Random Weird Things - Part Ⅰ

Published at 2024-07-05T10:59:59+03:00; Updated at 2025-02-08

Every so often, I come across random, weird, and unexpected things on the internet. I thought it would be neat to share them here from time to time. As a start, here are ten of them.

2024-07-05 Random Weird Things - Part Ⅰ (You are currently reading this)

2025-02-08 Random Weird Things - Part Ⅱ

2025-08-15 Random Weird Things - Part Ⅲ

Table of Contents

1. `bad.horse` traceroute

Run traceroute to get the poem (or song).

Update: A reader hinted that by specifying `-n 60`, there will be even more output!

2. ASCII cinema

Fancy watching Star Wars Episode IV in ASCII? Head to the ASCII cinema:

https://asciinema.org/a/569727

3. Netflix's Hello World application

Netflix has got the Hello World application run in production 😱

By the time this is posted, it seems that Netflix has taken it offline... I should have created a screenshot!

C programming

4. Indexing an array

In C, you can index an array like this: `array[i]` (not surprising). But this works as well and is valid C code: `i[array]`, 🤯 It's because after the spec `A[B]` is equivalent to `*(A + B)` and the ordering doesn't matter for the `+` operator. All 3 loops are producing the same output. Would be funny to use `i[array]` in a merge request of some code base on April Fool's day!

5. Variables with prefix `$`

In C you can prefix variables with `$`! E.g. the following is valid C code 🫠:

6. Object oriented shell scripts using `ksh`

Experienced software developers are aware that scripting languages like Python, Perl, Ruby, and JavaScript support object-oriented programming (OOP) concepts such as classes and inheritance. However, many might be surprised to learn that the latest version of the Korn shell (Version 93t+) also supports OOP. In ksh93, OOP is implemented using user-defined types:

Using types to create object oriented Korn shell 93 scripts

7. This works in Go

There is no pointer arithmetic in Go like in C, but it is still possible to do some brain teasers with pointers 😧:

Go playground

8. "I am a Teapot" HTTP response code

Defined in 1998 as one of the IETF's traditional April Fools' jokes (RFC 2324), the Hyper Text Coffee Pot Control Protocol specifies an HTTP status code that is not intended for actual HTTP server implementation. According to the RFC, this code should be returned by teapots when asked to brew coffee. This status code also serves as an Easter egg on some websites, such as Google.com's "I'm a teapot" feature. Occasionally, it is used to respond to a blocked request, even though the more appropriate response would be the 403 Forbidden status code.

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#418

9. `jq` is a functional programming language

Many know of `jq`, the handy small tool and swiss army knife for JSON parsing.

https://github.com/jqlang/jq

What many don't know that `jq` is actually a full blown functional programming language `jqlang`, have a look at the language description:

https://github.com/jqlang/jq/wiki/jq-Language-Description

As a matter of fact, the language is so powerful, that there exists an implementation of `jq` in `jq` itself:

https://github.com/wader/jqjq

Here some snipped from `jqjq`, to get a feel of `jqlang`:

10. Regular expression to verify email addresses

This is a pretty old meme, but still worth posting here (as some may be unaware). The RFC822 Perl regex to validate email addresses is 😱:

https://pdw.ex-parrot.com/Mail-RFC822-Address.html

I hope you had some fun. E-Mail your comments to `paul@nospam.buetow.org` :-)

other related posts are:

Back to the main site

Proxied content from gemini://foo.zone/gemfeed/2024-07-05-random-weird-things.gmi (external content)

Gemini request details:

Original URL
gemini://foo.zone/gemfeed/2024-07-05-random-weird-things.gmi
Status code
Success
Meta
text/gemini;
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.