Jeff Duntemann's Contrapositive Diary Rotating Header Image

programming

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.

Odd Lots

  • The mysterious X-37B has returned to Earth after 468 days in space, evidently without a scratch. One of the comenters on the many space hobby sites I read suggested something interesting: The spacecraft might be considered a “retrievable satellite” that can stay in orbit for years at a time, then shimmy down the gravity well for a refurb when necessary before being launched to orbit again. (Thanks to Frank Glover for the link.)
  • The secret to an successful programming language may be a good…beard.
  • Here’s a nice, short, practical piece on password security. In case you haven’t heard yet, a long password of concatenated plain English words (“correct horse battery staple“) is better than a shorter password of unmemorizable gibberish.
  • Why 419 scam emails claim to be from Nigeria and are written idiotically, as they’ve been for years’n’years: It’s a stupidity filter. Only the spectacularly gullible would now reply to one, which maximizes the chances that the respondents will actually fall for the scam. Damned clever, these Nigerians.
  • Here’s yet another assault on wine snobbery.
  • I’m closing in on 60, and in my life have known a fair number of redheads. Not one of them would I describe as “fiery.” Not one. The cliche has become widespread enough that we recently discussed it as such in our writing group. (Most of my heroines have black hair, which seems more exotic to me.) Now that Pixar has anointed the cliche in a new film (rough language alert) might we hope that redheads will now be given some slack? (At least it’s a film in which the folks with Scots accents are actually Scottish.)
  • Speaking of redheads…there is some science now suggesting that the Neanderthals may have been gingers.
  • Speaking of Neanderthals…in my note-taking for a possible novel called The Gathering Ice, I suggested that Neanderthals (who hide in plain sight, and have done so for 50,000 years) refer to themselves as “the Uglies” and to the rest of us as “the Saps.” Now I learn that Graham Hancock uses “the Uglies” to describe the Neanderthals in his 2010 novel, Entangled. Bummer.
  • Double bummer: There is a YA teen series called The Uglies. Not about Neanderthals, though. Still, having twice been outgunned on the term, I’m considering renaming my Neanderthals “the Plugs.” Could work.
  • The anomalous cold snap called the Younger Dryas 12,000 years ago figures into the backstory of my Neanderthal yarn. It’s still unexplained, as this article maintains, but it sure looks like a phase-transition stutter to me, as Earth’s climate was changing from its cold state to its warm state. I’ve often wondered if we are now in the thick of a phase transition from the climate’s warm state to its cold state. (Such a stutter is the main gimmick in The Gathering Ice.)
  • This was utterly news to me: Parts of New York City have a vacuum-driven garbage-collection system that literally sucks trash through pipes under the streets to a central disposal location–and has had it for 35 years.
  • The email subject read “Your parcel is expecting of receiving.” Its parcel was expecting of delivering trojan. My delete was delivering of action. Alreet!

Odd Lots

