import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
graylevel = 1.0
mpl.rc('figure', facecolor = (graylevel, graylevel, graylevel), edgecolor ='r')
%pylab inline
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
config.vm.define :ejabberdbox do |ejabberdbox_config| | |
ejabberdbox_config.vm.box = 'precise64' | |
ejabberdbox_config.vm.box_url = "http://dl.dropbox.com/u/1537815/precise64.box" |
This file contains hidden or 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
import os | |
import ycm_core | |
from clang_helpers import PrepareClangFlags | |
compilation_database_folder = '' | |
# These are the compilation flags that will be used in case there's no | |
# compilation database set. | |
flags = [ | |
'-Wall', |
This file contains hidden or 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
import os | |
import ycm_core | |
from clang_helpers import PrepareClangFlags | |
# Set this to the absolute path to the folder (NOT the file!) containing the | |
# compile_commands.json file to use that instead of 'flags'. See here for | |
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html | |
# Most projects will NOT need to set this to anything; you can just change the | |
# 'flags' list of compilation flags. Notice that YCM itself uses that approach. | |
compilation_database_folder = '' |
This file contains hidden or 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
std::vector<std::string> split(const std::string &s, const std::string &tosplit){ | |
const std::regex rsplit(tosplit + "+"); | |
auto rit = std::sregex_token_iterator(s.begin(), s.end(), rsplit, -1); | |
auto rend = std::sregex_token_iterator(); | |
auto res = std::vector<std::string>(rit, rend); | |
return res; | |
} |
This file contains hidden or 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
xen-create-image --hostname ubuntu.dev --size=30G --swap=1G --dhcp --memory=8192Mb --mirror=http://archive.ubuntu.com/ubuntu/ --lvm server --dist=precise --passwd --force |
This file contains hidden or 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
brew install python | |
easy_install pip | |
#install scipy use temp branch | |
pip install git+https://github.com/minrk/scipy-1.git@accelerate | |
#ft2build.h not found ==> | |
pip install git+git://github.com/matplotlib/matplotlib.git |
This file contains hidden or 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
import re | |
def mongo_cleanup(item, replacement=''): | |
"""clean's a nested structure keys to adapt to mongodb's | |
legal keys | |
see http://www.mongodb.org/display/DOCS/Legal+Key+Names """ | |
if hasattr(item, 'items'): | |
newdict = {} | |
for key, value in item.items(): | |
nkey = key |
This file contains hidden or 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
dthandler = lambda obj: obj.isoformat() if isinstance(obj, datetime.datetime) else None | |
def jsonify(data): | |
return Response(json.dumps(data, default=dthandler)) | |
This file contains hidden or 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
(defn send_multipart [socket iter] | |
(map mq/send-more (repeat socket) (pop iter)) | |
(mq/send socket (last iter))) |
NewerOlder