Brandon Holtsclaw: 10 ways to amuse a geek
1. Make a list of the top 10 ways to amuse a geek.10. Use binary.
1. Make a list of the top 10 ways to amuse a geek.I think the real reason there was resistance to this change is that MySQL doesn't support DDL transactions; and wrapping migrations in a transaction is mostly pointless without this feature. Since MySQL doesn't support it, most Rubyists don't know what DDL transactions are - so here's a quick primer on this incredibly useful and certainly underrated feature. DDL = data definition language, also known as the schema. DDL commands include CREATE TABLE, DROP TABLE, ALTER TABLE, and CREATE INDEX. DDL transaction support means that the following sequence of SQL commands will not modify your databaseI never even thought of that. I was fairly confident in my vision of Postgres getting faster and faster, and Mysql become a "real" database... that the two systems were converging on something resembling a common speed/feature set. But things like this still occasionally rear their ugly heads and I'm happy to be a Postgres user.
Meme from Jono:
That said, I still don't have stable access to a Mac. Does anybody have a 64-bit OS X server and can provide me with SSH access? Preferably something that I can have access to for a long time, so that I don't have to keep asking for OS X access. :)He's in .nl if it makes any difference. I'm not that wild about "passenger" by itself (mod_fcgid does ok for what I need), but the "enterprise ruby" project, which is basically a reworking of how Ruby's garbage collection functions, is a useful and timely idea, given how much of a memory hog rails is.
I spent more time than I would like to admit massaging the process that
ultimately led to the release of the the GNU Free Documentation
License 1.3 (GFDL) by the Free Software Foundation (FSF). Hours
counted, it was probably one of my biggest personal projects this year.
The effect is to allow wikis under the GFDL to migrate to the
Creative Commons BY-SA license or, as Wikimedia's Erik M ller has
proposed, to some sort of dual-license arrangement.
There are many reasons for this change but the most important is that
the move reduces very real barriers to collaboration between wikis and
free culture projects due to license compatibility. BY-SA has become the
GPL of the free culture world and Wikimedia wikis were basically
locked out from sharing with a larger community, and vice-versa;
projects will no longer have to choose between sharing with Wikipedia
and sharing with essentially everyone else. The GFDL has done a
wonderful job of helping get Wikimedia projects to where they are today
and M ller's proposed switch seems, in my opinion, the best option to
continue that work going forward.
The FSF gets a lot of credit (and a lot of flack) for what it does.
Offering to "let go" of Wikipedia -- without question the crown jewel of
the free culture world -- represents a real relinquishing of a type of
political control and power for the FSF. Doing so was not done lightly.
But giving communities the choice to increase compatibility and
collaboration by switching to a fundamentally similar license was and
is, in my opinion, the right thing to do.
Everyone who has worked hard to make this happen deserves the free
culture movement's thanks. This list includes Richard Stallman, Brett
Smith and Peter Brown of the FSF; James Vasile and Eben Moglen of the
SFLC; Erik M ller, Mike Godwin and Shunling Chen of the Wikimedia
Foundation.
The FSF in general, and RMS in particular, deserves a huge amount of
credit for what it has decided to not do in this case and for giving
up control in a way that was responsible and accountable to its
principles and to GFDL authors and in the interest of free culture
movement more generally. It has not been easy or quick. If you support
or appreciate work like this, please support the FSF and express
this while doing so. Doing so is an important way to support these
essential and almost inherently underappreciated efforts.
@fixtures =
@seen =
# Do something with a fixture. In this case, we store it for later.
def handle_fixture(record)
@fixtures[record.class.table_name] = []
@fixtures[record.class.table_name] << record
end
# Get some sort of unique way of identifiying a record - class name and id.
def unique_record(record)
return record.class.to_s + " " + record.id.to_s
end
# Grab all the relations of a class and add them to the queue.
def add_fixture(record)
ur = unique_record(record)
if @seen[ur]
puts "LOOP!"
return
end
@seen[ur] = true
puts "Fixture for # record.class.name - ID # record.id "
handle_fixture(record)
record.class.reflections.each do k, r
begin
if r.macro == :has_many
r.macro == :has_and_belongs_to_many
related = record.send(r.name).send('find', :all, :limit => STARTING_LIMIT)
else
related = record.send(r.name)
end
related = [related] unless related.is_a?(Array)
related.each do related_record
if related_record
puts " New Record # related_record.class.name # related_record.id "
@todo << related_record
end
end
rescue => e
puts " ERROR: # e :\n# e.backtrace.inspect "
end
end
end
@todo = []
namespace :db do
namespace :fixtures do
desc 'Create YAML test fixtures starting from a single model using reflections'
task :modelbase => :environment do
STARTING_CLASS = Foobar
STARTING_FIND = :all
STARTING_LIMIT = 1
tmp = 0
totale = STARTING_CLASS.find(STARTING_FIND, :limit => STARTING_LIMIT).size
STARTING_CLASS.find(STARTING_FIND, :limit => STARTING_LIMIT).each do m
tmp += 1
puts "# tmp su # totale : # m.id "
@todo << m
end
while true
if @todo.length == 0
break
end
add_fixture(@todo.pop)
end
puts "\n\n# '='*80 \nScan Finished\n# '='*80 \n\n"
@fixtures.each do name, fixture
if fixture.size > 0
i = "000"
filename = "# RAILS_ROOT /test/fixtures/# name .yml"
puts "Create # filename for class # fixture.class.name "
FileUtils.mkdir(File.dirname(filename)) unless Dir[File.dirname(filename)].size > 0
File.open("# RAILS_ROOT /test/fixtures/# name .yml", 'w') do file
file.write fixture.inject( ) hash, record
hash["# record.class.table_name _# i.succ! "] = record.attributes
hash
.to_yaml
end
else
puts "Fixture for # name is EMPTY"
end
end
end
end
end
As a brief introduction to this - I first read through the Android code when interviewing with Google for an opening with the Android kernel team. I didn't get the job, and while I don't think anything that follows here is as a result of residual bitterness you might want to take some of it with a pinch of salt.android_early_suspend_t early_suspend; android_early_suspend_t slightly_earlier_suspend;to deal with the fact that the MSM framebuffer driver depends on the MDDI driver having brought the link bank up and so needs its suspend method called before the MDDI driver but its resume method to be called after, and the only way to handle that is to register two methods - the "slightly earlier" one which has a suspend method but no resume, and the "early" one which has a resume method but no suspend one.
I have it on very good authority* that our favorite Indian/Nepali restaurant, Himalayan Bistro, is coming to Roslindale (from West Roxbury), into the oft-turned-over location last assigned to NuVo, and Gusto before that. Perhaps the third “-o” restaurant will be a charm. Assuming they serve up the same superlative food and atmosphere as the West Roxbury location, I’m sure this one will be a keeper. (My only concern is that having the two restaurants so close to each other may result in self-competition.)
*Authority = Himalayan Bistro delivery guy. You don’t get much more authoritative than that.
In other Roslindale Restaurant news, we heard via RVMS recently that Robyn’s Bar and Grill has changed hands to the owners of the Halfway Cafe in Dedham, which could be a change for the better. Roslindale did not need another pizza/sports-bar, and still does not need one, although maybe that’s all the Robyn’s location will ever be. Even more recently, however, we heard an unconfirmed rumor from a neighbor that the sale fell through and Robyn’s is not changing owners.
In other potentially disappointing news, the Roslindale Emac and Bolio’s has changed owners again, this time to a co-owner of the Blue Star Restaurant. I want to like Blue Star, but they can’t seem to get the most basic short-order cooking tasks right. A diner must, first and foremost, deliver greasy food fast, hot, and at the same time for the entire group. At worst, serve the kids first. It also helps for the food to be consistent. Blue Star in our experience (many visits) only occasionally satisfies the basic diner requirements, much less delivers any sort of creative urban-chic reinterpretation of the classic retro diner. (By contrast, Deluxe Town Diner in Watertown is our current Greater Boston favorite — it’s always a good sign when a greasy spoon also actively caters to vegans.)
Which brings me to Emac and Bolio’s, which apparently will be renamed “Select Caf .” First, why give up the goodwill associated with the Emac’s trademark? Second, the initial signs of the change-over are not promising. A handwritten sign posted in the window announces that the cafe is under new management, and (1) no credit or debit cards will be accepted and (2) no Emac and Bolio’s gift certificates will be honored. I’d love to be proved wrong about this, but I’m pessimistic that this is going to be the Change We Need in Roslindale — namely, a top rate artisanale snobby espresso shop. We can only hope that Simon’s, Flatblack, Cafe Nation, Diesel, or another of their ilk will come occupy one of the vacant storefronts on the courtyard. That we have any vacancies at all in the square, much less several, is a crime against humanity.
Technorati Tags: Roslindale, Restaurants
Way back in mid-late May, I switched keyboard layouts from standard US QWERTY to Colemak. I’d played around with the layout a bit before that and thought it seemed pretty solid, but it hadn’t been a good time to switch then. (I did, however, snag the idea of remapping Caps Lock to Backspace from that early trial though, and to this day that’s probably the most annoying thing about typing on QWERTY, because I associate Caps Lock with Backspace on both layouts now. Anyway.) This time, however, I strategically timed it to coincide with the end of classes, so I had no assignments due and could make a fool out of myself during the first few days of my summer job. Smashing success.
It only took a couple days to get past the point of extremely frustrating slowness. Two weeks in I was up to 40wpm, which was about the point where I stopped noticing that I’d taken a backwards step in typing speed, as it didn’t really hinder anything I did on a regular basis. By the end of the summer I was back up to the same speed as I’d been prior to switching (around 75wpm). I didn’t really do any typing lessons after the first few days, as I found just doing whatever I would normally do on a computer much more interesting.
The biggest hurdle after the initial adaptation of actually being able to type on the layout was, for a command-line lover like myself, dealing with “hjkl” not being a convenient way of navigating around in console apps like mutt, vim, aptitude, and less. After a bit of experimentation, I stole an idea from this page and started adapting my dotfiles to make these programs use ne for jk and st for hl, and that seems to be working out well. The worst key that this clobbers in general is n, but it’s pretty easy to remap that to QWERTY’s n, which is easy to remember and is the hardly-used k on the Colemak layout.
For any interested others, I’ve thrown the relevant dotfile snippets up here. I’d been putting off blogging this because I wanted to finish setting up dotfiles/homedirs-in-git la Joey Hess beforehand, but I figure I’ll never actually get it done if I keep using that excuse. For mutt, the given snippet goes in your .muttrc (or whatever you source keybindings into your muttrc from). The same goes for vim. Aptitude keybindings go in .aptitude/config. For less, it’s a little more arcane: first you stick your keybindings in .lesskey, and then you run the command lesskey. I also remapped screen’s escape key to ctrl-t.
Why not Dvorak?
Dvorak seems to be the most well-known QWERTY alternative around, so why didn’t I switch to that if I wanted something better? I did try Dvorak first, but the incredibly uncomfortable combination of ls on the right pinky was a complete deal-breaker. I also found it very slow-going to try to adapt to Dvorak after typing on QWERTY for years. The Colemak FAQ has some more notes on Dvorak deficiencies that it addresses.
Overall, I’ve found typing on Colemak to be remarkably lacking in anything that particularly bothers me. I still type on QWERTY a little, but mostly just for login prompts on Athena workstations and the desktop machine in my room which my roommate sometimes uses. I have to glance down at the keyboard when typing on QWERTY to get it back in my head, but generally I only need it for a few minutes anyway and it’s no big deal. As long as I glance down occasionally I can still maintain a speed level well above that of frustration. On the plus side, this means that if I look at the keyboard when typing normally in Colemak, I get screwed up because I start thinking in QWERTY. So it’s good touch-typing reinforcement in general.

