Jeff Duntemann's Contrapositive Diary Rotating Header Image

programming

Daywander (Again)

I guess for symmetry’s sake I have to hand you two Daywanders in a row. Blame symmetry if you want; here you go:

It’s (almost) all good news. Carol is improving daily, though still using crutches for long hauls. Her foot hurts when she uses it too much. She’s about to begin physical therapy, which should help. And in three weeks she goes in to get the other one done. We knew this winter was going to be spent mostly at home, though neither of us fully appreciated just how at home we were going to be. Then again, dancing with that girl is as close to heaven as I’ll get on this old Earth. It’s not even three years until our 40th wedding anniversity celebration. Dancing you want? Dancing we’ll give you!

Our Lionel trains are up! It’s been several years, but with a little unexpected help from Jim Strickland, the Camel and the GG-1 are tearing around a longish loop that now surrounds both of our livingroom couches, powered by my formidable Lionel ZW. We put some liver treats in Carol’s 1959 hopper car, and of all the Pack, only Dash was willing to chase the train around and scoop the treats up out of the hopper. He was also the only one willing to grab Louie the Giggling Squirrel from the same hopper.

I find myself renewing an old friendship while writing a chapter on programming. (The book itself is largely about hardware.) Back in the early 1990s I spent a certain amount of time with Tcl/Tk and much enjoyed it. Visual Basic was brand new, and creating GUI apps was still mortal drudgery facilitated by the king of mortally drudgerous languages, C. In 1993, all you got with Tk was Motif. Funny to think of Motif as a bottom-feeder GUI now, when back then it was nothing short of breathtaking. Today Tk gives you native look-and-feel, and there are bindings for just about any language you’d ever want, and there are more computer languages these days than mosquitoes in Minnesota. I’m using a binding for Python called TKinter that basically gives you Tcl/Tk without Tcl. That’s good, since Tcl is a bit of a dud as languages go and the main reason I dropped Tcl/Tk like a hot rock when the Delphi beta wandered in the door at PC Techniques. Python isn’t Pascal but it’s way better than all the toothless C wannabees that represent the sum total of recent language research, especially JavaScript, the Woodrow Wilson of programming languages. If you just can’t bring yourself to use The Kiddie Language without falling into fits on the floor and drowning in the dog’s water bowl, well, Python and TKinter represent the easiest way to lash up a GUI that I’ve ever seen.

Then again, Delphi and Lazarus are just better.

Carol and I got the Christmas cards out today. It didn’t get done last year because Carol’s mom was failing and we knew we had only one more Christmas with her. Between Carol’s foot and my book project it almost didn’t get done this year either, but we’re trying to get back real life as life should be lived. Christmas cards are part of that. No complaints.

Bad news? Not much. I was pulling a pizza out of the oven a couple of nights ago, and fumbled the pan with my gloved right hand. Fearing that dinner was about to go jelly-side-down on the kitchen floor, my reflexes put my un-gloved left hand in the line of fire, and whereas I saved the pizza, it came at the cost of second-degree burns on two fingers and the thumb of my left hand. It’s not bothering me as much today as yesterday, and my typing speed is slowly getting back to my accustomed Thunderin’ Duntemann (Thanks, Fiona!) 100 WPM. But I promise you, the next pizza that gets wonky on me is gonna go jelly-side down, while I stand there and laugh. I may be 61, but I learn.

New featured pairing: Stilton cheese and Middle Sister Rebel Red wine. Very good news.

As most people have already discovered just sticking their noses out the back door, 2013 looks to become one of the ten coldest years in US history. It may not be global, but damn, it’s cooling.

And that, my friends, makes me look to my now-empty snifter of brandy and egg nog beside the monitor. Time for a refill. Long past time, in fact.

Daywander

As the temperature slides back down below zero (F) here, the supper dishes are done, and I lean back to savor the memory of home-made stuffed peppers, and for dessert a good sharp Stilton cheese chased with Middle Sister Rebel Red wine. It was very close to a carb-free meal, consisting of some 85% ground beef with a little rice to thin it out, mixed with salsa and scooped generously into some very Christmas-y red and green pepper halves. Oh, I’ll maybe have a little egg nog later on, the season being what it is.

What the season actually is, is early. I’m not used to below-zero temps two weeks before winter begins. It certainly hasn’t happened in the ten years we’ve lived here. I get screamed at every time I suggest that we may be entering a cooling spell on the Third Rock, but from all I’ve seen in the stats it sure looks that way. At some point my strongly suspected Neanderthal genetics may come in handy.

