Where I’ve been

Here’s a story about what I’ve been doing and thus not doing any posts. My usual whines about craziness in the news has gotten boring (to me, probably boring to you, Dear Reader, a long time ago). Certainly there is still an ample amount of craziness to blog about, esp. with politics in full swing (lots of ridiculous stuff there) but I’ve been totally absorbed into programming projects for my personal fun.

You see I am a ‘hacker’ in the original sense of the word. Today we use ‘hacker’ as malicious person who does cybercrime, but in the original days (back when computers were expensive and not readily available) some of us geeks liked to play with computers just for fun. After all they were new and almost any idea you had was “original” (today it takes huge teams and lots of money to do something “original”) and you could do cool (at least to geeks) stuff with them.

So, for instance, as a couple of examples, back at MIT in the 1960s computer were expensive and huge and hard to get time on them (of course with batch card programming, hey kiddies, any clue what a punch card is, or assembly language). So MIT built a prototype computer for the military that had very primitive graphics. So naturally it was a great toy. So a fellow by the name of Ivan Sutherland created the very FIRST paint program and it was super cool, despite the awful graphics (flickered like crazy and had a round distorted tube, B&W naturally). Ivan was a very clever guy (later forming his own company to build flight simulators but also building one of the first (if not first) walking robot) but he was in the right place at the right time, i.e. nobody had done this stuff before and he had access to a zillion dollar computer that was unique (who knows what his day job was on that computer that allowed him to invent fun stuff in the wee hours of the morning). btw gamers, the very first graphics computer game was done by other hackers on that same machine, a primitive version of Asteroids, that almost got them kicked out of school as this otherwise outstanding students became so addicted to creating games (not playing them) their studies seriously slipped.

A group of my friends found an unguarded IBM 1620 (in the wee hours of the night when the real users had gone to sleep). There is probably no microprocessor chip in existence today, no matter how cheap, that is as primitive and limited and SLOW as a 1620. But it was our toy and that’s where I got my start programming, before most people (even students at MIT), had even seen a computer (imagine how fun it was decades later when I got my first PC, something kids take for granted today). One of the guys had a transistor radio (hey, streaming music crowd, that’s how you used to play music). It turns out the clock frequency of the 1620 (i.e. about 1Mhz, not the multiple Ghz of today’s PCs or smartphones, or now even watches) which meant it created static on the transistor radio that was on the console. This clever chap realizes that certain loops in assembly language code modulated that static and created crude musical notes (take that Ray Kurweil with your fancy synthesizer, we did it first, never saw you hanging around the 1620). Make each note’s code a subroutine, execute the subroutine the right amount of time and now you have 1/2 notes and 1/4 notes and so forth. Change the frequency and string those together and you’ve got music. That took many weekends of programming to get a simple song (no idea if this was a first).

So, Dear Reader, you can possibly see why playing with early computers was the drug of choice for us hackers (that term came from (and today sometimes is still used the same way) as code that was thrown together without any real design or plan, but kinda worked; also it means devious tricks to get something to work in a non-obvious way, which is what today’s hackathons are all about).

So decades later, being much more skilled and experienced, but with less youthful energy, plus having learned software engineering disciplines (and instilled in my talented but inexperienced teams) I’ve gone back to hacking. Of course it’s much easier now – hugely powerful and fast machines with great development tools that I actually own (and tons of reference information at my fingertips on the Net). Plus I’ve got all this free time in the idleness of my retirement, esp. in winter in Omaha where going outside can be life-threatening.

So after the long preface here’s my story. I’ve been looking for something else to do besides fiddle with computers, i.e. some hobby with real world objects (weaving is appealing but has numerous drawbacks, like being expensive, whereas doing something on computer, esp. computer graphics is effectively “free”). So in looking at various crafts I stumbled on one of the new (to me, at least) fads – adult coloring books.

