« first day (2831 days earlier)      last day (2339 days later) » 

14:01
If something is not there, is it not possible that it could be somewhere else ?
For example unicorns, just because you have not seen it, it does not mean that they do not exist.
Maybe you are blind to unicorns (similar to color blindness)
or maybe they don't exist in your area or they could be very close to you,
maybe your parents are unicorns. Saying something isn't true doesnt make it false.
Not everything is Boolean
@FlyingGambit Except for my love life - That is definitely nowhere to be seen. :cry:
ForEverAlone.jpeg
@New_2_Code BIG FAIL
Thank you for you help guys.
It makes it more clear to me.
Pleasure Arber, always happy to help.
@Arber You are welcome, please visit us again
@New_2_Code Did u check inside Davy Jones Locker
14:06
@FlyingGambit Shit be barren yo. :D
Welp you can adopt me if you are rich, your fatherly love life could begin from there
user1596138
Fatherly cash
A child's birth right
@FlyingGambit Incest is wincest? Naah I'll pass, but thanks for the offer. (hehe)
@New_2_Code Eww didn't meant that way
14:12
Apologies, the internet has ruined me.
// within an
(async () => {
  const someOtherThingWithSideEffects = console.log;

  const somePromisification = num =>
    new Promise((resolve) => setTimeout(() => {
      someOtherThingWithSideEffects(num);
      resolve(num)
    }, Math.random() * 100))

  const argArr = [1, 2, 3];
  argArr.forEach(async (name) => { await somePromisification(name) });
})()

