You must read “Hello Android” by Ed Burnette.

If you’re like me, you have a dozen or more books on your bookshelf that you will never ever read again, but you have never considered throwing them away. With titles like “Learn C++ in 30 days” and “3D Game Programming in Java” or whatever. Maybe even something like “PHP 4.0 Tips and Tricks” (ok I made that one up, I don’t even want to look at my bookshelf right now). Because once you learn something and do a few projects in it, you don’t really need to read the books anymore. Well, those are the good books. The bad books, you bought them because you thought they would help you and they turned out to be utter crap. Most computer books are like that. You walk into a bookstore and there’s 10 books on C/C++/Objective C/C design patterns/C#, and “C is the new Cobol”. Maybe a dozen more on C game programming, Linux programming in C, and a dozen more, and you sit there and shake your head. Then you walk over to the Java section and the situation repeats. Except this time it’s worse because in addition to all the normal bloat you have the “Android Section”. And this is where your hell really begins. Because most android books really suck.

Thank god for the internet, I always say. So I went home and downloaded a dozen books on Android development. I ended up buying only two of them which I will name shortly. The losers deserve no mention by name, although I will talk of them first. They were all current (2.1/2.2 and up as of writing). They all looked good. Some of them seemed to be the best in their class. Some were from famous publishers and some were by relatively well-known and experienced people. The main problem is that they were obtuse. And this is a difficult thing to get around since programming for Android is a whole new world from Java. Yes, it’s Java, but it’s like nothing you have ever seen before. Personally I think the people who designed this system were genius dropouts. Genius because the system works, but dropouts because it is a horrid pile of crap from the standpoint of getting in the door.

See in the past you would do programming for an interface by loading the values you wanted into a data structure and sending that data structure to some sort of class library slash interface. This is just how things have been done for billions of years. But along came things like Ruby and AJAX and CSS and suddenly it began to look like the Lisp guys won. You have major services like Twitter using Scala. Scala. Why? Because it’s not mainstream.

But this is besides the point. There is so much XML and other cruft you have to wrap your head around that it is like programming in a different language. There’s absolutely no reason why you have to type stuff into an XML file when Java has a perfectly good way of instantiating arrays of values in code. XML is NOT more human-readable than Java code for doing this, especially for people who have been in deep with the Java for a long time. I’ll give you an example. The layout and value XML code is full of stuff like this:

            android:textSize="24.5sp" />

ok. ‘splain this to me. How is this any different from a simple Java class file, where say a .layout() method is like…

        View view = new TextView();

Short answer: It isn’t. It’s just more difficult to switch contexts and switch files all the time. And it’s more expensive to process by the computer as well. Which, surprise surprise, ends up converting it into machine code along with everything else and running it. The XML crap is a bane, and you have no choice but to learn it.

So, about those failed books? All of them beat you over the head with this stuff. They make things so ridiculously complex, cutting and pasting things in 4 or 5 different places just to declare a class and have it fit in the “Activity” model — which in itself is a giant .wtf().

But I promised I wouldn’t whine about the poor design decisions that went into setting up a public Android Development Environment. This is about books. And the best book I ever read was “Hello Android” by Ed Burnette. I cannot believe how good this book is. If you read anything else, you are wasting your time. Well, that isn’t entirely true. I did read another book which was just as amazing as Ed’s. But I won’t tell you what it is yet. I’ll save that for part 2.

“Hello Android” was really a godsend for me. The examples they use were not assinine (like making a social network app – Jesus Christ which marketing guru got fired over that one) and not useless (no names, no names). The book was also COHESIVE which I cannot stress enough — no other book was as cohesive. What do I mean? Well it’s difficult to describe. Halfway through other books I just felt lost and was like “Shit I better keep reading, and maybe something will sink in”. But nothing ever did. It was one useless paragraph of long winded bullcarp after another. But not “Hello Android”. No, this amazing book was easy to read. For the first time I found myself actually understanding layouts and actually understanding getting from point A to point B with things like buttons and handlers and Activities and Views.

Thank God for “Hello Android”. Thanks to Ed Burnette, my Android adventure has only just begun.


Dear Netbeans Development Team

Dear Netbeans Development Team;

I’ve been using Netbeans for, wow, as long as I can remember. I switched when the Kawa project folded. I loved Kawa. Netbeans felt like Kawa. It felt like home. So I stayed. I loved the interface and the power. But recently you dropped the ball on SAF support. You promised that it would be okay to use it, even though it would be dropped from the Java spec. You promised that the only thing was that it would not be updated. Maybe, someday in the future, we wouldn’t be able to create projects with it. Okay. Well I’ve been using Netbeans and SAF for a very long time, more than six years. Maybe back since 2002. Not sure. I have code that old but not sure if I was using SAF back then. Of course, if SAF was promoted as the default for new GUI projects in 2002 (it was in 2009, at least) I would have been using it.

