Archive for August, 2007

Taking Snapshot of Google Map

Wednesday, August 29th, 2007

My boss is great fan of google map geographical visitors of our website, and he wants to show it in the main page. I was bit worried about the delay caused by the javascript making the overlay on the map. So I decided to taking a snapshot of it and use it for the main page.

First, I didn’t want inventing a wheel, so I tried to use webkit2png. Obviously, I was asked to install PyObjcC, but it wasn’t easy to install in my machine (WebKit problem). I’ve installed Safari beta 3, and some people blamed it as it pretends having WebKit SDK while it doesn’t. But changing symbolic links for WebKit SDK didn’t work.

So, I’ve shifted my gear and thought. What if using AppleScript and Paparazzi? I’m totally newbie in AppleScript world, so I’ve looked for what others have done. Galarrhea is an AppleScript making a snapshot of each of your Ma.gnolia and del.icio.us bookmarks using Paparazzi.

Base of what he have done, I was able to capture the geographical visitor page, and I used ImageMagick to cut off the google map region from the big-fat-page image. And I also used scp to upload the snapshot to the server. I considered exploiting Transmit with AppleScript, but my server is over the firewall, and I need to use SSH Tunneling to go through it directly, so I decided to stick with a shell script.

Here’s the script. geovisitors.scpt

Compiling CHARMM c33a1 on Mac OS X

Wednesday, August 15th, 2007

Compiling CHARMM on Mac OS X is supposed to be easy; The install script has identifier osx. However, I encountered numerous problems while I tried to compile it. So here I leave some comment how I worked around the problems. Probably, I suspect some of the problems are because of my group is using little modified version of CHARMM, so this may not same for everyone.

  1. pre-requisites:

  2. ./install.com osx large ifort nolog

  3. The first error message that I’ve encountered is:

    eutil.f: In subroutine ‘enerin’:
    eutil.f:2234:
    ceterm(XMAP) = ‘XMAP’
    ^
    Invalid declaration of or reference to symbol `xmap’ at (^) [initially seen at (^)]
    make: *** [/Users/sunhwan/Programs/c33a1/lib/osx/energy.a(eutil.o)] Error 1

    The workaround for this error is putting XRAYMAP to the file build/osx/pref.dat.

  4. The second one is:

    /Users/sunhwan/Programs/c33a1/source/machdep/cstuff.c:30:23: error: bits/time.h: No such file or directory
    /Users/sunhwan/Programs/c33a1/source/machdep/cstuff.c: In function ‘fmalloc_’:
    /Users/sunhwan/Programs/c33a1/source/machdep/cstuff.c:104: warning: conflicting types for built-in function ‘malloc’
    /Users/sunhwan/Programs/c33a1/source/machdep/cstuff.c: In function ‘fsystem_’:
    /Users/sunhwan/Programs/c33a1/source/machdep/cstuff.c:145: warning: incompatible implicit declaration of built-in function ‘exit’
    /Users/sunhwan/Programs/c33a1/source/machdep/cstuff.c: In function ‘fputenv_’:
    /Users/sunhwan/Programs/c33a1/source/machdep/cstuff.c:278: warning: incompatible implicit declaration of built-in function ‘exit’

    The workaround: edit the file source/machdep/cstuff.c line 30, from bits/time.h to time.h

  5. Lastly:

    /usr/bin/ld: Undefined symbols:
    xraymap0
    collect2: ld returned 1 exit status

    Workaround: replace build/osx/energy.mk to energy.txt.

Again: I am suspecting the first and the last errors are related with my source, others may not suffer from them.