#development

1 messages · Page 251 of 1

frosty gale
#

actually i wonder if i convert the buffer to a string then reverse the string would it be faster than reversing a second copy of the buffer

neon leaf
#

no

#

that was bens solution

#

remember

frosty gale
#

was it

quartz kindle
#

strings dont have a built in reversing method

#

so you'd have to make your own

frosty gale
#

oh right

neon leaf
#

yeah he split into array, reversed and joined

quartz kindle
#

i also tried reversing a string with a for loop, not much difference

neon leaf
#
chloe: 67.301ms
best_possible_optimizations: 40.922ms
best_possible_optimizations_2: 42.505ms
tim2: 30.67ms

 robert  ~/projects  bun sha1.js 
[33.85ms] chloe
[25.81ms] best_possible_optimizations
[24.78ms] best_possible_optimizations_2
[29.72ms] tim2```
#

interesting

frosty gale
#

using it makes the speed fluctuate a lot

#

it fluctuates between 62 and 70ms

quartz kindle
#

bun uses JSC, which basically means slower raw js, and faster non-js built ins

#

such as c++ addons and internals

neon leaf
#

yeah

#

suprised your code is so slow compared to the other in bun

quartz kindle
#

:^)

neon leaf
#

robert  ~/projects  deno run sha1.js
error: Uncaught (in promise) ReferenceError: require is not defined
const crypto = require('crypto');
^
at file:///home/robert/projects/sha1.js:1:16

#

ugh

quartz kindle
#

xDDD

neon leaf
#

not gonna bother

#

v8 anyway

quartz kindle
#

deno uses ESM only i think

#

try import from "crypto"

#

or "node:crypto"

#

idk

neon leaf
#

robert  ~/projects  deno run sha1.js
chloe: 198ms
best_possible_optimizations: 134ms
best_possible_optimizations_2: 116ms
tim2: 16ms

#

💀

#

welp now i know what to not use in prod

#
chloe: 188ms
best_possible_optimizations: 131ms
best_possible_optimizations_2: 113ms
tim2: 19ms

 robert  ~/projects  bun sha1.js 
[41.48ms] chloe
[31.50ms] best_possible_optimizations
[34.47ms] best_possible_optimizations_2
[37.81ms] tim2

 robert  ~/projects  node sha1.js 
chloe: 69.046ms
best_possible_optimizations: 42.996ms
best_possible_optimizations_2: 43.665ms
tim2: 38.974ms```
frosty gale
#

by reusing a buffer like 0x7 and using buffer.copy into the preallocated buffer i got 20-30ms faster, huge gains

function chloe() {
    const reversedSet = new Set();
    let buffer = Buffer.allocUnsafe(32);
    for (let i = 0; i < entries.length; i++) {
        const entry = entries[i];
        
        entry.bytes_buffer.copy(buffer);
        const reversed = buffer.reverse();

        if (reversedSet.has(decoder.write(reversed))) {
            console.log("Duplicate found!")
        }

        reversedSet.add(decoder.write(entry.bytes_buffer));
    }
}
#

turns out buffer.from is a bit slow

neon leaf
#

uh that code wont detect properly

#

use decoder.end

frosty gale
#

oh thats why it fluctuates so much

quartz kindle
#

if not slightly better

neon leaf
#

robert  ~/projects  bun sha1.js
[19.79ms] chloe
[27.96ms] best_possible_optimizations
[24.66ms] best_possible_optimizations_2
[21.96ms] tim2

frosty gale
#

buns clearly doing something right

neon leaf
#

robert  ~/projects  bun sha1.js
[27.10ms] chloe
[29.48ms] best_possible_optimizations
[27.56ms] best_possible_optimizations_2
[32.50ms] tim2

#

with .end

frosty gale
#

oh no you dont need to call .end on it

neon leaf
#

well you should to avoid allocating tons of memory

#

your function is using over 5gb ram on 10000000 objects

#

tims is definitely the best solution

#

uses barely any ram and is 2s faster

frosty gale
#

tims solution hurts my eyes

quartz kindle
#

mitata, one of the best benchmarking libs i've tried so far

#

very consistent results, unlike most other benchmarking libs

neon leaf
#

how many entries?

quartz kindle
#

100k

#

should try 1mil?

neon leaf
#

yes

#

and 10mil

#

(if you have 8gb ram free)

quartz kindle
#

10mil too much lmao

frosty gale
#

using binary encoding for some reason with textdecoder i got it down another 20ms to Chloe Function: 34.52ms

#

no idea why thats faster than ascii but this is js after all

#

gonna add tims too for comparison

quartz kindle
#

thats 1mil per iter

neon leaf
#

i want to try it on my pc

#

can you send that reversebuffer.js file

quartz kindle
frosty gale
#

@quartz kindle your one runs slower than mine for some reason

Chloe Function: 35.194ms
Tim Function: 57.827ms
Hex Username Man Function: 95.63ms
#

i used this one

frosty gale
#

i still dont get why using binary as a key is faster than ascii

#

ascii is literally just str[i] = buffer[i]

neon leaf
frosty gale
#

oh wait

neon leaf
#

ascii has some extra stupid validation afaik

frosty gale
#

its actual binary

