TweetThis!

July 30th, 2007

Note: This post is also posted on my blog - there is a screen shot and the ability to post comments there.

I’d like to introduce the application I started building tonight - TweetThis!

Firstly - I need to thank Sayher Heffernan for the fantastic logo that he whipped up for me tonight. Very much appreciated mate.

TweetThis! is coming along quite nicely, still quite a bit to go though. Currently it allows you to see the last few Twitter messages posted by your friends, and update your own status. Check out the screen shot - a lot has been implemented. It’s fast and responsive, although a bit of testing will need to be done over the next couple of days.

TODO:
Links in JLabels don’t work - I need to find a way to work around this.
Although I have tested it and it works, I need a button to submit a status update.
It would be nice to be able to go through more than the last 4 friend update.
I would like to put the persons picture next to their post.
Login dialog box needs to be finished.
Use JDIC to put this thing in the system tray.

Unfortunately - no usable demo for you at the moment - I still need to properly implement a login dialog box and a couple of other things. Look for a release in the next couple of days.

In the mean time, follow me on Twitter to be the first to know when this thing is released.


A New Take on the Clock

April 25th, 2007

NOTE: I have disabled comments on this blog due the the large amounts of comment spam I was recieving, and the fact that Akismet would not accept my API key. This post is also posted on my new blog, and you are welcome (actually encouraged) to post comments there.

The clock is something that we genrerally take for granted. Can you think of a better, or nicer looking way to display inforamtion about the current date or time? Is the way that a regular analog (or even a digital) clock displays the time the most intuitive and easiest to read?

Check out the Polar Clock by Pixel Breaker, its a slightly different way of looking at the time, makes a great screen saver too.


Social Network Visualisations

March 10th, 2007

NOTE: I have disabled comments on this blog due the the large amounts of comment spam I was recieving, and the fact that Akismet would not accept my API key. This post is also posted on my new blog, and you are welcome (actually encouraged) to post comments there.

I have been playing around recently with getting social network data from a real online social network. To do this I have written a small java application to download profiles and friend lists from one of the major online social networking sites. You will be hearing more about this as time goes on, with a possible release of the program at some point.

Here is a sample output from what I have so far:

Social Network

The visualisation was created using pajek, a free social network visualisation tool. There are a lot of other tools out there that can generate nicer images, see a short list of them here. If you are interested in some other examples of what can be done, and what I will be trying to do, you should check out the site that inspired me Echelon and a couple of the sites that it links to Visual Complexity and Data Mining Blog.


A long time coming…..

February 4th, 2007

Get Songbird


Simple Javascript Graphs

January 27th, 2007

For a while I have been toying with the idea of creating a javascript tool/library to display simple histograms in the browser window. The idea was inspired by a concept called sparklines. Sparklines are considered to be “intense, simple, wordlike graphics” to represent simple data sets. This genre of graph can be used for a number of different things, though primarily it is used to display data that has little or no explanation needed. It’s helpful for displaying the history of a number, or for quickly displaying trends in data sets. One of my favourite websites has been using sparklines for a while now to display their daily page views.

Although not technically sparklines, the graphs created using this library are of a similar type. They could be used to display any sort of data that would normally be displayed using a histogram. The implementation that I demonstrate below is still a work in progress (it could even be considered a beta version - :P) and I will be working on it over the course of the next few days, so look out for edits to this post.

The invocation format is fairly simple, although it would be a lot nicer if I was able to use prototype and use invocation syntax like moo.ajax used to, but I want to keep the filesize as low as possible, plus not require any external libraries. I’ve thrown the types in for added clarity:

drawHistogram(‘graphDiv’,new Array() dataset,int width,int height,boolean axis,boolean autoRange)

The different parameters are fairly straight forward, axis enables and disables the x- and y-axis, while autoRange causes the graph to start at the lowest number. Here is an example:

drawHistogram(‘graphEl’,new Array(88,84,82,92,82,86,66,82,44,64,66,88,96,80,24,26,14,0,0,26,8,6,6,24,52,66,36,6,10,14,30),180,40,false,false);

