Nov 2, 2010

Android is smoking

This is my first Android development test using the NDK and OpenGL-ES. I quickly adapted some simulation code I found on the web and rewrote the rendering layer to make it compatible with OpenGl-ES. I also fixed a couple of bottlenecks to make it run faster. Here's a video of the result.



So far I like working with the Android NDK and OpenGL-ES although I'm not a big fan of the Eclipse IDE (development environment). Now I'm going to start a shippable project to really get the feel for this new platform.

Snow balling

I admit I'm still buying Legos and a vast majority of those are Lego Technics and Mindstorm that I use for prototypes and robots. But, from time to time like any 37 year old kid, I get a kit simply because it looks cool. Hence I have the Lego X-Wing.

This magnificent piece of design dating from the back-when-lucas-was-good era was siting on my work desk and my son, playing with it, said “Dad, can you make the ladder to climb in?”. Any reason to get my Legos out is a good reason, so Voila!



My son was happy but, like any good geek would, he had the obvious thought; what about the cane gizmo to get R2 in and out of the ship? The clouds parted and a ray of light beamed down on me. I was so ready for his demand... maybe I was too ready.
Not only did I built it but I made a working version using Lego Mindstorm motors and the remote control.



The rotation is powered with gears and the up-down motion is done with a pneumatic piston and a switch to select up or down (directing the air flow to the top or bottom of the piston). This extra manual step will come back to haunt me latter.
After watching my son playing with the crane for a bit, it was apparent that it's reach had to be improved. After all, I could still plug a third motor to the system. Some minutes latter version 2 was alive.



The base is resting on gliding 'skis' and stays in place because two of them are sitting in a groove. One side of the groove serves also as the row of teeth used by a gear (attached to the crane base) to pull or push the whole system. This gear is using a pulley system and so it just slips if the kids reach the end of the tracks (no grinding gears). The pneumatic switch had to be repositioned so that it would not jerk the whole assembly every time it's used (that switch is a real pain). Finally. the arm of the crane was also lengthened.
The kids (and I) played with that version for days. I added a weight in the back to prevent the 'gliding gear' to skip. This is the final version of this design:




In conclusion
The main problem with this crane is the pneumatic switch. All the other movements are made with the remote and the switch make the experience of using the crane awkward.

A second important point is to make it error proof. The pneumatic piston system and the pulley system permit the errors in the crane manipulation without breaking anything. On the other hand, the direct gears that are used to rotate the crane can skip, grind or break if something goes wrong. Also the tubing for the piston prevents the crane from doing a continuous rotation and could rip of. (We had a terrible accident where Han Solo was thrown across the flight deck...)

So the next project will be a new crane with a completely different design that can lift heavier loads and where all the controls are done using the remote. This system will also be error proof by using systems like:
* Pulleys
* Slip gears
* Automatic reverse

“Gentleman, we can rebuild it. We have the technology. [...]”

Oct 28, 2010

The neverending Story Points

Here's my second shot at explaining Story Points for estimation in Scrum:


When I switched to points I decided to if I could meet those two points;
1) find and argument that justify the switch and that will convince the team
2) Find an easy method to use it.


Phase 1: Convincing
It took me a lot of reading on the subject but a finally found the argument that convinced me and my team: It’s nearly impossible to find two programmers that will agree on the time a task will take but the same two programmers will almost always agree on which task is the biggest when shown two different tasks.
This is the only skill you need to ‘estimate’ your backlog. Here I use the word ‘estimate’ but at this early stage it’s more like ordering the backlog from tough to easy.

Phase 2: Putting Points in the Backlog
This step is done with the participation of the entire scrum team.
Start dropping the stories one by one in a new spreadsheet while keeping the following order: the biggest story at the top and the smallest at the bottom. Do that until all the stories are in the list.
Now it’s time to put points on those stories. Personally I use the Poker Planning Scale (1/2,1,2,3,5,8,13,20,40,100) so this is what I will use for this example. At the bottom of that list you’ll probably have micro tasks (things that takes 4 hours or less to do). Give to every micro tasks the value of 1/2. Then continue up the list by giving the value 1 (next in the scale) to the stories until it is clear that a story is much bigger (2 instead of 1, so twice bigger). Now using the value '2', continue up the list until you find a story that should clearly have a 3 instead of a 2. Continue this process all the way to the top of the list.
NOTE: Try to keep the vast majority of the points between 1 and 13. The first time you might have a bunch of big stories (20, 40 and 100) and you’ll have to brake them down into chunks smaller or equal to 13.
That is it for the points and the original backlog. If you ever have a new story, compare it to that list to see where it fits (bigger/smaller process) and give it the value of its neighbors.

Phase 3: Velocity & Estimation
To estimate how long it will take you to go through that backlog, do the first sprint planning. Make the total of the points attached to the stories the teams picked and VOILA!, that’s your first velocity measure. You can then divide the total of points in the backlog by that velocity, to know how many sprints will be needed.
That velocity will change and settle in the first 2-3 sprints so it's always good to keep an eye on that value

May 6, 2010

Serendipity