#
'\x01\x02\x03'```
#

thats why

neon leaf
#

yeah

frosty gale
#

i thought it meant something like 0111010010101

#

then yeah thats gonna be always faster

neon leaf
#

mmmm

quartz kindle
#

ah yeah, i forgot about that

#

binary is alias for latin1, not ascii

#

binary/latin1 is the one that does no checks

frosty gale
#

i dont like this language

neon leaf
#

best_possible_optimizations seems to be 2x slower on both machines compared to tim2

quartz kindle
#

i still dont know if mine is actually reliable/accurate lmao, i did add one duplicate entry to see if it finds it and it did, but im not confident in this rocket science code

frosty gale
#

now your function runs slightly faster than mine lol

#

fluctuates though

quartz kindle
#

yeah, js fluctiations are normal, cant really deal with them

neon leaf
#

I really need to fix my cooling

#

I am using an aio with the pump in the radiator but mounted at the top

#

barely any water going through

frosty gale
#

using set instead of copy for buffer had no impact

#

yeah this is my end result and its almost as fast as tims, without finding a way to avoid using a set or converting buffer to string dont think theres a way to make it faster

function chloe() {
    const reversedSet = new Set();
    let buffer = Buffer.allocUnsafe(32);
    for (let i = 0; i < entries.length; i++) {
        const entry = entries[i];
        
        entry.bytes_buffer.copy(buffer);
        const reversed = buffer.reverse();

        if (reversedSet.has(decoder.write(reversed))) {
            console.log("Duplicate found!")
        }

        reversedSet.add(decoder.write(entry.bytes_buffer));
        decoder.end();
    }
}
#

i wonder what happens if i use an object instead of a set

quartz kindle
#

i thnk object will be faster

#

but im not sure

frosty gale
#

much slower around 30ms more

function chloe() {
    const reversedSet = {};
    let buffer = Buffer.allocUnsafe(32);
    for (let i = 0; i < entries.length; i++) {
        const entry = entries[i];
        
        entry.bytes_buffer.copy(buffer);
        const reversed = buffer.reverse();

        if (decoder.write(reversed) in reversedSet) {
            console.log("Duplicate found!")
        }

        reversedSet[decoder.write(entry.bytes_buffer)] = undefined;
        decoder.end();
    }
}
quartz kindle
#

hmm

#

what about Map?

#

should be similar to set i guess

frosty gale
#

i checked v8 internals and maps and sets are almost identical in implementation

#

except set doesnt set any value

quartz kindle
#

ye

frosty gale
#

anyhow i guess this concludes our annual "try to optimise this js function and work around javascript quirks for no reason other than fun"

neon leaf
#

but does it

frosty gale
neon leaf
#

help 34 ms/iter (32 ms … 54 ms) 183 ms 189 ms 189 ms

#

(just kidding

frosty gale
#

wonder how it would perform with native bindings

#

takes ages to setup a nodegyp project though so i wont bother

neon leaf
#

I have an idea

quartz kindle
#

i dont think the data is large enough to make it faster

#

you would need to concat all the buffers into a single large buffer, pass it to c++ and then decode everything there in one go

#

otherwise it wont be worth the overhead

frosty gale
#

ill write a patch for v8 just to implement this single use case into arrays

quartz kindle
#

xD

frosty gale
#

[].has_reverse(x)

quartz kindle
#

native bindings are very slow at going back and forth between c++ and js, sadly

neon leaf
#

ok i was gonna write tims stuff in assemblyscript but i truly dont understand wtf tim wrote to type it out

quartz kindle
#

lmfao

#

basically

#

lets say each buffer is like this [34,252,12,534,34,234,53,3463,64,554,2,352,3,23,...]
take first item 34, use it as an array index: [33x empty, something here]

#

after a few times doing this, you will eventually run into collisions

#

two buffers that have the same first number

#

when that happens, you create a new rope node/leaf, for example [33x empty, [251x empty, buffer that first time is 34 and second item is 252, ...], ...]

#

and slowly you build up a rope like a tree index, something like this:

{
  34: {
    252: {
      12: { ... }
    }
  }
}
#

which allows you to compare new buffers to old buffers byte by byte without having to compare all bytes

frosty gale
#

ill stick to developing an os kernel

quartz kindle
#

lmao

neon leaf
#

guess how long this takes with assemblyscript (ts to wasm ran in bun)

// The entry file of your WebAssembly module.

export function add(a: u8, b: u8): u8 {
  console.log(a.toString(2))
  return a + b;
}

function toString(data: Uint8Array): string {
  let str = '';

  for (let i = 0; i < data.length; i++) {
    str += String.fromCharCode(data[i]);
  }

  return str;
}

export function chloe(entries: Uint8Array[]): void {
  const reversedSet = new StaticArray<string>(entries.length);
  let buffer = new Uint8Array(32);
  for (let i = 0; i < entries.length; i++) {
      const entry = entries[i];
      
      buffer.set(entry);
      const reversed = buffer.reverse();

      if (reversedSet.includes(toString(reversed))) {
          console.log("Duplicate found!")
      }

      reversedSet[i] = toString(entry);
  }
}```
#

(this has been running 2m+ so far on 1mil)

quartz kindle
#

Lol

quartz kindle
neon leaf
#

oh god

#

my 2am brain will not understand that

past field
#

hey tim

quartz kindle
#

here, easier to understand if you convert the arrays to objects

neon leaf
#

oh wait so its a binary tree

#

well almost

quartz kindle
#

yeah

neon leaf
#

ah okay now I get it

quartz kindle
#

its a rope data structure

#

its very similar to a tree

#

v8 uses ropes to handle string concatenation under the hood

neon leaf
#

why cant computers just be magic

quartz kindle
#

they are

#

but they are evil magic

#

:^)

neon leaf
#

brb gonna build a quantum computer

quartz kindle
#

idk why

#

but with objects instead of arrays

#

it gets 2x faster at 1mil iterations

#

but stays the same perf at 100k iterations

neon leaf
#

now put chloe0 trol

