« first day (2285 days earlier)      last day (2678 days later) » 

8:00 AM
I have 175 000 monopoly dollars
 
user6438653
 
So, @WATERYMEL0N: Why do you have that rediculous input format?
 
user6438653
Because that's how it copied.
 
user6438653
ACCEPTED	202	Accepted
BAD_GATEWAY	502	Bad Gateway
BAD_REQUEST	400	Bad Request
CONFLICT	409	Conflict
CONTINUE	100	Continue
CREATED	201	Created
EXPECTATION_FAILED	417	Expectation Failed
FAILED_DEPENDENCY	424	Failed Dependency
FORBIDDEN	403	Forbidden
GATEWAY_TIMEOUT	504	Gateway Timeout
GONE	410	Gone
HTTP_VERSION_NOT_SUPPORTED	505	HTTP Version Not Supported
INSUFFICIENT_SPACE_ON_RESOURCE	419	Insufficient Space on Resource
INSUFFICIENT_STORAGE	507	Insufficient Storage
INTERNAL_SERVER_ERROR	500	Server Error
 
How are you losing all the whitespace in there?
 
user6438653
8:07 AM
Ha @CapricaSix doesn't work.
 
user6438653
@Cerbrus Dunno.
 
Especially on REQUEST_URI_TOO_LONG414Request-URITooLong, for example, the lack of whitespace makes it impossible to parse that string.
Because you can't even rely on uppercase letters...
 
user6438653
true.
 
user6438653
The one i pasted ^^ has new lines.
 
In other words, fix the input. Don't try to parse it.
 
8:12 AM
{ email: email, username: username, password: password }

I'm sending data to a PHP script and I've got variables which have the same name as the keys, does that work?
 
@Pigman168 Why wouldn't it?
 
Thought it may read it as a variable or something
 
it won't.
!!>var a = 'foo'; var b = {a: 123}; console.log(b);
 
@Cerbrus "undefined" Logged: {"a":123}
 
user6438653
@Cerbrus It's too hard.
 
8:16 AM
@Sheepy thanks
 
@WATERYMEL0N That's what she said...
Sorry, couldn't resist.
 
user6438653
@Cerbrus ahahhahhahahahahhahahhahha!
 
Okay, it wasn't that funny...
 
anyone know what the best way to get a DOM document from a fetch 'Response' body is?
the options i've found are `Response -> Blob -> xmlhttprequest -> doc` and `Response -> string -> DOMParser -> doc`
 
user6438653
@Cerbrus thats what she said.
 
8:22 AM
Eh, no...
 
user6438653
Sorry, got a bit that's what she said carried away.
 
` "ha".repeat(funniness)+"!" `
 
I tried clearing the cache + removing active logins but I'm still logged in on SO?
 
reinstall your OS and replace your CPU
 
Ok be right back
 
8:28 AM
Hey guys
 
Didn't work, still logged in
 
clearing cache won't help with logins btw
you need to clear cookies for that @Pigman168
 
got some doubts related to nginx
I want to configure nginx with redis
 
Yea but there's a specific option to remove active logins in Firefox @Cauterite
 
to address to all requests being made to server
 
8:29 AM
And I cleared the cookies too
 
then check the header, make a request to redis look for value and then redirect
 
I don't want to log out, it's just interesting that it stays logged in
:D
 
@GandalftheWhite Doesn't sound like JavaScript
 
did you actually reload the page?
 
8:30 AM
It's like... SO doesn't want me to leave...
Yes
 
@Pigman168 What login provider did you use?
 
Well... we discuss all stuff here
so
we are discussing login issues as well
 
@Cerbrus What do you mean?
 
@Pigman168 How do you login to SO
 
8:31 AM
you can login via google, facebook, github etc.
so those are the cookies you need to clear
 
Oh I created an account here using a gmail
 
user6438653
Clearing cookies logs you out of most things including so.
 
@GandalftheWhite: Just saying, not sure if this is the room.
 
user6438653
@Pigman168 a gmail?
 
@Pigman168 Still logged in on gmail?
 
user6438653
8:31 AM
just gmail, not a gmail.
 
"a gmail" is valid.
 
Not logged in on gmail + the account isn't linked. I'm only using a google email to register on SO
 
I have 2.
Ah... Dunno what's happening then
 
Okay mate
 
Yea, quite strange
 
8:33 AM
: )
 
Probably a firefox tissue-issue
 
user6438653
@Cerbrus Nooooo!
 
