Tutorial by Examples

Open Function.cs and replace the class code with the following: public class Function { /// <summary> /// A simple function that takes a birth date and returns Age in years /// </summary> /// <param name="input"></param> /// <returns>Age is years&...
Right Click your project and select Publish to AWS Lambda... The Upload to AWS Lambda screen will appear. Make sure the correct region is selected. Keep all of the defaults. Then only enter the Function Name: AWSLambdaFunctionAgeInYears and then click next. On the next page, sele...
After Step 3 above, Visual Studio will open the View Function window with your function loaded. On the bottom left of this screen, enter the following json into the Sample Input box: { "month": "10", "day": "28", "year": "1979" } ...
There are different types of variables in Clojure: numbers Types of numbers: integers longs (numbers larger than 2^31 - 1) floats (decimals) strings collections Types of collections: maps sequences vectors functions
This example assumes you have a servo with the following characteristics, which happen to be typical: movement between 0 and 180 degrees pulse period of 20 ms minimum pulse length of 0.5 ms maximum pulse length of 2.5 ms You need to check if those values match your hardware, since forcing i...
Reagent atoms are essentially the same as regular atoms in both Clojure and ClojureScript - they are essentially variables that can be altered. This is especially useful, as Clojure(Script)'s data types are mostly immutable - which means that to change the value of a variable, the variable has to be...
A (m x n) matrix can be representes by a surface by using surf; The color of the surface is automatically set as function of the values in the (m x n) matrix. If the colormap is not specified, the default one is applied. A colorbar can be added to display the current colormap and indicate the map...
Instances of Integer_IO have a settings variable Default_Width which the number of characters that each output number will take. with Ada.Text_IO; use Ada.Text_IO; procedure Print_Integer is subtype Count is Integer range -1_000_000 .. 1_000_000; package Count_IO is new Integer_IO ...
A settings variable Default_Base is set on the instance of Ada.Text_IO.Integer_IO; also, Default_Width is set so that output cannot have leading space. with Ada.Text_IO; use Ada.Text_IO; procedure Print_Hex is subtype Count is Integer range -1_000_000 .. 1_000_000; package Count_IO...
Ada.Text_IO.Editing offers formatting decimal fixed point values using “picture strings”. These describe output using “magical” characters for separators, currency signs, etc. with Ada.Text_IO.Editing; use Ada.Text_IO; procedure Print_Value is Max_Count : constant := 1_000_000; ...
Combine the instances of the _IO packages, use the right one with its numeric type. with Ada.Text_IO; use Ada.Text_IO; procedure Print_Inventory is type Fruit is (Banana, Orange, Pear); subtype Count is Integer range -1_000_000 .. 1_000_000; package Fruit_IO is new Enumeration...
This will take about 30 minutes. We will be setting Ruby on Rails Development Environment on Ubuntu 16.10 Yakkety Yak. Open up your terminal using Ctrl + Alt + T. Installing Ruby The First step is to install Dependencies For Ruby. sudo apt-get update sudo apt-get install git-core curl zlib1g-...
A simple sports2000 example: FIND FIRST Customer NO-LOCK WHERE CustNum = 1 NO-ERROR. IF AVAILABLE Customer THEN DO: DISPLAY Customer.NAME. END. ELSE DO: MESSAGE "No record available". END. FIRST - find the first record that matches the query NO-LOCK - don't lock the r...
Install the toolchain with curl https://sh.rustup.rs -sSf | sh You should have the latest stable version of rust already. You can check that by typing rustc --version If you want to update, just run rustup update
Paste this snippet somewhere in the http {} Block; or place it in it's own file in the /etc/nginx/conf.d/ folder. Also see the official docs for logging to syslog. # # Access Log # log_format fmt_syslog '[$time_local] $status $remote_addr $http_host "$request" $body_bytes_sent $reque...
A usual Website just needs 3 HTTP Methods: GET, HEAD and POST. Block all other Methods by using limit_except: location / { [...] # Note: GET includes HEAD limit_except GET POST { deny all; } [...] }
Coding method used: Hybrid/Spongy It has been forever a myth that div's can not be used in emails. There are email clients (unlike outlook) that can render div's properly. The example below will illustrate how an email can be coded that will work on Gmail app (with updates not rolled out yet), Sams...
Parent Component : Initialize users lists. @Component({ selector: 'parent-component', template: '<div> <child-component [users]="users"></child-component> </div>' }) export class ParentComponent implements OnInit{ let users...
The create-* commands in Grails automatically create unit or integration tests for you within the src/test/groovy directory. It is of course up to you to populate these tests with valid test logic, information on which can be found in the section on Unit and integration tests. To execute tests you ...
import grails.rest.* @Resource(uri='/books') class Book { String title static constraints = { title blank:false } } Simply by adding the Resource transformation and specifying a URI, your domain class will automatically be available as a REST resource in either XM...

Page 1123 of 1336