#does anyone know how servers work?
1 messages ยท Page 1 of 1 (latest)
Here is an AI assisted attempt to answer your question ๐ค. Maybe it helps! In any case, a human is on the way ๐. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
When you host a server on a specific port, your computer essentially opens up that port for communication and listens for incoming requests. When a request is made to that port, the server program running on your computer processes the request and sends back a response. Your computer's network interface card (NIC) is responsible for transmitting and receiving data packets to and from the server.
Useful links:
Have you learned about the network?
nah
And ports?
nahh
traffic first and foremost is handled by ur router
so eventually someone will send data to ur router (via IP address, using UDP or TCP as communication protocol)
i just wanna know what happens when i do npm run dev
ur router then sends the data to ur computer bc uve "opened the port" on the router
like, u went into ur router settings and did what's called port forwarding
telling ur router "incoming traffic on port x, please send that to computer y"
so it forwards it
ur computer now receives the traffic
and that's happening through an API provided by ur OS
called the socket API
the socket API implements the tcp and udp communication protocol
thats ur entry point into communication with other machines
is there a good yt vid i can watch on this topic?
The best analogy I've heard is the post with letters sent to people.
When you start a server, you tell a process to wait at the door (a port out of 0-65535).
That process will then wait for anyone to send a letter (a request).
When one happen, it will read it, then send a response.
the OS deals with the details of it. for example ports, firewall, and so on
so in ur program u just make use of that os api and say u want to listen to tcp or udp traffic on port x
and then u get that traffic eventually from ur OS
i understand that part yes but i wanna know what physically happens. does ur pc just send a signal to the router or what
no, in ur router settings u configure all of that
via port forwarding
ur computer then receives the traffic and the OS will either know a program to forward it to or simply ignore the traffic if no program is interested in the traffic on that port
(and the firewall is also put before that)
where can i learn all this bro
I am unclear about what you are asking for?
All networking is signals.
But we are at a higher level that that when doing a server.
i dont know if there is a single resource teaching that stuff. especially bc the content ur asking about is extremely big
u could spend decades on this topic alone
ah
I welcome you to read it all, and it history to understand why it is like that.
depending on how deep u want to go on what exactly
im 17
what should i learn
i just wanna make another website
but idk
what to make
do you know how to do a static website?
html?
its the same
yuh
you could just ask individual questions
i alr made a firebase one
ah
im trying to be familiar with github
I reckon I can just learn it as I use it more
as long as its "just frontend" without any backend, github pages will serve u very well
your next step would be to have the same website, but with nginx and a reverse proxy like cloudflare
what is cloudflare and nginx?
ive seen cloduflare but never really went deep into it
nginx is a webserver that is very good at serving static website
the current website in my about me is made by me, I used my discord bot to show my discord status, but render went down after a few mins of inactivity so I used lanyard
thing is you need to install it on a computer at home or in the cloud on a remote server
cloudflare is often used as protection layer. anyone visiting ur website has to first go through cloudflare. they check the traffic and block it if its malicious, shielding ur server. especially from DDoS attacks
it runs on so many websites worldwide that it analyzes the entire traffic and can spot large scale attacks that way
also is the cs job market really that bad or do people just like to say stuff
depends a lot where ur at
I am in canada
it also add captcha
in germany for example every cs student gets a job no problem
but as said, depends a lot on location
dev salaries tend to always be in the "upper class" region
but might vary within that region
I see cs graduates from waterloo instantly go to faang companies
but its pretty given that it will be enough to have a good life
in fact a family friend of mine instantly got to work at tesla right after graduation
that will depend a lot on where ur at and what ur doing
i personally never had a job that was bad or not fun
is it worth it to learn artifical intelligence
i had one that i didnt like and just quit it
its a big topic right now. u dont need it but its one of those topics that many people are looking for atm
you are probably talking about generative ai or machine learning
yeah
are u planning to study computer science? if so, ull learn everything u need anyways
yes I already got into a few unis, still waiting for better offers though
i see. yeah, just follow their road and ull be well equipped knowledge wise with everything u need
I released an app on ios with over 140 downloads, is that good for my uni application?
I think it only gets impressive when I hit a few thousand downloads
then, whether u want to aim for the stars or just get a normal job is up to u. either case, ull be having a good salary overall and the possibility to look for a job thats also fun
6 figures?
there will always be people getting more than u. but whats ur goal. chances are ull be getting more than 70% of every other citizen even with the lowest dev salary
uhhh
i want atleast 500k salary
family friend from nvidia makes over 900k plus stock options
lucky guy
so u want to become rich
fuck yeah
i always just wanted to get enough to afford family, house and everything i need, while having a enjoyable life and fun at my job