#
for (const entry of entries) {
    const reversed = Buffer.from(entry.bytes_buffer).reverse();
    for (const e of entries) {
        if (e.bytes_buffer.compare(reversed) === 0) {
            console.log("Duplicate found!");
            process.exit(1);
        }
    }
}```
quartz kindle
#

cpu goes brrrr

quartz kindle
past field
quartz kindle
past field
quartz kindle
#

its a double loop

past field
#

i was gonna ask for a humongous favor

quartz kindle
#

essentially 100k x 100k

past field
#

and i understand if you say no

#

but

#

can you look at my game code and maybe give me any suggestions for optimizations or improvements that come to your mind? i can screen record the game to show you how it looks if you’re willing

#

again, completely understand if you say no

#

i know you’re a busy man

quartz kindle
#

its not that your code is bad

#

its just that your coding mindset can improve, different ways to think about things

#

and for that to work, the whole thing needs to start from the beginning

past field
#

ok i gotcha, over time i’m willing to learn! maybe not i’ll wait on the optimization lol

quartz kindle
#

they say that premature optimization is the root of all evil xD

past field
#

lol i want to get to that point!

quartz kindle
#

for starters, avoid using fixed timers

past field
#

wait

#

are you looking at it rn

quartz kindle
#

always think in terms of "when this ends, start that", never like "run this for x time, after this time run that"

quartz kindle
past field
quartz kindle
#

lol ok

#

but im not gonna look at it too deep rn

past field
quartz kindle
#

love how wildly js fluctuates dependign on what my laptop is doing in the background

#

exact same run

#

thats why you gotta run benchmarks a gazillion times, to find a good average

neon leaf
#

(or run on an empty vps/lxc)

quartz kindle
#

ye

#

ok i think this is the final version of the function, just a few adjustments, got rid of Buffer.isBuffer()

#
function tim2() {
    const rope = Array(255);
    for(let i = 0; i < entries.length; i++) {
        const buffer = entries[i].bytes_buffer;
        let current = rope;
        for(let n = 0; n < buffer.length; n++) {
            const entry = current[buffer[buffer.length - n - 1]];
            if(entry) {
                if(Array.isArray(entry)) {
                    current = entry;
                    continue;
                }
                if(n < buffer.length -1) {
                    const next = Array(255);
                    next[entry[n+1]] = entry;
                    next[buffer[n+1]] = buffer;
                    current = current[buffer[n]] = next;
                    continue;
                }
                // console.log("duplicate found");
            }
            current[buffer[n]] = buffer;
            break;
        }
    }
}
#

array is still better than object for integer keys, even though v8 claiming that objects have the same ooptimizations as arrays if all its keys are integers

#

got a sub 20 using continue instead of else, at 100k iter

#

might just be luck tho

#

ok i had enough of this xD

neon leaf
#

btw that assemblycode stuff was still running

#

I completely forgot

quartz kindle
neon leaf
#

moral of the story: dont use sketchy ts to wasm solutions

surreal sage
#

i need

#

that silly

#

pink colored

#

file share

#

website

#

thing

neon flicker
#

Why can't I set this option to "Discord Provided Link"?

#

I was trying to create a private test bot, and so I had to set the install link to "none" for once, however now I can't set it back to "Discord Provided Link"

#

But for my public bot, it is a valid option

deft wolf
#

Because private bots cannot have this button on their profile

neon flicker
trim tartan
#

The "Discord Provided Link" option in the Discord Developer Portal is typically used for redirect URLs that point to a Discord-provided endpoint, like the OAuth2 authorization flow. If you're having trouble setting this option, there are a few possible reasons:

  1. Limited Use Case: This option is restricted to specific use cases where Discord provides a link for a particular purpose, such as OAuth2 authentication. If your bot or application doesn't fall under these use cases, this option might not be available.

  2. Incorrect Configuration: If your bot's configuration doesn't align with the requirements for using a Discord-provided link, the option might be unavailable. For example, this option is usually relevant when setting up OAuth2 flows where Discord handles the redirection to a specified endpoint.

  3. API Type: The option might only be available for certain types of applications or bots. For instance, it may not be applicable to bots that don't use OAuth2 or other specific Discord features that require a provided link.

  4. Role or Permissions: Ensure that you have the correct role or permissions in your Discord server or Developer Portal account to modify this setting. If you don't have sufficient permissions, you might be restricted from changing certain options.

  5. Region or Account Type: Some features or settings in the Discord Developer Portal may be region-specific or dependent on your account type. If the feature is not available in your region or for your account, you might not be able to select this option.

deft wolf
#

💀

earnest phoenix
#

what is bro doing

neon flicker
#

Apparently it will never let me turn off this option no matter what

#

So even tho it is currently a public bot with the all intents on, I still can't see the option "discord provided link"

#

Discord's developer portal is annoying

deft wolf
#

This option also prevents the "Add app" button from being enabled

neon flicker
#

Oh thanks

radiant kraken
#

js is too slow

raven nexus
#

i try to refix the vote seem it dont send to the webhook did i do anything wrong?

const { WebhookClient } = require('discord.js');
const dayjs = require('dayjs');
require('dotenv').config();

module.exports = (client) => {
  client.on("webhook_vote", async (voteData) => {
    try {
      const { user } = voteData;
      const webhookURL = process.env.WEBHOOKURL;

      // Create a Webhook Client
      const webhookClient = new WebhookClient({ url: webhookURL });

      // Get the current date and time
      const currentDate = dayjs().format('YYYY-MM-DD');
      const currentTime = dayjs().format('HH:mm:ss');

      // Send the message through the webhook
      await webhookClient.send({
        content: `:ballot_box: **Received a vote from ${user}!**`,
        embeds: [
          {
            color: 0x00A36C, // Customize the color as needed
            fields: [
              { name: 'Date', value: currentDate, inline: true },
              { name: 'Time', value: currentTime, inline: true },
            ],
          },
        ],
      });

    } catch (error) {
      console.error("Error handling vote event:", error);
    }
  });
};
#

is the webhookurl is discord url? or no

deft wolf
#

Nope

raven nexus
#

ah

#

how to get the url?

deft wolf
#

I mean, it depends in what sense

#

Because you can use the discord webhook url to send a message but you can't use it to receive a request from top.gg

raven nexus
#

ah

#

so what url should i use?

#

it runing as 3001 for port

quartz kindle
#

because client.on("webhook_vote") does not exist

#

also, that code does not have any webhook server in it

#

show trhe code where the webhook server is

raven nexus
quartz kindle
#

if you use that, you dont need any code

raven nexus
#

owhhhhhhhhhh

quartz kindle
#

with that the vote goes directly to discord, not to your bot

#

which also means you cant do rewards and stuff like that

raven nexus
#

because it mostly flightsim used

quartz kindle
#

ok so you can delete all the vote code, and use the webhook-topgg url

lament rock
#

Been working on a program to automatically take material properties from a 3D program (in this case Unity) and bake all of the settings the material has into a texture atlas. This includes stuff like tinting the texture, repeat amount and offsets like specified in the material for each texture slot. Also supports normal maps and scaling on that. (I hate math) and the offsets of the texture where the texture overflows the edges to the other corner is what I'm especially proud of (I hate math)

quartz kindle
#

awesome

lament rock
#

Did I mention that I hate math

#

I also hate how when resizing a canvas, all of the image data is lost

#

Also needed to create clamp and lerp functions

#

Need to optimize as well since offset in both directions calls for 4 slices to reconstruct the image meanwhile offsetting in one direction only calls for 2.

#

Really makes me wonder how things look under the hood of a shader

#

HLSL makes things really easy

#

I mean like Unity shader internals btw since you need to sample the image textures with a special function if you want tiling and offsets

spark flint
#

its inaccurate 99% of the time and theres no point answering if you aren't writing it yourself and can actually back what you're saying

lyric mountain
#

the button is merely a convenience for others to invite your bot

sage bobcat
sage bobcat
surreal sage
#

DANKE

sage bobcat
#

One message removed from a suspended account.

surreal sage
sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

storage is so cheap these days

surreal sage
#

its like

#

0.01 cent for 10 gig now no?

#

or am i too far in the future

#

~6$ per tb

quartz kindle
#

depends where

#

google/amazon its stupid expensive

#

the volume storage products at least

#

the personal 2tb cloud storage is cheap

#

but you cant really use that for this, is would be stupid slow

neon leaf
#

cloudflare r2 costs 1 cent per 10gb for fast storage

quartz kindle
neon leaf
#

no other fees really

quartz kindle
#

but still very much cheaper than almost everything else

neon leaf
#

class a is pretty hard to get to the free tier limit

surreal sage
#

34$ for 900gb SAS is pretty good

#

but i have 14 600gb ones laying around gg

neon leaf
#

sas is pretty annoying

rigid maple
#

https://svelte.dev/repl/440c652622ff44a882a78d34156fa825?version=4.2.18
CSS did not work fully due to repl
I made fullpage scroll snap animation using gsap. I made a sidebar (it appears at the top left in repl, normally it is right on the left of the page). I want to switch between sections using the sidebar, but I can't figure out how to do this. When the section was changed, I also changed the page url hash. Using this, I can understand which section it is in, but I couldn't figure out how to show that section when I go to that hash.

ruby ermine
#

Hii

lament rock
#

Having a bit of trouble offsetting an image. My logic is to get the sides and swap them around but that produces this funny little fella. Any help would be appreciated. Using the HTML5 canvas

const right = partInAtlas.getImageData(shiftAmountX, 0, sizeInAtlas, sizeInAtlas); // to left
const left = partInAtlas.getImageData(0, 0, shiftAmountX, sizeInAtlas); // to right

ctx.putImageData(right, 0, 0);
ctx.putImageData(left, shiftAmountX, 0);
lyric mountain
#

wdym "swap them around"?

#

like flip the image?

lament rock
#

This is what I want the end result to look similar to where the black line is where the end of the image actually was before. The left side is now on the right and the right side is now on the left of the black line

#

but for some reason, there's some overdraw

quartz kindle
#

or is it just a reference?

lament rock
#

I don't know, but I tried before with another Canvas instance with the same pixel data using drawImage from ctx.canvas

#

Produced the same results unless the data is also just a reference

#

The image data is stored in a uint8array

#

4 * width * height for RGBA

quartz kindle
#

did you try this?

#
var original = ctx.getImageData(0,0,300,150);

var copiedData = original.data.slice();
var copied = new ImageData(copiedData, original.width, original.height);
lament rock
#

I can try that when I get home from work. Just gonna bookmark this convo and I'll get back in like 7 hours :)

quartz kindle
#

xD

naive pulsar
#

guys for unknon reason when some one vote to bot its send many post not just one post ?

neon leaf
#

Are you returning status 200 correctly

naive pulsar
#

thanks

round cove
#

Whenever a shard dies / fails to start, what do you guys recommend doing instead of restarting the whole bot over? It's kinda tedius to continue to do that if something dies on startup.

real rose
#

iirc you don't have to restart the whole bot?

#

I'm not certain of the process myself, but I wouldn't imagine that's the case

#

do you have respawn true enabled?

round cove
#

To be fair I'm not sure how else to get the shard to retry once its process exits.

#

Yeah it retries.

#

Sometimes it just dies at random, but I seldomly ever restart the bot

#

Waiting for 30 shards to spawn takes so long, I can't imagine being Iara lmao

round cove
#

yeah 😔

#

omg hi tim it's been so long

quartz kindle
#

afaik if you kill the child process, the manager should automatically recreate it

round cove
#

Oh hmmmmmmm

cloud pier
lyric mountain
pearl trail
hidden gorge
#

Any reason interactionCreate would be firing the ready.js event?

#

good to know using var instead of const casued this

quartz kindle
#

Lol

lament rock
#

lmfao

hidden gorge
#

i am a dumbass 😭

hidden gorge
#
Database query result: { wins: 0n, losses: 0n }
Error fetching user stats: Error: No data returned from the database
    at Object.execute (/root/bots/Leon/commands/utility/userstatus.js:28:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Object.execute (/root/bots/Leon/events/interactionCreate.js:14:17)
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('userstats')
        .setDescription('Shows your win and loss count'),
    async execute(interaction) {
        const userId = interaction.user.id;
        const db = interaction.client.db;

        try {
            const [rows] = await db.query(`
                SELECT
                    COALESCE(
                        (SELECT COUNT(*) FROM rps_games WHERE winner_id = ?), 0
                    ) AS wins,
                    COALESCE(
                        (SELECT COUNT(*) FROM rps_games WHERE 
                            (player1_id = ? AND winner_id != ?) OR 
                            (player2_id = ? AND winner_id != ?)
                        ), 0
                    ) AS losses
            `, [userId, userId, userId, userId, userId]);

            console.log('Database query result:', rows);

            if (!Array.isArray(rows) || rows.length === 0) {
                throw new Error('No data returned from the database');
            }

            const result = rows[0];

            if (typeof result !== 'object' || result === null || typeof result.wins === 'undefined' || typeof result.losses === 'undefined') {
                throw new Error('Unexpected data structure');
            }

            const wins = Number(result.wins);
            const losses = Number(result.losses);

            const embed = new EmbedBuilder()
                .setColor('#00FF00')
                .setTitle('User Statistics')
                .setDescription(`Here are your statistics, ${interaction.user.username}:`)
                .addFields(
                    { name: 'Wins', value: `${wins}`, inline: true },
                    { name: 'Losses', value: `${losses}`, inline: true }
                )
                .setTimestamp();

            await interaction.reply({ embeds: [embed] });
        } catch (error) {
            console.error('Error fetching user stats:', error);
            await interaction.reply({ content: 'There was an error fetching your statistics. Please try again later.', ephemeral: true });
        }
    },
};
#

It's failing to pull the data for some reason

frosty gale
#

that is a performance killer

lament rock
#

@quartz kindle I figured out that param indexes 2 and 3 are for the size of the rectangle not the coordinates on the canvas

#

Dont need to duplicate the data either

#

works in all directions, x, y and xy

#

It also handles numbers greater than 1 and less than 0

rigid maple
#

How do I send the function in onMount to the component? sveltekit

neon flicker
#

I'm back to dashboard my first dashboard development attempt, and I'm facing with a strange issue

#

quick.db works outside my Next.js app folder, however inside the app folder, it keeps throwing the following error:
Module not found: Can't resolve 'write-file-atomic'

#

It worked to execute npm quick.db write-file-atomic

frosty gale
#

bro used a clash royale emote 💀

lament rock
#

Gaming.

neon flicker
neon leaf
#

holy fuck

#

amazon is so stupid

naive pulsar
sharp drift
#

free amd for u what a lucky guy

rigid maple
hidden gorge
dusky idol
#

Okay I need some help with verification of my new discord bot, this discord update is quite tragic. It's asking me to do identity verification and when I'm submitting my id it's just rejecting it. What can I do?
This isn't me trying to verify my first bot. I've a bot which got verified 2 years ago and like 4-5 months ago I verified my 2nd bot. When I verified my 2nd bot, it didn't ask for any id. I thought as I'm already verified once, I don't have to do it anymore.
Now after 4-5 months, I'm trying to get my 3rd bot verified. This time the verification page is completely changed for whatever reason and it's asking me plus not accepting the same document. BRUH

quartz kindle
#

maybe they changed something there and stopped accepting certain types

dusky idol
quartz kindle
frosty gale
#

you probably dont need unlimited number precision

dusky idol
quartz kindle
#

rows is an array, [rows] is the first item of the array

hidden gorge
quartz kindle
#

its not about the db, its just js

hidden gorge
#

Ah

quartz kindle
#

const rows = ... this is an array, so you can do Array.isArray(rows) and rows.length

#

const [rows] = ... this is not the array, this is the first item of the array, same thing as rows[0]

hidden gorge
#

Oooo

frosty gale
#

not sure why the library by default returns the numbers as bigints

quartz kindle
#

probably because he set the columns as int(11)

#

but idk

frosty gale
#

oh right he did

#

no i think the library just returns all numbers as bigints

#

ah i think i see

#

it doesnt actually affect the size of the number but it affects the return precision

#

so if you have something like int(5) for a 0 value mysql will return 00000

#

not sure though

quartz kindle
#

this would not affect js tho, unless js converted it to string

hidden gorge
#

Ton of words

neon leaf
#

aggregation/counting is always in bigints by default

quartz kindle
#

INT(5) ZEROFILL with the stored value of 32 will show 00032
INT(5) with the stored value of 32 will show 32
INT with the stored value of 32 will show 32

frosty gale
#

that is so confusing

#

why is this a feature

hidden gorge
#

So can someone quickly simplify this for me 💀

#

I don't understand anything

quartz kindle
#

numbers or bigints will not make any measurable difference in this case

#

your particular issue was just the rows / [rows] thing

hidden gorge
#

bigints means big integers right?

frosty gale
#

does look like it does it all by strings though

#

and im not sure if you can check whether a number string would exceed the max number limit accurately

quartz kindle
#

but 0x7 said aggregation/counting is alreays done in bigints

frosty gale
#

probably that then

#

not sure why thats a bigint by default though

#

not much different than returning a number column

#

from the librarys perspective

#

all just tables

quartz kindle
#

the db itself has no concept of bigint since its purely a js thing, so the this particular db library must be doing something

neon leaf
#

postgres returns actual bigints

#

idk for mysql

frosty gale
#

if it returns numbers in binary it can just return the number it has as-is

#

if its a string it should just convert it to a string

#

none of these really require any special conversions in this case

quartz kindle
neon leaf
#

no the actual db

quartz kindle
#

the actual db doesnt know what a bigint is

#

it only knows 32bit/64bit ints

neon leaf
#

well yes sure

#

but the type is called bigint

quartz kindle
#

ah

frosty gale
#

thats just a 64 bit number no?

#

ints by default are 32

quartz kindle
#

i guess js will always convert them to bigint without checking how big the number is

#

if the column is defined as int64

frosty gale
#

yeah bigint looks like its just 64 bit numbers

#

though if you want "bigints" theyre really just strings in js anyways so you might as well store them as strings in the database

#

best performance that way

quartz kindle
#

cpu-wise maybe, but storage-wise bigint is better

frosty gale
#

how about we just dont use bigints in database and instead store massive numbers like private key prime numbers as blobs/binary in the database

#

that way we retain blazingly fast performance

quartz kindle
#

fun fact, a js bigint is the most space-efficient method of storing short amounts of binary data in js

frosty gale
#

its js im not even going to try dispute this because its probably true

quartz kindle
#

i measured it in dev tools memory dump

#

xD

frosty gale
#

this language has you rethink everything you know about optimising code because it doesnt apply to it

neon leaf
#

tim when optimize my ip and subnet parser

quartz kindle
neon leaf
#

yes

#

i hate ipv6

jovial palm
#

is there any qrcode module recommand to generate ?

prime cliff
jovial palm
#

it give the undefined error

prime cliff
#

Oh you wanted a qrcode to show on discord...

#

That was for a website

jovial palm
#

yea

#

i want it like i scan the qr code

#

and let it open the strip payment page

prime cliff
#

If you want to set an embed image/thumbnail with the attached file you can set the embed image url to attachment://file.png for example if you upload it as file.png

timber hatch
#

Does anyone kow the best way to check for NSFW content in images using JS which balances out resource intensiveness and cost.

Because i could use NSFWJS but it's extremely resource intensive, or i could outsource it to a micro-service but that would become extremely expensive?

The use case is an emoji listing site which gets around 3000 new listings per day.

We also allow people to change the content of their emoji, in case they make revisions to the graphic. And we don't know whether it would be more appropriate to re-check on every edit OR re check on an interval.

deft wolf
#

You can simply add emote verification for accounts that are new/untrusted and you can also add an emote reporting option

quartz kindle
#

you could also limit/downscale the image size before checking, if you dont already to that

frosty gale
#

i love how they have a camera option for testing

earnest phoenix
lament rock
quartz kindle
lament rock
#

Thank you

surreal sage
#

hey chat

earnest phoenix
#

bye chat

surreal sage
#

i'm working on vehicle culling and i'm not sure what if statements and stuff to do to make it work properly

#

i'm updating the "state" of a vehicle on every frame render

#

the data I have is:

  • is the vehicle within the player camera fov
  • the distance to the vehicle from the camera
  • if the vehicle is blocked by terrain or not (and so the camera cant see it)

and I can either hide the vehicle all together, or just hide the chassis (chassis is e.g. wheels)

#

I'm just not sure what order of things I have to do

lyric mountain
#

You'll need to sacrifice one or the other

frosty gale
#

either less boobies or less images

#

in brainrot terms

rigid maple
#

I'm trying to make fullscreen snap scroll animation using fullpage.js, but all sections appear on a single page.
(I'm trying to rewrite a project I got from github using svelte)

#

The height of all sections is 100vh

young pawn
#

does anyone know how i would apply classes / attributes to the body / html further down in the component tree in nextjs app router without using vanilla js to modify the dom since that's frowned upon (e.g. document.body)?

so i can provide theme previewing, rtl, and ltr support etc.

spark flint
sharp geyser
#

If you really dont want it on there, have a report system

spark flint
sharp geyser
#

Trying to guard against nsfw images is more work then its worth

spark flint
#

it can scan many a second and its running on the same machine as the website itself

sharp geyser
#

and often times the results vary in accuracy

timber hatch
# sharp geyser If you *really* dont want it on there, have a report system

It's not me so much as the registrar, even with a report system if some manage to slip by... domain registrars hate it.

In regards to the inaccuracy i think i will mark any with a score higher than 0.5 as awaiting approval by moderator. i would never STRAIGHT remove from an image model, only make the review process easier.

I would PROBABLY dictate a risk score PRIOR to making the image check too. i.e. emoji name, file name, etc. those cold be great indicators as to the content of the image and the likelyhood of it needing to be checked

sharp geyser
#

Why would your domain registratar care?

timber hatch
#

well we're on namecheap now but when we were on... godaddy 🤢 they would always be on our case

spark flint
#

because they have to step in for stuff

#

namecheap is good and gives 24h notice most of the time

sharp geyser
#

I mean, if its illegal content sure

#

but nsfw stuff isn't illegal 🤷

spark flint
#

godaddy is trigger happy for anything other than phishing lol

timber hatch
#

lol

sharp geyser
#

I honestly just don't care enough. You can't expect me to guard against everything perfectly

#

its better to just let it happen, and handle it as it gets noticed. As even with an AI model it is not perfect if you dont have enough data

hidden gorge
#
var { Events } = require("discord.js");

module.exports = {
    name: Events.GuildCreate,
    async execute(guild) {
        console.log()
    }
}

is there a way i could call the client from the guild to access the db or no?

deft wolf
#

Have you tried guild.client yet?

hidden gorge
#

found a way

wheat mesa
#

You can just pass your client as an argument to the function wherever you set up your event handler

#

That would be the “proper” way to do things

#

You could technically make your client a singleton if you wanted but that could be a little messy

quartz kindle
#

there is no reason for why guild.client would not work

deft wolf
#

✨ magic ✨

quartz kindle
#

unless guild is not a guild

warm surge
#

Why cant you add client like (client, guild)

hidden gorge
#

I was lazy and did this: event.execute(...args, client);

hidden gorge
quartz kindle
hidden gorge
warm surge
quartz kindle
#

because different events can have different number of arguments

warm surge
hidden gorge
quartz kindle
#

if you do ...args, client
if event has 1 arg, it will be arg1, client
if event has 2 args, it will be arg1, arg2, client
so client is not always in the same position

#

so you have to remember that in your event handlers

hidden gorge
frosty gale
harsh nova
hidden gorge
night lagoon
#

Or for in

proven lantern
#

what's a good library for making graphs? is D3 still good?

lyric mountain
#

In what lang?

quartz kindle
#

english

proven lantern
#

like building a svg

#

im looking at d3-node and d3

night lagoon
#

A nice way to log

client.on("ready", (client) => console.log(client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.users.client.user.id))
sharp geyser
earnest phoenix
#

does it actually take 1-2 weeks to get my bot verified

#

on top gg

night lagoon
#

i got it in 2 days

earnest phoenix
#

epic

#

mine is a user install

#

does that affect time

night lagoon
#

I don't think so

lament rock
#

Does anyone know how to convert an HDR color to SDR
For instance, I have a color of RGBI(191, 79, 6, 2.353308);
The color on the left is RGB(191, 79, 6); and the one on the right is the output target color which is RGB(255, 255, 93);

Using JS, but any programmatical way to do it without relying on some external deps/magic would be very appreciated.
I can understand other languages to a certain degree so don't hold back

proven lantern
#

ai says to do this

function hdrToSdr(r, g, b, intensity) {
    // Normalize RGB values to 0-1 range
    r = r / 255;
    g = g / 255;
    b = b / 255;
    
    // Apply intensity
    r *= intensity;
    g *= intensity;
    b *= intensity;
    
    // Apply a simple tone mapping (Reinhard operator)
    r = r / (1 + r);
    g = g / (1 + g);
    b = b / (1 + b);
    
    // Convert back to 0-255 range
    r = Math.round(r * 255);
    g = Math.round(g * 255);
    b = Math.round(b * 255);
    
    return [r, g, b];
}

// Example usage
const hdrColor = [191, 79, 6];
const intensity = 2.353308;
const sdrColor = hdrToSdr(...hdrColor, intensity);

console.log(sdrColor);```
earnest phoenix
#

