Tutorial by Examples

Similar to repeaters used in other languages. This binding will allow you to replicate a block of html for each item in an array. <div data-bind="foreach:contacts"> <div class="contact"> <h2 data-bind="text:name"> <p data-bin...
Use this binding to build options for a select item <select data-bind="options: gasGiants"></select> <script type="text/javascript"> var viewModel = { gasGiants: ko.observableArray(['Jupiter', 'Saturn', 'Neptune', 'Uranus']) }; </scri...
a simple example of how to define a custom shape with 2 inlets and 3 outlets. case class TwoThreeShape[-In1, -In2, +Out1, +Out2, +Out3]( in1: Inlet[In1@uncheckedVariance], in2: Inlet[In2@uncheckedVariance], out1: Outlet[Out1@uncheckedVariance], out2: Ou...
We know that 'best practise' dictates that a range object should have its parent worksheet explicitly referenced. A worksheet can be referred to by its .Name property, numerical .Index property or its .CodeName property but a user can reorder the worksheet queue by simply dragging a name tab or rena...
Add akka-actor dependency (SBT example) libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.4.8" Create actor classes: Actor for string output: class OutputActor extends Actor { override def receive: Receive = { case message => p...
When working with multiple open Workbooks, each of which may have multiple Sheets, it’s safest to define and set reference to all Workbooks and Sheets. Don't rely on ActiveWorkbook or ActiveSheet as they might be changed by the user. The following code example demonstrates how to copy a range from...
Gnuplot is a portable command-line driven graphing utility. This example will show how to setup gnuplot in the various platforms. Windows Download the latest version of the installer from gnuplot site. Run the downloaded file and allow it to run as administrator if requested On the ...
The Help Class encapsulates the HTML Help 1.0 engine. You can use the Help object to show compiled Help files (.chm) or HTML files in the HTML Help format. Compiled Help files provide table of contents, index, search, and keyword links in pages. Shortcuts work only in compiled Help files. You can ge...
To delete all rows from the table //get writable database SQLiteDatabase db = openHelper.getWritableDatabase(); db.delete(TABLE_NAME, null, null); db.close(); To delete all rows from the table and get the count of the deleted row in return value //get writable database SQLiteDatabase db =...
HTTP Basic Authentication provides a straightforward mechanism for authentication. Credentials are sent in plain text, and so is insecure by default. Successful authentication proceeds as follows. The client requests a page for which access is restricted: GET /secret The server responds with st...
Download your preferred version from Lightbend with curl: curl -O http://downloads.lightbend.com/scala/2.xx.x/scala-2.xx.x.tgz Unzip the tar file to /usr/local/share or /opt/bin: unzip scala-2.xx.x.tgz mv scala-2.xx.x /usr/local/share/scala Add the PATH to ~/.profile or ~/.bash_profile or ...
Case classes provide a copy method that creates a new object that shares the same fields as the old one, with certain changes. We can use this feature to create a new object from a previous one that has some of the same characteristics. This simple case class to demonstrates this feature: case cla...
A XOR Linked list is also called a Memory-Efficient Linked List. It is another form of a doubly linked list. This is highly dependent on the XOR logic gate and its properties. Why is this called the Memory-Efficient Linked List? This is called so because this uses less memory than a traditional d...
The idea behind programming to an interface is to base the code primarily on interfaces and only use concrete classes at the time of instantiation. In this context, good code dealing with e.g. Java collections will look something like this (not that the method itself is of any use at all, just illus...
A Subject in RxJava is a class that is both an Observable and an Observer. This basically means that it can act as an Observable and pass inputs to subscribers and as an Observer to get inputs from another Observable. Subject<String, String> subject = PublishSubject.create(); subject.subscr...
PublishSubject emits to an Observer only those items that are emitted by the source Observable subsequent to the time of the subscription. A simple PublishSubject example: Observable<Long> clock = Observable.interval(500, TimeUnit.MILLISECONDS); Subject<Long, Long> subjectLong = Publi...
Requirements A version of the Haxe toolkit must be installed Haxe must be present in your system path Command line must be accessible Code Navigate to a desired project directory and create a Test.hx source file with the following content: class Test { static function main() { ...
This example connects to a Wi-Fi access point with WEP encryption, given an SSID and the password. public boolean ConnectToNetworkWEP(String networkSSID, String password) { try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID ...
This example connects to a Wi-Fi access point with WPA2 encryption. public boolean ConnectToNetworkWPA(String networkSSID, String password) { try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; // Please note th...
The example below describes how to declare three different types of direct dependencies in the app/ module's build.gradle file: android {...} ... dependencies { // The 'compile' configuration tells Gradle to add the dependency to the // compilation classpath and inclu...

Page 432 of 1336