Search Results: "reg"

20 November 2005

Junichi Uekawa: Hello ptrace, on ppc.

I've started playing with ptrace on my ibook.It is a bit different from what I have seen on x86 machines.First, the test sample that I have had hanging around in my source tree didn't build.It told me there was no PTRACE_GETREGS symbol.This means that I won't be able to read contents of a register,which sounds like a bad news when capturing system calls.I made a bit of research.Following the header files, by including linux/user.h, asm/user.h asm-ppc/user.hasm/page.hlinux/ptrace.hasm/ptrace.hasm-ppc/ptrace.h are included.PTRACE_GETREGS is not defined anywhere.Looking at ppc64 for comparison, it is different but also did not definePTRACE_GETREGS (PPC_PTRACE_GETREGS is defined, which is a bit of an added mystery).Kernel side source is at arch/ppc/kernel/ptrace.c functionsys_ptrace.Looking at that, PTRACE_GETREGS wasn't handled in the switch statement.In arch/ppc64/kernel/ptrace.c, PPC_PTRACE_GETREGS is definedand it seems to be implementing a PPC_PTRACE_GETREGS which looks like functionally what I'm looking for.Looking at that code, it looks really trivial to add that feature,I wonder why it's not there.I don't think ppc32 is overshadowed enough by ppc64 that developmentcould be halted.

Matthew Palmer: My First Time Mining Ruby

I'm not usually a grand fan of the latest and greatest fads'' in programming. The only C# I know is the black key next to D#, and I loathe coffee. An IDE in the hands of a poor programmer will still result in crap code. While I do think that agile methods (such as XP) can do well in certain development environments, I certainly don't subscribe to the notion that XP can solve all the world's software production ills. And so on. I do know quite a number of programming languages, and tend to pick up new ones out of intellectual curiousity (although Ada did put a severe dent in that habit) or because a bit of research tells me that the language might be particularly suitable for a particular task (although I've since learned that the actual purpose of PHP isn't dynamic websites so much as bringing the security levels of Linux boxes in line with Windows-led industry standards). I also learn languages because I want to hack on projects written in them, which is motivational, but not a particularly good way to get a deep understanding of a language. Why all of this introspection in a blog? So you have the background to understand how everything about Ruby is different for me, including how I'm getting started using it. I have no interest in hacking on a Ruby-implemented project, and -- although Rails proponents give me an impression similar to that of a horny teenager with a shiny new unlimited broadband account -- I don't have any particular use for Ruby at the moment (I want to write less webapps, FFS, not more!). So, why the hell did I fork out $90 hard-earned South Pacific pesos for a copy of "Programming Ruby: The Pragmatic Programmers' Guide"? A couple of reasons: I'm glad I got "Programming Ruby". The book is superbly organised, reads very easily, and gives you all of the love as and when you need it. Surprisingly for me and a technical book, I read the first section of the book "cover to cover". By the end of it, I came away with a real (if naturally superficial) understanding of the language, and a feeling that I was ready to tackle the world in Ruby. It is a sad state of affairs when the first piece of new programming you can sink your teeth into is some four days after finishing your initial studies into a language, but this afternoon I wrote my first Ruby program in anger. It's quite simple -- just take stdin and rewrite it all on stdout with the lines in a random order. But I wrote it in a new programming language, in about 3 minutes, with nothing more than ri (Ruby's answer to firing up python and typing help(xyzzy), more or less) and "Programming Ruby". I think I also produced a suitably reasonable result:
#!/usr/bin/env ruby
lines = []
while line = gets() do
	lines << line
end
	
while ! lines.empty? do
	idx = rand(lines.length)
	puts lines[idx]
	lines.delete_at(idx)
