Tutorial by Examples: l

ActionScript 3 can be used by installing the Adobe AIR SDK or Apache Flex SDK or as part Adobe's Animate CC product (formerly known as Flash Professional). Adobe Animate CC is a professional software solution that can be used to create AS3 projects using visual tools - once installed, no further st...
Classes have 3 types of methods: instance, singleton and class methods. Instance Methods These are methods that can be called from an instance of the class. class Thing def somemethod puts "something" end end foo = Thing.new # create an instance of the class foo.somemeth...
A while loop will evaluate a condition and if true will perform an action. As long as the condition evaluates to true the action will continue to be performed. while(condition){ code_block } The following example creates a loop that will count down from 10 to 0 $i = 10 while($i -ge 0){ ...
A command shell is a command line interface computer program to an operating system. Some Variants 1. Bash : Comes as default shell on ubuntu 2. KornShell(ksh) : To install ksh in Ubuntu $ sudo apt-get install ksh To start working with ksh $ ksh $ ps $$ PID TTY STAT ...
Detailed instructions on getting UWP set up or installed. Requirements Windows 10 Visual Studio 2015 Steps Download and custom install Visual Studio 2015, while making sure that Universal Windows App Development Toolsis selected along with its sub options:- a) Tools and Windows SDK b...
A custom extraction can be written by implementing the unapply method and returning a value of type Option: class Foo(val x: String) object Foo { def unapply(foo: Foo): Option[String] = Some(foo.x) } new Foo("42") match { case Foo(x) => x } // "42" The retur...
Example: Get a Stream of 30 elements, containing 21st to 50th (inclusive) element of a collection. final long n = 20L; // the number of elements to skip final long maxSize = 30L; // the number of elements the stream should be limited to final Stream<T> slice = collection.stream().skip(n).li...
Hash has a default value for keys that are requested but don't exist (nil): a = {} p a[ :b ] # => nil When creating a new Hash, one can specify the default: b = Hash.new 'puppy' p b[ :b ] # => 'puppy' Hash.new also takes a block, which allows you to automatically create n...
var object = { key1: 10, key2: 3, key3: 40, key4: 20 }; var array = []; for(var people in object) { array.push([people, object[people]]); } Now array is [ ["key1", 10], ["key2", 3], ["key3", 40], ["key4", 20] ] ...
Given the following array var array = [ ["key1", 10], ["key2", 3], ["key3", 40], ["key4", 20] ]; You can sort it sort it by number(second index) array.sort(function(a, b) { return a[1] - b[1]; }) 6 array.sort((a,b) => a[1] - b[1]);...
For security reasons, PowerShell is set up by default to only allow signed scripts to execute. Executing the following command will allow you to run unsigned scripts (you must run PowerShell as Administrator to do this). Set-ExecutionPolicy RemoteSigned Another way to run PowerShell scripts is t...
-and # Logical and -or # Logical or -xor # Logical exclusive or -not # Logical not ! # Logical not
split allows to divide a vector or a data.frame into buckets with regards to a factor/group variables. This ventilation into buckets takes the form of a list, that can then be used to apply group-wise computation (for loops or lapply/sapply). First example shows the usage of split on a vector: Con...
The table-layout property changes the algorithm that is used for the layout of a table. Below an example of two tables both set to width: 150px: The table on the left has table-layout: auto while the one on the right has table-layout: fixed. The former is wider than the specified width (210px in...
The border-collapse property determines if a tables' borders should be separated or merged. Below an example of two tables with different values to the border-collapse property: The table on the left has border-collapse: separate while the one on the right has border-collapse: collapse. ValueDe...
3.0 In Swift 3 there are multiple access-levels. This example uses them all except for open: public struct Car { public let make: String let model: String //Optional keyword: will automatically be "internal" private let fullName: String fileprivate var otherName...
public class SuperClass { private func secretMethod() {} } internal class SubClass: SuperClass { override internal func secretMethod() { super.secretMethod() } }
struct Square { private(set) var area = 0 var side: Int = 0 { didSet { area = side*side } } } public struct Square { public private(set) var area = 0 public var side: Int = 0 { didSet { area = side*side } ...
class Animal def method_missing(method, *args, &block) "Cannot call #{method} on Animal" end end => Animal.new.say_moo > "Cannot call say_moo on Animal"
class Animal def method_missing(method, *args, &block) if method.to_s == 'say' block.call else super end end end => Animal.new.say{ 'moo' } => "moo"

Page 83 of 861