#programming

all tags: japanese[49] education[23] travel[22] kanji[21] programming[14] MYJ15[13] NII17[9] research[9] website[8] linux[7] hardware[6] 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] i18n/l10n[1]

国立情報学研究所〔八〕

Month eight — second to last. D:

The runway lights back home are already switching on — one by one.

Some better balanced I/O compared to last time:

  • general
    • was able to take a week off to show my family around here in Tokyo
    • had a peek into an interesting enthusiasts' sphere at the HHKB user meetup vol.2
    • spent the good part of a day in 横浜 and 川越
    • rode crazy rollercoasters at Fuji-Q Highland
    • got a Vortex CORE — wasn't able to find a nice case/sleeve/transport option yet, thorugh
  • at the institute
    • things are going at a reasonable pace again after last month's "spurt before the deadline"
    • slowly getting more used to bending my work to external requests/compatibility requirements

All in all this month felt like a prolonged transition from just being in Japan, over doing some stuff before it's too late to already on my way back.

On to the last month!

国立情報学研究所〔七〕

Month seven — two more to go. Quick review:

This month felt a bit packed. A lot of nice output and interesting input though. So all in all good progress — I only wish there was more time to get hyped about upcoming and let sink in recently experienced stuff.

Anyway, I/O:

  • general
    • saw 琵琶湖 and 近江神宮
    • got out a new chapter of my うぶんちゅ! translation
    • was at ニコニコ超会議2018 — for work, actually; kind of
    • attended ゲームマーケット and COMITIA
    • had a great time at the Tokyo Mechanical Keyboard Meetup Vol. 4
  • at the institute
    • writing businessy e-mails in Japanese gets easier and easier
    • was working on and with two web applications that more or less are the backend for a larger project which had to reach a presentable state until today. The whole thing having several interdependent people, parts and working steps involved and being interdisciplinary is interesting, really. But it's also waaay more draining that just building something on your own.

Hoping for some less I/O heavy times in the coming days.

On to the next month!

国立情報学研究所〔六〕

Month six — two thrids done; one to go.

Going by the initial schedule this would've been my fifth day back in Germany. Glad I still have time to enjoy Japan now that it's finally not cold anymore. Maybe it'll be sick of the heat and humidity in July making it easier to go. ^_^

As always, stuff happened:

  • general
    • bought a 座椅子
    • enjoyed a sunny Saturday in 隅田公園, sitting on a stone wall reading a book, and saw three old ladies looking for somewhere to sit, so moved a bit to the side. Continuing my book I was handed a piece of 唐揚げ, two pieces of sushi and a some 和菓子 — no small talk or questions, just 「はい。昼ご飯です。」. :'D
    • started making my own 弁当 as a change to caffeteria food
    • visited かなまら祭り which was great fun
    • was able to see some of the people that, through their videos, introduced me to Japan before I came here the first time over two years ago, irl at a YouTube hanami
    • lots of nice new people at the share house
    • had my first 馬刺し — tasty :)
  • at the institute
    • started developing a piece of software that interacts with an application being developed by an external developer — both projects being in a prototype phase and the whole thing being orchestrated by my superviser. As a result I'm reading and writing a lot of Japanese e-mails — more 敬語 practice. orz

On to the next month!

国立情報学研究所〔五〕

Month five of six nine!

Anki was not bad; sport very much insufficient; most importantly though my stay got extended by 3 months. :) Time to take a step back, shake off the oh no I'm leaving in a few weeks mindset and take a deep breath. :3

Anyway, here's the listy thing:

  • general
    • went to a meetup for people interested in i18n/l10n innovations and found myself walking up to a nice reception lady in front of a room with classic music playing and not a single person not wearing a suit in it — until I entered, that is. After reassurance of the event's host that this is a casual get-together, an immensely butchered self introduction to the group from my side, free Dr. Pepper and some interesting presentations, the following 懇親会 was great though. Exchanged a lot of 名刺 and had good conversations with the folks there
    • had my frist proper VR experience (as in not just a headset) in the form of a planetarium / VR attraction using a Japanese VR system called ABAL
    • watched Stranger Things, ちはやふる -結び- and way too much AoE2 videos on YouTube
    • finally did some geocaching in the area where I'm living currently
  • at the institute
    • diving deep into linked data stuff lately (if someone knows how to configure a few arbitrary* inference rules for data stored and accessed through a Fuseki 3.6 instance PLEASE tell me)
      *meaning not just RDFS or OWL statements
    • arranged my workspace as a standing desk (very improvised but it works)

On to the not last month!

Mixed language content

A few days ago I was wasting a few seconds on Facebook, scrolling down the newsfeed, and was suprised to see a short Japanese post, 「残念だな」, by someone I was pretty sure doesn't know Japanese. Upon closer inspection it turned out Facebook had translated their German post into the language my account is set to display. This made me very aware — for a moment — that the fact in which language something is written carries information. Why did they suddenly post in Japanese? (Well ... they didn't.)
If, let's say, a Chinese acquaintance of whom I know that they don't know any German sent me birthday whishes in German, then they went through the trouble of goolging for German birthday whishes, using Google Translate or asking someone. In a similar fashion I report of elevators saying 「本日はご苦労様でした」 at my lab — because they do so in Japanese. Other times using a word from another language is just more concise and feels more accurate. Instead of talking about "a type of bicycle with a front basked often used by mothers" or leaving out information and just writing "bicycle" I name the thing by its name and say 「ママチャリ」.

The obvious problem with this is that my recent blog posts only really make sense to people that can read English and — at least some — Japanese. This made me think about working with Accept-Language headers. Just parse what a user's browser tells me about their language capabilities and display content accordingly.

To figure out how I'd go about the display content accordingly part I googled "mixed language web content" and similar things. This yielded a lot of SEO articles saying DON'T!, a few W3C resources on how to mark and style parts of text depending on language and even an interesting looking book titled Language Mixing and Code-Switching in Writing. No solution though for my balancing act between information/authenticity and audience/intelligibility.

So, I played around myself and came up with this: ← if your browser tells me you understand Japanese you will just see 「例」, otherwise the word will have a grey-ish background and when you hover over it, it will display "example".
Best thing about them? They're purely done in CSS. :3 (See the code here.) On the server side of things it gets a little bit unaesthetic — sadly. I maintain the contents of this website in Markdown and extra stuff is added in after parsing. For mixed language strings I use the following construct <‌!-- mixlang:例:example -->. Not quite as concise as e.g. Markdown links but well ... HTML comments go through the parser untouched and then I built my small <span> matryoshkas. Writing a Markdown extention would be an alternative but I don't have the time for looking into that right now.

By the time this post goes live I will have gone through my backlog of posts and added in optional English translation for all non English strings. レンジでgood!

国立情報学研究所〔四〕

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