#programming

all tags: japanese[44] kanji[21] education[19] travel[18] MYJ15[13] programming[9] website[7] linux[7] hardware[6] NII17[5] research[5] libertine[5] food[4] misc[4] time[2] games[2] movies[2] parkour[2] rant[2] self-reflection[2] manga[1] speedcubing[1] anime[1] books[1] translation[1] lego[1]

国立情報学研究所〔四〕

Month four — one thrid left; review:

Anki ok. Sport insufficient. Here's the interesting stuff:

  • general
    • 餃子 and stuff from オリジン found their way into my food routine
    • helped a crying little boy out in the street find his mum
    • witnessed the following manifestation of cuteness:
      3 small kids, two of them in bear costumes, waiting for the train with their mum
      announcement for the next train to come in a few minutes: 「...。この電車は10両です。」
      kids: 「10秒?10!9!8!...」
      but there was no train when they reached 0. :'D
    • was stopped by police for riding my bike at night without a light (mount is loose, I support it w/ rubber bands, that day the bands ripped on my way to work so I put they light in my bag); they were extremely nice — had a good chat
    • got the Dogen approved verification that my Japanese it about as good as that of a native first grader — was asked 「長いんですか?日本は」 by abovementioned policemen and the next day when getting my hair cut :3
    • saw a performance of the 東京都立青梅総合高等学校 和太鼓部 which was awesome
    • spent almost a week in Kyōto and two nights in Nagoya
    • the local sentō had a "chocolate bath" (cacao butter mixed into the water) around valentine's day which was geat ^_^
    • saw a few people from Matsuyama again while they were in Tōkyō
    • a bug I found* in Pokemon GO got some coverage by blogs/YouTube channels
      following how the story spread from a dedicated subreddit to more and more general sites was quite interesting — especially low effort "news posts" that got things wrong were amusing
      (*to be precise I found something that works on some devices and a fellow redditor found a variation that works on all devices)
  • at the institute
    • the conceptual stuff I mentioned last time is finally done and got some good feedback
    • was able to integrate learning a few neat new Flask related things into my work
    • stumbled upon a PhD thesis titled The Presentation of Self on a Decentralised Web — can I please take a week off from life and explore this?
    • got into and am getting back out of eating dinner somewhere close to work to then head back and work some more
    • the elevators say 「おはようございます」 at 8:26 a.m. — so maybe the interval is from 8 to 9?

Good times. More.

On to the next month!

国立情報学研究所〔三〕

Month three — halfway through; another review:

Anki wasn't that great (stats) but at least still better than in the first month — and I finally got around doing some badly needed maintenance on my deck. Apart from Japanese study, slow but steady progress across the board. Nothing to complain. :)

Again, an attempt to convince myself that I'm actually making good use of my time here:

  • general
    • was at a sentō on christmas eve; on the way back I heard a girl's voice from a near high-rise building 「サンタ様ー!来てくださーい!」 :3
    • was shocked to learn that Japan introduced compulsory wearing of seat belts for rear passangers in 2008 and there's no penalty for non expressway roads °_°
    • rode my bycicle to work, passed a ママチャリ and thought I heard a 「ウゥウゥウイッ!地震です!」 — but there was a kid on the back of the ママチャリ gaming away on some handheld console so I could've misheard some game sounds. Stopped anyway to see what happens — nothing happened so I concluded it was some game. Turned out it actually was an earthquake alarm.
    • saw the last Jedi
    • was in Niigata
    • had a very Japanese New Year with 紅白, 年越しそば, 雑煮, 初詣 and 駅伝 — sneaked in a German tradition with Dinner for One
    • watched the entire かるた名人・クイーン戦 live on ニコ動
    • visited the Tokyo Saitama flood prevention underground thingy
    • I'm finally getting back into sports after a 5 month break due to an injury
  • at the institute
    • had a bit of fun with face recognition and line detection (OCR)
    • doing a lot of very conceptual work at the moment
    • the elevetors sometimes say 「お待たせしました」 and 「どうぞお乗りください」

