Google Wave to Line

I had an idea for a software development web-based of an application to manage bullets of text with version control. For example, this application could be used as:
  • TODO list
  • SCRUM backlog
  • Software release notes
  • Brainstorming board
  • Event organization
  • Task tracking
As far as the idea was maturing, I realised that most of the functionality was already implemented by Google Wave, but some details. So, instead of starting a new project, I decided to share the new features I would add to Google Wave in order to get feedback and perhaps I could get Google to include this features in next Google Wave releases.

Why Line?

The name comes from the idea of treating each input as a line in the timeline. Each line changes in the time. The changes are tracked, storing when a line was changed and what the change was.

1. Line states

Each line would have an state for their content:
  • Approved: the content of the line is considered valid.
  • Draft: the content of the line is tentative.
  • Active / inactive
  • Deleted
2. Line reordering

Lines should be able to be reordered. The user must be able to drag and drop one line and move it up/down in the list of lines. This way, we can consider a wave as a list of lines ordered by importance.

3. Line survey

A user could open a proposal of different contents for a line. The line would pass to draft state. The users joined to that wave would be able to vote for any of the proposed options. At the end of the survey, the line will have the value of the most voted option.

4. Line discussion

Similar to surveys, the line would pass to draft state. In this case, a forum will be opened where any user joined to the wave could leave an opinion. When an agreement is reached, a user redact the content of the line, the discussion would be closed and the line turns to approved state.

5. Snapshot

An instant in the time such as a transverse cut in the time line. An snapshot defines a photo of the lines in the moment the snapshot is taken. An snapshot would have to be defined by a name. Only approved and active lines would be considered part of the snapshot. This way, we can define easily release notes for a software development.

6. Line split / join

One line could be splitted in several different. For example, in a brainstorming, an idea could be separated in other smaller.

Several lines are joined in one.

7. Mode timeline

It would be the way to review the tracking of changes. This mode would be very visual. This view would show each line as that, a line in the time. The timeline would have a zoom in/out in the time scale (from minutes to months or years). Everything would be shown: surveys, discussions, snapshots, splits, joins, states.

Feedback

What do you think?

OpenGL, camera 3 levels of freedom

This is an implementation using quaterniones of a world with objects with 3 levels of freedom.
Download it at this link.





Camera:
Up: I
Down: K
Left: J
Right: L
Backward: H
Forwad: Y
Speed+: T
Speed-: G
Pitch right: D
Pitch left: A
Yaw up: W
Yaw down: S
Roll right: X
Roll left: Y

Triangle:
Speed+: Arrow up
Speed-: Arrow down
Pitch right: Arrow right
Pitch left: Arrow left
Yaw up: N
Yaw down: B
Roll right: V
Roll left: C


Racing 4k --> 4k Grand Prix Simulator



Version 0.0: Basic
Version 0.1: Added splines.
Version 0.2: Faked physics. Marks on the ground.
Version 0.3 (current): AI. New Circuits.
Version 1.0: 4k version. Some bugs fixed. Graphical details.

Inspired by my old Grand Prix Simulator for my Amstrad CPC 646.

Accelerate: Up arrow
Break: Down arrow
Turn right: Right arrow
Turn left: Left arrow

Click: Start/Restart

1-3: Select circuit






uCertify review

I was contacted to make a review for the software provided by uCertify to prepare many IT certifications. I've got a full version for the Sun certification CX310-065 SCJP 6.0.

First of all, you have to know that this software is a support for people who already know something about Java. If you are a complete novice, start studying the basics, and then prepare for the certification.

For me, the most helpful feature I've found have been the teorical content assoccated to the exam objectives. It wasn't easy to get to it, but when I did, I saw the light. This is perfect because you have all the notes in a printable interface and they are associated with concret exam objectives. To get to this feature, you have to click "Exam objectives", where you'll find the official list of them; there, click the top-right button "Go to objectives with notes" to expand all the notes by objective. I would add the feature of remarking important parts of the notes with a highligther.

If you don't like to study the notes because it is boring and not so practical, you can go through the tests in "Learn Mode" that allows you to make visible the question theorical note as feedbak while you are making the test. The program allows you to create custom test, feature I would add the option to create tests based on the dificulty of the questions. Perhaps this can be supplied by the adaptative tests, but I feel I would like to have a bit more control in the level of the questions I go through, to manage my study pace.

You can keep track of all your progress in the tests. I would add tracking on the time you spend studying the notes, with an estimation of the effort they needs depending on the difficulty, to evaluate my dedication to that subject.

The sofware is pretty intuitive. You will get used to it quickly. The only feature I couldn't find easily and I couldn't evaluate was the option "Discuss It". This feature must allow us to leave comments on test questions or on notes, share them with other users and read what other users had typed. I haven't found any comment from others, so I suppose this functionality is not used very much. As proposal, I would make an study of the real use of this feature; if it us widely used, I leave it as it is now, else, I would remove it and I would replace it by a standard centralized forum, instead of linking comments to specific contents. Please, if anybody finds a comment and finds it useful, please, share with us.