Odd Lots

  • It’s been a rough week here (hence the current post paucity) and I just got Carol on a plane to Chicago to look after some unexpected family issues. As we left the driveway it was snowing like hell again, this on the morning of May 15. Even today, halfway to lunchtime, it’s still gray-grim and 39 degrees. I guess it’s going to be another indoors week. Much planned for coming days, including the ebook release of Cold Hands and Other Stories. Stay tuned.
  • I stopped in Denver on the way home from the airport to pick up some Elfa parts to expand the shelf system in the back of our garage. It’s an Erector set for storage, and if you don’t know about Elfa I think it would be worth taking a look. I have a hodgepodge closet in my workshop downstairs that desperately needs to be Elfa-whacked, and it’s on the project list for this summer.
  • I used to spend a lot of time poking around in Google Earth, mostly looking for abandoned railroad right-of-ways near where I’ve lived in the past. Since then The Daily Google Earth has appeared, full of interesting things visible from space. Today’s desert triangles post intrigues me, since my parents bought land in that general area in the 1960s and I still own it.
  • Carol and I have moved incrementally to CFLs as our incandscents have died, but the can fixtures we have in our ceilings are too narrow to pass the necks of CFL floods. Alas, this promising new technology won’t fix that (the necks are, if anything, wider) but it’s a promising alternative to incandescents and doesn’t contain mercury. As the author suggests, it won’t be long before the Maker community figures out how to focus the output into a beam and perhaps even scan it across the bulb’s face.
  • I’m not generally one for weird case mods and exotic custom cases, but this Priarie School item engenders a certain amount of lust. I also realize that I could easily make a case of Stickley-style dark-stained quarter-sawn oak–not that I need another thing to do. Would be killer cool, though.
  • As a programmer guy with old roots in embedded systems, I feel a very deep itch to try the Android Open Accessory Kit. Alas, as an SF writer with only so many hours in the day, I may not get to it soon. But I greatly rejoice that it’s even possible.
  • The data caps issue has gotten to the WSJ, which probably means that it’s off geek turf and Really Quite Sincerely Real. What few people are talking about with respect to ISP data caps these days is the perverse incentive they present for video piracy: Why pay an additional “bandwidth tax” on your favoite films each time they’re streamed when you can download them once and watch them any time you want without further payment? This has always been the case, but moving to a metered Internet only makes it worse.
  • From the ‘Bout-Damned-Time Department: Samsung’s Galaxy line of phones and tablets will be getting its Gingerbread update any day now. We hope. Any day now. Guys, really?
  • Bruce Baker sent me a link to sculpture made of books, sculpture as I suspect termites understand it. The last picture made me cringe a little: It’s a carved-up copy of all three volumes of the 1936 New Century Dictionary, which has been my go-to word source now for almost thirty years. What other dictionary (none here!) can show you drawings of a wanderoo and a wanigan on the same page?
  • Not all engineering problems are nice and clean and up on top of a well-lit bench. Especially this one.
  • If ebook readers ever push print books over the edge of the world, it’ll be due to much higher resolution displays. This one, at 458 DPI, is very close to what you see on mass-market four-color interior printing. At 600 DPI (and we’ll be there in a few years) the war will be over.
  • Boy. Here’s a kind-of-a-sort-of-a-thing-a-ma-jigger. A display that hinges in the middle? As a friend of mine once said: “Laugh or lust? Flip a coin.”
  • Inevitable: I Can Has Zeppelin.

Lazarus, Stay Where You Are!

…because when you came forth, you stepped on my bootloader.

I’ve tried to like Lazarus. I’ve tried for years. I can only assume that (as also evidenced by its similarly screwy cousin, Kylix) there is something in the Linux platform that makes Pascal compilers go a little bit whacko.

A few days ago I installed the KDE Fedora Spin in a new partition on my Linux box. It’s been a good education in the Plasma desktop. Plasma is all very blue and cold looking (way too blue for me, in fact, though the default wallpaper is striking) but unlike my first taste or two of KDE 4, it actually works.

So I started installing the software I’m familiar with to begin using it, and somewhere down the list was Lazarus, the Delphi-ish GUI front end for FreePascal. The package available from Fedora was V0.9.28.2, which is considerably newer than the one I have installed on Ubuntu Lucid, and only a little older than the one you can get from the project Web site. After it downloaded and installed all of its enormous pile of stuff, it asked me to restart Linux. I did.

And grub failed to run.

All I got was a blinking text cursor in the upper-left corner of the screen. This is the first time I’ve ever seen grub fail, apart from the well-known habit of Windows to overwrite grub with its own bootloader. (This is why Windows goes in first, if you’re going to have it at all.) I booted the Ubuntu 11.04 live CD I’d burned a few days after it was released, just to see if my MBR had been damaged. As best I could tell it had not, but I’m not good enough at grub’s internals to really be able to tell what was wrong with the software itself. Since I had plenty of free space on the 750 GB drive, I just installed Ubuntu on yet another partition, hoping that its update of grub would put things right. And it did.

So why would installing a compiler and an IDE mess up the OS bootloader? (Anybody?) I don’t have a lot of clues. The copy of Lazarus I installed looks like it works as well as Lazarus ever does, so I can’t assume that something in the installer or the package glitched and overwrote something unrelated. None of the other partitions on the disk were affected, as best I can tell. I’m tempted to install Lazarus under Ubuntu, to see if it will stomp on Ubuntu’s copy of grub as well…but that will happen another day, when I’m not as busy and not so grouchy.

