« first day (1852 days earlier)      last day (3099 days later) » 

crl
3:00 PM
I proposed this definition to urban and got rejected :(
dick:
derived from German, French, and English "ric" (ruler, leader, king) and "hard" (strong, brave), and therefore meaning "powerful leader"
 
How do you even debug 'Uncaught TypeError: Illegal invocation'
 
I'm guessing something in my ajax call isnt' quite right, but I can't see it
/me feels blind
 
do you get a line number?
 
crl
line1 but the script is minified jk
 
3:03 PM
hehe
 
@devdar use gitlab
 
yeah line 5 XD
 
we tested gitolite and it was a pain to set up
 
it also has the line number of my script, the $.ajax({ line
 
@ssube didn't have any issue with it
 
3:04 PM
@ssube i cannot use gitlab the repository must be locally
 
@devdar you can install gitlab locally
I should write my own git server
 
@devdar gitlab is based on gitolite
is/was, but turned into a github clone
@FlorianMargaine didn't the gitlab devs recently go that? you should look at what they ran into and came up with
 
i wonder how i can have a linux image tmeplate that i can resize when i clone. I guess they do some script at boot up that resizes partitions?
 
@ssube the git protocol is fairly easy. I just mean making a proxy between bare repositories to manage permissions and the likes... using dulwich or w/e
 
3:07 PM
@FlorianMargaine this is what they rewrote: gitlab.com/gitlab-org/gitlab-git-http-server
 
@ssube ok great i will def take a look at this
 
dunno if that's of any interest
 
@FlorianMargaine I assumed that was all done in post-receive hooks
 
@ssube yeah, that using the ssh protocol would be better
that's what I assumed
@Luggage this doesn't let you control enough
 
3:09 PM
ah
 
... I assume
post is too late
I'd have to look it up though
anywho, being a layer above is just much easier
 
So, are Maps just basically "more iterable" objects?
 
you can just proxy pass
 
it sounds like the preferred way, between github and gitlab, is to have a single user linked to a custom shell
 
it lets you inspect the push and abort it
 
3:11 PM
should I be seralizing my values? :
 
crl
@corvid better options for keys
 
that shell then checks the incoming key, pulls the user, and does the auth
 
@corvid es6 Map? it lets you use objects as keys, not just strings
 
@corvid no, not even vaguely.
 
    var myForm = document.querySelector('#datafixForm');
    var formData = new FormData(myForm);
Do I need to serialize formdata before trying to submit it?
 
crl
3:12 PM
no, I think, try
 
Oooh, okay... that seems a bit weird. I don't think I've ever experienced that use case
 
oh my fucking god xD
 
@corvid That's because without maps, it's not possible.
 
But, I've never found myself thinking that I needed anything like that. Maybe different types than strings as keys, but not objects
 
@crl was that at me?
 
crl
3:16 PM
map is like a set with keys having values?
 
@corvid For example, you may want to map a User object to a Date object, without having an actual field inside the User object.
 
Oooh, okay, that does make sense now. Is there a reason why it doesn't have standard map and reduce functions though?
 
crl
Map.map hehe
 
@ssube the server i have been given is a windows machine i know this is really lame. I am using cygwin and gitolite on the windows machine
 
@corvid Because they don't make sense for a map.
 
3:18 PM
map and reduce operate on arrays, not hashes. you can map or reduce the keys or values.
 
Anyone here use sails? I have to functions in my controller, one is GET and one is POST, when i log req.session in the GET method i get the following code, but when its in the POST method, its undefined, bearing in mind im using websockets
 
Have you never seen the dict data structure before?
 
Session { cookie:  { path: '/', _expires: null,  originalMaxAge: null,                                                       httpOnly: true } }
 
Oh... it's a hash? Then Map seems like a bit of a strange name
 
i might have misused the term hash
but it's a dictionary.
 
crl
3:20 PM
^ was going to say
 
hash is the JS (and maybe Lua?) term for a dict
 
it's like an object, not an array. that's all
 
Map is the every other language term
every C-based language has a Map interface for the dict structure
 
same reason you don't do myObject.map(), but instead Object.keys(myObject).map
 
including JS, now
for a Map, you use myMap.entries().map
 
3:20 PM
Python and Ruby use dictionary/dict for the same thing?
 
crl
but in real life dictionaries, keys are just strings..
 
fuck real life.
 
@crl so are values, because you can't put an object in a book
 
crl
ah true :)
 
serialized objects
 
3:25 PM
So, Maps are cool, but why would I use a Set rather than an Array? What are the benefits?
 
@Nick sets enforce unique values
 
Oh, that's nice
that wasn't sarcasm
 
Array/Vector/List are just a collection of ordered values. Set enforces unique values and is usually unordered. Map/Dict holds key-value pairs, with the keys being unique.
If you have a bunch of data and you want to loop over it repeatedly, you probably want an array.
If you have a bunch of data and you need random access by name, you want a map.
 
I still don't get what weakly referenced is supposed to mean. Does it mean the volatility of the variable?
 
it means that it can't leg press 540lbs, which is what I did this morning... 3 sets of 12.
I could only do half of that a month ago
 
3:30 PM
well, you can't use it in current browsers anyway
do you know how garbage collection works (broadly)?
how it cleans up memory that is no longer referenced (pointers to it)
 
user1596138
@nick Psh it was just my stereo anyway I was out late lol
 
user1596138
@SterlingArcher Hahahahahahaha
 
I'm trying to get a friend to join this room. He wants to talk about how node would be better with sync calls.
Be gentle.
 
Node has sync calls
 
^--
uhm ... i think :|
 
3:32 PM
They're for when you want a blocking functional call
 
he can use futures/promises? They read somewhat synchronously
 
right, you don't have to explain to me
I mean he thinks it would be better with ONLY sync calls
 
6
Q: Synchronous vs Asynchronous code with Node.js

ModikaWe are working with node, mainly for an internal project and to understand the best way to use the technology. Not coming from a specific asynchronous background the learning curve can be a challenge but we are getting used to the framework and learning the process. One thing that has polaris...

The logic alone of "only" breaks is very argument
Where's the harm in having both?
By having only async or only sync you limit the uses or your programming language
/framework etc etc
 
he throws around terms like callback hell. Let's see if he'll join
 
@SterlingArcher inconsistency
it's better to pick one or the other
consider a data access class that may load from memory or may make a network/filesystem request
 
3:35 PM
with Bluebird/ES6 Promise callbacks become very manageable and intuitive. I mean, I hardly ever help vamp for those
 
the memory access can be sync, the network can't, so you provide a consistent async API to cover both
without promises, it absolutely leads to callback hell
 
@Luggage people is free to join this room though.
 
yes, he's changing laptops, i think he's coming
 
@SterlingArcher providing only an async API doesn't limit anything
 
Ok I;m here. let the flaming begin
 
3:36 PM
With node 4.0, isn't Promise included by default? That means nested callbacks shouldn't be necessary
 
@BadgerCat I snap chatted you. Send me back pics of @copy plz
 
it's the same idea as returning an empty array instead of null when your search method has no results
 
@ssube I'm all for async
 
having a consistent API is super important, some operations have to be async (because they physically are), so you always use an async API
 
no flaming, i just need help in proselytizing you into async bliss.
 
3:37 PM
now, classic JS, that leads to callbacks nested 12 deep and is absolutely fucked
so we have promises to solve that
 
Are you saying there are no valid uses for sync calls?
 
Or you could just use threads from the start and everything is sync
 
@user9170 network calls still aren't sync
 
JavaScript is single-threaded, no?
 
There are valid uses for sync calls, but if you have the ability to make something async, why not make it async?
 
3:38 PM
@SterlingArcher there are no valid uses for a sync API. Even if the implementation is sync, you don't need to expose that.
 
this avoidance of threads is absurd
 
@user9170 at this point it's a legacy thing that can't be changed
 
Hi.
 
38 secs ago, by Sterling Archer
JavaScript is single-threaded, no?
Am I wrong or?
 
browsers have web-workers now and node has toyed with similar
 
3:38 PM
@Nooble hola
 
I don't see why, in node, that it has to be a legacy thing.
 
it's too late to not be?
 
@user9170 because node has always had it and it would break a lot of code
you have to write code carefully to be thread-safe and node code is written anything but
 
But if dont properly, nodecode is so beautiful
 
So my argument was that single-threaded evented was actually GOOD, not just a compromise. See nginx, redis, etc.
 
3:39 PM
Okay, I can't use generator functions, but is there anything providing similar functionality? That is, a way to generate an iterator-like structure. I need to traverse tree-like structures, would be nice to have a wrapper to make it easier.
 
I would figure that you could come up with an equivalent of the cluster module (that does threads) that would allow your request handler to be in its own thread
 
@Luggage single threaded is never good
@user9170 sure, but then the framework has to support that, and it snowballs from there
node just doesn't support threads
they originally half-assed it with async IO, then realized async IO is important even if you do have threads
 
Once you have your own thread for each request, the async issues go away, annd the software is greatly simplified
 
@SterlingArcher done
 
@user9170 Java servlets suggest that's not true
 
user1596138
3:41 PM
@SterlingArcher I'm gonna start sending you candid snapchats of @Loktar lol
 
all the thread-safety problems still crop up
 
!!popcorn
 
Node does threads, in the cluster module. I don't see why threads are ok there, but then in your usual programming paradigm they are evil.
 
@BadgerCat omg yes
 
user1596138
3:41 PM
Not really
 
@Jhawins please do :D
 
x) I just read the tag list. I might be late to the party, but I laughed.
 
@user9170 not to mention that, because of the number of async ops and not tying up threads while some secondary task goes over the wire, Java servlets actually went way out of their way to add async endpoints
@user9170 those aren't threads, it's multi-process
with shared memory and file handles, like apache
 
a process is a thread
 
I only use readFileSync to read a settings file when you start the server; otherwise, I only ever use async calls. I even feel dirty having that one sync readfile...
 
3:42 PM
That's the correct time, @Nick
 
I hate it when arguements get so deep into the backend that I have no idea what's being said
 
Yeah, I know, but it still feels wrong
 
yea, but it's not really wrong, there.
 
@nick But why should you feel dirty?
 
@user9170 do you have experience with multi-threading in languages lik Java or C# or C++ or similar languages ?
 
3:43 PM
i get it, though.
 
Yes, I do.
 
@user9170 that's not my username
 
Man, is this really the Javascript room? :)
 
