Tutorial by Examples: er

Requirements: 64-bit version of Windows 7 or higher on a machine which supports Hardware Virtualization Technology, and it is enabled. While the docker binary can run natively on Windows, to build and host containers you need to run a Linux virtual machine on the box. 1.12.0 Since version 1.12 y...
Docker is supported on the following 64-bit versions of Ubuntu Linux: Ubuntu Xenial 16.04 (LTS) Ubuntu Wily 15.10 Ubuntu Trusty 14.04 (LTS) Ubuntu Precise 12.04 (LTS) A couple of notes: The following instructions involve installation using Docker packages only, and this ensures obtaining...
HandleFunc registers the handler function for the given pattern in the server mux (router). You can pass define an anonymous function, as we have seen in the basic Hello World example: http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Hello, w...
The simplest way to create an error is by using the errors package. errors.New("this is an error") If you want to add additional information to an error, the fmt package also provides a useful error creation method: var f float64 fmt.Errorf("error with some additional informatio...
In Go, an error is represented by any value that can describe itself as string. Any type that implement the built-in error interface is an error. // The error interface is represented by a single // Error() method, that returns a string representation of the error type error interface { Erro...
In Go you don't raise an error. Instead, you return an error in case of failure. // This method can fail func DoSomething() error { // functionThatReportsOK is a side-effecting function that reports its // state as a boolean. NOTE: this is not a good practice, so this example // tur...
In Go errors can be returned from a function call. The convention is that if a method can fail, the last returned argument is an error. func DoAndReturnSomething() (string, error) { if os.Getenv("ERROR") == "1" { return "", errors.New("The method fai...
The getAll() method retrieves all values from the preferences. We can use it, for instance, to log the current content of the SharedPreferences: private static final String PREFS_FILE = "MyPrefs"; public static void logSharedPreferences(final Context context) { SharedPreferences s...
/// <summary> /// This interface can do Foo /// </summary> public interface ICanDoFoo { // ... } /// <summary> /// This Bar class implements ICanDoFoo interface /// </summary> public class Bar : ICanDoFoo { // ... } Result Interface summary Clas...
Select your button (or whatever view you want to center) on the storyboard. Then click the align button on the bottom right. Select Horizontally in Container and Vertically in Container. Click "Add 2 Constraints". If it wasn't perfectly centered already, you may need to do one more thin...
5 <input type="number" value="0" name="quantity"> The Input element with a type attribute whose value is number represents a precise control for setting the element’s value to a string representing a number. Please note that this field does not guarantee to h...
Instantiate a XMLWriter object: $xml = new XMLWriter(); Next open the file to which you want to write. For example, to write to /var/www/example.com/xml/output.xml, use: $xml->openUri('file:///var/www/example.com/xml/output.xml'); To start the document (create the XML open tag): $xml-&gt...
When a method need to accept an "extensible" set of enum values, the programmer can apply polymorphism like on a normal class by creating an interface which will be used anywere where the enums shall be used: public interface ExtensibleEnum { String name(); } This way, any enum t...
2.2 let aString = "This is a test string." // first, reverse the String's characters let reversedCharacters = aString.characters.reverse() // then convert back to a String with the String() initializer let reversedString = String(reversedCharacters) print(reversedString) // &q...
Method 1: Below query will be applicable for SQL Server 2000+ version (Contains 12 columns) SELECT * FROM dbo.sysdatabases Method 2: Below query extract information about databases with more informations (ex: State, Isolation, recovery model etc.) Note: This is a catalog view and will be availa...
Introduction Interfaces are definitions of the public APIs classes must implement to satisfy the interface. They work as "contracts", specifying what a set of subclasses does, but not how they do it. Interface definition is much alike class definition, changing the keyword class to inter...
Default behaviour is when the merge resolves as a fast-forward, only update the branch pointer, without creating a merge commit. Use --no-ff to resolve. git merge <branch_name> --no-ff -m "<commit message>"
Even just reading the value of a pointer that was freed (i.e. without trying to dereference the pointer) is undefined behavior(UB), e.g. char *p = malloc(5); free(p); if (p == NULL) /* NOTE: even without dereferencing, this may have UB */ { } Quoting ISO/IEC 9899:2011, section 6.2.4 §2: ...
Functions can take inputs in form of variables that can be used and assigned inside their own scope. The following function takes two numeric values and returns their sum: function addition (argument1, argument2){ return argument1 + argument2; } console.log(addition(2, 3)); // -> 5 ...
x = [5, 5, 1, 3] y = [5, 2, 4, 3] Union (|) contains elements from both arrays, with duplicates removed: x | y => [5, 1, 3, 2, 4] Intersection (&) contains elements which are present both in first and second array: x & y => [5, 3] Difference (-) contains elements which ar...

Page 36 of 417