Search Results: "Joachim Breitner"

3 April 2008

Joachim Breitner: How to make contour lines circles?

Dear lazyweb, I have a question with regard to image manipulation. Given an rectangle image with a continous function on it (in my case, walking distance from a certain point), I can easily draw the contour lines of the function, i.e. for a given distance from the center mark all points that have this distance. This looks very similar to the contour lines of height map. I d like to morph this image now that all these contour lines are circles around the centers, but I don t have a good idea how to do that with a minimum amount of distorting. Any suggestions or pointers to algorithms are welcome.

16 March 2008

Joachim Breitner: The problem with turing complete editors

I was just editing a file with vim and was about to do the same few strokes repeatedly. I vaguely remembered something about recording macros, so I tried it: I pressed q-1 to start recording, did my steps (a yank, a movement, an insert, a paste, a movement), and finished the recording with q. Now I could repeat these steps with @-1.I then noticed that I forgot something at the end (moving the curser to the beginning of the line). I re-started recording (q-1), thought hey, maybe I can insert the old recording here and pressed @-1. Surprisingly, that worked. I added the missing movement and finshed the recording with q.When I then tried to recall these commands with @-1, the editor froze and I was wondering whether the network connection went down (I was working over SSH). But it wasn t, and it dawned me that vim did not insert my old commands when re-recording the macro, but just inserted the call to the macro itself. My text editor was caught in a infinite loop...Not too bad, I just killed vim, did not lose anything and everything was fine. But I think an editor, even vim, should somehow prevent such behaviour.

3 March 2008

Joachim Breitner: Creative Week of Snowboarding

I was snowboarding with some friends last week, and in the evenings I had a little rush of uncontrolled creativity: I wrote a new entry in my (German) tech parody news about guitar hero in music education and two new parody songs: Pain of Boarding instead of Sound of silence and a snowboard-variant of I will survive . I ve also hacked up my XML/XSLT/make-website-system to include the songs, so you can find all my songs there now as well.

11 February 2008

Joachim Breitner: How to fork privately

A few days ago, I asked how to fork a debian package privately. I got some repsonses by comments, e-Mail and other blog posts, and I want to summarize the tools that were suggested. I have not really tried them, just looked at the webpages, the documentation or the sourcecode. I m only including Debian-specific solutions, as using Gentoo might be nice, but is out of scope here :-)I also deleted half the text before saving it, and I hate rewriting stuff, so it might be a bit terse.debtooEddy Petri or tells me about his three year old project debtoo, which wants to bring a Gentoo-like experience to Debian. While it probably provides what I need, it feels too big in that it has a more general aim than what I m looking for. It is not in Debian and not actively developed in the last two years.srcinstEddy also tells me about srcinst, which is a small haskell program written by jgoerzen in 2005. This is more a proof-of-concept that builds a package and all necessariy build-dependencies without using a binary package, but does not allow for patches to be applied. It is in Debian, actively maintained, but not developed, and barely documented (just an IRC log).apt-buildA similar tool and also in Debian is apt-build. This package is created to compile packages for optimization (as it asks half a dozend compiler-flag-questions with DebConf during the installation). It allows the user to apply a patch to the source, but it has to be passed as a command line option, and patches seem not to be tracked. Not much development in the last year, and not much documentation.debpatchNot to be confused with the program in the debdelta package is the debpatch tool by Victor Hsieh which Carsten Hey told me about. Also written in 2005, this comes closest to what I want. For every package you want to modify, you can configure it to apply patches to the source, to add patches to the debian/patches directory or to statically replace files in the generated binary and puts it in a local apt repository. No code yet to track new versions of the packages and no support for pbuilder though. This perl script is not yet in Debian, but is available as a Debian package and seems to have seen some development in the last years. Quick Googleing does not return any user reports; has any already tried this?customdebSomewhat in this direction goes the script that I wrote two weeks ago for a totally different project, customdeb, but it is aimed at binary debian files exclusively, and debpatch already supports replacing files in the binary package.Summary I found a few projects that go in a similar direction, and one that seems to fit my needs quite well. All of them are not widely used and in a very early state of development. I m actually surprised that this is not a itch more people had to scratch! I will have a closer look at debpatch when I find the time and maybe, if found useful, see if it can be included in Debian probably after a name change, since we already have a debpatch binary.

