#🪅-progaming
1 messages · Page 40 of 1
github prioritizes the new issue button over more common actions like sharing on the repo screen in their mobile app
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
they will somehow find a way to not use a template
also since when do github issues have types
the public preview started at the end of september
istg javascript codebases are impossible to understand
idk if anyone is interested but i was trying to find out how spicetify works, more precisely - how it calls spotify methods, like playback control and others. i found this but there's literally fucking nowhere in the code where this Playback gets assigned
i hate js cuz the amount of ways to just fucking set a field or something is hilarious
spicetify is probably so badly made
judging from their CLI I cant expect more from their mod
look at any extension
the beginning is always this
i dunno much about js but uh this doesn't look too good, does it?
settimeout is smth cursed imo
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
argh i just want to see how they're able to use the playback api 😩
doing a mod in a js application yet doesn't know basically hacks to avoid that
is Playback assigned to Player?
modding spotify sucks
it breaks and unpatches itself like x100 more frequently than discord
yeah uhh i dont think its made to be modded
neither is any other popular webapp tbf
neither is any other popular webapp tbf

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)>>
`
no pin
bwaah
also wtf why r u using rustc directly
i just copied it from zed
oh
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
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```
jumpscare I hate that too
insanity

@woven mesa is this very good?
no its very bad
i didnt mean it
idk
async iterators > all
async iterators -> suicide
wdym
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
im not using js
and its not about speed its about it being annoying
yeah i heard rust async iterators are sub-par
theyre not theyre just hard to set up if youve never done it before
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
It sucks needing to implement each combination of iterator+async+result+whatever separately
Gimme a proper effect system please
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
@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.
"leverages a heterogeneous ensemble of machine learning models and deterministic algorithms"
yea thats 100% ai
the whole sentence "This implementation leverages a heterogeneous ensemble of machine learning models and deterministic algorithms to achieve robust performance across diverse interaction paradigms."
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.
this site is bullshit
i wrote this sentence myself just now
it doesnt even say like 80% or smth
just ask ai
quillbot also has ai detector but its way worse
i mean my supervisor doesn't really know anything about ai and he probably doesn't care either, he's a chill guy
then you're safe
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
xdddd
https://ss64.com/nt/syntax-redirection.html (this is for cmd/batch, not sure about PS)
thank you very much!
who cares, a lot of papers nowadays are written with the help of llms
dude i went to this restaurant earlier
and their payment thing accepts negative tips
Stonks
FIRE
😭
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
Who the hell made html and decided target=”_blank” and target=“_self” was a good idea and easily understandable for what their purpose was
you love html spec
and then “blank” exists too
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

