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
static private bool IsValidFormula(string formula) { | |
// Ja bych byl pouzil Regexpy a mel to na tri radky, jenze to neprojde na cas, takze automat :/// | |
ValidatorState state = ValidatorState.START; | |
if (formula[0] != '=') | |
{ | |
return false; | |
} | |
for (int i = 1; i < formula.Length; i++) | |
{ |
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
Napište program, který dostane na prvním řádku standardního vstupu výraz zapsaný v preorder notaci, výraz vyhodnotí a výsledek vypíše na standardní výstup. Ve výrazu se mohou vyskytovat celá kladná čísla, která se vejdou do 32-bit. integeru se znaménkem (tj. menší než 231 = 2147483648), binární operátory +, -, * a / a operátor unárního minus ~. Operátory i čísla jsou odděleny mezerami. Výsledek vypište jako celé číslo se znaménkem v dekadickém formátu. | |
Při vyhodnocování výrazu používejte výhradně celočíselnou aritmetiku. Všechny mezivýsledky se vejdou do 32-bit. integeru se znaménkem. Pokud by v průběhu výpočtu došlo k přetečení (mezivýsledek se nevejde do intu se znaménkem), vypište jako výsledek řetězec "Overflow Error". Pokud dojde k dělení nulou vypište chybový řetězec "Divide Error". A konečně pokud zjistíte, že zápis výrazu je z jakéhokoli důvodu neplatný (objevují se v něm neznámé tokeny, nedodržuje preorder formát apod.), vypište chybovou hlášku "Format Error". | |
Vyhodnocované výrazy jsou relativně kr |
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
#include <ostream> | |
#include <sstream> | |
#include <iostream> | |
#include <vector> | |
class Matice { | |
public: | |
void pridej_sloupec(int a) { | |
} |
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
adresare="" | |
cesty=true | |
while [ $# -gt 0 ] | |
do | |
# nacteni adresaru, ktere se budou prohledavat | |
if [ ${1:0:1} != "-" ] ; then | |
if $cesty ; then | |
adresare="$adresare $1" | |
shift | |
continue |
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 | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
class Sleeper extends PHPDaemon\Daemon { | |
public function run() { | |
while (true) { | |
echo "zzzZZZzzz...\n"; | |
sleep(2); |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"BackupBucket": { | |
"Type": "AWS::S3::Bucket", | |
"Properties": { | |
"LifecycleConfiguration": { | |
"Rules": [ | |
{ | |
"Id": "Move to Glacier", |
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
#!/bin/bash | |
set -eux | |
sudo apt-get update | |
packages="postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common" | |
# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de | |
sudo update-alternatives --remove-all postmaster.1.gz |
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 | |
namespace Vondra; | |
class GitBranchPanel implements \Nette\Diagnostics\IBarPanel | |
{ | |
public function getPanel() | |
{ | |
return ''; |
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 org.hibernate.Session; | |
import org.hibernate.SessionFactory; | |
import org.hibernate.Transaction; | |
import org.hibernate.context.internal.ManagedSessionContext; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.util.function.Function; |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Resources" : { | |
"GithubServiceTopic" : { | |
"Type" : "AWS::SNS::Topic", | |
"Properties" : { | |
"DisplayName" : "Topic for Github pull request integration", | |
"Subscription" : [ | |
{ |