<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>仁力的網頁</title>
	<atom:link href="http://renli.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://renli.wordpress.com</link>
	<description>My contribution to the world of blogs.</description>
	<lastBuildDate>Sat, 17 Sep 2011 18:07:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='renli.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>仁力的網頁</title>
		<link>http://renli.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://renli.wordpress.com/osd.xml" title="仁力的網頁" />
	<atom:link rel='hub' href='http://renli.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Slapped in the Face by Natural Language Processing</title>
		<link>http://renli.wordpress.com/2011/09/18/slapped-in-the-face-by-natural-language-processing/</link>
		<comments>http://renli.wordpress.com/2011/09/18/slapped-in-the-face-by-natural-language-processing/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 18:07:40 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=238</guid>
		<description><![CDATA[I just spent three weeks solving some of the hardest logic puzzles I&#8217;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&#8217;t seem to belong there. Long story. Recall my last post where I describe the new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=238&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just spent three weeks solving some of the hardest logic puzzles I&#8217;ve done in a while. And what did I learn?</p>
<p>Well, I finally found a class for that little bit of code in the main program that didn&#8217;t seem to belong there. Long story.</p>
<p>Recall my <a href="http://renli.wordpress.com/2011/08/17/concentration/">last post</a> 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 &#8212; kongzi can now give multiple choice best-word quizzes.</p>
<p>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&#8217;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 &#8220;wrong&#8221;, 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&#8217;s grammatical fit than anything else.</p>
<p>Example: &#8220;I take the ____ to work every morning.&#8221; a) grape  b) taxi   c) car    d) airplane</p>
<p>Obviously a is not a good answer, and d is illogical. But among b and c, the answer is not clear. It&#8217;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.</p>
<p>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.</p>
<p>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 &#8220;unknown&#8221; status, but words which the student knows will slowly rise to the top regardless of a few occasional errors.</p>
<p>Quality of phrase is also important here. A phrase like &#8220;He is a very ______ boy.&#8221; can lead to a lot of such errors, because there are a lot of possibilities. However, a phrase like &#8220;He is a very _____ boy, he is punished every day.&#8221; cuts down a great deal on the possible adjectives. It&#8217;s very difficult to have a real collision with a sentence like this. Another example:</p>
<p>Bad: Would you like to watch a ______ movie with me tonight?<br />
Good: I like comedy movies, but I don&#8217;t like _____ movies. They&#8217;re just too scary!</p>
<p>The second sentence above probably has just 1 or 2 words which could &#8220;normally&#8221; 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.</p>
<p>So far the solution seems to be holding up well and I have only seen the odd rare collision.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=238&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2011/09/18/slapped-in-the-face-by-natural-language-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>
	</item>
		<item>
		<title>Concentration</title>
		<link>http://renli.wordpress.com/2011/08/17/concentration/</link>
		<comments>http://renli.wordpress.com/2011/08/17/concentration/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 19:32:37 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=227</guid>
		<description><![CDATA[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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=227&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://renli.files.wordpress.com/2011/08/memorygame2c.png"><img title="memorygame2c" src="http://renli.files.wordpress.com/2011/08/memorygame2c.png?w=468&#038;h=253" alt="" width="468" height="253" /></a><a href="http://renli.files.wordpress.com/2011/08/memorygame1.png"><br />
</a></p>
<p>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.</p>
<p>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 &#8220;memory&#8221; 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.</p>
<p>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.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/227/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=227&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2011/08/17/concentration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2011/08/memorygame2c.png" medium="image">
			<media:title type="html">memorygame2c</media:title>
		</media:content>
	</item>
		<item>
		<title>Kongzi: Japanese</title>
		<link>http://renli.wordpress.com/2011/06/23/kongzi-japanese/</link>
		<comments>http://renli.wordpress.com/2011/06/23/kongzi-japanese/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 05:36:09 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=207</guid>
		<description><![CDATA[Okay I finally decided to start learning Japanese. I&#8217;ve been &#8220;learning&#8221; Chinese for 20 years, don&#8217;t hate me for switching horses midstream, okay? I will always love the old horse too. Anyways. As soon as I started learning Japanese I realized that I would have to first learn Hiragana. Hiragana is of course the primary [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=207&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay I finally decided to start learning Japanese. I&#8217;ve been &#8220;learning&#8221; Chinese for 20 years, don&#8217;t hate me for switching horses midstream, okay? I will always love the old horse too.</p>
<p>Anyways.</p>
<p>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 &#8220;kana&#8221; in Japanese. So I dutifully started entering Hiragana into Kongzi. I immediately discovered <em><strong>much to my chagrin</strong></em> that for all the &#8220;talk&#8221; I made about using Kongzi to learn Japanese as well as Chinese, it wasn&#8217;t nearly as convenient. Here&#8217;s what I was faced with:</p>
<div id="attachment_208" class="wp-caption aligncenter" style="width: 478px"><a href="http://renli.files.wordpress.com/2011/06/kongzi-b5-hiragana.png"><img class="size-full wp-image-208" title="kongzi-b5-hiragana" src="http://renli.files.wordpress.com/2011/06/kongzi-b5-hiragana.png?w=468&#038;h=364" alt="" width="468" height="364" /></a><p class="wp-caption-text">Something&#039;s not right...</p></div>
<p>I always knew I would have to design a new set of tags, so I wasn&#8217;t too worried about that. What bothered me was that it said &#8220;Traditional / Simplified&#8221;, &#8220;Pinyin&#8221;, &#8220;Zhuyin&#8221; and so forth. Terms which i&#8217;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 &#8211; Kanji, of course, hiragana and katakana, yes &#8212; but also romaji and phonetics, alongside a definition.</p>
<p>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:</p>
<p><a href="http://renli.files.wordpress.com/2011/06/kongzi-b7-options-a.png"><img class="aligncenter size-full wp-image-209" title="kongzi-b7-options-a" src="http://renli.files.wordpress.com/2011/06/kongzi-b7-options-a.png?w=468&#038;h=400" alt="" width="468" height="400" /></a></p>
<p>and added the relevant fields to the Add Entries dialog:</p>
<p><a href="http://renli.files.wordpress.com/2011/06/kongzi-b7-hiragana.png"><img class="aligncenter size-full wp-image-210" title="kongzi-b7-hiragana" src="http://renli.files.wordpress.com/2011/06/kongzi-b7-hiragana.png?w=468&#038;h=399" alt="" width="468" height="399" /></a></p>
<p>Voila!</p>
<p>Then I realized the &#8220;phonetic display options&#8221; and certain selections in the quiz settings dialog weren&#8217;t set up to handle the default display of a third phonetic. Nevermind that quizzes themselves weren&#8217;t coded to accept or display a third phonetic. Oh bother. So I coded new interfaces for setting up what&#8217;s shown on flashcards, as follows:</p>
<p><a href="http://renli.files.wordpress.com/2011/06/kongzi-b7-options-b.png"><img class="aligncenter size-full wp-image-211" title="kongzi-b7-options-b" src="http://renli.files.wordpress.com/2011/06/kongzi-b7-options-b.png?w=468&#038;h=400" alt="" width="468" height="400" /></a></p>
<p>Right now i&#8217;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 &#8220;Hiragana&#8221; but not in the quiz configuration directly above, where it says &#8220;Phonetic 3&#8243;.</p>
<p>But, other than those few cosmetic display issues, Kongzi is up and running&#8230; in Japanese! <strong><span style="font-family:times,serif;font-size:x-large;">やった!</span></strong></p>
<p><strong>Some final comments.</strong></p>
<p>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&#8217;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, &#8220;or anything&#8221;, are very true. Such as Stackz&#8217; claim that it can be used to teach flags, or Anki&#8217;s claim it can be used to teach guitar chords. It&#8217;s a gimmick.</p>
<p>To truly be able to use a program to learn a language, that program must be specifically designed to handle that language.</p>
<p>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&#8217;t truly designed to be used &#8212; but I feel very happy with Kongzi now and I feel very happy with it&#8217;s native support for Japanese learners.</p>
<p>And Korean? Thai? Tagalog? At the moment I wouldn&#8217;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 &#8212; a single, simple, small and beautiful program that runs on anything, and can be used to learn any language in the world. So I&#8217;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.</p>
<p>And about releasing the program, well, one day&#8230;. I promise&#8230;.</p>
<p>This is renli, over and out.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/207/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=207&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2011/06/23/kongzi-japanese/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2011/06/kongzi-b5-hiragana.png" medium="image">
			<media:title type="html">kongzi-b5-hiragana</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2011/06/kongzi-b7-options-a.png" medium="image">
			<media:title type="html">kongzi-b7-options-a</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2011/06/kongzi-b7-hiragana.png" medium="image">
			<media:title type="html">kongzi-b7-hiragana</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2011/06/kongzi-b7-options-b.png" medium="image">
			<media:title type="html">kongzi-b7-options-b</media:title>
		</media:content>
	</item>
		<item>
		<title>JSync and Kongzi Beta-6</title>
		<link>http://renli.wordpress.com/2011/05/24/jsync-and-kongzi-beta-6/</link>
		<comments>http://renli.wordpress.com/2011/05/24/jsync-and-kongzi-beta-6/#comments</comments>
		<pubDate>Tue, 24 May 2011 06:04:33 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=202</guid>
		<description><![CDATA[You know, I&#8217;d probably make more blog posts if wordpress didn&#8217;t suck so much. I just have this intangible feeling that it sucks, that something sucks about wordpress. More on that later when I remember what sucks so much about wordpress. Right now I can&#8217;t think of anything. Anyways I have been working on Kongzi [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=202&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You know, I&#8217;d probably make more blog posts if wordpress didn&#8217;t suck so much. I just have this intangible feeling that it sucks, that something sucks about wordpress. More on that later when I remember what sucks so much about wordpress. Right now I can&#8217;t think of anything.</p>
<p>Anyways I have been working on Kongzi off and on. I&#8217;ve added a timer to the Multiple Choice quiz. Which is kind of cool. Now you know how much time it took you to finish. I&#8217;ll add the same to Flashcards and so forth. I&#8217;ve also added the concept of &#8220;Sticky Tags&#8221; to the Add Entries dialog. The thing that really made me upset the most when adding lots of entries is that the tags wouldn&#8217;t be remembered from entry to entry. This may or may not be a desired behavior (from personal experience) so I put it in as a checkbox.</p>
<p>Another annoying thing I fixed is that if you accidentally click &#8220;open&#8221; instead of &#8220;save&#8221;, it wipes the Dictionary. That killed me twice during actual classtime so I fixed it. &#8220;Open&#8221; doesn&#8217;t clear your database until you select a file.</p>
<p>So yeah I&#8217;ve been real busy at work lately which is why I haven&#8217;t bothered to seriously work on Kongzi. I spent most of 2010 with an insane number of teaching hours and I am only now recovering from the shock. It was that bad. What brought me back? Simple, file sharing. The idea came up at a meeting that we should be able to share files. It&#8217;s better than e-mailing files to everyone all the time, and it would encourage a greater amount of collaboration. But every option we looked at was &#8220;expensive&#8221;. So me being me I decided, why pay? Or rather, I should say, why pay <em>someone else</em>? haha. That was something I could do. So I whipped up JSync.</p>
<p><a href="http://renli.files.wordpress.com/2011/05/jsync-beta-1.png"><img class="aligncenter size-full wp-image-204" title="JSync Beta-1" src="http://renli.files.wordpress.com/2011/05/jsync-beta-1.png?w=468&#038;h=401" alt="" width="468" height="401" /></a></p>
<p>JSync is pretty cool. It doesn&#8217;t actually copy files yet, I&#8217;m banging out the code for that as we speak. First I&#8217;ll talk about the job selection menu which is a cool little piece of work. You&#8217;ll notice one item is blue and one item is greyed. The greyed items, greyed (or de-greyed) by the right mouse button are &#8220;jobs which will be processed&#8221;. The blue item is the currently displayed item. I&#8217;m rather proud of that interesting user interface. Next there are three modes: synchronize, contribute, and mirror. Finally there are three types of connection; local, FTP and JSync. JSync will be a very interesting mode which I&#8217;ll keep secret for now. Actually I&#8217;ll discuss the whole file sharing back end later. I just wanted to mention I&#8217;m working on JSync now. And it&#8217;s gonna be good. Real good. Just like Kongzi.</p>
<p>I know, I know, I haven&#8217;t released Kongzi yet&#8230; so when am I gonna release JSync.. well, I&#8217;ve been using Kongzi to teach now for a very long time. It&#8217;s mainly &#8220;finished&#8221; and could be released, except for one or two small things. The only feature I want to add to Kongzi now is a cloze test generator (also known as trigger exercise). I&#8217;ve realized the best way to do this is to accompany each dictionary with a separate database of sentences and dialogue. I could attach sentences and dialogue to each vocabulary word. But that&#8217;s a little clunky. Yeah well this post is long enough. I just needed to write down some ideas. There&#8217;s actually a lot here, which I will be discussing in greater detail as time goes by. But for what it&#8217;s worth this is it&#8230; probably&#8230; Once this round of development is complete, I&#8217;ll probably release Kongzi. It works really well for teaching and self-learning.</p>
<p>Actually there&#8217;s something else I want to do. I want to add hiragana, katakana and a basic list of kanji as well. Then, really work on the presentation a bit and trim the dictionaries so I have a basic list of say 500 english words, 500 chinese and 500 japanese kanji. Maybe 500 korean as well. As a basic release package. Man there&#8217;s so much I want to do! Why did I stop working on Kongzi.. I got sick and had a motorcycle accident and I was so busy at work.. Well, I guess I learned something about myself.. back to work!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=202&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2011/05/24/jsync-and-kongzi-beta-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2011/05/jsync-beta-1.png" medium="image">
			<media:title type="html">JSync Beta-1</media:title>
		</media:content>
	</item>
		<item>
		<title>it&#8217;s alive!</title>
		<link>http://renli.wordpress.com/2009/12/20/its-alive/</link>
		<comments>http://renli.wordpress.com/2009/12/20/its-alive/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 12:23:01 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=199</guid>
		<description><![CDATA[Kongzi is working. I have made a dozen or more small changes, mainly adding some great new features in the last month. But the important thing is, it&#8217;s working. I have 40 teaching hours a week now, and I use Kongzi in the classroom to teach English. The students LOVE it. And the schools LOVE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=199&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Kongzi is working.</p>
<p>I have made a dozen or more small changes, mainly adding some great new features in the last month. But the important thing is, it&#8217;s working. I have 40 teaching hours a week now, and I use Kongzi in the classroom to teach English. The students LOVE it. And the schools LOVE the fact that I can give audiovisual teaching. Time to ask for a raise? Maybe <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>The downside to all this is that I don&#8217;t have time to really work on the program. I still haven&#8217;t finished the memory game or the new idea I had, the unscrambling game. But other than that the program is very mature now. As I continue to use it over the next months, it&#8217;s my hope that weekend here weekend there I can finish it off and then step 3: profit.</p>
<p>I know I&#8217;ve been rambling about releasing this program for years but perhaps I lacked confidence in the code. Now that I know it works, and works extremely well, I will have a selling point to work from.</p>
<p>Actually the way these things work there would probably be more money in selling it as a tool to teach English. But hey, either way, it works like a charm <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I hope I can find the time to finish it soon. Please leave supporting comments maybe I just need a pep talk to hunker down and start coding again. Right now I just feel tired.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=199&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2009/12/20/its-alive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>
	</item>
		<item>
		<title>Chinese Character Frequency Lists</title>
		<link>http://renli.wordpress.com/2009/11/18/chinese-character-frequency-lists/</link>
		<comments>http://renli.wordpress.com/2009/11/18/chinese-character-frequency-lists/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 05:37:47 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=193</guid>
		<description><![CDATA[Hi. This is in response to a comment left on the Kongzi page. Calimeron writes: Hi, I&#8217;m using the Yahoo Widget &#8220;Mandarin Flashier Cards.&#8221; That uses a cedict dictionary with 2 frequencies (in sqlite format). Do you know anything about these frequencies? Or other frequencies available on the web? (I don&#8217;t like to use these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=193&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi. This is in response to a comment left on the Kongzi page.</p>
<p>Calimeron writes:</p>
<blockquote><p>Hi, I&#8217;m using the Yahoo Widget &#8220;Mandarin Flashier Cards.&#8221; That uses a cedict dictionary with 2 frequencies (in sqlite format). Do you know anything about these frequencies?  Or other frequencies available on the web?   (I don&#8217;t like to use these frequencies if after learning 1000&#8242;s of words, I discover the frequencies are not right.)  Tip for you: do something similar! If you have a program that starts automatically at the startup of the computer, and then automatically flashes the 5-10000 cards you&#8217;d like to study, it&#8217;s very difficult not to study!</p></blockquote>
<p>Hi Calimeron! I have been interested in frequency lists for a long time. The conclusion I&#8217;ve come up with is that no one frequency list is the ultimate, be all and end all. The reason for that is because frequency lists merely target whatever they have been analyzed from. Let me give you an example. If I took, say, 200 daily newspapers, 100 novels and business books, and a broad selection of 100 magazines all from last year, threw in a few scripts from plays and transcribed news broadcasts, I&#8217;d have several million analyzed words. The Chinese Government put something out like that. It lists frequency of simplified chartacters. That&#8217;s one list. But if I added a lot of classical chinese or religious books like the Dao De Jing, the frequency list would change.</p>
<p>Another example is the list put out by the Ministry of Education in Taiwan back in 1997. This is a very modern list with nearly 20 million analyzed words from a broad spectrum of books, magazines, newspapers, television, and even some classical material. This is the frequency order listed in Far East&#8217;s 3000 Chinese Character dictionary &#8211; a book I cannot reccomend highly enough for it&#8217;s value as a learning tool.</p>
<p>Yet another example is the internet frequency order. Someone had compiled something like 5,000 websites from China and came up with 280 million words. It&#8217;s huge. Simplified characters. And another compiled in 1993 and 1994 from Chinese Newsgroups. All of these lists have vastly different orders for characters.</p>
<p>There are other lists. The point I am making is, what are you trying to learn? Obviously using one frequency list over another will target you towards that particular culture. Newspapers in Singapore may use shorthand characters for twenty and thirty which will not appear in other lists &#8211; although they may be included in a list of characters targeting Singaporean newspapers.</p>
<p>My advice is that if you&#8217;re just starting out amd you&#8217;re confused about which frequency list to use, use them all! Study the first 100 or 200 characters in one list, then go study the new characters in another list. It will be very revealing to you to understand which characters are the same and which are different. For example, Yi1 (one) and de5 (ownership particle) are going to be in the top ten no matter what, almost for sure. Other words may be closer or farther away. Also you may wish to know that some lists count bigrams such as &#8220;ta1 de&#8221; (his) separately from ta1 (he) and de (ownership). So you really have to understand what your frequency list is targeting before you can use it.</p>
<p>The way I solve this problem with Kongzi is by allowing the user to import whatever frequency list they like from the internet. It currently can import five or six different lists.</p>
<p><strong>For anyone learning Chinese, I strongly reccomend Far East&#8217;s 3,000 Character Dictionary. It is indispensable and the frequency order is very good for learning daily Chinese you will see and speak all over the world. I&#8217;ve never seen anything better.</strong></p>
<p>You may also be interested in James E. Dew&#8217;s &#8220;6,000 Chinese Words&#8221;. It is another indispensable book which lists many things including CYY and BLI grading, and several different frequency lists.</p>
<p><strong>For advanced students only,</strong> I reccomend buying an entire series of very easy children&#8217;s books (think aesop&#8217;s fables, three little pigs) and indexing and counting each character in each book. That should take you a couple of months! And making your own frequency list from that. You will come up with about 800 words that are significantly common and you will discover that learning as few as 200 of them will allow you to read 90% of the material in the books. Again I cover this technique in my new textbook, &#8220;Welcome to Chinese&#8221;.</p>
<p>For super advanced students. Oh? Here&#8217;s something to think about. What percentage of the most common 3000 characters are nouns, what percentage are verbs, and so forth? Choose the most common 20 or 30 nouns, the most common 20 or 30 verbs, and so forth, and you could probably set up the kernel of a MCI system in 100 words. This puts near-conversational fluency in the hands of first year college students. This is something akin to what I&#8217;m doing for Kongzi and WTC.</p>
<p>Good luck on your Chinese journey!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=193&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2009/11/18/chinese-character-frequency-lists/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Styled Documents</title>
		<link>http://renli.wordpress.com/2009/11/13/using-styled-documents/</link>
		<comments>http://renli.wordpress.com/2009/11/13/using-styled-documents/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 07:31:26 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=187</guid>
		<description><![CDATA[A few beta testers reported back that on their netbooks&#8217; small, high resolution screen, the HTML-limited size of the Chinese Characters was too small. So I redid it using styled documents. Notice anything different? It&#8217;s pretty much the same, except now you can blow the Chinese character up as much as you like. Perfect for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=187&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few beta testers reported back that on their netbooks&#8217; small, high resolution screen, the HTML-limited size of the Chinese Characters was too small. So I redid it using styled documents.</p>
<p>Notice anything different?</p>
<p><a href="http://renli.files.wordpress.com/2009/11/kongzi-styled-docs.png"><img class="aligncenter size-full wp-image-188" title="kongzi-styled-docs" src="http://renli.files.wordpress.com/2009/11/kongzi-styled-docs.png?w=468&#038;h=320" alt="kongzi-styled-docs" width="468" height="320" /></a></p>
<p>It&#8217;s pretty much the same, except now you can blow the Chinese character up as much as you like.</p>
<p>Perfect for Netbooks! This was definately a step I needed to take in order to move towards Kongzi on portable devices.</p>
<p>One of the next big goals for Kongzi is adding a Speech module (i.e. press F1 to hear the Chinese). Associated with this will be a new &#8220;listen and type&#8221; style of quiz, &#8220;listen mode&#8221; for multiple choice, etc.</p>
<p>Development is proceeding extremely rapidly. I&#8217;m working on some UI issues now, making it better. Kongzi is becoming more and more robust. I currently am using it to teach myself but entering characters is slow-going, there are only 250 words in the dictionary now.</p>
<p>I have a really good feeling about Kongzi these days. I think it&#8217;s going to be a success!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/187/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/187/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/187/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=187&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2009/11/13/using-styled-documents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2009/11/kongzi-styled-docs.png" medium="image">
			<media:title type="html">kongzi-styled-docs</media:title>
		</media:content>
	</item>
		<item>
		<title>Modifying Selection Properties of a JTree, JList or JTable</title>
		<link>http://renli.wordpress.com/2009/10/25/modifying-selection-properties-of-a-jtree-jlist-or-jtable/</link>
		<comments>http://renli.wordpress.com/2009/10/25/modifying-selection-properties-of-a-jtree-jlist-or-jtable/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 06:59:40 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Java Programming]]></category>
		<category><![CDATA[Kongzi]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=177</guid>
		<description><![CDATA[I like to write programs for those times that I come up with something elegant. What I really mean by that is when I learn something I didn&#8217;t really know before. Here&#8217;s today&#8217;s challenge: You have a very long JTree, and a need to select several things in that JTree (This could be a JTable, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=177&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I like to write programs for those times that I come up with something elegant. What I really mean by that is when I learn something I didn&#8217;t really know before. Here&#8217;s today&#8217;s challenge:</p>
<p>You have a very long JTree, and a need to select several things in that JTree (This could be a JTable, JList, etc.). The idea here is that if you make a mistake and click on something you will erase all your previous selections. So, you want to change the default behavior of click-select.</p>
<p>The why is simple: it&#8217;s a royal pain to remember to hold down the control key. Plus being as paranoid as I am about data entry I would constantly scroll up and down the list before clicking accept &#8211; just to make sure everything I needed was properly selected.</p>
<p>I kept telling myself how nice it would be to just click to <em>toggle</em> the selected status instead of having to control-click. To have toggling as the default behavior.</p>
<p>There are a few ways to do this, but the best way I could come up with was to handle the mouse click itself. JTree, JList, and JTable all have methods for determining which item is being clicked based on the getX() and getY() methods from the mouse event. So I declared a mouse click handler for my JTree (list, whatever). This is what it looks like:</p>
<blockquote><p><code><br />
private void specialClickSelectionHandler(java.awt.event.MouseEvent evt)<br />
{<br />
if((evt.getButton() == evt.BUTTON2) || evt.getButton() == evt.BUTTON3)<br />
{<br />
TreePath tmp = tagview.getClosestPathForLocation(evt.getX(), evt.getY());<br />
if (tagview.isPathSelected(tmp))<br />
{<br />
tagview.removeSelectionPath(tmp);<br />
}<br />
else<br />
{<br />
tagview.addSelectionPath(tmp);<br />
} // if it's currently selected<br />
} // if it's a mouse2 or mouse3 event.</code><br />
return;<br />
}</p></blockquote>
<p>Now, when the user right clicks, it will toggle the selection.</p>
<p>Digging around I found some <a href="http://forums.sun.com/thread.jspa?threadID=530254">similar code for tables and lists</a> on Sun&#8217;s Swing Archive, but keep in mind the code there uses isPopupTrigger(), and therefore needs to be modified for cross-platform use (since isPopupTrigger() works differently on different systems &#8211; see javadoc).</p>
<p>You could also use this technique to change the default action of the left mouse button, which might be a better idea. I don&#8217;t want any chance of mistakenly pressing left click and accidentally removing selections off-screen where I won&#8217;t see them dissapear. Well, there&#8217;s one headache gone. Now I can relax a bit more while entering the thousands of Chinese words I need into my database <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=177&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2009/10/25/modifying-selection-properties-of-a-jtree-jlist-or-jtable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>
	</item>
		<item>
		<title>Kongzi can now import CC-CEDICT</title>
		<link>http://renli.wordpress.com/2009/10/23/kongzi-can-now-import-cc-cedict/</link>
		<comments>http://renli.wordpress.com/2009/10/23/kongzi-can-now-import-cc-cedict/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 08:00:49 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Main]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=168</guid>
		<description><![CDATA[Yes, Kongzi Beta-5 can now import data from CEDICT (or CC-CEDICT). It has no problem loading up each of the over 100,000 entries and making them editable, searchable, and quizzable. Yet, there is a problem. It turns out that there is so much non-chinese information (such as korean characters, just as an example) and many [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=168&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yes, Kongzi Beta-5 can now import data from CEDICT (or CC-CEDICT). It has no problem loading up each of the over 100,000 entries and making them editable, searchable, and quizzable. Yet, there is a problem. It turns out that there is so much non-chinese information (such as korean characters, just as an example) and many unsupported (ancient?) characters, and the definitions so unwieldly &#8211; so many mistakes and missing pieces of information &#8211; that I don&#8217;t feel using CC-CEDICT is a good idea.</p>
<p>Looks like I&#8217;ll have to just keep adding characters one by one. It will take a while but beginners would only be interested in the first few hundred anyways, so I have my work cut out for me.</p>
<p>I suspect things would be different if there was any sort of organizational data in CC-CEDICT to help draw only on what would be useful, but due to several of the project&#8217;s stated rules (such as not creating a separate entry for parts of speech &#8211; a huge mistake in and of itself) and not including any frequency data or grading data (another huge mistake where learners are concerned) CC-CEDICT is actually quite useless for learners compared to better organized dictionaries or lists of words (such as the BLI or CYY lists, or the ones used to make Far East&#8217;s 3000 Learner&#8217;s Dictionary). In that respect you probably wouldn&#8217;t want to use CC-CEDICT. I&#8217;ll leave the import feature in, however, since you never know who may wish to use it for whatever purpose.</p>
<p>In other news:</p>
<p><img class="aligncenter size-full wp-image-169" title="kongzi-b5-mnmquiz" src="http://renli.files.wordpress.com/2009/10/kongzi-b5-mnmquiz.png?w=468&#038;h=172" alt="kongzi-b5-mnmquiz" width="468" height="172" /></p>
<p>As you can see I&#8217;ve recovered the Mix &#8216;n Match quiz feature. The Multiple choice quiz feature was also recovered. Some cosmetic changes will come later, of course, but all the logic is there. Some of the logic is even more advanced than previously. You will notice that at least one of the answers (if not more than one) is highly similar to the one being presented. For example, we include the character for seven, and the phonetics for eight and nine, when the proper answer is three. And so forth. In Mix &#8216;n Match, we include no, when the correct answer is yes. And so forth. It makes for a more difficult (and therefore more interesting/useful) quiz. Note also that you can&#8217;t use similar terms to help you narrow down an answer. The logic will also include head fakes (see the SI prefixes above or the numbers included with yes/no below). You really have to know the answer, no guessing allowed!</p>
<p>You&#8217;ll also notice in the above that pinyin tone numbers and tone marks have been mixed. This is because I haven&#8217;t finished entering the shortcuts in. That&#8217;s fine, the program always recognizes tone numbers (and will always recognize both interchangeably once I finish the shortcuts).</p>
<p><img class="aligncenter size-full wp-image-170" title="kongzi-b5-mcquiz" src="http://renli.files.wordpress.com/2009/10/kongzi-b5-mcquiz.png?w=418&#038;h=328" alt="kongzi-b5-mcquiz" width="418" height="328" /></p>
<p>The program is stable enough that I&#8217;ve started adding characters again (in order to have fun using it, and beta test it while doing so, of course!) In it&#8217;s current state it is very useable, however there are a number of things I&#8217;d like to do before releasing it and there are still a few bugs and things I haven&#8217;t hammered out yet. I&#8217;m still annoyed that I lost the memory game quiz. That was fun and amazing. Although now, the problem of word size has been solved by the implication it will select only from words of the same size (as such are organized by tags, providing a convenient solution). When I do reimplement it, I will cause it to toss in characters with the same radical (or which differ only by a radical) to help the user learn to visualize and discern between characters. I have high hopes for that feature.</p>
<p>I&#8217;d like to have at least 1,000 characters in the dictionary before I start public beta testing. One important organization is the grading scheme (A, B, ss, or Jia, Yi, Bing, Ding, etc.) used by some government testing programs, HSK grading, and that sort of thing. Which brings me to frequency representation. What a headache! I could easily include three different items for frequency and have them all be different. Instead of causing needless headaches, or lying to the user that only one number is accurate, I think that the best way to use &#8216;frequency data&#8217; will be to allow the user to import frequency order lists from a file. That way if the user decides to switch from one order to another it would be an easy thing to do. This way I also save myself from having to write special code to determine which particular frequency order they were using. Brilliant!</p>
<p>Now, back to adding characters to the dictionary&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=168&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2009/10/23/kongzi-can-now-import-cc-cedict/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2009/10/kongzi-b5-mnmquiz.png" medium="image">
			<media:title type="html">kongzi-b5-mnmquiz</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2009/10/kongzi-b5-mcquiz.png" medium="image">
			<media:title type="html">kongzi-b5-mcquiz</media:title>
		</media:content>
	</item>
		<item>
		<title>Populating Trees and Lists in Java</title>
		<link>http://renli.wordpress.com/2009/10/04/populating-trees-and-lists-in-java/</link>
		<comments>http://renli.wordpress.com/2009/10/04/populating-trees-and-lists-in-java/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 15:32:26 +0000</pubDate>
		<dc:creator>Usagi</dc:creator>
				<category><![CDATA[Java Programming]]></category>
		<category><![CDATA[Kongzi]]></category>
		<category><![CDATA[Main]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://renli.wordpress.com/?p=154</guid>
		<description><![CDATA[I&#8217;d like to comment on what went into the new Font Chooser dialog for Kongzi Beta-5. The problem can be posed as follows: Create a dialog box that takes, as input, existing data. Complication: Selecting a value on some lists will change the contents of the others. Obviously this sort of design pattern would have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=154&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to comment on what went into the new Font Chooser dialog for Kongzi Beta-5. The problem can be posed as follows:</p>
<p><em>Create a dialog box that takes, as input, existing data.<br />
Complication: Selecting a value on some lists will change the contents of the others.</em></p>
<p>Obviously this sort of design pattern would have important usages; configuration boxes, persistant user profiles, and so forth. Or, for example, a specialized Font Chooser &#8211; which is the example I&#8217;ll discuss. Take a look at this screenshot from Kongzi Beta-4:</p>
<p style="text-align:center;"><img class="size-full wp-image-121 aligncenter" title="Kongzi Beta-4 Japanese Fonts" src="http://renli.files.wordpress.com/2008/01/kzb4-jfont.png?w=430&#038;h=391" alt="Kongzi Beta-4 Japanese Fonts" width="430" height="391" /></p>
<p>I remember how fiendishly difficult this was to code the first time around, so the second time around I was prepared. The problem would be that I had to follow a special order: populate the language box, select the language, then use that event to populate the font box. But then I had to interrupt the normal order of things and populate the font box before I selected the font from pre-existing data. I couldn&#8217;t think of a way to do that without cutting and pasting code or creating a very convoluted logic.</p>
<p>But worrying about that before I wrote any code would drive me insane. So I plunged in head first, fleshing out the dialog box in Netbeans, then adding several methods to find and select values in the list, such as &#8220;SelectLanguage(String)&#8221;. That way whenever I wanted to, I could populate the dialog box with pre-existing data, in this case, the language and font data that had been selected previously. This is important, of course, to provide a smooth user experience.</p>
<p>Then the nasty null pointer errors started. Basically because of the logic/flow problem I described above. The logic for populating from pre-existing data, and the logic to modify itself based on user input, was too difficult to reconcile. When I tried to populate language, the size box wouldn&#8217;t be populated yet, so I couldn&#8217;t preview sample text for the new language. If I tried to populate the size box first, this would also trigger a preview event which would crash. The workaround in Kongzi Beta-4 was to include a preview button as shown in the above screenshot. Then I was technically excused from having to do anything. But just because I put a button on it doesn&#8217;t mean it wasn&#8217;t a giant kludge. For Beta-5 I wanted something smoother. I wanted to use the same logic at all times, the same entry points, and I didn&#8217;t want a preview button. I wanted selection events to populate everything.</p>
<p>The key to my final solution was in realizing that when I sent commands to the lists, such as fontList.setSelectedIndex(i), I was going to trigger events which would send me back into the auto-population and auto-selection methods. This is how it had to be, to avoid cutting and pasting code, making a terrible mess. Yes, I wanted to follow &#8220;accepted practices&#8221; of reusing the same code which auto-populated the lists to accept events and propagate their own data to other lists. Doesn&#8217;t everyone?</p>
<p>The first idea I had was checking for null pointers and then skipping over those lines of code. I rejected this almost immediately because of the difficulty it would present to doing any sort of error checking. I would in essence be assuming that any time I encountered a null pointer, I knew why it was there; and that was simply untrue. To write proper code, I would then have to write a second check to determine if the null pointer was there because there was a bug, or simply because the dialog wasn&#8217;t fully populated yet.</p>
<blockquote><p><em>Or, as an aside, populated properly. I saw the potential for sloppy logic to start creeping in, caused by my abuse of checking for null pointers. In horror, I imagined several cases where entire blocks of code would never execute because they would always be called at a time when null pointers were there. I imagined terrifying cases where a population function would be called four, five, or more times, each time getting sent back with a null pointer, until the dialog was finally ready to accept the input. I recoiled from checking for null pointers, and resolved to find a better way.&#8221;</em></p></blockquote>
<p>After staring into the monitor for a while, I came up with the idea of using boolean flags to keep track of what procedure I was in. The solution worked like a charm. I created several class-wide variables such as &#8220;boolean populatingFontList&#8221;. Any time a method dialog was performing an operation on a list where the selection would change as an unintended consequence, I simply set &#8220;updatingFontList&#8221; or &#8220;updatingSelectLanguage&#8221; (or whatever) to true. Then, at the beginning of that function (and any other appropriate place) I would put in a clause which prevented anything bad from happening. Usually something like &#8220;if (updatingFonts) return;&#8221; at the beginning of a troublesome function.</p>
<blockquote><p><code>populatingSelectLanguage = true;<br />
selectLanguage.removeAllItems();<br />
populatingSelectLanguage = false;</code></p></blockquote>
<p>Then when the program fires off it&#8217;s little events as a result of you removing whatever item was selected, you wont get an error because the font list isn&#8217;t populated yet. And so forth.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/renli.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/renli.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/renli.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/renli.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/renli.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/renli.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/renli.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/renli.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/renli.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/renli.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/renli.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/renli.wordpress.com/154/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/renli.wordpress.com/154/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/renli.wordpress.com/154/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=renli.wordpress.com&amp;blog=863765&amp;post=154&amp;subd=renli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://renli.wordpress.com/2009/10/04/populating-trees-and-lists-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9ad55d2ef2c031b01d0ec88c7696641d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Oliver</media:title>
		</media:content>

		<media:content url="http://renli.files.wordpress.com/2008/01/kzb4-jfont.png" medium="image">
			<media:title type="html">Kongzi Beta-4 Japanese Fonts</media:title>
		</media:content>
	</item>
	</channel>
</rss>
