Search Results: "ean"

5 November 2005

Anthony Towns: Britney's Memory Management

One of the things about the whole money thing and free software is the question of whether it’ll take all the fun and spontaneity out of hax0ring. As it turns out, that doesn’t even work when you try; so instead of doing dak work last weekend, like I’d planned and like the market was indicating, I ended up hacking on britney until about 5am Sunday morning, leaving the dak stuff to be spread over the week, instead. (After the last post, dak might seem cursed, but trust me it’s not. More on that RSN, but not just yet) For those playing along at home, britney is the name of the scripts used to update Debian’s testing distribution; basically it automates some of the hard problems of Debian release management. Naturally, this is a pretty tricky job – there’re over 200,000 packages in Debian unstable (spread across eleven architectures), with fairly complicated sets of interdependencies amongst them. It gets complicated enough, in fact, that the core analysis britney undertakes isn’t just too processor intensive to do in perl or python, it’s too memory intensive to use standard malloc for its data structures. (Cynical and Coding, and the UQ CS228 class of ‘98 will probably have some idea of the fun to come at this point…) The problem is that britney uses an absurd number of linked lists to resolve dependency issues, with each entry in the list being an independent block of a dozen or so bytes; and adding the usual malloc overhead to this can effectively double the memory usage. Worse, britney also likes to reuse memory quite a lot, does a fair bit of backtracking, and generally acts like the prima donna she is. Up until last week, britney’s memory was managed by the use of a parallel bitfield indicating whether memory was free or not: so britney would first allocate a 128kB block using standard malloc, note it’s all free, then every request for 12 or 52 bytes would result in some bits being twiddled; and every free would twiddle the bits back, so they could be reused later. This means two things: one is that the free invocation has to include the size of the memory to be freed as well as the address, and the other is that finding an appropriate sized block of freed memory can be awkward, leading to some degree of fragmentation. This fragmentation seemed to lead to britney having a gradual memory leak, which would mean that if the release managers were doing some complicated transitions gigabytes of memory would end up being used and OOMing; or, since britney runs on ftp-master and it’s probably not a good idea to have the OOM killer start on the machine that ensures the Debian archive’s integrity, the ulimit is reached, and britney aborts unhappily. Unfortunately, though, the use of a “roll your own” malloc means you can’t use the standard memory checkers to see what’s going on, so you’re left with guessing and hoping. And as a consequence the memory leak’s been around for ages, causing fairly regular minor annoyance. This changed last week when Micha Nelissen (neli) got into the act:
<neli> why does it need so much memory ?
<aba> neli: because it needs to check how the changes affect the installability count
<neli> aba: ok…but still does not seem like a big deal
<neli> how large trees are we talking then?
<aj> it has to do a lot of backtracking
<aj> how large is the longest dependency tree in debian?
<neli> backtracking only takes time, not space, right?
<aj> you need a list of things to backtrack over
<aba> neli: it also consumes memory, at least with the current dpkg-implem ntation
<aba> (well, there are ideas how to avoid this memory fragmentation, but that’s something else)
<aj> (it’s not actually memory usage, it’s memory fragmentation)
<neli> hmm, bad memory manager ?
<aj> imperfect, *shrug*
After poking around at getting britney to run locally, and doing some basic analysis on how it was used, neli decided to rewrite the memory manager to use chunk-size pools – so that a separate pool would be used for 4 byte allocations, for 8 byte allocations, for 12 byte allocations, etc. That’s possible due to two factors: one is that the special memory allocation is only needed for data structures which are all made from fairly small sizes, and are a multiple of the word size. It also means that fragmentation can be avoided completely – since you can use the “free” elements to store a free list taking up no extra space. Happily, that change also made the memory allocation much simpler. (It also shows the benefits of a fresh look at code; I’d been thinking of doing something similar for ages, but always been stopped because I couldn’t figure how to make it cope with the various different sized blocks I’d need. As it turned out though, I’d solved that problem ages ago when I wrote a separate allocator to deal with strings, which would’ve required my malloc to cope with a much larger variety of sizes) What it didn’t do was actually solve the memory leak. Which was pretty confusing, since the old memory checker had some tests to ensure that memory wasn’t really being leaked, and if the memory’s not being lost due to a missing free, or being lost to fragmentation, where is it going? At this point, the real benefit of having a simpler malloc implementation came across; because suddenly it was plausible to add some debugging code to allocate a separate pool for every memory allocation, and to report how much memory is being used at any point, per line of code. That gave me output like:
pool 8B/1:751; 1962683 used 1965960 allocated (99.8% of 22 MiB)
So I knew that line 751 (of dpkg.c), was allocating 8B chunks, had used up to 22MiB in the past, and was currently using 99.8% of that. (Actually, I made an off by one error initially, so the “8B” above is actually 12B, as you can see if you divide 22MiB by 1965960) That let me see two “leaks”. One turned out to be fairly easy to diagnose; as an optimisation, when I say “package foo is installable”, I note that “but we used bar to see that, so if we later update/remove bar, note that we’ll have to see if foo is still installable”. So the datastructure for bar ends up with a linked list of all the packages, foo, that relied on it. But I don’t check that list for dupes, so if I note that both bar and baz were required for foo to be installable, then update bar, when I recheck foo, I’ll add it to both bar’s and baz’s lists; which is fine for bar, whose list I cleared when I updated it; but not so fine for baz, because it’s now got two entries for foo. Having already added a check for dupes when trying to see if my guess was right, extending that check to skip the addition was pretty easy. The other leak required a little more investigation. It was in a fairly tight loop which could reasonably be using a fair amount of memory; but by the end of the loop it should all be freed. Adding some more debug code to the allocation functions confirmed the problem:
<aj> pool 8B/11:1231; 1618157 used 1703936 allocated (95.0% of 13 MiB, 9.05% current)
<aj> so it looks like ~9% of those allocations are never freed to me
<aj> 9.05% = used/alloc
<aj> where used is incrememnted on b_m, decremented on b_f
<aj> alloc is incrememneted on b_m, never decremented
The code was meant to either add the allocated block to a larger list that’s being traversed, or to free it immediately – the problem turned out to be that there were some nested ifs, and an internal if was lacking an else that should have freed the block. Fixing that changed the results to:
pool 8B/11:1228; 160 used 131072 allocated (0.1% of 1 MiB, 0.01% current)
Which both dropped the leak – only allocating a maximum of 130,000 nodes instead of almost 2,000,000 – and resulted in almost all the allocations that had ever been made, having been freed once britney had been running for even a fairly short while. As it turned out, though, the cure for the first leak was worse than the disease – checking for duplicates in a linked list turned out to take too long, and the memory wasted in that section wasn’t that big a deal. Using a red-black tree or similar instead would’ve been a solution, but so far doesn’t seem necessary. There haven’t been any OOMs since, happily; and even better, the reduced bloat seems to have made the overall checking a bit faster. Sweet.