please 🙏

#

you need to make mistakes to learn

proven lantern
#

here's some more AI insight

Note that this is a basic implementation and may not give you exactly the output you're looking for (RGB(255, 255, 93)). The exact conversion depends on various factors, including the color space, the tone mapping operator used, and any additional color grading applied.
For more accurate results, you might need to consider:

The color space of your input (e.g., linear RGB, sRGB, etc.).
The target color space for your output.
A more sophisticated tone mapping operator.
Color grading operations to achieve the desired look.

If you need a more precise conversion, you might want to look into color management libraries or implement a more complex tone mapping algorithm. However, these often involve external dependencies or more complex mathematics.
earnest phoenix
#

what are you trying to do @proven lantern

proven lantern
earnest phoenix
#

most the time

sharp geyser
#

I mean

#

its not wrong in this case from what I remember

earnest phoenix
#

yall cant be serious

#

😭

sharp geyser
earnest phoenix
#

yall dont use ai and call yourselves developers right?

sharp geyser
#

I think you have a misconception

#

Nothing wrong with using AI to get a direction to go in

earnest phoenix
#

i get that, just dont rely on AI to do all your coding or you will never learn

warm surge
sharp geyser
#

At this point it is impossible not to use AI

earnest phoenix
sharp geyser
#

Its literally built into every browser now

