You intend to install LevelDB, but you don’t want to manually install & compile it as described here.
Instead, you just want to use the debian packaging system and some reproducible method of creating a DEB package from LevelDB.
Reasons for preferring not to compile & install manually could be:
- You want to deploy LevelDB to one ore more environments that don’t have a complete build environment
- You prefer a clean install-uninstall-purge package lifetime management
- You need a reproducible process to deploy LevelDB
You can list all codecs supported by
libavconv (the library used by
avconv) by using this command:
If you don’t have the
ffmpeg executable simply use
Note that avconv and ffmpeg are essentially the same, but the projects split at some time and then re-merged. Starting from Ubuntu 15.04, ffmpeg is available in the repositories again, whereas previously, ffmpeg was replaced by avconv.
For details, see this StackOverflow thread and this detailed post about the ffmpeg/libav situation.
Why trying to access your Android device using ADB, you encounter the following error:
error: insufficient permissions for device
You want to use
printf to print something to the
stderr stream (instead of stdout)
You want to use the
pmi tool from the
powermanagement-interface package, e.g. to standby your Linux computer using the command line, but you get an error message like this:
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files
You own a Toshiba Notebook and want to set LCD backlight brightness using the commandline.
You want to get the IPv4 and/or IPv6 addresses of the local computer’s network interfaces using NodeJS in an OS-independent manner.
You encounter a GCC error message of the form
error: declaration of ... shadows a parameter
Using fixed width integers is space-inefficient in many cases, especially if the majority of values are low and only use the less-significant bytes.
This guide describes the basics of varint (varying-length integer) encoding while focusing on C++ as programming language, but the basic concepts apply to any language.
Varint encodings use only the bytes that are needed to represent you integer value appropriately. A varint algorithm can represent the number 10 in only one byte while using 4 bytes to encode 800000000 (800 million). In many application this yields a significant overhead reduction since you would need to use larger integers if there is a slight change that your values grow beyond the boundary of the integer type that is applicable for the majority of your values. Additionally, you usually can only use 8,16,32 or 64 bit integers while 48 bit integers need to be coded manually in most languages. For example, if most of your values are between 0 and 100, but a few might be larger than 16384 (for unsigned integers), you would usually use a full 32-bit integer, even if most values could be represented by a single byte.
In more recent Ubuntu Versions, the minimize, maximize and close icons have moved to the left upper corner of the window.
If you want them to show up on the right side instead, follow this guide:
- Open a terminal (e.g. click on Ubuntu Dashboard and type Terminal, then click on Terminal)
- Copy and paste this text into the terminal (Ctrl+V doesn’t work here, use right-click -> insert)
gconftool-2 -s /apps/metacity/general/button_layout —type=string “menu:minimize,maximize,close”
- Press Return / Enter
- The icons should shift to the right immediately
You want to setup gitlab using Apache and unicorn (no passenger!), but it doesn’t work, no matter how hard you try.
You have a video file and want to encode it to support all three HTML5 codecs currently available (WebM, Theora and H.264) on the majority of devices.
This article describes basic operations in manipulating bitfields using boolean operations. Although this article focuses in Java, most programming languages use the same syntax.
What is a Bitfield?
All modern computers use binary arithmetic – that means, the most basic unit of information is a bit – it’s value can either be 0 or 1. On almost all hardware implementations of binary arithmetic, you can’t adress and modify bits directly, but you have to use bytes (= 8 bits). Bitfields are vectors of bits where each bit expresses a specific piece of information that can either be true or false. Depending on the application the bitfield can occupy more or less space.
Possible applications for bitfields include, but are not limited to Bloom Filters and Game artificial intelligences. In the latter case they are called bitboards if they represent a specific state in a game board.
You might also use words (2 bytes = short in most configurations), double words (4 bytes = int in most configurations) or quad words (8 bytes = long in most configurations) instead of single bytes for addressing. On 64-bit platforms, double words or quad words are usually most efficient but anything beyond quad words (i.e. 64 bits) needs more than one instruction in the CPU, which usually makes computation inefficient (there are some tricks involving SIMD, but this is beyond the scope of this article).