Tutorial by Examples: sin

Some collection types can be initialized at the declaration time. For example, the following statement creates and initializes the numbers with some integers: List<int> numbers = new List<int>(){10, 9, 8, 7, 7, 6, 5, 10, 4, 3, 2, 1}; Internally, the C# compiler actually converts this...
All of these main method styles can also be used with varargs: package my.program fun main(vararg args: String) { println("Hello, world!") }
As always, you need to make sure you have the required permissions. public class MainActivity extends AppCompatActivity implements LocationListener{ private LocationManager mLocationManager = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCr...
As always, you need to make sure you have the required permissions. public class MainActivity extends AppCompatActivity implements LocationListener{ private LocationManager mLocationManager = null; HandlerThread mLocationHandlerThread = null; Looper mLocationHandlerLooper = null; ...
RSA can be used to create a message signature. A valid signature can only be generated with access to the private RSA key, validating on the other hand is possible with merely the corresponding public key. So as long as the other side knows your public key they can verify the message to be signed by...
Asymmetric encryption has the advantage that a message can be encrypted without exchanging a secret key with the recipient of the message. The sender merely needs to know the recipients public key, this allows encrypting the message in such a way that only the designated recipient (who has the corre...
Use list() to quick assign a list of variable values into an array. See also compact() // Assigns to $a, $b and $c the values of their respective array elements in $array with keys numbered from zero list($a, $b, $c) = $array; With PHP 7.1 (currently in beta) you will be able to use s...
Create a set local set = {} -- empty set Create a set with elements by setting their value to true: local set = {pear=true, plum=true} -- or initialize by adding the value of a variable: local fruit = 'orange' local other_set = {[fruit] = true} -- adds 'orange' Add a member to the ...
This analyzes a python script and, for each defined function, reports the line number where the function began, where the signature ends, where the docstring ends, and where the function definition ends. #!/usr/local/bin/python3 import ast import sys """ The data we collect. ...
The same example above, Image loading, can be written using async functions. This also allows using the common try/catch method for exception handling. Note: as of April 2017, the current releases of all browsers but Internet Explorer supports async functions. function loadImage(url) { return...
The getaddrinfo() function is the recommended POSIX function for interfacing with the system resolver. Depending on system configuration it will perform name lookups in the DNS, /etc/hosts, mDNS, etc. It is preferred over the deprecated gethostbyname() family of functions because it supports both ...
Following are the Prerequisites for installing Cookiecutter: pip virtualenv PostgreSQL Create a virtualenv for your project and activate it: $ mkvirtualenv <virtualenv name> $ workon <virtualenv name> Now install Cookiecutter using: $ pip install cookiecutter Change dire...
Server-Side JavaScript Native JSON Samplestack Sample Application Temporal Documents REST Management API Improvements More Semantics Features, Including SPARQL 1.1, Inferencing, and SPARQL UPDATE Node.js Client API REST and Java Client API Improvements Enhanced HTTP Server Features Flexi...
The Symbol.for method allows you to register and look up global symbols by name. The first time it is called with a given key, it creates a new symbol and adds it to the registry. let a = Symbol.for('A'); The next time you call Symbol.for('A'), the same symbol will be returned instead of a new o...
Bootstrapping Magento by calling: require_once 'app/Mage.php'; Mage::app(); // Your code This is the simplest way but not really the Magento way because we're not using class that extends Mage_Shell_Abstract - the class which when extended provides us with tools to parse command line arguments...
Magento way File resides in shell/custom.php <?php require_once' abstract.php'; class Stackoverflow_Shell_Custom extends Mage_Shell_Abstract { protected $_argname = array(); public function __construct() { parent::__construct(); // Time limit to infinity ...
The std::nth_element algorithm takes three iterators: an iterator to the beginning, nth position, and end. Once the function returns, the nth element (by order) will be the nth smallest element. (The function has more elaborate overloads, e.g., some taking comparison functors; see the above link for...
The canonical way of writing code inside documentation is with the {@code } construct. If you have multiline code wrap inside <pre></pre>. /** * The Class TestUtils. * <p> * This is an {@code inline("code example")}. * <p> * You should wrap it in pre tags...
We can create a better mapper classes with extension methods, Suppose if i have some DTO classes like public class UserDTO { public AddressDTO Address { get; set; } } public class AddressDTO { public string Name { get; set; } } and i need to map to corresponding v...
The following query returns the documents which have an element named "company" - cts:element-value-query( xs:QName('company'), '*', ("wildcarded"))) The following query returns the documents which have an element named "company" with an attribute named "name&...

Page 90 of 161