2012.Jan.16
Filed under: Programming — jon @ 19:19

I decided to install Cyanogenmod 7.1 on a microSD card that my Nook Color can boot. I get a nice tablet to play with and none of the original firmware gets touched. Win-win! Much has been written about how to do this, but there are a few scattered things which will make your life easier.

  • If using Linux, you’ll want to write the image file to the block device (/dev/sdb, etc.) and not the partition (/dev/sdb0, etc.).
  • If using a procedure documented for 7.0.x, the boot partition will not be big enough to hold your 7.1 installation and ZIP file. Expanding the (only) partition to 200 MB works fine. Note the current version of GNU PartEd tools won’t be able to do this (they don’t like something about the particulars of the FAT32 image). Use the Windows7 disk manager or the free version of EaseUS.
  • To get the boot menu up (if ever you need it), hold down the “n” nook button while powering on.
  • Slow microSD cards will make your Android run very sluggishly and cause a lot of force closes due to timeouts. Check the spreadsheet and buy something that has a high “Random Write 4KB QD=32″ value. I first tried on a PNY class 4 card (0.029 MB/sec on that spreadsheet) and it was neigh-unusable. Note that a lot of class 10 (fast sequential write) cards have absolutely horrid random write performance.
  • Once you have Cyanogenmod booting into the setup wizard, you’ll need to follow a few steps to turn on WiFi before you actually run the Google account sync.
2010.Mar.16
Filed under: Personal,Programming — jon @ 17:02

I’ve had my Android Dev Phone 1 (T-Mobile G1) for a year now, and figured I should update my previous post about what applications I recommend:

  • Google Listen: it isn’t the perfect podcast listener, but, as with most Google products, the difference between it and perfect is small enough to tolerate.
  • Astrid Task/Todo List: a great to-do list with a nice, simple widget. I’ve recently starting using its synchronization with Remember the Milk and it works well. My list is in the cloud and available to me from anywhere.
  • ConnectBot: still the best ssh client I’ve found.
  • RealCalc Scientific Calculator: I know, there’s one installed, but it doesn’t do RPN or binary/hexadecimal; this one does.
  • RingDroid: my favorite application for getting audio files (or parts of them) to ringtones.
  • Google Voice: now everyone can afford the power of a software PBX.
  • My Tracks: fun for mapping favorite bike routes and sharing them via Google Maps
  • Google Sky Map: simple, amazing, and tons of fun for people who are new to the power of a smartphone
  • Voice Recorder or Droid Record: turns your phone into a basic audio recorder. Handy for meetings, notes in the car, etc. Both work very well, just with different interfaces.
  • Google Goggles: I used to recommend Barcode Scanner (which is still handy), but this is a bit more sophisticated; awfully handy when shopping and making notes. Take a picture of a price tag (barcode), object, building, text in a foreign language, etc., and Google will work its magic.
  • Contact Owner, by Paranoid Android: changes your lock / wake-up screen to include a little message on how to contact you (in case you lose your phone).
  • Astro File Manager: a decent file manager (think Dolphin / Nautilus / Explorer) that also has a process manager.
  • Pintail: if you ever lose your phone, you can send a specially-formatted SMS (with a PIN) to it and it will respond with its GPS location
  • BeamReader PDF Viewer: It’s the only PDF viewer I’ve found that can reliably (and quickly) handle very large PDFs, like data sheets for electronic parts. There’s a free version with limited capabilities and then a “key” version you can purchase which will unlock the remaining features. The only pay-for application I have installed at the moment.
  • KeePassDroid: a password manager based on the open-source KeePass. Does what it says.
  • Google Buzz widget: if you use Buzz, it does what you expect it to do.
  • Android Terminal Emulator: rarely used, but fun for poking around or the occasional hack.
  • Compass: again, does what you’d expect. Works with GPS off, which is nice for battery savings.

