From fce598049caaf3ad2b2a330ccfd0cafbd51b22bd Mon Sep 17 00:00:00 2001
From: yostane <1958676+yostane@users.noreply.github.com>
Date: Thu, 29 Aug 2024 09:45:21 +0200
Subject: [PATCH] Update notebooks
---
.../result-explorer/demo00.ipynb | 5 +-
.../result-explorer/demo01.ipynb | 1708 ++++++++++++-----
.../result-explorer/demo02.ipynb | 942 +++------
3 files changed, 1485 insertions(+), 1170 deletions(-)
diff --git a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo00.ipynb b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo00.ipynb
index eae59509..8c132a78 100644
--- a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo00.ipynb
+++ b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo00.ipynb
@@ -11,12 +11,13 @@
}
},
"source": [
- "# Hello Jupyter Kotlin"
+ "# Hello Jupyter Kotlin\n",
+ "This is markdown cell. You can write markdown in Jupyter notebook. You can also write code in Kotlin. Let's write a simple code in Kotlin."
]
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": 2,
"metadata": {},
"outputs": [
{
diff --git a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo01.ipynb b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo01.ipynb
index a03a46e5..b1d2ee28 100644
--- a/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo01.ipynb
+++ b/material/rest-api-ui-ktor-quiz-collector/result-explorer/demo01.ipynb
@@ -9,20 +9,27 @@
},
{
"cell_type": "code",
- "execution_count": 29,
"metadata": {
"ExecuteTime": {
- "end_time": "2024-08-24T11:14:19.583192900Z",
- "start_time": "2024-08-24T11:14:12.242893300Z"
+ "start_time": "2024-08-29T07:34:03.349088700Z"
}
},
- "outputs": [],
"source": [
"// Without specifying %useLatestDescriptors, the version included in the Kotlin Jupyter kernel will be used.\n",
"%useLatestDescriptors\n",
"%use kandy\n",
"%use dataframe"
- ]
+ ],
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "The execution was interrupted"
+ ]
+ }
+ ],
+ "execution_count": null
},
{
"cell_type": "markdown",
@@ -33,65 +40,26 @@
},
{
"cell_type": "code",
- "execution_count": 30,
"metadata": {
- "ExecuteTime": {
- "end_time": "2024-08-24T11:14:19.925191Z",
- "start_time": "2024-08-24T11:14:19.603194600Z"
- },
"notebookRunGroups": {
"groupValue": "1"
+ },
+ "ExecuteTime": {
+ "end_time": "2024-08-29T07:34:11.912960400Z",
+ "start_time": "2024-08-29T07:31:04.404062800Z"
}
},
+ "source": [
+ "val df = DataFrame.read(\"http://localhost:8080/responses\")\n",
+ "df"
+ ],
"outputs": [
{
"data": {
- "application/kotlindataframe+json": {
- "columns": [
- "What is the primary goal of Kotlin Multiplatform?",
- "How does Kotlin Multiplatform facilitate code sharing between platforms?",
- "Which platforms does Kotlin Multiplatform support?",
- "What is a common use case for Kotlin Multiplatform?",
- "What is a shared code module in Kotlin Multiplatform called?",
- "How does Kotlin Multiplatform handle platform-specific implementations?",
- "What languages can be interoperable with Kotlin Multiplatform?",
- "What tooling supports Kotlin Multiplatform development?",
- "What is the benefit of using Kotlin Multiplatform for mobile development?",
- "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?"
- ],
- "kotlin_dataframe": [
- {
- "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?": "None",
- "How does Kotlin Multiplatform facilitate code sharing between platforms?": "By sharing business logic and adapting UI",
- "How does Kotlin Multiplatform handle platform-specific implementations?": "actual",
- "What is a common use case for Kotlin Multiplatform?": "Developing a cross-platform app",
- "What is a shared code module in Kotlin Multiplatform called?": "Shared module",
- "What is the benefit of using Kotlin Multiplatform for mobile development?": "and sharing",
- "What is the primary goal of Kotlin Multiplatform?": "To share",
- "What languages can be interoperable with Kotlin Multiplatform?": "Java, Swift",
- "What tooling supports Kotlin Multiplatform development?": "IntelliJ IDEA",
- "Which platforms does Kotlin Multiplatform support?": "Android, iOS, and web"
- },
- {
- "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?": "Kotlin Multiplatform allows sharing code between different platforms using common modules.",
- "How does Kotlin Multiplatform facilitate code sharing between platforms?": "By sharing business logic and adapting UI",
- "How does Kotlin Multiplatform handle platform-specific implementations?": "Through expect and actual declarations",
- "What is a common use case for Kotlin Multiplatform?": "Developing a cross-platform app",
- "What is a shared code module in Kotlin Multiplatform called?": "Shared module",
- "What is the benefit of using Kotlin Multiplatform for mobile development?": "Code reuse and sharing",
- "What is the primary goal of Kotlin Multiplatform?": "To share code between multiple platforms",
- "What languages can be interoperable with Kotlin Multiplatform?": "Java, JavaScript, Swift",
- "What tooling supports Kotlin Multiplatform development?": "IntelliJ IDEA, Android Studio",
- "Which platforms does Kotlin Multiplatform support?": "Android, iOS, and web"
- }
- ],
- "ncol": 10,
- "nrow": 2
- },
"text/html": [
- " \n",
- "
\n",
- " \n",
" \n",
" \n",
- " \n",
- "\n",
- "DataFrame: rowsCount = 2, columnsCount = 10
\n",
- "What is the primary goal of Kotlin Multiplatform? | How does Kotlin Multiplatform facilitate code sharing between platforms? | Which platforms does Kotlin Multiplatform support? | What is a common use case for Kotlin Multiplatform? | What is a shared code module in Kotlin Multiplatform called? | How does Kotlin Multiplatform handle platform-specific implementations? | What languages can be interoperable with Kotlin Multiplatform? | What tooling supports Kotlin Multiplatform development? | What is the benefit of using Kotlin Multiplatform for mobile development? | How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS? |
---|
To share | By sharing business logic and adaptin... | Android, iOS, and web | Developing a cross-platform app | Shared module | actual | Java, Swift | IntelliJ IDEA | and sharing | None |
To share code between multiple platforms | By sharing business logic and adaptin... | Android, iOS, and web | Developing a cross-platform app | Shared module | Through expect and actual declarations | Java, JavaScript, Swift | IntelliJ IDEA, Android Studio | Code reuse and sharing | Kotlin Multiplatform allows sharing c... |
\n",
+ " Which platforms does Kotlin Multiplatform support? | Which naming of KMP is deprecated? | At which Google I/O, Google announced first-class support for Kotlin on Android? | What is the name of the Kotlin mascot? | The international yearly Kotlin conference is called... | Where will be located the next international yearly Kotlin conference? |
---|
Android, iOS, desktop and web | Hadi Multiplatform | 2014 | Kotlinee | KotlinConf | Tokyo, Japan |
\n",
" \n",
" \n",
" "
- ]
+ ],
+ "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"Which platforms does Kotlin Multiplatform support?\",\"Which naming of KMP is deprecated?\",\"At which Google I/O, Google announced first-class support for Kotlin on Android?\",\"What is the name of the Kotlin mascot?\",\"The international yearly Kotlin conference is called...\",\"Where will be located the next international yearly Kotlin conference?\"],\"nrow\":1,\"ncol\":6},\"kotlin_dataframe\":[{\"Which platforms does Kotlin Multiplatform support?\":\"Android, iOS, desktop and web\",\"Which naming of KMP is deprecated?\":\"Hadi Multiplatform\",\"At which Google I/O, Google announced first-class support for Kotlin on Android?\":\"2014\",\"What is the name of the Kotlin mascot?\":\"Kotlinee\",\"The international yearly Kotlin conference is called...\":\"KotlinConf\",\"Where will be located the next international yearly Kotlin conference?\":\"Tokyo, Japan\"}]}"
},
- "execution_count": 30,
+ "execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
- "source": [
- "val df = DataFrame.read(\"http://localhost:8080/responses\")\n",
- "df"
- ]
+ "execution_count": 9
},
{
"cell_type": "markdown",
@@ -443,16 +722,19 @@
},
{
"cell_type": "code",
- "execution_count": 31,
"metadata": {
- "ExecuteTime": {
- "end_time": "2024-08-24T11:14:20.162191700Z",
- "start_time": "2024-08-24T11:14:19.946198800Z"
- },
"notebookRunGroups": {
"groupValue": "2"
+ },
+ "ExecuteTime": {
+ "end_time": "2024-08-29T07:34:11.915959400Z",
+ "start_time": "2024-08-29T07:31:04.694061Z"
}
},
+ "source": [
+ "val correctDF = DataFrame.read(\"http://localhost:8080/correct-stats\")\n",
+ "correctDF.schema()"
+ ],
"outputs": [
{
"data": {
@@ -461,93 +743,36 @@
"correct: Int"
]
},
- "execution_count": 31,
+ "execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
- "source": [
- "val correctDF = DataFrame.read(\"http://localhost:8080/correct-stats\")\n",
- "correctDF.schema()"
- ]
+ "execution_count": 10
},
{
"cell_type": "code",
- "execution_count": 32,
"metadata": {
"ExecuteTime": {
- "end_time": "2024-08-24T11:14:20.619193Z",
- "start_time": "2024-08-24T11:14:20.287192300Z"
+ "end_time": "2024-08-29T07:34:11.916958Z",
+ "start_time": "2024-08-29T07:31:05.379688600Z"
}
},
+ "source": [
+ "val correctDF2 = correctDF.add(\"tq\") {\n",
+ " question.take(3) +\n",
+ " Typography.ellipsis.toString() +\n",
+ " question.takeLast(25)\n",
+ "}\n",
+ "correctDF2"
+ ],
"outputs": [
{
"data": {
- "application/kotlindataframe+json": {
- "columns": [
- "question",
- "correct",
- "tq"
- ],
- "kotlin_dataframe": [
- {
- "correct": 0,
- "question": "What is the primary goal of Kotlin Multiplatform?",
- "tq": "Wha… of Kotlin Multiplatform?"
- },
- {
- "correct": 1,
- "question": "How does Kotlin Multiplatform facilitate code sharing between platforms?",
- "tq": "How…haring between platforms?"
- },
- {
- "correct": 1,
- "question": "Which platforms does Kotlin Multiplatform support?",
- "tq": "Whi…in Multiplatform support?"
- },
- {
- "correct": 0,
- "question": "What is a common use case for Kotlin Multiplatform?",
- "tq": "Wha…for Kotlin Multiplatform?"
- },
- {
- "correct": 0,
- "question": "What is a shared code module in Kotlin Multiplatform called?",
- "tq": "Wha…lin Multiplatform called?"
- },
- {
- "correct": 1,
- "question": "How does Kotlin Multiplatform handle platform-specific implementations?",
- "tq": "How…specific implementations?"
- },
- {
- "correct": 1,
- "question": "What languages can be interoperable with Kotlin Multiplatform?",
- "tq": "Wha…ith Kotlin Multiplatform?"
- },
- {
- "correct": 0,
- "question": "What tooling supports Kotlin Multiplatform development?",
- "tq": "Wha…ultiplatform development?"
- },
- {
- "correct": 0,
- "question": "What is the benefit of using Kotlin Multiplatform for mobile development?",
- "tq": "Wha…m for mobile development?"
- },
- {
- "correct": 0,
- "question": "How does Kotlin Multiplatform differ from Kotlin Native and Kotlin/JS?",
- "tq": "How…lin Native and Kotlin/JS?"
- }
- ],
- "ncol": 3,
- "nrow": 10
- },
"text/html": [
- " \n",
- " \n",
- " \n",
" \n",
" \n",
- " \n",
- "\n",
- "DataFrame: rowsCount = 10, columnsCount = 3
\n",
- "question | correct | tq |
---|
What is the primary goal of Kotlin Mu... | 0 | Wha… of Kotlin Multiplatform? |
How does Kotlin Multiplatform facilit... | 1 | How…haring between platforms? |
Which platforms does Kotlin Multiplat... | 1 | Whi…in Multiplatform support? |
What is a common use case for Kotlin ... | 0 | Wha…for Kotlin Multiplatform? |
What is a shared code module in Kotli... | 0 | Wha…lin Multiplatform called? |
How does Kotlin Multiplatform handle ... | 1 | How…specific implementations? |
What languages can be interoperable w... | 1 | Wha…ith Kotlin Multiplatform? |
What tooling supports Kotlin Multipla... | 0 | Wha…ultiplatform development? |
What is the benefit of using Kotlin M... | 0 | Wha…m for mobile development? |
How does Kotlin Multiplatform differ ... | 0 | How…lin Native and Kotlin/JS? |
\n",
+ " question | correct | tq |
---|
Which plat...m support? | 1 | Whi…Which plat...m support? |
Which nami...eprecated? | 0 | Whi…Which nami...eprecated? |
At which G...n Android? | 0 | At …At which G...n Android? |
What is th...in mascot? | 0 | Wha…What is th...in mascot? |
The intern... called... | 1 | The…The intern... called... |
Where will...onference? | 0 | Whe…Where will...onference? |
\n",
" \n",
" \n",
" "
- ]
+ ],
+ "application/kotlindataframe+json": "{\"$version\":\"2.0.0\",\"metadata\":{\"columns\":[\"question\",\"correct\",\"tq\"],\"nrow\":6,\"ncol\":3},\"kotlin_dataframe\":[{\"question\":\"Which plat...m support?\",\"correct\":1,\"tq\":\"Whi\\u2026Which plat...m support?\"},{\"question\":\"Which nami...eprecated?\",\"correct\":0,\"tq\":\"Whi\\u2026Which nami...eprecated?\"},{\"question\":\"At which G...n Android?\",\"correct\":0,\"tq\":\"At \\u2026At which G...n Android?\"},{\"question\":\"What is th...in mascot?\",\"correct\":0,\"tq\":\"Wha\\u2026What is th...in mascot?\"},{\"question\":\"The intern... called...\",\"correct\":1,\"tq\":\"The\\u2026The intern... called...\"},{\"question\":\"Where will...onference?\",\"correct\":0,\"tq\":\"Whe\\u2026Where will...onference?\"}]}"
},
- "execution_count": 32,
+ "execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
- "source": [
- "val correctDF2 = correctDF.add(\"tq\") { question.take(3) + Typography.ellipsis.toString() + question.takeLast(25) }\n",
- "correctDF2"
- ]
+ "execution_count": 11
},
{
"cell_type": "code",
- "execution_count": 33,
"metadata": {
- "ExecuteTime": {
- "end_time": "2024-08-24T11:14:20.800192Z",
- "start_time": "2024-08-24T11:14:20.651193800Z"
- },
"notebookRunGroups": {
"groupValue": "1"
+ },
+ "ExecuteTime": {
+ "end_time": "2024-08-29T07:34:11.917960100Z",
+ "start_time": "2024-08-29T07:31:06.033760500Z"
}
},
+ "source": [
+ "correctDF2.plot {\n",
+ " bars {\n",
+ " y(tq) {\n",
+ " axis.name = \"Question\"\n",
+ " }\n",
+ " x(correct)\n",
+ " }\n",
+ "}"
+ ],
"outputs": [
{
"data": {
- "application/plot+json": {
- "apply_color_scheme": true,
- "output": {
- "data": {
- "correct": [
- 0,
- 1,
- 1,
- 0,
- 0,
- 1,
- 1,
- 0,
- 0,
- 0
- ],
- "tq": [
- "Wha… of Kotlin Multiplatform?",
- "How…haring between platforms?",
- "Whi…in Multiplatform support?",
- "Wha…for Kotlin Multiplatform?",
- "Wha…lin Multiplatform called?",
- "How…specific implementations?",
- "Wha…ith Kotlin Multiplatform?",
- "Wha…ultiplatform development?",
- "Wha…m for mobile development?",
- "How…lin Native and Kotlin/JS?"
- ]
- },
- "kind": "plot",
- "layers": [
- {
- "geom": "bar",
- "mapping": {
- "x": "correct",
- "y": "tq"
- },
- "position": "dodge",
- "sampling": "none",
- "stat": "identity"
- }
- ],
- "mapping": {},
- "scales": [
- {
- "aesthetic": "y",
- "discrete": true,
- "name": "Question"
- },
- {
- "aesthetic": "x",
- "limits": [
- null,
- null
- ]
- }
- ]
- },
- "output_type": "lets_plot_spec",
- "swing_enabled": true
- },
"text/html": [
"