NBC can’t do math

June 21st, 2010

On a story tonight about large serving sizes of cheap food, NBC noted that the average dinner plate has gone from 9″ in diameter in the 1960s to 12″ today, “or 33% larger”. But, from a food point of view, it’s area that matters, and a 12″ plate is 77% larger in area than a 9″ plate (because area grows as the square of the radius).

Do the math, NBC!

Intuit can’t download tax data from Intuit?

March 29th, 2010

My business uses Paycycle, owned by Intuit, for processing payroll. But Turbotax, made by Intuit, can’t import W-2 data from Intuit.

What’s up with that?

Then again, Turbotax data import this year isn’t impressive. It crashes downloading from one brokerage, and gets mangled names for securities on another one.

Programmers of the World, remove the hyphens!

January 22nd, 2010

Like many of you, I’ve written code for web sites. How hard is it to remove spaces and hyphens in credit card numbers and phone numbers? Usually, it’s a one-line regexp. And some test cases. Don’t forget the test cases.

People make measurably fewer mistakes when they can punctuate long number strings. It’s easy enough for us to let them do it.

So write the code.

Loading JNI libraries on the Mac

January 18th, 2010

I’ve been trying to build a simple JNI library from C code on the Mac (Snow Leopard). Compiling it seems pretty straightforward, but the Java library loader isn’t happy. I can call

System.load("/tmp/jnitest.jnilib");

which works fine, or

System.loadLibrary("jnitest")
// or
System.loadLibrary("jnitest.jnilib")

with java.library.path set to “/tmp”, which doesn’t work.

I’ve given up trying to understand it for now. I spent way too long googling on the Intertubes for information, which points to problems with Java 1.6 on Snow Leopard, but I didn’t find anything that was even consistent with this behavior. On the other hand, I can at least make progress for the moment, since the JNI calls work.

Browsing code with Aquamacs Emacs

September 15th, 2009

.. -*- mode: rst -*-

I’m working with some C, C++, and Java code now, so it’s time to get Emacs set up to do that nicely on my Mac. Getting all the pieces working was trickier than I expected, so here are some notes about it. I wanted to get a working setup that includes ECB (the Emacs Code Browser) and JDEE (the Java Development Environment for Emacs). Both of them use CEDET (the Collection of Emacs Development Environment Tools).

1. Started off with a clean installation of Aquamacs, a nice adaptation of Emacs for Mac OS. The JDE plugin for Aquamacs is nice, but the current version of ECB needs a newer version of JDE, so I didn’t install the plugin.

2. Installed ant-contrib package for JDE to use::

sudo port install ant-contrib

Ant itself was already available.

3. Checked CEDET out of subversion::

cvs -d:pserver:anonymous@cedet.cvs.sourceforge.net:/cvsroot/cedet login
cvs -z3 -d:pserver:anonymous@cedet.cvs.sourceforge.net:/cvsroot/cedet co -P cedet

4. Followed instructions in cedet/USING_CEDET_FROM_CVS (The Mac ships with a terminal-based version of Emacs 22, which is good enough to compile the CEDET Lisp files.)::

cd cedet; make EMACS=emacs

5. I started off with the basic CEDET configuration from the setup page.

6. While I was at it, I installed Exuberant Ctags using MacPorts and enabled it in CEDET::

(semantic-load-enable-primary-exuberent-ctags-support)

7. Started up Aquamacs to make sure everything is working. (It’s handy to run the terminal Emacs to work on the files while all this starting and exiting is going on…)

8. Now install JDE dependency elib: download from the JDE SourceForge site. I am using the source directory directly instead of installing the package on the system, so just run make in the directory, and add the directory to my own load-path.

9. Followed the directions in jde/doc/install.html

10. Create a ~/.jdee-config.properties file for Ant to use::

cedet.dir=/Users/treese/devel/emacs-programming-environment/cedet
elib.dir=/Users/treese/devel/emacs-programming-environment/elib-1.0
prefix.dir=/Users/treese/devel/emacs-programming-environment/jde

