#development
1 messages Β· Page 261 of 1
if let Some(lock) = locks.get(lock_id) {
if lock.locked {
if let Some(owner) = lock.owner {
if owner != event.thread_identifier {
let error = AnalyzerError {
line,
error_type: AnalyzerErrorType::ReleasedNonOwningLock {
lock_id: lock.id,
thread_id: event.thread_identifier,
owner,
},
};
return Err(error);
}
}
}
}
gotta love me some Rustβ’οΈ
would you like some divs with your div?
wait till bro discovers there are elements that do a lot of things from the box instead of having to code the CSS for them using a class
thats me but i still use div π
dunno, using a service that offers these classes, so yeah
exploiting the needrestart vulnerability on my unpatched server and it works
how did this even go unnoticed for so long
the same way as every other vuln do
Yoo
Can't you do something like
if let Some(lock) = locks.get(lock_id) {
if lock.locked && lock.owner.map_or(false, |owner| owner != event.thread_identifier) {
let error = AnalyzerError {
line,
error_type: AnalyzerErrorType::ReleasedNonOwningLock {
lock_id: lock.id,
thread_id: event.thread_identifier,
owner: lock.owner.unwrap(),
},
};
return Err(error);
}
}
The onwrap is safe because of the map_or
it saves some indentation at the price of being less readable
it's not that bad tbh
i use that a lot in my projects and it's still readable
map*() helper methods help a lot
yeah I prefer them aswell when I'm writing rust
but some people prefer more if statements to be able to follow the flow of the code easier
but I don't like to indent more then 4-5 times
well i used to avoid them because i afraid that it might harm the performance
and now i use them everywhere lol
pretty sure they don't, do they?
well... you lose a few microseconds, that's all
if let indentation hell is def something to avoid
oh interesting 
didnt know about that
i mean i could use let chains too, but they are still unstable
Really? If it's false map immediately invokes to false. And mapping allows you to unwrap which iirc is faster than implicitely unwrapping with an if let Some(). But I might be talking crap now I'm not really sure of that so take it with a grain of salt
Also the compiler should optimize these patterns no? I'm pretty sure the asm code is nearly identical
you should dive deeper into Option and Result helper methods, they help a lot in readability
Definitely
Option and Result types are what make rust so great
I even made a custom lil library in typescript so I have typesafe Option and Result types in my typescript projects lol
rust is literally syntactic sugar heaven
yup
if let Some(owner) = lock.owner && owner != event.thread_identifier {}
i don't recommend using unstable features until they're stable
is this swift?!!?!?
no it's the π language
not the pro language sadly π
Fair
I solved it a bit differently, could reduce nesting by inverting some conditions to use them as guard clauses
poggers
what are you working on btw?
Its an analyzer for traces. These traces log the order of acquire/release events of locks and im checking if the traces are well-formed (by checking some rules they defined in the paper this is based on)
oh interesting
Yea, thats part of my master thesis
But i was running into lifetime issues when i tried to refactor the individual match arms into seperate functions so i need to look into that
Currently i have a for loop where i iterate over the events and fill a HashMap depending on the kind of event. But when i moved the logic into its own function i ran into the issue that i needed to borrow the HashMap mutiple times mutable to fill it. Any ideas on how to solve that?
I can send more context when im home again 
damn you're allowed to write your master thesis in rust?
send me code of what you're trying to do
At least a part of it
I will later 
typical rust conversation π€£
me when my projects are boring af
same
π€ βοΈ you could use <section> and <article> to help identify distinct parts of your website
fire sticker
ty
I stole it
not nice
ackshually
π€ βοΈ you should add aria-* attributes in order to help people with disabilities
How do i center a div
The div:
lmfao i swear
@radiant kraken sooo
The basic structure is:
pub fn analyze_trace<'a>(trace: &'a Trace) -> Result<(), AnalyzerError<'a>> {
let mut locks: HashMap<&str, Lock> = HashMap::new();
let mut memory_locations: HashSet<&str> = HashSet::new();
let mut line = 1;
for event in &trace.events {
match event.operation {
Operation::Acquire => { /* logic */ }
Operation::Release => { /* logic */ }
Operation::Write => { /* logic */ }
Operation::Read => { /* logic */ }
_ => {}
}
line += 1;
}
}
I want to refactor each match arm into its own function but since im modifying the hashmaps in multiple places im not sure how would i achieve this
in multiple places?
meaning in multiple match arms
shouldn't that be fine tho? afaik you can do that as long as they are inside each match arm
hm, lemme try that again, maybe did i something else wrong
also you're missing a ; after the line += 1
besides that, your code looks pretty good, nothing i would refactor myself


Operation::Write => analyze_write(event, line, &mut memory_locations)?,
Operation::Read => analyze_read(event, line, &memory_locations)?,
e.g. this complains about cannot borrow memory_locations as mutable more than once at a time
i thought id be cleaner to move the logic into seperate functions
fn analyze_read<'a>(event: &'a Event, line: usize, memory_locations: &'a HashSet<&'a str>) -> Result<(), AnalyzerError<'a>> {
let memory_id = expect_operand(&event, &Operand::MemoryLocation(""), line)?;
if let None = memory_locations.get(memory_id) {
let error = AnalyzerError {
line,
error_type: AnalyzerErrorType::ReadFromUnwrittenMemory {
memory_id,
thread_id: event.thread_identifier,
},
};
return Err(error);
}
debug!("Thread '{}' read from memory location '{memory_id}' in line {line}", event.thread_identifier);
Ok(())
}
thats the implementation of the second function
and its complaining about cannot return value referencing local variable memory_locations and im not sure how im returning a local reference
i mean in the end, the code compiles when everything is in one functions so im not too worried but im curious how i would make this work
huh, i can't seem to replicate this
uh
is the error stack pointing exactly at those two lines?
these are the two error messages
for the second one, are you returning data from that match statement?
im returning Err inside the match and an empty Ok(()) at the end of analyze_trace
and im constructing the errors like this