Imma murder the mf that wrote html
yeah lmao i did because i was testing it
the total was -9$ because i put more than the total
was hoping theyd give me money
did you tell them about it lmao
smh they scammed you ||(frfr ong)||
those papers arent graded
not yet cause ima look more into it once i get back from my trip, its a software that a few restaurants use
do they not use square
are u in america
"waiter gave me bad service so my bill is coming out of his tip jar" ahh restaurant
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
reminds me of indian mcdonalds delivery
i saw that the other day
i can bypass payment completely
and pay other peoples orders
do they have bug bounty
even if they dont im sure theyre gonna be willing to give u some money for a free food exploit
Big W
they do not, I did email them asking if they'd be willing to compensate for the information
i should also make a programming language in kotlin
wait kotlin also has this
wtf
i thought it was only a clippy thing
thats sonarlint
does anyone know how you lose some type inference on variables captured in anonymous functions
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
if they say no you get free food forever
alr nice
u do realize this is straight up illegal lol
mf out here extorting restaurants
nah im responsibly disclosing trust
for a small sum of cash
u cant withhold details and demand payment 😭
eh it's not extortion
and there's nothing forcing you to disclose vulnerabilities you find
theres nothing preventing them from bringing criminal charges against you for vulnerabilities you find lol
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)
and if they dont have a vdp or similar
they can just email back from the legal@ domain
it would be illegal if you were like "give me money or I will sell this on the black market" 👽
only police can bring charges
i dont see how this is extortion
sure they might want to sue him but thats completely different
people sell exploits legally all the time
even if you do everything "by the book" (responsibly disclose properly and give them all the info, even if you don't ask for a reward) you can still get sued by them and often will, happens all the time here in germany at least
no its not
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
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
not too familiar on the fine print of us law regarding that stuff but i learned that a rich guy or a company wants to fuck you they will find a way to do so even if it is on a technicality xd
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
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?
they dont have a bug bounty so i think its a small local restaurant
@green gulch how big is the business?
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
rooting for him 🤞
(honestly id just keep getting free meals with this method for a lifetime)
LMFAO
so just theft
this was a joke for legal reasons
someone would notice anyway one way or another anyway if you do it a few times
not worth it
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$
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
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
yeah prolly
@placid cape next person that im teaching programming will be starting with rust
interesting choice 🤔
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
i just tried to teach someone react without any js experience
ive had to teach someone who made a vanilla js website with chatgpt how to use nextjs
cause i wasnt boutta build him a router and login portal and evertything with just js
the restaurant itself has like 5 locations
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
did u email the restaurant or the software
cause that might be a decent paycheck if its used by thousands of restaurants
the parent company
I got on their live chat and had them make me a ticket
did u say anything yetr
I just told them the scope of the issue/the urgency and asked if they had a system in place for responsible disclosure such as a bug bounty etc
The support person was giving me a hard time
Started trying to sell me the software
what exactly did u say
saying do you have a system in place for responsible disclosure is very good wording
what did u say abt the scope of the issue
I said it can compromise customer information and cause financial damage to their thousands of clients, as well as damage to their systems
like did you say "i disovered an issue that can..."
I found out this morning that their merchant sign in page is vulnerable to sql injection
💀
I said like "I came across an issue that can..."
ok nice
I don't know if I'm going to even get a reply from them honestly
your own language?
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
i want to understand the parsing process
I didn't really access any data that wasn't mine, besides the sequential ID thing but that was also an accident
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...
Security researchers do it every day
in austria you are not allowed to guess wifi passwords, and its probably similar in the us
Nothing would really hold up
they do it whet theyre paid by the company
in your case it wouldnt, yea
Theres independents that do it
the sequential id thing is probably illegal tho
unless they have a bug bounty that allows it
And I wasn't really querying API directly, i was looking at the network tab on dev console from their website
did you go to theirdomain/security.txt ?
how did u find sequential ids from that
sequential ID i found from my friends order
oh lol
nor does the parent company site have it
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
he has lol look up
u mean the video?
oh shit i see
lmao
@green gulch hope they dont notice/ dont care
ah ok
so hopefully thats enough of a bribe to stay quiet
did u take the bill with u
I did it to test if it would actually take it
receipt?
yes
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?
id be surprised if i was the first one to try that
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
lmfao
i mean i think the waiter would definitely notice
they go to check their tip and see its -40$
for me yeah
not for the homeless dudes
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
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
uve used this before??
or u mean just normal payment
als
i was saying just cause the waiter didnt check the system
alr
even if they saw it, they'd assume its an error + i left cash
this would be really funny on a receipt
how to become a billionaire TODAY (join my whatsapp group!!!)
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
probably cause it causes an exception somewhere down the chain
or they might sue you out of your ass in the name of hacking
omg they probably use unsigned ints representing the amount of cents in the amount and it overflows and thinks u cant pay that much
he didnt do any hacking
i know, but companies will make up any reason
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
and this company isnt large enough to do that honestly
its not like
stripe
or square
those 2 def have a bug bounty
ok so this is weird
{
"code": 420,
"message": "Oops! Someone has already paid part of this bill. Please review and try again."
}
makes sense
even for unpaid bill
yea they do
420 isnt even a real response code
i think this means theyre using spring
a very old version of spring at that
i say you don't give them your exploit and use it to order free food 
i mean if they dont offer bug bounty ill just not reply
i say youre the hat and roll a 3
i really want to mess around with the sql injection on the merchant sign in but i probably wont
u should probably try to contact someone higher up if they say no
that is what could get me in the most trouble
they said the ticket was put in with the "executive team" but yeah ill try that
u could probably sign in with an admin account so mention that
actually no dont mention that
youve alr told them enough to make them issue a bug bounty
yeah
dont really know much about spring, how long ago would it have been deprecated
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);
}
it was already deprecated in october 2015 https://web.archive.org/web/20151025102238/http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/HttpStatus.html
also use the wappalyzer browser extension
see what theyre using
maybe spring isnt the only one that uses 420
yes, the language its written in
not finding anything
their entire code is just a single js file
they use the same one on customer end and merchant end1
wtf
??
they send u the server js??
no its the frontend code
js
but 90% of their handling/validation is client side
that reminds me
ever heard of life360
no
yes
pretty big
they had their auth secret in front end
[UNCHECKED_CAST] Unchecked cast of 'kotlin. Array<*>' to 'kotlin. Array<lol. koblizek. leap. parser. ExpressionBuilder>'.
Can't you suppress that error with some comment
lol.koblizek is crazy
i didnt use this name for ages ngl
its atleast a year since i dont even own that domain anymore
does it say type is a domain variable that couldve been changed at this point
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
my goofy ahh used my school email in all my commits
bro github desktop is so awesome
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
its ok but try to avoid unwrap
thanks; i'm doing it just for now so i don't need to fuck with Ok() and stuff like that
was trynna make it running asap :P
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
i just use neovim and rustacean.nvim handles everything for me
most of the time it either doesn't show actual errors or shows fake errors
yop i have nvim too, just find it kinda hard to get used to, though i admit it's very powerful and cool once you master it!
i'm thinking of using zed for rust coding
you cant beat the compiler
oh and ive set rust_analyzer to give it its own target dir so it won't lock up the main target dirs
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...
use zed
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
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
a bad algorithm will be a bad algorithm irrespective of the language
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
i didn't really configure nvim much, i just installed one of those like pre-built uh configs (astronvim to be precise). tho for some reason LSPs didn't work but somehow i fixed it by using zig to compile them (crazy aint it)
if its in the stdlib its optimal
oh lmao i use astronvim too
here u can just do fs::read_to_string(file)
does it not chew up a gigabyte for you or is it just me
tried using it but there were some errors
ima reproduce it rq
it does
you can also try using ra-multiplex
python is easier to use yes, but youd have to try very hard to write an algo that isnt purposefully inefficent (like adding a sleep(1000)) that is slower than python
it does, idk why but we can all afford it anyway
i mean everytime i run out of space the first place i go to clear out storage is my rust project so
running out of space is inevitable
burntsushi (who made ripgrep) got his uv target dir to 600gb
i thought we were talking abt ram
it uses 1.2 gb of ram for me
doing this results in a panic:
called Result::unwrap() on an Err value: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }
cause it has to load ur entire dep tree and all of its code
just tokio is like a gig
oh what wtf r u reading
the string is empty
just a binary file?
no binary for string
but why does it work with from_utf8 then
wait what are you reading
@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)
it reads.. to a string
thus u need to specify a string for it to go to
waow
let string = fs::read_to_string(filename)?;
dbg!(string)
nono no do that
its a binary
its non-utf8
That's usually spelled .expect("cannot read image")
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
you cant print error with that
.
he was tryna read utf 8
nuh uh
.expect() does print the error
use read_exact for that
read_to_string just takes in a string buffer for efficiency
called Result::unwrap() on an Err value: Error { kind: InvalidData, message: "stream did not contain valid UTF-8" }
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
guhhh stop reading to stringgg
maybe ur stream doesnt contain valid utf 8??
is the file valid utf 8
It's gonna print five lines of panic stuff anyway
😭 did you read the fact that its binary yet
what ive learned from rust is that the compiler is always right
yeah but i want format
!
Panics aren't for user-facing errors
hes been tryna read it to a string this whole time so i assumed its utf8?
they are if your name is @valid jetty
idk but reading a utf-8 string with that same file worked fine in python
idrk
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
i can send you some of the first bytes this file has
me im the user
cuz i'm not really sure how to tell if the file is a valid utf-8 or not
.
its not valid utf 8
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)
the file is .bfn which is not something i know and probably not utf 8
it's some proprietary file
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
should be a valid string
fs::read(filename)
Contains null bytes
it might contain valid utf 8 but to parse it as a string you need the whole file to be valid utf 8
Could theoretically be valid utf8, but it's certainly no string
not valid utf8
its like converting dnsrto45rn6old to a decimal number
456 is valid but the rest isnt
no, i just meant to show that i'm opening inhex to open this in a hex editor, this file has no relation to imhex, sorry for confusion! werwolv is actually the creator of imhex
https://adventofcode.com/2023/day/1 reference???
@spark tiger you should most likely be deserializing this instead, just read it as a Vec<u8> for now and parse it properly

