The segment fault is usually caused by memory manage issues.
When I debugged my issue, I found that:
One class called "new S3Client", which is passed to a unique_ptr. However, when ShutdownAPI(options) function is called, the S3Client somehow gets destroyed. Then when the unique_ptr tries to destroy S3Client, a segment fault happened.
The fix is to put a section bracket { } before calling ShutdownAPI so that the unique_ptr destroys the pointer before ShutdownAPI.
1/11/2017
1/06/2017
How to change terminal cursor shape and color
For gnome-terminal:
Profile Preference | Cursor Shape (Prefer no blinking block)
Then:
Add "echo -ne '\e]12;#ff0000\a'" to change the color to red
To disable cursor blinking:
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default|tr -d \')/ cursor-blink-mode off
To disable Ubuntu Cinnemon cursor blinking:
System settings | Keyboard Turn off text cursor blinks
For Putty:
Window | Appearance | Cursor Appearance: to change shape
Window | Colors | Cursor Color: to change the color
Profile Preference | Cursor Shape (Prefer no blinking block)
Then:
Add "echo -ne '\e]12;#ff0000\a'" to change the color to red
To disable cursor blinking:
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default|tr -d \')/ cursor-blink-mode off
To disable Ubuntu Cinnemon cursor blinking:
System settings | Keyboard Turn off text cursor blinks
For Putty:
Window | Appearance | Cursor Appearance: to change shape
Window | Colors | Cursor Color: to change the color
For Google Docs:
12/29/2016
How to build CloudCompare
To build on Mac:
Use CMake GUI tool.
Source code: /Users/liangzou/gitcloudcompare/trunk
/Users/liangzou/gitcloudcompare/build
Then click Configure
Manually fix the QT5_ROOT_PATH fields:
/Users/liangzou/Qt/5.7/clang_64/lib/cmake/Qt5
Then choose what to install under INSTALL. Check INSTALL_QANIMATION_PLUGIN
Set variables for FFMPEG:
/usr/local/Cellar/ffmpeg/3.1.4/include
Click the Configure again.
Then click Generate.
In addition, I need to do a code change in file:
QVideoEncoder.cpp. Add function call "avcodec_register_all()" before avcodec_find_encoder(codec_id).
Then make install
To build on Linux:
Use CMake GUI tool:
cmake-gui
Install Qt5. Download QT installer and run it.
Set:
QT5_ROOT_PATH: /opt/Qt/5.10.1/gcc_64/include
Qt5Concurrent_DIR: /opt/Qt/5.10.1/gcc_64/lib/cmake/Qt5Concurrent
...
With PDAL to support LAS files.
Download and build https://github.com/LASzip/LASzip
Download and build https://github.com/PDAL/PDAL
Check the OPTION_PDAL_LAS option
PDAL_DIR should be set correctly if it was installed correctly. e.g. /usr/local/lib/cmake/PDAL
Download and build https://github.com/open-source-parsers/jsoncpp
Set JSON_ROOT_DIR to: /usr/local/lib/cmake/jsoncpp/
To install the QANIMATION_PLUGIN, FFMPEG needs to be installed.
https://github.com/FFmpeg/FFmpeg
To install FFMPEG:
git checkout n4.1
./configure --disable-x86asm --prefix=/opt/ffmpeg --enable-shared --enable-pic
make
sudo make install
Set FFMPEG_INCLUDE_DIR and FFMPEG_LIBRARY_DIR correctly, e.g. /opt/ffmpeg/include/ and /opt/ffmpeg/lib
(VERY IMPORTANT: need to add /opt/ffmpeg/lib to LD_LIBRARY_PATH. Otherwise, the plugin won't show in CloudCompare).
A working build screen:
Common errors:
1. cannot find a so:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt/5.10.1/gcc_64/lib:/usr/local/cuda-9.1/lib64
OR you'll need to run sudo ldconfig
2. CloudCompare crashes when starting:
Delete some pidgin files: e.g. sudo rm -rf /usr/local/lib/cloudcompare/pidgins
3. If installed by using snap, need to follow:
sudo apt update
sudo apt install snapd
sudo snap install cloudcompare
Use CMake GUI tool.
Source code: /Users/liangzou/gitcloudcompare/trunk
/Users/liangzou/gitcloudcompare/build
Then click Configure
Manually fix the QT5_ROOT_PATH fields:
/Users/liangzou/Qt/5.7/clang_64/lib/cmake/Qt5
Then choose what to install under INSTALL. Check INSTALL_QANIMATION_PLUGIN
Set variables for FFMPEG:
/usr/local/Cellar/ffmpeg/3.1.4/include
Click the Configure again.
Then click Generate.
In addition, I need to do a code change in file:
QVideoEncoder.cpp. Add function call "avcodec_register_all()" before avcodec_find_encoder(codec_id).
Then make install
To build on Linux:
Use CMake GUI tool:
cmake-gui
Install Qt5. Download QT installer and run it.
Set:
QT5_ROOT_PATH: /opt/Qt/5.10.1/gcc_64/include
Qt5Concurrent_DIR: /opt/Qt/5.10.1/gcc_64/lib/cmake/Qt5Concurrent
...
With PDAL to support LAS files.
Download and build https://github.com/LASzip/LASzip
Download and build https://github.com/PDAL/PDAL
Check the OPTION_PDAL_LAS option
PDAL_DIR should be set correctly if it was installed correctly. e.g. /usr/local/lib/cmake/PDAL
Download and build https://github.com/open-source-parsers/jsoncpp
Set JSON_ROOT_DIR to: /usr/local/lib/cmake/jsoncpp/
To install the QANIMATION_PLUGIN, FFMPEG needs to be installed.
https://github.com/FFmpeg/FFmpeg
To install FFMPEG:
git checkout n4.1
./configure --disable-x86asm --prefix=/opt/ffmpeg --enable-shared --enable-pic
make
sudo make install
Set FFMPEG_INCLUDE_DIR and FFMPEG_LIBRARY_DIR correctly, e.g. /opt/ffmpeg/include/ and /opt/ffmpeg/lib
(VERY IMPORTANT: need to add /opt/ffmpeg/lib to LD_LIBRARY_PATH. Otherwise, the plugin won't show in CloudCompare).
A working build screen:
Common errors:
1. cannot find a so:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt/5.10.1/gcc_64/lib:/usr/local/cuda-9.1/lib64
OR you'll need to run sudo ldconfig
2. CloudCompare crashes when starting:
Delete some pidgin files: e.g. sudo rm -rf /usr/local/lib/cloudcompare/pidgins
3. If installed by using snap, need to follow:
sudo apt update
sudo apt install snapd
sudo snap install cloudcompare
12/26/2016
12/16/2016
Mersenne Twister
The Mersenne Twister is a pseudorandom number generator (PRNG). It is by far the most widely used general-purpose PRNG. Its name derives from the fact that its period length is chosen to be a Mersenne prime.
In mathematics, a Mersenne prime is a prime number that is one less than a power of two.
More generally, numbers of the form Mn = 2n − 1 without the primality requirement are called Mersenne numbers.
In mathematics, a Mersenne prime is a prime number that is one less than a power of two.
More generally, numbers of the form Mn = 2n − 1 without the primality requirement are called Mersenne numbers.
Ransac (get planes from point clouds)
Fit Plane Ransac: Random sample consensus (RANSAC) is an iterative method to estimate parameters of a mathematical model from a set of observed data that contains outliers, when outliers are to be accorded no influence on the values of the estimates. Therefore, it also can be interpreted as an outlier detection method.[1] It is a non-deterministic algorithm in the sense that it produces a reasonable result only with a certain probability, with this probability increasing as more iterations are allowed. The algorithm was first published by Fischler and Bolles at SRI International in 1981. They used RANSAC to solve the Location Determination Problem (LDP), where the goal is to determine the points in the space that project onto an image into a set of landmarks with known locations.
12/14/2016
Delaunay Triangulation
In mathematics and computational geometry, a Delaunay triangulation for a
set P of points in a plane is a triangulation DT(P) such that no point
in P is inside the circumcircle of any triangle in DT(P). Delaunay
triangulations maximize the minimum angle of all the angles of the
triangles in the triangulation; they tend to avoid skinny triangles.
Subscribe to:
Posts (Atom)

