Skip to content

Instantly share code, notes, and snippets.

View vedgar's full-sized avatar

Vedran Čačić vedgar

View GitHub Profile
def D23():
T = TuringovStroj.iz_tablice('''a b c _ C B A
0 A+1 ! ! . ! ! !
1 +2 +5 ! ! ! + !
2 + B+3 ! ! ! + !
3 ! + C+4 ! + ! !
4 - - - - - - +0
5 ! ! +6 ! + ! !
6 ! ! ! . ! ! !''')
for n in range(13):
"""Basic example of a Trading bot with a strategy pattern."""
from statistics import mean
from dataclasses import dataclass
from functools import partial
from exchange import Exchange
class Avg:
@vedgar
vedgar / sd.py
Created November 15, 2021 18:19
tablica = [
(10, 0),
(12.5, 0.1),
(15, 0.5),
(17.5, 0.1),
(20, 0.6),
(22.5, 0),
(25, 0),
]
N = suma = 0

Keybase proof

I hereby claim:

  • I am vedgar on github.
  • I am veky (https://keybase.io/veky) on keybase.
  • I have a public key ASAobMWD8ehR6FML0G_-9IgPliXspx3R4bSdj6-zZ7gCvQo

To claim this, I am signing this object:

def boolean(x, y, operation):
'''\
x | y | x∧y | x∨y | x→y | x⊕y | x≡y |
--------------------------------------
0 | 0 | 0 | 0 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 0 | 1 | 0 |
0 | 1 | 0 | 1 | 1 | 1 | 0 |
1 | 1 | 1 | 1 | 1 | 0 | 1 |
--------------------------------------'''
symbol = dict(
@vedgar
vedgar / MG.py
Last active April 26, 2020 11:44
mg = '''\
S>ASB|aa
AaaB>aaaa
Aaaa>aaAaa
'''
import collections, contextlib
pravila = collections.defaultdict(set)
for linija in mg.splitlines():
def ls_lex(kôd):
lex = Tokenizer(kôd)
for znak in iter(lex.čitaj, ''):
if znak == 'P':
lex.plus(str.isdigit)
n = lex.sadržaj.lstrip('P')
if n != str(int(n)): raise lex.greška('Vodeća 0')
yield lex.token(LS.PVAR)
continue
if znak == '<': znak = lex.čitaj() # fallthrough
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex-dev 2019.9.8) 9 SEP 2019 17:41
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**forallxyyc
(./forallxyyc.tex
LaTeX2e <2019-10-01> pre-release-2
(/usr/local/texlive/2019/texmf-dist/tex/latex/memoir/memoir.cls
Document Class: memoir 2018/12/12 v3.7h configurable book, report, article docu
ment class
sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev
with open(input('izlazna datoteka: '), 'w') as izlaz:
for p in enumerate(open(input('ulazna datoteka: ')), 1):
print(*p, sep=': ', end='', file=izlaz)