BARCODEREVIEW READ FOR FREE WITH YOUR QL!

PLUS: ALL THE USUAL NEWS, LETTERS AND YOUR FREE REVIEWS.

Issue 3 2004 1 FREE 5 12647 86493 3 CONTENTS...... 2 CONTENTS You’re reading them! July is officially a “blue moon” month (or was that last month? I forget), which might explain why Barcode Review Issue, whatever issue it WIBBLE...... 3 is, has made an appearance. Barcode Review talks to the trees (literally) about new RFID Don’t be fooled by the new design, the content is as bad as ever, and the design itself was technology and the future of knocked up by two monkeys banging a barcodes. typewriter (f’nar - Ed). Oh, there are also no previews, reviews or celebrity interviews this month, mostly because I couldn’t be bothered LETTERS...... 4 (it has taken long enough to write the content The page that we hand over to you, that is in this issue, and most of that was our lovely readers. cut’n’pasted from email).

So, without further ado, and whilst still trying to FEATURE...... 5 think of how best to fill the rest of the contents Find out how to do barcode page, let’s get on with - whatever issue it is - of Barcode Review. scanning on your QL.

(How about a picture of the now-legendary NEXT MONTH...... 8 Ethernet T-Piece dog? - Ed) Good idea. And if you’ve read all that, don’t be deceived by the “next month” page, as Barcode Review has not and never will stick to any kind of schedule, monthly or otherwise.

CREDITS

Editor and anything else that doesn’t have a credit Chris Young Contributors Simon N Goodwin

An Unsatisfactory Software publication http://www.unsatisfactorysoftware.co.uk

Write to us at [email protected] You can make your own little T-Piece critter with six Ethernet T-pieces and a bent - © 2004, may not be sold for profit. clip for the tail. Created entirely with Pagestream on Amiga.

2 Barcodes are set to be replaced with RFID devices - little radio transmitters with all the cuteness of... something not very cute at all. This issue, Wibble takes to AN APPLE the streets and asks some inanimate objects what they think WIBBLE: So, surely you don’t also believe WIBBLE these evil electronic tags are good and our lovely, sweet, A TREE innocent and WIBBLE: So, what do you think of these RFID friendly things, then? barcodes are bad? TREE: Well, it’s good, isn’t it? APPLE: WIBBLE: Good? Well, it doesn’t TREE: Yes, really barcodes are affect us apples. printed on paper, which is made of WIBBLE: Why not? wood, which means the more of the APPLE: We don’t tend to get barcodes stuck to things that are us, just bagged up and weighed at the produced, the more checkout. of my cousins are chopped tragically WIBBLE: Oh. killed. RFID technology doesn’t use paper, so us trees can live on in peace. CELEBRITY BARCODES WIBBLE: (silence) COMPETITION TREE: Which is good for the environment. YES, FINALLY YOUR CHANCE TO WIN A BARCODE ENDORSED BY A CELEBRITY!

Barcode Review has exclusively obtained ten IN THE BINS barcodes from wok boxes, signed by Ken Hom!

The barcode found in the bin this issue All you have to do, is cook a chinese meal that was this faded and biological waste looks like a barcode, and send a photograph of encrusted little number. Yeurgh! the results to us.

Send your disgusting barcodes to the The finest ten entries received before the usual address. closing date of the day before this issue of Barcode Review was released, will win this piece of barcode history.

3 I had a whole bag full of barcode-related trivia from around the world ready for the letters page this issue. Unfortunately the dog ate it, so this array of rubbish that was sent to me several years ago will have to do. Send letters for the next issue to [email protected]

star letter but I’m not going to now. Ed

LETTERSI WANT A FREE BARCODE BATTLER KEEN ON BARCODES star letter could i have a barcode battler for free?ive been Roll on issue 3. And perhaps searching for one in mint condition for so you can mention the program long....could it be possible? that writes readable and Killer Chicken, email useful barcodes on a ZX (really) - I know it was No. before Your Spinclair time (in the halcyon days Ed of Your Spectrum, the Sinclair magazine that took more than a month to read) but see: GWOAA (snip - Ed) NN http://www.users.globalnet.co.uk/~jimg/yr04/yr04 Gwoaaaaaaaannnnnnn please print this letter _29.htm then i’ll be the envy of the school playing field!!!!!!!!!!!!! I suspect anyone strange enough to enjoy your go1gwya00, email mags might like this too. Any if you think I’m keen on barcodes (er, not especially, just keen I don’t know why the school playing field will be I guess) bear in mind that my brother Sam envious of you getting a letter printed in an worked the Casio format out by inspection, Internet magazine which only gets “published” then wrote the program to generate such once in a blue moon. I suppose it might go barcodes on the ZX printer on a 48K Spectrum green with envy but, erm, I doubt anybody with microdrives but some keys broken, so if would notice. he needed some keywords or glyphs he had Ed to:

