Tutorial by Examples: a

Below is and HTML page <html> <head> <title>Select Example by Index value</title> </head> <body> <select name="Travel"><option value="0" selected> Please select</option> <option value="1">Car</option&...
A minimal Flask application looks something like this: from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello World!" A large Flask application can separate one file into multiple files by blueprints. Purpose Make it easier for ...
Go to Main.cs file in iOS project and change existed code, like presented below: static void Main(string[] args) { try { UIApplication.Main(args, null, "AppDelegate"); } catch (Exception ex) { Debug.WriteLine(...
let doc = require('dynamodb-doc'); let dynamo = new doc.DynamoDB(); var tblName = "MyTable"; exports.handler = (event, context, callback) => { readOperation(context); } function readOperation(cnxt) { var params = { TableName: tblName, Key: { "id": ...
class MySubClass(np.ndarray): def __new__(cls, input_array, info=None): obj = np.asarray(input_array).view(cls) obj.info = info return obj def __array_finalize__(self, obj): # handles MySubClass(...) if obj is None: pass ...
For a more real time solution you can use watchPosition function in Geolocation that notifies whenever an error or a position change occurs. Unlike the getCurrentPosition the watchPosition returns an Observable import {Geolocation} from 'ionic-native'; import template from './custom-component.htm...
Things are easy when you have to use a C++ library in a Python project. Just you can use Boost. First of all here is a list of components you need: A CMakeList.txt file, because you're going to use CMake. The C++ files of the C++ project. The python file - this is your python project. Let's...
Checking Requirements Run bin/symfony_requirements for checking symfony requirements and php cli setting. Install all packages that needed to run a symfony project. Setting your php.ini for example setting timezone and short_open_tag. Setting both php.ini for your php webserver (eg: /etc/php/apache...
<div class="container"> <h2>Alerts</h2> <div class="alert alert-success"> <strong>Success!</strong> </div> <div class="alert alert-info"> <strong>Info!</strong> </div> <div ...
The .fade and .in classes adds a fading effect when closing the alert message. <div class="alert alert-success fade in"> <a href="#" class="close" data-dismiss="alert" aria-label="close">×</a> <strong>Succ...
using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Interactivity; using System.Windows.Media; using System.Windows.Media.Imaging; namespace MyBehavior...
<UserControl x:Class="Example.View" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"...
Before understand require to follow some setup for project integrate with firebase. Create your project in Firebase Console and download google-service.json file from console and put it in app level module of your project, Follow link for Create Project in console After this we require to...
Assume the following enum: enum Operation { Multiply(left : Int, right : Int); } Enum matching can be performed as follows: var result = switch(Multiply(1, 3)) { case Multiply(_, 0): 0; case Multiply(0, _): 0; case Multiply(l, r): l * r; } Ref...
Assume the following structure: var dog = { name : "Woofer", age : 7 }; Enum matching can be performed as follows: var message = switch(dog) { case { name : "Woofer" }: "I know you, Woofer!"; case _: "I don't know you, so...
var result = switch([1, 6]) { case [2, _]: "0"; case [_, 6]: "1"; case []: "2"; case [_, _, _]: "3"; case _: "4"; } References "Array matching", Haxe manual
The | operator can be used anywhere within patterns to describe multiple accepted patterns. If there is a captured variable in an or-pattern, it must appear in both its sub-patterns. var match = switch(7) { case 4 | 1: "0"; case 6 | 7: "1"; case _: "2"; ...
It is also possible to further restrict patterns with guards. These are defined by the case ... if(condition): syntax. var myArray = [7, 6]; var s = switch(myArray) { case [a, b] if (b > a): b + ">" +a; case [a, b]: b + "<=" +a; case _:...
Extractors are identified by the extractorExpression => match expression. Extractors consist of two parts, which are separated by the => operator. The left side can be any expression, where all occurrences of underscore _ are replaced with the currently matched value. The right side is a p...
This relies on the official consul docker image to run consul in clustered mode in a docker swarm with new swarm mode in Docker 1.12. This example is based on http://qnib.org/2016/08/11/consul-service/. Briefly the idea is to use two docker swarm services that talk to each other. This solves the pro...

Page 719 of 1099