Skip to content

This blog is now being maintained at http://bfj7.com/blog.

Blog has moved

This blog is now being maintained at http://bfj7.com/blog. Thanks for following along.

Advertisements

Severe weather and climate change

I was looking up a severe weather alert (45 MPH winds tonight) and stumbled on an interesting data visualization. The picture is of the deviation between the average temperature last month with it’s 30 year average.

I think it’s interesting that Russia seems to have the most severe deviation of any place on earth. Obviously, Russia is a large area of land, but why isn’t there a similar hot to cold to hot deviation in the western hemisphere?

.. oh, and I saw an albino squirrel today (not a joke).

Industrial tour of MPLS

Went riding this Sunday afternoon through some of the industrial parts of northern Minneapolis (MPLS).

[Link] to gmaps route.

That’s 19.0 miles, fixed gear @ 44×16 and 32c tire in front, 28c in rear (need to up the size on that rear to smooth out the pavement).
Here is me and my whip on top of an old rusted rail bridge on St. Anthony Parkway:

Relocating an SVN repository

I moved universities and servers and needed to move the subversion repository that used to live on my office computer. I don’t have an office server anymore, but I did manage to keep access to a linux server in Georgia. I can now update the working copy of the repository on my work laptop and home desktop using the ‘switch’ command via

> svn switch --relocate [OLD-SERVER-PATH] [NEW-SERVER-PATH]

Processing scanned papers, books, and notes

It’s been a long time since I posted anything. You can probably forgive me. I’ve been on the job market and just recently secured a job for next year. Yay.

I’ve been processing various scanned papers, books, and notes for easy reading on a (certain un-named) eBook reading “device” I recently acquired and which I nightly curl up with before bedtime. Said device reads PDFs really well, but not other formats, in particular it has trouble with the DjVu format. A DjVu reader exists for said device, but it’s slow, featureless, and junky (e.g. no text search).

The DjVu format is nice, it’s provides high fidelity scanned images packaged with searchable text. I want PDF files though, so here’s what I’m doing to batch-convert my .djvu files to optimized, searchable (OCR’d) PDFs.

  1. Convert a folder full of .djvu files to postscipt: here’s a Bash shell script which calls the djvups program which comes with the Mac OSX packaged version of djview (and djviewlibre).

    #!/bin/sh
    for file in *.djvu
    do
        name=`echo $file | sed 's/\(.*\)\.djvu/\1/'`
        djvups "${name}.djvu" "${name}.ps"
        echo
    done

  2. Convert postscript .ps files to PDF files (I’m using Adobe Distiller because I have access to a machine that has it installed, as well as Acrobat Pro), but you can use the free and open source ‘ps2pdf‘ command (along with a modified version of the script above) that is included when you install TeXLive or any modern LaTeX distribution.
  3. Batch optimize the PDF files, OCR them and embed the text. I’m using Adobe Acrobat Pro which is slick, but definitely not free. I’d like to figure out a free / open source solution to this part.

Third derivatives

Judging by sweatershirts, hats, and water bottle stickers, I have at least five \Delta\Delta\Delta‘s in my calculus class. I feel like membership in this sorority must bestow knowledge and skill in computing 3rd derivatives. Maybe not?

Sage interact: area optimization

Sage notebook code which produces an interactive area optimization problem typical of a first semester calculus course. The main feature is the slider which controls the slope of the hypotenuse.

@interact
def _(s=slider(-10,-0.1,0.1,default=-2,label='slope')):
    print "Try to minimize the area of the triangle whose hypotenuse\npasses through (2,3):"
    G=line([(0,-2*s+3), (-3/s+2,0)]) #s*(x-2)+3,(x,-1,6))
    G += polygon( [ (0,0), (0,-2*s+3), (-3/s+2,0) ], rgbcolor=hue(0.75))
    G += point([(0,-2*s+3),(-3/s+2,0),(2,3),(0,0)],rgbcolor=hue(0.95),pointsize=25)
    G.show(ymin=-1, ymax=10, xmin=-1, xmax=6, figsize=3)
    print "Area = %f" % (1/2*(-2*s+3)*(-3/s+2))

Here is a screenshot (since I couldn’t yet figure out how to get the example published and working on the public Sage server).

The (calculus) solution is to find the minimum (positive) value of the function \frac{1}{2}(-2x+3)(\frac{-3}{x}+2) which occurs at x=\frac{-3}{2}.

There are lots of great examples of the interact module on the Sage wiki: Examples.

Backing up my flickr photos and metadata

I’ve been trying to backup my flickr account for long time and haven’t (until now) found a good solution. I want to backup not only the original photos but the titles, descriptions, comments, geotags, etc. There are several programs that will run MacOSX / Linux for backing up just the photo files, but most (or all) of these don’t backup metadata or else they are really difficult to get running under OSX.

Today I found Offlickr.py, a python script that uses the python flickrapi module and libxml2 to do exactly what I want. Getting all this to work on Mac OSX 10.6 (Snow Leopard) took some searching and compiling so I wanted to record what I did here.

Steps:

  1. Download Offlickr.py and libxml2 source, put them in directory [DIR] (I downloaded ftp://xmlsoft.org/libxml2/libxml2-2.7.6.tar.gz
  2. Compile libxml2: untar the libxml archive and enter it’s directory:

    tar xvzf libxml2-2.7.6.tar.gz; cd libxml2-2.7.6
    and compile:

    ./configure; make; sudo make install

  3. Before you run Offlickr.py you’ll have to make sure Python knows where to find the libxml2 module. Mine got installed in /usr/local/lib/python2.6/site-packages so I put this directory in my python path:

    export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.6/site-packages

  4. Go back to [DIR]: cd ..
  5. Before running Offlickr.py you may need to make a modification. I had to do this to avoid getting the error:

    UnboundLocalError: local variable 'isPrivateFailure' referenced before assignment
    What I did (following this Google code issue) is modify line 390, by inserting the line:

        isPrivateFailure = False
    

    make sure the line is properly indented so that Python doesn’t complain.

  6. Now we’re ready to rock and roll. Find your flickr ID (e.g. mine is 97495157@N00) and run:

    mkdir BACKUP
    ./Offlickr.py -i 97495157@N00 -d BACKUP -p
    

    See the Offlickr.py page above for more commandline options.

Now I have a nice DVD backup of my 2250 flickr photos, complete with metadata! Awesome.

Tableau Diagrams

I just finished writing a complicated bit of combinatorics involving signed quasi-bipartitions for a paper I’m working on. Part of the proof relies on a simultaneous degeneration of two bipartitions which are subordinate to a pair of signed quasi-bipartitions. The diagram to explain part of that argument is pretty involved:

The layout and arrows in the diagram are handled by the XY package (xymatrix) in latex whereas the tableaux are drawn by a complicated latex macro, borrowed from my collaborators and extended in a few ways to produce the figures needed.

By the way, tableau is a French diminutive for “table” and tableaux is it’s plural.

Signed quasi-bipartition combinatorics

A diagram describing a simple simultaneous degeneration of subordinate bipartitions from signed quasi-bipartitions.