November 14, 2009

Server push demo

In this demo, I use two XMLHttpRequests ? one is a regular request to submit messages to the server, while the second one is the push channel to get messages from the server. The first XMLHttpRequest is easy. When you press enter, the browser initiates this request, and sends the message entered to the server. It then waits for the server to acknowledge the message. The server processes this message and acknowledges by either asking the browser to initiate the push channel, and a simple OK. The push channel is based on a technique described in Server Push and Server Sockets. In this technique, the push channel returns a multipart response with content type multipart/x-mixed-replace. Whenever a new chat message arrives, the server writes a MIME part containing the message. Here is an example message:





You said: Knock knock



--goofup101
Content-type: text/xml


You said: Who's there?



--goofup101--
On the browser side, we need to be able to process each part without waiting for the complete multipart message to arrive. This can be done via the onload handler of XMLHttpRequest. Here is an example. The onload handler in this example gets called whenever a new chat message arrives.


var channel = ...; // Create XMLHttpRequest
channel.multipart = true;
channel.onload = function(e)
{
var message;
if(this.responseXML) {
message = this.responseXML;
}
else {
message = this.event.target.responseXML;
}

// Process the message
};
...
channel.open('GET', url, true);
channel.send(null);
...


These are the easier problems to solve. For the server push to work effeciently and effectively, managing connections is critical for both the browser and the server

Multiprogramming in Ruby

Multiprogramming is the writing of computer programs that write or manipulate other programs as their data.


class Device
def initialize(device_id, data_resource)
@id = device_id
@data_resource = data_resource
end

def display_device
mode = @data_resource.get_display_device_mode(@id)
presets = @data_resource.get_display_device_presets(@id)
summary = "display_device: #{mode} ($#{presets})"
return "* #{summary}" if presets == "XTC909"
summary
end

def chip
mode = @data_resource.get_chip_mode(@id)
presets = @data_resource.get_chip_presets(@id)
summary = "chip: #{mode} ($#{presets})"
return "* #{summary}" if presets == "XTC909"
summary
end

def input_device
mode = @data_resource.get_input_device_mode(@id)
presets = @data_resource.get_input_device_presets(@id)
summary = "input_device: #{mode} ($#{presets})"
return "* #{summary}" if presets == "XTC909"
summary
end

end

November 7, 2009

delhi police recruitment and results 2009

Result of Trade test held from 05-10-2009 to 19-10-2009 for the post of CONSTABLE (DRIVER) in Delhi Police-2009.---http://www.delhipolice.nic.in/home/recruitment/driver_trade_22102009.doc


Result of Written Examination held on 19-08-2009 for the post of Constable (Executive)-Male in Delhi Police 2009.---http://www.delhipolice.nic.in/home/recruitment/Male_Written%20_Result_11-09-09.doc




RECRUITMENT OF MALE CONSTABLES (EXECUTIVE) – 2009-10

Applications are invited to fill up 6302 vacant posts of Temporary Constable (Executive)-Male and 416 vacant posts of Temporary Women Constable (Executive) in Delhi Police under the following categories in the pay scale of PB-1 Rs. 5200/- 20200/- + Grade Pay Rs. 2000/- and other allowances as admissible. Recruitment will be held at Delhi for which candidates from all parts of the country fulfilling conditions mentioned hereunder can apply:-

Sl. No.Name of postsUROBCSCSTTotal
1.Constable (Exe)-Male318217029454736302
2.Women Constable (Exe)2111126231416





CLOSING DATE: 28.11.2009.

AGE-CONSTABLE (EXE.)-MALE: : 18 to 21 years as on 01.07.2009, i.e. those born not earlier than 02.07.1988 and not later than 01.07.1991 will be eligible


AGE-WOMEN CONSTABLE (EXE):
18 to 25 years as on 01.07.2009, i.e. those born not earlier than 02.07.1984 and not later than 01.07.1991 will be eligible.

pay scale of PB-1 Rs. 5200/- 20200/- + Grade Pay Rs. 2000/- and other allowances as admissible

Fee: Rs. 100/-

more details ------> http://www.delhipolicerecruitment.in/mconst2009-10/home.cgi