warm surge
earnest phoenix
sharp geyser
#

I use AI to explain vauge errors

#

Its better for it to pull sources that I can fact check myself then to scour for them

#

I hardly ever ask AI for code, it will get it wrong 70% of the time

sharp geyser
#

Yea, well your bot works, does not mean its good

warm surge
sharp geyser
#

yes

#

that will evaluate ofc

#

djs everything has the client attached to it

#

guild object, channel object, user object, role object

#

if it doesn't, it surely will have something that does

warm surge
#

true

prime cliff
# sharp geyser At this point it is impossible not to use AI

There's a big difference between using AI to suggest or auto complete stuff (in the sense of completing things like next number in a sequence or last used variables based on context)
Compared to writing the entire code or generating images for you.

Pretty much a lot of big developer tools/services, even Discord, has used some level AI techniques before the whole "AI is supreme" era came in.



#

Even stuff like message reply features which some social apps, keyboards and android os have had for a long time to suggest what to reply back with "hi" "ok" based on context

#

Meanwhile apple is flaunting message reply features in iphones like it's some kind of crazy new technology XD

proven lantern
# proven lantern ai says to do this ```js function hdrToSdr(r, g, b, intensity) { // Normaliz...

here's a better version

// Adjustable parameters
let exposure = 1.0;
let contrast = 1.0;
let saturation = 1.0;
let highlightCompression = 1.0;
let shadowLifting = 0.0;