// I half-hoped this would print 1,2,3 in order :/
guess I need to use a for loop instead of a for each, but it's kind of bumming me out
would be neat if, once I remove async in the forEach, the await would still be applied to the above function @BenjaminGruenbaum
What you need is a serial version of Promise.all
that would also be lovely, but from what I understand, promises are being tossed aside for the async/await abstractions :/
at least, in terms of tooling as far as node goes
What?
async/await is promises
> for the abstraction
14:18
I don't follow
btw bluebird seems to have mapSeries and each, both of which do that
I guess I went on an internal train of thought
the idea is that I thought promises wouldn't be developed on much anymore, except for making async/await better
so Promise.mapSeries will probably not be a thing
promises aren't part of ecma, right?
I don't think async/await is the reason why though
await isn't intended to be used everywhere. Like any tool, it has good uses and bad uses.
async (name) => { await somePromisification(name) } is a bad use
again, from what ben has told us, it looks like the intent is to make them usable everywhere
I might have misinterpreted
usable != used
Why am I not able to access this.searchBox inside of handleSearchKeyup?
I know this is probably a really simple problem but I can't figure it out. in connectedCallback I'm able to access this.search, which uses basically the same pattern unless constructor does something special about scoping member variables
14:32
cause you're not binding this, I reckon
this.handleSearchKeyup is not the same as this.handleSearchKeyup.bind(this) or event => this.handleSearchKeyup(event)
The same problem exists with the timer callback
Oh darn. I don't want to go through binding this, is there a way to structure my handleSearchKeyup function declaration where it will inherently bind this?
I've seen the solution where you list all the functions in the constructor and loop through, binding this to each and that just seems less elegant.
Lambdas bind automatically, like I showed
a new ecma feature is class properties. There's a neat trick where instead of methods that you have to bind, you define a class property and assign it to a lambda. In that lambda, this will always be the class instance
it's how the new kids do react
JS really dropped the ball with this binding IMO
@towc that's ES7, right?
14:35
In what way Kendall?
Well, Vap0r's code is a prime example
You'd expect it to work in a sane version of JS
Or this didn't exist at all, and was just a regular parameter
quick question: $.ajax has a 'success:' and 'failure:' options, where stuff is done on the success or failure of the ajax request. does this just mean if the ajax request goes through, it's considered 'success' and if it doesn't it's considered 'failure'?
@KendallFrey thanks btw, that worked.
or is there a response i can send back to the jscript directly to trigger the 'failure' function?
that is, if the ajax request went through, but maybe a value was off, and the server sends back "this value failed validation" --- would the 'success' function run, because the ajax request was technically a success?
or is there something i can send back to the request that will trigger the 'failure' function, even though the request technically went through?
Kendall I disagree just assign a variable to this problem solved
@Vap0r stage 2 proposal apparently
it's a pretty simple yes or no question, @KendallFrey
but already plenty of pull:
Poll: 📊 How do you typically handle binding in #react today? Examples of each: https://www.dropbox.com/s/5dc5zdwgwctoaup/Screenshot%202017-10-21%2015.49.32.png?dl=0
so if you know the answer, typing in "yes" or "no" is less effort for you than linking something, and less effort for me than looking through that
14:39
Java's which I assume you are referring to is much worse because you don't have choice to remind functions at all
i guess you could inherit this from the outer scope which in my opinion is weird and cases weird situations
@AmagicalFishy Even less effort is you reading the damn docs
i do agree this = window was a bad idea though
... n... no, that isn't "even less effort"
as per what i literally said like 15 seconds ago
@AmagicalFishy Are you seriously arguing that reading documentation is a waste of time?
@AmagicalFishy yes but linking you to the documentation will teach you the skill of reading documentation. It will also show others that you aren't looking for handouts, and instead have come to an educational site looking to learn. A "yes" or "no" gives you much less info than reading the docs
14:41
@AmagicalFishy did you consider other people's time is more valuable than yours?
@towc Did you consider that you're full of shit?
and that if you ask a lot, people are eventually going to ignore you
@towc I think being considerate wasn't a consideration of his at all
no, i'm arguing that when someone comes in with a pretty simple "yes or no" question, that linking them the documentation is a waste of your time and theirs, especially if they've already read the documentation
i am not good at ajax
and this doesn't easily answer my question
@AmagicalFishy then read the documentation
Coding isn't easy
14:42
what symbol usually signifies iteration over a set?
@AmagicalFishy If you've already read it, then try not to ask questions that are answered within it
It isn't hard either, if you learn the skills
@AmagicalFishy the documentation likely answers a lot more questions that you might have, so linking to it is actually an investment
and so is reading it
@Rick ∀
14:43
Thanks @KendallFrey :)
all this effort into telling me to look at something that doesn't answer my question, along with these pretty silly assumptions about the things i'm considering when i come in to ask a qusetion
is really kind of silly
@AmagicalFishy If you don't understand something in the documentation, by all means ask about that.
What part of your question does this not answer?
ok. i don't understand what the documentation tells me: does this just mean if the ajax request goes through, it's considered 'success' and if it doesn't it's considered 'failure'? or is there a response i can send back to the jscript directly to trigger the 'failure' function?
that is, if the ajax request went through, but maybe a value was off, and the server sends back "this value failed validation" --- would the 'success' function run, because the ajax request was technically a success?
or is there something i can send back to the request that will trigger the 'failure' function, even t
@AmagicalFishy google will literally answer every question you have
those are all things that are fairly trivial to test, or figure out by reading more
14:45
figuratively, of course
Who could've thought learning would involve more than depending on strangers.
you guys kind of suck. =/
> When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error."
We're not the ones asking jQuery ajax questions
14:46
Did you just not read that bit?
my coin is on the fact that he did not read it
user1596138
@AmagicalFishy I would have spent my effort on reading a paragraph of the documentation instead of writing a paragraph --- for us
hey everyone
moral of the story: we kinda suck
i have another .fetch question
user1596138
14:52
Did you google it yet
user1596138
Jk "just ask" ;P
'kinda'?
when putting in a .json which only has an array in it... the fetch works fine.. but when putting an array directly inside of it the operation falls over
and doesn't work
user1596138
Could you exemplify that
14:55
what do you mean
a json file is different that a js array object
well i run the calls from the get .fetch request through 2 functions
(if you meant that you injected a js array object instead of url to the .json)
@ChristianMatthew can you post your code I'm having a hard time visualizing this
user1596138
I just didn't understand what you asked
[
    "https://xxxxg-california.jpg",
    "https://xxxx/WDW/WDW-front.jpg",
    "https://xxxxx.jpg"
]
that is what is in the .json file
this is the .fetch request
      return fetch('./img_list.json', {mode: 'no-cors'})
        .then(status)
        .then(json)
        .catch(function(error) {
          console.log('Fetch Error :-S', error);
        });
