In this section I will collect short things that have taken me some time to figure out. The intent is that I would be able to avoid wasting time in the future after I have forgotten about them.
11.12.2017
When using Biber in LatexTools in Sublime Text, bibliography is not shown.
From the settings of LatexTools, set use_biblatex
to true
, and set builder
to basic
. In the Latex source, use \addbibresource{bibliography.bib}
to add bibliographies, and \printbibliography
to include the bibliography.
06.12.2017
CMake does not recognize the change in compiler, say from Clang to gcc.
You need to delete both of CMakeCache.txt
and CMakeFiles
, and then run CMake again.
06.12.2017
Pastel does not compile with gcc-7.2
, hitting an internal compiler error in PASTEL_ARG_SC
.
Revert to an earlier compiler; gcc-5.4
works.
26.06.2017
After pushing to a Bitbucket repository, Mercurial shows the commits in draft status.
Go to Bitbucket’s repository settings, and uncheck “This is a non-publishing repository”.
15.06.2016
When using the Armadillo linear algebra library in a Matlab mex-file in Linux Mint 18, running the file gives a segmentation fault in Matlab.
Under Linux, the system’s BLAS library is confused with Matlab’s BLAS library. The segmentation fault occurs because of using different bit-widths for integers. A solution that worked for me is to define ARMA_BLAS_LONG_LONG
in the C++ compiler flags. See more here
15.06.2017
When compiling against an older version of libc++
, you get an error like this:
error: 'basic_string<_CharT, _Traits, _Allocator>' is missing exception specification
'noexcept(is_nothrow_copy_constructible<allocator_type>::value)'
basic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)
This is a bug in libc++
that has since been fixed; see here. Either find a newer version of libc++
, or use GNU’s libstdc++
instead.
15.06.2017
When running Matlab 2015a in Linux Mint 18, you get a segmentation fault with just basic use.
Matlab contains conflicting versions for the C++ Standard Library. There is a package to fix this:
sudo apt install matlab-support
The package replaces files in the Matlab installation with proper ones. This is from here.
15.06.2017
After installing Linux Mint in VirtualBox, you cannot share folders with the host, because you don’t have permissions.
Add yourself to the vboxsf group:
sudo gpasswd -a username vboxsf
01.06.2017
You want to create a pure Html+Javascript+Css project in Visual Studio 2017.
Choose the New Web Site
command from the File menu, and select ASP .NET Empty Web Site
. This project type is missing from New Project
.
26.04.2017
Concerning the paper “Estimation of Information Theoretic Measures for Continuous Random Variables”, Fernando PĂ©rez-Cruz, Advances in Neural Information Processing Systems 21, Proceedings of the Twenty-Second Annual Conference on Neural Information Processing Systems, Vancouver, British Columbia, Canada, December 8-11, 2008.
The proofs in this paper are flawed. The proofs appeal to the (classical) strong law of large numbers, which is not applicable since the averaged random variables are not independent. The probabilities under the k-neighbor balls are dependent on each other, and in particular the probability in a k-neighbor ball depends on the whole sample set, not just the center point of the search as is suggested by the notation. This dependency is the exact source of difficulty when analysing algorithms based on k-nearest neighbors.
As far as I know, the result claimed in the paper, almost-sure convergence, has not yet been proved for all distributions. A very general result for almost-sure convergence, under certain assumptions on the distribution, is “A law of large numbers for nearest neighbour statistics”, Dafydd Evans, Proc. R. Soc. A 2008 464 3175-3192, 2008.
14.03.2017
You want to use the latest gcc
on Linux Mint.
See here.
14.03.2017
After installing Linux Mint in VirtualBox, Mint warns about reverting to software rendering.
See here.
14.03.2017
Live account requires to give a non-empty last name, which you don’t want to give.
Use an invisible Unicode character, such as U+202A Left to Right Embedding
. This is from here.
14.03.2017
Visual Studio Feedback tool shows your real name in feedback.
There is a separate account for Visual Studio, which contains its own information in addition to the main Live-account. This accout is required to use Visual Studio Community. Change the name in the Visual Studio account.
10.03.2017
You want to use a generalized trigger ref{
for label-searching in LatexTools, while currently it is triggered by \ref{
.
Add the following into Sublime Text’s key bindings:
{
"keys": ["{"],
"command": "latex_fill_all",
"args": {
"completion_type": "ref",
"insert_char": "{"
},
"context":
[
{ "key": "selector", "operator": "equal", "operand": "text.tex.latex - comment" },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "ref$" },
],
},
This is from here.
10.03.2017
With a recent update, Latexing plug-in for Sublime Text stopped working, meaning that the default syntax cleans the files instead of building them. I tried to work around this bug by selecting another syntax, but then I was hit by other bugs, which made inverse search fail. Unfortunately, Sublime Text does not allow to downgrade packages, and so I was stuck.
Switch to the LatexTools package instead, which is better supported, and has a larger community.
10.03.2017
I tried the Atom text editor on Windows today. It is a nice editor when looking at features and extensibility. The problem is that it has noticeable lag in almost every action, from selecting text to inverse-searching pdfs when building Latex files. This is something I cannot get over.
09.03.2017
You have both Python 2 and Python 3 installed on Windows. You have a Python script foo.py
installed using pip3
, which works on both Python 2 and Python 3. The foo.py
is on the path. Running foo.py
launches Python 2, which then states being unable to find a module related to foo.py
, since those modules are stored with Python 3.
Make sure that only one of the Python script directories on the path, and make it the same as the default Python interpreter.
09.03.2017
You want to create an empty file.
On the command-line, write
copy NUL empty.txt
09.03.2017
You would like to upload a new version into PyPi, with two different formats such as .zip
and .gztar
. However, upload fails with
error: Upload failed (400): Duplicate file upload detected.
Only upload the .zip
file. Somewhere along the way, PyPi was changed so that the extensionless names of the files must be unique.
09.03.2017
While WSL was running, I tried to change a directory in Windows command-line, and then dir
that. Command-line automatically changed the directory to the `C:\Users\Kaba" directory and listed the contents of that.
Close the Windows Subsystem for Linux. Perhaps restart the computer.
09.03.2017
The language is not english, although my Windows is.
To change the language:
sudo update-locale LANG=en_US.UTF8
09.03.2017
After installing Windows Subsystem for Linux, running sudo
says
sudo: unable to resolve host (none)
Add the name of the PC to /etc/hosts
:
127.0.0.1 KABA-PC
12.11.2017
On Latexing 1.2.20 on Sublime Text on Windows, choosing the syntax as “Latexing” fails to build the document when pressing Ctrl+B
. Instead, Latexing runs a clean-up, deleting all temporary files.
A workaround is to choose another syntax, such as “Latexing (Tikz)” as the default for .tex
files. Another solution is to press Ctrl+L+B
to get to a menu and explicitly choosing to build. I have reported this bug here.
11.02.2017
When trying to animate a plot as in
Animate[Plot[PDF[BetaDistribution[3, n], x], {x, 0, 1}, PlotRange -> {0, 40}], {n, 1, 100}]
Mathematica 11 fails to show the animation, providing an error about being unable to show dynamic content.
Turning of the suggestion bar from the preferences removes the problem. This is from here.
31.01.2017
When trying to install Pillow 3.4.2 on Linux, installation fails because the developer libraries of zlib
and libjpeg
are missing.
Install both libraries:
sudo apt-get install libjpeg-dev zlib1g-dev
16.01.2017
In numpy, the eigenvalue-decomposition of an almost-diagonal matrix will not produce an orthogonal matrix of eigenvectors:
import numpy
a = 7599.9393278410407
b = 7.198527976045102e-13
c = 7599.9393278410489
A = [[a, b], [b, c]]
s, u = numpy.linalg.eig(A)
print(u.T.dot(u))
The same problem was present in at least the following builds:
numpy-1.11.3+mkl-cp35-cp35m-win32.whl
numpy-1.12.0+mkl-cp35-cp35m-win32.whl
Since my matrix was symmetric, I could use the specific symmetric version eigh
instead. This fixed the problem. My guess is that the non-symmetric eigenvalue-decomposition is badly conditioned, with the condition number being related to the minimum distance between eigenvalues. But perhaps that is not the case, and the problem is in the algorithm. Both numpy and Matlab use LAPACK for computations. Matlab does not have the problem, because it automatically selects the symmetric version based on the matrix. I reported the issue for numpy here and then to the LAPACK bulletin board.