And the games / silly applications:

  • Jewels: a Bejeweled clone.
  • Magic 8-Ball: “the outlook is amusing.”
  • Coin Flip: I almost never carry change; this helps settle who drives to lunch.
  • Ethereal Dialpad: a neat little “touch to make music” app, good for demonstrating the interface to others. I wish it supported multi-touch.
  • Tricorder: silly fun watching the raw accelerometer data, etc.
  • Barrage Lite: a Scorched Earth clone.
2010.Jan.8
Filed under: Personal,Programming — jon @ 19:20

I ordered three hard drives from Amazon, Western Digital Caviar Green 1.5TB models (WD15EADS). They were inexpensive and I talked to people who used them in their desktop setups. It turns out that Western Digital, at some point, changed the drives they were making so that they no longer work under a RAID setup. The drives routinely fault out of the array because you can’t turn on TLER. Also, they make a horrible loud clicking noise every ten seconds as the heads are parked and un-parked due to routine disk access under Linux. Nowhere on Western Digital’s page about the drive does it say “do not use in a RAID setup” or “do not use in Linux.” Oops.

From scouring the web, it turns out that the “sub”-model number and build date are important. My three drives were WD15EADS-00P8B0, built Nov 2009, firmware 01.00A01. There are reports that older build-date drives can be made to work; true or not, mine could not. Western Digital’s customer service is of zero help, blaming the problem on everything but the drive.

No more Western Digital drives for me. I’m returning these three as defective. I’ve put WD drives in my last three builds because they’re inexpensive and reliable. No longer. Back to Seagate drives (yes, even after their ST31500341AS firmware debacle).

2009.Dec.17
Filed under: Programming — jon @ 17:51

