Search Results: "duck"

24 March 2008

Stefano Zacchiroli: perl invariant sigils

New invariant sigils in Perl 6 Wouter, apparently most people found Perl's changing sigils (that's the name of Perl's paraphernalia: $, %, @) annoying. That's the reason why they are becoming invariant with Perl 6. Actually I assume that's the reason; I haven't read the corresponding RFC, partly because it is usually impossible to find the one you are looking for ... BTW, I recommend to all people interested in Perl to have a look at Patrick Michaud's slides on Perl 6: I quite enjoyed his talk at FOSDEM, way better than Larry Wall's talks I've attended in the past (this time at least I went back home with some actual content, instead of only LOLing for the talk duration).

23 March 2008

Wouter Verhelst: Perl

Martin blogs about how the Camel book mentions the fact that scalars, arrays, and hashes have completely separate namespaces, as if this is a problem. Well, I disagree. As with anything in Perl: yes, obviously it's possible to confuse yourself with this feature, and yes, obviously it's true that if you do this, you will get to keep both pieces of your program. So don't do that then. However, when used properly, I find that it actually helps me improve readability of my programs. Let's say we have a subroutine which returns a reference to a filehandle to a bunch of data in a format that we know how to parse. We don't know what the filehandle points to (and we don't care, either), but we do know what the data is. So we store the filehandle in some scalar, and then proceed to parse the data into a hash. Now we could use variable names such as $fh and %hash, but I'll hope that everyone agrees with me that this is very bad practice. So, instead, we should name the variables after what they contain. Say our data file contains books:
$books = get_books_fh();
while(<$books>)  
	(... parse $author out of $_ ...)
	push @ $books $author , $_;
 
The filehandle to which $books is a reference, points to some useful data; and the %books hash table contains the exact same data, only structured in a different, more useful way. So why give them a different name? They're the same thing, call them the same way. Personally, I find this makes a whole lot of sense. And you can do the same thing with arrays vs hashes, or scalars vs arrays. Of course you can also write code that uses $somevar and @somevar, with no semantic connection between the two. That is stupid, so don't do it. The fact that you can do stupid things with Perl, however, should not mean the language sucks. You see, other than some other programming language I could think about, Perl does not assume its users are stupid, or inexperienced, or dummies, or whatever. Yes, that does mean that new users will get confused; but it also allows experienced users to Get Stuff Done in a proper way. And, well, I'm sure you can do stupid things with python, too.

22 March 2008

Martin F. Krafft: Perl does not get confused! A feature!

I am implementing the last bits and pieces I need for ikiwiki to replace rest2web on all sites I maintain. In doing so, I need to touch Perl. I probably ran into enough crap today for a very long rant, but instead I ll limit myself to a quote from the Perl book (3rd. ed., p. 52):
Note that we can use the same name for $days, @days, and %days without Perl getting confused.
I question any language whose interpreter s capability to deal with ambiguity without confusion is worth mentioning. NP: The Flower Kings: The Sum of no Evil

19 March 2008

Stefano Zacchiroli: git-buildpackage from debian-only to debian+upstream

Moving a git layout from debian-only to debian+upstream ... and live happily with git-buildpackage Let's say you have a git repository you have used thus far to maintain only the Debian part of some package (i.e. no upstream sources on sight). OK, you're right, that would be quite an uncommon scenario for a git repository. In fact the truth is that you are in such a situation because the git repo was obtained converting from a subversion repo which was using the mergeWithUpstream stuff of svn-buildpackage. Now that you have git's space efficiency you want to change this, import upstream sources, and possibly adhere to a branch layout which is compatible with git-buildpackage (which is very simple in its minimal requirements: an upstream branch containing just upstream sources and a master branch containing a debianized source tree). Out of the box git-import-orig won't work since don't have the upstream branch. Creating it branching from master (or somewhere else) won't work either unfortunately. Indeed after branching you will need to remove the debian/ dir from upstream and when you will merge upstream with master you will be merging the removal as well, bad idea. By myself I've found some horrifying solutions involving using git-filter-branch on the upstream branch merged from master and then squashing all the history of that branch with git-rebase, but they are so horrible that I won't mention them here more than this. The nice solution came from a hint by madduck on the creation of branches without ancestry. Here is the complete recipe (assumed to be run from the master branch of the repo, before creating any upstream branch):
$ git-symbolic-ref HEAD refs/heads/upstream
$ git rm --cached -r .
$ git commit --allow-empty -m 'initial upstream branch'
$ git checkout -f master
$ git merge upstream
$ git-import-orig --no-dch ../foo_1.2.3.orig.tar.gz

