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
<!-- the slides --> | |
<div id="slides"> | |
<div class="slide"> | |
<!-- Content of slide #1 --> | |
</div> | |
<div class="slide"> | |
<!-- Content of slide #2 --> | |
</div> | |
<div class="slide"> | |
<!-- Content of slide #3 --> |
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
# Returns `True` if the square at `a` is in one of the | |
# **eight surrounding squares** of `b`; `False` otherwise. | |
def nextTo(a, b): | |
x = a[0] - b[0] | |
y = a[1] - b[1] | |
d = x*x + y*y | |
return 0 < d < 3 |
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
/** | |
Shadow effects | |
============== | |
Multiple text-shadows can be stacked to | |
create wonderful, realistic effects. | |
Oh, and CSS allows for expressiveness too. | |
Try zooming in and disabling some shadows! | |
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
/** | |
Shadow effects | |
============== | |
Multiple text-shadows can be stacked to | |
create wonderful, realistic effects. | |
Oh, and CSS allows for expressiveness too. | |
Try zooming in and disabling some shadows! | |
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
determinant = (M) -> | |
k = M.length | |
return 1 unless k | |
# copy child matrix | |
N = [] | |
for y in [1...k] | |
N.push M[y].slice 1 | |
# recurse |
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
#!/usr/bin/python | |
import alsaseq, alsamidi, requests, time, math | |
from lxml import etree | |
INTERVAL = 70e-3 | |
URL = "http://root:dreamboxx@10.139.205.104/xml/streaminfo" | |
alsaseq.client('sat-align', 0, 1, True) | |
map = lambda x, s, e: s + x * (e-s) | |
clamp = lambda x, s, e: max(min(x, e), s) |
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
// Barebones program that reads a video file, extracts | |
// the video stream, processes it someway and then encodes | |
// it (alone) to another file. | |
#include <stdio.h> | |
#include <libavutil/opt.h> | |
#include <libavformat/avformat.h> | |
#include <libavcodec/avcodec.h> | |
#include <libavfilter/avfilter.h> |
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
/** | |
* Program I hacked up to produce timelapses with dynamic speedup | |
* factor. The `get_speed` function will be called periodically | |
* to decide what speedup should be applied at that point of the | |
* input video. | |
* | |
* This works by simply duplicating / dropping frames just as the | |
* `fps` filter would (zero-order hold). The program is based on | |
* the `transcoding.c` example, and is dirty. Make sure the input | |
* contains no streams other than the video stream to process. |
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
Siglas Nombre Logo | |
ALCD ALIANZA DE CENTRO DEMOCRÁTICO http://resultados2016.infoelecciones.es/99imgs/LOGOCO990001.gif | |
AND PARTIDO SOMOS ANDALUCES POR ANDALUCÍA Y LOS PUEBLOS http://resultados2016.infoelecciones.es/99imgs/LOGOCO990002.gif | |
BNG-NÓS BNG-NÓS CANDIDATURA GALEGA http://resultados2016.infoelecciones.es/99imgs/LOGOCO990005.gif | |
C's CIUDADANOS-PARTIDO DE LA CIUDADANÍA http://resultados2016.infoelecciones.es/99imgs/LOGOCO990013.gif | |
CCa-PNC COALICIÓN CANARIA-PARTIDO NACIONALISTA CANARIO http://resultados2016.infoelecciones.es/99imgs/LOGOCO990007.gif | |
CCD CIUDADANOS DE CENTRO DEMOCRÁTICO http://resultados2016.infoelecciones.es/99imgs/LOGOCO990008.gif | |
CCD-CI CIUDADANOS DE CENTRO DEMOCRÁTICO-CANDIDATURA INDEPENDIENTE http://resultados2016.infoelecciones.es/99imgs/LOGOCO990009.gif | |
CDC CONVERGÈNCIA DEMOCRÀTICA DE CATALUNYA http://resultados2016.infoelecciones.es/99imgs/LOGOCO990010.gif | |
CENTRO MODERADO LOS VERDES-ECOPACIFISTAS http://resultados2016.infoelecciones.es/99imgs/LOGOCO990011.gif |
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
import math | |
# Basic "convert to binomial, then back to polar" stuff, nothing interesting | |
def radial_avg(angles): | |
dx, dy = (0, 0) | |
for angle in angles: | |
dx += math.cos(angle) | |
dy += math.sin(angle) | |
return math.atan2(dy, dx) |