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
JSON.encodeURI = function(jsonObject){ | |
var string; | |
$.each(jsonObject, function(key, value){ | |
string += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(value); | |
}); | |
return string.slice(1); | |
} |
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
<!doctype html> | |
<head> | |
<title>Word Count</title> | |
<link href="http://maxcdn.bootstrap | |
cdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> | |
<style> | |
.container { | |
padding-top: 40px; | |
} | |
.container *{ |
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 is2through9 = /[2-9]/; | |
var genElement = function(elm){ | |
var elementCount = 1; | |
var lastChar = elm[elm.length-1]; | |
if (is2through9.test(lastChar)){ | |
elementCount = lastChar; /* add coefficient */ | |
elm = elm.slice(0, -1); | |
} | |
return [elementCount, elm]; |
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
#include <stdio.h> | |
int main(){ | |
for (int i = 0; i < 100; i++){ | |
if (i % 15 == 0) { | |
printf("FizzBuzz\n"); | |
} else if (i % 3 == 0){ | |
printf("Fizz\n"); | |
} else if (i % 5 == 0){ | |
printf("Buzz\n"); |
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
hello, goodbye, re = ARGV | |
print hello | |
puts " and #{goodbye}" |
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
object FizzBuzz { | |
def main(args: Array[String]){ | |
for( i <- 1 to 100){ | |
if (i%15 == 0) | |
println("FizzBuzz") | |
else if (i%3 == 0) | |
println("Fizz") | |
else if (i%5 == 0) | |
println("Buzz") | |
else |
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
{ | |
"name": "data-vis-intro", | |
"version": "1.0.0", | |
"description": "", | |
"main": "server.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "6to5-node server.js" | |
}, | |
"author": "", |
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 F = require('fractional').Fraction; | |
var colors = require('colors'); /* unused */ | |
var hardLimit = 20; /* times */ | |
var divisor = eval(process.argv[2]); | |
var value = 0; | |
var path = ''; | |
var m =''; | |
for (var i = 1; i < hardLimit; i++) { | |
var res = Math.pow(divisor, i); |
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
Array.prototype.toLinkedList = function(){ | |
var lastElement = {data: this[this.length-1], next: undefined}; | |
for (var i = this.length - 2; i >= 0; i--){ | |
lastElement = {data: this[i], next: lastElement}; | |
} | |
return lastElement; | |
}; |
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
/* USAGE: | |
node webD.js [dictionaryfile] [hashalgo] | |
*/ | |
var crypto = require('crypto'); | |
var fs = require('fs'); | |
/* SETUP */ | |
var target = 'xQj73CykeTXZoUXgeMxvh9IdBIk'; |
OlderNewer