Archive for the 'Programming' Category

May 21 2008

Craplets

Published by Mark under Programming, Technologia

I don’t read the consumer technology press much (at all), so I hadn’t heard of this excellent term for all the little pieces of junk software one finds on a new computer until my Dad brought it up. This happened while I was in the middle of trying to remove a bunch of them from a new laptop he had purchased for my Mother. I don’t know if Walt Mossberg coined the term, but he certainly gave it more visibility in a column last year. The symptoms which had brought Mom’s shiny new HP unit to my desk included slow boots, and a strange configuration of nested desktop folders. When I first began examining it I found seven or eight entries in the Startup folder, and another fifteen or so under the various flavors of the RUN key in the registry.

What causes slow boots in a Windows machine? In fairly rare circumstances it can be problems with the registry, page file, disk, or a device. Typically, though, it’s software that has to be loaded at startup. When software is set to run from the Startup folder or the registry it is essentially added to the work that the operating system must do before handing control over to the user, because by definition “startup software” must be running before the system can be considered to be fully up and functional. Of course, a large chunk of the software that we find running at boot is nothing like essential to the function of the system. Thus the term “craplets.”

So which were the culprits in the case of Mom’s new luggable? The usual suspects: update notifiers, system tray monitors, context menu handlers, etc. There was Java’s update checker, and Adobe’s update checker, and HP’s update checker, and Quicken’s update checker. I was glad to see the first two of these on the recent ZD.Net UK list of the most annoying software. Update notifiers are among the worst offenders in my book, simply because there’s no good reason for them at all. Yes, people have a vested interest in knowing when new versions of important software are available, which is why Windows Update is a good, if imperfect, mechanism. But the criticality of the need tracks the criticality of the software, and outside of the operating system most of it just doesn’t qualify.

Do I need a separate process running just to check and make sure that there isn’t a new version of Java available? Or the Adobe PDF reader? Of course not. What’s wrong with checking every so often when the software is run? Many applications do just that (Google Earth, for one example), and the system works great. I can’t help but think that many of the software OEMs that dump these craplets onto new machines are in pursuit of some vaguely positive branded relationship with users, but it’s a misguided pursuit. Users have good branding experiences with software when it helps them get something done, not when it interrupts what they are trying to do with useless information.

No responses yet

May 13 2008

When is a Missing Class File Not Missing?

Published by Mark under Programming

This is the part of the show where experienced Java developers laugh as the C# guy tries to tread water. I’ve been developing a Java console application to import some data files into a MySQL database. The development work has all been done in Eclipse on Debian, testing against a local DB. When the time came to test against a remote DB I was offered a Windows-based VPN client to use for the connection, but nothing for Linux. So I decided I might as well package the app up for deployment and run it on my XP system, where it could connect to the database and do its thing.

I jarred up everything (too much, in fact, but I’ll come back to that) and moved it over to Windows. When I double-clicked the jar file the VM popped an error dialog that said “Could not load main-class: ClassName, program will exit.” That sent me down a path of looking at the manifest and trying to figure out why the VM couldn’t find the main class. The package paths all seemed correct. Finally I tried running it from the command line instead of double-clicking (good thing, too, since as I said above it’s a console app). Now the error I received was “exception in thread ‘main’; java.lang.noClassDefFound: org.quartz.SchedulerException”. Well, that’s different.

Turns out I had naively packaged my dependent .jar files into the main .jar for the app, expecting everything to get loaded correctly. That doesn’t work without some additional plumbing. Once I moved them out to a directory and specified the locations correctly in the Class-Path variable in the manifest, all was well. Lesson learned: always execute my programs from the command line, lest the VM bury my exception in something misleading.

No responses yet

May 13 2008

Eclipse: Refresh the Package View

Published by Mark under Programming

Sometimes it’s those little things that drive you nuts, like expecting that when Eclipse displays the Project Properties dialog and you click the Build Path and then click “Add Jars” the resulting list will contain whatever .jar files you happen to have placed in the project folders. Apparently this is not so. Today I needed to add a few .jar files to a project, so I copied them into the lib folder under my project, where the existing .jar files already live. I then went into the project properties to add the jars to the build path. But there were no jars to add. I stumbled around a bit like the idiot I often am, until I happened to click “File | Refresh” from the menu bar with the package selected. Bingo. Eclipse refreshed the package list and suddenly all my shiny new jars were there and available to be added to the path. I had to select the package first, however. If it wasn’t selected then the “File | Refresh” choice was disabled in the menu.

No responses yet

May 05 2008

Did Microsoft Drop the Ball with Developers?

Published by Mark under Programming