Results in:

With some small changes made to the code, these graphs can also be used to quickly represent just about anything. Take this example of a weather forecast, which gives an overview of the weather for the previous 4 weeks in a very elegant way:

So finally - here is the code for displaying the graphs. Simply add this code within a <script> tag in your documents <head>, or save the file at the bottom of this page and import it using a <script> tag.

var divOffset = 0;
function drawHistogram(id,array,width,height,axis,autoRange)
{
	var el = document.getElementById(id);

	el.style.width = Math.round(width/array.length)*array.length + “px”;
	el.style.height = height + “px”;
	if(axis)
	{
		el.style.borderLeft = “1px solid #3D3D3D”;
		el.style.borderBottom = “1px solid #3D3D3D”;
		el.style.zIndex = 3;
	}

	var tempArray = new Array();
	if(autoRange)
	{
		var smallest = getSmallestElement(array);
		for(i = 0; i < array.length; i++)
		{
			tempArray[i] = array[i];
			array[i] = array[i]-smallest+(smallest*0.05);
		}
	}

	var xPos = 2;

	//work out the multiplier for height
	var multiplier = parseInt(el.style.height)*0.95 / getLargestElement(array);

	// draw the actual graph
	for(i = 0; i < array.length; i++)
	{
		var newItem = document.createElement(“div”);
		var divIdName = “graphItem” + (++divOffset);

		newItem.setAttribute(“y”,array[i]);
		newItem.setAttribute(“id”, divIdName);

		newItem.style.backgroundColor = “#B3CC99″;
		newItem.style.width = Math.round((parseInt(el.style.width) - array.length*2)/array.length) + “px”;

		newItem.style.height = Math.round(array[i]*multiplier) + “px”;

		newItem.style.position = “absolute”;

		//set the y position
		var offset = (parseInt(el.style.height) - parseInt(newItem.style.height));
		newItem.style.top = (findPosY(el) + offset) + “px”;

		//set the x position
		newItem.style.left = (findPosX(el) + xPos) + “px”;
		xPos = xPos + (parseInt(el.style.width)/array.length);
		el.appendChild(newItem);

		if (newItem.addEventListener){
  			newItem.addEventListener(‘mouseover’, function () {this.style.backgroundColor = ‘#3366FF’}, false);
			newItem.addEventListener(‘mouseout’, function () {this.style.backgroundColor = ‘#B3CC99′}, false);
		}
		else if (el.attachEvent){
		//Internet Explorer
			document.getElementById(divIdName).onmouseover = highlight;
			document.getElementById(divIdName).onmouseout  = normal;
		}
	}
}
 
function highlight(event) {
  this.style.backgroundColor=‘#3366FF’;
}
 
function normal(event) {
  this.style.backgroundColor=‘#B3CC99′;
}
 
function getLargestElement(array)
{
	var largest = 0;
	for(i = 0; i < array.length; i++)
		if(array[i] > largest)
			largest = array[i];
	return largest;
}
 
function getSmallestElement(array)
{
	var smallest = array[0];
	for(i = 0; i < array.length; i++)
		if(array[i] < smallest)
			smallest = array[i];
	return smallest;
}
 
/* Original code below created by by Peter-Paul Koch & modified by Alex Tingle. */
function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1)
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }
 
function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

Browser Support:
Tested in: Opera 9, Firefox 2, IE6+
Should work (but not fully tested): Safari, Opera 7+, Firefox 1+, IE 5+ (possibly with no mouse over effect)

Let me know if you find the demo’s buggy in any particular browser. I’ll be doing further testing of my own over the weekend and will update this post at some when I know more.

TODO/Ideas:
Make the mouse over effect work in IE.
Display x-value on mouseover (possibly tooltip)
Be able to zoom the graph.
Make it easier to set colour of bars.

Download:
The script can be downloaded from here. Right click and select to save the file.

Licence:
Although I am happy for this code to be used in any way you wish, a small note in the comments of this page would be appreciated if you use this code in your projects.
Parts of the code are sourced from Peter-Paul Koch & Alex Tingle, this code is believed to be public domain.


Free Fonts

October 12th, 2006

One thing that is really missing in the open source community is great looking, professional, free fonts. Found a really nice list of 17 quality free fonts over at del.icio.us that anyone else that misses really nice fonts should have a look at.


McAd

September 28th, 2006

Found this add on digg.com:

http://flickr.com/photos/achillex/253615202/

Now that is cool, are we looking at the future.

I have been so insanely busy lately, between work, work, study, ibl application and personal projects, I have had absolutely no time for anything else. I do however have a couple of posts on the go that I will be posting soon after a little more research has been done.

I have also had an idea for a neat little app using the flickr interface, I’ll try kepp you posted. :P


On a rampage

August 31st, 2006

Looks like I’m on a blogging rampage.

Here is some inspiration for some plugins and themes that ByteClub could add here:\

Top WordPress Plugins at The Blog Joint
Best Minimalistic Themes via Plaintxt

The theme that I wanted uploaded in the previous post is actually in the list of themes on plain txt - it’s called ‘Way to Clean’


Playing Catch Up

August 31st, 2006

Last time I blogged I was talking about the speed test site that I was making. After a fair bit of modification we ended up using it at work to test peoples speed on occaision, it works a little better than some of the other ad-riddled sites out there. While I was making it another speed testing site came out that I really liked, everyone go and check out speedtest.net, I really like the interface, plus it has an Australian mirror.

Since I haven’t yet posted this semester I should probably do a run down of the subjects I’m doing to see if any ByteClub members have done, or are doing them now, and can offer any advice.

C++ for Java Programmers - I’m quickly learning that C++ is a totally different beast! Compared to friends at other universities, I’ve always felt that starting with Java has been a blessing. Object-orientation, nice syntax, good free/open source editors and being able to devellop the same code on a linux machine and submit it for assessment on Windows (atleast true for SD1/SD2/DSA). Unfortunately, the thing I loved most about learning Java, is not true with C++…. There is no API. It’s hard to believe that a language has been develloped without the type of documentation that Java has. There is no one reference point available to people who don’t already know the ins and outs of the language.

Business Data Communications and Networks - Very interesting. Lots of chatter about differenet types of technologies, but unfortunately you don’t really get to have a deeper look at why they work, just get told that they work. It’s fun to do a subject like this when you have a couple of semesters of CCNA behinds you, albeit in High School.

Operating Systems - I’m quite liking getting a hands on with Linux. The tasks in the labs are actually quite fulfilling. I’m not finding the technical nature of the lectures as enthrawling as I dound Data Stuctures and Algrorithms last semester, but it’s still OK.

Analysis, Modelling and Design - It seems that CSSE students dislike UML with a vegence, I don’t really feel that I’m the same. It really not that hard to understand, and it actually does give you a good overview of what your about to program.

Well that post was way to long…. Promise some more interesting stuff - how about a quick run down on a AJAX form validation script that I’ve been working on…. Next time.

EDIT: Who do I email a theme that I would like uploaded too?


Speed Test (BETA)

July 4th, 2006

I have been playing around with the idea of creating an online speed test (ala ozspeedtest, internetfrog and testmy.net) and have created a bit of a beta/demo version for any byteclub members to test with.

Instead of relying on mirrors on local ISP servers I have gone with using flickr images and will probably more that over to All You Can Upload at some point as there terms of use are a lot less constricting.

Anyone interested can run a simple download speed test at http://sesh.no-ip.info/speedtest/ which is hosted on the machine sitting on my floor (Running Ubuntu 6.06 Server + Apache 2.0.55 + MySQL 5.0.22).

For anyone that has never done this sort of speed test before, basically it times how long you take to download an image, and from that calculates your speed based on the following equation:

((size of file in bytes)/(time taken))/1024

As an added novelty the application can also do ping’s and provides a little bit of information such as your IP/Hostname + a GeoLocation lookup.

Any bugs/ideas/inspiration are more than welcome. Still in early programming stage, you are the first people to see it other than myself.