Friday Fun Post – July 3rd, 2009
Today’s ‘Friday Fun Post’ maybe be an old one for some of you, but it is something I have continually found amusing. It is somewhat of a sad truth, but a truth nonetheless for the majority.
Happy Friday!
nVidia – X.org – Suspend to RAM
I have an older laptop, which I brought back out of storage for fun and to keep it updated. It runs Debian Lenny, so it’s a pretty stable machine, and very handy. A recent purchase of a new battery gives me ~2.5 hours of time with it, which isn’t bad for a laptop from Fall 2002.
Anyways, with running Linux, sometimes you’ll run into small glitches which become slight annoyances when you realize how life could be. In the case of our HP Mini – I know suspend to RAM works in the latest kernels, and my older laptop supports ACPI. So, I ventured to solve the suspend to RAM problem. I found that after suspending, upon resume, the laptop would appear alive, but only the backlight would be on. No graphics, no text, nothing. I could SSH into it, and noticed that an XOrg process was eating the CPU. After researching a bit of history on XOrg and nVidia, I found a forum post noting that this particular user had encountered success by turning off nVidia’s AGP handling. Upon testing the following config (/etc/X11/xorg.conf – In the ‘Device’ or ‘Screen’ section)
Option "NvAGP" "0"
I found I could suspend, and resume with ease. What a great community behind these types of things.
Obligations to Customers – End-of-Life for Software Versions
I’ve been thinking about obligations to software customers lately. I don’t have any of my own (yet) but it is something typically on the front of my mind. At my day job, we maintain various versions of our software, while not directly on the client – in our backend systems. This means that our backoffice must be able to handle multiple versions (major and minor) for our customers. Why is this an issue, or something worth writing about? Because it is such a pain – and customers expect things to ‘just work‘.
This is an especially difficult problem when writing reports, let alone, multi-location reports – where the data is brought in and aggregated from multiple sources into a single report. The reports become a mess of if/else based on the structure of one location compared to another.
So, this leads into the topic of End-Of-Life for versions. As stated above, these reports specifically, become large and painful to update. What is the solution? In my opinion, it is having sane expiration dates on the software you support. This has a couple benefits, some direct and some indirect.
Direct:
- More errors fixed in later versions
- More features
Indirect:
- Less maintenance on the backend
- Quicker feedback on software – if user base is larger.
- Reduced support costs (ie, helpline) for archaic versions where knowledge experts may be limited.
There are some drawbacks though. Fear of change is sometimes warranted with business critical applications. Sometimes, customers are just fine running the current version, and don’t want to change for fear of unknown issues, loss of data, or worse yet, loss of customer data. Likewise, if this process isn’t started from the beginning, the upgrade processes may not be ironed out, and this causes great heartburn if the process is not seamless for the end-user.
But, back on topic – what is a sane value for end-of-lifeing a software package? Is it six-months? 18-months?
In my opinion, it largely depends on the rate at which you update your software. But, largely, 1 major versions back from the current major/minor version is sufficient. So, if your current release is 5.1 – anything beyond 4.1 should be end-of-lifed. Your customers should have enough time within the minor releases to react, prepare for any upgrades, and your support staff / developers will appreciate the forward momentum. This of course assumes a reasonable release cycle. If you’re releasing more often than a minor version every 3 months or so, increase the number of versions you wait.
What do you think? Too aggressive? Not aggressive enough?
C++ Project Layout
With the recent license change at Nokia/Trolltech for Qt – I’ve grown more interested in learning proper GUI development, specifically with C++. I know there are bindings to other languages, but for simplicity of deployment, I think C++ will be easiest to test / depend on, as well as protect in the event that I create something of actual value.
So, outside of the context of Qt, specifically, what are the best practices for organizing C++ projects? I’m used to packages in Java for code organization, do people follow similar suit with C++? In looking at a large project like KDE, it seems that for the bulk of utilities / applications, the code is organized in a single directory, not necessarily split out (as might be the case with a Java project).
Are namespaces worth it? At what size of a project would they add value.
‘Correct’ SQL INSERT Syntax
Recently I encountered an issue at work. I had recently merged some code, and someone who tested from start to finish said there was an error right off the bat. Crap.
Looking at the error, my blood began to boil:
PHP Fatal error: Column count doesn't match value count at row 1 |
So, I investigated where this was happening, and found it. Effectively, when you write an INSERT like this:
INSERT INTO table VALUES ('1', '2', '3'); |
The DB will automatically match your values up with the columns. Except, you’ve effectively broken the code because any change to the schema will change the number of columns. Second, you cannot guarantee the column order on a table, so you just broke any chance of compatibility with another DB back-end. Especially, in the case of multiple branches of a project being updated, you must be defensive about coding practices against the database. You cannot assume anything about the mainline of development beyond your branch.
So, a small lesson. Anytime you’re writing an INSERT, always, always, always, declare the column listing like so:
INSERT INTO table (col_1, col_2, col_3) VALUES ('1', '2', '3'); |
Now, you see that the DB doesn’t have to think about which columns you’re populating, you told it directly. This also guards against the change in column order, as well as, the addition of new columns. Remember, if you’re adding columns that are set to ‘NOT NULL’, be sure to set a sane acceptable default, and you shouldn’t have compatibility issues with your old inserts.
Closing side benefit, I can look at this new INSERT, and know what the columns are. Given the first, I’d have to go check the DB, and verify the column order, etc. Always put column names in. Always.
HP Mini – Ubuntu Wireless SSH
I recently purchased a new HP Mini. Love the form factor, as does Stef. It’s great for checking e-mail, web surfing, etc in the living room while watching TV.
First thing I did was drop Windows in favor of Linux. In this case, Ubuntu. I found that everything worked flawlessly except I couldn’t SSH out. After searching around a bit, I found the solution, which I’ll post here in hopes that it saves others some time.
In /etc/network/if-pre-up.d/wireless-tools , add the following line at the end of the file:
/sbin/iwpriv eth1 set_vlanmode 0
And restart networking. You should now be able to SSH in/out of the HP Mini.
Floors
Put new floors in the hearth room & kitchen. Finished up a week or two ago. Really took about 20 hours tops, with the help of a good buddy. Still need to decide what to do about trim (floorboards, base shoe).
- Floors – Looking at door to deck.
- Floors – Looking at kitchen
DBDesigner4 & MySQL 5
I use DBDesigner4 for DB modeling and ERD generation. Great tool, though the original developer went to work for MySQL (I think) to build their MySQL Workbench. Well, for Linux users, Workbench isn’t available yet, so we can still use DBDesigner4, which works great. Anyways, so I recently attempted to connect to my local MySQL 5 instance, and couldn’t connect. Consistent errors stating invalid username/password, even though I clearly typed it with no errors.
The issue is rather simple. The library used by DBDesigner4 uses an older version of the MySQL API to connect. Meaning, in between versions, MySQL changed the method by which passwords are stored, therefore the authentication would keep failing. Enter ‘OLD_PASSWORD‘. By setting your password using the ‘OLD_PASSWORD’ method, you can connect up with DBDesigner.
Example:
mysql> set password for ‘user’@'host’ to OLD_PASSWORD(’mysecret’);
Google Street View Car Drive-by
Gazed out my window to see the Google Car driving up my street. With cat-like reflexes I grabbed my camera and snapped a few photos from the front door.
What’s funny is, now when the pics appear on Google, the world will see me standing in my front door…
DAWitter v0.1.1
Made a couple small feature updates to my Twitter client. Added in a tabbed interface to handle main updates, replies, and direct messages. Added a simple ‘About’ window (what app would be complete without one?), and the beginnings of a simple context-menu to facilitate easier replies / direct messages. Next up, posting.
A couple screenshots:
PyGTK
Over the last few weeks I’ve had the itch to learn Python. Specifically, in the GUI context. I poked around, looking at a few of the widget sets out there, and settled on GTK. GTK is cross-platform, works on *nix, Apple, and Windows, pretty seamlessly. The integration is quite nice as well. My pet project to increase the speed at which I’m learning (as opposed to just ‘Hello World’) is a Twitter client. Most of the Twitter clients written today are for the Adobe AIR platform, which limits use to Windows & Apple.
I’ll post as I make more progress, but a couple simple screenshots should suffice for now:


