Debian 7.5
build-essentials
andgit
ipython notebook
numpy
scipy
matplotlib
pandas
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
{ | |
"metadata": { | |
"name": "clusterpy loves matplotlib" | |
}, | |
"nbformat": 2, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "code", |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
## Tarjan implementation from Wikipedia's pseudocode | |
def tarjan(graph): | |
#input: graph G = (V, E) | |
#output: set of strongly connected components (sets of vertices) | |
n = len(graph) | |
sccs = [] | |
index = [0] | |
indexes = [-1] * n | |
lows = [float('Inf')] * n | |
S = [] |
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
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
#include <set> | |
#include <map> | |
#include <queue> | |
using namespace std; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Palidromized topcoder | |
string minAdds(string s) { | |
string res,a,b,aux; | |
a=s;b=s; | |
aux=s; | |
reverse(aux.begin(),aux.end()); | |
if(s == aux) | |
return s; |
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
;; TopCoder .cc compile function. (When using .cpp change -3 -> -4 -two times-) | |
(defun tc () (interactive) | |
(compile (concat "g++ " (buffer-name)" -Wall -g -o "(substring (buffer-name) 0 -3)" && ./"(substring (buffer-name) 0 -3))) | |
) |
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
// Sergio Botero | |
// Status: | |
#include <cstdio> | |
#include <string> | |
int main (){ | |
while( 1 ){ | |
for(int i = 0; i < 25; usleep(30000), printf("%s+%s+%s\r", std::string(i++, ' ').c_str(), std::string( 50-(2*i) , ' ').c_str(), std::string(i, ' ').c_str())) fflush(stdout); | |
for(int i = 25; i >= 0; usleep(30000), printf("%s+%s+%s\r", std::string(i--, ' ').c_str(), std::string( 50-(2*i) , ' ').c_str(), std::string(i, ' ').c_str())) fflush(stdout); |
OlderNewer