Tag: english

The failure of Microsoft

OneDrive

Just earlier someone linked the news from Verge that MS was forced to rename SkyDrive due to trademark problems with the British Sky media brand. This could only be better if they were also sued by Google over the “drive” word (cf Google Drive).


GTK3 red to green progress bar in Python

I really needed a progress bar that changes from red to green as it progresses. Well, I made one. Though it doesn’t support labels as the built-in GTK ProgressBar, one can easily be added next to the bar, or (if it’s static) in a tooltip. Also, not removing self.bar would result in an actual red-to-green gradient, instead of a color-changing bar. (Though it should still be removed when the bar is reset.)


Reordering elements in a GTK Menu

Recently I’ve had the pleasure to play around with GTK from Python while working on a (by now not so) little app for KanColle. (Since that last update on github I’ve rewritten the whole thing from scratch, but that’s not the point now.) On the way, I encountered a quite annoying problem: the reorder_child method for gtk.Menu just doesn’t work. I use Python 2.7, gtk.gtk_version says that’s 2.24.20, and gtk.pygtk_version is 2.24.0.


#nowplaying button for the Ubuntu sound menu

Every now and then I get this urge to just post a #nowplaying tweet, and at such a time it’s always such a drag to type it in manually. So I thought I’d make a menu item in the Ubuntu sound menu that sends such a tweet automatically. It turned out not to be all so easy at all…


Coffee

Just now I found this nice infographic about the average coffee consumption around the world on facebook, and I just had to check how I’m faring.

Current Worldwide Annual Coffee Consumption per capita


Python dict lambda mapping fun

Just now I had to insert a certain dictionary variable into a database, and i wanted to use sqlite’s named placeholder scheme to make things simple.
self.cur.executemany('insert into mytable(id, name, field1, field2) values(:id, :name, :foo, :bar)',data)
Now the problem was that this dict called data didn’t have keys “foo” and “bar”: {'id': 1, 'name': u'name', 'keys': [1, 2]}.
I’d need to map this into the shape of {'id': 1, 'name': u'name', 'foo':1, 'bar':2} to use in the database query. Also, i wanted to keep the whole thing in a single command for reasons unknown. In the end, I came up with the following: map(lambda y: y.update({'foo':y['keys'][0], 'bar':y.pop(u'keys')[1]}) or y, data)
This did the trick. What it does: updates y with the ‘foo’ key as needed, then adds the ‘bar’ key as well, while popping off the unnecessary ‘keys’ key. The “or y” needs to be there, because dict.update returns None, not the dict object.


The Theory of Everything

I really loved Ayreon’s 01011001. It was such an overwhelming experience with great musical execution of deep topics. After songs like Connect the Dots, i guess it’s understandable that I had high expectations for The Theory of Everything.

While there are 42 songs in total on the two discs (what a smart answer that is to life, the universe and everything), the almost-two hours of progressive metal left me without any real impressions. It was there – it was playing – then it was over. Lucassen himself said that it was meant to be “less heavy and more instrumental than 01011001” and sure it is much more instrumental. My problem is that if you want to thin out the overwhelming lyrical depth that characterized Y (01011001 is the code for Y) and make it “more instrumental” then there would be a need to replace that attractive force with something on the instrumental side. That is something that the Theory of Everything fails to do.

It’s still a good prog metal album, but it is nothing compared to Y.


Starbucks Christmas

Today i went to grab my dose of coffee for the coming ~10 days at the local Starbucks, and the whole place’s already in full Christmas mood. I got a sample of their Christmas blend and some “cranberry bliss bar” cookie, with encouraging introduction from the barista girl saying they match really well because of their cinnamon spiciness.

I was a bit confused at first about the “spicy” part when i actually put the samples to the test, since the coffee had a really nice, sweet berry-like aroma, supplemented by a warm and smooth (and indeed with a tint of cinnamon) taste. However, the real wonder came when i munched down the cookie bit too: the two together turned into the all-so-familiar (and all-so-missed) taste of mince pie.

I even considered actually buying a bigger dose of the duo then and there, but alas, i’m not well-off enough to pay 300 yen for a single slice of cookie (and i was buying the beans anyway, though of the espresso Christmas roast).


Guess what

Welcome to our regular post-Ubuntu update rant. I’m a bit disappointed that i have to write one like this again, especially since i haven’t logged on to Ubuntu for quite a while after the update came out (i stayed on Windows to play League). And even with the extra time, there were problems present.


Driving licence

So, on the third try, i (miraculously) got it. I really have no idea how could i pass now and got failed the last time, considering i honestly did horrible this time (messed up one of the sharp turns and put out the turn signal too late once).

My conclusion is that it depends totally on the examiner. It doesn’t matter if you do perfectly (or as close as one can get to perfect), if they want to fail you, they will. On the other hand, if you get a nice guy (or just one who isn’t dead set on failing you) then you can make mistakes and still pass.

My case as a prime example.