Example of how to create dynamic map distance scales.
This file contains 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
#!/usr/bin/env python3 | |
""" | |
Drop-in replacement for pandas.DataFrame methods for reading and writing to database: | |
pandas.DataFrame.to_sql | |
pandas.read_sql_table | |
For some reason the current (Jan 2023) implementation in Pandas | |
using sqlalchemy is really slow. These methods are ~300x faster. |
This file contains 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
def the_song_lyrics(): | |
while True: | |
yield "This is the song that doesn't end" | |
yield "Yes it goes on and on my friends" | |
yield "Some people started singing it, not knowing what it was" | |
yield "And they'll continue singing it forever, just because" | |
for lyric in the_song_lyrics(): | |
print(lyric) |
This file contains 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
# A script showing how to back up a MediaWiki server hosted on a remote Debian machine | |
# I run each line manually myself | |
# SUMMARY: Basically there are five things you should extract from the mediawiki server: | |
# 1. LocalSettings.php: Get this from /var/www/mediawiki/LocalSettings.php | |
# 2. images.zip: A zip file of /var/www/mediawiki/images which contains all the image data | |
# 3. dbdump20201011.sql: A single .sql file which is a dump of every table in the /var/www/ MySQL mediawiki database, | |
# which you can create by running mysqldump | |
# 4. pedia_full_dump.xml: The content, by running php /var/www/mediawiki/maintenance/dumpBackup.php --full > pedia_full_dump.xml | |
# 5. mediawiki.zip: A zip file of /var/www/mediawiki entirely (just in case we have other media or config stuff we need) |
This file contains 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
# Instructions for Windows developers working on the Fling Unity Visualization Tool | |
# 1. Install the latest version of Unity | |
# 2. (NOT NEEDED) Install "SmartMerge" for Unity by following https://docs.unity3d.com/Manual/SmartMerge.html | |
# 3. Install GitHub Desktop | |
# 4. Install git-lfs | |
# 5. Get a GitHub developer account | |
# 6. Get invitated and accept the invitation to the fling-asia GitHub organization | |
# 7. Clone the fling-unity repository to your computer via the GitHub desktop app | |
# 8. Open the program in Unity |
This file contains 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
# Install git-lfs | |
# (From https://github.com/git-lfs/git-lfs/wiki/Installation) | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:git-core/ppa | |
sudo apt-get update | |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash | |
sudo apt-get install git-lfs | |
git lfs install | |
# Add git-lfs to an existing repo |
This file contains 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
You can view WCON files at: | |
movement.openworm.org/wconviewer | |
But until the HTML5 fix is in, you have to upload and then download the file, which is awkward. Instead: | |
1. Clone movement validation | |
2. Start -> Run -> cmd -> navigate to C:\Users\Fling\Documents\GitHub\movement_cloud\webworm |
This file contains 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
#Drag-and-drop upload files, via JavaScript, to a simple Python 3 HTTP server |
This file contains 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
CREATE FUNCTION sandbox.MonthNormalizedYearDiff(@StartDate DATE, @EndDate DATE) | |
RETURNS FLOAT | |
AS | |
BEGIN | |
/* | |
MONTH-NORMALIZED YEAR DIFF | |
How many years are between 31 December 2015 and 31 January 2016, say? You could say | |
31 days in January / 366 days in the year 2016. But notice how if I then try to | |
"de-annualize" the resulting fraction, I can't multiply by 12, since 31/366 != 1/12. |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
This file contains 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
Asset,Type,Asset Value,Debt,Net Value,Change vs 2015,Change,Stake,Latitude,Longitude,Notes | |
Trump Tower (New York City),Office and retail,471,100,371,-159,Down,1,40.768277,-73.981455,Opened 1983 | |
1290 Avenue of the Americas (New York City),Office and retail,2310,950,408,-62,Down,0.3,40.768277,-73.981455, | |
Niketown (New York City),Office and retail,400,10,390,-52,Down,1,40.768277,-73.981455,Ground lease through 2079 | |
40 Wall Street (New York City),Office and retail,501,156,345,-28,Down,1,40.768277,-73.981455, | |
Trump Park Avenue (New York City),Residential and retail,191,14.3,176.7,-27,Down,1,40.768277,-73.981455,"49,564 sq. ft. of condos; 27,467 sq. ft. of retail" | |
Trump Parc/Trump Parc East (New York City),Residential and retail,88,0,88,17,Up,1,40.768277,-73.981455,"11,750 sq. ft. of condos; 14,963 sq. feet of retail; 13,108 sq. ft. of garage" | |
"Trump International Hotel and Tower, Central Park West (New York City)","Hotel, condos and retail",38,0,38,21,Up,1,40.768277,-73.981455, | |
"Trump World Tower, 845 United Natio |
NewerOlder