-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
Copy pathindex.html
293 lines (253 loc) · 15.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
{% extends "base.html" %}
{% block page_title %}{{ html_title }}{% endblock %}
{% block head %}
{% autoescape off %}
<script>
var domainData = {{ domain_data_json }};
var nextChapter = "/{{ language_code }}/{{ next_chapter }}";
var previousChapter = "/{{ language_code }}/{{ previous_chapter }}";
var backChapter = "/{{ language_code }}/{{ back_chapter }}";
var tutorialData = {{ tutorial_data_json }};
</script>
{% endautoescape %}
<script src="/static/js/learnpython.js"></script>
{% endblock %}
{% block title %}{% if tutorial_page %}{{ page_title }} - {% endif %}Learn {{ domain_data.language_uppercase }} - Free
Interactive {{ domain_data.language_uppercase }} Tutorial{% endblock %}
{% block ogtitle %}{% if tutorial_page %}{{ page_title }} - {% endif %}Learn {{ domain_data.language_uppercase }} - Free
Interactive {{ domain_data.language_uppercase }} Tutorial{% endblock %}
{% block ogurl %}{{ domain_data.full_url }}{% if tutorial_page %}/{{ path }}{% endif %}{% endblock %}
{% block content %}
<div class="container" id="main">
<div class="row">
<div class="col-12">
{% if env == "prod" %}
<div class="d-none d-lg-block">
<a href="https://codingforkids.io?utm_source=learnpython&utm_medium=banner&utm_campaign=cfk-learnpython&utm_id=learnpython" target="_blank">
<img src="/static/img/banners/cfk/promo_long.png" style="width: 100%; margin-bottom: 10px"/>
</a>
{# <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>#}
{# <!-- Interactive Tutorials Top -->#}
{# <ins class="adsbygoogle"#}
{# style="display:block"#}
{# data-ad-client="ca-pub-3723950136133694"#}
{# data-ad-slot="2345161899"#}
{# data-ad-format="auto"#}
{# data-full-width-responsive="true"></ins>#}
{# <script>#}
{# (adsbygoogle = window.adsbygoogle || []).push({});#}
{# </script>#}
</div>
{% endif %}
{# <div class="mb-3">#}
{# <a href="https://chrome.google.com/webstore/detail/technews/babfhcgjchdmjknpmbdpcfggaonhimlj" target="_blank"><img src="/static/img/banners/technews-banner-wide.png" style="width: 100%"/></a>#}
{# </div>#}
{% if page_title %}
<ul class="breadcrumb" style="margin-top: 10px">
{% if back_chapter %}
<li><a href="/{{ language_code }}/{{ back_chapter }}">{{ back_chapter }}</a> <span
class="divider mr-1">/</span></li>
{% endif %}
<li class="active">{{ page_title }}</li>
</ul>
{% endif %}
</div>
</div>
<div class="row mt-3">
<div class="col col-lg-10">
{% if domain_data.language == "sql" %}
{% if page_title in ["Hello, World!", "Selecting data", "Creating tables"] %}
<p>To discover more interactive courses and gain hands-on experience in SQL, get started with DataCamp's free <a href="https://datacamp.pxf.io/5gjDNn?sharedId=learnsqlonline.org">Introduction to SQL</a> tutorial. Learn Data Science by completing interactive coding challenges and watching videos by expert instructors. <a href="https://datacamp.pxf.io/Kjxv6a?sharedId=learnsqlonline.org">Start Now!</a></p>
{% elif page_title in ["Inserting rows", "Updating rows", "Deleting rows"] %}
<p>To discover more intermediate courses and gain hands-on experience in SQL, register to DataCamp's <a href="https://datacamp.pxf.io/m5nmQ7?sharedId=learnsqlonline.org">Intermediate SQL</a> tutorial. Learn Data Science by completing interactive coding challenges and watching videos by expert instructors. <a href="https://datacamp.pxf.io/Kjxv6a?sharedId=learnsqlonline.org">Start Now!</a></p>
{% elif page_title in ["Joining tables", "Group by", "Aggregate functions"] %}
<p>To discover more courses about data manipulation and SQL functions, register to DataCamp's <a href="https://datacamp.pxf.io/DKLN45?sharedId=learnsqlonline.org">SQL</a> tutorials. Learn Data Science by completing interactive coding challenges and watching videos by expert instructors. <a href="https://datacamp.pxf.io/Kjxv6a?sharedId=learnsqlonline.org">Start Now!</a></p>
{% elif page_title in ["The HAVING statement", "Distinct queries", "Order by"] %}
<p>To discover more intermediate to advanced SQL courses, register to DataCamp's <a href="https://datacamp.pxf.io/eKR5Wg?sharedId=learnsqlonline.org">SQL</a> tutorials. Learn Data Science by completing interactive coding challenges and watching videos by expert instructors. <a href="https://datacamp.pxf.io/Kjxv6a?sharedId=learnsqlonline.org">Start Now!</a></p>
{% elif "<h1>Welcome</h1>" in text %}
<p>Get started learning SQL with DataCamp's free <a href="https://datacamp.pxf.io/5gjDNn?sharedId=learnsqlonline.org">Introduction to SQL</a> tutorial. Learn Data Science by completing interactive coding challenges and watching videos by expert instructors. <a href="https://datacamp.pxf.io/Kjxv6a?sharedId=learnsqlonline.org">Start Now!</a></p>
<p>This site is generously supported by <a href="https://datacamp.pxf.io/Kjxv6a?sharedId=learnsqlonline.org">DataCamp</a>. DataCamp offers online interactive <a href="https://datacamp.pxf.io/eKR5Wg?sharedId=learnsqlonline.org">SQL Tutorials</a> for Data Science. Join 11+ million other learners and get started learning <a href="https://datacamp.pxf.io/eKR5Wg?sharedId=learnsqlonline.org">SQL for data science</a> today.</p>
<p>Good news! You can save 25% off your Datacamp annual subscription with the code <a href="https://datacamp.pxf.io/Y9Nz7R">LEARNPYTHON23ALE25 - Click here to redeem your discount!</a></p>
{% endif %}
{% endif %}
<div id="inner-text">{% autoescape off %}
{% if page_title %}
<h1>{{ page_title }}</h1>
<hr/>
{% endif %}
{{ text }}
{% endautoescape %}</div>
<div class="row mt-2">
<div class="col">
<button id="start-exercise" class="btn btn-success pull-left mt-2" onclick="reset()">
<i class="fas fa-play"></i> Start Exercise
</button>
</div>
</div>
<hr/>
<div class="row mt-2 mb-2">
<div class="col">
{% if previous_chapter %}
<a class="btn btn-primary pull-left" href="/{{ language_code }}/{{ previous_chapter }}">
<i class="fas fa-angle-double-left"></i> Previous Tutorial
</a>
{% endif %}
{% if next_chapter %}
<a class="btn btn-primary pull-right" href="/{{ language_code }}/{{ next_chapter }}">
Next Tutorial <i class="fas fa-angle-double-right"></i>
</a>
{% endif %}
</div>
</div>
<div class="row mt-2">
<div class="col">
<a href="https://codingforkids.io?utm_source=learnpython&utm_medium=banner&utm_campaign=cfk-learnpython&utm_id=learnpython" target="_blank">
<img src="/static/img/banners/cfk/promo_mid.png" style="width: 100%; margin-bottom: 10px"/>
</a>
{# <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>#}
{# <!-- Interactive Tutorials Bottom -->#}
{# <ins class="adsbygoogle"#}
{# style="display:block"#}
{# data-ad-client="ca-pub-3723950136133694"#}
{# data-ad-slot="6124145877"#}
{# data-ad-format="auto"#}
{# data-full-width-responsive="true"></ins>#}
{# <script>#}
{# (adsbygoogle = window.adsbygoogle || []).push({});#}
{# </script>#}
</div>
</div>
</div>
<div class="col-2 d-none d-lg-block mt-2">
<div id="google-ad-right">
{% if domain_data.language == "sql" %}
<iframe src="https://learnsqlonline-ads.datacamp.com/?page={{page_title}}&language={{language_code}}" frameborder="0" width="160" height="600" scrolling="no" allowtransparancy="true" style="margin-bottom: 10px; border: 0;"></iframe>
{% endif %}
<h4>Sponsors</h4>
<hr/>
{# <div class="mt-3">#}
{# <a href="http://onelink.to/5tw9ex"><img src="/static/img/banners/typetap-banner.png" target="_blank"></a>#}
{# </div>#}
<div class="mt-3">
{# <a href="https://codingforkids.io?utm_source=learnpython&utm_medium=banner&utm_campaign=cfk-learnpython&utm_id=learnpython" target="_blank"> #}
{# <img src="/static/img/banners/cfk/promo_high.png" style="width: 100%; margin-bottom: 10px"/>#}
{# </a>#}
{% if gruvian_ad %}
<a target="_blank" href="{{gruvian_ad.click_url}}">
<img src="{{ gruvian_ad.ad.image.url }}" alt="{{ gruvian_ad.ad.image.alt if gruvian_ad.ad.image.alt else 'Gruvian Ad' }}" style="width: 100%; height: auto; margin-bottom: 10px">
</a>
{% else %}
<a href="https://codingforkids.io?utm_source=learnpython&utm_medium=banner&utm_campaign=cfk-learnpython&utm_id=learnpython" target="_blank">
<img src="/static/img/banners/cfk/promo_high.png" style="width: 100%; margin-bottom: 10px"/>
</a>
{% endif %}
{# <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>#}
{# <!-- Interactive Tutorials Right -->#}
{# <ins class="adsbygoogle"#}
{# style="display:inline-block;width:160px;height:600px"#}
{# data-ad-client="ca-pub-3723950136133694"#}
{# data-ad-slot="5528539062"></ins>#}
{# <script>#}
{# (adsbygoogle = window.adsbygoogle || []).push({});#}
{# </script>#}
</div>
<div class="mt-3">
<a href="https://digitalocean.com/" target="_blank" >
<img src="/static/img/banners/digital-ocean.svg" style="width: 160px" alt="Digital Ocean">
</a>
</div>
<div class="mt-3">
<a href="http://www.spoj.com/?utm_campaign=permanent&utm_medium=banner&utm_source=learnx" target="_blank">
<img src="/static/img/logos/spoj.png" style="width: 160px" alt="Sphere Engine">
</a>
</div>
<div class="mt-3">
<a href="#" data-toggle="modal" data-target="#masterschoolModal">
<img src="/static/img/masterschool.png" style="width: 150px;"/>
</a>
</div>
<hr />
<div class="mt-3">
<a href="https://app.gruvian.com/preview/13" class="btn btn-primary btn-block">
Sponsor this Site
</a>
</div>
<h4 class="mt-3">Chapters</h4>
<hr/>
<div class="mt-2">
{% for link, link_href in site_tutorial_links %}
<div>
<a href="{{ link_href }}">{{ link }}</a>
</div>
{% endfor %}
</div>
</div>
</div>
</div> <!-- row -->
</div>
{% include "footer.html" %}
<footer id="dock">
<div class="container">
<div class="row mb-2">
<div class="col-sm-12 col-lg-6 mt-3">
<div class="code-window">
<div class="row mb-2">
<div class="col-2">
<h5>Code</h5>
</div>
<div class="col-10 text-right">
<button id="run-button" class="btn btn-success btn-sm" onclick="execute()">
<i class="fas fa-play"></i> Run
</button>
<button id="reset-button" onclick="reset()" class="btn btn-primary btn-sm">
<i class="fas fa-sync-alt"></i> Reset</button>
<button id="solution-button" onclick="showSolution()" class="btn btn-primary btn-sm">Solution</button>
<button id="toggle-dock-button" class="btn btn-primary btn-sm" onclick="toggleMinimize()">
<span class="maximized">
<i class="fas fa-angle-double-down"></i>
</span>
<span class="minimized">
<i class="fas fa-angle-double-up"></i>
</span>
</button>
</div>
</div>
<div class="row footer-toggle">
<div class="col">
<textarea id="code">{{ code }}</textarea>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-lg-6 mt-3">
<div class="output-window">
<div class="row mb-2">
<div class="col-3">
<h5>Output</h5>
</div>
<div class="col-9 text-right">
<button id="expected-output-button" class="btn btn-primary btn-sm" onclick="showExpected()">
Expected Output
</button>
</div>
</div>
<div class="row footer-toggle">
<div class="col">
<div id="text-output">
<textarea id="output"></textarea>
<div class="powered-by-sphere">
Powered by <a target="_blank" href="http://sphere-engine.com/">Sphere Engine ™</a>
</div>
</div>
<iframe id="html-output"
style="border: 1px solid #ccc; box-sizing: border-box; background-color: white; display: none; height: 200px; width: 100%"></iframe>
<iframe id="expected-output"
style="border: 1px solid #ccc; box-sizing: border-box; background-color: white; display: none; height: 200px; width: 100%"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
</footer>
{% endblock %}