#development

1 messages Β· Page 298 of 1

frosty gale
#

tbf i get sensitive about badges too

#

i know they have absolutely zero value (except if you sell your account with a rare badge maybe) but its just an irrational sort of attachment

deft wolf
#

I don't have problem with badges personally, I have a problem with people chasing them like crazy masnakappa

#

Badges are definitely an addition to your profile but not so important that you have to do everything to get as many of them as possible

swift barn
#


@tasks.loop(minutes=30)
async def update_topgg_stats(self):
    await self.wait_until_ready()
    if not self.topgg_token:
        return

    url = f"https://top.gg/api/bots/{self.user.id}/stats"
    headers = {
        "Authorization": self.topgg_token,
        "Content-Type": "application/json",
    }
    data = {"server_count": len(self.guilds)}

    try:
        # use only a single session urs was creating sessions everytime 
        if not hasattr(self, "topgg_session"):
            self.topgg_session = aiohttp.ClientSession()

        async with self.topgg_session.post(url, headers=headers, json=data) as resp:
            if resp.status == 200:
                print(f"[TOP.GG] Posted server count: {data['server_count']}")
            else:
                error = await resp.text()
                print(f"[TOP.GG ERROR] Status {resp.status}: {error}")
    except Exception as e:
        print(f"[TOP.GG EXCEPTION] {e}")

async def setup_hook(self):
    # start loop once only.
    if not self.update_topgg_stats.is_running():
        self.update_topgg_stats.start()

    await self.tree.sync()
    print("[DEBUG] setup_hook running")

then u can add like a function to close the session pool or something
try , if it works, it was a loop issue

warped glacier
frosty gale
frosty gale
#

i do genuinely wonder if some of the mods in the discord dev server get paid or are they just doing it for free

#

i see some borderline glaze from some of them

deft wolf
#

Someone said that they are paid iirc

#

Also RIP faceboy, he was banned Prayge

#

(not for that question)

warped glacier
swift barn
#

rip the badge finally left

frosty gale
#

skull emoji if they did it for free

warped glacier
neon leaf
#

@quartz kindle bad news for the ampere

#

the ram in my epyc is 4R, which is not compatible with ampere altra 1/2R

#

so will be stuck on 16gb for now :c

swift barn
warped glacier
harsh nova
#

trying to debug aoc day 4 and it just looks cool cant even be mad

#

figured out solving it

lyric mountain
harsh nova
#

LMAO yeah basically

queen needle
harsh nova
# queen needle how'd you do a visualization?

I did this

fn get_char_rep(c: char) -> char {
    if c == '@' {
        return 'β–ˆ';
    } else if c == 'x' {
        return 'β–’'
    } else {
        return 'β–‘';
    }
}

for i in &iter {
    let s: String = i.iter().map(|&b| get_char_rep(b as char)).collect();
    println!("{s}");
}
#

before anyone says I can just do the cast in get_char_rep. Yes but i kept it like this to spite yall

queen needle
#

Ohhh okay

neon leaf
scenic kelp
#

it's that you're using rust!!!!!!

patent bramble
queen needle
#

day6 is not for the weak(me)

queen needle
#

happiest moment of my life

#

Both parts run in 6ms

#

And I'm not even attempting optimizations

harsh nova
frosty gale
#

is it just me or my browser or did chromium add a border around every page??

#

it looks terrible

#

ok disabling this fixed it

#

thank goodness

pearl trail
#

chrome now have split tab view

deft wolf
#

Indeed

harsh nova
#

Zen has rounded corners too but I kinda vibe w it

stark kestrel
#

zen still superior imo

neon leaf
#

I used so many tokens that it cant even display the cost 😭

neon leaf
#
type TranslationRecord = {
    [k: string]: string | TranslationRecord;
};

type DefinedTranslations<
    O extends TranslationRecord,
    P = UnionToIntersection<PathImplObj<O>>,
> = {
    raw: O;
    paths: keyof P;
    mapping: P;

    use<K extends keyof P>(
        key: K,
        // @ts-ignore this is perfectly fine
        values: Record<GetPlaceholders<P[K]>[number], string>,
    ): string;
};

export type UnionToIntersection<U> = (
    U extends unknown
        ? (k: U) => void
        : never
) extends (k: infer I) => void
    ? I
    : never;

type PathImplObj<T> = T extends TranslationRecord
    ? {
            [K in keyof T]: T[K] extends TranslationRecord
                ? PathImplObj<T[K]> extends infer Nested
                    ? {
                            [P in keyof Nested as `${K & string}.${P & string}`]: Nested[P];
                        }
                    : never
                : {
                        [P in K]: T[K];
                    };
        }[keyof T]
    : never;

type GetPlaceholders<S extends string> =
    S extends `${string}{${infer W}}${infer RE}`
        ? [W, ...GetPlaceholders<RE>]
        : [];

how I love typescript

ionic ibex
pearl trail
#

!

burnt hornet
neon leaf
quartz kindle
neon leaf
#

ty

low marten
#

Turning out pretty nice πŸ˜„
Spent last night creating a bunch of branding material for around 2 hours

#

Here's one of the new logo

#

My implementation of server selection is pretty unique 😎

acoustic bough
#

looks very neat

#

though the sidebar/navbar kinda looks like this were the docs (just from the looks) lol

digital swan
#

i like it love a nice set of graphs

quartz kindle
clever tundra
low marten
#

people join > report bugs > bugs get fixed > documentation

#

but thanks 😎

clever tundra
#

most people see join servers for you and think scam, so just bear that in mind

#

and the top.gg invite link makes it so that it doesnt make a role btw

low marten
clever tundra
#

other than message history?

low marten
#

no need

clever tundra
#

oh

#

-# website invite link makes it have a role

low marten
#

ill check it out now

#

but this is what i mean!! users discover things

#

my mistake, on top.gg it SHOULD have a role

#

for read message history

#

its been a long day

#

fixed.

clever tundra
low marten
clever tundra
#

alright

queen needle
quartz kindle
queen needle
#

Part 2 is straight from the devil

quartz kindle
#

lmao

quartz kindle
queen needle
#

It took me a couple hours

#

I had to rewrite my logic from part 1, and then I used my new part 2 to make part 1 better, and then that new part 1 to make part 2 befter

quartz kindle
#

xD

#

took me about 40min for both parts, but second did give a little trouble

queen needle
#

How tf

#

I struggled because I didn't understand what had to be done

#

And still kind of don't

#

For part 2

quartz kindle
#

took me a little while to understand too

#

gotta learn how to read Cephalopod math

#

:^)

