« first day (2489 days earlier)      last day (2444 days later) » 

6:22 AM
and what do you want that array to become? @lix
 
1
A: Merge/flatten an array of arrays in JavaScript?

ReduA Haskellesque approach function flatArray([x,...xs]){ return x ? [...Array.isArray(x) ? flatArray(x) : [x], ...flatArray(xs)] : []; } var na = [[1,2],[3,[4,5]],[6,7,[[[8],9]]],10]; fa = flatArray(na); console.log(fa);

 
I'm trying to make it so [ [{title},{title}], [{prop},{prop}] ] becomes [{title,prop},{title,prop}]
 
hi
 
@MohAdnan Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
@monners It's close but doesn't answer how I merge across
The arrays of objects all maintain the same length, so I'm trying to make it so the final array of objects all merge from the same index along
 
6:26 AM
eh monners, did you really have checked the 2nd page ? :p
that's something rare
 
so it's like you have an array of all the titles (in objects), then an array of all the props (in objects), etc. ?
 
Yeah basically there's just an object with a single property
 
how did you got that array ...
 
Well I'm parsing XML files and I created different rules that find things like the title
Those are all in promises that resolve once the rule is met or not
That's within a promise all that's left me with those arrays
 
make yourself easier by using a function and a for loop ...
 
6:30 AM
I suppose what I should do is maybe simplify my approach as the map version is probably to complex for me
 
well here's a clue, you want to end up with this i think:
Object.assign({}, arr[1][0], arr[2][0], arr[3][0], …),
Object.assign({}, arr[1][1], arr[2][1], arr[3][1], …),
Object.assign({}, arr[1][2], arr[2][2], arr[3][2], …),
 
Like I've been reading how to just merge objects
good clue
I'll get working
 
so you can use your loops, maps, whatever, to build an array like that
good luck
 
@KarelG Eh?
 
Can anyone explain what the first answer to this question means?
0
Q: issue with XMLHttpRequest - returning status of 0 on local machine and live server

Joei am having trouble getting this XMLHttpRequest to work properly, this is my first time using ajax so i'm not sure if i'm formatting everything correctly. i have looked all over the web and i keep finding basically the same info and examples but certain elements are in different orders so i'm not...

I'm neww to Javascript and am nt sure what the poster means
"You are telling XMLHTTPRequest to send the request asynchronous, which means the rest of your script gets executed while you wait for the response. You will get a reponse code 0 (uninitialized) and an empty response, because at the time you return from the function that is the current status and response.

Instead you want to define a function to call when the state changes, or let XMLHTTPRequest work synchronous."
 
6:42 AM
It means your function isn't waiting for your request to complete before continuing
 
@Cauterite Brilliant, your clue got me there thank you!
 
$.ajax({
    type: 'GET',
    url: 'mysite.com',
    crossDomain: true
    success: function (data) {
      console.log(data);
    },
    error: function (xhr, ajaxOptions, thrownError) {
      console.log(xhr.status);
    },
  });
 
@TheCoder 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
 
@lix no worries man; Object.assign is one of my favourite features :)
 
@monners Is this the function? 'function (xhr, ajaxOptions, thrownError)'?
 
6:44 AM
@TheCoder That's not the code you put in your question. $.ajax has a callback function for when the request completes
 
can you use express to grab the location of the browser, or will you need to deploy a script to do that?
 
@monners the link you've commented opens to a set of answers on page 2 of that question
I have rarely checked past page 1 (if the question has multiple pages)
 
Rookie error :P
 
@monners that's not my question
I just googled a similar question
 
Totally different.
Comments probably have it right. Server config issue
 
6:48 AM
TheCoder, jquery's ajax doesn't fire up an error if a cross domain request fails
 
Oh, so i'll never get a 404 back
even though I get 502s and 500s?
 
you get 500+ errors because the response actually came from the server
400-499 is generated by the client, it is not (always) aware of the server
since you tried a cross domain request, it has failed because of not finding a resource. jQuery then don't throw an error because XMLHttpRequest sets the state to 0 if that happens
 
Heh, I haven't used jQuery in two years
Maybe more
 
There are 4 cases when xhr sets the state to 0
 
oh
 
6:54 AM
your failed cross domain request is one of them ;)
 
Use fetch instead :D
Yay! Promises
 
it will behave the same I think :P
 
Yay! Hello.
 
@KarelG Don't think so. Would give ya a rejected promise, no?
is too lazy to google it
 
me too
 
6:58 AM
Can snoop response.status
For the code
 
How does one do a fetch?
 
@TheCoder What have you tried?
 
    $.ajax({
        crossDomain: true,
        url: url,
        data: {}
    })
 
user7110739
hi
 
7:05 AM
@Programmer21 Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
user7110739
ok
 
