Too often I get confused with git when it comes to stashes. I tend to stash often, as I jump from a task to another or from a branch to another, but it already happened I forgot I stashed something. The stash grows and I don’t remember what each patch contains. Fortunately, I never really end up doing duplicate work, but this is doomed to happen if I don’t take appropriate measures.
I concocted this function and bash prompt to present (in proper color no less) the current amount of stashed items. This way I always know if I have stashes around
function git_stash_size {
lines=$(git stash list -n 100 2> /dev/null) || return
if [ "${#lines}" -gt 0 ]
then
count=$(echo "$lines" | wc -l | sed 's/^[ \t]*//') # strip tabs
echo " ["${count#} "stash] "
fi
}
# Comment in the above and uncomment this below for a color prompt
PS1='${debian_chroot:+($debian_chroot)}\[\033[04;34m\]\u\[\033[01;00m\]@
\[\033[04;34m\]\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\[\033[36m\]
$(__git_ps1 " (%s)")\[\033[00m\]\[\033[01;31m\]$(git_stash_size)\[\033[00m\]\$ '
I got around a problem in Qt designer that didn’t allow me to drop any widget. When I tried, I obtained the barred circle mouse pointer, instead of the plus. When dropped, the drop operation did not complete, and the receiving widget remained empty. Apparently, it’s due to some form of collision between designer and Unity (the graphic environment on Ubuntu). I switched to Gnome and now designer works. Note that I got it to work occasionally on Unity as well, but I was never able to reproduce the exact conditions that allowed it.
Those of you old enough to get internet connection with an empty can of beans connected to a string will probably remembered a coal-powered tool of the time, the modem. Its shrieks filled the beginning of an evening of bad GIFs, short web pages with <blink> tags, and plenty of telnet and IRC sessions. The memorable combination of sounds was a bit of a mystery to me, but I found this extremely interesting blog post detailing the negotiation phase, step by step, directly on the spectrogram. Worth checking out if you ever wondered what your modem was saying.
Maybe I should file a bug report on this, but it’s a nice example of lack of usability due to colliding needs: the need for a scrollbar in the terminal, and the need for window resizing.
As you can see, the popup scrollbar always follows the mouse pointer, making it impossible to get the resize operation. This happens in the bottom-right corner as well. The only way to perform resizing is to either use the top right corner, or to “trick” the scrollbar by moving the mouse pointer in a particular way, something made even more difficult by the fact that this area is one or two pixels wide.
This is so wrong from the usability point of view that I am surprised nobody caught it.
I really love this thing. It is a telepresence robot with a stabilizer (similar to a Segway) which mounts an iPad as a “face”. I have no use for it, yet I’d really love to have one. Now imagine having a full exoskeleton version…
Occasionally, my iSight stopped working, even in the middle of a Skype video session, with the camera in full control of Skype. Any effort to re-enable the camera failed with a “Camera in use by another application” message. I could not wrap my head around the issue, until I investigated a bit and I think I managed to understand what’s going on.
Occasionally, during video chat, Skype detaches from the camera in order to switch resolution, probably to scale it accordingly to current bandwidth conditions. During this split second, it may happen that the google talk browser plugin takes over the camera, and never relinquishes it. The camera is now stuck with google talk, Skype can’t grab it anymore, and so for all other camera applications. The only solution appears to be a reboot.
A few days ago I started playing with MPI, and I started wondering: “what’s the difference between mpiexec and mpirun?” It turns out that the distinction is mostly historical. In the first MPI specifications, there was nothing defining how the executables should run. Implementors of the specifications created an mpirun executable, but each implementation had different switches and different behavior. The MPI2 standard filled this gap, but it was not possible to merge the different implementor-dependent behaviors that became established in the meantime. The solution was to standardize the utility name as mpiexec. As a consequence, MPI2 compliant implementations will generally have both: mpiexec to honor the standard, and mpirun to honor compatibility with their previous implementation.
I recently became aware of this native Python package PyMySQL. The package has one important benefit vs. the other solutions to talk to a MySQL server, such as MySQLdb (AKA mysql-python) , namely, it reimplements the MySQL protocol, instead of binding to the MySQL connector library (also known as libmysqlclient). Why is this an issue? Well, because the MySQL connector library is GPL, and you can’t bind against GPL code unless your code is under a GPL-compatible license. This excludes all commercial uses, and makes all derivative works of libmysqlclient GPL as well, including the Python binding MySQLdb. If you thought about circumventing the problem using unixodbc, tough luck: the ODBC MySQL connector is also GPL, thus making unixodbc GPL as well.
Despite the low version number, PyMySQL, seems to be working, has no dependencies, it’s pure python, and it is released under the very liberal MIT license.
Apparently today February the 1st something happened in OSX so that Java plugins stopped working. I found the solution on the OSX forums at Apple, courtesy of user Shirkan79: you have to invoke the following command (on a single line)