Tutorial by Examples

To keep a container running in the background, supply the -d command line option during container startup: docker run -d busybox top The option -d runs the container in detached mode. It is also equivalent to -d=true. A container in detached mode cannot be removed automatically when it stops, t...
A Docker volume is a file or directory which persists beyond the lifetime of the container. It is possible to mount a host file or directory into a container as a volume (bypassing the UnionFS). Add a volume with the -v command line option: docker run -d -v "/data" awesome/app bootstrap....
Auto-implemented properties were introduced in C# 3. An auto-implemented property is declared with an empty getter and setter (accessors): public bool IsValid { get; set; } When an auto-implemented property is written in your code, the compiler creates a private anonymous field that can only be...
fn to_test(output: bool) -> bool { output } #[cfg(test)] // The module is only compiled when testing. mod test { use super::to_test; // This function is a test function. It will be executed and // the test will succeed if the function exits cleanly. #[test] fn...
Lets assume we have some Film model: public class Film { public string Title { get; set; } public string Category { get; set; } public int Year { get; set; } } Group by Category property: foreach (var grp in films.GroupBy(f => f.Category)) { var groupCategory = grp.Key; ...
You have started an interactive rebase. In the editor where you pick your commits, you decide that something is going wrong (for example a commit is missing, or you chose the wrong rebase destination), and you want to abort the rebase. To do this, simply delete all commits and actions (i.e. all lin...
Map<String, String> num = new HashMap<>(); num.put("one", "first"); if (num.containsKey("one")) { System.out.println(num.get("one")); // => first } Maps can contain null values For maps, one has to be carrefull not to confuse &quot...
Definition In software development, a breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. More generally, a breakpoint is a means of acquiring knowledge about a program during its execution. During the interruption, the programmer inspects th...
Overview In order to debug Java classes that are called during MATLAB execution, it is necessary to perform two steps: Run MATLAB in JVM debugging mode. Attach a Java debugger to the MATLAB process. When MATLAB is started in JVM debugging mode, the following message appears in the command wi...
The following code snippet shows how to open the Google Play Store Listing of your app in a safe way. Usually you want to use it when asking the user to leave a review for your app. private void openPlayStore() { String packageName = getPackageName(); Intent playStoreIntent = new Intent(I...
Constants are declared like variables, but using the const keyword: const Greeting string = "Hello World" const Years int = 10 const Truth bool = true Like for variables, names starting with an upper case letter are exported (public), names starting with lower case are not. // not e...
Swift supports the creation of custom operators. New operators are declared at a global level using the operator keyword. The operator's structure is defined by three parts: operand placement, precedence, and associativity. The prefix, infix and postfix modifiers are used to start an custom op...
Change Index Initialize or update a particular element in the array array[10]="elevenths element" # because it's starting with 0 3.1 Append Modify array, adding elements to the end if no subscript is specified. array+=('fourth element' 'fifth element') Replace the entire ar...
Sqoop ships as one binary package however it’s compound from two separate parts client and server. You need to install server on single node in your cluster. This node will then serve as an entry point for all connecting Sqoop clients. Server acts as a mapreduce client and therefore Hadoop must b...
This is the primary purpose of cat. cat file1 file2 file3 > file_all cat can also be used similarly to concatenate files as part of a pipeline, e.g. cat file1 file2 file3 | grep foo
To jump back to a previous commit, first find the commit's hash using git log. To temporarily jump back to that commit, detach your head with: git checkout 789abcd This places you at commit 789abcd. You can now make new commits on top of this old commit without affecting the branch your head is...
C++17 C++17 introduces structured bindings, which makes it even easier to deal with multiple return types, as you do not need to rely upon std::tie() or do any manual tuple unpacking: std::map<std::string, int> m; // insert an element into the map and check if insertion succeeded auto [i...
To get a verbose list of all devices connected to adb, write the following command in your terminal: adb devices -l Example Output List of devices attached ZX1G425DC6 device usb:336592896X product:shamu model:Nexus_6 device:shamu 013e4e127e59a868 device usb:337641472X produc...
Write the following command in your terminal: adb install [-rtsdg] <file> Note that you have to pass a file that is on your computer and not on your device. If you append -r at the end, then any existing conflicting apks will be overwritten. Otherwise, the command will quit with an error....
Write the following command in your terminal: adb shell getprop This will print all available information in the form of key/value pairs. You can just read specific information by appending the name of a specific key to the command. For example: adb shell getprop ro.product.model Here are a...

Page 127 of 1336