Sunday, June 08, 2008

Emacs

"Your first time using emacs you'll just cadge someone's .emacs file and pray you never have to understand all those parentheses. But you'll have to, before you can witness the firepower of this fully armed and operational text editor."

Tuesday, April 29, 2008

Breaking out the Django Tests

So I'm using Django at work, and I'm finally getting into this testing thing. My biggest annoyance with django's way of testing is that it forces you to put your tests in either app_dir/tests.py or app_dir/models.py What I want to do is to either break out the tests into files in the test directory, or wherever I want.

Django uses python's unittest framework. Digging through django's code, I see that It basically imports the app.tests module and runs the unittests loadTestsFromModule. Inspecting this code shows us,

def loadTestsFromModule(self, module):
"""Return a suite of all tests cases contained in the given module"""
tests = []
for name in dir(module):
obj = getattr(module, name)
if (isinstance(obj, (type, types.ClassType)) and
issubclass(obj, TestCase)):
tests.append(self.loadTestsFromTestCase(obj))
return self.suiteClass(tests)
As you can see it looks for any names the module has defined. So I can put my tests in the test module and in __init__.py do import file_name.class_name to make django find my tests

Sunday, March 30, 2008

The mistake of clean install perception in Linux

From here
The day where I can recommend that my father use Linux (without the fear of him calling me on a daily basis to fix things) is the day I’ll proclaim the “year of the Linux desktop” has arrived.

Sorry, but that day was three years ago. I've had Ubuntu running on a machine where novice computer users connect to the internet to do work for a very long time. After the initial setup, not one of them has had an issue.

I spent years installing the maintaining Windows machines. Without the initial setup, they are much more likely to be missing the required software for daily use, the required drivers to take advantage of their hardware.

The difference is that people are used to installing and setting up their windows machines. They know that they will need driver x,y, and z along with software suite a and b.

Most of the time there will be maybe a single issue on Ubuntu that will need fixing by a first time installer.

The amount of universal direct out of box compatibility and feature set expected out of Linux is unreasonable, plain and simple. Just like any other OS (yes, even OS X), it will need setup by an OEM or a technician to be a 100% smooth experience.

X-Files returns

Maybe I'm atypical of my friends out there, but my mother raised me on X-Files. So today I was really pleased to hear that they are making a final movie, supposedly to tie it up. If you watched X-Files, you know that they let it drag out way too long. It's one of the main reason's that show now limit themselves to typically five seasons from the get-go.

There is much more information here. Including some tidbits of info on producing and directing the series.

Wednesday, March 19, 2008

Xen on Gutsy

My installation of Xen on Gutsy went well as far as getting the host(server) up and running. I had an issue when it came to getting my guest(image) running under Xen.

Xen has a few strange things about it, the first being that it uses terminology that I'm not familiar with and is no where explained. Example: "Provision VM" Which I eventually found to be configuring a virtual machine.

Xen also doesn't just emulate the metal. It boots off a kernel from your host's file system. If you build a guest by hand then you need to bootstrap it with a distro of your choice.

My guest would always boot through the kernel, but never init. After messing around for a while I came across this. Seems like there is a bug in the Gutsy Xen-tools configs.

Finally, a bit of my frustration with Xen was not with itself, but with the third party gui setup and management tools. Xenman, Virt-manager, and Enomalism all had show stopping bugs that I'm sure could be fixed if I really tried, but that's not the point.

Over all, the core suite of Xen is very good. With some better intro documentation, and some mature attach on tools, it could be great.

Update: I may not have made it clear, but the guest OS was gutsy also, which is what requred the hooks in Xen-tools to boot.