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){ |
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
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
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
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
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
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
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
SELECT e.id, e.rok_wydania, e.lokalizacja_id as lokalizacja_nazwa, e.lokalizacja_id as l_ident, | |
e.wydawnictwo_id as wydawnictwo_name, e.wydawnictwo_id as w_ident, | |
fullname(u.imie, u.nazwisko) as user_fullname, u.id as u_ident, | |
k.tytul as ksiazka_tytul, k.tytul as k_ident, | |
fullname(a.imie, a.nazwisko) as autor_fullname, a.id as a_ident, | |
wyp.id as wyp_ident, wyp.id IS NOT NULL as wypozyczony | |
FROM egzemplarz e LEFT OUTER JOIN wypozyczenia wyp ON wyp.egzemplarz = e.id AND wyp.data_zwrotu IS NULL | |
LEFT OUTER JOIN uzytkownik u ON wyp.uzytkownik = u.id | |
JOIN ksiazka k ON e.ksiazka_id = k.tytul | |
JOIN autor a ON a.id = k.autor_id; |
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
BEGIN; | |
CREATE TABLE "autor" ( | |
"id" serial NOT NULL PRIMARY KEY, | |
"imie" varchar(255) NOT NULL, | |
"nazwisko" varchar(255) NOT NULL, | |
"rok_urodzenia" integer NOT NULL, | |
"rok_smierci" integer | |
) | |
; | |
CREATE TABLE "wydawnictwo" ( |
OlderNewer