Search Results: "philipp"

2 January 2006

Philipp Kern: Coding with Ruby and xmpp4r

Hm Andres, funnily enough I was currently coding a new Jabber bot for my personal use when you came up with your Dapper post on the Planet With xmpp4r and Ruby of course. What features does xmpp4r lack? Couldn’t you implement them? ;-) After a bit of crawling in xmpp4r’s documentation I still think that it’s quite useable for Jabber tasks. I just think that its developer should file the ITP for it and upload a package of it to Debian. Although they seem a bit messy, he already started such an effort and I would be happy to sponsor him. It really seems that Christmas time is also a time for diamonds. :-P

31 December 2005

Zak B. Elep: Ubuntu-PH Christmas EB at El Pueblo

I’m at Ayala Center in Makati, enjoying the Sunday life amidst the buzz of the mallrats. I’m also enjoying the free internet provided by Globeline’s kiosk here, as well as access to a (locked-in) HP laptop with wired LAN. Anyhow, I’m not too comfy here, blogging without a chair to sit on, and dragging a backpack too, so let me do this quick. Yesterday I met up with the Ubuntu-PH people (namely, Jerome. Clair, Donnie, and Ealden) for our Christmas EB at Congo Grill in El Pueblo, Ortigas. I almost got lost trying to find the location, which I knew was somewhere near SM Megamall, and since I was coming all the way from UP Diliman via the MRT. Nevertheless, after some asking-around, I finally got to where I was supposed to be, and ate a hearty meal with chicken and garlic rice while listening to the channel, er este, people chatter (amidst the roaring Christmas party another gang was making.) After the meal, we then moved to The Podium nearby and sipped some coffee at Starbucks, then talked some more about Ubuntu, Gnome and KDE (especially the recent and quite controversial thread on desktops,) and some other stuff mentioned in Donnie’s post. There was also some stuff to be brought up at the next team meeting (see TeamMeetingAgenda) that we touched on, in particular that bit about membership to Ubuntu-PH. Well, it took us almost a midnight to wrap up; even then, along the road towards EDSA we were still talking about Ubuntu-PH, PLUG, and the AsiaBusinessTour, before we all finally parted ways. Indeed, EBs like these rock, especially when we’re all doing something great together as a team. Indeed, the next year seems to hold great promise for Ubuntu, Linux, and FOSS for the Philippines—and we’re at the forefront of it. Now, I need to go, and eat some Whoppers…

26 December 2005

Tollef Fog Heen: Mail based tracking systems: RT

Philipp Kern asks about mail-based tracking systems. Even though he specifically says "no" to RT, I would recommend it. The source is very hackable and making up commands for changing ticket properties is easy.

25 December 2005

Philipp Kern: Mail-based tracking system

Does anybody know a mail-based tracking system which allows one to manipulate all item properties by mail? Web interface and installation ease would be nice, too. It should also contain a reminder function for email or other notifies as I tend to delay issues. But it would not be too hard to code that in if the data is easily accessable through a database. Something like Debbugs would fit my needs, but is a mess to set up properly and the data is not easy accessable as far as I remember. And it really serves another purpose And no: RT is not an option, not being modifiable by mail.

24 December 2005

Philipp Kern: Source-only uploads to Debian

I did some investigation (which was very little, dak’s source is very helpful) upon the possibility to do source-only uploads to Debian’s ftp-master. In short: It’s not possible. Jennifer rejects uploads which do not contain a single binary Debian package:
if not has_binaries and Cnf.FindB(“Dinstall::Reject::NoSourceOnly”):
    reject(“source only uploads are not supported.”);
But well, there’s a way to trick it: If the package contains an arch:all binary independent package and if you upload it together with the source (the binary-indep target of debian/rules will help), Jennifer thinks that the upload contains indeed a binary package and ignores the fact that there are no real architecture dependent binary packages. The autobuilders will do the work for you.

Philipp Kern: Meme: Who needs what?

