Friday, June 17, 2011

Japanese on Android again

I've already discussed the superb aedict before, (twice in fact) and my frustration at its stroke-order-dependent kanji recognition. In my second post I also talked about AnkiDroid and  a new Japanese/Chinese handwriting IME.

I had great hopes for that IME, but after trying out several versions of it as it is released, support for Japanese still seems weak.

In the meantime, I came across WWWJDIC and Kanji Recogniser for the Android by Nikolay Elenkov. At first I wasn't impressed, since the dictionary requires connection to the internet, unlike aedict. However, I've gotten good use out of its slightly less picky kanji recognition, and I often switch between WWWJDIC and aedict while reading through a book when I come across a particularly mysterious or easier-to-draw-than-decompose-into-radicals type of kanji.

It isn't perfect, but its another option when I come across a particularly difficult character, and I don't have to bookmark so many words to wait until I can ask my wife!

Ankidroid has come into its own too, with sync fully supported, and even the ability to add cards. I would finally consider ankidroid to be a useable app, and it was very useful today, as I was left waiting for nigh on an hour at a blood donation centre. Now I can redeem at least some of my wasted time with Japanese knowledge!

Tuesday, April 19, 2011

Feeding a Baby Japanese advice...

Putting the events of the last month aside for the moment, I was reminded the other day of the strange discrepancies between the Japanese and English health advice.

My wife told me a story of one Japanese housewife in Italy, who had a bit of a barney with their husband over whether their child should eat pasta, but there are quite a few differences between advice between countries.

The one that strikes me most is the difference in opinion over meat in the UK versus Japan. The NHS states meat, including pork, beef and lamb as excellent sources of protein, whereas the Sakaide city office guidelines maintain you should refrain from all but chicken until ~9 months, and ham until 1 year. The NHS also recommends cow's milk as an option, whereas this is considered dubious until about 1 year in Japan*.

Of course, there are a lot of points in agreement: No honey, no nuts, etc. But I think its good to be aware of the different advice.

That said, I've not gotten into a fight over my baby's dinner yet..

*Specifically, they mention the milk should be thoroughly cooked/boiled before consumption

Wednesday, March 16, 2011

Sendai situation

As you'll be aware Sendai city in Miyagi prefecture was one of the first cities to experience the tsunami. Luckily for many of the residents, the city is located several kilometres inland, and I think only about half of the city was inundated.

I mentioned one blogger in the stricken city in my post a couple of days ago. In his latest post, he gives a good sense of the situation in his area. He starts off by once again thanking those who have contacted him to check he is OK.

I think Miyagi prefecture will continue down a hard road, but however many years, however many decades are needed, it will -like a phoenix- rise again. I really feel in my heart that the whole of Japan, indeed the whole of the world is supporting us.

He goes on to say how they re-opened their shop on the 14th, and they almost instantly sold out. He's got some pictures to illustrate this too, so do check the link above. Here's an extract in English:

On the 14th, we opened up the shop for the first time since the disaster. Then, in the time it takes to say "Ah!" we sold out. We'd completely forgotten to check we had enough provisions for ourself, but we've got rice, and we'll manage somehow, so I've not felt too discouraged.
A lot of  people who came for water also bought some sake to say thanks. There were others who would thank us with tears streaming down their face, and I too couldn't help letting out some tears... But we encouraged each other to stand firm... There were so many people who came to our usually quiet shop.

He also says some people also bought some candles, so presumably (and, I guess, unsurprisingly) there are still large areas of Sendai without electricity. One visitor said they were staying with friends due to damage to their apartment block. But what he says next is probably most interesting:

Then, a middle-aged couple from the Arahama town of Wakabayashi ward, and a taxi driver from Yuriage, Natori stopped by the shop, and bought some sake. "I keep recalling such terrible scenes... I hope the sake will help me forget...", he said, and laughed feebly...
The one's we were most worried about, our family in Yogasakihama, Miyagi district, had the tsunami roll right over them, but miraculously they all got to a shelter unharmed, it seems. Their house is completely washed away, but just that they still have their lives, we're thanking our ancestors.

Some pretty moving stuff, I think. But the amazing thing is, if you look at the kinds of places he talks about, they're all right next to the sea. Places that have been totally annihilated. My wife points out that a lot of people were likely to have been at work when the tsunami hit, and thus further inland... I think a lot of lives may have been saved just by virtue of the calamity occurring on a weekday.

In any case, the picture on the ground seems to be one of calm -albeit saddened- determination to see things set right once more.

Tuesday, March 15, 2011

Fukushima Daiichi plant abandons use of helicopters

According to NHK news (see this news article), plans to refill the pool of reactor 4 with helicopters have been abandoned. According to the article: "the method of using helicopters would be too difficult"

Apparently, the hole blasted by the explosion earlier was several metres away from the pool, so it wouldn't be possible to dump water through the hole into the pool. The possibility of only small quantities of water being carried was also cited as a reason for abandoning the plan.

Monday, March 14, 2011

Unbelievable Account of the Japan Earthquake

I just found this blog post. If you skip down beyond the garish pictures you'll find an incredible, first-hand account of what happened to someone working in the Wakabayashi ward of Sendai. Perhaps more amazing is what happened to her son, who went out to sea after the earthquake, to save their boat from being smashed, evidently unaware of the scale of the unfolding disaster. I've done a tentative translation of the whole article:

11 march

I was in a meeting concerning working over the weekend in the afternoon, on the 3rd floor of my workplace in Sendai city’s Wakabayashi-ward. There was a loose rocking, and just as I say “Oh, an earthquake...?” the shaking became very violent. My superiors shouted out “Everyone sit down! Keep your heads down!”. Amongst the screams, I tightly grasped the hand of one of the girls I get on with, and we crouched down.

Our superiors held us too, shielding our shoulders, as around us the shaking failed to die down. Machines fell over, glass smashed, and a flatcar rampaged on its casters. Then the power went out. As things quietened down, we dashed out to take refuge in the parking area, and there were many aftershocks.

Once, I tried to get to the locker room, but the lockers were a complete wreck. I got into my car to drive home, but the traffic was completely jammed. My phone wouldn’t connect. Even in my car there were numerous aftershocks. The traffic lights were all out, so I forced the car through the traffic to get home. On the way, I got a mail from my oldest son, who lives in Soma, Fukushima:

“House in Soma a mess. I’m going to put the boat out to see now. Anyway, I’ve no injuries. Chiiko and Shoko are taking refuge. Taka is also fine, it seems. That’s all for now.”

For the time being, I was relieved.

First I went to the nursery to pick up my daughter, then leaving my car at home, I went to the school on foot to pick up my second son. Both of them had not even a slight injury, and were fine... But I couldn’t get through to my husband. We waited in the car in the parking space by our house for him to come back, and just as it looked like night was coming, he arrived. Everyone in the family was safe.

But then the news came in: The beach area of Soma had been completely destroyed in the tsunami.

I’d heard Chiiko and Shoko had fled, but my eldest was putting the boat out to sea to protect it with his uncle. After that I couldn’t get through to them. I could let out nothing but tears. I was so worried. I thought that to have your own son die before you was the worst thing a parent could allow to happen, and so I couldn’t stop crying.

And then, I was able to get through. He told me they’d returned safely, and I cried again in relief.

He and his uncle headed out to the tsunami, and as they approached the summit of the wave, their engine cut out. On passing over the wave, it started again and they came down from the top of the wave... Apparently, this happened many times.

Once the tsunami passed, they returned to the beach...

They say that it was a mountain of rubble and bodies. They had to walk over all this to get to the shelter... My husband’s mum and grandmother where swallowed by the wave, but somehow were rescued. My parents, sister, nephews and nieces are all alive.

At this time, so many people have contacted, worrying about me. I don’t have all your real names, but there is a staggering number.

Here is a list of my internet acquaintance’s:

