« first day (2685 days earlier)      last day (2488 days later) » 

10:00
yesterday, by Neoares
they don't have personality nor feelings
I was talking about animals
me too
are you assuming she's an animal?
that's the point
10:01
I don't share your point
This is sounding creppy a - f
well, I'm going to keep nagging you about it then
it's fine for me
@ShrekOverflow wait how
2 mins ago, by towc
does she have a soul?
out of context gave me the chills
kinda like when Superman asked Batman "Do you bleed?" in the new Justice League movie
10:06
TIL there are "countries" that operates in a UTC+14 timezone
had to fix a bug
thought boundaries was [-12, +12]
10:18
Nop @ShrekOverflow that's my bestfriend and we are working on same project from last 1 year
@ShrekOverflow because Main got banned
cc @MadaraUchiha someone might be wearing socks today
If you are unclear with that question then I will be happy to make you clear
I hate this world, I am gonna go hit the swamp
@ShrekOverflow is that swamp not on the same "world" you hate?
10:29
@KarelG its dreamland T_T
ofcourse its not
maybe i came too strong there, I should rephrase it as
I hate vampire realm 😉
:P
I do not tho
got sucked by a vamp before ( Í¡° ͜ʖ Í¡°)
@ShrekOverflow wasn't it trollnation?
@Neoares TrollNation is still the same 😛
I just avoid it as much as possible
Why does process.exit kill my batch-script I run using child_process.spawn with detached: true?
Anyone experienced this before?
10:45
what are you talking about
@Neoares forking a process
@geisterfurz007 what is the code you are returning it with?
also, is there anything else that the event loop should bother running for after your child is dead ?
If there is nothing remaining in the node eventloop after the child the parent will exit.
@rlemon @KendallFrey @Loktar @FlorianMargaine
:41336614 I run the script to start a new instance of the server and then terminate the old one. The batch script has a built in delay of 3 seconds to make sure the previous node process is down. So I thought

spawn(somethingSomething);
process.exit();

