2024 update

This commit is contained in:
Alexander Nozik 2024-08-06 09:38:15 +03:00
parent e4783ca9e2
commit d0d8e89c62
5 changed files with 2639 additions and 10 deletions

View File

@ -1,8 +1,8 @@
plugins {
kotlin("jvm") version "1.6.10"
kotlin("jvm") version "2.0.0"
}
group = "ru.mipt.npm"
group = "center.sciprog"
version = "1.0"
// Where to get dependencies
@ -12,12 +12,11 @@ repositories {
dependencies {
//loading coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
//testing libraries
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.3")
}
// Load testing platform
@ -25,7 +24,6 @@ tasks.test {
useJUnitPlatform()
}
// Set a byte-code target for JVM
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
kotlin{
jvmToolchain(11)
}

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

2439
notebooks/Idioms.ipynb Normal file

File diff suppressed because it is too large Load Diff

192
notebooks/Types.ipynb Normal file
View File

@ -0,0 +1,192 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true,
"ExecuteTime": {
"start_time": "2023-03-17T14:00:30.580123Z",
"end_time": "2023-03-17T14:00:30.668303Z"
}
},
"outputs": [
{
"data": {
"text/plain": "4"
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"2+2"
]
},
{
"cell_type": "code",
"execution_count": 3,
"outputs": [],
"source": [
"val a: Int = 2"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-03-17T14:00:30.950210Z",
"end_time": "2023-03-17T14:00:31.048695Z"
}
}
},
{
"cell_type": "code",
"execution_count": 4,
"outputs": [
{
"data": {
"text/plain": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"val listOfInt: MutableList<Int> = ArrayList()\n",
"\n",
"for(i in (0 until 10)){\n",
" listOfInt.add(i)\n",
"}\n",
"\n",
"listOfInt"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-03-17T14:00:31.477441Z",
"end_time": "2023-03-17T14:00:31.931786Z"
}
}
},
{
"cell_type": "code",
"execution_count": 5,
"outputs": [
{
"data": {
"text/plain": "true"
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"listOfInt.add(11)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-03-17T14:00:32.050143Z",
"end_time": "2023-03-17T14:00:32.168752Z"
}
}
},
{
"cell_type": "code",
"execution_count": 6,
"outputs": [
{
"data": {
"text/plain": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11]"
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"listOfInt"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-03-17T14:00:32.498157Z",
"end_time": "2023-03-17T14:00:32.572039Z"
}
}
},
{
"cell_type": "code",
"execution_count": 9,
"outputs": [],
"source": [
"%use plotly"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-03-17T14:06:08.235188Z",
"end_time": "2023-03-17T14:06:08.422903Z"
}
}
},
{
"cell_type": "code",
"execution_count": 8,
"outputs": [
{
"data": {
"text/html": "<div>\n <div id=\"space.kscience.plotly.Plot@350dd0bb\">\n <script>if(typeof Plotly !== \"undefined\"){\n Plotly.react(\n 'space.kscience.plotly.Plot@350dd0bb',\n [{\"type\":\"scatter\",\"x\":[1,2,3],\"y\":[1,2,3]}],\n {},\n {\"responsive\":true}\n ); \n} else {\n console.error(\"Plotly not loaded\")\n}</script>\n </div>\n</div>\n"
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Plotly.plot {\n",
" scatter {\n",
" x(1,2,3)\n",
" y(1,2,3)\n",
" }\n",
"}"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-03-17T14:04:06.169017Z",
"end_time": "2023-03-17T14:04:06.433979Z"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false
}
}
],
"metadata": {
"kernelspec": {
"display_name": "Kotlin",
"language": "kotlin",
"name": "kotlin"
},
"language_info": {
"name": "kotlin",
"version": "1.8.0",
"mimetype": "text/x-kotlin",
"file_extension": ".kt",
"pygments_lexer": "kotlin",
"codemirror_mode": "text/x-kotlin",
"nbconvert_exporter": ""
}
},
"nbformat": 4,
"nbformat_minor": 0
}

View File

@ -1,3 +1,3 @@
rootProject.name = "jvm-demo"
rootProject.name = "ks-materials"