[list of names of people who have contacted]

If these people are able to see my situation in this article, then I’m truly happy. My husband’s family home has disappeared without a trace.

The fight starts from here. I’ll do whatever I can! And at the end, a new wind is revolving. I’m thankful to the courage that got me in touch.

From Mizuho

It seems totally unbelievable. I can't imagine what it must have been like to try and approach that tsunami head on.

Sunday, March 13, 2011

What the Japanese think of the Earthquake

The BBC, like all good media, is prone to a bit of fear-mongering, and it struck me a lot watching the news of how the people of Japan are alternatively portrayed as "in fear of what is to come" and "dealing with the situation calmly". It seemed a bit strange to me, so I thought I'd see what the Japanese are actually thinking right now..

Firstly, of course I asked my wife (she's far quicker than my little netbook, shame she doesn't fit in my rucksack), and she said her family weren't particularly worried about the situation, least of all her father, whom I suspect is annoyed by the lack of any of his favourite TV dramas...

After a brief* look at paints a pretty good picture. Starting with Tokyo-based blogs there are so many blogs giving out advice to fellow countrymen, or just encouragement. There is also a lot of blogs mirroring what I've been hearing on the TV: stores in Tokyo are being completely cleared out by anxious shoppers making sure they are prepared. In some places it appears people are even having trouble getting hold of toilet paper, let alone rice. That said, there are some blogs which have just carried on as though nothing happened, more troubled about their relationships than the fate of the nuclear reactors just a few prefectures away. But, such is the human condition, I guess.

Focusing in on blogs closer to where most of the damage was done in Miyagi prefecture inevitably paints a darker picture. Though many blogs in this area have only just restarted as power finally comes back online. There are many which are just short posts (along this lines of "don't worry, I'm alive"), but a fair few with stories to tell.

One blogger tells of the situation in his town in Miyagi. Like many I've found, though somewhat surreal, he starts off by apologising for worrying everyone. He continues to describe how he has adapted:
The water is back on, but the gas is still down. I've phoned all my relatives in the prefecture but I can't get through to about 90% of them. The quake was days ago, but the city is completely paralysed. The electricity was out, but we have a charcoal kotatsu so we had heating. We also used charcoal to help cook dinner. We've not done this since the 7.9 quake, 33 years ago. We're taking in many shivering people to warm them up -we've all got to rely on each other after all- it doesn't matter if we know their name or not, anyone is fine. We've already had over 100 people come to fill their polythene water tanks.

They also uploaded some pictures showing the damage near their home.

Another blogger, from Sendai shows the queue of people, perhaps 1.5km long, all in need of water. Apparently they set out at 8:30am, and didn't get their water until 12:40pm.

Other blogs ask visitors for any information they have for their area, others provide help on which radio stations are best for getting information, many tell stories of trying to get home after the quake, or on how  they tried to find out what was going on. One blogger laments:

Are you OK? ... Are you alive? ... Now I have no way of contacting you.

Searching blogs for Fukushima unsurprisingly will net you a lot of anxious discussion on the nuclear situation, including advice on what to do if a radioactive cloud passes through your neighbourhood, though I don't know where that blog actually originates. One blog I did find from Fukushima so far paints a similar picture as before, with shops running out of pretty much everything, but also offers advice for people living nearby. For another, it appears like business as usual, despite sharing the prefecture with a variously: no-problem-here, just-seconds-from-meltdown, where's-all-this-hydrogen-coming-from nuclear plant**.  Indeed, I can find very few blogs from Fukushima expressing much in the way of concern over how things will turn out, but with so many still without power, its difficult to tell what is going on behind the news. Nonetheless, most of those blogs I've found from the area, while mostly filled with some degree of shock, also tend to retain an air of grin-and-bear-it.

I guess I can't really say whether or not the news is really fear-mongering. Those worst effected are unlikely to be blogging, in any case. That aside, what I've found has shown that generally these people seem to be doing their best to help their neighbours. It doesn't paint a pretty picture, but its somehow reassuring. If nothing else, there are these people determined to carry on, no matter what.

