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
*Main> printSierpinski 5 | |
* | |
* * | |
* * | |
* * * * | |
* * | |
* * * * | |
* * * * | |
* * * * * * * * | |
* * |
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
sier 0 = ["*"] | |
sier n = [blanks ++ row ++ blanks | row <- mat, let blanks = replicate (2^(n - 1)) ' '] ++ [row ++ " " ++ row | row <- mat] | |
where mat = sier (n - 1) | |
printSierpinski n = mapM_ putStrLn $ sier 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
jisuka@HCL:~/git/Life$ python life.py | |
Enter the size of universe: 12 | |
Enter the number of live cells:4 | |
Now, please enter the live cell co-ordniates | |
-5 5 | |
-5 6 | |
-5 7 | |
-6 6 | |
day 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
#!/usr/bin/python | |
import time, sys | |
SIZE = int(raw_input('Enter the size of universe: ')) | |
stable = False | |
def read_coord(live): | |
num = int(raw_input('Enter the number of live cells:')) | |
print('Now, please enter the live cell co-ordniates') |
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
(defun element_at (row position) | |
"Finds out the position'th element in the row'th row in Pascal's triangle" | |
(if (or (= position 0) (= row position)) | |
1 | |
(+ (element_at (- row 1) (- position 1)) (element_at (- row 1) position)))) |
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
/*Filename: pascal.c | |
Blog: http://jithusunnyk.blogspot.com/ | |
Date: 24-09-11 | |
Description: Finds out the number at any given location(row, position) of Pascal's triangle. | |
Row-one is conventionally enumerated as 0 & position-one as 0, position-two as 1, etc*/ | |
#include <stdio.h> | |
int element_at(int row,int pos) { | |
if (pos == 0 || pos == row) |
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
Ciphertext: wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj | |
Plaintext: the quick brown fox jumps over the lazy dog |
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
jisuka@HCL:~/git/Python/Caesar$ python caesar.py | |
Enter the cipher: "Jan hxd fjclqrwp luxbnuh?" | |
"Kbo iye gkdmrsxq mvycovi?" | |
"Lcp jzf hlenstyr nwzdpwj?" | |
"Mdq kag imfotuzs oxaeqxk?" | |
"Ner lbh jngpuvat pybfryl?" | |
"Ofs mci kohqvwbu qzcgszm?" | |
"Pgt ndj lpirwxcv radhtan?" | |
"Qhu oek mqjsxydw sbeiubo?" | |
"Riv pfl nrktyzex tcfjvcp?" |
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
#!/usr/bin/python | |
#Date: Sept 19, 2011 | |
#Filename: caesar.py | |
#Code for deciphering Caesar-Cipher | |
#Author: Jithu Sunny | |
#Blog: http://jithusunnyk.blogspot.com/ | |
#Email: [email protected] |
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
jithu@HCL:~/Dropbox/Public$ ./resultmanager.py | |
Enter the url of result page of first(any) student from university website: http://202.88.252.6/exams/results1/btechNEW/btechresults_display.php?id=816®no=etaiecs002&Submit=Submit | |
Enter the total marks: 1200 | |
Enter the total number of students: 72 | |
Roll number Total Percentage | |
----------- ----- ---------- | |
etaiecs001 796 - 66.33 | |
etaiecs002 785 - 65.42 | |
etaiecs003 909 - 75.75 |
NewerOlder