|
5 | 5 | "cell_type": "markdown",
|
6 | 6 | "source": [
|
7 | 7 | "# Idiomatic Kotlin @ Paris JUG\n",
|
8 |
| - "Date: 2024 / 10 / 12" |
| 8 | + "Date: 2024 / 11 / 12" |
9 | 9 | ]
|
10 | 10 | },
|
11 | 11 | {
|
12 |
| - "cell_type": "code", |
13 | 12 | "metadata": {
|
14 | 13 | "collapsed": true,
|
15 | 14 | "ExecuteTime": {
|
16 |
| - "end_time": "2024-10-25T14:33:51.646533Z", |
17 |
| - "start_time": "2024-10-25T14:33:51.606114Z" |
| 15 | + "end_time": "2024-11-12T08:46:52.080221800Z", |
| 16 | + "start_time": "2024-11-12T08:46:51.711403Z" |
18 | 17 | }
|
19 | 18 | },
|
20 |
| - "source": [ |
21 |
| - "val event = \"Paris JUG\"\n", |
22 |
| - "println(\"Hello $event\") // String template" |
23 |
| - ], |
| 19 | + "cell_type": "code", |
24 | 20 | "outputs": [
|
25 | 21 | {
|
26 | 22 | "name": "stdout",
|
|
30 | 26 | ]
|
31 | 27 | }
|
32 | 28 | ],
|
33 |
| - "execution_count": 17 |
| 29 | + "execution_count": 1, |
| 30 | + "source": [ |
| 31 | + "val event = \"Paris JUG\"\n", |
| 32 | + "println(\"Hello $event\") // String template" |
| 33 | + ] |
34 | 34 | },
|
35 | 35 | {
|
36 | 36 | "metadata": {
|
37 | 37 | "ExecuteTime": {
|
38 |
| - "end_time": "2024-10-25T14:33:51.733128900Z", |
39 |
| - "start_time": "2024-10-25T14:33:51.666925500Z" |
| 38 | + "end_time": "2024-11-12T08:46:52.606006400Z", |
| 39 | + "start_time": "2024-11-12T08:46:52.182420600Z" |
40 | 40 | }
|
41 | 41 | },
|
42 | 42 | "cell_type": "code",
|
43 |
| - "source": [ |
44 |
| - "// Extension function: add a function to a class without inhetitance\n", |
45 |
| - "fun String.randomCase(): String {\n", |
46 |
| - " // If expression\n", |
47 |
| - " return if (Math.random() > 0.5) uppercase() else lowercase()\n", |
48 |
| - "}\n", |
49 |
| - "println(event.randomCase())" |
50 |
| - ], |
51 | 43 | "outputs": [
|
52 | 44 | {
|
53 | 45 | "name": "stdout",
|
|
57 | 49 | ]
|
58 | 50 | }
|
59 | 51 | ],
|
60 |
| - "execution_count": 18 |
| 52 | + "execution_count": 2, |
| 53 | + "source": [ |
| 54 | + "// Extension function: add a function to a class without inhetitance\n", |
| 55 | + "fun String.randomCase(): String {\n", |
| 56 | + " // If expression\n", |
| 57 | + " return if (Math.random() > 0.5) uppercase() else lowercase()\n", |
| 58 | + "}\n", |
| 59 | + "println(event.randomCase())" |
| 60 | + ] |
61 | 61 | },
|
62 | 62 | {
|
63 | 63 | "metadata": {
|
64 | 64 | "ExecuteTime": {
|
65 |
| - "end_time": "2024-10-25T14:33:51.861854200Z", |
66 |
| - "start_time": "2024-10-25T14:33:51.755062200Z" |
| 65 | + "end_time": "2024-11-12T20:11:18.362206600Z", |
| 66 | + "start_time": "2024-11-12T20:11:18.090413800Z" |
67 | 67 | }
|
68 | 68 | },
|
69 | 69 | "cell_type": "code",
|
|
75 | 75 | "// Argument labels\n",
|
76 | 76 | "println(event.randomCaseChance(offset = 3))\n",
|
77 | 77 | "println(event.randomCaseChance(\n",
|
78 |
| - " chance = 0.9,\n", |
| 78 | + " \n", |
79 | 79 | " offset = 2,\n",
|
| 80 | + " chance = 0.9,\n", |
80 | 81 | " )\n",
|
81 | 82 | ")"
|
82 | 83 | ],
|
|
90 | 91 | ]
|
91 | 92 | }
|
92 | 93 | ],
|
93 |
| - "execution_count": 19 |
| 94 | + "execution_count": 10 |
94 | 95 | },
|
95 | 96 | {
|
96 | 97 | "metadata": {
|
97 | 98 | "ExecuteTime": {
|
98 |
| - "end_time": "2024-10-25T14:33:52.069576Z", |
99 |
| - "start_time": "2024-10-25T14:33:51.987387600Z" |
| 99 | + "end_time": "2024-11-12T08:46:53.633203200Z", |
| 100 | + "start_time": "2024-11-12T08:46:53.337385800Z" |
100 | 101 | }
|
101 | 102 | },
|
102 | 103 | "cell_type": "code",
|
|
118 | 119 | ]
|
119 | 120 | }
|
120 | 121 | ],
|
121 |
| - "execution_count": 20 |
| 122 | + "execution_count": 4 |
122 | 123 | },
|
123 | 124 | {
|
124 | 125 | "metadata": {
|
125 | 126 | "ExecuteTime": {
|
126 |
| - "end_time": "2024-10-25T14:33:52.233616600Z", |
127 |
| - "start_time": "2024-10-25T14:33:52.158182800Z" |
| 127 | + "end_time": "2024-11-12T08:46:53.984086300Z", |
| 128 | + "start_time": "2024-11-12T08:46:53.673347200Z" |
128 | 129 | }
|
129 | 130 | },
|
130 | 131 | "cell_type": "code",
|
|
145 | 146 | ]
|
146 | 147 | }
|
147 | 148 | ],
|
148 |
| - "execution_count": 21 |
| 149 | + "execution_count": 5 |
149 | 150 | },
|
150 | 151 | {
|
151 | 152 | "metadata": {
|
152 | 153 | "ExecuteTime": {
|
153 |
| - "end_time": "2024-10-25T14:40:24.001881Z", |
154 |
| - "start_time": "2024-10-25T14:40:23.881908900Z" |
| 154 | + "end_time": "2024-11-12T08:46:54.593211500Z", |
| 155 | + "start_time": "2024-11-12T08:46:54.027803300Z" |
155 | 156 | }
|
156 | 157 | },
|
157 | 158 | "cell_type": "code",
|
|
170 | 171 | "name": "stdout",
|
171 | 172 | "output_type": "stream",
|
172 | 173 | "text": [
|
173 |
| - "P, a, r, I, S, , J, u, g\r\n", |
| 174 | + "p, A, R, i, S, , j, u, G\r\n", |
174 | 175 | "[P/2, a/0, r/2, i/4]\r\n"
|
175 | 176 | ]
|
176 | 177 | }
|
177 | 178 | ],
|
178 |
| - "execution_count": 24 |
| 179 | + "execution_count": 6 |
179 | 180 | },
|
180 | 181 | {
|
181 | 182 | "metadata": {
|
182 | 183 | "ExecuteTime": {
|
183 |
| - "end_time": "2024-10-25T14:50:19.815828200Z", |
184 |
| - "start_time": "2024-10-25T14:50:19.702384500Z" |
| 184 | + "end_time": "2024-11-12T08:46:55.067201900Z", |
| 185 | + "start_time": "2024-11-12T08:46:54.610120800Z" |
185 | 186 | }
|
186 | 187 | },
|
187 | 188 | "cell_type": "code",
|
|
212 | 213 | ]
|
213 | 214 | }
|
214 | 215 | ],
|
215 |
| - "execution_count": 27 |
| 216 | + "execution_count": 7 |
216 | 217 | }
|
217 | 218 | ],
|
218 | 219 | "metadata": {
|
|
0 commit comments