Intermediate concepts in Python progrmming like:
- Working with files
- The standard library
- Virtual Environments
- Working with modules and packges
- Making API requests
| # ------------------------ | |
| # Base JSON-RPC Components | |
| # ------------------------ | |
| class JSONRPCMessage(BaseModel): | |
| jsonrpc: Literal["2.0"] = "2.0" | |
| id: int | str | None = Field(default_factory=lambda: uuid4().hex) | |
| class JSONRPCRequest(JSONRPCMessage): | |
| pass |
| #!/bin/bash | |
| set -e | |
| print_usage() { | |
| echo "" | |
| echo "Usage: $0 /path/to/directory [group]" | |
| echo "" | |
| echo "Arguments:" | |
| echo " /path/to/directory Target directory to apply permissions" |
| #!/bin/bash | |
| read -p "Enter the database name to create: " DB_NAME | |
| read -p "Do you want to use an existing user? (y/n): " USE_EXISTING_USER | |
| if [ "$USE_EXISTING_USER" == "y" ]; then | |
| read -p "Enter the existing PostgreSQL username: " DB_USER | |
| else | |
| read -p "Enter new username: " DB_USER | |
| read -s -p "Enter password for new user: " DB_PASS |
First Login to the Autodesk Accounts Page
https://accounts.autodesk.com/logon
When you login, you'll be able to access your files in the Fusino team
| import torch | |
| from torchvision import models | |
| # single image batch size, 3 color channels, height, and width | |
| dummy_input = torch.randn(1, 3, 224, 224, requires_grad=True) | |
| resnet = models.resnet50() | |
| resnet.fc = torch.nn.Linear(in_features=2048, out_features=102) | |
| resnet.load_state_dict(torch.load("model.pth", weights_only=True, map_location=torch.device('cpu'))) | |
| torch.onnx.export(resnet, dummy_input, "model.onnx") |
| #!/bin/bash | |
| # Define output file | |
| OUTPUT="big.txt" | |
| # Define excluded directories | |
| EXCLUDED_DIRS=( | |
| ".git" | |
| ".venv" | |
| "__pycache__" |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| ''' | |
| z₀ = 0 | |
| zₙ₊₁ = zₙ² + c | |
| ''' | |
| def is_mandelbrot(complex_num, max_iter=100): | |
| z = 0 | |
| for n in range(max_iter): |
| #import <Foundation/Foundation.h> | |
| #import <Cocoa/Cocoa.h> | |
| #import <unistd.h> | |
| BOOL copy_to_clipboard(NSString *path) | |
| { | |
| // http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage | |
| NSImage * image; | |
| if([path isEqualToString:@"-"]) | |
| { | |
| // http://caiustheory.com/read-standard-input-using-objective-c |