end
(Any Ruby afficionados out there, feel free to e-mail me and tell me what egregious sins I've committed). I think it looks reasonably neat and clean, it's certainly simple, and the use of real Object Orientation makes for a certain readability (I think the method call lines.empty? is particularly cute, although I did initially consider the use of a question mark in a method name to be a crime against humanity). So, will I be using Ruby more in the future? I think so. There are some features in Ruby which I'm hoping to get a lot more cosy with -- the idea of "blocks" looks particularly interesting, and I don't think the utility of languages that have been designed, top-to-bottom, to really live the OO ideal has been explored enough (you SmallTalk bigots can stop glaring at me now -- really, I mean it -- stop it!). It's far too early to tell whether Ruby will become my "go to" language for random development tasks, but anything that stops the nightmares (where I start thinking about using PHP as a general scripting language) cannot be all bad. And, if I continue to make new webapps, Rails will probably come in handy. Update: HTML <pre> tags don't like having < inside them unescaped. Also, Philipp Kern pointed out that the Ruby documentation browser is called ri (not ir as I originally wrote). Philipp was also kind enough to provide a much shorter version of my original script, which shows the power of Ruby so much better:
 lines = []
 STDIN.each_line    line  lines << line  
 lines.sort_by   rand  .each    line  puts line  
Now tell me that isn't a language worth using!

Joey Hess: quod libet

screenshot Earlier I dismissed the quod libet music player since it needed 20% of my laptop's cpu to play music. The new version has been improved, it only needs a still exorbitant 13%, but at home I use my shuttle PC for music now, so CPU usage doesn't matter. And I think quod libet is worth the slightly lowered battery life on the road too. There's no end to the features -- and plugins full in all kinds of interesting edges (onscreen display, audioscrobbler, alarm clock) -- and while it's still under development with a rough spot here and there, mostly around the plugins, it mostly just works. I'm especially impressed at how powerful the tag editing is in quod libet. It makes it so easy to clean up the missing and broken metadata in even a large sound library like mine, and the effects are so immediate and nice as things get sorted into the right place, albums ordered as missing track info is added, album covers displayed, that it's addictive just to putter around in there. Some other features that IMHO make it worth using include the ramdom album plugin, which lets it pick a new album at random when it finishes playing the current one (my collection is too varied and big for random track play to work, but this, mostly, does), the gorgeous album list, and the queue, an odd little feature that lets you insert any songs you like into a play queue, to play after the currently playing song. Which solves a lot situations I've been in before. And the little details are all there too, little things like right-clicking on the play button to turn off the music player after the current song finishes; and automatically and quickly finding new music on startup; and properly supporting multiple artist albums. And that just scratches the surface of things I've found to like over a day.. there's a whole regexp/tag based search engine in there, a music prefernces learning system with weighted playback, internet radio, playlists and more. And it's actively developed, and kinda oddly marketed squarely at Debian users. Buh-bye rhythmbox..

Andrew Pollock: [life] Hello America!

Where do I start? It's been an eventful couple of days... The flight to LA was uneventful. Qantas is certainly orders of magnitude more pleasant to fly with than United, even though we were seated in a bulkhead area. I had a 13-month old baby seated next to me (no, Mikal was on the other side), and he was about as well behaved as you could possibly ask a 13-month old baby to behave. Mikal also behaved himself. I had the intention of trying to get something approximating 8 hours sleep, as we arrived at LAX at 7am local time, but I only managed about 4 hours. I did spend about 8 hours with a mask on and my brain in idle, so I arrived at LAX being mostly coherent. Entering the US via LAX was a much less traumatic experience than I was expecting. The E-3 visa was accepted fine, and I now have an I-94 stapled into my passport. Quarantine involved getting looked up and down by a guy in a booth, who waved me through. We had 3 hours to spare (or about 2 by the time we cleared all the immigration/customs queues) and then hopped on a 50 minute American Airlines flight to San Francisco, hired a car and drove to Santa Clara. The accommodation we're staying in for a month is very spiffy indeed. It's a largish gated community of units. Mine's got a ground floor entry, but everything else (except the garage) is upstairs. When Sarah gets here, we'll put up some photos. The weather is lovely as well. Our first outing was to the Social Security office to attempt to get social security numbers. This wasn't as successful as I'd hoped, as we were too freshly in the country to show up on their systems, so we left with letters saying we'd get one within four weeks, when our details had been verified. Yesterday evening, we went for a general recce of the surrounding area, and checked out a supermarket. That was less disconcerting than I expected, although I don't think it was a terribly huge supermarket. Having a GPS certainly raises one's confidence when navigating significantly. Last night I discovered that all the keys in my apartment were not created equal, and that the two loose in the lock box on the front door were the only two that opened the unit, and the two sets on key rings on the coffee table only opened the amenities and my mailbox. So I got to spend a bit of time sitting on my front doorstep until the nice man from Synergy Relocations came out to let me in (except his key didn't work either, so he got to make conversation with a legal alien while we waited for someone else to come out with a key). Today, we drove around to see a shopping mall, and the first set of shops we found happened to be around the corner from an enormous (by my standards) apartment complex, which had some signage implying that it had vacancies, so we decided to get the low down on how renting worked before we did our rental tours. Casey drove us around in a golf buggy and gave a tour of what two different floor plans looked liked. It seems that in this part, it's standard for an apartment to include the refrigerator, dishwasher, microwave, washing machine and clothes dryer, which is good to know. Let me just say that if this is what living in an apartment complex is like, it's more like living in a resort. The place had pools everywhere, tennis courts, two gyms, a community centre, it was just unreal. It was also cheaper than I was expecting. We then went to a massive shopping mall to do some window shopping. Discovered Wetzel's Pretzels. Hope they're not too fattening... Tomorrow, I'm going to avail myself to the complex's gym, and generally get ready for the week ahead. Future posts will be in a new category, which I won't be feeding to Planet Debian as not to bore people. I will inflict Planet Linux Australia readers with them until someone asks me to stop. If you'd like a custom feed that excludes my American adventures, please let me know. I wonder if adjusting Blosxom's idea of timezone buggers up existing posts and aggregators like Planet in general?

18 November 2005

Sam Hocevar: Planet and my Atom feed

Okay, for all of you who made fun of me because my Atom feed broke planet.d.o with unnecessary HTML entities escaping, my feed is valid and every other agregator groks it, so I really think Planet is the culprit. Feel free to indicate a workaround that keeps the feed valid!

16 November 2005

Joachim Breitner: Lightweight Replacement for 111 lines of code

Chris Lamb has announced his gaim plugin “gaim-lightthink” both on his blog and on the thinkpad-linux mailing list. His plugin does basically the same thing as my gaim-thinklight plugin. I was a bit surprised to read that his plugin is supossed to be a lightweight replacement for mine, as he says on the code page.As he has not yet replied to my mail, I can only guess what he means - it’s probably not lines of code, I count 111 in mine and 128 in his. So I hoped he had found a better solution for letting the user write the /proc/acpi/ibm/light file, but he just requires the user to change permissions himself (on every boot, that is), while I install a suid program that does nothing but lets anyone write one of two strings to that file. Also, I think constructing a long line like “echo on > /proc/acpi/ibm/light; sleep .400; echo off > /proc/acpi/ibm/light; sleep .400;...; &” is not very lightweight compared to call the light controlling program directly from gaim, using gtk’s event loop for the delays. But maybe I’m missing something...BTW, I’m still looking for a sane way to let my plugin write to that /proc file. There should be a system wide list of files and permissions for virtual files (/proc, /sys), where packages like gaim-thinklight can register their needs. This file should then be worked off upon boot (or better, upon mounting of the respective file system).

15 November 2005

Edd Dumbill: Building Web 2.0 at XTech 2006

I'm very excited to announce the Call for Participation for XTech 2006. Submissions are due by 9th January. The conference itself is 16th-19th May 2006, in Amsterdam, Netherlands. The theme this year is "Building Web 2.0", focusing on the technologies and issues involved in building the next generation of web applications and services. There are four tracks -- I'll write a bit more about each track in the coming weeks, but if any of this turns you on, head over to the full call and submit your abstract. Also, do read the full track descriptions -- they go into more detail than I can here. Tutorials will be held on the 16th, and the presentation tracks from 17th-19th. In 2006 I want to build on the success of last year and broaden XTech's reach into web technologies. On the technology side, I'm particularly interested in getting more in about databases, frameworks like Ruby on Rails, tagging and search. In addition to technology, I'm interested in opening up dialogue between developers, designers and information architects about the kinds of applications being built on the web now, and the issues of their design, organization and implementation. Partly to encourage this, 2006's conference will have more room for panel discussion sessions. Feel free to drop me a note with any questions or suggestions about XTech 2006. (If you want to propose a session, please use the online submission form rather than sending email.)

Matthew Palmer: Arrr, it's Sonybeard the Pirate!

In what can only be described as a massive display of SCO-you-worked-on-Linux-2.7-grade stupidity, it appears that the infamous Sony shiny-disc-that-pretends-it's-a-CD DRM is not only bad for your computational health, but is in fact a copyright-infringing work, as it looks as though it contains chunks of the LAME MP3 encoder/decoder library. I don't think my commentary can beat what BoingBoing had to say on the matter:
Sony claims that it needs to install dangerous, malicious, underhanded software on its customers' computers to protect its copyrights, but in order to write this malware, it has no compunction about infringing on the copyrights of public-spirited software authors who make their works available under free software licenses like the GPL. I suppose it's natural to believe that everyone is at least as sleazy as you are: for Sony's rip-off artists, assuming that paying customers are planning to rip them off must come easy.
How can anyone even vaguely involved in the tech industry possibly believe that anything they write can't be popped open and peeked in, to find out what naughtyness they've done? The mind boggles. Sony, you are on my official shit list. It's a long and prestigious list, but you've managed to climb very quickly to the upper echelons. May the fleas of a thousand camels infest the nether regions of every Sony executive who may have had anything to do with this whole fiasco. The original article is available, and is quite informative. Yay for BoingBoing, also, who provide me with so much of my daily interesting news.

14 November 2005

Jordi Mallach: The source of all evil

Yesterday was a very, very intense day, and I had lots of fun. Clint, sladen and I headed to Chinatown walking, with a few detours to be able to checkout Manhattan's skyline. The view from the other shore is awesome, even with the two towers missing. When I compare the current view with how it was four years ago, I understand how much the city has changed without them. They were so impressively big that I just can't picture them too well in my mind.


The skyline of South Manhattan We walked over the Brooklyn bridge, giving me other very cool views of Manhattan, while I hammered Clint with questions about this and that. I saw that since 9/11, you can't go past the Town Hall. "Security reasons", of course. I was very surprised to see police cars in every single street. It's like a Police State, and if you ask me, it didn't make me feel safer. After some walk, we finally got in Chinatown, which is the craziest place ever. People sell stuff on the sidewalks, and many streets are packed with people. We had to meet with mikah, biella, dilinger and his cat at some Chinese place for breakfast/lunch. The place, as Chinatown itself, was crazy. As soon as we sat down a few waitresses landed a few plates on the table, without asking or anything. A few minutes later I could see that the way they serve you is going around with carts with lost of food, and you either want it or not. We left dilinger at the metro station, and moved on to the SoHo. I wanted to go to the SoHo Apple Store to see if they knew about replacement Spanish keyboards for my Powerbook. My powerbook was bought in the US last year, so it has a US keyboard. This is mostly ok, but only mostly as it's missing a key. After SoHo, we went back to Chinatown to pick up bubbles. It was nice to see her after Debconf, and she made the effort to come just for a few hours even if she was ill and had lots to do in Philly. We headed to South Street Port, where I had a long chat about Cuba with micah while we sat on a bench looking at Brooklyn bridge. And then, we gathered all our braveness and headed to the heart of the beast, to the kernel of the system. We walked into the Financial District, and soon enough I was walking in Wall Street no less. If I breathed hard, I could smell the money. The road was paved in gold, and there were skyscrapers everywhere. I discovered the rulers of this world had opened a "public space" in JP Morgan's building. To their despair, probably, it had been taken over by the poor. I wonder what Bloomberg will do about it. As I walked up the street, a strange feeling in my heart grew and grew, until, behind a corner, I saw it. The source of all evil was ahead of me, guarded by George Washington himself.


The New York Stock exchange and it's black evil aura of Capitalism I was standing ahead of this building where so many people behave like bastards everyday, pushing millions to povery for a bit more profit margin. The doors were closed and surrounded by security officers, which despite being asked politely, didn't let us in for "security reasons". Next to it was the Church of Capitalism, at the end of the street. It's curious that such an old church still stands where it was build near the harbour probably a century ago, now surrounded by some of the most modern and tallest buildings in the planet. And then, we visited the bull, which I didn't know is the "friendly" symbol of how Capitalism works.


I had Capitalism by the balls We moved down to Battery Square, past the old US Customs building with the four statues representing the four continents. We saw the damaged sculpture which lived in the WTC, and sat down at the pier to watch a beautiful sunset over the Statue of Liberty.


The Statue of Liberty seen from South Manhattan At that point, biella and micah had to meet some friends at one cinema to see the Wal-Mart documentary. We went to a funky place to have some tea, decided to go see Times Square and then walk to Central Park. At the time, mako was arriving to NYC on the Chinatown bus, so we agreed to meet in a restaurant to have lunch. Paul Sladen finally managed to get lost, after many tries during the day, and wasn't seen until we got back home. Mako and Mika waited for us at the door of an... ethiopian restaurant in the SoHo, despite Mako knows I can't stand spicy food. But in the end it wasn't so bad, I just needed a few more glasses of water than average. And I finally got to know mika, after lots of time of chatting over IRC. Greg, SPI's lawyer, also appeared, and was a nice addition to the group. Mako knew where to take us after that. The Belgian bar was packed, but there was a private party in one of the spaces and we took over some of that space. After a few rounds, we were ready to leave the pub and go for Falafel and some tea. I was terribly falling asleep though, so instead of tea we took a cap back to Brooklyn, where we found Paul waiting at the door. After an hour of inflating a mattress, we were ready for sleep, at 4AM. It didn't look like the morning after would be very productive...

13 November 2005

Matt Brown: My LA LUG Roundup Interview

A few weeks ago I had a chat to Karin Purser of the Linux Australia Podcast Service. Karin regularly compiles the Linux Australia LUG Roundup, which does an excellent job of keeping people informed about what is going on in other LUGs around Australia, and now New Zealand. This month they decided they wanted to talk about WLUG and one way or another I ended up as the person to talk to. The interview is now online and apart from being a bit long winded and sounding a bit poncy in a couple of places I think I did an OK job of describing WLUG and the state of Linux in New Zealand. I need to remember not to talk so much in response to questions in future! Grab it from the following locations: or see the Linux Australia Podcast Service Homepage for links to torrents of both files. I think what I’ve come to realise over the past month is that our efforts to create a Linux NZ type organisation may have been misfounded. Linux Australia is already showing a great deal of support for NZ (LCA’06 in Dunedin, WLUG in the LA Lug Roundup, etc), so perhaps we should be pushing to have this support formalised and extended. Worth thinking about some time in my opinion.

Matthew Palmer: Working as a Witness

(A continuation of my reminiscences as an expert witness.) In an earlier post, I made brief mention of the unpleasant realities of being a witness in a trial. More details, ahoy! Most witnesses aren't allowed in the courtroom except when they're giving evidence (to avoid bias) and have to sit out in the hallway. Bring a fat book, because you could be out there for days. I don't think much compensation is provided for your time, either. And, as a final indignity, the lawyers might not even end up calling you to the stand. For example, one of the prosecution witnesses in the case I was involved with was called to appear, and sat outside the court for eight (count them, 8!) days, before being told he wasn't needed after all, and he could go home. I don't know about you, but if that had been me, I would have ended up in the dock myself on a charge of mayhem. Another witness, after having been through her time on the stand, made a comment along the lines of "I'm going to make sure I'm overseas next time". Expert witnesses (as I was) get treated a little better. We can watch most of the bantering in court, while we evaluate the technical evidence presented by other witnesses (experts and non-experts alike), and at least the pay is sensible. As an occupation, "expert witness" would be OK. The hours are pretty sweet, the pay is good, and the conditions quite reasonable. For a regular geek like myself, though, it was fairly close to agony by the end of it. I've had three big projects on indefinite hold while I was at court, unable to give my clients a firm date when I could resume work for them. They were all understanding, bless them, but I could have lost out badly. The complete uncertainty as to what is going to happen and when means that you basically end up camping out at the courthouse for umpteen days. At least, in my case, I was being paid regular consulting rates for my camping. When I say uncertainty, I really do mean it. I was originally told I'd be needed for a day or two -- a quick look at what the other witnesses were saying, maybe jump in the box for a bit, and then I'm off. Then the first witness in the stand was there for nearly three days (along with a day or two of procedural stuff in amongst it so I had been there a week before he was finished). Then the defence was going to make a motion for dismissal, because the prosecution were being pummeled by his honour for their lack of case preparation, so I would have been out of there. That never materialised. Then more procedural faffage, another witness that ended up in the box for about 4 days -- each day of which I thought was the last -- and then it was my turn, which lasted nearly four days. At no stage did I have any indication of when it was going to be over, either, so I couldn't say with any sort of certainty when I could start helping anyone else out. While the legal system has a vital part to play, I'm wondering if something could be done to improve the running of trials to reduce this sort of pummeling of witnesses. On the sweet hours: court convenes each morning at 10am. There's usually half and hour to an hour of transcription correction (although I get the impression that isn't a standard thing) then witnesses start going through. There's a half hour morning tea break around 11 or 11:30, and then an hour lunch at 1pm. Usually there will also be an afternoon break of 10 to 15 minutes, before court adjourns for the day at 4pm (if not a bit earlier). I presume that the reason for the short days is that it's mentally very tiring, and there's lots of prep work for the lawyers mornings and afternoons, but it's a lot better life when you've got none of that to do. Unfortunately, the day isn't short enough that I could get a lot of other work done, so it's effectively just a short-paid day.

Matthew Palmer: Linking Does Not Create A Derivative Work

Ian Murdock's recent piece on the whole Debian/Nexenta controversy contained what is an almost-universal misunderstanding (so common, in fact, that I held the same misunderstanding myself until fairly recently) about what the GPL actually says about linking in other software with a GPL-licenced work. Ian writes:
It seems to me the argument that linking a GPL application to a CDDL library and asserting that that somehow makes the library a derivative work of the application is, to say the least, a stretch&emdash;not to mention the fact that we're talking about libc here, a library with a highly standard interface that's been implemented any number of times and, heck, that's even older than the GPL itself. It's interpretations like this, folks, that give the GPL its reputation of being viral, and I know how much Richard Stallman hates that word.
The core misunderstanding there is that the GPL somehow claims that libraries linked into a GPL-licenced binary are derived works. Nothing in the text of the GPL states that, and a quick scan of the GPL FAQ doesn't provide any opinions of that nature, either. What the GPL does state are a few conditions which you have to abide by in order to be given permission by the copyright holder to exercise rights ordinarily held exclusively by said copyright holder. One of those is that, in order to be given permission to distribute a compiled binary, you must be able to provide source code for the binary itself, as well as all interface definition files, build scripts, and modules contained in the binary, and that all of this material must be provided under terms no more restrictive than those of the GPL. The GPL isn't trying to lay a "derived work" claim on any of those other parts. It's just saying to you, as someone who wants to distribute a binary, "here are some other things that must be OK if you want to do this". A similar clause exists with regards to patents and court judgments (section 7, for those of you playing along at home). This doesn't mean that the GPL is attempting to claim that the patents or court judgments are derived works. A licence could also say "you must delete all copies of any Microsoft product from your hard drive before duplicating this software", but that wouldn't mean that the licence is attempting to claim that all Microsoft products are derived works of the licenced software! As anyone who's looked at a typical proprietary software EULA probably already knows, a software licence can claim pretty much anything (and, apparently, thanks to the DMCA, in the US they can make it stick). The licence doesn't make the claim on the basis of derivation, it makes it because that's just what the licence claims. The GPL is no different in that respect. If you can't fulfill the licence conditions (either because you don't want to, or because -- as in the case of the clause under discussion -- the module you are including in your binary can't be licenced under terms equivalent to the GPL) then you can't do whatever it is that the licence would otherwise allow you to do. To be fair to Ian, some of the comments he made to his blog post indicate that he does understand the distinction between a claim due to derivation and one due to a simple licence term, but I thought it worth making the point crystal clear to everyone out there in the blogsphere, because it's a very common misunderstanding, and I'd hate for it to spread any further than it has already.

12 November 2005

Martin F. Krafft: Big Google

I like The Register a lot...

Anand Kumria: Blogging with a phone

<p> Or '<a href="http://en.wikipedia.org/wiki/Moblog">mobloging</a>' for short. Basically it is using your mobile phone to add content to your blog. All very interesting, except when you get to the details. </p> <p> <a href="http://www.flamingspork.com/blog/">Stewart Smith</a> gave it a whirl ([<a title="first attempt" href="http://www.flamingspork.com/blog/?p=503">1</a>], [<a title="take two" href="http://www.flamingspork.com/blog/?p=504">2</a>]) with fairly predictable results. This is because the message you might receive is dependent on the phone manufacturer <em>and</em> the <aabr title="Multimedia Messaging Centre">MMC</abbr> does to your message. And that is before it might be mangled along the way via email. </p> <p> Basically most phones (or MMCs) will convert the content to either <a href="http://en.wikipedia.org/wiki/Base32">Base32</a> or, more commonly, <a href="http://en.wikipedia.org/wiki/Base64">Base64</a>. Generally the MMS is composed of only two parts, and then sent to an email address. From there you'll have to write something that takes the email and converts it into a blog entry. </p> <p> A while ago a friend of mine wanted to do the same, so I wrote some perl to do it for him. It seemed to work for him (with some tweaks) and it might be enough for you too. You can grab it <a title="Code to help with mobile blogging" href="http://www.progsoc.org/~wildfire/arch/projects/moblog--devo--1.0/">here</a> However you might find it simpler to use <a href="">GNU Arch</a> and register <code>http://www.progsoc.org/~wildfire/arch/projects/</code> and then browse in <code>wildfire@progsoc.org--projects/moblog</code>. </p>

11 November 2005

Joe Wreschnig: More Python

I’m writing a registration database for Anime Detour, our local anime convention. Normally I would hate this kind of work (does anyone actually like SQL?) but SQLObject, which [info]gesten pointed me towards, is really awesome. It basically turns any SQL database (in my case SQLite) into a Python object database, with classes as tables, instances as rows, and Python class methods for queries. People stuck writing database code should definitely check it out. Another Optimization Lesson
Quod Libet stores a library of your music, like most other players. The most common things the library needs to do, and therefore the most efficient things it should do, are 1) get a list of songs in the library, and 2) check to see if a song is in the library (or equivalently, given some handle, retrieve the song with that handle from the library). Anyone familiar with Python will probably think of a dict keyed to something unique, like the filename or URI. That’s what I did, and that’s what I wrote. When QL saves, it serialize the song list using pickle, and dump it to the library: pickle.dump(library.values(), file). When it loads, it does something like for song in pickle.load(library): if song.valid(): library.add(song) where song.valid() reloads the song if its mtime has changed or removes it if the file no longer exists. So what’s the problem with this code? I sure didn’t see one until this morning, when our Italian translator complained about interestingly long cold cache startup times. The answer’s at a lower level than Python programmers usually have to work at: This sucks for disk cache. library.values() dumps the file in Python dict order, which is not only not meaningful, it’s actually semi-random for security reasons. When I reload the dumped file and iterate through the songs in it, I’m stat(2)ing files in an order designed to be as unpredictable as possible. How is the cache supposed to cope with that? The answer is, it doesn’t. Sorting the songs by filename when saving the dict costs almost nothing (Python out-sorts every other language as far as I know), but saves 10% wall clock time for me when starting - it will probably save even more on filesystems that perform poorly on stats of large files (reiser3), and directory trees that go more than 2 levels deep. Lessons learned: First, CPU profiling is good, but doesn’t have all the answers; profile.py insists the program is slower because of the sorting on exit. Second, ideas that work fine for n=100 don’t work well for n=10000 even if the algorithm you chose scales well with regard to complexity theory. Finally, the fundamentals still matter; fixing slow Python code still makes you consider OS/hardware-level cache effects.

