Currently, I experiment with a possibility to backup the whole filesystem to a single compressed file. During the backup process, I want to conveniently preview the directory structure which will be actually backed up.
How to correctly handle the file access permissions our application gets after the user chooses a file using the file chooser?
It is possible to get this working in Arch Linux quite easily.
How to use a compositor to improve window manager performance and redrawing, but without adding any visual effects or animations.
This is how I install Arch Linux with a minimal graphical environment - Openbox as a window manager, tint2 as panel, and some tray icons (network, sound and removable disk devices).
This is how I remapped a mouse button to do the same action as the mouse wheel click (because that other button was way more convenient to press than the mouse wheel).
My app was receiving a large binary file which was not sorted nor indexed in any way. Here I show how I searched in the file as fast as possible.
By default, the i3 tiling window manager allows switching workspaces on each monitor separately. We can achieve switching the workspace at all monitors at once, so that we will have something like multi-monitor workspaces instead.
There are 2 clipboard-like mechanisms in Linux - primary selection (copy by selecting text and paste by middle mouse button) and clipboard selection (copy by CTRL+C, paste by CTRL+V). Since I prefer using only the latter, I wanted to completely disable the primary selection.
When serializing using the
Newtonsoft.Json library, we can specify a custom
ContractResolver to e.g. make the properties appear to have a different name. We can use this possibility to shorten the key names.
Install the tools
This is a specific example of using custom layout in Android.
After taking a screenshot in instrumentation tests, we often need it to be transferred back to the host computer. Here I explain different approaches I found.
If it is difficult to gain the desired effect using some standard layout (
GridLayout etc.) or a combination of them, it is relatively easy to programmatically create a custom layout class.
Older Android versions used a separate button to open a menu (which was then replaced by the action bar and its overflow menu). When testing applications using an emulator with some old Android, we often want to somehow access the menu. The emulators used to provide a button for this, but such buttons were shown only in a specific skin: Skin with dynamic hardware controls.
In Android 7 (maybe older versions, too), at least on Nexus phones, there is a file manager with some basic functionality.
Committed to master branch by mistake? Do not solve it by branching off a feature branch and then reverting that commit on master. You will lose changes in that commit - they will not be merged back from the feature branch.
A good habit is to begin each bash script with:
To implement a custom input stream in Java, the only mandatory method to implement is
read(). However, a stream with only
read() implemented can perform very badly.
How to convert strings in C++ between Unicode encodings (UTF-8, UTF-16 and UTF-32)? Here are some code snippets showing easiest ways I found out yet.
Similarly to Microsoft Visual Studio compiler, gcc and Clang compilers support precompiled headers, too. Let’s look at creating and using of a precompiled header in clang compiler, particularly at chaining of precompiled headers (building a precompiled header using another precompiled header compiled earlier).
This post is mostly inspired by facts summarised at utf8everywhere.org.
In Git, rebasing can be used instead of merging to integrate changes from another branch.
When rethrowing an exception in C++, there can really be a difference between