Wednesday, November 04, 2009

Hide/Reveal with CSS and Java Script

I've been working on a project at school trying to produce a web site to act as the backbone of a language lab in the PC room, turning every box with a web browser and network connection into a terminal for English study (in theory). My school's disastrous network overhaul last year means that the internet is now unusably slow (don't even start me on it), and I wanted to develop the site with a focus on media such as movies and music, so I decided to host the site locally - I built the box with debian server, got apache up and running with PHP support and I've coded the majority of the site already.
You can see a slightly buggy copy viewable online here: learningenglish.

I developed the media playback using JW FLV Media Player, but stumbled across a problem where I wanted to have links that would load specific audio files into the player so that students could hear the reading of a word in English without having to use a separate play bar for every single file, kind of like having a playlist for the player on the web page itself.
One possible way to solve this problem is with hide/reveal in CSS, creating many instances of the player and then hiding all the ones that aren't being used. I'm not sure if this is what I will eventually do, but it led me to this page and learning a little about hide and reveal in CSS.
The problem was that I wanted only one item from a large selection to be displayed, and the only way I found to do this online was with radio buttons which I don't want to use. So, I sat down and tried to code some java script that would do this dynamically for a list of any size and with a little help from my friend Sayer, this was the result.

I couldn't find anything else on the net which showed how to use hide/reveal to display one item from a list without radio buttons, so I hope that this might be useful to some people. It scans the HTML content and determines how many elements there are on the page based on the DIV id, meaning there is no need to set the number yourself and making your HTML more easily maintainable.

Hide/Reveal with CSS and Java Script.

Friday, September 12, 2008

JLPT Level 2 Grammar

I'm sorry that's it's been so long since I've posted anything here, but I'm just not a blog person. Or a MySpace person. Or a FaceBook person, either.

Back to business.

JLPT Level 2 - Grammar: 日本語能力試験2級・文法

JLPT Level 2 Grammar Guide.

The JLPT is coming up and I've been studying pretty hard for it so far. This year will be my second attempt at getting level 2 and so far I'm on track.
When I started studying last year I found the lack of decent English learning materials for level 2 to be a real barrier, so I decided to compile all of the resources that I could find and put them together in a digital format so that they could be searched and updated by me as I went, and also so that they could be shared and maybe evolve into something else if the motivation took hold of me (which, beyond posting them here, looks unlikely).

The resources that I found to work with were as follows:

1. Japanese Language Proficiency Test Level Two Grammar Book
The Kanzen Master series are excellent study guides and this provides a point-by-point breakdown of the grammar points for level 2 along with a brief explanation and example sentences. The only problem - the grammar explanations are vague, and written entirely in Japanese.
2. An online JLPT grammar guide
This wasn't as descriptive when I started last year and seems to have improved a lot. Example sentences are a little scarce.
3. A Dictionary of Japanese Grammar: Basic, Intermediate and Advanced
These are amazing reference books and have extensive explanations of grammar points, a large selection of example sentences and good cross-referencing for similar grammar. My only criticism is that there are many points in the level 2 grammar that are not included in any of the books, even in the most recent Advanced Grammar book.
4. JGram
JGram was a big help with a lot of points that weren't covered in the above grammar dictionaries, but the descriptions are often vague and I found the example sentences all very similar and often just copied straight from Jim Breen's online dictionary.

Combining all of these together and pestering Japanese and foreign friends to explain the problems that weren't covered by one or more of these different guides, I have managed to put together (what I think) is a good explanation for most of the level 2 grammar points, available here.
It follows the Kanzen Master book and includes all the example sentences, but has the addition of English translations for the grammar points and some additional notes where relevant/available.
When the grammar point is listed in the Dictionary of Basic/Intermediate/Advanced Japanese Grammar, I have included the book and the page number underneath the grammar point title.
I tried to stick to regular formatting so that it would be searchable (for example with grep or if you wanted to turn it into XML) but I may have made mistakes here and there.
The format is a unicode txt file.
I used EditPlus2 (normally used for coding but equally suitable for txt files) for writing and printing - I found the the line numbers on the printed pages and the ability to format each document in the same font without imbedding it in the file very useful.

If there are any spelling mistakes (Japanese or English) or if you have any notes or comments, please post them here and I will happily incorporate them into the document.

I hope that this can be of service to someone other than myself in the great battle against the Japanese language that a small army of us continue to wage every day. Through the power of grammar, bolstered by the artilliary of decent kanji knowledge, I have every faith that we will be victorious and finally convince Japanese people that foreigners have brains too.

Monday, April 16, 2007

sakura

Cheery blossom season has only just begun, but the incredibly short life of the cherry blossoms (around ten days) means that it has also almost finished. Viewing cherry blossoms (hanami) is an important event in the Japanese calendar, and the best places are always crowded at this time of year. Yesterday, I went to Garyuu Park in Suzaka City, just East of Nagano city, and spent the day checking out the cherry blossoms.

Here are the photos: 1 2 3 4 5 6 7 8 9 10 11

And here are two more emailed to me by a friend (not Garyuu Park): 1 2

EDIT: Last Monday I went back to Garyuu Park with some other friends for the night cherry bloosom viewing. There photos really don't do justice to how beautiful it was: 1 2

Thursday, February 01, 2007

*place holder*

I am too busy with work at the moment to get up my photos from winter vacation or tell you about what I got up to, but here is a quick image to keep you happy until next week when I will have some free time (the third years have their high school entrance exams next monday, so I have been busy tutoring some of them every afternoon for the last few weeks).

1. Kinkakuji Temple, Kyoto - taken on Sayer's camera, care of Sayer. The weather was perfect to see a temple like this - the sun illuminated the gold-leaf upper levels perfectly, and the image is beautifully reflected in the clear, still water.