This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Uses Kotlin 1.0.4 with kotlin-reflect | |
| fun main(args: Array<String>) { | |
| val p = C::x | |
| println(p.javaGetter!!.annotations.toList()) | |
| println(p.javaField!!.annotations.toList()) | |
| } | |
| @Target(AnnotationTarget.FIELD) | |
| annotation class MyAnnotation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| group 'com.github.h0tk3y.kotlinEapFun' | |
| version '1.0-SNAPSHOT' | |
| buildscript { | |
| ext.kotlin_version = '1.1-M02' | |
| repositories { | |
| mavenCentral() | |
| maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.fasterxml.jackson.core.JsonParser | |
| import com.fasterxml.jackson.databind.DeserializationContext | |
| import com.fasterxml.jackson.databind.JsonDeserializer | |
| import com.fasterxml.jackson.databind.JsonNode | |
| import com.fasterxml.jackson.databind.Module | |
| import com.fasterxml.jackson.databind.module.SimpleModule | |
| import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper | |
| import okhttp3.OkHttpClient | |
| import retrofit2.Retrofit | |
| import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Практика: пишем компилятор для языка с Pascal-like-синтаксисом. | |
| В базовом языке будет: | |
| - арифметика (expressions) | |
| - локальные переменные с присваиванием | |
| - чтение из стандартного потока: read(v) | |
| - write(e) | |
| - if e then s else t | |
| - while e do s | |
| - s; t; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Антон Подкопаев -- anton@podkopaev.net | |
| Даниил Березун -- daniil.berezun@jetbrains.com | |
| Лекции и практики, в основном домашние работы и курсовая работа (написание компилятора к концу семестра). | |
| Компиляторы -- один из самых интересных типов языковых процессоров. | |
| Языковой процессор обрабатывает текст на каком-то языке. | |
| Другие варианты: | |
| * интерпретатор; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Частичные вычисления | |
| Интересный вид языковых процессоров. | |
| Метавычисления -- вычисления на программах, "уровень, с которого мы смотрим на программы". | |
| Уровень описания языков -- метаязыки. Один из метаязыков -- математика. | |
| В.Ф. Турчин -- физик-ядерщик, основатель метавычислений, создатель языка Рефал, общей теории эволюции. | |
| Рефал -- язык, в основе которого лежит сопоставление с образцом. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| group 'com.example.myExample' | |
| version '1.0-SNAPSHOT' | |
| buildscript { | |
| ext.kotlin_version = '1.1.0' | |
| repositories { | |
| mavenCentral() | |
| } | |
| dependencies { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE VIEW avg_meter_cost_rent AS | |
| SELECT rooms_number, AVG(cost / area) AS avg_meter_cost | |
| FROM offer JOIN property USING (property_id) | |
| GROUP BY rooms_number | |
| WHERE kind = 'rent'; | |
| CREATE VIEW avg_meter_cost_sale AS | |
| SELECT rooms_number, AVG(cost / area) AS avg_meter_cost | |
| FROM offer JOIN property USING (property_id) | |
| GROUP BY rooms_number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .text | |
| .comm v3, 4, 4 | |
| .comm v1, 4, 4 | |
| .comm v2, 4, 4 | |
| .globl main | |
| main: | |
| l0: | |
| pushl $1 | |
| l1: | |
| popl v3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fmap :: (a -> b) -> Cont r a -> Cont r b | |
| fmap f c = cont (\q -> runCont c (\a -> q (f a))) |