Tutorial by Examples

-- File counter.vhd -- The entity is the interface part. It has a name and a set of input / output -- ports. Ports have a name, a direction and a type. The bit type has only two -- values: '0' and '1'. It is one of the standard types. entity counter is port( clock: in bit; -- We ...
There are many ways to print the classical "Hello world!" message in VHDL. The simplest of all is probably something like: -- File hello_world.vhd entity hello_world is end entity hello_world; architecture arc of hello_world is begin assert false report "Hello world!&quo...
es = Elasticsearch(hosts=hosts, sniff_on_start=True, sniff_on_connection_fail=True, sniffer_timeout=60, sniff_timeout=10, retry_on_timeout=True)
If you need to copy a database from one server to another, you have two options: Option 1: Store the dump file in the source server Copy the dump file to your destination server Load the dump file into your destination server On the source server: mysqldump [options] > dump.sql On th...
Below is example of service decorator, overriding null date returned by service. angular.module('app', []) .config(function($provide) { $provide.decorator('myService', function($delegate) { $delegate.getDate = function() { // override with actual date object return new Date(...
The standard Ada programming language is defined in the Ada Reference Manual. Interim version changes and release notes are discussed in the corresponding rationale documents. Implementations typically document their compliance with the standard in the form of a user guide and/or reference manual, f...
To remove all elements from a Map, use the .clear() method: map.clear(); Example: const map = new Map([[1, 2], [3, 4]]); console.log(map.size); // 2 map.clear(); console.log(map.size); // 0 console.log(map.get(1)); // undefined
To remove an element from a map use the .delete() method. map.delete(key); Example: const map = new Map([[1, 2], [3, 4]]); console.log(map.get(3)); // 4 map.delete(3); console.log(map.get(3)); // undefined This method returns true if the element existed and has been removed, otherwise fal...
To check if a key exists in a Map, use the .has() method: map.has(key); Example: const map = new Map([[1, 2], [3, 4]]); console.log(map.has(1)); // true console.log(map.has(2)); // false
Map has three methods which returns iterators: .keys(), .values() and .entries(). .entries() is the default Map iterator, and contains [key, value] pairs. const map = new Map([[1, 2], [3, 4]]); for (const [key, value] of map) { console.log(`key: ${key}, value: ${value}`); // logs: // ke...
Use .get(key) to get value by key and .set(key, value) to assign a value to a key. If the element with the specified key doesn't exist in the map, .get() returns undefined. .set() method returns the map object, so you can chain .set() calls. const map = new Map(); console.log(map.get(1)); // und...
To get the numbers of elements of a Map, use the .size property: const map = new Map([[1, 2], [3, 4]]); console.log(map.size); // 2
EntityState.Added can be set in two fully equivalent ways: By setting the state of its entry in the context: context.Entry(entity).State = EntityState.Added; By adding it to a DbSet of the context: context.Entities.Add(entity); When calling SaveChanges, the entity will be inse...
To enable code shrinking with ProGuard, add minifyEnabled true to the appropriate build type in your build.gradle file. android { buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile(‘proguard-android.txt'), 'pro...
To enable resource shrinking, set the shrinkResources property to true in your build.gradle file. android { ... buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'p...
All libraries come with resources that are not necessary useful to your application. For example Google Play Services comes with translations for languages your own application don’t even support. You can configure the build.gradle file to specify which resource you want to keep. For example: de...
Setting the state of an object graph (a collection of related entities) to Added is different than setting a single entity as Added (see this example). In the example, we store planets and their moons: Class model public class Planet { public Planet() { Moons = new HashSet<...
Using requestAnimationFrame may on some systems update at more frames per second than the 60fps. 60fps is the default rate if the rendering can keep up. Some systems will run at 120fps maybe more. If you use the following method you should only use frame rates that are integer divisions of 60 so th...

var

An implicitly-typed local variable that is strongly typed just as if the user had declared the type. Unlike other variable declarations, the compiler determines the type of variable that this represents based on the value that is assigned to it. var i = 10; // implicitly typed, the compiler must de...
Delegates are types that represent a reference to a method. They are used for passing methods as arguments to other methods. Delegates can hold static methods, instance methods, anonymous methods, or lambda expressions. class DelegateExample { public void Run() { //using class ...

Page 730 of 1336