Carol’s still scooting around the house on her knee walker. She’s improving day by day but there’s still some pain that her surgeon will have to consider when we go back next week. I hung a little canvas pack on the knee walker so she can carry things around. My father brought the pack home from WWII, and it sat in a box in my mother’s attic until we sold her house in 1996. It then sat in a box in my sister’s garage for another ten years, until we unpacked it and I took it home. I have no idea what sort of pack it is, and if you recognize it (see above) give a shout. Now, the other mystery: How could something that old and neglected not smell? It doesn’t. It’s clean and looks almost unused. Whatever my father did with it back in the day, it’s become useful again. He would be pleased if he knew. Someday I hope to tell him.

I turned in a ginormous chaper today for The Book I Still Can’t Tell You About. I’m well over half finished with the gig, and certainly hope the next chapter won’t cast off to 55 book pages all by its lonesome. It’s certainly something to do while waiting for a quick trip outdoors to cease being a near-death experience.

Michael Covington mentioned to me that Lowes is now selling Meccano parts in those marvelous little bins of odd bits in the hardware aisle. I got up there a few days ago to take a look, and it’s true: A company called The Hillman Group provides little bags of zinc-plated steel girders, plates, and brackets, all with the Meccano standard 1/2″ hole spacing, the holes sized to clear an 8-32 bolt. They’re expensive compared to haunting eBay for beat-to-hell and incomplete modern Erector sets, but the parts can be damned handy. Here’s an Arduino-powered cat teaser built from some servos and Hillman parts.

Tomorrow I dive into Chapter 5. Should be easier, as it’s about programming, not hardware. Now, can we ditch this absurd obsession with curly brackets? What part of BEGIN and END don’t you all understand?

Odd Lots

Odd Lots

Odd Lots

Where’s the rest of SQLite?

Wait. Oh. That’s all there is.

Really.

I had this problem once before, with the Atlantis word processor. It’s 5MB installed. 5. The first time I installed it I suspected I had downloaded a corrupt file, but no: However they did it, the wizards over at Atlantis implemented a damned fine Word 2000 clone in 5MB. It doesn’t have the collaboration features, but for solo work it’s a very big win, and exports extremely clean epubs as a side benefit.

For a fair number of years now, my non-Delphi database work has all been in MySQL. (With Delphi I use a VCL product called DBISAM, which is linked into the compiled .exe and doesn’t have to be installed separately.) Because SQLite is available for the Raspbian OS and MySQL isn’t (as best I know; Percona runs on Arch Linux) I’m going to be using SQLite as a database teaching tool. So when I installed it the other day, I stared at the 600K .dll and wondered, Is that all there is?

Yes, that’s all there is, my friend–so let’s keep dancing. Let’s break out the tools and have a ball. ‘Cause that’s all there is!

Wow. I verified it by searching for the sqlite3.dll file on my system. The Calibre ebook manager uses an older version (as do a few other things) and the file was not only that same unbelievable size, but smaller. Can you implement a relational database engine in only 372K? I guess you can.

One reason SQLite’s .dll is so small is that it contains no UI at all. There’s a bare-bones command-line management utility available as a separate download. As some of you may know (or suspect) I dislike command lines intensely. So it wasn’t long before I had two free GUI management apps for SQLite databases. One was recommended by Chris Newman’s book on SQLite, SQLite Database Browser, and the other is SQLiteMan. Both are free and installed without drama. So far I prefer SQLiteMan, but it’s really too early to tell. SQLiteMan is supposedly compilable on the RPi. I intend to try that. I’ll let you know how it goes.

One other reason may be that SQLite is “typeless,” which means that the engine does not do type-checking on reads and writes. You can put anything you want in any field (apart from key fields, which are treated specially) and if it makes no sense, it’s your screwup on your conscience. I’m a strongly typed guy and this would rankle, if it didn’t allow a database engine to come in at half a megabyte.

There are wrappers for most common languages, including Lua and Lazarus/FreePascal, both of which I have here and have been fooling with in recent months. I’ve been very spoiled by DBISAM, and I’m interested to see how well SQLite works in non-server applications. More as it happens.

Odd Lots

Odd Lots

