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
$ cat Demo.java | |
class Demo { | |
public static void main(String args[]) { | |
System.out.println("Aa".hashCode()); | |
System.out.println("BB".hashCode()); | |
} | |
} | |
$ javac Demo.java | |
$ java Demo |
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 -*- | |
tabulka = """ | |
000002 | |
011011 | |
101100 | |
110111 | |
011120 | |
100022 |
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 -*- | |
fin = ("2",) | |
dvojice = """ | |
0 1 | |
1 2 | |
1 3 | |
3 4 |
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
digraph cv5 { | |
// public int fnc() { | |
node [fontname="menlo-regular"]; | |
edge [fontname="arial"]; | |
// B999(); | |
// int d999 = 808; |
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 -*- | |
from optparse import OptionParser | |
import os | |
from select import select | |
import socket | |
def main(): | |
op = OptionParser() |
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 logging | |
from time import monotonic as monotime | |
logger = logging.getLogger(__name__) | |
class TimingWrapper: | |
''' | |
Wrapper na jakoukoli strukturu objektů, který měří dobu trvání běhu metod |
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 zmq = require('zmq'); | |
var socket = zmq.socket('dealer'); | |
socket.connect('tcp://127.0.0.1:3333'); | |
socket.on('message', function(payload) { | |
console.info('Received:', payload.toString()); | |
}); | |
console.info('Sending...'); |
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
def ano_nebo_ne(otazka): | |
"Vrátí True nebo False, podle odpovědi uživatele" | |
while True: | |
odpoved = input(otazka) | |
if odpoved == 'ano': | |
return True | |
elif odpoved == 'ne': | |
return False | |
else: | |
print('Nerozumím! Odpověz "ano" nebo "ne".') |
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
from contextlib import contextmanager | |
import multiprocessing | |
def main(): | |
multiprocessing.current_process().name = 'master' | |
mgr = multiprocessing.Manager() | |
with setup_logging(mgr): | |
pass # do cool stuff here |
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 python3 | |
import flask | |
import json | |
app = flask.Flask(__name__) | |
@app.route('/') | |
def index(): | |
return ''' |