All in all, satisfactory. Oh and the constant feeling that I could/should do more is gone. (:

On to the next month!

国立情報学研究所〔二〕

Month two of only six this time; another review:

I did better with Anki this month (stats); even managed to stoll through 神保町, grab a second hand book (日本語雑記帳) and read from time to time. Still ... my deck needs some maintenance, I want to add more new vocab, read more, etc. I took part in events, explored new places and worked a bit on personal projects. Still ... I feel I could do more. Maybe being aware that there's soo much going on around me constantly, resutls in a fear of missing out on great chances. But it's not just that. Regardless of the specifics of what's going on around me, I'd like to do more — more than I currently can do with the limited amount of productive time per day. On the bright side, that's a least better than not knowing what to do with myself.

Again, a collection of noteworthy and/or random things:

  • general
    • the 漢字ミュージアム in Kyōto is nice — you can do mini 漢検 samples
      (I seem to be able to pass 6級 and 5級, but 4級 and 3級 were so so)
    • ゲームマーケット2017秋 had a real life Catan trading and in general was super fun
    • Agricola seems to be popular among board game enthusiasts here
      (a local meetup I attended was almost exclusively Agricola, played one round)
    • at ポタフェス2017 I was able to experience the Sennheiser HE 1
      (kind of ... didn't have the time to really choose music, was in a noisy environment, etc.)
    • Open Space 2017 at the NTT ICC was good fun
    • CJK Unicode shenanigans
  • at the institute
    • wrote a small flask web application that is now used in production, hosted by the NII
    • the elevators don't say 「本日はご苦労様でした」 when you get out way after 5 p.m.
    • the elevators say 「おはようございます」 at 8:50 a.m. — need further data to estimate a time frame for that
    • attended NTCIR 13 sporadically; chatted with some Yahoo! guys

All in all, a lot of good stuff. But MOAR WANT. TOO MUCH WANT.

On to the next month!

国立情報学研究所〔一〕

> On to the ... oh wait. :(
NEXT MONTH!

I'm back to Japan. First month passed. Assembling the bits and pieces of a functioning everyday life. :)
Register as a resident, set up a bank account, get a bicycle, find a supermarket to frequent, get a feeling for monthly costs and how much you can spend on what, connect with new people, ... I have the feeling I'm almost set up. One of the few things I have yet to manage is get into a stable Anki routine. I've been powering through over 300 cards today to finally get back to 0 after a meager 14/30 days studied since I arrived.

A collection of noteworthy and/or random things:

  • general
  • at the institute
    • the day after my arrival I got my scholarship for several months in cash. Having the equivalent of about 4.5k € in cash lying around made me kind of paranoid and sped up the process of me getting a bank account.
    • Mac and Windows users are required to install Sophos Anti Virus. Linux users are left in peace :3
    • overhearing other grad students talk about and plan their "first time in Japan" adventures is entertaining
    • the elevators say 「本日はご苦労様でした」 when you get out on the first floor after 5 p.m.
    • cafeteria lunch is tasty

All in all, I'm quite satisfied. The only thing that kind of bothers me is the lack of any easily quantifiable progress with my Japanese. I pick up and write down new words and phrases, but constantly being behind with my Anki studies prevented me from integrating them into my deck. Oh and also ... my Kindle app won't let me log into my German account so I can't access the Japanese book I was reading back in Germany. -.-

Anyway, the few things to complain about are mostly harmless, soo ...

On to the next month!

Six months at the 国立情報学研究所

About a year ago I came back to Germany after spending one year in Japan. Now I'm going again — for six months. :)

Last time I went as an exchange student. This time I got into an internship program for Ph.D. and Master students at the National Institute of Informatics. — i.e. this time I'm actually doing something related to my studies (my exchange university last time had no computer science courses).

Another major difference is that this time I had to organize accommodation by myself. Find a place to live in Tokyo — what a nice ex ante adventure, yay ᕕ( ᐛ )ᕗ. What I knew from the beginning is that I would search for a room in a share house. I had previously made good experiences with share houses in Japan, knew that it would be cheaper, save me the hassle of having to buy a gazillion every day life items for just half a year and get rid of them afterwards, and knowing that I might end up speaking primarily English at work, a share house with Japanese people would up my chances of having extended conversations in Japanese on a daily basis.
So, I started searching on roomshare.jp and roommate.jp, took a brief glimpse at non-shared flats on グッドマンスリー only to be scared away by the prices, and finally found something at ひつじ不動産. Given what I wanted — something not too far from work, not too expensive, where I could let someone stay at my place for a night or two, where thery're okay with someone who's guaranteed to leave after 6 months and on top of all that where a foreigner is able to sign a contract without a Japanese guarantor — I'm super happy with the place I found. :)
Additionally the countless mails back and forth until I found the place, the deal was sealed and all the details were discussed were quite the 敬語 boot camp. orz

Anyway, preparations are as good as done. Journey starts Oct 17th. Updates will be tagged #NII17. :)

松山大学〔七〕

Seven months in Japan; another review:

As I predicted in my previous post I enjoyed an extensive downtime to recharge. :) No traveling, no big events, just lazy day-to-day life. Coming monday lectures will start again; leaving me with less free time, but more externally enforced structure.

In any case, the trip I was in the midst of last post ended without any trouble and was definitely worth it. Good experiences, nice memories and I was able to tick off some new prefectures in the projects section (never underestimate the motivational power of lists ^_^').

In the time after the trip occupied myself with geocaching, parkour training, meeting friends and making new acquaintances. I also felt the desire to do something techy again. After about 4 months of “abstinence“ I tinkered a bit with my anilist client, peaked into the realm of polyglots, — and also aside from tech I invested some time in areas of interest where it seemed long overdue. I guess I kind of dialed down the feeling guilty whenever I sink time into stuff that isn't in any way helping with my Japanese. Good thing.

On to the next month!

Rebuilt in Python

I rebuilt the page with Python, Markdown, and Jinja2.

The code should be a lot cleaner and for me it's more comfortable to type pages and blog entries in Markdown. There are still a few things to sort out but the current state seems presentable. :3

2015-01-26

JSONProxy

Before I begin with what this is actually about, some words for those who aren't familiar with AniDB, MyAnimelist, XDCC-Bots or at least one of those:
AniDB and MyAnimelist are both websites that let you create a list of anime titles. In the case of AniDB the focus lies on the anime episodes you have stored somewhere, MyAnimelist cares more about what episodes you saw.
XDCC bots are IRC bots that send you files on demand. They are a common distribution method for fansubbed anime and offer so called packlists, where the list all the files they offer.

Now to the real story: I'm a user of both AniDB and MyAnimelist, but I only maintain a list on the latter. I use AniDB of keeping up to date with newly released episodes of airing series. The problem is, that if you only want to see notifies for new releases of certain subgroups, you have to add episodes of the respective anime from that subgroup to your list. I, however, don't maintain a list on that site, so I'd get a ton of unnecessary notifies.

Now, since I get all my new episodes from XDCC bots I though I could make use of simply parsing their packlists, which was the first thing I did: write a JSON file with all neccessary info, a small PHP script to parse the packlist and a minimalistic site to display the output. With that I always had an up to date list of all released episodes of the series I watch and only from the subgroup I want them from.
The problem with that approach was, that I had to memorize the number of the last episode I saw for every of those anime. So I had to come up with something different. Since MyAnimelist always has the information on which episode of which anime I watched last it seemed natural to use that. Also, since I open the page with my list on it several times a day, it seemed to be a good idea to simply include the information about new episodes there.

So I wanted to write a userscript that should obtain the information from both my JSON file and the packlists, look at the site itself and, if there were any episodes released that I hadn't seen, inform me about that ... well, same origin policy says no. The userscript is written in JavaScript and common browsers won't let it perform an XMLHttpRequest for stuff stored on other servers than the one the site you are viewing when the script is executed is hosted on.
I had to find a workaround and I though of JSONP, a method where you create a new script tag in the head of the site with the remote thing you want to access as the src attribute of that tag. Problem is, that remote thing should be a string with a JavaScript method call, so that you actually can use what you got from the remote server. But I wanted to access packlists I had no control over. It then came to my mind, that I simply could write a PHP script that would access and parse the packlist and return a JSONP string — a JSONP proxy you could say. ^^ And then access this with my userscript.

This is what I ended up doning. :) My JSONProxy parses packlists based on my listing of urls, titles and subgroups and my userscript (actual code) uses that to inform me about new episodes. :3

I guess it would be quite easy to write a universal JSONProxy which takes a get parameter (the url to the document one wants to access) and returns a JavaScript method call with the whole site as a parameter. What I'm not sure about is, wether or not there are regulations on the src attribute of script tags and how messy the escaping of whole websites for the JS method call would get. ^^
Oh and by the way: since the actual request to the site you do not control (in my case the packlists) is not performed by the browser the JS is running on but by the PHP script on your server this method doesn't even violate the same origin policy more than JSONP itself — it's just a handy way to access data from other servers when you write userscripts. :)

2012-07-19

VZ Netzwerke message backup

A few days ago I read that the VZ Netzwerke (a group of dying social networks once popular in Germany) will be renamed to or restarted as idpool. Reading about those networks alone reminded me that ever since I stopped using them I wanted to backup all my messages. Hearing that the platform will be undergoing serious change some time soon made me take immediate action.

I wrote a Perl script to extract the messages and store them in json-files. To view the messages I wrote a simple web interface in PHP.
I ran into some problems with SSL connections which is why the script uses a session ID instead of an e-mail address and password as a launch parameter. Additionally, when dealing with large amounts of messages the script decided to freeze after a certain amount of parsed messages, so I wrote a second version using threads to parse messages and in case they freeze simply parse the message again. This second version, however, is painfully slow because of my crappy implementation — but since it does a job that only has to be done once I'm fine with that. :D

Concerning the web interface one thing was very important for me: having messages and answers that belong together being displayed at the same place. A thing that the VZ Netzwerke never offered, you only have your in- and outbox. Separated. Absolutely terrible if you want to read an old conversation again. So ... my web interface shows all messages to and from a person at one place. : )

In case you'd like to backup your messages too, here you go: vz_messageparser.tar.gz
Run perl vzmp.pl studi|schueler|mein <sessid> (use vmzp_crap.pl if neccessary) and view the index.php (webserver required ofc) as soon as the script finished.

Here is a video showing how it works.

2012-06-14