XOR Media

Coding, Operations, Etc.

Puzzle Solver

Backstory

Final Puzzle Solution

My brother got me a pretty cool puzzle for Christmas which claims to have "Over 300,000 wrong ways to assemble the pieces, but only One right way!". The only hint/instructions are that the final solution will be a 3x3 square with six points and six holes on ...

(more)
In misc, tagged: algorithms, coding, examples, and javascript.

String Truncate Middle With Ellipsis

There are times when you need to middle truncate a string. In many cases it's for UX/human purposes, though in some situations it's the best way to generate unique string for a length-limited field. This is the case I ran in to recently in trying to automate ...

(more)
In code, tagged: python, coding, examples, and strings.

Natural Sort Order with Zero Padding

Which of the following lists is sorted in the most "natural" fashion?

A:
    Elementary Season 1 Episode 1
    Elementary Season 1 Episode 10
    Elementary Season 1 Episode 11
    Elementary Season 1 Episode 12
    Elementary Season 1 Episode 13
    Elementary Season 1 Episode 2
    Elementary Season 1 Episode 3
    Elementary Season ...
(more)
In code, tagged: python, coding, examples, and sorting.

High Performance Web: Asynchronous HTTP

Async-What

The secret to building high performance sites which depend on external web services is asynchronous HTTP. The trick to asynchronous HTTP (or anything with the exception of UI) is to avoid callback hell. Enter futures/promise objects. When used correctly they make doing substantial asynchronous IO, relatively straightforward.

It ...

(more)

Seamless iOS Splash Video

As part of a project I'm currently working on we wanted to have a brief splash video that plays the first time our app starts up for branding purposes. The video also kills a little time as some initial processing is happening.

Nothing earth-shattering, but the video only plays ...

(more)
In code, tagged: coding, examples, github, ios, and oss.