that works fine
but if i put the array directly into the first fetch parameter it doesn't work
user1596138
@ChristianMatthew So it's a porn site
> (if you meant that you injected a js array object instead of url to the .json)
the reason wny i need to manipulate the array is so i can batch images
14:58
@ChristianMatthew the first parameter must be an uri
https://xxxxx.jpg
hmm
I think I am having a race condition with window.URL.revokeObjectURL...
user1596138
You mean you're doing
const saveFile = (blob) => {
  // URL of the blob
  const url = window.URL.createObjectURL(blob);
  const link = document.createElement('a');
  link.setAttribute('href', url);
  // link.setAttribute('target', '_blank');
  link.setAttribute('filename', 'users.csv');
  if (document.body) {
    document.body.appendChild(link);
    link.click();
    link.remove();
    // window.URL.revokeObjectURL(link.href);
  }
};
user1596138
14:59
fetch('["val", "val"]')??
that does not work because that is not an uri
user1596138
Never gonna work.
copy paste that in your browser
user1596138
What do you want to happen? Maybe we can suggest a sane way
14:59
What are you trying to do?
user1596138
Fetch is for making http requests. This makes no sense lmao
@littlepootis omg a .jpg domain name would throw so many flimsy validators in the trash
When I don't use window.URL.revokeObjectURL it works completely fine, but has a clear memory leak. When I do uncomment that line, it constantly gives me a file not found exception.
sure... but when i put in the array it concatenates them
these are url's
i just cut them off
@towc for just 150k you can do it
15:00
that is what fetch do if you simplify it: read the first argument, "browse" to that string and collect the response. Once done, it gives the response back as string
user1596138
Ohh
so it would be fetch(['url1', 'url2'])
user1596138
You have to make a separate fetch for each array entry, you can't pass a array of URLs
no ...
Stop trying to make that fetch happen
It's never going to happen
user1596138
15:01
51
A: How can I fetch an array of URLs with Promise.all?

BergiYes, Promise.all is the right approach, but you actually need it twice if you want to first fetch all urls and then get all texts from them (which again are promises for the body of the response). So you'd need to do Promise.all(urls.map(fetch)).then(responses => Promise.all(responses.map(res =

