Tutorial by Examples: l

Interfaces provide a way to specify the behaviour of an object, if something can do this then it can be used here. an interface defines a set of methods, but these methods do not contain code as they are abstract or the implemntation is left to the user of the interface. unlike most Object Oriented ...
This simple exampe will create a hello world web service that will listen on the port 80. docker service create \ --publish 80:80 \ tutum/hello-world
You can install mocha either globally or in your project folder. The latter is the preferred way. In all the example let's assume that all the test files are in a test folder within the project folder. Install Mocha locally To install mocha in your project folder, you can use the following npm co...
import spock.lang.* class HelloWorldSpec extends Specification { @Shared message = 'Hello world!' def "The world can say hello using when and then"() { when: def newMessage = message then: newMessage == 'Hello world!' } ...
Contrary to Drupal 7 you cannot call regular PHP functions in your templates. In Drupal 8 the way to go is by creating filters and functions. You should use a filter when: you want to transform the data you want to display. Imagine you have a title that you want to always be uppercase. For example,...
A Seaside component (subclass of WAComponent) needs to override #renderContentOn:. It is a smalltalk class that can use all the normal ways of structuring an application. Here it delegates to three different methods. JQDroppableFunctionalTest>>renderContentOn: html self renderInstructions...
Detailed instructions on getting split set up or installed.
import SpriteKit import UIKit class GameRoomTableView: UITableView,UITableViewDelegate,UITableViewDataSource { var items: [String] = ["Player1", "Player2", "Player3"] override init(frame: CGRect, style: UITableViewStyle) { super.init(frame: frame, s...
We create a dataset that we then fit with a straight line $f(x) = m x + c$. npoints = 20 slope = 2 offset = 3 x = np.arange(npoints) y = slope * x + offset + np.random.normal(size=npoints) p = np.polyfit(x,y,1) # Last argument is degree of polynomial To see what we've done: impor...
We use the same dataset as with polyfit: npoints = 20 slope = 2 offset = 3 x = np.arange(npoints) y = slope * x + offset + np.random.normal(size=npoints) Now, we try to find a solution by minimizing the system of linear equations A b = c by minimizing |c-A b|**2 import matplotlib.pyplot as...
dev.office.com/sharepoint is a great place to get started with the SharePoint Framework. The SharePoint Framework is a modern, client side approach to SharePoint Development initially targeted at SharePoint Online in Office 365. Web parts created with the SharePoint Framework are a new type of web ...
Using the Flyable example as a starting point, we can add a second interface, Swimmable, with the following code: Sub Swim() ' No code End Sub The Duck object can Implement both flying and swimming: Implements Flyable Implements Swimmable Public Sub Flyable_Fly() Debug.Print &quo...
In tables recording events there is often a datetime field recording the time an event happened. Finding the single most recent event can be difficult because it's always possible that two events were recorded with exactly identical timestamps. You can use row_number() over (order by ...) to make su...
from sqlalchemy import create_engine cnx = create_engine('mysql+pymysql://username:password@server:3306/database').connect() sql = 'select * from mytable' df = pd.read_sql(sql, cnx)
Typically, before developing a new HERE SDK application, you need to acquire a set of credentials by registering your application on http://developer.here.com. Each application requires a unique set of credentials. When you register your app, the registered bundle identifier must match the package n...
The pygame.mixer module helps control the music used in pygame programs. As of now, there are 15 different functions for the mixer module. Initializing Similar to how you have to initialize pygame with pygame.init(), you must initialize pygame.mixer as well. By using the first option, we initiali...
While chrome browser is open to any tab (except welcome tabs) you have three options to open Chrome Dev Tools: Keyboard: Type command ⌘+option+i Browser Menu: Click 'Menu' > 'More Tools' > 'Developer Tools' Program Menu (at top of your screen): Click 'View' > 'Developer' > 'Develope...
You use the FIRST_VALUE function to determine the first value in an ordered result set, which you identify using a scalar expression. SELECT StateProvinceID, Name, TaxRate,        FIRST_VALUE(StateProvinceID)         OVER(ORDER BY TaxRate ASC) AS FirstValue FROM SalesTaxRate; In this example,...
The LAST_VALUE function provides the last value in an ordered result set, which you specify using a scalar expression. SELECT TerritoryID, StartDate, BusinessentityID,        LAST_VALUE(BusinessentityID)          OVER(ORDER BY TerritoryID) AS LastValue FROM SalesTerritoryHistory; This example...
The LAG function provides data on rows before the current row in the same result set. For example, in a SELECT statement, you can compare values in the current row with values in a previous row. You use a scalar expression to specify the values that should be compared. The offset parameter is the n...

Page 706 of 861