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 xcrun swift -i | |
println("Process.arguments gave args:") | |
for s in Process.arguments { | |
println(s) | |
} |
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
import java.io.*; | |
import org.apache.poi.xslf.usermodel.XMLSlideShow; | |
import org.apache.poi.POIXMLProperties.*; | |
import org.apache.poi.xslf.usermodel.*; | |
public class HelloPoi { | |
public static void main(String[] args) { | |
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
// Sort in order by frequency (descending) | |
var terms = ["a", "b", "a", "c", "a", "b"] | |
var termFrequencies = [String: Int]() | |
for t in terms { | |
if termFrequencies[t] == nil { | |
termFrequencies[t] = 1 | |
} else { | |
termFrequencies[t] = termFrequencies[t]! + 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
#!/usr/bin/env node | |
'use strict'; | |
var fs = require('fs'); | |
var when = require('when'); | |
var webdriver = require('selenium-webdriver'); | |
exports.takeShot = function(url, outputFilePath) { | |
return when.promise(function(resolve, reject) { |
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 node | |
'use strict'; | |
var when = require('when'); | |
var phantom = require('phantom'); | |
exports.takeShot = function takeShot(url, outputFilePath) { | |
return when.promise(function(resolve, reject) { |
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
#COUNT TERM ONE TERM TWO TERM THREE |TERM THREE PREDICTION | |
----------------------------------------------------------------------------- | |
# 1 fish showed fish | heart | |
# 2 ignite showed fire | fish | |
# 3 ignite showed match | fire | |
# 4 grain showed wheat | fire | |
# 5 development showed construction | fish | |
# 6 development showed code | construction | |
# 7 labor showed worker | fire | |
# 8 influence showed speaker | fire |
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
#COUNT TERM ONE TERM TWO TERM THREE |TERM THREE PREDICTION | |
----------------------------------------------------------------------------- | |
# 1 aunt likes baking | programming | |
# 2 aunt likes piano | baking | |
# 3 aunt eats vegetables | | |
# 4 uncle eats chocolate | vegetables | |
# 5 uncle likes bikes | programming | |
# 6 uncle eats coffee | chocolate | |
# 7 uncle likes running | bikes | |
# 8 uncle eats cereal | coffee |
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 _coffee | |
console.log 'hello ...' | |
setTimeout _, 100 | |
console.log '... world' | |
doSomething = (isError, cb) -> | |
process.nextTick -> | |
if isError | |
cb(new Error('error'), isError) | |
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
var items = ['0', '000', 0, 1, '001', 'a', 'z', 'A', 'Z', '!', null, undefined]; | |
console.log('sorted', items.sort()); | |
// defaults to string sort null becomes 'null' | |
// sorted [ '!', '0', 0, '000', '001', 1, 'A', 'Z', 'a', null, 'z', undefined ] | |
console.log('string sort', items.sort(function(a, b) { | |
if (a < b) { | |
console.log(typeof(a), a, '<', typeof(b), b, '== true'); |
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
if (1 == '1') console.log('1. 1 == "1"'); | |
if (1 === '1') {} else console.log('2. 1 is not === "1" (types different)'); | |
var a = 'a'; | |
var a1 = a; | |
var a2 = 'a'; | |
if (a == a1) console.log('3. a == a1'); | |
if (a == a2) console.log('4. a == a2'); | |
if (a === a2) console.log('5. even a ==== a2 (equal value and type)'); |