Search Results: "ana"

29 December 2005

Jeff Bailey: Will bomb for food

CBC reports that fisheries around the world combined consume the same amount of oil per year as the Netherlands. They go on to explain:
  1. Depletion of fish stocks because boats are travelling further out to sea in order to meet demand causes higher fuel consumption.
  2. The fishing industry is still more efficient than other meat based industries.
Another way that your dinner can contribute to global warming and US-style "anti-terrorism".

Steve Kemp: Edinburgh Meetup

KeySigning
Today I went to meet Paul van Tilbur for coffee hot chocolate and exchange key fingerprints. A nice chat on a nice evening. I was pretty sleepy since I’d been forced to get up and leave the house at 10AM this morning to donate blood samples to the local vampires doctors. Getting home afterwards was a bit challenging as there was a fire river - really a torchlit procession + fireworks. Several of the streets on my route home were closed to traffic, so the busses weren’t running. I walked part way home, stopping of en route to buy some DVDs. Once I did manage to get a bus going in the right direction I stupidly creatively managed to get on the wrong one. It immediately changed direction and left me going away from my house! I guess I was more tired than I’d realised. Anyway I got off the bus, and now I’m going to watch part of one of my new films before having an early night.

John Goerzen: Hospital For Sale on eBay

Halstead Hospital and Hertzler Clinic in Halstead, KS are both for sale on eBay for $1.9 million. This was once a thriving hospital in central Kansas. It shut down abruptly a few years ago after it turned out that the management was engaging in their own mini-Enron with its finances. My family doctor was in the clinic part of this building for several years. It's still surprising to me that it's closed.

Decklin Foster: An Explanation Is Requested

In case anyone only reading the tech feed is wondering why those particular bits of sarcasm (I think I should just stop doing that about holy-war topics) floated to the top of my feed this morning, it was a bunch of stupidity on my part and an occasionally annoying feature of PyBlosxom.

Decklin Foster: lastfmsubmitd

Apparently, tis the season to be writing your own Last.fm plugin. So here is mine. I finally got fed up with finding and causing bugs in mpdscribble (I am a bad sponsor!) it s written in C with libsoup, blah blah, can t stand C, and so I revived the MPD pseudo-listener I had started on as a replacement for that awful orphaned cacheless one-off we were all using before mpdscribble. I also fixed a few issues that were bugging me, like failing to detect restarts and tag changes. Not wanting to muddy up any of that logic with HTTP gar, I decided to write a separate program to queue, cache and send along song submissions. They re two or three hundred lines of Python each, and single-threaded (yes, that means child writers blocking and hanging around if the network code is in the middle of timing out or backing off. Deal with it! This is UNIX). I m pretty happy with the design, although the implementation is still very rough. This also mimics the model they want to move to for player plugins in general, which is good, because it will be less work for me to implement version 2.0 of the protocol once that is finalized. Additionally, I was able to find a more satisfying way to solve the disconnected-CD-player problem than my previous dreadful method of either using a few kludgey scripts to frob around in my primary plugin s cache or dealing with using cdscrobbler and having to be very careful about one plugin not stepping on the other s toes and invalidating my backlog. So this is the second example program included. (Oh yes, that part uses the Python bindings for MusicBrainz. MB is awesome. The Python bindings are hideous, however straight port of the C++ API. I d probably be better off just dumping the RDF into a real RDF implementation and doing my own cross-referencing, instead of prying it out piecemeal with select queries and non-polymorphic getters and all the other absolute nonsense you have to deal with when writing in a language without high-level data types or garbage collection. But regardless of implementation woes, this has kept me close to the MB metadata for my favorite CDs, and so I ve been busy all week entering and voting on mods (and doing research to justify my changes), which is very satisfying. I have yet to begin the gargantuan task of adding MB tags to my Ogg collection (I know, this is really just a matter of babysitting tp_tagger, but I ve got some work cut out for me to even get to that point).) And of course, once this becomes less prototypey, anyone who likes it can knock all the networking code out of their plugin and use it as their system service . Perhaps if I m agile enough this can become official code! It is at least a mootable proof-of-concept that UNIX systems don t necessarily need a heavyweight libscrobbler to abstract the service stuff out of the player plugin. I won t get my hopes up though. Still a bit unsure about the name. Theoretically it seems the service (you know, the thing we pay money to if we like it) should be Last.fm, while the software and protocols should still be Audioscrobbler, but the distinction does not seem to be drawn very clearly in practice. With the analogous situation of livejournal vs. ljcom you had a grokkable technical delineation (different repositories) as well as other widely used installations besides ljcom (DeadJournal, etc). I really can t see there ever being a competing installation of Audioscrobbler, because licensing the streamables is a formidable investment hurdle, and there s a negative market effect (also, the web site is not open source). But I am also bored of just sticking scrobble onto something else, so I wanted to grab sticking last onto something else before it got old. I haven t the faintest clue what makes me prefer whimsical names for some projects and prosaic ones for others. Note to actual MPD users (all, like, 5 of you): the stuff in the package will not handshake at the moment, as I have not yet gotten Russ to bless the client ID I made up. Will try to catch him tomorrow. Or later today I suppose. It s ready to go now. Next up: Because it s either this or Sound Juicer, I think perhaps it s time to bid adieu to abcde and write a MusicBrainz plugin for jack (jack is nice enough, I just haven t had a truly compelling reason to switch, and there have always been lots of good eyeballs on abcde). FreeDB delenda est.

