Tutorial by Examples: is

This can be used in various chat applications, rss feeds, and social apps where you need to have latest feeds with timestamps: Objective-C - (NSString *)getHistoricTimeText:(NSDate *)since { NSString *str; NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:since]; if(in...
Enables the use of local type inference in declaring variables. What is type inference? You can declare local variables without explicitly stating a data type. The compiler infers the data type of a variable from the type of its initialization expression. Option Infer On: Dim aString = "12...
Document level It is on by default, but you can set it by placing Option Infer On|Off at the top of the code file. The option will apply to the whole document. Project level You can switch it on/off via the menu in Visual Studio: Project > [Project] Properties > Compile Tab > Option i...
Sub Main() Dim People = New List(Of String)({"Bob Barker", "Ricky Bobby", "Jeff Bridges"}) Console.WriteLine(People.Contains("Rick James")) Console.WriteLine(People.Contains("Ricky Bobby")) Console.WriteLine(Pe...
There is an example of listing content : tar -tvf archive.tar The option -t is used for the listing. For listing the content of a tar.gz archive, you have to use the -z option anymore : tar -tzvf archive.tar.gz
Polymorphism is the ability to perform an action on an object regardless of its type. This is generally implemented by creating a base class and having two or more subclasses that all implement methods with the same signature. Any other function or method that manipulates these objects can call the ...
General log - all queries - see VARIABLE general_log Slow log - queries slower than long_query_time - slow_query_log_file Binlog - for replication and backup - log_bin_basename Relay log - also for replication general errors - mysqld.err start/stop - mysql.log (not very interesting) - log_err...
How to use conditional execution of command lists Any builtin command, expression, or function, as well as any external command or script can be executed conditionally using the &&(and) and ||(or) operators. For example, this will only print the current directory if the cd command was succ...
def lst = ['foo', 'bar', 'baz'] lst.collect { it } // ['foo', 'bar', 'baz'] lst.collect { it.toUpperCase() } // ['FOO', 'BAR', 'BAZ'] To collect keys or values from a maps def map = [foo: 'FOO', bar: 'BAR', baz: 'BAZ'] def keys = map.collect { it.key } // ['foo', 'bar', 'baz'] def vals = m...
def lst = [10, 20, 30, 40] lst.findAll { it > 25 } // [30, 40]
def lst = ['foo', 'bar', ['inner_foo', 'inner_bar']] lst.flatten() ​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​...
Prefix bitwise operators Bitwise operators are like logical operators but executed per bit rather than per boolean value. // bitwise NOT ~: sets all unset bits and unsets all set bits printf("%'06b", ~0b110110); // 001001 Bitmask-bitmask operators Bitwise AND &: a bit is set onl...
In the 32-bit world, the general-purpose registers fall into three general classes: the 16-bit general-purpose registers, the 32-bit extended general-purpose registers, and the 8-bit register halves. These three classes do not represent three entirely distinct sets of registers at all. The 16-bit...
The n & (n - 1) trick (see Remove rightmost set bit) is also useful to determine if an integer is a power of 2: bool power_of_2 = n && !(n & (n - 1)); Note that without the first part of the check (n &&), 0 is incorrectly considered a power of 2.
my @data_array = (123, 456, 789, 'poi', 'uyt', "rew", "qas"); print Dumper @data_array; Using Data::Dumper gives an easy access to fetch list values. The Dumper returns the list values serialized in a way that looks like Perl code. Output: $VAR1 = 123; $VAR2 = 456; $VAR3 ...
Function Receive-TCPMessage { Param ( [Parameter(Mandatory=$true, Position=0)] [ValidateNotNullOrEmpty()] [int] $Port ) Process { Try { # Set up endpoint and start listening $endpoint = new-object System.Net.IPEndPoint(...
"MySQL Cluster" disambiguation... NDB Cluster -- A specialized, mostly in-memory, engine. Not widely used. Galera Cluster aka Percona XtraDB Cluster aka PXC aka MariaDB with Galera. -- A very good High Availability solution for MySQL; it goes beyond Replication. See individual page...
Before you start the cherry-pick process, you can check if the commit you want to cherry-pick already exists in the target branch, in which case you don't have to do anything. git branch --contains <commit> lists local branches that contain the specified commit. git branch -r --contains <...
To unregister from Remote Notifications programatically you can use Objective-C [[UIApplication sharedApplication] unregisterForRemoteNotifications]; Swift UIApplication.sharedApplication().unregisterForRemoteNotifications() this is similar to going into the setting of your phone and manual...
Java EE stands for Java Enterprise Edition. Java EE extends the Java SE (which stands for Java Standard Edition). Java EE is a set of technologies and related specifications that are oriented towards the development of large-scale enterprise applications. Java EE is developed in a community driven p...

Page 57 of 109