This is a quick guide to Kotlin programming language. The previous part of this guide is here
#Object Oriented
fun main(args : Array<String>) {
class local (val x : Int)
val y = local(10)
println("${y.x}")This is a quick guide to Kotlin programming language. The previous part of this guide is here
#Object Oriented
fun main(args : Array<String>) {
class local (val x : Int)
val y = local(10)
println("${y.x}")| /* | |
| * Copyright 2015 Laurens Muller. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| package team2200.smartdashboard.extension.rectangletracker; | |
| import edu.wpi.first.smartdashboard.camera.LaptopExtension; | |
| import edu.wpi.first.smartdashboard.properties.BooleanProperty; | |
| import edu.wpi.first.smartdashboard.properties.NumberProperty; | |
| import edu.wpi.first.smartdashboard.types.DataType; | |
| import edu.wpi.first.wpijavacv.WPIBinaryImage; | |
| import edu.wpi.first.wpijavacv.WPIColor; | |
| import edu.wpi.first.wpijavacv.WPIColorImage; | |
| import edu.wpi.first.wpijavacv.WPIContour; |
Reactive Programming has been getting a lot of attention in the Android community lately. While it has uses throughout the application stack, we're going to focus here on using it to validate forms (exciting!). This approach cuts down on ugly nested if statements and transforms all of the validation logic to just a few simple lines using the RxJava framework. More, its robust and testable.
This post assumes some knowledge of how RxJava and lambdas work. If you need more of a refresher RxJava Retrolambda
| #!/usr/bin/env bash | |
| # | |
| # Converts Windows batch script to Linux shell script | |
| # | |
| # Invocation: | |
| # ./bat2sh script.bat | |
| # | |
| OUTFILE=${2:-${1%%.bat}.sh} |
| package com.company; | |
| import retrofit.RestAdapter; | |
| import retrofit.http.GET; | |
| import retrofit.http.Path; | |
| import rx.Observable; | |
| import rx.Subscriber; | |
| import rx.functions.Action1; | |
| import rx.functions.Func1; | |
| import rx.functions.Func2; |
@SuppressWarnings("UndesirableClassUsage")
@SuppressWarnings("FileEqualsUsage")
@SuppressWarnings("GtkPreferredJComboBoxRenderer")
@SuppressWarnings("UnsafeVfsRecursion")
@SuppressWarnings("ConstantConditions")
@SuppressWarnings("UnusedAssignment")
@SuppressWarnings("NumericOverflow")
@SuppressWarnings("RedundantCast")| import java.io.IOException; | |
| import java.lang.reflect.Method; | |
| import java.util.AbstractCollection; | |
| import java.util.ArrayList; | |
| import java.util.EnumSet; | |
| import java.util.HashMap; | |
| import java.util.Iterator; | |
| import java.util.Map; | |
| import android.media.AudioManager; | |
| import android.media.MediaPlayer; |