queen needle
#
function transformProblem(problem: string[]): (string | number)[] {
  const numbers = problem.slice(0, -1);
  const operator = problem.at(-1)!;

  const output: (string | number)[] = []

  for (let i = operator.length - 1; i >= 0; i--) {
    let column = "";
    for (const num of numbers) {
      column += num[i] ?? " ";
    }
    output.push(Number(column));
  }

  output.push(operator.trim());
  return output;
}```
#

This is the code of my part 2

#

core*

#

originally my parsing for the input into [
[...column]
[...column]
]
Etc was just for(length of line){ part = split line by " " for (number of part){ if(problems[index(number)]) push else create array for column } }

#

"pseudo" code lmao, I'm on mobile

quartz kindle
#

xD

queen needle
#

But for some reason the right logic for transforming wouldn't work with that input parsing system

#

Because I wasn't dealing with the white spaces needed

#

what was your solution?

quartz kindle
#

also keep in mind the last line is truncated, not of equal length as the other lines

#

so if you base everything off of operator.lenght, you might get wrong results

#

in my case the operator line was 2 characters smaller than the number lines

queen needle
#

due to whitespace?

quartz kindle
#

it has no whitespace at the end

queen needle
#

when I finally got my code working I forgot one spaxe in the example input

quartz kindle
#

it ends there

queen needle
#

Which caused me to be off by 4, that took like 30 minutes to fix

quartz kindle
#

that was one of the things that caused me to get wrong results

queen needle
#

ahh

#

Waiting for the amazing tim code

quartz kindle
#

i did console.log the lengths of the lines and got this: [3763, 3763, 3763, 3763, 3760]

#

3 characters less in the last line

quartz kindle
# queen needle Waiting for the amazing tim code

my amazing code:

function LOL6v2(input) {
    let total = 0;
    const lines = input.trim().split("\n");
    const width = Math.max(...lines.map(x => x.length));
    let n = [];
    for(let i = width-1; i > -1; i--) {
        const col = lines.map(x => x[i]);
        const op = col.pop()?.trim();
        const num = col.filter(x => x.trim()).join("");
        n.push(Number(num));
        if(op) {
            let toadd = n.shift();
            for(const xyz of n) {
                switch(op) {
                    case "+": toadd += xyz; break;
                    case "*": toadd *= xyz; break;
                }
            }
            total += toadd;
            n.length = 0;
            i--;
        }
    }
    return total;
}
queen needle
#

I saw a lot of solutions that just used eval

#

which I thought was pretty funny

quartz kindle
#

thats for lazy people lmao

queen needle
#

I used a reduce

quartz kindle
#

this was part 1:

function LOL6(input) {
    let total = 0;
    const lines = input.trim().split("\n");
    const ops = lines.pop().split(/\s+/);
    const numbers = lines.map(x => x.split(/\s+/));
    for(let i = 0; i < ops.length; i++) {
        const op = ops[i];
        const nums = numbers.map(x => Number(x[i]));
        let toadd = nums.shift();
        for(const num of nums) {
            switch(op) {
                case "+": toadd += num; break;
                case "*": toadd *= num; break;
            }
        }
        total += toadd;
    }
    return total;
}
#

pretty similar

queen needle
#

But you get the longest line and use that as your loop, but how does that get the column?

quartz kindle
#

lines.map(x => x[i])

queen needle
#

yeah but wouldn't that just be a number m

quartz kindle
#

wdym? its all numbers in that column

queen needle
#

lines I'm that case is the array of all of the numbers right?

#

in*

quartz kindle
#

lines is all lines, including the operators line

#

lines = [numbers, numbers, numbers, numbers, operators]

queen needle
#

Yeah but then how does that map for column work?

#

Is it a 2d arrayM

quartz kindle
#

lines.map(x => x[i])
is the same as [numbers[i], numbers[i], numbers[i], numbers[i], operators[i]]

queen needle
#

I sound stupider than I am I swear

#

Gimme a second

#

ohhhh

#

So like at 0 it gets the first of all of them, which is a column

#

I get it now

quartz kindle
#

[1234]
[8472]
[4582]
[4850]
[*___]

i = 2
3
7
8
5
_

queen needle
#

How does it turn it into the weird format that it wanted?

quartz kindle
#

thats the format they wanted, read the numbers from top to bottom

queen needle
#

yeah because you using width -1 as your start for the for loop right?

quartz kindle
#

start at the end of the lines, because they want it from right to left

#

and then from top to bottom on each index

queen needle
#

Ahh yeah

#

Making me feel like I overcomplicated it a little lmao

quartz kindle
#

xD

queen needle
#

"You pick an algorithm for part 1, and then one of the other algorithms is revealed as a bad choice for part 2. Do you switch or keep your original choice?"

#

Sounds about right

quartz kindle
#

xD

queen needle
#

I hope tomorrow isn't as bad

quartz kindle
#

the issue with your idea is that splitting by " " makes no sense for vertical numbers, they are not the correct boundary

queen needle
#

I just have trouble understanding what a problem asks for most of the time, not the actual implementation

quartz kindle
#

you go the long way of doing corrections and transformations to fix it

queen needle
#

That method preserves whitespace (along with the line under it)

quartz kindle
#

btw did you measure performance? xD

queen needle
#

my old way for parsing was literally just

const problems = []

for(let h = 0; h < lines.length; h++){
    const line = lines[h].split(" ");
    for(let j = 0; j < line.length; j++){
        if(problems[j]) problems[j].push(line[j])
    else problems[j] = []
    }

}```
#

probably a little off but

queen needle
quartz kindle
quartz kindle
queen needle
#

it was the only way I could think to parse just looking at it

#

and then I realized I could write a tokenizer

quartz kindle
#

but for vertical numbers it doesnt work

queen needle
#

Thankfully I didn't

queen needle
quartz kindle
#

ye

queen needle
#

yeah unfortunately

clever tundra
#

@low marten what timezone is most active hours based on?

low marten
#

GMT

clever tundra
#

Interesting

#

Oh great that's my timezone

#

That's nice

quartz kindle
#

holy shit today's AoC was hell

#

usually you can get away with many different methods and still complete it, but this time good luck lmao

low marten
#

hey again guys, i'm currently working on the backend for VC / User VC statistics, in the mean-while, i could use some help on where to actually display these stats, do i create new charts, or use existing ones, and append them with the VC info?

#

for example, Instead of message volume, it's activity volume, with 2 respective line charts, for 'messages' and 'minutes' minutes obviously accounting for VC

low marten
stark kestrel
#

made yesterday's today because had no time

#

will do today's tomorrow probably, hate that kind of day honestly

quartz kindle
queen needle
#

Part 1

#

Part 2

quartz kindle
#

yup thats the proper way to solve it

queen needle
#

What'd you do lmao??

quartz kindle
#

i tried the other ways first and got demolished hard

quartz kindle
# queen needle https://github.com/Cinnamonsroll/AdventOfCode2025/blob/main/day7/part2.ts

this was my version, but the solution is pretty much the same

function WHATTHEFUCK(input) {
    const lines = input.trim().split("\n");
    const beams = Array(lines.length / 2).fill().map((_,i) => Array(lines[0].length).fill(0))
    beams[0][lines[0].indexOf("S")]++;
    for(let i = 2; i < lines.length; i += 2) {
        const line = lines[i];
        const b = (i - 2) / 2;
        for(let x = 0; x < beams[b].length; x++) {
            const beam = beams[b][x];
            if(beam > 0) {
                if(line[x] === "^") {
                    beams[b+1][x-1] += beam;
                    beams[b+1][x+1] += beam;   
                } else {
                    beams[b+1][x] += beam;
                }
            }
        }
    }
    return beams.at(-1).reduce((a,t) => a + t, 0);
}
#

my other solutions were a recursive function and a "always go left" maze solver thingy with backtracking
both would take hours/days if run until the end

queen needle
#

all though these days are getting to the point where I have issues and may not be able to solve them, so I might be tapping out soon

