Nerd


In the name of ergonomics, I’m training myself to not touch the mouse and keep hand movement to a minimum. Here’s a few tips that have been the most helpful to me:

  • - changing tabs in firefox: use alt-numbers. I keep gmail open in tab 1, so switching to it would be alt-1. mostly, my most recent tab is the furthest one out in my bloated tab bar. To get to the last tab, press alt-9. Great for quickly checking any email, then switching back to whatever else I was reading.
  • - Code editing with emacs/vimpulse. I’m no pro, but I have used vim for about 5 years, thanks mostly to Gentoo Linux tutorials. I admit to being the typical noob, and staying almost exclusively in insert mode. As part of my experimentation, I followed the superb vimtutor tutorial (just type in vimtutor at your command prompt if vim is installed). vim is awesome! you can move about so easily! However, all of my internet reading suggested that the architecture of emacs would get me a little further in the long run. In emacs, moving around in files is not quite as easy. This is where vimpulse (or viper) comes into play. It lets me use vim commands to move around, but allows me to do so within the framework of emacs. Best of both worlds!

I’m out for now, but I’ll update this post or make new ones as I explore.

Some odd notes of potential usefulness as I stumble through dissertation writing:

  • Proper figure numbering is accomplished by including the \label{} command inside the \caption{caption} command. Otherwise, it catches the section number…
  • Mendeley is great for managing references. Set the web importer up as a bookmark in the bookmark toolbar. It can grab references from Google Scholar, Google books, and many others. I find that the direct grabs from a Google Scholar search are incomplete – where possible click the link through to the page with the abstract, and import the article from there.
  • Store your articles with Mendeley’s web storage to keep them in sync across multiple computers. To start storing them, right click your “All Documents” collection, then “Edit settings” (Why isn’t there any reference to this in Mendeley’s program settings? I had a hell of a time finding this.)
  • \ref and \cite are very different Latex commands. If a bibtex reference refuses to show up, you probably tried to cite it using \ref, rather than \cite. \ref is for references defined by \label.

And… my theme here apparently has a problem showing bulleted and numbered lists…

I wanted to make a nice, pretty text file from some log info, but python didn’t want to cooperate with string formatting.

I was trying something like this:
f=open(‘file’,'w’)
f.write(‘%-10s’ %string)

At the interactive prompt, the equivalent print command would give the desired result.

I got it to work by replacing f.write() with
print >> f, mystring.ljust(10)

This code has the same net result of printing to the file, but it actually does the spacing properly.

This thread gave me the hint I needed, though it looks like the poor guy never resolved his issue – he should have tried the print suggestion.

http://bytes.com/groups/python/25205-using-string-ljust-try-hold-fixed-width#links

Digital picture frames are neat little gizmos – especially for showing pics to my parents, who are rarely, if ever, inclined to poke around flickr (or anything much beyond their email).  I have had various setups for a while using an old laptop.  At first, I used Windows, because the wifi drivers for Linux were either missing for my card, or inadequate (non-functional, or locked up computer frequently).  I have finally gotten a card that agrees with Linux (the Intel 2200BG MiniPCI), and the computer is now up and running with Xubuntu.  Many options are out there for picking particular sets, or photos by interestingness, but I wanted simply a way to download my whole photostream and allow a screensaver to meander the collection.  Not all of my photos are interesting, but they have other personal value of interest to parents.

The synopsis of what I do:
- Use flickrfs to mount my photos on the drive
- rsync to copy photos from flickrfs to local drive
- cron to run photo update scripts nightly

To do this yourself,

  1. Get flickrfs – on Ubuntu/Xubuntu 8.04 and 8.10, this can be accomplished with
    apt-get install flickrfs  (sudo as necessary)
  2. Make 2 folders – one to mount flickrfs to, and another to store your pictures locally.  Make sure you have write access to both of them (obviously)
  3. Mount the flickrfs filesystem to the folder you created for it.  This is as simple as the command
    flickrfs /PATH/TO/YOUR/DESIRED/MOUNTPOINT

    After running that command, a web browser will open for you to authorize flickrfs to access your account.  Eventually, the command line window will spit out something about updating your sets, and tell you when it’s done.

  4. You should now have 2 folders in your flickrfs mount point – sets and meta
  5. If you have the 2 folders, create a folder named “stream” in the flickrfs mountpoint. If you don’t have the 2 folders and you create the stream directory, fuse will complain about a non-empty directory.  The flickrfs mount point must be empty until it (flickrfs) puts stuff there.
  6. Wait 5-10 minutes for flickrfs to populate the stream folder
  7. rsync to copy files from the flickrfs/stream/ folder to your local pictures folder.

If anyone finds it useful, here’s the script that I have cron run to update my local Pictures directory with the contents of my photostream.  There’s also a bit in there to clean up empty files.  rsync seems to be not quite perfect with flickrfs, and I accumulated a few empty jpg’s that confused the screensaver.

flickr-update

I display the pictures using GLslideshow, which is standard with xscreensaver.  I replaced gnome-screensaver with xscreensaver, as configuration of xscreensaver is easier.  To ensure that xscreensaver is always reading a fresh set of photos, I kill it and restart it nightly (cron is really useful!).  I did have to tell XFCE to start xscreensaver at startup – it isn’t a completely automatic drop-in replacement for gnome-screensaver.  To point xscreensaver at your local pictures directory, check the advanced tab in the upper right, and change the folder where it looks for pictures.

Side note: The Perl installation for Ubuntu 8.10 has a bug with xscreensaver.  It dumps yellow text onscreen, something about a constant being changed.  I fixed this by adding a debian sid repository to my third party software, and using the Perl version from there, since it’s more up to date.  It fixed the yellow text problem for me.  The older this post gets, the less likely this will be an issue for you – I imagine the Ubuntu people will update this soon.

Check this out!!  I found Sue’s long lost buddy/brother/sister!!

Sue is the better looking bike, obviously…  =)

