http://www.portalion.com/wroclaw/item/728-trasa-zwiedzania
https://www.google.com/maps/d/u/0/viewer?mid=ztS5BIgTJ90s.k06x_LAzMw90
interface PacketTranscoder | |
open class Packet | |
class StringPacket(val body: String) : Packet() | |
interface PacketDecoder<out T : Packet> : PacketTranscoder { | |
fun decode(client: String, buf: Array<String>): T |
language: java | |
jdk: | |
- oraclejdk7 | |
- oraclejdk8 |
'use strict'; |
fun String.isPhoneNumber() = matches(Regex("\\d{11}")) |
function hoog { | |
search=$1 | |
count=$2 | |
if [ -z $count ] ; then | |
hoogle -q -c "$search" | grep -v -e "^Searching for:" | awk 'BEGIN { a = 1 } { print a ") " $(NF-NF) ; a = a + 1 }' | |
else | |
hoogle -q -c -i -s $count "$search" | |
fi | |
} |
$ groovy -version | |
Groovy Version: 2.4.7 JVM: 1.8.0_91 Vendor: Oracle Corporation OS: Linux | |
$ groovy test.groovy | |
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: | |
/home/alien/test.groovy: 6: Apparent variable 'name' was found in a static scope but doesn't refer to a local variable, static field or class. Possible causes: | |
You attempted to reference a variable in the binding or an instance variable from a static context. | |
You misspelled a classname or statically imported field. Please check the spelling. | |
You attempted to use a method 'name' but left out brackets in a place not allowed by the grammar. | |
@ line 6, column 16. |
$ groovy test.groovy | |
Caught: groovy.lang.MissingPropertyException: No such property: foo for class: Foo | |
groovy.lang.MissingPropertyException: No such property: foo for class: Foo | |
at Foo$_bar_closure1.doCall(test.groovy:10) | |
at Foo.bar(test.groovy:9) | |
at Foo$bar.call(Unknown Source) | |
at test.run(test.groovy:20) |
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
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}")