10 November 2005

Aigars Mahinovs: No that I have had time to consider my reactions, ...

No that I have had time to consider my reactions, I will write down, what was my experience in Dublin, when I went for a on-site interview for a job in Google. First of all, I had to sign an NDA before entering the office, so I can not tell you about anything that I learnt there. Still this is a huge post, to save me first impression, so that I can look back on it in the future (like tomorrow morning) and see how naive I was. :)

The first thing I noticed after arrival to Dublin was that the highway from the airport to the city was under repair. I was lucky though as I arrive at night and there was almost no traffic. The highway looked strange compared to highways in Belgium, Germany or UK - it had all those strange twists and turns and splits and merges - it looked like the highway was build adapting it into the space between other roads and buildings, like it was some kind of a country road. Oh and that driving on the left side - freaks me out every time.

After I arrived to the hotel and checked in, I discovered that executive suites of 3 star hotel look much like regular suites of five star hotels I've been accommodated earlier in my life. One more fun fact found me soon - the power plugs are all wrong :) When I was in UK some time ago, all homes that I went to used usual EU type plugs, so this was the first time I saw a UK plug in action. Needing power (a computer geek always needs power) I searched for a solution. I thought that I found one, when in the bathroom I found three round holes marked "for shavers only". I responded - "but this is an emergency" and tried to plug my notebook in anyway. Unfortunately they have thought about that - shaver plugs are thinner and just a tiny bit closer, so the regular power plug does not fit in shaver socket. Damn! Oh well, then I'll have to sleep.

