Tutorial by Examples: c

module.exports.routes = { 'GET /foo': 'FooController.index', 'GET /foo/new': 'FooController.new', 'POST /foo/create': 'FooController.create', 'GET /foo/:id/edit': 'FooController.edit', 'PUT /foo/:id/update': 'FooController.update', 'GET /foo/:id': 'FooController.show', ...
module.exports.routes = { '/foo': '/bar', 'GET /google': 'http://www.google.com' };
module.exports.routes = { // This function will be executed for all http verbs on all urls 'all /*', function (req, res, next) { // Expose the function `fooBar` to all views (via the locals object) res.locals.fooBar = function (arg1) { return 'foobar' + arg1; }; }, };...
module.exports.routes = { 'GET /foo/*': { fn: function(req, res) { res.send("FOO!"); }, skipAssets: true }, };
Consider using Extension Methods as Functions which wrap other code, here's a great example that uses both a static method and and extension method to wrap the Try Catch construct. Make your code Bullet Proof... using System; using System.Diagnostics; namespace Samples { /// <summary&g...
Database connections are set up using the CF Administrator tool. See Database Connections for how to connect a datasource. To execute queries all you need is the <cfquery> tag. The <cfquery> tag connects to and opens the database for you, all you need to do is supply it with the name of...
Many database configurations require authentication (in the form of a username and password) before you can query the database. You can supply these using the username and password attributes. Note: the username and password can also be configured against the datasource in the ColdFusion Administra...
A cached query is a query that has its results stored in the server's memory. The results are stored when the query is first run. From then on, whenever that query is requested again, ColdFusion will retrieve the results from memory. You can cache a query using the cachedAfter attribute. If the que...
You can limit the number of rows to be returned by using the maxrows attribute. <cfquery datasource="Entertainment" maxrows="50"> select * from Movies </cfquery>
create destination with <a id="destinationLinkName"></a> link to destination [link text](#destinationLinkName)
Virtual Methods are methods in Java that are non-static and without the keyword Final in front. All methods by default are virtual in Java. Virtual Methods play important roles in Polymorphism because children classes in Java can override their parent classes' methods if the function being overriden...
Structures in Rust are defined using the struct keyword. The most common form of structure consists of a set of named fields: struct Foo { my_bool: bool, my_num: isize, my_string: String, } The above declares a struct with three fields: my_bool, my_num, and my_string, of the type...
Consider the following struct definitions: struct Foo { my_bool: bool, my_num: isize, my_string: String, } struct Bar (bool, isize, String); struct Baz; Constructing new structure values for these types is straightforward: let foo = Foo { my_bool: true, my_num: 42, my_string: ...
To declare methods on a struct (i.e., functions that can be called "on" the struct, or values of that struct type), create an impl block: impl Foo { fn fiddle(&self) { // "self" refers to the value this method is being called on println!("fiddling...
Structures can be made generic over one or more type parameters. These types are given enclosed in <> when referring to the type: struct Gen<T> { x: T, z: isize, } // ... let _: Gen<bool> = Gen{x: true, z: 1}; let _: Gen<isize> = Gen{x: 42, z: 2}; let _: Gen...
async and await are two operators that are intended to improve performance by freeing up Threads and waiting for operations to complete before moving forward. Here's an example of getting a string before returning it's length: //This method is async because: //1. It has async and Task or Task<...
C.I.A.s are intended as a simple way of getting attributes from whatever is calling the targeted method. There is really only 1 way to use them and there are only 3 attributes. Example: //This is the "calling method": the method that is calling the target method public void doProcess() ...
Example showing how to create Guis using functions instead of labels. Gui, Add, Button, gCtrlEvent vButton1, Button 1 Gui, Add, Button, gCtrlEvent vButton2, Button 2 Gui, Add, Button, gGoButton, Go Button Gui, Add, Edit, vEditField, Example text Gui, Show,, Functions instead of labels CtrlEv...
In Haskell, all functions are considered curried: that is, all functions in Haskell take just one argument. Let's take the function div: div :: Int -> Int -> Int If we call this function with 6 and 2 we unsurprisingly get 3: Prelude> div 6 2 3 However, this doesn't quite behave in...
You cam amend the time of a commit using git commit --amend --date="Thu Jul 28 11:30 2016 -0400" or even git commit --amend --date="now"

Page 386 of 826