user1596138
Ignoring the Promise.all this has examples of how you might approach this
@Vap0r neat. I know where my savings are going
function fetchIt(url) {
  fetch(url, ...).then(...) // other stuff
}
then do
['url1', 'url2'].forEach(fetchIt)
I am not a fan of promise.all though
only fools uses those
I use callbacks like a real man
even Bergi yes. I know he's an experienced dev but he is a fool when he suggested that
15:03
ahh the article says use map i.e.. url.map(fetch)
let me try that
@littlepootis is your avatar a part of the bigger picture?
@ChristianMatthew use .forEach man -.-
and why is fetch not going to happen?
that was a joke
user1596138
15:05
var urls = ["https://xxxxg-california.jpg", "https://xxxx/WDW/WDW-front.jpg", "https://xxxxx.jpg"];
var fetchProms = urls.map(url => fetch(url));
fetchProms.forEach(fetchPromise => {
    fetchPromise.then(status)
    .then(json)
    .catch(function(error) {
      console.log('Fetch Error :-S', error);
    });
});
:P I understand that with your back history
user1596138
You want something like that looks like
user1596138
But don't just copy/pasta
oi lady bird that movie was astonishingly okay
user1596138
Cause you gotta wait for those fetchs to actually happen
user1596138
15:05
@corvid I'm Hank Hill's dog.
ok but in general why was the json file working?
god dang it bobby
i guess that was the confusing part
@ChristianMatthew because it is an uri ...
it tried to find that file and found it
user1596138
@ChristianMatthew it wasn't doing anything even remotely similar to this
15:06
and then processed the url's inside?
user1596138
It was retrning the array of URLs. Nothing more. Not fetching them
user1596138
Nope. You simply got an array back from that
but it did fetch them that is what i was saying
I have a doubt that you were not reading the convo here
15:07
what is the purpose of the first parameter of fetch then?
what i am saying is that i was confused as to why the json url worked to fetch the contained urls
user1596138
It didn't.
but it did it processed them accordingly
user1596138
Open your network panel and run your code. It will never request the URLs contained inside of img_list.json
the issue came when i tried to stop using the json and went directly to an array
i'll show you
user1596138
15:08
Unless your json function runs more fetches
any good svg validators out there?
can find one online
user1596138
SVG is XML
ermmmmm
@FlyingGambit reread my comment, but pretend there's a winky face at the end. ;)
with this code
    function loadImageList(){

      function status(response) {
        if (response.status >= 200 && response.status < 300) {
          console.log('we got here ')
          return Promise.resolve(response)
        } else {
          console.log('we got bad');
          return Promise.reject(new Error(response.statusText))
        }
      }

      function json(response) {
        return response.json();
      }

      return fetch('./img_list.json', {mode: 'no-cors'})
        .then(status)
        .then(json)
user1596138
15:12
Yeah if you can show that code also fetching the URLs inside of img_list.json I'll paypal you $5
user1596138
But if you can't you owe me $5
lol ok
venmo
user1596138
@KarelG am I missing something there?
I hate my parents more then anyone else in the world
2
user1596138
Snotty brat.
15:15
@William how about trump or hitler?
2
either way, what did they tell you?
And what did Trump and Hitler tell you? Just to know they are really worse than these two dictators!
don't flag things just because you disagree with them please kthxbye
what got flagged? -_-
William's scorn
also you people seem to be assuming that the parents are neither trump nor hitler
15:17
could have been ladybird's insult
or my mention of hiltler too
@DaveRandom good point
user1596138
Wait someone flagged me saying brat
Promise {<pending>}__proto__: Promisecatch: ƒ catch()constructor: ƒ Promise()finally: ƒ finally()then: ƒ then()Symbol(Symbol.toStringTag): "Promise"__proto__: Object[[PromiseStatus]]: "resolved"[[PromiseValue]]: Array(20)0: "https://blaslkds/california/bkg-california.jpg"1:
it resolved all 20 url's in that array
user1596138
Resolved does not mean what you think
user1596138
It didn't fetch 20 URLs lol
user1596138
15:23
Look in your network panel
user1596138
You should have 20 requests sent if what you think is happening is happening.
user1596138
And on that note I am done with this.
@towc trump is an idiot hitler everyone agreed was evil. Funnily my issues idirectly relate to hitler
parents are some of both but nobody will agree with that
your father is orange and your mother has a silly mustache?
are your parents nazis? What are you trying to say?
are you a nazi and your parents aren't ok with it?
15:28
@towc those fascists!
@LadyBird i swear to u it did
they are all in my cache no
they all preformed a get request in the network tab
⚙ bkg-california.jpg
vse-content.s3.amazonaws.com/vrd/prod/collections/california
GET	200
OK
fetch	service-worker.js:279
Script
968 KB
968 KB
1.24 s
355 ms
⚙ WDW-front.jpg
vse-content.s3.amazonaws.com/vrd/prod/collections/california/WDW
GET	200
OK
fetch	service-worker.js:279
Script
605 KB
604 KB
1.10 s
379 ms
⚙ WDW-1.jpg
vse-content.s3.amazonaws.com/vrd/prod/collections/california/WDW
GET	200
OK
fetch	service-worker.js:279
Script
679 KB
679 KB
1.08 s
357 ms
do you believe me now
Ah, another day in the majesty. The world is mine.
15:54
Hello everyone, I tell it first, I don't havo lot of skill in javascript codding, I use sometime for very simple visualisation stuff.
I would like to wrap the label for the node-tree in D3.js like this one :
http://bl.ocks.org/robschmuecker/7880033

And use thhis function create in this SO post:
https://stackoverflow.com/questions/38487512/wrapping-long-text-labels-in-d3-without-extra-new-lines

To add it in the script and wrap my label at a given character (like a comma)
What do I have to change in the wrapper function to modify my labels and work with the template that a use ? It's very s
@YoanBouzin 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.
16:40
I found some weird behavior...
In the above pen, giving the span a display: flex CSS property causes the <b> tag to remove the whitespace preceding it.
Anyone know why this is?
why would a span be display:flex
and, what whitespace?
ic
i'd assume because you're displaying an inline element within a flex element.
but you're doing something quite weird here, a weird result isn't quite unexpected.
17:12
Ignoring templates is there way to detect the line break character for the file in IE11?
?
"the file"
Current file the code is running in
Well technically it's running in the browser but the file itself has a linebreak chasracter
@KevinB it was because the span is part of material design lite's ul->li nesting
The whitespace was literally a space character, in this instance
Right, but text directly inside a display: flex element? what would you expect that to do? display: flex is meant to align elements within it using flex, it can't properly align text.
so it took the only element inside it and tried to align it... but had to also deal with the text
@William that makes no sense to me. Maybe I'm missing some context?
Yeah I agree that it was a poor decision on the part of the mdl authors. I ended up using a table layout for the drop down component that this text was going inside
not necessarily drop down but floating list component
17:31
!!s/a table.+/heroin/
@Shmiddty Yeah I agree that it was a poor decision on the part of the mdl authors. I ended up using heroin (source)
Would have been a supremely more enjoyable experience
17:47
what happened to @LadyBird
I'm having trouble figuring out how I would want to do a text highlighter w/out causing the possibility of XSS injection.
I have a function that basically is createSearchResult(result, searchTerm)
const termSearch = new RegExp((${searchTerm}), "ig");
const termHighlight = "<b class="highlight">$1</b>\";
can you get an index from new Set since they preserve order
But that causes problems when I replace because the <b> causes me to have to do an innerHTML
if I do that, whatever result is could be HTML and would be displayed/executed on the page
Any ideas?
I suppose I could split on the search term
@William wait so what happened with your parents?
instead of using a template why don't you just use an id to change the element from the javascript?
document.getElementById('highlight')
17:59
I have text and want to insert the highlight, the highlight doesn't exist in the document at this point

« first day (2831 days earlier)      last day (2339 days later) »