Next morning I walked around the area of Google EU Headquarters scouting the surroundings. I found that the building, where the headquarters are, is still under construction - I am sure Google advised the builders on some minor adjustments ;). Just across the street there is a large block of residential houses. Small residential houses. I've seen apartments bigger then some of those houses. I also found several nice apartment houses: from the common "windows that Cappuletti will not climb trough" to modern housing with large windows and modern decor. I also saw the first backyard street in my life - a street less then half a meter wide between two lines of backyards. Diverse life. And that was only one neighbourhood - less then 5 minutes from Google office.

After the interviews were over, I planned to go to see the city center. Unfortunately looking on the map of the city did not provide any clue to discovering any such place. No central building, no central square, no central monument or park. Nothing - just a maze of streets. Well, I hit the maze. What I saw was a flood of people, just like in Riga on Friday night (it was Friday). The difference was that because of the lack of clear centre, the mass of people floated in a larger area. I noticed lots of very special shops that would have not survived in Riga (belt buckle shop?) and a general lack of big supermarkets that we are used to here. Also the people seam to be much more ignorant to traffic rules - it is easy to see people streaming across a street despite a red streetlight.

I can also touch a bit on food, as I tried the food in hotel and in a local fast-food place. Well, the situation in Ireland is much more positive towards fast-food. In Latvia the regular food is both much better and a bit cheaper then fast-food. In Ireland the quality level of regular food seams similar to the fast-food while the price of fast-food is lower. I rated the quality by the taste of meat, where perfect meat is from a wild animal shot in a forest and prepared straight without any additives, and worst meat is slice of fast-food hamburger meat with all the salt and additives they put there. Of course I couldn't get a clear sample within my short stay, but I tried to be as objective as I could.

