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.
GitHub users may have this experience: after reporting an issue for a project on GitHub, you suddenly found a solution to fix it. Then you want to attach a pull request to this issue, but by the time this article is written, GitHub does not provide a web interface to attach a pull request to an issue. However, no such web interface does not mean it's impossible – a command line tool called hub could help you out.
When using ctags to generate the tags file for C/C++ projects, usually we use the following command:
ctags -R .
For some users that need more info of the symbols, they may use this command instead:
ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
No matter which one you use, the generated tags file only contains the symbols in the files in your project source tree, but not any external file, such as standard header files (e.g. stdio.h, stdlib.h), etc. thus editors or IDEs that use tags files, such as Vim, are not able to locate symbols in external header files. There was a solution: generate a tags file for any external header files first, and let the editor or IDE read both the generated tags file and the tags file for the project source tree. For example, the following command will generate a tags file for all your system header files on UNIX/Linux:
ctags -R --c++-kinds=+p --fields=+iaS --extra=+q /usr/include
This command usually takes a very long time to finish, and finally it gives a quite large tags file, which causes the editor or IDE a long time to search this tags file for symbols. To solve this problem, I came up with another idea.
Why must we generate a tags file containing all the symbols in the system header? If we only generate the tags file only for the header files that are related to our projects, would it be faster? That's the point of this idea. We could first search for the header files that are included in our projects, and then we use ctags to generate a tags file for these files and our source files, in this way, a much smaller tags file that containing all the symbols that maybe useful for the project is generated.
Usually for a project with more than one developer involved, it is essentially
important for the project to define and maintain a consistent coding style.
Most code editors and IDEs, such as Vim, Emacs, Code::Blocks,
provide settings related to coding styles, such as the width of tab, the size of
indentation, end of line, etc. However, it is hard to provide the same settings
for different Editors and IDEs: we have to maintain many config files for
different editors and IDEs, such as .vimrc for Vim, .emacs for
Emacs. In order to solve this, EditorConfig was born. By defining coding
style in files named
.editorconfig, the EditorConfig plugins for different
editors and IDEs will automatically adjust your coding style.