In short: you should create an upstream branch without any ancestry, in it you should create an empty commit, then merge it (vacuously) in master, and now you're ready to call git-import-orig to the rescue. Feature request on git-buildpackage to support this out of the box is on the go: bug #471560.

13 March 2008

Martin F. Krafft: Queen Day

I spent the night doing all these normal things in my dreams: washing dishes, coding, shopping, cleaning up my desk, etc.. The only thing that was common to all was that I sang Bohemian Rhapsody all along. In the morning, I was afraid I could have kept my flatmate awake, but he denied hearing anything. Regardless, I am declaring today Queen Day and I m already grooving. NP: Queen: A Night at the Opera

11 March 2008

Martin F. Krafft: vcs-pkg meeting in Extremadura?

If you are interested in using version control for distro packaging, you If you read the mailing list, you know about the upcoming Extremadura meeting 2-6 April 2008. If this is news to you, well, it isn t anymore. If you think you should be in Extremadura when this party takes place, don t hesitate and reply. The message ID is 20080311193428.GA25745@piper.oerlikon.madduck.net.

10 March 2008

Lars Wirzenius: Reducing online distractions

I'm attempting to raise my productivity by reducing the number of distractions I have while working. I work at home, and there's no-one else here when I work, so there's not much to do there. There is a lot to do about online distractions, however. The three biggest distractions are IRC, non-necessary mailing lists, and random web browsing. I will be reducing the IRC channels I'm regularly on. This means dropping all but one or two channels not directly related to work, and as many work related channels as I can. I'm pondering doing something similar to what Martin Krafft has talked about: making sure the mailing list messages reach me only at certain points of the day or week. I'd do this by having list e-mail delivered to a folder not usually visible to my e-mail program, and then having a cron job move the mails to the inbox when it's time. I have all the scripts written for this, so it'd be easy to do. This way I could ignore them at all other times, and then catch up on them every now and then. The problem with this is that when the list mails are delivered, I'm going to be swamped, and that can happen at an inconvenient time. So it's probably best to just unsubscribe. Either way, even if I'm fairly silent on mailing lists, don't be surprised if I shut up completely. (I might start sending out other e-mails and blog a lot more, though.) Both of these changes, dropping IRC and lists, are potentially permanent, but might turn out to be temporary. We'll see. If this works out well, meaning that I manage to keep track of the people and projects I'm interested in while improving productivity, the change is likely to be permanent.

Martin F. Krafft: Customer support farce

There are plenty of reasons why a company might provide a web form as the only means for customers to get in touch with their customer support department: for instance, the web form compels the customer to send along important information with the first request, therefore saving time (and money) for the customer service department. Even though I hate web forms, I sometimes do fill them in and usually get an answer back; it works. Every once in a while, however, I ll encounter a form designed by people without any form of understanding of the role of a customer for any business (it s the most important asset ). Such is the case when the form limits the message to a certain number of characters. Obviously, no customer service agent wants to read novel-length prose when fielding incoming requests, but a few hundred characters may also not be enough to get the point across. Star Alliance, for instance, expects you to get your point across in 300 characters. I find it hard to imagine that people write lengthy texts into web forms, unless they have more information to get across. I also see no technical reason for limiting the length of the text which can be submitted. The only logical explanation I have is that those companies give a flying food about customers and would much rather not have them contact the support department. NP: The Flower Kings: Back in the World of Adventures

5 March 2008

Gunnar Wolf: And you call them abusive?

