Tutorial by Examples: and

WampServer is a Windows web development environment. It allows you to create web applications with Apache2, PHP and a MySQL database. Alongside, PhpMyAdmin allows you to manage easily your databases. WampServer is available for free (under GPML license) in two distinct versions : 32 and 64 bits. Wa...
Groups can be configured under Suite and/or Test element of testng.xml. All groups which are marked as included in tesng.xml will be considered for execution, excluded one will be ignored. If a @Test method has multiple groups and from those groups if any single groups is excluded in testng.xml that...
with q command we could simplify a lot of tedious work in vim. example 1. generate array sequence (1 to 20). STEP 1. press i to enter insert mode, input 1 1 STEP 2. Record following action: "append the last number to the next line, and increment the number" type esc to exit input...
First of all you need to have IIS (Internet Information Services) installed and running on your machine; IIS isn't available by default, you have to add the characteristic from Control Panel -> Programs -> Windows Characteristics. Download the PHP version you like from http://windows.php.ne...
For example you want to use surfaceView in ng2-nativescript. As we don't have surfaceView in nativescript we should use placeholder. first we should import the requirements: import {Component} from "@angular/core"; import placeholder = require("ui/placeholder"); let applicat...
app.component.ts: import {Component,OnInit} from "@angular/core"; import placeholder = require("ui/placeholder"); let application= require("application"); @Component({ selector: "my-app", templateUrl: "app.component.html", }) export...
Below are examples of generating 5 random numbers using various probability distributions. Uniform distribution between 0 and 10 runif(5, min=0, max=10) [1] 2.1724399 8.9209930 6.1969249 9.3303321 2.4054102 Normal distribution with 0 mean and standard deviation of 1 rnorm(5, mean=0, sd=1) [1...
The -Command parameter is used to specify commands to be executed on launch. It supports multiple data inputs. -Command <string> You can specify commands to executed on launch as a string. Multiple semicolon ;-separated statements may be executed. >PowerShell.exe -Command "(Get-Date...
public static async Task<TResult> GetAnsync<TResult>(this Uri uri) { using (var client = new HttpClient()) { var message = await client.GetAsync(uri); if (!message.IsSuccessStatusCode) throw new Exception(); return message.ReadAsAsyn...
To use default values with **kwargs def fun(**kwargs): print kwargs.get('value', 0) fun() # print 0 fun(value=1) # print 1
from py2neo import authenticate, Graph, Node, Relationship authenticate("localhost:7474", "neo4j", "<pass>") graph = Graph() You have to make sure your Neo4j Database exists at localhost:7474 with the appropriate credentials. the graph object is your interfa...
Installation Installation of Log4j2 is as simple as putting log4j2 jar in application classpath. Though you might want to customize logs output through additional config file Configuration maven To add log4j to project in maven, add it's dependency: In pom.xml add following dependency: <dep...
Supposing you have setup a django project, and the settings file is in an app named main, this is how you initialize your code import os, sys # Setup environ sys.path.append(os.getcwd()) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings") # Setup django imp...
When we query our data, we often need more than one filter to get the exact data set we are looking for. In SQL, we handle this with AND and OR clauses. We can achieve the same thing with collections. To add an AND clause to your query, just simply add another method call. This will append the seco...
This uses the SwiftyDropbox library to upload a file from a NSFileHandle to the Dropbox account using upload sessions, handling every error case: import UIKit import SwiftyDropbox class ViewController: UIViewController { // filled in later in doUpload: var fileHandle : NSFileHandle?...
In Symfony, the built-in ChoiceType (and EntityType or DocumentType extending it), basicaly work with a constant choice list. If you want to make it work with ajax calls, you have to change them to accept any sumitted extra choices. How to start with an empty choice list ? When you build your...
BEGIN TRY -- start error handling BEGIN TRANSACTION; -- from here on transactions (modifictions) are not final -- start your statement(s) select 42/0 as ANSWER -- simple SQL Query with an error -- end your statement(s) COMMIT TRANSACTION; -- finalize all transa...
The first thing we need is to tell karma to use Webpack to read our tests, under a configuration we set for the webpack engine. Here, I am using babel because I write my code in ES6, you can change that for other flavors, such as Typescript. Or I use Pug (formerly Jade) templates, you don't have to....
Before reading and writing text files you should know what encoding to use. See the Perl Unicode Documentation for more details on encoding. Here we show the setting of UTF-8 as the default encoding and decoding for the function open. This is done by using the open pragma near the top of your code (...
SELECT 1,22,44 UNION SELECT 2,33,55 SELECT 1,22,44 UNION SELECT 2,33,55 UNION SELECT 2,33,55 The result is the same as above. use UNION ALL when SELECT 1,22,44 UNION SELECT 2,33,55 UNION ALL SELECT 2,33,55

Page 91 of 153