The conclusion? In my mind, moving from Riga to Dublin will be a downgrade in life quality. Google's offer must be good enough to compensate this, if they want me in. We'll see soon enough. I should have the answer before next week.

P.S. The level of spam in my mail has reached 11 000 per month. Yay! :P

Aigars Mahinovs: Now that I have had time to consider my reactions,...

Now that I have had time to consider my reactions, I will write down, what was my experience in Dublin, when I went for a on-site interview for a job in Google. First of all, I had to sign an NDA before entering the office, so I can not tell you about anything that I learnt there. Still this is a huge post, to save my first impression, so that I can look back on it in the future (like tomorrow morning) and see how naive I was. :)

The first thing I noticed after arrival to Dublin was that the highway from the airport to the city was under repair. I was lucky though as I arrive at night and there was almost no traffic. The highway looked strange compared to highways in Belgium, Germany or UK - it had all those strange twists and turns and splits and merges - it looked like the highway was build adapting it into the space between other roads and buildings, like it was some kind of a country road. Oh and that driving on the left side - freaks me out every time.

After I arrived to the hotel and checked in, I discovered that executive suites of 3 star hotel look much like regular suites of five star hotels I've been accommodated earlier in my life. One more fun fact found me soon - the power plugs are all wrong :) When I was in UK some time ago, all homes that I went to used usual EU type plugs, so this was the first time I saw a UK plug in action. Needing power (a computer geek always needs power) I searched for a solution. I thought that I found one, when in the bathroom I found three round holes marked "for shavers only". I responded - "but this is an emergency" and tried to plug my notebook in anyway. Unfortunately they have thought about that - shaver plugs are thinner and just a tiny bit closer, so the regular power plug does not fit in shaver socket. Damn! Oh well, then I'll have to sleep.

