This file contains hidden or 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
// Conversion between color models(buggy) | |
/* Following is one of the best examples of how worse college given programs | |
can be. Proceed at your OWN RISK */ | |
#include<stdio.h> | |
#include<conio.h> | |
#include<graphics.h> | |
#include<stdlib.h> | |
void main() | |
{ | |
int gd=DETECT,gm,n; |
This file contains hidden or 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 math import * | |
import sys | |
chosen = {} | |
n = int(sys.argv[1]) | |
def place(xpos, ypos): | |
if (ypos in chosen.values()): | |
return False | |
opponent = 1 |
This file contains hidden or 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
// Implementation of Quicksort in C language | |
#include<stdio.h> | |
int i,j,n,pivot,a[20]; | |
void quick(int *a, int left, int right); | |
void swap(int *a, int i, int j); | |
void main() | |
{ | |
int a[20]; | |
printf("Enter the limits: "); | |
scanf("%d",&n); |
This file contains hidden or 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
// Evaluating postfix expression using Stack ADT | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<ctype.h> | |
typedef struct node | |
{ | |
int data; | |
struct node *next; | |
}stack; | |
stack *topstk=NULL; |
This file contains hidden or 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
// Implementing Heap Sort in C language | |
#include<stdio.h> | |
void heap(int *a, int n); | |
void create_heap(int *a, int n); | |
void main() | |
{ | |
int a[50],i,n; | |
printf("Enter the limits: "); | |
scanf("%d",&n); | |
printf("Enter the elements: "); |
This file contains hidden or 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
#!/bin/bash | |
#+-----------------------------------------------------------------------------+ | |
#| Title : Bash Script to Download Selected Gists | | |
#| Author : jkk | | |
#| Date : 26-04-2010 | | |
#+-----------------------------------------------------------------------------+ | |
if [ $# -eq 0 ] ; then | |
cat 1>&2 <<USAGE_TEXT | |
$0: missing gist id(s) |
This file contains hidden or 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
#!/bin/bash | |
echo Pinging 192.168.1.3 \ | |
&& \ | |
ping -c1 192.168.1.3 > /dev/null 2>&1 \ | |
&& \ | |
echo Ping Succeeded \ | |
|| echo Ping Failed; | |
echo Press Enter key to exit...; | |
read; |
This file contains hidden or 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
/* Lex program to pretty-format json file. ***WARNING-Amateurish*** */ | |
%{ | |
int string=0; | |
int gi=0; | |
void indent(int i); | |
int prev_close=0; | |
%} | |
%% | |
\\\" { //Matching an escaped double quote |
This file contains hidden or 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
// Ackermann's Function - Full Recursive | |
#include<stdio.h> | |
#include<stdlib.h> | |
int ackermann(int x, int y); | |
int count = 0, indent = 0; | |
int main(int argc, char **argv) | |
{ | |
int x,y; | |
if(argc!=3) | |
{ |
This file contains hidden or 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 sys | |
count=0 | |
sys.setrecursionlimit(50000) | |
cache={} | |
def a(m,n): | |
global count | |
global cache | |
count=count+1 | |
if cache.has_key(m) and cache[m].has_key(n): | |
return cache[m][n] |
OlderNewer