rblog

Switch-case statement in Phyton

I’m not all that familiar with Phyton, but since Jython ,which is the Java implementation of Phyton, is the preferred scripting language for WebSphere I do need to dive into it now and then. Today I needed to check if input parameter to a script was equal to a given value, then check a property file for the corresponding key/value pair. If key/value pair not present then check if the common default value where there. If if all is false, then just break out of the script.

As you might have figured out this will get a bit messy, so I thought that maybe a switch-case statement could help me out to make it a bit cleaner. First I found this article at Bytebaker switch-case-statement-in-python showing a “fake” implementation of swich-case, since it turns out that Phyton does not have this functionality. “Yes!!!”, but then it turned out no…I read the comments to the post and at the end found the follow-up article “Switch-case statement in Python revisited“. So back to square one again…

Kiwi – not a good idea

At work we get a fruit basket twice a week. The past few weeks they have added a lot of kiwis which is a good idea in theory since kiwi is very good…but in real life at work, not such a good idea. We get a few plastic tools to help us eat the fruit, but it is not as sharp as a real knife making it impossible to peel the kiwi. And eating it with the spoon…did not turn out as I had hoped. Luckily I am an experienced kiwi eater so I had a paper towel underneath, but still, look at the result

Fire drill at work – what a lovely day!

When I was about to enter the building and go down to the locker room today I was a bit surprised since so many people where on their way out. Realized fast what is was since there where some of them where walking around with reflective vests. So I just had to turn around and go out and enjoy the sun. Good thing, since I then had time to do some stretching as well. Played around with my cell phone in the nice weather, took pictures of all the people outside, me in the sun, my new mtb shoes in the sun, people walking in to the building in the sun. Not the worst thing that could happen 🙂

Worn out bike chain

Had a puncture yesterday on my way to work, just to realize that the tool I needed to loosen the back wheel was at home. So I had to take the subway home in order to fix it. After I had fixed the puncture I then as always had to fasten the tension seeker. Realized then that the chain now is almost totally worn out, as you can see on the picture there is almost no more possibility to create tension to the chain. All this in just about 5 months of use, that includes paternity leave and holiday. Might need to buy better quality?

To see the history of my chain, from when I mounted it and maintenance during the summer, click here