Create temporary MongoDB Docker container (named some-mongo
) and fill it with JSON data from data
subdir in current working directory. The documents are placed in tmp
DB, tmp
collection.
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
function mathjax_needed (classNames) { | |
var found = false; | |
classNames.forEach(function (className) { | |
[].forEach.call(document.getElementsByClassName(className), function (element) { | |
if (element.textContent.indexOf("$$") > -1) | |
found = true; | |
}); | |
}); | |
return found; | |
} |
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
5453287796 | |
340714825 | |
305725372 | |
7060224699 | |
7352262412 | |
6155279339 | |
6311125249 | |
7502218482 | |
9208022472 | |
356105230 |
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
Úkolem je realizovat funkci, která transformuje soubor s popisem rozvržení výuky. | |
Předpokládáme, že máme uložený seznam učitelů s předměty, které učí. Soubor je textově orientovaný, na každém řádku je zapsáno jméno učitele, dvojtečka a čárkou oddělený seznam vyučovaných předmětů. Jména učitelů i předmětů jsou tvořena výhradně znaky anglické abecedy (malá i velká písmena) a číslicemi. Před a za jmény mohou být bílé znaky (které nehrají žádnou roli, budou přeskočeny). Pokud řádka začíná znakem #, jedná se o komentář (přeskočit řádku). Soubor může vypadat např. takto: | |
lada : PA1 , PA2,OSY | |
#toto je komentar | |
pepa: PA1, PA2 | |
Úkolem programu je načíst takový soubor, zkontrolovat jeho správnost a zapsat obdobný soubor na disk. Ve výstupním souboru bude uveden seznam předmětů, pro každý předmět bude uveden seznam jejich vyučujících. Pro ukázku bude výstupní soubor obsahovat: |
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 requests | |
from bs4 import BeautifulSoup | |
from collections import namedtuple | |
from datetime import datetime | |
import csv | |
Earthquake = namedtuple('Earthquake', 'date, state, area, magnitude, lat, lon') |
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 | |
from tkinter import Tk, Canvas, mainloop | |
from math import cos, sin, pi, sqrt | |
from numpy import dot | |
# dot = lambda X, Y: [[sum(a*b for a, b in zip(X_row, Y_col)) for Y_col in zip(*Y)] for X_row in X] | |
master = Tk() |
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 sys | |
from requests import get | |
CRIME_CODE = 821 # = bribery | |
# make HTTP GET request for areas, parse them as JSON and access a list under a key "areas" | |
areas = get("http://mapakriminality.cz/api/areas", params={"level": 2}).json()["areas"] |
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 zmq | |
import struct | |
import sys | |
from time import sleep | |
def publish(port): | |
address = "tcp://*:{}".format(port) |
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 | |
from matplotlib import pyplot as plt | |
from matplotlib import animation | |
import threading | |
import collections | |
import queue | |
import logging |
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
<?php | |
$container = require __DIR__ . '/../app/bootstrap.php'; | |
$app = $container->getByType('Nette\Application\Application'); | |
$p = $app->getPresenterFactory()->createPresenter('Base'); | |
$p->run($app->createInitialRequest()); | |
$p['header']->render(); |
OlderNewer