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 grid_clasterization = (points, quadrant_size, grid_size, x_max, y_max) => { | |
const quadrants = Array.apply(null, {length: Math.ceil(grid_size/quadrant_size)}).map(e => 0); | |
const grid_width = Math.sqrt(grid_size); | |
const quadrant_width = Math.sqrt(quadrant_size); | |
const grid_quadro_x_size = (x_max / grid_width)*quadrant_width; | |
const grid_quadro_y_size = (y_max / grid_width)*quadrant_width; | |
for(const point of points) { | |
const x_index = (Math.ceil(point.x/grid_quadro_x_size) - 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
<button onClick={() => { | |
const jsonData = JSON.stringify(state, null, 2); | |
const w = window.open(); | |
w.document.open(); | |
w.document.write('<html><body><pre>' + jsonData + '</pre></body></html>'); | |
w.document.close(); | |
}}>open</button> |
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 fetch = require('node-fetch'); | |
function btob64(buff) { | |
let binary = ''; | |
const bytes = (new Array()).slice.call(new Uint8Array(buff)); | |
for(let i = 0; i < bytes.length; ++i){ | |
binary = binary + String.fromCharCode(bytes[i]); | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>pr</title> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; |
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
// ========== array brace validation | |
const edict_arr = [ | |
['[', ']'], | |
['(', ')'], | |
['{', '}'], | |
]; | |
function valid_arr(braces){ |
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
<!DOCTYPE html> | |
<html lang="ru"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>pistonizator</title> | |
</head> | |
<body style="text-align: center; font-size: 24px;"> | |
<p>MVC</p> | |
<img id="mainv" src="http://fb.ru/misc/i/gallery/51506/2272349.jpg"></img> | |
<br/> |
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
<!DOCTYPE html><html><head><style type="text/css"> | |
#main_wrapper { | |
margin: 0; | |
padding: 0; | |
overflow: none; | |
} | |
.nvtooltip { | |
position: absolute; | |
background-color: rgba(255,255,255,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
<!DOCTYPE html><html><head><style type="text/css"> | |
#main_wrapper { | |
margin: 0; | |
padding: 0; | |
overflow: none; | |
} | |
.nvtooltip { | |
position: absolute; | |
background-color: rgba(255,255,255,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
// ========== data | |
const data = [{ | |
"value":49, | |
"childs":[ | |
{"value":54, "childs":[ | |
{"value":25, "childs":[{"value":5, "childs":[]},{"value":5, "childs":[]}]}, | |
{"value":15, "childs":[{"value":25, "childs":[]},{"value":125, "childs":[]},{"value":625, "childs":[]},{"value":55, "childs":[]}]}, | |
{"value":35, "childs":[{"value":25, "childs":[]}]} | |
]}, | |
{"value":55, "childs":[{"value":85, "childs":[]},{"value":45, "childs":[]},{"value":25, "childs":[]}]}, |
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
package main | |
import ( | |
mgo "gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"time" | |
) | |
// ========== model |
NewerOlder