chatgpt said WerWolv is a rust web scraper and uses bfn files
i guess thats hallucinated then
what is the file for
but it is?
god stop using chatgpt for factual information
so cursed
no not the dot itself
i said apparently
i knowthe dot itself is valid utf8 but thats not the point
the dot is but the whole file needs to be
valid
ur parsing the file not the dot
the whole file isn't utf-8 valid
i mean yes obviously the file itself is not utf-8, but i was trying to read that specific byte 2E
The file isn't text so whether it's utf8 isn't relevant
i have some small explanation here - #🧊-off-topic-iceman-only message
then just read it in a Vec<u8> and check the 5th byte
oh- i thought it'd consider the current position
why are u tryna steal assets lol
println!('.')
Or x.seek(4)?; x.read_exact(std::slice::from_mut(&mut byte))?;
huh what how, the implementation you provided for those has seeking reader that does that
??
It does, yes
It reads the entire remainder of the file into a String
the 5th byte is always 2E
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
hi guys did i can add new plugun ??
@spark tiger you should be using https://docs.rs/byteorder/latest/byteorder/index.html for this tbh instead of writing your own impl
This crate provides convenience methods for encoding and decoding numbers in either big-endian or little-endian order.
ah ok
your println comment adds nothing guh
+whatever the thing is called for this is not support this is pro gaming
vns you mean?
its the fastest way to do what he wants
huh what, you can see the implementation of that method
it is clearly not doing anything like seeking
so ur goal is to read specific bytes from a file?
what does println got to do with any of this
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!("{}", '.'); }
| +++++
i forgor 💀
i do that every time
im glad the rust people invented dbg!
forget it
If only dbg! wasn't terribly formatted
im so confused rn i pray you will not throw random code at me no more
I have the third most cursed crate on the planet to rectify that though
I mean yeah, but I just like the idea of implementing this myself rather than using a 3rd-party crate 
I don't really know why but yeah lol
you will have to seek manually then
it was a joke because he said he wanted to read the dot at position 5 so i just gave him a dot
currently you are not seeking
please know that your joke made me very confused
i got that yes
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:
read_exact does already seek when you call it so
Uh no it doesn't
It reads from the current position
(And advances the position)
huh what
No, seeking means jumping
Like seeking to position 0x1234 without reading the bytes before that
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
"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
That won't work, you'd need std::slice::from_mut to convert that &u8 to a &[u8]
The core operation of Read is read, not read_exact
Though they should have been called read_some and read
read_some isnt a good name either
and what exactly does this relate to
esp cause of Option::Some
cause read just reads some amount of bytes and then returns the amount of bytes read
Sure, the naming can be bikeshedded
got another question - what exactly should we use seek for if not for advancing the current position?
i think
The point is that the good name should go to the useful operation
For seeking to some other position
like i always thought seek is basically so you don't read over and over the same position
i think thats kinda the whole point of seek
For example if your archive says "file foobar.txt starts at position 970114" then you might want to seek over there
nah just read the whole file and drop the first 970113
can you not
we have kinda gone off topic anyway
so lets go on topic instead of derailing completely
@spark tiger what is your issue currently
What's the topic anyway
nah lets derail completely
the fact that they cant read this binary file
i mean i can just use that old way
it works fine
sure that's fine too
Not if it's not utf8
Just use std::fs::read()
this can also be used and is fine if the file is not like, gigabytes in size
just read the whole file 
ur reading the first 5 bytes here
Yeah if it's gigs you'll want mmap
the first 5 bytes happen to be utf8
no? i tried swapping read_str and read_int calls in my code and it resulted in different outputs
Wow calling different functions does different things?
Amazing!
cause read_int probably reads the ascii int from it or smth
lmao i meant swapping their order
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
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
is this actually a different output or is it just one in decimal and the other in asclii
i thought they didnt
ur prob right
makes sense
first results in . - 1
and the second results in - 771751936
What did you expect
The first one interprets bytes 0..=3 as an int, the second interprets bytes 1..=4 as an int
me when the hardware does things sequentially 
I think it's the kernel, not the hardware
argh i'm so confused atp
But that's quite off topic
the hardware doesnt do anything
if you dont have any more problems no need to change anything
shit up
the hardware just is
Hardware is irrelevant for most propgramming anyway
our professor drilled into us that vhdl doesnt have time
i mean as long as it works - probably no. i'm just left confused whether i need to add seek() call to each of my read_* function or not
no need
found out read_exact does advancing for you anyways
i thought it didn't but you learn new things everyday
well you either need to seek to the 5th byte or read the first 5 bytes
As another nitpick/advice, wrap your File in a BufReader, it'll be an order of magnitude faster
thanks!
Doing many small reads is expensive, so BufReader does fewer but larger reads
3 ns instead of 30 ns
the first, and since i do read_u32 which reads four bytes and advanaces the position, i don't need to seek, i think
I almost always do my io by reading to a Vec<u8> first (or mmap if large)
if you need the 45612789th byte instead of the 5th byte, you probably wanna seek instead of reading to it
oh yeah sure! but in our case the seeked bytes are needed so we just read them
oh u need the first 5, not the 5th?
i dont think most programs will be dealing with files big enough to warrant not using Vec<u8> anyways
Most won't, yeah
the first four bytes, which is u32, are needed so i know how big the string will be starting from 5th byte
ohh
Also that thing kinda confuses me as well. I mean when would I just read directly from a File or when I need to use BufReader or when I need memory map or something
lmao
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 
it wont be
also need to find a way to benchmark python and rust code
...so what i meant to say before discord died, was that you should always just read the whole file or read from the file or whatev and then if you specifically experience performance issues regarding reading from files, use bufreader or mmap
oh my fucking god finally
don't over-optimize
dis was the worst 12 minutes of my life icl
this was ur chance to touch grass 💔
so in my case i'd rather just read it all to vec and then do all my read_str, read_u32 stuff on that vec than reading directly from bufreader?
On the slice, rather, but yeah
forgot to say -- thanks to everyone! using rust has been very fun so far
bro
GOD BLESS JAVASCRIPT 🇺🇸🇺🇸🇺🇸🇺🇸🦅🦅
i wonder how that works though
like you don’t even know what fields you’ll get when compiling
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

