Skip to content

Instantly share code, notes, and snippets.

@GoSteven
GoSteven / Figure it out
Created October 14, 2011 14:23
Just figure out what github gist is
Figure it out, Make it work
@GoSteven
GoSteven / .zshrc
Created May 9, 2012 13:25 — forked from jcrobak/.zshrc
My zshrc
######################################################################
# joe's zshrc file, based upon: mako's zshrc file, v0.1
# http://stuff.mit.edu/~jdong/misc/zshrc-osx-blackonwhite
#
# Options overview: http://zsh.sourceforge.net/Doc/Release/Options.html
######################################################################
unsetopt BG_NICE # do NOT nice bg commands
setopt CORRECT # command correction
setopt INTERACTIVE_COMMENTS # allow comments on line
@GoSteven
GoSteven / latency.txt
Created June 1, 2012 06:10 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@GoSteven
GoSteven / latency.markdown
Created June 8, 2012 03:42 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@GoSteven
GoSteven / OO programming review.md
Created June 9, 2012 07:46
Concurrency in Java and OO in Scala

#Concurrency

###Benefits of Concurrency

  • Exploit multicore processors
  • Hide latency from slow I/O
  • Keep GUI more responsive

###Processes vs Threads

  • memory space
  • share variables

RECITE

Gateways

  • Inclusive Gateway -- merging Inclusive Gateway
    decisions may produce more that one possible outcome
  • Parallel Gateways
  • Exclusive Gateway
@GoSteven
GoSteven / algorithm_and_data_structure.md
Created June 23, 2012 11:48
algorithm and data structure

ant colony

Thus, when one ant finds a good (i.e., short) path from the colony to a food source, other ants are more likely to follow that path, and positive feedback eventually leads all the ants following a single path. The idea of the ant colony algorithm is to mimic this behavior with "simulated ants" walking around the graph representing the problem to solve.


List of algorithms

@GoSteven
GoSteven / changeMvnPassword.sh
Created December 4, 2012 01:22
Change maven encripted password in ~/.m2/settings.xml
#!/bin/bash
echo Please type your password:
read -s p
encrypted=`mvn --encrypt-password $p`
echo encrypted password for mvn is:
echo $encrypted
#escape /
encrypted=`echo "$encrypted" | sed s,/,\\\\\\\\\\/,g`
java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv .venv", so your project folder
# has a .venv folder at the top level, next to your version control directory.