Just Another Blog

Are you thinking what I'm thinking?

Wednesday, November 26, 2003

Say NO to IE

Today I found a real good collection of articles about anti-IE. The slogan "say NO to IE" attracts me. Just like "say NO to drug". Haa... There is another VERY INTERESTING finding: CSS can kill IE. See 我要當掉我的IE. Think twice before clicking if you are really using IE... =P

Also, I found a typo in a logo made by me! How come no one tell me... T__T
Let me fix it...

Wednesday, November 19, 2003

Are Application Developers Stupid?

I've been using OpenWiki for nearly 2 months. But I just realize how stupid the author is: there is no index in his database design!!! Also, there are only 2 foreign key constricts (But there are 8 tables!). Actually I knew about this already quite a long time ago. But I didn't make any change as I didn't know what will happen if I altered the design.

However, after creating the indexes tonight, Wiki looks running faster! I think if I use database other than MS Access, the improvement should be more obvious. (^-^)

Maybe all application developers who work with database should take a database course mandatory, so that they will know how B-trees and R-trees (and other indexes as well) can help them improve query performance when the queries only select a small percentage of rows in a table, just like the case in Wiki.

Saturday, November 15, 2003

An Exciting Day

Today we found a very interesting Wiki: UseModWiki. Although it is a file-based Wiki and doesn't look so good at the first glance, it is actually very powerful (compared with the other Wiki in Perl)! Some highlighted features: preview, subpages, interwiki, page redirection, edit conflict detection and resolution, free link, page index, etc.

Then I found a UseModWiki Korean Extension, which is EVEN BETTER! It adds things like double-click edit, orphaned pages, wanted pages, syntax highlighting of program code, emoticon, etc.

The only thing that is not so good is that the UseModWiki consists of mainly one file only! @__@ wtf... But anyway, we'd probably use it to replace our exisiting Wiki which is so rubbish.

We also had a great meeting with Miss Mong. Now seem everyone got his target.

The database lecture after the meeting is again very good. Tonight's topic is skyline retrieval. Again, R-tree plays an important role in this kind of queue. This data structure and its related algorithms are so amazing! Hmm... I think my interest in such topic is increased a bit.

Thursday, November 06, 2003

My Site's Ranking in Search Engines

I found my Wiki (http://minghong.xroad.com) is listed in Google and Yahoo! Yeah ^o^... Let's see if anyone would enter my Wiki like this... though it is not the first URL listed (It is the fourth, not bad...).

Wednesday, November 05, 2003

Helping Hands

I've just receive an email from Michael Ash, a guy who wrote the How-to for legOS. (I sent him an email, asking him about how to use LNP... ^^::)
I feel so happy. He is really very kind. And the email that he replied is quite long too... o..o||

> Hi,
> I'd like to have inter-RCXs communication and PC-RCX communication
> using
> BrickOS (formerly legOS). I found several useful pages like
> http://legos.sourceforge.net/HOWTO/x405.html and
> http://news.lugnet.com/robotics/rcx/legos/?n=788. But I can't find any
> example
> code. By just reading the manual, I don't quite get how it works,
> probably
> because I don't have network programming background.
> I'd like to know if there is any example programs. It don't need to be
> very
> complicated, a very simple one is good enough. For example, RCX A
> (sender)
> send something to RCX B (receiver), then RCX B response by beeping.
I've attached my lnpmsg.h and .c files in case they help. Most of what they contain is already in the HOWTO, but maybe the extra code will be useful to you.
I haven't programmed for legOS for a couple of years, so I'm a bit rusty, but hopefully I haven't forgotten everything. (I keep meaning to get back into it, but life continues to intervene.)
The best approach is to take the packet_handler function as-is. As I wrote in the HOWTO, you don't want to do anything complicated or lengthy in the packet handler, just copy the message someplace safe and mark a flag that it has arrived. You can then have a thread which waits for the gNewData variable to be set, and then acts. (Code for this thread is in the HOWTO section you pointed out, near the end.) Sending the message is fairly easy, you just use lnp_addressing_write, or the my_addressing_write function in lnpmsg.c which makes sure everything is thread-safe and also makes sure the message is actually sent (although it can't make sure that it's been recieved). So what you can do is something like this on the sending end:
char msg = kBeepMsg; // define kBeepMsg somewhere as a number or
// character to mark the 'beep' message
my_addressing_write(&msg, sizeof(char), other_rcx_address, my_source_port);
And on the recieving end, in your PacketWatcher function, see if the first char of the incoming message is kBeepMsg and act accordingly.
The only thing left is addressing, which is a bit complicated as I never did RCX-to-RCX communication. But the basic idea is you set the address in your legOS kernel somewhere. (I forget where exactly....) Then you have two copies of the kernel, each with a different LNP address. Upload one to one RCX and the other to your other RCX. Then in your program, you can #define the address of the other RCX as you can see in the lnpmsg.c file. Once they both have unique addresses and know the address of the other one, they should be able to communicate.
Hopefully this will get you started. Network programming can be either simple or complicated, depending on what you want to do. Once you get the basic messaging working and you work on more complicated things, keep in mind that in LNP your messages are guaranteed to be uncorrupted, but that they are not all guaranteed to actually arrive. Write your code with the idea that some of your messages will not make it through.
If you have other questions, please feel free to write back.

Tuesday, November 04, 2003

A Day of Photoshop

I had designed a CS logo yesterday. Now I'm trying to change it a little bit. Let's see if it will look better.

I've also selected some good photos from the gallery. The photos are taken by students like Yulam and Sing (I don't know if I spell it correctly) and the people in Lab at Nov 1. I've retouched them so as to reduce the grains resulted from scanning of the films. The photos on the gallery are the original ones, or the retouched ones. =P

About Me

An ordinary Hong Kong young man, graduated in computer science at City University of Hong Kong in 2005, who likes surfing, blogging and watching anime/manga. An evangelist of web standards, non-toy Databases, Mozilla, Google, Gmail, and Blogger.