interesting, thanks
maybe i can steal some of their code to make it work with binary 
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!
like, using serde for a binary format?
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
uhh maybe? but i was thinking of a thing that doesn’t depend on serde. the closest thing is probably nom
i want to utilize field decorators(?) like nom does
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
oh those are attributes
they're parsed by the #[binrw] proc macro
oh yeah, my python ass calls it decorators 
i need some help with xcode 
I think your best bet is a sledgehammer
are you running macos on a steamdeck?
this is the illegal steam deck they don't want you to know about
is this a hackintosh or a remote display
yeah i just saw that
idk i stole the pic off twitter 
@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
this is all its training data - What's the weather like in New York?
- How is the weather in London?
- Tell me the weather for San Francisco.
- Will it rain in Tokyo?
- Weather forecast for Berlin
- What's the temperature in Los Angeles?
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
poggers
i thought u became a <@&1042507929485586532> but that’s just the cotd 
The color of the donor role is slightly brighter than the cotd 

i'm bored i wonder how hard it is to make a wayfire plugin
GitHub
Anime Girls Holding Programming Books. Contribute to cat-milk/Anime-Girls-Holding-Programming-Books development by creating an account on GitHub.
Why does that exist
tried to add some error handling to my code but it's so damn confusing
also it now fully works
Can't you just
self.read_exact(&mut bytes)?;
u32::from_le_bytes(bytes)
let's see
its STILL getting updated?
holy shity
had to wrap it in Ok but yeah that works thanks
alright i'm done with rustrover
here we go 
i need some good theme
@hoary sluice @placid cape what theme are you using in zed?
not sure which to choose tbh