If you get unwanted or strange results, don’t dismiss them right away.


Ask yourself the question “Can this be used for something?” If it might, take notes of all the parameters so you can reproduce this result whenever you want. Think of it like experimental cooking, if you find something great you save that bunch of steps and ingredients and give it a name. If you don't, this rare event will be lost again.



By the way, this does not only apply to science and cooking. Think about this in everything you do.

Apr 1, 2010

One hit machines

I believe everybody has the capability to create one good piece of art in as many fields in which they have an interest. Not two good pieces... but probably one in many different fields.


Even though we're not all song writers, painters or industrial designers. I think that we all have it in us to create one good thing in all those fields. That is, if they are of interest to us to start with. If something is interesting to us we think about it in more details and we have a precise mental picture of what the 'best' is for that subject. Let's take song writing as an example. For most of us, since it's just an interest (as opposition to a passion) we don't work in that field and so for years we just roll around that one image of what makes a good song, and the best styles and the kind of subjects we like. We might even catch ourself thinking how cool it would be to hear more songs fitting that bill. So if at a given moment somebody was to ask us “Can you write me lyrics for a good song.” we could say “Yes! I have the perfect song.”. And than the flood gates would open and we would put that song on paper in no time, injecting in it every ideas we've ever had about what would make a good song.

It would, most probably, be our only song. At least for quite some times. This is because all we had went in that one song and we're left with nothing to create a different one.

I could probably ask anybody to design a good cell-phone interface and (if they use cells) they would all have a pretty finite idea on the perfect size, color, finish, button shape and many other details. It's all cool but can they design ten new phones every years? My guess is no. Of course the world is full of exceptions so there are people good at everything and others that couldn't make anything good in fields they love.

Mental pictures let the designer in us give a shot a everything. Unless we actively work at it, I think our 'inner-designer' only works on one concept which is 'the coolest' (for us). Once that concept is used... the tank is empty.

Mar 27, 2010

Ignorance is bliss

Eye-Fi just release the first ever ‘Endless’ memory stick. Yes finally a memory stick that never fills up. You can put any amount of videos and pictures on it and you’ll never see the ‘Not enough memory!’ message.


At this point the computer savvy knows there’s a catch somewhere. But let’s plunge back into the average clueless-computer-user brain.

Wow! my last memory card purchase ever. Let’s go to the web site. Mmmm, there are two capacity choices, I wonder why? I’ll take the cheaper 4GB over the 8GB. It won’t make a difference since it is infinite memory anyway.

Welcome to reality! Infinite memory doesn’t exist. It’s advertised, it’s sold and some people even buy it but it doesn’t exist. This mem-stick is only Endless because it deletes the oldest files if it needs space for the new ones. If you have anybody in your family that doesn't know computer much, you know how long it takes just to make them understand how to manage there files. 'Keep them in order.', 'Put them all under the same base-folder, so you know where your stuff is.'. And still they find ways to lose files or overwrite them.

Then after some time, the newbies understand there computer enough not to lose there files. They're almost ready to understand the virtues of backups.

Enters Eye-Fi Endless memory card!

“Where are all our pictures from Hawaii?”
“They're gone dad.”

Mar 24, 2010

The small things

I'm optimistic by nature. I can motivate a team of hopeless people by finding the tiniest bit of good in a bad situation. I then proceed into warping reality around that tiny thing until it becomes the only central step. So, for a short time, it turns into the most important part of the work and it creates a new viewpoint (in this case a good one) on the project.

I don't consider this a lie since, like everybody knows, if a lie is a means to an end it becomes a good lie (I like to say that everybody knows that. It makes it alright.). On top of that, since we want to 'do onto others as you would have them do to you' I'm totally okay because I do this to myself all the time.
Yes I do it, I lie to myself every time I attack a big problem and I reach a dead-end. We hear often 'work that big problem by picking at it'. 'Picking' doesn't sound very sexy and interesting all the time. Sometimes you want 'hacking' and 'slashing' because it feels good to move fast and have big results.


Big results. It such a trap since the size or importance of a result is relative. Something which is significant for somebody is noting for an other person. So perspective and mindset is not only important to understand the problem but also to believe in it. You next little task may be the small stone that start the landslide. It doesn't take much to gain momentum in a project and the next task might be the trigger.

Sorry but I don't have a choice, many of my projects are long term monsters barely moving sometimes. You have to appreciate the small things.

Mar 22, 2010

What is impossible?

A task is impossible only in the relative point of view of the person describing it as impossible.

Most of the time people come to the conclusion that a task is impossible with this bad induction: "X number of people try to do this and failed. This task must then be impossible."


To me, complex problems are like mountains: Most people attack them head first in a straight line using known and proven methods. Personally, I prefer walking around it and see it from the other angles. Nature as a tendency of creating natural steps here and there. There's nothing worst than reaching the top only to find the ski lift that was on the other face.

Feb 18, 2010

Roll manoeuvre

