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
# WSGI:n perus kirjasto | |
from wsgiref.simple_server import make_server | |
# Tätä funktiota kutsutaan aina, kun selain haluaa sivun | |
# environ: yleistä tietoutta: mitä sivua kysyttiin, millainen vempain jne jne jne | |
# start_response: funktio, jolla kerrotaan WSGIlle palautetun kaman tyyppi ja mahdolliset virheet | |
ilmoittautuneet = [] |
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 pyaudio | |
import numpy as np | |
import matplotlib.pyplot as plt | |
CHUNKSIZE = 1024*2 # fixed chunk size | |
# initialize portaudio | |
p = pyaudio.PyAudio() | |
stream = p.open(format=pyaudio.paInt16, channels=1, rate=44100, input=True, frames_per_buffer=CHUNKSIZE) |
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 pyaudio | |
import numpy as np | |
FORMAT = pyaudio.paInt16 | |
CHANNELS = 1 | |
RATE = 44100 | |
CHUNK = 1024 | |
audio = pyaudio.PyAudio() |
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
# Polygon generator for python3 using numpy. | |
# Released under the MIT lisence | |
# Copyright (c) 2017 Théo Friberg & Roope Salmi | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to |
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
# Polygon generator for python3 using numpy. | |
# Released under the MIT lisence | |
# Copyright (c) 2017 Théo Friberg & Roope Salmi | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to |
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
t _ [] = 0 | |
t !n ('8':rest) = t (n+1) rest | |
t !n (')':rest) = n + (t n rest) | |
main = getLine >>= (\l -> print (t 0 l)) |
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
#!/bin/bash | |
g++ -O2 -Wall -std=c++11 $1 --debug && echo "===" && time ./a.out |
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
CC drivers/media/video/camdrv_ss.o | |
drivers/media/video/camdrv_ss.c:264:3: warning: initialization from incompatible pointer type | |
.show = rear_flash_show, | |
^ | |
drivers/media/video/camdrv_ss.c:264:3: warning: (near initialization for 'dev_attr_rear_flash.show') | |
drivers/media/video/camdrv_ss.c: In function 'camdrv_ss_g_parm': | |
drivers/media/video/camdrv_ss.c:3915:36: warning: argument to 'sizeof' in 'memcpy' call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess] | |
memcpy(param, &state->strm, sizeof(param)); | |
^ |
OlderNewer