Madduck complains about the lack of attractive data plans for mobile phone providers in Switzerland. Madduck: As always, you will have to remember there are many people confronted with a much worse situation than yours.
Up to a month ago, I never envisioned using my phone for anything besides... Well, talking. But yes, since I got my new gadget, I keep playing with GPS or using it for simple things that require Web access and do not require much interactivity (the suckiness of a 12-key keyboard is berhuge!) - Provided, of course, that I am near a WiFi hotspot, of course. My mobile service provider, Telcel, just publicly launched its 3G network - this means, of course, prices are well over the roof:
The cheapest plan starts at MX$59 (around US$5.5) a month, and gives you a whooping 1MB of allowed transfer - Anything you do over 1MB will cost you MX$0.06 per kilobyte. Yes, Telcel offers a 1.5Mbps connection, so it'd theoretically take only 6 seconds to exceed the monthly plan. After the joyful first seconds of network access, each second of full-fledged data transfer will cost you 9 pesos - Around US$0.85. How nice!
Now, there are plans for 1, 3, 5, 10, 15, 20, 30, 50, 100 and 1000MB. Their price increases at a slow pace up to MX$459, which is still somewhat expensive if you even thought on using your cell phone as a gateway (say, over Bluetooth) for your regular computer's connectivity. Of course, if I buy 1GB of data transfer, I'd expect a much lower price for each additional Kb. Well, no, it only goes down to MX$0.03. Per Kilobyte, yes, you read right. Those little things your Vic20 was full of.
There is even an unlimited plan. Well, yes, unlimited but limited - For MX$579 (~US$55) you get a nice deal, right? After all, I pay MX$350 for my 1024/128 DSL connection - it is on the right range. Well, no - If you get over 3GB in one month, your data rate will drop to 128Kbps for the rest of the month. Nice. No good as a gateway either.
So, I'm not hiring a 3G plan at all. But that's also a danger - If I open a net-using program at the wrong moment, I'll be billed at MX$0.14 per Kilobyte.
Bah.
[update] There is another similar service in Mexico, IUSAcell's BAM. Pricing is equivalent, though.

Martin F. Krafft: Mobile phone business opportunities

Since Switzerland s three main cell phone providers (Swisscom, Sunrise, and Orange) are apparently happy to remain stagnant, here are two business opportunities, in case you re fidgety and looking to get rich. The second actually applies to all of Europe, or even the world.
  1. provide a true EDGE flat rate. The three providers all have unlimited data options, but cap their offers at 1.5-2.5 Gb/month, after which you end up paying horrendous amounts for each additional Megabyte. The marketing people are, of course, aware of this unlimited lie, while the casual customer does not have to be since s/he won t generate this amount of traffic.
  2. peer with local providers and come up with a plan that allows me to roam about and use my phone from anywhere in Europe (or the world) for the exact same fees as always. I realise this will be quite difficult because it involves a large number of peering agreements, but think of the potential: I d switch immediately, I d even forego any remaining term I still have on my contract, and I am sure I am not the only one.
Once you hit the black numbers, please hand over a small percentage of your stakes for my ingenious ideas. NP: Gazpacho: Night Update: Gunnar replied with a peek into the situation in Mexiko. Yes, I am spoiled.

4 March 2008

Martin F. Krafft: Failing to contact the Apple Store

I am trying to contact the Swiss Apple Store to inquire about one of their products. I was happy to find a free phone number on their web site, so I reached for the cellphone to dial but could not get a connection. It turns out that they don t accept calls from a cellphone because that costs a fair amount more than from a land line. I ve spent another 20 seconds or so looking for another way to get in touch with them, but apparently they don t care about me or other cellphone users. I ll take my business elsewhere then. NP: Guns n Roses: Use Your Illusion I

2 March 2008

Adeodato Sim : Making EnhancedCommentify.vim more useable for me

I use the enhanced commentify script from vim.org to easily comment and decomment parts of code. It knows about comment delimiters in a ton of languages, and it’s generally nice. Lately, I’ve been a bit annoyed about commenting several lines with different indent levels. In particular, given for example this snippet:
  def foo():
      if duck.is_hungry():
          grab_food()
          feed_duck()
If one instructs the script to comment the three last lines, the result is:
  def foo():
      # if duck.is_hungry():
          # grab_food()
          # feed_duck()
When what I would like is:
  def foo():
      # if duck.is_hungry():
      #     grab_food()
      #     feed_duck()
There is one variable one can set to achieve this behavior: EnhCommentifyUseBlockIndent. However, it only works when commenting from visual mode. From normal mode (what I normally use — that is, going to e.g. line 2 above, and pressing 3,c), it doesn’t work, because from normal mode the commenting function does not receive the block, it just gets called three times, once per line. To solve this, the solution I found was to create a custom command that accepts a range, and calls the function exactly once, for the whole block. In particular, this is all my enhanced commentify configuration from ~/.vimrc:
  let EnhCommentifyPretty = "yes"
  let EnhCommentifyUserBindings = "yes"
  let EnhCommentifyRespectIndent = "yes"
  let EnhCommentifyUseBlockIndent = "yes"
  " The MyEnhancedCommentify bit is needed because the normal nmap just
  " calls EnhancedCommentify() <count> times, thus UseBlockIndent can't
  " work.
  nmap <Leader>c :MyEnhancedCommentify<CR>
  vmap <Leader>c <Plug>VisualTraditional
  command! -range MyEnhancedCommentify 
      \ call EnhancedCommentify('', 'guess', <line1>, <line2>)

28 February 2008

Andrew Pollock: [debian] It's all Bob's fault (or 3 years of maintaining dhcp3)

So today is the third anniversary of my first upload of the ISC DHCP v3 package to Debian. It all started back in the days of the linux.conf.au 2005 organising committee. Bob Edwards, who ran the ANU Department of Computer Science computer labs (which ran on Debian at the time), was constantly complaining about bugs like #286011, once he'd found out I was a Debian developer. So I figured I'd try and do something about it, so I think I emailed the maintainers, who had been fairly inactive (the last upload before mine was in July the year before), and asked if they'd like me to NMU the package. I think Matt Zimmerman emailed me back and told me to knock myself out, and add myself as an uploader while I was at it, and well, the rest is history... I've had fun fixing bugs, trying to clean things up, deal with a pretty archaic upstream build system and get the package up to current Debian standards compliance. One of the highlights was being able to finally get rid of Debian Installer's dependence on the v2 DHCP client package, so we could finally jettison the v2 packages for Lenny (which reminds me, I still have to figure out how to handle the transition from Etch with respect to that). I've been working hard to try and get as many of the patches in Debian's DHCP packages incorporated upstream. Unfortunately, they have a totally unpredictable release cycle, and they have feature releases and bug fix releases. The feature releases are very few and far between, and they won't introduce new features into a bugfix release. Speaking of patches, my personal philosophy is that distribution packages shouldn't differ radically in behaviour or functionality from their upstream source, so I've resisted incorporating some of the more deviant patches from Ubuntu, instead forwarding them directly upstream. There's still a bit of work to be done with the package. The ISC released version 3.1.0 a while ago, and that's the version I'm trying to standardise on for Lenny. It's got new support for a domain-search option, which means people can stop abusing the domain-name option to set a domain search list in their clients. The domain-search option is also honoured by Mac OS X (Leopard), and I dare say Windows Vista probably supports it as well, but I haven't checked. Unfortunately the client-side support for the domain-search option is a bit flaky in 3.1.0, so I'm hoping the ISC will release 3.1.1 real soon now, as I believe most of the flakiness issues are addressed in it. Of course, for Lenny to do the right thing consistently with this new option, #460609 and #465158 need to be resolved also. The last thing I'm trying to sort out for Lenny is the reasonably in-demand LDAP patch. It's been floating around out-of-tree for longer than I've been maintaining the package. Jos L. Redrejo Rodr guez has been kind enough to clean up the patch for me, so that rather than bastardising the standard DHCP package to build a dhcp3-server package that has LDAP support, it basically builds DHCP twice, once with the patch and once without, and the dhcp3-server-ldap package just diverts /usr/sbin/dhcpd3 out of the way and plonks in the LDAP-enabled binary in its place. I hope to upload a new revision of the package that builds this new binary package within the next week (hopefully this weekend). After that's done, and hopefully 3.1.1 has been released, and Lenny is out of the way, I'm going to focus on transitioning away from a versioned set of DHCP packages. The whole "3" in everything was to allow the v2 and v3 packages to coexist. I've sought advice from the release team about this, and they said not to bother, but it feels really gross to have the version 4 package (4.0.0 has been released by the ISC for a while now as well) be still called dhcp3, and to install into /etc/dhcp3 and other such versioned directories. The final thing I want to look into is collaborative maintenance. I've been wanting to do this for a while, but I wanted to get the package into a revision control system (shock horror, it's not currently) and I've been baulking at how to do it the "right" way. I'm pretty sold on using Git for the revision control system, I just haven't figured out the right approach yet. Martin Krafft's articles about it have been interesting, but feel a bit overly advanced, and don't quite suit my situation. I've been hesitant to start using Git, then discover I've done it all wrong, and have to start again. I need to just bite the bullet. My upstream also doesn't use Git, and doesn't make their revision control system publicly available, so I just get the tarballs when they're released. Speaking of upstream, I made the discovery last year that they're just down the road from me in Redwood City, so I've been trying to improve relations by getting the main folks who work on DHCP at ISC to pop up to Google for lunch every now and then, which so far has happened twice, and been good a opportunity to have a chat. In fact, they're keen for Debian to join the DHCP Forum (Debian is already a member of the BIND Forum) and I think they've started talking to the Debian folks responsible for our BIND Forum membership about extending that to cover the DHCP Forum as well. So that's about it. I think after three years of being the sole uploader, I'll formally put myself in as the maintainer and Eloy as an uploader until I get around to implementing collaborative maintenance.

