Skip to content

Instantly share code, notes, and snippets.

View rocarvaj's full-sized avatar
🐀

Rodolfo Carvajal rocarvaj

🐀
View GitHub Profile
@rocarvaj
rocarvaj / classExample.py
Created May 3, 2012 18:35
Class in Python
class Arc(object):
""" An arc in the graph """
def __init__(self, origin=None, dest=None, varCost=None, fixCost=None, capac=None):
self.origin = origin
self.dest = dest
self.varCost = varCost
self.fixCost = fixCost
self.capac = capac
@rocarvaj
rocarvaj / template.py
Created May 22, 2012 00:50
Basic python script
#!/usr/bin/python
import sys
fileName = sys.argv[1]
print "Reading file:", fileName
inFile = open(fileName, 'r')
@rocarvaj
rocarvaj / .screenrc
Created July 2, 2012 20:49
Screen config file
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
@rocarvaj
rocarvaj / numbers.cpp
Created August 24, 2012 16:35
Printing tips C++
std::cout << std::setw(2) << setfill('0') << myNumber;
@rocarvaj
rocarvaj / plot.gnuplot
Created August 27, 2012 05:27
Plot from data file
plot "c37.lp_MIPStart.log" using 1:5 with lines, "c37.lp_MIPStart.log" using 1:6 with lines
@rocarvaj
rocarvaj / README.md
Created September 5, 2012 13:40
diverseBB usage

What do you need?

  • [IBM ILOG CPLEX][cplex] (See section below on how to install CPLEX). The code works with CPLEX 12.2, but any later version should be fine.
  • MPI C++ compiler.

CPLEX

The process of downloading/installing CPLEX is a bit cumbersome, you have to get an account at IBM's academic initiative in order to get the software. Follow these steps:

Download software

  • Go to the [IBM academic initiative site][ibm] and create and account (click "Join now" at the right).
  • Once you have completed this, go back to the [home page][ibm] of the site and go to "Get software & access".
@rocarvaj
rocarvaj / GitNotes.md
Created September 21, 2012 19:50
Git Notes
  • How to Push a New Local Branch to a Remote Git Repository

// The one sending branch

git push --set-upstream origin plugin

// The one wanting to use the branch

git fetch origin >git checkout --track origin/plugin

@rocarvaj
rocarvaj / C-CppNotes.md
Created September 24, 2012 13:26
C/C++ Notes
@rocarvaj
rocarvaj / README.md
Created October 4, 2012 16:05
Read file and parse strings

Read file and parse

Las funciones importantes est'an en parse.c. Adjunto tambi'en el archivo macros.h, que tiene algunas funciones macro que se llaman en parse.c, pero se llaman s'olo para cosas como testear para ver si hay alguna condici'on de lleve a error.

@rocarvaj
rocarvaj / csvToLP.py
Created October 11, 2012 15:40
Convert .dow and .csv files to .lp
#!/usr/bin/python
"""
Convert an instance from the multicommodity fixed charge
network flow problem in .csv format to .lp file (arc formulation)
Usage: ./csvToLP.py path/to/my/csv/file.csv
Rodolfo Carvajal <rocarvaj@gatech.edu>