Decklin Foster: Non-GUI Music Players

Clint, I use MPD. You can do everything from the command line with mpc. (I frequently do, but I m also trying to help hack Pygmy into something decent for clicky-clicky use as well.) Also very useful if you want to do the whole diskless machine in the stereo cabinet with its library mounted over NFS thing.

28 December 2005

Antti-Juhani Kaijanaho: Unbounded 1.3

Wrote a GDK version of Unbounded’s drawing. Now it’s compile-time-selectable whether the drawing uses Cairo or GDK (Cairo is used if it is available). The main benefit is that Unbounded compiles on Sarge, though it still requires gtk2hs, which is not in Debian, at build time. Released Unbounded 1.3. Packaged it, too, but only unofficially. Downloads are here. There is no aptable repository. The debs are signed with my Debian key, there is no separate Debian source. The debs require only stuff that is in Debian.

Uwe Hermann: 22C3: Impressions, lectures, hacking, bb ported to iPod

Train Station It's day 2 of the 22C3 congress — time to post some stuff. I've been travelling to Berlin by train with Daniel Reutter, taking a bunch of photos with my new PowerShot A610 (see photo on the right, for an example). You can browse the 22c3 flickr group for more photos. We've listened to quite a lot of lectures already, and many more will follow. Especially the keynote by Joi Ito was really great, the network here works most of the time (wired net, as well as WLAN), so everything's fine for now... As far as hacking is concerned, we played around with iPodLinux a bit. We managed to port aalib to the iPod an then (more interesting) we also ported bb, the portable text-mode demo. There are some issues on both the 4g iPod and the 5g iPod we tried this on, but we're working on it... We have documented the ports in the form of HOWTOs (currently Debian-specific) in the iPodLinux wiki (aalib, bb). bb on a 4g iPod
bb on a 5g iPod photo 1
bb on a 5g iPod photo 2 Up next: porting Ruby to the iPod.

Andrew Pollock: [life] Back online

Our DSL modem finally arrived today. Well, it kind of involved accosting the UPS guy in an adjacent street whilst walking back home from 7-Eleven acquiring ice cream, but hey, we got the thing in the end. I went with Sonic on advice from guys from work, and I have to say I've been totally impressed with their customer service to date. Today I got an email from them because I'd reached my activation date, but they hadn't seen any ADSL traffic from me yet, and they just wanted to check that everything was okay. We had a free dialup account for use while we waited for the ADSL to be provisioned (and the delay was with receiving the modem over the holiday season, not the ADSL provisioning itself). Also, their account management website allows an impressive amount of self-control over aspects such as spam filtering and firewalling. I'm a very satisfied customer so far.

Jonathan McDowell: Linux WMDs

