Tutorial by Examples: c

<cfscript> /*define collection*/ attributes = { "name": "Sales", "type": "text", "value": "Connection" }; for(attribute in attributes){ /* attribute variable will contain the key name of each key value ...
For example, if you are sending an email to a customer after starting a task, it's best to immediately redirect the user to the next page while queuing the email to be sent in the background. This will speed up the load time for the next page, since sending an email can sometimes take several second...
Each of Laravel's queue drivers are configured from the config/queue.php file. A queue driver is the handler for managing how to run a queued job, identifying whether the jobs succeeded or failed, and trying the job again if configured to do so. Out of the box, Laravel supports the following queue ...
Through the use of event types you can easily reduce code bloat that often occurs when defining events for many objects on stage by filtering events in 1 function rather than defining many event handling functions. Imagine we have 10 objects on stage named object1, object2 ... object10 You could d...
Sometimes it's a good idea to further secure your publishes by requiring a user login. Here is how you achieve this via Meteor. import { Recipes } from '../imports/api/recipes.js'; import { Meteor } from 'meteor/meteor'; Meteor.publish('recipes', function() { if(this.userId) { return Re...
char literals are defined by wrapping the value with single-quotes ': char c = 'h'; Character literals may contain escape sequences. See String Escape Sequences A character literal must be exactly one character long (after all escape sequences have been evaluated). Empty character literals are ...
decimal literals are defined by using the suffix M or m on a real number: decimal m = 30.5M;
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...
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.
This is a common gotcha with Laravel routes. Routes are matched in the order that they are declared. The first matching route is the one that is used. This example will work as expected: Route::get('/posts/{postId}/comments/{commentId}', 'CommentController@show'); Route::get('/posts/{postId}', 'P...
Stashing takes the dirty state of your working directory – that is, your modified tracked files and staged changes – and saves it on a stack of unfinished changes that you can reapply at any time. Stashing only modified files: Suppose you don't want to stash the staged files and only stash the mod...

Page 206 of 826