Open Side Menu Go to the Top

07-01-2016 , 11:54 PM
Quote:
Originally Posted by Craggoo
I don't understand your analogy so let me ask something in non-tech babble.

I have 2 users logged in viewing the same resource.
User 1 updates the resource. Server says "this resource has changed"
Server tells User 2 resource has updated
[optional?] Server sends User 2 the updated resource


Real world example might be...
User 1 adds comment to a article.
Server sees the list of comments has updated
Server tells all users currently viewing (whether active or afk) that the resource has updated
[optional?] Server updates the view for all users currently viewing the article
The bolded would happen via websockets. Most web technology has traditionally been pull, meaning nothing happens unless the client (browser) requests it from the server. With websockets the server can push to the browser any time it wants, w/o the browser having to poll every second or so.

Polling is is the traditional method of achieving something like server->browser communication. But it eats resources and isn't as efficient as push.

Push makes sense for something like a real time game or chat application. A lot of people want to use it in places where it's really not needed. My boss was obsessed with websockets and kept pushing for us to find a place to use it even though our app really didn't need it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
07-01-2016 , 11:57 PM
Web sockets sound a lot like asynchronous data calls or something like in Ajax/ajaj

Edit

Aside from the server push mentioned above

Also, part of learning that sucks is trying to figure out a decent excuse to use the thing you're trying to learn. Maybe when you're learning you just need to shoehorn it in for the sake of getting the concepts and worry about using it appropriately at a later time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-01-2016 , 11:57 PM
Quote:
Originally Posted by RustyBrooks
I think it's funny when people talk about websockets. They're just sockets. The difference is, they're not typically limited the way web connections used to be.

In a typical web connection, the client says "Here's some data" and the server says "here's my response" and that's the end of it

With websockets the client says "heres some data" and the server says "here's a response" and then the client says "here's some more data" and the server says "here's another response"

The data sent by the client tends to be smaller, little messages. The responses sent by the server also tend to be smaller, json or xml data that gives status updates. Think "messages" instead of "pages"

But there's no magic, the internet was built on sockets long before the web got involved.
Right, but websockets keep an open channel of communication between the browser and server, that the server can push to any time w/o a request from the browser. Traditional sockets for web requests (straight http calls and ajax) have short-lived sockets that close when the original request/response is finished.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-01-2016 , 11:58 PM
Quote:
Originally Posted by Noodle Wazlib
Web sockets sound a lot like asynchronous data calls or something like in Ajax/ajaj
Not really. Asynchronous is still originated by the browser. Websocket pushes are originated by the server (via an open socket).

Btw I have asked a bunch of smart programmers I know how a socket works under the covers, and read a lot, and it's pretty damn hairy and confusing. Anyone want to explain the nuts and bolts of a socket? Not what it does, but how it does it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 01:18 AM
Quote:
Originally Posted by suzzer99
Not really. Asynchronous is still originated by the browser. Websocket pushes are originated by the server (via an open socket).

Btw I have asked a bunch of smart programmers I know how a socket works under the covers, and read a lot, and it's pretty damn hairy and confusing. Anyone want to explain the nuts and bolts of a socket? Not what it does, but how it does it.
Lemme give an attempt to explain how it works. I'm not sure which pattern I'm referring to (mediator or observer pattern or maybe something else altogether).

Simple example is : user --> resource <-- server

The resource has some method that accepts push/pull requests (per the vocab used in this thread). Those pull/push requests presumably trigger an update in the corresponding 'endpoint. In a pull request [ajax request], the server, receives some updated values. In a push request [socket connection], the user receives an updated resource based on something that some other client has done. Maybe you're logged into gmail on your iphone, desktop, and laptop. You sent an email on your iphone. All logged in clients receives an updated list of sent emails (iphone, desktop, and laptop) even though you only sent the email on your iphone.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 01:24 AM
Yeah - that sounds right.

It's similar to data-binding on the front end, where if anything changes the underlying data, anything watching that data is triggered to update its view.

But keep in mind the client can also get updated values from a pull request. The client initiates the request, then gets updated values from the response. This is how the browser gets updated information like 99.99% of the time in the current web. Push is still an esoteric niche thing.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 02:10 AM
Quote:
Originally Posted by suzzer99
Yeah - that sounds right.

It's similar to data-binding on the front end, where if anything changes the underlying data, anything watching that data is triggered to update its view.

