Skip to main content


Showing posts from May, 2008

Compiling with Exiv2

make install puts
library in /usr/local/lib
includes in /usr/local/include/exiv2To the eclipse
Project->Properties->C/C++ general/Paths and Symbols/GNU C++ /usr/local/include/exiv2
Project->Properties->C/C++ Build/Settings/MacOS X C++ Linker/Libraries
This is a little tricky - the Makefile calls a bunch of things including libtool to set thinks up for the linker. My green horn way of compiling arbitrary source files was to copy


to a directory and then put the new source file under src/

Setting up a C++/QT project on eclipse under Mac OS X

The compile steps with Qt4 are:
qmake -project [generates a .pro file based on the files you have in the root directory]qmake [genrates the Makefile from the .pro file]make [gnu make that uses the Makefile to generate your project as a *.app folder]
To get eclipse to follow this chain I did
Fire up eclipse and choose File->New->C++ ProjectUncheck 'use default location' and browse to the root of your code treeEnter a Project name e.g. ChhobiQT
Pick Empty Project (leave MavOSX GCC as is)
At this stage eclipse will find your files/subdirectories and try and compile and probably give you an error. Ignore this smart ass behavior or uncheck Project->Build automatically
Project->Properties (If this is grayed out, make sure to click and highlight ChhobiQT)->C/C++ Build : Uncheck 'Generate Makefiles automatically''Build directory' set it to the variable ${project_loc}Run->External Tools DialogUnder program create a new entry and set:
Name : qmake1
Location : …

Install QT on mac os

Download QT/Mac OS edition [here]./configure
sudo make installAdd to path (bash shell)
export PATHIn project directory do [from here]
qmake -project
And there! You have an honest to goodness for Mac...

Eclipse and code directory/folder structure

Eclipse apparently requires (or required) a fixed directory structure [the mailing list rant, the bug report, the project proposal]. There is a short tutorial on setting up projects to pull in existing files from arbitrary locations [here, basically File->New->File click advanced]. In a recent version of eclipse 3.3.2 you can specify any root for the project, but your files have to all be under that root.

Photo organizer for Mac III

Ok, I'm gonna write my own.
GUI will be done in C++/QT -
I'm familiar with coding GUIs using this combination
C++ should give the necessary snappy response such an app needs for comfortThe database will be sqlite (the database will mirror the metadata for speedy searching and organizing)The core will be built around
libiptcdata OR
Both libraries are self contained, but I'm leaning towards exiv2 because libiptcdata can not read/write Exiv info Project road map:
Put down on paper what the program will do and what its interface will look likeDownload, compile and install QTFigure out API for exiv2Write a baby program to read and write metadata using exiv2. The baby program should use a text based interface but have all the functionality of the final productImplement the full design UPDATE:

My new direction, instead of messing around with exiv2's C code, is to go back to the idea of building an interface around exiftool.

To start with I'll do batch operations to speed t…

Back to Eclipse

Joon was using Eclipse and I looked over his shoulder and saw code completion. My eyes popped. Wha? I left Eclipse because it didn't have code completion rant rant. Turns out my memory was half right. Eclipse will do code completion only for registered modules. Some modules are registered by default and I saw code completion for those, but not for the ones I wrote and imported in my code.

Komodo has this nice feature that it will parse every file you import and generate the tables for code completion on the fly.

It seems that Pydev (Eclipse plugin for Python) requires you to register the module by going to Eclipse->Preferences->Pydev->Interpreter-Python and add the module directory to PYTHONPATH. [from here]

But, open source is open source. Komodo edit is nice, but its not the full thing - which costs money. So I think I will take up eclipse again...

Inkscape and Latex

One class of solutions (EQTeXSVG, InkLaTeX, Textext) generates a dvi file using latex, then converts the dvi to svg using pstoedit. pstoedit is a bit of a pain to get working on mac.

pydvi2svg is a python script that can do the dvi to svg conversion without recourse to pstoedit. It works just fine on Mac OS X (I just had to download the two archives on that site).

Now I just gotta plug it into inkscape as an extension...

Point to focus

There are several annoyances with Mac OS (No, it does not 'just work' anymore than Vista and XP 'just work' i.e. you should not stray too far from the fold) but my biggest goat is with focus changes.

Mac OS has click to focus. Fine. Just don't have the cursor blinking on a unfocused window pretending its ready to accept input.

Also, if you are gonna have Unix run in the background, do it properly. Don't let Mac OS X mess with good old Unix by adding all these strange permission bits that can even override the super user. That's terrible. If you can't do it from the command line, you shouldn't be able to do it at all.

Spicy Sushi and sweet chinese

When ordering a chinese dish you can ask for 'no sugar' because some dishes come with too much of it, even if they are spicy.

When ordering sushi, if it is spicy sushi it can be pretty spicy and take away the sushi taste.

Nationalgrid good, Verizon not so

National grid is the electric and gas supplier. Not having paid utility bills for 7 years I don't know if this is the norm now, but I am VERY impressed with their online accounts system and the ease with which payments can be setup and made.

Verizon on the other hand, an Internet Service Provider, has a lousy account management system. There all all sorts of Bill not found, service not found errors, to start with when I log in. I'm trying to set up home voice mail, and after a lot of searching (its even easier to find journal papers online) it turns out that I need an access number. No one gave that to me! So I gotta now PHONE their online support. That is another PhD project...

