Tutorial by Examples: c

Life-cycle hooks are also exposed as DSL elements, where later invocations of the methods shown below will replace the contents of the respective hooks: val a = actor(new Act { whenStarting { testActor ! "started" } whenStopping { testActor ! "stopped" } }) The above i...
It is also possible to create nested actors, i.e. grand-children, like this: // here we pass in the ActorRefFactory explicitly as an example val a = actor(system, "fred")(new Act { val b = actor("barney")(new Act { whenStarting { context.parent ! ("hello from &quot...
Open Control Panel -> Programs and Features, choose the Visual Studio 2015 item, and then choose the Change button. In the setup wizard for Visual Studio, choose the Modify button. In the list of optional features to install, select the HTML/JavaScript (Apache Cordova) checkbox, c...
In Visual Studio, choose Tools->Extensions and Updates. In the Updates tab of the Extensions and Updates dialog box, choose Product Updates. If an update for Visual Studio Tools for Apache appears, select it, and then choose the Update button.
C# statements executes in either checked or unchecked context. In a checked context, arithmetic overflow raises an exception. In an unchecked context, arithmetic overflow is ignored and the result is truncated. short m = 32767; short n = 32767; int result1 = checked((short)(m + n)); //will ...
Let's assume that you need to show the status of a user and you have several possible CSS classes that could be used. Angular makes it very easy to choose from a list of several possible classes which allow you to specify an object list that include conditionals. Angular is able to use the correct...
Angular supports three types of expressions in the ng-class directive. 1. String <span ng-class="MyClass">Sample Text</span> Specifying an expression that evaluates to a string tells Angular to treat it as a $scope variable. Angular will check the $scope and look for a va...
First you create a new Cordova project: cordova create HelloWorld my.application.identifier AppName This will create a blank Cordova project in the HelloWorld folder with identifier my.application.identifier (which should be unique for each application) with name AppName. Next you add th...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="M 10,10 L 100,50" stroke="blue" stroke-width="5" /> </svg> Result:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="M 10,10 H 200" stroke="orange" stroke-width="5" /> </svg> Result:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="M 10,10 l 90,90 M 100,10 l -90,90" stroke="red" stroke-width="10" /> </svg> Result:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="M 10,10 V 200" stroke="green" stroke-width="5" /> </svg> Result:
The goal with using anonymous structs is to decode only the information we care about without littering our app with types that are used only in a single function. jsonBlob := []byte(` { "_total": 1, "_links": { "self": "https://api.twitch.tv/k...
Code lens is a simple way to know what happens with the code. Here you could find an image with the number of references of a method or class. If you can't see the code lens please see this question: Missing CodeLens references count in VS 2015 Community edition
Wildfly, part of the JBoss umbrella of projects, can also be executed via Docker. On a machine with Docker properly configured, run: $ docker run -it jboss/wildfly Once the image is pulled, the container starts and the following line can be seen: 09:44:49,225 INFO [org.jboss.as] (Controller Bo...
Sometimes you may want to have a lambda expression implementing more than one interface. This is mostly useful with marker interfaces (such as java.io.Serializable) since they don't add abstract methods. For example, you want to create a TreeSet with a custom Comparator and then serialize it and se...
Initialize a UICollectionView with a CGRect frame: Swift: let collection = UICollectionView(frame: CGRect(x: 0, y: 0, width: 200, height: 21)) Objective C: UICollectionView *collection = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, 200, 21)]; You can also create a UICollectionVi...
Every collection view must have a Datasource object. The Datasource object is the content that your app will display within the UICollectionView. At a minimum, all Datasource objects must implement the collectionView:numberOfItemsInSection: and collectionView:cellForItemAtIndexPath: methods. Requir...
When you request the url yourSite/Home/Index through a browser, the routing module will direct the request to the Index action method of HomeController class. How does it know to send the request to this specific class's specific method ? there comes the RouteTable. Every application has a route ta...
Hibernate (and embedded H2 DB) <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/...

Page 184 of 826