Resources
[1] Head images http://bids.neuroimaging.io/
Thursday, September 06, 2018
Wednesday, September 05, 2018
pip3 ImportError: cannot import name 'main'
In linux you need to change the file: /usr/bin/pip3 from:
to:
from pip import main
if __name__ == '__main__':
sys.exit(main())
to:
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())
Monday, September 03, 2018
c++ realloc references
https://en.cppreference.com/w/c/memory/realloc
https://www.tutorialspoint.com/c_standard_library/c_function_realloc.htm
Sunday, September 02, 2018
quadtree
References:
[1] http://www.lcad.icmc.usp.br/~jbatista/procimg/quadtree_neighbours.pdf
[2] http://homepage.divms.uiowa.edu/~kvaradar/sp2012/daa/ann.pdf
[3] http://web.archive.org/web/20120907211934/http://ww1.ucmss.com/books/LFS/CSREA2006/MSV4517.pdf
[3] operations cost https://arxiv.org/pdf/1712.05591.pdf
Resources:
[1] quadtree neighbors https://bl.ocks.org/mbostock/4343214
[2] neighbors https://gist.github.com/patricksurry/6478178
[3] neighbors https://github.com/geidav/quadtree-neighbor-finding/blob/master/neighbors.py
[4] https://geidav.wordpress.com/2017/12/02/advanced-octrees-4-finding-neighbor-nodes/
[5] for check https://github.com/xoolive/quadtree
[6] gaussian kd-tree https://www.cg.tuwien.ac.at/courses/Visualisierung2/HallOfFame/2012/7-Labschuetz/Homepage/index.html#References
[7] quadtree over CUDA source code http://ecee.colorado.edu/~siewerts/extra/code/example_code_archive/a490dmis_code/CUDA/cuda_work/samples/Samples.html
[1] http://www.lcad.icmc.usp.br/~jbatista/procimg/quadtree_neighbours.pdf
[2] http://homepage.divms.uiowa.edu/~kvaradar/sp2012/daa/ann.pdf
[3] http://web.archive.org/web/20120907211934/http://ww1.ucmss.com/books/LFS/CSREA2006/MSV4517.pdf
[3] operations cost https://arxiv.org/pdf/1712.05591.pdf
Resources:
[1] quadtree neighbors https://bl.ocks.org/mbostock/4343214
[2] neighbors https://gist.github.com/patricksurry/6478178
[3] neighbors https://github.com/geidav/quadtree-neighbor-finding/blob/master/neighbors.py
[4] https://geidav.wordpress.com/2017/12/02/advanced-octrees-4-finding-neighbor-nodes/
[5] for check https://github.com/xoolive/quadtree
[6] gaussian kd-tree https://www.cg.tuwien.ac.at/courses/Visualisierung2/HallOfFame/2012/7-Labschuetz/Homepage/index.html#References
[7] quadtree over CUDA source code http://ecee.colorado.edu/~siewerts/extra/code/example_code_archive/a490dmis_code/CUDA/cuda_work/samples/Samples.html
Thursday, August 30, 2018
Linux: mount folder to different folders
Code:
mount -o bind /media/disk1/pictures /home/user1/pictures mount -o bind /media/disk1/pictures /home/user2/pictures
Code:
/media/disk1/pictures /home/add1cker/pictures none defaults,bind 0 0
Sunday, August 26, 2018
OpenGL Tutorial
Common libs for start
Matrix Class [3]
Error:
_dl_check_map_versions: Assertion `needed != ((void *)0)' failed!
Fixed using -lpthread parameter [2].
References:
[1] https://www.opengl.org/wiki/Programming_OpenGL_in_Linux:_GLX_and_Xlib
[2] http://stackoverflow.com/questions/20007961/error-running-a-compiled-c-file-uses-opengl-error-inconsistency-detected
[3] http://www.songho.ca/opengl/index.html
http://www.songho.ca/opengl/gl_matrix.html#example1
[4] Image Libraries
https://www.opengl.org/wiki/Image_Libraries
[5] SFML
http://www.sfml-dev.org/tutorials/2.3/start-linux.php
$sudo apt-get install freeglut3-dev
Matrix Class [3]
Error:
_dl_check_map_versions: Assertion `needed != ((void *)0)' failed!
Fixed using -lpthread parameter [2].
References:
[1] https://www.opengl.org/wiki/Programming_OpenGL_in_Linux:_GLX_and_Xlib
[2] http://stackoverflow.com/questions/20007961/error-running-a-compiled-c-file-uses-opengl-error-inconsistency-detected
[3] http://www.songho.ca/opengl/index.html
http://www.songho.ca/opengl/gl_matrix.html#example1
[4] Image Libraries
https://www.opengl.org/wiki/Image_Libraries
[5] SFML
http://www.sfml-dev.org/tutorials/2.3/start-linux.php
Wednesday, August 22, 2018
Tuesday, August 21, 2018
Raspberry pi 3
1) user and passwords:
Distribution | Username | Password
---------------|------------|-------------
Debian Squeeze | pi | raspberry
Arch | root | root
QtonPi | root | rootme
Raspbian | pi | raspberry
OpenElec | root | openelec
Pidora | root | raspberrypi
RISC OS | n/a | n/a
raspbmc | pi | raspberry
2) add users
$sudo adduser username
$
usermod -aG sudo username
3) Ports
$lsof -nP -i | grep LISTEN
$netstat -tlpn | grep LISTEN
4) vncserver (reinstall, by default sometime doesn't works)
$sudo apt-get install tightvncserver
5) Firewalls
iptables -I INPUT -p tcp --dport 5900 -j ACCEPT iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
Resources:
[1] https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart
[2] direct way https://www.shellhacks.com/how-to-grant-root-access-user-root-privileges-linux/
[3] vncserver https://quaintproject.wordpress.com/2013/03/24/establish-a-vnc-connection-to-your-raspberry-pi-from-a-linux-pc/
Monday, August 20, 2018
Thursday, August 16, 2018
Optimize code C/C++
If you are using linux: use
In Windows the equivalent is
Resources:
[1] fast input/output https://ideone.com/BrsDz4
Enteprise solutions:
[1] http://www.fastformat.org/
getchar_unlocked()
and putchar_unlocked()
for taking fast single character I/O.In Windows the equivalent is
getchar()
and puchar()
repectivelyResources:
[1] fast input/output https://ideone.com/BrsDz4
Enteprise solutions:
[1] http://www.fastformat.org/
Monday, August 13, 2018
Thursday, August 09, 2018
Programming online C++ and others
Online programming tools
Resources:
[1] C++, Python https://repl.it/@melhorum
[2] Multi Language Support https://code.dcoder.tech/
[3] Account for C/C++, C#, Java http://rextester.com
[4] http://www.onlinegdb.com/
Resources:
[1] C++, Python https://repl.it/@melhorum
[2] Multi Language Support https://code.dcoder.tech/
[3] Account for C/C++, C#, Java http://rextester.com
[4] http://www.onlinegdb.com/
Wednesday, August 01, 2018
Python 2.7 pip
Resolving error on python 2.7 using pip: ImportError: No module named _internal
$wget https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz
$tar -xzvf pip-8.1.2.tar.gz
$cd pip-8.1.2
$sudo python setup.py install
Tuesday, July 10, 2018
Friday, June 29, 2018
OpenCV 2.4.9 and 3.4.1 Compiling
2.4.x
CUDA_nppi_LIBRARY CUDA 7.5 -> 8.0 (was removed)
-D WITH_CUDA=OFF ..
c++ 6 fatal error: stdlib.h: No such file or directory
export CC=path_of_gcc/gcc-version
export CXX=path_of_g++/g++-version
cmake path_of_project_contain_CMakeList.txt
make
OR
#Current version is 6, but we need to compile using another version (installed for sure)
$CC="gcc-4.9" CXX="g++-4.9" cmake /CMakeLists.txt
OR$cmake -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=/usr/bin/g++ CMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_TBB=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DBUILD_FAT_JAVA_LIB=ON -DINSTALL_TO_MANGLED_PATHS=ON -DINSTALL_CREATE_DISTRIB=ON -DINSTALL_TESTS=ON -DENABLE_FAST_MATH=ON -DWITH_IMAGEIO=ON -DBUILD_SHARED_LIBS=OFF -DWITH_GSTREAMER=ON -DWITH_OPENMP=OFF -DWITH_CUDA=OFF -DBUILD_opencv_gpu=OFF ..3.4.x
Unknown CMake command "ocv_append_source_files_cxx_compiler_options".
This happened when the opencv_contrib version is no compatible with your current version.
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules/ ..
$make
$sudo make install
$sudo ldconfig
After installation, if doesn't compile, check the files opencv.conf and opencv.pc:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#/etc/ld.so.conf.d/opencv.conf
/usr/local/lib
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#/usr/local/lib/pkgconfig/opencv.pc
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include
Name: OpenCV
Description: Open Source Computer Vision Library
Version: 2.4.13.6
Libs: -L${exec_prefix}/lib -lopencv_contrib -lopencv_legacy -lopencv_stitching -lopencv_nonfree -lopencv_superres -lopencv_ocl -lopencv_objdetect -lopencv_ml -lopencv_ts -lopencv_videostab -lopencv_video -lopencv_photo -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_imgproc -lopencv_flann -lopencv_core -L/usr/lib/x86_64-linux-gnu -lIlmThread -lHalf -lIex -lIlmImf -lImath -ljasper -ltiff -lpng -ljpeg -lavutil -lswscale -lswresample -lavcodec -lz -llzma -lxcb-shape -lxcb-render -lxcb-xfixes -lxcb-shm -lxcb -lavformat -lv4l2 -lv4l1 -ldc1394 -lGL -lGLU -latomic -ltbb -lrt -lpthread -lm -ldl -lstdc++
Cflags: -I${includedir_old} -I${includedir_new}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Resources:
[1] opencv github (choice right branch) https://github.com/opencv/opencv
[1] opencv_contrib is just from 3.0 .. https://github.com/opencv/opencv_contrib/releases
[2] Steps for install () http://karytech.blogspot.com/2012/05/opencv-24-on-ubuntu-1204.html
[3] Script for install under ubuntu16 https://gist.github.com/fortunto2/20a9696c7fc23ef18f8cfc50e371fe5f
[4] Some variables http://daveaubin.com/index.php/how-to-build-and-install-opencv-2-4-9-on-raspberry-pi/
Monday, June 11, 2018
Friday, June 08, 2018
Fluid Simulation: Lectures and Resources
CAELinux LiveDVD in your computer to turn it into a free and open engineering development workstation with CAD, CAM, CAE / FEA / CFD, electronic design and 3D printing features: no licence and even no installation is required ! [2]
Resources:
[1] Laboratory http://lgg.epfl.ch/research_physicsbased_animation.php
[2] CFD Linux distro https://caelinux.com/CMS3/
Courses:
[1] Khan https://pt.khanacademy.org/partner-content/pixar/effects/particle/p/water-simulation
Wednesday, June 06, 2018
Compiling tris2indicator on Linux Ubuntu 16
change code from MapViewOfFile (Windows) to mmap (Linux) on read_obj.cpp and write_grid.cpp.
$g++ read_obj.cpp vect.cpp global.cpp insert_poly.cpp write_grid.cpp timer.cpp main.cpp -lpthread -lm -o tris2indicator
source code:
[1] http://josiahmanson.com/research/wavelet_rasterization/
$g++ read_obj.cpp vect.cpp global.cpp insert_poly.cpp write_grid.cpp timer.cpp main.cpp -lpthread -lm -o tris2indicator
source code:
[1] http://josiahmanson.com/research/wavelet_rasterization/
Tuesday, June 05, 2018
Mapping files into memory
- CreateFile(); or OpenFile();
- CreateFileMapping();
- MapViewOfFile();
mmap()
combines the functions of CreateFileMapping()
and MapViewOfFile()
References
[1] https://stackoverflow.com/questions/8391094/equivalent-win-api-in-nix
[2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html
[3] mmap example https://gist.github.com/marcetcheverry/991042
Subscribe to:
Posts (Atom)
-
Resources: [1] Hela https://ome.grc.nia.nih.gov/iicbu2008/hela/index.html
-
en inglĆ©s se llama “A potentially dangerous Request.Form value was detected from the client”. varias pĆ”ginas indican dos cosas: 1. agrega...
-
mas plugins http://devsnippets.com/reviews/using-jquery-to-style-design-elements-20-impressive-plugins.html http://www.extjs.com/deploy/dev/...
Odoo 17 - Custom adds
[1] Diario/Seq https://apps.odoo.com/apps/modules/17.0/sequence_for_journal