Tutorial by Examples: c

"dependencies": { "module-name": "0.1.0" } exact: 0.1.0 will install that specific version of the module. newest minor version: ^0.1.0 will install the newest minor version, for example 0.2.0, but won't install a module with a higher major version e.g. 1.0.0 newe...
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: ...
ReactJS is an open-source, component based front end library responsible only for the view layer of the application. It is maintained by Facebook. ReactJS uses virtual DOM based mechanism to fill in data (views) in HTML DOM. The virtual DOM works fast owning to the fact that it only changes individ...
Post::find()->all(); // SELECT * FROM post or the shorthand (Returns an active record model instance by a primary key or an array of column values.) Post::findAll(condition); returns an array of ActiveRecord instances. Find All with where Condition $model = User::find() ->w...
OPERATORS $postsGreaterThan = Post::find()->where(['>', 'created_at', '2016-01-25'])->all(); // SELECT * FROM post WHERE created_at > '2016-01-25' $postsLessThan = Post::find()->where(['<', 'created_at', '2016-01-25'])->all(); // SELECT * FROM post WHERE created_at < '2...
<?php namespace models; use yii\db\ActiveRecord; use yii\behaviors\TimestampBehavior; class Post extends ActiveRecord { public static function tableName() { return 'post'; } public function rules() { ...
Generators can be used to implement coroutines: # create and advance generator to the first yield def coroutine(func): def start(*args,**kwargs): cr = func(*args,**kwargs) next(cr) return cr return start # example coroutine @coroutine def adder(sum = 0): ...
To get your most recent stash after running git stash, use git stash apply To see a list of your stashes, use git stash list You will get a list that looks something like this stash@{0}: WIP on master: 67a4e01 Merge tests into develop stash@{1}: WIP on master: 70f0d95 Add user role to lo...
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() ...
The Oracle SQL and PL/SQL || operator allows you to concatenate 2 or more strings together. Example: Assuming the following customers table: id firstname lastname --- ----------- ---------- 1 Thomas Woody Query: SELECT firstname || ' ' || lastname || ' is in my database.' a...
Interaction with the history # List all previous commands history # Clear the history, useful if you entered a password by accident history -c Event designators # Expands to line n of bash history !n # Expands to last command !! # Expands to last command starting with "text&qu...
Prerequisites Installation
Prerequisites iOS 7 or later, macOS 10.9 or later, all versions of tvOS and watchOS. Xcode 7.3 or later required. Installation Download the latest release of Realm files from here or from Github link and extract the zip. Navigate to ios/static/ directory Drag Realm.framework to t...
The second value in the curly braces dictates the length of the replacement string. By adjusting the second value to be positive or negative, the alignment of the string can be changed. string.Format("LEFT: string: ->{0,-5}<- int: ->{1,-5}<-", "abc", 123); string....
// Integral types as hex string.Format("Hexadecimal: byte2: {0:x2}; byte4: {0:X4}; char: {1:x2}", 123, (int)'A'); // Integers with thousand separators string.Format("Integer, thousand sep.: {0:#,#}; fixed length: >{0,10:#,#}<", 1234567); // Integer with leading zero...
Use existing .NET classes instantly with PowerShell by using [class]::Method(args): PS C:\> [guid]::NewGuid() Guid ---- 8874a185-64be-43ed-a64c-d2fe4b6e31bc Similarly, in PowerShell 5+ you may use the New-Guid cmdlet: PS C:\> New-Guid Guid ---- 8874a185-64be-43ed-a64c-d2fe4b6e31...
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...
Boxed value types can only be unboxed into their original Type, even if a conversion of the two Types is valid, e.g.: object boxedInt = (int)1; // int boxed in an object long unboxedInt1 = (long)boxedInt; // invalid cast This can be avoided by first unboxing into the original Type, e.g.: lon...
The fetch function does not send cookies by default. There are two possible ways to send cookies: Only send cookies if the URL is on the same origin as the calling script. fetch('/login', { credentials: 'same-origin' }) Always send cookies, even for cross-origin calls. fetch('htt...

Page 115 of 826