HAIKU CORNER (1) MERGE a program containing the symbol Dear Sir, I wish to congratulate you on your required. most excellent publication. “Barcode Review” is (2) Find and edit the line with it in. like a breath of fresh air into the normally staid (3) Type the rest of the line round the symbol and predictable world of barcodes, and your (4) Delete the rest of the MERGEd stuff. magazine stands head and shoulders above such rival publications as “Which Barcode?” He can also read ASR33 paper tape by eye, and the contemptible “Barcode User” (spit, but anyone can do that, can’t they? curse etc). Simon N Goodwin, email P.S. Must get back to my 1.77 MHz Video I was greatly moved by Mike T’s haiku in issue Genie now. 2 and felt compelled to add my own to your esteeemed magazine: Thanks Simon, that fitted in quite nicely here and means I don’t have to give that haiku- Mark of the devil wielding maniac the Star Letter. Not that there On ev’ry thing you purchase are any prizes associated with the Star Letter, Argh! run away, shopper! it’s more of an ego thing. Hajo Spuuunup, email Ed P.S. Must get back to my tea and biccies now. You were doing so well, up until the haiku started to kick in. I was going to award you the

4 dozen key codes, as if they’d does not restore keyboard QCat - really been typed. operation. free bar Codes is the word; the Apparently CueCat does not code message consists of raw key work with the keyboard port FEATURE scanning up and key down messages, on the Q40/Q60 either, for for Qdos! prefixed by the PC code for hardware reasons. It appears ALT-F10, followed by encoded possible to adapt it for use Prompted by Tim Swenson data using four six codes with Hermes, Q40/60 and and Tony Firshman, I have for each three eight bit bytes, other Qdos compatibles with written a SuperBASIC driver interspersed with other one cheap chip, diverting its for CueCat barcode scanners padding. The first 18 bytes messages into a serial port, which are being given away you decode are the serial but I have not tried that; there for free by Radio Shack, the number of the pen, whcih are details - including a US chainstore known as doesn’t change. After that schematic, parts list and Tandy in Europe. They are comes a three-character construction photos - in the free because Radio Shack abbreviation indicating the -0.1.9.tar.gz archive on want PC owners to use them type of bar-code scanned, the web-page I mention at the to scan bar codes from their and the bar code value. end of this report. catalogue, to simplify online Usually this just consists of I inserted the CueCat I ordering. However they work digits but it’s potentially received into the PS2 just as well for other arbitrary text or even binary keyboard circuit for my Linux purposes, as Linux hackers data. box running Debian 2.4 and soon found out, and Qdos Armed with various notes and managed to swipe a few ISBN ones too! programs from the Linux codes, starting cautiously with These gadgets can be community it did not take me barcodes from persuaded to work with long to cobble together a published in the USA. Since original QL systems and Qdos SuperBASIC decoder. then I’ve scanned magazines emulators, and I expect with It appears that CueCat is not and many other types of SMS. I wrote and tested my compatible with product code into my Minerva software in UQLX, the free SuperHermes. But this does Qdos emulation. Qdos emulator for Linux, and not mean that it’s At first this swiping stuffed Timothy Swenson has incompatible with Qdos. If you gibberish into the Linux successfully read messages connect one to SuperHermes, keyboard queue, and hence from the CueCat into a QL keyboard input from the PC into window #0 in equipped with a Falkenberg keyboard collapses as soon SuperBASIC. The CueCat Keyboard-90 interface. as the CueCat tries to insert output is basically A CueCat is a bar-code its gibberish into the input alphanumeric, plus “+” and “-“ reader that daisy-chains onto stream. to make up the full 64 code an IBM standard PS/2 Normal input can be restored, set for six-bit values, plus an keyboard port. You plug a at least until the CueCat initial ALT-F10, a few full stops lead from it into the PS/2 chirps up again, by between sections, and a final keyboard socket, and plug the unplugging both keyboard and line-end marker keyboard into that. The CuCat (i.e. unplug the PS2 I opted for stripping out the full CueCat lights up but does keyboard adapter from the stops and some bytes from nothing till one of many Hermes, to reset both CueCat start and end of the input, and standard barcode formats and the keyboard). Just processing whatever was left. passes in front of it, at which unplugging the keyboard and My first version converted the point it spews out several leaving the CueCat connected data into binary, which was