Verizon phone seems to be more oriented towards phone based support (1-888-553-1555). Their automated phone system quickly gave me my needed access number

Moving costs

Moving from a small 2 bedroom apartment with a few pieces of furniture (sofa-bed, 2 shelves, dining table, 2 desks, easy chair, misc tables/cabinets) and many books: about 100-120 boxes of medium size.

Truck (one way, Penske, 3 days) $290
Gas (~500mi) 60 gallons $223
Hotel room (1 night) $130
Movers $96 + tip
Total ~ $780

Moving to Boston : Penske is good

Of all the services I had to deal with during the move Penske truck rentals had the fastest and most pleasant phone response time by far. I phoned them several times (mostly to make changes and additions) and it was always fast and done right.

The truck was just fine : we had a small (700sq ft) two bedroom and we got a 16ft truck (that's what the Penske operator recommended). With our inefficient packing the truck was just filled. We did throw out a big couch, but that would have fit fine too. It cost $290

So two bedroom (700 sq ft) = 16" truck.

The gas cost was within expectation. It took three fillups (~500mi drive) totalling 60 gallons costing $225

The only jarring note was that a strange charge of $210 appeared two days after we returned the truck. I phoned Penske and they quickly looked into it and the guy said that there had been a mistake in logging the return and they were correcting the charge.

Komodo edit is great

You can code html and Ruby with it too and it does sweet things like close your <div> tags and put in 'end' to your 'def's.

I just gotta convinve John to order Komodo Ide for the lab

Electronic vs paper organizers

I spent $135 (or somewhat) to buy a Casio electronic organizer, and when that died I spent $200 to buy a Handspring visor. This was when I was a grad student and I really couldn't afford it. But electronic organizers were so shiny! The gadgets were fun for a while but then got old. In the end, I find that for todo lists the little paper notebook my better half gave me works the best. There's something to paper and pen that I can't figure out. For scheduling its google calendar, and now the new online calendar they have at work. I just couldn't figure out how to use electronic organizers effectively

Annotating pdfs with skim

For Mac there is this nice shiny aplication called skim, that looks very nice. You can add notes, highlight (two-column does not work) and export the notes. The notes appear as a list in a sidebar as you work. Importantly skim stores the annotations in the file itself. So why am I not using smim yet? Unfortunately the annotations seem to be in a skim specific format, so that preview can not pick it up (and so acrobat reader might not either). Skim is not available for windows, so I'm not sure if I should lock myself in.

Don't use google scholar to calculate your H-index

or any other index of academic performance, because you will rank lower than Drs A Potential NN Blog and D Discovery, for sure...

Python webserver

A python webserver can be a pretty short file [fragments], but an interesting tidbit on linux (and Darwin):

From [here]:
If you are trying to run a server on a port < 1024 on linux, you need to
be root (they are "priviledged ports").Otherwise you will get
socket.error:(13,'Permission denied')

Another implementation of a webserver [aspn cookbook]

Organizing photos into folders by date taken

Aaah, the command line. After downloading from the camera I wanted to move photos into separate directories based on their date


#This is a somewhat inefficent (calls exiftool many times) script that will put pictures
#into a date based directory structure. The script will use exiftool to read the date the
#picture was taken and then move the picture into an apropriate directory

#Requires bash, exiftool
#Works on Darwin and most probbaly any *nix distribution

shopt -s nullglob #if no file is found the pattern *.jpg will expand to itself, but this prevents that

for file in *.[jJ][pP][gG]
date=`exiftool -d "%Y-%m-%d" -s -s -s -DateTimeOriginal "$file"`
mkdir -p $year/$date
mv $file $year/$date/

bash string manipulationexiftool manualadvanced bash scripting guideUPDATE:

Hah! This whole script can be replaced by the following exiftool command

exiftool -d %Y/%Y-%m-%d "-directory<datetimeoriginal" *.JPG

Man, exiftool is a po…

commands module

The commands module enables us execute a shell command and suck the stdout response into python.


import commands
commands.getoutput('exiftool -Subject -s -s -s IMG_6754.JPG')

Read image metadata in Python

Install iptcinfo package:
easy_install iptcinfo

info=IPTCInfo('test.jpg')['caption/abstract']='Witty caption here'['supplemental category']=['portrait']
info.saveAs('test_out.jpg')# keep original safe

But this will not read arbitrary tags, like exiftool will

Photo organizer for Mac

I really miss MS Photo Gallery. iPhoto and KodakEasyShare do not read Photo Gallery's metadata. iPhoto does not store info in the image metadata, it uses an xml file instead.

I'm now trying out mapivi. Its written in perl/Tk.

Getting Tk setup on mac [Bug's mac page]
Mac OS 10.5 has perl 5.8.8Download Tk tarball from cpan [current version]perl Makefile.PL
make test [This is FUN to watch]
sudo make installGet Image::MetaData::JPEG and follow the above steps to install.

mapivi is neat, but does not read the windows photo gallery metadata. I'm begining to think I need to cobble together a script that will move metadata around from one tag to another in order to make my pictures usable across applications.

Verizon FiOS 20/5 serivice

Verizon supplies an Actiontec M1424WR Router. The defaults are:
User: admin
Pass: password1
[cbuck03's blog]