Next morning I walked around the area of Google EU Headquarters scouting the surroundings. I found that the building, where the headquarters are, is still under construction - I am sure Google advised the builders on some minor adjustments ;). Just across the street there is a large block of residential houses. Small residential houses. I've seen apartments bigger then some of those houses. I also found several nice apartment houses: from the common "windows that Cappuletti will not climb trough" to modern housing with large windows and modern decor. I also saw the first backyard street in my life - a street less then half a meter wide between two lines of backyards. Diverse life. And that was only one neighbourhood - less then 5 minutes from Google office.

After the interviews were over, I planned to go to see the city center. Unfortunately looking on the map of the city did not provide any clue to discovering any such place. No central building, no central square, no central monument or park. Nothing - just a maze of streets. Well, I hit the maze. What I saw was a flood of people, just like in Riga on Friday night (it was Friday). The difference was that because of the lack of clear centre, the mass of people floated in a larger area. I noticed lots of very special shops that would have not survived in Riga (belt buckle shop?) and a general lack of big supermarkets that we are used to here. Also the people seam to be much more ignorant to traffic rules - it is easy to see people streaming across a street despite a red streetlight.

I can also touch a bit on food, as I tried the food in hotel and in a local fast-food place. Well, the situation in Ireland is much more positive towards fast-food. In Latvia the regular food is both much better and a bit cheaper then fast-food. In Ireland the quality level of regular food seams similar to the fast-food while the price of fast-food is lower. I rated the quality by the taste of meat, where perfect meat is from a wild animal shot in a forest and prepared straight without any additives, and worst meat is slice of fast-food hamburger meat with all the salt and additives they put there. Of course I couldn't get a clear sample within my short stay, but I tried to be as objective as I could.

