This file contains 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
void BZR_iterate(int *cell, int *cell_new, | |
int width, int height, | |
int k1, int k2, int g, int n) { | |
int x, y, xx, yy; | |
int c, S, excited, active; | |
int v; | |
int c_new; | |
for (y = 0; y < height; ++y) { | |
for (x = 0; x < width; ++x) { | |
c = cell[x + y * (width+2)]; |
This file contains 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 Channel = (function () { | |
var channels = {}, PREFIX = 'Channel:'; | |
return { | |
connect: function (id, handler, indirect) { | |
indirect = indirect || false; | |
if (indirect) { | |
window.addEventListener(PREFIX + id, handler, false); | |
} | |
else { |
This file contains 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
param([bool]$enable) | |
$signature = @' | |
[DllImport("user32.dll")] | |
public static extern bool SystemParametersInfo( | |
uint uiAction, | |
uint uiParam, | |
uint pvParam, | |
uint fWinIni); | |
'@ |
This file contains 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
// using Qt | |
QByteArray shuffled(const QByteArray &ba) | |
{ | |
QByteArray result = ba; | |
int n = result.count(); | |
char *c = result.data(); | |
while (n) { | |
int j = qrand() % n--; | |
char tmp = *(c + n); |
This file contains 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 <boost/algorithm/string/predicate.hpp> | |
struct BoolTranslator | |
{ | |
typedef std::string internal_type; | |
typedef bool external_type; | |
// Converts a string to bool | |
boost::optional<external_type> get_value(const internal_type& str) | |
{ |
This file contains 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
std::string createGUIDString(void) { | |
GUID guid; | |
HRESULT hCreateGuid = CoCreateGuid(&guid); | |
std::stringstream strBuf; | |
strBuf << std::hex << std::setw(8) << std::setfill('0') | |
<< guid.Data1 << "-" << guid.Data2 << "-" << guid.Data3 << "-"; | |
for (int i = 0; i < 2; ++i) | |
strBuf << std::hex << std::setw(2) << std::setfill('0') << short(guid.Data4[i]); | |
strBuf << "-"; | |
for (int i = 2; i < 8; ++i) |
This file contains 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 <string> | |
#include "mt.h" | |
warmupRNG(); | |
std::uniform_int_distribution<int> rollTheDice(1, 6); | |
for (int i = 0; i < 1000; ++i) | |
std::cout << rollTheDice(gRNG()) << ", "; | |
This file contains 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
result = [a[:] for a in [[' '] * h] * w] |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import sys, subprocess | |
from os import chdir | |
from glob import glob | |
FFMPEG = 'D:\\Developer\\ffmpeg.exe' | |
FFPROBE = 'D:\\Developer\\ffprobe.exe' |
This file contains 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
@keyframes hammer { | |
from,20%,53%,80%,to { | |
-webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); | |
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); | |
-webkit-transform: translate3d(0, 0, 0); | |
transform: translate3d(0, 0, 0) | |
} | |
40%,43% { | |
-webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); | |
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); |
OlderNewer