SonicBoomAu Posted August 12, 2004 Posted August 12, 2004 I am trying to convert the following "XXXnnnnn" into a barcode (where X stands for a alphabet character and n stands for a number) and therefore binary. Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
neodammer Posted August 12, 2004 Posted August 12, 2004 are the numbers and letters random? or are you going to assign each? Quote Enzin Research and Development
SonicBoomAu Posted August 12, 2004 Author Posted August 12, 2004 The letters and number will be random but the will always be in the same format Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
neodammer Posted August 12, 2004 Posted August 12, 2004 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim rand As Random = New Random Dim textconvert As String = TextBox1.Text Dim num1 As Int16 = rand.Next(65, 90) Dim barcodealph As String = Chr(num1) Dim nums As Integer = rand.Next(1, 10) MsgBox(barcodealph) MsgBox(nums) textconvert = textconvert.Replace("X", barcodealph) textconvert = textconvert.Replace("n", nums) MsgBox(textconvert) End Sub This might help you, what it does is first randomly generates a letter and a number 1-9 then I put msgbox's up there for just testing purposes.. then it converts all the X's into the randomly generated letter.. same thing then with n and numbers.. If you want each X and each n to have a different random letter/number just make a loop for that. Quote Enzin Research and Development
SonicBoomAu Posted August 12, 2004 Author Posted August 12, 2004 Sorry my mistake the number at alphabet are not random. I would gwet these values from a txtbox. Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
neodammer Posted August 13, 2004 Posted August 13, 2004 dim barcodealph as string = textbox.text textconvert = textconvert.Replace("X", barcodealph) thats all you need to do if your just replacing with a set letter. Quote Enzin Research and Development
SonicBoomAu Posted August 13, 2004 Author Posted August 13, 2004 Found out I was trying to re-invent the wheel. All I had to do was use a Barcode Font. Quote Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -- Rick Cook, The Wizardry Compiled
neodammer Posted August 13, 2004 Posted August 13, 2004 ahh yes that works also hehe however if its security your after, make up your own :) for stronger security Quote Enzin Research and Development
Denaes Posted August 13, 2004 Posted August 13, 2004 ahh yes that works also hehe however if its security your after' date=' make up your own :) for stronger security[/quote'] Security for what? He's reading barcodes. A barcode reader just reads the lines and transforms it into a code, then gives that code to the user. In supermarkets this is used on a relational Database to place orders (11003883 will pull up a can of soup for example). These are standardized things. I suppose if he were to create his own "non-upc" barcodes (upc's are standardized to avoid duplication from what I recall) to hold "top secret" information, then it might behoove him to make his own conversion/font. Usually this is done for sake of speed, not being secret agent man :) Quote
neodammer Posted August 13, 2004 Posted August 13, 2004 Maybe he wants to be a secret agent man :cool: **can hear james bond music** hehe. Btw can regular scanners scan bar code? Quote Enzin Research and Development
Denaes Posted August 13, 2004 Posted August 13, 2004 Yep. OCR (optical character recognition). It's 9,308% better than when I had my first scanner, but still makes mistakes though and isn't as quick as a laser. Really a laser barcode scanner (usb or parallel) is only like 30-50 bucks. Maybe more depending on quality and type. There is this site I nearly forgot about, you can have that scanner (or know the code) and logon and scan items from home, then after a certain point they'll send someone over with the items. Clunky for a webpage, but they're supposed to start building it into smart fridgerators where you just scan your items as you use them :) Quote
neodammer Posted August 13, 2004 Posted August 13, 2004 let me get this straight, you have the items and you run out..so you scan the barcode and this service brings it to your door with a bill? that would be pretty awesome. Quote Enzin Research and Development
Denaes Posted August 13, 2004 Posted August 13, 2004 let me get this straight' date=' you have the items and you run out..so you scan the barcode and this service brings it to your door with a bill? that would be pretty awesome.[/quote'] Well you scan things as you go, you probobly have your credit card attached to a billing account or something. You keep adding items, you can add/delete items, then click "Send Order" and they bring them to your house. I know ShopDirect brings groceries to your home. There is another model of refridgerator I'd heard about that constantly scans things inside of it. As you use them, it adds them to the list. Say you always have a can of olives in there. put one out, put one back, etc. Eventually you run out. It basically "learns" what you like and adds it to the list. In "theory" it's supposed to be able to be 'smart' like telling you that your milk is bad/low and other stuff. Boggles my mind. I can imagine it being like TIVO. Allows you to record TV onto a hard drive and it picks up on your viewing habbits and starts recording shows it "Thinks" you'll like. I remember a comic had a bit about TIVO, it started picking out shows that were really artsy and girlie then he was like "Oh my god! my TIVO thinks I'm gay!?" :D Quote
neodammer Posted August 13, 2004 Posted August 13, 2004 I wouldnt mind the first method just scanning items I need and then when ready hit "purchase" and have it delivered. On the other hand that fridge idea wouldnt be for me cause...i dont think we have evolved enough :D in the AI department for that Quote Enzin Research and Development
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.