« first day (2896 days earlier)      last day (2057 days later) » 

12:00 PM
I honestly prefer async/await then
 
oh, you prefer a needlessly-boilerplate API?
why don't you use callbacks then?
 
@FlorianMargaine I don't think it's needless.
 
callbacks are explicit!
 
callbacks have other drawbacks
You cannot return from them, you cannot safely throw in them, etc.
I think it's perfectly reasonable to give the author control over what to pause the function over and when
 
the author is not choosing over what to pause the function and when
 
12:01 PM
We can definitely argue about async/await semantics (auto-unwrapping for example)
 
he doesn't have a choice
 
But I disagree that having it is a bad idea.
@FlorianMargaine Sure he does.
 
if he uses IO, he has to yield
and he must not forget
 
const req1 = fetch();
const req2 = fetch();

return await Promise.all([req1, req2]);
This is a grossly simplified example of some of the flows we need to implement
@FlorianMargaine That's something I can get behind
But it's fairly easily solvable with tooling
i.e. find awaitables that have not been awaited, and warn/fail about it.
 
ok I'm unplonking @MadaraUchiha
 
12:05 PM
I am honored
 
otherwise I'd have to conclude Florian is talking to himself
 
mhhh
 
@MadaraUchiha You did your time, congrats :P
so I'm freaking out about GraphQL
it looks great
is everyone using it already?
 
should a preventDefault() on mousedown and mouseup prevent an anchor from executing a redirect, yes or no?
 
Sorry, I have to go, but you're touching on a completely different topic, which is "how do you manage concurrency in a synchronous API"
 
12:07 PM
like it would on click
 
@jAndy In my mind, it would prevent the default click event from firing, which would implicitly prevent the redirect.
Although I doubt that's how it works.
 
@MadaraUchiha nope.. to my shock, if you preventDefault mousedown and mouseup the click event still fires
makes me some trouble atm
 
hi friends,
how is websocket different than ajax?
 
you have to explicitly preventDefault the click event... wow, I could swear that wasn't always the case
@ArunRaaj its for the cool boys in town for once
 
Hmm
@jAndy Would capturing mode change that?
 
12:09 PM
lets see
doesn't look like
 
@ArunRaaj for starters, they use a different protocol
 
how is it different in context of functioning and efficiency?
 
and websockets will establish a persistent connection you can send and receive over, as opposed to the request-response model of http requests
 
@ArunRaaj in a nutshell, ajax is just regular http requests like any call to a website/server. WebSockets are a true bi-directional connect over its own socket connection on its own individual port
 
@ArunRaaj that question requires a book-length answer
 
12:12 PM
๐Ÿ‘๐Ÿ‘
 
@GNi33 http can also establish a persistent connection
 
yeah?
 
yeah
 
it's just HTTP operates with another layer of request/response on top
HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a single TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new connection for every single request/response pair. The newer HTTP/2 protocol uses the same idea and takes it further to allow multiple concurrent requests/responses to be multiplexed over a single connection. == Operation == === HTTP 1.0 === Under HTTP 1.0, connections are not considered persistent unless a keepalive header is included, although there is no official specification ...
 
@FlorianMargaine again, I don't think it's bad for some demos that aren't there to showcase some really nice design
 
12:12 PM
oh, yeah, you're right
 
aren't server-push events realized over http aswell?
 
also HTTP/2.0 (oops actually called HTTP/2 now)
 
@BartekBanachewicz that's not a persistent connection, that's just a "fairly long timeout" connection
I really have to go..
 
@FlorianMargaine no practical difference
 
a lot of practical difference
damn you all being wrong on the internet
 
12:13 PM
you should handle websocket reconnections anyway
so w/e
 
lol @FlorianMargaine
I know that
 
another analogy might be getting input from the user in a terminal, for simple applications
I'm totally ok with using a sync readline thing, rather than worrying about events and writing my code in a certain style
again, for a demo. In production, it's different
but even then, a lot of commonly used utilities written in python probably use the sync readline api
 
@jAndy yep
 