So, the delightful Kathy bought me a Marks & Spencer USB Missile Launcher (unfortunately out of stock at present or I'd have linked directly to it. Try searching on eBay / Google to see what I mean.) Problem. WinXP/2k only drivers. That's no fun. Plugged it in to my laptop (as you do). dmesg reports:
input: Tenx Nonstandard Devic as /class/input/input6
input: USB HID v1.10 Device [Tenx Nonstandard Devic] on usb-0000:00:1d.1-2
input: Tenx Nonstandard Devic as /class/input/input7
input: USB HID v1.10 Device [Tenx Nonstandard Devic] on usb-0000:00:1d.1-2
lsusb says:
Bus 002 Device 004: ID 1130:0202 Tenx Technology, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x1130 Tenx Technology, Inc.
  idProduct          0x0202 
  bcdDevice            1.00
  iManufacturer           0 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           59
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      43
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Devices
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      23
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
The Windows software appears to consist of TenxHID.dll (24k) and Missile_Launcher.exe (908k). TenxHID only exports DeviceIni, ReadBuffer and WriteBuffer AFAICT. Which implies the higher level stuff is done in the exe to me. I think it's a job for USBSnoop and a Windows box, but that'll have to wait for a few days until I get back to a WinXP box I can use to fiddle. Unless someone else manages to write a driver in the meantime. :)

27 December 2005

Matt Brown: Miredo/Toredo Patent Status

