Skip to content

Instantly share code, notes, and snippets.

View stangirala's full-sized avatar
🙃

Sarma stangirala

🙃
View GitHub Profile
@stangirala
stangirala / springer-free-maths-books.md
Created December 29, 2015 01:04 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@stangirala
stangirala / word_freq.py
Created February 17, 2014 08:08
Word Frequency
import urllib
import urllib2
from BeautifulSoup import BeautifulSoup
from collections import defaultdict
if __name__ == '__main__':
url = 'http://www.giwersworld.org/computers/linux/common-words.phtml'
agent = 'Mozilla/4.0'
@stangirala
stangirala / test_boost_serialization.cpp
Last active March 13, 2018 14:08
Boost serialization example for structs with pointers to primitive data types.
/**
* g++ test_boost_serialization.cpp -lboost_serialization -std=c++0x
*
* **/
#include <fstream>
#include <iostream>
#include <string>
#include <boost/archive/text_oarchive.hpp>
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@stangirala
stangirala / "Virtual" Data Members
Last active December 21, 2015 07:28
Example for a templated class data member that is "virtual". The virtual function that wraps around the data member, gets it to behave as a virtual data member.
#include <iostream>
using namespace::std;
template<typename A>
class base {
protected:
A data;
@stangirala
stangirala / inRect
Last active December 19, 2015 18:58
C++ Code that checks if a point lies within a rectangle. The rectangle can be aligned on any axis.
// Check if point is inside the space of the rectangle.
// Note the class defs and the operator overloading.
bool inRect (rectangle rectangle, point point) {
class point length, breadth, point_centre;
bool result;
sort_points(rectangle);
@stangirala
stangirala / gist:5585813
Last active December 17, 2015 09:19
Jake Install File
#!/bin/bash
#
# JAKE EXTERNALS INSTALLATION
# Similar to the Darwin install script.
# Stuff gets put in the external folder within Jake.
#
# Check that you have gcc-4.6.3. Managing mutiple gcc build
# is a personal thing,
# http://askubuntu.com/questions/211106/how-to-install-gcc-4-6-3-on-12-10
#
I have driven myself mad over my marks.
When I was in high school, I deluded myself into believing that although I was doing poorly in most subjects, I was among the better students in my class. I believed that my low marks could be explained away by my lack of interest in my studies, and that I could reach the top at any moment just by beginning to exert the smallest amount of effort. The rest of the students in the class were easy enough to group into try-hards who cared too much and losers who cared too little.
This worked well enough for me back then, and although I did not get into the university that I had always dreamed of, I was accepted into one that was good enough for my standards at the time. I heard time and time again that the school was a competitive one, but strongly believed due to my self-confidence that I could keep up my same work ethic and still succeed, as I had before.
I did not. I failed an enriched theory of computation course despite mighty boasts to the teacher about how inter