user6438653
@Pigman168 Close firefox, then delete the firefox folder.
 
user6438653
Or click uninstall.
 
To log out you mean?
Or because your browser of preference isn't firefox?
 
user6438653
8:35 AM
Then install Google Chrome. © Google Inc. All Rights Reserved.
 
I see
:D
 
user6438653
@Pigman168 Yip.
 
Installed already as backup
 
user6438653
Use Chrome, not firefox, we don't like out customers using other browsers.
 
user6438653
While you're installing Chrome, you could watch YouTube.
 
8:38 AM
Customers?
 
user6438653
What?
 
Customers of what?
 
user6438653
Our amazing google users.
 
i tried to install Chrome once
but my hard drive ruptured from the pressure
 
user6438653
 
8:42 AM
does it it speed up nodejs if I use cloudflare cdn ?
 
user6438653
@Cerbrus I parsed that insanity into ^^
 
@ADISbayrakcan maybe if you define 'speed up'
 
user6438653
@ADISbayrakcan heroku!
 
ping time.
 
user6438653
heroku!
 
8:43 AM
lower connection time between user and server
 
Wouldn't it increase? (I don't really know)
 
static js is ok, but how about node ? its javasdcipt that running on server
 
user6438653
@Pigman168 I don't work for google.
 
@WATERYMEL0N you're missing status 418
 
And 404?
Nvm its not in order
 
user6438653
8:45 AM
@Cauterite hahaha.
 
user6438653
@Pigman168 Yeah. true.
 
@WATERYMEL0N Manually?
 
user6438653
Using code.
 
user6438653
I ain't going to to that manually, that'll take hours!
 
@WATERYMEL0N YAY!! congo!!
 
8:49 AM
So I dated this javascript dev girl. I didn't go well because she said "Don’t call me, I’ll callback you. I promise!".
10
 
Hahah, that was good
 
user6438653
@Chris rolf.
 
:)
 
Finally, she rejected, and you never gets called.
 
8:51 AM
Maybe it's still pending ;)
 
user6438653
@Cauterite Just for you ;) jsbin.com/hovowosuxe/1/edit?console
 
user6438653
 
<3
 
perfect
 
@WATERYMEL0N That's far more complex than it needs to be
 
user6438653
8:55 AM
Yeah, I couldn't be bothered writing out the list manualky so i did that.
 
user6438653
If anyone wants to parse urls here's this regex:
 
