Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am titan-c on github.
  • I am oscarnajera (https://keybase.io/oscarnajera) on keybase.
  • I have a public key ASBq2SH3YmEPUJd6LW0NZP2nzkVkSHEMBKoaUr9T6d2KTQo

To claim this, I am signing this object:

@Titan-C
Titan-C / server.py
Created May 23, 2018 13:53
Simple query server
# -*- coding: utf-8 -*-
r"""
Simple query server
===================
This program runs a server that is accessible on
http://localhost:4000/. When server receives a request on
http://localhost:4000/set?somekey=somevalue it should store the passed key
and value in memory. When it receives a request on
@Titan-C
Titan-C / gf_init.err
Created August 14, 2016 11:11
triqs fail tests on HDF5
HDF5-DIAG: Error detected in HDF5 (1.10.0) thread 0:
#000: H5I.c line 1449 in H5Iinc_ref(): can't increment ID ref count
major: Object atom
minor: Unable to increment reference count
#001: H5I.c line 1482 in H5I_inc_ref(): can't locate ID
major: Object atom
minor: Unable to find atom information (already closed?)
Traceback (most recent call last):
File "<stdin>", line 33, in <module>
File "/home/oscar/builds/buildtriqs/pytriqs/archive/hdf_archive.py", line 222, in __getitem__
@Titan-C
Titan-C / glr_thumb
Created May 7, 2015 14:24
Sphinx directive extension for figure environment
# -*- coding: utf-8 -*-
"""
Created on Tue May 5 14:44:57 2015
@author: oscar
"""
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst.directives.images import Figure
@Titan-C
Titan-C / output
Created April 13, 2015 20:06
Failing examples in nilearn gallery
plotting plot_probabilistic_atlas_extraction.py
________________________________________________________________________________
plot_probabilistic_atlas_extraction.py is not compiling:
Traceback (most recent call last):
File "/home/oscar/dev/nilearn/doc/sphinxext/sphinxgallery/gen_rst.py", line 508, in generate_file_rst
execfile(os.path.basename(src_file), my_globals)
File "plot_probabilistic_atlas_extraction.py", line 32, in <module>
labels = np.recfromcsv(csv_filename)
File "/home/oscar/miniconda/envs/mach/lib/python2.7/site-packages/numpy/lib/npyio.py", line 1910, in recfromcsv
output = genfromtxt(fname, **kwargs)
@Titan-C
Titan-C / Starting_Profile.txt
Last active August 29, 2015 14:18
Cythonizing Hirsch-Fye Quantum Montecarlo
1214757 function calls (1212402 primitive calls) in 3.903 seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.029 0.029 3.591 3.591 hirschfye.py:52(imp_solver)
9000 1.603 0.000 3.557 0.000 hirschfye.py:83(update)
260114 1.635 0.000 1.879 0.000 hirschfye.py:142(gnew)
520228 0.244 0.000 0.244 0.000 {method 'copy' of 'numpy.ndarray' objects
@Titan-C
Titan-C / cblas_dger_use.cpp
Created March 31, 2015 18:18
Calling cblas from c++
#include <cstdlib>
#include <vector>
#include <iostream>
#include <cmath>
extern "C"
{
#include <cblas.h>
}
@Titan-C
Titan-C / mpi_red verbose
Last active August 29, 2015 14:14
fail triqs compilation
(alps)oscar@lab-arch buildTri $cmake -DCMAKE_INSTALL_PREFIX=/home/oscar/libs -DUSE_CPP14=ON -DBuild_Documentation=ON ../triqs/
-- Installation directory is /home/oscar/libs
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
@Titan-C
Titan-C / autocorrelation_time.output
Created October 6, 2014 13:27
This are the output files: the reference first then the test output
0.125 +/- 0.426956
0.0763889 +/- 0.174719
N = 100000
L = 100
(autocorrelation_time(A)) ---> 89
(autocorrelation_time_from_binning(A,intrinsic_variance)) ---> 80.2806
(autocorrelation_time_from_binning(A)) ---> 95.7671