Tutorial by Examples: c

[LayoutRenderer("hello-world")] public class HelloWorldLayoutRenderer : LayoutRenderer { /// <summary> /// I'm option and not required or default /// </summary> public string Config1 { get; set; } /// <summary> /// I'm required option. ...
To understand this example, it is recommended to have a brief idea about Bellman-Ford algorithm which can be found here Using Bellman-Ford algorithm, we can detect if there is a negative cycle in our graph. We know that, to find out the shortest path, we need to relax all the edges of the graph (V-...
declare is an internal command of bash. (internal command use help for displaying "manpage"). It is used to show and define variables or show function bodies. Syntax: declare [options] [name[=value]]... # options are used to define # an integer declare -i myInteger declare -i another...
Here is an example of a basic page using the Materialize CSS framework which incorporates the grid system and materialboxed. <!DOCTYPE html> <html> <head> <title>Materializecss Example webpage</title> <!--Import Google Icon Font--> <link href="ht...
Adjacency list is a collection of unordered lists used to represent a finite graph. Each list describes the set of neighbors of a vertex in a graph. It takes less memory to store graphs. Let's see a graph, and its adjacency matrix: Now we create a list using these values. This is called adjacen...
Descriptor objects can allow related object attributes to react to changes automatically. Suppose we want to model an oscillator with a given frequency (in Hertz) and period (in seconds). When we update the frequency we want the period to update, and when we update the period we want the frequency ...
use std::ops::Deref; use std::fmt::Debug; #[derive(Debug)] struct RichOption<T>(Option<T>); // wrapper struct impl<T> Deref for RichOption<T> { type Target = Option<T>; // Our wrapper struct will coerce into Option fn deref(&self) -> &Option...
For this example, we want to make sure that any Employee who is marked as a Project Resource also has an appropriate Labor Cost defined. // 1.0, Revealing Module pattern var myNamespace = myNamespace || {}; myNamespace.example = (function () { /** * User Event 1.0 example detailing...
After the record gets stored in the database, we want to inspect what was changed on the record. We'll do this inspection by comparing values between the old and new record instances. // 1.0, Revealing Module pattern var myNamespace = myNamespace || {}; myNamespace.example = (function () { ...
// 1.0 // Utilize the type argument and raw Strings to filter your // execution by the action function beforeLoad(type, form, request) { // Don't do anything on APPROVE // Note that `type` is an Object, so we must use ==, not === if (type == "approve") { return...
In SuiteScript 1.0, we retrieve the current execution context using nlapiGetContext().getExecutionContext(), then we compare the result to the appropriate raw Strings. // 1.0 in Revealing Module pattern var myNamespace = myNamespace || {}; myNamespace.example = (function () { var exports =...
Sometimes we need to collect data from google spreadsheets. We can use gspread and oauth2client libraries to collect data from google spreadsheets. Here is a example to collect data: Code: from __future__ import print_function import gspread from oauth2client.client import SignedJwtAssertionCred...
Apart from CSS, model, and binding selectors, protractor can also locate elements using xpath View <ul> <li><a href='http://www.google.com'>Go to google</a></li> </ul> Code var googleLink= element(by.xpath('//ul/li/a')); expect(element.getText()).to.event...
XPath selectors can be used to select elements with specific attributes, such as class, id, title etc. By Class View: <div class="HakunaMatata"> Hakuna Matata </div> Code: var theLionKing= element(by.xpath('//div[@class="HakunaMatata"]')); expect(theLionKing.g...
lib.pagetitle = TEXT lib.pagetitle.data = page : title
$productCollection = Mage::getModel('catalog/product')->getCollection(); Selecting the specific Attribute $productCollection->addAttributeToSelect(array('name', 'product_url', 'small_image')); Selecting the All Attributes $productCollection->addAttributeToSelect('*'); Add Filter ...
Elastic Beanstalk (EB) is essentially a hybrid between Golden AMIs and CloudFormation, while vastly simplifying the learning curve of Puppet or Chef. An Elastic Beanstalk deployment is broken down into two components: Application and Environment. Application Consider this your top-level groupin...
Blue/Green deployment is a release technique that reduces downtime and risk by running two identical production environments (one called "Blue", the other called "Green"). At any one time, only one of the environments is serving live traffic, while the other is sitting idle. Whe...
Creating a new array is slightly confusing, as there is no real identifier for an array in awk. So, an array cannot really be initialised with our AWK code. An array in awk is associative, meaning that any string or number can be a key. This means that the array is more like a key-value pair dictio...
The following example will contain a block of code that is meant to be split into several source files, as denoted by // filename comments. Source Files // my_function.h /* Note how this header contains only a declaration of a function. * Header functions usually do not define implementations...

Page 600 of 826