#🪅-progaming

1 messages · Page 24 of 1

timber root
#

thank you!!! it worked

dusty moth
dusty moth
#

perls your rust

valid jetty
#

wtf

fleet cedar
#

I think you might be looking for the paste crate

#

Or bitflags crate

dusty moth
fleet cedar
dusty moth
#

oh that's neat

#

how the fuck did I not realize this until now

fleet cedar
#

Nice

fleet cedar
dusty moth
fleet cedar
#

Yeah that's also necessary probably

#

Does ${\(uc)} mean $_.toUpper()?

dusty moth
#

the ()s are unneccessary I learned

fleet cedar
#

What would you do if you wanted to splice some other variable uppercasely?

dusty moth
#

if foreach (admin) then "$_ ${\uc}" would be "admin ADMIN"

fleet cedar
#

Hm.

#

Don't like that.

dusty moth
#

$_ is just the default variable

fleet cedar
#

"The default variable" is such a funny concept

dusty moth
#

but usually if you omit the arguments it'll print there

#

e.g. print; prints $_ to stdout

#

except for die; which uses $@ instead

#

but *@ = *!; in my code so it'll also accept changes to $!

fleet cedar
#

Do you realize how silly that sounds

dusty moth
#

oh also by default $_ receives the value of for loops

#

and sed notation operates on $_ unless you prefix it with $a =~

#

and if I did e.g. perl while (<>) { chomp; print; } it'd join all lines of stdin to stdout

timber root
#

why js is so racist to local files, i cant even find a way to get my local json w/o getting errors 😭

timber root
#

as i googled you cant use node on browser

#

couldnt find a way to get it too

dusty moth
#

oh you're using browser

timber root
#

ye

dusty moth
#

do you want to get a json file stored with the code or a json file stored on the user's device

timber root
#

no i want local json file with some constant info on web itself

#

just values so i dont need to search through code to edit them

dusty moth
#

or use a bundler

timber root
#

thank you!!!

dusty moth
#

yw

timber root
#

google is so silent about that

dusty moth
#

also if that doesn't work await fetch("./foo.json").then(r => r.json())

timber root
#

all of it wants me to buy server 😭

timber root
#

it tells me to buy a server too

dusty moth
#

are you using a file://?

timber root
#

no...

dusty moth
#

what url

timber root
#

same directory

dusty moth
dusty moth
timber root
timber root
#

no im not

dusty moth
#

prove it

timber root
dusty moth
timber root
#

oh

dusty moth
#

maybe

#

how are you opening this in the browser

timber root
#

same error

timber root
dusty moth
#

screenshot the error

dusty moth
timber root
#

its not on english

timber root
#

i just reload page

valid jetty
#

you can’t do that iirc

dusty moth
#

you will python3 -m http.server

valid jetty
#

you need to start a local server

#

^^^^

timber root
#

harch

#

im going to try importing first

valid jetty
#

oh is that the default

dusty moth
#

and the file might not be named index.html

#

no it's 8000

valid jetty
#

yeah yeah i meant like in general

dusty moth
#

3000 is node iirc

valid jetty
dusty moth
#

rate my generated code

valid jetty
#

because if yes you can add a plugin that allows you to import json and automatically embeds it into your js file when transpiling

timber root
#

it is just generic js file, no imports or anything

valid jetty
#

okok

dusty moth
valid jetty
#

i don’t remember

#

@timber root the easiest way i would do it is just
someProject~# python3 -m http.server 8080

import(“./a.json”).then(console.log).catch(console.error)

assuming you’re in the someProject directory:
someProject
L index.js
L index.html # imports that js
L a.json

you should be able to visit http://127.0.0.1:8080/index.html and your json file should work

timber root
#

let me try

dusty moth
#

is #![no_std] websockets possible

timber root
#

i guess im stupid but its still not working

dusty moth
#

cargo b
0 errors, 0.10 s
cargo b --all-features
38 errors

autumn sigil
#

what?

fleet cedar
#

Something panicked inside its Drop impl, when that was called while unwinding from the first panic

autumn sigil
#

this isnt rust

serene elk
#

I panicked when I saw the panic

#

sorry

autumn sigil
dawn ledge
#

