Tutorial by Examples

Collections in Java only work for objects. I.e. there is no Map<int, int> in Java. Instead, primitive values need to be boxed into objects, as in Map<Integer, Integer>. Java auto-boxing will enable transparent use of these collections: Map<Integer, Integer> map = new HashMap<&g...
public static class ArrayHelpers { public static bool Contains<T>(this T[] array, T[] candidate) { if (IsEmptyLocate(array, candidate)) return false; if (candidate.Length > array.Length) return false; for (int a = 0; a <...
redis-cli is the Redis command line interface program that allows to send commands to Redis and read the replies sent by the server, directly from the terminal. Basic command line usage is below: Access to redis: $ redis-cli 127.0.0.1:6379> Access to redis with authentication: $ redis-cli ...
The dir() function can be used to get a list of the members of a class: dir(Class) For example: >>> dir(list) ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__...
Notice that packages can be installedThis command installs the newest available version of the named packages: both locally or globally. Local installation means that npm installs your package in the current working directory. Node modules go in ./node_modules, executables go in ./node_modules/.bi...
The trim() method returns a new String with the leading and trailing whitespace removed. String s = new String(" Hello World!! "); String t = s.trim(); // t = "Hello World!!" If you trim a String that doesn't have any whitespace to remove, you will be returned the same S...
If efficiency is important, a fast way to iterate over pixels in a cv::Mat object is to use its ptr<T>(int r) method to obtain a pointer to the beginning of row r (0-based index). According to the matrix type, the pointer will have a different template. For CV_8UC1: uchar* ptr = image.ptr&...
To use Cython two things are needed.The Cython package itself, which contains the cython source-to-source compiler and Cython interfaces to several C and Python libraries (for example numpy). To compile the C code generated by the cython compiler, a C compiler is needed. Step 1: Installing Cython ...
By default, most of the information is hidden from the user. You can use -v switches to get a verbose log of the connection attempt, which will usually pinpoint the problem by showing why the behavior is different than you expect. Let's assume you are connecting to the server example.com using ssh ...
ISO/ANSI SQL: SELECT Id, Col1 FROM TableName ORDER BY Id OFFSET 20 ROWS MySQL: SELECT * FROM TableName LIMIT 20, 42424242424242; -- skips 20 for take use very large number that is more than rows in table Oracle: SELECT Id, Col1 FROM (SELECT Id, Col1, row_num...
ISO/ANSI SQL: SELECT * FROM TableName FETCH FIRST 20 ROWS ONLY; MySQL; PostgreSQL; SQLite: SELECT * FROM TableName LIMIT 20; Oracle: SELECT Id, Col1 FROM (SELECT Id, Col1, row_number() over (order by Id) RowNumber FROM TableName) WHERE RowNumber <= 2...
ISO/ANSI SQL: SELECT Id, Col1 FROM TableName ORDER BY Id OFFSET 20 ROWS FETCH NEXT 20 ROWS ONLY; MySQL: SELECT * FROM TableName LIMIT 20, 20; -- offset, limit Oracle; SQL Server: SELECT Id, Col1 FROM (SELECT Id, Col1, row_number() over (order by Id) RowNumbe...
See also the Mercurial Tutorial Creating a Mercurial Repository A Mercurial repository is simply a directory (referred to as the "working directory") containing an .hg directory with metadata about the contents of the repository. This makes Mercurial very lightweight and easy to start us...
Mercurial makes it easy to share your work, and to pull in contributions from other developers. This involves three key steps; cloning, pulling, and pushing. Clone To copy a remote repository to your local disk you "clone" it. To do so simply pass the remote URL you'd like to clone from....
DESCRIBE and EXPLAIN are synonyms. DESCRIBE on a tablename returns the definition of the columns. DESCRIBE tablename; Exmple Result: COLUMN_NAME COLUMN_TYPE IS_NULLABLE COLUMN_KEY COLUMN_DEFAULT EXTRA id int(11) NO PRI 0 ...
android { ... defaultConfig {...} buildTypes {...} productFlavors { demo { applicationId "com.example.myapp.demo" versionName "1.0-demo" } full { applicationId "com.example.myapp.full"...
In this example, we have a Countries table. A table for countries has many uses, especially in Financial applications involving currencies and exchange rates. Live example: SQL fiddle Some Market data software applications like Bloomberg and Reuters require you to give their API either a 2 or 3 ch...
Options have some useful higher-order functions that can be easily understood by viewing options as collections with zero or one items - where None behaves like the empty collection, and Some(x) behaves like a collection with a single item, x. val option: Option[String] = ??? option.map(_.trim) ...
<?php /** * Panel: WPCustomize * * Basic Customizer panel with basic controls. * * @since 1.0.0 * @package WPC */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } // Customize function. if ( ! function_exists( 'wpc_panel_wpcustomize' ) ) { ...
Panels can have sections, sections can have settings, and settings can have controls. Settings are saved in the database, while the controls for particular settings are only used to display their corresponding setting to the user. This code creates a basic section in the panel from above. Inside a...

Page 377 of 1336