well
I want enough money to unlock financial freedom
so I dont need to keep investing time into somthing I dont like
u get that without being rich already
how come
I dont wanan work a job bro
anyone earning more than people at the bakery etc already get enough to afford life without thinking much about money
but to keep that life you have to keep working
but if ur job is fun and enjoyable, where is the problem
I dont see how a job can be enjoyable
Im very bad at following schedules and I find them stressfull
theres plenty of jobs without schedules and stress
hang out with friends, have fun, work on sth u enjoy
Is this thread still about networking or fantasies of living on a yacht? 
latter atm
but if I get rich and then get AP watches and fancy cars that is better
ur still quite young and i dont want to shatter dreams. but ull be reaching a turning point with these thoughts eventually
frick
its just very hard and generally unlikely to become rich
Zenny, don't get brainwashed by social media - it doesn't show you what reality actually is
Your goal should be to make an enterprise.
But even then good luck not having to think about your work.
my advice is to not think too much about that stuff when ur still so many years away from it anyways. have fun, enjoy ur time, walk on the path that leads u to a great life.
graduate. get ur first job, get ur second job, realize how things work, realize what is important to u in ur life, adjust goals, by 30 or 40 years ull found a sweetspot
a great life is a life where I dont have to work
its a bit difficult to talk about actual figures as the worth of money is very very different based on location
especially bc other countries have wildly different constellation
actually no, with no work what would you even do?
idk make a startup probably
for example whether insurance is already included in the salary or not is one of those big differences that make it hard to compare numbers
that is still work
work that I find enjoyable
the problem with startups is that u dont see how many of them fail
I know most of them fail, I want to do it anyways
startups are high risk high work high reward
I just wanna fuck around for a bit making one
up to u ๐
do any of you guys know the game minecraft
its just sad how many people with similar ideas ive seen in my years at this server who then showed up a few years later and failed
do you make 6 figures
many do
I want to make a macro for hypixel skyblock using forge
but the path finding can prove to be difficult
what kinda math shall I learn for this to work
canadian or us salary cant be compared to german salary bc we have all insurance included already
so we get like half of what u get, pure salary wise
how good is da insurence
everything is covered
did you already graduate uni
in germany health and education is essentially free for everyone
here its essentially free
anyways
i get a typical senior salary
95k, which is about the money that a senior surgeon gets
so end of the normal high class range
mmmm
i can afford life without having to look at my bank account
that is alot in germany
its a normal dev salary for a senior
what does your company do?
juniors 60k, intermediates 70k, seniors 80-100k
ive had a few jobs. my current employer is a large european electronics retailer
its a classic java spring based backend job
did you graduate uni?
these exist like sand at the beach
yes
is it hard
most people do (but its nit necessary)
whats the jump like from hs to uni
id argue that its harder to learn it all urself
yes it is
the speed. they dont stop for anyone to catchup. each lesson has new content in it
not in my experience
is it math heavy
in school the teachers care for the individuals and will repeat sth if someone hasnt caught up yet
at university no one cares for the individual. ur sitting there with 100 other people and the prof is just forging ahead
I guess so
the sort of math u learn at university has nothing to do with the math at school. its more about logic and structure
less about calculating anything
usually no physics
physics is cool
nope
unless u pick sth like embedded systems engineering or microsystems or sth
you can have quite advanced math
I tolerate math
i dont like it
just tolerate it
its just completely different math. which is also why the dropout rate of math students is so super high
I don't like math ๐
what kind of math?
u learn how to prove sth, how to make theorems, how the people back then created their lemmas
instead of applying them
whats sth
sth = something
its hard to describe. in school the teacher gives u a formula and u apply it
in university u learn everything needed to find such formulas on ur own
and prove their correctness
in my hs, my teacher just wants us to learn algorithms up to merge sort
i dont like them
pathfinding isnt really hard actually
for real?
this guy coded his pathfidning from scratch
not using baritone at all I think
basic pathfinding is just a breath first search
more complex you have weights
and sure having a performant pathfinding over long distance is hard, but the basics are easy once you know how it workd
basics being :
i havent learnt alot of those
Graph traversal can be accomplished easily using BFS or DFS. The algorithms only differ in the order in which nodes are visited: https://i.imgur.com/n9WrkQG.png
The code to accomplish them is identical and only differs in the behavior of the Queue they are based on. BFS uses a FIFO-queue and DFS a LIFO-queue.
Queue<Node> nodesToProcess = ... // depending on BFS or DFS
nodesToProcess.add(rootNode); // add all starting nodes
Set<Node> visitedNodes = new HashSet<>();
while (!nodesToProcess.isEmpty()) {
// Settle node
Node currentNode = nodesToProcess.poll();
if (!visitedNodes.add(currentNode)) {
continue; // Already visited before
}
// Do something with the node
System.out.println(currentNode); // Replace by whatever you need
// Relax all outgoing edges
for (Node neighbor : currentNode.getNeighbors()) {
nodesToProcess.add(neighbor);
}
}
To get BFS, use a FIFO-queue:
Queue<Node> nodesToProcess = new ArrayDeque<>();
And for DFS a LIFO-queue:
Queue<Node> nodesToProcess = Collections.asLifoQueue(new ArrayDeque<>());
Thats all, very simple to setup and use.
For directed graphs relax all outgoing edges.
For trees the visitedNodes logic can be dropped, since each node can only have maximally one parent, simplifying the algorithm to just:
Queue<Node> nodesToProcess = ... // depending on BFS or DFS
nodesToProcess.add(rootNode); // add all starting nodes
while (!nodesToProcess.isEmpty()) {
// Settle node
Node currentNode = nodesToProcess.poll();
// Do something with the node
System.out.println(currentNode); // Replace by whatever you need
// Relax all outgoing edges
for (Node child : currentNode.getChildren()) {
nodesToProcess.add(child);
}
}
Where can I learn these