Slashdot Mirror


Resurrect Your Old Code With a DIY Punch Card Reader

First time accepted submitter mchnz writes "Need to read in some old punch cards? Have a hankering to return to yesteryear? I've combined an Arduino, the CHDK enhanced firmware for Canon cameras, and the Python Image Library to build a reader for standard IBM 80 column punch cards. You can see it in action in "Punch Card Reader — The Movie" or read more about it." This is an inspiring, intimidating project.

30 of 100 comments (clear)

  1. I'm lazy by jmorris42 · · Score: 3, Interesting

    I'm too lazy for all that lego building. If I needed to read punch cards I'd just find a scanner that would accept media that narrow and feed em through the ADF, feed that PDF into a script to pop apart the pages and then process the images.

    --
    Democrat delenda est
    1. Re:I'm lazy by narcc · · Score: 2

      I was kind of hoping for some pin-based contraption. I mean image based is obviously the better way to do it, but still..

      Pin-based contraption? Easy there Hollerith, it's not 1890 any more! Put down that abacus, we're not dropping pins through holes in to cups of mercury these days.

      Check out the IBM 2501 -- it's optical, sweet-cheeks -- You can't do >500 cards/minute with one of your antique mechanical reader! Get with the times!

  2. Make a Phone App by na1led · · Score: 2

    I bet most Android / iPhone cameras could scan those cards easily enough.

    --
    -- By all means let's be open-minded, but not so open-minded that our brains drop out.
  3. That's cheating! by gallondr00nk · · Score: 4, Interesting

    I was expecting something that mimicked the original way these cards were read. Anyone can take a photo of a punchcard :)

    1. Re:That's cheating! by Chris+Mattern · · Score: 4, Insightful

      Digital electronic overtook mechanical decades ago--that's why punch cards aren't used any more in the first place. It therefore follows the smartest way to deal with any problem of this sort is to get it converted to electronic ones and zeros as quickly and simply as possible, no matter how dirty, and then process the digital data to get what you need. In this case, that's getting a digital photo of the punchcard, and then doing your work on that.

      Anyone can take a photo of a punchcard

      Indeed they can (don't forget to use your wooden table!). Then doing OCR on that photo to extract the data the punch card contained is a little more involved, however.

    2. Re:That's cheating! by adisakp · · Score: 3, Insightful

      It's a cool project but it'd be more cool if it didn't require manual intervention (turning a crank per card). How hard would it be to add a servo controlled motor to turn that crank so the entire process could be automated?

    3. Re:That's cheating! by FitForTheSun · · Score: 2

      Only in rare circumstances. I recently heard a program about a guy who was trying to solve the Pioneer Anomaly, and he had to go find old boxes of punch cards and convert that data, in order to determine the spacecraft's exact positions when it was still in the Solar System. But yeah, pretty rare.

  4. OK, show of hands ... by gstoddart · · Score: 3, Interesting

    OK, this is really cool ... but how many people still have decks of punch cards?

    The closest I've been to them is a box we had of them we used for notes.

    Though, given the level of technology pack-rats we likely have on Slashdot, I expect several people to say they still have some cool program or another tied up neatly waiting for just such a thing. :-P

    --
    Lost at C:>. Found at C.
    1. Re:OK, show of hands ... by rasper99 · · Score: 5, Interesting

      I have punch cards on my desk at work so I can remember back to a time when computers and software worked reliably. Why read the holes if the keypunch machine printed the characters above the columns?

      I also have the heads and voice coil from a 185MB CDC removable disk drive (approx 15" long) in case I have to smack some young whippersnapper upside the head!

    2. Re:OK, show of hands ... by Antipater · · Score: 2

      My doctoral thesis was a punch card program that could beat the world's best players at Tic-Tac-Toe. I still keep it around, next to my degree from Springfield Heights Institute of Technology.

      --
      Everything is better with chainsaws.
    3. Re:OK, show of hands ... by Teresita · · Score: 2

      You kids don't know how good you got it with your newfangled "punch cards". Why, back in my day we had to use cuniform, on clay tablets. The BC2AD abacus bug made your "Y2K" problem look like a glitch.

    4. Re:OK, show of hands ... by Gaygirlie · · Score: 2

      You kids had it easy! Back in my day we scrawled our programs on the cave walls and had to relocate ourselves fully if we ran out of storage space. Not to mention that back then bugs actually meant bugs the size of your head!

    5. Re:OK, show of hands ... by icensnow · · Score: 2

      Walls? You had walls? Why, in my day, when we hadn't crawled out of the ocean yet, we had to position ourselves under the computer, blow an air bubble for 0 and make a little vortex for 1, and watch them rise into the reader. A large fish passing by could cause a transmission error that would make us start over from scratch.

    6. Re:OK, show of hands ... by Lumpy · · Score: 3, Interesting

      I service a CNC machine at a machine shop that STILL uses paper tape. I am the only guy that will touch the old hardware so I get paid $150 an hour to tinker with the stuff. Hell they cant find a IT company that can handle DOS so I also pick up the other old machines.

      I love it, 1 long afternoon/evening there and I go home with $1000 in my pocket.

      --
      Do not look at laser with remaining good eye.
    7. Re:OK, show of hands ... by Nimey · · Score: 2

      Luxury. We had to create the entire universe ourselves just to make an apple pie from scratch!

      --
      Hail Eris, full of mischief...

      E pluribus sanguinem
    8. Re:OK, show of hands ... by 1u3hr · · Score: 2

      I have punch cards on my desk at work so I can remember back to a time when computers and software worked reliably.

      Reliably? I have very unfond memories of my student years, the night before a project was due, standing in a queue in front of a bank of card readers waiting to run my Fortran or Cobol program. Then when the reader chewed up a card, going back to make a new card and waiting another 20 minutes to try to read it again. All the time the card readers were heating up and one by one stopping dead, so the queues got ever longer.

      In second year we were granted the privilege of using a keyboard with attached line printer and entering the program with a line editor. And in third year we could use an actual CRT monitor and could use vi.

      Card readers weren't quite Spock's "stone knives and bearskins", but close.

    9. Re:OK, show of hands ... by plover · · Score: 2

      I service a CNC machine at a machine shop that STILL uses paper tape. I am the only guy that will touch the old hardware so I get paid $150 an hour to tinker with the stuff. Hell they cant find a IT company that can handle DOS so I also pick up the other old machines.

      I love it, 1 long afternoon/evening there and I go home with $1000 in my pocket.

      This bothers me. You could easily replace the paper tape reader with a computer based solution - all the paper tape readers we had on our CNC machines 25+ years ago were interfaced with ordinary DB-25 RS-232 connections. Back then I just stuck a BlackBox short-haul modem on them to run the wires back to the foreman's office, where the other modem was plugged into an original IBM PC. A simple GW-BASIC serial program allowed them to load and store their programs to a hard disk, which was backed up nightly. It wasn't rocket surgery back then, and I have to believe the state of the art has advanced a little bit in offering hardware and software choices to do this today.

        A Raspberry Pi and software from sourceforge would cost less than an hour of your time, and would open them up to lots of possibilities, not the least of which is insurance against something unfortunate happening to their only support person.

      --
      John
  5. Horribly inefficient by Dynedain · · Score: 2

    Why not use a desktop scanner with a feed tray and process that? Eliminate the need for the fancy camera rig, arduino, legos, etc.

    You could still do all the python processing, but it would be far mor efficient and less prone to bugs.

    --
    I'm out of my mind right now, but feel free to leave a message.....
    1. Re:Horribly inefficient by Antipater · · Score: 5, Funny

      I'm confused.

      Why would you want to use fewer legos?

      --
      Everything is better with chainsaws.
  6. I don't get it by slashmydots · · Score: 2

    I'm 25 and I play a Sega Genesis emulator sometimes because those old games bring back fond memories and had such a different play style and difficulty. That's sort of the difference here. Who the hell had anything positive to say about punch cards back in the day that would make them want to experience it again? Fires, drops, manual collating, 1 missing card...everyone hated them! Nobody is going to say "oh wow, this is so fun just like back in the day" because it wasn't; it sucked.

    1. Re:I don't get it by gstoddart · · Score: 3, Interesting

      Because, like anything, if you were there for it, you might have some nostalgia for it. It's something you did that most people can't even imagine having to do -- like programming in assembly, or walking to school (uphill, both ways).

      I had a prof in university who used to wistfully tell me about toggling in the boot sequence with the buttons on the front of the machine. Hell, he once gave me the manual for the Winchester ST-506 hard-drive controller, and had me write the metal-up code to handle the HD -- about as bare metal as you can get as you shoved a byte into a register and wait for an interrupt to happen to respond to it. I still think that was kind of cool, but it's not something everybody wants to do. But, I gotta say, writing my own cat, ls, rm, mv etc in DOS going straight into the FAT filesystem, and knowing there wasn't a single line of code between me and the hardware I didn't write was fun and rewarding.

      I bet most people using computers never had to deal with IRQ assignments for hardware to make them all work together. It was a pain in the ass, but we all fought through it.

      And, finally, like so many of these technology projects "because I can" is sometimes all the reasoning you need. People do all sorts of stuff in their spare time, and one person's "shiny fun toy" is another person's "WTF would you do that for?".

      --
      Lost at C:>. Found at C.
    2. Re:I don't get it by Samantha+Wright · · Score: 2

      I'm pretty sure the average veteran of punch-card computing was more tactilely aware than a young adult of today like you or me. Missing or dropping a card would've been more rare—and there actually were automated sorting machines, some of which had very clever was of mechanically implementing mergesort.

      Not all nostalgia is exactly about the same kind of fun, though. Once you got past the nittiness and the grittiness of how the code was written (i.e. generally in a very limited compiled language, or assembler) the machines behind them were much simpler. It was possible in those days for a single person to be knowledgeable in CPU architecture and operating system design, and still be on the cutting edge in artificial intelligence. Because of that comparative simplicity, the opacity of the tools used to program the computers felt less like a chore and more like a game; c.f. the Story of Mel. The rules were different, code and UI style didn't exist, and the sophistication of a good hack reigned supreme.

      As a result, every modest and large program for these older systems was like a little shining gem. A programmer felt proud if something they wrote was well-designed, or shared amongst computer users, or accomplished its work in a particularly clever and memory-saving manner. I think wanting to preserve those accomplishments and memories of one's glory days is at the root of all this.

      (And they said computer history would never amount to a degree program—foo to them, say I!)

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  7. IBM Interpreter by Sporkinum · · Score: 2

    Takes me back to my old Air Force days as a computer operator. Had to run decks through the 558 twice, replacing the wiring panel, to interpret all 80 columns.
    http://www.columbia.edu/cu/computinghistory/interpreter.html

    --
    "He's lost in a 'floyd hole"
  8. All my best code is on paper tape by ackthpt · · Score: 2

    You insensitive clod!

    --

    A feeling of having made the same mistake before: Deja Foobar
    1. Re:All my best code is on paper tape by PPH · · Score: 2

      Just like the British Colossus. Interesting note: The CPU clock was taken from the input paper tape sprocket. So you could 'overclock' the system right up to the point at which the tape would break.

      --
      Have gnu, will travel.
  9. My favorite part about this video. by Guano_Jim · · Score: 4, Insightful

    When I hit that video the first time, the first couple of comments on that video aren't "cool!" "nice job!" or anything resembling constructive criticism. It's all "this is the wrong tech for the job" "seems like a hell of a lot of effort just to read what's already on the top of the card," etc.

    Haters gonna hate, I guess. But what ever happened to just enjoying a hack for a hack's sake?

    I think it's clever. Who cares how much time the guy spent, what technology he chose, as long as he enjoyed doing it.

  10. Kinda Slow by twmcneil · · Score: 3, Funny

    Compared to the real thing, this is a wee bit slow. But of course I threw out all my punch cards years ago. They warped so bad in about 12 months time that they would jam the reader.

    Quick way to win friends, jam the reader with about 15 people behind you.

    Now get off my lawn!

    --
    "The ferrets, they're every where I tell you!"
  11. Does it read hanging chads? by tomhath · · Score: 2

    Just wondering, in case it's ever an issue.

  12. Re:Now do the same for hard drives. by Ungrounded+Lightning · · Score: 2

    The earliest drives (RAMAC and the like) also had integral disks (with the spin motor integral inside the hub - with spare windings so you didn't lose your data if one burned out). But soon after that they went to removable packs, which was the way it worked for a while, with "washing machine" drives and "single platter in slot" drives.

    But they had a lot of problems with contamination. And as the bits got closer together and the heads flew lower they were running into a serious issue.

    The breakthrough came when IBM noticed that it had built less than twice as many packs as it had built drives. Turns out that the usual usage pattern was not to swap packs, but to do backups by copying to tape and to do "swaps" by copying tape to disk. Tape was far cheaper per bit than disk packs.

    So they realized they could solve the contamination problem by having a sealed unit. The first version had the platters, heads, and cooling air filters in a sealed uint but the motors and actuators were external. The "packs", with heads and such, were still swappable. It also moved the heads to a parking area and let them land on the disk, rather than having a complex mechanism to lift them off the surface when shutting down. This was the "Winchester" - which became a generic term for head-landing disk drives and then for disk drives in general.

    But electronics was getting very cheap and the mechanical connection to the external machinery was still problematic. So two generations later they went for an integral sealed unit with motors, actuators, and an electronic board. Thus was the current paradigm born. And with economy of scale and even tighter tolerances it has stayed that way until now (when semiconductors are finally looking to push disk drive technology into end-of-life).

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  13. One terabyte in boxcar-fulls of punched cards... by jabberw0k · · Score: 2

    A now-common one-terabyte disk drive, represented on punched cards, would occupy a cube approximately 15.3 metres (50 feet) on a side... similar to a decently sized five-story building, and would have a mass of over 34,000,000 kilograms.

    If loaded into standard U.S. railroad boxcars, that one terabyte would physically fit inside 17 boxcars but because of weight would have to be divided amongst 631 boxcars (each boxcar being rated at 60 tons, or about 1.5 terabytes' worth of punched cards). That works out to a freight train over seven miles long.