quartz kindle
#

for example ```js
function WHATTHEFUCK(input) {
let total = 0;
const lines = input.trim().split("\n").slice(0, 50);
go(2, lines[0].indexOf("S"));
function go(line, beam) {
if(line >= lines.length) { total++; return; }
if(lines[line][beam] === "^") {
go(line + 2, beam - 1);
go(line + 2, beam + 1);
} else {
go(line + 2, beam);
}

}
return total;

}

this takes 20 seconds if i truncate the input to 100 lines, and 200 seconds if i truncate it to 110, god knows how long it would take if i let it run for the full 140 lines
#

i spent hours trying to debug it because i thought it was getting stuck in an infinite loop

queen needle
quartz kindle
#

but no, it just takes days if i use this method lmao

#

this was my other attempt (the first one actually)

function WHATTHEFUCK(input) {
    let total = 0;
    const lines = input.trim().split("\n").slice(0, 100);
    let currentLine = 2;
    let currentBeam = lines[0].indexOf("S");
    const path = [];
    while(true) {
        if(currentLine >= lines.length) {
            total++;
            const prev = path.pop();
            if(!prev) { break; }
            currentBeam = prev[0] + 1;
            currentLine = prev[1] + 2;
        } else if(lines[currentLine][currentBeam] === "^") {
            path.push([currentBeam, currentLine]);
            currentBeam--;
            currentLine += 2;
        } else {
            currentLine += 2;
        }
    }
    return total;
}
queen needle
queen needle
quartz kindle
#

Lol

queen needle
#

I haven't been able to time my solution but my.giess is 1.5s

frosty gale
#

i only had a legitimate use for one once when i needed to solve the subset sum problem for some function

low marten
frosty gale
#

@quartz kindle first time using protobuf wish me luck

#

going to use it to give the user a signed hmac ticket to the user that looks like a token but authorizes some backend action

#

json slow

quartz kindle
#

or roll your own custom

#

if you're gonna use it for something specific and not general purpose messages, rolling your own encoding should be easy

frosty gale
#

was thinking about it but im using rust which im not too great at so wouldnt know how to (safely) deserialize a struct and serialize it back again

frosty gale
frosty gale
quartz kindle
quartz kindle
#

idk if the rust implementation does that

#

protobuf should be fine, the only thing i dont like about it is that its schema based

frosty gale
#

although im not a fan of the extra dependency, maybe ill just stick to json which is already in my stack and since its a tiny object protobuf likely wont have any noticeable performance improvement anyway

#

but then the waste of using json, such pain, those 10 cpu cycles i could save

quartz kindle
#

xD

neon leaf
#

if its rust-to-rust

#

doesnt include field names

#

only pure bytes, and is serde compatible

lyric mountain
#

aight time to catch up

frosty gale
#

looks a bit lighter than protobuf

#

looks pretty good, will probably use that, thanks

lyric mountain
#

oooooo @queen needle now I see what the drawing is

#

it's the map of the facility

queen needle
#

Oh yeah

queen needle
#

Today was hard

#

Likely won't be able to do tomorrow, I know I'm nearing my end of being able to do aoc

lyric mountain
#

funny to write a visualization of day 7

queen needle
#

Day 7 had the best visualization I think

#

Well day 1 someone made an awesome visualization

queen needle
#

My friend about today's part 2

stark kestrel
#

Day 7 part 2 seems oddly easy... πŸ€”

#

Time to see if the works

queen needle
lyric mountain
#

day 7 part 2 is more difficult than I expected

deft wolf
#

Krypton and KuuHaKu right now

lyric mountain
#

I'm prolly just approaching it wrong

stark kestrel
#

had to read today's part 1 for a long time lmfao

#

before i finally understood

#

i think i understood at least

queen needle
stark kestrel
queen needle
#

I just realized day 7 is just a variant of pascals triangle

#

Also I just heard of kruskals algorithm, and realized I naively implemented it for today's solutions

wheat mesa
#

Kruskal my goat

#

I haven't looked at day 7, is it graph theory?

#

I'm assuming something about minimal spanning trees

#

Literally just took an exam on that stuff 30 minutes ago

queen needle
#

day 7 idk what the like CS term for it is

lyric mountain
stark kestrel
#

google gave me graph shit, i implemented 1-to-1 as wikipedia writes on the article

stark kestrel
#

part 2 was kinda easier

#

sometimes they have mercy after a more painful part 1

quartz kindle
#

today's part one was annoying, i had to re-read it a bunch of times to understand what they actually want

#

part 2 seems to be even more annoying,i dont understand it at all

queen needle
#

Me neither

#

But the code works

neon leaf
quartz kindle
queen needle
#

kinda just kept trying things

#

But also my part 1 and 2 are very similar

#

Thankfully

quartz kindle
#

holy shit finally

#

this legit took all day

queen needle
#

No way you just finished

#

@quartz kindle let's see the code

quartz kindle
quartz kindle
# queen needle <@180112943612952577> let's see the code

part 2:

function STUPIDELVES(input) {
    const lines = input.trim().split("\n").map(x => x.split(",").map(Number));
    const distances = [];
    const groups = new Map();
    for(let i = 0; i < lines.length; i++) {
        for(let i2 = i + 1; i2 < lines.length; i2++) {
            const item1 = lines[i];
            const item2 = lines[i2];
            const dx = item2[0] - item1[0];
            const dy = item2[1] - item1[1];
            const dz = item2[2] - item1[2];
            const dist = Math.sqrt(dx ** 2 + dy ** 2 + dz ** 2);
            distances.push([dist, item1, item2]);
        }
    }
    distances.sort((a,b) => a[0]-b[0]);
    let nextid = 1;
    let last;
    for(const pair of distances) {
        const item1 = pair[1];
        const item2 = pair[2];
        if(item1[3] && item2[3]) {
            if(item1[3] !== item2[3]) {
                const old = groups.get(item2[3]);
                groups.delete(item2[3]);
                groups.get(item1[3]).push(...old);
                old.forEach(x => x[3] = item1[3]);
                if(groups.size === 1) last = [item1, item2];
            }
        } else if(item1[3]) {
            item2[3] = item1[3];
            groups.get(item1[3]).push(item2);
            if(groups.size === 1) last = [item1, item2];
        } else if(item2[3]) {
            item1[3] = item2[3];
            groups.get(item2[3]).push(item1);
            if(groups.size === 1) last = [item1, item2];
        } else {
            const id = nextid++;
            groups.set(id, [item1, item2]);
            item1[3] = id;
            item2[3] = id;
        }
    };
    return last[0][0] * last[1][0];
queen needle
#

oh wow

quartz kindle
#

zero optimization went into this, i just wanted it to work

queen needle
#

Similar solutions

quartz kindle
#

ye

queen needle
#

I don't think there were many unique solutions for today tho

queen needle
quartz kindle
#

i asked chatgpt to help me with understanding what they want

#

didnt help much

#

actually made it worse and sent me in wrong directions

#

lmao

queen needle
#

Lmaoooo

quartz kindle
# queen needle Lmaoooo

this was part 1 lmao:

function STUPIDELVES(input) {
    const lines = input.trim().split("\n").map(x => x.split(",").map(Number));
    const distances = [];
    const groups = new Map();
    for(let i = 0; i < lines.length; i++) {
        for(let i2 = i + 1; i2 < lines.length; i2++) {
            const item1 = lines[i];
            const item2 = lines[i2];
            const dx = item2[0] - item1[0];
            const dy = item2[1] - item1[1];
            const dz = item2[2] - item1[2];
            const dist = Math.sqrt(dx ** 2 + dy ** 2 + dz ** 2);
            distances.push([dist, item1, item2]);
        }
    }
    distances.sort((a,b) => a[0]-b[0]);
    distances.length = 1000;
    for(const pair of distances) {
        const item1 = pair[1];
        const item2 = pair[2];
        if(item1[3] && item2[3]) {
            if(item1[3] !== item2[3]) {
                const old = groups.get(item2[3]);
                groups.set(item2[3], []);
                groups.get(item1[3]).push(...old);
                old.forEach(x => x[3] = item1[3]);
            }
        } else if(item1[3]) {
            item2[3] = item1[3];
            groups.get(item1[3]).push(item2);
        } else if(item2[3]) {
            item1[3] = item2[3];
            groups.get(item2[3]).push(item1);
        } else {
            const id = groups.size + 1;
            groups.set(id, [item1, item2]);
            item1[3] = id;
            item2[3] = id;
        }
    }
    return [...groups.values()].map(x => x.length).sort((a,b) => b-a).slice(0, 3).reduce((a,t) => a*t, 1)
}
#

also, i did day 1 yesterday which i hadnt done before

queen needle
#
for (let t = 0; t <= 1000; t++) {
  const { a, b } = edges[t] as Edge;
  unite(a, b);

  if (t === 1000) {
    const componentSize = new Map<number, number>();
    for (let v = 0; v < N; v++) {
      const root = find(v);
      componentSize.set(root, (componentSize.get(root) ?? 0) + 1);
    }

    const sizes = Array.from(componentSize.values()).sort((a, b) => a - b);
    const result = sizes.at(-1)! * sizes.at(-2)! * sizes.at(-3)!;

    console.log(result);
  }
}```
#

