Tutorial by Examples: amp

package { import flash.events.TimerEvent; import flash.events.TimerEvent; import flash.utils.Timer; public class RandomTimer extends Timer { public var minimumDelay:Number; public var maximumDelay:Number; private var _count:uint = 0; privat...
Examples of monotonic predicates are: unification with (=)/2 or unify_with_occurs_check/2 dif/2, expressing disequality of terms CLP(FD) constraints like (#=)/2 and (#>)/2, using a monotonic execution mode. Prolog predicates that only use monotonic goals are themselves monotonic. Monoton...
To illustrate a simple example usage of the MVP pattern, consider the following code which creates a simple UI with only a button and a label. When the button is clicked, the label updates with the number of times the button has been clicked. We have 5 classes: Model - The POJO to maintain state...
;Sends the keystroke for the letter "a" every 3 seconds. #Persistent SetTimer, SendLetterA, 3000 return SendLetterA() { Send, a }
index.html <button id="increment">Increment</button> <button id="decrement">Decrement</button> <p id="app"></p> index.js import { createStore } from 'redux'; function counter(state = 0, action) { switch (action.type) { ...
Place Picker is a really simple UI widget provided by Places API. It provides a built-in map, current location, nearby places, search abilities and autocomplete. This is a sample usage of Place Picker UI widget. private static int PLACE_PICKER_REQUEST = 1; private TextView txtPlaceName; @Ove...
The code sample below shows one way to retrieve records from an MSSql Server in a background thread using FireDAC. Tested for Delphi 10 Seattle As written: The thread retrieves data using its own TFDConnection and TFDQuery and transfers the data to the form's FDQuery in a call to Sychronize...
This is the advanced approach with example class FundsController < ApplicationController def index @funds = Fund.all_funds(current_user) end def show @fund = Fund.find(params[:id]) respond_to do |format| format.html format.pdf do pdf = FundsPdf....
You need to add Gem and PDF MIME:Type inside mime_types.rb as we need to notify rails about PDF mime type. After that we can generate Pdf with Prawn in following basic ways This is the basic assignment pdf = Prawn::Document.new pdf.text "Hello World" pdf.render_file "assignment.p...
services/my.service.ts import { Injectable } from '@angular/core'; @Injectable() export class MyService { data: any = [1, 2, 3]; getData() { return this.data; } } The service provider registration in the bootstrap method will make the service available globally. main.ts im...
services/my.service.ts import { Injectable } from '@angular/core'; @Injectable() export class MyService { data: any = [1, 2, 3]; getData() { return Promise.resolve(this.data); } } getData() now acts likes a REST call that creates a Promise, which gets resolved imme...
Normal Update UPDATE TESTTABLE SET TEST_COLUMN= 'Testvalue',TEST_COLUMN2= 123 WHERE EXISTS (SELECT MASTERTABLE.TESTTABLE_ID FROM MASTERTABLE WHERE ID_NUMBER=11);
Given a simple PHP class: class Car { private $speed = 0; public getSpeed() { return $this->speed; } public function accelerate($howMuch) { $this->speed += $howMuch; } } You can write a PHPUnit test which tests the behavior of the class unde...
.NET Core app should be published using dotnet publish FROM microsoft/dotnet:latest COPY bin/Debug/netcoreapp1.0/publish/ /root/ EXPOSE 5000 ENTRYPOINT dotnet /root/sampleapp.dll
You can convert a timestamp or interval value to a string with the to_char() function: SELECT to_char('2016-08-12 16:40:32'::timestamp, 'DD Mon YYYY HH:MI:SSPM'); This statement will produce the string "12 Aug 2016 04:40:32PM". The formatting string can be modified in many different wa...
Swift class PickerViewExampleViewController : UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { @IBOutlet weak var btnFolder: UIButton! let pickerView = UIPickerView() let pickerViewRows = ["First row,", "Secound row,","Third row,","F...
A common use-case for iterators is to perform some operation over a collection of numbers. The example below demonstrates how each element within an array of numbers can be individually printed out to the console. This is possible because arrays implement the IEnumerable interface, allowing clients...
It might be easier if you think of GROUP BY as "for each" for the sake of explanation. The query below: SELECT EmpID, SUM (MonthlySalary) FROM Employee GROUP BY EmpID is saying: "Give me the sum of MonthlySalary's for each EmpID" So if your table looked like this: +----...
# will retrieve my home path ENV['HOME'] # => "/Users/username" # will try retrieve the 'FOO' environment variable. If failed, will get 'bar' ENV.fetch('FOO', 'bar')
As with docopt, with [docopt_dispatch] you craft your --help in the __doc__ variable of your entry-point module. There, you call dispatch with the doc string as argument, so it can run the parser over it. That being done, instead of handling manually the arguments (which usually ends up in a high c...

Page 11 of 46