Commorientes: “simultaneous deaths”
Ante: (no longer productive) Prior to in time.
Needed a fancy word that makes no sense to document the order of passing of the characters of the 1964-1967 sitcom Gilligan’s Island.
Read MoreCommorientes: “simultaneous deaths”
Ante: (no longer productive) Prior to in time.
Needed a fancy word that makes no sense to document the order of passing of the characters of the 1964-1967 sitcom Gilligan’s Island.
Read MoreCame across a Facebook video that I felt the need to “document”. Specifically a list of 120 songs between the years of 1990 to 1999, also called “My Teenage Playlist“.
This page is going to heavily depend on external links to Wikipedia and YouTube.
Read MoreA song recorded and released May 1973 came into a resurgence almost 10 years ago by Sara Bareilles with her amazing rendition. Sang recently at the NEXT / Kennedy Center for the 2024 Near Years Eve celebration.
There’s been many other things that find their finality in 2024, and for once I’m glad closure was invented for many of these.
Read MoreIn writing “quad-quad”, which is a set of four 4-letter speak-able words that can be used as a user-friendly “bookmark” into easily finding a record, I was writing a “quick” program to extract the contents of wikidatawiki-20220820-pages-articles-multistream.xml (a wikipedia dump) and came into this large delay in the following loop:
$alphas = 'qwertyuiopasdfghjklzxcvbnm ';
$newline = '';
for ($x = 0; $x < strlen($line); $x++) {
    $c = substr($line, $x, 1);
    if (strpos($alphas, $c) !== false) {
        $newline = $newline . $c;
    else {
        $newline = $newline . ' ';
    }
}
The loops main purpose is to sanitize any non-letter data by replacing unknown characters with a space for later processing. The end result would be words that I could filter down to 4-character words and tally them up.
When the program read a line around 1mb in length it would “hang” for a bit as it chewed through the data. In a nutshell 25,100,655 bytes of data would take 24m36s. It was time to optimize.
Replacing the previous with the following regex performance was increased immensely.
$newline = preg_replace('/[^a-z]/', ' ', $line);The same amount of data took 1.892s.
Lesson: If you don’t know regexes, learn regexes.