only difference In my part 1 vs part 2

queen needle
#

Or more so why does setting the length do anything

quartz kindle
#

a = [1,2,3,4,5];
a.length = 2; // a = [1,2]

#

faster than a.slice(0, 2)

#

lmao

queen needle
#

That's so stupid

#

what was youe day 1 solution?

quartz kindle
#

some annoying shit, i kept getting stuck because i was accidentally counting one zero too much

#

let me find lol

queen needle
#

Bros gotta hit the up arrow in the js console

quartz kindle
#

part 1:

function Day1Lol(input) {
    const lines = input.trim().split("\n");
    let dial = 50;
    let total = 0;
    for(const n of lines) {
        const num = Number(n.slice(1));
        const dir = n[0];
        if(dir === "R") {
            dial = ((dial + num) % 100 + 100) % 100;
        } else {
            dial = ((dial - num) % 100 + 100) % 100;
        }
        if(dial === 0) total++;
    }
    return total;
}

part 2:

function Day1Lol(input) {
    const lines = input.trim().split("\n");
    let dial = 50;
    let total = 0;
    for(const n of lines) {
        const num = Number(n.slice(1));
        const dir = n[0];
        if(dir === "R") {
            const r = dial + num;
            total +=  Math.floor(r / 100);
            dial = r % 100;
        } else {
            const r = (dial === 0 && num > 0 ? 100 : dial) - num;
            total += -Math.floor(r / 100);
            dial = (r % 100 + 100) % 100;
            if(dial === 0) total++;
        }
    }
    return total;
}
quartz kindle
queen needle
#

Standard solution

#

Looks nice

quartz kindle
#

i did this while debugging why it was not working:

function Day1Lol(input) {
    const lines = input.trim().split("\n");
    let dial = 50;
    let total = 0;
    for(const n of lines) {
        const num = Number(n.slice(1));
        const dir = n[0];
        if(dir === "R") {
            dial += num;
            while(dial > 99) { total++; dial -= 100; }
        } else {
            if(dial === 0 && num > 0) { dial = 100; }
            dial -= num;
            while(dial < 0) { total++; dial += 100; }
            if(dial === 0) total++
        }
    }
    return total;
}
queen needle
#

Bro wtf

#

I mean if it helped you get to the solution

#

my debugging looks like 100 console logs

quartz kindle
#

not really but i did eventually figure it out

quartz kindle
queen needle
#

Maybe if you used an ise

#

Ide

quartz kindle
#

maybe

queen needle
#
let dial = 50;

let password = 0;

for (const line of lines) {
  const direction = line[0];
  const value = parseInt(line.slice(1));
  const sign = direction === "L" ? -1 : 1;
  dial = (dial + sign * value + 100) % 100;

  if (dial === 0) password++;
}

console.log(password);```
#

Pretty basic part 1

#

part 2 I just added another loop

#
for (let i = 0; i < value; i++) {
    dial = (dial + sign + 100) % 100;
    if (dial === 0) password++;
  }```
quartz kindle
#

nicenice

queen needle
#

So are you all caught up for this year?

quartz kindle
#

did all 8 days so far yes

queen needle
#

Are you going to finish it out

#

@lyric mountain did you ever get today's/yesterdays?

quartz kindle
#

you think its gonna be too hard?

crimson vapor
#

how bad are the days so far

queen needle
#

Yeah only 4 more days, how much more difficult can it get

crimson vapor
#

are they like standard DSA or more involved

queen needle
queen needle
quartz kindle
crimson vapor
#

yeah im lowkey not tryna do MST anymore

queen needle
#

I'm just struggling because I have never taken a CS course so idk any of these fancy algorithms and things

quartz kindle
#

me neither

queen needle
crimson vapor
#

might be worth grabbing and reading CLRS

#

you can skip a lot of the proofs but the explanations about graph and tree algorithms are pretty thorough

queen needle
#

I mean it'd be nice knowledge to have, but I just program for fun and make simple websites and such I don't do much, the only algorithm I've ever had to make is minimax lmfao

crimson vapor
#

not planning on doing SWE?

quartz kindle
#

i hate trees in general

queen needle
#

I just like programming for fun, I think if I pursued a job in it I would grow to hate it

crimson vapor
#

quite possibly plus a french teacher would be more rewarding

queen needle
crimson vapor
#

I find it fun and interesting which is exactly why I'm gonna go into software

#

forever grateful that my prof skipped red-black trees and b trees

queen needle
#

what would a red black tree even be used for?

crimson vapor
#

no clue

#

kruskals is DSUF where you greedily add the lightest edge lengths that make a change yeah?

queen needle
crimson vapor
#

im locked in

lyric mountain
#

Day 8 didn't start yet

queen needle
#

What are you having trouble with in part 2?

lyric mountain
#

Finding the correct way to deal with it

#

Tried using a pascal pyramid but didn't test yet, gonna do it tomorrow

patent bramble
#

not even 2 weeks after hitting 100 guilds and I'm coming up hot on I passed 200

queen needle
#

Today's AOC isn't hard logically, but my part 2 takes forever to run that idek if it works

queen needle
#

@quartz kindle when you do it im going to need you to bust out optimizations

#

i run in like 2s

lyric mountain
#

ughhh ok day7 is a pita

lyric mountain
#

