Tutorial by Topics: o

Define a function with the function keyword: function f { } Define a function with (): f(){ } Define a function with both the function keyword and (): function f(){ }
Proc.new(block) lambda { |args| code } ->(arg1, arg2) { code } object.to_proc { |single_arg| code } do |arg, (key, value)| code end Be careful about operator precedence when you have a line with multiple methods chained, like: str = "abcdefg" puts str.gsub(/./) do |mat...
Conditional expressions, involving keywords such as if, else if, and else, provide Swift programs with the ability to perform different actions depending on a Boolean condition: True or False. This section covers the use of Swift conditionals, Boolean logic, and ternary statements. For more in...
Scala has first-class functions. Difference between functions and methods: A function is not a method in Scala: functions are a value, and may be assigned as such. Methods (created using def), on the other hand, must belong to a class, trait or object. Functions are compiled to a class exte...
Scope is the context in which variables live and can be accessed by other code in the same scope. Because JavaScript can largely be used as a functional programming language, knowing the scope of variables and functions is important as it helps to prevent bugs and unexpected behavior at runtime. ...
void session_abort ( void ) int session_cache_expire ([ string $new_cache_expire ] ) void session_commit ( void ) string session_create_id ([ string $prefix ] ) bool session_decode ( string $data ) bool session_destroy ( void ) string session_encode ( void ) int session_gc ( void ) array ...
There are many situations where it is useful to return several values from a function: for example, if you want to input an item and return the price and number in stock, this functionality could be useful. There are many ways to do this in C++, and most involve the STL. However, if you wish to avoi...
In Node.js, resource intensive operations such as I/O are performed asynchronously, but have a synchronous counterpart (e.g. there exists a fs.readFile and its counterpart is fs.readFileSync). Since Node is single-threaded, you should be careful when using synchronous operations, because they will...
Kotlin is a statically-typed object-oriented programming language developed by JetBrains primarily targeting the JVM. Kotlin is developed with the goals of being quick to compile, backwards-compatible, very type safe, and 100% interoperable with Java. Kotlin is also developed with the goal of prov...
Use context processors to add variables that are accessible anywhere in your templates. Specify a function, or functions that return dicts of the variables you want, then add those functions to TEMPLATE_CONTEXT_PROCESSORS.
import defaultMember from 'module'; import { memberA, memberB, ... } from 'module'; import * as module from 'module'; import { memberA as a, memberB, ... } from 'module'; import defaultMember, * as module from 'module'; import defaultMember, { moduleA, ... } from 'module'; import 'module'; ...
C++ file I/O is done via streams. The key abstractions are: std::istream for reading text. std::ostream for writing text. std::streambuf for reading or writing characters. Formatted input uses operator>>. Formatted output uses operator<<. Streams use std::locale, e.g., for details ...
The built-in collections package provides several specialized, flexible collection types that are both high-performance and provide alternatives to the general collection types of dict, list, tuple and set. The module also defines abstract base classes describing different types of collection functi...
An HTTP cookie is a small piece of data sent from a website and stored on the user's computer by the user's web browser while the user is browsing. bool setcookie( string $name [, string $value = "" [, int $expire = 0 [, string $path = "" [, string $domain = "" [,...
The $ character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interprete...
Classes and Objects are used to to make your code more efficient and less repetitive by grouping similar tasks. A class is used to define the actions and data structure used to build objects. The objects are then built using this predefined structure. class <ClassName> [ extends <Par...

Page 11 of 283