I hereby claim:
- I am perfectmak on github.
- I am perfectmak (https://keybase.io/perfectmak) on keybase.
- I have a public key ASB7_Dxtx59iQl333dCDbhuZdQJkagJEknicWXcRd6igawo
To claim this, I am signing this object:
#!/bin/bash | |
#Sample usage: HOST=google.com ./tcp_request.sh | |
# Open a file descriptor 3 for input and output to tcp host and port 80 | |
exec 3<>/dev/tcp/$HOST/80 | |
lines=( | |
'GET /push_archive HTTP/1.1' | |
"Host: $HOST" |
[ | |
{ | |
"data": [ | |
{ | |
"name": "address", | |
"type": "felt" | |
}, | |
{ | |
"name": "content_len", | |
"type": "felt" |
I hereby claim:
To claim this, I am signing this object:
pragma solidity 0.6.1; | |
interface MoneyToken { | |
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); | |
} | |
contract Loan { | |
mapping(address => uint256) public loanRegistry; | |
address owner; | |
address public ngntTokenAddress; |
pragma solidity 0.6.1; | |
interface MoneyToken { | |
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); | |
} | |
contract Loan { | |
mapping(address => int256) public loanRegistry; | |
address owner = 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c; | |
/** |
function distance(color1, color2) { | |
const [ r1, g1, b1 ] = color1 | |
const [ r2, g2, b2 ] = color2 | |
return Math.sqrt( | |
Math.pow(r1 - r2, 2) + Math.pow(g1 - g2, 2) + Math.pow(b1 - b2, 2) | |
) | |
} |
function quantize(k, colors) { | |
... | |
const centerDistances = new Array(k) | |
for(let i = 0; i < colors.length; i++) { | |
for(let j = 0; j < centers.length; j++) { | |
centerDistances[j] = distance(centers[j], colors[i]) | |
} | |
const minimumDistance = Math.min(...centerDistances) | |
const closestCentersIndex = centerDistances.indexOf(minimumDistance) |
function getRandomKCenters(k, colors) { | |
return lodash.sampleSize(colors, k); | |
} | |
function quantize(k, colors) { | |
... | |
const centers = getRandomKCenters(k, colors) | |
... | |
} |
function quantize(k, colors) { | |
if (k > colors.length) { | |
throw Error(`K (${k}) is greater than colors (${colors.length}).`) | |
} | |
... | |
} |
function quantize(k, colors) { | |
if (k > colors.length) { | |
throw Error(`K (${k}) is greater than colors (${colors.length}).`) | |
} | |
const centers = getRandomKCenters(k, colors) | |
let centerDistances = [] | |
for(let i = 0; i < colors.length; i++) { | |
for(let j = 0; j < centers.length; j++) { |