How to get started with test-driven development

Test-driven development is focused on short development iterations

Here is the general process:
  1. Add a test - Developer must completely understand the software requirements
  2. Run all tests- Confirms test harness is functioning and the new test fails (New code has not been written yet)
  3. Write some code -This is meant to be the first pass and will likely improve as the tests are performed
  4. Run the automated tests
  5. Refactor code- Clean it up


Google AJAX Libraries API

Open source JavaScript libraries are great but maintaining a production copy has its drawbacks. Google takes all the hassle out of maintaining these libraries. Check out Google AJAX Libraries API at Google Code


Simple Ajax Example

Today we are having more fun with XMLHttpRequest. This video tutorial will show you how to call a server side script when the user adds text to web form's text box. The server side script returns the current date/time.

That's it, pretty simple. Here is the project file (ajaxExample.zip): Download Project File


Where did XMLHttpRequest come from?

XMLHttpRequest is a key part of Ajax. The other part is javascript, so XMLHttpRequest is basically half of Ajax.

You can use it to get info from the server:
function handler() {
if(this.readyState == 4 && this.status == 200) {
// so far so good
if(this.responseXML != null && this.responseXML.getElementById('test').firstChild.data)
// success!
} else if (this.readyState == 4 && this.status != 200) {
// fetched the wrong page or network error...

Go Daddy $7.49 .com sale 200x200

var client = new XMLHttpRequest();
client.onreadystatechange = handler;
client.open("GET", "test.xml");
You can log a message from the server:
function log(message) {
var client = new XMLHttpRequest();
client.open("POST", "/log");
client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
Also, you can check the status of a document on the server:

function fetchStatus(address) {
var client = new XMLHttpRequest();
client.onreadystatechange = function() {
// in case of network errors this might not give reliable results
if(this.readyState == 4)
client.open("HEAD", address);

Find Your Special Someone

Where did XMLHttpRequest come from?

Microsoft gave us XMLHttpRequest in 2000, it was originally a server side API call for Outlook Web Access. Over time, web browsers have implemented XMLHttpRequest. If you are using a modern browser (IE 7 and up) then your page's javascript can use XMLHttpRequest. If you are sticking to your guns and not upgrading your browser then your page needs to invoke. XMLHttpRequest via an ActiveX Object.

In order to stomp out platform-specific code, the World Wide Web Consortium developed a working draft of XMLHttpRequest object's API.


My First Telnet Server

In this post I am going to show you how to build a simple Telnet server that uses TCP/IP and a command prompt. The development studio is Microsoft Visual C# 2008 Express Addition.

My First TCPIP Server from Joe Coder on Vimeo.

About TCP/IP:
  1. Internet Protocol Suite is a set of communications protocols used for the Internet.
  2. It is named from two of the most important protocols in it: the Transmission Control Protocol (TCP) and the Internet Protocol (IP).
The project file can be downloaded here: TcpServerDemo Download