Peter Bright has written a multi-page post on Ars Technica explaining the myriad technical failures of Microsoft’s tools strategy that have driven him off the Windows platform and over to OS/X. It’s just been slash-dotted and is getting the predictable level of commentary from the nominally MS-bashing crowd over there.

Ok, let’s leave aside for the moment the simple fact that if Mr. Bright was free to drop Windows and move over to OS/X he’s not working on anything that matters very much. I mean that he doesn’t have a lot of people depending on what he’s doing, otherwise he wouldn’t be so free to make that choice. Whatever. If he’d rather work on a Mac then who the hell am I to comment? But along the way he feels the need to rant a little on the “miserable” Windows development experience on .Net, and that’s where he goes straight off the rails.

Not that he was really on the rails to begin with. Before getting to his laundry list of .Net’s weaknesses Mr. Bright felt the need to categorize the world of software developers according to his own schema. In that world, there are three types of programmers: Excel-wielding macro-cowboy pseudo-coders in business suits; lazy, uninspired cube drones writing clunky, misshapen enterprise applications that nobody really cares about; and those conscientious, intelligent, detail-oriented super coders like himself. Hilariously, he characterizes that last group as the people who might use C++ or “whatever beret-wearing funky scripting language was à la mode at the time.” Like anyone who uses C++ regularly considers a funky scripting language to be real programming (”Look, Bjarne! Anything can be an object!”). Hey, if we push hard enough maybe we can cram the mainly gray-haired, uber-serious C++ programmer community into the same can with all those cool, messy-mopped script-slinging web-onauts. Maybe, but I doubt it.

Continue Reading »

4 responses so far

Apr 28 2008

MySQL Net Setup Problem

Published by Mark under Programming

In the process of setting up MySQL 5.0.32 on Debian Etch recently I ran into a frustrating problem. The server was installed correctly. The users were set up correctly, with the right established roles. I could connect to the server fine from the machine it was installed on, but not from any other machine on the LAN. I had run through the configuration in the MySQL Administrator three or four times to make sure I wasn’t missing anything, principally to keep squinting at the “Disable networking” checkbox to make sure it was clear. It was clear. It WAS CLEAR, dammit. But no matter: I could connect from the local system, but not from the Windows box sitting next to it. Trying from the MySQL Administrator program yielded the following…

mysql_neterr.png

From the command line it looked like this…

ERROR 2003 (HY000): Can’t connect to MySQL server on ‘192.168.0.105′ (111)

I Googled every combination of terms I could think of. At one point I ran across a discussion where someone seemed to be having the same problem, and about halfway down the page someone else suggested editing something in a conf file. Figuring I didn’t want to mess with conf files just yet (there MUST be a checkbox I missed SOMEWHERE) I kept butting my head against the problem. Finally, in a flash of what you wouldn’t call inspiration, given that I had been making no progress for thirty minutes, I tried the actual IP address rather than ‘localhost’ from the local host. No go. Aha… so it certainly acts like networking is disabled.

I went back and reread that discussion, and that’s when I learned about the variable bind-address in /etc/mysql/my.cnf. Here’s what it looks like after a default install…

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1

What it means is that in the default install mysqld will only bind to localhost (127.0.0.1). That interface has no communication with the outside world. The solution is just to comment it out, and suddenly everything works. You would think that the default install would also show “Disable networking” as “true” in the administrator when networking is… uhm… disabled, but I’m probably just not getting it yet.

No responses yet

Feb 04 2007

Scott Rosenberg on Why Software is Hard

Published by Mark under Programming

On Salon.com Andrew Leonard interviews Scott Rosenberg, whose new book Dreaming in Code: Two Dozen Programmers, Three Years, 4,732 Bugs, and One Quest for Transcendent Software, has a ridiculously long title, and some genuine insights derived from its author’s four years spent watching Lotus founder Mitch Kapor’s Chandler project. Chandler is a development effort aimed at delivering the next generation of personal productivity enhancement, and it is going through much of the pain that any software project that is really attempting something new goes through. There’s nothing in here that experienced software developers don’t already know, but it is refreshing to see a non-technical journalist go through an epiphany on what it really means to create “made up stuff layered on top of more made up stuff.” An interesting read. By the way, I’ve previously written here on the same topic, and made some of the same comparison. You can read the piece here, if you’re interested.

No responses yet

Jan 14 2007

Conway’s Game of Life on .NET 3.0

Published by Mark under Programming