The conclusion? In my mind, moving from Riga to Dublin will be a downgrade in life quality. Google's offer must be good enough to compensate this, if they want me in. We'll see soon enough. I should have the answer before next week.

P.S. The level of spam in my mail has reached 11 000 per month. Yay! :P

9 November 2005

Adeodato Sim : Learning

Though rarely, interactions of mine with other members of the Debian community have been punctually more aggressive than I would have liked, and I have (almost) always regretted afterwards. I have no doubts there’ll be further occasions in the future in which re-reading posts like these, together with remembering my feelings while reading some of the surrounding posts, will positively affect the outcome of the situation. NP: Ant nia Font, Patxanga

Edd Dumbill: Amazon 1, Palm 0

I have been getting into all the productivity geekery stuff, and now have all my GTD setup done in the way I wanted it on my LifeDrive. Now all my work life as I know it is contained in my beautiful LifeDrive. Today, the 4 month old LifeDrive touchscreen stopped working. Bad. So I called Palm support, after ages traversing their site to find the telephone number, cunningly hidden so people won't call them. After five minutes of hold music, I spoke to somebody on a very poor telephone line, who was religiously following a script. After a painful amount of time "registering" me, we finally got to talk about the fault. Except, we didn't. Instead he starts asking me to perform various resets and so on. Even though I've explained it's clearly a hardware fault. I've done those, I say. Now he wants me to do the complete hard reset again, but this time while the machine's on the charger. The charger that mysteriously fixes loose connections, I can only assume. I repeat that it's a hardware issue and I'm not an idiot. "I know, but we can't go on until we've done this". A proper hard reset takes 30 minutes on the LifeDrive. Really. I ask him if he knows this. Yes. So he's prepared to sit in silence with me for 30 minutes while I pay the telephone bill. Maybe I should ring back when it's done? Yes, you could do that sir. He gives me a twelve (twelve!) digit ticket number. A conversation with friends reminds me that I have lots of wonderful rights under the Sale of Goods Act. So, to Amazon this time. Alas, they make it very hard to report faults if you're outside their 30 day guarantee period, so I sent them email. A few hours later come back the instructions on how to return the product to them. No quibbles. I don't know if this exasperated saga is the best way to end a month's hiatus of writing here, so I apologise. It really isn't of any significance.

