Android Lightsaber

July 31st, 2010 View Comments

Chop everybody’s head off, de-activate the saber and walk away proudly. Use the force with Lightsword, an app to simulate a lightsaber in android. I’ve spend some time to fine tune the accelerometer to provide a smooth interaction — you just have to activate the sword and swing your phone around.  Works great at bars :) Trust me on this one. Now go try it.

QR code for Lightsword

QR code for Lightsword

Tags:

Android Theremin is out!

July 19th, 2010 View Comments

Theremin is finally released on Android Market. It’s in alpha stage, but I will be updating it quite a lot. For now it might be used to produce sounds based on the magnetic field around your phone. You can manipulate it using a metal object such as a coin or your ear phones. It might serve as well as a metal detector! :)

There is a video showing Theremin in action.

I would really appreciate some feedback and feature requests. I hope you enjoy it.

Theremin

QR-Code for Theremin

Tags:

Android Theremin prototype *updated*

May 27th, 2010 View Comments

"I'm so much cooler than you guys playing violins..."

Theremins are weird musical instruments. They consist basically of two antennas, the player moves its hands around it, altering the magnetic field. The device then registers this changing, playing creepy sounds. Take a look at this Pato Fu’s song and a lesson on how to operate a Theremin.

So I’ve bought an HTC Tattoo and of course, decided to try to develop apps for it. The whole SDK is amazing!

The concept of a Theremin can be implemented on Android, since the phones have a digital compass and registers the magnetic field in 3 axis (!).  Here is the first prototype and my very first Android app. yey! \o/

Its possible to change the magnetic field registered by this mobile using a coin. The closer the coin gets, the lower is the note. Actually real theremins work in the opposite way :)

*Update!*

Click here for the first version

Now, those notes are redered .ogg files of C scales =/ Android doesnt have a MIDI toolkit, right? I want to be able to produce my own frequencies, so the user could manipulate them like in a real theremin.

Tags:

Using string distance to compare sketches

May 10th, 2010 View Comments

post-it with the map

There is an article called Trainable Sketch Recognizer for Graphical User Interface Design from A. Coyette and others showing an approach to recognize pen-made sketches based on Levenshtein distance algorithm for string comparison.

The article talks about recognizing elements of user interface such as buttons, combo boxes and windows, when they are sketched by a designer. Well, they do that by using Levenshtein’s String Distance algorithm. Thats right, an algorithm created for string comparison to check if they are closer or not, in terms of character swapping. You know, when there is a typo on you search at google like “algoritm”, it says “you meant algorithm”. Thats a string distance algorithm working. It is really simple and I was quite amazed about how good it worked for Sketch.

So, what the authors of the article did to transform drawings into words? First you need to assign a number for each cardinal point, to compose your words. Lets say 1 for north, 2 for northeast, 3 for east, and so on. Then take the points (x,y) of the sketch and then each pair is compared to the next one, if the point is at north of the previous one then its a gesture going up and the character relative to North its added, 1.


How do you know what cardinal point each pair of x,y belongs relative to the previous is easy, take a look at the post-it at the beginning of this post (its actually a post-it, its on my wall). Lets get two points A and B, if (B.x – A.x) its positive and (B.y – A.y) its zero, then B its at East of A. If they are negative and positive respectively, then B its at SouthWest from A.

So a square would be something like: 3333333355555557777777111111111
A triangle would be like: 45454544537777777782232312


But people draw things differently, you may start a square by moving your pen South, instead of East, for example.
Since the algorithm its so fast, you may compare your sketch to several samples of squares, several words, or even better, let the user tells your application what he/she meant with that they just drawed.
“this is a square, learn the way I do”

Its a powerful tool which combined with other algorithms such as corner finding could give a fingerprint of the user’s sketch.

This is implemented as the single one algorithm responsible for recognition on the Sketch Shapes Application. There is more about this on the way, as the project matures: new algorithms will take place, but I think it couldnt be any simpler than Levenshtein’s.

Kudos for Coyette and the team.

Tags:

First steps of Eclipse Sketch

May 8th, 2010 View Comments

What do you think of this logo? (Click on it.)

Good news, the Sketch project was finally created! You may find it at http://www.eclipse.org/sketch

Although some improvements and refactoring are taking place right now, the API is already usable if you would like to pre-alpha-test it. :)

Me, Chris and Mariot have decided to go for Git as the version control. We are a fresh new project, so there were no reason not to: http://git.eclipse.org/c/sketch/org.eclipse.sketch.git/

Be aware that we are still re-organizing everything, and the code will be probably changed a lot, but if you see something really ugly, please file a bug.

The future of Sketch, as I envision it, includes users drawing their own graphical representations for models, being able to make suggestions to existing models using their own vocabulary and ultimately writing their own models. There is a very interesting discussion on this regard at the forum. If you are interested, please join it.

As for the present, I’ve prepared two videos for FlexiTools’2010, showing the features already available in Sketch.

1. VIDEO Creating a Use Case Diagram

Here I extend the Shapes editor (which is only able to model Squares and Triangles) to build such diagram.

2. VIDEO Creating an Activity Diagram and Making Annotations

Here is a slightly more complex example, plus annotations, which is the most immediate outcome of Sketch, since no recognition is needed.

Installing the Eclipse RCP Delta pack (for beginners)

May 5th, 2010 View Comments

I’ve decided to write this little step-by-step illustrated guide to help out some fellows who were always having trouble on exporting Eclipse products for multiple platforms. This is a little different from the steps you find here and here.

What is the Delta Pack?

