Tutorial by Examples

The first step to start Xamarin development on an OS X machine, is to download and install Xamarin Studio Community version from the official website. A few fields need to be filled to download the installer as shown in the picture below. The Xamarin Unified installer takes care of identifying an...
A Kotlin interface contains declarations of abstract methods, and default method implementations although they cannot store state. interface MyInterface { fun bar() } This interface can now be implemented by a class as follows: class Child : MyInterface { override fun bar() { ...
An interface in Kotlin can have default implementations for functions: interface MyInterface { fun withImplementation() { print("withImplementation() was called") } } Classes implementing such interfaces will be able to use those functions without reimplementing cl...
Download Qt for Linux Open Source Version Go to https://www.qt.io/download-open-source/ and click on Download Now, make sure that you are downloading the Qt installer for Linux. A file with the name qt-unified-linux-x-online.run will be downloaded, then add exec permission chmod +x qt-unified-...
The Stop command will pause the execution when called. From there, the process can be resumed or be executed step by step. Sub Test() Dim TestVar as String TestVar = "Hello World" Stop 'Sub will be executed to this point and then wait for the user Ms...
Different flavors of application builds can contain different resources. To create a flavor-specific resource make a directory with the lower-case name of your flavor in the src directory and add your resources in the same way you would normally. For example, if you had a flavour Development and w...
The easiest way to get writing your first XAML is to install Microsoft Visual Studio. This is avaliable free from Microsoft. Once installed you can create a new project, of type WPF Application, either with a VB.NET or C# code. This is similar to windows forms in the sense that you have a series o...
There are several ways methods can be inherited public abstract class Car { public void HonkHorn() { // Implementation of horn being honked } // virtual methods CAN be overridden in derived classes public virtual void ChangeGear() { // Implementation of gear...
Fortran is a language which can be compiled using compilers supplied by many vendors. Different compilers are available for different hardware platforms and operating systems. Some compilers are free software, some can be used free of charge and some require the purchase of a licence. The most comm...
All java Collection<E>s have stream() and parallelStream() methods from which a Stream<E> can be constructed: Collection<String> stringList = new ArrayList<>(); Stream<String> stringStream = stringList.parallelStream(); A Stream<E> can be created from an arra...
You don't have to check the IDisposable object for null. using will not throw an exception and Dispose() will not be called: DisposableObject TryOpenFile() { return null; } // disposable is null here, but this does not throw an exception using (var disposable = TryOpenFile()) { //...
INSERT INTO `my_table` (`field_1`, `field_2`) VALUES ('data_1', 'data_2'), ('data_1', 'data_3'), ('data_4', 'data_5'); This is an easy way to add several rows at once with one INSERT statement. This kind of 'batch' insert is much faster than inserting rows one by one. Typically...
Java 8 provides classes called IntSummaryStatistics, DoubleSummaryStatistics and LongSummaryStatistics which give a state object for collecting statistics such as count, min, max, sum, and average. Java SE 8 List<Integer> naturalNumbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); IntSu...
Starting with PHP Sessions we can pass an array with session-based php.ini options to the session_start function. Example <?php if (version_compare(PHP_VERSION, '7.0.0') >= 0) { // php >= 7 version session_start([ 'cache_limiter' => 'private', ...
Getting started with Ember is easy. Ember projects are created and managed through our command line build tool Ember CLI. This tool provides: Modern application asset management (including concatenation, minification, and versioning). Generators to help create components, routes, and more. A ...
Xamarin.Forms is a cross-platform natively backed UI toolkit abstraction that allows developers to easily create user interfaces that can be shared across Android, iOS, Windows, and Windows Phone. The user interfaces are rendered using the native controls of the target platform, allowing Xamarin.For...
Symfony Framework - built with symfony components, is one of the leading PHP framework used to create robust websites and web applications. Symfony can be installed quickly through two recommended ways. The official documentaion recommends to install the framework through the Symfony Installer ...

Try

Using Try with map, getOrElse and flatMap: import scala.util.Try val i = Try("123".toInt) // Success(123) i.map(_ + 1).getOrElse(321) // 124 val j = Try("abc".toInt) // Failure(java.lang.NumberFormatException) j.map(_ + 1).getOrElse(321) // 321 Try("123...
Different data types for error/success def getPersonFromWebService(url: String): Either[String, Person] = { val response = webServiceClient.get(url) response.webService.status match { case 200 => { val person = parsePerson(response) if(!isVali...
Pseudo-elements are added to selectors but instead of describing a special state, they allow you to style certain parts of a document. The content attribute is required for pseudo-elements to render; however, the attribute can have an empty value (e.g. content: ""). div::after { conte...

Page 113 of 1336