Backslash escaping is common in programming. Sometimes we may let a file go through a few filters or template engines, such as markdown, quik, etc. and things become even worse if we are writing the template files from a string which requires backslash escaping for any literal backslashes appearing in the string. On Windows, things are more horrible than on Unices (You know why, right? Hint: path separator). Then, if you need a “real” backslash in the final output, you may end up with four or eight or sixteen backslashes in the original file. This is horrible. To avoid this situation, I wrote a short preprocessing script in Python to double or quadruple or octuple or zzzuple your backslashes.
Homebrew and Macports are two excellent package managers on OS X. At most of the time, Homebrew is fair enough: it has a large package collections. But sometimes, there are just some packages not available in Homebrew while they are in Macports. Although having both of them installed is not recommended, I still want to give it a try.
The basic rules here are using Homebrew packages as much as possible. When one package is not available in Homebrew, install it from Macports (you will soon see why). We will wrap the executables installed by Macports with suitable Environmental Variables.
Vim, as a highly configurable and customizable editor, already has a powerful Vim-LaTeX plugin. However, I don't like the lack of live preview feature. For this reason, I developed a plugin called vim-latex-live-preview last year. Although it currently can't handle complex situations such as multiple tex files, it could basically handle single tex file project well (with or without BibLaTeX, thanks to Asis Hallab).
Note: This plugin currently doesn't work on Windows.
If you have multiple ssh keys, it is sometimes hard to manage. This was written before, but mostly they are handling using different keys with different host. What if you have two or more GitHub or BitBucket accounts requiring different keys? As a result, I created skm to provide a more general solution. Here I'll give a brief introduction of how to manage multiple SSH private keys with skm.
Mathematica is a famous computational software program in science, engineering, etc. However, the source code of Mathematica is usually stored in the format of Mathematica Notebook, which is hard to track with a Version Control System, such as git, mercurial, etc. Here I'm providing a solution to solve this problem.
If you are moving onto Mac OS X from Linux, you would probably find out that the command line tools shipped with Mac OS X are not as powerful and easy to use as the tools in Linux. The reason is that Mac OS X uses the BSD version command line tools, which are different from the Linux version, while they are both compliant with POSIX standards. But we can easily install the GNU tools by using Homebrew in Mac OS X and set them as default.
It is common for an scientific program to load an ASCII format matrix file, i.e. an ASCII text file consisting of lines of float numbers separated by whitespaces. In this post, I am gonna show my code (C++ and Python) to load a matrix from an ASCII file.
Chocolatey is a Machine Package Manager, somewhat like Apt, RPM but built with Windows. When you want to install a Windows application, with Chocolatey, what you need to do is to simply run a one line command – Chocolatey will automatically download and install this application for you. While there is an official guide on how to create and publish a package, this tutorial is simpler.
This post was updated on Feb 11, 2013, since the old way never works now. However, the original post is still available here.
Travis CI is a hosted continuous integration service for the open source community, helping run tests for your GitHub projects for every single push and pull request. However, by the time this post is written, Travis CI has not officially supported Jython, a Python interpreter written in Java. This post will help you setup a Jython testing environment for a Python project on Travis CI.
While Git is a powerful and popular Distributed Version Control System, Git's Submodule feature and Archive feature make Git even more powerful. However, the two features seems not working together well: Git's archive command does not provide a way to archive a Git repository and all of its submodules (yet). Fortunately, many scripts that could do this for us are available online, but not all of them work like a charm. After browsing the Internet and trying them one by one, I found this python script every useful. It has helped me and I believe it will also bring you luck.