So, download the trial version an evaluate it by yourself. I think it could provide you with useful content and an way to auto-evaluate your progress to your certificacion. If you have interest in any specific point I could help with, don't hesitate to leave a comment.

J2ME - My student projects

These are the videos from the project that my students did. They belong to the course 08/09 of the Master in Videogames of the European University of Madrid.

Thanks all my student for the interest and the effort. The merit is theirs, I pushed them a bit :).

San Fermín


Crisis behind
  • Cipri Sanchez Herraiz



Zelda


Pacoman2
  • Daniel Hernandez Zafra


Aviones


Pulso


Arkanoid
  • Carlos Casero
  • Laura Gil Sanz


Xax
  • Diego Lizarazo

Perl: normalizador de ficheros / files normalizer

espa?ol Perl, normalizador de ficheros: Un script en Perl para normalizar el formato del contenido de ficheros de texto: saltos de línea (windows/unix), tabulaciones, espacios al final de línea y saltos de línea al final de fichero.
(más)

espa?ol Perl, files normalizer: A Perl script for normalization the format of the content of text files: new lines (windows/unix), tabulations, ending line white spaces and ending file new lines.
(read more)

Hanoi Towers 64 Gadget


Add to Google

Adaptation of Hanoi of Towers with 64 discs to gadget.

Customizable, in elements and appearance.

As a curiosity, if you set the gadtet with an interval of 989 milliseconds and 15 discs, the completion takes 9 hours, that is, the duration of a normal job day of 8 hours (plus one hour for lunch).

Hanoi Towers with 64 disks

There are several versions of the legend, but all of them say that the end of the world will be reached as soon as all the disks are moved from the source peg to the destination one. Then, the following Java implementation of the Hanoi Towers in an applet with 64 disks can be considered a count down to the end of the world, :).

The puzzle consists in moving all the disks from the source peg to the destination one. Only one disk can be moved in each movement, and a bigger disk can’t ever moved on a smaller one.

The minimum number of movements needed for n disks are 2n-1, the, with 64 disks and moving one disk each second, the puzzle solution would last 585.442 billions years (calculus fromWikipedia).

This would be the actual position of the disks if the execution would have started on 1883, when the puzzle was ivented by Édouard Lucas.










Oh Mummy gadget



Add to Google

Adaptation of Oh Mummy! to gadget.

The classic Oh Mummy in a gadget. Use the arrow keys for walking all around the blocks until finding the 2 green blocks and then pass to the next level coming back to the initial position. Add it easily to your iGoogle with the Add to Google. button.

It has been changed from the original one. The mummies AI and velocities have been addapted. The game is divided in phases, and each phase consists of 5 miniphases; any time you continue the game, you will start from the beginning of the phase you are.

Subset

Given a set S, what are their subset?, what are their k-subset?. I’ve compiled several Java methods which iterate over these subset. Due to its low efficiency, this technique only should be used in brute force algorithms.

Contents

Notation
All the subset
All the k-subset
Auxiliar methods
References

Notation

S is the set with elements {n1, n2, n3, ... nn}. The number of elements of S is |S|=n.

K is the subset of S {k1, k2, k3, ... kk}, where ki belongs to S and ki doesn’t represent the same element S that kj does, with 1<=i,j<=k. The number of elements of K is |K|=k and takes values from 0 to n.

The subset of S will be represented byt set of n elements of {0, 1}, where 1 means belonging and 0 means not belonging. The number of elements of the suset |K|=k is the number of 1's that it has.

(contents)

All the subset

All the subset of S have subset from 0 elements to n. There are 2n of subset.

All the subset.

|S|=3

K0={0,0,0}
K1={0,0,1}
K2={0,1,0}
K3={0,1,1}
K4={1,0,0}
K5={1,0,1}
K6={1,1,0}
K7={1,1,1}

allSubsetBit(int) (iterative)

/**
* Iterates over all the subset of a given set of n elements.
*
* The maximun number of elements of the given set is 63.
* Subset are represented at bit level, 1 means belonging,
* and 0 not belonging.
* @param n Number of elements of the set, 0<=n<=63.
*/
public static void allSubsetBit(int n) {
for (long i = 0, lim = 1L << n; i < lim; ++i) {
printSubset(n, i);
}
}


allSubsetArrayIterative(int) (iterative)

/**
* Iterates over all the subset of a given set of n elements.
*
* The size of the set doesn't have any restriction, but
* the memory heap size.
* The subset is represented by an array of booleans, where
* true means belonging, and false means not belonging.
* @param n Number of elements of the set, n<=0.
*/
public static void allSubsetArrayIterative(int n) {

boolean[] subset = new boolean[n];

while (true) {

printSubset(n, subset);

// Add 1
int i=0;
do {
subset[i] = !subset[i];
++i;
} while (i<n && !subset[i-1]);

if (i>=n && !subset[i-1]) break;
}
}

allSubsetArrayRecursive(int) (recursive)

/**
* Iterates over all the subset of a given set of n elements,
* recursive version.
*
* The size of the set doesn't have any restriction, but
* the memory heap size.
* The subset is represented by an array of booleans, where
* true means belonging, and false means not belonging.
* @param n Number of elements of the set, n<=0.
*/
public static void allSubsetArrayRecursive(int n) {
boolean[] subset = new boolean[n];
allSubsetArrayRecursion(n, subset, 0);
}