is is there a way to manipulate the date from date type field so that can show year only
?
 
why don't you use type="number" with min and/or max set ?
 
user7110739
new Date().getFullYear()
 
the more i know the language, the less efficient i become at figuring out someone else's code
does that happen to anyone else
 
7:15 AM
Hello Guys
 
Hi ,

Can anyone help me with service workers
https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification
 
Hello, a question about computed value from -- Mozilla web docs: If the "specified value" change, would the "computed value" change? i.e. if the computed value is percentage of its container size.
 
I want to close the Push Notification afters 5 seconds
I can't see any option to close it
 
anyone around?
 
44
A: Raising the 25 chars limit for tags

Shog9Thunderforge makes a compelling argument that the tag length limit should be longer than 25 characters. Tim and animuson are quite right that shorter tags are generally better; regardless, supporting arbitrarily long tag names is out of the question for the foreseeable future - there are too man...

Shiny!
 
7:26 AM
Ok, a shorter version of my question: is computed value static? or it's responsive for mobile?
 
yes shinny
@N1ng I believe its responsive. Depends what your asking.
 
Got it, thank you:)
 
getComputedStyle you mean?
 
@N1ng "computed value" is just the value that the browser thinks a property is equal after resolving things like inherit and initial
It has nothing to do with responsiveness.
 
Hello Guys
I'm new for ionic and have same issue like
1
Q: Ionic drop-down display on wrong position when keyboard hide

JohntyI'm developing one application in ionic. Working good but issue occurs in iPad and Tablet only. Issue: In the app there is one form and in that form, there is one TextField that have display selection box (like dropdown). It's working good but If we are on another TextField and Keyboard is open ...

Anybody can help me on that?
 
7:35 AM
For example: Say I have a <div>, and I want it to inherit the height of <body>. But since the <body> contains the <div>, what is the height of the <div>?
 
> I just tried to add a tag for "implementation-defined-behavior"
why?
 
@N1ng They would both be auto if you do nothing
inherit doesn't necessarily imply it would be the same height
Just the same property value
 
hey guys
im doing this bash script that reads ping requests and prints out to text file
however, i get just this line in my ping requests.
ping -t $IPADD | while read pong; do echo "$(date): $pong"; done > ${SERVER}${IPADD}${FILEFORMAT} &
`Wed, Aug 09, 2017 3:40:21 PM: Ping request could not find host 199.59.149.230
. Please check the name and try again.`
 
I'm not sure if you are in the best room for this
 
i see. i thought people would do bash here.
do you know which room to ask?
 
7:42 AM
unix.stackexchange.com is probably the best bet
 
haha
Here's me trying to talk to a man in a car seat costume @nbcwashington https://t.co/e5humOM7uS
 
@William thanks :)
 
No, the height of <body> is 717px, and the <div> inside it is also 717px, but there are still other tags inside the <body>, wt...?
I use inherit to the height of <div>
 
someone here that may could help me to understand where my mistake is in using "rows.cells.item.innerHTML.length;" ? returns error Cannot read property 'innerHTML' of null... but this error makes no sense to me :/
 
@CrissCrossCrass Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
7:54 AM
So the height of background image of <div> is not included to <body>'s?
 
@CrissCrossCrass There is no rows.cells.item
@N1ng Yes
The size of your desktop wallpaper also doesn't make your screen bigger
 
Oh no. All those Disney movies I never watched!
 
@OliverSalzburg pff, grownup.
 
@OliverSalzburg thanks! But that makes no sense for me either xD because i use this line also for another process in the same function to count basically empty cells.. like if (checkCellValue < 1 ){countingEmptyCells++;} and there it working somehow... or is it working because there arent any empty values? :O
 
8:00 AM
console log it and see
 
@CrissCrossCrass I don't see any relation between that code and what you previously showed
Also, just because a given combination of symbols works in one location, does not mean it will have the same effect in another location
So the reasoning isn't clear to me regardless
 
1 message moved to Trash can
@CrissCrossCrass Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
That is completely different from what you were asking about initially
 
@OliverSalzburg ah damn.. sorry :/
 
I need to go to a meeting
 
8:05 AM
@OliverSalzburg alright, if you could check out later, my thanks will hug you forever :D
 
Firefox is more debug-friendly than Safari.
 
hello all
 
8:21 AM
i saw my to be boss at the urinal..he asked how i am. i smiled like a stupid fuck and sais hey. he walked away with a straight face
is it bad..
 
Depends on the sexual orientation of the people involved, I guess.
 
you don't talk when using an urinal
 
not when using it
like when we were done
i just cant say the right things
 
so you're saying wrong things then ?
 
i say nothing and smile
which is probably the wrong thing
 
