Tutorial by Examples

This example will show you how you can resolve data fetched from a service before rendering your application's view. Uses angular/router 3.0.0-beta.2 at the time of writing users.service.ts ... import { Http, Response } from '@angular/http'; import { Observable } from 'rxjs/Rx'; import { User ...
using System; using System.IO; public class Program { public static void Main() { string filePath = "somePath"; if(File.Exists(filePath)) { Console.WriteLine("Exists"); } else ...
Structured Query Language (SQL) is a special-purpose programming language designed for managing data held in a Relational Database Management System (RDBMS). SQL-like languages can also be used in Relational Data Stream Management Systems (RDSMS), or in "not-only SQL" (NoSQL) databases. ...
Methods are defined with the def keyword, followed by the method name and an optional list of parameter names in parentheses. The Ruby code between def and end represents the body of the method. def hello(name) "Hello, #{name}" end A method invocation specifies the method name, the...
Many functions in Ruby accept a block as an argument. E.g.: [0, 1, 2].map {|i| i + 1} => [1, 2, 3] If you already have a function that does what you want, you can turn it into a block using &method(:fn): def inc(num) num + 1 end [0, 1, 2].map &method(:inc) => [1, 2, 3]...
There are three basic rules of semicolon insertion: When, as the program is parsed from left to right, a token (called the offending token) is encountered that is not allowed by any production of the grammar, then a semicolon is automatically inserted before the offending token if one or more o...
empty statement var statement expression statement do-while statement continue statement break statement return statement throw statement Examples: When the end of the input stream of tokens is encountered and the parser is unable to parse the input token stream as a single complete Pro...
$string = "a;b;c\nd;e;f"; // $1, $2 and $3 represent the first, second and third capturing groups echo preg_replace("(^([^;]+);([^;]+);([^;]+)$)m", "$3;$2;$1", $string); Outputs c;b;a f;e;d Searches for everything between semicolons and reverses the order.
// 1. Instantiate an AlertDialog.Builder with its constructor // the parameter this is the context (usually your activity) AlertDialog.Builder builder = new AlertDialog.Builder(this); // 2. Chain together various setter methods to set the dialog characteristics builder.SetMessage(Resource.Str...
Cursors enable you to itterate results of query one by line. DECLARE command is used to init cursor and associate it with a specific SQL query: DECLARE student CURSOR FOR SELECT name FROM studend; Let's say we sell products of some types. We want to count how many products of each type are exis...
HBase Standalone is a mode which allow you to get rid of HDFS and to test HBase before deploying in a cluster, It is not production oriented. Installing HBase in standalone is extremely simple. First you have to download the HBase archive named hbase-X.X.X-bin.tar.gz available on one of the apache ...
In performing parsing, before starting, the grammar for the language needs to be specified. A source of tokens is also needed for the parser. The parser could be hand-written code, or a parser generator tool could be used. If a parser generator tool is used, then that tool will need to be downloade...
WPF introduces a very handy concept: The ability to store data as a resource, either locally for a control, locally for the entire window or globally for the entire application. The data can be pretty much whatever you want, from actual information to a hierarchy of WPF controls. This allows you to ...
Sharing a simple string was easy, but you can do much more. In this example, I'll also store a complete array of strings, along with a gradient brush to be used for the background. This should give you a pretty good idea of just how much you can do with resources: <Window x:Class="WPFApplic...
If you only need a given resource for a specific control, you can make it more local by adding it to this specific control, instead of the window. It works exactly the same way, the only difference being that you can now only access from inside the scope of the control where you put it: <StackPa...
In this example, we'll be accessing three different resources from Code-behind, each stored in a different scope App.xaml: <Application x:Class="WpfSamples.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http:/...
Polymorphism is one of the pillar of OOP. Poly derives from a Greek term which means 'multiple forms'. Below is an example which exhibits Polymorphism. The class Vehicle takes multiple forms as a base class. The Derived classes Ducati and Lamborghini inherits from Vehicle and overrides the base cl...
in this way '0' representing the known values ​​are ranked first, '1' representing the NULL values ​​are sorted by the last: SELECT ID ,REGION ,CITY ,DEPARTMENT ,EMPLOYEES_NUMBER FROM DEPT ORDER BY CASE WHEN REGION IS NULL THEN 1 ELSE 0 END, REGION ...
If you need to send events from fragment to activity, one of the possible solutions is to define callback interface and require that the host activity implement it. Example Send callback to an activity, when fragment's button clicked First of all, define callback interface: public interface Samp...
This is an example for how to handle dynamic key for response. Here A and B are dynamic keys it can be anything Response { "response": [ { "A": [ { "name": "Tango" }, { "name": "P...

Page 589 of 1336