Skip to content

Instantly share code, notes, and snippets.

@jilm
jilm / template.xsl
Last active August 15, 2017 13:09
XSLT template
<?xml version="1.0" encoding="utf-8"?>
<!--
-->
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
@jilm
jilm / soxplot.sh
Created March 10, 2018 14:21 — forked from notthetup/soxplot.sh
Whole file spectrum using SOX and gnuplot.
sox $1 -n stat -freq 2>&1 | sed -n -e :a -e '1,15!{P;N;D;};N;ba' | gnuplot -p -e 'set logscale x; plot "-" with linesp'
@jilm
jilm / nn.py
Last active January 11, 2019 14:15
Just Neural Network playground
import numpy as np
def sigmoid(x):
return 1.0/(1.0+np.exp(-x))
def sigmoidPrime(s):
return s*(1-s)
def sigmoid_derivative(x):
return np.exp(-x)/(1.0+np.exp(-x))**2
cat | tr 'A-ZÁČĎĚÉÍŇŘŠŤÚÝŽ' 'a-záčďěéíňřšťúýž' | tr "[:punct:][:space:]" "\n" | sort | uniq -c
@jilm
jilm / grid.py
Created January 27, 2019 09:44
A script to show a picture with grid
import PIL.Image
import sys
filename = sys.argv[1]
im = PIL.Image.open(filename)
im = im.convert('L')
w, h = im.size
gs = min(w, h) // 12
for r in range(h // gs):
cat document | cut -d ';' -f 13 | tr '[:upper:]' '[:lower:]' | tr '[:punct:]' ' ' | tr ' ' '\n' | sort | uniq | ./stemmer > stems.txt
cat document | cut ';' -f 13 | tr '[:upper:]' '[:lower:]' | tr '[:punct:]' ' ' | tr ' ' '\n' | sort | uniq > words.txt
cat words.txt | awk '{print "["$0"]"}' | tr '[' '"' | tr ']' '"'
paste words.txt stems.txt
@jilm
jilm / spm_math.md
Last active May 17, 2019 14:40
The math remarks regarding reliability.

Vyhodnocení skladových zásob

Pojmy

Deployed

Počet nasazených kusů dílu daného typu $d(t)$. Může být funkcí času.

Kumulovaná provozní historie

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<link rel="stylesheet" href="main.css">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "all" } }
body {
background-color: #fcf8f1;
text-align: left;
display: flex;
flex-direction: column;
width: 100%;
flex-grow: 1;
padding: 0;
margin: 0;
height: 100%;
import math
def poisson(lmbd, k):
return math.exp(-lmbd + k * math.log(lmbd) - math.lgamma(k+1))
def poisson_cumulative(lmbd, s):
return sum([poisson(lmbd, k) for k in range(s+1)])