memory_locations has the lifetime of 'a
you're returning a data with the lifetime of 'a as well (in this case, the error)
yeah
maybe you should replace the lifetime annotation for memory_locations to 'b like so: ```rs
fn analyze_read<'a, 'b>(event: &'a Event, line: usize, memory_locations: &'b HashSet<&'b str>)
also, replace that if let None = ... with if memory_locations.get(memory_id).is_none()
also, why are you referencing event again when it's already a reference? (expect_operand(&event, )
oh true 
hm, how would i annotate the analyze_trace. im a bit lost with lifetimes .-.
how would i read this annotation?
what do you mean?
like from the understanding of lifetimes, what is the relation between the two lifetimes
hm okay 
telling the compiler that the lifetimes differ should help with that compiler error iirc
i removed every lifetime annotation to start new .-. why is that the case: this function's return type contains a borrowed value
pub struct AnalyzerError<'a> {
pub(crate) line: usize,
pub(crate) error_type: AnalyzerErrorType<'a>,
}
pub(crate) enum AnalyzerErrorType<'a> {
MismatchedArguments {
operation: Operation,
operand: Operand<'a>,
},
RepeatedAcquisition {
lock_id: &'a str,
thread_id: &'a str,
},
RepeatedRelease {
lock_id: &'a str,
thread_id: &'a str,
},
ReleasedNonOwningLock {
lock_id: &'a str,
thread_id: &'a str,
owner: &'a str,
},
ReleasedNonAcquiredLock {
lock_id: &'a str,
thread_id: &'a str,
},
ReadFromUnwrittenMemory {
memory_id: &'a str,
thread_id: &'a str,
},
}
because of the string slices? should that be owned strings instead?
π΅βπ«π΅βπ«
Just a quick question... is it currently weekend on topgg in terms of votes? or not? I am so tired.... but i checked the code and should be fine... it seems to return True for the is weekend status with the topggpy client. tell me i am wrong... π
idk swift π΅βπ«
because AnalyzerError has an explicit lifetime annotation in its definition
therefore you must explicitly add a lifetime annotation whenever you want to use it
i don't think you should remove the explicit lifetime annotations tbh
so only two of my cogs are syncing slash commands and none of my other commands are syncing. How long does syncing typically take?
Its been over 10 minues since the restart
No
I invited it to a server I just made
what it do
im waiting on that
but right now nothin
later maybe
@ivory siren
#general-int message and this too
It went offline
-b 1308601169332928577 spam account
gulshan120#0 was successfully banned.
hai sis
hi
mme too
Hi guys, i've created an web app, i want some feedbacks
so pls become my feedbacker
This app was built in Streamlit! Check it out and visit https://streamlit.io for more awesome community apps. π
yes
yes