Mike Hommey: Nasty bugs

Recently, I’ve been going through mozilla-firefox’s list of bugs and took a look to some of them. I got interested in #336411, since I’m regularly hit by this one myself (remember ? I said I got strange crashes with 1.5beta1). It appears that this strange crasher is in fact due to extensions using binary components. ColorZilla was the one killing my firefox. Why does it crash on debian’s firefox and not on upstream’s ? Simple : upstream’s is built with gcc 3.4, debian’s with gcc 4.0. Both C++ ABIs are incompatible. Now the question is : what can we do for that ? A quick fix could be to check before loading the component, if it’s linked to the incompatible libstdc++.so.5, but it’s almost as nasty as the bug itself… I’ve not really investigated possible solutions yet, but if you have some better ideas, you’re welcome. Another bug I got interested in is #211010 and its dupe, #256384. This one was really nasty. One of the kind I hate : bad programming practices. The interesting thing with this bug, though, was that it’s been revealed because of 3 other issues in 2 separate programs. The first issue is that autoconf decides to use echo 'something\c' over echo -n something when both ‘\c’ and -n are understood by echo. The second issue is that when giving some options with spaces to configure (like in --enable-optimize="-pipe -w -O2"), the associated variable gets backslashed spaces (i.e. "-pipe\ -w\ -O2") (thus, being an autoconf feature) The third issue is that the mozilla configure.in script tries to get rid of these backslashed spaces with echo $enableval sed -e 's \\\ g', triggering the nasty dash bug. A simple workaround, as stated in #256384 is to quote $enableval Now, for the dash bug itself. What happens with dash is that whenever you echo a ‘\c’ escape sequence, all subsequent echo commands stop printing after the first argument containing a backslash. For example echo test1 'test2\ttest3' test4 outputs test1 test2<tab>test3. In the case of our echo $enableval, since its value was -pipe\ -w\ -O2, it printed -pipe\ without any space after the backslash, so that it was not removed by the sed call. This value was then substitued in config/autoconf.mk.in to create config/autoconf.mk, where the ending backslash was interpreted as its shell meaning (continue on next line), thus breaking the variable, and build command lines. And for the bad programming practice ? The dash bug is due to a global variable that never got re-initialized, leaving the “terminate echo” (kinda) flag turned on (which is only checked when there is a backslash in the argument, since it is used to stop printing after, guess what… ‘\c’). No wonder why one of the first things you learn in programming classes is : never use global variables. (or at least, be very very very careful about what you do with them)