argh zed has this bug where pressing ctrl + . or ctrl + , does not work if you're on non-eng keyboard layout
solarized light
oh you're using light theme
nah jk im not crazy
catppuccin macchiato blur
/ catppuccin frappe blur
depends on time of day
but usually macchiato
i was gen considering using light theme actually 
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
blur for me is #🪅-progaming message
you can turn off blur it’s one single bool in the theme
are u on a 4k monitor
windows?
2k
ye
@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
i mean is it a windows issue?
oh i don’t really know, i’m trying to find any similar issue on gh rn
i just tried to add the runs command explicitly to see if the error will be gone but it’s not
it works for me
😭
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
o that fixed it, thank u!
WHYYYYYYYYYY
oh wait
i forgot to remove the println!s
fuck it's still faster 
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
rust should be like 50 times faster
maybe not with file reads
but def not slower than python
seems more reasonable
@valid jetty
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
That doesn't look like a rebuild
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
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
it probably doesn’t
use time.perf_counter_ns() in python for more accurate results
time.time() depends on system's time
guh now it's 0.6974 ms for python
why is it almost as fast as rust
what am i doing wrong
not in the arch repos
and if i try to build zed from source it crashes my laptop
skill issue...
How do I add attachments to message? (Add pictures)
I wanna send message with pictures from plugin
@valid jetty @placid cape were being fined 1 million american dinero and going to jail for 20 years https://www.404media.co/senator-hawley-proposes-jail-time-for-people-who-download-deepseek/
i thought we were a free market
genuinely the most fucking fearmongering thing ive ever seen in my life
openai REALLY want that $500b to shove up their ass dont they
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 
20 years in jail for downloading it tho
like thats as much as a murderer would get holy shit
yeah that's a bit much but probably just said to scare people and won't actually be enforced