But keep in mind the client can also get updated values from a pull request. The client initiates the request, then gets updated values from the response. This is how the browser gets updated information like 99.99% of the time in the current web. Push is still an esoteric niche thing.
I work with knockout on my employers website. It's a lot like what you talk about except for one small difference. There is one initial request to fetch all the data. It is saved in an initial view. That becomes the 'authority' on the current state of the data. On saving a resource, that model gets updated. There is no request back to the server to request the new state of the resource. We just update various values to reflect what the state the server would return if it was queried .
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 06:49 AM
Grunch, Websockets seem like a protocol "on top of" TCP. BSD sockets are pretty much the basis for providing an API for TCP on the systems programming level.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 07:39 AM
Quote:
Originally Posted by Craggoo
Lemme give an attempt to explain how it works. I'm not sure which pattern I'm referring to (mediator or observer pattern or maybe something else altogether).
going with observer here iirc, but that makes the connection between, say, the chat client and chat server we wrote two semesters ago a web socket? Or does it have to be via a browser?

Edit

oh, duh, or I could just click the link to rails' site and read about the features:

Quote:
Action Cable is a brand-new framework for handling WebSockets in Rails. It’s a completely integrated solution for managing connections, a channels layer for server-side processing, and a JavaScript layer for client-side interaction. It’s incredibly easy to use, and makes designing live features like chat, notifications, and presence so much easier.

Last edited by Loki; 07-02-2016 at 07:45 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 08:55 AM
Quote:
Originally Posted by emmpee
I live pluralsight, it's well worth the cost imo.

The Spring/Java ones were probably the best ones I did (Spring Core/MVC/Security), but I don't think I was unhappy with any of the courses I took.
Cool thanks. I'm getting a free license for a few weeks. My job uses c# and asp mvc so I figured I would do some of those. Also angular 2 would be worthwhile.

My boot camp did spring and I learned a lot about it so I may check those out too.

I liked spring and was able to build decent apps with it, but asp/.net is so much easier to get started.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 11:40 AM
Quote:
Originally Posted by toddw8
feel dumb not having clicked this earlier (due to how links show I thought it was basically a lmgtfy-style post XD), but yeah, basically exactly this. Or, this combined with the other link.

Fantastic finds, thanks to both of you just_grindin. Adding this stuff to the resources thread.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 03:00 PM
Quote:
Originally Posted by Victor
Cool thanks. I'm getting a free license for a few weeks. My job uses c# and asp mvc so I figured I would do some of those. Also angular 2 would be worthwhile.

My boot camp did spring and I learned a lot about it so I may check those out too.

I liked spring and was able to build decent apps with it, but asp/.net is so much easier to get started.
Have you tried spring boot?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-02-2016 , 04:26 PM
no, ill check it out if I ever decide to go back to Java.

I gotta admit though, between the ease of set up, the syntactic sugar in C# get/set methods, anonymous methods, and LINQ, I really like C#. but I think it was better to learn the hard way with all of the Java explicitness.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-03-2016 , 04:19 PM
I'm sure this will be surprising to people, but I've started applying to jobs in the SF Bay. I know the endless attempts and persistence must be sickening, but sadly, it's the way I am.

There is a major difference between how different cities respond to my resume and projects.

Entry level:
SF and Austin:
Form letter saying "sorry, you don't have the skills we are looking for."
LA:
"Hey, I have this SR level position you may be interested in. Are you familiar with CVS or Git at all?"

For mid / sr level jobs, the responses are quite different in each city.
LA:
"Oh, you know, there's company X up the street. They are looking for Erlang programmers."

Austin:
"Why the **** are you wasting your time on projects no one gives a **** about?"

SF:
"Those are some impressive projects, especially for a self-taught, keep up the good work. Unfortunately, we need someone who has real world experience."
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-03-2016 , 05:40 PM
Why are you trying to get an entry job in one of the most expensive places to work?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-03-2016 , 06:45 PM
Quote:
Originally Posted by suzzer99
Most days I don't even eat lunch, I just drink a protein shake then go back to work. Even an hour lunch every day would drive me bananas. Also I would weigh 400 lbs if I went with the coworkers to the typical stuff-your-face Mexican places they like to go.

Typical lunch for them:
  • 10:30-11 - time when most people arrive at work
  • 11:15-11:30 - one bored guy starts milling around, gathering forces as he goes
  • 11:45 - most of the lunch crew is hanging around the one person's desk who is actually on a meeting or trying to get something done
  • 11:55 - crew slowly shuffles towards the elevator, inevitably someone has to rush back to their desk while the crew waits
  • 12:00 - crew gets on elevator, gets down to bottom floor, goes outside, now has to decide who's going to drive
  • 12:10 - after sorting out who has a baby seat, who has boxes in their car, who drove the last 3 times, etc. - a decision is reached on drivers(s)
  • 12:11 - crew realizes they haven't picked a place to eat yet
  • 12:15 - the choice between the standards: 1 of 3 gutbomb Mexican places, and Indian place, a sushi place and Whole Foods buffet takes surprisingly long - new places might be discussed but rarely chosen
  • 12:20 - start driving around the endless merry-go-round of the 12-story parking garage
  • 12:25 - on the open road
  • 12:35ish - arrive at lunch place, eat
  • 1:15 - head back to work
  • 1:25 - get to parking garage
  • 1:35 - finish parking garage and elevator merry-go-round, shuffle back to desks

