Tutorial by Examples: er

A higher-order function is one that takes another function as an argument or returns a function (or both). This is commonly done with lambdas, for example when passing a predicate to a LINQ Where clause: var results = data.Where(p => p.Items == 0); The Where() clause could receive many diffe...
Publications can be merged on the client, resulting in differently shaped documents within a single cursor. The following example represents how a user directory might publish a minimal amount of public data for users of an app, and provide a more detailed profile for the logged in user. // client...
function onOpen() { // Add a custom menu to run the script var ss = SpreadsheetApp.getActiveSpreadsheet(); var searchMenuEntries = [ {name: "Run", functionName: "search"}]; ss.addMenu("Get Files", searchMenuEntries); } function getFiles() { // Get...
PMF FOR THE BINOMIAL DISTRIBUTION Suppose that a fair die is rolled 10 times. What is the probability of throwing exactly two sixes? You can answer the question using the dbinom function: > dbinom(2, 10, 1/6) [1] 0.29071 PMF FOR THE POISSON DISTRIBUTION The number of sandwhich ordered in ...
Knitr is an R package that allows us to intermingle R code with LaTeX code. One way to achieve this is external code chunks. External code chunks allow us to develop/test R Scripts in an R development environment and then include the results in a report. It is a powerful organizational technique....
Instead of struct IShape { virtual ~IShape() = default; virtual void print() const = 0; virtual double area() const = 0; virtual double perimeter() const = 0; // .. and so on }; Visitors can be used: // The concrete shapes struct Square; struct Circle; // The v...
We try to extract imdb top chart movies and ratings R> library(RCurl) R> library(XML) R> url <- "http://www.imdb.com/chart/top" R> top <- getURL(url) R> parsed_top <- htmlParse(top, encoding = "UTF-8") R> top_table <- readHTMLTable(parsed_top)[...
The SilverStripe Grid Field Extensions Module has some very nice features to enhance the basic GridField... GridFieldAddExistingSearchButton - a more advanced search form for adding items GridFieldAddNewInlineButton - builds on GridFieldEditableColumns to allow inline creation of records. GridF...
The module Better Buttons for GridField adds new form actions and buttons to the GridField detail form. Save and add another: Create a record, and go right to adding another one, without having to click the back button, and then add again Save and close: Save the record and go back to list view ...
The module UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code. Main Features Construct a form using all major form fields (text, email, dropdown, radio, checkbox..) Ability to extend userforms from other modules to prov...
First thing to do is enable the mod rewrite on wamp go to Apache modules and scroll down the list If not showing tick enable it and then restart all servers. Linux users can also use below terminal command to enable rewrite module sudo a2enmod rewrite Then restart apache using: sudo service...
Cost centers are annotations on a Haskell program which can be added automatically by the GHC compiler -- using -fprot-auto -- or by a programmer using {-# SCC "name" #-} <expression>, where "name" is any name you wish and <expression> is any valid Haskell expression:...
SQL Server 2008 R2 Supported compound operators: += Add and assign -= Subtract and assign *= Multiply and assign /= Divide and assign %= Modulo and assign &= Bitwise AND and assign ^= Bitwise XOR and assign |= Bitwise OR and assign Example usage: DECLARE @test INT = 42; SET @test...
A class is also allowed to have static members, which can be either variables or functions. These are considered to be in the class' scope, but aren't treated as normal members; they have static storage duration (they exist from the start of the program to the end), aren't tied to a particular inst...
When you also want to expose metadata without a config file you can build on the example programmatically creating a ServiceHost: public ConsoleHost() { mHost = new ServiceHost(typeof(Example), new Uri("http://localhost:8000/Example"), new Uri("net.tcp://9000/Example")); ...
Scope guards allow executing statements at certain conditions if the current block is left. import core.stdc.stdlib; void main() { int* p = cast(int*)malloc(int.sizeof); scope(exit) free(p); }
You can move a container instead of copying it: void print(const std::vector<int>& vec) { for (auto&& val : vec) { std::cout << val << ", "; } std::cout << std::endl; } int main() { // initialize vec1 with 1, 2, 3, 4 and...
COPY is PostgreSQL's bulk-insert mechanism. It's a convenient way to transfer data between files and tables, but it's also far faster than INSERT when adding more than a few thousand rows at a time. Let's begin by creating sample data file. cat > samplet_data.csv 1,Yogesh 2,Raunak 3,Varun ...
Media queries allow one to apply CSS rules based on the type of device / media (e.g. screen, print or handheld) called media type, additional aspects of the device are described with media features such as the availability of color or viewport dimensions. General Structure of a Media Query @media ...
By default, the caret ^ metacharacter matches the position before the first character in the string. Given the string "charsequence" applied against the following patterns: /^char/ & /^sequence/, the engine will try to match as follows: /^char/ ^ - charsequence c - charsequ...

Page 186 of 417