Skip to content

Instantly share code, notes, and snippets.

View arunenigma's full-sized avatar

Shan arunenigma

  • Silicon Valley
View GitHub Profile
@arunenigma
arunenigma / nlp_bookmarks.txt
Last active December 20, 2015 05:49
NLP Bookmarks
http://streamhacker.com/
http://www.cse.unsw.edu.au/~billw/nlpdict.html
@arunenigma
arunenigma / embedded_proj_bookmarks
Last active December 18, 2015 21:59
Embedded_Project_Bookmarks
https://code.google.com/p/micropendous/wiki/SerialPortUsageWindows
http://processors.wiki.ti.com/index.php/Teraterm_Scripts
http://ttssh2.sourceforge.jp/manual/en/
@arunenigma
arunenigma / c_bookmarks.txt
Last active December 18, 2015 21:49
C concepts - Bookmarks
http://www.geeksforgeeks.org/understanding-extern-keyword-in-c/
http://stackoverflow.com/questions/2198186/purpose-of-ifndef-filename-endif-in-header-file
@arunenigma
arunenigma / GoogAppEng.txt
Last active December 17, 2015 17:39
Google AppEngine Installation and commands
Installation instructions
+++++++++++++++++++++++++
* download .dmg file for Mac and install Google AppEngineLauncher
* allow symlinks to be setup
* e.g. symlink --> /usr/local/google_appengine/dev_appserver.py
Setting up and running your first app
+++++++++++++++++++++++++++++++++++++
@arunenigma
arunenigma / decorator.py
Created April 13, 2013 01:29
Python Decorators
# Python demo of the use of Decorators
def makeBold(func):
def wrapped():
return '<b>' + func() + '</b>'
return wrapped
def makeItalic(func):
@arunenigma
arunenigma / py_notes1.py
Created April 12, 2013 23:35
Python Notes
# Python calls __init__() during instantiation to define additional behavior that should occur
# when a class is instantiated, basically setting up some beginning values for that object or
# running a routine required on instantiation.
For instance if I have a Point class... that has two objects which are the x and y coordinates i can do this:
class Point():
pass
@arunenigma
arunenigma / pygraphviz_hints.py
Last active December 15, 2015 21:39
PyGraphviz Hints | Attrributes
# rankdir='LR' ==> graph|tree prints from left to right
tree = pgv.AGraph(directed=True, strict=True, rankdir='LR')
# edges are flat
tree = pgv.AGraph(directed=True, strict=True, splines=False)
# edges are squared
tree = pgv.AGraph(directed=True, strict=True, splines='ortho')
# multiple edges between two nodes | default --> strict=True (when nothing is specified)
tree = pgv.AGraph(directed=True, strict=False)
@arunenigma
arunenigma / using_pyuic4.txt
Last active December 15, 2015 11:39
Using QtCreator, pyuic4 to convert UI design to Python Code
pyuic4 gets installed with PyQt4
$ pyuic4 /Users/arun/QtProjects/foo.ui > /Users/arun/Desktop/foo.py
Now,we can import foo.py in our python code
as ..
from foo import Ui_Foo # Ui_Foo is class name in C++ class generated with foo.ui
@arunenigma
arunenigma / pdf_renderer.py
Last active December 15, 2015 11:09
PyQt4, QtPoppler, pictureflow | Rendering pdf docs as picture flow in Apple Style
from pictureflow import *
from PyQt4.QtGui import *
import QtPoppler
import sys
app = QApplication(sys.argv)
w = PictureFlow()
d = QtPoppler.Poppler.Document.load('sample.pdf')
d.setRenderHint(QtPoppler.Poppler.Document.Antialiasing and QtPoppler.Poppler.Document.TextAntialiasing)
page = 0
pages = d.numPages() - 1
@arunenigma
arunenigma / trie.py
Created March 22, 2013 18:17
TRIE Implementation in Python
#!/usr/bin/env python
class Node(object):
def __init__(self):
self.next_node = {}
self.word_marker = False
def addItem(self, string):
"""