Skip to content

Instantly share code, notes, and snippets.

View wuerges's full-sized avatar

Emilio Wuerges wuerges

  • Home
  • Santa Catarina - Brazil
View GitHub Profile
@wuerges
wuerges / hangman.hs
Created October 6, 2015 14:47 — forked from ToJans/hangman.hs
A haskell implementation of the hangman game
import Control.Monad (when)
import Data.Char (toLower)
import Data.List (transpose)
import System.Random (randomIO)
wordsPath :: FilePath
wordsPath = "words.txt"-- "/usr/share/dict/words"
data GameState = GameState
{ _wordToGuess :: String
num = int(input("Digite Quantas notas: "))
notas = map(lambda x: int(input("Digite uma nota: ")), range(num))
media = sum(notas) / num
print("A media e':", media)
@wuerges
wuerges / Makefile.install_opencv_fedora
Created January 25, 2016 17:13
Makefile for Installing OpenCV in Fedora 23 with Python 3 support.
install_opencv:
sudo dnf install --best --allowerasing \
cmake python-devel numpy gcc gcc-c++ \
python3-devel python3-numpy \
gtk2-devel libdc1394-devel libv4l-devel ffmpeg-devel \
gstreamer-plugins-base-devel libpng-devel libjpeg-turbo-devel \
jasper-devel openexr-devel libtiff-devel libwebp-devel \
tbb-devel eigen3-devel python-sphinx texlive git
if [ ! -d opencv/ ]; then \
# estou com problema nessa funcao, por favor ajudem:
def hello_world(mensagem):
print(mensagem)
@wuerges
wuerges / script.sh
Created February 22, 2016 21:02
Comandos para gerar uma Stream com o VLC e para tocar
# gerar stream
cvlc screen:// :screen-fps=10 --sout '#transcode{vcodec=DIV3,vb=4000,scale=1,acodec=mp3,ab=32,channels=2}:std{access=mmsh,mux=asfh,dst=:2000}'
#tocar stream
cvlc mmsh://localhost:2000
define [1 x i32] @topLevel([3 x i32] %inputArray, [1 x i32] %returnArray) {
bb0:
%node_1 = extractvalue [3 x i32] %inputArray, 0
%node_2 = extractvalue [3 x i32] %inputArray, 1
%node_3 = extractvalue [3 x i32] %inputArray, 2
%node_8 = and i32 %node_1, %node_2
%0 = xor i32 %node_8, 1
%node_7 = and i32 %node_3, %0
%1 = xor i32 %node_3, 1
%node_6 = and i32 %1, %node_8
-- Função fibonacci memoizada usando:
-- * recursão,
-- * funções de alta ordem
-- * avaliação preguiçosa
-- * listas infinitas
fibs = 1:1:(zipWith (+) fibs (tail fibs))
-- imprimindo apenas os primeiros 10 valores da sequencia
main = print $ take 10 fibs
#!/bin/bash
import os,sqlite3
con=sqlite3.connect('dic.db')
cur=con.cursor()
cur.execute('''
create table if not exists Palavras(
#include <iostream>
#include <sstream>
#include <vector>
#include <deque>
using namespace std;
bool is_digit(const char c) {
return (c >= '0' && c <='9');
}
#include <cstdio>
#include <algorithm>
using namespace std;
int main() {
int n;
scanf("%d", &n);
int xs[n];
int p_tam = 0;