function linearToSRGB(x) {
    if (x <= 0.0031308) return x * 12.92;
    return 1.055 * Math.pow(x, 1/2.4) - 0.055;
}

function sRGBToLinear(x) {
    if (x <= 0.04045) return x / 12.92;
    return Math.pow((x + 0.055) / 1.055, 2.4);
}

function hdrToSdr(r, g, b, intensity) {
    // Convert to linear space
    r = sRGBToLinear(r / 255);
    g = sRGBToLinear(g / 255);
    b = sRGBToLinear(b / 255);
    
    // Apply intensity and exposure
    r *= intensity * exposure;
    g *= intensity * exposure;
    b *= intensity * exposure;
    
    // Apply contrast
    r = Math.pow(r, contrast);
    g = Math.pow(g, contrast);
    b = Math.pow(b, contrast);
    
    // Apply ACES-inspired tone mapping
    const tonemap = (x) => {
        const a = 2.51;
        const b = 0.03;
        const c = 2.43;
        const d = 0.59;
        const e = 0.14;
        return (x * (a * x + b)) / (x * (c * x + d) + e);
    };
    
    r = tonemap(r * highlightCompression) + shadowLifting;
    g = tonemap(g * highlightCompression) + shadowLifting;
    b = tonemap(b * highlightCompression) + shadowLifting;
    
    // Apply saturation
    const luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;
    r = luminance + saturation * (r - luminance);
    g = luminance + saturation * (g - luminance);
    b = luminance + saturation * (b - luminance);
    
    // Clamp values
    r = Math.max(0, Math.min(1, r));
    g = Math.max(0, Math.min(1, g));
    b = Math.max(0, Math.min(1, b));
    
    // Convert back to sRGB space
    r = linearToSRGB(r);
    g = linearToSRGB(g);
    b = linearToSRGB(b);
    
    // Convert to 0-255 range
    r = Math.round(r * 255);
    g = Math.round(g * 255);
    b = Math.round(b * 255);
    
    return [r, g, b];
}
pearl trail
eternal osprey
#

this is a vps right?

#

like tf is a kvm

#

this shit is so fucking cheap for a vps

#

def changing my vps

proven lantern
#

idk what it's for

radiant kraken
#

what

proven lantern
#

PapiOphidian asked how to conver hdr to sdr

pearl trail
#

i've been happy with it

#

12gb for < $5

#

tho just dont trust that "turbo" clock speed

#

it's running at base speed

proven lantern
#

the host system has a bunch of VMs running on it right?

pearl trail
#

ofc

proven lantern
#

so you dont get all that processing power

pearl trail
#

all other vps providers are like that too

#

unless you buy the "dedicated vps"

#

which is a lot expensive

proven lantern
#

aws uses vCPU as a unit of measurement for processing power

#

oh, it says 2 vCores

radiant kraken
civic scroll
sharp geyser
ashen rivet
#

i want change avatar bot in top.gg

eternal osprey
eternal osprey
#

Seems like a good deal to me, and i can always upgrade to the 8gb versions soon

#

I am using galaxygate now, 4gb ram, 1.4ghz cpu, no ddos and 30gb storage. Overprices as FUCK

#

Will directly cancel them

deft wolf
eternal osprey
#

Owh damn

eternal osprey
#

Whatchu think

deft wolf
#

I personally use the one with 12GB of ram for my bot

eternal osprey
#

I see, i do find my vps maximized a lot at 4gb ram so i might buy the 12 one

civic scroll
late crest
neon leaf
#

Datalix is good.

late crest
neon leaf
#

Yes, I recommended it for everyone here

#

I've been using it for over 1 year

late crest
#

This looks like a gold for me. So cheap and pretty powerful for this price

neon leaf
#

It's not thaaat good pricing

#

It's definitely very good though

late crest
neon leaf
#

Well yes but noone can compete with hetzner dedicated servers

#

50€ for i9-9900k 2x1tb 128gb ram

late crest
#

for ds

neon leaf
#

That is the cheapest in the entire world

#

So yes

late crest
#

Thanks, I'll add it to bookmarks

eternal osprey
#

Datalix is the best

#

I just got this one for 5$!!

eternal osprey
#

But i upgraded the ram to 16gb

#

For 7$

#

Honestly datalix so far has been great. Their dashboard etc is also 10x better than galaxygate

late crest
#

guys, how long does it took to get your discord bot verified here?

gilded plankBOT
#

@late crest

topgg When will my bot be reviewed?

Currently our average bot reviewal time is a few days or more.

Because of this — and because some bots take longer to review than others due to their features — we can't guarantee your bot will be reviewed as quickly as someone else's in the past and we also can't guarantee your bot will be reviewed within that timeframe. There is no exact time for how long bot approval can take. There is no way to check your bot's position in our reviewal queue, but remember you're not first and you're not last!

You may edit your bot's page as much as you like both before and after it's reviewed and this will have no impact on its place in queue.

You can read more about our bot reviewal process in this support article: How the Bot Reviewal Process Works.

topgg_ico_bulb In the meantime, please make sure your bot follows all of our Bot Guidelines for a quick and smooth approval!

