Tutorial by Examples: f

float literals are defined by using the suffix F or f, or by using a real number: float f = 30.5F;
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.
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...
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...
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...
Launch the Check In dialog for TFVS. $ git tfs checkintool This will take all of your local commits and create a single check-in.
Push all local commits to the TFVS remote. $ git tfs rcheckin Note: this will fail if Check-in Notes are required. These can be bypassed by adding git-tfs-force: rcheckin to the commit message.
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::ops::Deref and std::ops::DerefMut traits are used for overloading the dereference operator, *x. For types A and B, impl Deref<Target=B> for A indicates that dereferencing a binding of &A will yield a &B and, impl DerefMut for A indicates that dereferencing a binding of...
Unlike the other helpers, this one uses static class helpers to serialize and deserialize, hence it is a little bit easier than the others to use. using Newtonsoft.Json; var rawJSON = "{\"Name\":\"Fibonacci Sequence\",\"Numbers\":[0, 1, 1, 2, 3, 5, 8, 13]}...
A simple example defining a Function that gets triggered by a Queue message: public static void StringMessage([QueueTrigger("my_queue")] string plainText) { //... } It also supports POCO serialization: public static void POCOMessage([QueueTrigger("my_queue")] MyPO...
A simple example of a Function that gets triggered when a Azure Storage Blob is modified: public static async Task BlobTrigger( [BlobTrigger("my_container/{name}.{ext}")] Stream input, string name, string ext) { //Blob with name {name} and extension {ext} using (StreamRead...
extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; #[derive(Serialize)] struct Person { #[serde(rename="firstName")] first_name: String, #[serde(rename="lastName")] last_name: String, } fn main() { let person = ...
Meteor Tool To check the installed version of the Meteor tool, just run the following command outside of any Meteor projects: meteor --version To get a list of all official (recommended) Meteor releases, run: meteor show METEOR Meteor Projects If you want to check the project version of Me...
<!DOCTYPE html> <html> <head> <title>My Leaflet Map</title> <link rel="stylesheet" href="//unpkg.com/[email protected]/dist/leaflet.css" /> <style type="text/css"> #map { height: 500px; ...
Using escaped brackets, you can define a capturing group in a pattern that can be backreferenced in the substitution string with \1: $ echo Hello world! | sed 's/\(Hello\) world!/\1 sed/' Hello sed With multiple groups: $ echo one two three | sed 's/\(one\) \(two\) \(three\)/\3 \2 \1/' three ...

Page 108 of 457