« first day (2148 days earlier)      last day (3025 days later) » 

15:00
you should watch some pre-expansion cinematics then
I have one function with a bunch of async promise calls. I want to know when all these function calls are finished, and return one of two states.
@Neoares How awful is Legion? WoD awful?
I resolve off the promise chain, yes?
@neet_jn do they run at the same time (in parallel) or one after another (in sequence)?
Two branches based off of one condition, they both run in sequence.
15:02
@Trasiva it's waaaaay better
if(foo) doChain
else doOtherChain
despite I haven't played WoD
I'm just enjoying leveling from 100 to 110 just doing artifact and lore quests
@neet_jn Promise.all(promises, results => ...)
with great cinematics
@neet_jn that's not what in sequence means
15:03
then I'll probably quit, depends on the end game :D
@Neoares That's fine and dandy, WoD did well on the levelling story too. It's the end game that's fucking awful.
Three hours just doing the same fucking garrison missions, and then trying to PuG raids and flopping because people can't dodge the simplified mechanics.
well, let's see
How do you override toString in an ES6 class?
at the moment karazhan is confirmed to be a new raid
@OliverSalzburg class Foo { toString() { return 'foo!'; } }
15:05
huh...
Problem is somewhere else then. Thanks
Anybody know of a good solution/script for taking user input and doing math and string concatenation safely? I've found some math libraries but I haven't seen any that allow for both math and string evaulation.
What the actual shit
@Josiah 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.
data.data shows property connections = array[10]
When I assign data.data.connections to $scope.systemInterconnections, it's undefined. When it's not assigned, it logs
What. The. Actual. Shit.
Object.create(data.data.connections);
maybe it is being overwritten before it is used
$scope.reloadPage = function(){
    RESTServices.getSystemDependencies($scope.systemId).then(function(data){
        console.log(data)
        $scope.selectedSystem = data.data.score.name;
        $scope.systemInterconnections = data.data.connections;
        console.log("connections raw", data.data.connections); //logs
        console.log("connections", $scope.systemInterconnections); //undefined
At the moment, I'm doing this, and though it seems safe it isn't perfect by any means.
1 message moved to Trash can
@Josiah Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
  function prepExpression(exp) {
    var reg = /\s*([-\+\/\*])\s*/, // using () captures the delimiter. Using [] matches the set. \s* removes spaces.
        pieces = exp.split(reg);

    for (var i = 0; i<pieces.length; i++) {
      var pc = pieces[i];
      if (/[^-\+\/\*\d*]/.test(pc)) { //it has something other than numbers and math operators.
        var safe = pc.replace(/'/g, "\\'"); // quote it so it can't be called during eval.
        pieces[i] = "'" + safe + "'";
      }
    }

    var manipulation = pieces.join(" ");
15:10
> var pc
@SterlingArcher PC BRO!
I love that gif so much
"Image not found" is my favorite gif, by far
aw, it's just the work firewall blocking it :(
Rofl
Shut down by the firewall.
^ @ssube
about canada canada is much more well spoken then obama in the latest canada us meet up
15:23
are you having a stroke/
hi guys. quick question. var a = $("#sometext").val();
would this cause xss vulnerability?
Jesus christ that grammar.
@Shauzab 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.
@Shauzab no
why not ?
15:24
because you're just assigning a string to a variable
how would that possibly be a problem
that alone doesn't execute the string as code, it's just a string.
and im not writing it to html ?
no
you're assigning a variable in memory
if you do nothing with it, nothing will happen
@rlemon How much experience do you have making dough?
xss is really a pain.
15:25
decent amount
@Trasiva 5 years professionally
@Shauzab not really. sanitize inputs before they get sent anywhere
local pages are always insecure because the client can edit them however they please
@rlemon yea if the dev before me had done this sanitizing
I usually keep my place at 21C/70F, is that going to cause an issue with letting the dough raise?
15:27
and there are so many input takers in web app
I don't have a standing mixer, so I'm so not looking forward to hand mixing the dough.
Sri
Sri
Hi guys,

Can anyone guide me to the right direction. Is it possible to find a classname and insert a new line after the classname div?
@Trasiva shouldn't be too much an issue, just make sure to keep the temperature consistent
@Sri ofc
15:28
I usually cover it with a tea towel so the air doesn't change the top of the doughs temp
Sri
Sri
<div class="types"></div><br/><br/>
.types::after {
  content: '';
  display: block;
}
Sri
Sri
Is that CSS @rlemon ?
yes
Sri
Sri
so not possible in javascript?
15:29
sure it is, but it is easier in css
Sri
Sri
Thanks for the hint and I would be happy if you tell me how to do it in javascript?
Array.from(qsa('.types')).forEach(node => node.parentNode.insertBefore(document.createElement('br'), node.nextElementSibling())
qsa is ofc querySelectorAll
see how much simpler it is with css ;)
querySelectorAll returns an Array if I'm correct
no it doesn't
no need for Array.from
15:32
it returns a NodeList
Sri
Sri
Yes i agree. It's clear in css. But querySelectorAll returns an Array as like @jonathan said
no it doesn't. lol
guys, read the docs, test it, do something
qsa has always returned a nodelist
Sri
Sri
cool @rlemon. Thank you very much
document.querySelectorAll('*').forEach;
15:33
which is an array like object (it has a length and it iterable)
@Jonathan doesn't work
it's a nodelist, but it has forEach
nodeLists do not have foreach
In my Chrome it has ^^
you may be confusing the dom api with the jquery api?
Version 53.0.2785.89 beta-m (64-bit)
console ->

document.querySelectorAll('*').forEach;
forEach() { [native code] }
15:34
the NodeList interface does not contain a definition for forEach
so your console is irrelevant
If one happens to exist in your browser... you shouldn't use it anyway, unless you're building for one browser i guess and are ok with it randomly breaking.
you can implement it easily enoujgh (which I suppose something in your browser is doing, maybe an extension?)
When you run that in your Chrome it returns undefined?
no it throws an error
like it should
15:37
@Jonathan undefined
@rlemon Cool, appreciate it. I'm gonna try making chicken pot pies with my ramekins this weekend.
Ok, in that case I better revisit some commits I did earlier this week ^^
> document.querySelectorAll(...).forEach is not a function
in all browser but ones that specifically have a script to implement it
apparently my chrome has a forEach on its node list, as it shows native function
Since I actually removed my initial conversion to an array when I saw it working
15:38
like, you can add it in, but it never will exist by default.
and that's in the new tab window, so nothing should have changed that
@ChrisChilvers Yes, mine too
Mine does too, wtf
@ChrisChilvers dev tools adds a bunch of stuff that isn't standard and cannot be trusted
It's not devtools, it's chrome
15:39
.... \
facepalm
ah, that would explain it, that does get annoying sometimes, you go to test something and the environment magically changes underneath you
@littlepootis ugh, well that title sucks
being Iterable !== you magically get the array prototype methods
Sri
Sri
Can you check the below is that you defined @rlemon
Array.from(document.querySelectorAll('.types')).forEach(node => node.parentNode.insertBefore(document.createElement('br'), node.nextElementSibling()));
15:40
Gross
@rlemon well, it's correct
I normally just use something like lodash, or a simple function forEach(list) { Array.prototype.forEach.apply(list, arguments); }
@littlepootis yes but his title / intro reasoning doesn't touch the fact that being iterable doesn't add the prototype methods, they've decided to do that on their own
being interable means I don't have to steal the array Symbol.iterator
@Sri does it work?
Sri
Sri
@rlemon Sorry, no

Uncaught TypeError: node.nextElementSibling is not a function(…)
my bad it isn't a method
15:45
Ok, I'm a bit confused now. I can't find anything of NodeList prototype containing forEach
hey guys, any jquery ui date picker gurus around ?
so I guess I should fix my code?
@Jonathan because it doesn't contain it
What's it called when you configure routes to work without a #/ on a single page web application on the server? Need to google it
Chrome decided to basically do this: NodeList.prototype.forEach = Array.prototype.forEach; for you, but it isn't in the spec that way
15:46
My brain feels like it's melting.
@Luggage, I'll convert to JS once I have this resolved.

http://pastebin.com/qKyLz3x0

That's my code, very simple and straightfoward. When TLO.login is called, I just want to use .then appropriately after the promise chain has ended.
@corvid hashbang urls
Ok, thanks, I'll fix it than
@corvid that's just normal routing, on the client side it would be push state to avoid a round trip to the server but still change the client URL
@ChrisChilvers # blocks an actual route from processing, it is then needed to be parsed by the client js -- nothing is magic
Where would I place the resolve in TLO.login?
15:48
Confusing anyway, since they didn't do it for HTMLCollection
@Jonathan HTMLCollections are stupid
@corvid there's then 2 ways you can handle that client side when navigating directly to the url, serve up a common index and have that look at the url, or have the server generate the view for that url then use progressive enhancement (which is what github does)
@ChrisChilvers I'm trying to configure it with React, would it just be about using browserHistory from react-router instead of hashHistory?
Sri
Sri
@rlemon the javascript is not working sorry. Any other ideas please?
@corvid no idea on that, I just know to change the URL without a round trip to the server and without using a fragment (#) you want push state
15:53
Anyone have any benchmarks on indexOf vs includes?
@neet_jn You are STILL improperly using new Promise().. You don't need it at all. I can tell becasue you never call resolve or reject
@BenFortune that chart is amazingly unreadable, its tested against so many different browsers the bars are too small to actually see anything
@ChrisChilvers that makes sense, it appears to work... I think that you just need a catch-all route on the server to make it work.
@ChrisChilvers Yeah, it's pretty wank
15:58
@corvid for single page, yes, alternatively sites like github use progressive markup so will generate the page for that route server side, and mostly just use pushstate to get a nicer client navigation. Such as only re-loading specific sections of the page, and animating them.
@BenFortune thanks
Ok, weekend time!
@ndugger rather than the timings (which are almost identical), there is an interesting semantic difference when handling NaN stackoverflow.com/questions/35370222/…
@ChrisChilvers I'm already familiar with the semantic difference
but thanks
I'm just working on performance critical code right now, and was curious about the speed difference
It's not a large enough difference where it would make a dent in my timing, I think
@ChrisChilvers tricky but sensible change
@ndugger get those flame charts brah
16:06
I'd say the bigger issue, quite a few of those browsers do not seem to implement indexOf yet
aw man, if I was a sad nerd, I would get a flame chart on my bicep as a tribal tattoo
@ChrisChilvers you mean includes, but I would still have used it to get gains on browsers that are actually good, and then polyfill it with indexOf for shitty ones
Not a big deal
can anyone see the content of these chars?
মিরপুরে জঙ্গী আস্তানায় পুলিশের অভিযান, নিহত ১
were tweeted by BBC news
@ndugger why not a smart polyfill that benchmarks both when the module is first loaded and uses the faster one?
@towc Upside down viking runes mixed with spaghetti?
16:12
@towc yes, displays fine for me
@ssube Because that's stupid
@ndugger it's enterprise grade
smoke dat enteprise grade polyfills brah
it's from the bengali alphabet apparently
also, it seems the biggest performance increase in either function comes from changing browser
@towc Doesn't exist
@towc Translates to: Mirpur police raided a militant hideout, killing 1
oh, just a translation thing -_-
btw, it just linked to this after the message I wrote: bbc.com/news/…
contents of that are: বাংলাদেশের রাজধানী ঢাকার মিরপুরে সন্দেহভাজন জঙ্গীদের এক আস্তানায অভিযানের সময় একজন সন্দেহভাজন জঙ্গী নিহত হয়েছে, আহত হয়েছে তিন পুলিশ সদস্য। ঢাকা মহানগর পুলিশের একজন মুখপাত্র মাসুদুর রহমান জানিয়েছেন, পুলিশের এই অভিযান এখনো চলছে। আহত পুলিশ সদস্যদের মধ্যে ঢাকার রূপনগর থাকার ভারপ্রাপ্ত কর্মকর্তাও রয়েছেন।
well, were when I clicked it
It's just a short news brief about a military raid.
yeah, just looks like a normal issue
Three cops injured, one militant dead. In progress.
16:19
well, more like the militants were suspected of raiding
in which case it's everyday news I guess :/
@towc yes
you can't?
@littlepootis hadn't installed the right font packages
they're boxes
tasksel has an option that installs 880MB of fonts.
That should.. fix it.
16:21
well, I decided to stop installing packages that I could really do without
except sl. sl is good
Update on Juno @KendallFrey @rlemon
@towc you're probably missing some fonts, I'd bet they're part of the Windows East-Asian support
also wtf debian wiki
@towc nice
have also had a bad time trying to remove the ipp/cupsd services :/
I'm stupid like that
16:24
@ChrisChilvers I'd bet he doesn't use Winblows
Usually, installing ttf-{language}-fonts fixes that.
btw, funny names: windoze and noobuntu
In towc's case it would be ttf-bengali-fonts.
He likes to use linux because he thinks it makes him cool
the girls love it
girls here are unaware of it
16:27
Until he does rm -rf.
Then he's panicked and losing his collective shit.
btw, whoever's still saying rm -rf is a thing should rtfm
Didn't some guy do rm -rf ~?
@towc why?
Because --no-preserve-root?
it's sudo rm -rf / --no-preserve-root
and if you're logged into root in the first place you're an idiot
but you still need the flag
@littlepootis It happens a lot more than you think. It used to be a regular issue for the people I dealt with in the military because we had to give them root.
16:29
@towc rm -rf /* still works.
I just tried it wor
@littlepootis well, you're not removing / metadata tho
so doesn't count
:P
there's something wrong with us
oh, I found it
JavaScript:BILL! BILL! BILL! → JavaScript: BILL! BILL! BILL!
@towc Doesn't matter if you remove the metadata or not. You've still classically fucked yourself .
yes
except
how do you do a scrollable window inside another window?
@BenCraig overflow: scroll
16:35
thanks
@BenCraig what's problem? Could come up with any example or fiddle?
I have 2 independant lists, I want them to scroll seperately
@BenCraig overflow: auto
Do I need to require both farm.js and farm.crops.js in the main?
`farm.js`
---------------------------------------------------------------------------------------------------------------------------------------
Farm = function() {
  return this;
}
Farm.prototype.sell = function(value) {
  console.log('sold' + (value||'nothing'));
}

Farm.prototype.Crops = require('farm.crops.js')

Module.exports = Farm

`farm.crops.js`
---------------------------------------------------------------------------------------------------------------------------------------
Module.exports = {
16:43
no
I'm getting undefined when trying to access .Crops
@neet_jn Is this node?
Yes.
@neet_jn Module
16:44
but also, custom modules need to be relative paths
so it should be './farm.crops'
omit the .js part
> I feel like I'm going to pass out.
Crops exists and can be accessed in the Farm.js
But cannot be accessed in the main.js
Nonsense
So I'm not insane, it's my environment?
No, it's you
16:49
Missing a ) after 'ok'3zzy 1 min ago
That comes from a user with almost 20k rep... he still doesn't know he can edit answers ^^
@DenysSéguret why no arrow function
maybe because I posted that answer more than 3 years ago
@DenysSéguret To be fair dude, did you look at his stats?
!!stats 3zzy
@Trasiva User Elusio proved elusive.
16:53
WTF Cap
@DenysSéguret always write future proof answers god how could you
Anyways, 588Q:163A
@Trasiva I hadn't. Well... SO rep is sometimes very deceptive...
^ that. so much that.
Oh absolutely.
And so many of his questions are garbage.
16:54
not for us, of course
187
A: Should Jquery code go in header or footer?

3zzyPut Scripts at the Bottom The problem caused by scripts is that they block parallel downloads. The HTTP/1.1 specification suggests that browsers download no more than two components in parallel per hostname. If you serve your images from multiple hostnames, you can get more than t...

this is his best answer. a w3schools quote.
God it hurts, so much.
damn...
now we know how we could get rep... just quote w3shools
That's how most people already do it
My rep is really low because I refuse to be a shitbag
367
Q: Removing multiple classes (jQuery)

3zzyIs there any better way to rewrite this: $('element').removeClass('class1').removeClass('class2'); Can't use removeClass(); as it would remove ALL classes, which I don't want. Thanks

16:56
His best question is dumb af too
Yeah that
controversy and get sympathy!
His best question, which someone else got a fuck ton of easy rep for.
To be fair my highest voted answer is just an MDN quote too
@ndugger Yea, the other one for me is if there's already an answer that's as good if not better, I don't answer it.
Anyhow w3school quote In that answer is not incorrect so it should be fine. Shouldn't it?
16:58
WOOOP WOOOP my responsive image map using javascript works :D
@NullPoiиteя Not even remotely.
Well done sir 🙌
@NullPoiиteя it's a notoriously bad source. Even though the answer is high, high society programmers hate w3schools
I'd like to thank everyone who helped me and supported me during these first steps of my project. First of all thanks to my mom for giving me birth. Thanks to my sister who endured my bad mood when nothing worked about my project. And thanks to @BenFortune
for the tips:)
@SterlingArcher s/high society/common sense/
I actually added an extension to chrome that filters w3schools answers out of my google results.
17:02
imgur.com/gallery/zWrgB7m wow that's a lot of damage
@SterlingArcher There's a reason bulls are left in a giant paddock by themselves.
I don't appreciate w3s but we can't deny w3s can be helpful for newbie. Learning is process how can only source make a person incompeten?.
Does anybody know whether storing pdf files in an SQL-database is a good practice?
@trilolil Yes and no
17:06
@NullPoiиteя we can deny it because it is harmful moreso to newbies than vets
you can spot the terrible practises and leaky globals, newbies cannot
No store address in db and file in file server like s3 bucket
@OliverSalzburg would you mind explaining?
@NullPoiиteя W3schools teaches poor practices and habits that will make any new programmer a nightmare to deal with once they enter the work force. Go ahead, hire a bunch of new devs and let them work from W3S examples.
@NullPoiиteя Is there a big difference between s3 bucket and a SQL db?
17:10
94
Q: Is it a bad practice to store large files (10 MB) in a database?

B SevenI am currently creating a web application that allows users to store and share files, 1 MB - 10 MB in size. It seems to me that storing the files in a database will significantly slow down database access. Is this a valid concern? Is it better to store the files in the file system and save the ...

Can't an s3 bucket be any type of DB not just SQL?
Well I did some research and I think I'll just put them in the filesystem. That way people can very easily access it and modify everything to their needs. Next to this no need for me to learn something new to databases, that way I can focus on the more important things.
I'll just write some PHP code to get the files from the filesystem and display them on some local webpage.
@SterlingArcher what?
s3 is just file storage
Redux question: should a toggle action fire off a toggle event where the reducer describes the state, or should the toggle function get the state and decide which action to use?
17:13
@SterlingArcher yes it is but suitable for different aspects
RDS can be several different types of databases though
@ssube loooooooook
@SterlingArcher That's a neat looking useless lighter.
Does it turn on when you open it?
@KevinB storing files in filesystem is more of performance thing also I see no reason to store it in db and cause more complexity also make developer worry about db size
Anyway, good night!
17:23
np.reddit.com/r/IAmA/comments/4yeris/… man this AMA didn't go over well for her
@SterlingArcher I seent it last night. Looks fun.
> worry about db size
lol
@rlemon Dude, they tore her apart, lol.
@jake no there's a button. instructions say it shouldn't be active for more than a few seconds
Arcs are dangerous
1. Open
2. Toss in water
3. Collect fish
17:32
> Hey bro, I know you're taking a bath, but remember that time you fucked me over? toss lighter
That was my first thought, how many amps of power does it use?
> How do I instantiate an interface?
@jake don't you want crazy high voltage at low amps for that sort of thing?
Don't the amp kill?
17:35
yep, amps are bad
water is a decent insulator in large volumes
you would need a stupid amount of energy to electrocute fish in even a small pond
@rlemon Well, huh. I'll be damned.
Does anybody know what's the meaning of "web workers" ?
17:46
@KevinB OMG .. what are you doing here ..!!!!
I'm always here :)
@MartinAJ they're like threads, but nothing like threads.
@rlemon what? if I use a library, them I'm a web worker of that library ?
no, a WebWorker is its own interface
or did that woosh me?
17:51
@MartinAJ It's like your younger brother that does your homework while you play CS:GO
@MartinAJ Do you know what a thread is?
@KendallFrey "thread" means "title" (based on google translate)
out of the gate you can kinda think of them like threads, but really they are nothing like threads.
@MartinAJ uh no
protip: don't translate programming terms.
translate the pages those terms bring back
17:53
@rlemon they're threads, just without shared memory
which might be unique
@ssube so not threads
:P
@rlemon but they crash together...
they're weird
@littlepootis this is the best explanation I heard so far
MDN has a pretty good explanation on them
maybe check there
@ssube This "high voltage low amps" talk always gets under my skin, because amperage always directly correlates with voltage a la V = IR
17:55
@KendallFrey tesla coil
Well, R can vary.
@littlepootis Not in the situation of "it's not the voltage that kills you, it's the current"
Yes, a van de Graaff generator generates high voltage, but if you form a circuit with the ground, there's no corresponding high current because the voltage drops.
"high voltage low current" is pretty similar to saying the power source has high internal resistance

« first day (2148 days earlier)      last day (3025 days later) »