i'm your #1 stan :)
your biggest fan, this is stan
fr
Any good npm libraries for basic OCR?
Yeah, I wasn't able to find anything
tesseract ocr?
tessaract was okay. but bad. google vision is way better
o my bad, alr answered
google vision using api?
i made a captcha solver though...
] and j was a problem with tessaract for sure. even google vision had problems smtimes
tessaract
easy, good. shouldnt do any mistakes on that end. and free
Alright, thanks everyone
this one looks good but its outdated
it uses libtesseract directly, which is better than wasm
or you can make your own libtesseract wrapper with n-api
or testdrive node's new ffi when it comes out
I don't know if I can ask something like that, does anyone know how to get your domain up? Can't figure it out.
how to connect discord bot domain to my website
You add a record to the DNS records of your domain so that it directs to the IP address of the server where you host your website
in simple terms it's basically a global alias to whatever you point it to
When okay for example if I run it on Cloudflare
Arg okay
Do you have a Webserver? And port 80 open to public? and working?
Have you bought the Domain yet?
I don't know, I bought a domain last night, but they made a web server there, but I made one for my bot.
you bought a domain and they made a webserver, so you be seeing a site when you visit that domain?
But the webserver usually isnt included or is it in your offer?
might be a default site with the A record pointing to their webserver for such default sites
There must be some option to adjust your domain
och nvm. you said you run it on cloudflare π
so you just need to see where the option to adjust your domain is... And then you need to change the top most A record, like proposed here
maybe its calld 'advanced DNS'
Another example of my domain. this is a bit more complex and not for website purpose
paste @ in the name field instead of the domain name
I did that but it just changes it to my name.
Also changes need to propagate through the network... which the ttl says how often you suggest domain servers to querry for your address (they not obligated to do in that interval)...
Yeah. and you want a sub domain?
your server is not up and running
I can not reach http://109.176.202.68/
Oh
if i can't reach it via the above... you wont see any results with your propr domain
2 sec try straight
thus:
- Start your webserver
- open up at least port 80 to be open for public
- let th webserver listen to por 80 on incoming request
- respond to port 80 with a website or json object or whatever
- test again with http://109.176.202.68/
might as well open up port 443, because you will most likely also do secure connections via https soon
How do I make it a port 80?
Webservers usually are configured to port 80 by default
Okay
it depends on what you developing with... i can't easily answer this as i dont have enough infos
but lemmy ask this:
How do you test your webserver then?
localhost?
127.0.0.1?
VPS
Yeah okay. Thats... uhm like if you bought a pc... lets just imagine this... but there is no webservr installd on that 'pc' yet
nothing configured for it
accessing an url through http will already imply port 80 (port 443 for https)
Oh okay
you got to do it yourself
are you using something as a webserver? like nginx or httpd
ah, right, you just rented your server
No, I have created a dashboard for my bot that is coded into it.
is that dashboard accessible?
How do you 'see' your dashboard?
DASHBOARD: {
enabled: true, // enable or disable dashboard
baseURL: "http://beaverbot.xyz", // base url
failureURL: "http://localhost:8080", // failure redirect url
port: "8080", // port to run the bot on
},
ah, you're using a template
so I imagine you didn't attempt to access it yet right?
No
also, dont set the failureURL to localhost, it wont work in any way
localhost means "here"
but my "here" is different to your "here"
What should it stand on then?
well, some page to tell the user that the url is wrong/down
are you sure? nvm, u were answering the second question
Yes, haven't tried and gained access.
ok, so you'll need to first a webserver to process incoming requests
doing it raw would be possible too, but it'd be complicated
So use godaddy
no, I mean webserver like nginx or httpd
When no, I don't have it.
are you intending to host your dashboard in linux or windows?
So have a VPS server with windows
hm, with windows I'm not very experienced, but there are guides for it
Are you looking to set up Nginx on your Windows machine for web development or testing purposes?
skip step 2 since you plan to use cloudflare
nginx is a webserver that stays between your code and the world
so when someone makes a request to your IP it'll go through nginx which will route to the appropriate place
But I have coded my web server in my bot
yes
Can't figure out nginx
...I think you'll need someone who has a windows vps to guide you through this
Yep
windows doesnt usually run nginx
people mostly use windows vps to run something like WAMP/Apache
can you show which guide or program you used to make your dashboard?
Yes 2 sec
Can a send u DM
never used it, but i can see why
other languages you always have to compute that yourself
i prefer if you post here
okay the tesseract ocr is actually horrible
lmao rip
my bad... then maybe google vision api? gav me way better results but its paid whn u reach a certain usagelimit
doesnt seem to be available in germany for some reason
π₯΄
Then they changed it. my bad
was available in august
weird
whats the whole scope of the usecase`?
assisting my support team by automatically providing solutions to common issues
mhhm, team = work?
how often used?
ticket= 1x translation of screenshot consol to text?
well probably 1-2 ocr per ticket
send me an example image
well in current testing its mostly fine (since I only need portions of text) but that second screenshot messes up the versions
ah yes
there it is
how to manage from permissionOverwrites? discord js v14
You are welcome β€οΈ I hope this satisfies your needs
was bored, made brainfuck interpreter
in the end it wasn't that hard
just the [ & ] were a bit more annoying
the rest is just doing +1 or -1 to a variable lmao
now do a jsfuck interpreter /s
Hey, I got a question What permissions does a bot need to set a voice channel status?
im not sure if voice channel status isnt a thing yet with Djs or any libary code yet
It's not a library code
its code that uses node-fetch to set the status
idk if you could
?

like you can't say that this is good indentation, wtf is this mess
yes, this is the FORMATTED code
Still alot better the my classmate
I like it
Lot better than some shit i've seen in here
you sound like the type of person to dislike python's forced indentation /s
I dont mind it
@prime cliff surely this isn't how I have to do it...
<RadzenText Text=@("Name: " + _name) />
This looks...terrible
Shut up
@clear plinth (person deleted their message)
What the heck was that...
support scam
Bruh alot of support scam
They think they are smart 
@steady hedge
Anyway yea that's how you do it, inline text and combined variable has to do that ( )
Got the id
π
That looks so bad.....
I mean not really it's fine xD
I mean maybe im just not used to concatenation
I usually use template strings
$"Name: {_name}"
You might be able to do that too inside the ()
You can do it as Text="@( )" if that makes it any better :/
Bro
At this point
π
Meh its all good
@oak cliff @clear plinth spammer scam
is this blazor?
Yup
oh pog
Report issue here .@discordapp.com/invite\JgtqaaFH
Report issue here .@discordapp.com/invite\JgtqaaFH
Top tier auto mod
Ok that's a user doing it
xiuh is most likely still asleep lol
Indeed
@steady hedge go away
All the mod is prob sleeping atm
nah
we have plenty of mods living in eastern timezones
Indeed
but most of them are inactive
Ik and they are on leave i think
We need more (active) mods
nope
At somepoint is raid ping a good idea
nah this is just one guy
still 1
Fair point
Just ignore em
cosmic and sunil still respond to moderation pings so
Oh yeah i forgot
Not this time
Time to report the server to ticket tool bot that they are using 
lol
^
^
^
^
^
^
^
One message removed from a suspended account.
im adding them wanna troll?
wow that was a crazy convo
which one do you guys think is better? ```py
vs is a dict[int, ...]
vs = await ts.compare_bot_server_count(432610292342587392, 437808476106784770)
for first in vs[432610292342587392]:
print(first)
for second in vs[437808476106784770]:
print(second)
or...py
vs is an iterable, and can only be consumed once
vs = await ts.compare_bot_server_count(432610292342587392, 437808476106784770)
for first, second in vs:
print(first, second)
i'm writing a library and felt like latter would be a better syntax sugar, but realistically maybe the former
second better
alright, thanks!
starting a loop in python has an overhead so likely second as everyone said
python try not to incur a performance penalty doing literally anything challenge (hard)
pretty sure all langs that have enhanced iterators have some sort of overhead no?
tho the actual impact might depend on how it's implemented
for (Exmpl e : examples) {
...
}
``` is equivalent to ```java
Iterator<Exmpl> it = examples.iterator();
while (it.hasNext()) {
Exmpl e = it.next();
...
}
talking about performance when it comes to python... mhhm thats like talking about being fast, where as you only got by foot and others go by car. π
Python is fast in the same way that my 2013 ford focus was fast (compared to a horse)
i used three iterators to yield the output so it's not that performant lol```py
return c and zip(*((Timestamped(t, kind) for t in d[i]) for i in ids))
@quartz kindle ever heard of String.raw in js? Just found out about it
wow, thats interesting
sure, but running can get you far, assuming you use the right technique
nothing's wrong for getting the most out of something
just because something is not as fast doesn't mean you can make it run faster than the current implementation (it's rather naive to always assume the existing solution is the best one out there without reasoning)
no one doubting that
no one said that π β
so lemmy assume you think like this?
The big question is rather if its worth it
that's my response to 2nd clause of your sentence
and its definitely extra work to put into python when doing so
the comparison wasn't even something extreme
it was comparing 2n sequential operations to n sequential operations
so if you are heavyily cpu based and cant go to other native languages to compute it all.. then dont waste your time with python...
but its good to get things going ^^
most of the time you will be bound by IO before you can get to computational stuffs
also by trying to refactor and optimize the shit out of it you may fall into a state where you not able to build some features ...
hence optimisation is done at the end, when things are already working with the base impl
If you use python in an IO environment. yes. but thats just one usecase.
and not to mention python libraries can have c/c++ backend
people doing a bunch of ai/ml in python all the time
so this "performance" question depends
so you only be doing small programms that have a deadline and be done after that and do not need maintenance nor running on production? or what? ':D
but most of the time we are talking about algorithm performance (the number of operations it takes to perform a computation)
Idk about you, but i am rather thinking about bigger programms and that being said how good python is to build bigger programms... mhhm i dont want to talk about it... but maybe not the best choice
Yeah i know.... I aint saying anything against that lool
I am also heavily into python. dont understand me wrong
I know the pros of it
and have also developd AI's and done research in Ai and such... the AI's i have developed where mostly developed in python
again, it's to optimise the logical side of the algorithm, not the actual runtime impl under the hood
I am not dumb to now know that there arent any libraries
what do you mean by this point
"be done" here means you have a working implementation, and given that it's totally reasonable to optimize
what not to do however is premature opt
you let it sound as if there is a straight way of doing things and the will work out... people will do it right the first time they do.. nothing is going to happen if you optimize the running project... you be working and finishing your project and done...
Thats the opinion i am getting from you xd
But let alone the human factor in this equation... its insane. idk about u if you have worked with other peoples code or co worked with people at the exact same code and areas.... but i know how it goes
So you just talking about theoretical stuff here now? Thus you want to talk about O'kalkulus? Maybe about complexity theory? and how theoretical the cpu space and all is? xd How theoretical shall we talk about python... which shouldnt be talked theoretically xd its a practical example... in my opinion it wouldnt be good to talk theoretically about python... it would just not get us anywhere
Yeah... theoretically. but keep in mind others are reading here too...
theoretical stuff should be implementation-agnostic
if we talking pure theory, python wouldn't even be mentioned
and when talking about python... its not a theoretic model... its a practical implementation. so reviewing anything python related should be viewed in a broader space and on a practical view
*within python
good we agree
so you not looking at the code as a whole... but just at small code pieces
and u want to optimize individual operations
if needed
thus you do not do so, unless you got a cpu heavy operation(for example) and then sit down and see if you can get it done by another language and or omite being inefficient
and not thinking of the surrounding stuff
as of now (as far as i'm concerned):
- "the code as a whole" is the snippet
- that snippet's evaluation can be taken in isolation since it doesn't have observable side-effect
Whereas this work is indeed more with python then other languages like c++;
which bring me back to the point... what are we even talking about?
second one is an assumption. not true in practical in my opinon. But ok, you also stated 'not having observable side-effect'... so you may not see it asap.
ok, where is it then
talking about performance
when it comes to python
i was picking on this, because python doesn't deserve this much hate π
that was my original point
you said there can be a solution fond thats faster... I argued that no one said such a thing that the solution woulnd be able to be slower
now we discussing it out
and we agree in the point that you can opimize single isolated parts of code when needed.
without reasoning
hate? - I am heavily going for python since like 5 years xd
i'm not talking about your intentions
it was a pun, i guessed most likely
perhaps my message was lacking emojis?
oh how silly me

but yeah my point is, when talking about performance some people would assume the absolute runtime performance of something when the context is about comparing relative performance of different algos in the same medium, and i picked your pun up as such
apologies for the confusion
and unless one is really good, the first solution might not be the best - it's not like "i could optimise this but this is known to be slow overall so meh why bother"
what i inferred from "make it work, make it right, make it fast"
I just don't encourage talking about python and speed and trying to argue that its fast. Thats the main point. It is NOT fast. It can theoretically be fast in 'code snippets'. But anyone arguing that python is fast is the worst thing one can do... not generalising things... also no need to defend python. If you want speed go with something else. Stop wasting your time optimizing stuff then. its simple.
If you want to start out fast and build something, where you most likely wouldnt ever hit your limits of the cpu and else... you more likely to just abandon the program... thats when i say go with python.
So I encourage anyon going for python! but not building anything big onto it... as there is many pitfalls and considerations... And defining 'big' is also a thing thats hard to do... My big is probably bigger then most people will code things on their own
my point is not "python is fast" (although it is fast enough depending on your needs)
it depends on the bottleneck, and it totally fine to optimise if it's not ridiculous (eg. the algo, or different impl within scopes of the language's intended design)
and "fast" comes with "relative to what exactly?"
(fyi for my context it's "the same python program but using the 1st snippet")
we talked for so long i lost context
I'd not agree with "make if work, make it right, make if fast".
You should decide by case... And see if you need to make it fast... maybe rather save up time. I think time you spend developing is way more worth then getting things properly done.. Just shit a test project and see how it performs... then you can build a solid ground when its on market and performing good... or you can easily change stuff up to see how next version performs... then spending insane times at things you would probably not need in the future... it all depends on how oneself judges it. so... That being said... I value crap code a lot, as well as good and efficient code. But what I do not accept is having crap code as a basis or having exceptionally well code as a start up... But if you just do it as a private project and its just for yourself or learning or such... then might as well do whatever u want. why not experience this sh*t yourself? xd go for it!
i'd say for learning experience, it's worth it to see how your algorithm can be improved, logic-wise and impl-wise
you gain more knowledge about the algorithm itself, and language/runtime-specific knowledge
Now you tlaking again about bottleneck... that bottleneck may be true... but its not a code snippit we be looking at here then xd
I think we generally agree here.
I compare python being fast as with other languages that are popular and older.
go for it π Those reasons are personal/pricate once
wdym?
you thinkpython fastest language? o.O
Is this a language war or smth
i compared relatively to different implementation variants of the same python program
you compared python itself to other runtimes
i lost track
you might want to upgrade my LSTM model after this
tldr: arguing if we should argue about python being fast in different contexts and making sidequests to get things cleared as what cases we really mean and agree on.... in the end we both do not want ayone thinking wrong about python as the people starting the debate here seemed to have not clearly stated what they compare so it could look like python is either crap or good to others reading
Thats the main point of this conversaton. yes
I do not try to proof a point
I try to convince others to NOT talk about python when it comes to performance
we already have type hints
my point was that it was never python in the first place
it was rather the operations itself
and its too complicated for others to understand
Ψ§ΩΨ³ΩΨ§Ω ΨΉΩΩΩΩ
and well "others" only concern the active party that are related to the question
as long as the one who asks understands, i don't see a problem
we can choose to explain, if other wish to know
your LSTM is good xd maybe decreae the decay rate lool
so if we have type hints, you can technically compile python
feed it to LLVM
and bam
So we talking about algorithms and or small operations and not anymore about python? xd
i mean it's both and none right?
there are two kinds of opts, and one of which doesn't really care about what it runs on
'others' => anyone reading... this includes kids who dont know sht xd There is way more stakeholders that need to be taken into account
and viewing in reality people wouldnt ask to explain mostly... but i hope you know that already... and dont want to dig down on those reasons... so thats... not how it works...
what?
if you don't want answers, what's the point of asking?
one asks because one wish to learn more about the very thing one asks for
(unless i get your message incorrectly)
with the knowledge i got from the social activity i had and all experiences. I say no. PEople wish to have others ask. but thats not true. they do not accept that they do not ask. especially people in the area of informatics tend to not understand social actions/emotions /interactions and all very well. thus they are most likely assuming people will just ask. but thats a fatal assumption. They will most likely NOT ask. especially NOt if it gets to complicated
i'd say their lost
we can only assume so much about possible intentions
no one talked about not answering? o.O
also someone asking or not doesnt make the point of asking obsolet
wtf
Right, now to talk about whether or not asm is good
if someone doesn't ask, there are a bazillion reasons as to why that action was taken
we will never know
you ask because you feel the need to ask and you asking because you encouraged to do so any you are feeling confident about understanding the answer and not being shy and 100 other reasons that come into account here
good for
We need to make roller coaster tycoon 3
you authistic?
again, we can't take actions for em
we don't even know who's looking at the chat rn, let alone their intentions
Thats the point where you be looking at the small details
use MSIL for easier time (at least it allows you do to procedure decl)
and you assuming the world around you acts like you... and shall act like you. you do not take repsonsibility for what you dont want to see
rather then seeing the whole picture
Is this turning into a philosophy lesson tf
its okay
the main point is to explaining to the one who asks
putting them in words that 3rd party can understand, is good, but it's extra
it appears that you overthink
No
yes and no.
yes.
i think based on what i see
just simply refuses

yeah... but you right. i am overthinking things..
perhaps you think so much further that your words clipped out of bounds
probbaly. you are probably right
don't think for what you can't see
saves your head some power
i tried the same before and ended up not doing anything
i might appear like an ignorant (insert profanity here) to you, but that's what i see
Im like genuinely confused
you are not alone
i'm the main participant and i'm very perflexed
anyway if you are interested in roller coaster tycoon 3 in asm, i'd recommend MSIL
someone made a horror maze game with it
yeah, that doesnt help anyone... not even the company i need to lead with 5 employees which is suffering from decisions where i do not take into account all stakeholders and yet i got virtually no control of the cash income and or mood of anyone, only by complex thinking... let alone other things i got to manage besides that....
So yeah. I am definitely overthinking this here and should stop. and save power for other things. But it was fun talking to you β€οΈ
mhhm thats a bummer.. I feel sorry for you :c
Good thing is that i do not overthink this hard and get lots more work done then anyone else and building a stable basis at virtually anything i touch. Maybe you thought to hard :c
it was a thought-provoking conversation yes, my kudos to you
if i thought too hard this convo wouldn't begin 
have a nice day, and may your company prosper
so happy to see you bring positivity everywhere sis
@radiant kraken is rust being dumb or me?
then i remove and obviously
nvm, it was me
could've said i forgot the #[cfg(test)]
lol
yeah but i dont see the point of it
i dont understand those tagged functions shit at all lol
how did i never know this π
this is actually really useful
it's like python or rust's r'thing\escaped'
β
yeah its very helpful if for example you have text that has backslashes in it, js will by default escape it but sometimes you dont want that
using string raw lets you paste it in and JS will treat them as literal backslashes so helpful in windows paths for example
sort of a developer only helpful thing
@radiant kraken i think i am doing too many things in threads?
oh lmao understood the chunks() method wrongly, woops
thought it would create 8 chunks of equal number of elements
but it creates x chunks of 8 elements
so i created like 450+ threads instead of the 8 i wanted for testing
linux when you try to open more than 1024 files at the same time π π
iirc you can override limit
@civic scroll @pearl trail @covert gale @earnest phoenix the ultimate rust experience
so much memory safe
hell yeh
yeah with ulimit but not ideal
i love exact file format descriptions: "The first few bytes store metadata [...]" what is few??
probably the first 4
where can i ask for someone to make me a discord bot?
@shut cobalt
You seem to be asking for something you don't have experience for or something that hasn't been done yet, but really need for your bot/server.
You can hire developers from Fiverr or Freelancer to code the things you need for your bot/server.
love to see it
ngl rust is too safe
I feel like thats the point of rust
r/programmerhumor ahh post
Hello i hava a question im using discord hybrid sharding and now top gg displays me 145 servers but my bot has 430 servers when i remove sharding its working how can i fix that i need to use await client.cluster.broadcastEval('this.users.cache.size'); to get the total guilds?
Only showing my own personal information but I love making these kinds of programs.
Looks privacy invasive, congrats
Would also propose to make the background red and text yellow though
Will be as readable as now 
im tryna squint as hard as i can this is working
pog
i opted for white background with yellow text
even better
And how do I tell people to vote?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
pretty much what she said
I find that unethical
Alright, I'll add a command for that
π
that's what most/some bots on topgg use
Give them rewards (currency etc)
Or lock commands
Or hope that they think the bot is really good and they vote them self
provide perks for voters
ifs its an economy bot, give stuffs on voting
if not, set few commands to only be used by Voters / Patrons (If you have)
Can anyone give me the node_modules file, please?
you don't get 'sent' the node_modules folder, you need to run the npm i command in the directory of your bot
It tells me I have an old version.
please send a screenshot
I don't have the folder anymore, I deleted it.
i meant of the error message saying you have an old version
I no longer have the error that I was looking for that folder.
Wouldn't it be easier to ask the support of the hosting you use?
it is on my computer
Can't you give me that folder?
No, its something that is generated when you installed a lib
Via npm i
Download*
node_modules is a folder that contains all the npm packages your project requires. I don't know what packages and versions your project requires, that's why there is a packages.js file where all the packages and their versions are placed. They are then installed automatically using the npm i command
- Go to your folder
- Open commend prompt
- Type
npm i - Enter
- Wait
-# Note: this assume that you have packages.js ready
Packagedotjson
π€
If there is an error, please said tell us and we can try help @dense glade
Can I send you a friend request and when I get home I'll message you? I'm at work and can't really talk.
I dont accept friend request, if you need help, you can ask here
Thank you very much for your understanding.
it means I don't have package.json ready
Install the module via the step i said
yessir thats correct!
One message removed from a suspended account.
You know who they are
There is a reason I have it in my fr list
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Fr sent
One message removed from a suspended account.
has anyone used oracle cloud hosting?
wtf they giving 36 Cpus and 200GB RAM in their free tier
but its arm based tho
do note it's oracle
Yeah you will never actually get one of these though
they canceled my account for no reason and deleted everything i had there
They have a βlimited capacityβ of those and everyone and their mom is running scripts to snipe them 24/7
Sad reality when it comes to free stuff
Hmm
Not the only one lmao - happened to me and quite some others I've see that used it
yep, same here
tho in my case it was warranted lmao
got 24h cloudflare ratelimit when I accidentaly caused too many 4xx errors, so I set up a proxy server on oracle's
when you donβt know what to host on vps:
Thats with usage limits afaik.
Their use as much as you want teir is 1 shared cpu and 1gb of ram.
We dont ban for friend requests
ye they invited my bot to their server
so
also they did same thing to me
but @solemn latch is right mods cant ban people because someone sent a friend request
One message removed from a suspended account.
Isnt it an edit mention
One message removed from a suspended account.
One message removed from a suspended account.
hi chat
trying to set up
next auth and trpc
and i keep getting this zzz error and idk how to fix it
it's beautiful I know
nevermind
transpilePackages: ["next-auth"],
rust users realising the language doesn't protect them from race conditions or bad code
unwrap them all
unwrap is great
it forces you to face the fact youre choosing not to handle a possible error properly
and wrap it back with js
Wooo fully working roles and permission system 
Dividers where? XD
Hello π€
for discord? like just wrapping that permissions system of discord to your own layout? π or what is it used for?
Django comes into my mind to achieve this with little effort ^^
For my own website project
Django is ok at best but i don't really want clutter
π
A bunch of developer tools and server/docker management
:/ very informative
The magnifier glass is a search box
Ah that yea i could do something like a slight background with space or something
Im not a webdev π Just touching in here and there ^^
But I havent felt like django is clutter. :c
Though its pretty fast to setup! π
It wouldn't really work well with how custom i made this anyway
Asp.net identity, mongodb, outh support and 2FA with webauthn support too
looks nice!
couldnt do better with django nor anythign else ngl
ye
oke
you're learning rust??
nah
so pro
nah
annyeong
One message removed from a suspended account.
yews???
A framework for creating reliable and efficient web applications.
not to be confused with
https://runescape.wiki/w/Yew
Yew trees are one of a variety of trees that are interactive scenery found in various places. Players with level 70 Woodcutting can chop a yew tree to obtain 187.5 experience and yew logs, which are used in Fletching or Firemaking. The respawn rate of yew trees is 15 seconds. As with all trees above normal trees and achey trees, yews can yield m...
I was confused, thanks
Thanks
One message removed from a suspended account.
π
jokes on you, confusion is my natural state.
jokes on you, confusion is my daily
holy shit
io operations in node
are so bad
10 minutes to do something
write it in go
and invoke from node
done in 10 seconds
bye
Thatβs either a problem with how youβre doing the IO ops or a βthis is too much data to processβ problem, in which case thatβs not an IO problem
@surreal sage are you using fs promises, fs sync or fs write/read streams
it all heavily depends on how you're doing it. reading and writing data in a loop with either fs promises or fs sync would be the slowest but most memory efficient. Doing a Promise.all would be the fastest but take the most memory and using fs write streams could be a good balance assuming you manage how many ops you're trying to do depending on data size
nodejs actually has really good IO and I use node as a backend for my website and wherever possible, I use fs read streams and pipe those to the response body
Fully agree, read streams are crazy fast
They can easily fill my 10gbit network without issue
I am writing the most cursed number logic known to man
Writing a pure JS lib for essentially 64bit floats and the way it works is how a normal human would do arithmetic
Will have all the js operators support (in the form of class members)
think BigFloat(1).add(1000).mult(2).pow(2).div(5).sub(10)
(also supports modulus, but wanted a cool output which is 801590.8)
This only shows regular numbers, but the base would be able to exceed the Number.MAX_SAFE_INTEGER and reasonably any limit on the max number representable by BigInt as it's backed by strings, but has a hard cap on the precision of the mantissa of 16 characters.
Can convert int, float, bigint, string and undefined to this intermediary representation. string obv gotta be in the format of an int or a float
Performance might be ass so I don't expect to use it for anything other than what I intend which is my bots economy to calculate any final value from multipliers.
It's already overflowed the max safe int a long time ago
Can someone explain to me what an ECS is and how its used? I've looked at several sources online but no one seems to be able to really give a good explanation on how its used, but rather how to implement one yourself
Im still confused on topics like, how to use a ECS to interact with game logic, like unity for example.
They have game objects, or UI, or anything physically in the game, but that doesn't make it an Entity, it only becomes an entity when you "spawn" it with DOTS.
Problem is I dont understand how to interact with the game world, from the ECS "world". This goes for any engine with an ecs as well, I dont get how you are meant to mesh the two. Since it seems to me an entity is meant to be separate from this "game world", and not have any actual behaviour
I am going to be adding my bot to your website directory but in the step 2 create your bot listing it has a field "Top.gg Server URL" what is this as I can not find anything on the site about these servers?
amazon ecs?
thank you
in unity? or general
In general
fs.promises.open
go cpu usage is also better
won't be switching
An entity is just instances of components wrapped up into one object
Components are what provide behavior, the entities themselves can sometimes have some custom behavior, but most of the time theyβre just shells for the components to act on
Whyβs that
The idea is that components are sets of reusable behavior that can be applied to as many or as few entities as you wish
it's basically OOP
Well, take unity for example. You don't have to use their ECS, you can function normally without it.
Though if you use their ECS its not like it replaces everything, its just an addon. You still want to use game objects and such, but not everything is an entity.
So how would I interact with those game objects from the ECS
Game objects are part of unityβs ECS. Their whole engine is centered around ECS
Modify their transform properties, mess with their physics etc etc
Well no, from my understanding game objects are not entities
until you bake them
but either way, im wondering what the role of an ecs is
An ECS is primarily used for performance reasons
Iterating over tons of objects that are not living in contiguous memory blocks is very expensive
How do you interact with say the player from an ecs, without getting all players? Systems I know are a thing, but that seems to function on every thing that has X component(s)
You create a script component that runs a script on the object itβs put on, thatβs one solution
Thatβs Unityβs typical approach
Even scripts in Unity are technically components, thatβs why you can drag them onto your game objects

Then how does the ecs know game state?
or more specifically
For example a player takes damage, how does an ecs handle this and update the component data accordingly? As the stuff that happens in the "game world" is separate from the "ecs world". At least from my understanding
Usually the systems are updating every frame, some less than others. The systems are what update components
This is starting to get out of my realm of experience so I donβt want to mislead you on accident lol
Nah its all good
Itβs been a hot minute since Iβve done game engine dev
Im honestly probably jumping into the deep end
Im not even trying to make my own engine
just understanding how ecs works so I can apply it in unity or any other engine I end up using
Hereβs a good read on the implementation of an ECS, it might give you a better understanding of how it works: https://austinmorlan.com/posts/entity_component_system/
Ever since first hearing about Entity Component Systems and their implications in game development, Iβve wanted to build one for my own usage and knowledge. There are a few examples that people have built and posted online (1, 2), and there are a few full-fledged ones that can be used to build real games (3 , 4).
I liked different aspects of eac...
most games have FPS and UPS, the latter is how often game state is updated
Obviously this is massively simple for an ECS, and real ECSs have other problems to solve like signals, events, etc
so there's a secondary thread going over your entities and updating things
usually fixed at 60/s
Thereβs a point when it just clicks
the scrubbers are the update thread
the sliding thing is the renderer
ecs allows the update thread to be very efficient at running over everything doing calculations
icic
Honestly im just not sure what I should make an entity with DOTS and what not to
waffle had a ship game using ecs iirc
could take a look at it if it's open source
I dont think it was made with unity tho right?
nope, it was raw ecs
You made the ship game :p
I made a different game that sucked ass bc I had to meet deadlines
nah, it didnt suck
You can take a look at my PhysicsSim GitHub though
That one is a very basic ECS implementation stolen from that article
It shows you how systems act upon components and how entities are tied to components
idk if this is a dumb question
but how do I know when I need to make something an entity / component
Entities are just IDs
Thatβs an oversimplification but in simpler ECS systems, entities are literally implemented as integers
Components are the data associated with an entity
Systems act upon the components to change their state
"Aaron" (the name) is the entity, yourself as a person is the component
Entity = object
Components = instance variables
Systems = methods
If you want to think about it in terms of OOP, this is a decent analogy
I see
So my player would be an Entity, and Health, Stamina would be Components and then i'd have systems that act on these components?
Yes
Well
Then when im querying for the Health component, how do I not accidentally get enemies if I want to only get the player
cause enemies also have health
would I make Enemy and Player components (or just Enemy) to better differentiate?
You can query components for only a specific entity in some implementations Iβm sure
Iβm not entirely sure how youβre βsupposedβ to do it, since I havenβt done enough of that to really explain it well
the player would be linked to the controller itself, or you could check only for instances of Player
like, class Player extends Actor and class Enemy extends Actor
actor would be whatever is shared between both, like life, stamina, gear, etc
I think usually this is why scripting starts to get involved
Audit logs with nice filtering and extra info
I see thanks
Heeya, yall favourite cat is back
const voiceChannel = interaction.member?.voice.channel;
const connection = joinVoiceChannel({
channelId: voiceChannel.id,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator,
});
const player = createAudioPlayer();
const resource = createAudioResource(
path.join(__dirname, "./music/audio.mp3")
);
player.play(resource);
connection.subscribe(player);
player.on("error", (error) => {
console.error(`Audio player error: ${error.message}`);
});
the bot joins, no errors, yet no music playing
403 means you are not allowed to use the API without a auth token
i have auth token
can i send the code with token here?
you dont, you dont have aproved bot in topgg
i have
https://top.gg/bot/1016392200516550736/webhooks try resetting the token then
ok

Commandd
if not a prefix I wonder what you use

slash commands? mentioning?
Thats weird. Just write the command straight up
Though that's awful design. People could trigger the bot unintentionally
The power of your mind. You think about the bot using a command and it does it
Hell nah
π
Theres a lot of bots that do this, my favorite ones dont filter out bots messages.
get two of em, and cause a loop
IIRC there was a bot a long time ago in the bot reviewing server that responded to another bots commands.

yeah
Bruh
ok?
just imagine saying helo me guys and the bot responded first before the boys
hell na
yea that will be annoying thing


The funniest thing is that it looks like their website is 1:1 the website of another bot
They even forgot to remove the link to their Patreon 
no prefix means
anyone know why my bot description looks weird in top.gg but looks fine any other html preview?
any reasons for it to be happening?
using prefix cmds without using prefix
t!
I know what it means
hmm
fake server count?
it is listed as it is in 806 servers while the actual one is 422
idk idc
all the server counts been off,
but
tf
prefixless commands is asking for trouble
indeed
image for comparison please
?help in #commands
I must not
Slash commands are the greatest thing to grace bots
scale from 1 to 10 how badly do i want to kill myself: 10
Making some really good progress
is there any module recommand to do TTS?
-1 since it's just an eslint error. Follow your eslint rules!
Idk any myself, but it'd be helpful to mention which language you're using and if you expect like a lib or a standalone self hostable api or something similar
I use js
I have try the google tts but I scare when upload to the host and it won't work
hey is there a way to check if a song is copyrighted?
3 minutes of my life wasted
do better next time /j
discord tts or tts in general?
Tts in general @lyric mountain
well, there are quite a bunch of options out there, you could select 4 or 5 and give them a try
dependabot my opp
https://devspace.fluxpoint.dev/teams/fluxpoint/settings how is this demo of a project i'm making?
Done a bunch of work on the team settings stuff, roles list is missing though.
Is this like portainer
Server, docker, website and project management with other dev tools so yea a bit like portainer but more features and control π
Portainers roles and access sucks and other annoying things
Sounds cool
there's no more <@!user_id> in discord's message?







