Solves the OpenAI CartPole-v0 environment using a tabular version of Q-Learning with discretized feature space and epsilon-decreasing exploration.
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 | |
""" | |
Given a dataset of blackout events, generate daily downtime stats and calendar visualizations. | |
------------------- | |
Prerequisites | |
------------------- | |
python3 -m venv ~/.virtualenvs/blackout-stats | |
source ~/.virtualenvs/blackout-stats/bin/activate | |
pip install pandas==1.5.2 matplotlib==3.6.2 july==0.1.3 |
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 | |
""" | |
Concatenate and encode dashcam videos stored on an SD card. | |
Assumes the videos are stored as *xxxx.avi / *xxxx.mp4 / *xxxx.mov, where xxxx is a | |
sequential index. This should be compatible with most dashcam SoC manufacturers. | |
System requirements and dependencies: | |
------------------------------------- |
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
# -*- coding: utf-8 -*- | |
# Parse the numbers of Russian casualties in Ukraine from a news website, save them to CSV files, and plot them. | |
# | |
# Prerequisites: | |
# $ pip install beautifulsoup4==4.10.0 matplotlib==3.4.3 requests==2.26.0 pandas==1.3.4 | |
# | |
# Usage: | |
# $ python3 russian_casualty_parser.py | |
# | |
# Output: |
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 bash | |
# This script installs a PAM configuration script as a macOS launch daemon | |
# so that Touch ID for sudo is always available and persists across OS updates. | |
# NOTE: You might need to allow /usr/bin/env in Security & Privacy > Full Disk Access. | |
set -euo pipefail | |
PACKAGE_NAME="com.yuriyguts.persistent-touch-id-sudo" | |
CONFIG_SCRIPT_INSTALL_PATH="/usr/local/bin/${PACKAGE_NAME}.sh" |
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
""" | |
Converts subtitles in a video from any format to plain text using ffmpeg. | |
Reads all files that match a glob pattern. | |
Writes output to current directory unless specified otherwise. | |
Usage: convert-subtitles.py <input_pattern> [output_folder] | |
Example: convert-subtitles.py ~/Videos/*.mkv | |
""" | |
import glob |
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 | |
# -*- coding: utf-8 -*- | |
import pandas as pd | |
input_filename = 'https://raw.githubusercontent.com/devua/csv/master/salaries/2018_june_final.csv' | |
output_filename = '2018_june_final_eng.csv' | |
df = pd.read_csv(input_filename) |
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
@echo off | |
rem ===== Run this first: ===== | |
rem @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |
rem choco feature enable -n=allowGlobalConfirmation | |
rem mkdir C:\Tools | |
rem choco install -y toolsroot | |
rem =========================== | |
rem ----- Essentials ----- |
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
// This is an example of a C# application that uploads a CSV dataset to DataRobot, | |
// runs a classification project in autopilot mode and prints the leaderboard | |
// using the V2 REST API. Here you can also see an example of interacting with the | |
// asynchronous API routes (upload project, set target). | |
// Since the WebClient class has limited HTTP functionality, we use the newer | |
// Microsoft.Net.Http.HttpClient class. Its methods are async; as a result, | |
// the C# code uses asynchronous operations too. | |
// You may need to install the following packages for this code to work: |
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 | |
""" | |
Save or restore X11 desktop window arrangement. | |
Requires the `wmctrl` package to work. | |
Examples: | |
window_arrange.py save | |
window_arrange.py restore | |
window_arrange.py --profile ~/.winlayout-home save |
NewerOlder