5 simple but rather slow. Later I Turbo maintainer George Gwilt. managed to read the barcode condensed the program, There remains a risk that from the foil around a C90 eliminating the need for the INBYTE$ will read only the Goodmans chrome cassette. binary string and a slew of start of the message if it arrives CueCat doesn’t cope very well SELect lines. The first just as the timeout expires, but with small or glossy codes, but program, CueCat02_bas is the the timeout is adjustable and it I guess that doesn’t matter to easiest to read, but the second, is convenient to collect all the Tandy/Radio Shack. Another CueCat04_bas, is shorter and characters in one call falling EAN-13 that came up fine was faster. In case you wonder out nothing arrives. from the Amiga game UFO what you may be missing out Otherwise you could use Enemy Unknown, as on, CueCat01 was a prototype INPUT or Turbo Toolkit INPUT$ repackaged for that failed to decode some (without the third timeout Microprose/Acid Software by barcodes, and CueCat03 was parameter) which wait Guildhall. a hybrid used to check that the indefinitely for a line, or a loop But it won’t read the barcodes new code did the same thing containing INKEY$ calls to do on some other software in my as the binary version. much the same thing with more collection, including TurboText Anyhow, I fired up UQLX and code. All you want is to read a and Elite for the Spectrum verified that it could read input line of input from the keyboard. (about the only thing that used redirected from the CueCat. By The CueCat conveniently Lenslok other than the time it reached Qdos the sends an Enter character at the Supercharge). I suspect the message had three characters end of the stuffed string. problem with those is an on the front. These were 255, A bit more piddling around in interaction between the pen 250, 46, which starts correctly SuperBASIC got me code that and the old boxes, rather than for ALT and Shift F5 (aka F10) could read ISBN codes with the the barcode data formats. on Qdos, followed by a full stop five-digit suffix (that usually The UPC-A code on my old “.” that seems spurious. seems to be 90000 for books Caldera Open Linux Box set Stripping those four off and that I own) which CueCat was read OK, and got unpacking the lazy way with IB5, and the ISSN classified as UPA by CueCat. BIN and BIN$ (in the Quanta number from the front of Amiga Sinclair’s QL Classic library and PD Toolkit as well Active magazine (categorised Adventures box barcode as TK2, so viable for free code as IS2). scanned fine, as E13. So did development) I was able to It also read the IB5 barcode the barcode on Tascopy QL, extract a plausible CueCat ID from the ‘Macintosh which turns out to be an EAN from the start of the stuff it Toolbox Essentials’. I had to book code which might have inserted: I get ‘000 000 001 add a couple of extra lines to saved Tasman some VAT. 531 875 101' which is not quite get it to support ‘short’ bar Programs that listed in the Linux cuecat codes such as the bars on the The longer listing, kernel patch 0.1.9 document by back of the Supercharge box CueCat02_bas, decodes the Pierre-Phillipe Coupard but (and many other products) that entire base64 part of the was close enough to inspire return a base64 sequence that message from the CueCat, but confidence. is a couple of digits short in the only prints the type of barcode I used the recently-enhanced last 24 bit packet. This is the and the barcode itself. The DIY Toolkit function INBYTE$ reason for the ‘short’ test in the serial number of the pen is in to read the data, as I made a listing. scan$(1 TO 18) after each version with a convenient These EAN-13 (or E13 in successful scan. The second timeout parameter as part of CueCat terms) barcodes are listing skips that invariant my work on the Kodak digital the most common in general prefix, starting to decode from camera driver, with help from retail. After about 20 tries I the 27th byte of the message

