Search Results: "Philipp Kern"

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.

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]

3 November 2005

Philipp Kern: Today we've got April Fool's Day, right?

IBM is now able to slow down light with “fairly standard materials”, and it’s only a question of time when photons replace electrons in computers. Thanks ZDNet for making me smile...

2 November 2005

Philipp Kern: Gobby 0.3.0

Now with more people blogging about Gobby I could talk a bit about the upcoming 0.3.0 release, which is perhaps sponsored by the Free Software Foundation. We hope to release a new revision as soon as possible and although you wouldn’t see much differences when looking at the running program compared to 0.2.0, many things have changed under the hood. It features a new proven merging algorithm called Jupiter, which replaces the home-made algorithm currently present in obby. This results in less history keeping and a more reliable application of changes. Sadly this still requires Gobby to be a client/server application and does not help it on a way to a peer-to-peer one. Next there are also some new useful features. “Find and replace” with text and regular expressions comes to mind. Yes, we have to reimplement all features of an editor because “gedit” just didn’t meet our expectations when we considered to extend it. Sessions could be serialised into files and restored when needed, while preserving all information like who wrote what. We are currently writing a script which visualises this information on a web page to provide a log of a meeting. Our Tracker lists some more features, although it’s not clear if all could enter this release because of the deadline set by the FSF. I registered all our projects at Launchpad to get them translated through Rosetta. It would be nice if some more could help in translating Gobby. Well to come to an end: Matt Enks informed me today, that the word “gobby” is a slang term for “fellatio” in Australian. It’s a pity, really. It just sounded funny to us, but I won’t talk about the history of the name now because it’s weird. Perhaps we should rename it to something sane at any time in the future. We’ll accept proposals on the Wiki.

Next.

Previous.