But when you released 7.1 and included IF-statements that explicitly prohibited SAF forms from being loaded into the editor, you made a mistake; You did something you had no right to do, you tried to funnel users into migrating away from SAF into NBP (Netbeans Platform). Most of the reasons you gave for your decision were lies or excuses:

1. You said SAF (i.e. JSR-296) was being dropped from the Java Standard and therefore would be removed from Netbeans.
Ok so what is Netbeans Platform then? A JSR? It’s not even a JSR. So dropping it just because it won’t be in Java and then promoting Netbeans Platform does not make sense. If the reason is that it won’t be in Java, then how can we trust you and use NBP? It’s not logical.

2. You said SAF was not supported.
Reality #1: SAF was supported — by several fork teams. BSAF for example. It’s an extremely well known thing in the Java community, yet you failed to bring the BSAF team on-board or consider their work at all.
Reality #2: SAF was supported — by Netbeans. You actively promoted SAF and made it the default for new projects. Then you broke backwards compatibility with no warning, in reverse of previous statements you made that you would not do this. This is an EXTREMELY bad thing, for the reason I am about to tell you at the end of this list.

3. You said that Netbeans Platform was superior to SAF.
Reality #1: It’s not. I tried using Netbeans Platform from the project creation menu. It created a bloated heap of giraffe poo. Why is there a web browser in my new project, and how do I turn it off? You need to seriously think about that and why I was never able to solve the issue. You need to think about how you pissed me off as a developer. Never mind everyone else. We want the features of SAF without the bloat of Platform. Hint: My project is 300kb. Why would I upgrade it to Netbeans platform and have it quintuple in size with no visual benefit?

4. You provided no way out.
No, the “solution” in the form of an XML file which people had to dig thru a buglist to find WAS NOT ACCEPTABLE and did not work on 10-20% of files making the whole thing a pointless effort.
Reality: This was your biggest mistake. You have done this in the past with your Visual Web thingy. You have done this in the past with other technologies. Well, this time you pissed me off.
Reality #2: Sure, for people entering Netbeans today, or people PAID to do it, this is no problem. Welcome to the happy candy land of Netbeans and Netbeans platform. Well I’m not like that, and I am thru with Netbeans forever.
Reality #3: We can’t even use SAF or BSAF as standalone libraries because you put explicit IF-statements in the code blacklisting SAF. I can’t believe you did that.

How dare you do this to me.

Here’s that reason I promised you at the end of the list.

If you’re going to drop the ball like this, users are going to call you on it. You lied. You promised it was okay to make SAF forms. SAF was the default for many years. Many people who just wanted to use Swing were funneled into SAF by Netbeans, then you ripped the floor out from us. So I’ll tell you what. If I have to rewrite my projects in plain Swing, fine, I will.

In Eclipse.

And I will never, ever use Netbeans again and I will relate my story to as many people as possible.

I hope you all burn in hell.

Kongzi Beta 7 Milestone 6

I’ve been working on Kongzi a lot recently. There are THREE major new features.

1. Mix and match now works again (although I suppose it always needs more testing).

2. Kongzi now supports split dictionary and user files. That means if you are running a class (versus studying on your own) each student can have their own profile but the dictionary data can be edited in one place. VERY convenient.

And 3.. perhaps the most interesting, most-discussed, and most debated feature regarding this program.. well.. what is it? Well let me introduce it to you. Recall the Browse Entries screen from previous versions; here I am showing the Chinese-English dictionary highlighting some vocabulary from the BLI system:


Now, there’s a secret key; Select some entries (as many as you wish) and press F2:


I’ve removed the window title to build suspense, but there is a clue in this image as to what I am working on. Are you ready to see this? It’s so awesome.. scroll down:


Ahh, there it is! Kongzi’s FULLY INTEGRATED, FULLY DEBUGGED spaced repetition flashcard system!

It works off the dictionary so it’s completely configurable in every way all the quizzes are. I use it to teach myself Chinese and Japanese, and I use it to teach my students English. You can even configure your hints. I’ve included one more shot of a standard Chinese – Pinyin – English setup below; this is what you might see after clicking the “hint” button twice:


Wow, I can’t tell you how proud I am of this system! It took Kongzi in a fresh direction and brought me back to working on the project big time. Although I must say, that the dual savefile structure was more difficult (in the sense that I had to keep track of a very large number of things at one time).

All in all, the dual savefile structure was really necessary for classroom instruction. That’s the biggest bit of info which came out of the recent 6 month beta test. And, oddly enough, it was sort of required for the SRS system because the SRS system would only be useful for one “user”.

