Tutorial by Examples: c

It is possible to limit the tests executed by manage.py test by specifying which modules should be discovered by the test runner: # Run only tests for the app names "app1" $ python manage.py test app1 # If you split the tests file into a module with several tests files for an app $ p...
Drupal Console The new CLI for Drupal. A tool to generate boilerplate code, interact with and debug Drupal. First, we need to install Drupal Console. Drupal Console is needed not only for this time, but for future installations. # Run this in your terminal to get the latest project version: cur...
<PROJECT_ROOT>\app\build.gradle is specific for app module. <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to all sub-projects/modules. If you use another module in your project, as a local library you would have another...
In Aurelia all HTML templates are defined inside of opening and closing <template></template> tags. All of your HTML and Aurelia specific logic goes inside of these template tags and cannot exist outside of them. <template> </template>
Each pair in the dictionary is an instance of KeyValuePair with the same type parameters as the Dictionary. When you loop through the dictionary with For Each, each iteration will give you one of the Key-Value Pairs stored in the dictionary. For Each kvp As KeyValuePair(Of String, String) In curren...
Dim extensions As New Dictionary(Of String, String) _ from { { "txt", "notepad" }, { "bmp", "paint" }, { "doc", "winword" } } This creates a dictionary and immediately fills it with three KeyValuePairs. You can also add new val...
Dictionaries are implemented in a Dict core library. A dictionary mapping unique keys to values. The keys can be any comparable type. This includes Int, Float, Time, Char, String, and tuples or lists of comparable types. Insert, remove, and query operations all take O(log n) time. Unlike Tu...
Comparable types are primitive types that can be compared using comparison operators from Basics module, like: (<), (>), (<=), (>=), max, min, compare Comparable types in Elm are Int, Float, Time, Char, String, and tuples or lists of comparable types. In documentation or type definitio...
Record is a set of key-value pairs. greeter = { isMorning: True , greeting: "Good morning!" } It is impossible to access a value by an non-existent key. It is impossible to dynamically modify Record's structure. Records only allow you to update values by constant keys....
Get width and height (excluding margin): var width = $('#target-element').outerWidth(); var height = $('#target-element').outerHeight(); Get width and height (including margin): var width = $('#target-element').outerWidth(true); var height = $('#target-element').outerHeight(true); Set widt...
For named (non-anonymous) functions, you can break when the function is executed. debug(functionName); The next time functionName function runs, the debugger will stop on its first line.
From your Mac, download and install Xcode from the Mac App Store following this link. After the installation is complete, open Xcode and select Get started with a Playground: On the next panel, you can give your Playground a name or you can leave it MyPlayground and press Next: Select a locat...
We will see how to center content based on the height of a near element. Compatibility: IE8+, all other modern browsers. HTML <div class="content"> <div class="position-container"> <div class="thumb"> <img src="http://lorempix...
The caption-side property determines the vertical positioning of the <caption> element within a table. This has no effect if such element does not exist. Below an example with two tables with different values set to the caption-side property: The table on the left has caption-side: top whi...
From the official documentation: Gradle. dependencies { compile "com.squareup.picasso:picasso:2.5.2" } Maven: <dependency> <groupId>com.squareup.picasso</groupId> <artifactId>picasso</artifactId> <version>2.5.2</version> </dep...
Picasso supports both download and error placeholders as optional features. Its also provides callbacks for handling the download result. Picasso.with(context) .load("YOUR IMAGE URL HERE") .placeholder(Your Drawable Resource) //this is optional the image to display while the url i...
Abstract factory pattern provides a way to obtain an coherent collection of objects through a collection of factories functions. As for every pattern, coupling is reduced by abstracting the way a set of objects are created, so that the user code is unaware of the many details of the objects he needs...
Factories can be used in conjunction with Inversion of Control (IoC) libraries too. The typical use case for such a factory is when we want to create an object based on parameters that are not known until run-time (such as the current User). In these cases it can be sometimes be difficult (if no...
Enumerating dictionaries allows you to run a block of code on each dictionary key-value pair using the method enumerateKeysAndObjectsUsingBlock:(void (^)(id key, id obj, BOOL *stop))block Example: NSDictionary stockSymbolsDictionary = @{ @"AAPL":...
import pandas.io.sql import pyodbc import pandas as pd Specify the parameters # Parameters server = 'server_name' db = 'database_name' UID = 'user_id' Create the connection # Create the connection conn = pyodbc.connect('DRIVER={SQL Server};SERVER=' + server + ';DATABASE=' + db + '; UID...

Page 165 of 826