- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
git remote add upstream https://github.com/bluetree-service/idylla.git
)L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
// Adapted from: http://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect/1968345#1968345 | |
function line_intersects(p0_x, p0_y, p1_x, p1_y, p2_x, p2_y, p3_x, p3_y) { | |
var s1_x, s1_y, s2_x, s2_y; | |
s1_x = p1_x - p0_x; | |
s1_y = p1_y - p0_y; | |
s2_x = p3_x - p2_x; | |
s2_y = p3_y - p2_y; | |
var s, t; |
var tablica_1 = [1,2,3,4,6], | |
tablica_2 = [3,1,5,6], | |
tablica_3 = [3,1,2,3,6], | |
tablica_4 = [3,5,6]; | |
function contains(array, item) { | |
return array.indexOf(item) !== -1; | |
} | |
function head(array) { |
/* VT100 terminal reset (<ESC>c) */ | |
console.log('\033c'); | |
/* numbers comparations */ | |
> '2' == 2 | |
true | |
> '2' === 2 |
;; copy-and-paste to/from emacs and osx application | |
(defun copy-from-osx () | |
(shell-command-to-string "pbpaste")) | |
(defun paste-to-osx (text &optional push) | |
(let ((process-connection-type nil)) | |
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) | |
(process-send-string proc text) | |
(process-send-eof proc)))) |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React Quick Prototyping</title> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react.min.js"></script> |
/** | |
* Created by Tomasz on 30.01.2016. | |
*/ | |
$(document).ready(function(){ | |
var canvas = $('#canvas')[0]; | |
var cont = canvas.getContext("2d"); | |
var wid = $('#canvas').width(); // szerokosc canvasa | |
var hei = $('#canvas').height(); // wysokos canvasa |