27 February 2008

Martin F. Krafft: The Cure is back

I just saw The Cure, supported by 65daysofstatic, to which we arrived late. But the organisers had a reason why they started early. True to the concept of a Cure concert, the band played three hours, and two minutes more. And boy was it good. It felt like they were having the time of their lives on stage. Flawless. If you have a chance, see them.

Martin F. Krafft: Do sensible VoIP phones exist?

With my new VoIP infrastructure in place, I d like to get rid of the softphones and replace them with hardware. An obvious solution, given how I might need to replace my cellphone sometime soon, would be to check out the Nokia E65, which can do VoIP over wireless. I ve previously dismissed the Nokia E-series phones for good reasons, but Nokia had time to improve them, and I know a few people who like the E65. Waiting for the OpenMoko Freerunner is nother option. If you know of other VoIP+Wifi GSM cellphones you can advocate, please let me know. On the other hand, I might just want to get a separate VoIP phone, ideally wireless, to use at home exclusively. The problem is that there seem to be none. I checked out at least two dozens, and they all fall short for one of the following reasons: Thus, I am reaching out to the lazyweb. Does anyone know of a wireless (short-range) phone that can do VoIP at a reasonable price, either based on Wifi, or using an ethernet-connected base station (DECT). I d appreciate a note. NP: Age Pryor: City Chorus

Martin F. Krafft: Asterisk on Debian: piece of cake!

Yesterday, my phone had a temporary fit, yet I had a bunch of important calls left to make. Since I have an account with a VoIP provider and a Swiss number associated with it, I decided to use it as a fallback. That worked. The next thing I found out was that a meeting had been cancelled, and since I was in a VoIP-related mindset anyway, I did what I ve been meaning to do for years: check out Asterisk. An excellent article by Stefan Wintermeyer in the 01/2008 issue of the German Linux Magazin helped me understand the basics of the Asterisk configuration paradigms in a single read. With 40 minutes left, I installed the Debian Asterisk packages on a test machine and by the time of my next meeting, I had the server register with two VoIP providers (one of them being the university) and routed outgoing calls accordingly: calls to university numbers went there, all others would be routed via Insphone. I also hooked up three softphones and routed incoming calls to them. I shall post my configuration once I spent a little more time with it, configured e.g. voice mail and a simple voice- or DMTF-activated menu system to distinguish work from private calls, and cleaned it up. If you care before then, ask. Asterisk is said to have a steep learning curve. Thanks to the article and the excellent work by the Debian maintainers, I climbed that curve to the point where I can make and receive phone calls in about an hour. Thanks! NP: Age Pryor: Shanks Pony

