Skip to content

Instantly share code, notes, and snippets.

View anujku's full-sized avatar

Anuj Kulkarni anujku

View GitHub Profile
@anujku
anujku / app.js
Last active August 29, 2015 14:01
Ember Gauge Component
var App = Em.Application.create();
App.ApplicationController = Em.ObjectController.extend({
base:0,
something1: 375,
something2: 500
});
App.MyGaugeComponent = Em.Component.extend({
@anujku
anujku / app.js
Last active August 29, 2015 14:08
Sticky eyetack run test
/*
For the demo, this function simply return a random URL to be displayed in the study.
For Affinnova, it is very important to maintain a link between the participant id and the chosen image URL. All
eye tracking data will be keyed on the combination of the study id and the participant id.
*/
function getRandomImage() {
var urls = [
"http://www.psychologytoday.com/files/u736/86random-f1.1.gif",
"http://www.random.org/analysis/randbitmap-rdo.png"
];
@anujku
anujku / introrx.md
Last active August 29, 2015 14:08 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

import java.util.Arrays;
import java.util.Random;
/**
* The Class SecretSanta.
*/
public class SecretSanta {
/**
* Generate assignments. preconditions :
@anujku
anujku / TrinaryTree.java
Created December 14, 2014 21:03
Trinary Tree in Java
/**
* The Class TrinaryTree.
*/
public class TrinaryTree {
/** The root. */
TrinaryNode root;
/**
* The Class TrinaryNode.
@anujku
anujku / StringLongConverter.java
Created December 14, 2014 21:04
String to long converter
/**
* The Class StringLongConverter.
*/
public class StringLongConverter {
/**
* This method converts a String to long value.
*
* @param stringToBeConverted the string to be converted
* @return the long value
*/
@anujku
anujku / StringCompareApp.java
Created December 14, 2014 21:06
String comparison Console App
// Write a small console application that uses a string comparison function (that you
// will also write) that meets the following prototype:
//
// int MyStrCmp(char *a, char *b) - for C;
// or assume passed String data types - for C# / Java / PHP
//
// Entered or passed strings may be of any length; trap for edge conditions and
// display error messages. Functions cannot make use of or "wrap" any existing API
// calls. Function must return an int that is:
// <0 if string1 is less than string2;
@anujku
anujku / CommandLineChat.java
Created December 14, 2014 22:57
Command line chat using Java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Properties;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.Queue;
import javax.jms.QueueConnection;
@anujku
anujku / crawler.py
Created December 14, 2014 23:00
Simple Web Crawler
'''
Created on Sep 19, 2013
@author: anuj
'''
# your code goes here
import re
import httplib
import urllib2
import robotparser

Movies Recommendation:

Music Recommendation: