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
#include "./../deps/libuv/include/uv.h" | |
#include <stdio.h> | |
int msg; | |
void mkdir_cb (uv_fs_t* req) { | |
int* msg = req->data; | |
printf("send(%d)\n", *msg); | |
} |
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 org.lwjgl.opengl.*; | |
import org.lwjgl.*; | |
import org.lwjgl.util.glu.*; | |
import org.lwjgl.input.*; | |
public class Main { | |
public static void main(String[] args) { | |
int w = 800, h = 600; |
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
keyboard = {} | |
keys = "oqz,ij,abc,def,gh,kl,mn,prs,tuv,wxy".split(",") | |
k = 0 | |
for x in keys: | |
for c in x: | |
keyboard[c] = k | |
k = k + 1 | |
def toNumbers(x): |
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 factorize (x) { | |
for (var i = 2 ; i <= Math.sqrt(x) ; i++) { | |
if (x % i === 0) return [i].concat(factorize(x/i)); | |
} | |
return [x]; | |
} | |
function f (x) { | |
var numbers = []; |
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
@getHref = (js = false)-> | |
ret = "/"+(if section.length>0 then section else 'pubs') | |
ret += ".json" if js | |
pars = [] | |
filters = @current_filters.join(',') | |
pars.push("filter=#{filters)}" #if filters.length > 0 | |
pars.push("sort=#{current_sort}") if current_sort? | |
pars.push("page=#{current_page}") if current_page? | |
ret+'?'+pars.join('&') |
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
[16:30:31 MSK] Манук Акопян: тут? | |
[16:53:19 MSK] Artem Smirnov: да | |
[16:53:56 MSK] Манук Акопян: помоги мне | |
[16:53:56 MSK] Манук Акопян: :D | |
[16:54:03 MSK] Artem Smirnov: ? | |
[16:54:06 MSK] Манук Акопян: у меня короче по разу в день появляется экран смерти | |
[16:54:15 MSK] Манук Акопян: ошибки разные | |
[16:54:18 MSK] Artem Smirnov: ставь убунту | |
[16:54:21 MSK] Artem Smirnov: без приколов | |
[16:54:22 MSK] Манук Акопян: то память повреждена |
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
{ | |
"w" : 500, | |
"h" : 500, | |
"walls" : [ | |
{ | |
"x" : 0, | |
"y" : 0, | |
"w" : 500, | |
"h" : 20, |
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
procedure delete(var arr : array of integer; index : integer; var len : integer); | |
var i : integer; | |
begin | |
for i := index to len do begin | |
arr[i] := arr[i+1]; | |
end; | |
dec(len); | |
end; |
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 comb (items) { | |
if (items.length === 1) { | |
return [items[0]]; //Если только один элемент то только одно сочетание | |
} else { | |
var combs = []; //Массив комбинация | |
for (var i = 0 ; i < items.length ; i++) { | |
var subCombs = comb(items.slice(0, i).concat(items.slice(i+1))); //Под-сочетания | |
for (var t = 0 ; t < subCombs.length ; t++) { |
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
var factorial = (function () { | |
"use strict"; | |
function fact (product, counter, x) { | |
return counter > x ? product : fact(counter * product, counter + 1, x); | |
} | |
return function (x) { | |
return fact(1, 1, x); | |
}; |