11. Configure and build with ant (double-check the build.properties file after configure)::

ant configure
ant build
ant dist

12. Add the dist directory to my load-path.

13. Add (load ”jde-autoload“) to Emacs startup.

14. Checkout ECB and byte-compile it::

cvs -z3 -d:pserver:anonymous@ecb.cvs.sourceforge.net:/cvsroot/ecb co -P ecb
cd ecb
make CEDET=../cedet

The CEDET value should be wherever you have CEDET installed. I just pointed it to the source directory I’m using.

15. Add the ECB directory to load-path. It’s easiest to then add::

(require ‘ecb)

for startup. I don’t start Emacs that much, so it’s cheap to do it that way. Besides, computers are fast now.

16. Enjoy.

Dear Dell: Stop the paper!

August 7th, 2009

Dear Dell:

These days, we all want to cut costs. And save the environment. How about you do both at the same time?

Stop sending me paper mail. Postcards? Don’t need them. Catalogs? Likewise. If I need a Dell PC, I know where to go. (Frankly, I haven’t needed one in a while, since I mostly use Macs, but I have bought them on occasion.) Actually, the last ones were for someone else.

I have followed your website instructions about 5 times over the past year, and it’s not getting through. I called another company about a similar problem, and they stopped. Calling doesn’t seem to work with you, Dell.

Heck, if you insist, I’ll even put up with getting emails from you. At least the bits get recycled. (And I can filter the email. Oops, forget I said that.)

Sincerely,

Don’t Want Paper

What's next?

June 1st, 2009

Last week, SiCortex ceased operations and started an asset sale process. There are various accounts around the net; CNET has a decent brief summary. I’ve been with SiCortex since just after it was funded in October, 2004, and it’s been a lot of fun. We had a great team, a fascinating product, and some of the best customers anyone could hope to have. For the next short while, I’m still with the company to assist with the asset sale process.

After that, what’s next? I’m starting to look at several things, both new startups and established companies, and taking some time to do that. In the interim, I’ll be updating the site for my consulting company, Serissa Research, and possibly taking on some new business there.

What’s interesting? I’m not really sure yet. One of the consequences of focusing on a startup for a while is the fading of what else is happening. And one of the consequences of a forced change is a chance to look around again to see what really is interesting, from many points of view–technology, business, and value. Some of what I’m looking at will show up here, and some of it shows up in my column in the ACM’s NetWorker magazine.

So drop me a note if you’ve got something interesting.

(Yes, I know the link to SiCortex above will be dead sometime soon. But you can’t not link on the web!)

Learning iPhoto 09

February 14th, 2009

I’ve been playing with face recognition in iPhoto 09. It helps with tagging photos, but it wasn’t clear to me exactly how to get going with it. Curiously, there is no match for “face” in the Help, so that was not, um, helpful. Fortunately, Gizmodo is helpful, with “iPhoto ‘09: The Definitive Review and Tip Sheet”.

Now iPhoto should be done guessing photos of my oldest daughter, so I’ll get back to telling it when it’s right.

Update: the problem was that the help cache was out of  date. Here’s how to clean it. Now the mystery isn’t why there’s no help, but why this problem lingers so long in MacOS.

Making vCards from an LDAP directory

February 10th, 2009

We’ve got an LDAP directory at the office with names, phone numbers, and email addresses. It’s handy to get that all into my address book, which can import vCards. So here’s a Python script that does just that: ldap2vcard.

Web site rants, part 1

February 1st, 2009

I’m sure this will be a regular feature (web site rants, that is).

The support web site for Canon printers (and probably other products) has a search timeout. I was trying to find some helpful information about how to get my Canon Pixma iP1600 to actually feed paper, instead of just grinding for a while. It’s never been very good at doing that. I went away from the computer for a few minutes to see the block structure one of my daughters built. I come back, and the search session has timed out.

There are lots of web sessions I want to time out (my bank account comes to mind). But a search in the printer knowledge base? What’s up with that?