(i have no context here, assuminig they're fetching in a browser)

dusty moth
#

been bitten by forgetting ./ so I always include

dawn ledge
#

lol

dusty moth
#

can you have a secret cow?

dense sand
#

add cow to .env

dusty moth
dense sand
#

oh no its some rust shit again 😭

dusty moth
#

actually it'd probably be better to put the secret box in the cow rather than the cow in the secret box

valid jetty
#

TIL rust has contracts

fleet cedar
#

?

valid jetty
#

nvm apparently that isnt real syntax

valid jetty
#

yall

#

is this a sane way to ensure that tests written in the language itself are safe and correct

#

the way i test various modules is by using assert

#

so i think that testing assert should be done first to make sure assert works

#

but is there any other invariants that should hold true?

deep mulch
#

the Rosie rot

#

are you gonna add string templating

#

"${a}"

valid jetty
#

if i do it wont be like tha

#

t

#
i32 a = 5;
string foo = "\{a}";
``` would be the same as
```rs
i32 a = 5;
string foo = "{}".format(a);
autumn sigil
royal nymph
#

but yeah whatever u call putting a variable right inside a string with brackets is way more readable than .format()

dusty moth
#

i use \() for interpolation and '' for syntax tree quoting

#

also shit like let \("a" + "b") = 2;is completely sane

deep mulch
#

you will suffer

valid jetty
#

you will never need to escape it

#

because youre never gonna write need to write \( in your strings ever

frosty obsidian
#

bold assumption

valid jetty
#

its less bold than js where ${} exists

#

although i guess you need backticks for that

royal nymph
#

i write \( in my strings all the time

dusty moth
#

e.g. let \("Hello, world!") = 2; will make a variable named Hello, world!

frosty obsidian
#

$ is more standard honestly

royal nymph
#

only crapple uses \(

deep mulch
royal nymph
#

thats why rosie loves it

frosty obsidian
#

i would never think to use the escape character

deep mulch
#

\ for escaping stuff

royal nymph
#

swift uses \(

#

its weird

dusty moth
#

also splices are compile-time evaluated unless they depend on a var

deep mulch
#

apple loves being different

frosty obsidian
#

i would accept $ or %

royal nymph
dusty moth
royal nymph
#

wing loves %APPDATA%

deep mulch
#

@frosty obsidian have you ever coded batch

#

it's so bad

frosty obsidian
dusty moth
#

in perl ${\uc} is completely sane

#

as is *@=*!;

valid jetty
#

i have an idea

#
i32 a = 5;
string foo = ""`Hello with fmt: $$$_-_INTERPOLATION_=_START_-_{a}_-_INTERPOLATION_=_END_-_$$$ and more after `"";
#

@deep mulch what do you think

deep mulch
valid jetty
#

its great

deep mulch
#

nop

valid jetty
#

im implementing into elle rn

deep mulch
#

nop

#

you aren't

jade stone
#

guhhhhh

#

who made this main and not index

valid jetty
deep mulch
#

@valid jetty don't die

#

don't make it ugly or else you'll explode

dusty moth
#

so how bad of an idea is this

#

initially all users will be None

#

when a user connects, a write lock is taken against the slot, then the inner option is replaced with a fresh ConnectionState (killing the old one if necessary)

#

and a reference to it is kept, allowing the clients' threads to handle incoming packets (as the ConnectionState stores e.g. room info) as well as letting them take the outgoing packet mutex

#

when a user overwrites an older connection ("killing the old one if necessary"), it sends a Disconnect packet and shuts down the socket

jade stone
dusty moth
#

oh wait a second

#

i need more indirection

#

disconnecting would require me to somehow move out of the Option

#

but the only way to do that would be to keep the RwLock's writer the entire time

#

i should've talked to a rubber duck first

dusty moth
#

and you excluded the EnumMap

#

so to disconnect a user I need to somehow move out of the option, meaning I must have a way to take the write lock

#

however I don't want to accidentally take another connection's write lock

#

(the only way to disconnect a user as of now is to drop their ConnectionState)

fleet cedar
#

Consider dashmap

dense sand
#

can somebody here help me understand what does resolve parameter on loadClass mean?
or how does it affect class loading?

#

(in java)

fleet cedar
#

Isn't that whether to run static initializers

dense sand
#

well the docs say that if that flag is true, the class will be linked

fleet cedar
#

Otherwise it'll be run when you actually do anything with the class, like accessing a static field/method or instantiating it

dense sand
#

ah i see

#

so its basically whether or not to lazily run static initializers

fleet cedar
#

Afaik yes

dense sand
#

k ty

royal nymph
dense sand
#

whos supposed to understand this shit though

dense sand
#

i can read javadocs, but like

#

i want it the human way

royal nymph
#

Linking is the process of taking a binary form of a class or interface type and combining it into the run-time state of the Java Virtual Machine, so that it can be executed. A class or interface type is always loaded before it is linked.

Three different activities are involved in linking: verification, preparation, and resolution of symbolic references.

The precise semantics of linking are given in Chapter 5 of The Java Virtual Machine Specification, Java SE 8 Edition. Here we present an overview of the process from the viewpoint of the Java programming language.

This specification allows an implementation flexibility as to when linking activities (and, because of recursion, loading) take place, provided that the semantics of the Java programming language are respected, that a class or interface is completely verified and prepared before it is initialized, and that errors detected during linkage are thrown at a point in the program where some action is taken by the program that might require linkage to the class or interface involved in the error.

For example, an implementation may choose to resolve each symbolic reference in a class or interface individually, only when it is used (lazy or late resolution), or to resolve them all at once while the class is being verified (static resolution). This means that the resolution process may continue, in some implementations, after a class or interface has been initialized.

Because linking involves the allocation of new data structures, it may fail with an OutOfMemoryError.

#

tldr just what kyuu said

#

it initialises the class

#

runs static blocks

and resolves & loads dependencies of that class recursively

#

apparently resolveClass is a NOOP tho lol

dense sand
#

noop?

pearl stagBOT
dense sand
#

yeah

#

well that because it wants the inheriting classloaders to override it

royal nymph
#

cursed

dense sand
#

would expect AppClassLoader to be used

royal nymph
#

cant believe im installing jdk just for testing

dense sand
#

erm but why dont you use it as a docker container 🤓

#

jdk 23 added markdown support to javadocs smarty

royal nymph
dense sand
#

yeah its some tools trickery

#

java is pretty cursed and i dont like how they hide half of the shit behind internals

#

so you gotta do some weird ass reflection

royal nymph
#

but AppClassLoader doesnt override that method

#

it extends BuiltinClassLoader

#

which also doesn't override

dense sand
#

wait its final

#

my bad

royal nymph
#

XD

dense sand
#

i totally didnt see that

royal nymph
#

i didnt see it either tbf

#

but yeah so it literally does nothing

#

hilarious

royal nymph
#

if you run a java file directly without compile it has to so some weird trickery

#

hence the memory class loader

#

anyway since you can run plain text source java files with just JRE, JDK is redundant weSmart

#

real java devs dont need jdk

dense sand
royal nymph
#

that would be easier tbf XD

dense sand
#

but it seems like its not that easy lol

royal nymph
#

well

#

keep in mind i was using JRE

#

i didnt have JDK installed

dense sand
#

really?

royal nymph
#

yes

royal nymph
dense sand
#

tragedy, oracle will no longer be able to buy sport yachts

#

millions will suffer

dense sand
dawn ledge
fleet cedar
#

It does nothing with the class, just checks if the class object is nonnull

dense sand
fleet cedar
#

Dunno, probably legacy shit

pearl stagBOT
dense sand
#

smh

pearl stagBOT
royal nymph
#

i can't find implementation of JVM_ResolveClass lol

dense sand
#

well that would explain that i guess

#

so its for backwards compatibility ig

royal nymph
#

ya

valid jetty
nimble bone
valid jetty
#

elleos soon

potent cloud
#

rewrite elle in assembly

deep mulch
valid jetty
#

it’ll just end up being an sdl wrapper lol

deep mulch
#

no wrapper

#

pure elle

fleet cedar
#

Vulkan wrapper

deep mulch
#

ElleGL

dusty moth
#

i'm bored and feel like making a package manager

ornate quiver
#

...said no one ever

balmy lintel
#

pnpm devs in question

dusty moth
#

and am serious

#

(ripoff flatpak)

dusty moth
#

rate cli

#

can I make it longer

misty harbor
#

thoughts on mac rice

#

i need a better sketchybar config but am lazy

ornate quiver
#

looks nice I like it

still jolt
#

also since when are you green

dusty moth
jade stone
#

is there a reason typescript errors if you return a non-void type in a void function

#

doesnt void normally mean it doesnt matter what something returns

dusty moth
spark tiger
#

I've been trying to understand how watchdis.tv and premid.app were able to use different types of activities (i.e. watching/listening to, etc.) of rich presence even though rich presence wasn't allowed to do so
and apparently they are or were using this endpoint /users/@me/headless-sessions
I'm very curious where this was discovered from

#

cuz this undocumented and I couldn't really find any info about that

#

only from digging inside the extension src code

frosty obsidian
#

im pretty sure you can just send whatever activity type you want over the gateway

leaden flume
#

yo

#

quick question

#

is there a community-made plugin which creates a pin before you enter discord

viscid grove
#

like to prevent someone from looking at your messages while you're away from your computer?

leaden flume
#

I jst found password protect

#

but was wondering is there a way to do that for everything

viscid grove
#

if you use windows, you could just press win+l to lock your computer and make anyone have to put in your pin/password before seeing stuff on your computer

leaden flume
#

on mac unfortunately 😢

viscid grove
#

does ctrl + cmd + Q work?

leaden flume
#

yea

#

also another question

median root
#

what does the ```js
A = n(2466)

do in discords minified thing
#

ive basically been trying to create a patch where the defualt poll duration is one hour

#

but ive never realised how nice having well named variables were

#

im still very new to this whole thing but these are the patches i have ebeen able to come up with (only the first one works, the others have no effect for some odd reason)

#

the one patch that works just makes the box look like this (it gets set to 1 day again when i click post)

royal nymph
median root
#

i just saw a space and patched it

#

is that the only issue then?

#

no it clearly isnt

elder scaffold
median root
#

next they should make good varialbe names

elder scaffold
#

it's minified

median root
#

id just rathe read structured code than all of it on one line

#

great alr

#

ill go scroll thru this for a while longer

#

and see whats wrong

elder scaffold
#

yeah you can still use pretty print but you just have to not put any whitespace in your match that isn't required by js syntax

elder scaffold
median root
#

wait so how does that work

elder scaffold
#

\i is a special regex escape in vencord patches that matches identifiers (variable names, function names, etc)

median root
#

does it just do 1 character?

elder scaffold
#

it can do multiple

#

it just matches variable names

#

and stuff like that

median root
#

so something like selectedDuration, B a, l would all be replaced with \i

#

?

elder scaffold
#

instead of /selectedDuration:B/ you should do /selectedDuration:\i/

median root
#

aah thanks

spark tiger
cerulean plover
#

if you look at Vencord.Webpack.wreq you will see it's that function

median root
#
match: /let\s?\{\s?selectedDuration:\i,\s?onSelect:\i\s?\}\s?=\s?\i/,
            replace: "let {selectedDuration: a, onSelect: n} = e; a = 3600"

ok so ive done the patch with a bunch of optional spaces and also set a to 3600, this now crashes saying r.useRef isnt a function (spesifically referring to one where A (which is used in the method to determine the original default) = r.useRef(null))

#

am i even patching the right file here?

#

im actually so confused

dusty moth
#

parenthesize the \is you match and refer to them (1-indexed) with e.g. $1 in the replacement

median root
#

like that?

dusty moth
royal nymph
#

remove every single \s

#

discord code does NOT contain any unnecessary whitespace

dusty moth
#

also why not let { onSelect: $2 } = $3, $1 = 3600

median root
#

which replace might work better then seeing as I still get the r.useRef is not a func error

brave burrow
#

and that duration is quite above the limit

median root
#

i just assumed it was in seconds

#

cuz i cant just hold control and click for it to take me to the original function

brave burrow
#

but you have a search, use it

royal nymph
#

set a breakpoint

#

once it triggers you can see every value and jump to definition of functions

dense sand
#

how do i get rid of burning out from coding so quickly duh

#

i cant even focus on a project for mor than 1 day

median root
#

do projects ur actually intrested in

#

or give urself a motive

dusty moth
#

licensing question

#

can I use lgpl code in mit code (with credit)

elder scaffold
#

not illegal if no one notices trolley

median root
#

THAT WAS THE RIGHT PATCH

#

its visually right now

spark tiger
#

now make it support custom values godo

median root
#

is it just a $self.settings or sum?

cerulean plover
median root
#

ah thanks

dawn ledge
cerulean plover
#

yop

dense sand
#

can someone help me? im trying to use swayfx to set a wallpaper, but after reloading i still see the gray one

#

if i try it directly i get:

dusty moth
dense sand
#

well anyways using "*" would make it execute the command

dusty moth
#

otherwise it expands to all files in your current directory

dense sand
#

but nothing really happens

#

i still get shitty gray bg

dusty moth
#

hmm

#

what WM?

dense sand
#

swayfx

dusty moth
# dense sand swayfx

read -p "Wallpaper path: " && swaymsg -s $SWAYSOCK output DP-3 bg "$REPLY" fill

dense sand
#

DP-3 replace with my monitor i suppose

dusty moth
#

yes

#

i googled the command

#

(and changed the hardcoded path to read but still)

dense sand
#

didnt do shit

#

imma just ask on their discord

#

ayy i didnt have swaybg installed

median root
cerulean plover
dense sand
#

im looking for something that i could showcase on my cv though rn

#

something which interviewers might find valuable/interesting

#

like yes, rest api is cool and all, but everyone does that

#

(it should be something in TS or Java/Kotlin)

median root
#

so understanding how everything comes together

dense sand
median root
#

well it has to be sum that intrests you so i cant really tell you

valid jetty
#

it shows you have the ability to work on a larger-scale project, that you know how modern programming languages work on a deep level, and that you understand how to use the language you used to make your own language to its fullest extent

dusty moth
#

see rustc, javac, g++, etc

valid jetty
#

there’s surely still a bootstrap compiler written in another language

dawn ledge
#

javac husk

valid jetty
#

i wonder how an OOP compiler would look

#

class AddExpr extends BinOpExpr
class BinOpExpr extends Expr
class Expr extends BaseExpr
class BaseExpr extends TokenStream
class TokenStream extends Token

#

horror

dawn ledge
#

ah yes inheritance

#

horror

#

this is why i like rust

#

traits ftw

valid jetty
#

traits are literally the definition of composition

#

like they are literally just composition as a language feature

#

and i’m all for it

#

i love it

fleet cedar
frosty obsidian
#

i mean interfaces are pretty much the same thing

dense sand
#

Does anyone know how to use serviceloader here

fleet cedar
dense sand
#

I'm looking for a way to scan for classes implementing certain interface on runtime

#

I could use BufferedReader and Class.forname, but i dont think its that effective

fleet cedar
#

You can scan every class, yeah (that's what minecraft mod loaders did ages ago, or at least all classes starting with mod_)

#

But that's not a particularly great way to do it

dense sand
#

exactly

#

thats why i dont want to do that

fleet cedar
#

ServiceLoader requires implementations to explicitly list their classes in META-INF/services/fully.qualified.ClassNane

dense sand
#

yep

fleet cedar
#

Or in module-info.java but I never got that one to work

dense sand
#

yeah i did

#

but its still pain in ass

#

I kinda want to do this step automatically, so you dont have to write the class reference anywhere, you only implement an if and it will be automatically picked up

fleet cedar
#

You could have something in the gradle scan for classes and generate the meta-inf

dense sand
#

hmm yes plugin, already got that idea

#

is there any way to change the way the instantiation of the implementation classes work?

#

like which constructor to pikc?

fleet cedar
#

Huh, serviceloader gives instances, not classes

dense sand
#

yes

fleet cedar
#

I don't think so, sadly

dense sand
#

well thats a pity though

fleet cedar
#

You can of course have the plugins have a method with arguments that gives the real implementation

#

But that's boilerplate

dense sand
winged mantle
#

(e.g. inheritence)

dense sand
#

does anyone know how can i get mpd working with spotify?

dense sand
#

oh nice

#

cant rtfm 😭

dawn ledge
#

lol

#

happens

ionic lake
#

his eyeballs twitching like that gets me 😢

dense sand
fleet cedar
#

Java is lovely

valid jetty
#

this is why i love java

deep mulch
#

john java

#

that is one of my disliked things about java with its primitive and boxed types

valid jetty
#

aren’t primitives supposed to be instances of the primitive’s class

#

and isn’t int.class Integer?????

fleet cedar
#

isInstance takes an Object, so the 1 is autoboxed

valid jetty
#

oh

#

horror

fleet cedar
#

No, int.class and Integer.class are different things

valid jetty
#

…….

dense sand
#

java if generics accepted primite types:

valid jetty
#

i would imagine java is a pain to actually use

fleet cedar
#

Oh, it is

valid jetty
#

i haven’t used it but i know how to program with oop so i just need to know the syntax

#

but from what i’ve heard it’s so bad

dense sand
valid jetty
#

i’ve taken a big break from programming to focus on other things lol

#

i’ve decided i’m not gonna take CS or maths at university so

#

i’m gonna take fashion and design my own gothic lolita dresses

dense sand
#

ive decided i need to take break from life to focus on coding

#

i was too much living

#

i was compltely fine, then i changed my life a bit to "start living more" and became suicidal lol

#

back to the old days we go

deep mulch
deep mulch
valid jetty
#

i doubt i’ll be coming back to the extent of working on elle lol

#

i’m having a full on personality crisis

ionic lake
#

are you ok

#

you can message if you want to talk

royal nymph
dense sand
#

holy shit its asuka

royal nymph
#

not the best not the worst, just average

dense sand
#

every language was designed in some way, you cant just say that java is bad because its verbose -> java's point was to be verbose

hollow yoke
#

anyone know how to target the "is typing" message? its very specific but i wanna see if it can be moved to the bottom right of the screen through CSS

frosty obsidian
#

the verbosity was just a design decision

dense sand
#

yes but it was still intentional

fleet cedar
#

Not every point was carefully thought out, some were just what was popular in that era

frosty obsidian
#

and people can dislike an attribute of a language

#

enough people were frustrated with the verbosity of java that we got kotlin

dense sand
#

they just wanted python in jvm

#

/s

timber root
#

where it wants me to put ";"?????

fleet cedar
#

In what language? Js?

timber root
#

yes

fleet cedar
#

After the int probably

timber root
#

wait

#

i forgot this is js

#

i was writing in wrong language lol

#

thank you

timber root
dense sand
#

haha

valid jetty
dusty moth
dense sand
#

just use typescript tbh

#

fr when typescript native support in browsers >:(

timber root
dense sand
#

how is this even possible

#

Class is final

dusty moth
dusty moth
#

is there a saner way to match a field that may or may not exist?

fleet cedar
#

If you have an enum variant with multiple fields, consider extracting it to a struct

fleet cedar
#

Probably?

calm ruin
#

Doesnt it work

shy mauve
#

I have this and which is meant to only display "uptime" once but when i run the code it displays it twice

#

And i specify it to be blue

#

But i get both red and blue

#
DDDD   CCCCCCC           .buzzzzy
D   D  CC                Version: 1.10.5 ~ 88e8fa7e - Oct 29, 2024
D   D  CC                Client: Stable ~ Desktop v0.0.323
D   D  CC                Build Number: 339221 ~ Hash: 3687267
DDDD   CCCCCCC           Platform: macOS (MacIntel)
                         Uptime: Uptime: 334s

                         ███████████████████████████

#

Striped down venfast for those that are in servers that ban all mentions of mod clients

fleet cedar
#

Probably there's something that prints ${red}Uptime:${reset} ${uptime} somewhere else

shy mauve
#

The only thing i have referancing to red in the script is this which is for (2nd pic), it has nth to do with text color

fleet cedar
#

The colors are irrelevant

shy mauve
#

Do you want the full thing?

fleet cedar
#

Try changing the ${blue}Uptime to HELLO WORLD or something

shy mauve
#
DDDD   CCCCCCC           .buzzzzy
D   D  CC                Version: 1.10.5 ~ 88e8fa7e - Oct 29, 2024
D   D  CC                Client: Stable ~ Desktop v0.0.323
D   D  CC                Build Number: 339221 ~ Hash: 3687267
DDDD   CCCCCCC           Platform: macOS (MacIntel)
                         Uptime: HELLO WORLD: 9s

                         ███████████████████████████

#

So uptime is predefined?

#

But i don't know where, this code isn't fully mine

fleet cedar
#

Uptime is clearly somewhere in your code

shy mauve
#

These are the only 3 mentions of it in the code

#

I don't understand where it can get defined

#

Other than

fleet cedar
#

Maybe it uppercases the object keys

shy mauve
#

Can you show me

#

I'm unfamilar with the term

fleet cedar
#

You're the one with the code

#

And the one who cares

shy mauve
#

Do you mean UPTIME?

#

Uppercase it?

#

I js never heard of the term object key before

fleet cedar
#

Try changing the uptime: to something else and see where it crashes

shy mauve
#
DDDD   CCCCCCC           .buzzzzy
D   D  CC                Version: 1.10.5 ~ 88e8fa7e - Oct 29, 2024
D   D  CC                Client: Stable ~ Desktop v0.0.323
D   D  CC                Build Number: 339221 ~ Hash: 3687267
DDDD   CCCCCCC           Platform: macOS (MacIntel)
                         NONO: HELLO WORLD: 9s

                         ███████████████████████████

#

O

#

I see what's the issue

#

Lemme try smth

#

Good idea, i shouldve thought differently

#
DDDD   CCCCCCC           .buzzzzy
D   D  CC                Version: 1.10.5 ~ 88e8fa7e - Oct 29, 2024
D   D  CC                Client: Stable ~ Desktop v0.0.323
D   D  CC                Build Number: 339221 ~ Hash: 3687267
DDDD   CCCCCCC           Platform: macOS (MacIntel)
                         NONO: : 9s

                         ███████████████████████████

#

Nvrm

#

Can i make the object key not present, make it non existent. Bcs it seems that whatever is between blue and reset also appears

fleet cedar
#

You can change the code to do whatever you want

shy mauve
#

I changed
str += ${" ".repeat(25)}${t(line[0])}: ${line[1]}\n;
to
str += ${t(line[0])}: ${line[1]}\n;

#

And it worked

#
DDDD   CCCCCCC           .buzzzzy
D   D  CC                Version: 1.10.5 ~ 88e8fa7e - Oct 29, 2024
D   D  CC                Client: Stable ~ Desktop v0.0.323
D   D  CC                Build Number: 339221 ~ Hash: 3687267
DDDD   CCCCCCC           Platform: macOS (MacIntel)
                         Uptime: 80s
                         ███████████████████████████

#
DDDD   CCCCCCC           .buzzzzy
D   D  CC                Version: 1.10.5 ~ 88e8fa7e - Oct 29, 2024
D   D  CC                Client: Stable ~ Desktop v0.0.323
D   D  CC                Build Number: 339221 ~ Hash: 3687267
DDDD   CCCCCCC           Platform: macOS (MacIntel)
                         Uptime: 83s
                         ███████████████████████████

#

Honestly fire

#

Thank you, i do appreciate it

dawn ledge
dense sand
#

whoever is familiar with tw/css in general, i want to make fancy shaking(rotating) animation on hover, but it stops when its done and then continues, is there a way to do it seamless?

fleet cedar
#

If you don't want it to repeat, why did you set it infinite

dense sand
fleet cedar
#

ease-in-out makes it slower at the start and end

dense sand
dawn ledge
#

well the problem is

fleet cedar
#

Set it to linear if you want it linear

dense sand
#

i dont think its an easing problem

#

oh it is

#

lol

dawn ledge
#

that you're going from 0deg (100%) -> 0deg (0%) -> 15deg (25%)

dense sand
#

i set it to linear and it works now?

#

BUT

#

can i set easing for a specific keyframe?

fleet cedar
dawn ledge
#

make your last keyframe -15deg and only use 3 keyframes

fleet cedar
#

If 100% is not the same as 0%, you'll get ugly jumps when it loops

dawn ledge
#

does it not ease

#

i hate web dev

fleet cedar
#

Unless you have animation-direction: alternate it jumps straight from 100% to 0%

dawn ledge
#

alternate then

#

smh

fleet cedar
#

You could set it to from: -15deg, to: 15deg with direction: alternate, yes

#

That'd do about the same as your current one I think

#

Possibly with an animation-delay if you want it to start in the middle

dense sand
fleet cedar
#

That will likely look uneven af

dense sand
#

it works

#

but no easing

#

:(

#

i mean it looks a bit wonky

fleet cedar
#

That'd loop like this I think

dense sand
#

so how would you solve it?

fleet cedar
#
@keyframes shake {
  from { transform: rotate(-15deg); }
  to   { transform: rotate(15deg); }
}

.shaking {
  animation: shake 1s linear infinite alternate;
}
dense sand
#

i mean it works, but because i set it on hover it kinda does some weird shit because it moves to the -15deg

fleet cedar
#

You can add an animation-delay: -0.5s

#

Or you can just do ```css
@keyframes shake {
0% { transform: rotate(0deg); }
25% { transform: rotate(-15deg); }
50% { transform: rotate(0deg); }
75% { transform: rotate(15deg); }
100% { transform: rotate(0deg); }
}

dense sand
#

babe wake up, new tsoding video just dropped

azure egret
#

ok, im trying to make a plugin that shows images from my CDN with a command, but i want the command to show the images and gifs from my CDN like /gif would, how can i achieve this?

inner bone
#

Is it possible to set a reaction to a message using its ID in the Vencord API?

balmy lintel
dusty moth
fleet cedar
#

Do you have some sketchy derive on that?

dense sand
#

does anyone know if i can anyhow access this?

royal nymph
#

WEBSTORM

#

oh wait

#

it's kotlin

#

it was looking a lot like chrome devtools api LMAO

royal nymph
dusty moth
royal nymph
#

you can just access this$0 in ur code XD

#

but i hope u know that's hacky as fuck

pearl stagBOT
dusty moth
#

i'm committing more programming sins

dense sand
royal nymph
#

those are perfectly valid identifiers

#

kotlin doesn't like $ tho u gotta wrap in `

dense sand
#

i see

deep mulch
dusty moth
#

tip: cargo hack check --feature-powerset &| grep 'generated' | grep --only-matching -P '\d+' | paste -sd+ | script -qO /dev/null -c python3 | grep --only-matching -P '\d+' | tail -1 to get the total number of warnings for all of your crate's feature combinations

deep mulch
#

oh

#

someone already answered

#

if it's public then it's just straightforward but if it's private then horror

royal nymph
#

it's usually (always?) public

dusty moth
deep mulch
#

no

royal nymph
#

reflection exists

deep mulch
#

husk

dusty moth
dense sand
deep mulch
royal nymph
dense sand
dusty moth
royal nymph
#
class Foo {
  private String flag = "djsajkdsikdspokdoskp";
}

// some other class

var flagField = Foo.class.getDeclaredField("flag");
flagField.setAccessible(true); // if you're on JVM, the SecurityManager might disallow this, usually if the class comes from jvm internals
var flag = flagField.get(new Foo());
royal nymph
dense sand
dusty moth
#

hmm technically could minecraft fabric be wrapped around aliucord

#

iirc people have got it working with non-minecraft java games before

#

i think quilt is more for that use case though

dense sand
#

that actually sounds really cool

#

mixins in android apps

#

what a great invention

royal nymph
#

Aliucord is just a shit ton of reflection

dense sand
deep mulch
dusty moth
#

eventually someone will get minecraft running in it

#

then you can just load mods as plugins

deep mulch
royal nymph
dense sand
#

floader is made to be compatible with anything

dusty moth
dense sand
#

would there be any reason to try to implement that if bunny already exists

dusty moth
#

but bunny has been highly unstable from my experience

#

this is the third time it's cleared my plugin list this month

dense sand
#

bunny's been working quite well for me

#

but i dont use any plugins lol

dusty moth
#

and i can't exactly ask for support

royal nymph
#

zeet is scared of react native

deep mulch
#

ypp

frosty obsidian
royal nymph
deep mulch
#

react native discord always feel sluggish

royal nymph
dusty moth
#

the only problems with aliucord i've had is slow launch (prob messagelogger, but i'm working on a cross-platform messagelogger that's faster) and no backports (which I'll work on next)

dense sand
#

okay this might be a stupid question, but why java at all if discord phone app is built in react native

dusty moth
frosty obsidian
#

back when it was a native app

deep mulch
#

yop

dense sand
#

ah i see

#

how old is that version

deep mulch
#

126.21 at least a year maybe two

dense sand
#

i fucking hate intellij plugin sdk

#

such a mess

deep mulch
#

what are you making

dense sand
#

intellij plugin

#

like a bytecode viewer

#

i made something similiar in past in javafx but dropped it

#

atleast its not memory leak finally

deep mulch
#

I steal your most precious memories

dense sand
#

sure, you wont find anything besides pain though

#

for real, i must get an intership at jetbrains when i will be at uni

valid jetty
#

@shadow vigil is it just me or is slider feedback really bad on 120hz

#

wrong channel oops

deep mulch
#

Goodbye Rosie tosie

lost pawn
#

why doesn't vencord export react's context hooks along with the other ones?

ornate quiver
#

@deep mulch zootie tootie

deep mulch
nimble bone
#

@deep mulch zing zong

deep mulch
azure egret
dense sand
#

anyone selfhosting supabase here? how do i access auth settings? going to /settings/auth will redirect me to home

valid jetty
#

@dawn ledge @fleet cedar

fleet cedar
#

Why cowsay

supple whale
#

is there any starter guide for how to dev for vencord?

#

when i look at the regex shit i shiver

jade stone
#

thanks code mirror

dusty moth
#

but that type is actually inhabited

formal belfry
#

Code

fleet cedar
formal belfry
#

javascript with types

formal belfry
dusty moth
#

so yeah this type is inhabited

#

the recursive cases are Extension → { extension: Extension } → Extension and Extension[] → Extension

#

but the latter is also the base case, as ∀T. [T] due to empty arrays

#

therefore [], { extension: [] }, and [[], { extension: { extension: [[], [[]], { extension: [] }] } }] are valid extensions

fleet cedar
#

Congratulations you have invented set theory

deep mulch
#

@jade stone hi

dense sand
celest lodge
#

:D

shy mauve
#

I don't think it's that big to go in the main dev channels but how do i patch stuff

shy mauve
#

Like in general

#

How do you learn to patch things

#

Like where do you start

dense sand
#

normal files, binary files???

shy mauve
#

For example in blurnsfw, how do you even come around to patching

#

How do you find the things that you wanna maniplulate

dense sand
#

browse dom idk

shy mauve
#

Dom

#

What's that

#

😭

dense sand
#

well learn html and javascript before >_>

shy mauve
#

😭

#

Yeah

dusty moth
shy mauve
#

A ha

#

Alr

#

Thank you

jade stone
#

am i crazy or there any uses for extending Object

#

isnt that implicit

dusty moth
#

but in typescript interfaces implicitly inherit {} iirc

#

well, they don't really inherit at all

#

the extends clause just adds a & bound

jade stone
dusty moth
#

the type {} and value {} are different

#

interfaces only exist at type-level

jade stone
#

also

#

interface a {}

#

is anothing not null or undef

#

and everything extends object

#

so its the same thing

dusty moth
#

i'll send a ts playground when I get home

jade stone
#

@dusty moth it seems that you're just wrong

object vs. Object
TypeScript has another type called Object with the letter O in uppercase. It’s important to understand the differences between them.

The object type represents all non-primitive values while the Object type describes the functionality of all objects.

For example, the Object type has the toString() and valueOf() methods that can be accessible by any object.

dusty moth
#

ah yes i am

jade stone
#

The empty type {}
TypeScript has another type called empty type denoted by {} , which is quite similar to the object type.

The empty type {} describes an object that has no property on its own. If you try to access a property on such an object, TypeScript will issue a compile-time error:

dusty moth
#

was thinking about value-level extends

jade stone
dusty moth
jade stone
dusty moth
#

objectObject{}object

#

the holy trinity

jade stone
#

from lib.es5

dusty moth
dense sand
jade stone
jade stone
#

or type

dusty moth
#

something that satisfies Object but not object?

#

Objectobject{}

jade stone
#

object is non-primitive

#

Object and {} as types are equal

dusty moth
#

wait no

#

the thingies are backwarx

#

backward*

#

rip my reception

#

2 satisfies {} and Object but not object

#

Object.create(null) satisfies {} but not Object

#

well, it should — if not, it's a typescript bug

jade stone
#

Object.create(null) satisfies {} but not Object
well, it should — if not, it's a typescript bug
intended iirc

spark tiger
#

u good?

nimble quail
#

learned how to use multiprocessing

#

managed to close it properly instead of hard killing

nimble quail
#

intended behavior achieved

north harbor
#

Open shortcut menu on vencord with ctrl+/ and then paste this into console:

(async()=>{
    // Change this array
    // 0 is a low pitch eletric guitar like sound
    // 1 is a high pitch eletric guitar like sound
    // 2 is a different high pitch eletric guitar like sound
    // 3 is a different low pitch eletric guitar like sound
let music = [
        50, 0, // Time, arrow id
        50, 1,
        50, 2,
        50, 3,
        50, 0,
        50, 0,
        50, 0,
        50, 0,
        50, 0,
        50, 0,
        50, 0,
    
    
    ];
    
    const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))
    let arrows = document.querySelector(".ddrArrows_ad95dc").children
    console.log(arrows)
    for(let i = 0;i<music.length;i++){
        console.log(i, music[i], music[i+1])
        await sleep(music[i])
        if(music[i+1]!=-1)arrows[music[i+1]].click()
        i++
    }
})()
#

it plays yee ol' music

#

i was too lazy to make a music editor tho

dense sand
#

hey guys, if i have usestate in react:

const [bullets, setBullets] = useState(5);

whenever i setBullets bullets - 1, the code seems to be ran twice, why is that?

#

in production, this doesnt seem to be happening though

#

its in a dom listener if it helps anyhow

elder scaffold
dense sand
#

its being set like this:

setBullets((prevBullets) => {
  if (prevBullets > 0) {
    // Do things
    return prevBullets - 1;
  }
})
elder scaffold
#

i mean i dont think it should cause problems but you said it doesnt happen in production

dense sand
#

thats indeed right

#

but its kind annoying you know

dense sand
#

in dom event listener

elder scaffold
#

do you mean document.addEventListener or <button onclick=... /> ?

dense sand
#

which is wrapped in useeffect

#

first

elder scaffold
#

strictmode runs effects twice

#

so your listener is being added twice

#

youll need to clean it up properly

dense sand
#

i wonder if this is enough or do i need to reference the exact function?

elder scaffold
#

i think you need to match the function

dense sand
#

oh ur true

#

right it work

fleet cedar
#

removeEventListener'ing with a different function object is no good

dense sand
#

ty guys

elder scaffold
#

ie.

function handleClick() {
  console.log("asd")
}

// add listener
document.addEventListener("click", handleClick);

// cleanup
document.removeEventListener("click", handleClick);
dense sand
#

yes yes

royal nymph
#

strict mode deliberately runs everything twice in development mode to make sure your code is correct

#

if you're handling state incorrectly or not properly cleaning up, it will cause weird behaviour

fleet cedar
#

Which is exactly the point of strict mode

valid jetty
#

you must not only match the function behaviour wise but also reference wise

#

() => {} !== () => {}

#

you must use the exact reference you used when registering the listener

deep mulch
#

@frosty obsidian you

#

im kind of thinking of adding gui to my logcat program

#

but

#

idk if i should keep tui or drop it

frosty obsidian
#

do whichever you like more

supple whale
shadow gust
#

luauauauauauau

#

cool language programming

deep mulch
#

nop

true palm
#

Hey! I hang out a lot on a public League of Legends server, and I usually block people who are annoying, etc. The issue I’m running into is that once someone is blocked, I can’t tell they’re blocked when they’re in other voice channels. I always mute them as well, so I can see the muted symbol next to them before joining a voice channel.

I've noticed that when I search for people to block (in the top right), I can’t right-click to "mute" them, only to block them. In chat, too (screenshot attached), I can block but not mute.

I’d love to try coding a "plugin" or something to handle this, but I’m not sure how to get started. I also noticed that #🧩-plugin-development isn’t accessible, and I don’t have permission to post there - is that intentional?

Would anyone be able to help me get started? :)

true palm
#

Thanks

balmy lintel
true palm
#

Eh i didnt seem to notice that.
What I noticed is that I can right-click a user (blocked or not) on the member list on the right, and mute them
But not when I search for a user using id or message.

balmy lintel
#

im pretty sure there was a plugin for that

#

vp fullsearchcontext

elder yarrowBOT
balmy lintel
#

i assume that's what you mean?

true palm
#

no I have that plugin.
Here this is what I mean:

I can search you in the serverlist on the right: and mute you

#

but when I search for you in the search menu

#

I dont get the option to mute you

balmy lintel
#

ah- yeah that only applies to the message context menu

#

unfortunate

true palm
#

thats what I am trying to achieve but i have no clue abt vencord plugin dev haha

balmy lintel
#

if you have some knowledge of typescript & react, check the channel pins of #🧩-plugin-development, lots of helpful stuff there

dense sand
#

if you're handling state incorrectly or not properly cleaning up, it will cause weird behaviour
atleast good to know lol

royal nymph
#

I thought u meant Firefox

nimble quail
#

today marks the day i move all my program's functions into separate files to unclutter the main

#

coding adventures, episode 3: the autism strikes back

deep mulch
dense sand
#

tldr pls

deep mulch
dense sand
#

no one cares

deep mulch
#

I do

dense sand
#

if i have typescript file with
'use client'
why cant i use localStorage?

#

can i only use localStorage in components?

autumn sigil
#

i dont understand ruby, im trying to set up rails but literally nothing is working lmfao

fleet cedar
#

That's ok, ruby is not for mortal minds to understand

frosty obsidian
#

@deep mulch turns out the tidal api "bug" i experienced was actually caused by me being stupid and not remember-ing the oauth url

autumn sigil
autumn sigil
nimble quail
#

god i hate windows
it worked fine on linux

#

it was FINE

#

i pressed button and it did t hing

#

but now list proxies wont share with child processes graaaah i just want to multiproc in peace

viscid grove
fleet cedar
#

Why is yours not

#

Do you like, have the energy to clean it or something

viscid grove
#

occassionally

#

ahhh i added an extrra s

#

ahhhhhh

#

i added an extrea r

#

ahhhhh i added an e

#

(i did notice that e, but not fixing it was funny)]

