Search Results: "joey"

30 December 2007

Joey Hess: haskell baby steps

Since early August, I had forgotten about my plan to learn haskell. Today I refreshed my memory from the docs I read back then, and started writing some very simple programs. Reading a lot of docs and letting it gel for a few months seems to have worked fairly well, I was able to throw this program together in short order, and I think it's not too horrible.
putStrs = putStr.unlines
x s n = unwords $ take n $ repeat s
plot x s = (take (x-1) s) ++ "  " ++ (drop (x+1) s)
f x = truncate(40 + 38 * sin(x / 9))
line = "JOEY HESS"  x  8 
main = putStrs [ plot x line   x <- map f [1..]]
If you're wondering what it does, the equivilant perl is:
#!/usr/bin/perl -lisubstr($_,39+38*sin++$y/9,2)=$s
for($s='  ' McQ;$_='JOEY HESS 'x8;print) eval$^I 
I suppose both demonstrate features of their language to some extent.
At first I assumed haskell would automatically convert the floating point value coming out of sin and I got a nasty suprise:
    No instance for (Floating Int)
      arising from use of  f' at foo.hs:17:21-26
    Possible fix: add an instance declaration for (Floating Int)
Adding the truncate fixed that, but figuring that out from the above error message and google took longer than figuring out how to write the rest of the program. :-(

28 December 2007

Adeodato Sim : omg, DEBCHANGE_RELEASE_HEURISTIC=changelog

Until today, my workflow for handling debian/changelog was:
  % dch -i -D UNRELEASED
    (or dch -v X -D UNRELEASED)
  % dch -t
  ...
  % dch -t
  % dch -r
The first call opens a new changelog entry with distribution set to UNRELEASED, then each dch -t call adds successive changelog lines (the -t makes dch leave the trailer line untouched, which I find very useful, since it reduces noise in diffs, particulary in multi-maintainer packages), and finally dch -r changes the distribution from UNRELEASED to unstable, and updates the trailer line. While preparing this blog entry, which was about dch -t only, recommending it for everybody, I found that the above workflow is nicely automated for you if you use --release-heuristic changelog, or set DEBCHANGE_RELEASE_HEURISTIC=changelog in ~/.devscripts. Automated as in, just running dch will open a new entry if appropriate (that is, if the latest entry is not UNRELEASED), or will add new lines defaulting to -t. So the workflow now is:
  % dch
    (or dch -v X)
  % dch
  ...
  % dch
  % dch -r
Kudos to Guillem and Joey for #435980 and #448795, and the devscripts maintainers, of course.

25 December 2007

Adeodato Sim : Moving to ikiwiki

As many others, I’ve moved this blog to ikiwiki. In fact, I’ve moved my whole 3-page website to ikiwiki, and it only felt natural to migrate the blog as well (I may miss hobix’s webpage, though). Anyway, this gives me a bit more flexibility when creating the RSS feeds, so I’ve now created a separate feed for Planet Debian (which won’t have only Debian-related content, mind you), and left the old RSS URL to include all posts, e.g. some more personal ones, or some that I’d find unsuitable for the planet. If you’re interested, here is the full feed. I run ikiwiki in my laptop to generate static html, and rsync the generated output to the webserver. I have a Bazaar branch in my laptop as well, but it doesn’t interact with ikiwiki in any way. Finally, I’m very grateful that Joey committed this minutes after me mentioning on IRC, and I’m very grateful as well to whoever wrote the typography plugin. Migrating the old blog wasn’t hard, just tedious and boring, particularly since I didn’t want to keep using Textile, but migrate to Markdown. I switched off usedirs to keep old URLs working (I’d rather not mess with redirections), and used the date option of the meta plugin, so that the “Posted” information for old entries when inlining would be accurate. This still left the “Last modified” timestamp in the individual pages wrong, so I just used a script that would change the mtime of the entries in the filesystem to their creation time. One wart I’ve found is that I’m very used to having both a filename and a title for each entry, and have the filename just present in the navigation bar of the browser, and the title shown in big inside the page. You can do this in ikiwiki by using the title option of the meta plugin, and giving a H1 element in the entry content. However, this makes the H1 show in the RSS feed, which I had always noticed in Zack’s blog, and always found inconvenient. Oh well. It also makes for the same title to appear twice in the default [[inline]] page; to solve it, I just hide with CSS the H1 there — zack, e.g., does not use [[meta title]], and aligns the permalink to the right. Update: So I was washing the dishes and it struck me: maybe with a conditional! And, effectively, it is possible, given that there is a convenient included test. So now I start my entries with:
  [[meta title="This is the long title"]]
  [[if test="!included()"
       then="# This is the long title"]]
Yay! Update (2007-12-27): Lars does it differently, by only providing [[meta title]], and modifying the page template to include:
  <h1><TMPL_VAR TITLE></h1>
Update (2007-12-29): I finally decided, at least for now, that is cleaner not having the title duplicated in two lines, and went with a template. I didn’t want the <h1>title</h1> bit in all pages, though, and Joey pointed out that I could use a different template for blog entries using the pagetemplate_plugin.

Joey Hess: a hess holiday

On the Feast of the Radishes, we gathered at Heaven's Gate to eat mole and talk about comets.

22 December 2007

Joey Hess: solstice

Good solstice party this year. It seems not long since the last one, and I thought about not going, but did in the end. (Anna, several people asked about you.) The bonfire was in the field at the top of Wortroot, and it was cold enough to be very nice to have a fire out there while some of Here's to the Long Haul played. Down in the basement, watching contra dancers, I noticed that Klypso's muzzle has turned all white.

16 December 2007

Joey Hess: The Man from Earth

I turned this movie off because it became clear in the first few minutes that it was a very low budget movie shot in a hurry[1] with actors who reminded me of ones from not particularly awesome plays[2]. Then for some reason I went back to it. And soon it got interesting. And then I got thuroughly sucked in. And then I was really sad that the storytelling was over. I think it's been a very long time since I was sad that a science fiction movie was over[3]. Maybe 1980? This movie is set all in one room in a cabin, and has no higher technology in it than a cell phone, and yet it's amoung the top two purest peices of science fiction I've seen performed. And the lack of special effects, especially CGI[4], was a very nice change. There's a good chance you'll not enjoy this movie, but I hope you get a chance to see it and find out. You won't find it in theaters, there's a DVD and it's on Netflix, or you can download it and paypal the director and cast a few bucks.
[1] In about a week as it turns out.
[2] Which is probably true of some of them. I only recognised one.
[3] Snip: silly-yet-true-analogy-between-typical-SF-movies-and-bags-of-potato-chips
[4] Snip: hating on most CGI

15 December 2007

Joey Hess: sunny day

Yesterday was a nice sunny break in the mostly constant cloud cover. I went out to the Clinch Mtn and climbed up to the fire tower, it was very clear and I think I was able to see South Holston lake from there.

13 December 2007

Joey Hess: if all you have is a hammer

David's post about programming languages and hand tools reminded me about the old saw about the hammer and the nail. The funny thing about that saying is that the hammer is actually one of the more versatile tools there is. A few things I've done or seen done with hammers: So don't knock the hammer. Indeed it doesn't have the complexity of a programming language, but the variety of ways it can be used, number of varients that can be chosen for different purposes, and beauty of a well-designed one makes it at least comprable to a hash table, regexp engine, or the like.

1 December 2007

Amaya Rodrigo: I want to have your child

I want to have your child

Joey Hess: lego nslu2 speaker

My speakers run Debian. And are made out of lego. Don't all point and say "geek!" at the same time, plz. Details

Joey Hess: my mpd setup

One of the hard things about getting started with mpd is that there seems to be little documentation about the details of how other people use it. Instead you're given a collection of great tools and an excellently designed system, and expected to build your own personal music playing setup out of them with little direction. So I thought I'd document mine. There are several computers around the house that run mpd. One in my office, one has speakers in the bedroom. My laptop, of course. And I put a nslu2 in the living room in a fun lego case that embeds the little computer into a remote controlled speaker (photos when I find a camera). All of these machines have their music libraries synchronised using unison. I use sonata as a graphical frontend and browser. I keep one instance of sonata running on my desktop in the office, so I can go there to change music if my laptop's not on. Also so guests can change the music. I like to listen to whole albums at a time, and sonata doesn't make this especially easy in its user interface. I eventually realised that the best way to do it, for me, was to create a separate playlist for each album. Sonata does make it really easy to click on a playlist and start playing it. I wrote mpgenplaylists to automatically generate those playlists for me. I wrote a set of commands that I can use to transfer state between my mpd daemons. The easiest to use and most useful of these is mpswap, which swaps the state of two daemons. Generally I only have one mpd playing at a time, and the others are paused, though it'll also swap the states of two running mpds. So if I run "mpswap dodo dragon", the music that had been playing in my bedroom starts coming out the speakers in the office. Same song, not a single missed note. That's pretty handy. Or I can run "mpswap dodo" to swap state with my laptop, and carry the music out of the house with me. (This would be more seamless if I carried some bluetooth wundergadget so my computers knew where I am, but I think I'll pass.) Another tool I wrote is mpstore, which dumps the mpd daemon state out to stdout, so it can be saved to a file and later loaded with mpload. I use this when I'm listening to audiobooks, to store my place. Another one is mpfade, that can wake me up by slowly fading in music. Or slowly fade out and stop. Writing these little hacks is addictive, but I won't bore you with the rest. On some of the servers I run mpd-dynamic, a daemon that watches the playlist and makes sure it always has 10 unplayed items in it, chosing new items at random. It also removes old played items from the playlist. This is nice if I want music going without the bother of picking what. I typically add some albums to the playlist, and then when they're done, it keeps playing random stuff until I manually add something else. I do want to find something that can more intelligently pick things to play. I tried lastfmpdqc, but didn't like its results. Switching to mpd has meant that the filenames of mp3s matter again, since mpd UIs expose the filenames (a pity). I used exfalso to clean up all my file names based on the music's tags. I also added ReplayGain information to all my music so mpd can use it to normalise volume. BTW, after all this, I'll probably still only listen to music for an average of 3 hours per week.
mpd-dynamic is in the Audio::MPD perl module. mpdswap, mpdstore, mpfade, mpgenplaylists, and more are in mpdtoys.

Joey Hess: lego vs programming

I spent about four hours this evening building something out of lego, something I'd not done seriously in a good many years. I was suprised how much it felt like starting writing a program from scratch, and how many parallels I kept finding between snapping the bricks together and writing code. Here are just a few of them.

26 November 2007

Joey Hess: thoughts on replacing autofoo

The idea of replacing the auto tools with GNU make code could be a good thing. I tend to just write simple Makefiles, and avoid using autofoo in new projects at all. That's not good for portability, but it's excellent for sanity. But, what caused the auto tools to become such a mess in the first place? Part of it was the design, which from 30,000 feet is to write a code generator for some not ideal, but lowest common denominator language, and ship a copy of the (generated) code with every project. The new design is to write an include file in some not ideal, but almost lowest common denominator language, and ship a copy of that with every project. This avoids many of the pitfalls in the original design, such as having to deal with, and avoid editing, thousands of lines of nasty generated code when a build fails. I'm afraid it doesn't avoid other pitfalls we've seen with the auto tools. One being that all these copies of code need to be kept up to date. Another being that the interfaces between such an include file and the Makefile that would use it tend to be very broad, and, if not very well defined, can make upgrading the include file break things. As happens when you try to use the wrong version of the auto tools on a project that was written for an earlier version. Maybe smarter people than I can get around these problems. And there's probably, sadly, truth to the idea that to get a system like this really widely adopted, it needs to distribute build code that uses only lowest common denominator tools. (I was going to talk about how I started off using a similar include file but redesigned and sidestepped these problems while still getting wide acceptance for a build tool in the Debian community, but I see I already blogged about that earlier, in debhelper autoconf grudge match.)

25 November 2007

Joey Hess: learning to like mpd

I've used the Quod Libet music player since 2005. Mostly happily, despite the occasional really weird bug. The core of Quod Libet for me, the thing that no other player has, is the album list, just a big list of all available albums, with cover icons, and an easy way to limit the display to ones matching a search term. (I'm not one of those people who does complex, detailed playlists; I tend to play one album at a time, in order.) Quod Libet has lots of other nice features, including a great metadata editor, but the album list is the only thing I use daily. I mostly run Quod Libet on relatively slow machines (with decent speakers), with the display fed to my laptop. Lately it's been feeling a bit slow to scroll around in the album list with hundreds of albums and album icons being displayed over the network and everything running on an old laptop, or an overloaded server. I've known about mpd for a long while, and it's clearly a better fit for how I use servers to play music, but I could never stand to use any of the clients for long. Today I hit the triple cocktail of evil bugs in Quod Libet described in bug #413284. This is a potential last straw type bug, that's been open since March, and which I'd read before and hoped I'd be lucky enough to escape. This motivated me to try the Sonata mpd client again. It has a very clean looking and generally good interface, though like all mpd clients, it annoys me by being based around a playlist, and not making it easy to just select an album from the library and immediately start playing it. But there's a trick that makes it usable for me. I added all my music to the "playlist" (using the mpd command line) and ignore the hard to use library. Since Sontata does have an excellent type-to-limit-display feature, I can just type the name of an artist, album, or track, press enter, and it jumps to it and starts playing.

20 November 2007

Daniel Burrows: cwidget gets a Web page

I spent some time last weekend putting together the infrastructure to generate a basic Web page for cwidget. The Web page is generated by Ikiwiki (thanks to the incomparable Joey Hess for a really nice piece of code there) and doubles as the cwidget documentation; it will be included in the next upload of libcwidget-doc. It can be found in the source tree under doc/ikiwiki.

It's currently a bit skeletal: in particular, it really needs some tutorial/HOWTO material for new users. But it at least has all the basic information that I personally expect from a project Web site.


I was playing with ikiwiki for a week or so prior to setting this Web site up, and the more I use it the more impressed I am. When I get my new Slicehost instance set up (probably next weekend), this blog will probably migrate to an ikiwiki installation over there. Being able to edit my posts offline (about half my hacking time is offline), being able to expose a change history for posts, and not having to maintain an installation of a monster PHP program (as the docs put it, if you don't run the CGI then ikiwiki has the security implications of cat(1)), are all absolutely killer features for me, and I look forward to expanding my use of this tool. Joey has struck gold yet again.

Mart&iacute;n Ferrari: The times they are a-changin'

I had lost interest in the DM thing. Since August, when I asked for advocacies, those were posted to the newmaint list, and then nothing happened. Also, since a few days ago my NM process is running again, and there was the questioning about people becoming DM when they're close to finishing NM. Today, Gunnar sent a mail encouraging people in the Perl group to become DM, and I answered with those arguments. To my surprise, Joey Hess contacted me to tell me that my application ahd slipped under the radar for being too early and that I could be added now to the keyring. So I gathered all the required data and sent a bug report. A couple of hours later this message surprised me to no end: I am already a Debian Maintainer!!111one!! I must say that I'm completely stunned, I'd have expected to wait a couple of weeks, or months... This feels so... un-debian! :) I very happy for two reasons: obviously because now I can upload my own packages, but also because maybe this can finally make a difference for Debian. Thanks to everybody who has helped this to happen, and hope that more good changes are on our way! Now, if you excuse me, I'll have a beer to celebrate. Tomorrow I will start pestering my sponsors for their last sponsored uploads :) Tags: Planet Debian, Planeta Debian, Planet Lugfi, Debian

17 November 2007

Joey Hess: the beautiful creations of Theo Jansen

This presentation makes me insanely happy. Artificial lifeforms designed by genetic algorithm, brought to beautiful walking life on the beach, with skeletons and legs made of plastic tubes, wind vanes, 2 liter bottles for storing energy, and simple hydralic brains and sense organs.

11 November 2007

Joey Hess: random tip: per-port naming for identical USB devices

This is another case of a udev rule that took over an hour to figure out, and now seems very clear and obvious. Which probably means it won't next time I need it. I have a bunch of USB to serial adapters, all using pl2303, all so cheap that there's no product ID or any way to tell them apart. This is cheaper than buying actual console server hardware nowadays. So how to know which ttyUSB* device is hooked up to what? The solution is to use the USB bus ID, which corresponds to the usb port the device is plugged into. My /etc/udev/rules.d/z25_persistent_usb_serial.rules:
SUBSYSTEMS=="usb", ID=="3-2", KERNEL=="ttyUSB*", NAME="ttyUSB_front_upper"
SUBSYSTEMS=="usb", ID=="2-2", KERNEL=="ttyUSB*", NAME="ttyUSB_front_lower"
The ID numbers can be found in dmesg.

7 November 2007

Joey Hess: gallery of images that make you unnecessarily clean your display

I don't think such a gallery exists, but it should. Here's a my first contribution, found in a website background. tileJournalBG.gif

Roland Mas: Planet scores

Top posters in a few Debian-related Planets:
$ planet-scores.sh 
Planet Debian-FR :
     19 Rapha l Hertzog
      4 Roland Mas
      3 Jean-Christophe Dubacq
      2 Gr gory Colpart
      2 Alexis Sukrieh
Sometimes I think this should be renamed Planet Buxy.
Planet Debian-FR (utilisateurs) :
     10 Julien Candelier
      8 Emilien Macchi
      4 Guilhem Bonnefille
      3 Shams Fantar
      1 Rapha l Hertzog
      1 Olivier Berger (perso)
      1 Jean-Christophe Dubacq
      1 Jean-Baptiste H tier (djib)
      1 Eric Veiras Galisson
Newly added contributors to that planet have all their recent articles aggregated, not only the ones they wrote since they were added.
Planet Debian :
     40 Christian Perrier
      2 Russell Coker
      2 Raphael Geissert
      1 Wouter Verhelst
      1 Steve Kemp
      1 Romain Francoise
      1 NOKUBI Takatsugu
      1 Michal  iha 
      1 John Goerzen
      1 Joey Schulze
      1 Gerfried Fuchs
      1 Fathi Boudra
      1 Enrico Zini
      1 Emanuele Rocca
      1 Dirk Eddelbuettel
      1 David Welton
      1 Christine Spang
      1 Antti-Juhani Kaijanaho
      1 Adam Rosi-Kessel
Planet "Christian loves rugby".
debian-community.org :
      4 Holger Levsen
      3 Andrew Donnellan
      2 Evgeni Golov
      1 Wolfgang Lonien
      1 Rapha l Hertzog
      1 Martin Albisetti
      1 Marcos Marado
      1 Jean-Christophe Dubacq
      1 Cord Beermann
      1 Benjamin A'Lee
      1 Andreas Putzo
$
I know I have an encoding problem on some planets, but that script is a very basic curl+shell+sed+grep+recode+sort+uniq pipeline, and I only use it for the amusement value. Maybe I'll recode it with a proper RSS parser some day if I feel utterly bored.

Next.

Previous.