Lame – PC Incorrect Joke of the Day
So, a blind guy walks into a store with his seeing eye dog by his side. He proceeds to pick up the dog by the hind legs, and starts swinging him around the aisles. A clerk approaches and asks “Is there anything I can help you with, sir?”, to which he responds “No thanks, just taking a look around”
Ba-dum-ching!
Soundcard Update
Small update on the soundcard wishes post: bought a new Logitech USB headset, and all is well. Within Skype you can configure which audio devices to use for which action. Specifically, audio in (during a call), audio out (headset mic to hear me), and ringing device, which I can direct to the main speaker set, thus, the headset is not required to hear an incoming call. Very handy.
My one thing to still configure is the amount of time to wait until forwarding the call to my cell phone. The forwarded call costs the regular rate ($0.02/minute I think), so its not horrible, but still. If I don’t grab the headset soon enough and answer the call, it forwards to the cell phone. Need to up the amount of time.
Anyway, end result, I can do what I wanted with the new headset, so, fantastic!
(Posted via the Blackberry, so please excuse any grammar errors)
WordPress Upgrade Oddity
Hmm, I upgraded WordPress to the latest version available to my host, and suddenly an odd character is in place of a standard space character. Only when starting new sentences though (using 2 spaces to separate from the period). Weird.
Soundcard Wish
I use Skype periodically for phone calls from my PC. I also enjoy listening to music while I work. My main workstation is a Dell Dimension E520 – Running Kubuntu 8.04. So, on the box, I have 2 front connections to the sound card, a headphone jack and a microphone jack. Using my headset which splits the 2 out, it’s very handy for connecting. Trouble is I’m constantly unplugging the headphone jack to utilize the normal speaker set I have on my desk. What I’d love to do is direct regular audio output (ie, Music, System notifications, etc) through the rear connection, and have the Skype audio directed through the front headphone connection. This would allow me to listen to music, and when I saw a Skype notification arise, I could just pick up the headset and go, rather than fumble with the headphone connection.
Putting this post up on the ‘tubes to see if anyone has found a solution for this sort of setup.
Book: Joel on Software
I bought the book Joel on Software at Borders this weekend. I recently moved into a management role at the company I work for, so I felt I needed some pointers and encouragement for how things can be done. I say ‘can’, because I think management roles constantly evolve. You’re working with people, who are unpredictable beings, thus there is always variability and adaptation is necessary.
In the next few posts, I’ll be putting up interesting thoughts from the book, and my thoughts on them, or how I can apply them at work. Basically, I want to succeed and I want the team to succeed, so that the company can succeed.
Job Change
Recently, I hit what I’ll consider my own personal gold mine of jobs. I found a job with a company that allows me to work from home, no travel, and uses new technology. The best part is, I’m finally writing software that people depend on, that keeps business going. That may sound a bit dramatic, but the truth is, while I wrote valuable code before, it never struck me as something that was keeping business going. Anyways, after a month in Fairbanks, Alaska for training / orientation and picking up the work PC, I’ve been working from my home office for 3 weeks now.
Linux on the “Desktop”
For many years people have claimed that <insert year> will be the “Year of the Desktop” for Linux and it’s friends. I say it that way because people tend to clump the kernel, the toolsets, window managers, and everything else under the ‘Linux’ banner. I think Linux is ready for the “desktop”. I’ve used Linux on my main desktop for several years, and very few times have I griped about it. The only gripe I have would be proprietary formats, which in no way is a fault of open source.
The trouble with saying Linux is ready for the desktop, is people immediately assume you mean everyone can use it, without problems, without having any prior knowledge of their hardware or anything, that everything that comes on their PC (accessories included) should “just work”. I’m saying this in the sense that, Linux and friends have fit my every need for computing. Need a word processor? Grab OpenOffice. Need development tools? Find and install. Does this mean I haven’t had to tweak anything or massage something into place to work right? Of course not. I run into small problems, easily resolved. But that’s because it interests me. The only reason something stops working is me messing with something. Take a Windows installation for example. How do you get it setup. You install the base system, then spend the next 6 hours on updates. Install your anti-virus, anti-spyware, anti-malware, everything. Trouble is, your typical users are still running as ‘administrators’ so the system will “just work”.
Now, many people claim to have problems when setting up a Linux box. Usually some piece of hardware doesn’t fully work as expected. This is bound to happen when peripheral makers are focusing on the Windows platform. But, I’ve had several cases where I haven’t had problems. For instance, this weekend I bought a bluetooth adapter to use with my Treo. Just an off-the-shelf Kensington bluetooth adapter from Best Buy for $22.00 on sale. Plugged it in, and it’s already configured. Up pops the Bluetooth config dialog, and I just close it out accepting the defaults. Try sending something from the Treo, works every time. Next, I bought a wireless keyboard and mouse set for the DVR. Easier than running cables up the wall. Plug in the USB receiver, and connect the keyboard and mouse, works perfectly, without a reboot, no driver installation.
Who says Linux isn’t ready for the desktop?
Note: I’ll concede to certain Apple fans, they do make nice systems, but the cost of ownership is still too steep. But, remember, the kernel of your OS is open source.
Is Facebook Immoral?
I don’t hit the social networks as much as some might, but I do login once in a while to check in on people. Plus, sometimes people write you a message, and the network will only notify you that you have a message, not telling you the content. But, I guess they want to pull you to the site as often as they can.
Anyways, I logged in today to check said messages, and found that Facebook has an opinion on my marriage. Now, I find my wife to be “the best”, yet Facebook thinks otherwise. Clearly, I’m listed as married, but Facebook believes I can do better…

