#🪅-progaming

1 messages · Page 40 of 1

spark tiger
frosty obsidian
#

github prioritizes the new issue button over more common actions like sharing on the repo screen in their mobile app

royal nymph
spark tiger
#

tbh i dunno how someone can fuck up on this step

#

like u literally already have a list of types u just need to fucking choose the correct

frosty obsidian
#

they will somehow find a way to not use a template

spark tiger
#

also since when do github issues have types

sterile trout
#

the public preview started at the end of september

spark tiger
#

istg javascript codebases are impossible to understand

spark tiger
#

i hate js cuz the amount of ways to just fucking set a field or something is hilarious

serene elk
#

spicetify is probably so badly made

#

judging from their CLI I cant expect more from their mod

spark tiger
#

settimeout is smth cursed imo

serene elk
#

yes that is horrible

#

they are basically polling to see if the methods they need have been found every 300ms

#

to only them continue the execution

spark tiger
#

argh i just want to see how they're able to use the playback api 😩

serene elk
#

doing a mod in a js application yet doesn't know basically hacks to avoid that

spark tiger
#

idrk, best i could find is this

#

also there are these

#

.PlaybackAPI

supple whale
#

modding spotify sucks

#

it breaks and unpatches itself like x100 more frequently than discord

austere anchor
#

yeah uhh i dont think its made to be modded

spark tiger
austere anchor
hoary sluice
#

I LOVE ASYNC STREAMS IN RUST
rustc: method `request` has an incompatible type for trait expected signature `fn(&'life0 OllamaClient, &'life1 _) -> Pin<Box<(dyn Future<Output = std::result::Result<Pin<Box<(dyn tokio_stream::Stream<Item = std::result::Result<std::string::String, error::error::Error>> + Send + 'static)>>, error::error::Error>> + Send + 'async_trait)>>` found signature `fn(&'life0 OllamaClient, &'life1 _) -> Pin<Box<(dyn Future<Output = std::result::Result<Box<(dyn tokio_stream::Stream<Item = std::result::Result<std::string::String, error::error::Error>> + Send + 'static)>, error::error::Error>> + Send + 'async_trait)>>
`

austere anchor
#

bwaah

#

also wtf why r u using rustc directly

hoary sluice
#

i just copied it from zed

austere anchor
#

oh

hoary sluice
#

oh shit it actually works

#

i dont have proper parsing but its sending a stream of responses

#

i was not expecting it to work first try

#

omg they made the chatgpt reasoning public

stoic helm
#

got my prompt to pull mpris data because i run spotifyd on my server so might as well

#

either dbus is laggy or spotifyd is taking ages to respond so i set up a background service to write the now playing to /tmp/promptcmd and just read that on each prompt

#
if [[ $(playerctl status 2> /dev/null) == "Playing" ]]; then
    TITLE=$(playerctl metadata title)
    ARTIST=$(playerctl metadata artist)
    # %F{75}♫ %F{177}artist - title %F{75}♫ %F{177}
    PROMPT+=': %F{75}♫ %F{177}'"$ARTIST"' - '"$TITLE"' %F{75}♫%f'
fi