@queen needle I dont get wtf I'm supposed to do on day 8

quartz kindle
lyric mountain
#

I'm stuck in trying to understand what I have to do

#

as in, the puzzle itself

quartz kindle
#

ah yes i got stuck on it for hours too

#

part 1 or part 2?

lyric mountain
#

no tim, u didnt understand

#

I didnt get the puzzle itself

queen needle
lyric mountain
#

didnt even start coding, I just dont know what I have to do

#

ik I need to connect the closest boxes, but then it mentions separate groups but what's the threshold for separation?

#

do I have limited cord? the cords have a limited length?

quartz kindle
queen needle
#

@quartz kindle

quartz kindle
queen needle
#

how you doing on it

quartz kindle
#

playing league rn

#

i'll get back to it later

#

i have a general idea of what i want to do, just implementing it is annoying

queen needle
#

real

stark kestrel
#

took me like half an hour to even understand what it wants from me

lyric mountain
#

I must be doing smth wrong cuz I get 2x4, 3x2 and 7x1 circuits after 10 connections

#

the 5-box group only appears at 11th

stark kestrel
#

i guess today's part 2 is complex because part 1 was

let positions: Vec<Point2> = aoc_rs::input::read_file(aoc_rs::input::get_path(9, test))
        .iter()
        .map(|l| aoc_rs::regex::coord(l).unwrap())
        .collect();

    positions
        .iter()
        .flat_map(|a| positions.iter().map(move |b| a.covered_area(b)))
        .max()
        .unwrap_or(0)
queen needle
#

yea

#

my part 1 is 31 lines total

#

my part 2 is 85 lines total

stark kestrel
#

okay yeah this sounds like a pain

lyric mountain
#

oh found the issue, nvm

stark kestrel
queen needle
#

Yes

stark kestrel
#

like, 1 links to 2,2 links to 3,3 links to 4, etc.

queen needle
#

well

stark kestrel
#

makes it less painful

queen needle
#

Yes

stark kestrel
#

because it just says that the last and first are linked

queen needle
#

The red tiles are not affected from part 1 to part 2

queen needle
stark kestrel
#

In your list, every red tile is connected to the red tile before and after it by a straight line of green tiles.
ah nvm

queen needle
#

Oh yeah

#

i was confused as to what part you were referring

stark kestrel
#

less painful then KEKW

#

yeah part 1 is just computing areas of every possibility

#

unless there's some nerdy math solution

queen needle
#

The hardest part of part 2 is time complexity

queen needle
queen needle
stark kestrel
#

cargo build --release

queen needle
#

my current one runs in about 2.5s

#

i don't know any further optmizations

#

maybe using ASM

#

i even saw like 10s+ c++ solutions

stark kestrel
#

sum progress

queen needle
#

awesome

#

then just count interiors

tired zealot
#

I want to make so people can open a thread ticket, but like if I ping someone there they get added…

stark kestrel
#

yippie

stark kestrel
#

i now do part 1, but check if any tile is not X or #

queen needle
#

ahh

queen needle
queen needle
stark kestrel
#

not yet, sounds like for a grid of 100000-100000 it takes some time

queen needle
#

oh yeah

#

a long time

stark kestrel
#

i guess it's not a smart idea

queen needle
stark kestrel
#

always these grids & trees problems are a pain

queen needle
#

you can still use part 1

#

to help with lookup

tired zealot
stark kestrel
#

then ctrl+c-ed

#

🧌

queen needle
#

LMAO

#

gotta start optimizing early

stark kestrel
#

yeah i printed the grid, not too smart

quartz kindle
#

crashed from OOM

stark kestrel
#

time to check with my input 🧌

queen needle
#

Someone used this method

stark kestrel
#

got one, but didn't work

#

way too low

queen needle
#

Going to implement that it's so much faster

stark kestrel
#

probably because of the starting tile i choose to fill from

queen needle
#

oh wow

#

this solution runs so much faster

#

way less math and logic

stark kestrel
#

still getting some value that is too low 🧌

wheat mesa
#

Haven’t even looked at the problem, but if someone is using AABB then this sounds like a good use case for quadtrees

stark kestrel
#

okay time to ctrl+c

queen needle
#

LMAO

prime cliff
#

Woot got members, invites and bans all done

queen needle
#

Making awesome progress

patent bramble
#

Is there any special/proper way to ensure a guild bot can DM specific members when needed? I don't know if Discord ever fixed the "allow DMs from others" to exclude bots and allow them by default.

lament rock
#

Optionally cache if you can or cannot DM that user for a specific amount of time

patent bramble
lament rock
#

Good plan. DMing users from a guild channel isn't great. Let the user DM your bot unless you are generating something private

queen needle
#

Had to give up on day 10 part 2

#

😭

slim abyss
#

anyone know how to add vote linked to a command?

next kite
deft wolf
#

What do you mean by "vote linked to a command"? Like someone need to vote before they can use a command?

pearl trail
#

fucked up so bad

lyric mountain
#

aight, done with day 8 at last

#

issue was on groovy's pow operator

quartz kindle
lyric mountain
#

this is some picasso shit

#

it's funny that day 9 was made for java

#

there's a literal suite of poly processing in stdlib

vivid fulcrum
#

how do you all have the energy to do aoc... I come from work and the last thing I want to do is spend even more time on the computer 🀣

queen needle
#

Almost every part 2 for today uses a library called z3

#

I really want to try and get a solution without an external lib

queen needle
#

it runs!!!

#

takes less than a second, no external libraries

honest notch
quartz kindle
queen needle
#

I don't have anything else, it keeps me busy and entertained for a little bit

#

Or for today a lot a bit

lyric mountain
#

hell yeah, visualization

queen needle
#

Day 8?

lyric mountain
#

9

#

oh, my input was a circle

queen needle
#

Yeah

#

that's why I was confused

lyric mountain
queen needle
#

Most inputs are a circle for day 9

lyric mountain
#

but yep, algo still worked

queen needle
#

How did you create the visualization?

lyric mountain
#

funny that they added an indent JUST to fuck up with boundary detection KEKW

lyric mountain
queen needle
#

Ahhh okay

lyric mountain
#

java things

queen needle
#

My thought was just converting each range to a point system and scaling it, and then just drawing pixels for all ~400 lines/~800 points

lyric mountain
#

think I'll commit with the visualization

lament rock
lyric mountain
#

bro I'm starting to hate elves

queen needle
#

LMAO

#

me reading todays

lyric mountain
#

@solemn latch heard u wanted money

solemn latch
#

I always want money

hollow briar
#

FREE MONEY?

lyric mountain
queen needle
#

yeah

#

my part 1 has a lot of bitwise operations

lyric mountain
#

didn't start it yet, but that puzzle concept itself is complicated even without code

queen needle
#

very

#

even just the parsing is a huge step

#

even though it's just regex

stark kestrel
#

i don't understand today's part 2

#

@queen needle am i understanding right that the [] is irrelevant for part 2?

#

like you start like before, at 0 everywhere and you need to hit the {} by pressing the least buttons where each button press add 1 to the item

stark kestrel
#

so the same as part 1, but instead of hitting 1 for the # - you gotta hit the values in {}

queen needle
#

yes

#

It's system of equations

#

systems

stark kestrel
#

fair fair

#

thanks 🫑

queen needle
#