Matthew Palmer: Redhat Considered Harmful

I try hard not to hate Redhat, I really do. I don't visibly grimace when someone says "I'm running $REDHAT_DERIVED_DISTRO", and my first solution to "I can't get this to work on $REDHAT_DERIVED_DISTRO" is almost never "just install Debian,Ubuntu ". But Redhat makes it so hard to not beat them with a stick. For instance, I'm working on building a SOE for a client, and so I've got a bunch of scripts (calling random poorly documented and hard-to-find utilities) to help me do that. Naturally, I'm pruning the package list, which requires me to rebuild the list of packages which are on the CD. No problems, I can handle that. Oh, but the tool that builds the package list can't deal with the correct "ordering" of packages in the list. Why is ordering important? Because, and this will make you laugh, the installer can't actually deal with dependencies. Yes, that's right, anaconda will install your packages in any old order you specify, regardless of what is actually needed. Brain-damaged, certainly, but I've dealt with Windows, so this is ultimately a minor setback. The tools for building the packages lists are in a certain package, which I dutifully install. They then proceed to fail horribly. Why, do you ask? Because the script requires python modules from another package. Gee, wouldn't be handy if there was a mechanism by which a package could specify that it needed another package to operate? OH WAIT, THERE IS -- IT'S CALLED DEPENDENCIES, FOR $DEITY'S SAKE! YOU WROTE THE GODDAMN RPM SPECIFICATION, REDHAT, WHY CAN'T YOU ACTUALLY USE SOME OF IT'S FRIGGING FEATURES! But wait, there's more! Installing the package which contains the module doesn't actually make the module accessable to anything else on the system, because the module is installed in some god-forsaken, out of the way location, where Python fears to tread. You need to specify PYTHONPATH to make it work. Apparently someone was sure that specifying absolute paths in scripts (instead of letting the system search it's environment) was a bad idea, but didn't have problem with not putting modules in standard, well-known locations. Then, of course, the (other) tool segfaults. Why? Because it's reading an empty file. Wow. An empty file causes this thing to fall over in a screaming heap. Not "Sorry bub, but your file's empty" just an unceremonious segfault. Wow. Thanks. And that's even before we get around to actually doing an install...

Next.

Previous.