Skip to content

Instantly share code, notes, and snippets.

@Glorfindel83
Glorfindel83 / broken-image-repairer.md
Last active August 19, 2023 14:08
Broken Image Repairer

Broken Image Repairer

What is the problem?

A long time ago, it was possible to inline images from all kinds of external sources. Since the switch from HTTP to HTTPS, this is no longer possible; only HTTPS sources are allowed. This leads to ugly blurbs like

alt text http://example.com/image.png

instead of a nicely formatted page with images. Sometimes, the links don't even work anymore, even with HTTPS images, which will show like this: ... Luckily, we have the Wayback Machine which is able to rescue some of the lost images. Since a picture often says more than a thousand words, it's important to bring back the post into its original state; important enough to justify the occasional bump of an old post (see below).

package com.stackexchange.toolbox.misc;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.apache.http.Header;
var ok = {};
var deleted = {};
function check(i) {
if (i < 317093) {
console.log(deleted);
console.log(ok);
return;
}
var questionID = i.toString();
$.get("https://meta.stackexchange.com/questions/" + questionID + "/?noredirect=1")
We can't make this file beautiful and searchable because it's too large.
site,post id,post url,status,url,result,archived now?
stackoverflow,188327,https://stackoverflow.com/q/188327,failed,http://i38.tinypic.com/2pqopxi.jpg,Resource not found.,FALSE
stackoverflow,207019,https://stackoverflow.com/q/207019,failed,http://i35.tinypic.com/16i9oxi.jpg,Resource not found.,FALSE
stackoverflow,229594,https://stackoverflow.com/q/229594,failed,http://i36.tinypic.com/1q50t1.png,Resource not found.,FALSE
stackoverflow,232563,https://stackoverflow.com/q/232563,failed,http://i38.tinypic.com/2rnyjd0.png,Resource not found.,FALSE
stackoverflow,384220,https://stackoverflow.com/q/384220,already archived,http://i41.tinypic.com/307xfo9.png,https://web.archive.org/web/20121114161338/http://i41.tinypic.com/307xfo9.png,FALSE
stackoverflow,395195,https://stackoverflow.com/q/395195,already archived,http://i44.tinypic.com/30a7390.jpg,https://web.archive.org/web/20110703111834/http://i44.tinypic.com/30a7390.jpg,FALSE
stackoverflow,440743,https://stackoverflow.com/q/440743,archived,http://i39.tinypic.com/121
OT -> SO:
https://meta.stackexchange.com/q/100372
https://meta.stackexchange.com/q/103829
https://meta.stackexchange.com/q/103886
https://meta.stackexchange.com/q/113245
https://meta.stackexchange.com/q/177785
https://meta.stackexchange.com/q/181705
https://meta.stackexchange.com/q/162128
https://meta.stackexchange.com/q/218222
https://meta.stackexchange.com/q/227867

Judging from the fact that there's been a lot of talk of venture capital being pumped into Stack Overflow lately, something hasn't been sitting well with me at all. Then I got to thinking.

Ever think about Jeff's user ID? It's [1][1]. Seems innocuous, right? Like maybe he was the first user or something? But no, think about it. Jeff could have had any user ID he wanted. He could have had 1337 or 3735928559 or even -4. But those would have been too obvious for most conspiracy theorists. Jeff is a more subtle man than that.

For Jeff is even more devious than two [Wilson Fisks][2]. You see, 1 is the atomic number of [hydrogen][3]. And what is made of hydrogen? Well, a lot of things. So we need to narrow it down some more.

Fiddling with some more numbers, we come to realize that Jeff's name is "Jeff". But that's short for "Jeffry". That means he's missing two letters off of his name. His ID is 1, and he's missing 2 letters. [Deuterium][4] is hydrogen, having an atomic number 1 but an atomic mass of 2.

OpenSTV version 1.7 (http://www.OpenSTV.org/)
Suggested donation for using OpenSTV for an election is $50. Please go to
http://www.OpenSTV.org/donate to donate via PayPal, Google Checkout, or
Amazon Payments.
Certified election reports are also available. Please go to
http://www.openstv.org/certified-reports for more information.
Loading ballots from file chess-stackexchange-com-2019-election-results.blt.
package net.mathoverflow;
import java.util.HashMap;
import java.util.Map;
public class KnightsTour {
private static final int SIZE = 5; // odd number >= 5
private static final int MAX_WINDINGS = 4, UNIT = 16, HALF_BOARD_SIZE = (MAX_WINDINGS + 1) * SIZE - 1;
private static final java.awt.Point center = new java.awt.Point(UNIT * HALF_BOARD_SIZE, UNIT * HALF_BOARD_SIZE);
package net.mathoverflow;
import java.awt.Point;
// See https://mathoverflow.net/a/332788/70594
public class KnightsTour3Picture {
public static void main(String[] args) throws Exception {
System.out.println("<!DOCTYPE html>");
System.out.println("<html>");
System.out.println("<body>");