Tutorial by Examples

From ES5.1 onwards, you can use the native method Array.prototype.filter to loop through an array and leave only entries that pass a given callback function. In the following example, our callback checks if the given value occurs in the array. If it does, it is a duplicate and will not be copied to...
var arr = [1, 2, 3, 4]; Method 1 Creates a new array and overwrites the existing array reference with a new one. arr = []; Care must be taken as this does not remove any items from the original array. The array may have been closed over when passed to a function. The array will remain in mem...
The <div> element usually has no specific semantic meaning by itself, simply representing a division, and is typically used for grouping and encapsulating other elements within an HTML document and separating those from other groups of content. As such, each <div> is best described by it...
C++11 In the header file: // widget.h #include <memory> // std::unique_ptr #include <experimental/propagate_const> class Widget { public: Widget(); ~Widget(); void DoSomething(); private: // the pImpl idiom is named after the typ...
This query will return all COLUMNS and their associated TABLES for a given column name. It is designed to show you what tables (unknown) contain a specified column (known) SELECT c.name AS ColName, t.name AS TableName FROM sys.columns c JOIN sys.tables t ON c.object_id = t.o...
$this->helper('checkout/url')->getCartUrl(); OR Mage::helper('checkout/url')->getCartUrl();
$this->helper('checkout/url')->getCheckoutUrl(); OR Mage::helper('checkout/url')->getCheckoutUrl();
$this->helper('customer/data')->getLoginUrl(); OR Mage::helper('customer/data')->getLoginUrl();
$this->helper('customer/data')->getLogoutUrl(); OR Mage::helper('customer/data')->getLogoutUrl();
$this->helper('customer/data')->getForgotPasswordUrl(); OR Mage::helper('customer/data')->getForgotPasswordUrl();
$this->helper('customer/data')->getAccountUrl(); OR Mage::helper('customer/data')->getAccountUrl();
The easiest way to get started with Gremlin is to install the Gremlin Console. The Gremlin Console is a REPL that allows immediate feedback on the results of Gremlin traversals. As a prerequisite, Java 8 is required for the Gremlin Console to run. Ensure that it is installed prior to moving forward...
Detailed instructions on getting titan set up or installed.
Writes to the trace listeners in the Listeners collection when the application is compiled in debug configuration. public static void Main(string[] args) { Debug.WriteLine("Hello"); } In Visual Studio or Xamarin Studio this will appear in the Application Output window. This is d...
You can redirect the debug output to a text file by adding a TextWriterTraceListener to the Debug.Listeners collection. public static void Main(string[] args) { TextWriterTraceListener myWriter = new TextWriterTraceListener(@"debug.txt"); Debug.Listeners.Add(myWriter); Deb...
return http://www.example.com/skin/frontend/{interface}/{theme}/images/my-image.jpg
System time gives you the CPU time required to execute a R expression, for example: system.time(print("hello world")) # [1] "hello world" # user system elapsed # 0 0 0 You can add larger pieces of code through use of braces: system.time({ li...
At its simplest, proc.time() gives the total elapsed CPU time in seconds for the current process. Executing it in the console gives the following type of output: proc.time() # user system elapsed # 284.507 120.397 515029.305 This is particularly useful for benchmarking s...
One package for line profiling is lineprof which is written and maintained by Hadley Wickham. Here is a quick demonstration of how it works with auto.arima in the forecast package: library(lineprof) library(forecast) l <- lineprof(auto.arima(AirPassengers)) shine(l) This will provide you...
First choose your auth strategy and add it to your Gemfile. You can find a list of strategies here: https://github.com/intridea/omniauth/wiki/List-of-Strategies gem 'omniauth-github', :github => 'intridea/omniauth-github' gem 'omniauth-openid', :github => 'intridea/omniauth-openid' You ca...

Page 265 of 1336