Miredo is an implementation of the Teredo - IPv6 over IPv4 tunnelling protocol which I have been playing with lately. I have filed an ITP bug to get Miredo into Debian, however this has been delayed while I try and get a handle on some of the patent issues surrounding the Teredo protocol. While Miredo itself is licensed under the GPLv2 the state of the Toredo protocol is less clear. Teredo was created by Christian Huitema, an architect with Microsoft. It is currently a Proposed Internet Standard waiting for the IETF editor to review it and assign an RFC number for it, IANA will then assign a permanent prefix for use by Teredo clients, servers and relays. According to the IETF IPR disclosure page, Microsoft has filed a statement of claim against the technologies described in the Proposed Standard. Microsoft states that they will provide a Royalty-Free, Reasonable and Non-Discriminatory License to All Implementers in their statement. Specifically the license that they offer the Teredo protocol under is called the Microsoft Royalty Free Protocol License Agreement. This is a catch-all license that Microsoft uses for all client-server protocols used by Windows. The license itself doesn’t make any claims about Microsoft’s IP rights, it simply gives you a license to use any rights Microsoft may have in the specific protocol you are using. For example at the end of the license agreement you select which protocols you wish to have covered under the agreement. Alongside Teredo you can also choose protocols such as IPv4, DNS, 6to4 and lots of other common protocols. The actual patent application for Teredo is incredibly difficult to find, the IETF IPR disclosoure doesn’t link to it, none of the proposed standards link to it and googling for “Teredo Patent Application” isn’t particularly successful either. In the end it turns out that the title is quirkily named “Allowing IPv4 clients to communicate over an IPv6 network when behind a network address translator with reduced server workload” and was published as Patent Application 20040190549 on the 30th September 2004. Incidentally if anyone knows of a nicer way to link to a US Patent Application than the ugly URL above, I would love to know. Half the reason that the Patent Application was hard to find is that it doesn’t actually mention Microsoft anywhere at all, unlike the ~5000 odd other Patent Applications currently filed by Microsoft. From what I can tell it appears that Christian Huitema has filed the application through is own personal attorneys independently of Microsoft. So where does this leave us in terms of getting Miredo into Debian? The short answer is I’m not entirely sure. I can’t seem to find a definitive statement regarding Debian’s position on patents anywhere, the best I’ve been able to come up with is a debian-legal post from Andrew Suffield from Jan 2005 which offhandedly describes the informal Debian patent policy as:
“ignore patents until somebody starts to wave them around, then drop the offending thing like a hot rock”
So maybe I’ve already shot Miredo in the foot, by investigating its Patent Status… :( My take on the situation seems to be that Debian is perfectly happy (and perhaps has no other option but) to ignore patents applicable to software in Debian until it becomes apparent that a particular patent is being enforced or has the potential to be enforced. So the question now becomes whether the Microsoft Royalty Free Patent License is acceptable enough to Debian to allow Miredo to be included in main or non-free, or whether it simply can’t be redistributed at all. The main problem I see with the license is that it does not permit you to sublicense other parties to make use of the Toredo technology used by Miredo. If this were a copyright license then that would most certainly fail to pass the Debian Free Software Guidelines, does Debian treat patents in the same manner? I think it’s time for me to post to debian-legal to seek some “official” guidance on the situation, but hopefully this post has ordered my thoughts enough that I can now write a coherent mail seeking help. If you have any comments or pointers to Debian statements on this sort of situation that I have missed they would be most welcome.

26 December 2005

Clint Adams: No hay gracia en este elitismo

She was a fierce and majestic creature, with a fearsome bite and terrible claws. The anger of a thousand suns burned within her. She was a spoiled brat who needed to be the center of attention. In order to incite people to hurt her, she abused those who were foolish enough to pay her attention. She was a bandit, waltzing in the nighttime with a hundred sparkling rings. She was indigo, red, gold, green, light blue, red, yellow, orange, green. She was green. She was a fierce and majestic creature. She was GREEN.

Adam Rosi-Kessel: Verizon Does Not Have Enough Phone Lines

I’ve complained about Verizon twice before, and still haven’t gotten around to my omnibus Verizon entry. The latest issue is that I cancelled my Verizon DSL over two months ago, having switched to Speakeasy, which, although much more expensive, provides so much better service (both by way of connectivity/throughput and customer support) that it’s actually worth it. I called Verizon at the time, and asked them to cancel the DSL, which they said they would do immediately. The next month, DSL was still on my bill, but I figured it was probably a billing cycle issue. The following month, the DSL charges were still on my bill, so I called to find out what happened. They had no record at all of my prior request to cancel service, but said they would happily cancel it now and refund both months. I asked them if there should have been a paper trail for the earlier request, and they said there wouldn’t be. I asked them if I could have some sort of paper or email acknowledgment of my current request, and the representative insisted it wasn’t necessary (and apparently just “not done.”). Now again this month, I still have the charge on my bill, and the last two months have not been refunded. When I try to call today, however, after maneuvering through several menus to get to a human, I am informed that not only are all representatives currently serving other customers, but there are no available phone lines for holding, and I should call back later. Click. How is it that this country’s largest phone company doesn’t have enough phone lines? (I suppose another question is how is it that they manage to retain so many customers. But that’s a question for another day.) (Any Verizon folks out there who could comment on this entry and provide some illumination?)

Axel Beckert: Yet another old laptop

My father got me a nice IBM ThinkPad from 1996 earlier this year, so the next old laptop he digged up was planned to become a christmas present for my brother. But my father didn’t manage to find out, how old nor how fast that laptop was. And when I found out that it was a Pentium I with 90 MHz, it was clear, that my brother wouldn’t have any use for it, so he got “only” the used 850 MHz AMD Duron midi tower and my parents declared that old Compaq LTE 5100 laptop as a christmas present for me. :-) As my IBM ThinkPad bijou, this Compaq LTE 5100 is from 1996 and has a Pentium I processor. Both also have a 800×600 resolution, a double PCMCIA slot and a floppy drive, which can be replaced by a CD-ROM drive (if I had one). But that are all similarities. Technically the Compaq has 90 MHz instead of the ThinkPad’s 133 MHz, but therefore has 72 MB RAM in comparison to the 48 Megs the ThinkPad has. Also regarding disk space the Compaq outperforms the ThinkPad: 1.6 Gigs of disk space in comparison to the ThinkPad 1.0 GB hard disk. Another difference is the battery: While the ThinkPad can work over 2.5 hours without external power, the Compaq even didn’t manage to completely boot its currently installed Windows 98 (the ThinkPad had a Windows NT installed when I got it) when running on battery. (Will do that test again when I can confirm, that the battery was full before testing. :-) Yet another difference is the keyboard layout: The ThinkPad has an US layout while the Compaq has a Swiss-German layout. But the most obvious difference is the look: The black ThinkPad still looks like having a modern design while the Compaq looks very very outdated in its perfect computer beige and with its quite small display. So retroperspectively, it was a good a idea to name the ThinkPad “bijou” (French for jewel, jewellery, gem, etc.; named after a very neat british two-door limousine built in the UK by Slough on a 2CV base during the ’50s). Because now I have the choice between a lot of not so nice looking (not to say ugly ;-) 2CV derivatives to name the Compaq after. My favourites currently are the Iranian “Baby Brousse”, the Greek “Namco Pony” and the German “Fiberfab Sherpa”, all canvas and flatbed style 2CV based buggies, similar to the original Citroën Méhari but with steel body instead of the Méhari’s controversial plastic body. And one of the not used names, I can use for further ugly Compaq laptops¹. Another question yet to answer is the question of what operating system to install on it. Since the ThinkPad runs fine with Debian 3.0 Woody and I have a lot of other Debian boxes at home (running Woody, Sarge or Sid), I currently think about installing the very fresh NetBSD 3.0 (released on Christmas’ Eve 2005), FreeBSD 6.0 (released early November 2005), DragonFly BSD 1.4 (to be released in December :-) or DeLi Linux 0.7 pre (which was also released in early December 2005 and already uses X11R7). Another idea was to install grml 0.5, but since grml is a live CD distribution, it probably would be hard to install it over network. Same counts for ReactOS (version 0.2.9 was released shortly before Christmas 2005), which doesn’t seem to have a floppy disk plus network install. Since I always planed to upgrade my currently defective Toshiba T6400 i486 laptop ayca (maybe after getting an organ donor on eBay or so) to DeLi Linux 0.7 (and perhaps write a review about it for Linux Magazine or so) and I may get an Sun Ultra Enterprise 2 soon (on which NetBSD 3.0 would be the perfect OS since Linux’ performance still seems to suck on Sparc :-), I currently prefer the FreeBSD or DragonFly idea. If the Ultra doesn’t come, it probably will get NetBSD, since I haven’t a NetBSD box yet. (Haven’t a DragonFly box either, but a FreeBSD 4.x running somewhere. :-) Well, I guess, I’ll take even more old laptops than last year to the Vintage Computer Festival Europe (VCFe) next May. And since the two 1996 laptops are now 10 years old, they’re even ontopic! Yeah! ;-)

