Tutorial by Examples

val personMap = Map( 10 -> new Person("Roger", "Moore"), 20 -> new Person("James", "Bond") ) val names = for { (key, person) <- personMap if key > 15 } yield s"$key = ${person.firstName}"
import org.scalajs.dom import dom.document def appendP(target: dom.Node, text: String) = { val pNode = document.createElement("p") val textNode = document.createTextNode(text) pNode.appendChild(textNode) target.appendChild(pNode) }
Sbt dependency libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.9.1" // (Triple %%%) Running sbt run Running with continous compilation: sbt ~run Compile to a single JavaScript file: sbt fastOptJS
Test Automation is broad topic. DEV/QA should delve on this questions first: What is nature of product? (Web, Mobile, Cloud, IOT, Analytics) What is development stage? (Developed-Legacy, In Development) What is technology stack? (Java, C#, Python, Ruby, Node, React) Is it SOA/Micro-services ba...
Test automation framework can have several components depending on automation planned. Some of them(though not limited to) are: Test Runner (TestNG, JUnit, Jest, Protractor, Cucumber) Test Container (BDD Specs-Steps, Junit Tests, Spec based functions) Test Environment Configuration Test Data S...
jest is painless JavaScript testing framework by Facebook, with ts-jest can be used to test TypeScript code. To install jest using npm run command npm install --save-dev jest @types/jest ts-jest typescript For ease of use install jest as global package npm install -g jest To make jest work ...
To extend and expand upon the binding experience we have converters to convert one a value of one type into another value of another type. To leverage Converters in a Databinding you first need to create a DataConverter class tht extens either IValueConverter(WPF & UWP) or IMultiVal...
To install Marionette using NPM and Webpack Install NPM following the advice from the NPM blog Create a directory for your JavaScript application Inside that directory, run npm init, giving your application names Install Webpack: npm install --save webpack Install Marionette's dependencies: n...
Working Example: https://jsfiddle.net/Twisty/4f5yh3pa/7/ Cancelling and Reverting a sortable is not strongly documented. The helps show how moving an item from one list to another connected list can be conditionally cancelled. by default, this is not animated by sortable, this example includes an a...
Partial Update: Used when a partial document update is needed to be done, i.e. in the following example the field name of the document with id doc_id is going to be updated to 'John'. Note that if the field is missing, it will just be added to the document. doc = { "doc": { ...
Detailed instructions on getting graphite set up or installed.
iex(1)> String.contains? "elixir of life", "of" true iex(2)> String.contains? "elixir of life", ["life", "death"] true iex(3)> String.contains? "elixir of life", ["venus", "mercury"] false
You can concatenate strings in Elixir using the <> operator: "Hello" <> "World" # => "HelloWorld" For a List of Strings, you can use Enum.join/2: Enum.join(["A", "few", "words"], " "...
To count the occurences of a value in a numpy array. This will work: >>> import numpy as np >>> a=np.array([0,3,4,3,5,4,7]) >>> print np.sum(a==3) 2 The logic is that the boolean statement produces a array where all occurences of the requested values are 1 and all o...
Example of usage scalacheck with scalatest. Below we have four tests: "show pass example" - it passes "show simple example without custom error message " - just failed message without details, && boolean operator is used "show example with error messages on arg...
Use case: remember the current URL to return to after adding a new record in a different (related) controller, for instance create a new contact to add to an invoice being edited. InvoiceController / actionUpdate: Url::remember(Url::current(), 'returnInvoice'); ContactController / actionCreate:...
Zeromq has a huge number of bindings for different languages. To find the right binding and instructions how to use follow this. Also you can use: a pure C# implementation or Java implementation
In this example we will make a simple client and server with REQ-REP (request-reply) sockets. The client sends "Hello" to the server, which replies with "World". Server opens a ZeroMQ REP-socket on port 5555, reads requests on it, and replies with "World" to each reque...
this is the simple example of getting the hello world plain text message as output on calling the GET request. import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @Path("/hello") public class HelloExample { @GET...
The stdio.h header defines the fgets() function. This function reads a line from a stream and stores it in a specified string. The function stops reading text from the stream when either n - 1 characters are read, the newline character ('\n') is read or the end of file (EOF) is reached. #include &l...

Page 1186 of 1336