Joachim Breitner: Ways to fork privately

A few days ago, I asked how to fork a debian package privately. I got some repsonses by comments, e-Mail and other blog posts, and I want to summarize the tools that were suggested. I have not really tried them, just looked at the webpages, the documentation or the sourcecode. I m only including Debian-specific solutions, as using Gentoo might be nice, but is out of scope here :-)I also deleted half the text before saving it, and I hate rewriting stuff, so it might be a bit terse.debtooEddy Petri or tells me about his three year old project debtoo, which wants to bring a Gentoo-like experience to Debian. While it probably provides what I need, it feels too big in that it has a more general aim than what I m looking for. It is not in Debian and not actively developed in the last two years.srcinstEddy also tells me about srcinst, which is a small haskell program written by jgoerzen in 2005. This is more a proof-of-concept that builds a package and all necessariy build-dependencies without using a binary package, but does not allow for patches to be applied. It is in Debian, actively maintained, but not developed, and barely documented (just an IRC log).apt-buildA similar tool and also in Debian is apt-build. This package is created to compile packages for optimization (as it asks half a dozend compiler-flag-questions with DebConf during the installation). It allows the user to apply a patch to the source, but it has to be passed as a command line option, and patches seem not to be tracked. Not much development in the last year, and not much documentation.debpatchNot to be confused with the program in the debdelta package is the debpatch tool by Victor Hsieh which Carsten Hey told me about. Also written in 2005, this comes closest to what I want. For every package you want to modify, you can configure it to apply patches to the source, to add patches to the debian/patches directory or to statically replace files in the generated binary and puts it in a local apt repository. No code yet to track new versions of the packages and no support for pbuilder though. This perl script is not yet in Debian, but is available as a Debian package and seems to have seen some development in the last years. Quick Googleing does not return any user reports; has any already tried this?customdebSomewhat in this direction goes the script that I wrote two weeks ago for a totally different project, customdeb, but it is aimed at binary debian files exclusively, and debpatch already supports replacing files in the binary package.apt-srcAlso a related tool Carsten Hey told me about is apt-src. This tool wants to provide apt-like features for source packages. It allows you to install sources somewhere, upgrade the source and build binary packages from them. It does not really hide the sources from the user and seems to be created for people who want to work with the source somehow. If you have local changes to the sources, it can try to merge them with the new version, but these changes are not kept as a separate patch but only as implicit changes. If that were different, it would seem be a very nice tool. It s written by Joey Hess he abondonned it in 2004. Since then, not much development has happened.debnestYet another approach is taken by debnest, which Peter Makholm took over. Here, you create a full debian source package with a debian/ directory containing a control and rule file etc., but besides the debian/ directory, it contains just the packed sources (.dsc et al) from another package. In your debian/rules, you can specify your changes. I can see no support for tracking new versions of the inner package, but at least this project is maintained and in Debian.Summary I found a few projects that go in a similar direction, and one that seems to fit my needs quite well. All of them are not widely used and in a very early state of development, and it seems to be something people start to work on and quickly lose interest. I m actually surprised that this is not a itch more people had to scratch! I will have a closer look at debpatch when I find the time and maybe, if found useful, see if it can be included in Debian probably after a name change, since we already have a debpatch binary. Or maybe I should try to add support for what I need to apt-src, which seems to be the most advanced of all these programs, although it s unmaintained longer than the others exist.Update: Added apt-src.Update 2: Added debnest;

8 February 2008

Joachim Breitner: How to fork privately?