4 November 2005

Clint Adams: On nights like this

Once there was a little androgyne named Brendan. He was knee-high to a hamster, long-haired, and full of zest for life. Sometimes he rhymed slow, sometimes he rhymed quick, and sometimes, at least in his opinion, he resembled in some ways a Chick-O-Stick, and did not resemble DeLorean, Gambino, or Gotti. A waitress concurred to some degree. Here is your vermouth on the rocks, ma'am, she said. When Brendan insisted that he was not a ma'am , she was terribly apologetic, but her pleas could not quell the tumult of his bruised and beaten ego. I am virile! he declared, and through will alone he set his mind in motion. He furrowed his brow and concentrated deeply, and, ever so slowly, his facial hair grew. After many breaks for food and sleep, he decided that his masterpiece was complete. He beat his chest and left his home to show everyone his pride and joy, his Mustache. You've got something on your lip, mister, said a young boy. Great success! exclaimed Brendan, for he had been identified as a mister . He was on top of the world, basking in his newfound masculinity. Stay away from my children! screamed a woman who had instantly deduced that he was a member of NAMBLA. Realizing that many people believed him to be a pederast, he decided to make an adjustment. Soon, he had cultivated a Van Dyke, and showed his face in public again. Nice goatee, ma'am! a teenager shouted. It's not a goatee! he replied, and walked on. Reflecting that he had been called ma'am again, he undid his pigtails. What came next was a series of men hitting on him. This will not do, he thought, and converted his Van Dyke to a goatee. When this caused an entirely different set of men to hit on him instead, he swallowed his pride and went to the supermarket to ask for some advice. I am not a homosexual, he explained to Miss Midwest Midnight Checkout Queen. I am manly, and I like the poontang and the boobies. What can I do to stop this unwanted attention? Shave, she said, and refused to acknowledge his protests. So he shaved and went to the bakery. I've got a sweet tooth, he explained, for licorice drops and jelly roll. I'm sorry, ma'am, the baker informed him, but we only sell lard bread and bran muffins here. Brendan let out a high-pitched scream and stormed out to play in traffic. His eye was caught by a sign advertising fortune telling services, and desperation drove him to go ask for a consultation. You will die unhappy, said the Gypsy Queen. Brendan recounted his trials and tribulations and asked her for advice. The Gypsy Queen informed him that he would be subject to additional charges for such, and he assented. Very well, she sighed. People will never respect you if you care what they think. Just be yourself, and if anyone complains about the way you are, or demands that you change to suit them, tell them to fuck off. That's wonderful advice! Brendan gushed. He gave her an enormous tip, and hurried out into the world to try out his new lifestyle. That guy sucks, people said. She doesn't care about anybody but herself. So they shunned him. He died an unhappy little androgyne.

Matthew Garrett

Trolltech wrote a license called the QPL. Writing a patch under the QPL means that the licensor can include your patch in the version of the software that they sell to people who want to write closed-source applications. Or, in other words, it means that your code can end up being used in closed-source applications by evil companies.

So when a Trolltech community manager criticises the LGPL for allowing exactly that, remember that he's concerned about free software rather than worrying about a competitor releasing a better product:

Remember, the LGPL, is NOT about free software. Its about letting some corporation steal your work and not pay you for it.

Bless you, Trolltech. Blolltech.

(Total time taken to port Dasher to the Nokia 770: about 4 hours. Total time taken to get Dasher to integrate in the horrid, horrid, HORRID Qtopia build system: 4 DAYS THAT I FULLY INTEND TO RECLAIM)

Martin 'Joey' Schulze: Sparc Porting Host

Some weeks ago the kernel on vore, Debian's sparc porting machine and sparc buildd, was exchanged and didn't run as stable as expected. According to the site admin he was able to fix these problems in the meantime. However, one week ago the machine became unavailable again. This time it's a connectivity problem with the switch port. Unfortunately the security buildd for sparc has no redundancy. Even though auric, the other sparc machine of the Debian project hosted at the same place, visi.net, was configured to run a buildd for the general distribution, it wasn't set up to pick up security as well. It is not know when the connectivity problem of vore will be fixed. However, this morning build logs for security updates were received from a new machine. It looks like somebody spent some time on fixing the issue without vore and alleviate the situation. Hope we'll have a sparc buildd soon again.

3 November 2005

Radu Spineanu: Fun projects

Being almost friday and having a little bit of time and all i decided to create a new blog. Since my debian account was created recently i though 'why not' and added it to Planet Debian, among the best of the best.

Reading today the slashdot article about Nokia and opensource i remember about a project i did this summer. Following a question i posted about handling private keys on debian-security sometime in june someone emailed with this reply, which i found very interesting. And i actually wrote that, even though it's pretty rudimentary (authentication using mobile devices and assymetric keys).

Basically when you enter a username at the login prompt, the PAM modules looks up information about that user from a configuration file which contains the hwaddress of his assigned device and a path to a public key (either GPG or SSL). The PAM module then generates a temporary password, encrypts it with the users public key and sends it via bluetooth to the mobile device.

The Symbian part was a little tricky, and my first encounter with java. I implemented only SSL decryption capabilities because it's a faster decryption time (~4 sec on my 6630) , and because BouncyCastle's cryptography support for pgp is impossible to port to j2me with my java knowledge. Anyway i haven't seen assymetric key cryptography (oss) on mobile devices until this. Being in java it doesn't really use anything fancy, and it _should_ work on any mobile device supporting FileConnection API (jsr-75).

If you feel adventurous, you can find the source code here.

David Moreno Garza: NKjoom5

In most of the last few days, I've been completely into NKjoom5, a framework for developing web applications for the company I work for. This is based on the lastest version of Joomla, 1.0.3, and it tries to bring more ease of use to the final product, capable of understanding by all the guys working on the Mexico and Colombia local officies of the company.
 
In the meanwhile, I've ported most of the core code of Joomla into mysqli extension of PHP5 and most of the XML functionality is about to be ported with DOM and even XPath, all of this to bring more accessibility to the code and bring future to present :) MySQL 5, for production systems now, is also used, but I haven't played with it yet.
 
In the user management system, more work has to be done. We don't need more Authors, Editors, etc, user groups need to be defined.
 
This project excites me since I'm learning tons of things about PHP5 and Joomla, which happens to be a great framework content system, not only CMS. As soon as I have something releasable, I'll show it to the world.
 

Joey Hess: walls

That didn't last long, the new computer got (literally) stuck inside a wall by the second day, which reduced the noise level to enough to not bother me during the day. I need to add some noise blocking stuff inside the wall to get it low enough for me to tolerate at night. I'm so broken when it comes to environmental noise, oh well. Anyway, this ended up with the bits of the computer that arn't in the wall occupying parts of the bookshelf next to it, which is kinda neat. I especially like the flat panel monitor up on my bookshelf. Since I don't use the monitor for anything most of the time, I set it up to be a slowly changing slide show. Always something new and interesting from my photo library when I look over there. I spent a long time today installing vmware on the new computer, which was so annoyingly proprietary. It's amazing what people put up with, with hard to navigate websites, cryptic installation instructions, binary patches to fix stupid bugs, and then a whole layer of license key fun on top of it. With vmware you even get the fun of upgrading your license keys independant of the software. Once installed it is a lot faster than qemu though, so I put up with it. For some reason, I then decided to install the Windows CD that came with the computer in a vmware instance running on it, which meant I got to go through the whole crazy installer and license key rigamarole a second time. It takes more keystrokes to enter a windows license key than it takes to do a complete Debian desktop install! Amazing. And they use a font that makes Q and O and 0 and D all look like the same letter without a magnifying glass, so you might get to enter that key three or four times before you get it right. The plan is to keep that snapshot of an installed windows system and use it to make sure d-i does appropriate things when confronted with a system running windows. Anyway, d-i runs nicely on the new vmware system, with a first stage install taking less than ten minutes. I've already found and fixed more d-i bugs today than I had in the last week or so, thanks to the improved environment.