¹: I have two other not yet working Compaq laptops, both from an elder generation than Pentium I. One I got on a Swiss flea market for a few euros and the other was the first laptop of my boss, which he else would have thrown away. Unfortunately both are without power adapter and neither the usual allround laptop power adapters from Conrad, etc. nor the one from the LTE 5100 fits. But since there is eBay, I expect to get such a power adapter once. :-)

Andrew Pollock: [life] First Christmas abroad

(I love the term "abroad". It sounds so English.) Well that happened. We had Michael and another Andrew from work who started two weeks before us and his wife come over for what Michael was calling "linner" (the inverse of "brunch"). Sarah cooked up an absolute storm. We had roast turkey, roast potato, pumpkin and sweet potato, steamed broccoli, cauliflower and asparagus, and Yorkshire puddings. We had so many types of gravy we completely forgot about the cranberry sauce. Michael managed to track down a plum pudding (this country seems obsessed with pumpkin pie) and we had something approximating custard (something else this country doesn't seem to do) with it. A very good feast was had by all, and six hours later we were done. Back to unpacking boxes. Brought to you by some kind neighbour's open access point.

John Goerzen: A Christmas Conspiracy

There's been a bit of a plot in the air at church this Christmas. Mystery. Intrigue. Conspiracy. Even some good-natured holiday ribbing. And it's my fault. So let me explain. A little awhile ago, my dad and I pooled some money and purchased a nice Nikon Coolscan V negative and slide scanner. My first batch of slides to scan on this consists of 3 reels plus one box of slides from the church archives, some 600 images or so. I've got 350 scanned so far. We'll be using these in the centennial book we're working on, and I'll burn some DVD-Rs for use by the church in the future. There are some real treasures in this set. Some extremely rare color photos of the old church building (torn down in 1965), including its interior. All sorts of people in their younger days, plus photos of quite a few people that have since passed on. There were also many photos from 1983 for the church's 75th anniversary celebration. It's safe to say that few, if any, people have laid eyes on these photos in the last 25 years. About two weeks ago, I was remembering how I surprised Aunt Viola by giving her a print of a photo of the choir she directed in 1946. It occured to me how many photos are in this slide set that people would love to see. I started thinking "Hmmm....." As I was sitting there scanning, I had lots of time to think. (Each slide takes about 3 minutes at 4000 DPI). I finally decided that I could make nice prints of these images by uploading them to a photo printing service. I'd surprise a few people with an anonymous gift of photos on Christmas. Well, a "few" grew into "as many as possible", and I wound up ordering 175 prints. But I'm getting ahead of myself. I ran into a problem early last week. I don't know who many of these people are, or who their relatives are that still attend our church. I needed help. I had to enlist my dad in my conspiracy -- he knows many of these people and who they're related to. With his help on Monday, we identified people in some 300 photos. I rushed to get them uploaded to Shutterfly and place an order with overnight shipping to make sure they'd arrive by Christmas. They finally did. Terah helped stuff envelopes while I sorted out the photos. Each envelope had the name of the recipients, plus "Merry Christmas!" written on it. Our names were nowhere to be found. Saturday afternoon, before the big Christmas Eve program, my brothers and I (who had heard the conersation with my dad, but were good at keeping secrets) helped me stuff mailboxes at church. We escaped without tipping anyone off to what we were doing. The Christmas Eve service came and went. I tried to listen for conversations about pictures, but didn't hear any. I was a little concerned -- hopefully people liked these photos. I knew that the moment my aunt saw her photos, she would be able to figure out it was me behind it, and would spread that, but I figured I'd remain anonymous for awhile. It's fun to keep people guessing. Well, I accidentally blew my own cover this morning. I asked my aunt about her pictures, but she hadn't opened the envelope yet. Oops. (In my defense, that's not very like her!) But it turns out that these photos have been a topic of many conversations over the past two days. Lots of 70- and 80-year-olds "blaming" each other for delivering surprise photos on Christmas. Wild speculation about who this anonymous Santa is. And where did these old pictures come from? Whose closets would still have such a thing? Plus, lots of checking to see exactly what photos each person got. (I tried to give people photos that would be meaningful to them -- friends, relatives, etc.) There was even some amateur handwriting analysis going on. Apparently nobody even suspected me at all. This was probably the most time I've put into a Christmas gift in a long time. But also the most fun and rewarding. I got to see somebody run out the church to show a picture of some high schoolers in 1965 to a friend before they drove off. This is what makes Christmas such a fun time of year -- touching someone's heart. The sort of thing that can't be found on any Walmart or mall shelf. I've never been able to give a meaningful Christmas gift to so many people before, and it is a really wonderful feeling to have surprised so many this year.

