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
''' | |
Written by: | |
Eren Golge - erengolge@gmail.com | |
''' | |
import json | |
import pdb | |
import urllib2 | |
import mechanize | |
import cookielib |
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
function D = dist2(X, C) | |
tempx = full(sum(X.^2, 2)); | |
tempc = full(sum(C.^2, 2).'); | |
D = -2*(X * C.'); | |
D = bsxfun(@plus, D, tempx); | |
D = bsxfun(@plus, D, tempc); | |
end |
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
''' | |
Eren Golge - erengolge@gmail.com | |
written for experience and experiment | |
''' | |
import pdb | |
import math | |
import random | |
import time | |
''' |
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
/* | |
Linked_list implementation for cracking the code | |
questions | |
*/ | |
#include <iostream> | |
#include <stdlib.h> /* srand, rand */ | |
#include <map> | |
using namespace std; | |
template <typename dataType> |
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
/* | |
Linked_list implementation for cracking the code | |
questions | |
*/ | |
template <typename dataType> | |
class List{ | |
private: |
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
#include <vector> | |
#include <iostream> | |
using namespace std; | |
int main(){ | |
// This initialization is available at C++11 support compiler | |
// For lower version C++ support check the reference document | |
vector<int> arr (9); | |
arr = {1,2,3,4,5,6,7,8,9}; | |
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
#include <vector> | |
#include <string> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
void printArr(string arr[], int size){ | |
for(int i = 0; i < size; i++){ | |
cout << arr[i] << endl; | |
} |
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
from multiprocessing import Pool | |
# parallelize function | |
def product(a,b): | |
print a*b | |
# auxiliary funciton to make it work | |
def product_helper(args): | |
return product(*args) |
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
from __future__ import division | |
import cv2 | |
import cv2.cv as cv | |
import sys | |
import pdb | |
def detect(img, cascade): | |
rects = cascade.detectMultiScale(img, scaleFactor=1.1, minNeighbors=3, minSize=(10, 10), flags = cv.CV_HAAR_SCALE_IMAGE) | |
if len(rects) == 0: | |
return [] |
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 numpy as np | |
import theano | |
import theano.tensor as T | |
from theano import function,sandbox | |
from theano import ProfileMode | |
import warnings | |
warnings.filterwarnings("ignore") | |
# Dummy Data | |
theano.config.floatX = 'float32' # Theano needs this type of data for GPU use |