This meme is really silly, but ya know, I can’t resist... When looking for “Philipp needs”:
Obviously from an other incarnation of this meme:
Last but not least something which stuns me (softly edited):

Philipp Kern: Apple Laptops

I get tired of this laptop on my desk called iBook G4. It’s now the second time I receive “I/O error(s)” from the harddisk drive. So I’ll have to call up Apple just again and beg for a send-in to fix it. This will take several hours on the phone because the support guy can’t decide that on his own. How nice and time consuming level based services are. But could somebody please tell me why I needed a replacement after seven months of use, when the errors were just weird and only Linux refused to do something with the harddisk, and now again after three months when OS X can’t even repair its own filesystem because of bad blocks. The last time I sent it in I even had to go to the nearest Apple Support Provider to get my Airport card replaced because it broke. The whole repair at Apple took three days, the WiFi repair three weeks. And yes it’s true what you could probably read between the lines... My knowledge of English is vanishing... *cough*

15 December 2005

Philipp Kern: Tailor

Hey Wouter, did you already hear of Tailor, a script which syncs various repositories of various SCM?

11 December 2005

Philipp Kern: Another NM lost

I seriously tried to persuade Thomas Hood to revoke his withdrawal from NM, but he made it official now. According to him, both his current (formorer aka Alexander Wirt) and his former AM seem to have lost the AM correspondence with him. So we just lost another NM due to Debian’s bureaucracy. Normally he should have contacted the Front Desk to just get a new AM, but this already was his second.

Christian Perrier: Baz/tla/bzr suck

This is the new hype of last years. No development can take place with these so cool tools. Crap, I just maintain the bloody localization for apt and dpkg and, as the developers of these packages use distributed revision control systems, I'm forced to use them as well. I have never lost so much time in fixing broken stuff in my archives. OK, I'm a moron certainly but I use RCS things for several years right now (the old CVS/SVN and the like with a centralized repository) and I HAVE NEVER LOST SO MUCH TIME since I use tla, than bazaar. More fun: it seems that baz is getting obsoleted by bzr right now as obviously geeks cannot live more than one year with the same tool. So I will have to convert my archives if I want to continue helping in apt/dpkg localization. Of course, I know that people will help morons like me to do it, but, hey, this will AGAIN be lost time. Thanksfully, the D-I developers are wise people and we don't use distributed RCS but a good old solid SVN for 3 years now. Frans, Joey, don't ever think about changing this, please.... So now, I'm left with a change that I can't commit in my local archive for a French man page of dpkg, as suddenly for no reason, the bloody baz complains:
A/  arch /dpkg/dpkg--devel/dpkg--devel--1.13/philippe.batailler@free.fr--2005
A/
 arch /dpkg/dpkg--devel/dpkg--devel--1.13/philippe.batailler@free.fr--2005/patch-log
A
 arch /dpkg/dpkg--devel/dpkg--devel--1.13/philippe.batailler@free.fr--2005/patch-log/patch-1
M  man/fr/dpkg.1
M  debian/changelog
M  ChangeLog
arch_commit: unable to acquire revision lock (could not rename file.)
tree: /home/bubulle/src/debian/dpkg/dpkg-1.13
revision: bubulle@debian.org--2005/dpkg--devel--1.13--patch-88
url: /home/bubulle/arch/bubulle@debian.org--2005
So nice: I'll again waste precious time asking on IRC for help and hearing people telling me to switch to <insert your favorite RCS system here>. This will be a so wonderful Sunday....

6 December 2005

Philipp Kern: There is no Cabal!

Joey wrote in his blog entry about the tyranny of unix permissions:
(If I ever ran for Debian Project Leader (which I won’t), this would be one of the areas that I would be sure to investigate basing my platform on. Speaking of which, it’s nearly election season again, isn’t it?)
Which leads me to the next question Isn’t the next Debian Project Leader report already due? Oh, I better get back into my hole again and let the Cabal do their work. Disclaimer: All views expressed in here are not mine, but those of my tamagotchi.

2 December 2005