*I say brief, but with the amount of information out there already, you could spend weeks and only scratch the surface
**The true state of the plant is anyone's guess, and until people have the time to observe it properly, it probably exists in all these states at once. If you believe in Schrödinger's cat, anyway.

Brighter side of Japan

The news lately has been appalling, and I can only be thankful that no one I know is caught up in the unfolding tragedy.

But rather than instilling a mortal fear of returning to Japan, the constant coverage from Japan has reminded me how much I would rather be out there.

I think I can be forgiven for briefly putting the more serious issues aside for a moment (there are literally thousands of sites you can read for that, why duplicate them?*), and reminisce on the brighter side of Japan.

The first thing springs to mind is bicycles. I miss riding into work, and god save me if I attempt it here. In Okayama, I could cycle into work, not be run over, and be fairly confident that I would be dry when I got there. Also, you can leave your bicycle damn-near anywhere and it'd still be there when you got back (though sometimes tangled with several other  -the so called "bicycle dominoes" effect-). Indeed, a bicycle becomes something of a necessity in the hotter months, when it is far more refreshing to glide through town on a bicycle than to slog it out on foot.

That brings us to the weather. Lots of Japanese seem surprised when I assure them Britain has four seasons, but then if you spend a whole year in Japan, it kind of makes sense. You get the same seasons, but much more intense. Winter is cold, Okayama wasn't as cold as England perhaps, but when you're in a country without much in the way of central heating, you'll quickly find yourself rushing for a kotatsu, and variously downing meals of nabe, Japanese curry or ramen. Then, just as we turn on the defrost in England, Japan's oven turns on full blast, and you've got about a month or two to enjoy the spectacularly colourful spring before she gets up to temperature. And spring is truly amazing, especially if you like walking around Japanese gardens: it is one explosion of flowers after another, sparked off by the magnificent cherry blossoms. Before long, this leaves you roasting in the Japanese summer. But even in this furnace there is a lot to enjoy, including the annual fireworks festivals, and the occasional thunderstorms which not only cool things down, but are orders of magnitude more impressive than the wimpy English variety. Finally Autumn arrives, which unlike its English counterpart (which seems to exist purely to separate summer and winter, like a rather passive bouncer) is another explosion of colour, this time red (perhaps to warn us of the upcoming winter), and another month or two of mild** weather to enjoy it with.

The nature in Japan is also a big eye-opener for me. Of course, my first impression of Japan was that there wasn't any, because you quickly find out that urbanisation of Japan has been so prolific that most towns and cities have merged into a contiguous network of concrete. Nonetheless, it doesn't take long, especially in more "rural"*** areas to escape to somewhere surrounded by either mountains or fields. And being a country-bumpkin one of the first things I noticed was the different fauna and flora. Bamboo growing wild, spindly spiders that could outstretch my hand, and tree sparrows everywhere. It is a very rich environment to walk through.

The other thing I miss is the hospitality and Japanese way of thinking. Even it if it is superficial, there is nothing like walking into a shop and being hailed by the contagious call of "irashaimase!". While I wouldn't describe the average man-in-the-street as jovial, the Japanese somehow excel at projecting an image of happiness and order when such an image is called for. Its difficult to describe, but a very prominent feature of Japan as I've known it.

I'll just wrap up to say that despite my naive writing here, my thoughts are often with those who haven't been so lucky, and will be long after the news has lost interest.

*that said, there are a few things I'd like to investigate in Japanese myself, since the BBC have said a couple of (minor) things that raised my eyebrow

** not the English mild, which generally seems to mean "hypothermia unlikely". Japanese mild is more like the English summer, climate-wise.

*** again, rural in Japan is completely different from over here. I had the city of Okayama described to me as rural. Being from the green places of Dorset, the idea of a city being in any way rural was completely alien to me

Saturday, January 15, 2011

Sony Handycam easy on Ubuntu Linux

