Tutorial by Examples

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...
Java does not have a Char Stream, so when working with Strings and constructing a Stream of Characters, an option is to get a IntStream of code points using String.codePoints() method. So IntStream can be obtained as below: public IntStream stringToIntStream(String in) { return in.codePoints(); ...
1 + 2 # Addition 1 - 2 # Subtraction -1 # Set negative value 1 * 2 # Multiplication 1 / 2 # Division 1 % 2 # Modulus 100 -shl 2 # Bitwise Shift-left 100 -shr 1 # Bitwise Shift-right
-and # Logical and -or # Logical or -xor # Logical exclusive or -not # Logical not ! # Logical not
Simple arithmetic: $var = 1 # Assignment. Sets the value of a variable to the specified value $var += 2 # Addition. Increases the value of a variable by the specified value $var -= 1 # Subtraction. Decreases the value of a variable by the specified value $var *= 2 # Multiplicati...
PowerShell comparison operators are comprised of a leading dash (-) followed by a name (eq for equal, gt for greater than, etc...). Names can be preceded by special characters to modify the behavior of the operator: i # Case-Insensitive Explicit (-ieq) c # Case-Sensitive Explicit (-ceq) Case-I...
Success output stream: cmdlet > file # Send success output to file, overwriting existing content cmdlet >> file # Send success output to file, appending to existing content cmdlet 1>&2 # Send success and error output to error stream Error output stream: cmdlet 2&g...
Configure your project-level build.gradle to include the android-apt plugin: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1' } } Then, apply the android-apt plugin in your module-level build...
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...
The border-spacing property determines the spacing between cells. This has no effect unless border-collapse is set to separate. Below an example of two tables with different values to the border-spacing property: The table on the left has border-spacing: 2px (default) while the one on the right ...
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) say, speak = method.to_s.split("_") if say == "say" speak else super end end end => a = Animal.new => a.say_moo => "moo" => a.shout_moo => NoMethodE...
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"
class Animal def method_missing(method, *args, &block) say, speak = method.to_s.split("_") if say == "say" && speak return speak.upcase if args.first == "shout" speak else super end end end => Animal.new....
FrameLayout is designed to block out an area on the screen to display a single item. You can, however, add multiple children to a FrameLayout and control their position within the FrameLayout by assigning gravity to each child, using the android:layout_gravity attribute. Generally, FrameLayout is ...

Page 130 of 1336