Skip to content

Instantly share code, notes, and snippets.

View psaitu's full-sized avatar
👋
hello!

Prabhu Saitu psaitu

👋
hello!
View GitHub Profile
@psaitu
psaitu / gist:1398845
Created November 28, 2011 02:32
backbone1
(function($){
Backbone.sync = function(model, method, options) {
options.success();
}
var Item = Backbone.Model.extend({
defaults: {
name: "itemname",
description: "item description",
(function($){
Backbone.sync = function(method, model, success, error){
success();
}
var Item = Backbone.Model.extend({
defaults: {
name: "Item Name"
},
@psaitu
psaitu / dabblet.css
Created February 1, 2012 14:41
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(18deg, #f06, #f03);
min-height:100%;
@psaitu
psaitu / opt.c
Created March 31, 2012 11:42
Optimal Page Replacement
#include<stdio.h>
int check(int a[5],int inp[20],int ti) {
int i=0;
for(i=0;i<3;i++) {
if(a[i]==inp[ti]) {
return 0;
}
}
@psaitu
psaitu / lev.py
Created December 3, 2012 19:02
Python implementation to find the distance between two strings - Levenshtein distance
import sys
#Function to return the distance between two strings - Levenshtein distance
a = sys.argv[1]
b = sys.argv[2]
def lv_number(a, b):
string1 = a
@psaitu
psaitu / Program.java
Created April 23, 2013 14:19
A simple implementation of the water jug algorithm, works on the principle of repeatedly filling only one jug.
package defaultPackage;
public class Program {
public static void main(String args[]) {
WaterJug w = new WaterJug();
w.checkGoal();
@psaitu
psaitu / AStar.java
Created April 23, 2013 14:22
Simple implementation of AStar algorithm
package defaultPackage;
public class AStar {
public static void main(String args[]) {
Node n1 = new Node();
n1.label = "A";
Node n2 = new Node();
@psaitu
psaitu / main.coffee
Created June 7, 2013 08:47
framer tests
appView = new ImageView(
width: 480
height: 640
x: (window.innerWidth / 2) - 240
y: 0
image: "../images/appBg.png"
public class hash {
Node[] table;
int Table_size;
public class Node
{
String Name;
int count;
public Node()
@psaitu
psaitu / Graph.java
Created February 7, 2014 10:36
6lowpan hilo
//import java.util.HashMap;
public class Graph {
Node root;
public Graph()
{
this.root = null;
}
public Graph(int num)