Archive - Jul 6, 2007

Date

Fujitsu Siemens Pocket LOOX 600, trying to get one from China

I will be arriving at China on July 11th, 3:30 AM, Beijing time. I planed ahead on everything I want to do in next 2 month. A new one just inserted itself onto my list--get a LOOX 600. LOOX 600 was never released in US. I ought to hug one during the stay in China. Finally it happened
Fujitsu Siemens Pocket Loox 600 in full color

LOOX 600 was priced at £399 in UK back in 2002. The price in UK now is unknown to me. But in China, LOOX 600 became a very popular item after the late 2003. Even today, more than 1k of LOOX 600 is listed on Taobao.com, the site who beat ebay in China. A new one costs ¥780 with ¥20 shipping (around $105), a reasonable price for me. I'm extremely filthy rich(compare to all my siblings) and dripping gold every time I go out on a sunny day (if you know what I mean).

LOOX 600 equips with Intel XScale 400Mhz core and running PocketPC 2003(or 2002). PDF are pretty much the only kind of file going to be on my handheld, so the 320*240 64K true color TFT screen, 132 x 82 x 17 mm size,175 g weight and 64MB ram are extra nice. Running Happily The ROM is 32MB Flash, which is a bit small, but I can always get a 1G SD card boost. The battery says can work for 10 hours after each full recharge.

LOOX 600 is the dream handleheld! Glad I found a bunch cost only a bit beyond $105 (with S&H). Finally, Palm Z22 handheld $99 (without S&H) can never compare with the nice and cheap LOOX 600.

Game Programming Golden Rules

in

Game makers, you have to read this.
The things for about C++ complier is super mad!!!!!!

Status: 
On Hold

C++ Learning Note

Crashes!

unsigned char map[5242880];

Does not crash!

unsigned char* map = new unsigned char[5242880];

Copy some memory to another place

memcpy(pointer destination ,pointer source ,int bytes);

Helping people is the way to be

in

I'm getting around 3 help requests per day on Qunu.
cool things about helping people:
Learning while helping.Running Happily
A good example is the article I wrote about looping though multiple associative arrays. When will I ever relate to such a topic in my daily life? Never.
Earning while helping.Finally it happened
Earning respect and site visitors. Promote a website after just finish someone's impossible job just works!
Respect...Cool glasses

1D segment intersection detection part 2

After the part 1 of the tutorial, part 2 is born to kill.

I have one small tweak for the naive method, in theory, it will can only speed up the detection. so if your segments are always in extreme condition and keep running to the worst case for the previous algorithm, with this one you can't lose much.

Sort set B and compare with set A, but this time, If a x1 for one segment in set B is larger than the x2 in a set A segment, break the loop because all the x1's after that segment will have larger x1 values.
Just change following part in the original code:

for(i=0;i<size;++i){
    for(n=0;n<size;++n){
        if(b[n].x1<=a[i].x2 && a[i].x1<=b[n].x2)
        {
            ++counter;
            }
    }
}

to

for(i=0;i<size;++i){
    for(n=0;n<size;++n){
        if(b[n].x1<=a[i].x2)
        {
 		if(a[i].x1<=b[n].x2){
            		++counter;
		}
        }else{
        	break;
	}
    }
}

This code is usually good enough for most detections you will ever use if you use it to create a game(unless you have 20000 3D objects flying around).

To extend the 1D segment detection to 2D axis aligned bounding rectangle detection. Create a pair of y coordinates and x coordinates for each rectangle. Do the x's and y's separately. When both 1D segments for x and 1D segments for y need intersects, those 2D rectangles intersects. Same for 3D boxes, just add the z coordinates.

When come to databases, advanced algorithms comes to play.

Currently, all the fastest algorithms in this field works with tree structures. I believes the best thing for the 1D problem is the interval tree, a data structure mentioned in both Introduction to Algorithms and Computational Geometry1. While segment tree costs O(nlog(n)) memory, interval tree cost O(n) memory and just as fast.

Quadtree and Octree proven useful in 2D and 3D respectively.

For hardcore n Dimension hyperrectangles intersection detection, try PR-tree, a R-tree variant.

  1. 1. two books completely shatters the idea "Me can understand anything!"
Honey Pot that kill bots