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Snapshot.xml
Created February 7, 2025 23:00
chezmoi v2.59.1 - Passed - Package Tests Results
<?xml version="1.0" encoding="utf-8"?>
<fileSnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<files>
<file path="C:\ProgramData\chocolatey\lib\chezmoi\chezmoi.nupkg" checksum="26EC5C0ED22382E5E2E7C5D5270CD0BA" />
<file path="C:\ProgramData\chocolatey\lib\chezmoi\chezmoi.nuspec" checksum="0D82B87D66CBA0A8D41DE332AC6CFE21" />
<file path="C:\ProgramData\chocolatey\lib\chezmoi\chezmoi_2.59.1_windows_amd64.zip.txt" checksum="9100D27C7D083BF15117CDA9CE6410BE" />
<file path="C:\ProgramData\chocolatey\lib\chezmoi\tools\chezmoi.exe" checksum="A4E4F6FE3B0392F90125681E56409EF8" />
<file path="C:\ProgramData\chocolatey\lib\chezmoi\tools\chocolateyinstall.ps1" checksum="C0D39822F0201FB39F534DFE0F6148DF" />
<file path="C:\ProgramData\chocolatey\lib\chezmoi\tools\LICENSE" checksum="D5A988C578F9129B08297503DF155656" />
<file path="C:\ProgramData\chocolatey\lib\chezmoi\tools\README.md" checksum="27BE611B8A7F5E83705E5265C1AF5056"
@Ifihan
Ifihan / main.md
Last active February 7, 2025 23:01
Find the Number of Distinct Colors Among the Balls

Question

Approach-ish(es)

In this approach, I used a dictionary ball_colors to keep track of the latest color assigned to each ball. Also, I added a set called distinct_colors to store all unique colors in use.

For each query [x, y], I first check if ball x has already been assigned a color. If it has and the color is different from y, I decrement the count of the old color in a dictionary color_count. If the count reaches zero, I remove the old color from distinct_colors. Then, I update ball x with the new color y and update its count in color_count. Finally, I add y to distinct_colors and append the size of distinct_colors to my result list.

Implementation

@swizzlevixen
swizzlevixen / makemkv-keydb-update.sh
Created February 7, 2025 22:59
MakeMKV macOS update keydb.cfg from FindVUK Online Database
#!/bin/zsh
# This script downloads the latest copy of the FindVUK Online Database,
# unzips, and moves it to the logged in user's MakeMKV data directory
# NOTE: This script is designed for use on macOS, with the default
# location for the MakeMKV data directory. If you have changed the
# location in Preferences > General, you will need to edit the line
# that moves the file, near the end of the script.
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 7, 2025 22:57
Rimworld output log published using HugsLib
Log uploaded on Saturday, February 8, 2025, 6:57:54 AM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.3.1.0]: 0Harmony(2.3.3), HarmonyMod(2.3.1)
BetterLoading(me.samboycoding.betterloading.dev)[mv:3.5.0.0]: BetterLoading(2.3.0), Tomlet(3.1.3)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
Anomaly(Ludeon.RimWorld.Anomaly): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib)[ov:11.0.4]: 0Harmony(av:2.3.3,fv:1.2.0.1), HugsLib(av:1.0.0,fv:11.0.4)
@Ivyadona
Ivyadona / samant4
Created February 7, 2025 22:57
aaaaaaa
UwxQUFAAAAAAAAD1WOqw9VgAAAAAAAAAAQAAUFBQAAAAAAAA9VjqsPVYAAAAAAAAAAEAAFB4KAAAAAAAAPVYAAD6rAAAAAAAAAEBAABQeCgAAAAAAAD1WAAA+qwAAAAAAAABAQAAHngoAAAAAAAA/Vb6rPqsAAAAAAAAAgEAAB54KAAAAAAAAP1W+qz6rAAAAAAAAAIBAAAeeCgAAAAAAAD6rPqs+qwAAAAAAAADAQAAHngoAAAAAAAA+qz6rPqsAAAAAAAAAwEAACh4KAAAAAAAAPqsAAD6rAAAAAAAAAQBAAAoeCgAAAAAAAD6rAAA+qwAAAAAAAAEAQAAKHgoAAAAAAAA+qwAAPqsAAAAAAAABQEAACh4KAAAAAAAAPqsAAD6rAAAAAAAAAUBAAABAQAF080DAgACAMzNA4lQTkcNChoKAAAADUlIRFIAAAIAAAACAAgGAAAA9HjU+gAA5pNJREFUeF5jZBjh4N2V5f9BQfD64V28ISEqr4xVnlx9xAY7peYT0n/30r8RnQK8KutGfB4YyQkAlv/JDQMhncgBTT+0dv/a2or/+MImuLljQP0/2N032PMWE8MoGA2B0RAYDYHREBgNgdEQGHEhMNoAGE30oyEwGgKjITAaAqMhMAJDYLQBMJrsR0NgNARGQ2A0BEZDYLQBMJoGRkNgNARGQ2A0BEZDYDQERkIIjI4AjKbz0RAYDYHREBgNgdEQGB0BGE0DoyEwGgKjITAaAqMhMBoCoyMAo2lgNARGQ2A0BEZDYDQERkNgWIYAy2i8QkIA1z5/QuFDSB+hffi0Np+Q++5euj2aBEZDYDQEcIQAC5fooA4bQu778+01XvcP9X30hM4hGD0nAH/yHV0DMFr0jYbAaAiMhsBoCIyGwAgMgdEGwGiyHw2B0RAYDYHREBgNgdEGwGgaGA2B0RAYDYHREBgNgdEQGAkhMDoCMJrOR0NgNARGQ2A0BEZDYHQEYDQNjIbAaAiMhsBoCIyGwGgIjIQQGPG7AIhdpU/uLoHR
@NullClock
NullClock / prompt.js
Last active February 7, 2025 22:59
Prompt Function for Photop Bots Using Lyon
// docs:
/*
your post listener must be async because this needs await.
import this function or just use it as such:
prompt(question, user id of who to await a response from, post object from lyon)
*/
export async function prompt(text, user, post) {
return new Promise((resolve, reject) => {
@MISTERSOFT
MISTERSOFT / real_esrgan_upscaler_sample.py
Created February 7, 2025 22:55
Upscaler using RealESRGAN. Class based from the original project RealESRGAN.
# Simple RealESRGAN upscaler.
# Based from this file: https://github.com/xinntao/Real-ESRGAN/blob/master/inference_realesrgan.py
# Don't forget to download the model: https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth
#
# Step 1: Use a Virtual Environment.
# Step 2: Install the package: pip install realesrgan
# Step 3: Modify this file (if you have an error):
#
# .venv\Lib\site-packages\basicsr\data\degradations.py
#
using System;
namespace array_length
{
internal class Program
{
static void Main(string[] args)
{
int repeatOfNumbers = 0;
int maxRepeatOfNumbers = 0;
@possan
possan / rotozoom.c
Created February 7, 2025 22:54
Playbit rotozoom test
// build with
// cc -lplaybit -g -o /tmp/rotozoom rotozoom.c
#include <playbit/playbit.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
struct AppState
{