6 from the pen, where the insensitive and CueCat uses CueCat02_bas barcode type is encoded. lower and then upper case CueCat uses a custom six-bit letters for the first 52 100 REMark CueCat code to ensure that any encodings; the - scanner for QDOS/UQLX message can be encoded into (CODE(c$)>“96")*26 part 110 REMark Simon groups of just 64 printable takes away 26 from the result Goodwin May 2002, v0:2 characters. Each clump of if the character is lower case, 120 REMark Uses P.D. four characters encodes three differentiating its code from BIN, BIN$, INBYTE$ arbitrary data bytes - 4 times that for the equivalent capital 130 REPeat wait 6 in yield 3 times 8 bits letter. I typed the alphabet 140 out. To make life a bit more backwards by interspersing k$=INBYTE$(#0,80,250) fun for hackers, the output left arrow presses while typing 150 IF k$>““ : EXIT bytes need to have three bits it in the normal order, as I can wait reversed to yield the correct remember it easily from A to Z 160 PRINT #0;”?”; code. I used the exclusive-OR but not the other way round. 170 END REPeat wait operation ^^ 67 to toggle bits DECODE64 does not give an 180 REPeat l: k=”.” 0, 1 and 6 in SuperBASIC. error message if the character INSTR k$ :IF k=0 :EXIT CueCat02_bas assembles a is not in the expected set, but l :ELSE k$=k$(1 TO k- 24 character binary string you could add this by 1) & k$(k+1 TO) from four bytes, using a checking for the value 64 185 short=(LEN(k$)-3) SELect structure to find a six before returning - valid codes MOD 4 bit pattern for each input byte are 0 to 63, and 64 means the 187 IF short THEN and BIN$ to convert that to six character C$ was not found in k$=k$(1 TO LEN(k$)-1) binary characters, then three the pattern. & “aaa” calls to BIN to extract eight bit Both programs work 190 scan$=”” values. CueCat04 skips the consistently here, and 200 FOR group=3 TO binary stage by building a 24 CueCat02_bas in particular LEN(k$)-1 STEP 4 bit value in the variable SUM should be easy for you to read 210 sum$=”” and splitting that up into three or modify if necessary. I 220 FOR c=0 TO 3 parts in the RECODE$ enjoyed the hack and am 235 sum$=sum$ & function, by division, grateful to Tim and Tony for BIN$(DECODE1(k$(group+c multiplication, subtraction and setting me up for it.. US Ql-ers )),6) INT operations. The DIV and should consider a trip to Radio 240 END FOR c && operators do this sort of Shack, especially if they have 250 scan$=scan$ & thing faster, especially in a PS2 keyboard on their QL- DECODEBIN$(sum$) compiled code, but those only clone. 260 END FOR group work with 16 bit integers. 270 PRINT “Barcode The DECODE64 function in (I was told to add some jokes type “;scan$(19 TO 21) CueCat04 replaces a dozen to this, but I thought the 280 PRINT “Value simple lines in CueCat02's biggest joke would be if “;scan$(22 TO DECODE1 with one people read it all the way LEN(scan$)-short) complicated one. It uses through expecting some jokes 370 : INSTR to find a character in a Ed) 380 DEFine FuNction string. It turned out to be DECODEBIN$(t$) easiest to do this if the Simon N Goodwin 390 LOCal r$(3) alphabet and digits appeared REFERENCE: CueCat hacking tips, programs and links online: in reverse order, because of http://www.beau.lib.la.us/~jmorris/linux/cuecat/ the way INSTR is case- – [email protected] AKA [email protected]

7 CueCat04_bas 400 r$=CHR$(BIN(t$(1 TO 8)) ^^ 67) 410 r$=r$ & CHR$(BIN(t$(9 TO 16)) 100 REMark CueCat scanner for ^^ 67) QDOS/UQLX - Uses P.D. INBYTE$ 420 RETurn r$ & CHR$(BIN(t$(17 TO 110 REMark Simon Goodwin May 2002, 24)) ^^ 67) Streamlined version 0:4 430 END DEFine DECODEBIN$ 120 REPeat wait: 440 : k$=INBYTE$(#0,99,250): IF 500 DEFine FuNction DECODE1(c$) LEN(k$)>50 THEN EXIT wait 510 LOCal c 130 REPeat z: k=”.” INSTR k$: IF 520 c=CODE(c$) k=0: EXIT z: ELSE k$=k$(1 TO k- 530 SELect ON c 1)&k$(k+1 TO) 540 =CODE(“a”) TO CODE(“z”) 140 short=(LEN(k$)-3) MOD 4 550 RETurn c-CODE(“a”) 150 IF short THEN k$=k$(1 TO 560 =CODE(“A”) TO CODE(“Z”) LEN(k$)-1) & “aaa” 570 RETurn 26+c-CODE(“A”) 160 scan$=””: FOR group=27 TO 580 =CODE(“0") TO CODE(“9") LEN(k$)-1 STEP 4 590 RETurn 52+c-CODE(“0") 170 sum=0: FOR c=0 TO 3: 610 =CODE(“+”) : RETurn 62 sum=sum*64+DECODE64(k$(group+c)) 620 =CODE(“-“) : RETurn 63 180 scan$ = scan$ & RECODE$(sum) 630 =REMAINDER 190 END FOR group 640 PRINT #0;”Character 200 PRINT “Type”!scan$(1 TO ‘”!c$!”’ CHR$(“!c!”) not in CueCat 3)!”Value”!scan$(4 TO LEN(scan$)- set” short) 650 STOP 210 : 660 END SELect 220 DEFine FuNction DECODE64(c$) 670 END DEFine DECODE1 230 RETurn 64-(c$ INSTR”- +9876543210ZYXWVUTSRQPONMLKJIHGFEDC BA”)-(CODE(c$)>“96")*26 News about 240 END DEFine DECODE64 barcodes 250 : 260 DEFine FuNction RECODE$(t) Previews of 270 LOCal t1,t2,t3 forthcoming 280 t1=INT(t/65536) : t3=t- barcodes t1*65536 290 t2=INT(t3/256) : t3=t3-t2*256 Reviews of newly 300 RETurn CHR$(t1 ^^ 67) & launched barcodes CHR$(t2 ^^ 67) & CHR$(t3 ^^ 67) NEXT MONTH 310 END DEFine RECODE$ Features about barcodes

And more stuff about barcodes than you can shake a cat at, in the biggest free on-line barcode magazine with the name “Barcode Review”

Out at an undetermined point in time

8