-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathhw.html
510 lines (435 loc) · 16.7 KB
/
hw.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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
<!DOCTYPE html>
<html>
<head>
<link rel="canonical" href="https://hardmath123.github.io/hw.html"/>
<link rel="stylesheet" type="text/css" href="/static/base.css"/>
<title>Hello, World! - Comfortably Numbered</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="alternate" type="application/rss+xml" title="Comfortably Numbered" href="/feed.xml" />
<!--
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$']]}
});
</script>
-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-YNHdsYkH6gMx9y3mRkmcJ2mFUjTd0qNQQvY9VYZgQd7DcN7env35GzlmFaZ23JGp" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
// customised options
// • auto-render specific keys, e.g.:
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
{left: '\\begin{align}', right: '\\end{align}', display: true},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
// • rendering keys, e.g.:
throwOnError : false
});
});
</script>
</head>
<body>
<header id="header">
<script src="static/main.js"></script>
<div>
<a href="/"><span class="left-word">Comfortably</span> <span class="right-word">Numbered</span></a>
</div>
</header>
<article id="postcontent" class="centered">
<section>
<h1>Hello, World!</h1>
<center><em><p>Welcoming myself to my blog.</p>
</em></center>
<h4>Wednesday, November 27, 2013 · 6 min read</h4>
<p class="dropcap">I started on Comfortably Numbered a couple of months ago,
because I needed a blog. I needed a blog to dump interesting thoughts and I
wanted a place besides GitHub to show off projects. I wanted, for once, to
write industrial-strength code that would face <em>real people</em> instead of
fellow hackers. When you write code for a hacker, you write the bare minimum
for it to work. So I ended up obsessing insanely about the design, typography,
and optimization of this site. Pretty much everything except the content.
<p>I thought I'd present a cool non-trivial Hello, World program here. But all
the cool languages have really boring Hello, Worlds, and I have a natural
revulsion to a language whose most basic Hello, World is more than a line
long—C variants, Java, etc. So here's an assortment of my favorite Hello,
World programs.
<pre><code>echo 'print "console.log(\"print \\\"echo Hello, World\\\"\")"' | ruby | node | python | bash</code></pre>
<p>Here's a merry (pure) CSS3D welcome. It's essentially just a bunch of
animations with 3D transforms, but the end result is pretty impressive. It's
also overkill, which is the <s>best</s> only way to show off.
<style>
#hw {
text-align: center;
font-weight: 900;
font-size: 40px;
touch-callout: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
-khtml-user-select: none;
}
#hw span {
color: #aaa;
display: inline-block;
width: 30px;
margin: 0;
padding: 0;
height: 50px;
text-shadow: 0 0 3px #aaf;
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-ms-transform-origin: 0 0 100px;
-webkit-transform-origin: 0 0 100px;
transform-origin: 0 0 100px;
}
#hw span:nth-child(8n) {
-webkit-animation-name: rot0;
animation-name: rot0;
}
#hw span:nth-child(8n+1) {
-webkit-animation-name: rot1;
animation-name: rot1;
}
#hw span:nth-child(8n+2) {
-webkit-animation-name: rot2;
animation-name: rot2;
}
#hw span:nth-child(8n+3) {
-webkit-animation-name: rot3;
animation-name: rot3;
}
#hw span:nth-child(8n+4) {
-webkit-animation-name: rot4;
animation-name: rot4;
}
#hw span:nth-child(8n+5) {
-webkit-animation-name: rot5;
animation-name: rot5;
}
#hw span:nth-child(8n+6) {
-webkit-animation-name: rot6;
animation-name: rot6;
}
#hw span:nth-child(8n+7) {
-webkit-animation-name: rot7;
animation-name: rot7;
}
@-webkit-keyframes rot0 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
}
}
@keyframes rot0 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
-ms-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
}
}
@-webkit-keyframes rot1 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(360deg) rotateY(360deg) rotateZ(-360deg);
transform: rotateX(360deg) rotateY(360deg) rotateZ(-360deg);
}
}
@keyframes rot1 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(360deg) rotateY(360deg) rotateZ(-360deg);
-ms-transform: rotateX(360deg) rotateY(360deg) rotateZ(-360deg);
transform: rotateX(360deg) rotateY(360deg) rotateZ(-360deg);
}
}
@-webkit-keyframes rot2 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(360deg) rotateY(-360deg) rotateZ(360deg);
transform: rotateX(360deg) rotateY(-360deg) rotateZ(360deg);
}
}
@keyframes rot2 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(360deg) rotateY(-360deg) rotateZ(360deg);
-ms-transform: rotateX(360deg) rotateY(-360deg) rotateZ(360deg);
transform: rotateX(360deg) rotateY(-360deg) rotateZ(360deg);
}
}
@-webkit-keyframes rot3 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(360deg) rotateY(-360deg) rotateZ(-360deg);
transform: rotateX(360deg) rotateY(-360deg) rotateZ(-360deg);
}
}
@keyframes rot3 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(360deg) rotateY(-360deg) rotateZ(-360deg);
-ms-transform: rotateX(360deg) rotateY(-360deg) rotateZ(-360deg);
transform: rotateX(360deg) rotateY(-360deg) rotateZ(-360deg);
}
}
@-webkit-keyframes rot4 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(-360deg) rotateY(360deg) rotateZ(360deg);
transform: rotateX(-360deg) rotateY(360deg) rotateZ(360deg);
}
}
@keyframes rot4 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(-360deg) rotateY(360deg) rotateZ(360deg);
-ms-transform: rotateX(-360deg) rotateY(360deg) rotateZ(360deg);
transform: rotateX(-360deg) rotateY(360deg) rotateZ(360deg);
}
}
@-webkit-keyframes rot5 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(-360deg) rotateY(360deg) rotateZ(-360deg);
transform: rotateX(-360deg) rotateY(360deg) rotateZ(-360deg);
}
}
@keyframes rot5 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(-360deg) rotateY(360deg) rotateZ(-360deg);
-ms-transform: rotateX(-360deg) rotateY(360deg) rotateZ(-360deg);
transform: rotateX(-360deg) rotateY(360deg) rotateZ(-360deg);
}
}
@-webkit-keyframes rot6 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(-360deg) rotateY(-360deg) rotateZ(360deg);
transform: rotateX(-360deg) rotateY(-360deg) rotateZ(360deg);
}
}
@keyframes rot6 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(-360deg) rotateY(-360deg) rotateZ(360deg);
-ms-transform: rotateX(-360deg) rotateY(-360deg) rotateZ(360deg);
transform: rotateX(-360deg) rotateY(-360deg) rotateZ(360deg);
}
}
@-webkit-keyframes rot7 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(-360deg) rotateY(-360deg) rotateZ(-360deg);
transform: rotateX(-360deg) rotateY(-360deg) rotateZ(-360deg);
}
}
@keyframes rot7 {
from {
-webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
-ms-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}
to {
-webkit-transform: rotateX(-360deg) rotateY(-360deg) rotateZ(-360deg);
-ms-transform: rotateX(-360deg) rotateY(-360deg) rotateZ(-360deg);
transform: rotateX(-360deg) rotateY(-360deg) rotateZ(-360deg);
}
}
</style>
<div id="hw">
<span id="hw-1">H</span>
<span id="hw-2">e</span>
<span id="hw-3">l</span>
<span id="hw-4">l</span>
<span id="hw-5">o</span>
<span id="hw-6">,</span>
<span id="hw-7"> </span>
<span id="hw-8">w</span>
<span id="hw-9">o</span>
<span id="hw-10">r</span>
<span id="hw-11">l</span>
<span id="hw-12">d</span>
</div>
<p>While we're feeling masochistic, here's Hello, World in Malbolge (the first
working Malbolge program took 2 years and a LISP program to find, so don't feel
too bad if you don't get it right away):
<pre class="language-plaintext"><code>('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@></code></pre>
<p>If you're on a Mac, it's always nice to hear a human voice (or a reasonable
approximation thereof). The <code>say</code> command is a very easy way to
annoy your sysadmin. Try putting a <code>say</code> command in a shared
computer's <code>.profile</code>—perhaps along the lines of <q>Where have
you hidden the body?</q>.
<pre class="language-bash"><code>$ say -v Zarvox "Hello, World"</code></pre>
<p>Piet's Hello, World is pretty, self-referential, and a nice avatar for the
aspiring esolang geek.
<p><img src="http://www.dangermouse.net/esoteric/piet/hw6_big.png"/>
<p>I'd post a Hello, World program in Whitespace, but I decided to save myself
the effort and dump an empty box below. Use your imagination.
<pre class="language-plaintext" style="height:300px;"><code></code></pre>
<p>The following is a Hello, World program. Honest.
<pre class="language-plaintext">
<code>
Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.
Act I: Hamlet's insults and flattery.
Scene I: The insulting of Romeo.
[Enter Hamlet and Romeo]
Hamlet:
You lying stupid fatherless big smelly half-witted coward! You are as
stupid as the difference between a handsome rich brave hero and thyself!
Speak your mind!
You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer's
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!
You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.
Speak your mind!
[Exit Romeo]
Scene II: The praising of Juliet.
[Enter Juliet]
Hamlet:
Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!
[Exit Juliet]
Scene III: The praising of Ophelia.
[Enter Ophelia]
Hamlet:
Thou art as lovely as the product of a large rural town and my amazing
bottomless embroidered purse. Speak thy mind!
Thou art as loving as the product of the bluest clearest sweetest sky
and the sum of a squirrel and a white horse. Thou art as beautiful as
the difference between Juliet and thyself. Speak thy mind!
[Exeunt Ophelia and Hamlet]
Act II: Behind Hamlet's back.
Scene I: Romeo and Juliet's conversation.
[Enter Romeo and Juliet]
Romeo:
Speak your mind. You are as worried as the sum of yourself and the
difference between my small smooth hamster and my nose. Speak your
mind!
Juliet:
Speak YOUR mind! You are as bad as Hamlet! You are as small as the
difference between the square of the difference between my little pony
and your big hairy hound and the cube of your sorry little
codpiece. Speak your mind!
[Exit Romeo]
Scene II: Juliet and Ophelia's conversation.
[Enter Ophelia]
Juliet:
Thou art as good as the quotient between Romeo and the sum of a small
furry animal and a leech. Speak your mind!
Ophelia:
Thou art as disgusting as the quotient between Romeo and twice the
difference between a mistletoe and an oozing infected blister! Speak
your mind!
[Exeunt]</code></pre>
<p>And finally, FiM++ looks like an average letter to Grandma:
<pre class="language-plaintext"><code>Dear Princess Celestia:Hello World!
Today I learned how to say hello world!
I said "Hello, World!"!
That's all about how to say hello world.
Your faithful student, Kyli Rouge.</code></pre>
<p>(Other people, however, write their letters in LOLCODE.)
<pre class="language-plaintext"><code>HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE</code></pre>
</section>
<div id="comment-breaker">◊ ◊ ◊</div>
</article>
<footer id="footer">
<div>
<ul>
<li><a href="https://github.com/kach">
Github</a></li>
<li><a href="feed.xml">
Subscribe (RSS feed)</a></li>
<li><a href="https://twitter.com/hardmath123">
Twitter</a></li>
<li><a href="https://creativecommons.org/licenses/by-nc/3.0/deed.en_US">
CC BY-NC 3.0</a></li>
</ul>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46120535-1', 'hardmath123.github.io');
ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
</footer>
</body>
</html>