#

fuck

royal nymph
#

lmfaoo medium / dev.to writers picked up on some very early js proposal that is already superseded and has never been implemented in js, and wrote articles like it's a real language feature

#
Medium

JavaScript is introducing a new operator, ?=, called the Safe Assignment Operator. This operator is designed to simplify error handling in…

DEV Community

JavaScript developers, there’s a new way to handle errors without relying on messy, repetitive...

#

ai or just dumb I can't tell

dense sand
#

is there any1 familiar with how docker clients talk with the docker socket?

dense sand
#

from what ive seen, docker seems to expose some rest api but im not sure

royal nymph
#

well

#

it's not even an official proposal

#

personal repo

dense sand
#

this is too Go

winged mantle
royal nymph
#

nah smth like this is good

#

i dont like the syntax tho

#
const [data, error] = try await fs.readFile("file.json");
#

better

#

or just try catch expression

#
const data = try {
  await fs.readFile("file.json");
} catch (e) {
  // do smth;
}
dusty moth
#

expression statements are neat

dense sand
royal nymph
dusty moth
dusty moth
#

oh wait no that doesn't work

#

await Promise.resolve(null).then(async () => [,foo]).catch(e => [e,,])

royal nymph
#

thats fucking awful

dusty moth
supple whale
#

cb(err, data)

#

god i have ptsd when i see that

supple whale
#

i'd love this

fleet cedar
#

All languages need to have statements-are-expressions

supple whale
#

idk it feels like hell for switch statements ngl

fleet cedar
#

No it's amazing for switch

#

(Or rather, for match, which is switch but not 70s)

royal nymph
#

but js switch isnt made for that

supple whale
#

i fucking hate switch statements

#

the amt of extra syntax, boilerplate and edge handling

#

EEEEEEEEEEEEEEEEEEEEEE

fleet cedar
#

Me too

supple whale
#

i always just go with a map

#

way simpler

royal nymph
dusty moth
#

Java's switch statements (with ->) are slightly saner

royal nymph
#

explicit break = bad

#

rust has amazing switch

fleet cedar
#

They're a pain to decompile since there's no infallible way to find the end

royal nymph
#
let thing = match foo {
  1 => "one",
  2 => "two",
  3 => "three",
}
#

this is rust switch

#

soooo good

supple whale
#

thats a match

#

that aint a switch

dusty moth
royal nymph
#

it's the same thing

supple whale
#

switch statements are meant to have fall-tru