Tutorial by Examples

Data item is stored in packed decimal format in COMP-3. Packed-decimal format means that each byte of storage (except for the low order byte) can contain two decimal numbers. The low-order byte contains one digit in the leftmost portion and the sign (positive or negative) in the rightmost portion. ...
PSR-4 is an accepted recommendation that outlines the standard for autoloading classes via filenames. This recommendation is recommended as the alternative to the earlier (and now deprecated) PSR-0. The fully qualified class name should match the following requirement: \<NamespaceName>(\&lt...
PSR-1 is an accepted recommendation and outlines a basic standard recommendation for how code should be written. It outlines naming convetions for classes, methods and constants. It makes adopting PSR-0 or PSR-4 recommendations a requirement. It indicates which PHP tags to use: <?php and &lt...
PSR-8 is a spoof PSR (currently in Draft) proposed by Larry Garfield as an April Fools joke on 1 April 2014. The draft outlines how to define an interface to make an object Huggable. Excert from the code outline: <?php namespace Psr\Hug; /** * Defines a huggable object. * * A hugga...
1 2 3 <public publicId="-//OASIS//DTD DocBook XML V4.5//EN" 4 uri="docbook45/docbookx.dtd"/> <system systemId="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" 5 uri="docbook45/docbookx.dtd"/> <system ...
datepicker-overview-example.html: <md-input-container> <input mdInput [mdDatepicker]="picker" [(ngModel)]="date" placeholder="Choose a date"> <button mdSuffix [mdDatepickerToggle]="picker"></button&gt...
datepicker-overview-example.html: <md-input-container> <input mdInput [mdDatepicker]="picker" placeholder="Choose a date" [(ngModel)]="value"> <button mdSuffix [mdDatepickerToggle]="picker"></button> </md-input-container&...
This example also includes the use of properties: min max startAt startView touchUi datepicker-overview-example.html: <h2>Options</h2> <p> <md-checkbox [(ngModel)]="touch">Use touch UI</md-checkbox> <md-checkbox [(ngModel)]="filterOdd...
Most of the times, validation attributes are use inside frameworks (such as ASP.NET). Those frameworks take care of executing the validation attributes. But what if you want to execute validation attributes manually? Just use the Validator class (no reflection needed). Validation Context Any valid...
This example requires MdDialogRef and MD_DIALOG_DATA. Please import them in the component module. import {MdDialog, MdDialogRef, MD_DIALOG_DATA} from '@angular/material'; input-overview-example.html: <md-input-container> <input mdInput [(ngModel)]="id" ...
Batch file does not come with a built-in method for replacing nth line of a file except replace and append(> and >>). Using for loops, we can emulate this kind of function. @echo off set file=new2.txt call :replaceLine "%file%" 3 "stringResult" type "%file...
JSON data { "name" : { "first" : "Joe", "last" : "Sixpack" }, "gender" : "MALE", "verified" : false, "userImage" : "keliuyue" } It takes two lines of Java to turn it into a User insta...
Here the process initiated this call will sleep for 1 second.
There are benefits to switching the root view controller, although the transition options are limited to those supported by UIViewAnimationOptions, so depending on how you wish to transition between flows might mean you have to implement a custom transition - which can be cumbersome. You can show t...
In the most straightforward implementation, the Onboarding flow can simply be presented in a modal context, since semantically the User is on a single journey. [Apple Human Interface Guidelines – Modality][1]: Consider creating a modal context only when it’s critical to get someone’s attention, ...
So the most used functions on Clojure map and filter have been modified to return transducers (composable algorithmic transformations), if not called with a collection. That means: (map inc) returns a transducer and so does (filter odd?) The advantage: the functions can be composed into a single f...
Generating simple blog engine rails plugin new [engine name] --mountable Famous engines examples are Device (authentication gem for rails) Spree (Ecommerce)
Here, we have created a user-defined exception called CustomError which is derived from the Exception class. This new exception can be raised, like other exceptions, using the raise statement with an optional error message. class CustomError(Exception): pass x = 1 if x == 1: rais...
This example shows how to catch custom Exception class CustomError(Exception): pass try: raise CustomError('Can you catch me ?') except CustomError as e: print ('Catched CustomError :{}'.format(e)) except Exception as e: print ('Generic exception: {}'.format(e)) Output:...
In this example, function will return as soon as value var has 1 def func(params): for value in params: print ('Got value {}'.format(value)) if value == 1: # Returns from function as soon as value is 1 print (">>>> Got 1") ...

Page 1327 of 1336