When I was lucky enough to have my Father-in-law buy me a Sony Handycam, the guy at the shop told us

"Ah, you'll need a Japanese version of Windows on your computer if you want to turn your videos into DVDs"

Having previously owned a Sony mp3 walkman, I'm well aware of Sony's tendency to release propriety software with their gadgets, but being an Ubuntu fan, I also found a nice little java program that bypasses that necessity (called symphonic), and so I figured that the Japanese Handycam's requirement for a Japanese OS could also be bypassed fairly easily.

... In any case, there is always my wife's Japanese VAIO...

As expected, it was fairly straightforward. Indeed, I didn't even need any dedicated software to get everything working. I just used VLC to view the videos (although they run mighty choppy on my poor ickle netbook) and Kino video editor.

In fact, I get the feeling that it would have been more difficult to get the camera going in Windows.

Thursday, January 6, 2011

Making the world in 7 days?: An experience with JOGL

Last year I started learning Java, and had a lot of fun using its 2D graphics to procedurally generate a cartoon seal. Eventually I came across JOGL, a wrapper for OpenGL in Java. Its been a while since I did any serious 3D graphics programming, so I thought I'd see how easy it would be to program a 3D game in Java, and how well java would cope.

I started out making a grid comprised of regions, each subdivided into areas, further subdivided into terrain squares. I then made (a very inefficient) world generation class to iterate through all these terrain squares and assign them a different height (basically, I shove a load of sine waves onto the landscape with varying amplitudes, it looks very silly until the sine waves start overlapping, then the interactions between the sine waves start to produce something approaching believable.

Next came lighting, and I remembered (horror of horrors) that you need to specify normals at each vertex of the terrain, which is done by averaging the surface normals of all the quads surrounding a terrain vertex. Nonetheless, by the end of day one, I had a lit, hilly landscape. Albeit a blue one.

Most of day 2 was spent trying to find a simple way of adding terrain textures, it turns out that there is a very simple way, and I'm glad I took the time out to find it:

Texture tex ;
tex = TextureIO.newTexture(new File("Ground.png"), true);

Of course, I'm going to have to move this out of the init() function when I want to use more than one texture... But in any case it works. Finally, I added culling so any regions outside of the viewport aren't drawn, cutting down on rendering times. By the end of the second day, then, it was looking like this:

Remember I'm using a subdivided system of regions, areas and the rendered terrain squares. To further optimise, I added an algorithm to give the corner of each area its own vertex, and I moved the height of these vertices to match the height of the nearest terrain vertex. In effect I had created a low detail version of the rendered terrain. Then all that was required was to render the more detailed terrain closer to the camera, and render the less detailed areas further from the camera, reducing the number of triangles rendered overall. This effectively allowed me to greatly expand the size of the terrain, and still have it render at reasonable speed. Finally I added fog, which didn't take me too long at all, to get something looking a little more atmospheric:

Well... When I say atmospheric, perhaps depressing is a better word... To inject some new life into the world, I spent the 4th day adding the skybox (actually I spent most of the day adding model support). This is basically a textured sphere that I flattened into a pancake (not the most efficient method, but very quick), this way the fog doesn't obscure the sky above, but fades seamlessly into the sky. I also added a blue tint to the fog so it looks more like haze on a cloudless day than miserable English fog..

You might notice the sky has pixelation on a geographic scale, this is due to the fact I still haven't actually added support for multiple textures.. Yes, that's right, its the ground texture coloured blue!

So... 4 days into the creation, and just about everything is in place. Now I've hacked out the majority of the model loading code, vibrant tree'd (even inhabited) landscapes can't be far away...

To conclude... I've basically done this before in DirectX many years ago, but I'm quite impressed with how JOGL handles everything. Its a little more difficult for me to get my head around managing resources like models and images (something that DirectX manages quite well on its own), but performance wise its working like a charm, and creating it on my netbook has been very pleasing. Its the added portability of Java is the icing on the cake for me though, and I had my fledgling program running on linux with no troubles at all.