Tutorial by Examples

You can chain any number of else if statements to an existing if statement, to evaluate a sequence of statements. index.pug - var page = 60; if page => 52 h1 Lots of numbers! else if page > 26 && page < 52 h1 A few numbers else h1 Not a lot of numbers index.pu...
unless is the inverse operation of if in Pug. It is analogous to if !(statement). index.pug - var likesCookies = true; unless likesCookies === true h2 You don't like cookies :( else h2 You like cookies! index.pug output <h1>You like cookies!</h1> Note: else unless st...
rails new my_app cd my_app Gemfile gem 'friendly_id', '~> 5.1.0' # Note: You MUST use 5.0.0 or greater for Rails 4.0+ rails generate friendly_id rails generate scaffold user name:string slug:string:uniq rake db:migrate edit app/models/user.rb class User < ApplicationRecord exten...
For a class-less React component: function SomeComponent(props){ const ITEMS = ['cat', 'dog', 'rat'] function getItemsList(){ return ITEMS.map(item => <li key={item}>{item}</i>); } return ( <ul> {getItemsList()} ...
The string type allows you to store text, which is a series of characters. There are multiple ways to create strings. A literal string is created by writing the text between double quotes. text := "Hello World" Because Go strings support UTF-8, the previous example is perfectly valid. ...
Package fmt implements functions to print and format text using format verbs. Verbs are represented with a percent sign. General verbs: %v // the value in a default format // when printing structs, the plus flag (%+v) adds field names %#v // a Go-syntax representation of the value %T...
Getting started with Ext JS 6. Prerequisite steps: Download Sencha Cmd 6 and install it with sencha command set in environment path variables. Download trail version of Sencha SDK (ext-6.2.1.zip) and unzip it.(on location D:\ext-6.2.1) System is ready to create Extjs 6 application. Create ...
Since you need to sort & rename the fields, the best option will be the Sort Component in the Data Flow task (like you mentioned) . If you only want to rename columns, then use the "Derived Column" component. The Sort component should look as follows: In my example, you can see the ...
Installation of a vmod requires an installed version of Varnish Cache, including the development files. Requirements can be found in the Varnish documentation. Source code is built with autotools: sudo apt-get install libvarnishapi-dev || sudo yum install varnish-libs-devel ./bootstrap # If run...
Varnish controls and manipulates HTTP requests using Varnish Configuration Language (VCL). The following snippet of VCL removes cookie from incoming requests to /images subdirectory: sub vcl_recv { if (req.url ~ "^/images") { unset req.http.cookie; } }
The easiest way to create a style is to copy an existing one and edit it. Create a simple window with two buttons: <Window x:Class="WPF_Style_Example.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsof...
Taking the previous example, removing the x:Key element of the style applies the style to all buttons in the Application scope. <Style TargetType="{x:Type Button}"> <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> ...
Starting with the following ComboBoxes: <Window x:Class="WPF_Style_Example.ComboBoxWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft....
Having lots of styles in App.xaml will quickly become complex, so they can be placed in separate resource dictionaries. In order to use the dictionary, it must be merged with App.xaml. So, in App.xaml, after the resource dictionary has been created: <Application xmlns="http://s...
The following Window has been created: <Window x:Class="WPF_Style_Example.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/e...
Note: This setup guide assumes that you have Java and Eclipse already installed on your machine. If you do not, download the latest version of the Java Development Kit (henceforth referred to as the JDK) and the latest version of Eclipse (Neon 3 at time of writing). Step One: Downloading LWJGL To...
An example configuration for a hub: java -jar selenium-server-standalone-<version>.jar -role hub -hubConfig hubConfig.json { "_comment" : "Configuration for Hub - hubConfig.json", "host": ip, "maxSessions": 5, "port": 4444...
Here we will see a simple example of using the MessagingCenter in Xamarin.Forms. First, let's have a look at subscribing to a message. In the FooMessaging model we subscribe to a message coming from the MainPage. The message should be "Hi" and when we receive it, we register a handler wh...
You can also pass arguments with a message to work with. We will use the classed from our previous example and extend them. In the receiving part, right behind the Subscribe method call add the type of the argument you are expecting. Also make sure you also declare the arguments in the handler sign...
When you no longer need to receive messages, you can simply unsubscribe. You can do it like this: MessagingCenter.Unsubscribe<MainPage> (this, "Hi"); When you are supplying arguments, you have to unsubscribe from the complete signature, like this: MessagingCenter.Unsubscribe<Ma...

Page 1213 of 1336