I am very fond of Jean-Yves Lefort s link-monitor-applet, which puts little bars in my panel that display the ping time to certain hosts. Very useful, especially since I m often using a shaky wireless connection.With the latest release, though, the author added an icon next to these bars. He argued that the small bars, if there are only few of them, are hard to hit with the mouse, and therefore added this icon as a usability improvement for less advanced users.But for me, this makes the applet almost unusable, as I just don t have the space left for a useless icon. Things are here proably worse because the icon is higher than wide, scales to the maximum size that fits the panel and my panel is vertical and slightly wider than the normal horizontal panel is wide.I asked the author to make this behaviour configurable or to hide the icon when there are more than three hosts to display (with patch included), but he wanted to stick to the icon. So what are my options? I could manually download and extract the source, apply the patch and build the package every time a new version is uploaded to Debian but shouldn t this be easier?If Debian were not 20 but 2 years old I assume that all sources would be in one big git/darcs/hg/whatever repository, with something like the SuSE build service, which would automatically build the packages, and I could make my system automatically track a branch of the real Debian with my patches added. But at the moment, this would be utopical.I could imagine creating something smilar that would track the uploads to debian and, if link-monior-applet is uploaded, tries to automatically build a package with my modification, providing this in an apt repository that has a high apt priority for me. Has anyone done that already, or tried it, or thought about that?

27 January 2008

Joachim Breitner: customdeb easy modifications to binary Debian packages

I m currently working at the Linux migration of the city of B blingen which is currently pushed forward by Itomig. For our modifications to the client there I thought it would be nice to distribute them as easily as the regular Debian packages. We did not want to write a bunch of scripts that modify the files after installation, or try to create packages that modify other packages file.So I wrote customdeb, which currently allows you to change the contents and permissions of files inside a debian package, generating a new package (with a local version number) that you can easily distribute to your clients. The changes are specified in a simple, debian/control-like file, which therefore also serve as a documentation of your changes. It either modifies a package that you pass it on the command line or tries to fetch it with dget. More ways to change a package (e.g. adjust dependencies) will be added as soon as I need them (or someone else needs them and sends me a patch).I think this might be useful for others as well, so I am packaging it for Debian. If you want to try it before it went through the NEW queue, you can find the packages here. Contributions are welcome, but be aware that the perl code is currently written in a not very modular, quick-to-work style. I plan to change that if there is more interest in the program. I have the code in a darcs repository (browse it).

26 November 2007

Joachim Breitner: Children on sale

Another BBlooper found by me was featured on BBspot. Why BBspot is great? See my last post about it.

23 November 2007

Joachim Breitner: Descendant tree drawing problem

For a geneaology project of my familiy, I generated this fairly straight forward drawing of my Grand-Grand-Grand-Grandfather s descendants (click for full image): Unfortunately, this representation does not give any information about when someone lived, or how long. I tried to add this information to the graph, and I coudn t think of anything better than drawing each person as a rectangle whose upper edge lies above the parent s rectangle, and whose height and vertical possition represent the life span. This is the result (here you really have to click for a full view): This is obviouly not very helpful. Does anyone have a better idea how to draw this?By the way, these graphs are generated using haskell and the cairo bindings provided by gtk2hs very handy, as I also get svg output and pdf output for free.

7 October 2007

Joachim Breitner: Haskell Hackathon almost over

The Haskell Hackathon in Freiburg is nearly over now. For me, it turned out to be a xmonad hackathon, as of a few days ago, xmonad is able to handle dock applications such as the gnome-panel properly (that has prevented me from looking at xmonad before).Now that the panel worked, I also wanted it s window list and workspace switcher to at least show me the state of my workspaces. This resulted in the EwmhDesktops extension. I also noted that the dock handling provided in the default Config.hs was not sufficient, as it would even treat dialogs from gnome-panel as a dock. This is fixed with the extension ManageDocks, which later got additional support to increase xmonad s border gap if an window (such as gnome-panel) has the STRUT attribute set. To closer match my old metacity keys I added support to CycleWS for going to the next/previous workspace and for moving the current window there.I had some ideas how to make the hook interface for xmonad nice, and now started to work on debian packges for xmonad: You can get and test prelimary ones.

5 October 2007

Joachim Breitner: Haskell Hackathon: Hackage vs. Debian