private static void allSubsetArrayRecursion(int n, boolean[] subset, int i) {

if (i < n) {
subset[i] = true;
allSubsetArrayRecursion(n, subset, i + 1);

subset[i] = false;
allSubsetArrayRecursion(n, subset, i + 1);
} else {
printSubset(n, subset);
}
}


(contents)


All the k-subset

All the subset of S with k elements. The number of k-subset is:



n!

|k-subset|=
(n-k)!·k!

All the k-subset.

|S|=5
k=3

K0={0,0,1,1,1}
K1={0,1,0,1,1}
K2={0,1,1,0,1}
K3={0,1,1,1,0}
K4={1,0,0,1,1}
K5={1,0,1,0,1}
K6={1,0,1,1,0}
K7={1,1,0,0,1}
K8={1,1,0,1,0}
K9={1,1,1,0,0}

The following code has been taken from the book Hacker's Delight by Henry S. Warren Jr. It is a bitwise trick for getting the next greater number than one given with the same number of 1’s in binary representation.


allSubsetKBit(int,int)

/**
* Iterates over all the subset of k elements in a set of n
* elements.
*
* The maximun number of elements of the given set is 63.
* k must be 0<k<=n.
* Subset are represented at bit level, 1 means belonging,
* and 0 not belonging.
* REF: Warren, Hackers Delight, p.14.
* @param n Number of elements of the set, 0<=n<=63.
* @param k Number of element of the subset, 0<k<=n.
*/
public static void allSubsetKBit(int n, int k) {

long subset = 0;
// Set 1 k first bits
for (int i=0; i<k; ++i) {
subset |= 1<<i;
}

long limite = 1<<n;

long smallest, ripple, ones;
while (subset < limite) {
printSubset(n, subset);

// From Hacker's Delight
// Next greater number with the same number of 1's.
smallest = subset & -subset;
ripple = subset + smallest;
ones = subset ^ ripple;
ones = (ones>>2)/smallest;
subset = ripple | ones;
}
}



allSubsetKArrayIterative(int,int)

/**
* Iterates over all the subset of a given set of n elements,
* iterative version.
*
* The size of the set doesn't have any restriction, but
* the memory heap size.
* k must be 0<k<=n.
* The subset is represented by an array of booleans, where
* true means belonging, and false means not belonging.
* @param n Number of elements of the set. No restrictions.
* @param k Number of element of the subset, 0<=k<=n.
*/
public static void allSubsetKArrayIterative(int n, int k) {
boolean[] subset = new boolean[n];

while (true) {

int subsetCount = 0;
for (int i=0; i<n; ++i) {
if (subset[i]) {
++subsetCount;
}
}

if (subsetCount==k) {
printSubset(n, subset);
}

// Add 1
int i=0;
do {
subset[i] = !subset[i];
++i;
} while (i<n && !subset[i-1]);

if (i>=n && !subset[i-1]) break;
}
}

allSubsetKArrayRecursive(int,int)

/**
* Iterates over all the subset of a given set of n elements,
* recursive version.
*
* The size of the set doesn't have any restriction, but
* the memory heap size.
* k must be 0<k<=n.
* The subset is represented by an array of booleans, where
* true means belonging, and false means not belonging.
* @param n Number of elements of the set. No restrictions.
* @param k Number of element of the subset, 0<k<=n.
*/
public static void allSubsetKArrayRecursive(int n, int k) {
boolean[] subset = new boolean[n];
allSubsetKArrayRecursion(n, k, subset, 0, 0);
}

private static void allSubsetKArrayRecursion(int n, int k, boolean[] subset, int subsetElements, int i) {

if (i < n) {
subset[i] = true;
allSubsetKArrayRecursion(n, k, subset, subsetElements+1, i+1);

subset[i] = false;
allSubsetKArrayRecursion(n, k, subset, subsetElements, i + 1);
} else {

if (k==subsetElements) {
printSubset(n, subset);
}
}
}

(contents)


Auxiliar methods

These methods do a function with the subset given by the methods above. In this case, they print the subset. These are the methods that need to be changed for changing the behaviour.

printSubset(int,long)

/**
* Prints a subset represented with the bits of a long.
*
* @param n Maximum number of elements of the subset.
* @param subset Bit representation of the subset.
*/
private static void printSubset(int n, long subset) {
for (int j = n-1; j >= 0; --j) {
System.out.printf("%d", ((subset & (1L << j)) != 0) ? 1 : 0);
}
System.out.printf("%n");
}

printSubset(int,boolean[])

/**
* Prints a subset represented by an array of booleans.
*
* @param n Maximum number of elementos of the subset.
* @param subset Subser represented by an array of booleans.
*/
private static void printSubset(int n, boolean[] subset) {
for (int j = n-1; j >= 0; --j) {
System.out.printf("%d", (subset[j]) ? 1 : 0);
}
System.out.printf("%n");
}

(contents)

Referencess

"Hacker's Delight", by Henry S. Warren Jr.
"k-subconjuntos.".

(contents)