{
    "archive_path": "archive/1789034682.498716",
    "base_url": "devblogs.microsoft.com/oldnewthing/20260909-00/?p=112683",
    "basename": "",
    "bookmarked_date": "2026-09-10 10:04",
    "canonical": {
        "archive_org_path": "https://web.archive.org/web/devblogs.microsoft.com/oldnewthing/20260909-00/?p=112683",
        "dom_path": "output.html",
        "favicon_path": "favicon.ico",
        "git_path": "git/",
        "google_favicon_path": "https://www.google.com/s2/favicons?domain=devblogs.microsoft.com",
        "headers_path": "headers.json",
        "htmltotext_path": "htmltotext.txt",
        "index_path": "index.html",
        "media_path": "media/",
        "mercury_path": "mercury/content.html",
        "pdf_path": "output.pdf",
        "readability_path": "readability/content.html",
        "screenshot_path": "screenshot.png",
        "singlefile_path": "singlefile.html",
        "warc_path": "warc/",
        "wget_path": "devblogs.microsoft.com/oldnewthing/20260909-00/index.html@p=112683.html"
    },
    "domain": "devblogs.microsoft.com",
    "extension": "",
    "hash": "1BGJK8E3TAD71W18XMGA",
    "history": {
        "archive_org": [],
        "dom": [],
        "favicon": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--output",
                    "favicon.ico",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://www.google.com/s2/favicons?domain=devblogs.microsoft.com"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-09-10T10:12:40.720806+00:00",
                "index_texts": null,
                "output": "favicon.ico",
                "pwd": "/data/archive/1789034682.498716",
                "schema": "ArchiveResult",
                "start_ts": "2026-09-10T10:12:40.294779+00:00",
                "status": "succeeded"
            }
        ],
        "git": [],
        "headers": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--head",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://devblogs.microsoft.com/oldnewthing/20260909-00/?p=112683"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-09-10T10:12:40.966303+00:00",
                "index_texts": null,
                "output": "headers.json",
                "pwd": "/data/archive/1789034682.498716",
                "schema": "ArchiveResult",
                "start_ts": "2026-09-10T10:12:40.726232+00:00",
                "status": "succeeded"
            }
        ],
        "htmltotext": [],
        "media": [],
        "mercury": [
            {
                "cmd": [
                    "/app/node_modules/@postlight/parser/cli.js",
                    "https://devblogs.microsoft.com/oldnewthing/20260909-00/?p=112683"
                ],
                "cmd_version": "1.0.0",
                "end_ts": "2026-09-10T10:12:53.448434+00:00",
                "index_texts": null,
                "output": "mercury",
                "pwd": "/data/archive/1789034682.498716",
                "schema": "ArchiveResult",
                "start_ts": "2026-09-10T10:12:50.321475+00:00",
                "status": "succeeded"
            }
        ],
        "pdf": [],
        "readability": [
            {
                "cmd": [
                    "/app/node_modules/readability-extractor/readability-extractor",
                    "/tmp/tmpj52ktoxq",
                    "https://devblogs.microsoft.com/oldnewthing/20260909-00/?p=112683"
                ],
                "cmd_version": "0.0.11",
                "end_ts": "2026-09-10T10:12:50.313611+00:00",
                "index_texts": [
                    "I noted some time ago that  Windows XP chose your initial picture at random from among the pictures in the %ALLUSERSPROFILE%\\Application Data\\Microsoft\\User Account Pictures\\Default Pictures directory. But it seems people want to know more.\n\nHas anyone attempted to figure out the RNG for how Windows XP determines what profile picture is used on first account creation?\n\u2014 Xeno (@XenoPanther) December 11, 2025\n\nThe random number generator is our friend RtlRandomEx, using the current value of GetTickCount() as the initial seed.\nThe function uses a one-pass random selection algorithm. I can immediately think of two benefits of this decision. First, compared to the na\u00efve two-pass algorithm of counting up all the items, then randomly picking a number from 1 to n, and then iterating a second time to find the item at that index, it\u2019s more efficient because it reduces the amount of calls into the file system, which is where the bottleneck is. Furthermore, the one-pass algorithm avoids complications if the number of files in the directory changes while the code is running.\nThe one-pass algorithm is a special case of  reservoir sampling, where k is 1. This special case permits a tailored algorithm that is much simpler.\nselectRandomFromIterator(iterator)\n{\n    var count = 0;\n    var winner = null;\n\n    while (iterator.moveNext()) {\n        ++count;\n        if (uniform_random(min: 1, max: count) == count) {\n            winner = iterator.current();\n        }\n    }\n\n    return winner;\n}\n\nThe way this algorithm works is by observing that in a collection of n items, the last item has a 1/n chance of being randomly selected. If it isn\u2019t selected, then you need to select randomly from the first n \u2212 1 items, which you can solve recursively.\nPlaying the recursion forward, you start with the base case which is that if you have a list of 1 item, then your only choice is to chose that item. Otherwise, if you have a list of n items, first choose an item randomly from the first n \u2212 1, and then switch to the nth item with a 1/n probability.\nAs a final safety check, the code stops after sampling 100 pictures. This avoids pathological behavior if somebody puts a million files in the Default Pictures directory.\n        \n\n        \n            \n    \n\n        CategoryTopics        \n            Author\n            Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information."
                ],
                "output": "readability",
                "pwd": "/data/archive/1789034682.498716",
                "schema": "ArchiveResult",
                "start_ts": "2026-09-10T10:12:48.347676+00:00",
                "status": "succeeded"
            }
        ],
        "screenshot": [],
        "singlefile": [],
        "title": [
            {
                "cmd": [
                    "curl",
                    "--silent",
                    "--location",
                    "--compressed",
                    "--max-time",
                    "120",
                    "--user-agent",
                    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) curl/curl 8.14.1 (x86_64-pc-linux-gnu)",
                    "https://devblogs.microsoft.com/oldnewthing/20260909-00/?p=112683"
                ],
                "cmd_version": "curl 8.14.1 (x86_64-pc-linux-gnu)",
                "end_ts": "2026-09-10T10:12:48.342826+00:00",
                "index_texts": null,
                "output": "What algorithm did Windows XP use to choose your initial user picture? - The Old New Thing",
                "pwd": "/data/archive/1789034682.498716",
                "schema": "ArchiveResult",
                "start_ts": "2026-09-10T10:12:48.294672+00:00",
                "status": "succeeded"
            }
        ],
        "wget": [
            {
                "cmd": [
                    "wget",
                    "--no-verbose",
                    "--adjust-extension",
                    "--convert-links",
                    "--force-directories",
                    "--backup-converted",
                    "--span-hosts",
                    "--no-parent",
                    "-e",
                    "robots=off",
                    "--timeout=120",
                    "--restrict-file-names=windows",
                    "--warc-file=/data/archive/1789034682.498716/warc/1789035160",
                    "--page-requisites",
                    "--user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 ArchiveBox/0.7.4 (+https://github.com/ArchiveBox/ArchiveBox/) wget/GNU Wget 1.21.3",
                    "--compression=auto",
                    "https://devblogs.microsoft.com/oldnewthing/20260909-00/?p=112683"
                ],
                "cmd_version": "GNU Wget 1.21.3",
                "end_ts": "2026-09-10T10:12:48.288821+00:00",
                "index_texts": null,
                "output": "devblogs.microsoft.com/oldnewthing/20260909-00/index.html@p=112683.html",
                "pwd": "/data/archive/1789034682.498716",
                "schema": "ArchiveResult",
                "start_ts": "2026-09-10T10:12:40.972985+00:00",
                "status": "succeeded"
            }
        ]
    },
    "icons": null,
    "is_archived": true,
    "is_static": false,
    "latest": {
        "archive_org": null,
        "dom": null,
        "favicon": "favicon.ico",
        "git": null,
        "media": null,
        "pdf": null,
        "screenshot": null,
        "singlefile": null,
        "title": "What algorithm did Windows XP use to choose your initial user picture? - The Old New Thing",
        "warc": null,
        "wget": "devblogs.microsoft.com/oldnewthing/20260909-00/index.html@p=112683.html"
    },
    "link_dir": "/data/archive/1789034682.498716",
    "newest_archive_date": "2026-09-10T10:12:50.321475+00:00",
    "num_failures": 0,
    "num_outputs": 6,
    "oldest_archive_date": "2026-09-10T10:12:40.294779+00:00",
    "path": "/oldnewthing/20260909-00/",
    "schema": "Link",
    "scheme": "https",
    "snapshot_id": "8fab69bd-5dea-4524-adff-341635a11d75",
    "sources": [
        "/data/sources/1789034682-import.txt"
    ],
    "tags": null,
    "tags_str": "",
    "timestamp": "1789034682.498716",
    "title": "What algorithm did Windows XP use to choose your initial user picture? - The Old New Thing",
    "updated": "2026-09-10T10:12:40.294229+00:00",
    "updated_date": "2026-09-10 10:12",
    "url": "https://devblogs.microsoft.com/oldnewthing/20260909-00/?p=112683"
}