Skip to content

Instantly share code, notes, and snippets.

@settipalli
settipalli / vbox-tips-and-tricks.txt
Created April 15, 2012 07:31
Virtual Box Tips and Tricks
Start Virtual Guest without using the GUI frontend (source: http://www.virtualbox.org/manual/ch07.html#vboxheadless):
VBoxManage startvm "VM name" --type headless
The extra --type option causes VirtualBox to use VBoxHeadless as the front-end to the internal virtualization engine instead of the Qt front-end.
The alternative is to use VBoxHeadless directly, as follows:
VBoxHeadless --startvm <uuid|name>
@settipalli
settipalli / vimrc
Created April 16, 2012 17:58
VIM configuration
call pathogen#infect()
syntax on
filetype plugin indent on " load filetype plugins/indent settings
" General
set autochdir " always switch to the current file directory
set incsearch " highlight as you type your search phrase
set laststatus=2 " always show the status line
set number " turn on line numbers
set showcmd " show the commad being typed, e.g. ctrl+y
@settipalli
settipalli / gist:2717426
Created May 17, 2012 08:37
Save a file with root permissions from within VIM
This trick will help when you open a file using normal user and then realize that you need to be root to save the file:
In command mode:
:w !sudo tee %
Ref: http://stackoverflow.com/questions/1005/getting-root-permissions-on-a-file-inside-of-vi
@settipalli
settipalli / django-logging-configuration
Created November 5, 2012 12:08
Django-Sample-Logging-Configuration
# django settings.py - LOGGING configuration
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
@settipalli
settipalli / Django-virtualenv-wsgi-sample-configuration
Created November 5, 2012 12:14
Django-virtualenv-wsgi-sample-configuration
# contents of a django wsgi file.
import os
import sys
SITE_PACKAGES_DIR='<absolute-path-to-virtualenv-folder>/lib/python2.7/site-packages'
DJANGO_PROJECT_PARENT_FOLDER='<absolute-path-to-django-project-folder>'
DJANGO_PROJECT_PATH='<absolute-path-to-django-project-app-folder>'
SETTINGS_FILE='settings'
# Add the virtual Python environment site-packages directory to the path
@settipalli
settipalli / apache2-configuration-file-for-django-wsgi-project.
Created November 5, 2012 12:17
Apache2 configuration file for Django-wsgi-project.
# Apache 2 - wsgi configuration.
<VirtualHost *:80>
WSGIScriptAlias / <absolute-path-to-.wsgi-file>
ServerName <some-server-alias>
Alias /static <absolute-path-to-the-django-project-static-files-folder>
<Directory <absolute-path-of-the-django-project-directory> >
Order allow,deny
Allow from all
</Directory>
@settipalli
settipalli / django-urls.py-format
Created November 5, 2012 14:15
Django urls.py format.
# django urls.py format
(regular expression, Python callback function [, optional dictionary])
@settipalli
settipalli / gist:6aaa12eefb4fa3aee2f0
Created September 13, 2015 07:01
Mathematics-Books
All the Mathematics You Missed: But Need to Know for Graduate School
Mathematics: Its Content, Methods and Meaning
Mathematics for the Million: How to Master the Magic of Numbers
Nicolas Bourbaki
The Artist and the Mathematician: The Story of Nicolas Bourbaki, the Genius Mathematician Who Never Existed
https://sites.google.com/site/math104sp2011/lecture-notes
http://math.stackexchange.com/questions/69060/what-is-a-good-book-for-learning-math-from-the-ground-up
http://math.stackexchange.com/questions/178302/i-want-to-start-mathematics-from-scratch-what-should-i-begin-with
@settipalli
settipalli / books.csv
Created June 19, 2018 01:34
A sample list of book details downloaded by the py_gr_book_list project.
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 7 columns, instead of 4. in line 7.
The Story of Art (Hardcover),E.H. Gombrich,3.88,371409,1950,art,www.goodreads.com//book/show/222078.The_Story_of_Art
The New Drawing on the Right Side of the Brain (Paperback),Betty Edwards,3.84,397471,1979,art,www.goodreads.com//book/show/627206.The_New_Drawing_on_the_Right_Side_of_the_Brain
Wall and Piece (Paperback),Banksy,3.84,302128,1988,art,www.goodreads.com//book/show/114683.Wall_and_Piece
Steal Like an Artist: 10 Things Nobody Told You About Being Creative (Paperback),Austin Kleon,3.88,278559,2012,art,www.goodreads.com//book/show/13099738-steal-like-an-artist
Girl with a Pearl Earring (Paperback),Tracy Chevalier,3.86,717160,1999,art,www.goodreads.com//book/show/2865.Girl_with_a_Pearl_Earring
The Artist's Way (Paperback),Julia Cameron,3.89,154488,1992,art,www.goodreads.com//book/show/615570.The_Artist_s_Way
The Art Book (Paperback),Phaidon Press,3.81,227646,1997,art,www.goodreads.com//book/show/567616.The_Art_Book
Art and Fear: Observations on the Perils (and Rewards) of Artmaking,David Bayles,3.7,1398
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int INF = 99*999 + 1;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);