Odd Lots

  • Ubuntu 11.04 Natty Narwhal is out, and hardly anybody’s even mentioned it. Could it be that nobody’s really upgrading every six months anymore? (My workaday Linux system is still running 10.04.) I’m not bullish on Unity, and may reconsider Kubuntu when I set up a GX620-based Linux box in coming weeks.
  • The formidable Al Williams has a three-part series on DDJ explaining how to use the visual tool App Inventor to create Android apps. I have not used App Inventor yet, but Al’s analysis of the challenges of using it (and of visual metaphors for programming generally) are worth reading. Part 1. Part 2. Part 3.
  • John Scalzi has written a brand new Fuzzies novel. (Not furries, Fuzzies–tiny aliens created by H. Beam Piper.) Scalzi’s good–this one could be fun. I’ve read all the Fuzzies books (by Piper and others) and truly only like Little Fuzzy (the original) and Fuzzy Bones by William Tuning. Fuzzy Sapiens is so-so, and Fuzzies and Other People is so awful that Piper chose not to submit it for publication after he wrote it in 1962. It was found in a box after he committed suicide in 1964, and not published until the late 1980s.
  • Interestingly, most of Piper’s copyrights were not renewed, and a great deal of his work (including Little Fuzzy) is now in the public domain. Go to the “P” author page on Project Gutenberg and scroll down.
  • I heard years ago that armadillos are the only other mammalian species that contracts leprosy, but now there’s evidence that virtually all human cases of the disease (which is vanishingly rare these days) were contracted from them. (Thanks to Pete Albrecht for the link.)
  • Illinois is banning trans fats in its schools (with a notable exception for doughnuts, how healthy!) but does anyone dare remind them that there is absolutely no trans fat in unhydrogenated lard? In terms of monounsaturated fat (the good fat) lard comes out better than butter, and both are far better than the vegetable oil spreads we call margarine. Funny how the more animal fat I eat, the more animal fat (my own!) that I lose. (Thanks to Pete Albrecht for the Illinois link.)
  • And the much-reviled Dr. Eades makes the point that Mediterranean people who supposedly take all their foods as olive oil are actually doing a lot of their cooking in animal fats, especially lard. (They export the olive oil to people like us, who think it’s healthier.)
  • This gets an award for something. I’m still not sure what.

Odd Lots

App Inventor for Android

AppInventorBlocksEditor.png

Whoa. Yesterday morning Google took the wraps off App Inventor, a visual development environment for the Android mobile OS. I’m still trying to slurp from the firehose, even though I’m finding that all the hoses have basically the same information, and in truth not a great deal of that. But I’ll tell you right now: It stopped me in my tracks on the iPad decision. As of yesterday morning, I wanted something that runs Android. The new search is on.

You know me. I’m the Visual Developer guy, and the fact that my magazine’s been dead for ten years doesn’t change that. I still believe that visual metaphors for programming are not only useful but necessary, if certain kinds of software development are to happen at all. (More on this below.)

If you haven’t looked into App Inventor at all yet, a very good place to start would be Jason Kincaid on TechCrunch. He’s got a good overview and some screenshots (including the one I show above) that will give you a sense for what Google’s cooking up. I’ll summarize here. App Inventor has two major subsystems:

  • The Designer is basically a form designer, not conceptually different from that in Delphi, VB, and many other more recent environments. You drag UI components from a palette and arrange them on a form.
  • Far cooler (if less proven in its approach) is the Blocks Editor. Here’s where program logic happens, and it happens by snapping together logic blocks that look literally like jigsaw puzzle pieces. Clusters of blocks become event handlers. You connect a cluster to an event generated by a component on the form, and the blocks in that cluster execute.

(This may not be the correct jargon. Please understand that I don’t have an instance to play with yet, so all I can do is relay what I’ve read from the fortunate few who were given early copies.)

I knew what the major problem was going to be before Jason told me: In any system like this, you’re limited by the selectable elements on your palette. He didn’t mention where the blocks come from (I assume they’re written in Java using some relative of the MIT Open Blocks technology) nor whether user-created blocks will be importable into the product as shipped. I’m a lot less worried than he seems to be about this, because Google isn’t stupid, and they know damned well that the system lives or dies by the richness of the set of available logic blocks from which the apps are generated. If it’s anything like an open system, there will be an explosion in third-party blocks once a few Java guys get the system and figure out how to do it.

Jason provides some screenshots with his article, and I borrowed one above to get your attention. Here’s another page with a description of a more complex app, with a much more representative Blocks Editor display.

There’s not a lot more that I can say about App Inventor itself, at least until I can get a workable instance installed here. But it’s been interesting seeing all the dorks in the comments to the news stories, dumping on the system for its simplicity, and for the (frightening) possibility that the hoi-polloi will be able to use it to write their own software. They scream the obvious: You can’t write a word processor with a tool like this!

