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}")
(ns fileupload.core | |
(:use [net.cgrand.enlive-html | |
:only [deftemplate defsnippet content clone-for | |
nth-of-type first-child do-> set-attr sniptest at emit*]] | |
[compojure.core] | |
[ring.adapter.jetty]) | |
(:require (compojure [route :as route]) | |
(ring.util [response :as response]) | |
(ring.middleware [multipart-params :as mp]) | |
(clojure.contrib [duck-streams :as ds])) |
// installed Clojure packages: | |
// | |
// * BracketHighlighter | |
// * lispindent | |
// * SublimeREPL | |
// * sublime-paredit | |
{ | |
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?", | |
"paredit_enabled": true, |
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}")
package hu.axt.iotrace; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_FINAL; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PRIVATE; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_PUBLIC; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_STATIC; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ACC_SUPER; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.ILOAD; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESPECIAL; | |
import static com.sun.xml.internal.ws.org.objectweb.asm.Opcodes.INVOKESTATIC; |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
;;;; Super top secret talk stuff nobody should ever see. Shhh. | |
(in-ns 'user) | |
(defmacro bench [& body] | |
`((re-find #"\"(.*)\"" (with-out-str (time (do ~@body)))) 1)) | |
*ns* | |
(require 'clojure.walk) |
(ns midi-parser.core | |
(:use clojure.java.data) | |
#_(:use utils.utils) | |
#_(:use vendors.debug-repl) | |
(:import (java.io File) | |
#_(java.util Arrays) | |
#_(java.nio ByteBuffer) | |
(javax.sound.midi MidiSystem Sequence MidiMessage MidiEvent ShortMessage MetaMessage Track))) | |
;***************** Utils ******************** |
@Grab("org.grails:gorm-hibernate4-spring-boot:1.0.0.RC2") | |
@Grab("com.h2database:h2:1.3.173") | |
import grails.persistence.* | |
import org.springframework.http.* | |
import static org.springframework.web.bind.annotation.RequestMethod.* | |
@RestController | |
class GreetingController { | |
@RequestMapping(value="/person/greet", method = GET) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.