Tutorial by Examples: er

Install serverless globally npm install serverless -g Create an AWS Lamdba function in Node.js serverless create --template aws-nodejs Example of a handler.js 'use strict'; // Your first function handler module.exports.hello = (event, context, cb) => cb(null, { message: 'Go Server...
Prerequisites: Apple Developers Account Setup GameCenter Leaderboards with iTunesConnect Setting up GameCenter Leaderboards: Sign in to iTunesConnect Go to My Apps. Create an app for your project then go to Features. Click on Game Center Click the plus sign next to Leaderboards. Choose...
This class holds predicate filters values. public class QueryFilter { public string PropertyName { get; set; } public string Value { get; set; } public Operator Operator { get; set; } // In the query {a => a.Name.Equals("Pedro")} // Property name to filter ...
For one filter: Here is where the query is created, it receives a expression parameter and a filter. private static Expression GetExpression<T>(ParameterExpression param, QueryFilter queryFilter) { // Represents accessing a field or property, so here we are accessing for example: ...
In this very first example, a basic serial write operation is started from an Arduino device. void setup() { // put your setup code here, to run once: Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: Serial.println("Hello World!"); dela...
.after(delay, callback=None) is a method defined for all tkinter widgets. This method simply calls the function callback after the given delay in ms. If no function is given, it acts similar to time.sleep (but in milliseconds instead of seconds) Here is an example of how to create a simple timer us...
Scenario: You need to select an implementation of address validation when a sales order is submitted, and the validator is determined by the country to which the order is shipping. The factory needs to inspect some value passed as an argument to select the correct implementation. First, write an in...
Scenario: You need to resolve a dependency when a method is called, not in the constructor. Solution: Inject an abstract factory into the constructor. When the method is called, it requests the dependency from the abstract factory, which in turn resolves it from the container. (Your class depends o...
const Promise = require('bluebird'), fs = require('fs') Promise.promisifyAll(fs) // now you can use promise based methods on 'fs' with the Async suffix fs.readFileAsync('file.txt').then(contents => { console.log(contents) }).catch(err => { console.error('error reading', er...
const promiseReturningFunction = Promise.coroutine(function* (file) { const data = yield fs.readFileAsync(file) // this returns a Promise and resolves to the file contents return data.toString().toUpperCase() }) promiseReturningFunction('file.txt').then(console.log)
Promise.resolve([1, 2, 3]) .mapSeries(el => Promise.resolve(el * el)) // in real world, use Promise returning async function .then(console.log)
app.use(async (ctx, next) => { try { await next() // attempt to invoke the next middleware downstream } catch (err) { handleError(err, ctx) // define your own error handling function } })
You can qualify a whole folder folder for a specific device type, its files will override the ones outside it on that device: / DeviceFamily-Mobile PageOfEden.xaml MainPage.xaml MainPage.xaml MainPage.xaml.cs PageOfEden.xaml PageOfEden.xaml.cs Files inside the qualifying folder won...
If you browse your app's Assets folder you will notice that all resources are qualified by their scales (As you are required to put seperate files for each scaling in the package manifest). SplashScreen.scale-100.png SplashScreen.scale-125.png SplashScreen.scale-150.png SplashScreen.scale-200.pn...
Let's assume we have an Image element using a square image named Picture.png. We can use different files for each dimension set for the element. Picture.TargetSize-16.png Picture.TargetSize-32.png Picture.TargetSize-128.png Now if we set the Height or Width of our Image to 16px, it will use P...
php bin/magento setup:upgrade => Setup Upgrade php bin/magento setup:di:compile => Setup: Compile php bin/magento indexer:reindex => Reindex php bin/magento cache:flush => Clear Cache php bin/magento deploy:mode:set...
Decorator pattern adds behavior to objects without affecting other objects of the same class. The decorator pattern is a useful alternative to creating sub-classes. Create a module for each decorator. This approach is more flexible than inheritance because you can mix and match responsibilities in ...
This section should list, at least, the out of the box sql functions that come with Teradata Database and also list where there are differences between TD and the ANSI standard.
In Rust, there is no concept of "inheriting" the properties of a struct. Instead, when you are designing the relationship between objects do it in a way that one's functionality is defined by an interface (a trait in Rust). This promotes composition over inheritance, which is considered mo...
This UNION ALL combines data from multiple tables and serve as a table name alias to use for your queries: SELECT YEAR(date_time_column), MONTH(date_time_column), MIN(DATE(date_time_column)), MAX(DATE(date_time_column)), COUNT(DISTINCT (ip)), COUNT(ip), (COUNT(ip) / COUNT(DISTINCT (ip))) AS Ratio ...

Page 288 of 417