Tutorial by Examples: com

All DATEs have a time component; however, it is customary to store dates which do not need to include time information with the hours/minutes/seconds set to zero (i.e. midnight). Use an ANSI DATE literal (using ISO 8601 Date format): SELECT DATE '2000-01-01' FROM DUAL; Convert it from a string ...
Convert it from a string literal using TO_DATE(): SELECT TO_DATE( '2000-01-01 12:00:00', 'YYYY-MM-DD HH24:MI:SS' ) FROM DUAL; Or use a TIMESTAMP literal: CREATE TABLE date_table( date_value DATE ); INSERT INTO date_table ( date_value ) VALUES ( TIMESTAMP '2000-01-01 12:00:00' ); Oracl...
'Prefer composition over inheritance' is an important and popular programming principle, used to assign behaviors to objects, as opposed to inheriting many often unneeded behaviors. Behaviour factories var speaker = function (state) { var noise = state.noise || 'grunt'; return { ...
You can get list of available commands by following way: >>> python manage.py help If you don't understand any command or looking for optional arguments then you can use -h argument like this >>> python manage.py command_name -h Here command_name will be your desire command...
Similar to using an Object Declaration, you can define the main function of a Kotlin program using a Companion Object of a class. package my.program class App { companion object { @JvmStatic fun main(args: Array<String>) { println("Hello World") ...
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...
let minimumVersionString = "3.1.3" let versionComparison = UIDevice.current.systemVersion.compare(minimumVersionString, options: .numeric) switch versionComparison { case .orderedSame, .orderedDescending: //current version is >= (3.1.3) break case .orderedA...
Incoming data from JavaScript is going through Subscriptions. Elm side First, we need to define an incoming port, using the following syntax: port input : (Int -> msg) -> Sub msg We can use Sub.batch if we have multiple subscriptions, this example will only contain one Subscription to in...
import { Component } from '@angular/core'; @Component({ selector: 'my-app', template: ` <h1>Angular 2 App</h1> <p>Component is directive with template</p> ` }) export class AppComponent { }
Steps to Create component: Create a folder named components in your project root folder Create your component inside components folder e.g.: MyComponent.php namespace app\components; use Yii; use yii\base\Component; use yii\base\InvalidConfigException; class MyComponent ...
Create function in MyComponent.php namespace app\components; use Yii; use yii\base\Component; use yii\base\InvalidConfigException; use yii\helpers\Url; use yii\helpers\ArrayHelper; use app\models\User; class MyComponent extends Component ...
Note: it's strongly advised to use Composer. The instruction below is basically what Composer does for you. Download archive extension file of needed version from Github Open composer.json Find PSR-4 autoload section and remember it for e.g. kmit/select2 Extract files to corresponding fold...
You can use the following extension method for comparing the contents of two IList< T > instances of the same type. By default the items are compared based on their order within the list and the items themselves, passing false to the isOrdered parameter will compare only the items themselves ...
composer update composer update will update our dependencies as they are specified in composer.json. For example, if our project uses this configuration: "require": { "laravelcollective/html": "2.0.*" } Supposing we have actually installed the 2.0.1 version ...
compile built-in function can be used to precompile an expression to a code object; this code object can then be passed to eval. This will speed up the repeated executions of the evaluated code. The 3rd parameter to compile needs to be the string 'eval'. >>> code = compile('a * b + c', '&l...
To add annotations, hints, or exclude some code from being executed JavaScript provides two ways of commenting code lines Single line Comment // Everything after the // until the end of the line is excluded from execution. function elementAt( event ) { // Gets the element from Event coordinate...
Differences in subsetting syntax A data.table is one of several two-dimensional data structures available in R, besides data.frame, matrix and (2D) array. All of these classes use a very similar but not identical syntax for subsetting, the A[rows, cols] schema. Consider the following data stored i...
There are 4 methods for comparing NSDates in Objective-C: - (BOOL)isEqualToDate:(NSDate *)anotherDate - (NSDate *)earlierDate:(NSDate *)anotherDate - (NSDate *)laterDate:(NSDate *)anotherDate - (NSComparisonResult)compare:(NSDate *)anotherDate Consider the following example using 2 dates, N...
Show the changes between the tip of new and the tip of original: git diff original new # equivalent to original..new Show all changes on new since it branched from original: git diff original...new # equivalent to $(git merge-base original new)..new Using only one parameter such as ...
{ echo "contents of home directory" ls ~ } > output.txt

Page 12 of 65