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
import std.stdio; | |
import std.conv; | |
import std.concurrency; | |
void workerFunc() { | |
int value = 0; | |
value = receiveOnly!int(); | |
while (value >= 0) { | |
writefln("Worker: %s received", value); | |
double result = to!double(value) / 5; |
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" encoding="UTF-8"?> | |
<config> | |
<modules> | |
<module> | |
<type> | |
<class>Scaffolded</class> | |
<param name="resource">programs</param> | |
<param name="unicode">title</param> | |
<param name="name">Программы</param> | |
</type> |
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
#coding: utf-8 | |
import os | |
from scrapy.contrib.spiders import CrawlSpider, Rule | |
from scrapy.contrib.linkextractors.regex import RegexLinkExtractor | |
class ZavtraSpider(CrawlSpider): |
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
(defun random-number (length &key (current 0) odd) | |
(cond | |
((and odd (<= length 1)) (if (= 1 (mod current 2)) current (+ 1 current))) | |
((<= length 1) current) | |
(t (random-number (- length 1) :current (+ (ash current 1) (random 2)) :odd odd)))) | |
(defun check-prime (n rounds) | |
(let | |
((basic-primes '(2 3 5 7 9 11 13 17 19 23 29 31 37 41))) | |
(if (loop for i in basic-primes |
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
module Parser | |
open System | |
open System.Text | |
type Parser< 'T >(func : string -> Option<'T * string> ) = | |
member this.eval = func | |
(* Conditional parse *) | |
let (<?>) (par : Parser< 'T >) (pred : 'T -> bool) = Parser( fun x -> |