8:26 AM
I've got a line chart in d3 in which I set the height of the y-axis based on the largest data point in the data source. This works fine, but I have a couple of user inputs which can change the graph and I'm supposed to show how different things affect my plot. The problem with using a dynamic axis is now you cannot visualise the plots moving up and down, instead the axis is shifting. Is there another approach I could take?
 
Hi is there a way to add "," for every data I select in select tag?
Select tag:
    <label>MACHINE</label>
	<select id="test" multiple class="form-control selectpicker">
		<option>D10</option>
		<option>D13</option>
		<option>D14</option>
		<option>D15</option>
	</select>
 
Loop through the select and append
 
jquery:
$("#submit").click(function(){

			alert($( "#test option:selected" ).text())

		});
@Daruchini ay, i mean when I hit the submit button, i wanted to insert the selected valuesto array indexes
found the solution, i can't find the right word to say what i rlly needed. "Separator" is the exact word haha. jsfiddle.net/AcfUz
 
8:44 AM
Hey all - A question on Angular
I do have the following
<input type="text" ng-disabled="isAuthorized == false">
and on page load isAuthorized is always false but this condition does not disable the text box - but after some executions this ng-disabled expression works and disables the text box. On the other hand if I have <input type="text" ng-disabled="!isAuthorized"> this works on page load
 
@IshamMohamed Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
@EarvinNillCastillo uhm ... tbf you can get all selected indexes by just calling .val()
 
@CapricaSix thanks :)
 
!! afk 👮
 
@IshamMohamed Are you sure isAuthorized isn't a string?
 
9:03 AM
@RachelDockter huh? you pinged me
what do you mean?
 
Whatcha think?
 
o/
 
\o
italics become you, @GNi33
 
yes, yes, my evil plan is slowly taking shape
been skimming through the mod repo for a bit, there's a lot of stuff I seemed to have missed over the last months
 
@MadaraUchiha in soviet Italy .... :)
 
9:16 AM
@BenFortune its a boolean
 
Also, avoid loose equals.
 
9:28 AM
why does chrome not have a mute option when a tab is playing sound... it only shows that a sound is playing
firefox has it
 
such a slow day it's going
 
It does, for me.
 
@BenFortune ah. thanks .But why not make the sound icon clickable ? More easier
 
@KarelG isn't there like a lil speaker on the tab? Or is it FF? Can't remember am on phone
 
9:32 AM
it only shows the speaker, but you cannot interact with it. Apparently you have to rightmouse click it to mute it. (thanks again ben)
 
Hi
 
@kavigun Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
hmmmm ok
 
hello caprica
!!bigcat
 
9:37 AM
!!caprica
 
lol
 
haha
i dont know
 
he is sleepy
 
yep
 
9:38 AM
@KarelG there has been some discussion about this when they introduced it
 
aynhow
 
!!is @rlemon is BAD Horse or Good Horse?
 
bye
 
@ChewCat Good Horse
 
ok bye
@Hans1984
 
9:39 AM
...
 
9:52 AM
is it considered bad form in open source to squash and merge commits (losing the contributors name)
 
on the upstream repo?
that is considered a bad form in general
because you'll break all the existing local repositories
or are you talking about merging a branch or something like that?
 
merging a PR
if I squash it marks me as the contributer
 
don't squash it then
maybe squash some of their contributions
 
I don't think you can do that
 
if they submitted a lot of tiny commits, maybe squash some of them
 
10:01 AM
its all or nothing
 
but be sure to keep them (the author) in the history
 
from the github UI
 
not sure about that
in that case I'd just merge it
 
Git blame will still show the original contributor though wouldn't it?
 
10:02 AM
without squashing. helpful PRs should be recognized and part of the repo
I'd think so as well, yeah
 
@SuperUberDuper you can use git merge --squash <branch>
it squashes and keeps history
not sure if you can do this through your UI though
 
how does it keep history though?
I mean, isn't it basically the same as rebase -i without the manual steps in between?
 
10:22 AM
it performs a merge w/o performing a commit or moving the HEAD
 
yes?
 
I had to look up first. A small difference is that when you're using rebase, the reference is stored in reflog but can be gc'ed later. While it doesn't occur at merge command
 
the slovak girl came here today
it was great
@KamilSolecki there was this vegetarian friend from the UK, so in the end we had a breakfast with oats, yoghurt, grapes, blueberries and bananas
 
wohoo
nice!
 
@towc did you bang?
 
10:27 AM
it was really easy to do, kind of a disappointment, but tasted great
3
 
@BenFortune base 5: booty bang.
 
and she seemed to actually enjoy spending time with me
well, somewhat
she's just so great
@BenFortune we did it upside down under the kitchen sink
a three way
thank you guys. I love context. You should too
 
@BenFortune after you wrote that I imagined him running around her going "can I smash?"
 
!!urban smash
anyone running backups on cap btw? Been a while since I saw one
 
