Tutorial by Examples: 1

The sum 20 + 21 + 22 + ... + 2n-1 simplifies to 2n - 1. This explains why the maximum value that can be stored in an unsigned 32-bit integer is 232 - 1.
The sum of the geometric series r0 + r1 + r2 + ... + rn-1 In the case where r ≠ 1, simplifies to (rn - 1) / (r - 1). If r < 1, this sum is bounded from above by 1 / (1 - r). If r = 1, this sum is rn.
'use strict'; // This is an example of a /api/controllers/HomeController.js module.exports = { // This is the index action and the route is mapped via /config/routes.js index(req, res) { // Return a view without view model data // This typically will return the view defined at /v...
'use strict'; const co = require('co'); module.exports = { // This is the index action and the route is mapped via /config/routes.js index(req, res) { co(function* index() { // Return a view without view model data // This typically will return the view defined at /vie...
Configure your app's URLconf to automatically use a URL namespace by setting the app_name attribute: # In <myapp>/urls.py from django.conf.urls import url from .views import overview app_name = 'myapp' urlpatterns = [ url(r'^$', overview, name='overview'), ] This will set t...
<svg width="900px" height="400px" viewBox="900 400"> <defs> <filter id="GaussianHardEdge" x="0%" y="0%" width="100%" height="100%"> <feGaussianBlur stdDeviation="5"/&gt...
perl -ne'print if 5..10' file.txt
In SQL Server 2016 finally they have introduced Split string function : STRING_SPLIT Parameters: It accepts two parameters String: Is an expression of any character type (i.e. nvarchar, varchar, nchar or char). separator : Is a single character expression of any character type (e.g. nv...
set myVariable [expr { $myVariable * 17 }] This shows how you can use a simple expression to update a variable. The expr command does not update the variable for you; you need to take its result and write it to the variable with set. Note that newlines are not important in the little language un...
1. Print the Hadoop version hadoop version 2. List the contents of the root directory in HDFS hadoop fs -ls / 3. Report the amount of space used and available on currently mounted filesystem hadoop fs -df hdfs:/ 4. Count the number of directories,files and bytes under the paths tha...
Step 1: Create a new Rails app gem install rails -v 4.1 rails new angular_example Step 2: Remove Turbolinks Removing turbolinks requires removing it from the Gemfile. gem 'turbolinks' Remove the require from app/assets/javascripts/application.js: //= require turbolinks Step 3: Add Angu...
If you want to migrate from existing log4j 1.x in your project to log4j 2.x then remove all existing log4j 1.x dependencies and add the following dependency: Log4j 1.x API Bridge Maven Build <dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> ...
The AND keyword is used to add more conditions to the query. NameAgeGenderSam18MJohn21MBob22MMary23F SELECT name FROM persons WHERE gender = 'M' AND age > 20; This will return: NameJohnBob using OR keyword SELECT name FROM persons WHERE gender = 'M' OR age < 20; This will return: n...
Note: There will be some Objective-c in this example.. We will make a wrapper to C++ in this example, So don't worry to much about it. First start Xcode and create a project. And select a Cocoa application Delete all sources except the Info.plist file.(Your app won't work without it) Creat...
Option Base is used to declare the default lower bound of array elements. It is declared at module level and is valid only for the current module. By default (and thus if no Option Base is specified), the Base is 0. Which means that the first element of any array declared in the module has an index...
Contains the subpattern from the corresponding set of parentheses in the last successful pattern matched, not counting patterns matched in nested blocks that have been exited already, or nil if the last pattern match failed. These variables are all read-only.
This error occurs when tables are not adequately structured to handle the speedy lookup verification of Foreign Key (FK) requirements that the developer is mandating. CREATE TABLE `gtType` ( `type` char(2) NOT NULL, `description` varchar(1000) NOT NULL, PRIMARY KEY (`type`) ) ENGINE=InnoD...
The easiest way to install and manage various versions of Ruby with rbenv is to use the ruby-build plugin. First clone the rbenv repository to your home directory: $ git clone https://github.com/rbenv/rbenv.git ~/.rbenv Then clone the ruby-build plugin: $ git clone https://github.com/rbenv/rub...
Introduction Unity has a few 'specially named' folders that allows for a variety of uses. One of these folders is called 'Resources' The 'Resources' folder is one of only TWO ways of loading assets at runtime in Unity (The other being AssetBundles (Unity Docs) The 'Resources' folder can reside an...
Here is a tested code for image and video.It will work for all APIs less than 19 and greater than 19 as well. Image: if (Build.VERSION.SDK_INT <= 19) { Intent i = new Intent(); i.setType("image/*"); i.setAction...

Page 4 of 16