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
from random import randint, choice | |
def random_door(): | |
return randint(1, 3) | |
trial_count = 10_000 | |
stay_wins = 0 | |
switch_wins = 0 |
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
use std::process::Command; | |
use walkdir::WalkDir; | |
use regex::Regex; | |
/* | |
[package] | |
name = "rust_playground" | |
version = "0.1.0" | |
edition = "2021" |
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
cd ~/git/my_project_with_large_files | |
git lfs install | |
git lfs migrate import --include="*.pptx, *.pdf" --everything | |
git lfs ls-files | |
git push --all --force | |
# https://josh-ops.com/posts/migrate-to-git-lfs/ |
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
from manim import * | |
import os | |
class CircleTraceTest(Scene): | |
def construct(self): | |
circle = Circle(radius=2) | |
self.add(circle) | |
vt = ValueTracker(0.0) | |
point: Dot = always_redraw(lambda: Dot(point=circle.point_from_proportion(vt.get_value()))) |
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
# import required module | |
import os | |
from pathlib import Path | |
import re | |
# assign directory | |
directory = Path('/Users') / 'thomasnield' / 'git' / 'oreilly_essential_math_for_data_science_book' | |
def two_digit_correct(filename: str): | |
return re.sub(r"(?<=[0-9])_(?=[0-9][A-z])", "_0", 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
%%manim -qk Histogram | |
""" | |
PROMPT: Create sample Python code using manim to plot data into a histogram. Use that same data to create a numberline with points beneath it. Then draw a distribution function over the histogram. | |
""" | |
from manim import * | |
import numpy as np | |
class Histogram(Scene): | |
def construct(self): |
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
[ | |
{ | |
"ID" : 1, | |
"NAME": "Alpha Medical", | |
"ADDRESS" : "18745 Train Dr", | |
"CITY" : "Dallas", | |
"STATE": "TX", | |
"ZIP" : 75021, | |
"CATEGORY" : "INDUSTRIAL" | |
}, |
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
import pandas as pd | |
from math import sqrt | |
from manim import * | |
def create_model() -> tuple: | |
data = list(pd.read_csv("https://bit.ly/2KF29Bd").itertuples()) | |
m = ValueTracker(1.93939) | |
b = ValueTracker(4.73333) | |
ax = Axes( |
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
// C program to demonstrate the | |
// showbits() function | |
#include <stdio.h> | |
#define BV(bit) (1 << bit) | |
#define setBit(byte, bit) (byte |= BV(bit)) | |
#define clearBit(byte, bit) (byte &= ~BV(bit)) | |
#define toggleBit(byte, bit) (byte ^= BV(bit)) | |
#define getBit(byte, bit) (byte >> bit) & BV(0) |
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
WITH RECURSIVE my_dates(x) AS ( | |
SELECT date('2000-01-01') | |
UNION ALL | |
SELECT date(x, '+1 day') | |
FROM my_dates | |
WHERE x < '2030-12-31' | |
), | |
all_combos AS ( | |
SELECT |
NewerOlder