Archive for November, 2005


Thesis design project: POC 2 Robot Pics

Wednesday, November 30th, 2005

Our proof of concept (POC) was today and thankfully everything went OK (see previous post). I had one of my group members take some pictures of the robot before we disassembled it. Though the design below was good for the POC, it’s not what we need for a final design. With that in mind, we took it apart, and headed back to the drawing board.

Here are some pics of the extractor robot version 0.0002

Update May 11 2006: To read about the final product go here

Lego Mindstorms

RCX Brick

LeJOS on the RCX

Lego Mindstorms

Thesis design project: Proof of Concept 2

Tuesday, November 29th, 2005

Our thesis design project this year is to make an autonomous robot (out of Lego Mindstorms) that will go into a maze and rescue black coloured eggs. This is a year long project and the class is split into teams of 5-6 people (my group has 5).

The robot will be given a text file of the map, before it enters the maze. Once in the maze the goal is simple: Rescue all the victims as fast as possible. The standard Lego Mindstorms software does not apply here. To handle the complex logic and additional constrains we decided to use LeJOS (open source Java OS for the Lego RCX brick).

Tomorrow is the second “proof of concept” and I just spent a good 6 hours today getting our robot to work. All the robot has to do for tomorrow, is go into the maze (in a straight line) detect the egg and rescue it. Seems simple enough… no. First of all, the egg is hallow and thus extremely light. Unless the egg is going to be tied down (by tape or Palestine) the touch sensor will push the egg without even detecting it. I hear using a light sensor would work better; I’ll try that in the future (or a combination!). The next issue is handling all the threads of execution that get spawned from all the listeners that are set.

Ah well, it works now, and is good for tomorrow. This project is going to take lots of work. Eventually the robot will have to make turns, clear blockages, work with a map (and without), save multiple eggs, etc. Good times.

Microsoft’s Xbox loss per unit $126

Wednesday, November 23rd, 2005

It was expected that Xbox would sell at a loss, most consoles in the past have. iSuppli research crunched some numbers and came out with a loss per unit of $126 US. The idea: make money off the games. In a recent issue of Technology Review, there was an article about Halo 3. Take a wild guess when Halo 3 is supposed to come out? ….. When PS3 launches.

An up-close look at the components and other materials used in the high-end version of the Xbox 360, which contains a hard drive, found that the materials inside the unit cost Microsoft $470 before assembly. The console sells at retail for $399, meaning a loss of $71 per unit — and that is just the start.

Other items packaged with the console — including the power supply, cables, and controllers — add another $55 to Microsoft’s cost, pushing the loss per unit to $126. These estimates include assumptions that Microsoft is getting a discount on many components.

IBM has the right idea:

IBM also has designed chips at the heart of the competing video-game systems — the Playstation 3 from Sony and Nintendo’s forthcoming Revolution system, both of which are due next year.

Skype to sell phone kits at RadioShack

Tuesday, November 22nd, 2005

It looks like eBay is taking Sykpe to the next level, signing a deal with RadioShack to sell kits for its web based phone service.

Skype Technologies, which counts 66 million users of its free- and low-cost Web-based telephone services, mainly in Europe and Asia, said on Sunday that it would distribute Skype phone gear through 3,500 RadioShack stores.

The move into the retail market promises to raise Skype’s profile with American broadband users, who have begun to switch from traditional phone systems and use alternatives that rely on Internet connections.

Skype is able to get past most firewalls, so even if you’re connected through VPN, you can use your Skype phone/account with no problems. This is true for example at McMaster University, where most of the campus is wireless and you connect through VPN.

A couple months ago I read an article in Technology Review about one of the early fathers of F-Secure — he forecasted that the next huge virus craze will be through Skype. This makes sense, half the battle is already won by getting through the firewall.

Google Analytics shut down for new users

Monday, November 21st, 2005

Just as I got excited to try out Google Analytics, Google shut it down to new users. Apparently since it went free there had been serious reliability issues. An article on ITworld.com says:

This is the latest snafu to hit Google Analytics since last Monday, when Google began to offer it for free. That same day, Google Analytics, which used to cost US$199 per month, began to experience serious performance problems as new and existing users alike struggled to access the service.

I’m curious if it specifically tracks and differentiates users who access the website through AdWords or normal search/direct URL access. I know a lot of people are concerned about fraudulent AdWords clicks, etc. Once it comes back, I’ll look into it more closely.

