.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...
The REPLICATE function concatenates a string with itself a specified number of times.
Syntax is: REPLICATE ( string-expression , integer )
SELECT REPLICATE ('Hello',4) --returns 'HelloHelloHelloHello'
A metatable defines a set of operations which alter the behaviour of a lua object. A metatable is just an ordinary table, which is used in a special way.
local meta = { } -- create a table for use as metatable
-- a metatable can change the behaviour of many things
-- here we modify the 'tostrin...
Some metamethods don't have to be functions. To most important example for this is the __index metamethod. It can also be a table, which is then used as lookup. This is quite commonly used in the creation of classes in lua. Here, a table (often the metatable itself) is used to hold all the operation...
5.2
Objects in lua are garbage collected. Sometimes, you need to free some resource, want to print a message or do something else when an object is destroyed (collected). For this, you can use the __gc metamethod, which gets called with the object as argument when the object is destroyed. You could...
There is a metamethod called __call, which defines the bevahiour of the object upon being used as a function, e.g. object(). This can be used to create function objects:
-- create the metatable with a __call metamethod
local meta = {
__call = function(self)
self.i = self.i + 1
e...
Perhaps the most important use of metatables is the possibility to change the indexing of tables. For this, there are two actions to consider: reading the content and writing the content of the table. Note that both actions are only triggered if the corresponding key is not present in the table.
Re...
Sometimes, you don't want to trigger metamethods, but really write or read exactly the given key, without some clever functions wrapped around the access. For this, lua provides you with raw table access methods:
-- first, set up a metatable that allows no read/write access
local meta = {
__i...
In C# 5.0 and earlier the developer could only suppress warnings by number. With the introduction of Roslyn Analyzers, C# needs a way to disable warnings issued from specific libraries. With C# 6.0 the pragma directive can suppress warnings by name.
Before:
#pragma warning disable 0501
C# 6.0:
...
Ionic Framework
A Cross-platform mobile application development framework using Angular JS and Front End web technologies.
Official website: http://ionicframework.com/
Documentation: http://ionicframework.com/docs/
Installation and Setup
Installation
Ionic required NPM(Node Package Manager) an...
import std.format;
void main() {
string s = "Name Surname 18";
string name, surname;
int age;
formattedRead(s, "%s %s %s", &name, &surname, &age);
// %s selects a format based on the corresponding argument's type
}
Official documentatio...
To get template item by template Id.
TemplateItem templateItem = Sitecore.Context.Database.GetTemplate(new ID("{11111111-1111-1111-1111-111111111111}"));
Input the name of the template to get the template by using GetTemplate Method.
TemplateItem templateItem = Sitecore.Context.Database.GetTemplate("NameOfTheTemplate");
While you can create LaTeX documents using any editor and compiling using the console, there exist several plugins for widely used editors to simplify creating LaTeX documents, and there are specialized LaTeX editors. An exhaustive list of LaTeX editors is available on TeX.SE (the StackExchange site...
Sent when an application's close button is clicked. Do not confuse this with WM_DESTROY which is sent when a window will be destroyed. The main difference lies in the fact that closing may be canceled in WM_CLOSE (think of Microsoft Word asking to save your changes), versus that destroying is when t...
When you have an input with well defined boundaries and are expecting more than one match in your string, you have two options:
Using lazy quantifiers;
Using a negated character class.
Consider the following:
You have a simple templating engine, you want to replace substrings like $[foo] whe...
In comparison to regular classes – case classes notation provides several benefits:
All constructor arguments are public and can be accessed on initialized objects (normally this is not the case, as demonstrated here):
case class Dog1(age: Int)
val x = Dog1(18)
println(x.age) // 18 (success!...
[^0-9a-zA-Z]
This will match all characters that are neither numbers nor letters (alphanumerical characters). If the underscore character _ is also to be negated, the expression can be shortened to:
[^\w]
Or:
\W
In the following sentences:
Hi, what's up?
I can't wait for 2017!...