25 December 2005

Enrico Zini: drezza - Get a picture collection ready for publishing

I've been having three wishes since some time:
  1. Lean Ruby
  2. Find an easy and fast way to find digital camera shoots that need an invocation of exiftran, and invoke it
  3. Find a comfy way to code user interfaces. In particular, I've always dreamed of sticking closures into event handlers.
I've recently managed to fulfill these three wishes in a single shot by coding dr zza, a minimal picture browser with quick links to invoke exiftran. If anyone is wondering, "dr zza" means "make it straight" in Bolognese. It is simple, it is easy, it does all I need: you invoke it and it will show all the pictures in the current directory. If you invoke it with a directory as commandline argument, it will show all the pictures in that directory. It will display the pictures in a list together with their thumbnail. The thumbnail is taken from the EXIF thumbnail. If a JPEG file has no EXIF thumbnail, it invokes exiftran to generate it. Clicking on an image in the list shows it in detail. In the toolbar there are buttons to rotate the image with exiftran, which uses a lossless transform and respects exif data. The tool comes in a single file, no need to install. The source code is clean and commented, and is also a nice demo of various Ruby/GTK2 and Ruby/Gnome2 features and programming tricks, including:
  • subclassing GTK widgets
  • creating custom signals
  • reacting to widget resize
  • processing GTK events during long computations
  • updating the Gnome status bar
  • embedding pixmaps in the source code
  • using custom pixmaps for the toolbar
You can get it from here. If you play with it, let me know and I'll keep it up to date.

Enrico Zini: Including inline images in Ruby GTK2

Including inline images in Ruby GTK2 I'm making a simple application and I'd like to keep it self-contained into a single file; however, I'd like to use some custom icons in it. I tried storing a pixbuf in a string:
ICON = <<EOT
/* XPM */
[...]
 ;