Good luck

lyric mountain
#

brute force through part 1 go brrrrr

frosty gale
#

last time i did a few was when i did google foobar a few years ago

#

prefer working on my own stuff and just bashing out features

patent bramble
#

I don't know why but my Discord webhook for APPLICATION_AUTHORIZED keeps double/triple firing at times when added to guilds. Anyone else that uses this webhook have that happening? If it were a minute or two apart I'd assume that they kicked and re-added, but these are a few seconds apart when it happens, and it's happened to me before too even so idk..

#

One happened earlier today with a 6 second difference. I find it hard that the user added the bot twice that fast, or that it's happening that often...

spark flint
patent bramble
queen needle
#

Day 11 is scary easy

stark kestrel
#

Quickly skimmed through part 1 description and seems fairly easy

#

But just like the recent part 1

young orbit
#

Hey everyone, I’m running into an issue with Discord.py and could use some help.
I’m trying to log global avatar changes, but on_member_update() only gives me the guild avatar, not the global one. I tried using on_user_update(), but that event doesn’t include any guild context, so I can’t tie the change back to a specific server for logging.
Does anyone know the correct way to detect when a user updates their global avatar and still access the guild information? I’ve been stuck on this for a while and can’t find a reliable method.
Any help would be greatly appreciated!

stark kestrel
#

Keep some cache or something to know in what guild the user is in I guess

young orbit
neon leaf
lyric mountain
#

@queen needle bro wtf I had the answer to part 1 right in my face this whole time

#

still quite bruteforcing, but bro how come I never thought abt using bitwise to generate non-repeating unique combinations that progress naturally from smallest to largest combos

#

now onto part 2

lyric mountain
#

yep, I'm clueless on this one

queen needle
lyric mountain
#

Yeah sadly I'll have to resort to libs

vivid fulcrum
#

it sounds like you may have somehow set up multiple listeners

lyric mountain
#

aight, done, hate that it was mostly a math puzzle instead of a logical one

lyric mountain
#

the first part was hard but doable with some logic

#

part 2 wasn't a programming puzzle, that shit was uni-level linear algebra

queen needle
#

part 2 took me so long because I was adamant on not using a library

lyric mountain
#

so was I, not proud of the solution to that one

#

well, lets see wtf the elves are doing at 11th floor

queen needle
#

dude 11 is so easy

#

Makes me scared for tomorrow

#

but if this works like normal advent of code tomorrow only has one part

#

because the last day is usually part 1 and then part 2 is you have all the previous stars

lyric mountain
lyric mountain
queen needle
#

Genuinely felt like a day 3 esque problem

lyric mountain
#

doing it atm

queen needle
#

Googled, looked at solutions, and still took like 6 hours

queen needle
lyric mountain
#

hm ok, day 11 p1 is basically node traversal

queen needle
#

yes

lyric mountain
#

ummm, are loops possible?

#

as in, a path that leads back to itself

queen needle
#

i don't think so, my code doesn't worry about that

#

Or well I memoize

#

Yeah I memoize already seen things so I think a loop is possible?

lyric mountain
#

cuz going svr -> out is taking a hella long time using dfs

queen needle
#

Do you cache?

lyric mountain
#

no

queen needle
#

try adding caching

lyric mountain
#

cache what, exactly

