#serious-discussion
1 messages · Page 119 of 1
u mean the standard lib?
also, you can use nodefaultlibs with msvc cl.exe
msvcrt is not mandatory
In fact you can build UEFI executables with msvc
You work as a dev?
why yes
mmm but can u do multiplatform development with msvc?
nothing just good to know who is and inst cause it's a math server and all
pretty much the only widely used systems language that enforces runtime is golang imo
as long as it's PE
as much as go pisses me off i do kind of miss it sometimes, after living in async rust hell for awhile
PE?
is it promised based?
like js?
cause if it is i'm not gonna lie it sounds like it
no, async in golang is automatic and invisible
you just write code that looks blocking and it takes care of everything for you
or are you asking about rust
rust
async rust has “futures” which sort of look like js promises but are kind of different
a future in rust is basically a state machine that you poll until it is ready, then it finishes by handing you data
the cool thing about futures is that they require zero heap allocations, so you can use them in contexts where you don’t have dynamic memory allocation
anyway you don’t have to think in terms of state machines, the idea is you sprinkle async/await in your procedural code and the compiler generates a state machine like something you would hand-write in C
not really, no callbacks are involved
ummm yeah i think so, if i understand what you are asking
well, no, if you’re polling you’re just checking if data is ready
you can go do other things while it’s not ready
like switching to polling other futures
Polling, or interrogation, refers to actively sampling the status of an external device by a client program as a synchronous activity. Polling is most often used in terms of input/output (I/O), and is also referred to as polled I/O or software-driven I/O. A good example of hardware implementation is a watchdog timer.
yeah so it's a way of handling multi threading
by not blocking the Main thread
i gather?
and then sending events to the main thread
well, it’s a way of handling concurrency. you don’t really even need multiple threads to use async rust
once the future has been fullfilled?
concurrency is about múltiple actors accesing a resource
right, but you can do concurrency without having multiple threads, which is what JavaScript does
why not just block the Main thread until resource is readt?
yes
that is called polling
well if you block the main thread you can’t do anything else
so one thing you might want to do is respond to other signals while waiting on some work to be done
the data once the thread stops polling?
on that same thread
and the thread has a lock ?
on the data
so typically what one does in rust is pulls in an async runtime, which is not included in the standard library in rust
your async runtime will manage a collection of concurrent tasks you give it
if one of your tasks does any IO or waiting of any kind, the executor will switch to another task while waiting on that
is async typically handled the same by most programming languages, I'm trying to learn more about it to solve some python code involving asyncio and receiving packets and wondering how strict I need to be with my reading
no
u should read about concurrency and multithreading
I found myself starting to look at bytes and realized I need to turn back
i am not sure how asyncio works in python sorry
I originally had threads but I ran into race conditions because I'm trying to receive too many responses simultaneously
I don't really know how to work out sorting my responses out without mangling them, but I'm pretty sure asyncio is what I need, not threads
place it in a data store
and have a second thread be send a message
that there is stuff to process
async is threads
my conceptualization of it is something like, there's a buffer "out there" that receives the packets and somehow it's giving them to me, which is what my futures are, really just the results of the coroutines
just with less verbosity
i mean a variable that holds the data received by the polling thread
I'm trying to ssh into, say 50 devices, wait for about 8 seconds for a response from each, and most come in at around the same time
ohh
this is where I end up getting mangled results with my threads
so u don't have to be continuosly listening?
yikes, like a data race? i thought python was supposed to prevent that
well I mean I believe it can be done in python
i am sure it can
which is why i said u should just leave a thread listening for the data
I dont' know past what I've seen on like stack overflow and reading some of the docs
that way u make sure to receive all packets
but it's just not clear to me how to accomplish that, and I'm tired of reading haha
is there like a join thing in python that takes n async things and waits for them all concurrently
idk
I guess I don't know how threads work under the hood to know that this is reliable or not
threads in python are super ez
I know there's this whole GIL thing and so I'm picturing it juggling between listening for a bit, then doing something else like sending packets - which would cause it to not receive them or something idk
I guess this can be handled by TCP asking for it to resend or something, I just don't know what's actually going on and I don't know how to gain visibility into that
this uses threads in the background
why this vs asyncio
I want to do async and I'm doing io, seems like what I really want
there's a handful of different choices for concurrency it looks like in the standard library, I just don't know
what is the api you are using to do ssh, i am curious
I was using paramiko but that was when I was using threading
I think that in and of itself won't work when switching to using asyncio, so I have started looking at switching to asyncSSH
I just haven't started yet at implementing it, cause it's the weekend
im gonna be honest my experience with ssh is basically using the ssh command or using it through applications lol
what are u trying to do with ssh?
it sounds like you are dealing with low level stuff like tcp/ip though
is it file copying?
this is about 50% of my choice of using asyncio over concurrent.futures
and I read some convincing stack overflow answer
past that I know nothing
wait
I'm just looking for arguments like pros/cons of each choice
ur communicating between múltiple processes?
i need more context
what are u doing through ssh
?
ssh into the device, send some long running commands, then receive their response after about 10 seconds or so
well he is doing ssh which involves network communication
and I do this several times to each device let's say
then I take the responses and I save them all to one file all concatenated basically
although they don't need to be, it doesn't matter for my purposes
I end up running stuff to filter through those logs
but at that point the networking part is over with
mm seems like orchestration is needed
so i can forget the stuff you said about tcp and packets, cuz that sounds a bit low level for what you are doing
yeah I think it's too low level
that's like layer 3/4, I want to work at like layer 7
it’s a shell, you’re sending commands, surely you get text or just a stream of bytes back?
yeah, it's a stream of bytes
okay, we can work with that
are u having multiple ssh sessions at the same time?
I don't know how to ensure my stream of bytes doesn't get mangled between the different requests
have you made something that works for just 1 device yet
or just executing each ssh sessions sequentially?
yeah I've successfully done this with threading
but my results ended up being chopped up
mostly they were fine, but a few of them were cut off, like halfway through one log was the log of adifferent device
at least that's what I'm interpretting as a race condition of my threading
sounds like it
oh you’re saving everything to the same file though
yeah, I think I see what you're starting to get at
if you append to the file from the stream directly, then yeah i would expect it to get interleaved
theres also the problem of using the same port for the ssh
I should be saving to individual files and then combine them later somehow
i would collect the stream in memory, then write to the file in one go actually, unless that is impractical
pretty sure that's not an issue at all
each connection will have it's own separate ephemeral port
ok
that sounds right
then u need to listen on those specific ports
I'm not sure what that means honestly
what that means
when my program is running, unless I'm writing to a file, I should assume it's just all in RAM, and that's what you mean right
like save each file to some array or dictionary for each host
it just stores it in memory
and then combine it after all the threads have ceased
yeah i mean i figure there’s a byte string type or something in python
I was sort of afraid it would be too much to hold in RAM
so just read the response into your byte string, then once you have all of the responses, write them one by one into the file
how much data is it, do you have any idea?
but maybe I'm underestimating howmuch RAM that device has, I haven't really checked
I don't have any idea, I mean it's just text so it can't really be that much now that I'm thinking about it
or u could store them on a database like sqlite
maybe 3K lines of text logs per device
hmmm i feel like that shouldn’t be that much
I think before I was conflating the threading issue with reading from the buffer from the NIC (or however that works) rather than just me writing over the same file
well if each line were 1000 characters it’d be like 150mb, which is…. eh
so I think I'll try to see if I can fix it that way
yeah i wouldn’t worry about the NIC, i think the os is taking care of all that for you
wouldnt it be better to use a database at that point
?
Yeah I think you're right
the lines are about, 100 or so characters probably
actually maybe 511
database adds complexity, might be useful for what he’s doing, might be a waste of time, idk
he says it's more than 100 average
I throw away the logs after reading them anyways
I might even just try filtering them as I receive them instead
I'm only picking out certain pieces
@pulsar pagoda @jagged forge thanks this has been really helpful
should be fine if you read all of it, based on our napkin math, but filtering shouldn’t be hard either
not stopping the conversation, just like, at a good point here
yeah, it's clearer to me now how I was sort of misguided a bit earlier, I guess I have a semi lingering doubt about threading and the NIC
the python GC could kick u in the balls
well it is good you are thinking about what the hardware is doing, i just think you were a bit confused
but i think @jagged forge knows more about that
I feel like the threading bounces between being off/on to turn the other ones on, but the NIC is sort of always "on" so it seems like there would be a mismatch between it feeding data
I am pretty sure how I'm thinking about is not how it really works at all though, so I'm not really too bothered by that
it's cause u probably have no OS knowledge
I just wish I knew what actually happens
not a Bad thing
there's a kernel, there's some syscalls, there's some gpu pixies, etc etc...
OS handles operations with the hardware for u
it goes nic buffer -> kernel buffer -> application buffer
yes
each buffer will hold your packets more or less until they are needed
are all these buffers literally locations in RAM?
well the NIC has its own buffer on the card itself
yes
I see, that makes sense
so it's sort of waiting to pass that on to the kernel buffer ASAP
otherwise it'll have to start dumping data on us
the kernel handles a service
through a interface file
that service is interacted with by applications
through a API
that's starting to make sense, there's like an ADHD hamster in the kernel that like redirects what it's focused on, and so some of that time it's unloading stuff from the NIC's buffer for instance, is that fair to say
yeah if you don’t read packets fast enough in your application, stuff gets backed up and the kernel or the nic can drop packets, but i wouldn’t worry about that too much for now
I'm only worried about it as far as I know I'm receiving a lot of data at once
which is why
and in the future I'll probably extend this to get even more data so I'm tryign to work out how I'd troubleshoot that
u don't want to stop the flow of data
so thats why i suggested just keeping the thread on listening
this sounds to be in contradiction with this, but I don't know the relative times of events
I feel like I'm grabbing it, filtering it rather than just tucking it away to look at later
I think I see what you were saying earlier now, maybe future me needs a database, but I'll hold off for now
yes but grabing it can happen while u receive another losd
load*
i feel like there should be a premade solution for ur problem already
somewhere
you would think
sounds like you are ingesting logs
there probably is
I guess I'm still forgetting TCP handles error correction
so it doesn't matter if the NIC drops stuff, it'll ask to resend it
or something below me will if not the NIC
I don't know where that's actually delegated to
Feels more programmy to me
or the kernel
if we're talking OSI model, I think the NIC basically handles layer 1 and maybe some layer 2
so I'm guessing the kernel/software is handling above that
yeah i think the kernel is handling retransmission
yeah, only reason I'm talking about it haha
but the nic is definitely dealing with ip
you sure about that?
I don't think it has that kind of capability
no
but i think the nic does some things based on ip addresses
maybe i am thinking of switches
the NIC should have an asic that handles tcp and other stuff
switches do that too
at a bigger scale
@jagged forge check what i sent
I think at most it's looking at the CRC to determine if it should drop, and then checking the destination MAC matches before stripping the ethernet frame on to send it on up the chain
I guess it can continue to handle things for all I know
bro you know more about this than me 
lol
but i would not be surprised if some nics have tcp/ip stuff directly on them
I could see there being an asic though, that sounds reasonable
shit some nics have a full operating system on them
at least in a dedicated network device like a switch or router
I have no idea how I'd actually confirm any of this, is there a way to peek into my laptop's NIC's firmware lol
dont
ok I tried using ansible in the past
u can use wireshark
but it was just a bunch of shitty yaml config files
did u set it up?
yaml engineering 
I couldn't get it working but that was a long time ago
I might give it another try but the thought of it makes me cringe
personally i would just stand up a log database
for My last gig
and point all of my applications at the log database
and have them push logs to the database
if what you want is logging anyway
so for the thing of going through packets
centralized logging
that's not a bad idea but these logs aren't really that useful, I rarely need them
u can use something called wireshark
ah, then maybe just have a script that collects them on demand, like you’re doing
it's just to check them, consolidate some info, then reissue some commands out to them
I also don't want to set up a dedicated logging server haha
if your logs are json you can filter them down with jq, otherwise grep is also your friend
we have other ones like that
so
tell me about it 
I used to filter them with awk
ur running a Windows laptop?
awk is my favorite programming language
awk is also good, i am a noob at it
awk is super efficient
I have wireshark
if ur a bash good
PE/COFF to be exact. The object code format primarily used by Windows.
i hate bash 
like the Windows ABI?
actually i like bash, just not for long term things
what am I using wireshark for
tracking packets if u want
I use bash/vim/awk/sed mostly all day every day
vim gigachad
what am I tracking packets for
in the house
wireshark is a cool way to peer under the hood, see what packets are being sent to where and stuff
nothing
getting it to work with tls is annoying tho
u just mentioned wanting to SEE what happens at the NIC
ok im not sure wireshark will help with that lol
mmm
part of, yeah
no it would not
I'm more interested in seeing what all it's handling, is it just handling MAC addresses or does it also deal with IPs and TCP ports?
there should be some commands that show you your network cards and how many packets you have tx/rx and stuff
it should
yeah, I might google around for that kind of thing
but # of packets is not really granular enough for what I'm trying to undertand
there’s a Linux cli tool called bmon that i like
@pulsar pagoda with ansible can you run code with it too?
the network card i was working with had a TUI that showed you all sorts of metrics, like how much stuff was in the buffers. but i think that was a heavy duty network card
from what I saw I was sorta hamstrung to just putting in specific lines over ssh, I didn't get too far before I decided to just try to do it all in python directly since that seemed more comfortable to me
yeah, kind of like I'm doing
yea set -euo pipefail or bust
interesting, I'll check out bmon
bmon does not do this i think
checking it out regardless
cause powershell has some automátion thats right there with ansible
and it's better documented
it was a special cli program that came with the drivers. not sure if there is a similar general thing you can use on linux
that works for any card
if you find one let me know, that would be sick
u can always just have a terminal listen to the output of the file
sure, yeah I should clarify the device doing the sshing is a red hat vm
since the socket file would have all packet data
and from the client SIDE?
I might be able to use a windows server to do it though, but I know barely any powershell
yeah
like what are u using
PS> Shutdown-Computer
this was on bmon’s github page
ooh multicast packets. my company deals with multicast
I'm working on the red hat box and running code off it
I just ssh into it to run scripts on the network
and I'll modify/experiment with them there too
tell me more about ansible, you said it's limited but you can code
it's a orchestration tool
I felt like it was kinda janky and I was fighting it a lot
like I just wanted to write code but it was trying to make me write these grating config files
so it's supposed to be used to execute in distributed environment
once that yml is written that would execute on each instance
separately
so if u wanted to lets Say install something in 300 vms
have you heard of kubernetes 
it would do it
so for instance, if I would want to ssh into each device, show log then would I be able to filter the data all collected to create new commands, then send those all back out - all without leaving ansible?
or modern cloud developers 
yeah
fortunately that's not my responsibility
if u have to set up k8s manually u usually use ansible
cool in concept though
saltstack
it should but i'm not that good with bash
I'm sorta aware of puppet/ansible/chef/salt but I feel like those are for people who don't know how to program
eh
if u can write the bash script that does it go for it
but they might just be nice conveniences to have too
I mean, more of a "pickign the right tool for the job" kind of thing
I'd rather not write a bash script
think about reinventing syslogd
yeah
also ansible is the tool of choice of the eth Zurich hpc cluster
we had log collection from distributed systems from 90s
I mean, still better than bash script
what's that
Google eth Zurich
well right now I'm using python script, although originally it was a bash script actually
but I just went ahead and rewrote it cause it was easier to maintain
a high perfomance computing ckuster
what is a cluster in this context
a bunch of computers
some say python is a better bash, though i know some people hate that sentiment lol
python is ok for somethings
I use both, they're just easy and ubiquitous
yeah I use scp relatively often
i don’t mind bash until you start doing anything more than 15 lines and with 2 levels of nesting
but also im just not that good at bash
it sorta grows on ya
the more I do it, the more I do it
and I guess the default hotkeys are emacs too, I sort of acquire more and more as I go
it's nice to live off the land so to speak
it's sorta goofy at times
emacs
yeah I don't fully get it, that's why I use shellcheck when it's something I'm not throwing away
That’s a cringe take imo
Because I use bash more
therefore python is worse
mostly I'm throwing stuff away though, I'm usually doing some awk and sed to filter/organize commands from one thing into another thing to "pipe" it on its way
like people think i'm a low Level hard headed programmer
lol
I hated it when I first started learning it a long time ago, cause all I knew was Java
i just wish people wouldnt SEE everything as a nail
and I missed that clarity of knowing the types of stuff going in and out on the first line, just irritated me
Java is such a better language tbh
then I got over it, and became a reckless python programmer
haha I don't know if I'd go back but I think a lot of concepts I learned in Java have helped me understand python better than if I had only ever learned python or something
java was my second language
My first was cpp
I only learned it cause I was interested in programming android apps and my brother was making money making minecraft mods in Java, so I read through Headfirst Java and another android Java programming book, downloaded eclipse and went on my way
that sounds pretty epic
it was a pain in the ass
are you a vim person?
Yeah
nice
switched to neovim recently
my coworker convinced me to try neovim and i loved it at first
but in the interest of getting shit done i have reverted to vscode
I have neovim on my home computer but I just use regular vim elsewhere, unless they just have vi
trying to setup a Haskell lsp without crappy JavaScript shit
neovim is so pretty though, with the right setup
i usually have my .vimrc in github
I'm usually too lazy to edit my .vimrc, there are a handful of changes I have to make or I'm miserable though
haskell is pretty fun
I just download some random .vimrc off github and edit it up a little
Haskell is fun because they typing is strong enough I never get runtime errors
it’s all at compile time
if u like Haskell u would like f#
most of the code I write is like garbage to get a job done as fast as possible, if I see a corner case I'll fix it if I have to, avoid it otherwise
I'm writing a bunch of one liner type crap
awk is my favorite programming language lol
if you want provably awesome code, lean 4 is a fully fledged dependently typed pure functional language as well as a theorem prover
You can have compile settings at the top to loosen the restrictions
are u talking about that spec writing lang?
so it compiles with warnings or with nothing
by Leslie lamport?
I learned a bit of haskell (for great good?) a long while back, but I didn't get too into it
I have heard some good things about closure/lisp but afraid to get sucked into the cult
functional programmers are cultists
no, lean was originally a theorem prover for mathematics but with lean 4 they made it a full programming language and reimplemented lean’s theorem prover in lean
if you consider python a cult you are in for a rude awakening when you meet go or rust programmers 
i know some
I think python just has a super low barrier to entry and it's just very accessible. It's got that social network effect, like if you're tryign to do something someone's probably already done it kind of thing. I lean on that as one of its key strengths imo.
I would use it less if didn't have that
Anything with Hindley-Milner type inference is awesome to me
all I care about is maximizing my possibility of someone else having written the code for me out there
low barrier to entry, popular, large ecosystem, etc
I can get the speed of dynamic typing and the safety of strong typing at the same time
popular and large ecosystem doesnt necessarily translate to good u know
awesome until you get insane type inference errors in your generically generic functions 
c# generics to the rescue
popular often does translate to higher quality libraries
as someone who works with less popular languages i have felt this
You can still give type declarations
i do think the dotnet ecosystem is of a higher Quality than the python one
rust and go are not even unpopular but the ecosystem is lacking in certain areas
true
And the type inference errors being insane is a good sign you’ve written shitty code
give them time
i had a good time with Haskell until i ran into monad transformers
that was like, my tipping point in terms of what i could handle
i wanted to eliminate my monad sandwiches which were causing me to write annoying nested matches
don't let sharp hear u
we’re safe, it’s like 4am lol he’s asleep
cats are My mortal enemy
Bruno died running after a cat
the cat also died tjoi
though
mom told me today how she saw the light going out of his eyes
he's moving his tail in heaven
he was a good Christian dog
aint Even joking
he SAT with mom to watch the church sermon on sunday
didnt make a noise
sounds like he was the goodest of boys
ETH Zürich?
yeah
ye they research a lot of stuff
i have access to the cluster
:O
but i don't want to make appointment
cause their really strict
if i'm going to do an appointment for the cluster i want to have everything ready so i don't waste time
on thinking the setup of the sim
sheeeesh 50000 cores
yeah it would be helpful if they made full ansible configuration (minus actual topology details) readily available, so that workloads could be locally tested be before submission
nope they give u a subset of the actual compute
as a vm
and then u set Ur shit there
or a couple of vms
is it x86?
Ooooo fpga clusters nom
next they should get a quantum
yeah it's pretty useless yet iiuc
sharing 100 qubits is different from sharing 50000 cores i imagine lol
why is it so hard to make more than a handful of qubits
anyone can run stuff on ibm's quantum computer, see how much that is https://docs.quantum-computing.ibm.com/start/hello-world
material scientists have a better grasp at the problem
they give you some amount of computation time per month for free
so ibm has a computer with 433 qubits
whack
i know there is a difference between physical and logical qubits tho
the NSA is hackin' everybody with that no doubt
shit ansible is owned by red hat, which in turn is owned by ibm
cuz a decade ago d-wave advertised 2000 qubits and scott aaronson roasted them
ah yes, the transitive relation
that's how they getcha
so u need more than one physical qbit for a logical one
cause u have to take error correction into account
thats what i gathered from the wiki
makes sense
they do that with regular bits too, so no reason it would be different I suppose
error correction that is
later, I probably should too
i am going to be so fucked up in terms of sleep on monday
maybe i will just do an all nighter at this point
that'll make it worse lol
Does it support extraction into rust????
Lol
what is reverse chain rule
I struggle to evaluate equations
I know what i’m doing, but I make a lot of arthimatic mistakes with algebra
Do I need mental math skills or…
Just practice
Imo
It can help to consciously slow down and value correctness over speed
While learning to use some concept or formula, also try to develop methods to check your work if possible
hi big bro ur complex no link really helped me
thanks for that '
@autumn onyx actually i think those are not equal
Np, glad to help
does it cost money
nvm lol i figured it out
@jagged forge take a look at this
interesting, it seems like they have some amount of support for templates, but there are a lot of issues eg this one
based on what i have read, i am guessing you can use a concrete instantiation of a template but not the (unbound) template itself
one of the developers goes into more detail in this blog post from 2017: https://www.mono-project.com/community/google-summer-of-code/reports/2017/cppsharp-dimitar-dobrev/
i wonder if theres a reason why unsafe code in c# cant use c# generics
@jagged forge cause the examples of code from c# dont have any generics at all
for example @jagged forge
go at the top solution for this
and read the sentiment behind using unsafe
they dont give an argument against it
its more like i dont want to use unsafe
Two pings in one message DAMN
apparently you can only take pointers to “unmanaged types” according to this SO answer
so
there has to be a way of making constraints for the unmaged generic types to a integral type
cause the runtime itself supports those integral types
ive seen them on the runtime
say yes if ur following what i mean
if not ill explain in more detail
im not following but i am also not that interested in c# honestly
ok
so heres the thing
templates only allow the passing of integral types at instantiation
what this means is that when u use a template function u need to pass the type of the argument
and that type needs to be of a integral type
at compile time
can’t you have templates that accept non integral types, i am confused
no
cause template signature functions need to be resolved at compile time
not at runtime
i have definitely used templates with non integral types for things like json marshaling
is std::unique_ptr<std::vector<T>> not an instance of a template with a non-integral type
the std resolves to integral types
the address to which it points is though
so a pointer address can be seen as a integer
with function composition
which in cpp terms is called overloading
a struct is a pointer
sec
i think im confusing pointers with references
also mind u
c doesnt have "variable references"
asking my cpp expert friend
ok
so heres the thing
last 6 messages
disregard them
u can pass a struct to a template argument
but u need to specify its type as the name u gave to the signature of that struct
in the c# documentation of microsoft ```In C#, a generic type parameter cannot itself be a generic, although constructed types can be used as generics. C++ does allow template parameters.
also c++ allows for having function passed to the template
as function pointers
thing is kind of convoluted it seems
mmm
the overloading can be overwhelming at first but people should be able to get the hang of it with time
just a guess though
key takeaway
all of ur templates calls should have types which are resolved at compile time
@pulsar pagoda anything promising on qcomputing?
are they here?
idk the hype
i know it exists somewhat
but im not sure specifically what
their like
im thinking of playing around with qiskit
were going to be able to do computations on stochastic functions
with more precision and shit
thats the average mindset from people i see with hype over quantum computing
o
i mean everyone i remember that hyped over it when I was in school never gave me any good reasons
software ppl come in different varieties tho
the python ones
them too
the ones that only want to do python
math nerd hype 🔥
Hey anyone knows that feeling when you're trying to find a general formula for a parametric sequence and at each new order you find out your formula doesn't work anymore and you spend literal hours trying to understand it until past midnight at which point you're so obsessed with that problem you go to a math discord server to complain about it before going to bed?
Because I sure do
I've had a similar feeling with a different kind of problem
Oh what was it?
it will be kinda long to describe the problem now
but I also feel ashamed because it turned out to have a simple solution 
I was dumb ngl
Well, nice to know I'm not alone in this lmao
Oh last time I had that kind of problem the solution was everything but easy XD
but the bond with problems that u spend hours on is real
I basically found a general expression for Catalan numbers without even knowing about their existence somehow
kinda becomes a part of u at that point
combinatorics is super fun
Yeah like those problems become basically your best friends
Once you solve them. Before that it's kind of a toxic relationship lol
and after solving you will remember it forever
For sure
Wait you made me realize the problem I'm currently working on is combinatorics too 😂
Guess I just can't get enough of it
It is super fun though, you're right
Hopefully it's not Catalan numbers again cause it looks similar
@jagged forge @burnt ledge
Ok so like
We're solving a nonlinear ODE right
So we get the homogenous and particular solution
The first two terms are the homogenous solution, the last term is the particular solution
if its nonlinear does adding homogeneous and particular still work
Isn't that usually how you solve nonlinear ODEs, it's been a while since I've taken ODEs lol
We can write the particular solution as
i thought the ppint of homogenous/particular was using the linearity of the ODE to apply superposition, and adding any two solutions gives you another solution
lol
yes
Thought so but trusted ur word more
We can rewrite this as so
(Again isntead of F_0/(k-mw^2), we can write it as (F_0/k)/(1-r^2))
So for the r < 1 and r > 1 cases
My professor says assume initial conditions = 0
Then he plots the behavior of the particular solution only? Against the forcing function F = F_0 * cos(wt)
Which looks like this
This is for r < 1
This is for r > 1
Then we move onto the case that r = 1
now for this he just ??? plots the behavior of the whole solution ???
And so what I'm stuck on is
This is what my notes look like rn
is the ODE by any chance damped forced harmonic motion
Undamped, but yes
Undamped forced harmonic motion
So these are my notes rn
I just want a clean reason/transition from
"Oh first we plot x_p against F(t) for when r < 1 and r > 1" to "then we plot x (the whole thing) against t when r = 1"
I cpuld go back to my first year notes and see how they prove this
I know how
Don't worry
It's not a misunderstanding of the math
Purely like
how do I order my notes lmfao I don't like the way he does it
It's so random
oh first we focus on just the particular solution
for r < 1 and r > 1
but for r = 1 we focus on the whole solution
I mean isnt for all three we are taking initial conditions = 0?
Yes
In all three cases, the whole solution = the particular solution
No
How
ode to joy
But the particular solution is only the last term
if initial conditions are zero then the sln to the homogenous is zero, and particular is all thats left
regardless of r, no?
The homogenous solution is -F_0/(k-mw^2) * cos(w_n *t) no?
which is only 0 if F_0 is 0
F_0 is not an initial condition and we're assuming it's nonzero
Idk what this means
fffeatherrr
Yeag
The homogenous solution is this
the f0 only comes in when ur doing a particular solution, bc the homogenous part wojld be a solution to mx.. + kx = 0
Which doesnt even have an f0 term
I realized that right as I sent that oops lol
Ok can we restart somewhat?
Sure
Okay
fffeatherrr
Yega
I'm even more confused now so bear with me
We said that the solution will be the sum of a homogenous and particular solution
so we do some math and find the constants and we get
when you compare terms it seems like the first two terms make up the homogenous solution and the last makes up the particular?
but that doesn't make sense because the homogenous solution shouldn't even have an F_0 term in it lol
but if we rewrite this
to this
then the first two terms make up the "homogenous part" and they match up with the solution obtained previously in my notes when we considered unforced motion
but that would mean that the second term is the particular solution
fffeatherrr
So now that doesn't add up 
But whatever
I can turn a blind eye lol
But still that leaves me with trouble when I do my notes
Because if I say that I'm interested in the behavior of the particular solution only
Well ok clearly it depends on whether r < 1, r > 1, or r = 1
For r < 1 and r > 1 the math checks out
But when r = 1
fffeatherrr
So my professor rectifies that by taking the limit as r -> 1 <=> lim w -> w_n
But the thing is he takes the limit of the WHOLE solution
which gives you an indeterminate form (in the last term) and then you apply L'Hopital's rule and simplify and it's easy
Okay i was working thru it and im confused now too
But you can't do that here since you end up with a 1/0 form
Confused about what?
idk what exactly, but i feel like im messing something up, or misremembering something, or forgetting something
which i havent done diffeqs since first year so its likely
felt
reminds me vaguely of bifurcation theory
I think the answer is that my professor just wanted to highlight how the particular solution behaved, since we already knew how the homogenous solution behaved
No? Maybe? Idk let me think more
It's pointless to think too hard over this lmao thank you but I think it's best to just move on @burnt ledge :P
i am guessing this is wrong when r = 1
Messy
my experience solving recurrence relations (which are related to differential equations) tells me you just have to solve singular cases separately
i have never taken differential equations but i had to do some recurrence relations in my probability textbook recently
what are you doing recurrence relations for
My friend asked me
To code something for him
And the sequences were defined in terms of eachother 😭
How do I code that? I’m not sure
Recursion is goated
Recursion is goated
But idk how to handle a defined in terms of b and b defined in terms of a.. 😭
well, just make two functions that call each other
a_n = f(b_{n-1})
b_n = g(a_{n-1})
why
Because b hasn’t been defined yet
then just define b?
Ikr
i think you do not need to make a class
you can just declare f and g in a header file first
and then implement them together
except it doesnt do it another file but thats just how they decided
Ye
No cuz like
Yk how lambdas are
So my “declaration” of function a
Included function b
But if I just use normal fking functions it isn’t a big deal
I’m dun
yeah lambdas are a bit annoying i guess
Yeah
amukh
the chapter on functions
of schaums outline
covers recurrence relations
go read it
schaum's outline discrete math
I meant Classic since you like disc maths bro
Damn
and i have time to shit post
like
get ur shit together
u can do it amuk
we all know u can
believe in urself my dude
@jagged forge u there?
hi
use gdb i guess
im seeing this object in pdb
mapped in a struct through ctypes
xclDeviceInfo2
i found it in the debugger is used for initializaing the board apparently
i need to get the values the python script is using to map them to a cpp struct so i can use them
i think this is not even the data yet
just an array of tuples
zzzz
yes thats what it is
fuck my life
why is discussion-2 always just programming these days
Atleast it’s not haskell

Someone here worked at bostom dynamics right?
Why did they not use AI for the robot?
because we have nowhere else to go 
It's so disappointing to learn that all of the robots movements are hand coded
we are fugitives in this server
Hello
What robot? And why AI?
Ai so you don't need to hand code every movement the robots does
how would you go about using "AI"?
That'd be really nice honestly, but AI probably isn't at that stage yet. Or maybe it is (to some degree) but probably confined to a university lab or something. Feel free to drop links if you're aware of examples (I find this stuff interesting and would like to know what's out there).
If they coded everything it's probably to make sure that the robot can perform reliably. Using AI might be possible, but given some of the ways it's implemented I'd imagine analyzing the system's performance and trying to fix bugs is probably more troublesome than a more "classical" approach. Industry tends to be a bit more conservative and slow from what I've witnessed (which is reasonable if you want your stuff to be reliable).
I'm no expert, but that's my two cents (or educated guess I suppose).
Whats the integer of 23,437
Don't spam multiple channels with your nonsensical question
Is there a site where i can learn high school phisics?
Something similar to khan academy
you spelled physics wrong
organic chemistry can help you with organic phisics...
