Skip to content

Instantly share code, notes, and snippets.

View bunelr's full-sized avatar

Rudy Bunel bunelr

View GitHub Profile
def parse_input_file(in_filename):
with open(in_filename, 'r') as in_file:
first_line = in_file.readline()
nb_vid, nb_end, nb_req, nb_cache, capacity = map(int, first_line.split(' '))
video_weight_line = in_file.readline()
video_weights = np.array(list(map(int, video_weight_line.split(' '))))
datacenter_to_end_latency = np.ndarray(nb_end)
end2cachelatency = []
@bunelr
bunelr / const.cpp
Created February 19, 2016 16:59
Const behavior
#include <iostream>
void test_const( int & a, const int & b){
a = a + 1;
a = a-b;
}
int main(int argc, char *argv[])
{
@bunelr
bunelr / quizz.cpp
Created December 18, 2015 12:20
Quizz
for (int l1=0; l1 < M_; l1++) {
for (int l2=0; l2< M_; l2++) {
float temp = (l1==l2 - inv_proba(l2)/z_norm) * inv_proba(l1);
J1(l1,l2) = temp;
}
}
@bunelr
bunelr / mv.sh
Last active November 12, 2015 15:51
Using split files to get all Train/Test/Validation images in a folder
cat split/train.txt | trim | awk '{printf("cp /home/rudy/datasets/MSRC/MSRC_ObjCategImageDatabase_v2/Images/%s /home/rudy/datasets/MSRC/train/%s \n" , $1 , $1)}' | bash
cat split/Validation.txt |sed 's/.bmp/_GT.bmp/' | trim | awk '{printf("cp /home/rudy/datasets/MSRC/MSRC_ObjCategImageDatabase_v2/GroundTruth/%s /home/rudy/datasets/MSRC/GT_by_partition/val/%s \n" , $1 , $1)}' | bash
@bunelr
bunelr / cube.tex
Last active September 9, 2015 14:57
\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm,landscape]{geometry}
\usepackage{tikz}
\usepackage{keyval}
\usepackage{ifthen}
%====================================
%emphasize vertices --> switch and emph style (e.g. thick,black)
%====================================
\makeatletter
% Standard Values for Parameters
@bunelr
bunelr / Benchmark result
Last active August 29, 2015 14:22
Forward mode
-- Without the monkeypatching (standard nn)
rudy@rudy-Tower:~workspace/utc-caltech[master]
$ time luajit luatools/prediction.lua
data/res/divers-bignn/set09/V010.txt
real 1m1.162s
user 0m51.132s
sys 0m13.084s
@bunelr
bunelr / To add to ServiceDefinition.csdef
Last active August 29, 2015 14:05
Install The datadog Agent on Azure
<Task commandLine="installDatadogAgent.cmd YOUR_API_KEY" executionContext="elevated" />
@bunelr
bunelr / Comand to run.md
Created August 22, 2014 20:32
Debug Command

Try

> import wmi
> conn=wmi.WMI(None)
> res = conn.Win32_PerfFormattedData_PerfDisk_PhysicalDisk()
> print res[0]

If it doesn't work, try:

@bunelr
bunelr / yo.md
Created August 14, 2014 22:00
Yo-Datadog
@bunelr
bunelr / Twilio refined payload
Created July 31, 2014 13:43
Twilio Refined Payload
{
"To":"+1347XXXXXXX",
"From":"+1347XXXXXX",
"Body":"$EVENT_TITLE \n Related Graph: $SNAPSHOT"
}