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
interface Animal { | |
size: number; | |
} | |
interface Cat extends Animal { | |
furry: boolean; | |
} | |
interface Human extends Animal { | |
name: string; | |
} |
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
complete | |
on page, got: 3 results: [object HTMLLIElement],[object HTMLLIElement],[object HTMLLIElement] | |
From page, got: 3 results: [object Object],, |
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
fs = require('fs'); | |
function scrape() { | |
var url = "some local url with asset served"; | |
var date = new Date(); | |
var stamp = date.getTime(); | |
console.log("scraping url: " + url); | |
//Screenshot 1 - Routes and Traffic Time Table | |
var page = require('webpage').create(); |
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
c__builtin__ | |
frozenset | |
p1 | |
((lp2 | |
Vchikuho.fukuoka.jp | |
p3 | |
aVthruhere.net | |
p4 | |
aV\u0c2d\u0c3e\u0c30\u0c24\u0c4d | |
p5 |
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 AIToolbox | |
import XCTest | |
@testable import ios_hub | |
class LogRegTests: XCTestCase { | |
func getSmallTestData() -> DataSet { | |
// Create test case | |
let data = DataSet(dataType: .Classification, inputDimension: 2, outputDimension: 1) | |
do { |
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
// Code and tests adapted from Numpy library | |
func dot_product(in arr1: [Double], index1: Int, in arr2: [Double], index2: Int, n: Int, result_index: Int, inout result_arr: [Double]) { | |
var sum = 0.0; | |
for i in 0..<n { | |
sum += arr1[index1 + i] * arr2[index2 + i] | |
} | |
result_arr[result_index] = sum | |
} |
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 time | |
import threading | |
input_thread_values = [] | |
def input_thread(): | |
print('press s and enter to stop...') | |
global input_thread_values |
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 python3 | |
""" | |
Display the number of additions and deletions per commit for a file e.g. | |
$ ./git_helper.py index.d.ts | |
commit added deleted | |
bd1de57 4 4 index.d.ts Error object fix | |
c3a54db 25 120 index.d.ts Merge branch 'master' into types-2.0 | |
e9a0e98 58 10 index.d.ts Merge commit 'upstream/master~300' into merge_7_25 |
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
// Similar to Ruby array `last` method | |
Object.defineProperty(Array.prototype, "last", { | |
get: function(){ | |
return this.length && this[this.length-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
// Adapted from: https://nodejs.org/docs/latest/api/cluster.html | |
const cluster = require('cluster'); | |
const http = require('http'); | |
const numCPUs = require('os').cpus().length; | |
if (cluster.isMaster) { | |
console.log(`Master ${process.pid} is running on ${numCPUs} numCPUs`); | |
// Fork workers. |
OlderNewer