« first day (1907 days earlier)      last day (3048 days later) » 

10:00 PM
^ true
 
MN is the only state in the midwest with actual cities
 
user1596138
Benson lol
 
not counting Chicago, since it's not part of the midwest
 
Benson MN? I have cousins that live there
 
@ssube lol... or Detroit?
or Flint
 
10:00 PM
or Detroit, since they're both real things
 
user1596138
Hey we have 2 cities in Nebraska
 
they are known cities
or Ann Arbor..
 
user1596138
What about Indianapolis
 
Chicago and Detroit are their own separate places
 
user1596138
Fort Wayne
 
10:00 PM
@Jhawins not big enough
 
@ssube I will agree on that
 
ms seems to be coming out with some nice ideas msdn.microsoft.com/en-us/data/gg577609
 
user1596138
@ssube Oh really? lol
 
@Jhawins yes
 
I used to forget Detroit was in MI when I moved out of Detroit :p
 
user1596138
10:01 PM
It's only like 3 million people
 
user1596138
That's not real? haha
 
whats things like in Rochester?
 
I used to live in a place just as shit as Detroit, but it had a nice small town vibe, so it didn't feel nearly as dangerous
 
you have to clear 3 million to be a real city
 
@ndugger there is no place as shitty as detroit
 
10:01 PM
500k in the limits, at least
 
user1596138
My god dude. What is your life?
 
unless you mean Flint.
 
user1596138
Omaha is big enough for me lol
 
@Loktar Try telling that to North East Ohio
 
user1596138
Indy would be stupid.
 
10:02 PM
let con = mysql.createPool(db_config);

function query(sql) {
	return con.getConnectionAsync().then(connection) => {
		return connection.queryAsync(sql)
		.spread((rows,fields) => return rows)
		.finally(() => connection.release());
	});
}
 
yeah Omaha is pretty damn nice
 
Has bluebird changed? I don't see getConnection in my pool list
 
Cost of living is fantastic
LOL.
 
