eaglelandsonce commited on
Commit
1f3a142
·
verified ·
1 Parent(s): 91ebfa0

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +341 -19
index.html CHANGED
@@ -1,19 +1,341 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Delta Lake Jeopardy</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: center;
13
+ background-color: #f0f0f0;
14
+ margin: 0;
15
+ }
16
+ h1 {
17
+ color: #0078D4;
18
+ }
19
+ #game-board {
20
+ display: grid;
21
+ grid-template-columns: repeat(5, 1fr);
22
+ grid-auto-rows: 100px;
23
+ gap: 2px;
24
+ margin: 20px 0;
25
+ background-color: #000;
26
+ border: 4px solid #000;
27
+ }
28
+ .category {
29
+ background-color: #005a9e;
30
+ color: #fff;
31
+ font-weight: bold;
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ text-align: center;
36
+ font-size: 18px;
37
+ border: 1px solid #000;
38
+ }
39
+ .card {
40
+ background-color: #0078D4;
41
+ color: #fff;
42
+ display: flex;
43
+ justify-content: center;
44
+ align-items: center;
45
+ font-size: 16px;
46
+ font-weight: bold;
47
+ cursor: pointer;
48
+ border: 1px solid #000;
49
+ text-align: center;
50
+ transition: background-color 0.3s;
51
+ }
52
+ .card:hover {
53
+ background-color: #005a9e;
54
+ }
55
+ .card.disabled {
56
+ background-color: #cccccc;
57
+ cursor: default;
58
+ }
59
+ #question-display {
60
+ width: 80%;
61
+ text-align: center;
62
+ margin-bottom: 20px;
63
+ }
64
+ #score {
65
+ font-size: 24px;
66
+ font-weight: bold;
67
+ color: #0078D4;
68
+ }
69
+ .answer-container {
70
+ display: flex;
71
+ justify-content: center;
72
+ margin-top: 20px;
73
+ }
74
+ .answer-btn {
75
+ margin: 5px;
76
+ padding: 10px 15px;
77
+ font-size: 18px;
78
+ cursor: pointer;
79
+ text-align: center;
80
+ border: 2px solid #005a9e;
81
+ border-radius: 5px;
82
+ background-color: #0078D4;
83
+ color: #fff;
84
+ font-weight: bold;
85
+ transition: background-color 0.3s, color 0.3s;
86
+ }
87
+ .answer-btn:hover {
88
+ background-color: #005a9e;
89
+ color: #f0f0f0;
90
+ }
91
+ .answer-btn.disabled {
92
+ background-color: #cccccc;
93
+ color: #666;
94
+ cursor: not-allowed;
95
+ }
96
+ .feedback {
97
+ margin-top: 10px;
98
+ font-size: 18px;
99
+ font-weight: bold;
100
+ }
101
+ </style>
102
+ </head>
103
+ <body>
104
+ <h1>Delta Lake Jeopardy</h1>
105
+ <p>
106
+ <strong>Learn More:</strong>
107
+ <a href="https://learn.microsoft.com/en-us/azure/databricks/delta/" target="_blank">Delta Lake Documentation</a>
108
+ </p>
109
+ <div id="game-board">
110
+ <div class="category">Delta Lake Fundamentals</div>
111
+ <div class="category">Getting Started &amp; Basic Operations</div>
112
+ <div class="category">Data Ingestion &amp; Conversion</div>
113
+ <div class="category">Table Management &amp; Updates</div>
114
+ <div class="category">Advanced Features &amp; Optimization</div>
115
+ </div>
116
+ <div id="question-display"></div>
117
+ <div id="score">Score: 0</div>
118
+
119
+ <script>
120
+ const categories = [
121
+ "Delta Lake Fundamentals",
122
+ "Getting Started & Basic Operations",
123
+ "Data Ingestion & Conversion",
124
+ "Table Management & Updates",
125
+ "Advanced Features & Optimization"
126
+ ];
127
+ const questions = [
128
+ // Delta Lake Fundamentals
129
+ [
130
+ {
131
+ q: "What is Delta Lake?",
132
+ a: [
133
+ "An optimized storage layer that extends Parquet files with ACID transactions and scalable metadata handling",
134
+ "A proprietary database management system",
135
+ "A cloud-only file storage service"
136
+ ],
137
+ correct: 0
138
+ },
139
+ {
140
+ q: "Which feature is integral to Delta Lake for ensuring reliable data operations?",
141
+ a: [
142
+ "Simple file copy operations",
143
+ "A file-based transaction log",
144
+ "In-memory caching only"
145
+ ],
146
+ correct: 1
147
+ },
148
+ {
149
+ q: "Delta Lake is fully compatible with which API for big data processing?",
150
+ a: [
151
+ "Hadoop MapReduce API",
152
+ "Flink DataStream API",
153
+ "Apache Spark APIs"
154
+ ],
155
+ correct: 2
156
+ }
157
+ ],
158
+ // Getting Started & Basic Operations
159
+ [
160
+ {
161
+ q: "On Azure Databricks, what is the default format for tables?",
162
+ a: [
163
+ "Delta Lake",
164
+ "Parquet",
165
+ "CSV"
166
+ ],
167
+ correct: 0
168
+ },
169
+ {
170
+ q: "Which approach automatically gives you all Delta Lake benefits when saving data on Azure Databricks?",
171
+ a: [
172
+ "Manually setting table properties",
173
+ "Saving data with default settings",
174
+ "Using third-party ingestion tools"
175
+ ],
176
+ correct: 1
177
+ },
178
+ {
179
+ q: "Where can you find examples of basic Delta Lake operations like creating tables and updating data?",
180
+ a: [
181
+ "In Delta Lake API documentation",
182
+ "In the Delta Transaction Log Protocol guide",
183
+ "In the Delta Lake tutorial"
184
+ ],
185
+ correct: 2
186
+ }
187
+ ],
188
+ // Data Ingestion & Conversion
189
+ [
190
+ {
191
+ q: "Which product is mentioned as a way to accelerate loading data into a Delta Lake?",
192
+ a: [
193
+ "Delta Live Tables (DLT)",
194
+ "Delta Query Engine",
195
+ "Delta Data Warehouse"
196
+ ],
197
+ correct: 0
198
+ },
199
+ {
200
+ q: "What is one method provided by Azure Databricks to convert Parquet or Iceberg data to Delta Lake?",
201
+ a: [
202
+ "Automatic backup",
203
+ "Incremental conversion",
204
+ "Full manual migration"
205
+ ],
206
+ correct: 1
207
+ },
208
+ {
209
+ q: "Which ingestion option is NOT listed as available for Delta Lake?",
210
+ a: [
211
+ "COPY INTO",
212
+ "Auto Loader",
213
+ "Real-time SQL polling"
214
+ ],
215
+ correct: 2
216
+ }
217
+ ],
218
+ // Table Management & Updates
219
+ [
220
+ {
221
+ q: "What operation does Delta Lake support to facilitate upserts into tables?",
222
+ a: [
223
+ "Merge",
224
+ "Join",
225
+ "Union"
226
+ ],
227
+ correct: 0
228
+ },
229
+ {
230
+ q: "Which Delta Lake feature allows updating table schema without rewriting data?",
231
+ a: [
232
+ "Vacuum",
233
+ "Manual or automatic schema updates",
234
+ "Liquid clustering"
235
+ ],
236
+ correct: 1
237
+ },
238
+ {
239
+ q: "What functionality does Delta Lake provide to rename or delete columns without rewriting data?",
240
+ a: [
241
+ "Schema enforcement",
242
+ "Selective overwrite",
243
+ "Column mapping"
244
+ ],
245
+ correct: 2
246
+ }
247
+ ],
248
+ // Advanced Features & Optimization
249
+ [
250
+ {
251
+ q: "Which capability allows Delta Lake to support both batch and streaming operations with a single copy of data?",
252
+ a: [
253
+ "Tight integration with Structured Streaming",
254
+ "In-memory data grids",
255
+ "Dedicated streaming servers"
256
+ ],
257
+ correct: 0
258
+ },
259
+ {
260
+ q: "How does Delta Lake enable querying previous versions of a table?",
261
+ a: [
262
+ "Through continuous data replication",
263
+ "Using the transaction log to review table history",
264
+ "Via external backup systems"
265
+ ],
266
+ correct: 1
267
+ },
268
+ {
269
+ q: "What optimization technique in Delta Lake helps reduce the number of files scanned during a query?",
270
+ a: [
271
+ "Index rebuilding",
272
+ "Data caching",
273
+ "Liquid clustering and data skipping"
274
+ ],
275
+ correct: 2
276
+ }
277
+ ]
278
+ ];
279
+ let score = 0;
280
+ let totalCards = 15;
281
+ let answeredCards = 0;
282
+ const gameBoard = document.getElementById("game-board");
283
+ const questionDisplay = document.getElementById("question-display");
284
+ const scoreDisplay = document.getElementById("score");
285
+ function createBoard() {
286
+ // Create 15 question cards (3 rows x 5 columns) appended after the category headers.
287
+ for (let row = 0; row < 3; row++) {
288
+ for (let col = 0; col < 5; col++) {
289
+ const card = document.createElement("div");
290
+ card.className = "card";
291
+ card.textContent = `$${(row + 1) * 100}`;
292
+ card.onclick = () => showQuestion(col, row, card);
293
+ gameBoard.appendChild(card);
294
+ }
295
+ }
296
+ }
297
+ function showQuestion(category, difficulty, cardElement) {
298
+ if (cardElement.classList.contains("disabled")) return;
299
+ const question = questions[category][difficulty];
300
+ const answerHtml = question.a
301
+ .map(
302
+ (answer, index) =>
303
+ `<button class="answer-btn" onclick="checkAnswer(${category}, ${difficulty}, ${index})">${answer}</button>`
304
+ )
305
+ .join("");
306
+ questionDisplay.innerHTML =
307
+ `<h2>${categories[category]} for $${(difficulty + 1) * 100}</h2>
308
+ <p>${question.q}</p>
309
+ <div class="answer-container">${answerHtml}</div>`;
310
+ cardElement.classList.add("disabled");
311
+ cardElement.style.backgroundColor = "#cccccc";
312
+ answeredCards++;
313
+ }
314
+ function checkAnswer(category, difficulty, selectedAnswer) {
315
+ const question = questions[category][difficulty];
316
+ const correctAnswer = question.a[question.correct];
317
+ const isCorrect = selectedAnswer === question.correct;
318
+ const value = (difficulty + 1) * 100;
319
+ document.querySelectorAll(".answer-btn").forEach((btn) => {
320
+ btn.disabled = true;
321
+ btn.classList.add("disabled");
322
+ });
323
+ if (isCorrect) {
324
+ score += value;
325
+ questionDisplay.innerHTML += `<p class="feedback" style="color: green;">Correct! You earned $${value}.</p>`;
326
+ } else {
327
+ score -= value;
328
+ questionDisplay.innerHTML += `<p class="feedback" style="color: red;">Wrong! You lost $${value}. The correct answer was: ${correctAnswer}</p>`;
329
+ }
330
+ scoreDisplay.textContent = `Score: ${score}`;
331
+ if (answeredCards === totalCards) {
332
+ endGame();
333
+ }
334
+ }
335
+ function endGame() {
336
+ questionDisplay.innerHTML = `<h2>Game Over!</h2><p>Your final score is $${score}.</p>`;
337
+ }
338
+ createBoard();
339
+ </script>
340
+ </body>
341
+ </html>