Unable to parse command history line in MATLAB

Problem

Everytime I start MATLAB it reports an error in my command history with the error message: Unable to parse command history line

Solution

Open the file History.xml in the MATLAB Preferences directory. You can find this directory using the command prefdir. Either find the offending entry in this XML file and delete it or just delete the entire file itself.

Tried with: MATLAB R2014a and Ubuntu 14.04

AC_PROG_LIBTOOL error

Problem

I was trying to build GPerfTools by running its autogen.sh script when I got this error:

$ ./autogen.sh 
configure.ac:154: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

Solution

I was mistaken in thinking that AC_PROG_LIBTOOL was referring to some generic library tool. Actually, there is a GNU LibTool script that is used to build libraries.

To install it:

$ sudo apt install libtool

The build worked fine after installing this package.

Tried with: Ubuntu 14.04

Menu not visible in Zeal

Problem

I installed Zeal as described here. When I opened Zeal, the main menu was not visible!

Solution

This is a problem caused by the integrated menu bar used by Qt5. As described here, removing the appmenu-qt5 solves this problem immediately:

$ sudo apt-get remove appmenu-qt5

Tried with: Ubuntu 14.04

Invalid MEX-file error in Matlab

Problem

Running a Matlab script threw this error:

Invalid MEX-file '/home/joe/do_work.mexa64':/usr/local/matlabR2014b/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version 'GLIBCXX_3.4.19' not found (required by /home/joe/do_work.mexa64).

This error is surprising since do_work.mexa64 was built using Matlab using the same system and same environment settings.

Solution

There is a difference in the glib version between the compiled and running environment. When the do_work.mexa64 was built, the libstdc++.so.6 from /usr/lib/x86_64-linux-gnu/ was used since it was first in LD_LIBRARY_PATH. However, when the script is run by Matlab, it picks up its own libstdc++.so.6 file as explained here!

A simple solution to this problem is to remove or rename the Matlab version of libstdc++.so.6, so that it is not picked up.

Tried with: Ubuntu 14.04

Django core management error

Problem

I ran the Django manage.py script and got this error:

ImportError: No module named django.core.management

Solution

The error message gives no indication of the true cause. This was required to be executed in a virtualenv and I had not activated the virtualenv, hence the error. It went away when I ran it after activating the virtualenv.

WinUSB Exit Code Error

Problem

I was using WinUSB to create a bootable Windows USB disk. I chose the Windows ISO file and the USB thumb drive to write it to. I chose Install, WinUSB asked for my password and failed with this error: Exit Code: 256

Solution

The same procedure worked fine on one Ubuntu computer, but failed on another. This really puzzled me.

In any case, I ran the program from the shell with superuser permissions:

$ sudo winusbgui

This worked fine without any problem!

Tried with: WinUSB 1.0.11 and Ubuntu 15.10

Thrust error on min_element or max_element

Problem

I was compiling some old CUDA code with a recent version of the CUDA SDK. I got these errors on Thrust methods:

error: namespace thrust has no member max_element
error: namespace thrust has no member min_element

Solution

In recent versions of CUDA SDK, these Thrust methods have been moved to the extrema.h header file. These errors will go away if you include the thrust/extrema.h header file.

Tried with: CUDA SDK 7.5 and Ubuntu 14.04

Firefox does not scroll when selecting text

Problem

I run into so many small, but irritating problems in UI of programs that I wonder if I am the only one affected by them! Here is another one that took a while to figure out.

Someone had sent me a long email that was many pages long. I had it open in Gmail in Firefox. I needed to copy a large portion of this email and paste it into another document.

Ctrl + A to Select All was not a solution since that selects all the text being displayed, including sections of the Gmail UI. A common solution in this situation it to put the mouse cursor at the start of the text, press down the Left button, drag mouse down until it hits the screen bottom and keep dragging until I reach end of the text I want. This highlights and selects the text portion I want and I can now right-click and choose Copy or press Ctrl + c to copy it.

The strange problem was that, this did not work! Keeping Left mouse button pressed I could drag until screen bottom, but the page would not scroll up allowing me to choose the rest of the text!

Solution

It turns out that this happens only in Firefox on Ubuntu. It will only happen when Firefox is shown in a maximized or fullscreen window.

What is happening is that when the mouse cursor is dragged to hit the screen bottom, something in Firefox UI is not indicating that the cursor is trying to move out of the window. Thus, the webpage is not scrolling.

Turns out that this is a known bug, reported here in 2011. Four years on, a good solution is still being debated on.

Until it is fixed, the solution is simple: unmaximize or restore your Firefox window so that it is not fullscreen or maximized. Now try the copy operation, the webpage will scroll and it will work! Voila!

Tried with: Firefox 42 and Ubuntu 14.04

icu.InvalidArgsError

Problem

I tried running gcalcli and got this error:

$ gcalcli
Traceback (most recent call last):
  File "/usr/bin/gcalcli", line 392, in <module>
    class gcalcli:
  File "/usr/bin/gcalcli", line 410, in gcalcli
    dateParser    = DateTimeParser()
  File "/usr/bin/gcalcli", line 335, in __init__
    self.pdtCalendar = parsedatetime.Calendar();
  File "/usr/lib/python2.7/dist-packages/parsedatetime/__init__.py", line 216, in __init__
    self.ptc = Constants()
  File "/usr/lib/python2.7/dist-packages/parsedatetime/__init__.py", line 1733, in __init__
    self.locale = pdtLocales['icu'](self.localeID)
  File "/usr/lib/python2.7/dist-packages/parsedatetime/pdt_locales.py", line 151, in __init__
    self.icu = pyicu.Locale(localeID)
icu.InvalidArgsError: (<type 'icu.Locale'>, '__init__', (None,))

Solution

This is a well known bug in the parsedatetime package as described here.

The solution is to remove the package installed from Ubuntu archives and install a recent version of it from the Python Package Index:

$ sudo apt-get remove python-parsedatetime

$ sudo pip install --upgrade parsedatetime

Tried with: Ubuntu 14.04

Min or max error in C++

Problem

C++ code using the std::min and std::max can fail with a cryptic error message when compiled with Visual Studio on Windows:

error C2589: '(' : illegal token on right side of '::'

Solution

This is caused if you are including windows.h. That header defines these as old-style macros.

To indicate that these macros not be defined, define NOMINMAX before including that header:

#define NOMINMAX
#include <windows.h>

Tried with: Visual Studio 2015 and Windows 7 x64