Tutorial by Examples: ear

The case modifier causes the Scala compiler to automatically generate common boilerplate code for the class. Implementing this code manually is tedious and a source of errors. The following case class definition: case class Person(name: String, age: Int) ... will have the following code automati...
In oracle, the difference (in days and/or fractions thereof) between two DATEs can be found using subtraction: SELECT DATE '2016-03-23' - DATE '2015-12-25' AS difference FROM DUAL; Outputs the number of days between the two dates: DIFFERENCE ---------- 89 And: SELECT TO_DATE( '201...
Creates a image representing a linear gradient of colors. linear-gradient( 0deg, red, yellow 50%, blue); This creates a gradient going from bottom to top, with colors starting at red, then yellow at 50%, and finishing in blue.
You can search for man pages containing a particular string in their description using: man -k <string> For example: man -k unzip Might return: man -k unzip IO::Uncompress::Bunzip2(3pm) - Read bzip2 files/buffers IO::Uncompress::Gunzip(3pm) - Read RFC 1952 files/buffers IO::Uncom...
Assuming we want to modify bit n of an integer primitive, i (byte, short, char, int, or long): (i & 1 << n) != 0 // checks bit 'n' i |= 1 << n; // sets bit 'n' to 1 i &= ~(1 << n); // sets bit 'n' to 0 i ^= 1 << n; // toggles the value of bit 'n' Us...
Prerequisites In order to run Elasticsearch, a Java Runtime Environment (JRE) is required on the machine. Elasticsearch requires Java 7 or higher and recommends Oracle JDK version 1.8.0_73. Install Oracle Java 8 sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update echo "or...
pip assists in creating requirements.txt files by providing the freeze option. pip freeze > requirements.txt This will save a list of all packages and their version installed on the system to a file named requirements.txt in the current folder.
pip assists in creating requirements.txt files by providing the freeze option. pip freeze --local > requirements.txt The --local parameter will only output a list of packages and versions that are installed locally to a virtualenv. Global packages will not be listed.
Declare a BluetoothAdapter first. BluetoothAdapter mBluetoothAdapter; Now create a BroadcastReceiver for ACTION_FOUND private final BroadcastReceiver mReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); //...
Python has a variety of command-line switches which can be passed to py. These can be found by performing py --help, which gives this output on Python 3.4: Python Launcher usage: py [ launcher-arguments ] [ python-arguments ] script [ script-arguments ] Launcher arguments: -2 : Launch ...
Sometimes you need to keep a linear (non-branching) history of your code commits. If you are working on a branch for a while, this can be tricky if you have to do a regular git pull since that will record a merge with upstream. [alias] up = pull --rebase This will update with your upstream so...
This option allows you to clear a TLA for references and values at TLA allocation time and pre-fetch the next chunk. When an integer, a reference, or anything else is declared, it has a default value of 0 or null (depending upon type). At the appropriate time, you will need to clear these references...
When used with -XXallocClearChunkSize, this option sets the size of the chunks to be cleared. If this flag is used but no value is specified, the default is 512 bytes. Usage: -XXallocClearChunks -XXallocClearChunkSize=<size>[k|K][m|M][g|G]
strpos can be understood as the number of bytes in the haystack before the first occurrence of the needle. var_dump(strpos("haystack", "hay")); // int(0) var_dump(strpos("haystack", "stack")); // int(3) var_dump(strpos("haystack", "stackoverf...
Prerequisites The Windows version of Elasticsearch can be obtained from this link: https://www.elastic.co/downloads/elasticsearch. The latest stable release is always at the top. As we are installing on Windows, we need the .ZIP archive. Click the link in the Downloads: section and save the file t...
A landmark region that contains a collection of items and objects that, as a whole, combine to create a search facility. <div role="search"> <input role="searchbox" type="text"> <button role="button">Search</button> </div>...
A type of textbox intended for specifying search criteria. <div role="search"> <input role="searchbox" type="text"> <button role="button">Search</button> </div>
Vim supports the use of regular expressions when searching through a file. The character to indicate that you wish to perform a search is /. The simplest search you can perform is the following /if This will search the entire file for all instances of if. However, our search if is actually a r...
Following statement matches all records having FName that starts with a letter from A to F from Employees Table. SELECT * FROM Employees WHERE FName LIKE '[A-F]%'
In case you need to read an array elements avoiding repetitions you case use the #uniq method: a = [1, 1, 2, 3, 4, 4, 5] a.uniq #=> [1, 2, 3, 4, 5] Instead, if you want to remove all duplicated elements from an array, you may use #uniq! method: a = [1, 1, 2, 3, 4, 4, 5] a.uniq! #=> [1...

Page 5 of 21