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
color_prompt=yes | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
blue=$(tput setaf 4) | |
bold=$(tput bold) | |
reset=$(tput sgr0) | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != 'nothing to commit (working directory clean)' ]] && echo $red || echo $green | |
} | |
function parse_git_branch { |
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
# Package to install, to get an open terminal in Right-Click context menu. | |
sudo apt-get install nautilus-open-terminal | |
# To move window controls in your Ubuntu from left to right… | |
gconftool-2 --type string --set /apps/metacity/general/button_layout "menu:minimize,maximize,close" | |
# To switch back | |
gconftool-2 --type string --set /apps/metacity/general/button_layout "close,maximize,minimize:menu" | |
# Repeat last command with sudo | |
sudo !! |
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
jkk@jkk-desktop:/usr/local/src/osm2pgrouting$ cmake . | |
CMake Error at CMakeLists.txt:4 (FIND_PACKAGE): | |
Could not find module FindPostgreSQL.cmake or a configuration file for | |
package PostgreSQL. | |
Adjust CMAKE_MODULE_PATH to find FindPostgreSQL.cmake or set PostgreSQL_DIR | |
to the directory containing a CMake configuration file for PostgreSQL. The | |
file will have one of the following names: | |
PostgreSQLConfig.cmake |
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
Train routes: | |
============= | |
Chennai/Beach Tirumalpur Suburban Rail | |
-------------------------------------- | |
Park Town | |
Chennai Fort | |
Walajabad | |
Trisulam | |
Chetpet | |
Chennai Egmore |
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 cos | |
PI = 3.141592 | |
N = 8 | |
def f(u,v): | |
if u + v % 2: return 0 | |
return 1 | |
def sum(x,y): |
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 BeautifulSoup import BeautifulSoup | |
import urllib2 | |
import urllib | |
import sys | |
import csv | |
def validator_scraper(uris): | |
user_agent = 'Mozilla/5 (Ubuntu 10.04) Gecko' | |
headers = { 'User-Agent' : user_agent } | |
results = [] |
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
#include<stdio.h> | |
#include<math.h> | |
#include<stdlib.h> | |
#define DEBUG(str) //printf(str) | |
typedef struct | |
{ | |
int order; | |
float *coeff; | |
}poly; |
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
#include<stdlib.h> | |
typedef struct | |
{ | |
int order; | |
int *coeff; | |
}poly; | |
poly clone(poly a) | |
{ |
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
// Backtracking solution to Knight's Tour problem http://en.wikipedia.org/wiki/Knights_tour | |
#include<stdio.h> | |
#include<string.h> | |
#include<stdlib.h> | |
// Constraint: MAXX should be greater than or equal to MAXY | |
#define MAXX 5 | |
#define MAXY 5 | |
typedef enum {FALSE, TRUE} bool; | |
int n = 0; | |
bool treaded_blocks[MAXX][MAXY]; |
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 java.awt.*; | |
import java.awt.event.*; | |
import java.applet.*; | |
/* | |
<applet code="AWTControls" width=500 height=550> | |
</applet> | |
*/ | |
public class AWTControls extends Applet | |
implements ActionListener, ItemListener, | |
AdjustmentListener |