(Written on Friday 16th, posted on Monday)
As I write this, I'm on a plane off the coast of the Netherlands, on the way back from a couple of days designing APIs with Rob McQueen and the RTCom people at NRC Helsinki (who we work with on the chat and VoIP functionality for Nokia internet tablets).
We've had a very useful couple of days, mainly designing the next-generation channel requesting and dispatch API for Telepathy (the same APIs I've been doing preparatory work for on the Telepathy mailing list in the last couple of weeks). API sketches for review and comment are either on are on Merge Monkey or on the way there.
Before even reaching Nokia, Rob and I did a lot of design on the plane over to Helsinki, and I took some notes: here they are, by way of a glimpse at how the Telepathy design process works when we don't have a whiteboard[1] :-)
- Geoloc looks good in principle, needs some more work
- add more docstrings
- add a way to ask people for uncached info (RequestLocations)
- move access control to Co.I.Presence, call it RichPresenceAccessControl?
- DeliveryReporting looks good, ish
- improve wording of delivery-echo and rationale
- when sending a delivery report, add a reason for the status (using Channel_Text_Send_Error?)
- Uniqueness requirement for (channel, handle_type != 0, handle) is in the way - let's drop it
- MSN should use "authentic" 1-1 chats, and use Ch.I.UpgradeableToRoom (name tbd) to migrate the underlying switchboard to be a room
- XMPP should use Ch.I.UpgradeableToRoom too, but the 1-1 channel may also stay open
- Mutable handle => handle 0 must stay (for requestotron's benefit)
- bundles ftw
- renaming: we want SelfHandleChanged in the core
- TpC* - add ability to subscribe to ifaces ay construct time (blocks Ready) or later
- Dispatching: when registering a c'handler, specify everything it can handle
- If a new bundle can be handled in its entirety by the same handler (call it 'the bundle handler'), do it. Otherwise split it up completely (there is no 'bundle handler').
- If a channel in an existing bundle can be handled by the bundle handler, send it there, else send to the default handler.
- Group - add SelfHandleChanged, maybe? Also Connection
- Add HandleOwners: prop a uu , HandleOwnersChanged(a uu , au)
- Use TargetHandleType, TargetHandle
- Stringified initiator handle as a separate property
- Maybe even a FirstMessage property, although this stretches the definition of "immutable"
- org.freedesktop.Telepathy.Client interface
Nokia's Mikhail Zabaluev kindly took notes for some further discussion we had with him and Alberto Mardegan about the dispatch API, which he already posted to the mailing list.
We hope this API will make it possible to integrate Telepathy into the desktop better - it should make it a lot easier to share connections between processes in a useful way and hand out incoming channels to the appropriate handlers, which was always a major goal for Telepathy. It should also let us and others implement exciting new notification mechanisms (hi to the people on IRC and the mailing list wanting to patch their media players to integrate with Telepathy! :-)
| [1] | When we do have a whiteboard, the design process is: "Robot101 scribbles on a whiteboard, smcv writes down <tp:rationale> elements" |
(Part 1 of an ongoing series: shiny things in telepathy-glib)
16:46 < epmf> tp-glib is made of magic—#telepathy, 2008-04-15
Rob pointed out today that I'd been promising to blog about telepathy-glib for several months and still haven't done so. I think there's too much to cover in one blog post, so I'll start with the oldest part - implementing a service (typically a Telepathy connection manager).
While telepathy-glib is (obviously) intended for Telepathy implementors, I think the ideas we've been implementing are likely to be useful for any D-Bus API, particularly flexible/complex APIs where an object implements many interfaces.
(credit: daf)
commit 355ef78d98d6fc65715845d56232199162cab12a
Author: Steve Fr cinaux <steve istique net>
Date: Thu Aug 17 11:48:20 2006 +0200
Interface support for bindings.
Instead of running dbus-binding-tool or creating GObjects with D-Bus
interfaces, we put the entire Telepathy spec through
glib-ginterface-gen.py, a distant descendant of Gabble's gengobject.py.
For each interface in the spec, we generate a GInterface that mirrors the
D-Bus interface. Any GObject that implements the GInterface automatically
gets the D-Bus interface if it's exported onto D-Bus.
There are a few non-obvious refinements, though:
The signature of the method implementation is always in the mode that dbus-glib calls "asynchronous", where the method implementation can either send a reply message before or after it returns. For "slow" methods, this is the only thing you can do. For instance, many Telepathy D-Bus methods can't return anything until some TCP round-trips to the server have happened. This is also the only thing you can do if you want to extract extra information, like the sender's unique name, from the method-call message (dbus-glib's "synchronous" API doesn't allow this to be done). For "fast" methods, sending a reply message before returning is just as easy as using the "synchronous" API (it's just a difference of syntax), and has an API consistent with that of the "slow" methods, making it easier for service authors.
The layout of the GInterface vtable is private, and (auto-generated) accessor functions are used to fill in implementations. This means our ABI doesn't change just because we re-ordered functions in the spec.
If no implementation is provided for a method, we just raise an appropriate error (org.freedesktop.Telepathy.Errors.NotImplemented), rather than suffering an assertion failure. This means we can safely add methods to an interface.
While we're generating code anyway, we generate some static inline wrapper functions which wrap dbus_g_method_return(), to have type-safe method returns. You can easily check that a method replies with correct types, by checking that the implementation of Foo() replies by calling tp_svc_some_interface_return_from_foo().
Similarly, we generate wrapper functions to emit signals, to get type-safe signal emission.
I've been meaning to document this for ages...
My laptop is set up with an encrypted root filesystem using LVM and dmcrypt.
It also has a small Debian stable system for recovery purposes (I don't have
a CD drive, so if everything goes horribly wrong, I can't just boot from a
live CD).
Here's how to set up something similar:
/. If you wanted extra LVs, set them up too.
Also set your recovery partition to be used as ext3, mounted on /boot,
and not reformatted.
It should now look something like this (smcvcrypt is the name of
a KVM virtual machine in which I've been testing these instructions, normally
you'd have the laptop's hostname there).
Proceed with the installation.
Install Grub to the MBR - this will temporarily make the recovery system
unbootable, but shrug never mind. Finish the installation and reboot into
your new main system.
title Go to recovery system
root (hd0,1)
chainloader +1
(Replace (hd0,1) with what Grub thinks the recovery partition is - the second
number is the partition number starting from 0, so /dev/hda5 would be (hd0,4)
and so on.)
Also edit /boot/boot/grub/menu.lst and put this right at the end:
title Back to main system
root (hd0)
chainloader +1
Also, still in /boot/boot/grub/menu.lst, go to the top of the file and
change the colour scheme to something else (I used a red background) to
indicate that this boot menu is for the recovery system.
Reboot and try it out. You should now have an extra boot menu option,
"Recovery system". Selecting it will switch to the recovery system's
boot menu, which has an option to switch back, and so on. Each boot menu
also has some entries for kernels, any of which will boot with the
appropriate root filesystem (encrypted root for the main system,
unencrypted for the recovery system). Success!
Here's a script I use to speed up compilation at work. Since I work at
Collabora, I call it collaboratively.
It's a prefix to a command (used in the same way as sudo or nice) which sets
up icecc (Icecream) and ccache to work
nicely together.
#!/bin/sh
# ~/bin/collaboratively
# Typical usage: collaboratively make check
PATH=/usr/lib/ccache:/usr/lib/icecc/bin$(echo :$PATH sed -e s@:/usr/lib/ccache@@g)
export PATH
MAKEFLAGS='-j -l3'
export MAKEFLAGS
exec "$@"
Some more explanation of what it does:
$PATH for a second time! My bash and zsh dotfiles
automatically set up ccache, so in practice it does need editing out.make should be parallelizing as many compiles as
feasible - I use the flags -j -l3 to run an unlimited number of parallel
compilation processes, but stop when the load average reaches 3 (the number
of CPU cores I have, plus 1, seems a reasonable maximum load-average).apt-get install icecc-monitor and run icemon to see whether this is all
working - if it is, you should see compile jobs going off to other hosts.
I spent much of this week in Alicante. It was wonderful to have a
few days away from the beginnings of Winter in Cambridge - Alicante's
in South West Spain, right on the Mediterranean. It's a lovely city,
although it was very quiet due to the time of year.
I was invited down to Alicante by organisers of the Congr s de Programari Lliure,
Comunitat Valenciana, to present a talk about Debian. That I did,
and as always my slides
and photos
are available in case people are interested. I wasn't too sure about
what level to aim the talk, so I deliberately went for a general
introduction to Debian. That seems to have been the correct level -
nobody threw anything at me, and nobody was visibly falling
asleep. *grin* It's also the first time I've ever given a talk with
official translators, which is a weird experience! The main topic for
the conference was the new release of Lliurex, Valencia's own GNU/Linux
distribution targeted primarily at use in schools.
The conference was massive; I was told there were about 1500
attendees in all, most of whom were teachers who wanted to come and
learn more about Free Software. There was a good spread of talks and
workshops, covering topics from development through to deployment in
the classroom. The level of enthusiasm for Free Software here was
immense - lots of people were keen to learn more about it and get
involved. I was told that out of the 15 regions/states of Spain, 11 of
them have now started their own distributions to use in schools!
Extremadura were the first region to experiment with Free Software
like this, and their success with LinEx was a clear inspiration to
their neighbours elsewhere in Spain. As well as the obvious cost
advantages of moving from proprietary to Free Software, the local
governments also love the freedom to use and modify their software
however they like - including the ability to provide their own
translations.
I met up with a lot of cool people at the conference too. The local
education minister (Alejandro Font de Mora) was keen to talk with all
the speakers and very enthusiastic about the future of Free Software
in his schools. As is increasingly common at FS events around the
world, there were of course quite a few Debian people around too.
Luciano and Miriam were also giving talks, and I bumped into Rene and
Miguel and a whole bunch of others whose names I'm too crap to
remember - sorry! I also spoke a lot with Kurt Gramlich, the
mega-enthusiastic Skolelinux developer who was also happy to push
Debian to everybody he spoke to *grin*. Jon "Maddog" Hall had some
excellent ideas that I'm sure we'll all hear more about soon, and his
talk was excellent. He did a very good job of explaining how Free
Software makes such a difference, including how it helps people to
make money. He also explained that due to travel he had missed
Halloween at home and he wanted to share the experience of scary masks
with the people at the conference:
I had a great time in Alicante, and I'm very grateful for the
invitation to go there. I wish that the UK was as far as advanced as
Spain in the use of Free Software in education - they've done a huge
amount of good work in this area and I'm glad we can help them.
--exclude Packages* --exclude Sources* --exclude Release* --exclude ls-lR*The first stage must not delete any files. The second stage should then transfer the above excluded files and delete files that no longer belong on the mirror. Rationale: If archive mirroring is done in a single stage, there will be periods of time during which the index files will reference files not yet mirrored. And that will lead to a lot of confusion for our users.
When I first read http://two.sentenc.es/ in (if I remember correctly) madduck’s
signature, I thought something like “This can’t be! Why are people
castrating themself?”
Although I really understand that the inventor has good reasons for such a personal policy, I notice how much
time I waste by trying to fit all the information I want to transmit
in the 160 characters a short messages allows — or, even worse,
into the 140 characters microblogging services like identi.ca or Twitter allow.
So I had to oppose something to this, but even to only reach the
coolness level of the domain “sentenc.es” is hard, you probably can’t
top it at all. For luck, I’m not alone and Venty had the right idea
for a hostname which has at least some geeky niveau.
So here it is, our pleading for e-mails as long and detailed as
necessary:
http://e-mail.is-not-s.ms/ A German version will be available soon at http://e-mail.ist-nicht-s.ms/. Feel free to add either URL to your e-mail signature. :-) Oh, and thanks to the Government of Montserrat which allows strangers to register .ms domains without any hassles. :-) Update / FAQ Seems to be necessary to make a few things clear…
Next.