is that bad?
 
thanks guys
 
12:15 PM
@towc I once instantly failed a candidate for async: false
It's never a good idea.
 
@MadaraUchiha whistles
 
@BartekBanachewicz an example of how it's very different is that if the request wants to send something new, it has to send all the headers again to make a new request
 
did you tell him that?
 
 
@MadaraUchiha I'm not sure what you mean by that
 
12:16 PM
@BartekBanachewicz Afterwards, yes.
 
@FlorianMargaine yes but that's not a difference between persistent/fairly long timeout
 
now you're doing it on purpose
 
anyway yeah we agree so no point arguing that
sorry
 
thanks, I can leave knowing full well you're just trolling
 
@towc it means that a candidate came to us to preform a test to see whether we should accept them to an open position at the company or not, and the fact that he wrote async: false was enough indication for me to fail them instantly.
 
12:17 PM
lol
 
a "fairly long http request" is still not really bi-directional is it?
that alone makes it "very different"
 
@FlorianMargaine doesn't that mean it's similar to a sync api within a thread?
 
@jAndy it's still a req/res model
 
@MadaraUchiha "but it was just a demo"
 
@MadaraUchiha oh, an interview candidate. That's funny
 
12:17 PM
@rlemon When you're interviewing, you're supposed to impress me.
Had he wrote something along the lines of // I know this is bad, but this is a timed interview and I know I should have used XYZ instead I might have not disqualified them immediately.
 
like, jumping on the table and peeing?
 
@MadaraUchiha So, if a candidate does a triple backflip, they're in?
 
wouldn't that impress anyone
 
@Cerbrus Hell yeah.
 
Awesome
 
12:19 PM
protip: bring snacks. second interview is much more likely if they think you'll bring more Turkish Delight
 
For example, there's the famous story of the balanced parens question
 
@MadaraUchiha I don't remember this
 
/**
 * I know you're supposed to solve this with a stack,
 * But I thought the following would be more interesting
 */
function parensAreBalanced(input) {
  try {
    eval(input.replace(/\(/g, '{').replace(/\)/g, '}'));
    return true;
  } catch {
    return false;
  }
}
If the parens are not balanced, the eval'd replacement would throw a syntax error
 
oh neat, I didn't even know you could nest code blocks like that
 
59
A: How to check if the number of open braces is equal to the number of close braces?

Florian Margainevar expression1 = "count(machineId)+count(toolId)"; var expression2 = "count(machineId)+count(toolId))"; if (matches(expression1)) { alert("Matched"); // Triggered! } else { alert("Not matched"); } if (matches(expression2)) { alert("Matched"); } else { alert("Not matched"); // T...

 
12:22 PM
(The question says that you can assume valid input consisting of only ( and ))
 
@MadaraUchiha That will always return false.
always
 
@Cerbrus why?
 
Copy it into an IDE, you'll see.
 
If someone can take a look at my question, I'd really appreciate it. Not entirely sure why this is happening and I've tried to look for an answer on SO but maybe I'm using the wrong words. - stackoverflow.com/questions/52425107/…
 
@Cerbrus I don't see what you mean
I just tested it, it works
 
12:24 PM
Weird
 
huh
 
^ that
copy-paste fuck-up
 
Alright, I cheated and edited the typo away :D
 
Hax.
 
I was hoping you'd try to copy again and feel stupid
 
12:25 PM
oh, replce
 
parensAreBalanced('"("')
Broken :D
 
5 mins ago, by Madara Uchiha
(The question says that you can assume valid input consisting of only ( and ))
 
Oh, lame...
 
((( and and and )))
 
good one
 
12:28 PM
ba dum tss
 
@Neil This is the JS room, not Lisp.
 
@MadaraUchiha opens up random JSX code uhhh, sure?
 
Guys, can you have a look at
To me it looks like the rain of downvotes is mainly due to people not knowing let or the console
 
nah, most people downvote because of mob mentality
they downvote because it's already downvoted, or vice versa
 
it's not a great dupe target
 
12:32 PM
@Neil what's vice versa here?
 
but at least one answer touches on it
 
@towc upvote because it's already upvoted
 
1:00 PM
Hello, is it ok if I ask a node.js question here? Is something simple but It's taking so much time to solve it
 
@FelipeOliveira Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@FelipeOliveira It can't be that simple then :)
 
I feel like it's something simple to more experienced developers
I could be wrong though
 
well it's hard to know
that's kind of what makes us experts
we know what's easy and what's hard
 
@MadaraUchiha wanna join Android quick?
 
1:09 PM
so if you find it difficult, it could be very much just as difficult for an experienced programmer
 
nvm, another mod seems to have joined
 
It was super effective!
 
@Neil i'm trying to do the infamous "let clientVar = <% serverSideVar %>"
my server side console.log Works just fine, but when I try to console.log the cliente side new var
it gives me undefined
 
@FelipeOliveira ok well silly questions first
you're writing to the console.log in the same scope?
and you're writing to console.log after you assigned it?
 
take a look at the rendered code?
 
1:21 PM
@Neil Yes, those console.logs are the last thing I do in this block of code
 
@FelipeOliveira <%=
 
might be that JSON.stringify acts up or it doesn't get written correctly
ah yeah, you're not actually writing it
 
^
<% evals things, but returns nothing
 
@FelipeOliveira You might want to make sure it is in a string what gets written into the page
 
you need <%=
 
1:22 PM
so surround with ''
 
no, the only problem is missing =
 
well that problem will come afterwards
i'm fairly sure
 
stringify returns a string
 
JSON.stringify should take care of that
 
doesn't need wrapping
 
1:23 PM
it should show up surrounded by "" then?
 
it does, but his ejs is wrong
<% doesn't return, it evaluates in place
 
yeah, although we don't know what studio.studio.rooms is anyways
 
well, that's definitely a problem
not sure if it's the only one
 
Ohh I see, so I'm not assigning the value to it... Silly mistake, thanks everyone! I'm going to try it
 
run it with <%= .. %> and then see what happens
 
1:29 PM
it seems to be working :) thanks everyone
 
Figure that I spent half a day checking and rechecking a process which should have been changing only to find out that it was using a file different from the one I was updating as input
no wonder it wasn't changing
 
in those situations, I like to have a friend (when available) looking into it for a minute. It seems that if I get stuck into a problem for too long, I can't seem to be able to "think outside of the box"
 
helps to have someone who knows ejs ๐Ÿ˜‰
 
i'm learning it right now in order to write my final Project for college, i'm using node.js(express) and mongoDb(mongoose)
 
hehe, good luck with mongo
 
1:34 PM
I wanted to use angular too, but it was taking too much time and causing too much problems, so I'm leaving that learning for later.
so far it's all good, I'm having fun messing with noSql for the first time
 
 
1 hour later…
2:57 PM
@rlemon What'd I miss?
smh
I'm seriously considering writing a user-script or an extension to record flags so that we don't lose history of who flags.... This is getting a bit ridiculous
 
troll in Android
mass stars and mass flagging
no mods were around, but one showed up eventually
 
3:12 PM
How can a chrome extension hook into an existing websocket?
How does Cap do it?
 
new socket
 
@MadaraUchiha if you get it in the websocket already, I have that code done
just doesn't work for us plebs anymore
 
@rlemon gimmie
Let's test
 
3:30 PM
morning
 
Morning!
If i wanted to write a script to visit a page every day, click a button to go to another url and then click a button to download an item. How would I do this? Selenium?
 
Selenium can take care of the webdriver part
But it won't do the "run this every day" part
That one will depend on your environment
e.g. I'd use a cronjob for it, but you might not have that
 
i'm running linux so i can schedule cron
I wrote a script to tell me email me the public ip of my home network everday
cron is scheduling
 
oh ok cool
so there you go, cron + selenium and you're done
 
nice.
 
3:41 PM
you're sure you can't just curl it though?
 
thing is I dont know the url before hand
 
user10220492
Hi, what does this phrase means "The module.require method provides a way to load a module as if require() was called from the original module." in this documentation? I lost all my day to understand this phrase but i am failed. Please can someone explain in easy words?
 
@DhuBytes Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
the file that im interested in get's uploaded daily to a file sharing/hosting website
 
user10220492
3:43 PM
 
I'd check if the URLs are predictable
 
user10220492
@forresthopkinsa Sure Please. Thanks
 
@Dhu its similar to the regular const mod = require('mod_name')
because each file is treated like a module
 
user10220492
@CapricaSix I asked the same question on the site but no one replied to me. Please can you tell me what is the difference between require() and module.require(), i spend all my day on this but i am failed, now i am stressed because i really want to clear my concept
 
and modules can be required
 
3:45 PM
!!echo cap is a bot
 
cap is a bot
:10220492 You need to try harder
 
!!undo
 
@forresthopkinsa I'm afraid I can't let you do that, forresthopkinsa
 
foiled again
 
user10220492
@ex080 So what does this phrase points to?
 
3:47 PM
in what documentation?
 
4 mins ago, by Dhu Bytes
This is the link of this phrase: https://nodejs.org/api/modules.html#modules_module_require_id
 
user10220492
@forresthopkinsa yea i know but i want to translate it to simple words, what does the original module means here?
 
yeah, so, if you have a module that exports module, you can then call .require on module and it will run as if it was within the original module.
What exactly is the context in asking this question?
What are you trying to solve by using this method?
 
user10220492
@KevinB I am trying to clear my concept because i am learning the whole node
 
3:49 PM
the description of what the method is/does makes sense to me, i'm not sure what you're missing.
:(
I can't think of a usecase for this method right off hand
 
user10220492
@KevinB Sir require() and module.require() are different or no they are the same, the only difference is calling require() by the module object as module.require()? ha?
 
user10220492
@KevinB are they different or same?
 
read the link I told you explains it
 
sir. no.
 
They both require a module. The context in which they do so are different.
 
user10220492
3:52 PM
@KevinB but the job of both of them is different?
 
user10220492
@rlemon yes sir i am doing but let me clear few things
 
user10220492
@KevinB require() is a global function and module.require() is the method of the module object, is that correct?
 
They perform the same action. they are literally the same method, simply being called from with a different context
@DhuBytes Please, stop pinging/replying
we get it, you're talking to us
 
> This is where the real magic happens. First, a special standalone require function is created for that module. THIS is the require function that we are all familiar with. While the function itself is just a wrapper around Module.require, it also contains some lesser-known helper properties and methods for us to use:

require(): Loads an external module
require.resolve(): Resolves a module name to its absolute path
require.main: The main module
require.cache: All cached modules
require.extensions: Available compilation methods for each valid file type, based on its extension
 
For the sake of learning node.js, you can probably just ignore that this method exists.
 
user10220492
3:56 PM
Thanks to all of you who answered.
 
user10220492
@KevinB yes you are right. Thanks alot
 
user10220492
@rlemon Thank you so much sir. Your link helps more
 
only if you read it before asking the question over again ;)
 
user10220492
@rlemon :)
 
@rlemon you are a sir among sirs
2
 
user10220492
3:57 PM
@Loktar right
 
@rlemon what an absolute sir
 
He actually saved my family by sleeping with my wife to cure her depression. Sir level 100.
 
might have cured her, but now I'm depressed
thanks
 
LOL
 
I can cure you
 
user10220492
3:59 PM
@rlemon Lollz
 
rlemon is a knowledge GOD
 
user10220492
programmers are always stressed, so, we don't need wife
 
@ex080 ohh if only you knew
 
tell me then i'll know
 
He's not a god he's just canadian
 
4:00 PM
Thanks, I taught him.
 
forrestttt
 
@ex080 It's true, have you seen his garage?
 
pls no
seriously. my garage and my basement are embarassing right now.
 
No, I dont live in canada
 
4:01 PM
I really need to clean and organise
 
