Skip to content

Instantly share code, notes, and snippets.

View caiofcm's full-sized avatar
🎯
Focusing

Caio Curitiba Marcellos caiofcm

🎯
Focusing
View GitHub Profile
@caiofcm
caiofcm / proof_crystyield.ipynb
Last active October 22, 2015 08:05
Proof for yield relation using mass balances
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@caiofcm
caiofcm / newcppproject.sh
Last active June 2, 2017 00:11
Generate new CPP Project based on Makefile for g++ with folders to organize files (default including ipopt/adolc - change it; create a help command also)
#!/bin/bash
# Use -gt 1 to consume two arguments per pass in the loop (e.g. each
# argument has a corresponding value to go with it).
# Use -gt 0 to consume one or more arguments per pass in the loop (e.g.
# some arguments don't have a corresponding value to go with it such
# as in the --default example).
# note: if this is set to -gt 0 the /etc/hosts part is not recognized ( may be a bug )
while [[ $# -gt 0 ]]
do
key="$1"
@caiofcm
caiofcm / convertAdolc.py
Last active June 3, 2017 01:35
Convert c++ file (header and source) from regular double to adouble in order to use ADOLC
# # Convertion TOOL: from double to adouble
#
# ## Description:
#
# In the header/source files mark double that should be considered as adouble as:
# `double\*a*\`
# The conversion tool will simple change those declaration to `adouble`
#
# ## Usage:
#
@caiofcm
caiofcm / python-package-info.md
Last active March 20, 2018 14:04
Python Package Informations
@caiofcm
caiofcm / python-profile-execution.md
Created March 20, 2018 15:19
python-profile-execution

Python Profile

Currently using Snakeviz:

Steps

  • pip install snakeviz
  • python -m cProfile -o program.prof my_program.py
  • snakeviz program.prof
@caiofcm
caiofcm / python-test.md
Created March 20, 2018 17:56
Python Test
@caiofcm
caiofcm / from_git_to_latex_revision.md
Last active June 13, 2018 19:47
Create revision pdf file from latex using git commits
@caiofcm
caiofcm / mingw64-python-numpy.md
Created May 30, 2018 14:59
Mingw64: install python with numpy scipy pip

Mingw64: install python with numpy scipy pip

$ pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime
$ pacman -Su
$ pacman -Sy base-devel msys2-devel
$ pacman -Sy mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-numpy mingw-w64-x86_64-python3-scipy mingw-w64-x86_64-python3-matplotlib mingw-w64-x86_64-python3-pandas mingw-w64-x86_64-python3-Pillow

reference

@caiofcm
caiofcm / Makefile
Last active June 18, 2018 13:02
pdflatex makefile
# LaTeX Makefile
FILE=thesis
all: $(FILE).pdf
.PHONY: clean
clean:
rm -rf *.blg
rm -rf *.out
@caiofcm
caiofcm / cat_vector.py
Last active July 13, 2018 15:01
python simple auxiliary functions
def cat_vector(args):
noArray = False
for y in args:
if isinstance(y, np.ndarray):
if y.size != 1:
x = y
noArray = True
break
if noArray == False:
raise 'One of the args has to be a numpy array'