Joe Wreschnig: GNOME Performance Day + 3 = Python Performance Day

To whoever decided it would be a good idea to make Python’s gettext.ngettext search the filesystem for the domain’s mo files every time it is called (potentially one “J. David Ibanez”), please don’t go near any standard libraries ever again. You are personally responsible for almost 30% of the time spent loading Quod Libet’s album list, and probably a proportional amount of time wasted elsewhere in the program. For people using gettext.py, here is something to replace gettext.install with:
def install(domain, localedir=None, unicode=False):
    import __builtin__
    t = translation(domain, localedir, fallback=True)
    __builtin__.__dict__['_'] = unicode and t.ugettext or t.gettext
    __builtin__.__dict__['ngettext'] = unicode and t.ungettext or t.ngettext
(Python 2.4 users may want to have the codeset kwarg as well. Update: Fixed a thinko where I used “self” and meant “t”. Submitted upstream.) Now with added bonus of not having to import ngettext yourself in every module. (Yeah, using __builtins__ is kind of ugly, but I’m just going for minimum interference with existing code.) Before:
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1851    0.020    0.000    1.070    0.001 gettext.py:475(ngettext)
After:
   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1851    0.000    0.000    0.010    0.000 gettext.py:345(ungettext)

2 November 2005

Wouter Verhelst: Warning: rant ahead.

I hate bugzilla. With a vengeance. Not because it doesn't have features or anything; because you need to log on to it to be able to use it. I've got way too many passwords as it is already that I need to remember. I don't want one to be able to file a bug, thank you very much! And no, I'm not going to give you one of my precious other passwords -- especially not one that I use to log on to my system. So that means I'll have to do ugly things to remember it. grumble. Why is it that everyone and their mother uses this fsck'ing I-love-passwords-bugzilla? There are only two Open Source projects that I know of who don't: Debian and FreeBSD. The former uses a home-grown BTS which predates bugzilla by several years; the latter uses Gnats which, ironically (since so many FreeBSD developers have philosophical problems with the GPL), is GNU software. It's no accident that I'm associated with one of them. One advantage of Free Software is that there's so many choice, and that you can use loads of different software—and this happens all the time, everywhere; consider Graphical User Interfaces (KDE, Gnome, ion, Enlightenment, WindowMaker, ...), shells (bash, dash, zsh, tcsh, ...), kernels (FreeBSD, Linux, NetBSD, ...) etcetera. So why doesn't this happen for bug tracking systems?

Clint Adams: Someone got a jones for the mozzi

Selling fresh mozzarella is illegal here. This means that I have to either make it myself, which would involve plunging my hands into scalding hot water, or procure it from someone flouting The Law. So, instead of being able to go to the local supermarket, one may experience conversations like this. How fresh are they? All fresh, mang. All fresh. Which are the freshest? All fresh. You want this one? Is that the freshest? They're all fresh. Fine. Then maybe he'll give you a discount on some smack. If it turns out that he's given you some bad cheese, there's no legitimate entity to complain to; you either suck it up and deal, or you oil up your sawed-off and go hunting.

Benjamin Mako Hill: Double Occupancy

Last night I was out in Dublin and, due to the length that the night dragged on, I invited my friend to crash in the extra bed in my Hotel room in central Dublin rather than return to his place in the suburbs which, at that point, may well have been impossible. When someone came by to clean the room in the morning, they noticed both beds full and reported this to the Hotel managment who called me up to say that they knew the room had been "double occupancy" last night and that they wanted to know if it would "single occupancy" the next night. That's a pretty strange way to talk if you think about it. There is an extra person in my room and the Hotel complains that my room has somehow changed into a new state that they are unhappy with. I suppose this circuitous way of speaking is designed to avoid any potentially embarrassing discussion about who the extra body is and why they are there. That said, this type of obtuse conversation is difficult for patrons to puzzle through immediately after being awoken. Dublin, of course, is great.

