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
200.times do | |
Thread.new { `./klient 100 1 1` } | |
end | |
Thread.new { `./klient 100 100 #{1..1000.join(" ")}` } |
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
int main() { | |
{ | |
Rational a(1, 3), b, c(a), d, e(1); | |
d = a; | |
e = 1; | |
assert(d == a); | |
assert(b == Zero()); | |
assert(e == One()); | |
assert(a && !b); | |
assert((a / b).isNumber() == false); |
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
let rev = List.fold_left (fun a x -> x::a) [];; | |
let is_prime x = | |
let rec pom a = | |
if a*a > x then true | |
else | |
if x mod a = 0 then false | |
else pom (a+2) | |
in if x mod 2 = 0 then false | |
else pom 3;; |
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
cp /etc/hosts /etc/hosts.backup && | |
for h in $( echo 'blip.pl | |
flaker.pl | |
ign.com | |
joemonster.org | |
jogger.pl | |
onet.pl | |
polygamia.pl | |
wyborcza.pl' ) | |
do |
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
from django.db.models.signals import * | |
class UserNotPresentError(Exception): | |
pass | |
class SignalNotSpecifiedError(Exception): | |
pass | |
class SignalReceiver(object): | |
user = None |
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
You can represent time statements in most western languages where | |
a prefix and/or suffix is used. | |
The default case is to use suffix only (as in English), which you | |
do by providing the `suffixAgo` and `suffixFromNow` settings in | |
the strings hash (earlier versions of timeago used the deprecated | |
`ago` and `fromNow` options). If present, they are used. | |
2 minutes [suffixAgo] | |
2 minutes [suffixFromNow] |
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
#!/bin/bash | |
username=$(whoami) | |
proc="$(ps aux | grep $username | grep -v $0 | grep firefox | grep -v grep)" | |
if [ "$proc" != "" ] | |
then | |
echo "shutdown firefox first!" | |
exit 1 | |
fi | |
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
#include <iostream> | |
#include <stack> | |
using namespace std; | |
stack<int> liczby; | |
int main (int argc, char const *argv[]) | |
{ | |
char c = 0; | |
while(true){ |
NewerOlder