Pages: 1 2 3 4 5

Coming soon: New site.. version 3!

The redevelopment of this site and it's mini-site is nearly finished.

Hopefully over the next couple weeks we'll finish up and we can start the roll out. Stay tuned.

...

Read more

There are no comments on this post.

Python on Windows: How to get network protocol statistics

Just something I was playing around with today that I thought I might share.

I was curious about how to get network statistics in windows so I've been reading MSDN all day trying to work it out. I've written a little bit of python using the ctypes module to access the API on network statistics. All I can say is that doing these things on Linux is so much easier as you can just access the /proc directory and parse the system files there that contain such information.

...

Read more

There are no comments on this post.

My microcode decoder design

Months ago I was required to design and model some part of computer system architecture. I decided to do a very small microcode processor.

For those who are unfamiliar with microcode allow me to explain the significance. In computer system design there are two approaches to designing instruction decoders. The first is called the hardwired approach. For each possible instruction in our instruction set the decoder designers spend a lot of time with truth tables. Each bit in the instruction is mapped through logic pathways to produce an appropriate result on the processor control lines. This is a very efficient decoding approach as instructions are decoded extremely fast. The problem is that if you change the instruction set or even modify the components in the processor, the decoder will need a complete overhaul. This becomes expensive.

The second approach is called microcoding. Here we design a dynamic instruction set that can be reprogrammed (called microprogramming believe it or not). The idea is that we store the entire instruction set and the values of each control line in a very small very fast memory device. When an instruction enters the decoder, the decoder simply looks up the values of the control lines for the input instruction and writes them out onto the bus. This is not as fast as a hardwired approach because memory devices have much greater latency than logic gates however it makes changing the instruction set (adding, removing or modifying instructions) very easy. We don't have to spend a lot of time completely redesigning the decoder whenever we add, remove or modify other components in our system. We simply reconfigure the decoder to behave differently when it receives an instruction.

...

Read more

There are no comments on this post.

Diffie-Hellman-Merkle key exchange in a nutshell

This is a simple Python implementation. Note the global variables p and a should in general be re-generated each pass. p is any prime and a is the primitive root of p.

...

Read more

There are no comments on this post.

Dynamically importing Python modules by filename

After looking for a way to import Python modules when given a valid filepath I came across a description of a technique to do so here.

What I did not like about this approach was the use of null_module. In his approach you needed to have a module called null_module somewhere in your PYTHONPATH. This was then cloned and the information about the actual module you wish to report overwrites this module. In short, he was using null_module as a skeleton module for the import. This is unnecessary.

To do the entire import in a much nicer way you can simply do:

...

Read more

There are 2 comments on this post.

JavaScript tip: How to find the document elements that intersect at a certain coordinate

This is going to be mostly a code post.

First thing we need is a method of getting the coordinate of elements in the document. Here is a function I created to do that.

/**
 * Get the offset coordinates of the element.
 * @param {Object} element The element.
 * @return {Object} An object with four properties named x1, x2, y1 and y2 containing the elements left, right, top and bottom edges respectively.
 */
function getElementPosition(element) {
    var elementX = 0;
    var elementY = 0;
    var elementW = element.offsetWidth;
    var elementH = element.offsetHeight;
 
    while (element.offsetParent) {
        elementX += element.offsetLeft;
        elementY += element.offsetTop;
        element = element.offsetParent;
    }
 
    elementX += element.offsetLeft;
    elementY += element.offsetTop;
    elementW += elementX;
    elementH += elementY;
 
    return {x1: elementX, y1: elementY, x2: elementW, y2: elementH};
}

...

Read more

There are no comments on this post.

An easy technique for ellipsis drawing on JavaScript canvas objects

During my recent struggle with the JavaScript canvas object I was looking for a method to draw ellipses. Originally I was trying to use the arcTo() and even got desperate enough to have a quick play around with the bezierCurveTo() and quadraticCurveTo( ) functions before the obvious solution dawned on me.

In the event anybody else wastes their times looking for a way to do this try the following:

var e = document.createElement("canvas");
document.body.appendChild(e);

...

Read more

There are no comments on this post.

Relaunch of the nullnetwork imagepaste

After taking significant time to be lazy & forgotful I have reconfigured the apache to run the nullnetwork image paste tool again (available at http://imagepaste.nullnetwork.net/). All are free to contribute to the gallery.

There are no comments on this post.

Installing the link layer topology discovery (LLTD) protocol responder on Debian Linux

This post on how to install the LLTD is largely ripped off from http://www.howtoforge.com/installing-the-lltd-protocol-responder-for-linux-on-debian-lenny and made a bit more direct for those that just want to make it work and not pay attention to what you're doing! Like me!

So let's dive right in.

mkdir lltd
cd lltd
wget http://download.microsoft.com/download/b/8/e/b8eee444-f8d5-4b8b-aa3d-2f19bf19ac72/Rally-LLTD-PortingKit.exe
unzip Rally-LLTD-PortingKit.exe
sudo apt-get install linux-headers-`uname -r` build-essential

...

Read more

There are 4 comments on this post.

Microsofts open source push

Microsoft is now a major sponsor of the Apache Software Foundation and is putting its protocols and formats into a royalty-free license, all part of a larger open-source push.

Big things are happening with Microsoft lately. As an Open Source developer by nature I can say that I was a little shocked when they first opened their Microsoft Office document format specifications (which I was sad enough to read!). There are various news stories where Microsoft is becoming more open. I like it. I like it a lot.

As to why they are doing it, the only reason I can see is that they are taking a beating in the the computer industry with competitors like Apple, IBM, Mozilla and Google all peaking at their profits. Not to mention the European computer laws on monopolistic behaviour. They need to form alliances and change market opinion about them if they want to remain unchallenged.

...

Read more

There are no comments on this post.

Pages: 1 2 3 4 5

Powered by Debian, Guinness, and excessive quantities of caffeine and sugar.