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 | |
$join = []; | |
if ($something) | |
{ | |
$join[] = "LEFT JOIN tabulka ON podminkaa = podminkab"; | |
} | |
echo "SELECT * FROM product " . implode(" ", $join) . " WHERE active = ?"; |
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
create temporary table _zeme (id varchar(255) primary key, popis varchar(255)); | |
insert into _zeme values ('AF', trim('Afghánistán ')); | |
insert into _zeme values ('AX', trim('Alandy ')); | |
insert into _zeme values ('AL', trim('Albánie ')); | |
insert into _zeme values ('DZ', trim('Alžírsko ')); | |
insert into _zeme values ('AS', trim('Americká Samoa ')); | |
insert into _zeme values ('VI', trim('Americké Panenské ostrovy ')); | |
insert into _zeme values ('AD', trim('Andorra ')); | |
insert into _zeme values ('AO', trim('Angola ')); | |
insert into _zeme values ('AI', trim('Anguilla ')); |
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 | |
declare(strict_types = 1); | |
namespace Tests\CommissionsBundle\Form\Type; | |
use CommissionsBundle\DTO\CatalogItemGroupDTO; | |
use CommissionsBundle\Entity\CatalogItem; | |
use CommissionsBundle\Entity\CatalogItemGroup; | |
use CommissionsBundle\Form\Type\CatalogItemGroupType; | |
use Doctrine\Bundle\DoctrineBundle\Registry; |
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 | |
use Doctrine\DBAL\Platforms\AbstractPlatform; | |
use Doctrine\DBAL\Types\Type; | |
use Money\Currencies\ISOCurrencies; | |
use Money\Formatter\DecimalMoneyFormatter; | |
use Money\Money; | |
use Money\Parser\DecimalMoneyParser; | |
/** |
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 | |
workers=4 | |
STEP=$(psql -U svetluska -c "SELECT ceil(COUNT(*) / $workers) FROM svetluska.domination" -qtA svetluska) | |
time for ((i=0; i<$workers; i++)) | |
do | |
echo "UPDATE svetluska.domination SET geometry = t.geometry_wkt FROM (SELECT id, geometry_wkt FROM svetluska.domination ORDER BY id LIMIT $STEP OFFSET $STEP*$i) t WHERE domination.id = t.id"; | |
done | xargs -P $workers -I % psql -U svetluska -c "%" svetluska | |
#done | xargs -P 3 -I % echo % |
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 <stdio.h> | |
#include <string.h> | |
#include <time.h> | |
#define MAX 8 | |
char pole [MAX][MAX]; | |
int poziceX=0, poziceY=0, trestnebody=10; | |
unsigned long cas1,cas2; | |
void inicializuj(){ //void je funkce, nema zadnou navratovou hodnotu, 'inicializuj' je nazev funkce,. () znaci ze to je funkce |