Chủ Nhật, 8 tháng 11, 2015

RomajiDesu has been updated with smart Japanese word decomposition

Watching real time search of user using Google analytics was somewhat very interesting. Many users, I suppose beginners, searched a verb in a changed form, not dictionary form - jishokei (辞書形). It made me think of my early days when self studied Japanese by trying to understand a favorite Japanese song, by copying a whole words into a dictionary without getting anything.

In the  the earlier version of RomajiDesu's Japanese Dictionary, if you searched "見てください", there'd be no result. But in this version, you will get the jishokei of the verb "見る", as well the possible conjugation form "Polite Imperative" (command). So from the verb (miru - look), and the inflection (polite imperative), you can easy guess the meaning: "Please look!"


It also words with Japanese noun and and adjective. And if you put in the search field a complex Japanese sentence, RomajiDesu will automatically decompose it into small and comprehensible components (which is similar to RomajiDesu's Japanese Translator). For example, "RomajiDesuが大好きです", into "RomajiDesu ga Daisukidesu" (I love RomajiDesu)





Chủ Nhật, 11 tháng 10, 2015

Wind visualization for meteorologist

This is my new creation for my department to visualize wind on different levels and forecast times. Streamline map is a very useful tool for forecasters, an animated wind map with speed indicator is even more useful I think. This is done using d3js and pure canvas javascript.

Thứ Tư, 11 tháng 3, 2015

New feature with RomajiDesu Kanji dictionary

RomajiDesu's Kanji dictionary has been updated with Chinese pinyin, Korean reading and Sino-Vietnamese (Hán Việt) reading. The updates have been done due to some suggestions from RomajiDesu users.  I don't really know how useful these updates are but as a Vietnamese, I found it's really cool to see how many words in Vietnamese, Chinese, and Japanese is related. The photo is my name (Hải) written Kanji, which means 'the sea' and pronounces  'hǎi' in Chinese, 'hae' in Korean, and 'kai' in Japanese ^_^

Thứ Ba, 13 tháng 1, 2015

A simple example of Delegate Pattern in Swift

Well, I've just start self learning to program iOS apps using Swift programming language. One early thing that you stumble into when learning it is a concept call "Delegate pattern". It's quite confusing for a self-taught learner like me and I've looked around for a good simple example. In wikipedia, there an article that explain the concept with many languages. However, I don't like the the functions and class names. So I try to rewrite the example which is simpler and funnier. Well, there's ways to go with Swift and iOS, but at least the first steps must be interesting, huh?

protocol AnimalBehavior {
    func eating()
    func calling()
}

class DogBehavior : AnimalBehavior{
    func eating(){
        println("The DOG is eating...")
    }
    func calling(){
        println("Wufff! Wufff!")
    }
}

class CatBehavior : AnimalBehavior{
    func eating(){
        println("The CAT is eating...")
    }
    func calling(){
        println("Meowwwww")
    }
}


class Animal{
    var behavior: AnimalBehavior;
    init(){
        behavior=DogBehavior();
    }
    func eating(){
        behavior.eating()
    }
    func calling(){
        behavior.calling()
    }
    func isACat(){
        behavior=CatBehavior()
    }
    func isADog(){
        behavior=DogBehavior()
    }
    
}


let myPet=Animal() // Notice this is not a variable but const
myPet.isACat();
myPet.calling(); // Meowwwwww
myPet.isADog();

myPet.calling(); // Wufff! Wufff!