Philipp Kern: Planet incompatibility

So without touching my blog at all I come over this bug by myself. The Serendipity developers say that it’s something wrong in Planet Planet but I wasn’t able to track it down. I just don’t know why it eats my old entries just again and presents them as new. The publication date is as pubDate in the RSS, so it really shouldn’t think that they are new.

26 November 2005

Philipp Kern: C++ ABI transitions

This vast amount of C++ ABI transitions is so bloody annoying. It makes developers maintaining C++ packages so unproductive as they are blocked for weeks waiting to upload new versions of their package.
Why isn’t the package updated in Debian yet?
Well, we have just another C++ ABI transition, this means the libsigc++ is incompatible to the version before and all packages have to be recompiled.
Debian is just too slow, even Ubuntu and Gentoo are faster...
Gentoo is source-based and I had, back when I used it, the impressions that some developers do not really try to compile it before they commit the new version, but I think this has changed now. Ubuntu, well yeah, even they are much quicker in transitions, out of various reasons I’m too tired to rehash here. Not only am I blocked by libsigc++-2.0 which I theoretically could NMU away, but by the whole bunch of gtkmm stuff which also needs to be recompiled with all of its dependencies. It will take weeks until the new revision of Gobby could enter at least Debian unstable. I bet that Ubuntu MOTU will update my package by their own before I am able to upload a new one to Debian to get it synced from there.

20 November 2005

Matthew Palmer: The Fun Never Stops With Ruby

Well, there's nothing like posting a really rubbish program to your blog to find out the right way to do it. Firstly, Philipp Kern has come up with another, even shorter version than his version I posted in the update to my original Ruby post, this time blowing me away with the strangeness of explicit casts in Ruby. Apparently, casting an input stream to an array produces an array with one-line-per-element, as in this example:
 STDIN.to_a.sort_by rand .each l puts l 
As Philipp warns, however: "Ruby is full of fun and power; one must watch out that the scripts remain readable". For a fairly toy example, this solution is still fairly readable, however I can see hair growing on this thing if your program grows large. Next, Pierre-Charles David showed his qualifications for becoming a co-author of the next edition of the Pickaxe (AKA "Programming Ruby: The Pragmatic Programmers' Guide"), with his example and explanation. He's kindly given permission for me to reproduce his e-mail in it's entireity, since it's too good to chop up:
Here is the shortest and most readable version of your "randomize stdin" script I can think of:
  #!/usr/bin/env ruby
  print ARGF.readlines.sort_by   rand  
 