Fersure. And that’s not what it’s for. I’ll respond with something that should be equally obvious: The mobile phone environment is fundamentally different from the desktop environment. From the beginning, it’s been about smallish apps that do one or two things of interest, and no more. Mobile phone computing for the most part is about getting in, doing something with a few quick clicks, perhaps reading the screen, and getting out. The apps are very focused and often extremely specialized. Some are obviously going to be a lot more difficult to write than others, but a useful mobile app does not necessarily require man-years of development time.

And if it ever did, it won’t anymore once App Inventor hits its stride.

I think that I’ll use App Inventor for the same reasons that I use Delphi: To play with ideas, see how things work, and gen up one-time test apps that may lead in useful directions. I’m guessing that App Inventor will enable people to create apps for an audience of one–themselves–and not have to spend six months of free time to do it. Companies may experiment with different approaches to mobile computing without having to commit millions of dollars in dev costs to any one approach, just to see if it’s useful or even doable.

I have never had a smart phone, and I’ve been waiting for my current cell provider contract to expire early next year before getting one. I may have to accelerate the schedule a little. This thing’s making me itch in places I haven’t itched in for a long time.

FreePascal (And Lazarus) From Square One

About two years ago I started piecing together a book on FreePascal based on my 1992 Bantam book, Borland Pascal 7 From Square One. I set the project aside in part because I needed to get my assembly book updated and back into print–something that took most of a year and all of the personal energy I could summon. But there was another problem: The text-mode IDE included with FreePascal is erratic in the extreme, and crashed constantly on me, especially under Windows. I had hoped that there was an easy fix, but apparently not. I installed the new 2.4.0 release of FreePascal yesterday, and the IDE hasn’t changed a bit. Try to set the text display resolution to anything at all (25 X 80, 43 X 80, whatever) and it crashes. One wonders why the damned thing is still there.

I’ve been following the Lazarus project since it had been the Megido project, back in 1998. The idea was to create an open-source alternative to Delphi, by writing a GUI front end for FreePascal. It’s possible to create ordinary console apps in FreePascal using Lazarus as the IDE, but I hesitated to use Lazarus as the example IDE in the book because it’s only available for Windows, Linux, and FreeBSD. (There’s a Mac port, but I’ve heard it’s less complete and much less robust than the others.)

Pascal and VDM readers, feel the irony: Jeff Duntemann hanging back from a RAD environment because he’d hoped to have a more broadbly applicable (read here: portable) book. Wow.

Heh. I changed my mind. I’ll have to go back to the beginning and pull out all the references and screenshots involving the text-mode IDE, but Lazarus is a much better IDE, even if you’re not actually doing any RAD work….yet.

“Yet” is key. If this first book works out, I hope to adapt some of my material from The Delphi 2 Programming Explorer into an intro book for Lazarus as a RAD tool. So getting readers familiar with the editing and project management machinery built into Lazarus is a good thing, even if the bulk of the app goes to waste while people learn the fundamentals of Pascal.

I’m going to try something new with this book. I’m going to pull a Cory Doctorow and give away the complete PDF version for free, and sell the printed version on Lulu. The book will be yet another descendant of Complete Turbo Pascal (in fact, it will in essence be the 25th Anniversary Edition!) and I’ve been paid for the work many times over. So I won’t be losing much by giving it away, and I’m very curious to see how many paid print sales I’ll make based on a free ebook.

Most of the work lies in the early chapters, where I introduce people to the Lazarus RAD environment. After that, well, it’s all basic Pascal, and while Delphi has extended Pascal fantastically in the last fifteen years, CASE statements are still CASE statements.

Unlike my earlier books, I intend to post regular PDFs of the work in progress, so you can follow the project as it happens. (There’s a 2008-era PDF out there now, and you can get it from my FTP area using HTTP.) I’ll post an updated PDF as soon as I untangle all the existing references to the text-mode IDE. Watch this space for more details.

Assembly Language Step By Step, Third Edition

ASMSBS3ECoverSmall.jpgA few minutes ago, UPS left my author’s carton of Assembly Language Step By Step, Third Edition on the front porch. So after ten months of work (and another month of anxious waiting around), it’s really and truly real.

100% Linux. Certified DOS-free. It turned out pretty well, all things considered. And having (finally) held it in my own hands, I think I won’t ask anything more from today.