Skip to content

Instantly share code, notes, and snippets.

View omeroot's full-sized avatar

Ömer Demircan omeroot

  • Istanbul
View GitHub Profile
@omeroot
omeroot / bayes.py
Last active August 29, 2015 14:27
# -*- coding: utf-8 -*-
import numpy as np
def loadDataSet():
postingList = [['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'],
['maybe', 'not', 'take', 'him', 'to', 'dog', 'park', 'stupid'],
['my', 'dalmation', 'is', 'so', 'cute', 'I', 'love', 'him'],
['stop', 'posting', 'stupid', 'worthless', 'garbage'],
['mr', 'licks', 'ate', 'my', 'steak', 'how', 'to', 'stop', 'him'],
['quit', 'buying', 'worthless', 'dog', 'food', 'stupid']]
function swap(array, index1, index2) {
var temp = array[index1];
array[index1] = array[index2];
array[index2] = temp;
}
function WTFSorting(arr){
var res = [];
res.push(arr[0]);
console.log(res);
//
// main.c
// sort
//
// Created by Markakod Development on 20/10/15.
// Copyright (c) 2015 Markakod Development. All rights reserved.
//
#include <stdio.h>
# -*- coding: utf-8 -*-
# ________________________
# | Recursion |
# |________________________|
#
# |---Illustrative Examples
# | |
# | |__factorial function
#
#
@omeroot
omeroot / omer.py
Created October 23, 2015 14:35 — forked from erayarslan/omer.py
for ömer <3
import sys
import os
import time
def get_terminal_size(fd=1):
try:
import fcntl, termios, struct
hw = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
except:
try:
from flask import Flask
from flask import request
from werkzeug import secure_filename
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'hello world'
....
checking for objdir... .libs
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... yes
checking for the correct version of the gmp/mpfr/mpc libraries... yes
checking for compatible ISL... no
configure: error: Unable to find a usable ISL. See config.log for details.
READ THIS: https://git.io/brew-troubleshooting
@omeroot
omeroot / python-bottle-service.py
Last active October 28, 2015 07:57
this service receive photo album it contains images and convert to video
from bottle import route,run,request,static_file
import os
import json
import numpy as np
import cv2
@route('/upload',method='POST')
def do_upload():
category = request.forms.get('category')
@omeroot
omeroot / images-to-video.py
Created October 24, 2015 12:43
one line images to video
import subprocess
def sb_proc(input, output):
subprocess.call(['avconv -r 20 -i ' + input + ' -b:v 1000k ' + output ,''],shell=True)
sb_proc('input/new_%d.jpg','output/tt1.mp4');#new_%d.jpg ==> new_0.jpg,new_1.jpg,....
@omeroot
omeroot / index.ejs
Last active October 26, 2015 12:46
binary tree visualization on ejs template
<html>
<head></head>
<body>
<% var queue = [],l=null,r=null; %>
<% queue.push(btree) %>
<% while(queue.length > 0){ %>
<% var s = queue.shift() %>