1 November 2005

MJ Ray: Audiovisual

itv4 launches tonight on freeview and ntl cable, but it seems that Sky have an administrative problem that will stop it being on Sky until next week. Anyone else suspicious? To compensate, itv4 launch night is being broadcast on Men and Motors too (which is visible across Europe, I think). The talk on the newsgroups suggests that itv4 is on satellite and it's only the non-standard Sky EPG which won't be updated. If you want it sooner, you may be able to use a standard DVB-S receiver or "Add Channels". Eutelsat float price falls. The report suggests it's because of other floats, people not wanting to invest so much in communications and bad bank practices. BBC World closes 10 radio services, opens 1 TV service which might suggest how much more expensive TV is to make. Meanwhile, a report says:
"Public service broadcasters are compromising quality to compete with commercial channels, and many of them depend on Governments or political parties. Meanwhile, ever-larger concentrations are developing in the commercial sector, often with clear political affiliations."
(Television across Europe report from OSI EUMAP) There's a guide to what I'm planning to do Real Soon Now: konekti la komputilon al televido If you want to get involved with radio instead, you could answer this call for help with rampART radio, from ram radio. I think they were interesting listening during G8 and on 7 July, but maybe they need a different approach for the rest of the time. RampART broadcast over the internet, which was how I listened. Many of the documents describing the internet are non-free, which is a silly silly pain. I've supported the petition about Problems with the IETF's copying permissions, by Simon Josefsson (author of libidn and gnutls) but I haven't done more yet. Moving to games, Sam Hocevar's post about Monsterz is unhappy with the difficulty of finding items for it:
"it makes me feel like coders are years ahead in terms of sharing their digital work for everyone to use and improve."
He's not alone. Want a big example? Stuart Yeates noticed that ibiblio's torrents have poor copyright info. I've also spotted Sourceforge and BerliOS hosting non-free data in the past. That's really annoying: you can't adapt everything you download from them and you have to read the terms really closely if you want to develop free software. It surprises me that Sourceforge and BerliOS stick so closely to the FSF's software=programs myth. It might be surprising that ibiblio's torrents seem blind to copyright metadata, but it's probably little surprise that a European Commission group assumes that strong, standardised, zealously-enforced copy controls are The Only Way and has meant the EFF Urges Fresh Inquiry Into Ramifications of DRM. There's news of a peer-to-peer technology that honours copyright law, by Derek Sooman. Will it work? Will it support liberal copyright terms as well as Big Media Grabs? Might Big Media outdo ibiblio? I doubt it.

Wouter Verhelst: 327780

Yes, I know that number by heart now. It's not a silly number, it's a bug. A grave bug on binutils which I opened, since the current version of binutils in unstable is, well, rather broken. I spent today tracking it down, and I found it. I must say I didn't expect that—I know next to nothing about the ELF file format, and even less about the binutils internals, so... But anyway, this is what I did: I'm pretty excited about this, both because we've had this bug for almost two months now (and we really needed to get rid of it) and because it's actually the first time I track down a bug in anything toolchain-related. This is nice.

31 October 2005

Eric Warmenhoven: Selling options

