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
# -*- coding: utf-8 -*- | |
__author__ = 'vit' | |
import tornado.web | |
class Handler(tornado.web.RequestHandler): | |
def _calling(self, http_method, action_name, args): | |
if http_method != 'get' and http_method != 'post': | |
raise tornado.web.HTTPError(405) |
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
# | |
# Имеется груз массой massa и набор весов, указанных в таблице | |
# | |
# create table m ( n int unsigned not null auto_increment, w int not null, primary key(n) ); | |
# insert into m values (NULL, 3), (NULL, 5), (NULL, 4); | |
# | |
# где n - порядковый номер веса (без разрывов), w - вес | |
# | |
# Можно ли указанными в таблице весами взвесить груз массой massa? | |
# |
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
# | |
# В декартовой СК на плоскости имеется набор окружностей одинакового радиуаса r. | |
# | |
# Таблица с центрами окружностей: | |
# | |
# create table p ( x int, y int ); | |
# | |
# Нужно найти максимальное количество окружностей, которые польностью покроет | |
# окружность указанного радиуса Rg | |
# |
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
$s='/home/vit/plint/modules/';$a = dir('/home/vit/plint/modules'); while (FALSE !== ($b = $a->read())) { if( ($b === '.' || $b === '..') || is_dir($s.$b)) continue; if (preg_match('/\.php$/',$b)) { $c=substr($b, 0, strlen($b) - 4); print($b . "\t--->\t" . $c . "\t\t\t\t" . (rename($s . $b, $s . $c) ? "OK" : "FAILED!") . "\n"); } } |
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
<html> | |
<head> | |
<title>ava</title> | |
</head> | |
<body> | |
<form action="http://api.imajao.com/1.0.1/user/edit" method="POST" enctype="multipart/form-data"> | |
<input name="apikey" value="cfcd208495d565ef66e7dff9f98764da" /> | |
<input name="token" value="spy1p1gxjk0vtanx5vtwyg21sewru8eo" /><br> | |
<input type="file" name="avatar"> <input type="submit"></form> | |
</body> |
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
PS1="\w [\e[0;34m`git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/\1/'`\e[0m]\n$ " | |
PS1="\e[2;36m\t\e[0m \w \e[1;33m`git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/\1/'`\e[0m\n$ " | |
PS1="\w \e[1;33m`git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/\1/'`\e[0m\n$ " |
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 connect = require('connect'), | |
http = require('http'), | |
mongodb = require('mongodb'), | |
db1, db2; | |
db1 = new mongodb.Db('first', new mongodb.Server('127.0.0.1', 27017, {})); | |
db2 = new mongodb.Db('second', new mongodb.Server('127.0.0.1', 27017, {})); |
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 maxTimeoutLoopExecutionTemplate = "(function (maxTimeout, fn, delay) {" + | |
" var t;" + | |
" setTimeout(function () { clearTimeout(t); }, maxTimeout);" + | |
" t = (function z() { return setTimeout(function () { fn(); t = z(); }, delay); })();" + | |
"})(:maxtimeout, function () { :expression }, :delay);"; | |
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() { | |
function extend(obj) { | |
Array.slice.call(arguments, 1).forEach(function(source) { | |
for (var prop in source) { | |
obj[prop] = source[prop]; | |
} | |
}); | |
return obj; | |
}; |
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() { | |
function extend(obj) { | |
Array.prototype.slice.call(arguments, 1).forEach(function(source) { | |
for (var prop in source) { | |
obj[prop] = source[prop]; | |
} | |
}); | |
return obj; | |
}; |