echo $PROMPT > /tmp/promptcmd```
onyx sierra
spark tiger
#

@woven mesa is this very good?

dense sand
#

no its very bad

austere anchor
#

surely oss is good

dense sand
#

i didnt mean it

woven mesa
hoary sluice
supple whale
#

js async iterators are like the best thing ever made

#

they are so fucking good and performant its mad

#

well ofc they arent the fastest solution, but they are INSANELY faster than node streams, and the utility they provide is also amazing

hoary sluice
supple whale
#

aware

#

js>rust shrimply

hoary sluice
#

and its not about speed its about it being annoying

supple whale
#

yeah i heard rust async iterators are sub-par

hoary sluice
hoary sluice
supple whale
#

yeah they are annoying to work with

#

i love js's async iterator integration with async/awat

#

it makes it so fucking nice to work with any form of data stream

fleet cedar
#

It sucks needing to implement each combination of iterator+async+result+whatever separately

#

Gimme a proper effect system please

unkempt shuttle
#

hello hastag programming

#

is there a windows equivalent to &> to redirect everything from console to a file?

#

> doesn't seem to capture everything by default

hoary sluice
#

@placid cape do you think the reviewers will believe that i wrote this myself lol Contemporary voice assistant systems rely on artificial intelligence (AI) to enable foundational capabilities such as natural language understanding, contextual reasoning, and adaptive response generation. This implementation leverages a heterogeneous ensemble of machine learning models and deterministic algorithms to achieve robust performance across diverse interaction paradigms. The system dynamically allocates computational tasks based on syntactic complexity, semantic ambiguity, and real-time resource constraints, ensuring an optimal balance between accuracy and responsiveness. By integrating both local and cloud-based AI frameworks, the architecture supports scalable deployment while maintaining interoperability with evolving language processing technologies.

placid cape
#

well i dont think

#

but maybe?

#

i would say its ai

hoary sluice
#

"leverages a heterogeneous ensemble of machine learning models and deterministic algorithms"

placid cape
placid cape
#

the whole sentence "This implementation leverages a heterogeneous ensemble of machine learning models and deterministic algorithms to achieve robust performance across diverse interaction paradigms."

hoary sluice
#

my entire introduction is 88% ai gen

#

lol

#

i mean thats pretty accurate

#

These models demonstrate superior performance in disambiguating lexical variations (e.g., regional dialects), resolving co-reference chains, and extracting intent from phrasings with high syntactic entropy.

hoary sluice
#

i wrote this sentence myself just now

#

it doesnt even say like 80% or smth

placid cape
#

¯_(ツ)_/¯

#

gptzero is the best i know about

royal nymph
#

just ask ai

placid cape
#

quillbot also has ai detector but its way worse

hoary sluice
#

i mean my supervisor doesn't really know anything about ai and he probably doesn't care either, he's a chill guy

placid cape
#

then you're safe

hoary sluice
#

i just dont wanna risk having 100% ai on gptzero

#

so true????

#

the human ones sound more ai than the ai ones

#
fn is_ai() -> bool {
  rng.gen_range(1..=2) == 2
}
#

ahh website

fallow jasper
green gulch
#

dude i went to this restaurant earlier

#

and their payment thing accepts negative tips

eternal wigeon
wheat kernel
#

pls tell me u got a free meal

#

there used to be a similar issue w mcdonalds terminals

#

removing stuff from the basic hamburger would add up to more negative charges than the worth of the burger

void leaf
#

Who the hell made html and decided target=”_blank” and target=“_self” was a good idea and easily understandable for what their purpose was

valid jetty
#

which specifies that it opens in a new tab but that new tab is shared for all links you click in your website

#

so if you have anchor A and B and you click A, it’ll open a new tab with A, but if you then click B it’ll overwrite the A that is already open with B

void leaf
#

Imma murder the mf that wrote html

green gulch
#

the total was -9$ because i put more than the total

#

was hoping theyd give me money

viscid grove
viscid grove
hoary sluice
green gulch
hoary sluice
#

are u in america

#

"waiter gave me bad service so my bill is coming out of his tip jar" ahh restaurant

green gulch
#

most places do

green gulch
#

just found out i can view any order (sequential IDs and no auth) and see the delivery address and customer info if it was delivery

hoary sluice
green gulch
#

i saw that the other day

#

i can bypass payment completely

#

and pay other peoples orders

hoary sluice
#

even if they dont im sure theyre gonna be willing to give u some money for a free food exploit

fallen nebula
dense sand
#

a perfect parser

#

now im waiting for a moment where it totally breaks down

green gulch
frosty obsidian
#

i should also make a programming language in kotlin

austere anchor
#

wtf

#

i thought it was only a clippy thing

dense sand
austere anchor
#

idk what that is

#

but cool

jade stone
#

does anyone know how you lose some type inference on variables captured in anonymous functions

serene elk
#

typescript cant be sure when that code is going to run

#

so they cant assure the type is the same

#

the same happens when you non null assert some variable and then try to use inside a function

hoary sluice
green gulch
#

exactly

#

i didnt give any details how its done in the email

#

just the severity etc

hoary sluice
#

alr nice

green gulch
jade stone
#

love weird type inference

wheat kernel
#

mf out here extorting restaurants

green gulch
#

for a small sum of cash

wheat kernel
#

u cant withhold details and demand payment 😭

royal nymph
#

and there's nothing forcing you to disclose vulnerabilities you find

wheat kernel
#

theres nothing preventing them from bringing criminal charges against you for vulnerabilities you find lol

royal nymph
#

if you email them like "hello I found a vulnerability that allows me to see other customer's private info, would you be willing to compensate me for disclosing it responsibly?" there's nothing illegal about that (the only thing that could possibly be illegal is "hacking" aka you weren't supposed to find that vulnerability in the first place, but if it's something you can find by doing extremely simple and normal things they shouldn't be able to argue that)

wheat kernel
#

and if they dont have a vdp or similar

#

they can just email back from the legal@ domain

royal nymph
#

it would be illegal if you were like "give me money or I will sell this on the black market" 👽

ornate quiver
#

sure they might want to sue him but thats completely different

#

people sell exploits legally all the time

blazing haven
hoary sluice
#

theres nothing illegal about finding vulnerabilities

#

hes hasnt exploited it

#

and for it to count as extortion there needs to be some threat or coercion, if its not phrased as "If you dont give me money I will sell this on the dark web", then the most they could claim in court is implicit threat, but that wont hold up

blazing haven
hoary sluice
# blazing haven what jurisdiction are we talking about

i guess usa, you could say that this falls under 18 U.S.C. § 1030 computer fraud and abuse but realistically even if they do sue on this basis, it would never hold up in court as he could claim that he found it unintentially and he disclosed it responsibly, so theres also no claim of extortion; this law is there to prevent malicious attacks

blazing haven
#

also even if it sounds ridicilous (because it is, to us anyway) the accessing of sensitive information could also be considered illegal even if it's just accidentally by trying the sequential id thing

hoary sluice
#

and you can phrase the email in such a way that there is absolutely nothing they can claim,
Hello, I recently noticed a potential security vulnerability on your website that may allow a user to modify the price of an order. I wanted to bring this to your attention so it can be fixed. I wasn’t able to find a bug bounty program; do you have a preferred method for responsible disclosure?

hoary sluice
blazing haven
#

maybe they have a security.txt

#

oh small local restaurant

#

prolly not xd

hoary sluice
#

@green gulch how big is the business?

blazing haven
#

just go to <domain>/security.txt

#

see if it exists

hoary sluice
# green gulch

looking at this video @blazing haven, this is in no way a cfaa violation, he used the intended, public ui and didnt "hack" the system, this is just an oversight on their part and they have no legal claim since he clearly wasnt like querying their private apis to see if theres no auth on one of them or smth

blazing haven
#

(honestly id just keep getting free meals with this method for a lifetime)

#

LMFAO

blazing haven
#

someone would notice anyway one way or another anyway if you do it a few times

#

not worth it

hoary sluice
#

this is probably not mcdonalds where they get like an order every second in large locations, and where you can use loyalty points to get free orders legitimately, so theyre gonna immediately notice that the receipt says -2.36$ or 0.00$

blazing haven
#

i wonder what goes through the head of someone seeing a receipt with a minus in front

#

would they just give you money the first time no questions asked? LOL

hoary sluice
#

no??

#

i mean if its at a mcdonalds they would ask you "how is the total negative?" youd say i used a voucher and theyd prob give you money

blazing haven
#

yeah prolly

hoary sluice
#

@placid cape next person that im teaching programming will be starting with rust

placid cape
#

interesting choice 🤔

hoary sluice
#

i have pretty much taught about 5 ppl and they started with c or python

#

the language is so awesome and i think itd be a good option for beginners since (especially at the beginner level) the compiler debugs everything for you

#

if they dont know the absolute basics then teach that with pseudocode, and then move to rust

valid jetty
#

i just tried to teach someone react without any js experience

hoary sluice
#

cause i wasnt boutta build him a router and login portal and evertything with just js

green gulch
#

but the software is used by thousands of restaurants world wide

#

the parent company no longer advertises it

#

since they have a new system, but the old one is still in support because of contracts

hoary sluice
#

cause that might be a decent paycheck if its used by thousands of restaurants

green gulch
#

I got on their live chat and had them make me a ticket

hoary sluice
green gulch
#

The support person was giving me a hard time

#

Started trying to sell me the software

dense sand
#

me when i pass

#

me when happy

hoary sluice
#

saying do you have a system in place for responsible disclosure is very good wording

green gulch
#

thats what i asked

#

pretty much word for word

hoary sluice
#

what did u say abt the scope of the issue

green gulch
#

I said it can compromise customer information and cause financial damage to their thousands of clients, as well as damage to their systems

hoary sluice
#

like did you say "i disovered an issue that can..."

green gulch
#

I found out this morning that their merchant sign in page is vulnerable to sql injection

hoary sluice
#

💀

green gulch
hoary sluice
#

ok nice

green gulch
#

I don't know if I'm going to even get a reply from them honestly

placid cape
dense sand
#

steady but slow

hoary sluice
#

cause ur technically not allowed to scope around information that is supposed to be private but accidentally isnt, but in case they dont respond well you can just say you found the negative tipping thing and just not tell them about the rest, cause the negative tipping is completely accidental and legal

dense sand
#

i want to understand the parsing process

green gulch
hoary sluice
#

i mean like youre not allowed to try to query private apis (at least its a gray area)

#

The Computer Fraud and Abuse Act of 1986 (CFAA) is a United States cybersecurity bill that was enacted in 1986 as an amendment to existing computer fraud law (18 U.S.C. § 1030), which had been included in the Comprehensive Crime Control Act of 1984. Prior to computer-specific criminal laws, computer crimes were prosecuted as mail and wire fraud...

green gulch
#

Security researchers do it every day

hoary sluice
#

in austria you are not allowed to guess wifi passwords, and its probably similar in the us

green gulch
#

Nothing would really hold up

hoary sluice
hoary sluice
green gulch
#

Theres independents that do it

hoary sluice
#

the sequential id thing is probably illegal tho

#

unless they have a bug bounty that allows it

green gulch
#

And I wasn't really querying API directly, i was looking at the network tab on dev console from their website

hoary sluice
#

did you go to theirdomain/security.txt ?

green gulch
hoary sluice
green gulch
hoary sluice
#

oh lol

green gulch
#

he sent his link

#

it was 3 numbers higher than mine

hoary sluice
#

oh wait its theirdomain/.well-known/security.txt

green gulch
hoary sluice
#

yep

#

nice

green gulch
#

nor does the parent company site have it

blazing haven
#

to the vast majority of companies security issues are just an annoyance

#

and security in general is an afterthought

#

so expect them to give you a hard time about everything

wheat kernel
hoary sluice
#

oh shit i see

#

lmao

#

@green gulch hope they dont notice/ dont care

green gulch
#

I left cash on the table

#

paid the amount + 10$ tip

hoary sluice
#

ah ok

green gulch
#

so hopefully thats enough of a bribe to stay quiet

hoary sluice
#

did u take the bill with u

green gulch
#

I did it to test if it would actually take it

green gulch
hoary sluice
#

yes

green gulch
#

yeah

#

I still have it

hoary sluice
#

meh you paid cash, they probably cant know that it was u

#

couldve been someone who also discovered the exploit and decided to abuse it

#

did u put any personal info into the app?

green gulch
#

id be surprised if i was the first one to try that

green gulch
#

card

hoary sluice
#

im guessing theres a bunch of homeless dudes who have been eating at restaurants with that app for free for years and youre about to ruin their life

green gulch
#

lmfao

#

i mean i think the waiter would definitely notice

#

they go to check their tip and see its -40$

hoary sluice
#

the waiter gets the bill + 10$ as a tip

#

for u at least

green gulch
#

for me yeah

hoary sluice
#

not for the homeless dudes

green gulch
#

since i left cash i doubt they checked the system

#

i went to a different restaurant a long time ago that had online payment on receipts, and i used it then left but I forgot my hat in there so i went back in

#

and the waiter thought I left without paying lol

hoary sluice
#

i mean they might have (only might, cause if the security is that garbage i doubt they have a lot of logging) a history of purchases and theyll see that u have a 0$ bill but u can say that was accidental, when u discovered it

hoary sluice
#

or u mean just normal payment

green gulch
#

normal payment

#

at a different restaurant

hoary sluice
#

als

green gulch
#

i was saying just cause the waiter didnt check the system

hoary sluice
#

alr

green gulch
#

this would be really funny on a receipt

hoary sluice
# green gulch

how to become a billionaire TODAY (join my whatsapp group!!!)

green gulch
#

lmao

#

to their credit it doesnt allow it if the total is negative

#

server side

#

but its not an intentional prevention

#

it just thinks the card doesnt have enough to cover the total

hoary sluice
#

probably cause it causes an exception somewhere down the chain

ionic lake
hoary sluice
hoary sluice
ionic lake
#

i know, but companies will make up any reason

hoary sluice
#

which wont hold up in court

#

and then he can just reveal the negative tipping in court and keep the other shit secret and fuck over the company

#

cause if they take it to court then its gonna be public news and everyone will know that theres some kind of exploit

#

tldr the company probably cba to sue some random guy who says he knows how to get free food

green gulch
#

and this company isnt large enough to do that honestly

#

its not like

#

stripe

#

or square

hoary sluice
#

those 2 def have a bug bounty

green gulch
#
{
    "code": 420,
    "message": "Oops! Someone has already paid part of this bill. Please review and try again."
}
green gulch
#

even for unpaid bill

hoary sluice
#

yea they do

hoary sluice
#

i think this means theyre using spring

#

a very old version of spring at that

ionic lake
#

i say you don't give them your exploit and use it to order free food blob

green gulch
#

i mean if they dont offer bug bounty ill just not reply

hoary sluice
green gulch
#

i really want to mess around with the sql injection on the merchant sign in but i probably wont

hoary sluice
green gulch
#

that is what could get me in the most trouble

green gulch
hoary sluice
#

actually no dont mention that

#

youve alr told them enough to make them issue a bug bounty

green gulch
#

yeah

green gulch
jade stone
#

something about this feels wrong

    private highlightChanges() {
        const [was, is] = this.lastPatchedModule.get();
        if (!was || !is || was === is) return;
        const changes = DiffFunc(was, is);
        let i = -1;
        let cur: Diff;
        let pos = 0;
        while (++i < changes.length && !(cur = changes[i])[0])
            pos += cur[1].length;
        let end = pos;
        while ((cur = changes[i++])[0] && i < changes.length)
            cur[0] !== DELETE && (end += cur[1].length);

        const rangeToShow = makeRange({ pos, end }, is);
        if (!this.editor) return;
        this.editor.revealRange(rangeToShow, TextEditorRevealType.InCenter);
    }
hoary sluice
#

also use the wappalyzer browser extension

#

see what theyre using

#

maybe spring isnt the only one that uses 420

hoary sluice
green gulch
#

not finding anything

#

their entire code is just a single js file

#

they use the same one on customer end and merchant end1

hoary sluice
#

wtf

hoary sluice
#

they send u the server js??

green gulch
#

no its the frontend code

#

js

#

but 90% of their handling/validation is client side

#

that reminds me

#

ever heard of life360

hoary sluice
#

no

valid jetty
#

yes

green gulch
#

pretty big

#

they had their auth secret in front end

dense sand
#

[UNCHECKED_CAST] Unchecked cast of 'kotlin. Array<*>' to 'kotlin. Array<lol. koblizek. leap. parser. ExpressionBuilder>'.
blobcatcozy

jade stone
dense sand
#

yea i can

#

but like it doesnt make much sense lol

dense sand
#

i didnt use this name for ages ngl

#

its atleast a year since i dont even own that domain anymore

hoary sluice
#

i didnt know it was a domain at first and the hypixel forums thread that taught me programming said to just do me.username

#

i changed it to dev.eagely later

hoary sluice
#

my goofy ahh used my school email in all my commits

#

bro github desktop is so awesome

spark tiger
#

how cursed is this

#

i don't know shit about rust, was just using something i've seen in other projects and with the help of chatgpt

ionic lake
#

its ok but try to avoid unwrap

spark tiger
#

was trynna make it running asap :P

ionic lake
#

👍

spark tiger
#

my concerns about rust were mostly about performance. like you need to basically create such things yourself which needs to be performant enough and i was too scared to start writing rust thinking i'd simply not come up with a performant enough solution

#

also coding this small thing taught me that rustrover is fucking dogshit

#

afaik it's using its own thing rather than rust-analyzer

#

and it's so bad

ionic lake
#

i just use neovim and rustacean.nvim handles everything for me

spark tiger
#

most of the time it either doesn't show actual errors or shows fake errors

spark tiger
#

i'm thinking of using zed for rust coding

ionic lake
#

oh and ive set rust_analyzer to give it its own target dir so it won't lock up the main target dirs

hoary sluice
#

For the programming language C++, the standard allows compilers to apply any optimizing transformation to a program during compiling, provided that such optimization makes no change in the "observable behavior" of the program, as specified in the standard. This mostly means that any actions the program performs on its environment occur in the sp...

hoary sluice
#

or nvim

#

zed is still pretty new so some parts abt it arent the best, so if you alr have a good nvim setup its prob better to use that for now

spark tiger
# hoary sluice https://en.wikipedia.org/wiki/As-if_rule

i mean yeah but still bad algorithm would definitely slow down the code. like maybe i could find a better and more performant way of implementing read_str like without having to create a vec and then create a string from that. like that way i uh have to allocate twice more memory, no? like in memory there's both the vec and the string

#

and like these kinda things kinda stress me out

hoary sluice
#

a bad algorithm will be a bad algorithm irrespective of the language

spark tiger
#

true, but in like python i didn't have to come up with any algorithm to just read a string from file stream

#

so don't have to worry

spark tiger
hoary sluice
#

if its in the stdlib its optimal

hoary sluice
austere anchor
spark tiger
#

ima reproduce it rq

ionic lake
#

you can also try using ra-multiplex

hoary sluice
hoary sluice
austere anchor
ionic lake
#

running out of space is inevitable

#

burntsushi (who made ripgrep) got his uv target dir to 600gb

hoary sluice
#

it uses 1.2 gb of ram for me

spark tiger
hoary sluice
#

cause it has to load ur entire dep tree and all of its code

#

just tokio is like a gig

spark tiger
austere anchor
spark tiger
hoary sluice
#

wait what are you reading

austere anchor
#

smh

spark tiger
#

tho not so big

hoary sluice
#

oh idk abt string with capaticty

#

read_to_string just returns a string i thought?

austere anchor
#

@spark tiger sure you just let fw: Vec<u8> = fs::read(&args.filename).unwrap_or_else(|e| panic!("Cannot read image, error: {e}"));

#

(copied straight from one of my projects blehhh)

ionic lake
austere anchor
#

thus u need to specify a string for it to go to

austere anchor
hoary sluice
austere anchor
#

its a binary

#

its non-utf8

fleet cedar
spark tiger
#

oh maybe i'm not supposed to use it with a with_capacity String and need to call it on the file? but that's not really what i want, i want to read exactly x amount of bytes

austere anchor
#

.

hoary sluice
austere anchor
#

or well

#

in the way you want

austere anchor
fleet cedar
austere anchor
#

read_to_string just takes in a string buffer for efficiency

spark tiger
austere anchor
#

also except is weird because you're supposed to put the string of what you expected to happen

#

but like

#

the error message doesnt feel like that

austere anchor
hoary sluice
#

is the file valid utf 8

fleet cedar
austere anchor
hoary sluice
#

what ive learned from rust is that the compiler is always right

austere anchor
#

!

fleet cedar
#

Panics aren't for user-facing errors

hoary sluice
#

hes been tryna read it to a string this whole time so i assumed its utf8?

hoary sluice
spark tiger
#

idrk

hoary sluice
#

im guessing python discards invalid utf8

#

or puts placeholder characters

#

no it doesnt ive had that issue in python before

#

anyways you cant read a non utf 8 file into a utf 8 string no matter what library you use

spark tiger
#

i can send you some of the first bytes this file has

austere anchor
spark tiger
#

cuz i'm not really sure how to tell if the file is a valid utf-8 or not

hoary sluice
#

its not valid utf 8

fleet cedar
#

If it's text, it's utf8 (or else 🔪)

#

If it's binary it's not utf8 (but might contain utf8 strings in some parts obviously)

hoary sluice
#

the file is .bfn which is not something i know and probably not utf 8

spark tiger
hoary sluice
#

apparently .bfn is a binary file that stores serialized data for WerWolv (the app in the screenshot)

#

its basically a zip file

#

but not zip

spark tiger
#

should be a valid string

hoary sluice
#
fs::read(filename)
fleet cedar
hoary sluice
fleet cedar
#

Could theoretically be valid utf8, but it's certainly no string

austere anchor
hoary sluice
#

its like converting dnsrto45rn6old to a decimal number

#

456 is valid but the rest isnt

spark tiger
hoary sluice
austere anchor
#

@spark tiger you should most likely be deserializing this instead, just read it as a Vec<u8> for now and parse it properly

hoary sluice
#

i guess thats hallucinated then

#

what is the file for

spark tiger
austere anchor
#

so cursed

austere anchor
hoary sluice
austere anchor
#

i knowthe dot itself is valid utf8 but thats not the point

hoary sluice
#

valid

#

ur parsing the file not the dot

austere anchor
#

the whole file isn't utf-8 valid

spark tiger
fleet cedar
#

The file isn't text so whether it's utf8 isn't relevant

spark tiger
hoary sluice
#

but to do that u were parsing the whole file as a string

#

which doesnt work

austere anchor
spark tiger
hoary sluice
hoary sluice
fleet cedar
austere anchor
austere anchor
fleet cedar
#

It reads the entire remainder of the file into a String

hoary sluice
spark tiger
# hoary sluice why are u tryna steal assets lol

not to steal, and i don't really see anything so bad about it. there are many such tools for like source engine games, godot games, etc. This game is de-facto abandoned, and I just wanted to both get some cute sprites from the game and try myself into reverse engineering a proprietary file format

mystic pond
#

hi guys did i can add new plugun ??

austere anchor
austere anchor
hoary sluice
fleet cedar
#

vns you mean?

elder yarrowBOT
hoary sluice
austere anchor
#

it is clearly not doing anything like seeking

hoary sluice
austere anchor
#

it just reads the whole file

#

not even a remainder

austere anchor
fleet cedar
# hoary sluice `println!('.')`
error: format argument must be a string literal
 --> src/main.rs:1:22
  |
1 | fn main() { println!('.'); }
  |                      ^^^
  |
help: you might be missing a string literal to format with
  |
1 | fn main() { println!("{}", '.'); }
  |                      +++++
hoary sluice
#

i do that every time

#

im glad the rust people invented dbg!

hoary sluice
fleet cedar
#

If only dbg! wasn't terribly formatted

austere anchor
fleet cedar
#

I have the third most cursed crate on the planet to rectify that though

spark tiger
austere anchor
hoary sluice
austere anchor
#

currently you are not seeking

austere anchor
hoary sluice
spark tiger
# hoary sluice so ur goal is to read specific bytes from a file?

this specific file is like a file tree for the archive of the assets themselves which is actually in another proprietary file which i haven't reversed engineered yet.
but for this rust code i just want to like read it all into a vec of file paths (like ./folder/file.bin) so then i can print a pretty file tree
the original algorithm in python is like that:

spark tiger
fleet cedar
#

It reads from the current position

#

(And advances the position)

spark tiger
#

ah

#

i thought seeking is the same as advancing the position

austere anchor
fleet cedar
#

No, seeking means jumping

#

Like seeking to position 0x1234 without reading the bytes before that

hoary sluice
#
let file = File::open(filename)?;
let mut files_len = [0u8];
file.seek(SeekFrom::Start(4))?;
file.read_exact(&mut files_len)?;

and u probably wanna do

files_len as usize

later cause lenght / index should be usize

austere anchor
#

"Readers can be thought of as cursors that only allow you to seek forward from the current position. They can be implemented with one method; read_exact. This forcibly attempts to split the underlying buffer in order to extract a sub-slice with a given length, and advance the buffer forward such that the next call to read_exact will return subsequent bytes in the buffer." ah TIL

fleet cedar
hoary sluice
#

oh yeah it needs to be a slice

#

now it works

fleet cedar
#

Though they should have been called read_some and read

hoary sluice
austere anchor
hoary sluice
#

esp cause of Option::Some

hoary sluice
fleet cedar
#

Sure, the naming can be bikeshedded

spark tiger
#

got another question - what exactly should we use seek for if not for advancing the current position?

hoary sluice
#

i think

fleet cedar
#

The point is that the good name should go to the useful operation

fleet cedar
spark tiger
#

like i always thought seek is basically so you don't read over and over the same position

hoary sluice
fleet cedar
#

For example if your archive says "file foobar.txt starts at position 970114" then you might want to seek over there

hoary sluice
#

nah just read the whole file and drop the first 970113

austere anchor
hoary sluice
austere anchor
#

@spark tiger what is your issue currently

fleet cedar
#

What's the topic anyway

hoary sluice
#

nah lets derail completely

austere anchor
hoary sluice
#

reading the 5th byte

#

is the topic

spark tiger
#

it works fine

austere anchor
#

sure that's fine too

fleet cedar
#

Just use std::fs::read()

austere anchor
#

just read the whole file thumbsup

hoary sluice
fleet cedar
#

Yeah if it's gigs you'll want mmap

hoary sluice
#

the first 5 bytes happen to be utf8

spark tiger
fleet cedar
#

Wow calling different functions does different things?

austere anchor
#

Amazing!

hoary sluice
spark tiger
#

mb

#

like before i first called read_int and then read_str and it resulted in . - 1, but after calling read_str first it was - somebignumber

#

it wouldn't differ if it read the first bytes rather than that ones at the current position

fleet cedar
#

Io is usually sequential

#

Most people aren't interested in reading the same bytes repeatedly, so the io primitives advance the position since that's the not stupid way to do it

hoary sluice
hoary sluice
#

ur prob right

#

makes sense

spark tiger
fleet cedar
#

What did you expect

#

The first one interprets bytes 0..=3 as an int, the second interprets bytes 1..=4 as an int

austere anchor
#

me when the hardware does things sequentially supershocked

fleet cedar
#

I think it's the kernel, not the hardware

spark tiger
#

argh i'm so confused atp

fleet cedar
#

But that's quite off topic

austere anchor
austere anchor
hoary sluice
#

the hardware just is

fleet cedar
#

Hardware is irrelevant for most propgramming anyway

hoary sluice
#

our professor drilled into us that vhdl doesnt have time

spark tiger
austere anchor
#

found out read_exact does advancing for you anyways

#

i thought it didn't but you learn new things everyday

hoary sluice
fleet cedar
#

As another nitpick/advice, wrap your File in a BufReader, it'll be an order of magnitude faster

fleet cedar
#

Doing many small reads is expensive, so BufReader does fewer but larger reads

hoary sluice
#

3 ns instead of 30 ns

spark tiger
fleet cedar
#

I almost always do my io by reading to a Vec<u8> first (or mmap if large)

hoary sluice
spark tiger
hoary sluice
#

oh u need the first 5, not the 5th?

austere anchor
fleet cedar
#

Most won't, yeah

spark tiger
hoary sluice
#

ohh

spark tiger
hoary sluice
#

i thought the 5th byte was your length 😭

#

i misunderstood the python

spark tiger
#

my next step would be actually finish porting this python script to rust and benchmark it somehow python vs rust

#

inb4 python version is faster due to my badly written rust code blobcatcozy

hoary sluice
#

it wont be

spark tiger
#

also need to find a way to benchmark python and rust code

hoary sluice
#

time

#

or hyperfine

#

oh ur on windows

#

idk

austere anchor
spark tiger
#

oh my fucking god finally

austere anchor
#

don't over-optimize

spark tiger
#

dis was the worst 12 minutes of my life icl

austere anchor
spark tiger
fleet cedar
#

On the slice, rather, but yeah

spark tiger
#

forgot to say -- thanks to everyone! using rust has been very fun so far

jade stone
#

this is horrid

#

i will now use it for iterating over regex objects

jade stone
royal nymph
wheat kernel
spark tiger
#

i wonder how that works though

#

like you don’t even know what fields you’ll get when compiling

ornate quiver
#

the Deserialize proc macro generates some boilerplate code that specifies the known fields to serde, and then serde_json parses input and fills in the known fields

spark tiger
#

maybe i can steal some of their code to make it work with binary blobcatcozy

#

i have a brilliant idea for a parsing lib

#

but i kinda have a feeling i’d rather just contribute some features to nom

#

if it doesn’t have them yet

#

but making stuff yourself is too fun to replace it with a crate!

ornate quiver
#

typically you'd use some binary parser lib like scroll or nom
and then if you really wanted serde support you'd write a small trait impl to connect the two

spark tiger
#

i want to utilize field decorators(?) like nom does

ornate quiver
#

wdymm show

spark tiger
# ornate quiver wdymm show

sorry i had a class. it seems like i confused nom with binrw. it’s binrw that has these neat decorators, like that:

#

oh actually it already does what i wanted to implement (that [br(count = bone_pile_count] thing)

#

though i’m still interested in making a similar thing

ornate quiver
#

oh those are attributes
they're parsed by the #[binrw] proc macro

spark tiger
spark tiger
#

i need some help with xcode blobcatcozy

fleet cedar
#

I think your best bet is a sledgehammer

viscid grove
#

are you running macos on a steamdeck?

ionic lake
#

this is the illegal steam deck they don't want you to know about

severe python
atomic brook
#

Probably remote desktop

#

There's a fps counter

ionic lake
#

yeah i just saw that

spark tiger
hoary sluice
#

@placid cape woo nlp works

#

its an actual voice assistant now

#

that can process natural language

#

the query here is "whats the weather in new york"

#

what may be the current climatical conditions in the great city of new york also works

#

so does If I were to step outside in new york, what kind of sky-and-air situation would I find myself in?

#

aertoulrvtoutlrdaetdrnaetdsraendtaersndtaerndtaerndtaesrdntea weather stdoulswvoulhtaesrndtaernd tourlwouvt new rtaersoutvvlhoudtroutd rn york
it detects that its weather but it thinks its weather in "NEW Kunden Center"

#

problem is i cant test it with voice cause it doesnt recognize my mic

#

oh nvm it does work

#

oh my god

#

its only trained on a few cities

#

lol

hoary sluice
#

i fixed it by adding the spaCy geopolitical entity recognier to my pipeline but problem is it only works with english place names cause the speech to text assumes english

#

so i cant ask what the weather in my city is

#

maybe ill implement a language setting soon

#

or auto language detection by whisper

#

it doesnt recognize antartica as a place??

#

if the nlp doesnt recognize anything then it defaults to llmquery, which uses ollama, and if ollama isnt running it halts, catches fire, crashes and burns my ram (why??)

#

aaaaa

placid cape
spark tiger
spring pilot
#

The color of the donor role is slightly brighter than the cotd blobcatcozy

placid cape
winged mantle
#

i'm bored i wonder how hard it is to make a wayfire plugin

hoary sluice
fleet cedar
#

Why does that exist

spark tiger
#

tried to add some error handling to my code but it's so damn confusing

#

also it now fully works

atomic brook
#

Can't you just

self.read_exact(&mut bytes)?;
u32::from_le_bytes(bytes)
spark tiger
#

let's see

supple whale
#

holy shity

spark tiger
#

alright i'm done with rustrover

spark tiger
#

here we go blobcatcozy

#

i need some good theme

#

@hoary sluice @placid cape what theme are you using in zed?

#

not sure which to choose tbh

placid cape
#

Catppuccin Espresso (Blur)

#

from catpuccin blur

spark tiger
#

argh zed has this bug where pressing ctrl + . or ctrl + , does not work if you're on non-eng keyboard layout

spark tiger
#

oh you're using light theme

hoary sluice
#

nah jk im not crazy

#

catppuccin macchiato blur

#

/ catppuccin frappe blur

#

depends on time of day

#

but usually macchiato

spark tiger
hoary sluice
#

i could never

#

i just turned on catppuccin latte and my eyes started hurting literally instantly

#

u can try rosies catppuccin glass but i prefer the blur

#

catppuccin espresso looks good too but its a bit too dark for me

valid jetty
#

you can turn off blur it’s one single bool in the theme

spark tiger
#

time to benchmark

#

oh my fucking god why is it reading the r arg inside the quotes husk

spark tiger
spark tiger
hoary sluice
#

@valid jetty is it faster to cargo build release and then run the executable or is caro run just an alias for cargo build && ./out

hoary sluice
spark tiger
hoary sluice
#

why are u doing 1 run, does it take that long?

#

if so u can just use time

spark tiger
hoary sluice
#

it works for me

spark tiger
#

😭

hoary sluice
#

hyperfine -r 'cargo run -r'

#

works

#

u prob cant use ' in windows shell

#

use ""

#

For Windows Command Prompt (cmd.exe), use:

hyperfine -r 1 "cargo run --release"

For PowerShell, use:

hyperfine -r 1 -- "cargo run --release"

The -- ensures that PowerShell correctly interprets the command inside quotes.

#

chatgpt is prob right

spark tiger
#

WHYYYYYYYYYY

#

oh wait

#

i forgot to remove the println!s

#

fuck it's still faster isob

hoary sluice
#

run them individually, more than 1 run

#

cargo run cant be faster than cargo run -r

spark tiger
#

fair

#

still python is faster 💔

hoary sluice
#

remove the runs 10

#

just let it do its thing

#

dont do cargo run -r, do cargo build and then hyperfile the executable

#

i think u might be compiling in the hyperfine

spark tiger
#

oh

#

might be the case

hoary sluice
#

rust should be like 50 times faster

#

maybe not with file reads

#

but def not slower than python

spark tiger
#

though why is cargo run rebuilding it if no changes were done

hoary sluice
#

seems more reasonable

hoary sluice
#

warning: backend (bin "backend") generated 2 warnings (run cargo fix --bin "backend" to apply 1 suggestion)
Finished release profile [optimized] target(s) in 0.08s
Running target/release/backend

#

it does this

#

even in release

fleet cedar
#

That doesn't look like a rebuild

hoary sluice
#

it isnt

#

but it does something before running the program

#

(shows the warnings)

#

it has to start the compiler, figure out that it already has a compiled target, im guessing by hashing all the files in the project and comparing them against the existing executable (?) and that takes more time than running the python script

#

it also has to load env variables (RUST_BACKTRACE)

#

i dont think the exe does that

spark tiger
#

idrk how to fairly compare python and rust version since running both python main.py and cargo run does extra stuff which slows everything down, so i decided to ust time.time() in python and Insant::now() in rust and the results are:

  • rust: 0.5119 ms
  • python: 1.000881195068359375 ms
#

actually thought it'd have a bigger performance improvement

#

maybe because i was running only once

valid jetty
placid cape
#

time.time() depends on system's time

spark tiger
#

guh now it's 0.6974 ms for python

#

why is it almost as fast as rust

#

what am i doing wrong

ionic lake
#

🚀 Zed v0.172 is out!

Users have been asking us for a long time to give them the ability to customize their file icons. With today's stable release, you can now create custom file icon sets through Zed extensions. 🎉 This closes out an issue with nearly 600 upvotes (👍)!

hoary sluice
#

and if i try to build zed from source it crashes my laptop

ionic lake
#

skill issue...

gusty hearth
#

How do I add attachments to message? (Add pictures)
I wanna send message with pictures from plugin

hoary sluice
frosty obsidian
#

i thought we were a free market

valid jetty
#

openai REALLY want that $500b to shove up their ass dont they

royal nymph
#

if those things I heard about deepseek apparently stealing openai training data are true then it's not unreasonable to ban it in the US (although american companies should be held to a similar standard when using copyrighted material for training)

#

Instinctively said EU instead of US cause normally it's the EU banning everything blobcatcozy

valid jetty
#

20 years in jail for downloading it tho

#

like thats as much as a murderer would get holy shit

royal nymph
#

yeah that's a bit much but probably just said to scare people and won't actually be enforced

#

still insane

royal nymph
#

there's promptToUpload and uploadFiles

#

see which one is suited for you

gusty hearth
#

Thx ill try

hoary sluice
#

"yes they trained this ai on this other ai and now its better" like ???

hoary sluice
#

this is another "senator im singaporean moment"

valid jetty
#

they banned the word transgender from being included in academic research papers

#

every day i wake up to "breaking news"

#

is it even breaking anymore

hoary sluice
valid jetty
#

lol ive seen this so many times

#

2 weeks into trumps presidency btw :3

#

4 years to go

hoary sluice
valid jetty
#

LMAO yeah that was fucking insane

hoary sluice
valid jetty
#

trump wants to take over the gaza strip

ionic lake
hoary sluice
#

yea hes fucked if he does that

valid jetty
#

yea

hoary sluice
#

i dont see him trying that

valid jetty
#

he also wants to take over greenland for "natural security"

hoary sluice
#

thats just a stunt for media

royal nymph
#

it's important for a country to protect the interest of their companies over foreign entities especially if there's suspected copyright infringement / fraud that lets the foreign competition gain an unfair advantage

usually that's done via tariffs but you can't really tariff something like DeepSeek

not to mention that AI is a field where letting a Chinese company have control is very dangerous considering many people use AI as a source of truth / search engine and trust it

#

If China gets a strong grip on consumer AI, they could abuse that to suppress information and push misinformation / chinese government narratives

#

this field definitely needs to be regulated very soon or it will have bad consequences

hoary sluice
#

theres just nothing they can do

valid jetty
#

i have a better idea

#

shut down ai altogether

#

bring back society to 2018

hoary sluice
#

and whats funny is his reasoning behind this is to not give money to china, but the ai is free and using their mobile app or chat website costs them money

hoary sluice
#

make it illegal to get an ai phd

valid jetty
#

no that is not what hes trying to do lol

hoary sluice
valid jetty
#

hes trying to make an openai monopoly bigger than it already is

#

hes not trying to get rid of ai hes trying to make openai dominate ai

hoary sluice
#

i mean if his bill passes it effectively gets rid of ai

ionic lake
#

back when openai released o1, open source had no idea how to replicate the same, only took a few months

hoary sluice
royal nymph
valid jetty
#

i mean im both

#

but yeah

hoary sluice
#

i cant sleep

ionic lake
#

kibbler

royal nymph
#

ask DeepSeek about tiananmen square. do you really want that to be the future of information

valid jetty
ionic lake
#

honest opinion but its honestly really stupid that people keep asking that, you want an uncensored llm with 0 guardrails?

valid jetty
#

censorship isnt baked into the model its just the website

royal nymph
hoary sluice
royal nymph
hoary sluice
#

what

ionic lake
royal nymph
#

the average person who sucks at tech downloads ai app from the app store and uses it as a search engine and trusts its output

hoary sluice
#

the average person uses chatgpt

ionic lake
royal nymph
#

if China ever leads the market people will download deepseek and potentially be fed chinese propaganda

#

do you seriously not see the danger lol

royal nymph
valid jetty
#

everyone knows about it

#

they originally only censored it in english

#

so it wasnt even supposed to be for the chinese users not to ask about it

#

because they.. wouldnt ask in english

hoary sluice
# royal nymph do you seriously not see the danger lol

no i dont, search engines are gonna host their own models, theres gonna be non chinese providers hosting it for people, its mainly about the research, most chinese ai is gonna be open source and thatll lead to advancements

royal nymph
hoary sluice
valid jetty
#

if you control ai you control the media tbh

royal nymph
#

result of people getting defamed as antisemite nazis the second they criticise Israel in any way

hoary sluice
#

personally i think america is fucked no matter what happens im just happy the eu is doing ok-ish and i wish everyone would join the eu

royal nymph
valid jetty
ionic lake
#

it can be anyone else other than china

royal nymph
#

yes I don't trust american companies either

valid jetty
#

it shouldnt be openai having a monopoly either tho

royal nymph
#

they also need to be regulated in this field

ionic lake
#

but to everyone, china is a very big problem!!!

valid jetty
#

it should be an even split

hoary sluice
#

i think it should i honestly dont think my european peers or any of the elders would fall for chinese propaganda

valid jetty
#

but openai dominates

hoary sluice
#

this is just an america issue

royal nymph
#

the US government does not force companies to censor anything

ionic lake
#

political correctness in an chatbot platform gives me the ick yuck

royal nymph
#

|| unless it's like confidential US state secret ||

hoary sluice
#

they do more blatant propaganda but nobody believes them and nobody is going to believe them no matter what new ai they make

ionic lake
#

we will just let chatgpt go haywire with whatever controversial bias it may be trained on

royal nymph
ionic lake
#

easy

hoary sluice
#

im honestly surprised as to how concerned the us gov is about china

royal nymph
#

In many cases like tiktok they're way too extreme

hoary sluice
#

theyre scared china will become the biggesn economy in the world

#

and they cant do anything to stop it

#

banning tiktok isnt gonna do shit and neither is banning ai

#

"dont sell H100 to china" ok well sell it to americans who will hand deliver it to china

valid jetty
hoary sluice
#

tsa doesnt know what an H100 is

valid jetty
#

its like speaking to a person with a physically rotted brain

royal nymph
#

wtf is a magat

ionic lake
#

make america great again (twat?)

valid jetty
#

make america great again something idk what t is

#

but yes its pronounced maggot

#

UN HRC = united nations human rights council*

hoary sluice
#

they werent very useful either way

royal nymph
#

leaving the WHO is stupid but I'm glad they're being criticised

ionic lake
#

i should have been the president smh

valid jetty
#

i compiled a list of the things hes done so far lol

royal nymph
#

rosie so obsessed with trump

valid jetty
#

its so over

hoary sluice
#

rosie if you werent 9 when brexit happened would you have voted yes or no with hindsight now

valid jetty
royal nymph
# valid jetty

expelling trams people from the millitary
https://youtu.be/aotlEpmAFVQ

Gen. McBrayer discusses how valuable homosexuals are, and why we must never put their lives at risk by allowing them in the military.

For More Breaking News: http://www.theonion.com/video
Subscribe to The Onion on YouTube: http://bit.ly/xzrBUA
Like The Onion on Facebook: http://www.fb.com/theonion
Follow The Onion on Twitter: http://www.twitter...

▶ Play video
ionic lake
#

THE ONION

valid jetty
#

but either way appparently its because "procedures can take up to a year of downtime in which the person's readiness isnt up to par"

#

😭