16 May 2011

Chain ring aesthetics

For Knicki, my favorite recumbent bike, I want to buy a 160 mm crank because I hope it will stop make my knees hurt. (I've heard that many recumbent riders find cranks shorter than the normal 170 mm more appropriate.) As a style guide note that I already sprayed Knicki's new rims in a beautiful white:
Sprayed rims for Knicki


I just settled on these Sugino XD cranks:

Now I am looking for a matching 110 mm BCD chain ring with preferably 50 teeth (I also consider 48T ones). Generally I was looking for something as transparent as possible to make the bike look light and slim.

Here's a gallery of what I've found. The first one is from Spécialités T.A. and it was just made to fit the Sugino cranks:
This one's not as transparent as possible but the five surfaces would allow to spray or paint some nice white pattern on.

The next one is from Sugino themselves. The right photo shows it with some cranks and a chain guard as used by Dahon. (I will add a chainguard if the chain falls off as often as it does now.)


And there's another Sugino with flattened edges. The right photo shows how it looks on the cranks, although I will have it as a single ring of course (just didn't find a single photo).

What's really unfortunate is that they don't have it in white. I could get a non-colored one and spray it myself, but it seems hard to cover the edges so well, that the result will look clean. (When I sprayed the rims, some of the lacquer ran underneath the covering tape and left lasting squirts.)

Finally, a wacky design from Blackspire (made in Canada, as the shop says) which also leaves space for painting some small motives.
I made this blog entry so I could look at my options a few times a day and dream of them at night and then decide what to get. I also have to take into account that I have found a German dealer for the first and last ones, but not the two Sugino ones. So it also depends how much I want to go out of my way to make my ride beautiful.

10 May 2011

out of sugar

Today on the S-Bahn I thought of the Firefly Episode Out of Gas (which in itself is a masterpiece of science-fiction which I think you should see...). Also on the S-Bahn I used my “smart” phone to look up recipes for vegan brownies. I had made them before, but I didn't know whether I had kept the recipe and besides it was very handy to look up a recipe and go shopping on my way home, because going home and then back out for shopping would take too much time on a day that was already night.
The first hit on Google seemed like a good recipe and the supermarket had all the ingredients plus some extra walnuts and almond flour which I like in my brownies. In any case, I don't need to buy baking staples because I always have them at home. Well, almost always, actually. At home, I found that I had run out of sugar and the only left-overs were in the sugar portioner for tea.
I also thought that it was just too late to ask the neighbors to borrow me some, so I looked around for replacements and that's where the fun started. I found honey, maple syrup flakes, chocolate powder (which is 50% sugar after all), and raspberry syrup. So I used a fair bit of each plus some cheap Amaretto that I also found while scavenging for sugar. After all I think I still have less sugar in my brownies than the two cups required by the recipe, but I also think that the flavor will be much more interesting!

This experience reminds me that in past epochs of my life I regularly used molasses and sugar beet syrup for baking. Those would probably also have made a good contribution to my recipe.

7 May 2011

strategic jamming (how I just played in the Google code jam)

First, thanks to Stefan Schubert for alerting me to the contest. (Also, many thanks to all people who formed ICPC teams with me back in the good old times. What I did today was based on what I learned with and from you.)

I was surprised that the contest should only take two hours, since I know that in the past, I spent many hours working on problems like those from the code jam. But I actually like that it's so short: it encourages to be prepared for it and allows people who don't have much time to compete without much disadvantage. (Others can spend more time on preparation, but not more time during the contest.) After all, the smartest people often have a lot of different interests and are less likely to spend much time just on one thing, especially when they can produce a good-enuf solution in a rather short time.

So keeping this spirit in mind, I first found out, how many points I would need to advance to the next round and then solve the simplest problem which gets me enuf points. In this case, it was Problem C.

As usually, I solved the problem on paper first, then I wrote the code. Also as usually, I struggled with the input parsing part since Java has so many classes and methods for IO I always forget which one to use. Luckily, I remembered correctly which one to use. (I also tried googling "icpc java parse input" and "code jam java parse input", but none of each gave me any usable hints.)

Finally, I initially found two bugs in my program, the first was actually a bug in my test data, since I had produced an inconsistent input. The other bugs was forgetting two lines of code because I got distracted while writing. I found that bug by adding some debugging output, added the two lines and it the program worked on the sample input given in the problem statement. It also worked on the "small" data set of the contest and then I immediately went ahead and processed the "large" input. Let's see if I made it into the next round ^_^.

Overall it took me about 90 minutes to submit this one problem, not counting the time to log in and find the number of points needed to advance (I just didn't see it on the scoreboard initially) and find the problem that I want to solve. (Although that was pretty easy: I just took a problem that was worth enuf points and had the highest percentage of people who already solved it.)

If I do the next round, I will prepare myself a little by collecting some source code for the IO overhead that I can reuse. Also maybe let myself inspire by some contest-specific programming techniques to be found in example solutions.

Before starting I briefly thought about programming in Haskell, but since I have the some IO troubles there and less online resources to detrouble myself, I stayed with Java. Sure, Haskell is way more fun, but the real fun is solving the problem in one's head and on paper.

There are already more than 10,000 participants (still enuf time for more people to join) over 1,400 of which have solved all four problems. The fastest one used only 40 minutes for all four problems!! So I guess when the contest becomes serious and only the 1,000 best participants advance, it won't be for me any more.

Update: I did indeed make it into the next round. In fact, I am among the best 11,000 participants out of 18,000, which means I left 7,000 other very smart participants behind! In case you want to follow me in the next round, my handle is bob406.

2 May 2011

Kommt ihr süßen Träume

Zur Auflockerung hier ein kleines Gedicht:

Was macht schön und munter und lindert Allergie?
Was schlägt jede Medizin und verfehlt die Wirkung nie?
Ach, was gibt es schöneres .... als Schlaftherapie.