21 February 2008

Martin F. Krafft: Logitech product lines and how they still screw over the customer

After a failed attempt to fix Penny s car speakers taking apart the interior of a Ford is way harder than it should be, and of course we came out of the quest with the obligatory screw which wouldn t fit anywhere I bought a pair of portable speakers. The Logitech PureFi Anywhere convinced in terms of sound quality, and we greatly enjoyed them on our roadtrip. Having bought them in New Zealand, the speakers of course came with a type I power plug, while most of Europe uses a type-C-compatible plug. The design is modular, allowing for the actual plug to be swapped, so I bought it anyway: Modular Logitech power plug with type I adapter Back home, I contacted Logitech and asked them how to get the adapter swapped. Their response? It is not possible to obtain the modular plug separate from the speakers. Logitech uses a modular approach to optimise their product lines and ultimately, their profit, but they don t deem it necessary to leverage the power from this approach to serve their clients. Guess who won t be buying Logitech products again! If you are considering their stuff, please think twice. If anyone knows of a way to get at such an adapter, or has one to trade, or can help otherwise, please get in touch with me. Thanks! NP: The Pineapple Thief: 137

17 February 2008

Martin F. Krafft: How long will this last?

At Melbourne Tullamarine airport today, I was asked to present the credit card used to book my flights as a security measure to be able to fly Bangkok-Zurich. I did not need the card for the Melbourne-Bangkok leg. Unfortunately, I left the card at home for various reasons. In the end, they just issued both boarding passes anyway. I was not allowed to take the throw-away wooden chopsticks that came with my Pad Thai lunch through the security checkpoint. For dinner on the airplane to Bangkok, we were given plastic knives and metal forks. For dinner on the second trip, we got metal knives. At Bangkok airport, I had to pass a security checkpoint changing planes. They confiscated the plastic water bottle which was given to me on the flight from Melbourne (the bottle said Thai airlines on the label). The lady in front of me was using one of those telescopic walking sticks, she apparently had a bad leg. They didn t even bother asking about the stick, which she ran through the x-ray. Terrorists don t have bad legs, nor know how to pretend. How long are we going to put up with this bullshit? NP: The Flower Kings: Stardust We Are

Martin F. Krafft: The Penny & Martin adventure: phase 2

Following the first phase, the second and final phase of the Penny and Martin adventure ended last Friday at Wellington airport. I am now 11 500 metres high on my way from Bangkok to Zurich, looking back at seven days on the New Zealand South Island, another in Wellington, and a night in Melbourne. Here s the summary of the 2200km we travelled, with selected photos inline. Penny has more pictures in her Flickr album. My New Zealand beer top-ten, in reverse order: Monteith s Original, Monteith s Black, Mac s Great White, Monteith s Golden, Monteith s Celtic, Monteith s Pilsener, Emerson s Pilsener, Mac s Hop Rocker, Emerson s 1812 India Pale Ale, and (drum-roll): Mac s Sassy Red. Yum! The Emerson beers get no links because the brewery website uses Flash. Thanks, Penny, for a fabulous two weeks! NP: The Flower Kings: Back in the World of Adventures

Martin F. Krafft: Places in Melbourne

On my way home from New Zealand, I spent a (Friday) night in Melbourne. Peter, Donna, Andrew, and Mark, all of whom I knew from LCA 2008, came out and helped me get away from the after-work-craze that filled centre city. Thanks to them, I found (and refound) a couple of places worth noting: NP: The Phoenix Foundation: Happy Ending Update: Joel points out that the Australia on Collins shopping centre on 260 Collins street has free wireless

Next.

Previous.