This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0800:0000 1E PUSH DS // save ds, since we'll be setting it to 0 | |
| 0800:0001 33C9 XOR CX,CX // cx = 0 | |
| 0800:0003 8ED9 MOV DS,ECX // ds = 0 | |
| // Detect parallel port address (from bios data area) | |
| 0800:0005 BB0804 MOV BX,0408 | |
| 0800:0008 B104 MOV CL,04 // try up to 4 addresses | |
| 0800:000A 8B17 MOV DX,WORD PTR [BX] | |
| 0800:000C 0BD2 OR DX,DX | |
| 0800:000E 7506 JNE 0016 // if (DX != 0) break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Retrieve the number of on-this-day events from a given language Wikipedia, | |
| # iterated over all days of all months of the year. | |
| # usage: onthisday.py [en|de|ru|...] | |
| # | |
| # Dmitry Brant, 2025 | |
| import sys | |
| import requests | |
| daysPerMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import subprocess | |
| def is_writenow_file(filepath): | |
| with open(filepath, 'rb') as file: | |
| header = file.read(8) | |
| return header == bytes([0x57, 0x72, 0x69, 0x74, 0x65, 0x4E, 0x6F, 0x77]) | |
| def convert_files(source_directory, target_directory): | |
| # Traverse the directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import subprocess | |
| def is_wordperfect_file(filepath): | |
| with open(filepath, 'rb') as file: | |
| header = file.read(4) | |
| return header == bytes([0xFF, 0x57, 0x50, 0x43]) | |
| def convert_files(source_directory, target_directory): | |
| # Traverse the directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Make sure to install 'jsonschema' as well as any validator packages, | |
| # such as 'rfc3339-validator', that are used by the schema. | |
| import json | |
| import sys | |
| import urllib.request | |
| import urllib.error | |
| import jsonschema | |
| def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Dmitry Brant, 2023 | |
| import requests | |
| def cleanupForCsv(s): | |
| return s.replace("\"", "”").replace("'", "’").replace("\r", " ").replace("\n", "") | |
| apiBaseUrl = "https://www.wikidata.org/w/api.php?format=json&formatversion=2&" | |
| continueStr = "" | |
| userEditCounts = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Dmitry Brant, 2023 | |
| import requests | |
| import urllib | |
| def parseDescription(content): | |
| description = "" | |
| sStart = content.lower().find("{{short description|") | |
| if sStart != -1: | |
| sEnd = content.find("}}", sStart) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function deleteMessageIfEmpty() { | |
| var threads = GmailApp.search('is:unread in:inbox') | |
| for (const thread of threads) { | |
| const messages = thread.getMessages() | |
| if (messages.length != 1) { continue; } | |
| const msg = messages[0]; | |
| const words = msg.getPlainBody().trim().split(" "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (Dmitry Brant, Apr 2022) | |
| Recently I came across a backup tape (an AIT-3 100GB tape) that was written with a format | |
| I didn't recognize. The only thing I knew is that it came from a Mac workstation, which means | |
| it was likely written using Retrospect, which was a popular backup tool at the time. | |
| This is the result of my reverse-engineering effort to get the contents out of this archive. | |
| ------------------ | |
| This backup format is composed of a sequence of blocks which use FourCC-style formatting. | |
| (All data is big-endian. Dates are formatted as seconds since Jan 1 1904.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| from google.cloud import storage | |
| # To install Google Cloud dependency: | |
| # pip install --upgrade google-cloud-storage | |
| # Private key to use for authenticating our service account: | |
| key_file = 'playStoreAccessKey.json' | |
| # Bucket name for our data (copy from Play Store Console): |
NewerOlder