ApacheCon Europe Presentation

Tuesday, November 15th, 2005

Most likely anyone who has ever used Apache Web Server, at one point or another, has said “how in the world was I supposed to have known that??” in respect to httpd’s inconsistencies.

Rich Bowen had a hilarious presentation at ApacheCon Europe joking about how he Hate the Apache Web Server.

How To: Learn AJAX in 20 minutes

Wednesday, November 9th, 2005

Here is a quick overview and example of AJAX in action. Before you begin, this example will only work in FireFox work in FireFox and IE7. You’ll have to change few things in the JavaScript for it to work in IE6. To download the files used below click here. If you don’t have PHP/Apache installed, follow the tutorial I made to install it. The example below assumes you know the basics of PHP, you can learn as you go along if you don’t. A good reference is the base PHP website.

AJAX stands for Asynchronous JavaScript and XML. Conventional web application trasmit information to and from the sever using synchronous requests. This means you fill out a form, hit submit, and get directed to a new page with new information from the server. With AJAX when submit is pressed, JavaScript will make a request to the server, interpret the results and update the current screen. In the purest sense, the user would never know that anything was even transmitted to the server.

A classic example of AJAX is Google Maps. If you havent noticed, with Google Maps you have the ability to click and drag the map. If you drag the map fast enough, you would see the new regions of the map loading in real-time. This is accomplished using AJAX.

If you click here, you’ll see a simple example of AJAX. The example performs the multiplication of two numbers. The top form performs the calculation using AJAX, while the bottom form uses standard techniques.

The Javascript that makes the example work is below. Basically an XMLHttpRequest is used to communicate with the server. Though the name may make you think you need to trasmit XML, it is not necessary (my example doesn’t). So when the function ajax_call() is executed, the already instantiated XMLHttpRequest attemps to open ajaxWork.php (with some parameters). Upon returning from the request (and assuming it was successful) the results are populated into the results input box.

Code:
var xmlhttp=false;

if (!xmlhttp && typeof XMLHttpRequest!='undefined')  {
     xmlhttp = new XMLHttpRequest();
}

function ajax_call() {
     xmlhttp.open("GET", 'ajaxWork.php?num1=' +
           document.getElementById('num1').value +
                '&num2=' + document.getElementById('num2').value , true);

     xmlhttp.onreadystatechange=function() {
           if (xmlhttp.readyState==4) {
                 document.getElementById('result').value = xmlhttp.responseText;
           }
     }

xmlhttp.send(null)
return false;
}

Below is ajaxWork.php which is used in the Javascript above. The code below uses a PHP class called ajax that I defined in ajaxClass.php. The code creates a new instance of the class ajax, reads the parameters from the URL, performs the multiplication, and outputs the result. The results are outputed so that from the response of the XMLHttpRequest, the Javascript can update the example.

Code:
<?php

include("ajaxClass.php");

$objSem = new ajax;
$objSem->readURLParameters();
$objSem->staticExample();

echo $objSem->result;
?>

Below is the ajax class used in the PHP code above. This class is used firstly to read the parameters from the URL (via readURLParameters()) and then to perform the multiplication (via staticExample()) .

Code:
<?php

class ajax {

	var $queryParam = array();
	var $result = 0;
	var $num1 = 0;
	var $num2 = 0;

	function readURLParameters() {
		$qstr = explode("&", $_SERVER['QUERY_STRING']);
		foreach ($qstr as $value) {
			$paramVal = explode("=",$value);
			if (array_key_exists(1,$paramVal)) {
				$this->queryParam[$paramVal[0]] = $paramVal[1];
			}
		}
	}

	function staticExample() {
		if (array_key_exists("num1",$this->queryParam) & array_key_exists("num2",$this->queryParam)) {
			$this->result = $this->queryParam["num1"] * $this->queryParam["num2"];
			$this->num1 = $this->queryParam["num1"];
			$this->num2 = $this->queryParam["num2"];
		}
	}

}
?>

The HTML is even more straightforward (so I won’t bother putting it here). You can download all the files I used here.
Also, be sure to remember the example above will only work in FireFox. To code would be similair to work in IE6, you’d just need to change some of the Javasript. If you have any questions post a comment.

Good luck