No?  Well, fine… She’s the bike with more cool stuff on her.  The one that’s obviously loved more.

This is what studying too much math will do to you:

I analyzed the Chinese zodiac while eating out last night.  Any of the recommendations that it tells you to avoid marrying are based on 6-year intervals.  Strangely, the boar doesn’t follow this pattern.  The boar is advised to be wary of itself, rather than its 6-year offset counterpart.  Any of the recommendations of who to marry are based on 4-year offsets, which led me to draw a parallel between the zodiac and the photographer’s rule of thirds.  For those not familiar with it, it says that most aesthetically pleasing photos can be composed by putting the subject of interest at a position 1/3 into the frame from any given side.

Lately I’ve also been pondering my move out of my apartment, and I’ve come to recognize that moves often are well described by logarithmic functions, with work being the independent variable (the x axis) and progress being the dependent variable (y axis) – your progress starts out very fast for a given amount of work, but pretty quickly degrades until it feels like no matter how much work you do, your overall completion changes little.  I think everyone feels this way, but how many people fit functions to their feelings?

Yikes.

I’ve been at a conference in New Mexico since last Tuesday, and I’ve had lots of interesting encounters and discussions.  One today was really frustrating though, so I’m writing about it.  I met a seemingly brilliant man who has come up with a new way to reconstruct 3D models from 2D projections.  He does it very quickly and with fewer projections than I thought possible, and with very good results.  He asked me what I was doing, after I gave him some details on GPU programming.  I don’t really have a well-defined plan yet, but I think I’d like to make it easier and more accessible for anyone to do these 3D reconstructions.  There are a number of programs, but most of them are variously counterintuitive, incomplete, poorly documented, buggy, etc.  I would like to create a framework for doing the image processing and reconstruction, and do it in such a modular way that it would be easy for anyone else to add to it in the future.  The best (non-commercial) program that I know of is IMOD, but it is not modular this way.

Well, this guy has developed a fairly complete package for all the steps of reconstruction, but he’s keeping it under wraps.  The way that he wants it to work is for people to send him data (2D images), and he’ll reply with their 3D model.  That’s a black box.  I hate black boxes.  They can’t be trusted, especially in science.  If you don’t know how someone is doing something, then their result can’t be trusted.  I don’t care how good it looks or how well it matches with the 2D data.  Open Source software is the obvious opposite of this, but I don’t think that everything has to be open source.  It should, however, be completely clear what a program is doing, to ensure that it is scientifically valid.  He did present a poster, and he vaguely details his methodology, but he intends to keep the detailed workings secret.

On the other hand, if everything was open source, I’m convinced that progress would be much faster.  There would be so much less duplication of work.  America’s economic model is obviously not compatible with everyone working together, and I don’t know of any other economy that would be totally compatible.  It is a pipe dream, but it sounds nice.  In this particular example, if everyone would work together, rather than 15 different labs all creating their own software, then perhaps one or two truly high-quality software packages could have been developed by now.  I don’t pretend to know how you’d split up funding or even put in a proposal for that sort of thing, but it seems like a more logical solution to a problem that we all face, and a problem that is far more general than 3D reconstruction software.  Linux has proven a lot of things possible, and we’ll see over the course of the next 10-20 years if my ideas of open development speeding beyond closed source actually come true.