still insane
look at how PetPet sends images
there's promptToUpload and uploadFiles
see which one is suited for you
Thx ill try
theres literally just no way to prove that other than by admission and its just another argument to make openai seem better
"yes they trained this ai on this other ai and now its better" like ???
basically he wants to ban any import and export of ai knowledge and unironically includes open source papers, so youre not allowed to write theses about ai anymore (there wont be any more ai phds), u cant write medical papers that involve ai and u cant publish anything related to ai (my voice assistant diploma thesis is illegal)
this is another "senator im singaporean moment"
whats new i guess
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
TikTok's Singaporean CEO Chew Shou Zi was grilled about his ties with China during a Congress session about the dangers children face on social media platforms on Wednesday (Jan 31). A US senator repeatedly asked Mr Chew if he had ever been a member of the Chinese Communist Party, to which he responded, "Senator, I'm Singaporean. No."
(Video: R...
lol ive seen this so many times
2 weeks into trumps presidency btw :3
4 years to go
that c++ paper titled "The undefined behavior question" that was deemed anti semitic by the board of c++:
LMAO yeah that was fucking insane
idrc what happens in america as long as the palestine ceasefire stays and we get one in ukraine too
you didnt see????????????????
trump wants to take over the gaza strip
ai outputs are not copyrightable
yea hes fucked if he does that
yea
i dont see him trying that
he also wants to take over greenland for "natural security"
thats just a stunt for media
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
that's what they say
the problem is you cant regulate open source
theres just nothing they can do
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
thats what hes tryna do
make it illegal to get an ai phd
no that is not what hes trying to do lol
i would love if china got a strong grip on ai
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
i mean if his bill passes it effectively gets rid of ai
back when openai released o1, open source had no idea how to replicate the same, only took a few months
china has much smarter people (prob cause they study like 16h a day, see the codeforces, aoc, and any other competitive programming leaderboard, its mostly china) and they arent as focused on money
you are either trolling or insane
kibbler
ask DeepSeek about tiananmen square. do you really want that to be the future of information

ok now clone the model locally and try again
honest opinion but its honestly really stupid that people keep asking that, you want an uncensored llm with 0 guardrails?
censorship isnt baked into the model its just the website
there is a difference between censoring potentially illegal, dangerous or sexual content and censoring things becsuse they are critical towards the government
china cant propagandise their ai if its open source, the deepseek api from deepseek.com is regulated but the actual model isnt, if you ask it to explain the tiananmen square massacre, itll start explaining it and then cut itself off midway through, if you ask it to explain it in leetspeak, itll explain it fully
but no one is gonna use the open source model
what
the first one is obvious, 2nd one is just about the same for any company of any jurisdiction
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
the average person uses chatgpt
well i just ran ollama run deepseek-r1

yes becsuse right now that's what leads the market
if China ever leads the market people will download deepseek and potentially be fed chinese propaganda
do you seriously not see the danger lol
no? gpt, gemini, etc is happy to answer questions about things that are critical of the US government
atp tiannamen square is a joke
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
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
why are you defending censorship
theyre very hesitant about criticising israel
if you control ai you control the media tbh
if anything that's just a representation of our society and probably part of what it learned 
result of people getting defamed as antisemite nazis the second they criticise Israel in any way
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
yes and that's the point and why letting China have control in this market is dangerous
true
i dont agree that china should have control
it can be anyone else other than china
yes I don't trust american companies either
it shouldnt be openai having a monopoly either tho
they also need to be regulated in this field
but to everyone, china is a very big problem!!!
it should be an even split
i think it should i honestly dont think my european peers or any of the elders would fall for chinese propaganda
but openai dominates
this is just an america issue
China is objectively much worse than the US in terms of misinformation / propaganda
the US government does not force companies to censor anything
political correctness in an chatbot platform gives me the ick yuck
|| unless it's like confidential US state secret ||
they do more blatant propaganda but nobody believes them and nobody is going to believe them no matter what new ai they make
we will just let chatgpt go haywire with whatever controversial bias it may be trained on
I agree but that's a different topic 
easy
im honestly surprised as to how concerned the us gov is about china
In many cases like tiktok they're way too extreme
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
have you seen a magat try to defend trump for leaving the WHO and UN HRC lmao
tsa doesnt know what an H100 is
its like speaking to a person with a physically rotted brain
wtf is a magat
no
word play on maggot?
make america great again (twat?)
make america great again something idk what t is
but yes its pronounced maggot
UN HRC = united nations human rights council*
they werent very useful either way
leaving the WHO is stupid but I'm glad they're being criticised
i should have been the president smh
rosie so obsessed with trump
its so over
rosie if you werent 9 when brexit happened would you have voted yes or no with hindsight now
it can affect us here in the uk, i need to be constantly watching while im still here
uhhhh idk
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...
THE ONION
TRUE
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"
😭