It’s been awhile since I’ve posted anything to this site, and while one excuse is that I was first looking for, and then ramping up in, a new job, another excuse is that I have spent the last four or five weeks checking out Windows Presentation Foundation and all the cool new interface programming techniques therein. The best way I know to get up and running on a new framework is to build something fun in it. The sample application I chose to immerse me in WPF was John Conway’s famous Game of Life. Yes, it’s Life! The game that has been implemented 1,195,043 times since 1970! Ok, so it isn’t a novel idea, and I am not even the first one to do it in XAML on the WPF. To make up for my sluggishness in getting up to speed on Vista-ness I obsessively massaged my implementation into a relatively polished state. Here’s a screenie:

avalon_life_screen.png

AvalonLife running Gosper’s Glider Gun

I also wrote up a fairly exhaustive (others might say wordy, or long-winded) article on the design and implementation of the program. The article begins here. The program is available here in .zip archive format with and without source code. Everything you need to run it is present in the default install of Vista. If you want to run it on XP you’ll need the .NET 3.0 runtimes, which are available here. If the source code is of interest you’ll need one or two other things. Instructions are at the end of the introduction to the article. Both packages include over 50 models in the AvalonLife .AVL native format, and you can also visit the Life Lexicon and drag the more than 100 models there onto the AvalonLife main window to load them. Have fun, and let me know what you think.

No responses yet

Nov 17 2006

XML at 10: Big or Little?

Published by Mark under Programming

xml.jpgUche Ogbuji of Fourthought writes the Thinking XML column on IBM’s developerWorks site. On the 14th of this month he celebrated what is more or less the 10th anniversary of XML with this thoughtful piece on the origins and current state of the technology. What the article ultimately ends up being about is the “Big” idea of XML vs. the oftentimes “Little” implementation of it. The Big idea is that XML can be used in a bottom-up fashion to model the grammar of a particular problem domain in an application- and context-independent manner. The little implementation is when XML is essentially used as a more verbose protocol for data interchange between existing applications. I would guess that is 90+ percent of what it is currently used for.

Mr. Ogbuji doesn’t like the idea that the XML vision might devolve into YAP (Yet Another Protocol). He rightly believes that the power and benefit of the idea is in creating independence between data formats and current processing mechanisms. I agree, but at the same time I don’t think it likely that this will actually evolve in most industries. Our economy is too chaotic, things change too rapidly, and self-interest always rules. Organizations are happy to cooperate on stuff that runs buried deep in the wires, i.e. HTTP or the ISO formats for bank data interchange. They are less happy to spend time creating a universal definition of what they do for customers and partners, which has the ultimate effect of debranding their own interfaces. An interesting read, whatever your take on it.

No responses yet

Sep 15 2006

Chris Crawford and Storytron

Published by Mark under Programming

The latest issue of Dr. Dobb’s Journal arrived today, and contained an interview by Michael Swaine with game design legend Chris Crawford on the subject of his new venture. You can find the piece online at DDJ.com. If games and game design interest you, I advise reading the interview before continuing. I have admired Mr. Crawford since the mid-1980s, around the time of Balance of Power. This is a guy who wrote his first commercial computer game for Atari in 1979. Balance of Power was a certified 250k copy smash when it was released in 1984. Somewhere along the way he veered off from the game business and went in a different direction. His new gig is a company he cofounded called StoryTron. After reading the interview I went to the site and read everything there, including some of the message board content. I think I now better understand where and why he parted ways with the industry he helped to create. I’m not sure that, in the end, it will be a journey with a successful ending, or at least it might not be the kind of success he envisions. But I understand the attraction of what he is trying to do. Continue Reading »

No responses yet

Sep 15 2006

A Basic Lack of BASIC

Published by Mark under Programming

David Brin makes an interesting point in a recent article on Salon.com (apologies for the ‘click the banner’ hoop you have to jump through to get to the story). The author of such popular SF works as Startide Rising and The Postman is also a programmer, and he has a son who shows signs of being a programmer as well. Now various people can argue that we don’t have enough programmers, or that we do, or that the ones we have are too expensive. But I don’t think anyone will consider it a bad thing if a young person who is inclined toward the art finds the right tools to assist in the learning curve. The point Mr. Brin makes that somewhat surprised me is that we used to have the perfect tool, and now largely have it no more. That tool was BASIC.

The word ‘BASIC’ is an acronym that stands for Beginners All-purpose Symbolic Instruction Code. It was designed all the way back in 1963 by John Kemeny and Thomas Kurtz, both of Dartmouth. The point of it then was to provide a fast way for students new to programming to get up to speed on the fundamental concepts: stepwise execution; flow of control; instructions; operators; operands; variables; input/output; etc. It used to be that every IBM-compatible PC had BASIC burned into a ROM on the motherboard, and there were any number of more capable versions of it available on tape or 5.25″ diskette once those became common. Incidentally, two guys by the name of Gates and Allen got their start implementing BASIC for the Altair. Continue Reading »

No responses yet

Next »