Tutorial by Examples: cas

var MyDict = new Dictionary<string,T>(StringComparison.InvariantCultureIgnoreCase)
Arrays are objects, but their type is defined by the type of the contained objects. Therefore, one cannot just cast A[] to T[], but each A member of the specific A[] must be cast to a T object. Generic example: public static <T, A> T[] castArray(T[] target, A[] array) { for (int i = 0; i...
$a = "some string"; results in $a having the value some string. The result of an assignment expression is the value being assigned. Note that a single equal sign = is NOT for comparison! $a = 3; $b = ($a = 5); does the following: Line 1 assigns 3 to $a. Line 2 assigns 5 to $a....
String.prototype.toUpperCase(): console.log('qwerty'.toUpperCase()); // 'QWERTY'
String.prototype.toLowerCase() console.log('QWERTY'.toLowerCase()); // 'qwerty'
In normal mode: ~ inverts the case of the character under the cursor, gu{motion} lowercases the text covered by {motion}, gU{motion} uppercases the text covered by {motion} Example (^ marks the cursor position): Lorem ipsum dolor sit amet. ^ Lorem ipSum dolor sit amet. ~ Lorem...
A select case construct conditionally executes one block of constructs or statements depending on the value of a scalar expression in a select case statement. This control construct can be considered as a replacement for computed goto. [name:] SELECT CASE (expr) [CASE (case-value [, case-value] .....
Broadcast variables are read only shared objects which can be created with SparkContext.broadcast method: val broadcastVariable = sc.broadcast(Array(1, 2, 3)) and read using value method: val someRDD = sc.parallelize(Array(1, 2, 3, 4)) someRDD.map( i => broadcastVariable.value.apply(...
A syntactic extension that lets you write \case in place of \arg -> case arg of. Consider the following function definition: dayOfTheWeek :: Int -> String dayOfTheWeek 0 = "Sunday" dayOfTheWeek 1 = "Monday" dayOfTheWeek 2 = "Tuesday" dayOfTheWeek 3 = "W...
Select Case can be used when many different conditions are possible. The conditions are checked from top to bottom and only the first case that match will be executed. Sub TestCase() Dim MyVar As String Select Case MyVar 'We Select the Variable MyVar to Work with Case "...
Addition + and subtraction - operations can be used to combine delegate instances. The delegate contains a list of the assigned delegates. using System; using System.Reflection; using System.Reflection.Emit; namespace DelegatesExample { class MainClass { private delegate void MyD...
Uppercase and lowercase letters of the alphabet are equivalent in the Fortran character set. In other words, Fortran is case insensitive. This behavior is in contrast with case-sensitive languages, such as C++ and many others. As a consequence, the variables a and A are the same variable. In princ...
// *** Case Insensitive comparison with exact title match *** NSPredicate *filterByNameCIS = [NSPredicate predicateWithFormat:@"self.title LIKE[cd] %@",@"Tom and Jerry"]; NSLog(@"Filter By Name(CIS) : %@",[array filteredArrayUsingPredicate:filterByNameCIS]);
// *** Case sensitive with exact title match *** NSPredicate *filterByNameCS = [NSPredicate predicateWithFormat:@"self.title = %@",@"Tom and Jerry"]; NSLog(@"Filter By Name(CS) : %@",[array filteredArrayUsingPredicate:filterByNameCS]);
// *** Case Insensitive comparison with matching subset *** NSPredicate *filterByName = [NSPredicate predicateWithFormat:@"self.title CONTAINS[cd] %@",@"Tom"]; NSLog(@"Filter By Containing Name : %@",[array filteredArrayUsingPredicate:filterByName]);
data.table offers a wide range of possibilities to reshape your data both efficiently and easily For instance, while reshaping from long to wide you can both pass several variables into the value.var and into the fun.aggregate parameters at the same time library(data.table) #v>=1.9.6 DT <- ...
If the compiler can infer that an object can't be null at a certain point, you don't have to use the special operators anymore: var string: String? = "Hello!" print(string.length) // Compile error if(string != null) { // The compiler now knows that string can't be null print(...
function listener(e:Event):void { var m:MovieClip=e.target as MovieClip; m.x++; } If such a listener is attached to an object that's not a MovieClip descendant (for example, a Sprite), the typecast will fail, and any subsequent operations with its result will throw the 1009 error.
Ever wanted to call a multicast delegate but you want the entire invokation list to be called even if an exception occurs in any in the chain. Then you are in luck, I have created an extension method that does just that, throwing an AggregateException only after execution of the entire list complete...
case {1, 2} do {3, 4} -> "This clause won't match." {1, x} -> "This clause will match and bind x to 2 in this clause." _ -> "This clause would match any value." end case is only used to match the given pattern of the particular data...

Page 3 of 14