Tutorial by Examples

On a desktop version of Chrome, the contents of the page can be inspected. This shows the document object model (DOM) of the HTML, the Cascading Style Sheet styles (CSS), and much more. Enter inspection by one of many options: Right click on a web page, and select Inspect From the Chrome Menu, ...
$ProductCollection=Mage::getModel('catalog/product')->getCollection(); Selecting the specific Attribute $ProductCollection->addAttributeToSelect(array('name', 'product_url', 'small_image')); Selecting the All Attribute $ProductCollection->addAttributeToSelect('*'); Add Filter on ...
What is a metaclass? In Python, everything is an object: integers, strings, lists, even functions and classes themselves are objects. And every object is an instance of a class. To check the class of an object x, one can call type(x), so: >>> type(5) <type 'int'> >>> typ...
You may have heard that everything in Python is an object. It is true, and all objects have a class: >>> type(1) int The literal 1 is an instance of int. Lets declare a class: >>> class Foo(object): ... pass ... Now lets instantiate it: >>> bar = Foo() Wh...
Let's assume we have an entity status field with 3 options Tentative Pending Approved Our goal is to show different color for each status as follow: Tentative will be Red Pending will be Orange Approved will be Green The switch condition: =Switch(Fields!ItemStatus.Value = "Tentativ...
Q. Why we need compilation? Ans. We need compilation for achieving higher level of efficiency of our Angular applications. Take a look at the following example, // ... compile: function (el, scope) { var dirs = this._getElDirectives(el); var dir; var scopeCreated; dirs.forEach(functi...
module main; auto getMemberNames(T)() @safe pure { string[] members; foreach (derived; __traits(derivedMembers, T)) { members ~= derived; } return members; } class Foo { int a; int b; } class Bar : Foo { int c; int d; int e...
// get product collection object $productCollection = Mage::getResourceModel('catalog/product_collection'); // get customer collection object $customerCollection = Mage::getResourceModel('customer/customer_collection'); // get order collection object $orderCollection = M...
Dependencies can be added for specific Build types: android { ... buildTypes { release { //... } debug { //.... } } } dependencies { debugCompile 'com.android.support:appcompat-v7:24.1.1' releaseCompile ...
Template Literals act like strings with special features. They are enclosed by by the back-tick `` and can be spanned across multiple lines. Template Literals can contain embedded expressions too. These expressions are indicated by a $ sign and curly braces {} //A single line Template Literal v...
Three main functions available (description from man pages): fromfile - A highly efficient way of reading binary data with a known data-type, as well as parsing simply formatted text files. Data written using the tofile method can be read using this function. genfromtxt - Load data from a t...
<!DOCTYPE html> <html> <head> <title>Styled Maps</title> <meta charset="utf-8"> <style> #map { height: 100%; } </style> </head> <body> <div id="map"></div> <script type="t...
As for any programming language, Ada comes with extensive libraries to accomplish various tasks. Here are some pointers to some of them, although searching on github will lead some more. The Ada runtime itself, distributed will all compilers, includes an extensive set of packages and annexes, r...
To compile a PHP extension in a typical Linux environment, there are a few pre-requisites: Basic Unix skills (being able to operate "make" and a C compiler) An ANSI C compiler The source code for the PHP extension you want to compile Generally there are two ways to compile a PHP ex...
A Producer is some monadic action that can yield values for downstream consumption: type Producer b = Proxy X () () b yield :: Monad m => a -> Producer a m () For example: naturals :: Monad m => Producer Int m () naturals = each [1..] -- each is a utility function exported by Pipes ...
A Consumer can only await values from upstream. type Consumer a = Proxy () a () X await :: Monad m => Consumer a m a For example: fancyPrint :: MonadIO m => Consumer String m () fancyPrint = forever $ do numStr <- await liftIO $ putStrLn ("I received: " ++ numStr) ...
Pipes can both await and yield. type Pipe a b = Proxy () a () b This Pipe awaits an Int and converts it to a String: intToStr :: Monad m => Pipe Int String m () intToStr = forever $ await >>= (yield . show)
We use runEffect to run our Pipe: main :: IO () main = do runEffect $ naturalsUntil 10 >-> intToStr >-> fancyPrint Note that runEffect requires an Effect, which is a self-contained Proxy with no inputs or outputs: runEffect :: Monad m => Effect m r -> m r type Effect = Pr...
To run script in debug mode you should add -d option in the command line: $perl -d script.pl If t is specified, it indicates to the debugger that threads will be used in the code being debugged: $perl -dt script.pl Additional info at perldocperlrun
Sometimes a complex IF condition is needed. Let's take and example, Assuming we have the following raw data: ItemIDItem NameItem Status1Item 1Tentative1Item 1Pending1Item 1Approved The Goal is: Let's assume our business user ask to see which items are not approved and which are approved. Tentati...

Page 920 of 1336