user1596138
I love it here. Jus sayin. This is perfect sized. There are Bass Pro and Gander Mountains (you probably don't know since you live in billion person metros but those are usually hours away from smaller towns), cost of living is fuckin sweet, it's actually pretty here if you go the right places and it only takes 10min to get to the middle of no where.
 
10:03 PM
I won't live anywhere with a Bass Pro :P
that place is the antithesis of everything I believe in
 
user1596138
Where do you live, cause if it's big you have one.
 
we probably do :(
 
user1596138
They sell good boots...
 
user1596138
And warm clothing
 
user1596138
You want real warm clothes go to a hunting shop lol
 
10:04 PM
@SterlingArcher Wat
 
user1596138
 
Invisible character? Or is that not a dot?
 
user1596138
@SterlingArcher lives in a giant grey square
 
@MadaraUchiha I can't figure out why my bluebird method isn't working
 
user1596138
That's just nasty.
 
10:05 PM
I don't know let me check
 
well, they're all in the suburbs, not actually in the city with me
so I guess that's ok
 
Nope, it's a period
Unexpected '.'
what the crap
 
user1596138
At least we don't live in Iowa City with the tweakers and @Trasiva
 
Wait where is @ssube at I forget
in DC?
 
@SterlingArcher Is that your actual code?
 
10:06 PM
twin cities
 
.then(connection) => { looks weird
 
ahh ok
 
grew up near dc
 
user1596138
No Sterling works in DC I just wanted a pic of a place that looks terrible because you can't see grass for 10miles straight from space
 
@KevinB That ^ @SterlingArcher
 
10:06 PM
Twin cities are pretty nice
 
they're stupid rich but still have a few million people
 
You guys have Mall of America
 
that place sucks
 
The claim to fame lol
 
user1596138
Twin cities?
 
10:07 PM
idk what else is there
 
@Loktar This is a very accurate depiction of what most of Youngstown, OH looks like: c1.staticflickr.com/3/2923/14436473111_0c8fb6c1f6_b.jpg -- I had to live and work here for a year of my life... I put on a lot of weight that I'm still in the process of losing. It was miserable.
 
it's all tourists and poor people bumming around
 
@ndugger haha I had a GF that lived there actually
 
Oh I'm a moron
 
user1596138
Oh so @ssube and @ndugger are in the same metro?
 
10:07 PM
function query(sql) {
	return con.getConnectionAsync().then(connection => {
		connection.queryAsync(sql)
			.spread((rows,fields) => rows)
			.finally(() => connection.release());
	});
}
 
she used to claim the same thing.. but it wasn't as bad as Detroit still :p
 
we have a few decent clubs, a few good liberal arts colleges with attractive students, and plenty of good drugs
 
@Loktar It's a shithole
 
Thar she blows
 
and I'm good
 
10:07 PM
I mean I won't disagree with that
 
user1596138
@ndugger I lived by Gary Indiana somewhat... That place is a shithole lol
 
but I think people underestimate Detroit
 
@KevinB nice eyes
 
@Jhawins yeah
 
@Jhawins There's a town in Indiana called Dugger -- it's too small to care about, though
 
10:08 PM
@Loktar it has more bombs than you would ever expect!
 
@SterlingArcher Don't use .finally() to release resourecs
 
What should I use?
 
user1596138
@ndugger bout the same population as my home town I spent 20 years in
 
wow, no wonder you're a hick
I mean that with love
 
10:09 PM
@SterlingArcher Promise.using
 
user1596138
 
user1596138
My life lol
 
i hate the 3 values shorthand for padding
 
@SterlingArcher Also, consider adopting the convention of "if you have something to resolve with, resolve with it"
 
user1596138
10:09 PM
That's roughly 30 miles between each town label FYI
 
I like 2 and 4 version
 
You're creating a promise (a query) but never return it, so you can't chain to that.
 
Isn't the return inferred?
 
@Jhawins I live near where it says falcon heights on this map: google.com/maps/@44.9412198,-93.1954668,37374m/data=!3m1!1e3
 
user1596138
@ssube "Little Canada"
 
10:10 PM
right between two big ol cities
the whole damn state is common-law Canada
 
user1596138
What big city is #2?
 
Little Canada is a shit hole that's just a small apendage of Roseville
 
minneapolis and saint paul are technically different cities
 
user1596138
The map isn't emphasizing a second large city
 
mpls is all commercial and rich, stp is industrial and somewhat less rich
 
10:11 PM
Minneapolis and St Paul are right next to eachother
 
im visiting rochester and indiana
and probally Iowa in a few weeks
 
it's all one city for most purposes, except taxes
 
Rochester MN is a good city
 
user1596138
@SuperUberDuper Rochester in Indiana?
 
user1596138
Or Rochester MN
 
10:12 PM
NY
 
user1596138
lol oh
 
the best Rochester is the one in MN
because screw everyone else ever
 
@SterlingArcher No, why would it be?
You're passing a completely regular function to .then()
 
new Promise().then(new Promise()).then(new Promise())
 
the return is only inferred if you omit the {}
 
10:13 PM
@MadaraUchiha I thought with => that you didn't need a return statement
Oh
 
@SterlingArcher {}
 
So I need to return inside brackets
 
@ndugger Nope.
 
Makes sense
 
@MadaraUchiha I was just joking
 
10:14 PM
hmm flights are expensive expedia.co.uk/…
almost 1k$
 
@ndugger Promise.resolve().then(Promise.resolve).then(Promise.resolve); would work though :P
 
lol
 
I'm reading up on websockets, and I was wondering -- do I open and close the socket for each event or do I leave it open?
 
@SterlingArcher leave it open
that's the entire point of sockets
 
10:15 PM
@SterlingArcher You don't need the brackets in your case though.
You only have one statement.
@SterlingArcher It's kinda the point that you keep the socket open, and the server can talk to you whenever.
Otherwise it wouldn't be different from interval polling.
 
So if I'm sending post requests to a nodeJS router, does that mean I need a different socket for each route?
Or is there a way I can pass in the route dynamically
 
@SterlingArcher You're not sending POST requests over a websocket...
WebSockets are not part of HTTP
 
I didn't know that
 
crl
they are
 
@crl They aren't part of the HTTP protocol...
 
crl
10:17 PM
websockets are an 'upgrade' of http
 
@crl Wat, no they are not.
WebSockets are a completely different protocol than HTTP is.
 
crl
I know they rely on tcp, but http too
 
@crl TCP is not HTTP
 
Since sockets are meant to stay open, I guess a simple XHR will suffice for form handling then. And I'll use sockets for the main map system
 
crl
@ssube thanks..
 
10:18 PM
@ton.yeung HTTP is a specific text-based TCP protocol
 
@ton.yeung WebSocket != Socket
 
But my question stands: do I need a different socket for each route?
 
@SterlingArcher it's typically a socket per player
 
@SterlingArcher You need a socket for each client.
 
you don't need one, but that's one way you could do it. probably not the best
 
10:19 PM
Anything more than that is likely to be redundant.
 
Sockets allow you to push data from the server to the client, often in JSON
 
Let me give you a quick example of how I used socket.io last year
 
2 mins ago, by crl
websockets are an 'upgrade' of http
 
4 mins ago, by Sterling Archer
I'm reading up on websockets, and I was wondering -- do I open and close the socket for each event or do I leave it open?
 
@ton.yeung ???
@SterlingArcher Don't use socket.io before you properly understand web sockets
 
crl
10:20 PM
right, I reckon my error, the connection 'upgrade' from http to ws is a protocol switch, but they sort of pass by http on the pre-flight
 
This was a year ago, but thanks :P
io = io.connect();
io.on("reloadXY",function() {
	io.emit("getXY");
	io.emit("getHP");
	io.emit("getGold");
});
io.emit("getXY");
io.emit("getHP");
io.emit("getGold");
io.emit("stopDisconnection");
io.on("event", function(obj) {
	var list = document.getElementById("events");
	var item = document.createElement("li");
	var node = document.createTextNode(obj.msg);
	item.appendChild(node);
	list.insertBefore(item,list.childNodes[0]);
});
 
You don't know the pains socket.io abstracts away from you
 
See how it's emitting to different routes? GetXY, getHP, etc
 
auto-reconnecting
 
That's what each client websocket will need to achieve and I'm trying to learn that natively
 
10:21 PM
So please acquaint yourself with the native form of WebSockets (and the ws package) before using libraries.
 
That's. What. I'm. Trying. To. Do. D:
 
those aren't really routes, they're messages. You're sending the message "getXY" to the server, the server then emits another message.
 
@crl the pre-flight is an HTTP request, because if it fails and the server can't upgrade, you usually fall back to polling
 
8=>
 
crl
@ssube ok
 
10:22 PM
So basically the server will distinguish which route to send it to, depending on what is being emitted?
 
@SterlingArcher That's like saying
 
best case it's HTTP -> WS open -> (WS data)*, worst case it's HTTP -> (HTTP)*
 
{ "route": "getXY", "data": { .... } }
It's not really a "route" as much as it's a message.
 
Yes, you'll be able to tell which client sent it, and you'll see the message. You can use that to determine what needs to be pushed back to that client or all clients.
 
(In your case, there isn't even a "data": {})
 
10:23 PM
WS aren't HTTP, so they don't have a path
 
Why do i keep pressing F5 on this window
 
@KevinB I heard CTRL+SHIFT+W solves that problem.
 
that may be why it's common for HTTP APIs to include the path in the body, it lets you use the same handler code that sockets would
 
and then there's http2...
 
I think I understand
 
10:24 PM
@FlorianMargaine which combines conns but doesn't add push, does it?
 
So my DOM sends a socket message to the server saying "hey, refresh the players HP"
And my server does stuff, and sends back the data, and I suppose (guessing, then looking up) a callback will handle the server response data if there is any
 
@SterlingArcher the big difference is that the server can randomly send you data
 
Right, without a client side trigger
 
both sides see events, doesn't matter whether the server decides to give you data or you're polling or whatever
 
right, so if user B does something that affects user A's stats, you can push that update to user A
 
10:26 PM
yeah, it's the basis for broadcast
 
Can I be user L?
 
@SterlingArcher look up websocket chat examples, they're usually pretty concise and will explain the idea
 
@SterlingArcher Here's a good exercise: Build a chat web app in under 50 lines
 
I'll spoon you if you can do it in 42
3
 
I'll fork you if you get naked.
 
10:28 PM
Socket.io counts as 51 lines btw
 
So should I not use socket.io on the node side?
Cause I'm going to lol
 
@SterlingArcher You should not use it on neither.
The 50 line count applies to both client and server
(HTML/CSS not included because whatever)
 
Use whatever you want to get the project done. Websockets were not the 'thing' you wanted to achieve with this I suspect. Focus more on completing the project and setting up your first server :p
 
@rlemon "first" server?
@SterlingArcher this your first time working with Node?
 
I've written a lot of Node code, but I've never deployed anything... probably because I never finish projects, lol. Blackbeard is the furthest I've gotten on any of my personal projects
 
10:38 PM
@ssube You know you can do with in pure CSS, right?
 
@MadaraUchiha have using css sprites for a canvas game/animation would be lame
 
@rlemon Fair enough.
 
and wouldn't always work well if you needed them to be interactive at all with anything else on the canvas
 
@MadaraUchiha no, I'm rewriting my game using cleaner node code and removing angular
 
@rlemon Although I feel like there should be a library or something for animating sprites in a canvas.
Sounds like a really basic usecase.
 
10:40 PM
there probably is
but knowing how to do it is still valuable
 
@SterlingArcher Right, so, as an aside, chat in under 50 lines, no socket.io :P
 
lol maybe
I'm already swamped in to-dos for learning :P
 
I'm giving up on wanting to do everything by scratch on the front end... I'm just gonna get bootstratp, a filetree lib, a slide-panel lib, etc. I'm getting bored with the front end :(
 
The fact that it's under 50 lines should hint you that it's really simple :P
 
I'm not a clever man @MadaraUchiha
 
10:41 PM
It's much more exciting to work on the back end, at least for me it is
 
@ndugger I like the combination of both.
 
I also prefer the back end.
 
I leave the design to someone else though
I suck at that and never really liked trying
 
Eh, I guess I'm just bored with the DOM and design, yeah
I still love working with canvas, though
even CSS is just really boring for me; I'm not being challenged enough by the front end anymore.
there's so much knowledge that I don't have about the back end yet, and that's what makes it exciting to me
 
@ndugger To me, the front-end isn't about the DOM or the actual code.
That's usually peanuts, the real logic is server-side.
To me, the front-end is about the UX
 
10:45 PM
@SterlingArcher
 
oh did not see that coming
 
Well sure, but the UX does include the DOM. I'm just more interested in things that I don't know. I know the DOM very well, and JS in the browser in general so it's becoming boring.
I just need to be challenged
Nothing radical, I think
 
@ndugger Have you looked at functional programming?
 
@ndugger write a filesystem
 
@MadaraUchiha lol, I'v actually considered making a Blackbeard version that's functional
 
10:46 PM
in Lisp
 
@MadaraUchiha I've considered it
@ndugger have you looked at e.g. Elm?
 
Nope
 
and god dammit, all of these file tree scripts are made with jquery
 
@ndugger Well there you go, make one without and release it :P
 
10:49 PM
@MadaraUchiha you might be interested in the code here. nothing is working yet, but I'm laying down foundations for a lot of stuff
 
pls
 
The JavaScript community is sorely lacking in pure, vanilla components, it's shocking.
And for no good reason, really, because they're freaking easy to make.
 
search on DHTML, you'll find plenty of js only scripts
 
11:01 PM
window.location.search is not working for me in Safari. Not sure what I am missing. It is just returning an empty string while there are parameters in the query string.
This is what my URL looks like:
http://localhost:8080/#/B2B-details?accountId=111&boId=222
 
This is the weirdest example of destructuring that I've ever seen: tinyurl.com/z7d5qkc -- I didn't know you could even do this
 
pretty common
do it all the time
 
Well geeze, why didn't anyone tell me!?
you're all fired
 
11:28 PM
@FlorianMargaine : Elm is a nice functional language for js, but not complete. Had to use ports to add javascript stuff (like interaction with localStorage)
 
heck, it even doesn't have a way to find out the current time ...
 
LOL
from a blog post by sebastian mckenzie:
> I saw the best and the worst of the open source community and witnessed both kindness and entitlement. There’s the saying “one bad apple spoils the bunch” but in this case it’s more like “several bad apples spoils the bunch”. Open source users expect A LOT and are very vocal when things aren’t exactly how they would have them.
and the image...
who could that be
 
Yeah, @DenysSéguret pointed that out earlier today; we definitely all know who that is lol
 
@Mosho LOL
 
@FlorianMargaine mind pointing a noob in the right direction for this error?
ohh. i should pull...
 
@SterlingArcher
:D
 
whoa, a lot more dependencies now
@FlorianMargaine i'll try on a linux machine and go play with making my own hello world.
 

« first day (1907 days earlier)      last day (3048 days later) »