Tutorial by Examples: ae

You can retrieve post data as Array. $post_data= $this->request->data; You can retrieve post data for particular key. $this->request->data['field']; Retrieve specific key value $this->request->data('key_name'); Retrieve specific key value of nested array $this->requ...
You can enable the Gradle Daemon to improve the performance of your builds. The Gradle Daemon keeps the Gradle Framework initialized and running, and caches project data in memory to improve performance. For a Single Build To enable the Daemon for a single build, you can simply pass the --daemon ...
The following example encrypts a given data block using AES. The encryption key is derived in a secure way (random salt, 1000 rounds of SHA-256). The encryption uses AES in CBC mode with random IV. Note that the data stored in the class EncryptedData (salt, iv, and encryptedData) can be concatenate...
Lambdas are meant to provide inline implementation code for single method interfaces and the ability to pass them around as we have been doing with normal variables. We call them Functional Interface. For example, writing a Runnable in anonymous class and starting a Thread looks like: //Old way n...
To start the process: $ forever start index.js warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms info: Forever processing file: index.js List running Forever instances: $ forever list i...
Runnable r = () -> System.out.println("Hello World"); Supplier<String> c = () -> "Hello World"; // Collection::contains is a simple unary method and its behavior is // clear from the context. A method reference is preferred here. appendFilter(goodStrings::cont...
Define Interface public interface ClickHandler { public void onButtonClick(User user); } Create Model class public class User { private String name; public User(String name) { this.name = name; } public String getName() { return name; } ...
A lambda closure is created when a lambda expression references the variables of an enclosing scope (global or local). The rules for doing this are the same as those for inline methods and anonymous classes. Local variables from an enclosing scope that are used within a lambda have to be final. Wit...
A lambda can only have a trailing return type; the leading return type syntax is not applicable to lambdas. Note that in many cases it is not necessary to specify a return type for a lambda at all. struct Base {}; struct Derived1 : Base {}; struct Derived2 : Base {}; auto lambda = [](bool b) -&g...
You can retrieve query string data as Array. $post_data= $this->request->query; You can retrieve post data for particular key. $this->request->query['field']; Retrieve specific key value $this->request->query('key_name'); Retrieve specific key value of nested array $th...
When you also want to expose metadata without a config file you can build on the example programmatically creating a ServiceHost: public ConsoleHost() { mHost = new ServiceHost(typeof(Example), new Uri("http://localhost:8000/Example"), new Uri("net.tcp://9000/Example")); ...
Required Namespace: System.Security.Cryptography private class Encryption { private const string SecretKey = "topSecretKeyusedforEncryptions"; private const string SecretIv = "secretVectorHere"; public string Encrypt(string data...
Lambda expressions are similar to anonymous functions in other languages. Lambda expressions are open formulas which also specify variables which are to be bound. Evaluation (finding the value of a function call) is then achieved by substituting the bound variables in the lambda expression's body, ...
The CAEmitterLayer class provides a particle emitter system for Core Animation. The particles are defined by instances of CAEmitterCell. The particles are drawn above the layer’s background color and border. var emitter = CAEmitterLayer() emitter.emitterPosition = CGPoin...
The most common way is to apply the extension via Config. Example: # File: mysite/_config/config.yml Member: extensions: - MyMemberExtension The extensions config variable is of type "array", so you can add multiple extensions like this: # File: mysite/_config/config.yml Mem...
A great existing example of the Adapter pattern can be found in the SWT MouseListener and MouseAdapter classes. The MouseListener interface looks as follows: public interface MouseListener extends SWTEventListener { public void mouseDoubleClick(MouseEvent e); public void mouseDown(MouseE...
Java EE stands for Java Enterprise Edition. Java EE extends the Java SE (which stands for Java Standard Edition). Java EE is a set of technologies and related specifications that are oriented towards the development of large-scale enterprise applications. Java EE is developed in a community driven p...
When we want to handle array of data, its better to use async.each. When we want to perform something with all data & want to get the final callback once everything is done, then this method will be useful. This is handled in parallel way. function createUser(userName, callback) { //creat...
Lambda Expresions are an extension of anonymous methods that allow for implicitly typed parameters and return values. Their syntax is less verbose than anonymous methods and follows a functional programming style. using System; using System.Collections.Generic; using System.Linq; ...
Starting with Java 8, you can use lambda expressions & predicates. Example: Use a lambda expressions & a predicate to get a certain value from a list. In this example every person will be printed out with the fact if they are 18 and older or not. Person Class: public class Person { p...

Page 2 of 5