Tutorial by Examples: an

Similar to aggregation methods also by the find() method you have the possibility to limit, skip, sort and count the results. Let say we have following collection: db.test.insertMany([ {name:"Any", age:"21", status:"busy"}, {name:"Tony", age:"...
In your build.gradle you need to add the below dependencies: debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' In your Application class yo...
Prerequisites you should have fuse installed (https://www.fusetools.com/downloads) you should have done the introduction tutorial in terminal: fuse install android in terminal: uno install Fuse.Views Step 1 git clone https://github.com/fusetools/hikr Step 2 : Add package reference to ...
Except main @conditional annotation there are set of similar annotation to be used for different cases. Class conditions The @ConditionalOnClass and @ConditionalOnMissingClass annotations allows configuration to be included based on the presence or absence of specific classes. E.g. when OObjectDa...
This example shows how to create a custom presentation transition that is driven by a composite UIDynamicBehavior. We can start by creating a presenting view controller that will present a modal. Swift class PresentingViewController: UIViewController { lazy var button: UIButton = { ...
Jest is used by Facebook to test all JavaScript code including React applications. One of Jest's philosophies is to provide an integrated "zero-configuration" experience. We observed that when engineers are provided with ready-to-use tools, they end up writing more tests, which in turn res...
If you have a multidimensional array like this: [ ['foo', 'bar'], ['fizz', 'buzz'], ] And you want to change it to an associative array like this: [ 'foo' => 'bar', 'fizz' => 'buzz', ] You can use this code: $multidimensionalArray = [ ['foo', 'bar'], ...
The command syntax will be of the following type: <REST Verb> /<Index>/<Type>/<ID> Execute the following command to explore elasticsearch cluster through Kibana Console. For checking the cluster health GET /_cat/health?v For listing all the indices GET /_cat...
This example shows how to make an interactive presentation transition with "real-world" physics similar to iOS's notifications screen. To start with, we need a presenting view controller that the shade will appear over. This view controller will also act as our UIViewControllerTransitio...
Processing provides method triangle() to draw a triangle. This code draws a white triangle on black background. void setup() { size(500, 500); background(0); fill(255); noStroke(); } void draw() { triangle(250, 225, 225, 275, 275, 275); }
Methods used: .DeleteFolder(FileSpec, Force (True/False)) .CreateFolder(Path) .DeleteFile(FileSpec, Force (True/False)) The following example illustrates the Deletion and creation of a folder using the methods "DeleteFolder" and "CreateFolder". Code: Dim strFolderPath, ob...
As java provide two different commands to compile and run Java code. Same as Kotlin also provide you different commands. javac to compile java files. java to run java files. Same as kotlinc to compile kotlin files kotlin to run kotlin files.
This example shows how to customize the UIDynamicItem protocol to map position changes of a view being dynamically animated to bounds changes to create a UIButton that expands and contracts in a elastic fashion. To start we need to create a new protocol that implements UIDynamicItem but that also...
Redis-py provides the execute_command method to directly invoke Redis operations. This functionality can be used to access any modules that may not have a supported interface in the redis-py client. For example, you can use the execute_command to list all of the modules loaded into a Redis server:...
EQ checks if two values have the same address of memory: in other words, it checks if the two values are are actually the same, identical object. So, it is can be considered the identity test, and should be applied only to structures: conses, arrays, structures, objects, typically to see if you ...
Common Lisp has 12 type specific operators to compare two characters, 6 of them case sensitives and the others case insensitives. Their names have a simple pattern to make easy to remember their meaning: Case SensitiveCase InsensitiveCHAR=CHAR-EQUALCHAR/=CHAR-NOT-EQUALCHAR<CHAR-LESSPCHAR<=CHA...
Foreword This is a detailed example about how to encrypt and decrypt data with Go. The uses code is shorten, e.g. the error handling is not mentioned. The full working project with error handling and user interface could be found on Github here. Encryption Introduction and data This example de...
We can use the componentchanged event to listen for changes to the entity: entity.addEventListener('componentchanged', function (evt) { if (evt.detail.name === 'position') { console.log('Entity has moved from', evt.detail.oldData, 'to', evt.detail.newData, '!'); } });
We can use the child-attached and child-detached events to listen for when the scene attaches or detaches an entity: entity.addEventListener('child-attached', function (evt) { if (evt.detail.el.tagName.toLowerCase() === 'a-box') { console.log('a box element has been attached'); }; }); ...
We can simply retrieve an entity using DOM APIs. <a-entity id="mario"></a-entity> var el = document.querySelector('#mario');

Page 289 of 307