The cheapest way to put something in space (satellite or shuttle) is at the equator while launching due East with an orbital inclination of zero degree (relative to the plane that cuts the earth at the equator). Why is that? Well, at the equator the rotation speed (relative to a fix point in space) is at its maximum and that is free speed that your ship will not have to generate. That would obviously put your ship in an orbit that fly strait above the equator. Logically we want to fly above more than a single strip of land and that's where the roll is used. If you need to fly over land that is half way toward the North Pole you would then have an orbital inclination of 45 degrees. By doing so you lose some of the earth initial speed and your launch would cost more money or you would have to compromise on weight to accelerate faster. The maximum orbital inclination (unless you have money to throw out the window) is then 90 degree and that would put your ship in a polar orbit, which is the most expensive one. So, unless there's a good reason, you always want to launch with as little orbital inclination as you can.

Where is the roll in all that? Normally, your ship on the launch pad is always pointing in the same direction, unless you have a fancy launch pad that can pre-orient the ship before takeoff. This means that the ship will have to rotate (roll) early in the flight to orient itself in the plane of the orbit.

Why is the shuttle rolling if the cheapest way to launch is at an orbital inclination of zero? It all depends on the location of your launch pad. Let's start by saying that the further you are launching from the equator the bigger your minimum orbital inclination will be. Like I mentioned before, at the equator the minimum orbital inclination you can achieve is 0 degree but at the poles the minimum is 90 degrees. This is because you can only achieve an orbit where the orbit plane is cutting the planet through it center of mass. In the case of the earth, since it's fairly round and the density is not uneven, orbit planes would cut the planet in half. The location and orientation of the shuttle launch pad and the target orbital inclination for each mission will, most certainly, force the shuttle to roll to set his orbital plane. The distance from the equator is also why the ISS orbital inclination is 51.6 degrees (far from zero). This is because of the Russian launch pad location is very far from the equator and the minimum orbital inclination that can be achieved from there is 51.6 degrees.

Feb 16, 2010

Floating on technology

Looking at four teenagers at the mall on a school day made me think.


The masses in north America have a cellphone, an ipod, are using Twitter and FaceBook. On the other hand, they couldn't make a simple HTML page from scratch, explain how the Internet works or tell the difference between a content-driven web page and a blog. “It just works man. What's your problem?” People forgot the basic things, like work, questioning, reading or learning a new thing so your brain doesn't die. I thought technology was supposed to push us further and faster. Looking around, it seems we're sitting down in our big technology lazyboy.

At the same time, the new generations in Asia are rising to build themselves a future. They want to learn and thus they learn fast. They fight for a chance at education and value it. Not only are they using technology but they understand it from the ground up. We should too. Once we'll completely rely on somebody else so we can 'float' on technology we'll be in trouble.

I don't think that everybody must learn all the subtle details, but our society as a whole must continue to understand and respect what is holding our life's comforts.

Feb 15, 2010

Math daemons

So, numbers are talking to me. No big deal uh? Patterns seems to jump out of chaos, begging me to write down a equation defining theme. I can't even talk to the people I know about this stuff, because I and the people around me, didn't studied in math. So, thanks to the web and a few hours here and there, I do some maths alone.


It all started three years ago when my brain decided that it liked math more than before. A lot more. How do you fight something like that? Why would I even fight it? It only cost time, paper and a pencil, so that is one cheap pastime.

One cool thing about loving math is the the sheer quantity of problems that need to be solve. Its' an endless sea of 'fun'. Let the nerd in you free and take a look at the Clay Institute Millennium Problems. If I had time, I'd work on P vs NP and The Navier-Stokes existence and smoothness all day long. Just because it's there, like the mountain for the rock climber.

I bet, if I was in high school, I'd get my ass kicked for saying stuff like that. Good thing I'm 37.

I'll just keep filling pages after pages of notes, hypothesis and calculus about 'why in the world' some points in a non linear dynamical system are not stabilizing when m goes to infinity. I'm so close to the answer I can smell it.

Jan 18, 2010

Creative Programming

Some time ago, I was asked to give a presentation about Creativity At Work. This was part of a series of presentations where people from different fields were asked to give there view on creativity. I wasn't very shocked (but a bit sad) to find out that most of the speakers were visual artists or designers and I was the only programmer. So, holding the fort, I started working on my presentation which mostly revolved around my personal view of creativity and my creation process. All the time, I was expecting some weird comments coming from non-programmers regarding the fact that a 'computer-guy' would have something to say about creativity but, to my surprise, most of the sarcasms came from other programmers. That'll teach me not to watch my back. Apparently, for some coders, no creativity was involved or needed when programming...

I was baffled, because I see coding as a medium. I use it to create, the same way I use paint or clay. I then decided to spend a good part of that presentation demystifying coding and showing it for what it really is: just another tool. Now, it's one of my favorite presentation to give. I love the reactions I get out of it.


Why would a person sitting at a piano be closer to creativity than a programmer at is keyboard? Playing the piano is pretty hard an not that many people can master it. But if they do, it can be used to invent and break new barriers. For me coding can be used that way too, whether the output is music, image, video, robotics or anything else that can be experienced by other people.

#define JAZZ printf(“Do de do, de do wha!\n”);