Instantly share code, notes, and snippets.

# Ashwin Nanjappaashwin

• Sort options
Created Feb 25, 2014
Print command-line arguments in Python
View printargv.py
 import sys def main(): for arg in sys.argv: print arg if "__main__" == __name__: main()
Last active Aug 29, 2015
Demo of Morton index in 2D
View morton2d.cpp
 #include #include uint32_t make_morton(uint32_t x, uint32_t y) { uint32_t m = 0; for (int bit = 31; bit >= 0; --bit) { uint32_t mask = 1 << bit; uint32_t xbit = (x & mask) >> bit;
Created May 28, 2014
How to display fraction in LaTeX
View fraction.tex
 % Fraction in LaTeX % The default method $\frac{1}{x}$ % Smaller fraction that occupies lesser vertical space \usepackage{amsmath} $\tfrac{1}{x} Created May 28, 2014 How to display equation in LaTeX View equation.tex  % How to display equation in LaTeX % Simple equation with no numbering \begin{equation*} x = y + z \end{equation*} % Equation with numbering \begin{equation} x = y + z Created Jul 3, 2014 How to create index in LaTeX View index.tex  % In the preamble \usepackage{makeidx} \makeindex % Whenever a key term is defined or used \index{normal distribution} \index{poisson distribution} % At end of document \printindex Created Jul 21, 2014 CMakeLists.txt for building wxWidgets program View wxCMakeLists.txt  project(helloapp) cmake_minimum_required(VERSION 2.8) find_package(wxWidgets COMPONENTS core base REQUIRED) include( "${wxWidgets_USE_FILE}" ) add_executable( \${PROJECT_NAME}
Created Aug 13, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
 // Use Gists to store code you would like to remember later on console.log(window); // log the "window" object to the console
Created Aug 13, 2014
Code demonstrating Google C++ Style Guide