This weekend, I m attending the Haskell Hackathon in Freiburg. Regular readers of my blog will have noticed an increasing interest in Haskell, so having this event so close was a nice chance to get more involved in the Haskell community. My blog also got added to Planet Haskell now.So far, I have hacked up a simple haskell program called Haskell Package Version Tracker . It takes the 00-index.tar.gz file of hackage (which is for Haskell what CPAN is for Perl) and a Debian Source file (which is the list of available packages in Debian) and outputs a comparision in the spirit of the Debian Perl Group s or utnubu s version comparison pages. You can see the last output, but I do not yet update that page regulary. The code is available in a Darcs repository. It uses the Index.hs-File from hackports thaks for that.

11 September 2007

Joachim Breitner: Cron s syslog messages

On a modern debian system (and other linuxes as well), the cron daemon is PAM-enabled, which is probably a good thing. One downside is that you get your /var/log/auth.log full of messages like:
Sep 11 11:15:01 otto CRON[8755]: pam_unix(cron:session): session opened for user jojo by (uid=0)
Sep 11 11:15:01 otto CRON[8755]: pam_unix(cron:session): session closed for user jojo
I think these are pretty useless and make it harder to find real authentication related entries in auth.log, especially if you get them every five minutes. Luckily, the fix is pretty simple: Just edit /etc/pam.d/cron and comment out the line @include common-session, as that only calls pam_unix.so which in turn, for session management, does nothing but logging anyways.To further separate the cron logs, you can remove these entries to syslog:
Sep 11 07:17:01 quimby /USR/SBIN/CRON[7949]: (root) CMD (   run-parts --report /etc/cron.hourly)
by configuring /etc/syslog.conf to move them to a logfile on its own:
*.*;auth,authpriv,cron.none     -/var/log/syslog
cron.*                          -/var/log/cron.log

6 September 2007

Joachim Breitner: Xen-Server-Sharing: The Setup

As previously mentioned, we are setting up a shared Xen hosting, and I promised to publish detailed setup steps. So here I will, but I warn you: I ll just note down what I m doing, and it might be confusing...
"Xen-Server-Sharing: The Setup" vollst ndig lesen

4 September 2007

Joachim Breitner: Xen Server sharing started

Today, I ordered a dedicated server for some friends of mine and me. We will split it up into 5 Xen instance, quite similar to Steve s xen-hosting. Thanks for the idea! Our project is name serverama, since our hosts will be named after Futurama characters.I might blog about the setup here, if I think it s interesting for the general public. I can t wait to get my hands wet in a chaos of RAID, LVM, Xen and virtual network bridges...

30 August 2007

Joachim Breitner: Haskell Syntax Gem

Often when creating text from a program, you encounter this situation: You have a value, e.g. first_name, that might be empty (depending on your programming language, this means undefined, NILL, None, nil or Nothing) or contain a string. In the latter case, you want to surround it by some markup, in the former you want to do nothing. Here is how I d code that in Template::Toolkit:
<table>
[% IF second_name %] <tr><th>Second name</th><td><b>[% second_name %] </b></td></tr> [% END %]
[% IF first_name %] <tr><th>First name</th><td>[% first_name %]</td></tr> [% END %]
</table>
And here in python:
output = "<table>"
if second_name:
output += "<tr><th>Second name</th><td><b>%s</b></td></tr>" % second_name
if first_name:
output += "<tr><th>First name</th><td>%s</td></tr>" % first_name
output += "</table>"
I really don t like entering each variable name twice, when I basically want to do one thing with it.Here is how you can use Haskell s flexible syntax to help you out. First we define a unconditional insert here operator ++!++ and then a conditional one, named ++?++:
(++!++) :: String -> String -> String -> String
pre ++!++ post = \ins -> pre ++ ins ++ post
-- Or more haskell-style:
-- pre ++!++ post = (pre ++).(++ post)

(++?++) :: String -> String -> Maybe String -> String
pre ++?++ post = \ins -> maybe "" (pre ++!++ post) ins
-- Or more haskell-style:
-- pre ++?++ post = maybe "" (pre ++!++ post)
Note that the first line of each function, the type declaration, could be left out as Haskell can figure it out by itself. Also note that these function are not restricted to strings (as lists of characters), but can be used for any kind of list.Now I can write the code up there as:
output = "<table>" ++
         ("<tr><th>Second name</th><td><b>" ++?++ "</b></td></tr>")  second_name ++
         ("<tr><th>First name</th><td>" ++?++ "</td></tr>") first_name ++
         "</table>"
