Skip to content

Instantly share code, notes, and snippets.

View baptistelabat's full-sized avatar

Baptiste Labat baptistelabat

  • Nautilabs
  • Nantes, France
View GitHub Profile
baptistelabat / mouseLog10Hz.html
Last active April 17, 2017 18:48
Small example of a log generated at 10Hz from mouse position that you can then save to your computer;
<button onclick="saveTextAsFile()">Save Text to File</button>
<script type="text/javascript">
// Inspiration from
var textToSave = "Date, clientX, clientY" + String.fromCharCode(13); // Header of log file
var clientX = 0;
var clientY = 0;
g++ -c test.cpp -o test.o
baptistelabat / compile.bat
Last active March 27, 2022 12:50
How to compile and access a c++ dll from c++ (taken from
rem You need to have g++ and gfortran installed (for example, use MinGW and add the bin repertory to your path).
rem Build the example_dll.dll
g++ -c -DBUILDING_DLL example_dll.cpp
rem .a is needed for gfortran compiler
g++ -shared -o example_dll.dll example_dll.o -Wl,--out-implib,libexample_dll.a
rem .lib is needeede by ifort compiler (but it is the same file)
copy libexample_dll.a libexample_dll.lib
rem del libexample_dll.a
baptistelabat / compile.bat
Last active June 16, 2016 13:44
Basic example of how to call c++ code from fortran
gcc -c test.cpp -o test.o
gfortran main.f90 test.o