Loading JNI libraries on the Mac

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

.. -- 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.

  1. 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

  1. 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

  1. I started off with the basic CEDET configuration from the setup page.
  2. While I was at it, I installed Exuberant Ctags using MacPorts and enabled it in CEDET::

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

  1. 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…)
  2. 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.
  3. Followed the directions in jde/doc/install.html
  4. 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

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

ant configure
ant build
ant dist

  1. Add the dist directory to my load-path.
  2. Add (load ”jde-autoload“) to Emacs startup.
  3. 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.

  1. 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.

  1. Enjoy.

Dear Dell: Stop the paper!

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?

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

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

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

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?

Failing at spam

I got some spam the other day. It told me I need "professional web site design":

You Need Professional Website Design!
If your website and campaign elements don't look and feel professional you can bet your loosing money. Today's online generation expects and demands high end professional graphics to project quality & trust.

Three grammatical errors in the first sentence. Now we're off to a professional start. I don't think I'll be going there for site design any time soon…

Bicycles

http://www.treese.org/win/wp-content/uploads/2008/07/jamis-coda-sport.jpgI ordered a http://www.treese.org/win/wp-content/uploads/2008/07/jamis-coda-sport.jpg Jamis Coda Sport today, for riding with the kids and for occasionally riding to work. The manager at Harris Cyclery in West Newton recommended it to me, and a test ride convinced me. I had also been looking at the Trek 7.3 and the Specialized Globe Sport. For bike shopping in the western suburbs of Boston, I found the following places interesting:

Harris Cyclery
1353 Washington St.
West Newton, MA 02465
+1 617 244 1040
A very serious bike shop; also good for beginners.

Spoke-N-Wheel
119 Boston Post Road (Route 20)
Sudbury, MA 01776
+1 978 443 6696
This is the first place I went. I called to make sure they were open on the evening before July 4, and the person said yes. When I got there an hour later, they had closed early, and were closed all weekend. I would have liked to see what they had, but I decided not to wait. They also have stores in Westborough and Waltham.

Landry's Bicycles
790 Worcester Road (Route 9 eastbound)
Natick, MA 01760
+1 508 655 1990
This is where I looked at the Trek and Specialized bikes. They knew a lot about bikes, and I liked the store a lot. They have a couple of other stores in the area as well.

International Bicycle Center
71 Needham St.
Newton, MA
+1 617 527 0967
This is a pretty big shop, and they also knew a lot about what they were doing. I test-rode the Trek 7.2 and 7.3 bikes there. They have another store on Brighton Ave in Boston.

REI
Route 30 in Natick
+1 508 270 6325
As you might expect, the staff knew something about bikes, but not as much as at the specialized shops. I was surprised that REI was selling not-quite-as-good bikes for about the same prices as the bike shops.

Places I haven't been, but came across in looking for places to shop:

Ray & Sons Cycle & Ski
183 Main St.
Maynard, MA 01754
+1 978 897 8121

ATA Cycle
93 Thoreau St.
Concord, MA

About

Welcome to my personal blog! I'm Win Treese, and I write here about whatever seems interesting at the time. My major projects at the moment are researching a book on the history of Maxwell's Equations, and exploring some algorithms in image processing.

I have previously done consulting work on various aspects of computer and network security, served as Director of Programs and Project Management at Boston University's Hariri Institute for Computing and Computational Science & Engineering, led software development at high-performance computing startup SiCortex, worked on e-commerce systems (especially security) as Vice President of Technology for Open Market, one of the earliest Internet commerce software vendors, in systems research at Digital Equipment Corporation's Cambridge Research Laboratory, and served as Chief Systems Engineer for MIT's Project Athena. Of those, only MIT and BU are still operating.

I can be reached by email at treese@acm.org or on Twitter as @wintreese.