I think that s a nice display of the flexibility of Haskell s syntax, in this case, using symbols for function names and infix application.

29 August 2007

Joachim Breitner: Internet Trading Game Idea

Reviving parts of my old MuMer idea, I thought of this trading game yesterday. Before I start hacking: What do you think? Who would want to be beta-tester? Any other things to consider?The idea is to freely trade goods (think wood, stone, gold as currency etc.) online, on your trading partners website. The whole point will be that you will more or less stumble across other people to trade, e.g. on their blog, on some wiki page or their myspace or StudiVZ page. There you will see that he wants to trade MuMer goods, maybe with a list of things he d sell and buy, and for what price. From there (and only from there) it is only one click to the MuMer page where you can actually trade, maybe leaving a message as well.On the MuMer page itself, there would be no list of users or so. To find someone to trade you ll actually have to look somewhere else and trade again you have to go to the other persons blog again. (I imagine this can be reasonable enforced by checking the referrer.) So taking part in the game, you also draw some people to your web site.For the reward I could imaging that once you have a certain amount of specific resources, you can buy special items or even buy the skill to manufacture more special and hopefully attractive items.This is the rough sketch. What do you think?

25 August 2007

Joachim Breitner: TTF-Glyph in pdflatex output

For a project of mine, I had the dire need of getting the Unicode character (U+26B0 COFFIN) in a PDF file created with pdflatex. I could find no latex package that provides this or a similar character, so I had to do it myself.There are some HOWTOs on how to use a TrueType font in pdflatex, but all of them thought that you are trying to use the font for your regular text, not just for the one strange glyph. So based on these, here is what I did:All in all you need to keep the files burial.enc, burial.sty, burial.tfm and t1burial.fd in the directory of your TeX file. I did not check how to install the files globally.If you think this is done horribly wrong, please feel free to tell me how it should be done instead.

23 August 2007

Joachim Breitner: The trustworthy stranger

Some friends and I are considering to set up something similar to Steve s xen-hosting.org. One issue that came up was: Who get s to be the main admin and how can we trust him? At first I found this an odd issue I ve never heard anyone considering this when using one of those anonymous virtual server hosting offers.After all, when you have something valuable to store somewhere, e.g. your family store of gold coins, you d rather ask your good friends instead of some random stranger. But it seems to be different for information: Imagine you have some valuable piece of information (e.g. your dirty secret from ten years ago) and you had to share it with someone suddenly the completely anonymous stranger seems to be a better choice than the persons that know you...I think this effect is also the reason why people are so little troubled by known and unknown facts such asThis is just a small part of the list of situations where people give information to some unknown stranger that they would probably not give their friends.Is this way of thought valid? If not, what are good arguments to convince people to be more careful? And under what circumstances would you trust your friend to manage the host machine for your Xen server instance?

23 July 2007

Joachim Breitner: Made it on bbspot

I very much like the satire news site bbspot.com. Besides some very good original stuff (news such as Number of Linux Distributions Surpasses Number of Users and top-11-lists such as Signs You Need to Clean Your Keyboard ), Brian Briggs regulary features so called bbloopers, funny typos and content-advertisement combinations from across the web. Although I d prefer he woudn t clutter his page with these (and those imported comics), or at least provide a feed without them, I submitted one I recently stumbled upon: The secret of Black Soap.

18 July 2007

Joachim Breitner: sm same fate as LaTeX?

Today I found an e-mail with the subject re new sm thing in my inbox. I almost deleted it, as I thought it to be spam with explicit content of some kind. On second thought, I did write a program called sm recently, so I read the message and indeed, no spam, just comments to the program. A bit like LaTeX where, when you google for it (especially on google images), you do not get results related to the excellent type setting program...In other news, screen-message has been featured on debaday today. I also got a bunch of nice feature ideas, but I m reluctant to implement them: I want sm to be a very simple tool, with no thinking or docs reading needed. I m afraid that if I implement all the nice ideas that others and I have, sm would become a big, complicated beast but I m keen to hear your opinions on that.

Next.

Previous.