user6438653
/^(?:([A-Za-z]+):\/\/)?(?:(\S+):(\S+)@)?([A-Za-z0-9_\-.]+\.[A-Za-z0-9]+)?(?::(\‌​d+))?((?:\/(?:[^\r\n\t\f#?]*))*)?(?:(?:\/|)(?:\?([^\r\n\t\f#]*)))?(?:#(\S*))?$/m
 
user6438653
matches[1] = protocol
 
user6438653
matches[2] = auth.user
 
user6438653
matches[3] = auth.pass
 
user6438653
8:57 AM
matches[4] = host
 
user6438653
matches[5] = port
 
user6438653
matches[6] = path
 
user6438653
matches[7] = query
 
user6438653
and matches[8] = hash
 
or you could do new URL("http://abc.xyz")
 
8:58 AM
Regex is abusive.
 
user6438653
@Pigman168 lol.
 
:3
 
user6438653
@Cauterite Too slow.
 
seriously? isn't it a native function?
e.g. nsIIOService.newURI
 
does anyone here use handlebars? I'm trying to figure out why you can't precompile straight to html (I haven't used it at all, just researching)
 
9:00 AM
new Array(4); = Empty array with a size of 4?
 
user6438653
@Cauterite Sorry, it's for node.js, url module is slow.
 
@WATERYMEL0N No, it's a browser API
 
user6438653
What?
 
user6438653
Node.js isn't a browser
 
9:01 AM
he means his regex is for node.js
 
user6438653
^^ Thanks
 
the fact that node doesn't have a fast URL parser is a bit concerning though
 
It's quicker than that regex, lol
 
@Pigman168 Give it a try. You'll see.
 
user6438653
@BenFortune Nope.
 
9:02 AM
!!>Array(4)
 
@Cauterite ["undefined","undefined","undefined","undefined"]
 
that's not right
 
it is
that's what it should do
 
Why it says "bad option" ? my query on SSH is ;
node - nouse-idle-notification - expose-gc - max-new-space-size=2048 - max-old-space-size=8192 - NODE_ENV=production server.js
 
user6438653
@BenFortune that regex is ~2ms while the node url module is ~5ms
 
9:04 AM
if you want array with values, use .fill()
or some hacks
 
how could that possibly be right?
they're supposed to be empty slots, not "undefined" strings, not even `undefined` values
 
define "empty slots"
null ?
 
@WATERYMEL0N Regexp is less maintable than url. Instead of well defined methods you have to use numeric index. Unless you are processing millions of url, I see no reason to save a few ms (or less) by using a 162 characters long regular expression.
 
i use
!!> [].fill.call({ length: 5 }, 0);
 
@KarelG {"0":0,"1":0,"2":0,"3":0,"4":0,"length":5}
 
9:07 AM
oy
doesn't work ._
* checks doc *
 
!!> [...Array(5).keys()]
 
RTFM! :D
 
user6438653
@Sheepy Thats what I'm doing. I'm also minimizing the amount of code to write.
 
@BenFortune [0,1,2,3,4]
 
9:08 AM
that console "redefines" it for you to make it clear
@BenFortune not default values tho. I recall a hack i've figured out to generate an array with 0's
well "recall"... forgot the details
 
user6438653
!!> [...Array(5).keys()]
 
user3119231
o/
 
!!> Array.from({ length: 5 }, () => 0)
 
@BenFortune [0,0,0,0,0]
 
dat arrow ...
 
user6438653
9:10 AM
!!@CapricaSix Doesn't work for me
 
ok
 
user6438653
!!@thedigitalmouse
 
user6438653
@BenFortune What?
 
9:11 AM
that's a huge speed difference o.O
 
less than a blink of an eye!
 
!!> [].push(0).push(1)
 
@ZhengquanBai "TypeError: [].push(...).push is not a function"
 
caprica isn't ES6 compliant? :D
 
@BenFortune what are we trying to do ?
 
9:26 AM
@Abhishrek url.parse vs the regex alternative
 
@ZhengquanBai .push will not return the array
@BenFortune oh heh what parts do we need?
here is my url parser
 
I've written something like arr.splice( 0, this.indexOf( '_' ) ) and this is, not suprisingly, undefined. How might I achieve that basic idea?
 
@TJWalker Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
Maybe
 
@TJWalker arr.indexOf?
 
9:28 AM
^
 
const el = document.createElement('a');
function parse(url){
    el.href = url;
    return {host: el.host, protocol: el.protocol, query: el.search};
}
 
@Abhishrek Node :P
 
Aha
url.parse then
I am wondering how a purejs version will perform
 
@Chris i just read your joke.. made me shoot Rootbeer from my nose >.<
 
9:31 AM
@BenFortune yeah, from Array.prototype.indexOf()
 
Morning guys
 
morning!
 
I feel like I am having a deja vu
I should sleep. Good night folks
 
@Abhishrek prace brah @thedigitalmouse Hey :-)
 
Anyone know how to do something like arr.splice( 0, this.indexOf( '_' ) )?
 
9:33 AM
Didn't you just ask that?
 
Go figure, seems I did. Oops. You'll have to forgive my oversight -_-
 
You're wanting this to refer to the array?
 
Yeah.
 
Why not just use arr?
this is referring to the surrounding scope.
 
lol, co-worker blames me of my massive push
25 files + 3000 additions
 
9:42 AM
@KarelG Did you push that push?
 
My actual use case looks like:

arr = arr
.sort ( ( a, b ) => a[1] === b[1] ? 0 : a[1] > b[1] ? -1 : 1 )
.map ( ( pair ) => pair[0] )
.splice ( 0, this.indexOf( '_' ) )
.join ( '' )
 
@Cerbrus pushed 'm up yeah ;)
 
@KarelG Then who's to blame for the push? :P
 
haha
@TJWalker just fyi, you can reduce the function in your .sort
 
@TJWalker I see.
 
9:43 AM
@TJWalker Those a[1] / b[1], are those strings?
 
@TJWalker split it up into 2 lines and use arr.indexOf()?
 
I know I could separate out right before the splice and use arr again. But I'm just wondering if there's a way to keep it all together and terse.
Yes, they are strings.
 
you can either declare a variable and use it or put a callback thing (but ugly)
 
@TJWalker (a, b) => a.localeCompare(b);
 
arr starts out as a two-dimensional array and needs to end as a string
 
9:46 AM
@TJWalker What do you have, what do you need, exactly?
 
One sec
 
i wish that java has a sorta #region feature
a 2D array of strings is quite strange IMO
 
He wants to get a reference to the object on which splice is invoked. But the object is the intermediate object somewhere in the chained invocation.
 
@Abhishrek good night! here's some help in counting sheep... console.log(Array.apply(null, {length: 100}).map(function(el, sheep_counted){ return sheep_counted; }).join(' sheep, '));
aw he left already :/
 
9:56 AM
nice exercise. However, you ended up with a 2D array ?
 
I don't think there is a way you can achieve that without having to split the chained invocation. Can't think of a way to obtain a reference to the intermediate object produced in the chained invocation without saving it to a named variable.
 
you can do that, but it's a spaghetti code if you do that
 
It seemed idiomatic to me as I wrote it. I'm open to wiser thoughts, though, on how to go about it.
@KarelG yep ended w/ 2dArr in this attempt
 
I would loop through that large text and for each char, get obj from this array by "key" char: [ {char: 'a', count: 0}, {char: 'b', count:0}, ... ]. Then add up the count. At the end, you only have to sort the array of objects, and then display the char + count.
 
Ahh, okay. Sounds decent. I'll play around with that idea.
Thanks, folks. 'Preciate ya.
 
10:05 AM
Can anyone recommend a good short course on MEAN stack, either in the UK or online? Preferably UK though. :)
 
@Cuckoo Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
10:33 AM
@ssube I'm more of a "learn a language when I need it, then forget half of it after I've done the job" kinda fad
which is fair
 
Hey, guys, does anyone know a way of using setTimeout without passing the function that you want it to execute. For example, something like this setTimeout(2000); ?
 
to do what? Delay the script?
that's not going to work. JS doesn't have a wait or sleep
 
Like calling a named function/method? setTimeout(this.method.bind(this), 2000);
 
@JoãoPaiva If you just want the particular function to be delayed then wrap it within timeout and give it 0 value, as its web api it will be called later
 
this also encourages modularity. Chances are that if you need a sleep or wait, you could have used a better code structure
 
10:36 AM
@SterlingArcher I can be a jerk sometimes, I try to avoid that.
 
codepen is down! We're doomed!
 
my life is over 0.o
 
Tiny Guide to Non Fancy Node.js - https://github.com/yoshuawuyts/tiny-guide-to-non-fancy-node - Quick explanations on Node concepts. Async, testing, da… https://twitter.com/i/web/status/820958295548633088
node goodness right there
 
@Shashi No, I meant without having to pass a function to the setTimeout function, like this setTimeout(2000);
 
what are you trying to achieve?
 
10:42 AM
@towc Who, me?
 
yes
 
basically I need to have two timeouts
but if i wrap the functions inside the timeout it gets too confusing
 
setTimeout(); setTimeout();
 
because the first timeout will have a function that will contain another setTimeout
 
10:45 AM
it's fine
 
what are you trying to acchieve?
 
put one in the other :)
 
why are you timeouting stuff anyway?
 
Does cdn network make it faster if there is only <? echo "hello world"; ?> on the page ?
 
setTimeout(function(){myfunction(); setTimeout(function(){otherfunction(), 2000)},2000);
 
10:45 AM
yeah, that's fine
 
Timeoutception
 
try to get some indentation in there
 
yeah, but it's too unreadable
i wanted to make it like in other languages
where i write timeout(2000); callfunction(); timeout(3000); callotherfunction();
 
@JoãoPaiva: your code is incorrect.
 
just wondering if that's possible
 
10:46 AM
No that's not possible..
 
@Cerbrus Ok, thanks.
 
how about t1 = 2000; t2 = t1 + 2000; setTimeout( t1, f1 ); setTimeout( t2, f2 )?
 
Don't change the times :-/
 
1. Try to separate the logic from the wiring, in other words. Create a named function, call it from te timeout call, anonymous functions tend to create a mess especially when nested.

2. Try to avoid timeout/intervals as they can be dangerous/confusing/slow. Maybe you need to rethink your approach.
 
setTimeout(
    function(){
        myfunction();
        setTimeout(otherfunction, 2000);
    },
    2000
);
There.
 
10:48 AM
I have installed flow
 
Your syntax was incorrect, in the first place, @JoãoPaiva.
 
$> touch .flowconfig $> npm install --save-dev flow-bin
still atom is saying flow is not installed
what could be the reason for this
 
So, @JoãoPaiva, what do you think? Is the indented & fixed code better?
 
Can anybody reach modernizr.com?
 
@Starrover Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
10:56 AM
@TGMCians shouldn't that be a global install?
 
cant reach modernizr.com
 
@DrSheldonTrooper Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
It keeps giving me 502 Bad Gateway error. :(
Does anybody know what's going on with modernizr.com? Need to read their documentation but the site is currently down.
 
i can give you the modernizr files if you need them
 
I want to kick Firefox devs
they still don't support HTML5 date
and won't in the near future >.>
 
11:01 AM
And they still don't support Intl...timeZone
This is very unconvenient
 
@DrSheldonTrooper Thank you, but I want to custom-build it... Is there any way to custom build the library from command line?
 
@KarelG but its still very comfy for developers
 
@BenFortune not sure, at least it should work for my project
for my working directory
 
@TGMCians Why should it? It tells you in the error message to have it available globally (in your PATH)
 
11:06 AM
@TGMCians install globally
 
I see
let me check what command to install globally
I am new in nodejs
npm install --global flow-bin
 
does the normal geolocation API from google <script src="https://maps.googleapis.com/maps/api/js?key&signed_in=true&callback=initMap‌​" async defer> </script> contains also the geolocation commands or do I need to use another API link?
*geocoding
like var geocoder = new google.maps.Geocoder;
 
I have installed npm install --global flow-bin however still atom is suggesting flow was not found
how can i set path of flow-bin
 
greetings, folks! any thoughts on this perplexing problem? stackoverflow.com/questions/41695585/…
 
11:11 AM
@Cerbrus Yeah, it does look better like that, thanks.
 
uh
> In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package.
not sure if you want to do this. What if you have another project ?
 
Yes
I have done some kinda
I restarted atom software, still getting same error
 
Does cdn network make it faster if there is only <? echo "hello world"; ?> on the page ?
 
how can i set in my path variable
 
11:17 AM
Do you think this tutorial is outdated? scotch.io/tutorials/…
 
@Thaenor without looking at it, I am not exactly sure :/
 
It says "During the writing of this series, React released version 0.12 which made some fairly significant changes. This tutorial will be written in 0.12 syntax"
 
Does anyone knows angluarJS here ?
 
Isn't react's currently version like 15. something?
@Mathematics 1 or 2?
 
@Thaenor Isn't that something you can't google :)
@Thaenor 1
 
11:18 AM
@Mathematics yes, I'm saying that because I googled it...
 
@Thaenor you are lucky, atleast you can google your problem :|
 
@Mathematics is your problem so bad that you can't google it? I know a little of angular. shoot your question, even if I can't I'm sure someone will chime in to help.
 
@Thaenor yes
and here you go...
I am able to make this work with toggling 1 css Class "red"..
but I want to make it work with blue css class too.. IN other words I want it to toggle blue/red classes without adding a directive or back-end code :-)
so changing it from red to blue and blue to red
 
@ADISbayrakcan Do you understand what a CDN is, and what it does?
@Abhishrek Hello, Mr. Brown.
 
Can't you just read what CSS class is currently active and if red, change to blue and vice versa?
I don't really remenber how angular used to do event handling but I think you could do that.
 
11:28 AM
312
Q: Adding multiple class using ng-class

Aditya SethiCan we have multiple expression to add multiple ng-class ? for eg. <div ng-class="{class1: expressionData1, class2: expressionData2}"></div> If yes can anyone put up the example to do so. .

 
that solves that.
 
I was thinking in vanilla actually... in your event handling doing a query selector and changing the class that way. But Ben's solution looks way more elegant and less hammertime'ish
@BenFortune +1
 
@BenFortune that's amazing...
thank you so much !
 
keh this dude
0
A: Tooltip on image

NourHtml <div id="content"> </div> JQuery $(document).ready(function() { $("#content").tooltip({ content: '<img src="http://icdn.pro/images/fr/a/v/avatar-barbe-brun-homme-utilisateur-icone-9665-128.png" />' }); });

> answered Aug 20 '16 at 13:06
 
11:50 AM
dare I click that...
 
To be fair it's a shit question too
Should be closed
 
I was expecting the image to be something more jarring...
 
is there a way to debug a click event?
 
@Pigman168 Set a breakpoint in the handler?
 
Oh, thanks @MadaraUchiha
 

« first day (2285 days earlier)      last day (2678 days later) »