Skip to content

Instantly share code, notes, and snippets.

View lovasoa's full-sized avatar
🎯
Focusing

Ophir LOJKINE lovasoa

🎯
Focusing
View GitHub Profile
@lovasoa
lovasoa / tableau.html
Created April 23, 2016 22:46
Construit un tableau depuis les résultats de clingo.
<html>
<head>
<meta charset="utf8" />
<style>
table {
border-collapse: collapse;
border-spacing: 0px;
}
td {
padding: 5px;
from heapq import heappush, heapify, heappop
#Question1
def table_frequences(texte):
table={}
for i in texte:
if i in table:
table[i]=table[i]+1
@lovasoa
lovasoa / exo.py
Last active May 4, 2016 07:35 — forked from anonymous/exo.py
#!/usr/bin/env python3
def rle(s):
encode = "" # La variable qui va contenir le résultat
count = 0
current_char = ""
for c in s:
if c == current_char:
count += 1
else: # On a rencontré un nouveau caractère
import numpy
from numpy.linalg import solve
lambdas = [0.01, 0.05, 0.09]
mu = [1, 0.7, 1.5 ]
Ns = [3, 3, 5 ]
N1s = [2, 2, 3 ]
N = Ns[1]
N1 = N1s[1]
import numpy
import itertools
import copy
from numpy.linalg import solve
def delath_kursovuyu(variant):
lambdas = variant["lambdas"]
mu = variant["mu"]
Ns = variant["Ns"]
@lovasoa
lovasoa / kursovuyu.py
Created May 11, 2016 13:26
Курсовая работа по курсу надежности.
import numpy
import itertools
import copy
import sys
from numpy.linalg import solve
def delath_kursovuyu(variant):
lambdas = variant["lambdas"]
mu = variant["mu"]
@lovasoa
lovasoa / .gitignore
Last active May 19, 2016 00:11
Elm Json.Decoder for javascript Array-like objects. {length:2, 0:value0, 1:value1}
# elm-package generated files
elm-package.json
elm-stuff/
# elm-repl generated files
repl-temp-*
@lovasoa
lovasoa / sequence.elm
Created May 25, 2016 13:04
Equivalent of Haskell's `sequence` function for Elm
sequenceResult : List (Result.Result a b) -> Result a (List b)
sequenceResult lst =
case lst of
x :: xs ->
x `Result.andThen` (\xval ->
(sequenceResult xs) `Result.andThen` (\xsval ->
Ok (xval::xsval)))
[] -> Ok []
@lovasoa
lovasoa / spellcheck.py
Last active September 21, 2016 14:34
Check spelling in a text file
#!/usr/bin/env python3
import sys, re
if len(sys.argv) not in (2,3):
sys.stderr.write("Usage: %s dictionnary.txt [file.txt]\n\nChecks spelling of text in input file.\n" % sys.argv[0])
sys.exit(1)
infile = open(sys.argv[2]) if len(sys.argv)>2 else sys.stdin
inwords = set(map(str.lower, re.split("[^\\w]", infile.read())))
@lovasoa
lovasoa / Mandelbrot.ipynb
Created September 22, 2016 16:37
Mandelbrot set viz in python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.