Uncategorized
Linux photo frame revisited
by mikez0r on Apr.07, 2012, under Uncategorized
Thanks to a hard drive crash, I’m recreating the Ubuntu-based photo frame for my parents.
Here’s the setup this time:
- Lubuntu 11.10 as the base
- Wally as the wallpaper changer ( http://www.becrux.com/index.php?page=projects&name=wally )
- fluxbox as the window manager, replacing LXDE. I like LXDE, but Wally can’t change the wallpaper under LXDE.
- unclutter to hide the cursor when it is idle
- a few customizations to the fluxbox startup:
in ~/.fluxbox/startup:
add the following lines just before the “exec fluxbox” line:
xset -dpms
xset s off
unclutter &
wally &
Those turn off the auto-power saving monitor feature, and disable the screensaver, hide the mouse cursor when idle, and finally starts wally at startup.
- one customization to make fluxbox load instead of LXDE:
in /etc/lxdm/default.conf, change:
session=/usr/bin/startlubuntu
to
session=/usr/bin/startfluxbox
Note: the wally icon does not show up in the system tray this way. If you start wally manually from the command line and save your settings, they stick.
UK Retrospective
by mikez0r on Jan.04, 2012, under Uncategorized
It’s been about a month now since leaving the UK, and I’ve been meaning to reflect a bit on my experience. I’m definitely glad to be back in California – my goodness, the sun is great! During my time in the UK, I was very negative about the place. Looking back, I’ve seen some redeeming and somewhat interesting qualities that I’d like to record here. Unfortunately, I’ve put this off for so long that only a couple of particular comments come to mind:
The relationship of (car) drivers in the UK is like the relationship of pedestrians in the US. I found drivers there to be generally extremely skilled (aware of their space) and very polite. In the US, when you’re walking around somewhere, most of the time people will be very polite about space, and apologize for running into you. Interestingly, the converse is also true – US drivers are comparatively awful relative to the UK, though pedestrians are extremely assertive about space there, and a trip to the store can be quite stressful for an introvert like me.
Of course, my time at the lab stands out as a high point – the SuperSTEM family was really something special to be part of.
More later, if I remember.
Letter to UC Davis Chancellor Katehi
by mikez0r on Nov.19, 2011, under Uncategorized
A letter to the UCD chancellor, in response to the police brutality that occurred on November 18:
=========================================
Chancellor Katehi,
The events at the student rally on November 18 have deeply saddened and upset me. The police – your police – demonstrated wanton and dispassionate abuse of peaceful protestors. These are not acceptable actions for any human being, let alone representatives of a world-class facility for intellectual development and exploration. I am appalled to be associated with a place that is host to such brutality.
I will be watching your reaction to these crimes carefully, and I hope your future actions and the actions of the University will sincerely reflect your supposed commitment to the Principles of Community.
Sincerely,
Michael C Sarahan, PhD
UCD Alumnus, 2010
Installing OpenCV with EPD on Ubuntu 11.04
by mikez0r on May.18, 2011, under Uncategorized
Quick note to self on getting OpenCV up on Linux with EPD.
When you run cmake (ccmake for the curses gui), toggle the advanced options. The python includes, binary, and lib directories are options that only show as advanced options. Change these to reflect your location for EPD. After running make, the cv.so library that python gets its functions from gets installed by default to /usr/local/lib/python2.7/site-packages/cv.so. Copy it instead to EPD_INSTALL_DIR/lib/python2.7/site-packages. You should be good to go, now.
Also, one other problem:
Ubuntu 11.04 has pulled the old switcheroo on library locations. If you’ve installed all the dev versions of the necessary libraries (libjpeg, libpng, libtiff, libzip were my problem libraries), you also need to create symlinks from their new locations to the locations that OpenCV’s make/CMake is expecting to find them:
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/libpng.so
ln -s /usr/lib/x86_64-linux-gnu/libtiff.so.4 /usr/lib/libtiff.so
ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/libz.so
This hint courtesy of:
http://www.nigeldunn.com/2011/05/14/ubuntu-11-04-libjpeg-so-libpng-so-php-installation-issues/
Windows command prompt here
by mikez0r on Feb.28, 2011, under Uncategorized
Learned a really handy trick today. To open a windows command prompt from Windows Explorer, you can click in the address bar (the cookie crumb trail in Windows 7). It will turn into your full path. Delete the whole path, and type cmd, then hit enter.
Linux wins again!
by mikez0r on Jan.25, 2011, under Uncategorized
I’ve been cursing the wireless card in my computer since I pieced it together last week. It’s an Asus PCE-N13. It didn’t require any extra driver installation under either Windows 7 x64 or Ubuntu 10.10. However, the signal was very poor in Windows, with constant drop-outs, and it would not detect any networks at all in Ubuntu.
I haven’t found a solution to Windows problems yet, but I blacklisted a few modules in Ubuntu, namely by adding these lines in /etc/modprobe.d/blacklist.conf:
blacklist rt2800pci
blacklist rt2800usb
blacklist rt2x00lib
blacklist rt2x00pci
blacklist rt2x00usb
Now Ubuntu is connecting like a champ. Blazing fast, and reliable. It seems to be using the rt 2860sta driver instead of the blacklisted ones now.
I originally found this information on the Ubuntu forums: http://www.uluga.ubuntuforums.org/showthread.php?t=1579053&page=2
UK bank suggestions
by mikez0r on May.27, 2010, under Uncategorized
For anyone thinking about moving to the UK (or maybe any European country), here’s some tips that I wish I had when I came over.
The banks that have been the most helpful:
NatWest required proof of address, and suggested that I get my bank at home to mail a statement to my temporary address here in the UK. Had I known that earlier, this would have been the best option.
HSBC has an account for incoming international people. You can (and should) apply for it before you come to the UK. They call it the Passport account. They do some background checks that took about a week for me. They then required me to prove my address back in the States. Unlike other banks, they accepted my proof of employment letters as proof of address (they had my US address on them.) The one down side is that their account costs 8 pounds per month. When you can’t get an account any other way, that doesn’t sound like so much.
The bank that sort of considered helping me, but screwed up with paperwork and cost me 3 weeks:
The co-operative bank
The banks that outright denied me any consideration:
Lloyd’s TSB
Royal Bank of Scotland
To the UK Bank system
by mikez0r on May.20, 2010, under Uncategorized
Dear UK Bank system,
In case you were wondering, I hate you. Your absolute refusal to even consider any piece of reasonable evidence that I am worthy of an account (aside from proof of address) is ignorant, irrational and most of all irritating. You acknowledge that I cannot obtain an apartment (and thus an address) without a bank account, yet you insist on proof of address. This is in spite of my proof of employment, proof of clean background check for entry to your national laboratory, and proof that I have paid over 1500 pounds as a deposit on an apartment, which I cannot move into until I have a bank account. Truly your stubbornness puts even retarded donkeys to shame.
Sincerely,
An employed American with a Ph.D. who has zero debt, has made one late credit card payment in 10 years, and now would prefer to put his money beneath his mattress, if only he could actually be paid without your slimy services.
by mikez0r on Apr.12, 2010, under Uncategorized
“It is the faith of all science that an unlimited number of phenomena can be comprehended in terms of a limited number of concepts or ideal constructs. Without this faith no science could ever have any motivation.”
L.L. Thurstone, Modern Factor Analysis
Spirals
by mikez0r on Mar.01, 2010, under Uncategorized
Some interesting maths from working on the dissertation. Yes, maths. I have to get used to the Queen’s proper manner of speech.
I study a material that is readily exfoliated into sheets. The sides of each sheet are not the same. This dissimilarity causes the sheet to roll up. You might be wanting a figure right about now. Me too. The sheet structure is easy – that’s just a matter of getting the crystal structure from some published source (e.g. ICSD). But how to turn this into a scroll? I tried Illustrator’s spiral tool to create a path, but got lazy trying to re-create the brush that would represent the structure. Plus, a friend noticed that when the diamond patterns get too close to one another, illustrator puts white space between them (makes one or both of them thinner). That won’t do for representations of reality!
So, I turned to the dark, non-artistic side: maths. You can draw a spiral pretty easily using polar coordinates. Check it out: if you have a line of length X, you can make a spiral by setting 2 things:
radius = x+inner radius of spiral
theta(angle) = some range of angles – how many times you want the spiral to make a complete circle.
In python with numpy and matplotlib:
import numpy as np
import matplotlib.pyplot as plt
r=numpy.arange(0,10,0.001)
theta=numpy.arange(0,4*numpy.pi,4*numpy.pi/len(r)
plt.polar(theta,r)
and you get
2 circles, no offset from 0.
Well, cool, but I need the spacing between layers to be some well-defined value. You can play with starting radii and/or number of times around the circle (and I did, before I got tired of it). Mathematically, you can set the either of these, and determine the other based on the spacing you want.
Spacing = length of line / number of times around.
So, when I want a spiral with 5 unit spacing, and I start with an initial radius of 100, I get 20 spins around the circle:
And you want Cartesian coordinates, because what good molecular modeling software recognizes polar coordinates? The nearest plot already shows this, but here’s how I got them. See how bumpy my lines are? Those are atoms! OOOO!
x=r*cos(theta)
y=r*sin(theta)
Basic geometry, I know, but I was proud of myself. Especially since I’ve been intending to figure this out for nearly a year and finally did it. And it only took me a day.


