April 23rd, 2008
So I’ve gone and got myself a job. In California.
I recently made a trip down to the Bay Area to check things out, and see if I couldn’t find a place to live while I’m down there. During most of the week I spent there I didn’t have a car, so I got around by public transit. People told me that I was crazy, but I already knew that.
Between BART and Caltrain the service itself didn’t seem too bad, but signage was occasionally a problem. When there’s no indication at track level as to which direction the train will be going, things can be confusing. Millbrae Caltrain platform 5, I’m talking about you! On my first day, shortly after figuring out that the train headed south to San Jose, a backpacker who had been walking up and down the platform since before I arrived asked me which way the train went, and he was then asked the same question only a few moments later…

On a brighter note, cars seem to stop for pedestrians almost without fail, to the point that people will pretty much slam on their brakes if they see you waiting at a crosswalk. Contrast this to Markham, where you’re lucky if drivers even notice you, nevermind actually stopping.
It was pretty warm there, but according to my new boss you can get by without AC if you’re only at home in the evenings. This is something I have a hard time believing, given the temperatures I saw during my trip, but we shall see. I came away with a few leads for apartments, although given I can’t really go down there until the University gives me my diploma, I’m still a way off actually moving.
Posted in California | 1 Comment »
April 5th, 2008
My mother recently bought a Mac to replace her aging Dell. She still needed to be able to use all her old applications though, and many of them were only available for Windows.
Virtual machines to the rescue! (almost)
VMWare has had a Mac version of their workstation product available for a while now, and I’ve been using it on my Macbook with no issues, so I decided to try and get her old machine stuffed into a vm. Some searching turned up this article, which explained how take the contents of the old computer’s hard drive and create a .vmdk file for use with VMWare. I booted with Knoppix, and ran:
qemu-img convert -f raw /dev/hda -O vmdk boot.vmdk
which produced a file that VMWare was able to boot from – so far so good. Unfortunately, Windows didn’t really like being transplanted like that, and refused to let anyone log-in until it had been activated again. After a call to Microsoft, I was told that OEM installs of Windows “die with the computer they were shipped with”, and that we would need to buy a new license for the new computer, which is what my mother decided to do.
I will be trying this again with Linux in the near future, as I’ve got a few old machines acting as servers that could be consolidated into one box with virtualization, and they shouldn’t complain about anything but hardware changes (I hope…)
Posted in Systems | No Comments »
December 24th, 2007
I’ve been moving a site I built for a client quite a while ago over to a new server. The old server had been using versions of apache 1.3.x and mod_auth_mysql compiled from source, while the new server is running apache 2.x installed from Ubuntu’s packages. Most of the migration has gone pretty smoothly thus far, considering how different the versions of software are on the new server.
One difference that had me stuck for a while was getting mod_auth_mysql to authenticate users against the database on the new server. I was able to install it as a package instead of compiling from source, and the new version seemed to use the same configuration directives as the old one, but I was getting 500 errors whenever I accessed a password protected page. The web server log was reporting
Internal error: pcfg_openfile() called with NULL filename
[client 10.1.1.99] (9)Bad file descriptor: Could not open password file: (null)
Additionally, the database server wasn’t logging any connections from the web server. I finally came across this thread which explains the issue. Apparently, apache2 wants to use the htpasswd file facilities to authenticate users, unless you explicitly tell it not to. Adding
AuthBasicAuthoritative Off
to the .htaccess files allows mod_auth_mysql to perform authentications. That was a step in the right direction, however apache was still recording errors whenever a password protected page was requested. This seems to be another side effect of apache2 wanting to use htpasswd files. If you add
AuthUserFile /dev/null
to the .htaccess file as well, it stops complaining.
Posted in Coding, Systems | 2 Comments »
November 11th, 2007
I’ve started using LaTeX to prepare assignments and other documents, and so far it’s working out pretty well. Formatting math is easily done, especially since I’m coming from OpenOffice, which uses a simplified version of the same markup. Importing and formatting code files with the listings package is great too. My big issue has been with positioning of figures.
It’s easy enough to add a figure to a document, and give it a caption, or reference it from elsewhere in the text. Getting it to flow into the text where you want it to is another story altogether. LaTeX likes to keep pages balanced, so as long as there’s text to be output, it doesn’t want to take up too much space on a page with figures. LaTeX likes to re-flow your document automatically to make sure it remains visually pleasing when you make changes to it. The problem is that with most assignments what’s needed is not so much a visually pleasing document as a document that will be easy for a TA or professor to mark. In order to achieve this, you generally want, say, the text and figures for question 6 to all appear, in order, before any of the text for question 7.
I’ve found a couple of the things that will make LaTeX float figures to later pages are settings for the limit as to how many figures it will allow on one page and how much text it will push to the next page to make room for figures. These commands will change those limits:
\renewcommand{\textfraction}{x%}
\setcounter{totalnumber}{x}
The first one sets the minimum fraction of text that will be displayed on any page, and the second sets the maximum number of figures to appear on any page. These two settings, in combination with the ! and h positioning flags to the figure environment, get close to letting you force the positioning of figures.
I’m still looking for something better though…
Posted in Coding | No Comments »
November 7th, 2007
I’m currently working with Angela Demke-Brown and Karen Reid on an extension to the sys161 operating system simulator to allow visualization of the current memory usage in the simulated system. The intent is to help students in a 3rd year operating systems course with their understanding of virtual memory. The visualizer now displays the used and unused pages, colour-coded according to the type of allocation. The next step is to somehow visualize the contents of pages used for kernel stacks.
The current idea is to get the simulator to report whenever the stack pointer register changes value, and infer what happened from that. Given that there is only one processor, the updated stack must be the one for the currently running thread (or an exception handler, but I’ll get to that later). I know which thread this is because a modification to the os161 kernel starter code causes the simulator to report whenever there is a context switch. Given this, and a dump of the symbol table for the running kernel, it should be possible to get the information I need.
So, I coded up a simple test that just sent a message from the simulator with the new value of the stack pointer every time it changed. I figured it would be updated often, but I had no idea how often – the resulting system sends so many messages to the visualizer program that it can’t keep up. I’ve determined that most of these messages aren’t really interesting, being the result of the timer interrupt. I’m hoping that I can find a way to exclude these, and that the remaining messages will be more manageable. If not, I’ll have to work out a way to turn this feature off when it isn’t needed.
Posted in Coding, Systems | No Comments »