Grinds My Gears – 60 Minutes Fat Report
Peter Griffin of Family Guy used to work at the news station in Quahog, writing a piece called “What really grinds my gears”, I pay homage to that style with a “Grinds My Gears” post.
Today on the radio one of the co-hosts was talking about a report from 60 Minutes about requiring restaurants in New York City to post nutritional information on the menus. As if the nutritional board wasn’t enough, or if you really cared, asking the manager somehow failed to get you the information you’ve been seeking.
You know “what really grinds my gears”? People blaming the fast food industry for making America fatter. As if people that eat fast food don’t realize that the food isn’t good for them. Ask anyone on the street, “If I dunk food in a vat of boiling oil (fat), is it healthy for me?” Of course not! People know it, but they keep eating it. What reason does McDonalds have to change the way it makes food? McDonalds doesn’t have the responsibility to maintain the health of America. Secondly, if McDonalds doesn’t provide the fat, someone else will. McDonalds isn’t the problem here, folks. It’s the people visiting the McDonalds.
Now if the health industry wants to run some type of campaign to make America healthier, and they use stats from the fast food companies for nutritional content (or lack thereof), by all means. But, in no way should they create legislation that affects the fast food industries business (by directly making them change anything). I believe anything they want to do to change the business should be indirect. Make the people want to change. If the people want McDonalds to change, it will. Until then, nothing will change.
Hopefully, this isn’t the last “Grinds My Gears” post.