EOT
icon = Gdk::Pixbuf.new ICON
but it tried to open a file called "/* XPM */\n....". I tried with an array:
icon = Gdk::Pixbuf.new ICON.split("\n")
But I kept getting GdkPixbuf-WARNING **:Inline XPM data is broken: Invalid XPM header. Note that trying to write that data to a file and loading the file, worked. This worked:
icon = Gdk::Pixbuf.new "pippo.xpm"
This didn't:
tmp = IO.readlines "pippo.xpm"
icon = Gdk::Pixbuf.new tmp
I finally managed using csource:
  1. gdk-pixbuf-csource --raw --name=antani image.png > /tmp/antani

  2. insert /tmp/antani in the Ruby source code, strip away the comments, concat the various strings:

    ICON = ""+
      "GdkP"+
      "\0\0\4\30"+
      "\1\1\0\2"+
      "\0\0\0@"+
      "\0\0\0\20"+
      "\0\0\0\20"+
      "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"+
    [...]
    
  3. load the data with icon = Gdk::Pixbuf.new ICON.unpack("C*"), true

A possible improvement could be using --rle in gdk-pixbuf-csource: raw is good for avoiding to copy the image data, but I don't feel comfortable in doing it since the image data is an integer array temporarily generated by unpack. As usual, if you know of better ways please send me a mail and I'll update the blog entry.

24 December 2005

Aigars Mahinovs: It just came to me that if we accept the definitio...

It just came to me that if we accept the definition of "industry" (from the text of the software patent directive that EP had in first reading where it it was said) that industry basically is mass production of material goods, then there is no need for neither software industry not movie industry nor music industry - the production and distribution of copies is very efficiently achieved via the Internet. These industries are no longer needed by the society - they have no reason to exist.
Some might object - but where will the first copy come from? Well, that is not product of an industry, but a product of an artist. If originally said industries were created merely to copy and distribute works, now they are morphed into structures "supporting" artists. That is a clutch, that is not needed. There are other ways for artists to make a living off their art. Fanart and free software movement clearly shows that. Patents and copyright are just clutches for the falling industries. The clutches must go and giants must fall for progress towards knowledge society.
I would be glad if we could have professional musicians getting a minimal wage from the government. If your art has been downloaded by 10 000 people last year, you can get government pro-artist payroll. If you want more then minimal wage - do tours, sing in clubs, do advertisements, work in more then one art or get another job. I would be very glad to pay a tax for that if I could have free and unrestricted (copyright-free) access to all art of all artists. Call it art tax, device a maximum number of pro-artists the country can support via the tax, make qualification competitions, whatever. There is art without copyright. It is just not that expensive.
However, while the society will allow industries to suck their money, it will be very hard to change the situation as the very same money will be used to prove that said industries are worth supporting.
There are two ways: kick the crutches out (abolish patents and copyrights) or just move forward and ignore them and their crutches as we step through them towards freedom (develop free software, free media, free ... movements). Of course we can do the second until the first becomes viable.

In that context it is nice to see some funny lawmaking in France (a law project for "copy all you want for 5 /month") or WIPO saying that copyright is not really a right and it is quite a shame that word "right" is part of "copyright". Even reading about each new patent horror of USA court system becomes fun, because them worse it gets, the closer is the end. (Same with Bush :P)

22 December 2005

Enrico Zini: Custom signals with Ruby-GTK2

How to create a custom signal in Ruby-GTK2 I'm playing with the GTK2 bindings for Ruby. When coding GUI things, I usually like to build my own higher level widgets by subclassing containers and populating them with other widgets. For example, I'm creating an image browser and I like to make an ImageList class that subclasses a Gtk::ScrolledWindow and builds the TreeView inside it:
class ImageList < Gtk::ScrolledWindow
      def initialize
              super
              @files = Gtk::ListStore.new(String, String, Gdk::Pixbuf)
              @fileList = Gtk::TreeView.new(@files)
              renderer = Gtk::CellRendererPixbuf.new
              col = Gtk::TreeViewColumn.new("Thumb", renderer, :pixbuf => 2)
              @fileList.append_column(col)
              renderer = Gtk::CellRendererText.new
              col = Gtk::TreeViewColumn.new("File name", renderer, :text => 1)
              @fileList.append_column(col)
              self.add @fileList
      end
      
      def readDir (root)
              Dir.foreach root do  dir 
                      file = root+'/'+dir
                      if !FileTest.directory?(file) && dir =~ /\.jpe?g$/ && FileTest.readable?(file)
                              thumb = getThumbnail(file)
                              iter = @files.append
                              iter[0] = file
                              iter[1] = dir
                              iter[2] = Gdk::Pixbuf.new thumb
                              File.delete(thumb)
                      end
              end
      end
