#💽Programming Chat v2
1 messages · Page 20 of 1
knew it
lose weight before your chair explodes
dear imgui reference
yo minecraft iMessage?
@spare quartz
macro_rules! _parse_slash {
// Extract #[choices(...)] (no Option supported ;-;)
($ctx:ident, $interaction:ident, $args:ident => $name:literal: INLINE_CHOICE $type:ty [$($index:literal: $value:literal),*]) => {
if let Some(arg) = $args.iter().find(|arg| arg.name == $name) {
let $crate::serenity_prelude::ResolvedValue::Integer(index) = arg.value else {
return Err($crate::SlashArgError::new_command_structure_mismatch("expected integer, as the index for an inline choice parameter"));
};
match index {
$( $index => $value, )*
_ => return Err($crate::SlashArgError::new_command_structure_mismatch("out of range index for inline choice parameter")),
}
} else {
return Err($crate::SlashArgError::new_command_structure_mismatch("a required argument is missing"));
}
};
// Extract Option<T>
($ctx:ident, $interaction:ident, $args:ident => $name:literal: Option<$type:ty $(,)*>) => {
if let Some(arg) = $args.iter().find(|arg| arg.name == $name) {
Some($crate::extract_slash_argument!($type, $ctx, $interaction, &arg.value)
.await?)
} else {
None
}
};
// Extract Vec<T> (delegating to Option<T> because slash commands don't support variadic
// arguments right now)
($ctx:ident, $interaction:ident, $args:ident => $name:literal: Vec<$type:ty $(,)*>) => {
match $crate::_parse_slash!($ctx, $interaction, $args => $name: Option<$type>) {
Some(value) => vec![value],
None => vec![],
}
};
// Extract #[flag]
($ctx:ident, $interaction:ident, $args:ident => $name:literal: FLAG) => {
$crate::_parse_slash!($ctx, $interaction, $args => $name: Option<bool>)
.unwrap_or(false)
};
// Extract T
($ctx:ident, $interaction:ident, $args:ident => $name:literal: $($type:tt)*) => {
$crate::_parse_slash!($ctx, $interaction, $args => $name: Option<$($type)*>)
.ok_or($crate::SlashArgError::new_command_structure_mismatch("a required argument is missing"))?
};
}
what is this
$
if I got a dollar for every $ in that
I'd be
still poor, but less poor than before
rust macro
what does it do
Your mom
mrowwwwwww
WTF? 😳 OpenAI whistleblower found dead in San Francisco apartment: Suchir Balaji, 26, claimed the company broke copyright law. Balaji helped gather and organize the enormous amounts of internet data used to train the startup’s ChatGPT chatbot. Information he held was expected to play a key part in lawsuits against the OpenAI https://www.mercuryn...
mrowwwwwwwwww
wh
why is he named like this
ai slop..
which average do you intend on keeping btw? I was thinking about it and im honestly not sure which one would be more correct
haven't decided yet
maybe a windowed one would be better? I'm not sure how to judge which one would be what I'd expect
I think I'd expect a windowed one but wouldn't notice if it wasn't
so maybe it doesn't matter lol
Is that Elon musk
nuh uh im doing this rn
👎
👍
he's turning birtish..
its over..
l websites.
Social media is too limiting. We believe that everyone should be able to freely express themselves in their own little corner of the web, without having to worry about things like algorithms, tracking, or advertisements.
Nekoweb is free of any advertisements, and is run completely by donations from its users.
Join us on our discord to chat with the community and the developers!
without having to worry about things like algorithms, tracking, or advertisements
Join us on our discord
ble
did some eye tracking programming and settled for an algorithm instead of using ai
because erm i only have raspberry pis and they might die
Just wanted to say dB is the most insane unit known to man
I had to touch surface level signal processing and antenna theory for something a while ago
It was hell
People who major in that are insane
i love having -80 dB for my internet connection
ialso love having 250 dB for my military sonar
dB being log scale does not help
And then there being dBm
dBi
dBd
I wish it was simple 😭
todo
log eventcleanup connection pinging eventlog colors- fix button animations
adonisne3phosphate
yes thats my name hello
❌
no
commas are weird
❌
yeah just needed to be sure
..., ...
turns into
...[1], ...[1...]
local t = {1, 2, 3, 4}
local function a(...)
print(...)
end
a(unpack(t) :: number) -- 1
a(unpack(t) -- 1, 2, 3, 4
what do you think this prints?
1 2 3 4
ha
it doesn't
it prints 1
whereas no typecast prints 1, 2, 3, 4
I was super confused by that behavior a while ago
i thought typecasts had no effect on exe
I thought so too
but whats actually happening here is
local t = {1, 2, 3, 4}
local function a(...)
print(...)
end
a((unpack(t)) :: number) -- 1
a(unpack(t) -- 1, 2, 3, 4```
a typecast wraps whats casted around enclosing ( and )
when you do that to a variadic, it returns the first value
very
me
i only really speak here
ah ok
LMAO
It’s true though
Telegram objectively worse
No
Yes
AAAAAAAA
oops didnt mean to put hose As
doesnt telegram have like
e2ee turned off by defualt
people say it does at least i havent used it in years
iirc yes
turned off by default for 1-to-1 dms and no option at all for group dms iirc
what the fuck
awke
telegram bad
telegram bad

1868514267554779446
@timid quartz https://fixupx.com/MKVRiscy/status/1868705514886140145
The drone mass hysteria is 100% leading to a passenger jet getting shot down or crashing
Quoting Paul E Williams (@PEWilliams_)
When I was flying in from Raleigh on Friday night there was someone shining a laser pointer at the plane as we were coming down over Jersey. Didn’t think about it until just now but it was probably someone drone hunt...
(what i meant by don't fly over nj)
i managed to make a simple eye tracker with opencv but it's a bit basic. just uses threshold method with contour areas. gonna try using haar cascades with a mix of threshold/contours @rustic vine
red marker is the x output, only need x axis for this project
but need to make it scale properly to the width of the eyes rather than just using the whole frame, so probs will use haar cascades for defining eye bounds
might make an auto threshold algo if it hasn't got one built in
the white box is the detection area but needs to be a tiny bit bigger
should be less painful anyway once i have fixed lighting conditions
thats a weird eye
@spare quartz why don’t you go meow on the guard frequency
im gonna study rf stuff
study grass
lgtm
simple solutions win every time
if thresholding and countouring works then thats what I'd go with
I recognize that pupil shape, seeing you soon.
after analysis I can conclude those are indeed cubes
just don't have accidents
actually the compiler eliminated all of this
👍
oh it uses n later
um
TRUE
this doesn't fall through though?
sorry I thought the ocaml code was faulty
yeah 😭
ママママジカル&ミラクル
java 👎
this isnt java
kotlin 👎
this isnt kotlin
this isnt javascript
its rust
wrong
:3
rust uses semicolons and self rather than this
it's kotlin i just like lying

about rust though
earlier i found a minecraft mod using rust
based mod
terrible mod
BASED MOD
if only i knew how to use jni with ada
go through c :3
Found a good combo. Haar cascade for detecting eye bounds, and then thresholds/contours for iris, used together to get left/right viewing positions
Green dots are eye X axis bounds
Green rectangle is iris
what is this coded in
Red line is an output from an algorithm which takes in averages/curves and shit
die
im asking a question
no i dont care i just wanted to know
oh ok
oh cool
because i like python and i know its slow
but its fast enough for me
But yeah I'm making a simple eye tracking program for mechanical eyes for a project
fursuit
Python is also bearable for CV
no fucking way you didnt hate on python
Bleh Ada
adcs are so weird....
overriding function Handle_Client (Header : HTTP_Header; State : in out Server_State)
die
yes
魔魔魔 マジカル・アンド・ミラクル
この広い世界へ飛び出そう
失敗なんて恐れない
思い立ったが吉日でしょ
1・2・3 踏み出せば
はじまるアドベンチャー
Oh I didn’t listen to that much of it
Bro this is the best one for all of today
GO AWAY!!!!!
idk what this guy is yapping about
NOT YOU TOO
I’ve been using Warp for a while
what are those??
Cause I’m not explaining
good .
i don't know why cmd or powershell isnt good enough to some people though...
CAUSE MY LAPTOP IS NOT A WINDOWS MACHINE
WHY IS BASH NOT GOOD ENOUGH FOR YOU
Ok what if I don’t want to boot up my whole IDE just to use my shell
open your systems shell
macOS default terminal app is dookie
true
is there any features that stick out though
cause like
i dont see much out of a shell other than up/down and typing
bleh coke in bottles suskc,.
I think the most useful one is that it like…partitions all the commands you run, so like for every command you run it splits it into its own “block” or whatever
Among the things it lets you do, you can control F the output
And it limits it to that one block
The UI for selecting previous commands with the up arrow is also nice
like
cd ../
mkdir gay
cd gay
?
co ol
every terminal has tabs today
And ai goyslop if you want that
and i dont care about the rust
but i feel like every console today should have CTRL+F
sucks that they dont!!!
It also limits it to a certain block too
So like if you do
——
curl http://api-that-has-long-json-output.com?q=1
{
…
}
——
curl http://api-that-has-long-json-output.com?q=2
{
…
}
——
You can search the outputs independently
ANIME GIRLS INM MY AERS RUNNING AWAY FROM SCPS
魔魔魔 マジカル・アンド・ミラクル
この広い世界へ飛び出そう
\
懐かしの!曲を!歌いました!!!!!!!!!!!!!
サルゲッチュ20周年記念でTwitter始動してたから新作確信してたけどそんなことはなかった…
定期的にスペクターに沼ります(ド性癖)
■original:SHINGEN MONKEYS
作詞作曲:百石元さま
https://www.youtube.com/channel/UC5hT4j9Gp6K0pJTVsVf5Mzw
■MIX:kzmariさま
https://twitter.com/kzmari1
■vocal&illustration&MV: ばやちゃお
--------------------...
oh mtf spanwed :3
im dead :3
god i need to make my own tts app
the one i use rn takes a minute to open an crashes every few minutes from a segfault
GOD DAMMIT OF COURSE
Or what if you made an ada program that launched it for you and maybe kept a pool of a few processes in the background to swap in every time the main one crashes
you should work at a multibillion dollar company
I WANT TO BUT THEY DONT WANT ME WORKING FOR THEM
holy crap that is freaky
what is going on here?
not a gcc or C expert but
from, what i can tell
GCC is seeing the int i() typedef during compilation, putting it's code (the for part) into main
the asm/for part is then resolved into a call to puts
and elsewhere is just an empty looping function... somehow
ow crap i just cut myself on a pepsi can
same, I can guess at kinda what happens but the technicalities are beyond me as well
thats cool though
I assume the unused annotation is so that the entire function doesn't get eliminated
C doesn't have execution in the top level right?
you mean outside of a function?
no, you can't
yeah i just call that top level
Yeah, I thought so but I wanted to be sure
That that's what you meant
This looks more like a bug than a thing lol
LOL
It doesn't even compile in clang lmao
eh expected
oh
And bad use of asm
asm in clang probably uses LLVMs format
Ya

nono like
Lol
bleh i cant find it
but LLVM has their own format for inline assembly
aside from intel/at&t
The intel asm syntax is much nicer to read right? At least I found it so, albeit I rarely touch asm
i prefer ATT honestly
Huh really
Yeah, it doesn't, i was just curious what yall thought
I mean Intel feels more mathematical and att is more logical and programmer like
Cuz in Intel x = y
Where x becomes y
And att lol
I can see that
Intel is rust no wonder ATP doesn't like it
im gonna kms if i see more gan-llm slop
Lmao
well NEITHER is ada
so im gonna sit on the fence in that regard
i've got 2 simple low level programs
1 real-mode OS and 1 UEFI loader
but neither are actually built beyond just saying hi
Uwu
if i had the time i'd work on the UEFI loader since its more complete
Mine doesn't even say hi yet 😭
I can say hi in Javascript does that make me a low level developer 🥺
uhhhhh
depends
By collegeboard standards you are God tier
does your engine have JIT
Goat
No but it's an inline 6 with vtec
You don't just worship the machine God you are the machine God
Does that count
ehhh good enough promoted to project manager
Let's go
you'll be paid twice as much as the developers
Prompt engineer an ai to do the prompt engineering and you evolve
if you think about it all of the work is done by the framework each will inevitably use
so React wins
avif.
Everyone except js frameworks lost
Angular 😅
but whats that
Make a website
I know who lost. Aspx
I believe
IE 12 will come out eventually and even real feet will tremble from its sheer thingability
Why do it over UDP
probably cause its faster or something
Well yeah
But that quic thing is probably gonna just do everything that tcp does anyways
If using UDP with connections (I'm guessing but I'm already ranting now) is somehow faster then fix tcp instead of making a new layer for things to break
udp
look inside
essentially tcp built on udp
Designed to obsolete tcp
Then replace tcp instead of making tcp over UDP!?? Rahhh
I feel like everything new in programming just makes things better by making them worse
Things are already multiplexed though!!!
Make the fucking thing work better even if it's more difficult instead of just building on top of it
I just looked it up they made it faster only because of tcp's header
Not header idk
I looked up it's article on chromium they literally made quic only because tcp would be too difficult to change
"tcp-like over udp" fuck you
tcp but less back and forth over udp, why does it haved to be over udp if your making a new fucking protocol make a new one goddamit
quic literally made me crash out 😭
Because if they made it over TCP then they’d still have to deal with TCP and QUIC wanted to fix shit about TCP and you can’t do that if you use TCP; UDP does literally nothing more than send a packet from source to destination so it’s more ideal to extend especially if you’re trying to fix shit about TCP
And they didn’t make it a separate protocol that is implemented in the OS because that drastically slows down development time because the protocol gets ossified in the OS
bro theres like a billion protocols that dont go over tcp/udp that your os supports
and you can also send raw ip packets so
you dont haved to even make it in the operating system
what I was saying is that quic is just making tcp but doesnt do as much as it can to solve the problem that its supposed to solve
they just made tcp over udp for no reason when they have the power to make tcp better than it is now, but would rather not
oof udp doesnt have a handshake thing
but even udp's rfc says
Applications requiring ordered reliable delivery of streams of data should use the Transmission Control Protocol (TCP)
and instead of improving tcp, they make up a tcp that runs over udp
it just sounds crazy to me for them to replace tcp with fixed tcp over udp instead of fixing tcp in the first place
like you haved to do some minor parkour to permanently irrevocably cure your disease (improving / replacing tcp) or you could take a pill that helps with the symptoms (quic)
hi chat i need help deciding if i should us opengl or vulkan for a project i'm working on, i've used both and know that opengl is super easy but hasn't khr essentially stopped working on it in favor of vulkan?
I’m asking this question here directly because I haven’t seen a clear answer anywhere. Speculation aside, does anyone have any kind of concrete information they can share or direct me to which indicates what the future plans for the OpenGL specification are? I’m talking working group papers, timelines, roadmaps, etc. Anything published, presente...
i've already seen about everything under the sun on vulkan vs opengl but i want other opinions too
but hasn't khr essentially stopped working on it in favor of vulkan?
clarifying this point
you don't have many options besides just vulkan
metal exists if you wanna do mac development
and depending on the project you can sidestep a graphics library and just use native ui
yeah, but also gl 4.6 supports fairly modern features and even some rather modern gl features are on a wide variety of gpus
i guess i'm asking mostly in a complex application, i'm fairly certain they both can do it, but which one can do it better?
isn't that obvious
it's vulkan
like, what exactly do you want out of your program
modernity, extensibility, performance, compatibility?
it doesn't need to be modern by any standards, but it needs to be able to do most of those
i've seen gl and vulkan do almost the same on some things, with many different people saying different things about each one. i mean even taffo recommended gl, but yeah i'm hearing lots of different opinions
well if it doesn't need to be modern and you don't wanna spend 5 weeks making a triangle do opengl i suppose
maybe i should just make my own graphics api 'draw everything()' 
good luck!
wait a second
wow i am REALLY tired to confuse you two
what
It's fun and easier than using vulkan lol
Still if it’s built into the OS kernel then updates to the protocol can only come when OS kernel updates get released, which are normally on a scheduled cadence, and not everyone may update immediately
They still dealt with things that they really wanted to get rid of like handshake delay and head of like blocking, I don’t think it was for no reason at all
And also connection migration
There will be no perfect protocol but QUIC improves on TCP where it aimed to
Versus using UDP which is already a known transport protocol by computers, servers, middleboxes, and everything else, so they don’t have to try to get the QUIC protocol into every single damn device like routers which rarely ever update
And then QUIC can just sit in the user space and be rapidly developed
Like one big thing with QUIC that let it get developed and tested so fast is the fact that it’s implemented entirely implemented in userspace, so Google was able to just roll it out to Chrome users when they wanted to start testing it
And could bundle it in Chrome updates (that often apply automatically) to add and fix things
You don’t get this benefit to raw IP packets because if you just send raw IP packets then you have to get your transport protocol registered everywhere so middleboxes know what kind of packets they are and end systems know how to demultiplex the packet
@timid quartz
Dude gross why are you doing that
That’s just nasty
Do I have to ban you now?
I never did
Do that stuff in your own time but don’t show everyone else
smh
camel case computer name might be the worst of all
my hostname is that way because I stylise it as wwise and not Wwise
NOOOOOO
okay i got good news
i DO NOT have to do 31 assignments per hour*
unfortunately
i HAVE to do 31 assignments per hour because they're threatening to arrest me with truancy again
🙏
BRUH
😭
bruh
And if you get arrested you can’t join the military so…
yes i can
Is truancy not a felony
its a "class c misdemeanor"
whatever that means
apparently its equal to these
i dunno how giving a gun to a kid is equal to just not doing school
but
texas
Yeah checks out for Texas
Oh did you like your visit from the FCC and FAA over experimenting with ACARS
no because i do not have a radio transmitter in my posession yet
and FROM WHAT I CAN TELL
its not going to be easy at all
- have to make an antenna that can rx/tx at 131.55 MHz
- have to amplify the frequency coming out
- have to downscale the frequency coming out
- have to plug it into a ADC
- have to somehow connect that ADC to my computer
if i manage to get all the components required this'll be my first truly embedded project
... and also a GREAT use for ada
ill also need a 2.4 GHz rx/tx antenna for bluetooth stuff cause
my radio card only supports wifi....
And the MOMENT you start transmitting on that frequency without authorization, you’re gonna have agents come to your door
nuh
depends on the transmission power and its direction
if im just blasting 2.4 GHz/131.55 MHz over my neighborhood then yes duh
if its directional and/or low power then i'll be fine
RF stuff is gonna be a pain to learn though
Direct it at an aircraft and send them a :3
i'd need a radio towers worth of power to send it to the SA airport and would get arrested for pirating
so
Just uh, get within a few miles
with my entire computer???
Yeah
Anything’s mobile if you want it to be
ame
you should keep coding in ada
Same with Ada for me
And there’s always a reason to use Rust
Rewrite it all :3
im racist.
congrats
no
Use Rust and maybe you’ll get verified
A role
do it matter
boooooooringgggggggngngngn
no check mark for YOU then
x premium blue check
i have the role for some reason
please dont tell me you paid fir this
poorest programmer here
atp ur literally buying anime maid outfits
i was joking
mmmmm suree
防衛省!?一体何をして....
you wish
DO YOU PLAY TF2
its not vendor lock in if its a standard
:3
its not vendor lock in if the vendor is significantly better than the competition
It’s not vendor lock in if you can’t choose the implementation you run and all of the implementations (which might only be just one) are proprietary
Oh wait that is vendor lock in
no no, we gotta name that something else
vendor lock in has a bad rep
vendor... support?
👍
And don’t say coreboot or libreboot because those only work on like 2 devices and you have a 75% chance of bricking whatever device you install it on
marrrrrowwwwwwwwww!!!!
anyways i dont see the bad rep in uefi
aside from it being controlled by Big Tech
a lot of things are controlled by big tech I think
uefi is prob the last
on the list that I would care about
missing the spar bar
OMG
space
don't worry thats shipping tomorrow
chatgpt please set my computer into the S2 power state
github added a ask copilot bar at the top of the homepage
prompt engineers are rejoicing
some others are exploding
also on this point, I don't like vendor lock in but when the alternative is to use an objectively worse product I will take the better product any day of the week
have experienced this many times over
i was thinking the same when it came to choosing a physics engine
imma be real with u I asked chatgpt a coding question yesterday
lowest point of my life
wait
can I ask here
sure
I literally could not find
a single stack overflow
or anything
on this
and then chatgpt gave me a non working example code
so basically I have a time in seconds, and I want to display this number to the user in a nice way, but I can't make any assumptions about the magnitude of the number and thus can't pick a "good" unit to display it in ahead of time. I didn't think too hard on it but couldn't think of a good way to find the "best" unit of time (i.e. ms, us, s, min, hour, etc..) to display it in
I think my main problem with not being able to find any answers by searching is I couldn't formulate it into a very clear question
are you allowed to change the unit dynamically?
well it'll be stored as the base unit always
in this case say seconds
I just want to convert to the "best" unit when displaying it, idk how to define "best" but 0.0000000001 seconds isn't very useful, nor is 10000000000000000 ms

for time UNDER 1 second, use a conventional metric conversion system like this
otherwise, for times over a second, use an algorithm that goes like
minutes: s > 60? s / 60
hours: s > 3600? s / 3600
...
why is this so complicated 😭
KOTLIN 👎👎👎🤮🤮🤮
handles a lot of conversions in different styles
you use this function
val (truncatedNumber, unit) = formatNumber(n)
whats unitOffset and unitMax
if your time was in something like ms, formatNumber(n, -1)
unitMax is the "wraparound" threshold, so like
oh offset is the power of ten from the base unit?
1kg = 1000g
what is this for
1ku = {unitMax}u
formatting numbers in our mod
default is 1000, so e.g. for grams #1264496483957346346 message
huh. doesn't the unitOffset already tell you the unitMax?
oops one message off
unless im understanding unitOffset wrong
is it not this?
if you had a unitMax of 1000 then that would be correct, but otherwise it's just the offset in the unit symbols list
imagine not being able to just do format!("{the_number}"); smh
by default it has a starting index of 8 ("")
if your raw value was in millis, then you'd send -1, and the starting index would be at "m"
formatNumber(1000, -1) = 1 u
formatNumber(1, -1) = 1 mu
oh unitOffset matters when you don't pass in a number in the base unit
yes
ok
I'll take a peek again at what I ended up with
I think I just slapped ms on it and called it a day
there is a few units were missing like deci/hecta or whatever
but those are weird so we just ignore them
what kind of formatting does this even do
agreed
for arguments "1000"
truncatedNumber = 1
unit = k
just format!("{the_number}{unit}");
so ez
$truncatedNumber$unit
the problem isn't formatting
its picking the right unit to format in
mm ic
yeah cause 0.00000000000000000001 seconds isn't terribly helpful
but I can't just convert to a specific unit ahead of time
because I don't/can't make assumptions about the magnitude of the number (in the base unit)
wdym you can’t convert that in your head
smh
unfortunately I can't, maybe if I was a math major
2
wait no the InitialWait isnt applicable for this script
(p.s. i hate people who attach heartbeat events to make second-by-second clocks)
The officially curated dev tools things are dogshit
It literally straightup didn't work when it was new
It's less standardized (motherboards changing functions behavior so they actually work) than bios somehow
And it has a ton of security issues that bios didn't have
It wastes disc space and makes it so a drive can only boot one thing natively at a time
the IC on the right looks so cute next to the one on the left
(bluetooth IC/sub GHz IC)

@spare quartz https://mastodon.online/@nikitonsky/113691789641950263
sent to coedv
2
what are you trying
It looks like a computer
it's something related to an esp but I'm unsure if he's just looking at schematics or actually making his own pcv
pcb
making pcb for 100-500 mhz radio
what for if I may ask
the transceiver is out of shot
ACARS
like what
I mean maybe
this is again my first time making something actually embedded
so the first program on that ESP32 is just gonna be like, sending a string of text over a random frequency and getting it on another end
some tips about designing a PCB for an esp32
put the esp all the way to an edge incase you ever want to use WiFi/bt
you don't need a seperate usb to serial like the Arduino does - usb pins do it just fine
oh yeah I have the PCB design manual on hand
voltage reg is between the USB-C on the right and the ESP32 on the left
you're stepping down 5V to 3V
Unsure how good it is, but it should limit the 5V coming off the USB lines to 3.3V, with overvoltage** protection up to 200V
also, depends on how long you'll use it for, but make sure the regulator is cooled properly
amateur mistake that lots of people do
got it
and is it SMD or THD
all components on the schematic are SMD
we should move to #1267583072728121384 if you wanna continue chat btw so we don't clog this up
figured I'd revisit the moving average stuff from a while ago now that I have a real use for it, these results are kinda interesting
the top is backed by a circular buffer/queue
the bottom is backed by just a normal array, which is table.moved to shift it down to keep constant size
makes sense that the table.move gets much slower as the sample size goes up
wonder why the circular buffer backed one is slow everywhere else though
will look into it tomorrow lol its too late
is table.move just a nice wrapper over memcpy or just a loop
its a memcpy yea
ah
maybe lied about that, I don't think its as simple as just a memcpy for lua, see here
no. way.
lgtm ✅
tests failing turn off tests
merge to master
push to prod
make sure you do it on a friday afternoon at 5 too
forgot to mention that
christmas eve even better
tragic
customer is always right
thats how it works
good thing I don't need to listen to customers
they sound awful
the myth of "consenual push to main"
Developer: I consent!
Project Manager: I consent!
Customer: I don't!
isn't there someone you forgot to ask?
forgot to ask your load balancer if it can take another push to main on a friday afternoon at peak load
oh yeah i now wholeheartedly believe rebase is the way to being saved by jesus christ
merge is a sin created by Big VCS
rebase is the way forward
fast forward is good too when it can be used
(essentially simple rebase)
Squash and merge >:)
only acceptable in PRs
so is "lgtm" for 60k changes worth of commits
correct
unironically yes
(we pushed model files once, it was like 100k lines)
dont use cuda
opencl is literally easier to use
and works on everything
and cuda forces you to use microsoft bloatware too 💀
gpu compute on nvidia is just really siht
and using cuda will make itw orse
I remember I finally got opencl working on my new nvidia laptop and it ran slower than my amd igpu on the same computer
supicious that my program runs on everything except nvidia and it uses opencl....
made the one backed by a circular buffer a little faster
what’s the script
merry christmas IDIOTS
what .
--!native
--!optimize 2
local circularbuffer = require("./../../datastructures/circularbuffer/circularbuffer")
type Map<K, V> = {[K]: V}
type Array<T> = {[number]: T}
type CircularQueue = circularbuffer.CircularBuffer<number>
export type MovingAverage = {
_average: number,
_samples: number,
_n: number,
_initial_sum: number,
_window: CircularQueue,
compute: (self: MovingAverage, n: number?) -> number,
}
local function next_avg(n: number, prev_avg: number, last_n: number, next_n: number): number
return prev_avg + ((next_n - last_n) / n)
end
local function compute(self: MovingAverage, num: number?): number
local average = self._average
if not num then
return average
end
local n = self._n
local samples = self._samples
local window = self._window
local window_buf = window.buf
if n < samples then
local next_n = n + 1
self._n = next_n
window:add(num)
local next_sum = self._initial_sum + num
self._initial_sum = next_sum
local next_average = next_sum / next_n
self._average = next_average
return next_average
else
local next_average = next_avg(samples, average, window_buf[window.tail], num)
self._average = next_average
window:add(num)
return next_average
end
end
return function(samples: number): MovingAverage
local average: MovingAverage = {
_samples = samples,
_average = 0,
_n = 0,
_initial_sum = 0,
_window = circularbuffer(samples),
compute = compute
}
return average
end```
: thumbs_up :
--!native
--!optimize 2
type Map<K, V> = {[K]: V}
type Array<T> = {[number]: T}
export type CircularBuffer<T> = {
head: number,
tail: number,
size: number,
capacity: number,
buf: Array<T>,
add: (self: CircularBuffer<T>, k: T) -> (),
remove: (self: CircularBuffer<T>) -> T,
clear: (self: CircularBuffer<T>) -> (),
iter: (self: CircularBuffer<T>) -> (() -> (number, T))
}
local function add<T>(self: CircularBuffer<T>, k: T)
local head = self.head
local tail = self.tail
local size = self.size
local capacity = self.capacity
if tail >= head and size == capacity then
self.head = (head % capacity) + 1
else
self.size += 1
end
local n = (tail % capacity) + 1
self.buf[tail] = k
self.tail = n
end
local function remove<T>(self: CircularBuffer<T>): T
if self.size <= 0 then
error("cannot remove from empty queue!")
end
local head = self.head
local k = self.buf[head]
self.buf[head] = nil
self.head = (head % self.capacity) + 1
self.size -= 1
return k
end
local function clear<T>(self: CircularBuffer<T>)
self.head = 1
self.tail = 1
self.size = 0
end
local function iter<T>(self: CircularBuffer<T>): () -> (number, T)
local arr = self.buf
local tail = if self.tail - 1 <= 0 then self.capacity + 1 else self.tail
local i = self.head - 1
return function()
i += 1
if i < tail then
return i, arr[i]
else
return nil :: any, nil :: any
end
end
end
return function<T>(capacity: number): CircularBuffer<T>
local queue: CircularBuffer<T> = {
head = 1,
tail = 1,
size = 0,
capacity = capacity,
buf = table.create(capacity, false) :: any,
add = add,
remove = remove,
clear = clear,
iter = iter,
}
return queue
end```
For the CircularBuffer impl
does roblox properly warn when using dot notation on these functions yet
i know there was a time when
function A:B(c)
A.B(c)
properly warned
but not
function B(self, c)
A.B = B
A.B(c)
Why would it? You can always do buf.iter(buf, ...)
buf:iter(...) is just shorthand for that
Oh yea. If you do buf.iter() that warns
okay i just wanted to make sure of that
cause early on in luau calling self functions with a dot was pretty weird
Rust at home
;(if A then FunctionA else FunctionB)(...) my beloved
If it works it works
Should typecheck fine
nah that isnt even a "if it works it works" thats just the correct way to write code
LOL yea
Surprisingly using an actual buffer to back the circular buffer was slower than just using an array like here
It’s println!(x) tyvm
I noticed that too
Also unnecessary mut
I dunno if the preprocessor supports characters like ! Though
Oh ALSO it has a return 0; but the function signature has no -> u32
Like yes #define fn int but
If you’re REALLY trying to imitate rust
what
give us your entire paycheck to keep the job
im not even gonna quit im just not showing up
when we getting universal basic income this finna be normal 💀
おまねこ君
yippity yap
おまねこは男の子?
女の子だと思っていたけど
うちの猫は男の子なんですが、猫を飼っていますか?
はい、猫を飼いますが、「おまねこ」と呼ぶJASDFのマスコットについて喋っていましたよ。
ああ、悪い、私の日本語はあまり上手ではありません。
はい、そうです
一人で勉強していますか?
Yes I am
(I couldnt say some of that in japanese so)
I just simplified my sentence in english
You could just say はい(、そうです)
ah
日本語はたぶん一番難しい言語なんですから、頑張ってくださいね。
腹痛があります :<<<
Also a comment, you’re communicating mostly in polite form (ます), but then you use “悪い” as a way of saying “my bad” which is way less informal
Generally not a good idea to mix formalities like that
すみません would work fine while maintaining the formality
Or even わかりました
英語は実際はもっと難しい
hey Aera since you’re here…
Do you know why Japanese comments have wwwwww a lot in them
Ok I used translate for this sentence and what the hell💀
It's just their language
Like we have vowels
wwwww is “lol”
w is short for 笑(わら) which is the kanji for laughing
OH
That makes sense
That's what you mean
I'm also learning german
Which is easier to learn if you already know English
Yeah there’s a double は there which isn’t grammatically correct
Translate is not ideal for sentences
It's normally for translating other languages TO English and for singular words
The fix is easy though
True
実際に instead of 実際は
LOL
Hold on lemme try smth
Well generally things ending in the longer forms like ます and です are more formal and you generally want to stick with one when using Japanese
Which one you choose can vary by person but
Yeah my Japanese is like I've been smoking for 3 days straight and have just learnt the language 💀
There are some grammar structures that take exclusively the plain (informal) form no matter what formality you’re going for, but then the formality is normally expressed elsewhere
Oh so you did take a class?
Guessing you took a class but are now self-studying
Tbf I’ve been taking classes for about 2.5 years in college and I’m only now at this level of understanding which honestly isn’t that high
でもピンク Nerds が私の愛用!!!!!!!
- Dissecting sentences is so hard on phone
- Typing Japanese is also so hard on phone
Yup
I had classes in school
I got straight A+ most years
Maybe would have also typed “nerds” in katakana idk
That’s…fairly correct though
Didn’t know the right way to write it out since it’s a product
But yay!!
Aw crap I lost my glassses
okaty back on cpn wo
You could have probably omitted the 私の
Because it’s kinda implied
I also think that the two-kanji words (like 愛用) are a little more formal than non two-kanji words so you could have said like
I use duolingo ngl 💀
でもピンクNerdsが大好き!!!
isn't there a japanese !
Yes
i tried finding it on jisho but only exictement came up
And to take it even further you could have used んだ which kinda adds like an “explanatory” tone to your message, so like the meaning would be “(it’s because) I really like pink Nerds!!!” or “but I really like pink Nerds!!!” alllmost kinda whiny maybe
aren't there 3 different styles or writing or something in japanese
or whatever you're meant to call it
Three different character sets yes
yeah that
why is that
is there a particular reason
sounds like it makes things complicated
So でもピンクNerdsが大好きなんだ!!!!
Yes
Kanji, Hiragana, Romaji
LOL
hey harry can you help me translate

