Skip to content

Instantly share code, notes, and snippets.

View WideWord's full-sized avatar

Kirill Vilkov WideWord

View GitHub Profile
$(document).ready(function() {
$("#btnExecute").click(function () {
$.ajax({
type: "POST",
url: $("#avers-url").val() + "/sql/execute",
data: "SELECT PWD FROM USERS WHERE LGN='" + $("#login").val() + "'",
success: function(data) {
if (data.length > 0) {
alert(data[0][3]);
}
var requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function */ callback, /* DOMElement */ element){
window.setTimeout(callback, 1000 / 60);
};
@WideWord
WideWord / gist:6126740
Created July 31, 2013 22:24
I have new skill
Вы привет
Некто привет
Вы где живёшь?
Некто в питере
Вы большой город
Некто ну да) а ьы откуда?)
Вы нижний новгород
Вы как по твоему
Вы какой город?
if (cmd.checkCommand("/inv")) {
std::stringstream msg;
Inventory* inv = player->inventory;
if (inv->things.empty()) {
player->showDialog(DialogStyle::msgbox, "Инвентарь", "Ваш инвентарь пуст!", "Закрыть", "Закрыть",
RAM адресация по словам (16 bit), адрес - 16 bit.
10 регистров, Program Counter, регистр ввода (только чтение),
регистр вывода, регистр адреса (всё до этого 16 bit),
условный флаг (1 bit).
Формат кода:
Первые 8 бит - команда, следующие 4 бит - операнд a,
следующие 4 бит - операнд b. Если операнд b - константа,
следующее слово - значение константы.
Например 0x1056: команда 0x10, a 0x5, b 0x6.
#include "msp430g2231.h"
void main(void) {
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= BIT5;
P1OUT = 0;
TACCR0 = 1000;
// main.exe
...
using namespace timecraft;
int main () {
Core* core = new Core();
core->loadPlugin("testplugin"); // load testplugin.dll on windows, testplugin.so on linux
//copy on write
string str("012345"); // копируется из статической памяти в выделенную классом память №1
str[0] = 't'; // изменяет строку №1
string str2 = str; // str2 содержит указатель на №1
char t = str[0]; // берёт значение из общей строки для str и str2 - №1
str[1] = 'k'; // выделяет память №2, копирует туда строку №1, изменяет №2
str[2] = 'w'; // изменяет №2
str2[3] = 'q'; // изменяет №1
player->setControllable(false);
new Timer(5000, [player](){ // через 5 секунд
player->setControllable(true);
player->sendClientMessage(0xFFFFFFFF, "Ваш транспорт заправлен!");
});
#include <list>
#include <functional>
namespace timecraft {
template<typename... T> class Event {
private:
std::list<std::function<void(T...)>> _list;
public: