#🪅-progaming

1 messages · Page 95 of 1

winged mantle
#

java is quite quirky with this

fleet cedar
#

Java's Optional is completely worthless

winged mantle
#

but what if a function which returns Optional returns null

#

eh nobody would ever do that

#

i mean... there's no way anybody would accidentally write return null instead of return Optional.empty()

royal nymph
#

java Optional is crap

#

there's a reason no one uses it

#

java should just add null to the type system and it would be good

#

kotlin fixes this

winged mantle
#

i remember seeing a competent looking project using guice and optional and i felt like such a noob seeing that

#

i don't think i really like annotation magic

#

or any kind of magic

#

unless it's obvious

#

like

@Event
public void onBadThingHappen(BadThing thing) {
    // oh no
}
#

❤️

#

i feel like a GoPro

#

if err != nil

#

i feel like my code is very spacey

#

when in doubt i always put a blank line in between things lol

winged mantle
#

i always use sql directly

split timber
#

I always ask chatgpt

austere idol
#

i had never used it

frosty obsidian
#

don't start

signal oakBOT
spark tiger
split timber
spark tiger
#

hell yea 🔥🔥🔥

split timber
#

Car crash

spark tiger
#

oh fromtheheart too??? baseddd

nimble bone
winged mantle
#

yes

solemn ravine
#

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

nimble bone
#

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

ornate quiver
dense sand
#

Liquid ass

#

Just an apple thing

solemn ravine
broken bear
#

Hey can anyone help me with this

#

I installed vencord the way to get plugins

#

and now it just told me im using an unsupported version

#

and will be banned from reciving help

#

Can anyone help me?

lavish frigate
balmy lintel
#

power users 🔥 🦾

broken bear
lavish frigate
broken bear
#

It wasnt that hard to understand

lavish frigate
#

Yes those are the instructions for a devbuild

#

The official install has an install on vencord.dev/the GitHub page it does not need instructions

broken bear
#

So them why am i being threated to be banned from getting help

#

Like what

lavish frigate
#

You are installing third party plugins which can mess with vencord or your computer

#

If you have problems with vencord it may be caused by those plugins

#

So we don’t give support for that

#

We cannot account for those

#

You are on your own

broken bear
#

okay then there is no problem because i was just worried for that warning

lavish frigate
#

And exactly that’s why we don’t give support either, you have no idea what you are doing and it’s not meant for you and it’s more trouble than it’s worth explaining everything to you

broken bear
lavish frigate
#

Right

broken bear
winged mantle
winged mantle
#

i like the way i try to make my code cleaner and it ends up somehow having 200 extra lines?

#

??

#

where did they come from?

#

every time i make my code cleaner it has more lines

#

true java developer

#

maybe my project needs an entity component system

#

perfection

balmy lintel
#

cleaner code = written by ai

austere idol
#

clean code is a lie

obtuse cipher
#

okay this sounds stupid but how do i add a domain to this stupid list

supple whale
#

webpack my beloved

#

try rspack

#

supposedly its a drop in replacement thats giga faster

#

but its insane just how goood webpack is, and how many cases it handles for you

#

like take dynamic imports, vite stll just doesnt do good dynamic imports

#

and webpack can guesstimate exactly what files u wanted imported and shit just works

#

if you do import(`./data/${name}.json`)

#

webpack will just externalize all json files in the data folder

#

yes a 3rd party plugin

#

indeed

winged mantle
#

not necessarily but i feel worried if most times i try to clean up i end up with more code

#

i did manage to reduce quite a lot of LOC by making some things simpler

native spruce
woven mesa
native spruce
woven mesa
#

both

#

liquid glass and reopen

native spruce
#
@AppStorage("com.apple.SwiftUI.IgnoreSolariumLinkedOnCheck")
private var _ignoreSolariumLinkedOnCheck: Bool = false```
woven mesa
#

no way you can do that

native spruce
#

just did

woven mesa
#

thats so insane

#

i rate it

severe python
#

i added a guthib/donate link to the website for feather

#

i don't know how to put a apple app continuous corner mask in the icon..

woven mesa
#

@native spruce it is so broken

spark tiger
#

i thought they only added it to ipados26 as they only said that during the ipados part in wwdc25

#

why does it show that i had installed it if im first time seeing this lol

severe python
#

i think i could change the colorscheme for the website for feather that im making

#

idk

#

ok i think the website is pretty much complete now

#

i've changed the favicon

celest lodge
#

i write C

#

sometimes

frail turtle
#

me too

#

C

severe python
#

so i use html/css

#

i dont know much about js though

frail turtle
#

C

spark tiger
#

I C

severe python
#

@solemn ravine ok uhh let me know if you want the source code or if you want some adjustments then i'll make them

#

since its complete

stuck gorge
#

I'm trying to get all the participants of a voice channel I'm connected to. I tried looking into ChannelStore but it doesn't seem to have that information... ? Any ideas?

stuck gorge
#

oh that's it: Vencord.Webpack.findStore("ChannelRTCStore").getParticipants(channelId)

solemn ravine
#

ive probably found the worst swift code of all time

frosty obsidian
#

was gonna be mean but decided not to

dense sand
frosty obsidian
#

im too old

solemn ravine
warped jackal
#

fellas, just theoretically speaking, would it be possible (and would it ban accounts because it's too many API requests) to write a userplugin that, when I click on a user that i'm friends with in a server, checks all other users if the user is in each user's mutual friends, therefore telling me who in the server has this user friended? because this information is available, but there is no way to retrieve it unless i'm manually going through every user

maybe to stop api spam the plugin only works if the server has less than 1000 people? idk

woven mesa
#

happens for all stock apps

#

not that it matters its a stub appstore listing that calls the restore method on system app proxies

#

deleting a system app doesnt delete it because its a framework thats a part of ios and the app itself is a stub to load and execute the framework’s entrypoint

#

hence downloading system apps on the appstore just tells ios to bring back the stub

spark tiger
spark tiger
#

🏳️‍⚧️ microsoft

lavish frigate
spark tiger
austere idol
#

i want to make an os kernel with just one c source file

dense sand
#

Ok

severe python
#

lol

supple whale
#

HOW CAN VITE NOT DO JSON IMPORTS

#

HOW DOES IT FAIL AT SOMETHING SO BASIC

#

FUCK YOUUUUU

#

webpack fucking solved this a decade agooooo

supple whale
#

god i hate vite

const viteFixedImportWeTrullyHateViteWithAPassionForNotSupportingBasicFeatures = async <T>(path: string) => {
  // previously: return import('doc999tor-fast-geoip/data/locations.json', { with: { type: 'json' } })
  const res = await fetch(`/geoip/${path}.json`)
  return await res.json() as T
}
ornate quiver
#

I wish I knew about it earlier

dense sand
#

Could anyone here help me write a github workflow to find all Dockerfiles and build them in a matrix

#

Like i have no clue how to do this

#

I got something, but it doesnt work

dense sand
#

Wait typi

#

Typo

#

I meant github obviously

ionic lake
#

find all dockerfiles? is this random and not something specific?

dense sand
#

I want to automate builds

#

I can send you what i have but give me like 15 mins im in bus

dense sand
#
name: Deploy Docker Images to GitHub Container Registry

on:
  push:
    branches:
      - main
      - ci/deploy-ghcr # Testing branch for deployment

jobs:
  define-matrix:
    runs-on: ubuntu-latest
    outputs:
      image_names: ${{ steps.set-matrix.outputs.image_names }}
    steps:
      - name: Find Dockerfiles and set matrix
        id: set-matrix
        run: echo "image_names=($(find . -name 'Dockerfile'))" >> "$GITHUB_OUTPUT"

  build-and-push:
    runs-on: ubuntu-latest
    needs: define-matrix
    strategy:
      matrix:
        dockerfile: ${{ fromJson(needs.define-matrix.outputs.image_names) }}
    permissions:
      contents: read
      packages: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Log in to GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Build and push Docker image
        run: |
          IMAGE_NAME=$(basename "$(dirname "${{ matrix.dockerfile }}")")
          IMAGE="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest"
          docker build -f "${{ matrix.dockerfile }}" -t "$IMAGE" .
          docker push "$IMAGE"

ehh but i have no clue how this actually wokrs

supple whale
#

which then makes it impossible to exclude from caching

#

also I'm importing from a dependency, not my own data

native spruce
#

@woven mesa HOW DO I MAKE HOMESCREEN LOOKING COLLECTIONVIEW WITH PAGING

native spruce
#

@woven mesa crying it looks so bad and I cant scroll or drag

woven mesa
#

guhh

#

@native spruce send code

native spruce
#

its just a normal collectionview

supple whale
#

the 1 mf in the middle of the ocean watching anime

woeful zinc
#

Or swimming

#

Depends

supple whale
#

nah thats hawaii

#

but still xd

woeful zinc
solemn ravine
#

it sucks rn

severe python
#

@solemn ravine i added korn to the website for feather

#

actually i think i should change the font to nunito and use fira code for code

#

looks uhh kinda better now

spark tiger
dense sand
#

Anyways i fixed it already

spark tiger
#

nice

supple whale
#

like lithium or phosphor

severe python
spark tiger
#

why is the logo a square 😭

frosty obsidian
#

@solemn ravine i don't think this would work

spark tiger
#

gmake

#

wait gmake is actually a thing wtf

#

how many makes do they have 😭

royal nymph
#

most systems use gmake as make so they'll be the same, but some systems use other makes

#

it's like how there are different standards for /bin/sh

#

on most distros it's just bash, but some other distros may use dash or other shells for it

spark tiger
#

why are you gnu

royal nymph
#

make was originally made ages ago at Bell Labs

#

over the years people made different mostly compatible implementations but with their own extensions, like GNU make added conditionals

#

like pmake/bsd make, gnu make, dmake

#

there's also nmake, Microsoftslop

frosty obsidian
#

veemake

royal nymph
# royal nymph it's like how there are different standards for `/bin/sh`

you usually use sh if your script is "posix compliant" aka will run on any good shell

but if you use bash specific features you explicitly use bash instead

it's very similar with make, if you use make you should make sure your Makefile is compliant will all implementations. if you use gnu specific features, it's better to explicitly use gmake (or pmake if you're using bsd features)

frosty obsidian
#

vee going on a nerd yap

royal nymph
winged mantle
solemn ravine
solemn ravine
solemn ravine
frosty obsidian
#

No such file or directory

royal nymph
#

why is make not just a symlink to gmake

#

😭

solemn ravine
#

also funnily enough gnumake exists

#

which is just a copy of make in the same protected area

royal nymph
#

😭

#

why is it in a "protected area"

#

why is apple so insane

#

hop on linux....

solemn ravine
#

and a lot of the tools it comes with is from like 2006 wires

severe python
#

😭

solemn ravine
#

I guess it doesn’t need updated stuff but it kinda sucks, at least there’s options to get newer stuff

severe python
#

i don't really know how to put apple's app mask thingy on it

#

could make it rounded tho

solemn ravine
#

you know it’s so old when the make it comes with doesn’t support multithreading

spark tiger
#

INSANE

solemn ravine
warped jackal
#

me when i want to pnpm install --frozen-lockfile and it doesn't let me download because i didnt run pnpm config set strict-ssl false and i waste 20 minutes of my life:

solemn ravine
#

@royal nymph your dumb bot breaks with new pnpm

#

gotta add a couple lines in workspace…

severe python
solemn ravine
#
onlyBuiltDependencies:
  - better-sqlite3
  - canvas
  - esbuild

+ packages:
+  - .
royal nymph
solemn ravine
solemn ravine
#

weird arbitrary changes smh

jade stone
#

i love typescript

#

es2026
available since 2022
what did they mean by this

#

like it's not even in typescript yet

jade stone
#

cursed typescript my beloved

#
export function TAssert<T extends {}>(value?: T): asserts value is T {
}
austere idol
royal nymph
ionic lake
#

use xmake

austere idol
#

what are general rules?

nimble bone
#

unironically nix may be a good solution to that

#

only other good use case

#

@royal nymph make nix fork called Vix and uses a sane language

jade stone
#

how does ts-expect-error even work in types

if typescript runs into an error, how can it evalualate the type

#

wouldnt that just default to any and be worthless

#

then you should type it that way

#

by using ts-expect-error you're obfuscating the reality

#

people could think that that branch is typed

#

if a branch is impossible to reach, then never should be used

that's one of the intended uses of never

#

i think we will have to disagree on this blobcatcozy

supple whale
winged mantle
jade stone
#

rename folder in git, only change caps
git for windows doesn't recognize any change because windows doesn't recognize case in filenames
CI fails because path not found

I LOVE WINDOWS I LOVE WINDOWS crazy_fucker crazy_fucker
||might be a config issue, but if it is, the defaults should be better||

frosty obsidian
#

i think thats just a skill issue

supple whale
#

i have a lint rule for this exact problem

frosty obsidian
#

thats smart actually

royal nymph
#
git mv --force Balls.java balls.java
#

or just rename twice and git add inbetween the renames
Balls.java -> jhisdasjidjijdias.java -> balls.java

winged mantle
#

just spent ages googling to realise my problem was caused by not saving a file

#

i used to complain about intellij automatically saving files

#

but there are so many issues i've had from forgetting to save them

#

😭

#

i think i just like the satisfaction of pressing ctrl+s

jade stone
winged mantle
#

i was searching for a postgres library called pgx

#

and i accidentally clicked the wrong thing

royal nymph
#

it's the same file

winged mantle
#

why do duckduckgo results shuffle

#

😭

royal nymph
#

hop off windows if you don't want case insensitive files

winged mantle
gilded surge
#

windows considers it the same file

#

so nothing for git to see and push

jade stone
#

idk why everyone is saying that windows considers it the same file

#

that is the default behavior, but you can make it case-sensitive

royal nymph
#

I feel like making windows case sensitive is just asking for trouble

jade stone
royal nymph
#

much like how making Linux case insensitive would also be asking for trouble

jade stone
#

yes, however using it to detect if a folder has been renamed in a case only way is a valid use case for this

royal nymph
#

you can create a case sensitive drive but making your C:/ case sensitive would be insane

jade stone
#

you aren't touching any files

royal nymph
#

just make a separate case sensitive partition for your coding folder blobcatcozy

jade stone
#

drive letters are hard case-insensitive

royal nymph
#

or hop off windows

winged mantle
#

if you rename the case of a filename that is observable

jade stone
#

networking drivers still borked

royal nymph
#

just use lan love

jade stone
#

on top of tons of others that i don't know about yet

jade stone
royal nymph
#

I used to have WiFi problems on Linux cause this stupid WiFi USB adapter I bought is an unstable piece of garbage on Linux so I just switched to using LAN

royal nymph
#

the kernel one had really slow speeds
the catgirl one had full speed but it would regularely just crash for whatever reason

jade stone
#

hopefully qualcomm will get their shit together and we'll get working wifi drivers

royal nymph
#

it was some tplink / realtek slop

#

I mean it's my own fault for buying an adapter that doesn't even officially support Linux

#

I just bought the amazon bestseller cause I was lazy blobtranscozy

winged mantle
#

🇵🇱

jade stone
#

MDN INSANE

WHO DESIGNED THIS SHIT

#

need to know the currently focused element
focusin event

#

shit, safari only

#

reality

nimble bone
royal nymph
solid gazelle
#

Hi

#

how would you do in nodejs

#

to force process exit after 19s

#

but not necessarily 19s if every other task finishes before that

#

if I just do a timeout it'll wait 19s for that timeout >:(

#

been trying dumb things with async_hooks to check if the current timeout is the only pending task but couldn't figure it out

royal nymph
#

you'll have to track your tasks with something like promises

#

then you can do

import { setTimeout as setTimeoutP } from "timers/promises";

await Promise.race([tasksFinished(), setTimeoutP(19000)]);
solid gazelle
#

o

royal nymph
nimble bone
#

vee knows all javascript

spark tiger
#

hop on C++ tag

#

get rid of yo RUST tags

solemn ravine
#

OBJC TAG

dense sand
supple whale
austere idol
#

do your service/app/software supports filenames with newlines?

supple whale
supple whale
#

i never used the promises timeout so im actually not sure xD

ionic lake
#

no you dont need to

#

it unrefs on its own

supple whale
#

huh

#

since when

#

i remember i always had an util for timeout which was

export function setTimeout(...args) {
  const res = setTimeout(...args)
  res.unref?.()
  return res
}
ionic lake
#

is this classic settimeout

supple whale
#

yeh

#

does timers/promises handle that for u?

ionic lake
#

yeah it should

#

hopefully

royal nymph
#

no you still have to

#

but i mean I was assuming they'd just process.exit() as soon as the first finished

supple whale
#

ah i read that code as "yeah there's nothing else to run so nodejs auto exits"

spark tiger
lavish frigate
#

The fuck is actix web

#

Also seems like it just lists the most popular options

spark tiger
#

it’s that guy who tweeted this if you’ve seen it

lavish frigate
#

😭😭

#

Yeah I have

#

Do you have internet or wifi

spark tiger
#

wifi

fleet cedar
spark tiger
ionic lake
#

you assemble components like askama for templating alongside it

spark tiger
#

pretty sure actix is not even the best lmao

#

i mean what else u except from this guy

ionic lake
#

actix is fairly popular but everyone using tokio is on axum anyway

spark tiger
#

can’t believe they’re consuming ai slop 😭

winged mantle
#

i literally have had many laptops lik ethis

#

what's the joke

shrewd canopy
#

bro must have forgor to prepend "Microsoft" before java

frosty obsidian
#

dude knows three sentences

spark tiger
austere idol
spark tiger
#

do you have internet or wifi

austere idol
#

last screenshot

severe python
spark tiger
#

why

severe python
# spark tiger why

because F means that the processor has no integrated graphics and needs a graphics card

#

and the tweet says NIL

#

which means none

spark tiger
#

oh in that case yeah

severe python
#

yeah

austere idol
severe python
austere idol
#

we say either null or NULL

severe python
#

what if you don't like microsoft or use another text editor like neovim

#

guhh

severe python
#

yop

lavish frigate
#

ADVANCED JAVASCRIPT

#

LET

#

CONST

#

VARIABLES

#

sorry beginners NO VARIABLES FOR YOU

austere idol
#
function pi() { return 3.14 }

console.log(2 * pi() * 4)
lavish frigate
#

Sorry but functions in js are first class objects and also very technically variables

formal belfry
#

i dont think Object.defineProperty is a variable

lavish frigate
#

globalThis is also a variable

#

Just a global one

#

Same with Object

formal belfry
lavish frigate
#

Yeah

formal belfry
#

hm

#

i mean

lavish frigate
#

you got me there

#

damn

#

i did not expect that

formal belfry
#

i dont see any variables 🤔 🤔 🤔 🤔

lavish frigate
#

js is sooo insane

formal belfry
#

yeah

#

written in 10 days

#

🔥

hasty vessel
severe python
royal nymph
rugged berryBOT
#

Here is your js(18.15.0) output @royal nymph

hiii
shrewd canopy
royal nymph
glacial mirage
#

/run

1..constructor.constructor`console.log("hi")`
rugged berryBOT
#

Your js(18.15.0) code ran without output @glacial mirage

glacial mirage
#

fuick

#

/run

1..constructor.constructor`console.log("hi")` ``
rugged berryBOT
#

Here is your js(18.15.0) output @glacial mirage

hi
glacial mirage
#

brackets are for nerds

shrewd canopy
austere idol
royal nymph
# royal nymph this is essentially how jsfuck works

using only those few characters, you can get empty string ([]+[]), true (!![]), false (![]), numbers (+false=0, +true = 1, just use addition to get higher numbers) undefined [][0] and NaN (1 + undefined)

we can turn those things into strings to get a bunch of letters, like to get t you do (true+"")[0]

with these letters, we can get new things like []["flat"] which we can turn into a string to get way more letters

and so on, eventually you can get all ascii characters this way (and you can use String.fromCharCode to get any character your heart desires)

then you can just do []["constructor"]["constructor"] to get the function constructor which allows you to create a function from a string (aka eval)

#

it's so funny

austere idol
jade stone
#

GUHHHH

why does window.onmouseout fire on svgs

supple whale
jade stone
supple whale
#

it shouldn't fire for svgs doe?

#

iirc they aren't part of the dom

#

and a lot of shit doesn't work on them

#

it's funky

jade stone
supple whale
#

yep!

jade stone
#

might be because svg isnt an html element

supple whale
#

yep! which is why i was confused by ur msh xd

formal belfry
#

how to instlal the bot?

formal belfry
#

so silly

#

this makes absolutely no sense whatsoever

winged mantle
#

javascrip

lavish frigate
#

its just stupid

formal belfry
lavish frigate
# formal belfry not really no

+2 = 2
Boolean(2) / Boolean(-2) = true
!Boolean(2) / Boolean(-2) = !true
!true = false

!-2+2
!-2 gets evaluated first and !-2 is false
false + 2
false = 0
0 + 2 = 2

lavish frigate
royal nymph
#

only the last one doesnt

#

the last one is just because if js doesn't know how to add two different types together it just turns everything into a string

lavish frigate
# lavish frigate thats how booleans work

everything in a computer is literally just 1s and 0s any data type boils down to 1s and 0s in a specific format
numbers are just binary
words are just bytes mapped to specific characters
booleans are just bits with 0 being false and 1 being true
just 1s and 0s

#

of course a little more complicated than that but yeah

static ridge
#

but it looks like its incomplete

wheat kernel
supple whale
#

jesus electron transparency is problematic

winged mantle
supple whale
#

is -undefined++ 1?

#

also Nan

#

cool

#

undefined isnt 0 number castable?

lavish frigate
winged mantle
#

it feels weird that ++ gives you the converted previous value but ig it makes sense

#

you would've thought that the expression myVar and myVar++ would yield the same result but that's not the case

#

which ig shows that it's really just syntax sugar for (++myVar)-1

royal nymph
supple whale
#

lmao

royal nymph
#

even worse than bootstrap

supple whale
#

imho it doesnt get better than that

#

i think what you mean is you hate people that use shadcn without customizing it at all and leaving everything default

#

which i can agree on

austere idol
lavish frigate
#

its good but people are too lazy to actually style or change the components so all sites using them look the same

supple whale
placid cape
#

@hoary sluice i won some stuff and 400€ with the voice assistant

supple whale
#

MUNI

winged mantle
#

i feel like in a real app you should not use go's built in http server

shrewd canopy
#

you should use net/http

winged mantle
#

i mean you can't even easily customise the method not allowed response

shrewd canopy
winged mantle
#

yea i'm using it for learning as i understand it's good to learn the standard lib

#

but you have to use stuff like http.StripPrefix husk

lavish frigate
winged mantle
#

i also had to create a wrapper to allow returning an error

#

this is such a useful app

placid cape
spark tiger
#

what kinda naming is that

supple whale
#

wtf v0 is now really good?

supple whale
#

as much as i hate ai, this is.... decent

#

its not amazing, but its decent

#

took 22 versions, a lot of manual editing, but its a great tool when u know what u want but suck at design

#

a lot of it is still bad, the code is awful, the icons are bad, the paddings are bad, but that's all correctable

#

so kinda w

lucid trail
supple whale
#

it just uses premade components which are good as a base

#

but that alone puts it leagues ahead of everything else

lucid trail
supple whale
#

i told it to use svelte instead of react shadcn, and holy was it dogshit XD

lucid trail
supple whale
#

"no"

#

you can tell it to use other frameworks

#

but it doesnt do a good job

#

keep it react and port it yourself

#

xD

lucid trail
#

it doesn’t seem good for anything serious

supple whale
#

i mean

#

the moment you start doing custom shit, all AI fails

#

but it did a decent enough job

#

like its defo a good tool, it defo saved me a fuckload of time and effort, and its defo better than what i would designed, but its not perfect, im sure my designer friends which i often ask for help would have beat it

winged mantle
#

I just wish you could disable this

supple whale
#

the temp storage part?

winged mantle
#

yea

#

i just want to parse one file limited to 50kib and error if there are any more

#

this doesn't really achieve exactly waht i want

#

it feels odd to pass in the limit twice

winged mantle
#

unused values being errors feels annoying because it makes me check every time i declare a variable

#

i prefer them as warnings simply due to the colour coding in ides

winged mantle
#

what happened to hastebin lol

#

wow i guess generic pastebin might be handy after all (i was just making it for learning)

wheat kernel
shrewd canopy
#

frontend deserves to be vibecoded 🙏

winged mantle
#

when i see messy code i assume it's python

#

turns out this was go code

#

i think i feel quite bad about python mainly because it's often beginner code

tired vigil
ornate quiver
royal nymph
#

pastebin has always been shit

#

that's why we use gist or hastebin

#

maybe there's a hastebin alternative that isn't dead idk

spark tiger
#

GUYS THERE IS NO WAY

#

I got fired today. I'm not sure why, I personally don't think there is a reason, or that it's important.

When I joined twitter, I joined because of the engineers I met in SF. They seemed happy. They were having fun. Engineers at play. Engineers that were enabled. It was good!

tired vigil
royal nymph
#

LOVE

native spruce
#

@royal nymph open to work

lavish frigate
spark tiger
#

fr

#

acting like he wasn’t the one working on the site 😭

hoary sluice
#

kilo abbreviated wrong

#

common twitter L

spark tiger
lavish frigate
frosty obsidian
spark tiger
frosty obsidian
#

weird world

spark tiger
#

do u mean that cur something

#

whats it name

frosty obsidian
#

manifold

#

name gives me crypto vibes

valid jetty
#

@hoary sluice @placid cape which one

#

its currently a linked list

jade stone
valid jetty
#

well with high loads there’s gonna be a lot of both

runic sundial
#

Linked list.

valid jetty
#

yeah probably idk

runic sundial
#

If you're unsure, focus on making it easy to swap the data structure for another one.

valid jetty
#

at the moment collection happens very often which prevents clogging, and the threshold for collection doubles if > 75% of objects stay alive after collection

valid jetty
runic sundial
#

Yeah. Nothing wrong with it then

#

Is this the slow part of your system?

#

And do you have other parts that need more attention?

valid jetty
runic sundial
#

It's more of like, if you can just do it later

valid jetty
# runic sundial Is this the slow part of your system?

well at one point the threshold was 32 * 1024 * 1024 bytes, which, when that got full and collection was triggered, took a full 5 seconds to complete because it was looping through hundreds of thousands of objects as it’s a conservative gc

#

right now the min threshold is 32 * 1024 which takes only a few ms to collect

valid jetty
#

so considering i switched data structure anyway i thought i might aswell ask which one is the best to switch to

runic sundial
#

Linked list makes the most sense from the perspective of being easy to get right

#

The best one would be a hybrid. And require profiling and tons of measuring to polish it to perfection

valid jetty
#

if you did something as simple as

fn main() {
    x := #alloc(i32);
    y := x + 1;
    x = nil;
}
``` the gc would never find the allocation and would think it’s unreachable
valid jetty
runic sundial
#

Yeah, so a valid way of going about it

valid jetty
#

i did do a little profiling with this linked list approach and it doesn’t seem to have a very big effect on performance

#

as the dips aren’t synced with cleanups (when the object count goes from 32k to 200) the dips are just random system throttling stuff and unrelated

#

at a capped 240fps the collections have 0 effect on performance

#

i did also test with the gc disabled (leaking everything) and the performance was about the same

runic sundial
#

How are you measuring perf?

valid jetty
#

well this is a raylib game that does a bunch of allocations for stuff like iterators to display on the screen so i feel like it’s a better real-world use than just allocating a bunch of things and timing cleanup time

runic sundial
#

This is rust right? So there's gonna be good bindings for tracy and you can have some more scientific flamegraphs.

#

For your GC bits

valid jetty
#

nopee it’s my own compiler

runic sundial
#

Ok

valid jetty
#

but i can generate flamegraphs yes

#

i’ve done that in the past

runic sundial
#

Nah, I'm more saying using a low overhead profiling framework

#

Tracy can give you double digit nano precision

valid jetty
#

i can probably port bindings hmm

#

i’ll look into that thank youu

runic sundial
#

Worked on this a while back, modern MC has tracy built-in but I wanted it on 1.7.10

valid jetty
#

zig 💔🥀

runic sundial
#

Zig was easier for JNI than C

#

In particular for the cross compilation

valid jetty
#

i see

runic sundial
#

And also FalsePattern is the one who made the ZigBrains JetBrains plugin so good test case

runic sundial
#

Ziggy

royal nymph
#

I love ai accounts

nimble bone
#

veeee 😭

ionic lake
#

i thought i was the only one seeing these ai slopcoder accounts

#

someone was saying they're reimplementing tsc in rust and i couldn't believe it

shrewd canopy
#

Or abuse AVX/SSE instructions

winged mantle
#

fiber looks better than go stdlib

#

servemux behaves so weirdly

#

i've had problems where you need trailing / otherwise it returns 404

winged mantle
#

the main issue is servemux but the responsewriter isn't as nice to use as hono or express

runic sundial
#

That's how they get traction

#

They got you, they want smart people to reply in the comments

#

So they get traction

shrewd canopy
#

i decided to check post comments

valid jetty
#

quite silly

austere idol
austere idol
spark tiger
#

@runic sundial why is there no inheritance in zig how tf do i like do anything

crude star
#

skill issue

spark tiger
#

am i supposed to like make a big ass switch statement or

crude star
#

what are you trying to do

spark tiger
#

i was just bored and decided to make a chip8 emulator in zig as a way to both learn zig and emudev. so i just thought maybe i could like make a separate struct or whatever for each opcode so i can just implement their logic inside their pub fn execution() and then just call it for any generic opcode like

crude star
#

horror

#

why would you use inheritance for that

spark tiger
#

idk it seems cleaner

runic sundial
#

Or vtables

#

Or composition

#

But for opcodes?

spark tiger
#

fucking husked isob

spark tiger
runic sundial
#

For opcodes a huge switch statement is almost always the way.

#

Regardless of language

runic sundial
#

Is it clean? No. Is it readable? Yes.

spark tiger
#

it just looks ugly so i thought maybe i could come up with a better idea

crude star
#

list of functions yop

#

(don't)

runic sundial
#

Or that yeah.

#

You can have a vtable

crude star
#

compiler will probably generate a jumptable for you

runic sundial
#

Where the opcode is the index into an array of functions

#

But if you insist on inheritance?

#

Look into how duck typing works

spark tiger
#

i guess i'll just do it the regular way cause what you're saying sounds kinda scary ngl

runic sundial
#

And what comptime can do

#

It's closer to C than C++

#

You can have inheritance, but you need to do it by hand.

winged mantle
#

are there no interfaces

runic sundial
#

Duck types get you close

spark tiger
#

afaik no

winged mantle
#

duck typing in compiled languages sounds scary

crude star
#

there are

#

sorta

#

you make your own vtable

runic sundial
#

Yes, the insides of Allocator are a good example

#

Was on the tip of my tongue, thank you for pulling it up

winged mantle
#

would be cool if go maps supported . syntax

myMap := map[string]uint64{
    "ducc": 1024751454751309996,
}
fmt.Println(myMap.ducc) // 1024751454751309996
runic sundial
#

Horror

spark tiger
#

is vtables the c/c++ name of interfaces?

austere idol
#

interfaces are classes with pure virtual functions (virtual void thing() = 0;)

#

(idk)

spark tiger
#

idk on papare interfaces and vtables sound the same

#

and are used the same way i think

winged mantle
#

you just conventionally would probably call something with only pure virtual functions an interface

#

it's also the way virtual functions are implemented in general, not just pure virtual functions

crude star
#

i mean they are liteterally "virtual tables"

valid jetty
#

they allow polymorphism to exist via dynamic dispatch

#

then when you call a virtual function, it gets looked up in the vtable to determine which function to call

#

it is not related to interfaces almost at all

spark tiger
#

oh T_T

shrewd canopy
#

myMap.42 would be weird

crude star
#

only rust allows that syntax and its for tuples

winged mantle
#

$ prefix would allow using variable instead

func getValue[K comparable, V any](m map[K]V, k K) V {
    return m.$k
}
valid jetty
#

that just seems like a bunch of syntax hacks when the universal x[y] syntax already exists and handles all of the cases you could ever want with operator overloading

winged mantle
#

this saves characters

#

instead of doing m[k] you do m.$k

crude star
#

thats the same amount of characters

valid jetty
#

first of all why are you golfing everyday code

#

second of all rini is right lol

winged mantle
#

i think you're bad at counting

#

m.$k is three characters

#

m[k] is four

valid jetty
#

what

#

?????????????????

#

.$ is not 1 character

crude star
#

m#k

lavish frigate
crude star
#

better syntax 😊

valid jetty
#

m[k] literally works in all cases

#

you want array indexing? put a number in there
you want map access? put the key in there
you want a variable in it? put the variable in it

winged mantle
valid jetty
#

no extra syntax for different cases it just handles all of it at once

royal nymph
valid jetty
#

oh ok so youre baiting

#

lmao

lavish frigate
valid jetty
#

that too yeah

crude star
#

[] in go should come before the variable to match the type syntax

#

[k]m

valid jetty
#

aswell as, its been in use for decades, every programmer ever will recognize the syntax

winged mantle
#

$k.m

crude star
#

haskell should have [m k]

#

and rust

#

i forgot rust existed

valid jetty
crude star
#

life was so good while i forgot rust existed

winged mantle
#

i forgot how to do hello world in rust because i couldn't remember what you import for the print function

valid jetty
#

..nothing?

winged mantle
#

then i remembered it's built in

valid jetty
#

lmao

crude star
valid jetty
#

you can yeah

lavish frigate
valid jetty
#

i stole it from c

runic sundial
#

Rust doesn't have a print function

valid jetty
runic sundial
#

It has a print macro

valid jetty
#

dont worry about it :3

lavish frigate
#

oki

runic sundial
#

It's a language for goofy people by goofier people

crude star
#

erm axhually it expands to a print function.....

winged mantle
runic sundial
#

And don't womansplain it to me, I'm going to bed

#

Goodnight

winged mantle
#

to make it seem more exciting

valid jetty
#

god said "let there be bidirectional memory access" and suddenly ```rs
i32 x[42];
(41[x] = 39)[x] = 41;
$assert(x[x[x[41[x]][x]][x][x]] == 39, nil);

crude star
#

explode!(@winged mantle)

lavish frigate
crude star
winged mantle
#

wait couldn't you add a todo! function in kotlin to make it more rust like

valid jetty
winged mantle
#

print? "hello world"

crude star
#

50/50 chance of printing

winged mantle
#

PRINT "hello world" outputs HELLO WORLD

lavish frigate
#

all your fancy complex languages with tons of syntactic sugar and everything cant compare to php
face the wrath of my die;...

crude star
#

perl -e die

winged mantle
#

why does this have no error

lavish frigate
#

who made this language

winged mantle
#

i love implicit parens

lavish frigate
#

no the funny thing is exit by itself gets ran as the "language construct" while exit() gets ran as a regular function and can also just be overwritten

#

right of course

winged mantle
#

being serious for a second I think something I've liked about go is the code aestetic

#

it feels pretty compared to a lot of other langauges

lavish frigate
#

:=

crude star
#

why is there a penis opperator

lavish frigate
#

its not the penis operator its the walrus operator

#

i mean the assignment operator

#

no wait

#

the short variable decleration

crude star
valid jetty
#

this is like kotlin i fear..

lavish frigate
#

are u gonna add emoji variable name support

winged mantle
valid jetty
lavish frigate
#

/run

<?php
$🥺 = "Hello, World!";
echo $🥺;
rugged berryBOT
#

Here is your php(8.2.3) output @lavish frigate

Hello, World!```
crude star
#

lmao

winged mantle
#

rust users writing let all day while go users write the much prettier if err != nil { return err }

valid jetty
#

yeah LMAOOO

#

this works

winged mantle
#

GOOD

lucid trail
valid jetty
#

but indexing is 0-based

winged mantle
#

actually it's usually
if err != nil {
return errors.New("some helpful thing: %w", err)
}

valid jetty
#

so 41 is the last one

winged mantle
crude star
#

real golang users dont check for errors

lavish frigate
#

so corrupted by go...

winged mantle
lavish frigate
#

horrible

winged mantle
#

had to write InsertPaste twice, neither of which will be renamed when i rename the method

winged mantle
lucid trail
winged mantle
#

worst imaginable error handling
if err != nil {
os.Exit(0)
}

valid jetty
#
(41[x] = 39)[x] = 41;
``` is the same as
```rs
x[41] = 39;
x[39] = 41;
#

just a very cursed way of writing it

winged mantle
#

honestly for some reason go sometimes gives me vibes of language that was created to teach people programming even though its really not

crude star
#

0[(char *)0]

lavish frigate
winged mantle
#

eh not really

#

it's not really specifically meant to be used in schools

valid jetty
#

golang's gc is interesting

#

its a concurrent tricolor exact non-generational gc

#

because of goroutines they can run the gc "parallel" with the actual code

winged mantle
#

apparently kotlin native's gc is pretty bad

#

is this true

valid jetty
#

idk

#

but if it uses java's gcs it wont be

#

java has been refining its gcs for decades

#

(yes, gcs plural)

lavish frigate
#

face wrath of my -Xmx1M

winged mantle
#

idk just heard that it might be compared to c#

fleet cedar
ivory heath
ivory heath
#

I think most of this server would die if they had to write c++ for a hour

valid jetty
#

i did need to actually implement it

runic sundial
#

Long time

#

I wrote C++ for longer than an hour

#

And I only nearly died

valid jetty
#

I Wrote RUST for 100 HOURS!!! * extreme *

runic sundial
#

Ok

valid jetty
#

it was supposed to be one of those youtube titles dont murder me

#

First To Leave VIM Wins $10,000

hoary sluice
hoary sluice
#

shift z z

valid jetty
#

:x

hoary sluice
#

without custom binds

valid jetty
#

yeah

#

:x

hoary sluice
valid jetty
#

you never specified what mode im in

hoary sluice
#

i can do leader x

valid jetty
#

what does this mean

hoary sluice
#

do you not know what a labubu is??

runic sundial
valid jetty
hoary sluice
valid jetty
#

i have a bubu lamp at home actually

hoary sluice
#

isnt this beautiful

#

its literally the nigerian flag

valid jetty
valid jetty
#

though i’m far less active

hoary sluice
valid jetty
#

literally

#

but tbf for the last like 2 weeks i haven’t really done any programming

runic sundial
#

Mine won't be green as I stopped really using GitHub

valid jetty
#

it’s all been physics and further maths

#

i did a little bit because i’m writing my cs assignments in elle and i come across small bugs here and there

hoary sluice
valid jetty
#

im trying to find a reason not to go to uni

#

i already know the content so i can just not go to lectures and get drunk

#

win win

valid jetty
#

@hoary sluice

hoary sluice
hoary sluice
winged mantle
#

I didn't mean in the sense of being easy to learn i mean in the sense of very unusual things

#

like complex numbers

nimble bone
#

penis operator

dense sand
#

just javascript things

supple whale
#

yeah thats a server function

#

you're running a web api

#

inside nodejs

#

what do u expect?

dense sand
supple whale
#

lmao

#

it probs compiles for server side and client side, but only runs client side

#

vite has that problem like fuck and it pisses me off too

dense sand
#

nextjs moment

ivory heath
ivory heath
runic sundial
hoary sluice
#

@valid jetty GIT REFERENCE ?!?!???

crude star
#

this version is like 4 years old now

winged mantle
#

i tried fiber but the api design and docs felt meh

#

bit annoying with net/http that you have to specify content-type but you can create helpers

winged mantle
#

stuff like how fiber has its own logger and things are hard to understand due to optimisations turns me off a little

valid jetty
#

@hoary sluice what the FUCK did i just uncover

#

is this unsafe

fleet cedar
#

What have I told you about sanitizing your inputs?

valid jetty
#

well the whole idea is that these literals are supposed to be "exact" as in, the compiler places them as-is into the IR file which gives you a lot of control for naming

#

clearly a bit too much control

#

for example, the runtime monomorphizes a few things

#

in the actual code i dont want to create duplicate monomorphizations if they already exist in the runtime

#

so i can use exact literals to define those monomorphized functions

external fn `Array.with_capacity.0.2.15.1`(i32 capacity) -> string[];
external fn `Array.push.0.2.15.1`(string[] self, string element);
external fn `Array.resize.0.2.15.1`(string[] self, i32 new_capacity);
#

if it were sanitized, you couldnt do this

fleet cedar
#

Depends on how much you sanitize it

valid jetty
#

true

fleet cedar
#

If you allow arbitrary qbe identifiers but not things that are not qbe idents for example

valid jetty
#

i might be able to just allow characters that are allowed in object file names

#

or that, yeah

#

that is kinda funny tho

winged mantle
#

i don't understand... why do some routing libs not find the page if there's a slash at the end... why would anyone want this behaviour

#

do i just have to register two routes, one with the trailing /

#

ok at least it's not as weird as http.ServeMux

#

nvm though

#

StripSlashes only strips one slash

#

so /download/ matches but /download// does not

crude star
#

malware

winged mantle
#

how many rest apis only support 1 trailing slash

#

😭

hoary sluice
valid jetty
upper oak
#

Hello i need help to make a script working again to get my token from the Discord console

(
webpackChunkdiscord_app.push(
[
[''],
{},
e => {
m=[];
for(let c in e.c)
m.push(e.c[c])
}
]
),
m
).find(
m => m?.exports?.default?.getToken !== void 0
).exports.default.getToken()
VM5404:16 Uncaught TypeError: Cannot read properties of undefined (reading 'exports')
at <anonymous>:16:2

#

i have try different import nothing work

shrewd canopy
upper oak
#

i just need it

#

i know i can get it from the Network option and change channel and fetch the resquest but its soo long....

shrewd canopy
#

🤨

upper oak