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