Since most of what I found on the web was either wrong or more complicated than needed, here is what worked for me. (My drive image file was old.vdi and I wanted a new copy of that disk, new.vdi, which was 24 gigabytes (give or take).

  1. cd ~/.VirtualBox/HardDisks
  2. vboxmanage createhd –filename new.vdi –size 24000
  3. vboxmanage clonehd old.vdi new.vdi –existing
  4. Open VirtualBox, select the virtual machine, and click on Hard Disks.
  5. In the Attachments section, click on the existing image file name (old.vdi) and click the Select Hard Disk button to its right. This will open the Virtual Media Manager dialog.
  6. Select the old image file and click Release. Remove the old image file (old.vdi).
  7. Click Add and browse to the new image file (new.vdi). It will now appear in the Hard Disks list.
  8. Click the Select button at the bottom of the Virtual Media Manager dialog.
  9. Go download a gparted LiveCD .iso file. Click on the virtual machine’s CD/DVD-ROM settings. Make sure “Mount CD/DVD Drive” is checked, pick “ISO Image File”, and browse to the gparted ISO file you just downloaded.
  10. Click the OK button at the bottom of the Settings dialog to close it.
  11. Start up your virtual machine. Click in the window and press F12 to bring up the boot devices menu. Pick “c” for CD/DVD-ROM.
  12. Run gparted, click on your partition, and resize it to occupy the whole disk.
  13. Shut down gparted, reboot, and wait for Windows to check your new hard disk.
  14. Celebrate!
2009.Dec.1
Filed under: Kubuntu,Programming — jon @ 15:21

A quick note for anything trying to get Gears to work with Firefox 3.5 and 64-bit Linux: follow the steps in this post. The post is for gcc 4.3.3, but it worked just fine with my gcc 4.4.1. Beware: the svn checkout step will take many many minutes.

sudo apt-get install build-essential subversion m4
svn checkout http://gears.googlecode.com/svn/trunk gears-trunk
cd gears-trunk
wget http://gkovacs.xvm.mit.edu/google-gears/gears-gcc433.diff
patch -p0 -i gears-gcc433.diff
chmod +x third_party/gecko_1.9/linux/gecko_sdk/bin/xpidl
cd gears
make -s

The installable file will end up in ./bin-dbg/installers/ (that is, something like /home/foo/gears-trunk/gears/bin-dbg/installers), with a name like gears-linux-x86_64-dbg-0.5.34.0.xpi. In Firefox, pick “Open File” from the File menu and browse to that directory; pick the XPI file and you should be good to go. I’ve only tested it with offline gmail, but that seems to work fine.

2008.Sep.21
Filed under: Programming — jon @ 14:28

Trivial but handy utility/function to give you a subversion diff with paging and syntax coloring:

svndiff ()
{
  svn diff $* | colordiff | less -r
}

Pass it anything you’d pass to “svn diff”: e.g., “.” for the current directory, a list of filenames, or options like –no-diff-deleted.

2008.Sep.13
Filed under: Kubuntu,Programming — jon @ 18:24

Here in the underground bunker we have computers named after fruits:

  • lime
  • lemon
  • mango
  • cherry
  • indigo – not a fruit, but replaced “indulgence”
  • oreo – my wife has convinced me that Oreos are definitely a fruit

All machines run Ubuntu server or Kubuntu, and several dual-boot and/or virtualize XP.

Filed under: Programming — jon @ 18:07

The WordPress RSS widget has two little flaws, in my opinion. Here are my fixes, in case they help anyone:

  1. For an article the widget will provide a “title” attribute that contains the whole content from the article. Since this site implements a tooltip-like hover box for links with a title element, that can get really ugly. The fix is trivial, and involves truncating post content at 500 characters.
  2. When given a feed from my Google Reader “shared items” list, the title of the blog is mashed against the end of the article title. I’ll get things like “Cat Stuck Up TreeRoanoke Times”, which is also really ugly. The fix is somewhat more complicated, and involves not including the “source” element in the article title.

WordPress 2.6 also finally integrated the ability to log in and administer your blog over HTTPS, so that’s one less patch/plugin I need to track.

Happy hacking!

2008.Jun.12
Filed under: Kubuntu — jon @ 18:54

The latest VMware Server 1.0.6.91891 will install in Hardy (v8.04), but wouldn’t run for me. A short page on HowtoForge gave me the pointer I needed to get it to run: sudo cp /lib/libgcc_s.so.1 /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1.

If you find your control, shift, alt, and caps lock keys suddenly stop working outside the guest OS, run setxkbmap to get them back. The bug report indicates uninstalling VMware Tools from the guest will solve the problem, too, but I haven’t had to take so drastic a step.

2008.May.30
Filed under: Activism,Programming — jon @ 15:46

Competition is good for everyone! Well, everyone save the entrenched leader. Help Firefox set a new record for most downloads in a day.

2008.Apr.25
Filed under: Kubuntu — jon @ 13:58

Kubuntu logo

In case you missed it, yesterday brought us a new release of Ubuntu, Kubuntu, and family. The version is called “Hardy Heron”, version 8.04. New features of interest are desktop 3D effects (compiz), the ability to use a KDE4 desktop (which I’ve tried from the LiveCD and it’s shiny), and some bug fixes to packages like kpdf.

2007.Dec.3
Filed under: Entertainment,Programming — jon @ 21:35

My two favorite Edsger Dijkstra quotes:

… if 10 years from now, when you are doing something quick and dirty, you suddenly visualize that I am looking over your shoulders and say to yourself “Dijkstra would not have liked this”, well, that would be enough immortality for me. (From EWD1213.)

and:

Elegance is not a dispensable luxury but a quality that decides between success and failure. (From EWD1284.)

2007.Nov.11
Filed under: Programming — jon @ 23:27

If you’re using subversion and haven’t yet used svnmerge for merge management, I highly recommend it. It gracefully handles most of the chores associated with branches, from remembering which merges have happened and which were deliberately excluded to handling merges from multiple branches. Super-nifty. If you’re running a Debian distribution, svnmerge is available in the package subversion-tools (which also contains, among others, the super-useful svn2cl and commit-email scripts).

On a related note, I’ve finally posted my simple source code management guide.

2007.Mar.29
Filed under: Programming — jon @ 13:11

Michael McDonough’s Top Ten Things They Never Taught Me in Design School led to Andrés Taylor’s top ten things ten years of professional software development has taught me, which led me to Coding Horror’s Top 6 List of Programming Top 10 Lists, which inspired me to think about my own. I can’t claim all these as my own, but here’s my take on my oh-so-long career:

  1. Be the change you wish to see (a.k.a. actions speak louder than words). Gandhi’s advice applies to more than swaraj. Complain minimally; act instead.
  2. Work smart, not hard (a.k.a. hard work is its own reward). If they both give the same outcome on similar investments, choose smart work over hard work: it begets more smart (efficient) work. Example: if I find myself doing the same time-consuming manual task a third time, it’s time to automate it.
  3. You are not your code (a.k.a. critique the code but be kind to the coder). Don’t take it personally when someone praises or insults your work; learn from it. We all have written and will write bad code. Be responsible for it, but don’t own it or people will avoid communicating their problems with it. When critiquing code, aim there and not at the author. Problems with the author should be addressed separately.
  4. Communicate well (a.k.a. play well with others). Good production is built on teamwork and communication with your peers, customers, and supporting organizations. Communicate with, not to. Remember that you’re all in it together: it’s “us and us” not “us and them.” Support those around you and accept their support when it is offered. Efficient and happy work relies on knowing what is happening. Be honest and direct. Document as you code (automatic documentation generators like doxygen are your friend). Write your use models before you code and your test cases no later than as you code. Speak up when you have a problem. Ask questions when you need to know something. Passive-agressive behavior has no place in an office.
  5. Learn to differentiate between the essential and the desired (a.k.a. fight for what you believe in, but don’t push the rest). Be true to yourself. If it’s important, speak up and don’t let yourself be trampled. Support other peoples’ important things. Remember the color of the bike shed.
  6. Be slow to hire and quick to fire (a.k.a. using the right tool makes the job easy and enjoyable). There are few things more disruptive in an office than a bad employee and nothing more wonderful than a great one. There are few things more depressing than being hired for a position that (unbeknownst to you) doesn’t fit you and few things more fulfilling than one that does. It’s not fair to the employee or the employer to be sloppy in hiring or firing. Also remember that it’s easier to teach technical details to a smart, nice person than to teach people skills to a knowledgeable jerk.
  7. Keep learning (a.k.a. keep your tools sharp and get some more tools). Learn how to better practice your art. Learn new languages, techniques, development styles. There is always a better way. It’s good for both your professional and personal development.
  8. Do it right the first time (a.k.a. establish/teach good habits early). To a first approximation, no code is ever re-written, re-factored, or re-documented; there’s never the money, time, or people. If you don’t spend the few extra minutes to do it right this time, it’ll be trouble for the remainder of the product’s life. Train your new hires before they fall into make-do habits.
  9. The road to hell is paved with good intentions (a.k.a. no good deed goes unpunished). “The world is not set up to facilitate the best any more than it is set up to facilitate the worst. It doesn’t depend on brilliance or innovation because if it did, the system would be unpredictable. It requires averages and predictables. So, good deeds and brilliant ideas go against the grain of the social contract almost by definition. They will be challenged and will require enormous effort to succeed. Most fail. Expect to work hard, expect to fail a few times, and expect to be rejected. Our work is like martial arts or military strategy: never underestimate your opponent. If you believe in excellence, your opponent will pretty much be everything.” — Michael McDonough. I couldn’t have said it better.
  10. Implementations are important; interfaces are critical (a.k.a. few people see the car’s engine). The thin skin of your program that interacts with the outside world is critical. (The same applies to modules written for a larger program.) If you don’t get the UI right, not many will care how well it is written. If you don’t make the interface easy to use, not many will care that does what they need. Some people can design interfaces and some can’t — learn to recognize the first and tap into that talent.
2006.Dec.31
Filed under: Programming — jon @ 11:16

Two things you never ever want to see in a chunk of (production) C/C++ code:

void someReadFunction(char *buf, size_t buflen)
{
   ...
   pos = -1;
end:
   buf[pos] = '\\0';
   return pos;
}

And no, the programmer wasn’t advancing buf in the omitted part of the function.

2006.Dec.20
Filed under: Activism,Programming — jon @ 16:07

Linus Torvalds has a wonderful response to a proposed Linux kernel patch that would disallow loading proprietary (non-GPL-compatible-licensed) kernel modules. This is no particular surprise, given Linus’s pragmatic nature, but it illustrates a good point about DRM: it is impossible to determine fair use algorithmically. The difference between a fair use and an illegal one are outside the realm of software. To quote his response:

The fact is, the reason I don’t think we should force the issue is very simple: copyright law is simply better off when you honor the admittedly gray issue of “derived work”. It’s gray. It’s not black-and-white. But being gray is good. Putting artificial black-and-white technical counter-measures is actually bad. It’s bad when the RIAA does it, it’s bad when anybody else does it.

Technical solutions to social problems don’t work and never will.

2006.Dec.3
Filed under: Programming — jon @ 19:27

Microsoft made available a download of a Virtual PC image of a stripped-down Windows XP install and IE6 (if you pass a Genuine Advantage check on your machine), allowing web developers to test sites against IE6 (which does not co-exist peacefully with IE7). I’ll avoid pointing out the obvious problems with their system, but thought the following might interest to people who develop on other platforms. Add:

and you get a VMware server image of WinXP and IE6 that you can run under any OS supported by VMware, which is to say just about any.

Steps, to make it clear (this all happens on a Windows machine):

  1. Unpack the VPC image of WinXP and IE6.
  2. Install Virtual PC.
  3. When Virtual PC prompts you, create a new virtual machine; at the prompt for what storage to use, choose the “pre-existing hard drive” option and point VPC to the file you unpacked in the above step. This will create a .vpc file (typically in My Documents/My Virtual Machines).
  4. Run VMware Virtual Machine Importer and import the newly-created .vpc file from the previous step. In a few minutes, you’ll have a VMware machine image you can then use on any OS.
2006.Nov.20
Filed under: Kubuntu — jon @ 12:03

The kdevelop 3.3 in kubuntu’s edgy’s repository has a nasty tendency to lock up when working in C++ code. Apparently this relates to it using an old and creaky Berkeley DB version. I’ve been using 3.4 on my two development machines for a long while, but thought it might be helpful to folks to post the instructions here on how to get and compile the code. These are based on the requirements and installation instructions on the kdevelop site. (I recommend uninstalling the old kdevelop from Adept before you do this.) This involves a few steps:

  1. save the below scripts (and patch file) to a directory. Make all scripts executable (chmod u+x *.sh).
  2. get the required libraries/packages (sudo kdevelop-get-packages.sh)
  3. get the kdevelop source code and patch files to make it work on edgy (kdevelop-get.sh)
  4. configure the kdevelop build (kdevelop-configure.sh)
  5. build (cd kdevelop-3.4-source; make -s) and install (sudo make install)

Here are the scripts I used. I don’t guarantee them, but they should get you a good start.

2006.Oct.31
Filed under: Kubuntu — jon @ 13:45

After upgrading to Kubuntu Edgy, I couldn’t get vmware server to run. After stumbling upon a thread about it over at the VMware forums, the solution was: uninstall libdbus-1-2 with Adept. It works fine now!

2006.Oct.29
Filed under: Kubuntu — jon @ 11:01

Ubuntu/Kubuntu/Xubuntu has released 6.10 (Edgy Eft). The noticable upgrades from 6.06 are Firefox 2, faster bootup, and a simpler control panel for system settings.

There have been reports on the forums of people having difficulty upgrading from 6.06 (Dapper), but I’ve had no problems here. (I used the CD-ROM to upgrade.) I’m in the middle of some consulting work so can’t upgrade the other machine, but I’ll update this when I complete that install.

Update: the upgrade on my Dell Inspiron 9300 went fine. I got one error during the “apt-get dist-upgrade” step, but running it a second time retrieved the remainder of the packages. Power management is much improved over Dapper.

Next Page »
  • dreamhost.com logo
    Happily hosted by dreamhost.com
  • This site is green.
  • Bike Month
    miles biked47.50
    gallons saved1.36
    dollars saved$5.22
    pounds CO2 saved26.60
    calories burned1677