In this post I am going to provide some examples of Git usage that may come in handy in case of unsuccessful previous actions during staging, committing, and merging. Let’s say you have staged some files to be further committed with git add and then change your mind. To unstage all or some files, invoke the git reset command (which is in a way an inverse of git add). A scenario for all changed files:
rsync is an extremely useful utility for synchronizing files between remote computers. It is the primary tool I use to deploy code to targets such as servers, Raspberry Pies, or other remote Linux machines. In this post, I am going to show the basic rsync usage examples, break down the meaning of the widely-used options of the rsync command, and demonstrate the principles of deployment of files to an AWS EC2 instance using rsync with an SSH key.
Jupyter Notebook is a great tool for data science prototyping, visualization and sharing. The first code cell of every notebook I work on contains the following commands: %matplotlib inline %load_ext autoreload %autoreload 2 These are some of the IPython Magic commands – handy enhancements added on top of the standard Python syntax to solve various tasks specific to interactive computing. The first line in the snippet above configures the notebook session to visualize and store all the Matplotlib figures inside the notebook.
Python works great together with native code. The success of the Python data science stack is largely attributed to the capability of building native extensions. It is no secret, however, that the out-of-the-box C-based facilities are rather cumbersome to use. Luckily, there are a bunch of alternatives out there. The one I liked the most is Pybind11, a fork of Boost.Python with focus on the modern C++ standards. It is distributed as a lightweight header-only library that can be bundled with your project.
When it comes to building and installing OpenCV with Python support on *nix platforms, the collection of tutorials by Adrian Rosebrock is the best. He provides detailed description of the required steps, as well as motivation for better development practices. In particular, Adrian creates a dedicated virtualenv environment, installs NumPy in it, and builds the whole thing having this environment activated. Such a solution worked pretty well for me, both on Linux and macOS.
When working with GigE Vision cameras, it is important to be able to receive Ethernet frames of larger sizes than one gets in the default configuration. In particular, the default value of Maximum Transmission Unit (MTU) is 1500 bytes. By setting this parameter to the maximum (9000 bytes), a video streaming application handles smaller number of frames per second. This results in a decreased CPU load by cutting the number of operations for reconstructing image data from multiple small Ethernet frames.
It’s been a long time since I planned to start a blog where I would publish various technical tricks which I have experienced in my work. I had greatly benefited from the others’ contributions – in blogs, Stack Overflow, and open-source software – and it’s definitely a good idea to share my own knowledge in an organized way. The goal is to make this blog a useful and interesting resource, perhaps with more than just nerdy stuff.