Should run the batch script (as said I use detached: true in the options for spawn) eventhough the node process is killed after.
10:50
with batch script you mean windows .bat?
that's so off-topic lol xD
more off-topic than memes
would anyone know why im getting the error "cant read contains of undefined" but when i console log it, it is definied
	$(".card").click(function(event){
		var card = jQuery(this);
		console.log(card);
		if ((!gamePaused) && (!card.classList.contains('matched'))
Why? It's node.js @Neoares
I am not talking about how to write a batch script. I am talking about how to run it fully detached from node
ok
now we're talking
10:52
@Neoares u wot
@RachelDockter classList is undefined
@KamilSolecki idk he told me it was windows batch
Memes aren't off topic
and windows is more off-topic than memes here :D
well, you got the point then
Memes live in thy heart
in your kokoro
10:53
@Neoares oh yeh i had to put card[0].classList, ty
@RachelDockter you are using classList on a jQuery object
it does not have it. using [0] gives you an element which has that property
just explaining :)
im not sure i understand
var card = jQuery(this) -> card is a jQuery object
card[0] -> converted to pure JS object
that object does not have .classList thus leading to undefined.
10:55
https://paste.ofcode.org/qR7CwFuE3Piebyuay48iSQ Is the code I have. But running that will not run the batch-file. No window opens and the code in it there is not executed eventhough I specified detached: true.
In the docs it reads "On Windows, setting options.detached to true makes it possible for the child process to continue running after the parent exits." But that does not seem to be what happens.
but instead you can just get the card with pure JS
or if you want to use jQuery (I don't see the point of it) just use the equivalent of "classList" in jQuery
card[0] gives you the node element that the jquery object holds. that has .classList which do give you a value
oh i get u, would u suggest getting it with pure js and not jquery?
so i wouldnt have to use [0]
right, ill find out how to do that
thanks
10:58
document.querySelector(".card").addEventListener(function(e) {
    ...
});
by the way, if your .card element is unique, use an ID
thanks, its not theres loads of them and the id containers the card number
so i would then use e.target.id ?
also apparently 2 arguments are required
oh yes sorry let me update the code
document.querySelector(".card").addEventListener("click", function(e) {
    ...
});
I forgot the event :D
boo @ double quotes for strings
but yes, if you have multiple .class elements, querySelector will get the first one
so you may want to expand the query
depending on how is your HTML
@KarelG what's the problem (actually I usually use single quotes)
"quotemark": [true, "single", "avoid-escape", "avoid-template"]
Pls
11:02
is that why e.target.id is returning blank?
i want to get the id of the one that was clicked
@RachelDockter if it's returning undefined it's because the element doesn't have an ID
it does
	$(".card").click(function(event){
		var card = jQuery(this);
		console.log(card.attr('id'));
returns the id of 1
when i click the div, both run but only the jquery one returns the id
and the js one returns ""
I'm not sure but maybe jQuery does multiple event asignation
since with $(".card") you're getting ALL the elements with class "card"
with querySelector you only get the first one
yeh i think that would be it
document.addEventListener('click', function(e) {
    if(e.target.classList.includes('card')) {
        console.log(e.target.id);
    }
});
Don't use ids to store data though, use data attributes
11:06
@BenFortune wtf
oh!
does that work always?
why not ?
but I do not like that tbf
that's what I'm trying to figure out
neither me
then you are handling all click events
yes, despite you're only creating 1 handler
the code isnt going into the if statment
im gonna look at data attributes
11:08
what do you mean with that?
im not sure of the difference
if(e.target.classList.includes('card')) {
that bit, apparently it doesnt include it because its not going in
Got my shit mixed up, it's contains not includes
ah right string prototype
:P
you got undefined
> The Node.contains() method returns a Boolean value indicating whether a node is a descendant of a given node, i.e. the node itself, one of its direct children (childNodes), one of the children's direct children, and so on.
even console.log(e) and i find classList, its blank
which is strange
11:09
oh wait it's not a node
inside e.target?
It should be
e -> target -> classList yeh
its lengh is 0
why ben? it has a class assigned to it
you get a '' (empty string)
Show us your HTML
yeah, do a jsfiddle or something
11:10
the html is built in the js
one second
Well then you need event delegation anyway if you're dynamically adding it
oh is that why
should i just stick with the jquery [0] method lol
yes
cus you do not understand it very well
best to not waste time if you do not have enough time
still, jQuery should not be used nowadays unless you are maintaining code or doing dynamic UI appearances like slideIn/Out
11:13
ill just make a jsfiddle 1 sec
I kind of hate the e.target pattern
I kind of hate you
you should already know what the element is
How? When you haven't attached a handler to it?
if you're using e.target, I should be able to assume that you don't know what the element is, and that can tell me a lot more about what your code is doing
11:15
@towc As I posted above, what about event delegation?
Are you suggesting things like attaching event handlers to probably thousands of elements? As they come in?
e is the event object ...
I'm under the opinion that you should have an internal system to represent the elements and make them act accordingly anyway
you can replace it with this but whatever
We do, with e.target
@BenFortune oh well, that's a somewhat specific scenario
11:16
...
but yeah, good point
thats it but its not working i think its because of the jquery
did you already have figured out your egg-problem?
@towc Not really, it's extremely common in any dynamic application
11:17
var cards = cardsList.concat(cardsList); ??
hmm, I learnt something today
that makes a lot of sense
a centralized listener for each event and then using the e.target
I can understand that
yeh because its a matching card game so i need 2 of each card
so i concat the list of cards
it works locally
but I often see e.target being used in react, where there's a specific event handler for that element. Or does react abstract it out automatically?
I can't really imagine it doing that
oh in the jsfiddle i declared cardList after i try concat it
insideDiv.setAttribute('class', 'inside'); is wrong on many levels btw
11:19
Why are you mixing so much jQuery with standard methods? If you're already using jQuery, use it properly
It's all fucking wrong
why not insideDiv.classList = 'inside'?
and also what ben said
@KarelG .add
im swaying towards pure js and only jquery for the animation
sorry :S
then define animation functions and use jquery there
11:21
> use jquery
i was up to the click events which is where i got stuck
> boo @ double quotes for strings
but still recommending jquery
boo @ karelG
like function flip(cardElement) { // put cardElement in jquery object and use jquery animation tools }
ok 1 sec
i changed the code to add a class to the class list instead of the way i did it
oh nice, the new npm design: preview.npmjs.com/package/express
11:24
someone said i should use data-id to store values
on this - cardDiv.id = cards[i].id;
@towc yay more colors!
best to read more about data attributes
cardDiv.setAttribute('data-id' , cards[i].id);
yeh
cardDiv.dataset.id = 'eee'
is that all just down to personal prefrance?
or is one more right
11:29
<div class="person"  data-group="teacher"><div>
<div class="person"  data-group="student"><div>
<div class="person"  data-group="student"><div>

document.querySelectorAll('.person').forEach(person => console.log( (person.dataset.group === 'student' ? 'S is a possible victim' : 'T can be mad')  ))
thats given me the best idea
with that
actually no wait i need to use classes
eg select all students only
because of the css
11:31
document.querySelectorAll('.person [data-group="student"]')
the data attributes are used to identify elements
or as a meta-data
ohh i never knew this
eg students have their own student id
you can then use
<div class="person"  data-group="student" data-student-id="11"><div>
<div class="person"  data-group="student" data-student-id="53"><div>
but please do not abuse it
i have seen cases where someone populated data attributes with 5+ different meta-data. (most one was 11 (!) )
haha is that bad because of how confusing it can get
11:34
clutter :P
11:45
suddenly my web app is redirecting to itself all the time
in an infinite loop
Guys which is most reliable free web-hosting.... mainly I want free database to use for my node application??
none
Free and reliable don't mix
You can try heroku
+1 for heroku
ive used heroku, its really good
It's average, and massively overpriced
11:56
i uploaded a game on it yesterday in fact, if u need help uploading ur site i can help u cuz i had alot of trouble first time
if it's just a db and you don't mind it being leaked, you can try using google spreadsheets :P
I tried to use google fire base with php but I failed so I want mysql
@BenFortune then why do you recommend it
he wants a free thing
nothing is free
Ben wants to break free
12:00
$(".picked").removeClass("picked");

does this scroll through every element, and if an element contains the class 'picked' it removes that class?
im not too familier with jquery
I have my 2 website with paid hosting package but sometimes free is also essential @KarelG
@RachelDockter you know, you can try it :P
it does yes
well i did try it but its not removing it if the element has additional classes after it
so i wasnt sure
might be code elsewhere preventing it
@BenjaminGruenbaum when/where?
@Zirak I can take you if you need
Hello
for an uber like application for cab booking is there any alternative at place of sockets to get similar output
brainstorming on the idea, I would love to use something other than it, if possible
12:17
Hey people, I have a very very simple image lazy loader and as soon as I make an ajax call just returning some html, the lazy loader no longer works. any ideas why? here's a fiddle, but can't replicate the problem there: jsfiddle.net/m6995ad8/8 but you can see the code i'm using for the lazy loader.
@GandalftheWhite what exactly do you mean?
12:34
@GandalftheWhite what does cab-booking have to do with sockets exactly?
I am trying to fetch some data from some website, and want to send it as SSE response and also want to save it in some file in the format {timestamp: fetchedData}. So I wrote this code
const sseResponse = getSSEResponseStreamSomehow()

function fetchData() {
	http.get("http://www.abc.com/path", res => {
		call1(res)
		call2(res)
	})
}

function call1(data) {
	const writer = fs.createWriteStream("filename.json")
	writer.write(`{${String(new Date())}: `)
	data.pipe(writer, {end: false})
	data
	.on('end', () => { writer.write('}') })
	.on('error', err => log.error(err))
}

function call2(readStream) {
	res.write("data: ")
	readStream.pipe(res, {end: false})
	readStream
	.on('end', () => res.write("\n\n"))
and the question is ... ?
Sending data to SSE works fine but in file, the entry is saved as {timestamp: partial_data
Note: the } is also not coming in file
Can you tell me what is the correct way to do this?
just on the first sight:
sometimes the entry in file is saved as : {timestamp:
thats all
12:40
you are piping without an end
then listen to an end event without a fire up
yes, so that I can write "}" after the stream completes
ohhhh
so how should I append it?
Basically how can I do this whole thing, can you tell me?
and BTW that's actually not gonna fire end event for writable stream, instead of readable so this is correct
13:09
No help today :(
it's festive in Canada?
tried a sample. It works fine if the both write streams are fs writestreams, don't know what's wrong if I use one fs writestream and one sse response as writestream
13:30
would anyone be able to help me vertically center this image, i tried vertical-allign: middle but that doesnt do anything
use inline-block
Flexbox
on the image? that doesnt work either
i was just about to try flexbox
sweet flexbox works nice
yes, using flex is a simpler approac
@RachelDockter if you don't want to use flexbox for some reason, position: relative; top: 50%; transform: translateY(-50%);
13:45
@RachelDockter flexbox is magic
!!magic2
thanks i just ended up using flexbox, seems to work good
it works like a charm
huh, didn't realize there was another launch today:
Today’s Falcon launch carries 2 SpaceX test satellites for global broadband. If successful, Starlink constellation will serve least served.
@KendallFrey you know about this?
I do now
13:46
it's like going to space is a thing people do every 2 weeks
is there gonna be another live stream
i missed the first one
this is just the falcon 9, not the heavy
stream starts in 30 mins
PAZ
that's peace in spanish
does elon musk have a personality and emotions? Oh wait
he doesn't have something...
how it was called
13:49
@towc it's a lot more often than that and always has been
@Mosho I've been missing out then
they just don't all tweet about it
0:
canada fucking stole the game
the game?
@jAndy turns out you never lost it. Canada stole it
good news
(I'm assuming we're actually talking about hockey)
13:52
in this case no
curling
I'm switching to the hockey game now :)
oh nice! You watch curling?
I do at the olympics
oh, I haven't managed to watch any of the events yet :/
oh it's the third period already :(
I'm planning to tune in to some curling after this bout of watching paint dry
13:56
@Mosho don't miss out.. I also heard there's going to be the cement drying event
cement doesn't dry; it cures
wat?!
@KendallFrey that a fact?
think so
For example, cement still cures underwater
craziness
13:57
ok guys we got a canadian
@KendallFrey it's festive or something?
physics is like a cheez doodle
@Neoares what's festive?
hm...
holiday
festive day
no
I feasted last night though :)
someone's done the crypto scam again on one of elon's comments: twitter.com/MaryoriSantiag1/status/966300247080210432
kinda different
I know that underwater rivers exist, but it still boggles my mind
13:59
is spacex launching a rocket today?
> SpaceX is targeting a Falcon 9 launch of the PAZ satellite to low-Earth orbit on Wednesday, February 21
oh god

« first day (2685 days earlier)      last day (2488 days later) »