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
const int HOWMANY = 1000000; | |
int main() { | |
int arr[HOWMANY + 1], k = 2, primec = 0; | |
while (primec < HOWMANY) { | |
int isprime = 1, p; | |
for (p = 0; p < primec; ++p) { | |
int pr = arr[p]; | |
if (k % pr == 0) { | |
isprime = 0; | |
break; |
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
// ==UserScript== | |
// @name blog.spodeli.org colorizer | |
// @namespace http://spion.github.io | |
// @version 0.3.4 | |
// @description Change the spodeli.org color | |
// @match http://b10g.spodeli.org/* | |
// @copyright public domain | |
// @grant metadata | |
// ==/UserScript== |
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 <OneWire.h> | |
#include <LiquidCrystal.h> | |
#include <avr/delay.h> | |
#define CHANGERATE 5 // in which limits will the temperature change since the last reading, in degrees | |
#define INPUTPIN 5 | |
// For every sensor found it outputs to serial: | |
// SensorID,CurrentTemp,Readout time,Current time | |
// Info at: http://wiki.spodeli.org/Хаклаб/Температура |
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 fibrous = require('fibrous'); | |
/** | |
* High-performance fibers context switcher | |
*/ | |
fibrous.switcher = function(dc, dt) { | |
dc = dc || 1; | |
dt = dt || 1; | |
var c = 0, | |
s = Date.now(); |
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 <iostream> | |
#include <vector> | |
#include <map> | |
#include <string> | |
#include <algorithm> | |
using namespace std; | |
int vrednostNaBukva(char bukva) { return bukva - 'A' + 1; } |
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
browserify --debug --watch -p ./tmpl.js example.js -o bundle.js |
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
<?xml version='1.0'?> | |
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
<fontconfig> | |
<dir>~/.fonts</dir> | |
<!-- The sensible defaults for most fonts. --> | |
<!-- Use antialiasing, but no hinting. If --> | |
<!-- you do use hinting, hint fully. --> | |
<match target="font"> | |
<edit mode="assign" name="hinting"> |
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 cp = require('child_process'), | |
EE = require('events').EventEmitter; | |
module.exports = function() { | |
var self = new EE(); | |
var audio = cp.spawn('arecord', ['-t', 'raw', '-f', 'U8', '-q']); | |
audio.stderr.pipe(process.stdout); | |
audio.stdout.on('data', function(d) { | |
var a = 0; | |
for (var k = 0; k < d.length; ++k) { |
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 duplex = require('duplexer'), // npm install duplexer | |
request = require('request'), // npm install request | |
spawn = require('child_process').spawn; | |
fs = require('fs'); | |
function ffmpegEncoder(opt, moreopt) { | |
var args = ['-i','pipe:'] | |
for (var key in opt) | |
args.push('-'+key, opt[key]); | |
args.push('pipe:'); |
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 async = require('async'); | |
exports.bfs = function bfs(start, moves, goal, done) { | |
goal(start, function(err, res) { | |
if (res) done(null, [start]); | |
else explore([start], 1); | |
}); | |
var depth = 0; | |
var foundGoal = null; | |
var visited = {}; |