urgh my feet are damp from smoething :/
 
3:43 PM
@user9170 Threads share memory, processes don't
 
@JacqueGoupil we're talking about JS for a change.
 
@copy that's not right at all
processes can absolutely allocate shared memory
 
@copy I like your shark
 
@user9170 then you know the dangers of it, that users at JS shouldn't be exposed to
 
crl
@KarelG yes that's what I'd like, but working on another solution atm
 
3:44 PM
ssube: master of knowledge
 
@ssube I know. I said they don't (usually), not they can't
 
!!s/arguements/his dick/
 
@KendallFrey I hate it when his dick get so deep into the backend that I have no idea what's being said (source)
5
 
@KendallFrey your jokes usually don't pay off; finally, a good one
 
3:45 PM
Nicely done, you even captured the typo
 
In the software sense, I always used thread/process as synonyms. Not to be confused with processor threads/cores.
 
@KarelG so what you're saying is that there is something special abut JS developers that just can't handle threading? And it's better to invent a tortured call-back hell instead?
 
@JacqueGoupil the one & only!
 
@user9170 first. the callback hell is your fault for not adopting promises
 
@user9170 it was, yes. They were stupid.
 
3:46 PM
the problem isn't the devs, but the browsers
 
we've gotten rid of callback hell now with promises
 
112
Q: Why doesn't JavaScript support multithreading?

NiyazIs it a deliberate design decision or a problem with our current day browsers which will be rectified in the coming versions?

 
they flatten things back out
 
Browsers don't support multiple threads
 
and promises helps you with the callback problems
 
3:46 PM
Promises only became available very recently.
 
@user9170 but yes, JS developers are a very wide group in terms of skill level. very wide.
 
It's not JS's fault that chrome wasn't designed to handle that
 
well, only a true standard recently
 
@SterlingArcher sure they do
 
@user9170 ~2 years ago
 
3:46 PM
wat
 
they've been around in jQ for at least 5
 
Web workers
 
What's a web worker?
!!google javascript web worker
 
I take some blame for leading @user9170 down the async.js and node-back path, but I did introduce promises later.
 
3:47 PM
Omg seriously?
 
lol
I'm not even a JS dev
nub
 
that's same as backgroundworker in Java
 
@Luggage after I already had a code base based on async.js...
 
jQuery has had Deferred since 2011, Bluebird's first release was 2013
 
right
 
3:48 PM
That's crazy, how does a web worker get around the single thread engine of the JS interpreter?
 
promises are so not a new thing
 
but i love refactoring :)
 
@SterlingArcher the engine isn't single-threaded at all
 
@SterlingArcher it uses another thread
 
Sorry I meant interpreter
 
3:48 PM
0
Q: if statement not returning true

BeckyI am supposed to be getting a number that is divisible by two and I am doing that. I am not sure why my code is not working. I'm doing this in a course to learn javascript. There error I get is this: Oops, try again. Looks like your function returns false when number = 2. Check whether your c...

 
none of the real code is single-threaded
 
Is it possible to define something akin to __iter__ for a javascript class? Eg, when you use let thing = new Thing(); for (let i in thing) { } it does some iteration function?
 
This is nothing new, and I've mentioned this on meta before. The folks in the javascript chat room are a bunch of kiddies who sit around and cause trouble. I've seen it first hand...anything with chat gives me the feeling of bad news. It's always smart alec folks who are NOT there to help but to point blame and joke all day long. Its nothing new..move along you deserved it. — JonH 33 mins ago
 
@SterlingArcher It runs multiple interpreters
 
3:48 PM
it just exposes a single thread to each page
 
> The folks in the javascript chat room are a bunch of kiddies who sit around and cause trouble.
 
@Nick ;)
@Nick wait wtf
you were banned yesterday?
 
But look at another nuance, you have these callbacks that need to be called to indicate being done with a resource. Like, in the pg module, You have to call done() to indicate you are done with the connection otherwise you leak handles, which means you have to do some clever callbacking, and if it's not done right, then you leak handles.
 
that thread question can be simplified: if the browser doesn't use more than one thread per page, then you cannot get multithreads
 
3:50 PM
@Loktar It was weird
 
@user9170 that's why promises have a finally clause
 
but it was only for 30 minutes
 
currently, they're still using 1 thread per page
 
same logic as try/catch/finally
 
tbf, i don't see a good reason to handle a page with more than one thread. These workers are exceptions on that topic though
 
3:51 PM
@Nick SWARM
 
@user9170 that done callback is just a callback and not really related to the async nature of things. it could have also been client.close().
 
@ssube so by using a web worker, it exposes another thread instead of using the one exposed for the page?
 
@SterlingArcher He thinks we never help people, and only point blame at folks
 
@Nick thats what happens when you go against popular narrative I suppose.
 
@SterlingArcher pretty much
 
3:52 PM
What the hell blame are we pointing? lol
 
or make jokes about it.
 
Could I interrupt your conversation with a small question? Oh wait, I'm asking if I can ask again... How would you make an infinitely scrolling div? As in, when you scroll the scrollbar adjusts so you can always scroll, a bit like in MS Excel or Visio?
 
I remember JonH. He wasn't pleasant.
 
^
 
JonH ....
 
3:52 PM
@JacqueGoupil check out infinite scroll on Google
 
Not being able to express a dissenting opinion seems like a problem. Expressing dissent is frequently a prerequisite to significant advancement of a rational discourse. Perhaps this is evidence of a flaw in the moderation system. — Waylon Flinn 21 mins ago
 
tons of resources.
 
@user9170 check out this answer for pg/promises: stackoverflow.com/a/24521906/129032
 
@JacqueGoupil interesting question. I'm not too sure, my initial guess would be to set the content height continuously in an overflow div
 
@ssube thanks, reading
 
3:53 PM
connection.queryAsync("select * from howdy")
.then(function(result) {
  console.log("rows", result.rows);
}).finally(function() {
  release();
});
 
@Loktar The problem is that I can only find sites with asynch loading - not the same kind of infinite scrolling.
 
is the good bit
 
@JacqueGoupil Detect when they've scrolled to near the end, and add more content when they have
 
async, then, finally
 
Rinse and repeat
 
3:53 PM
^
oops no longer maintained.
First result on Google
 
@Loktar it had me at: [Unmaintained] jQuery and Wordpress
4
 
You didn't understand my question...
 
@SterlingArcher see also "SharedWorker", it will blow your mind :S
 
@JacqueGoupil scroll forever right?
 
@RoyMiloh I haven't had a reason to use those, yet
 
3:54 PM
load content when you get near the end.. and continue
 
they're fun though
 
By load, we don't mean over XHR. Just add some content
 
This chat makes me feel stupid sometimes.
 
@SomeGuy's answer is what you would do.
 
@SterlingArcher confirmed my date for Friday; she just has to find a babysitter
 
3:55 PM
@ssube me too, but it's cool
 
@Nick ...
 
yeah the content can't already be there.. you would run out of memory
 
@JacqueGoupil i suppose that if the scrolling has hit the end, that you end up at the top again. Like that advert panel, which keeps scrolling to the left infinitely
 
Actually, I want to use scrollbars to scroll through a canvas. But IRL the canvas should stay the same size.
 
because its infinite
 
3:55 PM
@Luggage Hrmph, doesn't work. function* always throws a syntax error. Don't think Meteor has that implemented yet.
 
@JacqueGoupil that might not be possible with canvas
 
@ssube I'm fully aware that people will disapprove of me going out with someone that has 2 kids. Get over it
 
Oh, a canvas is a totally different story
 
unless you have an infinitely-scrolling thing behind it
 
@Nick I'm happy for you buddy :) If you feel nervous or need genuine non-troll advice, text me anything you need ok
 
3:55 PM
you can, you just have to implement it all on your own
 
@Nick I... am considering asking out a girl with a kid
 
@corvid you're using babel, right? do you have the polyfil for generators?
 
@ssube Oh... my bad, lol
 
I got with a girl last night who has 3 kids
4
 
because she has fantastic... tattoos
it's a little weird, but not that weird
 
3:56 PM
@Loktar is she single?
 
@Loktar plot twist: not your kids?
 
@RoyMiloh one of the ugliest feature, also dangerous
 
not anymore
 
@Loktar She was wild like a cat, right?
 
@SomeGuy hahah
 
3:56 PM
@Nick still going to make fun of you cause it's a little weird
 
@Loktar Does she share your last name?
 
Oh snap @Loktar is a home-maker!
 
:D
 
@ssube I know
 
@Nick depends on who you ask
 
3:57 PM
@Nick what is this, Alabama?
 
social security has never been updated lol
 
social security is a conspiracy, man
 
Yeah, I know canvas is a different thing. That's the issue, I keep finding code about asynch loading, nothing about scrollbar hacking... Oh well, I'll try something...
 
> anything you need
 
@Nick 30 minute ban
 
3:57 PM
What kind of stuff are you providing?
 
CYBER BULLYING CAN'T MELT STEEL BEAMS
 
@JacqueGoupil scrollbars are outside of the page, so it's hard.
 
LOL
 
Advice, replacement dick pics, and emergency $$ in case she's a hooker
 
You can always provide fake scrollbars.
 
3:58 PM
@JacqueGoupil Scrollbar hacking may be possible, but I don't imagine it paying off very well. Why do you want to do this?
 
Hello Mr. Negative, welcome to the world of "We don't always talk about JS because we're so active in the chat we run out of topics to discuss". Ever see the lounge? You have no idea how many people we help on a daily basis. Maybe come enjoy yourself instead of insinuating we don't help people. — Sterling Archer 7 mins ago
 
You can implement your own scrollbar within the canvas, which would be easier, but probably won't look as native
 
I'm tempted to ping JonH
 
Well u guys have helped me
I've not reached my final destination, but i feel at least closer..
 
Quick share that message with JonH
 
3:59 PM
@SterlingArcher Don't start some petty shit. Go look up the times he's come in trolling.
 
crl
pagination sucks, but infinite-scroll sucks a bit too (you don't know how far you are)
 
Flag his comment, link those posts.
Or don't, but don't go making a mess in public.
 
@SomeGuy I'm building a web-based Visio clone. I want to be able to scroll infinitely instead of having to specify a fixed size for the drawing.
 
Cyber bullying can't melt steel beams. — Nick 1 min ago
 
@djsmiley2k We'll never get you the whole way there; give a man a fish, and all that. We're definitely here to point you in the right direction, though
 
3:59 PM
@ssube I think it's too late for that
I won't ping or post more
 

« first day (1852 days earlier)      last day (3099 days later) »