This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"); | |
var url = require("url"); | |
function start() { | |
function onRequest(request, response) { | |
var pathname = url.parse(request.url).pathname; | |
console.log("Request for " + pathname + " received."); | |
response.writeHead(200, {"Content-Type": "text/plain"}); | |
response.write("Hello World"); | |
response.end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
$path="/ilab/users/bilalq/.scripts/primeList.txt" | |
class Prime | |
def initialize | |
@primes=File.open($path).collect do |num| | |
num.to_i | |
end | |
@count = @primes.size | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[bilalq@cpp:.scripts]$ ./prime | |
2 | |
3 | |
5 | |
13 | |
89 | |
233 | |
1597 | |
28657 | |
514229 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
professionsTable.addEventListener('click', function(e) | |
{ | |
if (e.row.path) | |
{ | |
var win = Ti.UI.createWindow({ | |
url: e.row.path, | |
title: e.row.title | |
}); | |
var profession = e.row.title; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dateOfBirth = Ti.UI.createPicker({ | |
type: Ti.UI.PICKER_TYPE_DATE, | |
minDate:new Date(1900,1,1), | |
maxDate:new Date(2000,1,1), | |
value:new Date(1995,8,1) | |
}); | |
var birthDayLine = Ti.UI.createView({ | |
layout: 'horizontal', | |
height: Ti.UI.SIZE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var images = [/*Array of image views with width of 22%*/]; | |
var row; | |
var grid = Ti.UI.createView({ | |
layout: 'vertical' | |
}); | |
for (var i=0; i<images.length; i++) { | |
if (i % 4 == 0) { | |
row = Ti.UI.createView({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void printHTML(Node target) | |
{ | |
if(target.hasBache()) | |
{ | |
ArrayList<Node> temp = target.getKids(); | |
for(int i = 0; i < temp.size(); i++) | |
{ | |
Node child = temp.get(i); | |
if(child.isTag()) | |
{ |
NewerOlder