Odd Lots

  • I’ve installed Lazarus 1.0 without mayhem, and have created a few simple programs with it. So far, no glitches. My recommendation is still cautious. Nonetheless, I’d be interested in hearing other people’s experiences with the new release.
  • Carmine Gallo wonders why more people aren’t doing image-rich PowerPoint presentations. Um…it’s because drawing pictures is way hard compared to writing text. Why is there no mention of this either in the article or in the comments?
  • Here’s a great timesaver: Instead of making political posts on Facebook, point to this. Done! Effortless! (Link courtesy S. Hudson Blount.)
  • And if that doesn’t work for you, this may. (Link courtesy Jim Mischel.)
  • I guess the evidence is piling up: It’s time to stand in front of the bathroom mirror and ask yourself: Does this political opinion make my head look small?
  • I’m glad that somebody else besides me noticed that The Atlantic came back from the dead mostly by publishing articles calculated to raise people’s blood pressure. I was a very satisfied subscriber back in the 90s and early oughts, but I suspect now that I never will be again.
  • Don’t believe what the MSM says about volcanoes. Or about DNA. Or maybe anything else.
  • Maybe we can give them (the MSM) something for Christmas this year. And then tell them to put a sock in it.
  • The article I mentioned in my September 8, 2012 Odd Lots about transistor radio manufacturers tacking unused transistors onto their circuit boards to up the transistor count was in fact “The Transistor Radio Scandal” by H. M. Gregory, in Electronics Illustrated for July, 1967; p. 56. Some manufacturers used transistors for diodes, which was maybe half a notch better. The article includes some mighty weird schematics, too. Worth digging for, if you have piles of old mags somewhere.
  • If our understanding of solar physics is accurate, sunspots might become impossible (at least for awhile) by 2015 or 2020. (Full paper here.) The magnetic fields that create sunspots have been getting weaker by about 50 gauss per year for some time. Field strength is now at about 2000; once that value hits 1500 gauss, some research suggests that sunspots may not form at all. This is not new news, but it’s interesting in that it’s a bit of poorly understood science that most of us will live to see confirmed or falsified. At any rate, I’m guessing we will not be working Madagascar on half a watt into a bent paperclip again for awhile, as the late George Ewing WA8WTE used to say.
  • I’ve identified a new trigger for Creeping Dread: Hearing the fans incrementally rev up on what was assumed to be an idle computer.

Odd Lots

  • I hit a milestone the other day: 40,000 words on Ten Gentle Opportunities, which is at least halfway there and maybe (if I’m willing to settle for a 75,000 word story) more than halfway.
  • One of my readers sent a link to a page describing how to install the Insight debugger under Linux Mint. As my ASM freak friends will recall, I no sooner described Insight in Assembly Language Step By Step, Third Edition than Debian pulled it out of their distribution. Supposedly this method will also work for newer versions of Ubuntu. I need to test the repository under both distros, and will report when I do.
  • There’s a new nova in Sagittarius. (Is that redundant?) Mag 7.8–which is easy to see with binoculars, if you can separate it from the stellar mosh pit in which it appeared. Thanks to Pete Albrecht for the link.
  • Michael Covington sent a Google Ngram for the words “whosever” and “whoever’s” indicating that “whosever” has been on the run for a couple of centuries. It became the minority player about 1920 and has been down in the mud since about 1960.
  • Ok, I agree: This is the most brilliant kitchen gadget since the salad spinner. Or before.
  • I used to do this a lot, though I haven’t done it since 1977: pull the guts out of a photocopier. This guy’s blog, by the way, is news to me but should be on every techie’s blogroll. (Thanks to Jack Smith K8ZOA for the link.)
  • Haven’t heard much about software radio recently. Ars Technica just had a nice overview piece on it. The hardware keeps getting better, but all the promised weirdness (including new types of pirate radio) hasn’t happened yet. My theory: Wi-Fi is just a better weirdness magnet.
  • Foxconn is releasing a fanless nano-PC toward the end of summer, and I like the looks of it, at least if it’s got something better than an Atom in it. Roughly 7.5″ X 5.25″ X 1.5″. No optical drive. 5-in-1 card reader on the front panel. Under $300.
  • Talk about nutty brilliance for film promotion: RC drones in the shape of superhero-style flying people to hype the film Chronicle, which is evidently about…flying people. (Thanks to Pete Albrecht for the link.)
  • To inflate a Buckyball, just use a laser.
  • This sweet merlot (scroll down) was lots better than I thought it would be, especially for a hot summer evening’s barbecue. May be hard to find outside Colorado. No least hint of concord grape, for you mutant-blueberry purists. About $15.
  • Yet another sign that we may be winning the Fat Wars: Fat-free dressing is bad for you.
  • Still yet another sign may be that the grocery store near our condo outside Chicago carries a sort of spreadable lard called “smalec.” This is the best-kept secret in the food world; it took me ten minutes to even find a picture of it. It was brought here by Polish immigrants and is no less healthy than butter, though I have no clue as to its taste.
  • As if we didn’t have enough to worry about, well, the latest home hazard is swallowing loose bristles from your grill brush. My brush is at least five years old and failing. Looking for another technique. (Again, thanks to Pete Albrecht for pointing it out.)
  • This sure sounds like a hoax, but there could be a zombie apocalypse theme park in Detroit’s future. The concept suggests that time’s about up for the zombie craze, so I’d better get my novel (which contains dancing zombies) shambling on to completion before the whole thing caves in.