is that tai lopez?
 
@Loktar I miss those glasses
 
cc @KendallFrey ^^
 
holy crap that caught me off guard
 
rlemon is tai lopez?
 
4:02 PM
Wow, rlemon looks like Tai Lopez.
 
wtf?
 
confirmed
 
the more you learn the more you KNAWLEGE
 
it's all a farce, lopez is spanish for lemon
I'm so sorry I lied all this time
 
Haha
 
4:29 PM
none of those convos are mine
I think "null" is a real user in the database that people get pushed into when bad things happen
 
user1596138
Wtaf
 
user1596138
300
Q: Array state will be cached in iOS 12 Safari. Is it a bug or feature?

abelyaoI found a problem with Array's value state in the newly released iOS 12 Safari, for example, code like this: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <title>iOS 12 S...

 
and easyroommate is storing passowrds in plain text -_-
@LuckyKleinschmidt check starboard
 
user1596138
Nah
 
4:41 PM
@LuckyKleinschmidt In only 2 days, this guy won 2gold 3silver 7bronce
 
user1596138
@robe007 Noticed that too lol. I got like 400 rep in 1 day on another SE site this week
 
user1596138
He's got 300 upvotes on that tho. Thats nuts
 
user1596138
If not for rep caps he'd be ready to answer terrible duplicates with jQuery answers like most the 20K+ guys do
 
yeah xD
 
@towc o/
 
4:44 PM
@towc ๐Ÿ‘Œ๐Ÿ‘€๐Ÿ‘Œ๐Ÿ‘€๐Ÿ‘Œ๐Ÿ‘€๐Ÿ‘Œ๐Ÿ‘€๐Ÿ‘Œ๐Ÿ‘€ good shit goเฑฆิ sHit๐Ÿ‘Œ thats โœ” some good๐Ÿ‘Œ๐Ÿ‘Œshit right๐Ÿ‘Œ๐Ÿ‘Œthere๐Ÿ‘Œ๐Ÿ‘Œ๐Ÿ‘Œ rightโœ”there โœ”โœ”if i do ฦฝaาฏ so my self ๐Ÿ’ฏ i say so ๐Ÿ’ฏ thats what im talking about right there right there (chorus: สณแถฆแตสฐแต— แต—สฐแต‰สณแต‰) mMMMMแŽทะœ๐Ÿ’ฏ ๐Ÿ‘Œ๐Ÿ‘Œ ๐Ÿ‘ŒะO0ะžเฌ OOOOOะžเฌ เฌ Ooooแต’แต’แต’แต’แต’แต’แต’แต’แต’๐Ÿ‘Œ ๐Ÿ‘Œ๐Ÿ‘Œ ๐Ÿ‘Œ ๐Ÿ’ฏ ๐Ÿ‘Œ ๐Ÿ‘€ ๐Ÿ‘€ ๐Ÿ‘€ ๐Ÿ‘Œ๐Ÿ‘ŒGood shit
 
user1596138
flagged
 
That's completely fair
 
@ex080 what's up
 
@Vap0r wait but why
 
also +1 "here in my garagggggggg"
 
4:51 PM
I dunno I kinda just wanted to. It's a slow Thursday.
 
user1596138
Who the hell tells you about a funeral 20mins before the funeral
 
user1596138
!!afk
 
I don't think people are energetic and efficient when planning funerals
 
well when you really need to get rid of a body
 
Hello. I am new to working with json to fill out an html templating. Would you recommend using jquery or a library like vue, mustache, handlebars?
 
4:56 PM
@JacobLett Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@JacobLett those tools are not meant to solve the same issue (well maybe handlebars and moustache)
 
thanks for your help rlemon. What I am trying to do is allow marketers to fill out a hubspot datatable that I can then reference the json. That way when they add a new record I don't have to upload new code to the server
 
@LuckyKleinschmidt lmao remember when they died though?
 
@Loktar LuckyKleinschmidt is afk.
 
so you think I should try handlebars
 

« first day (2896 days earlier)      last day (2057 days later) »