Skip to content

Instantly share code, notes, and snippets.

View jO-Osko's full-sized avatar

Filip Koprivec jO-Osko

View GitHub Profile
N = 100000000
import time
x = 0
t = time.time()
for j in range(0, N):
# 1, 2, 3, 4, 5, 6, ......
if j % 3 == 0:
x += j
elif j % 5 == 0:
x += j
module type Number = sig
type t
val add : t -> t -> t
val sub : t -> t -> t
val mul : t -> t -> t
val div : t -> t -> t
val zero : t
val one : t
Random.init 2020
type num = float
type distr_t = bool
let one: num = 1.0
let half: num = 0.5
let zero: num = 0.0
@jO-Osko
jO-Osko / scc.dot
Created April 19, 2020 11:02
Priprave IOI
digraph G {
//rankdir="LR";
subgraph cluster_0{
style=filled;
color=lightgray;
//1;
}
subgraph cluster_1{
style=filled;
for i in range(enumerate(len(niz))):
if znak == ' ':
presledki.append(i)
else:
nov_niz += niz[i]
@jO-Osko
jO-Osko / izris_sirjenja.py
Last active April 16, 2020 08:23
Primer širjenja po mreži
import random
import matplotlib.pyplot as plt
random.seed(2020 + 1 + 4) # 2025
class Svet:
def __init__(self, zacetno_stanje, verjetnost_okuzbe=0.42):
self.mreza = zacetno_stanje
self.generacija = 1
self.sirina = len(self.mreza[0])
@jO-Osko
jO-Osko / index.html
Created October 10, 2019 16:35
Moja domača naloga
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<title>Moja prva spletna stran</title>
<!-- todo: Poglej tole spodaj-->
<!-- Doma si poglej kako dodas favicon -->
</head>
@jO-Osko
jO-Osko / branje.py
Created September 25, 2018 15:01
Baze in python
import sqlite3
# Povezemo se na bazo
conn = sqlite3.connect("baza.sqlite")
cursor = conn.cursor()
cursor.execute("""
SELECT COUNT(*), cas_vpisa FROM MERITVE
GROUP BY cas_vpisa
create table UDELEZENCI
(
IME TEXT,
PRIIMEK TEXT,
EMAIL TEXT
unique,
STAROST INTEGER,
VEGETARJANEC TEXT default 'DA'
);
INSERT INTO UDELEZENCI (IME, PRIIMEK, EMAIL, STAROST, VEGETARJANEC) VALUES ('Filip', 'Koprivec', '[email protected]', 12, 'NE');
# Ni nujno, da se class imenuje enako kot datoteka, je pa to smiselna navada, ce imamo zgolj en class
class Task(object):
def __init__(self, title, done=False):
self.title = title
self.done = done
def output_nice(self):