Tutorial by Examples: ga

Sample Data: CREATE TABLE table_name ( value VARCHAR2(50) ); INSERT INTO table_name ( value ) VALUES ( 'A,B,C,D,E' ); Query: WITH items ( list, item, lvl ) AS ( SELECT value, REGEXP_SUBSTR( value, '[^,]+', 1, 1 ), 1 FROM table_name UNION ALL SELECT value, ...
let view = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) view.backgroundColor = UIColor.orange self.view.addSubview(view) UIView.animate(withDuration: 0.75, delay: 0.5, options: .curveEaseIn, animations: { //This will cause view to go from (0,0) to // (self.view.frame.origi...
Default behavior when cloning an object is to perform a shallow copy of the object's fields. In that case, both the original object and the cloned object, hold references to the same objects. This example shows that behavior. import java.util.List; public class Sheep implements Cloneable { ...
To copy nested objects, a deep copy must be performed, as shown in this example. import java.util.ArrayList; import java.util.List; public class Sheep implements Cloneable { private String name; private int weight; private List<Sheep> children; public Sheep(Str...
This will trigger the native email client for sharing text. Parameters : Email To address, Subject, Body. Code Sample : you can call the function wherever you need, (mostly inside click listeners) like below Calling function shareEmail("[email protected]", "Email sharing example&q...
Use a HashMap to store the parameters that should be sent to the server through POST parameters: HashMap<String, String> params; Once the params HashMap is populated, create the StringBuilder that will be used to send them to the server: StringBuilder sbParams = new StringBuilder(); ...
To get started quickly with Express, you can use the Express generator which will create an application skeleton for you. First, install it globally with npm: npm install express-generator -g You may need to put sudo before this command if you get a "permission denied" error. Once th...
Google currently has two ways to load the JS library for Google Visualization (a.k.a Google Charts), gstatic loader (https://www.gstatic.com/charts/loader.js) and jsapi (https://www.google.com/jsapi). The gstatic loader is recommended because Google is transitioning away from jsapi to the gstati...
In the logging configuration file of your choice set the logging of the following packages to the levels shown.: # log the sql statement org.hibernate.SQL=DEBUG # log the parameters org.hibernate.type=TRACE There will probably be some logger specific prefixes that are required. Log4j config:...
There is no simple way to obtain attributes from an interface, since classes does not inherit attributes from an interface. Whenever implementing an interface or overriding members in a derived class, you need to re-declare the attributes. So in the example below output would be True in all three c...
The first thing we need to do it add EventBus to our module's gradle file: dependencies { ... compile 'org.greenrobot:eventbus:3.0.0' ... } Now we need to create a model for our event. It can contain anything we want to pass along. For now we'll just make an empty class. public ...
Ordering the results and setting a limit can easily be achieved with 2 additional lines added to the chain, like so: $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*') ->from('#__users') ->where('username = '. $db->q('John')) ->ord...
Directives can be used to build reusable components. Here is an example of a "user box" component: userBox.js angular.module('simpleDirective', []).directive('userBox', function() { return { scope: { username: '=username', reputation: '=reputation' }, ...
Preliminary Install the Cordova cli tools, if you haven't already. $ npm install -g cordova Navigate to your desired working folder. $ cd /path/to/coding/folder Creating the application Create a new application $ cordova create <appProjectName> <appNameSpace> <appName> For ...
The following function is returning another function as its result which can be later assigned to a variable and called: func jediTrainer () -> ((String, Int) -> String) { func train(name: String, times: Int) -> (String) { return "\(name) has been trained in the Force \(times)...
Often in R you'll want to know things about an object or variable you're working with. This can be useful when reading someone else's code or even your own, especially when using packages that are new to you. Suppose we create a variable a: a <- matrix(1:9, 3, 3) What data type is this? Yo...
2 Dimensional arrays 6 In ES6, we can flatten the array by the spread operator ...: function flattenES6(arr) { return [].concat(...arr); } var arrL1 = [1, 2, [3, 4]]; console.log(flattenES6(arrL1)); // [1, 2, 3, 4] 5 In ES5, we can acheive that by .apply(): function flatten(arr) { ...
It may be a good idea to encapsulate the HTTP handling logic in its own class. The following class exposes a method for getting Posts. It calls the http.get() method and calls .map on the returned Observable to convert the Response object to a Post object. import {Injectable} from "@angular/co...
The first step in accessing a data source via ADO is creating an ADO Connection object. This is typically done using a connection string to specify the data source parameters, although it is also possible to open a DSN connection by passing the DSN, user ID, and password to the .Open method. Note t...
Dim stringOfSpaces As String 'Assign a string with 255 repeated spaces using Space$ stringOfSpaces = Space$(255) 'Assign a string with 255 repeated spaces using String$ stringOfSpaces = String$(255, " ")

Page 56 of 137