205 karma · joined November 10, 2009
I threw this together in a couple hours:
Oh, and it requires some form of sign in since it has a persistent world.
This method is so much less error prone than pulling stuff out a byte at a time. Plus you can use unions for network addresses, etc.
It's a simplified example to show what you can do.
struct packet_header { uint from_addr; uint to_addr; ushort flags; ... }
packet *p;
read(socket, somebuf, sizeof(packet));
p = &somebuf;
printf("from = %u to = %u flags = %u\n",p->from_addr, p->to_addr, p->flags);
It's a fun game usually.
I know so many people who've just done basic CRUD business programming. Smart people, really smart people, but they limit themselves; don't try to do anything deep and interesting, and it's sad.
You can also use either process with Aluminum sheet. both have their advantages.
Also, We had a Tandy Coco when I was a kid, I've had enough of chiclet keyboards. I'll be happy when Apple moves away from that.
Their brew master is my neighbour, super nice guy.
A good, well tested binary search is a pain in the ass to write...
1. Your sorted array MUST use exactly the same ordering as the search is expecting. We built and sorted the array on a PC, and ran the search on the device, so this was not guaranteed.
2. There can be NO DUPLICATE KEYS.. Duplicate keys will eventually send the search down a blind alley and off into hyperspace. Also devilishly difficult to find if the array has a lot of items, and you don't know what the problem is.
3. The above 2 problems can sneak in during production with new data.
http://www.amazon.com/ARM-System-Developers-Guide-Architectu... is a good book, you might want to buy a copy.
Some handy things to know about ARM.. logical operations can be added on to ALU instructions for free -- lots of speed gains there...
If you have never done any embedded programming; expect things to take longer to write, and frustration levels can be pretty ugly.
If you get an ARM chip that doesn't have floating point, and you need to do something mathematically intensive, look into fixed point math. Make everything you can into a table (most ARM chips have enough memory so that you can trade space for speed)
Don't give up -- embedded requires tenacity.
Oh, and Codesourcery provides good pre-compiled toolchains, but you have to dig around on their website a bit to find them.
Un^H^Hfortunately I'm not at work to test. :)