February 23, 2011

Worlds deepest ring trap!

Yup, I am quite sure they will never be deeper than this.
Squeezing any harder from the top would send the poor ions flying out the side.

November 24, 2010

Doing Y's again

I really should be doing some quantum schmantum, but couldn't help fiddling with some ideas for a best-compromise Y-intersection. This time around I'm firmly committed to Mathematica -- once you know the gotchas you can actually get some nifty performance. And the language is heavenly compared to most other things and Matlab in particular.

September 24, 2010

Local minima?

Somehow i don't feel that looking for local minima is going to tell me much when I take this to higher dimensions...

June 8, 2010

Mutliple non-admin users of GoogleAppEngineLauncher under OS X

If you do the right thing® and work as a non-admin user under OS X (10.6 / Snow Leopard), you will get strange errors if you are multiple users who try to use the GoogleAppEngineLauncher in order to toy with Googles awesome AppEngine: Only the non-admin user who (last) installed the program is apple to start the local server, everybody else gets an error that the server is unable to launch google/appengine/tools/os_compat.py or some such.
Turns out it's a permission problem: some of the files (which in my case are owned by sara:admin), doesn't have read/execute permission for everybody else:
fladmast:Contents janus$ pwd
/Applications/GoogleAppEngineLauncher.app/Contents
fladmast:Contents janus$ find . -name '*.py' -not -perm -005 | wc -l
     466
fladmast:Contents janus$ ls -l `find . -name '*.py' -not -perm +005 | tail -n 1`
-r-xr-x---  1 sara  admin  1938 May 16 08:28 ./Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/tools/bulkload_client.py

The fix is simple: Open a terminal and fix the permissions:
fladmast:/ janus$ cd /Applications/GoogleAppEngineLauncher.app/Contents/
fladmast:Contents janus$ sudo chmod -R +r,+X .
(That's a capital X in the chmod)

March 24, 2010

Scan processing with pdfimages and ImageMagick

Just for my own reference, the following procedure works quite well for turning greyish pdf scans into something printable:
pdfimages foo.pdf img
for a in *.ppm; do convert $a -level 50%,80%  ${a%ppm}png ; done
This uses pdfimages (on OSX you can grab the xpdf package from MacPorts) for extracting images from the pdf file, and then ImageMagick convert (probably MacPorts again) to set the white and black levels to 50 and 80 percent respectively. Without pdfimages, ImageMagick just calls ghostscript to convert the pdf at a fixed resolution which is of course useless for this purpose. Next time I might have a look at the contrast-stretch and auto-level options which might be a bit more robust.

January 1, 2010

Checking GMail contacts for iPhone sync issues

Google sync allows you to push sync your Google contacts to your iPhone. There are some quite arbitrary restrictions on the type and quantity of phone numbers that can be synced, as described here. Running the following piece of python next to an exported google.csv will check for entries that will loose phone numbers:
#Check a google.csv contact dump for iphone sync issues.
import csv
import collections 

#This is the problem: iPhone (when synced via exchange?) only allows
#a limited number of phone numbers -- which must be of specific types.
# See www.google.com/support/mobile/bin/answer.py?answer=139635&topic=14252
PhoneLimits={
 'Home':2,
 'Home Fax':1, 
 "Mobile":1, 
 "Pager":1, 
 "Work":3, 
 "Work Fax":1
 }

def limitViolations(limits,types):
 for (type,num) in types.iteritems():
  if num>limits.get(type,0):
   return '%d > %d entries of type %s'%(num,limits.get(type,0),type)
 return ''

reader = csv.DictReader(open('google.csv','rb'),quoting=csv.QUOTE_MINIMAL)
nPhone=-1
for row in reader:
 # First pass only: see how many phone columns are active
 if nPhone<0:
  nPhone=1
  while row.has_key('Phone %d - Type'%nPhone):
   nPhone+=1
  nPhone-=1
 # Use phonetypes to tally the types for the active row
 phonetypes=collections.defaultdict(int)
 for kPhone in range(1,nPhone):
  #if a phone value is given for this index, tally the type
  if len(row['Phone %d - Value'%kPhone])>0:
   phonetypes[row['Phone %d - Type'%kPhone]]+=1
 v=limitViolations(PhoneLimits,dict(phonetypes))
 if v:
  print('%25s: %s'%(row['Name'],v))



December 7, 2009

Restricting sshd to private key authentication on OS X 10.6

Mostly just a note for next time I have to do this.

Actions:

1) Edit /etc/sshd_config

cd /etc/
sudo cp sshd_config sshd_config.orig
sudo cat 'ChallengeResponseAuthentication no' >>sshd_config

2) Enable ssh

Go to sharing preferences and enable ssh for the relevant users.

Background

That should do it, other options are already ok by default:
# To disable tunneled clear text passwords, change to no here! Also,
# remember to set the UsePAM setting to 'no'.
#PasswordAuthentication no
#PermitEmptyPasswords no
Note that the comment is completely incosistent: the default is already 'no', and there is no need to set UsePAM no, as described further down in the config file.