There are lots of cases where you can have a positive view of a stock, but still want a bit of investment protection. A fairly typical way of getting some protection against a drop in price is to place a stop-loss order with your broker, so that if a stock hits a certain price that you set, the broker will automatically sell the stock. This limits your loss (known as downside protection), and if the price doesn’t go down, then you keep all the stock, and you get to take full advantage if the price goes up (known as upside participation). Also, it should be free to place a stop-loss order with your broker, unless the price is hit and the stock is sold. So, stop-loss orders have three benefits: downside protection, upside participation, and no up-front cost. Unfortunately, there are a couple downsides (no pun intended) to stop-loss orders. The first is that if a stock is really plummeting (there aren’t any buyers at all), then it may be difficult or impossible for your broker to get the price that you’ve specified. That’s sort of an extreme situation though and only happens about once every thirty years (think October 19, 1987). The other, much more likely, scenario is that the stock goes through a temporary decline (causing your stock to be sold), but then recovers. In that case, you’ve sold for a loss and you miss out on the recovery. So instead of placing a stop-loss order with your broker, you can purchase what’s called a protective put. A “put” is a contract that says the buyer of the put has the right (not an obligation; it’s the buyer’s choice) to sell stock on (or before, in most cases) a predetermined day at a predetermined price to the person who sold (”wrote”) the put. For example, today RHAT closed at $23.22; you can buy an option to sell 100 RHAT shares at $22.50 (the strike price) anytime between today and November 18, 2005 (the option expiration date) for $55 (as reported by Yahoo!). So you get downside protection and full upside participation, for a price. (There’s also a married put, which is the same thing as a protective put, except you buy the stock at the same time as the put; a protective put implies that you already own the stock.) But there is still the annoying up-front cost. If you’re willing to risk missing out on some of the potential upside though, you can offset the costs. A collar is when you buy a protective put and at the same time selling a call option. By selling (writing) a call, you give someone else the right (again, not the obligation) to buy shares on a predetermined date for a predetermined price. For example, say you do buy the protective put above, and at the same time, write a call option for 100 RHAT shares that expires on November 18, 2005 for a strike price of $25. The proceeds from this sale will be $30 (again, minus fees). So for a cost of $25 ($55 to buy the put minus $30 to write the call), you’ve got downside protection, and upside participation up to about 7.7%. All of this assumes that your preference is to keep the stock. But say that your stock has done very well and it’s gotten to be a sizeable part of your portfolio, and you’d like to diversify a bit. That means that you’re serious about selling it, regardless of what you think the price is going to do. (There are lots of good reasons to sell a stock that’s enjoyed nice gains, not the least of which is that nice gains are generally caused by nice growth, and a company can only grow so big.) Selling the stock outright is one technique; another is a variant of dollar-cost averaging, but instead of buying a fixed dollar amount, sell a fixed number of shares. But you can combine either of these with writing call options to potentially achieve even better results. A covered call is when you own a stock and write a call option on it (like a married put, a buy-write is when you buy the stock and write the call at the same time). Instead of selling the stock immediately, you give someone else the option to buy it from you at a predetermined future date. Because the date is in the future, there’s a bit of a premium that buyers will pay (which means more money for you). For example, November 18, 2005 calls for RHAT with a strike price of $22.50 are selling for $120 for 100 shares; that means that if the option is exercised, you make $22.50 from the sale, plus $1.20 per share from the option, for a total of $23.70 as your effective sale price. If the option is not exercised though, then your shares are not sold, but you get to keep the $120, and do the whole thing over again. (Unfortunately for me, Brocade has a company policy prohibiting collars and covered calls. But fortunately for me, I don’t own very much BRCDE stock.)

Steve Kemp: Lua annoyance

Lua Directory Handling
Arrrgggghhhhh!!!! OK maybe lua is not love. I just realised that Lua has no concept of directory handling (opendir, readdir, etc). Indeed it isn’t possible to tell whether something is a directory or a file. So I added some more primitives to the Lua socket extension library. Most usefully a readdir call. This means the sample webserver can now serve directory contents if index.html isn’t found. It can also now fall back to serving a “default virtual host” if the requested one doesn’t exist. The webserver code is now very stable and complete. The only omission is CGI handling, but I’m not going to bother unless prompted strongly. I’ve added some simple examples to the documentation and I think things are looking good. The Debian package has been downloaded a few times, but no real feedback - feel free to share, don’t be shy!

30 October 2005

Joachim Breitner: Utnubu Paper Press Coverage

