Tutorial by Examples: ed

nuget sources add -name feedname -source http://sourcefeedurl
Since Git 1.7.12 it is possible to rebase down to the root commit. The root commit is the first commit ever made in a repository, and normally cannot be edited. Use the following command: git rebase -i --root
To move data you first insert it into the target, then delete whatever you inserted from the source table. This is not a normal SQL operation but it may be enlightening What did you insert? Normally in databases you need to have one or more columns that you can use to uniquely identify rows so we w...
You can access SharedPreferences in several ways: Get the default SharedPreferences file: import android.preference.PreferenceManager; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); Get a specific SharedPreferences file: public static final String PREF_FILE_NAM...
The display CSS property is fundamental for controlling the layout and flow of an HTML document. Most elements have a default display value of either block or inline (though some elements have other default values). Inline An inline element occupies only as much width as necessary. It stacks horiz...
A Sub is a procedure that performs a specific task but does not return a specific value. Sub ProcedureName ([argument_list]) [statements] End Sub If no access modifier is specified, a procedure is Public by default. A Function is a procedure that is given data and returns a value, ideally...
A class designed to be inherited-from is called a Base class. Care should be taken with the special member functions of such a class. A class designed to be used polymorphically at run-time (through a pointer to the base class) should declare the destructor virtual. This allows the derived parts of...
An unnamed namespace can be used to ensure names have internal linkage (can only be referred to by the current translation unit). Such a namespace is defined in the same way as any other namespace, but without the name: namespace { int foo = 42; } foo is only visible in the translation uni...
Predefined macros are those that the compiler defines (in contrast to those user defines in the source file). Those macros must not be re-defined or undefined by user. The following macros are predefined by the C++ standard: __LINE__ contains the line number of the line this macro is used on, an...
An alternative to extending Enumeration is using sealed case objects: sealed trait WeekDay object WeekDay { case object Mon extends WeekDay case object Tue extends WeekDay case object Wed extends WeekDay case object Thu extends WeekDay case object Fri extends WeekDay case objec...
Functions can either be named or unnamed (anonymous functions): var namedSum = function sum (a, b) { // named return a + b; } var anonSum = function (a, b) { // anonymous return a + b; } namedSum(1, 3); anonSum(1, 3); 4 4 But their names are private to their own scope: ...
Freddy is a JSON parsing library maintained by Big Nerd Ranch. It has three principal benefits: Type Safety: Helps you work with sending and receiving JSON in a way that prevents runtime crashes. Idiomatic: Takes advantage of Swift's generics, enumerations, and functional features, without...
Custom Font Support Applications that want to use custom fonts can now include those fonts in their application bundle and register those fonts with the system by including the UIAppFonts key in their Info.plist file. The value of this key is an array of strings identifying the font files in the ...
getPreferences(int) returns the preferences saved by Activity's class name as described in the docs : Retrieve a SharedPreferences object for accessing preferences that are private to this activity. This simply calls the underlying getSharedPreferences(String, int) method by passing in this acti...
<p contenteditable>This is an editable paragraph.</p> Upon clicking on the paragraph, the content of it can be edited similar to an input text field. When the contenteditable attribute is not set on an element, the element will inherit it from its parent. So all child text of a conte...
Look at the contents of /etc/redhat-release cat /etc/redhat-release Here is the output from a Fedora 24 machine: Fedora release 24 (Twenty Four) As mentioned in the debian-based response, you can also use the lsb_release -a command, which outputs this from a Fedora 24 machine: LSB Version: ...
<?php namespace models; use yii\db\ActiveRecord; use yii\behaviors\TimestampBehavior; class Post extends ActiveRecord { public static function tableName() { return 'post'; } public function rules() { ...
You have to keep the operator precedence in mind when using await keyword. Imagine that we have an asynchronous function which calls another asynchronous function, getUnicorn() which returns a Promise that resolves to an instance of class Unicorn. Now we want to get the size of the unicorn using th...
async functions do not replace the Promise type; they add language keywords that make promises easier to call. They are interchangeable: async function doAsyncThing() { ... } function doPromiseThing(input) { return new Promise((r, x) => ...); } // Call with promise syntax doAsyncThing() ...
If value types are assigned to variables of type object they are boxed - the value is stored in an instance of a System.Object. This can lead to unintended consequences when comparing values with ==, e.g.: object left = (int)1; // int in an object box object right = (int)1; // int in an object bo...

Page 18 of 145