This file contains hidden or 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
#sudo sysctl -w net.inet.ip.portrange.first=32768 | |
sudo sysctl -w net.inet.ip.portrange.first=12000 | |
sudo sysctl -w net.inet.tcp.msl=1000 | |
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000 |
This file contains hidden or 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
const o = { | |
i: 0, | |
get x() { | |
return this.i++; | |
} | |
}; | |
switch (o.x) { | |
case 0: | |
console.log("a"); | |
case 1: |
This file contains hidden or 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
function Int2DArray(a: number, b: number) { | |
const data = new Int32Array(a * b); | |
return { | |
set(i: number, j: number, v: number) { | |
const index = j * a + i; | |
data[index] = v; | |
}, | |
get(i: number, j: number) { | |
const index = j * a + i; | |
return data[index]; |
This file contains hidden or 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
commit f37df59507f77cd9e7cad33c27b6c63dd7aae0e5 | |
Author: Parsa Ghadimi <[email protected]> | |
Date: Tue Mar 6 22:15:36 2018 +0330 | |
[Fix #196] Support RGB in imshow | |
diff --git a/src/im.ts b/src/im.ts | |
index adbd34e..26f0c55 100644 | |
--- a/src/im.ts | |
+++ b/src/im.ts |
This file contains hidden or 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
<?php | |
/** | |
* Class myRedisException | |
*/ | |
class myRedisException extends Exception{ | |
/** | |
* @var null|string | |
*/ | |
private $command = ''; | |
/** |
This file contains hidden or 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
<?php | |
// 2015/07 :) | |
/** | |
* The core class of Template Engine | |
* Class templateEngine | |
*/ | |
class templateEngine{ | |
/** | |
* @type array | |
*/ |
This file contains hidden or 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
<?php | |
$time1 = microtime(true); | |
include "lib.php"; | |
try{ | |
$db = new array_db("db1"); | |
}catch(Exception $e){ | |
echo $e->getMessage(); | |
} | |
$db->install([ | |
"users" => [ |
This file contains hidden or 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
// @flow | |
import Redis from 'redis'; | |
import bluebird from 'bluebird'; | |
import type {RedisClient} from 'redis'; | |
import uuid from 'uuid/v4'; | |
import md5 from 'md5'; | |
bluebird.promisifyAll(Redis.RedisClient.prototype); | |
const SearchClient: RedisClient = Redis.createClient({ | |
db: 2 | |
}); |
This file contains hidden or 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 { Params, T } from "propel" | |
let params = new Params() | |
let trainingData = [ | |
[[0, 0, 1], 0], | |
[[0, 1, 1], 1], | |
[[1, 0, 1], 1], | |
[[1, 1, 1], 1] | |
] | |
let unit_step = x => x < 0 ? 0 : 1 | |
let w = params.randn("W", [3]) |
This file contains hidden or 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 React, {Component} from 'react' | |
import hoistNonReactStatic from 'hoist-non-react-statics' | |
export default function(WrappedComponent){ | |
class withWindowDimensions extends Component{ | |
constructor(props){ | |
super(props) | |
this.updateDimensions = this.updateDimensions.bind(this) | |
} |