#development

1 messages Β· Page 207 of 1

sharp geyser
#

yes but tim, im sure you understand asm

lyric mountain
#

Cuz it becomes unreadable after the first line

quartz kindle
sharp geyser
lyric mountain
#

Also did I mention jsfuck cannot have newlines?

quartz kindle
#

i understand the concept, but i wouldnt know how to read asm

sharp geyser
#

it can if you use js to write jsfuck

#
const jsfuck = `` 
quartz kindle
sharp geyser
#

eval it

lyric mountain
sharp geyser
#

do not call jsfuck coding

#

its torture

lyric mountain
#

If u break the line u break the flow

quartz kindle
#

ah ye

#

js implicitly adds semicolons

lyric mountain
#

Spaces too, they separate the elements

sharp geyser
#

I wish jsfuck never existed

#

the idea of it

quartz kindle
#

thats like wishing math wouldnt exist

sharp geyser
#

what

lyric mountain
#

Jsfuck is just js' sins coming out to the open

quartz kindle
#

it will always come back, even if its gone

sharp geyser
quartz kindle
#

because someone somewhere will invent it again

sharp geyser
#

should of stayed hidden

sharp geyser
#

(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[+!+[]+[!+[]+!+[]+!+[]]]+[+!+[]]+([+[]]+![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[!+[]+!+[]+[+[]]] cause WTF is this bro

quartz kindle
#

xD

#

imagine you write a program in jsfuck and compile it with the movfuscator

lyric mountain
#

Ah yes, it was +[] to fuckin transform it to string for some reason

quartz kindle
#

someone tries to decompile it... only movs
hacks your pc steals the source code.... only jsfuck

lyric mountain
#

I confused with +{}

sharp geyser
lyric mountain
#

I wonder if u can apply some of those operations on regular coding

#

Like using +[] to call toString()

quartz kindle
#

you can just call +

lyric mountain
#

let smth = new SomeClass()+[]

sharp geyser
#

😏

shell tundra
#

That looks sussy

sharp geyser
#

its not

#

trust

lyric mountain
pearl trail
#

😜

sharp geyser
#

I would never risk getting banned again

quartz kindle
#

people actually do that, weird coercions because its shorter to write

lyric mountain
#

Which is why {}+[] becomes [object Object]

sharp geyser
#

what

#

why

#

why does +[] call toString

#

wtf

#

my js code fixing to look confusing as fuck with this one

lyric mountain
quartz kindle
#

its basically coercion abuse, the same as +"123" = 123

sharp geyser
#

im not surprised

#

jsfuck can get dangerous due to how obscure it is

#

so you can realistically hide anything in it, and send it to some moron who will run anything given to em

quartz kindle
#

a part of jsfuck only works using eval

#

and browsers like to block eval

sharp geyser
#

what if its not in the browser

#

but rather a js file

quartz kindle
#

then it will work

#

it will also work in a blank page

#

like about:blank

sharp geyser
#

Hey man install node, run this kthx for your information

lyric mountain
#

And it's pretty hard to revert to js

quartz kindle
#

there are protections in about:blank

sharp geyser
#

@shell tundra

lyric mountain
#

It works yeah

shell tundra
sharp geyser
#

no

#

I call you zob

shell tundra
#

:(

quartz kindle
#

could've*

#

:^)

sharp geyser
#

should've*

quartz kindle
#

i feel like making a geocoding service based on geonames

#

idk why

earnest phoenix
#

heyyy guys!!

rocky wave
#
const { Client, GatewayIntentBits, MessageActionRow, MessageButton } = require('discord.js');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');

const clientId = 'x';
const guildId = 'x';

const commands = [
    {
        name: 'test',
        description: 'Open a test modal',
    },
];

const rest = new REST({ version: '9' }).setToken('x');

const client = new Client({
    intents: [
        GatewayIntentBits.Guilds,
        GatewayIntentBits.GuildMessages,
    ],
});

client.once('ready', async () => {
    console.log('Ready!');
    try {
        await rest.put(
            Routes.applicationGuildCommands(clientId, guildId),
            { body: commands },
        );

        console.log('Slash commands registered.');
    } catch (error) {
        console.error(error);
    }
});

client.on('interactionCreate', async interaction => {
    if (!interaction.isCommand()) return;

    const { commandName } = interaction;

    if (commandName === 'test') {
        const row = new MessageActionRow()
            .addComponents(
                new MessageButton()
                    .setCustomId('modal_trigger')
                    .setLabel('Open Modal')
                    .setStyle('PRIMARY'),
            );

        await interaction.reply({ content: 'Click the button to open the modal.', components: [row] });
    }
});

client.on('interactionCreate', async interaction => {
    if (!interaction.isButton()) return;

    if (interaction.customId === 'modal_trigger') {
        await interaction.reply({ content: 'Modal triggered.', ephemeral: true });
        await interaction.channel.send({ content: 'This is a test modal!' });
    }
});

client.login('x');
#
node:events:497
      throw er; // Unhandled 'error' event
      ^

TypeError: MessageActionRow is not a constructor
    at Client.<anonymous> (/home/reaper/Desktop/test/index.js:44:21)
    at Client.emit (node:events:531:35)


Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:402:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
#

Help

deft wolf
rocky wave
pearl trail
#

MessageActionRow is only for early(?) discord.js@13 ℒ️

sharp geyser
#

What discord.js version

sharp geyser
pearl trail
#

seems like they're using djs v14

#

use this instead ActionRowBuilder

sharp geyser
#

discord.js v13 is still supported, but it wont have many of the new api features

#

Oh right builders nauseated_face_AE

pearl trail
#

🀒

sharp geyser
#

nasty things

pearl trail
#

Cassandra.ServerErrorException: java.lang.IllegalArgumentException: newLimit > capacity: (993079868 > 269) what does this mean? πŸ’€ the error is at line 105

#

oh also adminlogs is LIST<TEXT>

sharp geyser
sharp geyser
#

Im not super experienced with java, but iirc a list has a certain capacity, and if you are adding onto it too much and it exceeds that capacity then it will error (I think, don't take what I say seriously, thats just my speculation)

#

Someone like @covert gale or @lyric mountain would be better suited to answer this

pearl trail
pearl trail
#

ok i got it working, i'm dumb. changed to this UPDATE modlogs SET adminlogs = ? + adminlogs WHERE guildid = ? and new List<string> {myData} instead of just string 😩

radiant kraken
pearl trail
radiant kraken
pale vessel
#

is it like python's [1, 2, 3] + [something]

covert gale
#

i'm not sure about this but, you can probably hold atleast 2B entries

sharp geyser
#

woah thats not nice

#

what if they have feelings

pearl trail
#

true true

lyric mountain
lyric mountain
pearl trail
lyric mountain
#

no, db

#

ah nvm

#

cassandra is actually a db

pearl trail
lyric mountain
#

thought it was a c# database tool

sharp geyser
#

Lmao

#

No

#

Also they are using Java so that wouldn’t make sense

lyric mountain
#

that's c#

sharp geyser
#

It says a Java error

#

πŸ’€

pearl trail
#

cassandra is java yes. the C# driver just return the error from the server

lyric mountain
#

c# uses the same format lul

sharp geyser
#

I thought it was Java which is why I ponged haku

lyric mountain
sharp geyser
#

Let’s be real haku

#

Idfk what Java code looks like

lyric mountain
#

lmao

#

java interpolated string prefix is STR

#

but the pascalcase methods are what gave it away

sharp geyser
#

Ima be real everything looks the same to me at 8am

chilly hatch
#

This is the authorisation check code for my discord.js v14 command;

if (!interaction.member.permissions.has(PermissionFlagsBits.Administrator)) {
        return interaction.reply({
            content: text.yoneticihata,
            ephemeral: true
        });
    }

I want the server founder to use it, how can I do it?

lyric mountain
#

dont check the perm, check if the id is the same as guild's ownerId

#

there can be many admins, but only 1 owner

lament rock
#

Made my own starboard system. Discord is lame and doesn't allow bots to set the video field of embeds

#

Its a fake image as a placeholder because just an empty embed is boring

lyric mountain
#

there's an upcoming crosspost feature, perhaps it'll help making starboard

wild garnet
#

why no one is interested to create an auto react bot?

lyric mountain
#

what do you mean by "auto react"?

wild garnet
#

reacting to every message in the channel

lament rock
lament rock
lyric mountain
#

aside from destroying the ratelimit

wild garnet
#

what ratelimit will possibly attract in that case?

lyric mountain
#

reaction ratelimit

wild garnet
#

okay

lament rock
#

Reaction rate limit is 5 per 5 seconds

lyric mountain
#

on a moderately active server you could hang the bot simply by setting it to the general channel

lament rock
#

More like just hanging that bucket since I think it's per channel. But at scale, you can very easily hit the global rate limit

pearl trail
#

what permission(s) do a user need to make them as a "moderator"

#

is it manageGuild ?

eternal osprey
#

hey cuties. Any idea on the design here

#

these are basically flip cards

#

they describe keywords and once you flip them you are matched with a product.

dusky idol
eternal osprey
#

i reduced the opacity a little bit more already

#

which looks a bit better impo

dusky idol
eternal osprey
#

a site for fireplaces.

#

it's basically an "inspire me" section where customers can find a product that fits them best given some keywords on the cards

pearl trail
# dusky idol What

on my bot, how to tell if someone is a "moderator" without them being administrator cause it's too high

#

like i bet @ moderators don't have administrator perm

dusky idol
#

Just make the bot check if they have the role

#

Or you could check if the user has x permissions

pearl trail
#

no πŸ’€ i want to check em via permissions

pearl trail
dusky idol
pearl trail
#

that's what im asking πŸ’€

dusky idol
#

Can be anything depending on the server

pearl trail
#

are they the almighty ban_members kick_members and manage_messages

dusky idol
#

If it's a public bot then I advice you to let admins customize the command and decide who they wanna allow using it

#

Either with a role or perm

lyric mountain
#

on my bot I just check kick_members

pearl trail
#

ah

lyric mountain
#

ban sometimes is restricted to admins, cuz it's much more powerful than kick

#

but kick/timeout/manage msgs are nearly fundamental to moderator roles

#

since u cant moderate if you cant punish

pearl trail
#

i see i see, that makes sense

#

thank you!!

muted bramble
#

@dusty solstice

dusky idol
#

Do Views possibly fill up your resources? I was just wondering about it

If I define a view where
view = View(timeout=None)

and add buttons with their callbacks to this view, it's going to be live till the bot shuts down or reloads right. Where is this view getting saved even? In the memory of the bot or smth

#

If this view is getting stored, the buttons and other components stored inside will stay there too. Incase their callbacks have variables which stores images or other heavy data it could cause trouble or am I tripping

lyric mountain
#

context?

dusky idol
lyric mountain
#

but well, anything held inside callbacks is kept in memory yes, alas why u shouldn't have outside references to it

#

if your lang doesn't have gc also, you need to make sure to destroy it

#

and close any streams

lyric mountain
#

also remember that callbacks are like normal functions

dusky idol
#

I doubt the gc would pick up on views or callbacks considering the view doesn't expire

lyric mountain
#

once you leave their scope, it's gone whatever was inside it

#

unless you reference said things somewhere else

lyric mountain
dusky idol
lyric mountain
#

yes, like in functions

dusky idol
#

hm

lyric mountain
#

it's not that it's reset, it simply never existed within that scope

#

what happens inside, stays inside

dusky idol
#

Yeh I got you, basically the vars inside said callbacks are dropped after output

lyric mountain
#

yes

#

the only way to keep the value alive is to reference it in a higher scope

dusky idol
#

I dunno if it looks alright or no errors as I typed it on phone

dusky idol
lyric mountain
#

the callback itself is, the values inside it aren't

dusky idol
#

Even tho the callback function is dropped after everytime someone clicks it

dusky idol
lyric mountain
#

there's no "whole function"

dusky idol
lyric mountain
#

to make it simple, imagine you have a phone

#

you call someone and have a very long chat

#

the moment you drop the phone, the chat ceases to exist

#

it never existed

dusky idol
#

hm

lyric mountain
#

only during your chat it actually had a meaning

dusky idol
#

makes sense

lyric mountain
#

it's also why a project can have several millions of lines code and yet fit in a handful of MBs

#

because that code doesn't have meaning until it's used

dusky idol
#

If I set the timeout to something for the view is it removed off the memory after its duration is over tho

lyric mountain
#

the callback instance is

dusky idol
#

view = View(timeout=10)

lyric mountain
#

imagine you grab the phone and throw it into a bin

dusky idol
#

After 10 seconds this view should be gone from memory

lyric mountain
#

you didn't destroy the chat, you destroyed the phone itself

lyric mountain
#

but also, it's indeed not a good idea to have very long lived events

#

unless you have a specific need to keep it alive forever

#

simply because less events means less overhead

dusky idol
lyric mountain
#

I release my buttons after 1 minute of inactivity

#

as long as someone is interacting with it, it'll be kept alive

dusky idol
lyric mountain
#

each of my events instantiate a timed action, I just reset its countdown whenever someone presses a button

#

if the countdown is allowed to reach 0, it removes the event from the handler

#

since there are no more references to the event, it becomes elligible for GC

dusky idol
#

I see

surreal sage
#

chat

#

should i invest in server racks and cases

lyric mountain
#

server hacks and csgo cases

deft wolf
#

Gamba

pine willow
surreal sage
#

i cant gamble

#

i want to gamble

#

let me gamble

#

i love gambling

surreal sage
#

future proofing!

#

πŸ’―

pine willow
#

Hmmm

sharp geyser
#

Seems legit

pine willow
pine willow
surreal sage
covert gale
#

is there a good 100% uptime way of doing load balancing? (which is just switching between 2 urls depending on which one is online)

pearl trail
#

C#, what's best to use? or it's up to me

ResponseModel responseModel = new ResponseModel
{
    ResponseType = ResponseType.Embed
};

or

ResponseModel responseModel = new();
responseModel.ResponseType = ResponseType.Embed;
#

rider recommends me the first one, but i'm asking other's opinion

pale vessel
#

it's just syntactic sugar. i'd use whatever is shorter

#

the first one is better if you're setting multiple properties since you won't need to repeat responseModel

pearl trail
#

thanks

sharp geyser
#

honestly i'd go with one or the other, even if its only for a small number of properties

#

then again I like consistency

pearl trail
pale vessel
sharp geyser
#

Its all up to you at the end of the day

#

neither is bad

pearl trail
#

i see

scenic kelp
#

if there's no builder pattern

scenic kelp
#

newline braces are so clean

#

stuff gets so crowded when there's no gaps

pearl trail
scenic kelp
#

consistency

pearl trail
#

i see i see

scenic kelp
#

like whenever i see that kind of pattern i know i'm initializing an object

#

and it also works with other similar syntax like with

#

as well as anonymous objects

sharp geyser
#

told ya

#

consistency is key

#

πŸ‘

#

if you mix too many styles together code becomes ugly imo

scenic kelp
#

especially because C# is quite a feature rich language

#

there's a lot of different ways to do the same thing

sharp geyser
#

picking one and sticking to it is the best way

#

unless ofc one way is more performant then the other

scenic kelp
#

even like ```cs
ResponseModel a = new ResponseModel();
ResponseModel b = new();
var c = new ResponseModel();

#

three different ways

sharp geyser
#

var infers the type in C# right?

scenic kelp
#

your codebase would be a nightmare if you used them all

#

yes

#

same with new()

sharp geyser
#

Have not used C# in a good while

pale vessel
scenic kelp
#

don't make me break out the whole global:: bs

sharp geyser
#

thats my que to leave

pale vessel
#

can you prepend that to everything

scenic kelp
#

any fully qualified reference

#

so like global::System.Console.WriteLine()

pale vessel
#

can you make the most cursed c# hello world you could think of?

scenic kelp
#

gladly

sharp geyser
#

im scared

scenic kelp
#

i loaded dotnetfiddle and this is where i left off

#

so good start

pale vessel
#

at least it looks short

pearl trail
scenic kelp
#

i'm too lazy to make something truly cursed

sharp geyser
#
using global::System;
using global::System.Collections;
using global::System.Collections.Generic;
using global::System.Text;
using global::System.Reflection;

namespace CursedHelloWorld
{
    public class Program
    {
        public static void Main(string[] args)
        {
            global::System.Collections.IList hw = new List<char> { 'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd' };
            global::System.Text.StringBuilder cursedString = new global::System.Text.StringBuilder();
            foreach (char c in hw)
            {
                cursedString.Append(c);
            }

            // Using reflection to get the WriteLine method
            global::System.Reflection.MethodInfo methodInfo = typeof(global::System.Console).GetMethod("WriteLine", new global::System.Type[] { typeof(global::System.String) });
            if (methodInfo != null)
            {
                methodInfo.Invoke(null, new object[] { cursedString.ToString() });
            }

            global::System.Func<string, string> extraSteps = (global::System.Func<string, string>)(str => str + "! Welcome to Cursed Programming.");
            global::System.Console.WriteLine(extraSteps(cursedString.ToString()));
        }
    }
}
scenic kelp
#

that's decent

sharp geyser
#

chatgpt be cooking

scenic kelp
#

chatgpt?

#

yeah figured

#

i'd find a way to incorporate spans and unsafe marshal calls

#
using global::System;
using global::System.Runtime.InteropServices;

public class Program
{
    // Importing WriteConsoleW from kernel32.dll for output
    [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
    private static extern bool WriteConsoleW(
        global::System.IntPtr hConsoleOutput,
        global::System.ReadOnlySpan<global::System.Char> lpBuffer,
        global::System.UInt32 nNumberOfCharsToWrite,
        out global::System.UInt32 lpNumberOfCharsWritten,
        global::System.IntPtr lpReserved);

    // Importing GetStdHandle from kernel32.dll to get the console handle
    [DllImport("kernel32.dll", SetLastError = true)]
    private static extern global::System.IntPtr GetStdHandle(global::System.Int32 nStdHandle);

    private const global::System.Int32 STD_OUTPUT_HANDLE = -11;

    public static void Main()
    {
        // Getting the console handle
        global::System.IntPtr consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);

        // The message to print
        global::System.ReadOnlySpan<global::System.Char> message = "Hello, World!".AsSpan();

        // Variable to store the number of characters written
        global::System.UInt32 charsWritten;

        // Unsafe block to call the WriteConsoleW function
        unsafe
        {
            // Pin the ReadOnlySpan to get a pointer to the char data
            fixed (global::System.Char* pMessage = message)
            {
                WriteConsoleW(consoleHandle, message, (global::System.UInt32)message.Length, out charsWritten, global::System.IntPtr.Zero);
            }
        }
    }
}
``` that looks promising
sharp geyser
#
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace CursedHelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            new Program().Run();
        }

        unsafe void Run()
        {
            // Create a string using a span
            Span<char> helloSpan = stackalloc char[] { 'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd' };
            var cursedString = new StringBuilder();
            foreach (var c in helloSpan)
            {
                cursedString.Append(c);
            }

            // Use unsafe code to print the string
            fixed (char* p = cursedString.ToString())
            {
                IntPtr ptr = new IntPtr(p);
                Marshal.WriteIntPtr(ptr, ptr);
                Console.WriteLine(Marshal.PtrToStringUni(ptr));
            }

            // Use reflection to avoid direct method calls
            var methodInfo = typeof(Console).GetMethod("WriteLine", new Type[] { typeof(string) });
            if (methodInfo != null)
            {
                methodInfo.Invoke(null, new object[] { cursedString.ToString() });
            }

            // Additional unnecessary lambda function
            var extraSteps = (Func<string, string>)(str => str + "! Welcome to Cursed Programming.");
            Console.WriteLine(extraSteps(cursedString.ToString()));
        }
    }
}

#

yea chatgpt kinda weak sauce

scenic kelp
#

reflection is good

scenic kelp
#

it's weird that it originally suggested IntPtr instead of nint

#

fuck you chatgpt y ou are UNEDUCATED

sharp geyser
#

its chatgpt

#

its terrible

pale vessel
#

technically you can use WriteConsoleA too right

scenic kelp
#

no idea about windows functions

#

ideally i never have to touch windows api

#

i don't feel like feeling miserable

pale vessel
#

should be fine since hello world is ascii

scenic kelp
#

oh one is just unicode

pearl trail
#

@scenic kelpis there any way i can do

return await Context.SendResponse...

instead of

await Context.SendResponse...
return;
```? the type is `Task`
scenic kelp
#

no

pearl trail
#

😩

scenic kelp
#

just leave out the return though

#

unless you have more below nvm!

pearl trail
#

yeah i do have more below

scenic kelp
#

this is why cool languages use a unit type instead of a void type

#

switch to F# and you can probably do that!

sharp geyser
#

πŸ’€

#

We bringing out all the music notes with this one

pearl trail
#

lmfao KEK KEK

scenic kelp
#

i will now make the CLASSIC joke of calling it Db and Gb

sharp geyser
#

ngl

#

what even is F#

pearl trail
#

a language

sharp geyser
#

well I know that

pearl trail
sharp geyser
#

but I never looked at it

scenic kelp
#

functional ML-family language

pearl trail
#

oh god what is this πŸ’€

#

;

pale vessel
sharp geyser
#

Felipe my beloved

scenic kelp
#

and it has discriminated unions and C# doesn't

#

so therefore F# is better

#

sorry let me put it in a language people here can appreciate

#

IT'S JUST LIKE RUST ENUMS GUYS πŸš€

pale vessel
#

it's already good because they used oxford comma

scenic kelp
#

obviously rust actually invented everything

pearl trail
scenic kelp
#

i was thinking about it earlier it makes me sad to think there's probably people who think that rust actually invented like pattern matching

sharp geyser
#
// 'name' is inferred to be a string based on usage.
let printMessage name =
    printfn $"Hello there, {name}!"

// 'names' is inferred to be a sequence of strings.
let printNames names =
    for name in names do
        printMessage name

let names = [ "Ana"; "Felipe"; "Emillia" ]
printNames names

wtf is this syntax

scenic kelp
#

ML style

sharp geyser
#

internet went out for a few min there

scenic kelp
#

derives from ML -> Caml -> OCaml -> F# basically

scenic kelp
#

average discord developer

sharp geyser
#

what is ML

#

its not machine learning is it

scenic kelp
#

no

#

ML (Meta Language) is a general-purpose, high-level, functional programming language. It is known for its use of the polymorphic Hindley–Milner type system, which automatically assigns the data types of most expressions without requiring explicit type annotations (type inference), and ensures type safety; there is a formal proof that a well-type...

sharp geyser
#

its function may be fun but it doesnt look fun

scenic kelp
#

that the average discord developer thinks that rust is the language that invented pattern matching

#

that is what that means

sharp geyser
#

lol

#

anyone who thinks that..are indeed special

scenic kelp
#

i have to be rust's biggest hater to counteract all the random love for it

sharp geyser
#

rust isn't that bad lets be real

scenic kelp
#

no but this is a discord bot development server

sharp geyser
#

the dev community are...special but its not the worst language

scenic kelp
#

the language is fine

#

i like it

sharp geyser
scenic kelp
#

addresses the shortcomings of C

sharp geyser
#

I cant remember the last time someone was actually struggling with a discord bot in here

#

its mostly database related

#

db, web dev

#

backend apis

scenic kelp
#

not necessarily development but I've definitely seen people talking about rust for their fuckin web server or whatever they're writing

sharp geyser
#

Well yea

scenic kelp
#

something something square hole circle peg

#

jackhammer and nail

sharp geyser
#

What's wrong with rust for backend?

scenic kelp
#

it's overkill

sharp geyser
#

I disagree

#

for something small sure

#

but something of a mass scale, its definitely useful

scenic kelp
#

do you think random discord user 35 is going to be writing a 300k loc web server that needs to handle 1m requests per second

sharp geyser
#

no...but I definitely will be needing to handle that

#

or at least be prepared to

scenic kelp
#

mhm

sharp geyser
#

Its not for the average discord user no

#

but it definitely holds merit for backend dev

scenic kelp
#

in general web servers are so stupidly optimized in any language that you'll get more than acceptable performance

sharp geyser
#

except js

scenic kelp
#

including js

sharp geyser
#

nah

scenic kelp
#

express is pretty fucking fast

sharp geyser
#

js stinky

#

smelly

#

but nah, I went with rust simply for its syntax, memory management, and its strict type system. Among a few other things but i'd just be preaching to the choir

#

There's still a lot I dont know about rust

#

like its lifetimes and I still dont understand the borrow checker that much, nor do I really understand macros but hey im learning

scenic kelp
#

i just do not understand the appeal versus a language like C# when you're just doing backend stuff

sharp geyser
#

Im confident to hold my own though in some cases

outer crater
#

**Didn't worked: **


typedef struct{
  char name[36];
  int age;
  int level;

  struct DOB {
    int day;
    int month;
    int year;
  };

} player;

**Worked: **

struct DOB {
  int day;
  int month;
  int year;
};

typedef struct{
  char name[36];
  int age;
  int level;
  struct DOB dob;
} player;
sharp geyser
#

what the fuck

scenic kelp
#

very true

sharp geyser
#

thats c++ right?

#

looks like c++

scenic kelp
#

C or C++ idk

sharp geyser
#

I don't really know how to explain it because when it comes to talking about languages I don't know much about the language itself. I just didn't have a need for C#

#

rust on the other hand I plan on using for more than just backend so it worked out.

scenic kelp
#

i mean ig if you're actually going to be using rust for truly low level stuff

#

like actual systems programming then it's worth learning

sharp geyser
#

Indeed it is on my list of things to do

#

Down the road

outer crater
scenic kelp
#

just I'd advocate 90% of people stick with C# or a JVM lang or smth

#

they're the perfect balance in my mind of dev speed and maintainability vs performance

#

C# can genuinely be unfathomably fast

sharp geyser
#

honestly a valid point

#

I just have no need for C# rn

scenic kelp
#

the code quickly descends into madness but it can be very very optimized

sharp geyser
#

if I focus on too many things at once i'll never get anything done

scenic kelp
#

a lot of the recent language versions have focused on that with Span and stuff etc

harsh nova
#

I too love Microsoft Java

sharp geyser
#

who are you

#

random

#

fish

scenic kelp
#

java if it were good

harsh nova
#

True

#

C# is lovely

scenic kelp
#

add discriminated unions and i will never use another language ever i swear

#

not even css

sharp geyser
harsh nova
#

Can write pretty nice stuff with the blazor web framework as well or whatever it is called

sharp geyser
#

I might be wrong but I remmeber not being able to

harsh nova
#

Think it compiles to webml

scenic kelp
#

issue with blazor is it uses wasm to basically load a .net runtime

#

so it has a big initial load

harsh nova
#

wasm yea

scenic kelp
#

I'll stick to svelte for web stuff BUT OTHER THAN THAT I SWEAR

sharp geyser
#

vled said "oh no blazor" when I told him i was trying out c#

#

πŸ’€

#

Whats wrong with blazor might I ask

harsh nova
#

It's nice to write tho

scenic kelp
#

literally just the big load

#

imo

harsh nova
#

Perhaps not the fastest but it feels nice

scenic kelp
#

but they are working on native AOT compilation so maybe fingers crossed

sharp geyser
#

what do you use C# for farmer fish

#

dont say just web dev

#

πŸ’€

harsh nova
#

School, a discord bot, and some other stuff

sharp geyser
#

is threadwatcher made in c#

harsh nova
#

Nah, ts

sharp geyser
#

oh no wonder its bad

scenic kelp
#

TS is honestly pretty cool but it also inherently has all of JS's bullshit

harsh nova
#

Me and the dev of needle have joked about rewriting our bots in c# and for every time we joke about it, it feels less than a joke and more like a plan

sharp geyser
#

just do it at this point

#

idk who needle is

#

but he sounds like a nice guy

scenic kelp
#

i have always said that a language that has a very similar type system but not with a JS target would be pretty cool

sharp geyser
#

or girl

#

or them/they xem/xer idfk anymore

harsh nova
#

"Just do it" requires many hours of work I'm just not ready to handle rn KEKW

sharp geyser
#

bah quitter talk

scenic kelp
sharp geyser
#

if you dont take risks there is no reward

sharp geyser
harsh nova
#

Got a lot of uni work before I start working full time June and July

scenic kelp
#

my friend said it during a speech one time and now it's burned into my brain

#

ladies and gentlemen, theydies and thentlethems

sharp geyser
#

I dislike you

#

for burning it into my brain

scenic kelp
#

tee hee

#

anyways im going to sleep i want to go on a bike ride tomorrow around noon

sharp geyser
#

I need to learn more about kubernetes

scenic kelp
#

rip my 8h of sleep plan

sharp geyser
#

kubernetes is smth I need to find out more info on

harsh nova
#

My redneck friend did a massive Isak move during rethorics class when we were supposed to write a thanks to the nation speech after being elected as PM. His speech included "lgtb and normals"

sharp geyser
#

I know its like docker on steroids

#

then again idfk a damn thing about docker either

pearl trail
radiant kraken
civic scroll
lyric mountain
civic scroll
#

hi kuu

lyric mountain
#

tho vscode did in fact enter a loop there

#

hi sa-yun

pearl trail
#

guess it's my skill issue πŸ˜”

lyric mountain
#

nah, it's indeed a valud thing to do if (!list.Any(...))

pearl trail
lyric mountain
#

but vscode is stupid, and doesn't notice that c# doesn't have if (list.None(...))

#

so it suggests u to use All with !=

#

but it isn't the same as Any will stop iteration if it finds any truey value

lyric mountain
#

while All will go till the end

civic scroll
lyric mountain
#

that's rider?

civic scroll
#

guess the language gx_tro

civic scroll
lyric mountain
#

then idk how tf that happened

lyric mountain
civic scroll
lyric mountain
#

cpp?

civic scroll
#

no

#

rust but less serious

#

so less serious that you can still run if it fails to compile

lyric mountain
#

idk, js/ts?

civic scroll
#

yes

#

the ! tripped you right

lyric mountain
#

perhaps, since rust has weird exclamation marks in odd places

civic scroll
lyric mountain
#

come to groovy instead

#

you'll love it

civic scroll
#

i use janusgraph shell

#

but idk groovy

#

sob

lyric mountain
#

it's easy to learn

surreal sage
#

i like how chatgpt now basically forces you 4o and is significantly slower than 3.5

#

i like how i have over 2,000 conversations on it

#

holy fuck i havent looked at the nodejs site since like v18 and holy moly

pearl trail
surreal sage
#

p sure thats how you call a function

pearl trail
#

ig im not that dumb

surreal sage
#

rust being rusty

wheat mesa
#

It’s not rust

surreal sage
#

rfuck

civic scroll
wheat mesa
#

It looks exactly like rust but it’s not

surreal sage
#

fuck

civic scroll
#

it's a non-null assertion operator

pearl trail
#

i see i see

wheat mesa
#

You can also tell it’s not rust because it’s a function declaration without the fn keyword

#

(And the ?)

civic scroll
pearl trail
#

ahh interesting

surreal sage
#

ofc the question mark

civic scroll
pearl trail
#

oh so it's just for ts/intellisense/typings(?) or whatever it called?

civic scroll
civic scroll
pearl trail
#

i see, that's expected

surreal sage
#

objectthatmighthaveafunction.thepossiblefunction?()

objectthatmightbenullwithafunction?.functionwow()

#

does the ! even do anything besides shutting up linters?

civic scroll
pearl trail
civic scroll
surreal sage
#

basically shutting up..

civic scroll
#

the compiler can't cover everything

#

after all it's static

pearl trail
#

thepossiblefunction?() this exists?

civic scroll
#

runtime is more dynamic than that

civic scroll
#

if you want to optionally call it, use nullish chain

pearl trail
#

ah yeah

civic scroll
#

maybeNull?.();

pearl trail
#

i thought i missed something in js/ts KEK

pearl trail
civic scroll
#

if the object ends up being null, the rest of the chain stops calling

pearl trail
#

sussything?.amogus ?? impostor my beloved

surreal sage
civic scroll
#

though if the method itself is nullable

#

then you will need an assertion at the end

civic scroll
surreal sage
#

calls when exists no?

civic scroll
#

you already typed that the method certainly exists

surreal sage
#

the question mark

civic scroll
#

so ts wouldn't do otherwise when you remove

#

ag

#

i was blind, my apologies

surreal sage
#

cant do anything anymre..

civic scroll
civic scroll
surreal sage
#

it was like that

civic scroll
#

ah

surreal sage
#

i did make a syslink and everytihng

pearl trail
surreal sage
#

but it still shows up as real name

civic scroll
#

skill issue

surreal sage
#

die

pearl trail
civic scroll
surreal sage
civic scroll
#

pro tip: use typescript playground

#

don't have to run

surreal sage
#

thats web based

#

i dont like that

#

get real

civic scroll
#

mfw tsc compiles to js

surreal sage
#

LINTING

#

IT TYPE CHECKS

civic scroll
#

i use any

#

get real

surreal sage
#

unknown better

civic scroll
#

unknown throws type errors

pearl trail
surreal sage
#

any throws type errors

#

the type error battle

civic scroll
surreal sage
#

yes

civic scroll
#

any accepts any type

surreal sage
#

actually

civic scroll
#

and so is any, to any other type

surreal sage
#

dude i could swear eslint said fuck you to any

civic scroll
#

that's eslint

#

not tsc

#

though you can disable it

surreal sage
#

eslint built diff

civic scroll
#

typescript would do the same

#

if you enable strict checks

pearl trail
surreal sage
#

tsc like

#

only works 10% of the time

#

just using esbuild/tsup because that's the only thing that works 😭

harsh nova
#

Average I don't lint my code anarchist

civic scroll
surreal sage
pearl trail
harsh nova
surreal sage
#

gotta add the poorly capitalized func name

pearl trail
#

nah, before is fine

surreal sage
#

yeah but this is worse

pearl trail
#

add _

#

increase 50% performance /s

harsh nova
civic scroll
#

max performance

surreal sage
civic scroll
#

at that point might as well write raw machine code

#

saves you 2 cycles

surreal sage
#

optimization at its finest

pearl trail
lament rock
#

remove all whitespace

surreal sage
#

dude

pearl trail
surreal sage
#

dude

lament rock
#

tsup is pretty good for minifying though stuff like class names are lost so constructor.name calls will be borked

civic scroll
pearl trail
civic scroll
#

typical visual studio formatting

surreal sage
pearl trail
civic scroll
surreal sage
#

i wanna try jetbrains but im poor.

pearl trail
#

oh really?

lament rock
#

OTBS isn't really used in C#

civic scroll
surreal sage
#

"free for students" my school doesnt even have a .edu tld

pearl trail
#

nah

#

you don't need .edu

#

wait, does .sch.id count? trolldespair

civic scroll
#

don't hoard ides πŸ˜”

#

i have regretted

surreal sage
pearl trail
#

android studio my beloved

#

love em

surreal sage
#

android studio just for the vm

pearl trail
#

fair

civic scroll
#

i use android studio for actual development

surreal sage
#

overrated

civic scroll
#

it got nicer flutter integration

#

i'd take it

surreal sage
#

bloater integration

#

idk

civic scroll
#

nah

#

it's pretty good for what they did

pearl trail
civic scroll
pearl trail
#

AQUA indeed

civic scroll
pearl trail
#

maybe try their fleet app

surreal sage
#

feet app

pearl trail
#

looks great ig?

civic scroll
#

nah

pearl trail
civic scroll
#

i would stay in vscode

#

i don't have a remote codespace anyways

pearl trail
#

hmhm

surreal sage
civic scroll
surreal sage
#

like dude ofc my linting takes 30 seconds after a single change because its an rpi

pearl trail
#

there's no rider so it's fine Troll

civic scroll
#

i found the latest one

mental glen
pearl trail
#

oh god

civic scroll
surreal sage
#

i don even know after years on css

mental glen
civic scroll
#

then do math

surreal sage
#

jsless

pearl trail
civic scroll
mental glen
mental glen
civic scroll
#

a dynamic image, generated by canvas

civic scroll
mental glen
#

yes lol

#
                    <div class="relative">
                        <DiscordEmbed avatarUrl="/logo.png" username="Green Frog" title="Pepe Sign" imageUrl="/blanksign.png" />
                        <p class="h-[200px] w-[200px] absolute top-24 left-20 text-2xl font-medium text-wrap">I'm in {data.approximate_guild_count} guilds!</p>
                    </div>
civic scroll
#

flex / gridbox

pearl trail
#

what's the actual result from that code? πŸ’€

civic scroll
#

there you go

#

the fixed dimensions

pearl trail
#

the pepe, the text, the clock, or with the gradient

civic scroll
#

why absolute

#

wtf

#

why

mental glen
surreal sage
#

absolute only valid as child

civic scroll
#

that's why it's offcentered

#

also given that fixed box dimensions

#

how would it fare larger amount of text

mental glen
#

welp

mental glen
pearl trail
#

the screenshot looks cropped

mental glen
pearl trail
#

ah yes

mental glen
#

im dumb

#

lol

#

finally works

#

ty lol. i had to use flex

#

lolololo

covert gale
#

ok so planning time heademptybleh

#

next js frontend

#

rust backend

#

and like

#

hosted on vercel?

#

idk what to do for hosting ngl

#

i could self host but i need to setup auto deploying then

pearl trail
#

replit /s Troll

eternal osprey
#

hey guys

#

does anyone have an overview of the resource usage of linear regression models vs other models

frosty gale
#

i mean speaking on linear it should use substantially less resources than other models

eternal osprey
#

yeah i know but i must write a research paper

frosty gale
#

since you dont really have many layers or use any complicated activation functions

eternal osprey
#

so i don't think i can just say that out of the blue lmao

frosty gale
#

its just x = x + y etc

eternal osprey
#

i know

frosty gale
#

as opposed to x = tanh(whatever)

eternal osprey
#

but i need some black on white hard proof to discuss this matter in my paper

#

though google scholar has like 0 fucking papers about the resourse usage.

frosty gale
#

make your own proof then

eternal osprey
#

whenver i try to search it i get HOW we can do so, but it never talks about performace.

frosty gale
#

setup 2 models one linear and one non linear with complex layers

#

and measure it

eternal osprey
frosty gale
#

thats kinda shit then

eternal osprey
surreal sage
#

gotta love having to contact ISPs just to see which one is capable of delivering an ip subnet

wheat mesa
frosty gale
#

still comes back to having to find existing research that backs this up

surreal sage
#

*** System restart required ***

civic scroll
radiant kraken
#

you're just defining the struct inside a struct

#

not assigning it to anything

sharp geyser
#

I told you ANGRY

#

you can't define a struct inside a struct like that,

#

you gotta give it a var/prop name

radiant kraken
#

you got it

frosty gale
#

blud thinks the struct will name itself πŸ’€

surreal sage
#

just name em var1 and var2 and etc

lament rock
#

whats after etc?

#

ftc?

#

all the way up to utc?

eternal osprey
#

Hey I am trying to create my own file size reducer algo. What I was thinking about is taking the first n bits that fit into a single integer if every bit would be activated. Then transforming it into an integer that represents that bitstring.

#

Would this work?

frosty gale
#

as ive already mentioned you cant really deal with bits in a compression algorithm

#

its counter productive youll end up increasing the file size

#

not to mention the complexity that introduces if you want it to be close to effective

#

memory and disk doesn't use bits on the interface layer it uses bytes which is the minimum unit you should be targeting

#

you can't just store 5 bits for example you'd have to store it as a byte which brings it up to 8 bits so you waste 3 bits

eternal osprey
#

hmm i see

#

what would be an effective way then?

hidden gorge
#

should i remove this command?

spark flint
#

yes

#

idk why thats a command

hidden gorge
spark flint
#

why not just open your hosting panel and close it there πŸ‘

#

just seems bad to have on a bot

hidden gorge
spark flint
pine willow
spark flint
#

^

frosty gale
urban delta
scenic kelp
#

no idea what lark is

urban delta
scenic kelp
#

oh

urban delta
#

and have a machinization that is really different from original Lark

#

actually

#

original python

#

so i don't know how i process it to make a function that respond only once

#

using lark

scenic kelp
#

shouldn't depend on lark much for that I'd imagine, you can look for duplicates while you're visiting your nodes

urban delta
#

if gives more it erroes

scenic kelp
#

depends on how your code is set up can't really help with the specifics

urban delta
#

but am i allowed to post my code?

scenic kelp
#

yeah

urban delta
#

so you can see it?

#

oh perfect

scenic kelp
#

out of curiosity why are you using a parsing library for such a trivial parser

urban delta
scenic kelp
#

or is there more to it

urban delta
#

i made it for macro commands

#

that allows you to create custom commands

#

+> for personal commands or -> for server commands

scenic kelp
#

ah

#

do you have a function for handling formater yet?

#

basically you would just check for duplicates in there

urban delta
#

nope, not yet

#

cus i was worried about the repeating thing

#

first

#

cus i don't wanna it repeat the responses of black intalic and etc

scenic kelp
#

yeah it's similar to like method modifiers in C# or Java for example

#

you don't want public private static static

urban delta
#

so i can copy?

scenic kelp
#

example won't help much cause it's basically what you've got but

<method modifiers> ::= <method modifier> | <method modifiers> <method modifier>

<method modifier> ::= public | protected | private | static | abstract | final | synchronized | native```
#

they obviously handle duplicates when visiting the tree

scenic kelp
#

your grammar was fine before

#

both will parse identically

urban delta
scenic kelp
#

p much

neon leaf
#

πŸ”₯

covert gale
#

i approve of this

sharp geyser
#

fake

#

wtf is mcvcli

covert gale
#

seems like this?

#

some fork ig

pine willow
covert gale
#

you'd be surprised of mc tooling

pine willow
#

i use 2000% cpu

covert gale
#

mc has single handily taken java into the future yeefyeef

sharp geyser
#

ima be real

#

mc didnt make java better

pine willow
scenic kelp
sharp geyser
#

unity has fallen into irrelevancy

scenic kelp
#

nope it's very much still relevant

sharp geyser
#

its fallen out of favor in the game dev community

neon leaf
wheat mesa
#

A true gamblers algorithm would be partially sorting it then saying β€œjust one more…” and doing another bogo sort

scenic kelp
#

killing other processes so you can take their resources to bogosort more

urban delta
#

how do i compare if a user if friend with a user?

#

like, i'm planning to make an input that receives a friend as input by pings

frosty gale
#

only the users can

deft wolf
#

You could theoretically create your own "friends" system

frosty gale
#

i cant think of a better way of implementing a friend/relationship system other than having a table that stores 2 ids which are the 2 users that have said relationship

#

but when doing db lookups you need to do "if id1 is person or if id2 is person"

surreal sage
#

visual studio code explorer on right side of window users rise up

frosty gale
#

youre on your own

urban delta
#

well, at least there is the show code thing

#

that i created

#

so friends can copy it

#

that for macro

eternal osprey
#

hey guys i am bored

#

who can recommend me a cool java project?

urban delta
eternal osprey
#

java is great for ai as well, but ehh what are roleplay servers?

#

and what's a gm

surreal sage
#

general motors

#

rah

#

πŸ¦…

eternal osprey
#

bro what the fuck is this suggestion

urban delta
#

using tupperbox

#

and GM is game master

#

like, how DnD players have Game master for their story

eternal osprey
#

somethign less specific is appreciated guys KEKW
And i prefer to move away from games. just any project in general but i cannot come up with something fun tbf

urban delta
#

okay so, is this normal?

quartz kindle
#

apparently image is not a parameter

#

did you check the docs for the library you're using?

naive fiber
#

im having this error but i dont know how to fix it

#

it says empty message even tho im sending the poll

urban delta
#

okay so this is strange:

#

i'm getting this error

#

but it wasn't suppose to be like that

#

cus i created a new rule in my grammar and it didn't identified

#

why?

sharp geyser
#

console.log it

naive fiber
quartz kindle
#

only the lastest version 14.15 supports polls

naive fiber
urban delta
#

really complicated

#

i need to debug

quartz kindle
# urban delta

never seen that before, also googling that error returns 0 results

urban delta
quartz kindle
#

ah idk anything about lark

urban delta
#

there was friends mocking me for telling them that lark is difficult by they don't hear it, and just say "lol lark is easy cuz it's programmed 100% in python, and python is ez"

naive fiber
#

does anybody know why it takes so long to update from 14.14 to latest

quartz kindle
#

and djs is bloated huge

sharp geyser
#

almost wish there was a better option

quartz kindle
#

almost

#

:^)

naive fiber
#

πŸ’€

pine willow
lament rock
#

It's almost like discord.js kinda sucks!

pine willow
sharp geyser
#

its 10x better

lament rock
#

I cant tell if you're joking