THREADS - Program in Parallel!
28:17
Getting Good at Programming
13:23
7 ай бұрын
Пікірлер
@KaDaOtok
@KaDaOtok Күн бұрын
if I have just one ssd in my debian machine how should I setup the file mangement system?
@Talking2Wall
@Talking2Wall 6 күн бұрын
Great guide!
@Anonymous_404_Not_Found
@Anonymous_404_Not_Found 9 күн бұрын
Just curious, have you encountered a scenario where loads of nested conditions/loops was just unavoidable? Im currently writing a multi client connection handler using epoll (edge triggered), but with the additional TLS layer (using openssl C library). For non blocking sockets, im finding the libssl api to be cumbersome when combined with edge triggered epoll (the few posts online ive found from the few others who have attempted this seem to agree), at least when trying to abide by the RFC for proper TLS usage (bidirectional close notifies, etc). There are so many states to account for (further complicated by multiple threads and having to use mutexes/semaphores to prevent races). Ive got it working but I hate all of the nesting I had to do in a place or two (and will certainly be trying to improve it to the extent possible). Gives me imposter syndrome just looking at it lol.
@raven-vr5yz
@raven-vr5yz 12 күн бұрын
hey I have a question about your implementation of controling light bulbs in your room. I’m currently in school working on a smart home project and I have everything already planned out but the light bulbs. Should I use a relay and put in in the middle of the connection or do you know about any light bulb that has an open api?
@hoff._world
@hoff._world 12 күн бұрын
hey bro so the lights I have are phillips hue and they use a protocol called zigbee which is like a mesh-based local smart home protocol. There's a great piece of software called zigbee2mqtt which will bridge that to MQTT which is a network socket based protocol that any machine with an internet connection can access, and that's how I'm bridging my lights to the network. I have a daemon that bridges my own protocol to MQTT and that's p much how it works. I'd suggest checking out the zigbee2mqtt supported devices page for a list of bulbs. Zigbee bulbs are kind of expensive and recently I reverse engineered the IR remote for those cheap chinese LED products so I'll do a vid on that too :) if you go the zigbee route you need some hardware to act as the 'zigbee coordinator', which can be a raspberry pi with a USB zigbee coordinator dongle. I'm using the SONOFF ZBDongle-E
@MrRufus302
@MrRufus302 13 күн бұрын
@hoff._world: at 38.53 minutes into the video, you do something based on the command _make_ not producing the output you were looking for; what did you do/type to correct the issue? I cannot proceed any further, because there is no online information that deals with essentially, what the unknown issue is. UPDATE: I have completed the tutorial and it works well, except for the`dialog-information` box. I completed the program on an Android mobile phone IDE; the issue is Java. I do not know how to implement the Java `AlertDialog` box for Android devices; all examples I have seen are very complicated to understand (as I don’t know Java) and difficult to implement. Any chance of some assistance with this issue?
@rangerzh
@rangerzh 16 күн бұрын
is it 24/7 port forward?
@grommysvideohorde2734
@grommysvideohorde2734 19 күн бұрын
Howdy! This tutorial was INSANELY helpful (and I really dig the fact that you named your servers after Pokemon, I'm doing the same lol), but noob question: If I have several drives on my rig, how can I set them up to be shared via NAS? I could only seem to get the root drive to show up, but I have 2 8tb drives I want to use for storage, and which are presently sitting unused. Again, very noob-y question, but I'm a first timer, lol.
@metindmrc
@metindmrc 21 күн бұрын
Great job ! Pls dont forget to clear cli lines. KZbins play bar comes before the codes.
@mailoisback
@mailoisback 29 күн бұрын
Wow this is impressive. Thanks for sharing, it gave me some ideas to work on.
@noodlery7034
@noodlery7034 Ай бұрын
is your skate 3 gameplay emulated or are you recording from an actual ps3?
@hoff._world
@hoff._world Ай бұрын
emu but I own both a PS3 and a physical copy of skate 3 and ofc im using my dualshock 3 to play
@LorenzVdv
@LorenzVdv Ай бұрын
Paradigms are when stupid people take a single solution for a specific problem and claim entire programs should be written that way. Events are tools, sometimes good, sometimes bad. Use it when it makes sense, otherwise dont. Over my carreer i've always experienced paradigm coders to be producing the worst code bases. They write way too complex code for simple problems. They write 10x more code than what is actually needed. And with just those 2 cons, you'll end up with a un-maintainable code base in no time. And the worst is.. they keep doing it. Over and over again, because it's all they know, and admitting it's bad would destroy their ego. And they wont allow it.
@kerch00
@kerch00 Ай бұрын
Paradigms are separate from people who like to misinject complexity into their formal work
@LorenzVdv
@LorenzVdv 29 күн бұрын
@@kerch00 i disagree. From my experience, their idiologies always results into complexity. Probably because their paradigm is the wrong solution for the problem that needs to be solved.
@kerch00
@kerch00 29 күн бұрын
​@@LorenzVdvParadigms are not really tools as you speak of, they describe the architecture of languages. One doesn't just solely program functional in java even though it's possible. It's this reason why JavaScript is terrible since you are able to, and people do, mix these different types of programming together. Java is good for enterprise since it's Oop and imperative, C is good for kernel work since it's procedural and imperative. Haskell is not good for much but research because it's not imperative.
@uGetkilled
@uGetkilled 26 күн бұрын
100% the only sensible comment in here. I think the problem in tech is also that people "like" certain tools or technologies and that becomes the basis for decision making on solving problems. They then advocate for said tools/technology as if it's the end-all-be-all silver bullet solution to everything "because they've always used it, and it works". Just because you 'can' fix a problem a certain way, doesn't mean you 'should'.
@LorenzVdv
@LorenzVdv 3 күн бұрын
​ @kerch00 but like you said, languages allow for multiple paradigms. Paradigms dont make u use a language "as designed", they just hyper focus on certain features from the language and claim you must use these features and using other features are bad practice. The reality is that every feature has it's purpose and every problem has a best fitting solution. You cant use a few solutions to solve every problem. Like Mike acton said: "The problem is the problem" meaning you cant use 1 solution to fix every problem. Problems are unique. And paradigms ignore this fact.
@Palatonista
@Palatonista Ай бұрын
I remember coding UI-manger for small medical device at my current job. It was hella fun I must say
@hoff._world
@hoff._world Ай бұрын
ooh sounds cool. can u say anything about it or under NDA or smth haha
@chudchadanstud
@chudchadanstud Ай бұрын
Yes it's good fun but the coupling is insane and the debugging is hard.
@hoff._world
@hoff._world Ай бұрын
which, depending on ur definition of fun could also be fun...
@stefanalecu9532
@stefanalecu9532 Ай бұрын
You're not Tony Hawk, you're Tony Hoff
@redofficiale
@redofficiale Ай бұрын
you'll eventually stumble upon/reimplement reactive programming. I recommend reading the manifesto and looking at the implementations, maybe you'll change your view on this manner. I agree that enforcing Event-Driven because why not is just another cargo cult. Every decision should be motivated and solve specific problems
@timtreichel3161
@timtreichel3161 Ай бұрын
I think it really just comes down to the kind of problems you are solving. In cases like embedded systems, message processors, user interfaces, ect, events are a good way to model the problem. I guess you could almost say in general any program which should run "infinitely" and receives different inputs at (un)specified points in time can probably be modeled pretty nicely in an event based way.
@hoff._world
@hoff._world Ай бұрын
ye 100% agree, ig those are just the kind of problems im solving atm
@joshuarowe8410
@joshuarowe8410 Ай бұрын
One thing I'm exploring right now with a Server <-> Embedded device communication layer is wrapping up the event-based / state machine style code behind a simpler more imperative / RPC-like semantics functions. So "update_configuration()" internally might do a bunch of messages back and forth from the device to check current config hash, upload new one in chunks, then instruct it to swap over to the new config. If you have async/await, or Promises in NodeJS, etc, then you can present a quite nice API to help the onboarding issue you mentioned a bit. Nice shark jump.
@hoff._world
@hoff._world Ай бұрын
oh my lord we are the same person. U might be interested in my endpoint based rpc protocol for embedded sys that hybrids events and rpc hoff.industries/release-mup.html have u done like a spec doc for urs I can check out?
@estebanmurcia8451
@estebanmurcia8451 Ай бұрын
Could you recommend some projects that you would say helped you learn a lot? My focus on programming has always been high level like spring in java, nextjs / react, etc... I still always like embedded systems, not anything specific, from OS to socket programming and even some IoT, but haven't really done much to learn.
@hoff._world
@hoff._world Ай бұрын
write a basic TCP socket server with some clients, you could implement a 'chat server' to start off with which is pretty simple. You'll have to design a protocol for initialising, sending messages, leaving, etc. which is a lot of fun
@quinndirks5653
@quinndirks5653 Ай бұрын
I personally would prefer a version of this video without the skateboarding video game in the background. I managed to make it through, but it wasn't easy. Maybe make the video of the skateboarding smaller, and your face box bigger for future content? I found myself wishing that the distraction was gone so that I could focus more on what you were saying and the examples being shown... Just something to consider for future content. Other than that, it was a really interesting speech on an interesting subject. Subscribed
@hoff._world
@hoff._world Ай бұрын
hey bro, have been doing this style of vids for a while and had a disclaimer at the start the visuals werent critical and you can just listen instead. if u didnt realise i was actually playing the game in real time while talking, it's fun for me and think it clearly marks a different style of content from the other stuff on my channel. I try my best to make sure that the added visuals in these ones are not mandatory because I have got this feedback before, some people like it and some would prefer to just listen. Thanks for watching and I appreciate the feedback. did u see me jump over the shark at the end tho? that was pretty cool u gotta admit
@stefanalecu9532
@stefanalecu9532 Ай бұрын
​@@hoff._worldif it was scripted, that was damn near perfect, shark jump ftw
@hoff._world
@hoff._world Ай бұрын
@stefanalecu9532 these 'chatting' style vids rnt scripted, I have some dot points but its generally me yapping :D I legit forgot I even placed my marker at the shark and was like aight might as well try hahaha
@Tommy45344
@Tommy45344 Ай бұрын
good stuff man Ive written 2 event handling interfaces in the last few months at my new job, one for TCP communication and one with rabbitMq. Gotta say I’m also event pilled it’s good fun
@hoff._world
@hoff._world Ай бұрын
real dude we are eventmaxxed and eventpilled that's sweet, gotta do smth with rabbitmq or kafka at some point myself
@UsatiyNyan
@UsatiyNyan Ай бұрын
Also, if you have problems with handling events, look into more sophisticated event queues! Deferring and prioritisation always come in handy.
@Unbreathable
@Unbreathable Ай бұрын
Man, you speak me right out of the soul. I never even realized I'm doing event based stuff all the time, but for me I guess the approach I'm taking is a little bit of a mixed bag. I'm currently working on a decentralized chat app project (something like Matrix) with its own custom protocol. There are also events running mostly over websocket connections but also over normal HTTP requests all across the stack. It's been really enjoyable to work with but I do see the limitations of events. Of course you can also just send events over a normal HTTP request, but the way I see it, that doesn't make sense when you can just have the endpoint do a certain thing. But for sending chat messages, changing real-time data and all that kind of stuff I do love using events.
@hoff._world
@hoff._world Ай бұрын
that's an awesome project and yeah I can see how you'd want a hybrid approach for that. you could as you say force events over HTTP requests but it might end up being a square peg in a round hole... with it being decentralized I can't think of a better architecture then event based no? were there others you considered also?
@Unbreathable
@Unbreathable Ай бұрын
@@hoff._world I think it would be really hard to implement something like messaging using something else than events, maybe there is something besides events I'm not aware of, but I haven't considered anything else. Messaging is one of those things where you just need events to make sure things can be received any time and also resent if something goes wrong.
@raven-vr5yz
@raven-vr5yz Ай бұрын
damnn, bro's Bob Ross, professional surfer and Tony Hawk at the same time
@hoff._world
@hoff._world Ай бұрын
wait til i do a vid on my electric foil surfboard :P
@homemadelemonai7243
@homemadelemonai7243 Ай бұрын
"11 o'clock is an event" haha, nice vid
@Lavashyk
@Lavashyk Ай бұрын
I cannot describe how I love your previews. It is always piece of art. And obviously that I love the videos you make. About this topic. Observing various paradigm is always fresh feeling in programming. Me personally embrace Data Oriented Design (for game development) despite the popular approach - OOP. I mean, it is correct that paradigm is a architecture tool. And for me, it is sad that people choose OOP for every project. When you have a hammer, everything is a nail. So, It interesting for me to listen about the paradigm I have never heard of 😂 Thanks for the video! Nice jump over the shark😅
@hoff._world
@hoff._world Ай бұрын
couldn't agree more. Learning about all the different ways to structure applications keeps things fun - right now I'm having a blast using events for everything but in a year or two I imagine it will be pretty boring... same if it was any other paradigm. So then it will be time to learn a new one :)
@UsatiyNyan
@UsatiyNyan Ай бұрын
BTW, the game scene itself has to be a tree(propagating transformations, ray casting and etc.), how do you create relationships between “nodes” in DOD?
@UsatiyNyan
@UsatiyNyan Ай бұрын
Brooo, that’s what I’m saying!!! I’ve recently started making my own futures/coroutines/executors/event queues… It’s basically free performance. And if done correctly, writing safe and productive code becomes much-much easier!
@hoff._world
@hoff._world Ай бұрын
nice so ur implementing those paradigms yourself??
@UsatiyNyan
@UsatiyNyan Ай бұрын
Ye, in C++ though, but it comes about soo cool! I’ve got something like ‘co_await socket.read/write(bytes)’ and ‘co_await socket.accept()’ working with epoll. One of the things I really like is that it can work in one thread, without the cost of atomic operations, but with all the niceties of “asynchronous” execution.
@stefanalecu9532
@stefanalecu9532 Ай бұрын
​@@UsatiyNyando you have these somewhere public? I'd be interested in the implementation
@UsatiyNyan
@UsatiyNyan Ай бұрын
@@stefanalecu9532 ye, in UsatiyNyan/serious-execution-library repo on GitHub. Primary example is in serious-io-library repository. Multithreaded impl is WIP, though ;)
@ScaryHutmanPictures
@ScaryHutmanPictures Ай бұрын
First! :D
@hoff._world
@hoff._world Ай бұрын
twitter verified ☑️
@cience
@cience Ай бұрын
Such a handy guide and i liked the way you emphasized on good practices. Subbed! Thanks
@hoff._world
@hoff._world Ай бұрын
legend xx
@DevJeremi
@DevJeremi Ай бұрын
I use Linux 'cose it is: - it is more fun - stable and fast - customization - easy app install and updating them - grate/easy env to use/setup for coding stuff
@mrinalyadav4261
@mrinalyadav4261 Ай бұрын
This video was grt, i also want to learn all these stuff, any advise from where can i learn these low level stuff? i cant find any system engineering playist on youtube
@chad-ed2vn
@chad-ed2vn Ай бұрын
Since I watched this server tour video I have been trying to find another one with the same vibes. Couldn't find sht. So now im back here to rewatch this jewel.
@hoff._world
@hoff._world Ай бұрын
dababy VIBEZ
@folguefolgue6177
@folguefolgue6177 Ай бұрын
to make it easier to unmarshal you could define struct with the same data structute definition, check the json module documentation. Its been a while since ive written go, but I remember it been simple to do. PS: Interesting video :)
@evanrittenhouse7866
@evanrittenhouse7866 Ай бұрын
Have you thought about live streaming you coding?
@GregTash
@GregTash Ай бұрын
That would be pretty good I reckon
@hoff._world
@hoff._world Ай бұрын
it's crossed my mind, unfortunately I'd be exposing myself as a massive fraud who's never written a line in his life. nah kidding, main issue is timezone (im AEST) + busyness, there's no shot I could hold down a schedule but maybe if I announce one like a week in advance could work... no promises but ill think on it!
@royalpotato4733
@royalpotato4733 Ай бұрын
Its learning time :> also hoff I need some ideas in the field of Network programming, anonymity to work on for my final year project. Any assistant sensei
@alex.289
@alex.289 Ай бұрын
Couldn’t these problems be solved with Kubernetes?
@hoff._world
@hoff._world Ай бұрын
if it could I would still rather not pull in all that complexity for what I knew would be at max 300 loc
@alex.289
@alex.289 Ай бұрын
@@hoff._world yea it would probably add more complexity than necessary indeed
@hoff._world
@hoff._world Ай бұрын
@alex.289 it is always interesting tho to see other options put forth, in software engg and infrastructure stuff there's always multiple ways to do the same thing :)
@AliMoeeny
@AliMoeeny Ай бұрын
thanks for sharing, as always very educational, obligatory mention of Tailscale. Since it just works almost everywhere .
@estebanmurcia8451
@estebanmurcia8451 Ай бұрын
Have you ever used ruby for network programming? if so, what are your thoughts, specially when compared to other languages?
@hoff._world
@hoff._world Ай бұрын
I have never actually written anything in ruby. I hear rails is pretty good, or by network programming do you mean socket based stuff?
@estebanmurcia8451
@estebanmurcia8451 Ай бұрын
@@hoff._world socket based, i once planned a project, basically a fancy firewall and a professor recommended ruby which kinda surprised me because i never thought ruby would be used for this type of projects, later i found out that there are actually more projects for "low level" networking in ruby than i expected
@hoff._world
@hoff._world Ай бұрын
@estebanmurcia8451 interesting, yeah that surprises me too since it's interpreted you'd probably consider it a high level lang. Come to think of it there are also more socket programs and such written in python than I would expect so yeah I can see it
@mblenczewski
@mblenczewski Ай бұрын
Nice video! Reinventing a vpn, we love to see it :^) Initially when I saw the setup_exec() and process_watcher() code I had a lil' grimace, but it is simple, effective, and was quick to implement so I cannot complain. Plus this is written in a real language and not c so you have convenience and ergonomics, no need to overcomplicate anything. Aside from wanting to implement something yourself, why not simply use some vpn server for a point-to-point or point-to-site setup? Would that have worked, or is this use case of private services tunneled over public networks (the internet) unsuited to a vpn in some way? Any hints on what is coming up next?
@hoff._world
@hoff._world Ай бұрын
didnt wanna use a VPN because I want this to be always on and having everything go thru my home network all the time would probably be kinda slow re: coming next I think I should stop making promises I can't 100% keep :')
@mblenczewski
@mblenczewski Ай бұрын
@@hoff._world hahaha no worries about the future videos. Sometimes things become larger and more complicated than expected, sometimes other topics pop up and are easier to do, or we just stop being interested in something. All of these are fine and happen, nothing wrong with that :) Regarding not using a vpn due to all traffic always going through the home network, my understanding was that this was something you could choose to enable, not something that was unavoidable? For example, in a "point-to-site" case, your LAN would have the vpn server running on your top-level router. This is the "site" part, and would allow incoming traffic to be routed to all/some local subnets. On your device, i.e. the "point" part, you would have the vpn client running and this would tunnel all traffic going into it to the vpn server, as your ssh setup does now. You could obviously tunnel all traffic on your device through the vpn, and this could indeed be slow. But the default would be that your local network subnets are visible on your device, likely under some different subnet address and only traffic to this new subnet is tunneled (e.g. your home network is on 192.168.*.* but is visible on your device as 10.0.*.*, you simply access your local network services via this new 10.0.*.* network). I may still be misunderstanding your use case or constraints And this may not be how how all vpns work, some might enforce greater security at the cost of tunneling all traffic, or may not be configurable/flexible enough to allow my above mentioned setup.
@hoff._world
@hoff._world Ай бұрын
@mblenczewski neato u learn smth new every day that does sound like it could be good. to be honest haven't experimented so much with self-hosting a VPN of any capacity - freebsd's wireguard implementation was only recently considered 'production ready' so was planning on messing around with that when I have the time. The way this setup works at the moment is only port based, it just sets up a listener on that port and routes traffic on that through the enc tunnel, everything else goes thru the normal connection. With the method you're describing it would be that you simply interact with them as if they were regular hosts on your LAN except on a different subnet which would also be a completely valid way to solve the problem, thanks for sharing :)
@mblenczewski
@mblenczewski Ай бұрын
@@hoff._world your current implementation maps to multiple "point-to-point" vpns (one for each sshd host), each exposing their services onto the localhost subnet, I think. To my mind, the upside of ssh tunneling is remapping ports, which you don't get by default with a vpn. And ssh tunneling isnt talked about enough as it is, so it is always good to mention it. Enjoyed the video regardless :)
@Palatonista
@Palatonista Ай бұрын
Bro is on a hot streak 🔥Keep 'em commin mate ❤
@hoff._world
@hoff._world Ай бұрын
thanks x
@shevafire
@shevafire Ай бұрын
Depends of project ...
@raven-vr5yz
@raven-vr5yz Ай бұрын
bro just casually drops the most insane videos youtube has ever seen fr no cap
@hoff._world
@hoff._world Ай бұрын
fr fr ohio skibidi cooking porkchops for the sigma crew
@splattelol
@splattelol Ай бұрын
Sorry mom, can’t talk right now. Hoff just posted
@hoff._world
@hoff._world Ай бұрын
😳😳🫡
@ducky1681
@ducky1681 Ай бұрын
wow man, you really went all-out with this one, that whole distributed system is beautiful, here's hoping you release it one day 😅