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 ...
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...
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...
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...
Rust's From trait is a general-purpose trait for converting between types. For any two types TypeA and TypeB,
impl From<TypeA> for TypeB
indicates that an instance of TypeB is guaranteed to be constructible from an instance of TypeA. An implementation of From looks like this:
struct TypeA...
std::convert::AsRef and std::convert::AsMut are used for cheaply converting types to references. For types A and B,
impl AsRef<B> for A
indicates that a &A can be converted to a &B and,
impl AsMut<B> for A
indicates that a &mut A can be converted to a &mut B.
Thi...
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,...