end
When working like this, I find myself very soon in need of creating custom signals: in this case I want to make a signal that ImageList emits when the user select an image from the TreeView, like this:
fileList.signal_connect("selected") do  filename 
      imageDetails.load(filename)
end
Now, how do I implement that extra 'selected' signal in my ImageList? Ruby documentation is usually very good and easy to find, but this time Google had little to say to me. When the going gets tough, the tough gets to IRC:
enrico> Hi.  http://ruby-gnome2.sourceforge.jp/?News_20031116_1 says that it is
        possible to create custom signals, however I could not find any
        documentation on how to do it.  Anyone has a link or a short explanation?
pterjan> glib/sample in the source IIRC
pterjan>   # define new signal "hoge"
pterjan>   signal_new("hoge",                  # name
pterjan>              GLib::Signal::RUN_FIRST, # flags
pterjan>              nil,                     # accumulator (XXX: not supported yet)
pterjan>              nil,                     # return type (void == nil)
pterjan>              Integer, Integer         # parameter types
pterjan>              )
pterjan> in glib/sample/type-register.rb
enrico> ooh!
enrico> pterjan: thanks!
enrico> I'll blog about it, it might make it easier for others to google this answer
Thanks pterjan, and oh, coolness! So there are nice examples that I was silly enough to miss. Are they included in the Debian packages? Oh, yes! Right in /usr/share/doc/libglib2-ruby/examples/type-register.rb. Here's the ImageList class with the new signal:
class ImageList < Gtk::ScrolledWindow
      type_register
      signal_new("selected",              # name
                 GLib::Signal::RUN_FIRST, # flags
                 nil,                     # accumulator (XXX: not supported yet)
                 nil,                     # return type (void == nil)
                 String                   # parameter types
                 )
      def initialize
              super
              @files = Gtk::ListStore.new(String, String, Gdk::Pixbuf)
              @fileList = Gtk::TreeView.new(@files)
              renderer = Gtk::CellRendererPixbuf.new
              col = Gtk::TreeViewColumn.new("Thumb", renderer, :pixbuf => 2)
              @fileList.append_column(col)
              renderer = Gtk::CellRendererText.new
              col = Gtk::TreeViewColumn.new("File name", renderer, :text => 1)
              @fileList.append_column(col)
              self.add @fileList
              sel = @fileList.selection
              sel.signal_connect("changed") do  sel 
                      if iter = sel.selected
                              puts "Double-clicked row contains name # iter[0] !"
                              self.signal_emit("selected", iter[0])
                      end
              end
      end
      def signal_do_selected(file)
            puts "Selected " + file
            #p caller
      end
      
      def readDir (root)
              Dir.foreach root do  dir 
                      file = root+'/'+dir
                      if !FileTest.directory?(file) && dir =~ /\.jpe?g$/ && FileTest.readable?(file)
                              thumb = getThumbnail(file)
                              iter = @files.append
                              iter[0] = file
                              iter[1] = dir
                              iter[2] = Gdk::Pixbuf.new thumb
                              File.delete(thumb)
                      end
              end
      end
end
And here's the controller code that binds the signal to some effect:
imageList.signal_connect("selected") do  imagelist, filename 
      puts "File # filename  was clicked!"
      image.load(filename)
end
It's quite easy, and (finally!) it does what I want without needing to write thousands of lines of code. YAY! And I finally fulfull my dream of connecting closures instead of callbacks to GTK signals. Yes, I could have done it in Perl. Yes I could have done it in Python. But Ruby is soo cute!

Next.

Previous.