It’s a zipped Eclipse package with all the needed plugins to export your RCP product to many platforms (Windows, Linux, Mac, and so on) without having to do that on a platform’s native Eclipse installation. The archive contains all the platform specific fragments from the Eclipse SDK.

Situation

You have either

  • a .product of an already existing project (I will use Sketch product for Shapes Application as the example here)
  • you have your .product with your native installation dependencies and want to export to multiple platforms
First, check your version

First of all, check your Eclipse version, the delta pack you will download must have the exact same version, which means (yes) you will need to download another delta pack in case you update your Eclipse. But fortunately the steps are really easy to follow.

In my case, the version is Galileo 3.5.2 and the build is M20100211-1343, so look for that delta pack. Googling “delta pack <build name>” should give you the link, the file is usually like eclipse-M20100211-1343-delta-pack.zip

Unpack it into any folder. I usually place inside my own eclipse directory, inside a folder called delta.

Adding the delta pack to your Running Platform

Go to Window -> Preferences -> Plug-in Development -> Target Platform and Edit your current Running Platform.

Click Add..

Select Installation

Browse for the folder where you extracted the delta pack (mine is inside my eclipse folder, inside a folder called delta.

It will show all the packages for all platforms. See the swt for win32 64 bits, linux and everything. Click Finish and it will reload your platform (it might take a while).

If you open up your .product definition, and click Add Required Plugins, you shall see all the plugins.

If you go at the Overview tab of your product, click Export Product export wizard, and there it is, Export to multiple platforms.

Now you are able to generate your RCP product for any platform Eclipse is built for. Enjoy!

http://git.eclipse.org/c/sketch/org.eclipse.sketch.core.git/
Tags: ,

Speeding up Eclipse (a bit) with +UnlockExperimentalVMOptions

April 30th, 2010 View Comments

Although Sun’s JVM had this for quite a long time now, you might not know you can turn on some experimental options such as UseFastAccessorMethods and UseG1GC, which is a new garbage collector that uses parallel processors.

This might improve quite a bit your Eclipse’s performance, it improved mine. So try it out and share what did worked for you.

Warning: do NOT turn those flags on at your production environments.

Just add to your -vmargs launching arguments:

eclipse -vmargs

-XX:+UnlockExperimentalVMOptions

-XX:+UseG1GC

-XX:+UseFastAccessorMethods

Some people reported a great improvement in performance, not only in Eclipse, but also in other Java apps. For me it improved a little.

Some people also used other parameters (which didnt worked for my environment).

A complete list of jvm options may be found here, some are interesting like:

-XX:+AggressiveHeap
-XX:+AggressiveOpts
-XX:ParallelGCThreads=2
-XX:ThreadPriorityPolicy=1

Does it works for you? Please comment.

Tags: ,

New Home

April 21st, 2010 View Comments

Finally my new home is up and running, I was tired of having to update two blogs: blog.ugosan.com (in english) and coisasqueaconteceramcomigo.wordpress.com (in portuguese). On top of that, i didnt had space to make some things available decently like materials, references, papers, and so on.

Handmade bird shelter, no guests so far..

I’ve decided to put everything in one place, so I bought a host with Dreamhost, setup a WordPress (love it) with WPML for multi-language support (amazing!), and now we are up and running.

This is and will be my home from now on. If you are interested on the same things I am, follow me :)

Tags:

Sketch: Flexible Graphic Model in GMF (+Demo Video)

April 18th, 2010 View Comments

Sketch LogoThere’s a long time since i’ve blogged about the FlexiTools’2010 workshop and the discussion about a flexible graphic representation made possible in Eclipse graphical editors.

Here we talk about creating an intermediate element which holds a flexible graphic representation, in opposition to it’s canonical one (which in GMF is defined at .gmfgraph model). The users would be able to draw the elements as they wish, and as well be able to create new ones, something like this:

Here is a video explaining how it works, please watch and comment (go to Sketch Forum):

More Ideas for Sketch API

March 11th, 2010 View Comments

I’ve just submitted a position paper to FlexiTools’2010, in which me and Simone outline our ideas for the Sketch API, which i’m carrying on with Chris and Mariot.
Take a look at the paper:SKETCH: Modeling Using Freehand Drawing in Eclipse Graphical Editors

The main idea is the approach of the modeling task as a twofold process — one of freely sketching models with little interruption from the system; and another more formal, “classic modeling”, recognizing the elements drawn by the user right away, having as output a model in its canonical representation.

By letting users draw the model using their own graphic representation, we are allowing the GEF/GMF editor to be more flexible regarding its visual notation. For instance, assuming a simple model with the elements named flower, sun and cloud – they might be connected and generate an output or might serve as input for other models. A user might draw the flower element, for instance, in infinite ways, having any number of petals, with or without stem, and so on.

This allows the creation of a “graphicless model”, without predefined visual counterparts to the model elements, just elements and relations — the user would choose how elements will look like. That means the .gmfgraph would just hold the canonical representation, but the real one will be the user’s.

 So, on Eclipse GEF/GMF frameworks side, some minor modifications will need to take place:

  • The underlying model (Ecore?) will need a generic element to serve as an ‘unrecognized’ element, to be created at the model while the user does not signifies it as anything
  • make the editor flexible enough to hold any graphic representation for it’s elements, representing it using an SVG with the sketch. Also, this approach can also be used to make annotations on existing models, since the user might be able to create an “annotation” element.

Those are all feasible, so little adaptation would be needed to plug sketch onto GEF/GMF editors :)

Don’t you think?