ARGF is a special variable representing either stdin or, in the case where file names are passed on the command line, the content of these files (think of Perl's <>). ARGF behaves like an IO object (although I think it is not one). In particular, it responds to the #readlines method which splits the receiver's content into lines and returns an array. In other words,
  lines = ARGF.readlines
 
is the idiomatic way of doing
  lines = []
  while line = gets() do
    lines << line
  end
 
in your example. The next part (sort_by) uses a new form of the sort method, which I think is not documented in the Pickaxe. It implements the Schwartzian transform technique. In essence, a random number is associated to each element of the array, which are then sorted based on this index. As a general style remark, note that although Ruby supports "while" and "for x in y" loops, they are rarely used, in favor of iterators and/or higher order methods. For example, to gather all the input lines in an array without using readlines, one might write
  lines = Array.new
  ARGF.each_line    l  lines << l  
 
or
  lines = ARGF.inject([])    lines, l  lines << l  
 
Hope it helps, and welcome to Ruby!
Pierre, your explanation definitely helped, and I hope it helps others too. The third person to help me out is Decklin Foster, through a post in his blog. What particularly caught me about his solution was the neat demonstration of another feature of Ruby which I think I will really learn to love: the ability to dynamically add methods to an existing class. "Aiee!" I hear all the purists scream -- and I can see the potential for severe misuse, too. But, since every good idea seems to get deeply perverted, we may as well have some real useful features to pervert while we're at it. Decklin has the clever idea of adding methods to the Array class that shuffle the elements of the array in a random fashion. His code is beautiful in it's simplicity:
 class Array
    def swap!(a, b)
        self[a], self[b] = self[b], self[a]
        self
    end
    def shuffle!
        each_index do  i 
            j = i + rand(length - i)
            swap!(i, j)
        end
        self
    end
 end
He then goes on to rewrite my bumbling example in probably the most comprehensible manner I've yet seen:
 STDIN.readlines.shuffle!.each    line  puts line  
Decklin writes, "Now that is cool.". I couldn't have put it better myself. My thanks to Philipp, Pierre-Charles, and Decklin, for helping me along the Ruby path. So, two new Ruby Rules for me to live by: Hmm, is it possible that Ruby is nothing more than Functional Programming by Stealth? Aiee!

Philipp Kern: Lua Hype

Why is there such a hype around the Lua programming language when there are languages much more powerful around? It it small and beautiful? What makes it superior over something like Ruby? Comments would be much appreciated!

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!

14 November 2005

Philipp Kern: Input methods

Could anybody tell me how I could get the following behaviour under X11: I want to use an American English keyboard layout because it is more convenient to code. But sometimes, usually in chats, I need my native language characters which are umlauts (latin letters with diaeresis). How could I set up a deadkey combination as a prefix to get those letters? On OS X I could accomplish this by pressing Alt-U (which shows up the two upper dots) and then the desired letter. Something similar would be nice for use under Linux. Could I get such a behaviour just by hacking the keymap or do I need any input engines?

13 November 2005

Philipp Kern: Let the iBook get some sleep

Junichi, your iBook G4 might suspend fine, but is the USB stack fully functional afterwards? And could you plug in a device, suspend, resume and continue to use it just fine? I had some problems on mine with suspend, it did not detect a single device I plugged in after the sleep. It seems fixed with a more current kernel, though. But my zd1211 driver still needs to get unloaded before it sleeps, otherwise the iBook will panic after resume.

10 November 2005

Philipp Kern: Serendipity and Planet Planet incompatibility

Could someone please fix the incompatibility between Serendipity and Planet Planet? Nico and I haven’t found the cause of the problem yet but old posts of other developers keep reappearing. I don’t know why it doesn’t happen with my own instance of this weblog system, but I saw it in relation with quite some sites now.

6 November 2005

Philipp Kern: Happy Meal Ethernet

Probably it’s very old, but hey I had a good laugh...
Actually, it is a Sun engineer joke. The 10 Mbps predecessor was a chip called the “Big MAC Ethernet” in this case, it was a mere pun, since MAC stands for Media Access Control, i.e. the Ethernet data-link layer. When they designed the 10/100 Mbps chip later on, they decided to turn the pun into a full-out joke, and they called it the “Happy Meal Ethernet.”
528 static void happy_meal_tcvr_write(struct happy_meal *hp,
529                                   void __iomem *tregs, int reg,
530                                   unsigned short value)
531  
532         int tries = TCVR_WRITE_TRIES;
533         
534         ASD((“happy_meal_tcvr_write: reg=0x%02x value=%04x\n”, reg, value));
535 
536         /* Welcome to Sun Microsystems, can I take your order please? */
537         if (!(hp->happy_flags & HFLAG_FENABLE))  
538                 happy_meal_bb_write(hp, tregs, reg, value);
539                 return;
540          
541 
542         /* Would you like fries with that? */
543         hme_write32(hp, tregs + TCVR_FRAME,
544                     (FRAME_WRITE   (hp->paddr << 23)  
545                      ((reg & 0xff) << 18)   (value & 0xffff)));
546         while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries)
547                 udelay(20);
548 
549         /* Anything else? */
550         if (!tries)
551                 printk(KERN_ERR “happy meal: Aieee, transceiver MIF write bolixed\n”);
552 
553         /* Fifty-two cents is your change, have a nice day. */
554  
[Taken from drivers/net/sunhme.c in linux-2.6]

Next.

Previous.