This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--=================================================== | |
--= Niklas Frykholm | |
-- basically if user tries to create global variable | |
-- the system will not let them!! | |
-- call GLOBAL_lock(_G) | |
-- | |
--=================================================== | |
function GLOBAL_lock(t) | |
local mt = getmetatable(t) or {} | |
mt.__newindex = lock_new_index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Find the top X frequent numbers in a stream | |
// http://www.cs.berkeley.edu/~satishr/cs270/sp11/rough-notes/Streaming-two.pdf | |
// Returns the top numbers k and their frequencies in the set | |
// Complexity: | |
// space = O(k) | |
// time = O(N) | |
map<int, int> getFreq(k, Set) { | |
A = map<int, int> | |
for (k : getTop(k, Set) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# always list in long format | |
alias ls='ls -la --color' | |
alias clear=cls | |
# set dynamic prompt and window/tab title | |
PS1='\[\e]0;${PWD##*/}\a\]\n' # set window title | |
#PS1="$PS1"'\u@\h ' # user@host<space> | |
PS1="$PS1"'\[\033[32m\]' # change color | |
PS1="$PS1"'\w' # current working directory | |
if test -z "$WINELOADERNOEXEC" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "Provisioning virtual machine..." | |
sudo apt-get update | |
sudo apt-get install -y python-software properties | |
sudo apt-get install -y software-properties-common | |
sudo add-apt-repository -y ppa:webupd8team/java |
NewerOlder