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.
卒論
たった今「音楽業界の将来」を題目に卒論を提出した。残りは、数単位分の試験を受けて卒業するだけ。だけ…と言っても、卒論よりそっちの方が怖い。そろそろ勉強し始めなきゃ。
卒論の文章は、大学なんもかも終わってからネットあげるつもり。大半は先週一日で書いたものだから、はずかしいくらいに適当なとこもあるけど、一応な。
ちなみにそれは自分でもちょっとびっくりした。一日で(徹夜して)2万字近く書いた。これで今までの自分の、一日で4千字以上は書けないという限界を越えた。
Szóval
A régi blogmotorom meghalt. Pontosabban még működött, csak épp írni nem tudtam vele. Valamiért azóta, hogy az előző, Pythonos bejegyzést elküldtem, az új bejegyzés admin oldal 403-as hibával kizárt. Majd ha nagyon unatkozom, beimportálgatom a régi bejegyzéseket (úgyis rájuk fért már egy kiadósabb rendezés).
Ahhoz sajnos nem unatkozok (sem nem érdekel már) eléggé, hogy kitartsak a saját írású blogmotor mellett. Bár ki tudja, mit hoz majd a jövő.
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.
PDCA
就活生として面接などでいつも聞かれたことは、学生時代で苦労したこととか挑戦したことだった。たぶん就活講座なんやらにでてる人も、こんな質問に対して準備しなさいと言われるだろう。運がよければその講座で練習する機会もあるかも知れない。
俺は、3回生の夏のインターンを含めて一年以上就活してたと言っていいだろうに、その苦労・挑戦の質問についても散々言われたのに、その中でその質問で会社は何を知ろうとしてるかなど、質問の裏については一切何も教わらなかった。どんな問題に直面したか、そしてどんな対応とったかはいつも中心にあるが、何によって「いい答え」と「微妙な答え」と分けられる?
俺がただ頭が悪いだけかも知れない、ただ自分の答えがたまたま合ってて考えずに済んだので考えなかっただけかも知れないが、先週会社の人と話してそれを知った。
別にどんな問題でもいい。別に対処法が間違ってもいい。PDCAの考え方が見られるだけでいい。経済学部の学生として一応学んだことはあったが、知らない人はウィキでも読んどいて。問題の対処法はつまり、系統的でいい。それだけのこと。
Meglepetés
Tegnap kocsmázni mentem két barátommal, aztán hazafelé megláttunk egy nagyon pici beülős helyet, amit még ők se (akik aztán tényleg nagy kocsmavándorok) ismertek. Ugyan alig fértünk be, azért beültünk egy pohár szakéra.
A két cimborám egy idő után kiment dohányozni az arra kijelölt helységbe egy sráccal, aki egy kicsit utánunk érkezett. Én maradtam a helyemen beszélgetni a többi vendéggel. (Itt következik kb egy órányi említésre nem méltó társalgás.)
A meglepetés akkor ért, amikor hazafelé az egyik barátom megjegyezte, hogy milyen gyenge füve volt a srácnak. Csak néztem. Hogy mi? Japánban most először találkoztam helyi füvessel, és arra aztán legkevésbé sem számítottam, hogy egy ilyen kis hely vécéjében csak úgy előkapja valaki a bongot…
Ilyen is van, ezek szerint. (Bár engem nem érint, mert 1) nem érdekel 2) még ha érdekelne se tudnám valószínűleg megfizetni.)
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).
-
Recent Posts
Tags
ale anime art beer blog clojure code coffee deutsch emo english fansub fest filozófia food gaming gastrovale geek hegymász jlc kaja kultúra language literature live magyar movie másnap politika rant sport suli szolgálati közlemény travel társadalom ubuntu university weather work zene 日本 日本語 百名山 艦これ 軽音-
Recent Posts
Tags
ale anime art beer blog clojure code coffee deutsch emo english fansub fest filozófia food gaming gastrovale geek hegymász jlc kaja kultúra language literature live magyar movie másnap politika rant sport suli szolgálati közlemény travel társadalom ubuntu university weather work zene 日本 日本語 百名山 艦これ 軽音七大陸最高峰チャレンジ