Now for the most part these aren’t interesting to me (wasn’t very good at coloring as a kid, could never stay inside the lines, hated be required to just follow someone else’s design; not to mention sloppy and made lots of mistakes that are hard to change). So naturally: a) the more geometric drawings are more appealing to me (mandalas and tessellations) , b) actual coloring, even though it’s supposed to be stress relief and relaxation, is not fun for me, but of course programming is, and, c) ah-ha, do this on a computer and mistakes can be undone and colors can be changed when they’re not working out right (I may not have the visual imagination to plan coloring (those last bits I’ve run out of the right coloring pens), but I can “prefer” some coloring over others when I see it finished.

So, naturally I combined with what I like to do for fun (hacking) with my lousy coloring skills (but good and trial-and-error) and, bingo, I’ve got a nice time wasting hobby to do.

And when I get in a groove, like I’ve been for several weeks, I hardly come up for air. Food, the gym, personal hygiene, washing dishes, talking to anyone, sleeping – all these disappear until I’m so exhausted I have to stop, even with a little energy left to blog about it (good training for jobs in Silicon Valley, all those late nights secretly hacking the 1620 got me used to marathon programming sessions until I drop).

And my program is (and the fun too) is that one thing leads to another. I thought I could just use PhotoShop to color. Nope, wrong! That’s not what it is supposed to do (damn you, Adobe, anti-aliasing is bad news for the black outlines and your magic wand fails tracing outlines in lower resolution pixel drawings). Plus the downloaded image was crummy and full of problems.

So before I could write a coloring program I first had to prep some samples of color books I found online (in low resolution, with as I found the hard way, many defects in the image). So after a couple of days diddling in PhotoShop, then hacking my own code to fix the problems PhotoShop created (or precisely changing one pixel at a time) I have, ta-da:


Now I don’t claim this particular coloring is very attractive but that’s not the point. Every pixel of similar objects is EXACTLY the same color and the outlines are black, not blending with the fill colors as Photoshop did, plus the colors are visually far enough apart that my eyeballs and code can uniquely process them.

So after several days of nonstop work to get this image at last I could start on the coloring program itself. Click a color somewhere and poof it changes everywhere, as shown in this small section (again, not claiming good coloring, just the test case):


So, fine and dandy. Now I had my proof of concept so now it’s mostly improving the coloring program itself (I’ve got a big pile of specs now, my more professional approach to software rather than just hacking away). And the ordeal I went through cleaning up the download image and getting each region exactly the same pixel values allowed me to write an even larger spec (for a generalized cleanup downloaded image effort). So a big backlog of work to get done before getting to some results, i.e. colored drawings (but who cares about the end results, it’s the fun going on the journey)

But along the way I noticed something (and oh how the web is wonderful for doing research). This particular type of drawing is high geometric, loaded with symmetries and mostly just placing simple objects, transformed and replicated along some path, but there came the rub. Many of the elements are just placed on circles, easy-peasy (to rotate, step and repeat – can see the UI now to do it). But other paths (like the pseudo-heart shaped thingee) are just a wee bit more complicated. And I’ll get to that later.

But there were two problems about downloading images from the Net (I understand some of copyright law, so just coloring them myself, as long as I don’t publish, falls under Fair Use part of the law): a) none of the samples I could find were very high resolution, meaning the details are really yucky (OTOH, so-called resolution-independent graphics could go through all the transforms and step-and-repeat before turned into crude bitmaps, but also the bitmaps could be much higher resolution if generated by code (and thus have fewer defects to remove with clumsy tools and tedious effort). So I can find an ample supply of raw drawings to keep me busy coloring but what’s the fun in that when there is programming that can be done.

So my original idea of just coloring (with my program I’d have fun writing and can easily visualize) downloaded drawings ballooned into another idea, that is to create a design program to create the drawings (those of the highly geometric type) and easily vary “parameters” of the drawing (given some meta-description in math that actually renders the drawing) to get variations that might be more interesting. That program is challenging effort, but then I realized I’d need an entirely different program to create resolution-independent sub-elements (like the six-petaled flower in the example, or the flames, or whatever tickles one’s fancy to place in the overall design). Boom, now I’m inventing Adobe Illustrator and that’s a bit non-trivial to do as a hacking project. Plus I’d need at least simplistic shape “catalogues” (somewhat equivalent to photo album software) to save my ever-expanding set of simple objects. And there’s a really intriguing and hard problem, suitable for Google’s massive compute power and talented people – figure out an automatic organization of many tens of thousands of shapes based on their features (listening Google, or maybe Watson team at IBM).

Now actually I’ve written drawing programs before (long before there was an Adobe Illustrator (and I wrote Photoshop (at least some of it) long before there was a PhotoShop, as like Ivan Sutherland with the TX0 at MIT in the 1960s inventing Paint I had a real dayjob that gave me access to one of the first real-color design systems that costs hundreds of thousands (as in I managed all the software for it and could appropriate for play and realized I could do stuff I’d done in a real darkroom with chemicals and enlargers and masks and double exposures and all that messy stuff from the analog world)). So, IOW, I know the magnitude of the task I was about to start, far beyond my endurance of a blast of hacking.

So, and I’ll do another post as this one is already too long, I thought about a different approach (that tedious drawing of multi-segment line/ellipses/Beziers that Illustrator does) that comes from another hack (i.e. toy and useless program except for the fun of creating it) from my grad school days. Some slightly bizarre use of some math (parametric expressions for various periodic functions) to create dancing shapes on screens (you’ve seen plenty of them if you’ve ever watched old B&W scifi movies), i.e. Lissajous).

So, to recap, one idea led to one program, which led to another program, which led to another, a fun house of mirrors of infinite regress. But at last I think I’ve hit bottom and that will be the next post (or at least of this series as my hacking continues).

So maybe you’ll wish I’d go back to boring exercise stats and virtual trips and rants about current affairs, but instead you’re now stuck with the zany activities of a hacker with too much time.

Hint for next post – where did this dousy come from?




(To be continued)


About dmill96

old fat (but now getting trim and fit) guy, who used to create software in Silicon Valley (almost before it was called that), who used to go backpacking and bicycling and cross-country skiing and now geodashes, drives AWD in Wyoming, takes pictures, and writes long blog posts and does xizquvjyk.
This entry was posted in comment, musing and tagged , , . Bookmark the permalink.

One Response to Where I’ve been

  1. leggypeggy says:

    You have been busy.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s