!!backup
 
10:30 AM
@BenFortune Donna Noble has left The Library. Donna Noble has been saved.
 
ah, it was "lemme smash"
all those memes are so freakin horrible
 
last night I had the UK friend (also a female) and I binge watched some rick and morty because she had never seen it
so that was nice
then I revealed that I need to do some work while she gets some sleep
and she was like "nope, I'm staying up with you"
which was also nice, although completely not needed
 
DUDE SHE WAN SUM FUK
 
she asked if she could watch the screen as I do my vimming and devtooling
which was kinda unnerving because I actually had to spend a lot of time staring at my screen myself without typing anything, had to think a lot
and I was like "I'm so sorry if it looks like I'm not doing anything"
and then the spelling mistakes
long story short, she fell asleep and woke up every like half an hour
until about 2am
 
@towc you're on the starboard mate :D
 
10:34 AM
and this was all in a double bed
then we just fell asleep in the same bed and it was kinda funny how awkward/weird it was, but how little we cared
 
> and I was like "I'm so sorry if it looks like I'm not doing anything"
> long story short, she fell asleep and woke up every like half an hour
> until about 2am
> and this was all in a double bed
> then we just fell asleep in the same bed and it was kinda funny how awkward/weird it was, but how little we cared
 
the plan then was to wake up at 7am to go for a run. My objective was to make sure we were both well awake when the slovak girl would have come
 
Owl Carousel 2 having 3 slides move from 1 to 2 automatically but not further. loop and autoplay are true
 
towc please reread what you just said
and go smash please
 
10:36 AM
in the end, we spent about 30 mins after waking up looking for a printer for her flight tickets
and no run
just had a shower, then met up with the slovak girl (I actually started crying of happiness right before seeing her. It was really nice)
@KamilSolecki :P
 
any suggestion?
 
if anything what you said is true (which I think so) then you missed the easiest fun time of your life.
 
my next novel: an erotica story that turns out to never have actually involved anything sexual, but was actually about watering plants
 
oops a mistake. Clipboard not doing freat
 
@KamilSolecki nah, I respect the UK friend a lot, and I seriously don't really even consider having sex with other girls than the slovak one
 
10:39 AM
:38575036 are you getting any errors in the console? did you check if the markp is correct?
 
and I swear it's not like I keep thinking about having sex with the SK one. She's really really pretty and hot and everything, but that's not why I like her so much, and not what I think about when I think about her
 
@towc it was totally different last week :DDDD
 
@GNi33 no error.
 
@KamilSolecki wut wut?
 
$('.owl-carousel').owlCarousel({"nav":false,"dots":true,"items":1,"slideSpeed":500,"seconds":500,"lazyLoad":true,"margin":0,"stagePadding":0,"smartSpeed":150,"loop":true,"animateIn":"flipInX","autoplay":true});
this is the script
stuck at 2nd slide
 
10:40 AM
> having 3 slides
> "items":1
 
@SoMeUsEr you'll need to provide a running example. with that description pretty much all we can do is guess
 
also loop not working if there is only 2 slides
 
@SoMeUsEr if you want jQuery help, ask in the PHP room
it's kind of weird the way it works
this is JavaScript
 
@towc nah python room is better
 
omg is this tobiq/vapor?
 
10:41 AM
@towc Give up
Sagar V
 
I haven't seen vapor in a while
it's nice
 
@BenFortune yes
 
I'm so happy right now :D
 
how you got it
 
@BenFortune I think that option determines how many items" it shows in one "slide"
 
10:42 AM
@GNi33 yes
 
almost anything could make me so unhappy
I'll just stay away from the rest of the world until the happiness goes away by itself
 
@GNi33 Yeah, just checked the docs.
 
@BenFortune It can be set to 2 to show 2 slides at a time
 
like I said, without a running example (e.g. one on jsfiddle or something like it), this will be too much guesswork
 
wait
 
10:49 AM
did someone have tried to use .bind on an anonymous click event handler ?
// in a function body
this.container = element
this.listenToClick = false; // will be toggled elsewhere
window.addEventListener('click', function() {
 if (this.listenToClick) {
   // use this.container
 }
});
 
@KarelG function (){}.bind(this)
 
(function (){}).bind(this)
 
() => {}
 
@GNi33 in that, you can navigate to slide 3 by clicking the dot but it doesn't take you automatically
 
10:57 AM
client doesn't want to use webpack
:|
nobody of my team wants to work on this
 
!!s/client/idiot/
 
@jAndy idiot doesn't want to use webpack (source)
 
so had to resist to not use => each time D: (because he wants to use it later himself)
 
Babel + gulp
It's not webpack:p
 
he just doesn't want adopt to the new ES syntax. I cringed a bit
 

« first day (2489 days earlier)      last day (2444 days later) »