queen needle
#
const k = d + "|" + (f ? 1 : 0) + "|" + (c ? 1 : 0);
  if (k in memo) return memo[k] as number;```
#

That makes no sense out of context

lyric mountain
#

indeed it doesnt KEKW

stark kestrel
queen needle
#

mine ran in like 5ms πŸ’€

stark kestrel
#

probs the way i cache

lyric mountain
#

like, I'm passing down a tuple on every jump, which contains the name + both conditions

queen needle
#

It won't let me copy code pn mobile

lyric mountain
#

pathing from "you" goes pretty fast, but I'm starting to suspect "svr" has a loop

queen needle
#

I know some people had issues with it from the sub reddit

stark kestrel
#

fixed my cache

#

was like last year's day 19

queen needle
#

idk I'm just scared for tomorrow

#

Linear algebra into basic graph theory makes me think tomorrow is going to be something devastating

stark kestrel
#

i always forget hashset exists

#

@solemn latch bro is a bot

#

way too fast + always just sends that

#

diff of all 3 messages was less than 900ms for the first and 400ms for the second

stark kestrel
#

won't get any lower

queen needle
#

But like I did everyday up to it so I gotta do tomorrow

#

Tomorrow we're going to have to make a esolang

lyric mountain
#

yeah, memo worked

#

now to wait for the final boss

#

but yk, today might be helpful to get some more performance for my bot's dungeon crawler

wheat mesa
#

I haven’t even got day 6 yet 😭 been so busy with finals I haven’t had the time

lyric mountain
#

I need to path through nodes to find which are accessible to the player, gonna use memo now

lyric mountain
patent bramble
vivid fulcrum
#

if not, it may be a cloudflare worker quirk

patent bramble
#

I know they'll retry if no response is received within 5 seconds, but it's very intermittent when this happens.

frosty gale
#

cloudflare workers wouldnt duplicate requests, only way is if you receive 2x requests

#

strange issue though do you have any logging setup in the worker to see if it is indeed 2x different requests?

queen needle
#

πŸ₯€πŸ₯€

rustic nova
#

wtf

#

meh "Source Code Exposure" not that too deep

shell tundra
#

dbrand cards (free)

prime cliff
#

πŸ™‚

lament rock
#

DoS as well as shell access in such a short timespan isnt looking good for react

#

Glad I never adopted

rustic nova
#

glad im sane

prime cliff
#

πŸ˜„ DMs and Groups

queen needle
queen needle
prime cliff
#

Well i have barely worked on message stuff at all or per-channel permissions

upper kite
#

I build Discord bots, latest one builds out a whole server, channels, roles, sorts permissions, welcomes people anti raid etc etc usese ai and asks quesions with free input option and pretty much does it all, now i have no idea where to get people to test this, its mainly for brand new servers and hopefully helps those with not too much knowledge on how to setup servers... well... set em up haha

but yea if anyone here wants to test ? or has suggestions for me on where i can get people who want to test that would be super helpful

rustic nova
#

and that got spammed?

prime cliff
#

Dont you mean they tried using Guilded?
And it got bot spammed so they had to lock it

#

Wanna try a demo of it Aurel?

prime cliff
#

There was hu?? πŸ˜”

stark kestrel
#

web client isn't there apparently

pearl trail
#

good ol days

lyric mountain
lyric mountain
#

at last, aoc done

humble gyro
#

OH GOD

#

that's a fire logo tho

#

@prime cliff do u want my logo, I will pass the torch pensive

humble gyro
#

btw you guys can't see this PepeLaugh

stark kestrel
#

fair enough

queen needle
pearl trail
#

hell nah 100 hours πŸ’€

neon leaf
#

what are you doing

pearl trail
#

"fixing" my hard drive by filling zeroes to all sectors

#

*5tb hdd

neon leaf
#

100 hours is fine then

pearl trail
#

oh really? mmLul

neon leaf
#

i have seen worse on ssds

#

23h for 1tb

#

(dram-less)

pearl trail
#

oh, fair enough

#

the remaining time now become 113 hours xD

#

guess i'll wait till tomorrow to see if the remaining time still adds up or not

vivid fulcrum
prime cliff
#

Funny you should mention that my chat app backend is C# too and the client is C# Avalonia :p

vivid fulcrum
#

how is avalonia? I've been meaning to try building UI in dotnet, been eyeing Uno

prime cliff
#

Avalonia is a bit more mature than Uno and i had issues installing Uno due to some .NET SDK stuff.
If you need a more complex app then Avalonia is much better but both work either way.

warm surge
#

dam*

#

damn*

#

wtf iphone

lyric mountain
pearl trail
# lyric mountain wont that destroy the hdd lifetime tho?

hmmmm, some sources on internet says doing that will tell the hdd’s firmware which sectors are bad and mark them.. you might be right, my hdd started β€œfailing” when i tried to recover 2tb of lost data because windows installer formats the whole disk

lyric mountain
#

If it's indeed writing to the hdd then it'll burn the sectors very quickly

#

Tho hdds are more resistant than ssds in that matter

#

Did u try checking the drive's smart report?

#

It usually reports any failure detected

quartz kindle
#

in certain cases it is a good thing to zero out an hdd, there are cases where you may be able to "correct" bad sectors by repeatedly attempting to write to them

#

but in other cases it helps wear it down even further

#

the hdd's firmware will indeed only mark bad sectors when write+read fails multiple times, and doing that preemtively just offsets the problem so it doesnt get stuck retrying them during normal operation

lyric mountain
#

Just run the hdd through a strong magnet :v

#

Guaranteed fast zeroing

quartz kindle
#

xD

#

fast one-way zeroing

pearl trail
lyric mountain
#

0% health lmao

pearl trail
#

but then, before i leave it to sleep, i tried using manufacturer's software , andd holy god it's back

quartz kindle
#

yeah 0% = trash bin

pearl trail
#

the health went from 0% to 50%

#

so i guess yeah, zeroing won't always fix the issue

#

that complete drive test took 7 hours

quartz kindle
pearl trail
quartz kindle
#

140 is the threshold

#

and the value goes down as it gets worse

#

if it goes below 140 = bad

pearl trail
#

ohhh, what about pending sectors? it should be 200 too?

quartz kindle
#

ye

pearl trail
#

ohhh i see

#

thank you guys

quartz kindle
#

back in the day i used to play with HDDRegenerator

#

this is what they claim:

Almost 60% of all hard drives damaged with bad sectors have an incorrectly magnetized disk surface. We have developed an algorithm which is used to repair damaged disk surfaces. This technology is hardware independent, it supports many types of drives and repairs damage that even low-level disk formatting cannot repair. As a result, previously unreadable information will be restored. Because of the way the repair is made, the existing information on the disk drive will not be affected!

pearl trail
#

oh damn it's paid xD

#

but does it really work for you?

quartz kindle
#

last time i used it as like 15 years ago xDDD

#

and it as also a pirated copy

#

in some disks it did help a bit, in others didnt make a difference

pearl trail
#

xDD

quartz kindle
#

afaik they just do a very aggressive cycle of read+write+read multiple times on every sector

pearl trail
#

i can feel that will take 100++ hours

#

or even more πŸ’€

prime cliff
#

Electricity go brrrrrr

quartz kindle
#

i would leave it running for 24-36 hours on 80gb hdds

patent bramble
#

Also wild that when I tried to markdown embed that same link it got blocked lmao

lament rock
humble gyro
#

holy shit wolke

patent bramble
lament rock
humble gyro
#

goat

#

how has he been

#

haven't spoken to him in YEARS

lament rock
lament rock
# humble gyro how has he been

I haven't talked to him in a while. He included me as an employee in a company he owned for building out apps for clients, but that server with other employees has been dead for a while. He occasionally pops around when I ask for some guidance. But he seems to be doing alright and moderately successful

#

If you have a connection to him, he'd probably value reaching out to him

#

I see he is a mutual

patent bramble
#

Oh, yeah that's irrelevant. This is all mostly custom coded lmao

#

O well let them have some stats ig lmao

eternal osprey
#

hey guys

deft wolf
#

Hey

neon leaf
#

wtf

#

this may be magic

frosty gale
#

that sounds basically like it

neon leaf
#

i dont think so for dynamic data

frosty gale
#

from 2018

We guarantee that we will never perform this optimization for Vec: https://doc.rust-lang.org/std/vec/struct.Vec.html#guarantees. I don’t think the same is explicitly documented for String, but String is simply a wrapper around Vec so it still holds there at least in practice.
thats odd, i was under the impression it did

#

its basically expected to happen for strings in many languages because it offers massive speedups when dealing with strings

#

my day is officially ruined because of that

neon leaf
#

afaik its to simplify the std so unsafe code is safer

#

imagine trying to do raw pointer shit if every vec was optimized to nirvana

#

well time for me to switch most of my strings to this

frosty gale
#

yeah i guess that does make sense in theory, but is it really worth having every string equal an allocation?

frosty gale
neon leaf
#

keyword most

#

if i know a string has a 95% chance of being longer than 24 bytes, no point in changing

#

man i was just trying to find the vec based kvmap crate i forgor the name of

frosty gale
#

although, this crate says it can store 24 bytes max on the stack, but thats the size of the string struct itself? where is it storing a size/boolean that determines whether this is heap allocated or stack allocated? since the struct itself will act as a union to achieve the stack storage, unless it does something else

neon leaf
#

very clever

#

but yeah only 23 chars ig

frosty gale
#

scammed!!

#

knew there was a trick to this magic

#

i want my 1 byte refund

neon leaf
#

oh my days

#

this is fucking genius

#

@quartz kindle

frosty gale
#

that is very clever

neon leaf
#

beautiful

#

actually ill just do deref itll implement most stuff already

frosty gale
#

this crate is basically a free rust performance boost considering it doesnt already do this for strings

neon leaf
#

yes

#

and finally fixes my 1.5gb unused heap problem

#

it also lowers string allocation rate

#

from 2x to 1.5x

#

nice addition imo

frosty gale
#

although this only works really well in rust because it validates that any bytes are utf 8 before they are stored in a string, in a lang like c++ a string is literally just a bunch of bytes which could be any value from 0 to 255, so unless you enforce that same runtime safety check for bytes that rust does for utf8, you cant achieve that otherwise

#

youd have to sacrifice one or more bytes on the stack for tracking the state/length otherwise

#

so youre sort of trading performance for compactness in this case, but rust already verifies all strings are utf8 so in the rust world youre technically not paying anything extra

#

but still incredibly clever way to leverage the fact that strings are guaranteed to be utf8 in rust

neon leaf
#

it even provides a format function

#

oh my

#

such a good crate

frosty gale
#

bro is orgasming

#

ez port

neon leaf
#

i sadly have to manually rewrite a ton

#

worth it tho

frosty gale
#

why though

neon leaf
#

utoipa

#

nvm i have genius idea

#

ill make a submodule

#

and implement utoipa for it myself

#

the beauty of open source

frosty gale
#

ah

neon leaf
#

sad that there is still no real alternative to utoipa

#

it feels outdated and broken

frosty gale
#

i hope theres a feature that can be enabled

neon leaf
#

--features serde

frosty gale
#

nice

neon leaf
#

also has sqlx stuff

frosty gale
#

although doesnt seem to support rusqlite sadly

neon leaf
#

perfect

neon leaf
#

ah wait fromsql

#

rip

frosty gale
#

although may be worth porting to another sqlite3 lib? been thinking about it for a while since i eventually want to support other dbs as well not just sqlite

neon leaf
#

sqlx, trust

frosty gale
#

rusqlite is fast but a bit annoying to work with

frosty gale
#

i have one of my ci/cd checks run on a very low powered x86 oracle server simply because i pity it, this is the only check it can run without shitting itself and still it takes 5-10 minutes to finish

#

might just kill that server alltogether and move that final check to run on my arm server but might come in handy some day for an x86 only project

prime cliff
#

Pog audit logs and webhooks

crimson vapor
#

we have discord at home

pearl trail
#

sandal is the only safety equipment

misty bone
#

Hey

neon leaf
#

πŸ™

frosty gale
misty bone
#

Hello

crimson vapor
#

I’m playing guys

#

Real ones remember veld chat

humble gyro
#

realest shit

queen needle
#

veld chat come back when?

low marten
prime cliff
#

We have veld chat at home

low marten
#

I'm thinking of parallel hosting soon, Flask or Quart πŸ€”

queen needle
humble gyro
#

wait this is kinda goated

small tangle
#

Dont forget to add the Nitro paywalls

swift barn
prime cliff
#

Already got a bunch of stuff added yea, gonna work on mobile compatibile UI now πŸ˜… i can do android adb

humble gyro
#

woah builderb is adding warp x nitro?

#

man lunar chat is gonna be epic

prime cliff
#

You want to see a live demo of it Veld πŸ‘€

humble gyro
#

yes please

prime cliff
#

DM πŸ™‚

queen needle
#

Any chance I could πŸ‘€

prime cliff
#

Sent πŸ™‚

queen needle
#

Awesome thank you

humble gyro
#

very cool wow

queen needle
#

I agree

prime cliff
#

Thanks β™₯️ it's actually my first time using avalonia since 2 months ago so i need to learn how to design it better.
I also want to add more customized features like full user profiles (how guilded works), calendar type channel, more split permissions and other stuff.

#

Maybe even have like customized component channels for bots a bit like slack

marsh tapir
#

@prime cliff dm?

prime cliff
#

Why

marsh tapir
prime cliff
#

Ask it here pls

#

@marsh tapir ^

marsh tapir
prime cliff
#

And how am i supposed to know what language or tools you're are using?

wheat mesa
marsh tapir
prime cliff
woven comet
#

For hosting I'd recommend northflank- Thats what I use for a bot thats in 50+ servers atm. They can be a-tad expensive. But they have a "free plan" for like 3 months and they aint on a fix rate. Its all depending on how much the bot is used.

#

Example for me its around $15 per month for a bot in 50 servers

#

so if its a 1 bot you might even be able to get away with free

#

but even as free they are good

warm surge
prime cliff
pearl trail
#

just get contabo since you don’t really care about performance πŸ—Ώ

woven comet
#

For host on its own its like $5-7

prime cliff
#

Eh i mean if they want extra stuff then sure it's worth it

spark flint
#

Hetzner €3.49 for 4gb ram and 40gb ssd

#

Install database on there

wheat mesa
prime cliff
#

I wouldn't say that now with ram prices xD

brazen rose
#

topgg devs, How do you verify that a user is actually the owner of a bot before adding it? Is this manual? If not, how do you do this in a programmatic way?

#

I'm desperate for a solution to check the owner applications programmatically.

deft wolf
#

They don't afaik

brazen rose
#

jeez

deft wolf
#

I never tried it because I didn't see the reason for it but I saw some people complaining that their bot was added by someone else

brazen rose
#

YO I actually found a way. Application owned emojis are a way.

lament rock
brazen rose
#

I know no bot that allows users to upload to application emojis since there are only 2k

brazen rose
#

the last sentence

deft wolf
lament rock
#

Alright. I know a few people upload them programmatically

brazen rose
brazen rose
#

that is a neat way I think.

lament rock
#

What if a team is already at the emoji limit and they're unwilling to upload a new emoji

#

Would you support an existing emoji

brazen rose
#

nevermind, there is a better way with oauth2

brazen rose
#

also, 2k emojis is a VERY high limit

#

its an acceptable edge case

lament rock
#

builds are a different thing from bots

#

the app devs would have to submit builds to Discord to show on the now dead Discord games library

brazen rose
#

no, this scope allows you to fetch a route and get a status code apparently which indicates owenership

lament rock
brazen rose
#

I'm searching the docs right now xD

deft wolf
#

Asking on ddevs > searching docs

warped glacier
#

I made a antiraid tool!

brazen rose
frosty gale
#

a system where you invite a topgg bot and your bot into a server and make it output a specific string would be a cool verification method

#

albeit complex so maybe just in the bots bio

#

adding dyno to my profile as we speak

deft wolf
#

You can't access bio via API afaik

brazen rose
#

yes, sadly

thorn shell
#

Heya guys quick question:

if (config.topggToken) {
        try {
          const poster = AutoPoster(config.topggToken, client);

          poster.on("posted", (stats) => {
            console.log(
              `πŸ“Š Posted stats to Top.gg | ${stats.serverCount} servers`
            );
          });

          poster.on("error", (err) => {
            console.error("❌ Top.gg AutoPoster error:", err);
          });

          console.log("βœ… Top.gg AutoPoster initialized");
        } catch (error) {
          console.error(
            "❌ Failed to initialize Top.gg AutoPoster:",
            error.message
          );
        }
      } else {
        console.warn(
          "⚠️ Top.gg token not found in config - AutoPoster disabled"
        );
      }

returns:
❌ Failed to initialize Top.gg AutoPoster: Unsupported client on my raspberrypi5 server
But it fully works in windows10

wheat mesa
#

Are you sure your client is initialized? I imagine that if client is null it would be problematic

thorn shell
queen needle
crimson vapor
#

Yeah that’s xor for you

queen needle
#

yeah i knew like a^b^b == a but i never correlated that

#

because im used to python or js where i just do, a, b = b, a

scenic kelp
#

a temp is generally faster

queen needle
#

faster like code execution wise?

#

id suspect this to be faster since it's just doing bit operations but I don't know much about C languages

scenic kelp
#

the xor trick messes up CPU pipelining

queen needle
#

i would be lying if I said I knew what that meant

neon leaf
#

afaik its also just straight up more instructions anyway

scenic kelp
#

and realistically if it were faster than swapping then it would be implemented by optimizing compilers

queen needle
#

ah yeah that's true

scenic kelp
#

my general advice is that you should only focus on optimizations at the macro level until you know you need them at the micro level

#

focus on structuring your code in a sensible way

lament rock
prime cliff
#

πŸ™‚

queen needle
#

yoo awesome

prime cliff
#

I think embeds should suffice for now time to work on message replies next with a max of 3 πŸ™‚

queen needle
#

bawesome

pearl trail
#

actually a good idea xD

prime cliff
#

Just round robin your website so half the people land on the fake error page KEKW

frosty gale
neon leaf
frosty gale
# neon leaf

these look fine at first glance but on second glance its cursed

harsh nova
#

I really like the vscode one

frosty gale
#

the go one 😭