Sunday, November 29, 2015

How to version large files with Git LFS

Versioning large files (such as audio samples, videos, datasets, and graphics) can be difficult when working with distributed version control systems like Git. Fortunately, a new extension to Git makes handling of large files easier: Git Large File Storage (LFS) is an open-source project that replaces large files with text pointers inside Git, while storing the contents of the files on a remote server like GitHub or an AWS bucket.

Friday, November 27, 2015

How to run Matlab on a remote machine

You would think that launching Matlab jobs through the SSH connection to a remote Unix machine is as easy as running any other command in a terminal. Instead, you might find yourself stuck with log files filled up with GB's worth of error messages like Warning: Error reading character from command line and Error: Bad file descriptor, even though your script does not require any user input at all. What to do?

You could either look up answers for each of the encountered problems individually, or you can use the following guide that tries to address all of the potential pitfalls conveniently in one place.

Thursday, November 26, 2015

Celebrate Thanksgiving with OpenCV and Python

Some virtual turkey for all the nerds out there: Enjoy 50% off the eBook version of OpenCV with Python Blueprints on the official Packt Publishing website. Offer ends November 30th.

Happy Thanksgiving!

Wednesday, November 25, 2015

How to enable tab completion on elements of lists and array-like objects in iPython (greedy completion)

One of iPython's most useful features is tab completion: You start typing the name of a variable / function / module, then hit the TAB key and let iPython show you a list of potential matches.

However, what if you want to do the same on an array-like object?

[In 1] my_array[0].

Ask a Swiss!

What you are looking for is called greedy completion, and can be enabled with a line-oriented magic function. These work much like OS command-like calls. You simply type them into an iPython console:

[In 2] %config IPCompleter.greedy = True

This will enable completion on elements of lists, results of function calls, etc.

However, be warned that enabling this option can be unsafe, because the code is actually evaluated upon hitting TAB. This is why the feature is disabled by default.