My hard drive died.  Sort of.  It wouldn’t work at all inside my computer.  I put it into my external enclosure, just to see if it was my motherboard/SATA cable, or anything but the HDD.  It worked!  For 20 seconds…  That got me thinking that maybe it was overheating.  How better to cool it than with liquid nitrogen?  I’m at school, anyway…

Well, one empty trash can and a quick trip to the dewar, and I had a deep-frozen hard drive that did absolutely nothing.  It wouldn’t turn on.  I put it aside and went about disposing of the liquid nitrogen.  I poured out about half of it on the floor.  If you’ve never done this, you really should!  It fizzes and little droplets dance around the floor and collect all the dust into little spots.  Well, the drops raced into the hallway and fizzed menacingly.  Nobody was around, thankfully, or I might have had some questions to answer.  I dumped the rest onto chairs – a handy absorptive medium.  Quite the opposite of a hotseat.

Having disposed of the cryo-liquid, I wondered if the hard drive would work again after it had warmed.  These things usually have operating temperatures, and they’re usually not encompassing of liquid nitrogen temperatures.  I tried warming it in my jacket (while wearing it), but it was too cold for me.  I stuck it back in the computer for some heat.  I went off and played games for a while, came back, and had a nice, roughly 5 degree C HDD, which worked perfectly for me to salvage my files.

I don’t recommend trying this yourself.  I’m not really sane, and this wasn’t really safe.  Still, it is cool that it worked…

I run linux at work.  It eases my conscience to not depend on Microshit.  Fedora 9 was released today.  I’ve been a Ubuntu fan for a while now, but some of the software I use for work (IMOD) isn’t easily made to run on Ubuntu.  I know it should be just figuring out the proper paths to tell it, but I wasted a day and decided it wasn’t worth any more time than that.  On to Fedora (8).

Now, with the update today, I tried the preupgrade option.  It’s a cool idea – it downloads updated files, reboots, does whatever changes it needs to, and bam, updated OS.  It stalled at the later stage – 90.0%, something about metadata.  I figured it sounded too good to be true anyway.  I downloaded the new install DVD (thanks kernel.org!), and tried an upgrade install.  It took forever!  Why do these take so much longer?  I know there are more packages to install, and maybe these have to be downloaded.  That’s a valid excuse.  Well, ok, this time it finished.  I rebooted to a pretty unhappy computer – no GUI at all.  The display flickered a bit, and then gave up.  Command prompt time.  I checked into Xorg’s log file – version mismatch on the video driver (radeonhd).  Must not have gotten updated in the upgrade install (why not?)  A quick yum install took care of that, and X came up.  However, none of my desktops would load – not gnome, not KDE, and not enlightenment.  Showstopper.  I rebooted and did a fresh install.  Now things are pretty good.  I had to fight to get Flash working.  I had to feed my Pandora addiction.  For those of you wanting to know how to accomplish this feat, you must sacrifice your first born with a 32-hour old blade under a full moon…

No, really, here’s what you have to do (from http://docs.fedoraproject.org/release-notes/f8/en_US/sn-Desktop.html):

  1. Create the 32bit mozilla plugin directory using this command:
    su -c 'mkdir -p /usr/lib/mozilla/plugins'
  2. Install the nspluginwrapper.i386, nspluginwrapper.x86_64, and pulseaudio-libs.i386 packages:
    su -c "yum -y install nspluginwrapper.{i386,x86_64} pulseaudio-libs.i386"
  3. Install flash-plugin as shown above.
  4. Run mozilla-plugin-config to register the flash plugin:
    su -c 'mozilla-plugin-config -i -g -v'
  5. Close all Firefox windows, and then relaunch Firefox.
  6. Type about:plugins in the URL bar to ensure the plugin is loaded.
  7. If it isn’t loading, try this command (firefox 3 does things a little differently from firefox 2)
    su -c ‘ln -s /usr/lib/mozilla/plugins /usr/lib64/firefox-3.0b5/’

Now sound probably isn’t working yet.  Run these commands next, then restart firefox if you have it running at this point.

su -c "yum -y install libflashsupport-000-0.5.svn20070904.{i386,x86_64}"
su -c 'mozilla-plugin-config -i -g -v'

Thanks to http://www.derekhildreth.com/blog/how-to-fix-the-no-sound-issue-in-firefox-flash/ for this last bit.

YMMV, but I hope this helps.

For those of you who’ve seen Hollywood’s latest pile of poo on my childhood cultural icons:

VG Cats comic

That comic pretty well captures my sentiments.  It did a great job of bastardizing the franchise in the name of quick entertainment.  I don’t know why I expected anything more – perhaps it’s the optimist that I’ve tried to tie up, suffocate and drown deep inside.  Thanks a lot Hollywood, for showing that poor little remnant of happy me how undeserved its faint glimmer of faith is.