string literals are defined by wrapping the value with double-quotes ":
string s = "hello, this is a string literal";
String literals may contain escape sequences. See String Escape Sequences
Additionally, C# supports verbatim string literals (See Verbatim Strings). These are def...
ulong literals are defined by using the suffix UL, ul, Ul, uL, LU, lu, Lu, or lU, or by using an integral values within the range of ulong:
ulong ul = 5UL;
let rec factorial n = match n with
| 0 | 1 -> 1
| n -> n * (factorial (n - 1))
This function matches on both the values 0 and 1 and maps them to the base case of our recursive definition. Then all other numbers map to the recursive call of this function.
boot -d seancorfield/boot-new new -t app -n <appname>
This command will tell boot to grab the task boot-new from https://github.com/seancorfield/boot-new and execute the task with the app template (see link for other templates). The task will create a new directory called <appname> wi...
Consider the following C# code
Expression<Func<int, int>> expression = a => a + 1;
Because the C# compiler sees that the lambda expression is assigned to an Expression type rather than a delegate type it generates an expression tree roughly equivalent to this code
ParameterExpres...
Member functions of a class can be declared const, which tells the compiler and future readers that this function will not modify the object:
class MyClass
{
private:
int myInt_;
public:
int myInt() const { return myInt_; }
void setMyInt(int myInt) { myInt_ = myInt; }
};
In a ...
document.getElementsByClassName('class-name')
will retrieve
<a class="class-name">Any</a>
<b class="class-name">tag</b>
<div class="class-name an-extra-class">with that class.</div>
If no existing elements contain the given c...
document.getElementsByTagName('b')
will retrieve
<b>All</b>
<b>of</b>
<b>the b elements.</b>
If no elements with the given tag name exist, an empty collection will be returned.
Hashes can be freely converted to and from arrays. Converting a hash of key/value pairs into an array will produce an array containing nested arrays for pair:
{ :a => 1, :b => 2 }.to_a # => [[:a, 1], [:b, 2]]
In the opposite direction a Hash can be created from an array of the same form...
Basics
Anonymous functions are a powerful tool of the MATLAB language. They are functions that exist locally, that is: in the current workspace. However, they do not exist on the MATLAB path like a regular function would, e.g. in an m-file. That is why they are called anonymous, although they can h...
Firebase Authentication allows the users of your app to sign-in with social providers or their email+password. But what if you want to store additional information about a user, beyond what Firebase Authentication allows you to specify?
Or what if you want to display a list of the users in your app...
Complete the Installation and setup part. This will create the project in Firebase console and will also install the base SDK in your Android App.
Add the dependency for Firebase Realtime Database to your app-level build.gradle file:
compile 'com.google.firebase:firebase-database:9.4.0'
N...
<link rel="stylesheet" href="test.css" media="print">
Media specifies what style sheet should be used for what type of media. Using the print value would only display that style sheet for print pages.
The value of this attribute can be any of the mediatype val...
This will create a folder with the same name as the project, i.e. /My.Project.Name
$ git tfs clone http://tfs:8080/tfs/DefaultCollection/ $/My.Project.Name
Cloning from a git repository is ten times faster than cloning directly from TFVS and works well in a team environment. At least one team member will have to create the bare git repository by doing the regular git-tfs clone first. Then the new repository can be bootstrapped to work with TFVS.
$ git...
The following assumes you will use kdiff3 for file diffing and although not essential it is a good idea.
C:\> choco install kdiff3
Git can be installed first so you can state any parameters you wish. Here all the Unix tools are also installed and 'NoAutoCrlf' means checkout as is, commit as i...
The std::borrow::Borrow and std::borrow::BorrowMut traits are used to treat borrowed types like owned types. For types A and B,
impl Borrow<B> for A
indicates that a borrowed A may be used where a B is desired. For instance, std::collections::HashMap.get() uses Borrow for its get() method,...