Saturday, February 28, 2009

Cocoa: Drag & Drop

Today a simple example of Drag & Drop with Cocoa and NSView. The screenshot below shows two groups. In the first one, you can drop the photos on your filesystem, taken from Desktop or Finder. In the second group, you can only drop the first group image.

You can find the source code here: Drag & Drop Test Source Code.

Tuesday, February 24, 2009

OpenMoko: First Upgrade 2008.12

OpenMoko was "just" arrived, and is already time to Upgrade. As Open Moko Getting Started says "According to the FAQ and Distributions pages, all phones ship with Om 2007.2. "

If you want take a look at the /etc/version file you will find something like this (in my case the code is this) 200804240820. Ok, it says 2008.. but is 2007.2.

Preparing the PC
Download the uImage and RootFS from the OpenMoko respository.

Shutdown your device using the Power Button (bottom right) and click on "Shutdown" menu item.

Connect PC and Phone with the USB cable (in the pack).

Press and keep pressed the AUX button (top left) on the Phone and, at the same time, press the Power button (bottom right).

Ok, Now you're in the U-Boot Menu, is something like GRUB.

Press AUX, Three times until you're on the "Set console to USB" item and then Press Power. (AUX is used to move between items, Power is the "Enter" button).

Then replace the Kernel and RootFS:
dfu-util -a kernel -R -D <kernel path>.bin
dfu-util -a rootfs -R -D <rootFS path>.jffs2

That's all! Reboot your Moko and try the new Software.

Setup PC Network:
ifconfig usb0 netmask
iptables -A POSTROUTING -t nat -j MASQUERADE -s

Connect to Moko using ssh:
ssh root@

Thursday, February 19, 2009

QtContest NEO FreeRunner is Here!

The NEO FreeRunner of Nokia/TrollTech QtContest, is Here! with a great Qt T-Shirt!

Thanks Nokia/TrollTech!

Sunday, February 1, 2009

Data Structures: B*Tree

Hierarchy and Relational Databases Doesn't Scale well For Humans, they add Structure. They only scales well for an amount of structure that is feasible to learn.

I'm Writing a Library that contains some data structure useful for data indexing, this library will be the base for a simple FileSystem and it can be simply used by Applications to store and retrieve data efficently. Today I've finished the B*Tree Implementation, Now I've to implement something for full-text search like Suffix Tree or similar data structure.

Balanced trees are used in databases, and more generally, wherever a programmer needs to search and store to non-random memory by a key, and has the time to code it this way.

Internal Nodes

Internal nodes consist of pointers to sub-trees separated by their delimiting keys. The key that precedes a pointer to a sub-tree is a duplicate of the first key in the first formatted node of that sub-tree. Internal nodes exist solely to allow determining which formatted node contains the item corresponding to a key.

Leaf Nodes

Leaf nodes contains information, Information are stored in Items and each of which is identified by a key used to identify data and to keep sorted the tree. An item is a data container that is contained entirely within a single node, and it allows us to manage space within nodes. Every item has a key, an offset to where in the node the item body starts and a length of the item body.

If you want more information about this Project feel free to contact me, else you've to wait the first release of the project :)