So, now we’re at 0.7.6. The only thing left for Beta-8 is to add Audio quizzing. I’m a little unsure of how I should do this. There will be audio only quizzing which will repeat the word twice, but due to audio issues I may also include a “replay audio” button. That is, i’ve noticed audio issues in a lot of similar programs on a wide variety of computers, so I want to get that done right before I release it too.

beyond that, what else? A text analyzer, full-script cloze generator, and some sort of guide/helper would all be great but I think they are not going to be necessary to make a release-quality program. So after the audio (which itself might be thrown out and I’ll just release with the current set of features)… Working on those textbooks is now a big priority.

Okay so I am kind of rambling here, bouncing ideas off the wall, so that will be my decision. then. I’ll do a feature freeze now, put Kongzi back into another 2 months of beta testing to test the split savefile system and the SRS system in the classroom. I’ll work on the textbooks and stick to that June release schedule.

This is going to be a big release for me. I am very happy about this program!

If you’d like to be in the next beta test or you’d like to make any comments or suggestions, please, comment! Tell me what you want in a program like this. It’s going to be the best! Gotta be the best! ^^

Kongzi Beta-8 announced for June

Okay. Kongzi Beta-7 has been in classroom-use testing for about 6 months now and it seems pretty solid. A lot of changes have gone on under the hood. It’s using a database for the main type of save files now and you can merge (import) data from other files without destroying your user info. This will be tuned as time goes by, but as of now it is solid for general use.


All the quizzes have gotten a swift kick up in power, they now don’t just present random items but will sometimes present items which are similar to the correct answer. To do this I have created an engine which analyzes the user’s expected knowledge level and searches for similar words .This works in any language and with sentences (shown below) as well as with words (shown above).

Another thing which I’ve done is add the list of test mistakes to the score screen for easy studying. The following example is from the dictionary I use to teach “Let’s Talk in English” to Chinese students.


Once I give the manual a once-over and double check a few features on my to-do list, I’m going to have to start looking at how to package this beast.

For one, I plan to blow away the competition by offering a companion textbook with preloaded vocabulary. The MCI Chinese project (see the navbar up top) isn’t dead at all and has actually expanded with sister projects such as MCI Japanese and so forth. Here are some shots of the MCI Japanese book, “Welcome to Japanese”:





As you can probably guess I’m really excited to have reached this point in the Kongzi project and I will be able to package and offer these materials to YOU (well, to anyone) very soon. Target is this summer, around June for a complete Chinese/Japanese/Korean package which will take you from step one to “fluency”.

Thank you for keeping patient all these years. The wait has been difficult for me, too! But it is almost ready now, for real!

Slapped in the Face by Natural Language Processing

I just spent three weeks solving some of the hardest logic puzzles I’ve done in a while. And what did I learn?

Well, I finally found a class for that little bit of code in the main program that didn’t seem to belong there. Long story.

Recall my last post where I describe the new Memory game module. I had always had a feeling that once I had completed rewriting all the old code and fixing up the UI a bit, that the rest of the program would come out in a landslide. And it sort of did. I was blessed with a small holiday due to summer vacation and being ill, so I had quite a few solid days to work on Kongzi. And work I did. I found and fixed countless tiny widdle bugs, and I also added a phrase module — kongzi can now give multiple choice best-word quizzes.

This caused me to encounter a rather well-known, and actually unsolvable bug related to Natural Language Processing (NLP; and no, not neuro-linguistic programming). Let’s say I have a phrase; any phrase; and I choose one of the a-b-c-d answers to be correct. How do I then choose the answers b c d to be words which are not correct, in such a way, that it will not clue the reader in to the answer? This is much more difficult than it appears. First of all, it is not acceptable to record a small number of answers which are “wrong”, per question, because if these words are not in the current targeted vocabulary, the remaining (correct) word will be consconspicuously familiar. In practice this leads students to pass a test even when they do not really understand the meaning of the words. Limiting words which may appear by part of speech is for the same reason, unacceptable. Limiting words by tense, also. It becomes an exercise in choosing the word based on it’s grammatical fit than anything else.

Example: “I take the ____ to work every morning.” a) grape  b) taxi   c) car    d) airplane

Obviously a is not a good answer, and d is illogical. But among b and c, the answer is not clear. It’s probably c, but it might be b. This is the problem, the student might choose an answer which is right, and the computer would not know that.

The real problem is that with thousands of words and thousands of example phrases it is simply not feasable to list every possible answer to a question.

So the solution I came up with is, to choose the words randomly from the target vocabulary, from the least-known words. This has the advantage of creating a situation where the student cannot choose a word which is a wrong answer intentionally, because the definition of that word is one that the student does not know. The key here is that the problem described above occurs infrequently. Words which the student chooses wrongly in this way will remain in “unknown” status, but words which the student knows will slowly rise to the top regardless of a few occasional errors.

