Holy Wow.. The Microsoft Kinnect is amazing! However, I don't say that because I like the game, I say it because the technology amazes me. In order to understand why the Kinnect is amazing, you must first understand its competition.
The Wii, uses several infrared diodes that are tracked by the controller. This means that it can track one joint of motion. Basically if you move your wrist it can see it. Initially this was revolutionary, allowing players to make movements and the games would interpret them.
Like the Wii, the PS3 also uses infrared.. actually the Play Station solution basically mirrors the Wii solution except it uses the orb on the end of the wand to optically track the one joint of motion. At best this is evolutionary, if not just a clone of the Wii functionality.
Now the big boy, the Kinnect. This thing can track up to 16 joints of motion in 2 players simultaneously. It does this by projecting thousands of tiny infrared dots all across the room and then watching for position changes in these dots by using the on-board infrared camera. So right there you have 32 times more accuracy with no controller. Definitely Revolutionary!
A few years back Microsoft was talking about touch tables. Essentially these were tables where the entire table would be a computer screen. With the recent coming of age of gestures and multi-touch in the i-products, and with this software to track gesticulations from Microsoft, it doesn't take much to imagine the next version of windows available as a table top or a wall version.
Its interesting, I have recently started my graduate classes at Kettering University. I am able to attend all of them via distance learning. This really means that the lectures are delivered via video and the powerpoints and tests are all administered online. I guess the question becomes how come this isn't more common for bachelors degrees? Is it because they lack a certain maturity that would be necessary for this? or is it because the price margin is so high on bachelors degrees that even the schools would feel like they were scamming students.
This is for the "Studious Student" problem posed in the contest. Basically you are going to copy the following into a java file named GWStudiousStudent, and then compile and run it on the input.txt file that facebook supplies for the contest. This code will generate output on the console that you can copy and paste into the Facebook popup window.
Note: each person's problem is different and randomly generated!
import java.util.*;
import java.io.*;
public class GWStudiousStudent
{
public GWStudiousStudent()
{
try
{
Scanner myScan = new Scanner(new File("input.txt"));
String trash = myScan.nextLine();
while(myScan.hasNextLine())
{
System.out.println(solveOneLine(myScan.nextLine()));
}
}
catch(FileNotFoundException e)
{
System.out.println("File not Found");
}
}
public String solveOneLine(String oneLine)
{
//Make an array the exact size of the numb of words
int numWords = countWords(oneLine);
String[] loadArray = new String[numWords];
//Scan and put each element in the correct spot
Scanner sc = new Scanner(oneLine);
int trash = sc.nextInt();
for(int x = 0; x < numWords; x ++)
{
loadArray[x] = sc.next();
}
//Sort the array using bubblesort
int n = numWords;
for(int pass = 1; pass < n; pass ++)
{
for(int i = 0; i < n-pass; i++)
{
if((loadArray[i].compareTo(loadArray[i+1]))>0)
{
//swap
String temp = loadArray[i];
loadArray[i] = loadArray[i+1];
loadArray[i+1] = temp;
}
}
}
//Concatenate the array into a string
String concat = "";
for(int x = 0; x < numWords; x ++)
{
concat = concat + loadArray[x];
}
//return the concatination results
return concat;
}
/* INT - countWords
* This method takes in the formatted string
* and returns an int representing the number
* of words found in that string
*////////////////////////////
private int countWords(String theline)
{
int count = Integer.parseInt(theline.substring(0,1));
return count;
}
public static void main (String [] args)
{
GWStudiousStudent obj = new GWStudiousStudent();
}
}
Labels: Face Book, Facebook, Hacker Cup, HackerCup, Java, Programming, Qualification, Studious Student
Well after receiving an influx of hits I have decided to remove the source code from the Facebook Hacker Cup Studious Student contest. I will be posting the code after the qualification round completes.
However, I will try to decompose the problem a bit to help other students solve it. Like any good computer science problem you need to first decompose this one into its parts. Instead of trying to approach the entire problem lets just try to focus on solving the problem for one line.
Take the line: "5 this is a generic line"
If you were given this string there are five things we need to do to it:
- Identify how many words are on the line
- Create some structure and store each word in the structure
- Sort that structure
- Concatenate and return that structure
Labels: Facebook, Hacker Cup, Qualifying Ro, Studious Student