late crest
real rose
frosty gale
lament rock
#

I got a server PC with 8GB of DDR2 running Windows 11

#

Server PC as in 2 CPUs

#

Dont ask why I put Windows 11 on it

outer tide
#

e

late crest
#

isn't like DDR2 too slow for Win11? Also what CPUs does it have?

pearl trail
#

trimmed debloated win 11 maybe

late crest
quartz kindle
#

win11 LTSC ftw

neon flicker
#

Is there a limit for slash command option choices?

deft wolf
#

I think the limit is 25

deft wolf
sharp geyser
#

if you get scammed by datalix, its a reseller not datalix itself

#

datalix allows reselling and even promotes it

quartz kindle
#

welcome back lol

sharp geyser
#

sup tim

quartz kindle
sharp geyser
#

go for it

#

they really do not care I dont think

quartz kindle
#

building a vps business isnt a bad idea tbh, but you will be paying from your own pocket for quite a while until you have enough clients

#

i dont have that much pocket money rn

#

otherwise i would totally give it a try

deft wolf
#

Tim's VPSs

#

We need a catchy name and it might work out

quartz kindle
#

"my fucking VPS"

#

per-user disk encryption so datalix cant see any thing my users put in it

sharp geyser
#

well

#

they are still datalix's servers

#

I dont think they'd like having encrypted drives

#

💀

quartz kindle
#

well if i rent a dedi, do they have a say in it?

sharp geyser
#

I mean

#

you are renting it

#

you dont own it

#

If you stop paying for it

#

it goes back to them

quartz kindle
#

sure, they can just reformat the disks

#

but they cant have my data

sharp geyser
#

fair enough

#

doubt theyd take it anyways

frosty gale
late crest
#

and you will need Win 10 LTSC to upgrade

frosty gale
#

i would be interested in changing my windows 11 pro installation to the ltsc version

#

because im sick of microsoft adding more bloatware and annoyances each update

#

and more things that are opt out by default instead of opt in

#

but if you cant i might just reinstall it from scratch

quartz kindle
#

doubt windows would let you "upgrade" into something that removes a ton of shit

late crest
neon leaf
late crest
prime cliff
sharp geyser
#

good job on whatever that is

prime cliff
craggy pine
prime cliff
#

Thanks and yea gonna use this to replace sentry and portainer when it's fully functional 🙂

late crest
#

Does anyone know why is it empty and why this exists?

prime cliff
#

Shrug a few of those pages have been like that for a while now

late crest
#

There are problems with some graphs too

#

like votes and invites

prime cliff
#

Vote credits got removed too a long time ago

sharp geyser
#

They are planning on doing a lot of that when they release the new site stuff afaik

prime cliff
#

🙃 Ever single time you navigate it just forgets everything and loads it all again, such a waste

#

Why are the navigation links also missing on loading...

late crest
sharp geyser
late crest
#

looks sad

prime cliff
#

Lol no wonder why that's broken as hell, the CDN service they use for those flags is just gone with ssl errors and http redirects to some sketchy website

deft wolf
#

It's been like this for months now

#

Credits for votes were removed about half a year ago and I still see people who weren't aware of it

#

#auctions-support message notlikenoot

late crest
#

Is there any way to show server count like it is on other bots? Or it will show after some time auto?>

deft wolf
#

You can also use some autoposter depending on what language you use

past field
#

any tips for my relationship calculator?

sharp geyser
#

does it work?

past field
#

eh

#

not as i was expecting

sharp geyser
#

so its not drawing the second avatar?

past field
#

correct

#

but the logs say it is

#

wait

sharp geyser
#

I was reading that oop

past field
#

that's my bbygirl u cant seethat

sharp geyser
#

💀

past field
#

ima put it back lol

sharp geyser
#

rip people who can use snipe / have modded clients

past field
#

User 1: Maki https://cdn.discordapp.com/avatars/563434444321587202/3bedfc513ab9272409513297aa9265ea.png
User 2: bigtex3328 https://cdn.discordapp.com/avatars/197538444631605259/4d6dbf87e8fe581ab7ef300d6fd466c9.png
Loading avatars...
Avatars loaded successfully.
Canvas created. Drawing background...
Drawing first avatar...
First avatar drawn.
Resetting clipping region...
Drawing second avatar...
Second avatar drawn.
Canvas converted to buffer.
Embed created. Sending reply...
Reply sent successfully.

sharp geyser
#

It might honestly be drawing it out of bounds

#

what happens if you copy & paste that image in the embed

#

Discord limits the size of images in embeds and iirc has been known to "clip" images cutting stuff off

past field
#

nvm i fixed it

#

i changed the pixels to 350x175

#

and since i made it smaller i had to reposition it a little bit

#

i need to make the font a little smaller though

sharp geyser
#

yuh

#

so

#

_payload should be the json data

sharp geyser
#

Why

#

Can you detail your end result please

#

at this point in time, I am confused on what you want to accomplish

#

ok

#

so you need stuff from both the header & body correct?

#

So

#

you 100% can

#

It details how you can get something from the header as well as something from the body of a request

#

Assuming you are still using rocket

#

No problemo

#

I like axum tho

#

because its not as annoying

#

It has extractors built in that you can use that does all the impl stuff for you

#

In case you ever look at using axum

#

you'd literally just do

