Tutorial by Examples: by

This is especially useful if we have a class that we want to extend in the rule. See example below for a more convenient method. import org.junit.rules.TestRule; import org.junit.runners.model.Statement; public class AwesomeTestRule implements TextRule { @Override public Stateme...
JUnit has an abstract implementation of @TestRule that lets you write a rule in a more simpler way. This is called ExternalResource and provides two protected methods that can be extended like this: public class AwesomeTestRule extends ExternalResource { @Override protected void befor...
Add the hyperloop gem to your rails (4.0 - 5.1) Gemfile bundle install Add the hyperloop manifest to the application.js file: // app/assets/javascripts/application.js ... //= hyperloop-loader Create your react components, and place them in the hyperloop/components directory # app/hyperl...
Table ORDERS +---------+------------+----------+-------+--------+ | orderid | customerid | customer | total | items | +---------+------------+----------+-------+--------+ | 1 | 1 | Bob | 1300 | 10 | | 2 | 3 | Fred | 500 | 2 | | 3 | ...
#lang scribble/manual @; Make sure that code highlighting recognises identifiers from my-package: ꩜require[@for-label[my-package]] @; Indicate which module is exporting the identifiers documented here. @defmodule[my-package] @defproc[(my-procedure [arg1 number?] [arg2 string?]) symbol?]{ ...
On the server: var express = require('express'); var socketio = require('socket.io'); var app = express(); var server = http.createServer(app); var io = socketio(server); io.on('connect', function (socket) { socket.on('userConnected', socket.join); socket.on('userDisconnected', socke...
WarehosueEntity findWarehouseById(@Param("id") Long id); List<WarehouseEntity> findWarehouseByIdIn(@Param("idList") List<Long> warehouseIdList);
This will take about 30 minutes. We will be setting Ruby on Rails Development Environment on Ubuntu 16.10 Yakkety Yak. You'll want to download the latest Desktop version here: http://releases.ubuntu.com/17.04/ Open up your terminal using Ctrl + Alt + T. Installing Ruby The First step is to ins...
ByteStrings and Buffers Okio is built around two types that pack a lot of capability into a straightforward API: ByteString is an immutable sequence of bytes. For character data, String is fundamental. ByteString is String's long-lost brother, making it easy to treat binary data as a value. This c...
We can perform a GROUP BY ... COUNT or a GROUP BY ... SUM SQL equivalent queries on Django ORM, with the use of annotate(), values(), order_by() and the django.db.models's Count and Sum methods respectfully: Let our model be: class Books(models.Model): title = models.CharField() ...
In following example we will create table movies with AWS Ruby SDK v2. Here, each Movie as one unique Partition Key as id, and Range Key year. Apart from this we want to be able to query movies with their name, hence we will create a Global Secondary Index (GSI) name-year-index with name as Hash Ke...
So the good news is that Apple kindly includes a Ruby interpreter. Unfortunately, it tends not to be a recent version: $ /usr/bin/ruby -v ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16] If you have Homebrew installed, you can get the latest Ruby with: $ brew install ruby...
Working with Kettle There are two versions of Kettle aka Pentaho Data Integration : Kettle CE (Community Edition) Kettle EE (Enterprise Edition) Documents aims mainly on Kettle CE edition. Prerequisites PDI requires the Oracle Java Runtime Environment (JRE) version 7. You can obtain a JRE ...
Parameter TypesReturn TypeInterface()voidRunnable()TSupplier()booleanBooleanSupplier()intIntSupplier()longLongSupplier()doubleDoubleSupplier(T)voidConsumer<T>(T)TUnaryOperator<T>(T)RFunction<T,R>(T)booleanPredicate<T>(T)intToIntFunction<T>(T)longToLongFunction<T>(...
DirectByteBuffer is special implementation of ByteBuffer that has no byte[] laying underneath. We can allocate such ByteBuffer by calling: ByteBuffer directBuffer = ByteBuffer.allocateDirect(16); This operation will allocate 16 bytes of memory. The contents of direct buffers may reside outside ...
Parallel Testing with Appium using GRID: I will describe the way which worked for me. Create Selenium Grid with Appium Setup the selenium grid Download selenium standalone server jar on local file system Open your terminal and navigate to the directory to where you placed the jar file and exe...
You can pass data directly by assigning the property of the next view controller before you push or present it. class FirstViewController: UIViewController { func openSecondViewController() { // Here we initialize SecondViewController and set the id property to 492 let se...
Create a console application. Install EntityFramework nuget package by running Install-Package EntityFramework in "Package Manager Console" Add your connection string in app.config file , It's important to include providerName="System.Data.SqlClient" in your connection. Cre...
Another convenient solution for cross compilation is the usage of gox: https://github.com/mitchellh/gox Installation The installation is done very easily by executing go get github.com/mitchellh/gox. The resulting executable gets placed at Go's binary directory, e.g. /golang/bin or ~/golang/bin. E...
Imagine that you need sort records by lowest value of either one of two columns. Some databases could use a non-aggregated MIN() or LEAST() function for this (... ORDER BY MIN(Date1, Date2)), but in standard SQL, you have to use a CASE expression. The CASE expression in the query below looks at th...

Page 21 of 23