Skip to content

Instantly share code, notes, and snippets.

View yutarochan's full-sized avatar

Yuya Jeremy Ong yutarochan

View GitHub Profile
queenSocket.onMessage = function(data) {
data[0] += 1;
queenSocket(data);
};
@yutarochan
yutarochan / gist:38e9167adc6664e29f57115eb716c8e6
Created February 15, 2017 16:59 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@yutarochan
yutarochan / ubuntu.sh
Created August 9, 2016 07:42 — forked from jarutis/ubuntu.sh
Theano and Keras setup on ubuntu with OpenCL on AMD card
## install Catalyst proprietary
sudo ntfsfix /dev/sda2
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.BAK
sudo apt-get remove --purge fglrx*
sudo apt-get install linux-headers-generic
sudo apt-get install fglrx xvba-va-driver libva-glx1 libva-egl1 vainfo
sudo amdconfig --initial
## install build essentials
sudo apt-get install cmake
@yutarochan
yutarochan / README.md
Created May 2, 2016 04:10 — forked from GilLevi/README.md
Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns

Gil Levi and Tal Hassner, Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns

Convolutional neural networks for emotion classification from facial images as described in the following work:

Gil Levi and Tal Hassner, Emotion Recognition in the Wild via Convolutional Neural Networks and Mapped Binary Patterns, Proc. ACM International Conference on Multimodal Interaction (ICMI), Seattle, Nov. 2015

Project page: http://www.openu.ac.il/home/hassner/projects/cnn_emotions/

If you find our models useful, please add suitable reference to our paper in your work.

from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.normalization import BatchNormalization
#AlexNet with batch normalization in Keras
#input image is 224x224
model = Sequential()
model.add(Convolution2D(64, 3, 11, 11, border_mode='full'))
@yutarochan
yutarochan / sliding_window.py
Created April 11, 2016 22:51
Sliding Window Skeleton
from matplotlib.patches import Rectangle
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
X = mpimg.imread('sloth.jpg')
plt.imshow(X)
plt.show()
def sliding_window(image, stepSize, windowSize):
# slide a window across the image
@yutarochan
yutarochan / The Technical Interview Cheat Sheet.md
Created February 6, 2016 04:07 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
public class LD {
public static void main(String[] args) {
// Testing Kitten & Sitting...
String s1 = "kitten";
String s2 = "sitting";
System.out.println(computeLD(s1, s2, s1.length(), s2.length()));
}
public static int computeLD(String s1, String s2, int s1_l, int s2_l) {
@yutarochan
yutarochan / wgetter.txt
Created July 13, 2014 09:12
Java Method for wget
/*
* Intended for unix-based systems capable of using wget commands.
*/
public static void wget(String url, String filename) throws Exception {
String cmd = "wget -O " + filename + " " + url;
Process process = Runtime.getRuntime().exec(cmd);
BufferedReader r = new BufferedReader(new InputStreamReader(process.getInputStream()));
String data = "";
while ((data = r.readLine()) != null) System.out.println(data + "\n");
@yutarochan
yutarochan / GSearch.txt
Last active January 12, 2017 20:06
Google Search Using JSoup
public static List<String> googleSearch() throws Exception {
String google = "http://www.google.com/search?q=";
String search = "stackoverflow";
String charset = "UTF-8";
String userAgent = "ExampleBot 1.0 (+http://botexample.com/)";
Elements links = Jsoup.connect(google + URLEncoder.encode(search, charset)).userAgent(userAgent).get().select("li.g>h3>a");
List<String> linkList = new ArrayList<String>();
for (Element link : links) {