Quality of phrase is also important here. A phrase like “He is a very ______ boy.” can lead to a lot of such errors, because there are a lot of possibilities. However, a phrase like “He is a very _____ boy, he is punished every day.” cuts down a great deal on the possible adjectives. It’s very difficult to have a real collision with a sentence like this. Another example:

Bad: Would you like to watch a ______ movie with me tonight?
Good: I like comedy movies, but I don’t like _____ movies. They’re just too scary!

The second sentence above probably has just 1 or 2 words which could “normally” apply to it, and the chances of an idea collision are very low. But the first sentence, well, if two adjectives are chosen for the multiple choice (or if parts of speech is used to choose only adjectives), the reader might as well flip a coin to help him decide what the right answer is.

So far the solution seems to be holding up well and I have only seen the odd rare collision.


I feel as if I have come full circle. The Memory game code is the meat of what I lost back in 2007 when my computer crashed. Now, I have finally gotten around to rewriting it all these years later, and it feels as if a weight has been lifted from my shoulders. Each time I would think of coding for Kongzi I would remember how royally pissed off I was at losing my work. No more.

But, this is not the memory game of 2007. This is the new and improved version. As you can see, you can configure it to display different items as a pair. Of course, you can just use it to play regular “memory” as well, and increase your recognition of foreign language words or letters. However I find this particular mode especially well-suited for learning hiragana pronunciation.

I believe this end of the program is well-polished now, and that it may finally be almost time for the feature freeze before public release.

Kongzi: Japanese

Okay I finally decided to start learning Japanese. I’ve been “learning” Chinese for 20 years, don’t hate me for switching horses midstream, okay? I will always love the old horse too.


As soon as I started learning Japanese I realized that I would have to first learn Hiragana. Hiragana is of course the primary writing system, or “kana” in Japanese. So I dutifully started entering Hiragana into Kongzi. I immediately discovered much to my chagrin that for all the “talk” I made about using Kongzi to learn Japanese as well as Chinese, it wasn’t nearly as convenient. Here’s what I was faced with:

Something's not right...

I always knew I would have to design a new set of tags, so I wasn’t too worried about that. What bothered me was that it said “Traditional / Simplified”, “Pinyin”, “Zhuyin” and so forth. Terms which i’m sure Japanese-learning users would grow to love, but which were unsettling to me, personally. Call me a perfectionist. I was almost going to let it go when I realized that there were deeper, structural problems. Japanese has six peices of information which need to be remembered – Kanji, of course, hiragana and katakana, yes — but also romaji and phonetics, alongside a definition.

I realized I had been cheating with Chinese as well, because I had not included a space for phonetics. After some tinkering however, it all worked out well. I modified the options dialog to include a spot for learning Japanese:

and added the relevant fields to the Add Entries dialog:


Then I realized the “phonetic display options” and certain selections in the quiz settings dialog weren’t set up to handle the default display of a third phonetic. Nevermind that quizzes themselves weren’t coded to accept or display a third phonetic. Oh bother. So I coded new interfaces for setting up what’s shown on flashcards, as follows:

Right now i’m slowly changing all the labels to reflect what language is being learned. You can see that in the add entries dialog above where it says “Hiragana” but not in the quiz configuration directly above, where it says “Phonetic 3”.

But, other than those few cosmetic display issues, Kongzi is up and running… in Japanese! やった!

Some final comments.

I can now see how some of the comments I made about Anki vs. Kongzi were unfounded. I understand now why they stirred up a hornet’s nest of Anki supporters who accused me of not knowing what I was talking about. However, after updating the program to support Chinese and Japanese properly, I can at least reaffirm one aspect of that discussion. What I said about Japanese programs claiming they can be used to teach Chinese, “or anything”, are very true. Such as Stackz’ claim that it can be used to teach flags, or Anki’s claim it can be used to teach guitar chords. It’s a gimmick.

To truly be able to use a program to learn a language, that program must be specifically designed to handle that language.

Saying your program is versatile may be true, and it may be possible to hack and kludge your way into using a program in a way it wasn’t truly designed to be used — but I feel very happy with Kongzi now and I feel very happy with it’s native support for Japanese learners.

And Korean? Thai? Tagalog? At the moment I wouldn’t even think of saying Kongzi could be used to learn Korean. I realize now that although it COULD be, it never WOULD be, until proper coding is done, and proper support is given for Korean users. Yet this remains my dream — a single, simple, small and beautiful program that runs on anything, and can be used to learn any language in the world. So I’m sorry Korean learners, but I have a lot on my plate fixing this pig up for dual-language support. Korean will have to wait until next year.

And about releasing the program, well, one day…. I promise….

This is renli, over and out.