June 24th, 2009
I have been indoctrinated into the iron man blogging competition, apparently.
shadowcat bribed me, but I think this is a useful cause. :)
This means I have to blog 4 times every 30 days. Considering my normal output, this will be quite interesting.
This post is a bit small because I’m using an alien keyboard, I promise to write really long posts from now on. ;)
Tags: perl
Posted in Uncategorized | No Comments »
June 17th, 2009
I am in the process of transitioning a
DBIx::Class
application to Fey abd Fey::ORM.
I must say Fey::ORM is more comfortable than DBIC.
Fey is a framework for representing database schemas and generating queries from that representation.
Fey::ORM is a SQL-lovers object-relational mapping built on top of Fey’s impressive SQL generation capabilities.
I do mean impressive, as Fey is able to infer join conditions entirely on its own:
# A User has many units, and units have many users, via the lnk_unit_users table.
my $unit_users = $schema->table('lnk_unit_users');
my $unit = $schema->table('lkup_unit');
my $select_units = $factory->new_select
->select($unit)
->from($unit, $unit_users)
->where($unit_users->column('user_id'), '=', Fey::Placeholder->new)
;
has_many 'units' => (
table => $unit,
select => $select_units,
bind_params => sub { $_[0]->user_id },
);
So, when I go $user->units, I get an iterator object full of Units,
which executes the following sql:
SELECT *
FROM lkup_unit
JOIN lnk_unit_users ON (lnk_unit_users.unit_id = lkup_unit.unit_id)
WHERE lnk_unit_users.user_id = ?
Note, in my $select_units query I did not specify the join condition, I merely passed two Fey::Table objects,
and using the foreign key constraints Fey figured out what to do.
I think this is pretty cool. :)
Tags: fey, perl
Posted in perl | Comments Off
June 8th, 2009
So, yesterday I was in a bet with Aftran to type with all [AEIOU] vowels replaced with ‘O’.
I believe I won. Woo-hoo! :)
Posted in Uncategorized | Comments Off
June 6th, 2009
O wroto o scropt thot osos xmodmop to roploco vowols woth ony othor koyboord choroctor: http://gist.github.com/125133
Os o rosolt of thos, O ondod op on o bot woth my froond Oftron to spook ond typo osong O onstood of tho rogolor Onglosh vowols (oxclodong y)
for twonty foor hoors. Tho prozo of tho bot os o sodo or othor non-olcoholoc bovorogo.
Onothor condotoon of tho bot os to wroto thos blog post, whoch os now dono.
Of yoo don’t ondorstond thos, O woll post somothong on mondoy to oxploon. :)
Posted in Uncategorized, tech | Comments Off
May 29th, 2009
I updated my shell’s prompt for the first time in years.
New prompt has a right-aligned timestamp/datestamp, shows the number of background jobs (if any)
and shows the current git branch if I’m in a git repository.
I think it’s also not as obnoxiously colored.
Old Prompt:

dylan's old prompt
New Prompt:

dylan's new prompt
Tags: prompt, shell, unix, zsh
Posted in software, tech | Comments Off
May 12th, 2009
So, my 500G disk was having bad sectors near its end.
I had lvm on this, so I shrank the lvm pv (this worked),
put in my 750G disk, added it to the lvm vg njord,
ran pvmove from the dying disk to the living.
This seemed to work, but apparently I either vgreduced the wrong disk or the debian installer’s rescue mode did something weird.
Either way there was some data loss — luckily only some virtual machine images and maybe a few things in my ~/ that I hadn’t git-commit’d yet.
I’d like to point out that I haven’t formatted that disk in a LONG time.
Well, not that disk. I have been pvmoving that to and from various harddrives for the last 3 years or
so.
Maybe I should install gentoo?
Posted in Uncategorized | Comments Off