In the newest Linux-Magazin, a popular German - well - linux magazine, is a short note on Utnubu. The article is correct and sums it up quite nicely, but I am surprised by this amount of press coverage, a lot in the online news, now even on paper: Utnubu was just a quick idea of mine during DebConf, hasn’t done much besides the patch refomating and the packages diff, and my current time contraints won’t allow me to put enough effort in Utnubu to come anywhere close to justify the press coverage.This can only mean two things: A) The name was too clever for the project and therefore attracts the media attention or B) The press coverage means that Utnubu is something a lot of people do want to see. I hope for the latter.In that case, though, the Utnubu team needs more manpower (and womenpower...)! If you want to help out, just have a look at the missing packages list and see if there is a package you want in Debian, talk to the Ubuntu developers and/or prepare that package for debian. Subscribing to utnubu-discuss@lists.alioth.debian.org helps, too.And for those that for some strange reason like to read my name in the Linux Magazin: Have a look at the next one...

Dirk Eddelbuettel: Cringely see hundreds of thousands more Open Sourcers

This week's installment of Cringely's column has a slightly different take on the recurring theme of implication of the retirement of the Baby Boomers cohort:
In the U.S. the Baby Boom generation includes anyone born from 1946-64, which means everyone 41-59 years old. Those ages generally cover the top technical management positions in most companies and universities and they are starting to retire. But as anyone who reads magazines knows, this generation of upcoming retirees acts younger and healthier than the generations that preceded it and they plan to have very active older years. At the urging of reader Joel Franusic, I've been thinking of what implications this has for Open Source software. The implications are huge. Imagine 100,000 engineers and programmers leaving the U.S. work force every year for the next 18 years, because that's what is going to happen. Some of those people will find other careers, but most of them will be motivated less by money than they were earlier in their lives. Most of them will want to remain active. And once a nerd always a nerd, so I think many of them will gravitate to Open Source.

29 October 2005

Clint Adams: Some things are just Mormonic

Steve: I seem to remember that one can write a more functional HTTP server in fewer lines of Z-Shell code. Benjamin: As I understand it, Orson Scott Card is the problem. I'm sure other people can point to examples in his writing which illustrate poor judgment; I will stick to the topic at hand. Orson Scott Card has reportedly expressed his belief that Jake Lloyd is a fine actor. Orscon Scott Card has expressed his wish that Jake Lloyd play Ender in the movie. In case you are reading this with some program that strips hyperlinks (be sure not to miss the changelog for version 1.5.7), I'll remind you that Jake Lloyd is the kid who played Anakin Skywalker in Star Wars: Episode I - The Phantom Menace. If I recall correctly, Mr. Card was relieved to discover the high quality of child acting, because it meant that he wouldn't have to dumb down the story quite so much. I'm almost certain I heard that Peter and Valentine would be dropped entirely. I cannot bear to go on. Finally, the unifying theme between HTTP Server and Orson Scott Card is that, some time ago, Mr. Card attempted to co-author a novel with the Internet. Does anyone have a link for that?

28 October 2005

Erich Schubert: What is Google up to?

Google is expanding it's empire. In fact it's becoming a threat with this big of an influence on public opinion just by being able to effectively "censor" information if they would want to. We need more diversity, IMHO. With the latest rumors - Google Base - it seems that Google will be attacking new markets soon. Google Base could be a big threat to Craigslist and EBay, actually... (from what I've seen of Google Base, I find the phrase "Google wants to host your Databases" overstretches it a bit though...) So what is Google up to? When is Google starting to sell books? Google Talk isn't really big. It seems to be a nice product, but very few people are using it. I've never seen Google advertise it, so it's no wonder most people stick to their established IM/Voice services. But what's the point of it, when they don't adequately promote it? And whats behind that VPN service on their planned WiFi network in SF? Is it about beta testing, maybe? Google obviously wants to run company intranets. Company intranet search engines are a well-known product, and they for sure would like to expand that offer - offer email service, IM/voice, ... From what I've read about their WiFi service, they would be allowed to run e.g. deep packet inspection stuff on it. Combined with Google indexing tech they could test e.g. filtering out pr0n sites. Or test a virus filter. And then offer that product to companies. So is a google firewall coming? More obvious missing products in Googles portfolio are a document management and a customer relations management solution. Or a combination of both. Google base might actually be part of an upcoming document management product by Google, I guess. And, I mean, wouldn't it be obvious for Google to offer a document management (and storage) solution to companies? As for CRM - a google CRM solution combined with their document management and indexing applications would beat any other product: add a user to the CRM and have the related files appear automatically due to google indexing, have the email correspondence added from the company gmail accounts...

Next.

Previous.