Yeah I would definitely be the weirdo in France.
Startup life:
  • 12:10 - start to line up in kitchen/cafeteria area
  • 12:15 - catered lunch is served, eat with coworkers
  • 12:50ish - back to desk to work

It hits two very good notes: we get to be social with coworkers, while also not taking a big chunk out of the day when I usually would prefer to stay focused and get back to work. (edit: and a third, variation in food every day instead of eating at the same 3 places)

Quote:
Originally Posted by suzzer99
Btw I have asked a bunch of smart programmers I know how a socket works under the covers, and read a lot, and it's pretty damn hairy and confusing. Anyone want to explain the nuts and bolts of a socket? Not what it does, but how it does it.
Like, at what layer? I think your network card sends packets over the interwebs to a destination network card and then there's 7,000 layers of abstraction between the physical hardware and your node application that I never ever want to know the details of.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-03-2016 , 07:05 PM
Quote:
Originally Posted by kerowo
Why are you trying to get an entry job in one of the most expensive places to work?
I don't understand the question.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-03-2016 , 08:19 PM
Quote:
Originally Posted by goofyballer
Startup life:
  • 12:10 - start to line up in kitchen/cafeteria area
  • 12:15 - catered lunch is served, eat with coworkers
  • 12:50ish - back to desk to work

It hits two very good notes: we get to be social with coworkers, while also not taking a big chunk out of the day when I usually would prefer to stay focused and get back to work. (edit: and a third, variation in food every day instead of eating at the same 3 places)
I've worked at places like that, my gf works at one now. It's pretty sweet but eventually you get tired of the food rotation.

Quote:
Like, at what layer? I think your network card sends packets over the interwebs to a destination network card and then there's 7,000 layers of abstraction between the physical hardware and your node application that I never ever want to know the details of.
I'd settle for knowing exactly what an "open socket" means at a nuts and bolts level, and why it's so much more resource intensive than *not* keeping the socket open.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-03-2016 , 09:30 PM
http://discuss.joelonsoftware.com/de...gn.4.652240.24

best i can find on short notice, not much more informative than "it uses lots of resources", but it sounds like distributed apps can handle it tho
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-03-2016 , 09:44 PM
Okay this is good, from your link. I was wondering why an unused open socket would take up so much server system resources. According to this commenter anyway it doesn't, which makes a lot more sense to me.

Quote:
An open socket with no traffic on it is pretty close to zero CPU overhead for an application. It's also pretty close to zero for the kernel.

Why?

Because these things are event driven. Activity on network interface causes activity on a device driver which causes the kernel to service the request and flag the socket as readable or writeable -- and if you're using something like epoll, you just get access to the same flags.

{If you're using select, you've got setup/teardown cost on the fd_sets -- but anyway fd_sets usually aren't big enough to do large socket arrays with. Select doesn't scale well. Use epoll.}

You'll need some RAM for the connection -- but not a huge amount for a socket with no activity. Nothing that you really care about.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-04-2016 , 12:22 AM
Quote:
Originally Posted by suzzer99
Okay this is good, from your link. I was wondering why an unused open socket would take up so much server system resources. According to this commenter anyway it doesn't, which makes a lot more sense to me.
open sockets select vs. epoll


Without getting into weeds too much, the above article alludes to the overhead that can exist with many open connections. The select() method utilized for a server in handling connections doesn't scale well and Linux version 2.6 IIRC introduced the epoll system call which does scale well for servers with a large number of open connections. Robert Love explains this well in his excellent book, Linux Systems Programming.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-04-2016 , 02:38 AM
Quote:
Originally Posted by kerowo
Why are you trying to get an entry job in one of the most expensive places to work?
Salaries are also absurdly high.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-04-2016 , 03:09 AM
Quote:
Originally Posted by Baltimore Jones
Salaries are also absurdly high.
After cost of living I don't think it's anywhere near absurd.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-04-2016 , 03:32 AM
People are raising kids on $13/hr up there. Why would it be beneath me to stay in a flop house in the Tenderloin whilst earning meager entry level wages?

The Bay may be a better and easier place to find and maintain work. I don't know. Just seeing how that may go.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
07-04-2016 , 09:33 AM
Quote:
Originally Posted by blackize5
After cost of living I don't think it's anywhere near absurd.
studies indicate you would be wrong. even accounting for cost of living, SF is still like top 3 places in the country to live re: salary

Quote:
Why would it be beneath me to stay in a flop house in the Tenderloin
because you enjoy not being murdered?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m