fn some_handler(headers: HeaderMap, Json(payload): Json<SomeStruct>)```
#

axum is nice

#

it has a concept you are familiar with I assume

#

middlewares

#

Its similar to express middlewares in a way

#

I swapped from using rocket to axum

#

and plan on rewriting my backend to my old project into it when I get off my ass and do it

#

💀

#

either that or I will use asp.net core

#

Going to flip a coin to decide tbh

neon flicker
#

Is there a character limit for modal text input labels?

deft wolf
sharp geyser
#

yes

neon flicker
#

Thank you 😊

sharp geyser
#

45 characters

#

God damnit NyNu

#

😭

#

Discord didn't register your messages until after I tabbed back in and hit enter

sharp geyser
#

Does not need to be verified

past field
#

can i take it off?

sharp geyser
#

make the bot private

past field
#

ohhh

#

@pine willow 👀👀

pine willow
#

What

past field
#

i saw you joined my server and left lol

pine willow
#

Yes

#

Joined, added bot, left

#

Click war doesnt work single Player

#

Bs

past field
#

LOL

past field
pine willow
#

Funny

#

My Server has 120 Members and 0 Messages in 3 weeks

#

Nothing can save it

past field
#

oh damn

#

come join us for a game lol

sharp geyser
#
Unable to create a 'DbContext' of type 'RuntimeType'. The exception 'Method 'GetDatabaseLock' in type 'Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlHistoryRepository' from assembly 'Npgsql.EntityFrameworkCore.PostgreSQL, Version=9.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' does not have an implementation.' was thrown while attempting to create an instance.

What in the flying fuck does this mean

proven lantern
#

Did your dependencies auto update again?

#

9.0.0.0

#

seems pretty new

late crest
#

Im thinking about getting ryzen one, since it is faster in single/multi-thread than xeon. And I dont need too much ram for my bot.

lament rock
#

If your app is small then yes

sharp geyser
#

depends on what you are running

#

also depends on how powerful that one core is trollface

#

datalix has some pretty beefy cpus tho

late crest
#

ryzen core is pretty powerful even on single thread

sharp geyser
#

at least in terms of their ryzen

late crest
sharp geyser
#

Will it be enough to run a discord bot? Sure, probably not the most efficient though

#

It also depends on what your bot is doing as well

late crest
late crest
earnest phoenix
#

oracle free tier is love

late crest
#

commands are pretty light

#

and optimized (I think)

earnest phoenix
#

unless they delete it out from the existance because yes

late crest
#

same as AWS

earnest phoenix
#

i couldve gotten that juicy 4vcpu 24gb ram arm server though but

#

getting that is hard

#

its out of capacity all the time

#

so you either break the tos or be lucky

late crest
#

how long are you working with oracle free tier?

earnest phoenix
#

its been a few months since i set it up

#

it now has a purpose aka running analytics server for my site

late crest
#

ah I see

late crest
#

without recreating VM

lament rock
#

Idk. I don't use datalix. You can look at how the price to performance is and scale based on your current needs

pearl trail
#

you can upgrade, but you cant downgrade

late crest
#

ok, great

#

I will give it a try

frosty gale
#

i once had my free trial registrations denied consistently and oracle support wouldnt tell me why

#

i once tried registering on another wifi connection and it worked, flagged my ISP apparently

late crest
#

about oracle

frosty gale
#

they make you out like some criminal when you try contacting them asking why

#

"we are not allowed to give any details"

late crest
#

thats crazy customer support

#

did you tried AWS free tiers tho?

frosty gale
#

yeah its okay

#

give you a reasonable amount of free stuff but most of it is the limited first 3 months or whatever

#

they tend to give you 12 months free on most of their flagship products like S3 but the rest either no or its always free

#

on a lot of these you can probably run them outside of the free trial anyways since cloud providers can be really cheap if you know what youre doing

#

on their VMs or VPSs though you have no hope of competitive prices they tend to be extremely costly

earnest phoenix
proven lantern
#

lambdas have a free quota every month

frosty gale
# proven lantern

yeah aws lambdas do but to use them for anything meaningful you need to have some "aws router / proxy" instance which is behind the 12 month free trial

proven lantern
#

pay per use

frosty gale
#

yeah its api gateways

proven lantern
#

also they have function urls

#

those are newer

#

Function URLs are included in Lambda’s request and duration pricing. For example, let’s imagine that you deploy a single Lambda function with 128 MB of memory and an average invocation time of 50 ms. The function receives five million requests every month, so the cost will be $1.00 for the requests, and $0.53 for the duration. The grand total is $1.53 per month, in the US East (N. Virginia) Region.

#

5 million request for $1

#

not bad

#

300 million for $1 is better

neon leaf
#

30 Mil for 0$ trol

proven lantern
#

where should i move my domains to now that google domains shut down?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

proven lantern
#

they moved us over to squarespace

#

no thanks

quartz kindle
quartz kindle
#

i was running a minecraft server on their free ampere vms

quartz kindle
deft wolf
quartz kindle
#

only a single minecraft server, which i setup according to their own guide as well

#

lmao

#

and the server would be inactive 99% of the time

#

maybe they didnt like that 24gb ram were being used to run nothing 99% of the time

#

or that i didnt upgrade to any billing plan after 1 month

#

i also had issues signing up, had to contact their support about it because it wouldnt let me register

deft wolf
quartz kindle
#

oh yeah, making money from a server that had at most 4 people on

#

xD

#

15/06/2022 - account created

#

12/08/2022 -

deft wolf
#

How can they serve you in the future if they just terminated your account? KEKW

quartz kindle
#

:^)

dusky idol
#

Hey I'm experiencing slowness in my bot's performance after it runs for a long duration. Like upto 16 hours or more.
I've figured that it's being caused by the usage of Mongodb database, overtime the amount of threads being used increases to upto 120 or even 150 sometimes. But normally it shouldn't go upto 50 I'm assuming.
When I restart the bot, the count goes back down to normal obviously but builds back up over span of time. Currently I just re-start the bot once a day and it's not that big of a deal as restart time is quite acceptable. But I was wondering how can I manage the threads properly and just permanently sort this issue, read some docs not that helpful. I can't switch from mongodb to sql now as there's approx 50k lines of code

#

If anyone ends up responding, feel free to ping me cus im not looking at channel

quartz kindle
wheat mesa
#

Yeah it’s going to depend on the language, but most langs have a way to profile their performance. I’d highly recommend looking into a profiler, especially if it’s written in a compiled language

#

But assuming it’s in js I believe there is a js profiler out there somewhere

quartz kindle
#

also depends what he means by threads, actual cpu threads or mongodb connections?

#

in any case if its increasing like that its a code mistake that needs to be corrected

wheat mesa
#

Also, 50k lines is a MASSIVE number for a discord bot

#

Going to hope it’s not 50k lines of js 😭

small tangle
#

49k of them is a handwritten isEven :^)

wheat mesa
#

Classic

wheat mesa
#

Yours is different

#

You use actual software patterns and such for your bot

#

Plus it’s java so boilerplate

#

(And afaik your bot is also fairly complex in its features)

lyric mountain
#

oh, wait, I'm actually below 50k

quartz kindle
#

hax

small tangle
#

Imagine writing comments

#

My code is clearly self-explanatory

quartz kindle
#

should be around half a million lmao

#

mine is saying 200k for 10k lines

wheat mesa
#

I used that tool on 188 million lines of python I autogenned and it said something like 6 trillion dollars

quartz kindle
#

xDDD

#

its 71 million if i include node_modules

wheat mesa
#

holy fuck

#

Least bloated node modules folder

quartz kindle
#

compared to many projects out there

#

wasnt there someone here with 600mb node_modules folder?

#

mine is 77mb

wheat mesa
#

Most of mine end up being at least 200mb

#

Installing one package immediately installs 674 package deps

quartz kindle
#

most of that is devDependencies

#

idk why dev deps are installed by default

#

for production you have to specifically run npm i --omit=dev

wheat mesa
#

Most of my projects also never make it to prod lol

quartz kindle
#

xDDD

wheat mesa
#

Deploying is hard man

#

I’m so scared of deployment that I overthink it before I finish a project

quartz kindle
#

my issue is finishing the product, ie packaging the code, writing docs, desigining user interface/website

late crest
quartz kindle
#

hahaha funny

radiant kraken
#

🤌

#

probably the longest if chain ever written

late crest
#

crazy and not funny

late crest
quartz kindle
#

json database?

#

lmao

late crest
#

lmaao

#

nah, it's HSK dataset for learning Chinese vocabulary. Quiz command

quartz kindle
#

jeez

late crest
#

it is pretty hard to maintain tho, cuz it's have 5000 hieroglyphs there with meanings and other things.

dusky idol
late crest
quartz kindle
#

do you have a local offline mongodb or do you use the atlas service?

lyric mountain
#

ah right, scc

#

permission denied, for some reason

#

yikes, snap

late crest
lyric mountain
#

it's...linux ofc

late crest
#

even with sudo?

lyric mountain
#

it's a hard pass for me to have a windows server

lyric mountain
late crest
#

bruh 😦

frosty gale
#

rarely any good reason to use it

lyric mountain
#

aight, got from binaries

pearl trail
frosty gale
#

Windows is the last OS I see as being lightweight and getting out of your way

frosty gale
lyric mountain
#

idk, there's probably an explanation on their git

lyric mountain
#

if you use cmd you lack a lot of tools bash has, if you use powershell you cant use && to chain commands (yes, they broke it) and Everything-Is -In-Weird -Kebab-Case

quartz kindle