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
#include <stdio.h> | |
#include <vector> | |
using namespace std; | |
int num_vertices; | |
// this vector is for the adjacency matrix | |
vector <vector <int> > adj_matrix; |
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
#!/usr/bin/python | |
f = open('uniq.design') | |
design = {} | |
for x in f: | |
row = x.strip().split() | |
if len(row) < 2: continue | |
design[row[0]] = row[1] | |
f.close() | |
# print design |
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
#include<stdio.h> | |
int cycle(int i){ | |
int length = 1; | |
int n; | |
for(n = i ; n >= 1;){ | |
if(n == 1){ break; } | |
if(n % 2 == 0){ |
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
def reverse(a): | |
b = 0 | |
while a > 0: | |
b = b * 10 + (a % 10) | |
a /= 10 | |
return b | |
def check(a, b): | |
while (a > 0) and (b > 0): | |
c = a % 10 |
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
// this implementation has an error in the calculation, find the error | |
class Point { | |
public float x, y; | |
public Point(float x, float y) { | |
this.x = x; | |
this.y = y; | |
} |
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
#!/usr/bin/python | |
# f = open('uniq.design') | |
f = open('HumanCRC.design') | |
design = {} | |
for x in f: | |
row = x.strip().split() | |
if len(row) < 2: continue | |
design[row[0]] = row[1] | |
f.close() |
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
#!/bin/bash | |
# git-interactive-merge | |
# Taken from: http://www.angrylibertarian.com/node/53 | |
from=$1 | |
to=$2 | |
if [[ ( -z $from ) || ( -z $to ) ]]; then | |
echo "Usage:" | |
echo " git-interactive-merge <from-branch> <to-branch>" | |
exit 1 |
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
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
/* | |
* | |
*/ | |
int main(int argc, char** argv) { | |
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
#include <cstdlib> | |
#include <iostream> | |
#include <vector> | |
#define NUM_TREES 5 | |
using namespace std; | |
// base tree | |
class AbstractDecisionTree { |
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
Starting main program | |
Forest CTor | |
RandomForest CTor | |
Creating 0(th) decision tree | |
AbstractDecisionTree CTor | |
DecisionTree CTor | |
Creating 1(th) decision tree | |
AbstractDecisionTree CTor | |
DecisionTree CTor | |
Creating 2(th) decision tree |