Tutorial by Examples

When it comes to maps, usually SCSS is the easier syntax. Because Sass is indent-based, your maps have to be saved in one line. // in Sass maps are "unreadable" $white: ( white-50: rgba(255, 255, 255, .1), white-100: rgba(255, 255, 255, .2), white-200: rgba(255, 255, 255, .3), white-30...
Use charAt() to get a character at the specified index in the string. var string = "Hello, World!"; console.log( string.charAt(4) ); // "o" Alternatively, because strings can be treated like arrays, use the index via bracket notation. var string = "Hello, World!";...
CREATE TABLE person ( person_id BIGINT NOT NULL, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255), address VARCHAR(255), city VARCHAR(255), PRIMARY KEY (person_id) ); Alternatively, you can place the PRIMARY KEY constraint directly in the column definition: ...
OrientDB is available in two editions: Community Edition is released as an open source project under the Apache 2 license. This license allows unrestricted free usage for both open source and commercial projects. Enterprise Edition is commercial software built on top of the Community Edit...
In ASP.NET Web API, a controller is a class that handles HTTP requests. The public methods of the controller are called action methods or simply actions. When the Web API framework receives a request, it routes the request to an action. To determine which action to invoke, the framework uses a rou...
To load a bundled image: package com.example; public class ExampleApplication { private Image getIcon() throws IOException { URL imageURL = ExampleApplication.class.getResource("icon.png"); return ImageIO.read(imageURL); } }
Syntax is: REVERSE ( string-expression ) SELECT REVERSE('Hello') --returns olleH
<template name="myTemplate"> {{#each results}} <div><span>{{name}}</span><span>{{age}}</span></div> {{/each}} </template> Template.myTemplate.onCreated(function() { this.results = new ReactiveVar(); Meteor.call('myMethod'...
Cross join does a Cartesian product of the two members, A Cartesian product means each row of one table is combined with each row of the second table in the join. For example, if TABLEA has 20 rows and TABLEB has 20 rows, the result would be 20*20 = 400 output rows. Using example database SELECT d...
A template autorun may be used to (re)subscribe to a publication. It establishes a reactive context which is re-executed whenever any reactive data it depends on changes. In addition, an autorun always runs once (the first time it is executed). Template autoruns are normally put in an onCreated met...
Everything to the right of // in the same line is commented. int i = 0; // Commented out text
CREATE FUNCTION FirstWord (@input varchar(1000)) RETURNS varchar(1000) AS BEGIN DECLARE @output varchar(1000) SET @output = SUBSTRING(@input, 0, CASE CHARINDEX(' ', @input) WHEN 0 THEN LEN(@input) + 1 ELSE CHARINDEX(' ', @input) END) RETURN @output END ...
Sometimes a term is defined in multiple sections of the manual. By default, man will only display the first page it finds, which can be annoying for programmers because C functions are documented in a later section than commands and system calls. Use the following to display all pages that match a...
You can use the Substring method to get any number of characters from a string at any given location. However, if you only want a single character, you can use the string indexer to get a single character at any given index like you do with an array: string s = "hello"; char c = s[1]; //...
Let us build a simple control, a rating widget, intended to be used as: <rating min="0" max="5" nullifier="true" ng-model="data.rating"></rating> No fancy CSS for now; this would render as: 0 1 2 3 4 5 x Clicking on a number selects that ra...
NSString *htmlString = @"<p> This is an <b>HTML</b> text</p>"; NSAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithData: [htmlString dataUsingEncoding:NSUnicodeStringEncoding] ...
When you need to pass a collection into a Java method: import scala.collection.JavaConverters._ val scalaList = List(1, 2, 3) JavaLibrary.process(scalaList.asJava) If the Java code returns a Java collection, you can turn it into a Scala collection in a similar manner: import scala.collectio...
To create minification-safe angular controllers, you will change the controller function parameters. The second argument in the module.controller function should be passed an array, where the last parameter is the controller function, and every parameter before that is the name of each injected val...
defmodule Math do # We start of by passing the sum/1 function a list of numbers. def sum(numbers) do do_sum(numbers, 0) end # Recurse over the list when it contains at least one element. # We break the list up into two parts: # head: the first element of the list # ta...
.gitignore ignores files locally, but it is intended to be committed to the repository and shared with other contributors and users. You can set a global .gitignore, but then all your repositories would share those settings. If you want to ignore certain files in a repository locally and not make t...

Page 303 of 1336