« first day (3550 days earlier)      last day (1381 days later) » 

1:30 AM
@user33276346 theres multiple answers here
> when I copy a text with a link embedded if I copy it in a Notepad I only get the link. But in some other places you get the text with the link.
this could be the next answer, or the app maybe auto hyperlinking links
> What do I actually have in my clipboard?
This is a complex topic so I'll point you here --> en.wikipedia.org/wiki/Clipboard_(computing)
> I want to send to my clipboard the text with the link embedded using JS, is that possible?
Take a look here:
|| mdn ClipboardEvent.clipboardData
 
Invalid command! Did you mean: 3, d, ^? Try help for a list of available commands..‍.‍.‍
 
2:08 AM
@JBis thanks for orienting me!
 
 
7 hours later…
8:44 AM
This is a basic question but why promise continue to execute even after rejecting?
I've a firebase function with following structure
entry point
   - some conditions
        -reject
   - add data to firestore
When I send an invalid request, it is rejecting the execution and at the same time, the data is getting added to firestore.
The structure is like
if(condition){
    //reject
}
//insert to db
DB insertion is not written inside else block
 
a reject doesnt return tho
afaik
looking at the comments, perhaps you should do
if (condition) {
    return reject(...)
}
 
Yup. noticed that comment
oops!! now I've to edit my 40+ mutations
 
which... appears to have identical behavior to
 
Thanks for the link
 
if (condition) {
    reject(...);
    return;
}
but im not sure that is very nice
 
9:10 AM
why do you think it's not good?
 
9:31 AM
I just prefer return reject();
mostly for subtle reasons and preferences
 
 
4 hours later…
1:39 PM
Whats the best way to get the full id based on a partial id? For example, if the id is "length-a-30" and I want to search for "[id^=length-a]" so that I can get 30 back
 
1:54 PM
@Nika An HTML id attribute?
 
2:07 PM
@VLAZ Yes
 
Then yes, you can just use ` "[id^=length-a]"` as a selector and then get what it matches.
If you have multiple things with length-a-<something> as IDs, you'd need to use querySelectorAll. If you use jQuery you can just use that instead.
 
But doesn't querySelectorAll select the whole thing?
@VLAZ in the console it shows up as [<script id="length-a">]
 
2:26 PM
Does anyone know why I'm getting the error when passing the output of an earlier function, which is a 2D array, into another function, which does a spread operator on the variable, get me a "Object is not iterable" error? I got this in my web browser and I cannot replicate it even when passing in the same 2D array to the same function running on my local machine.
 
@Nika Seems like you have a single thing that matches that selector and it's a script. Check the example I have above - it does match all three items with the given ID. Either the ID you're looking up is incorrect or the script runs before the HTML you're trying to lookup exists.
@PrashinJeevaganth If you're getting "object is not iterable", then you have to check the value you're trying to spread. It's likely either null/undefined or something like a number.
||> a = 5; console.log(...a)
 
@VLAZ "TypeError: Found non-callable @@iterator" Logged: `` Took: 0ms
 
It might be the same error but in different words
||> a = null; console.log(...a)
 
@VLAZ "TypeError: console.log is not iterable (cannot read property Symbol(Symbol.iterator))" Logged: `` Took: 0ms
 
@VLAZ I've attached the printout in my code snippet, it's a 2D array and all elements are either strings or floats, nothing is null in there
 
2:29 PM
Oh wow. That's actually a bug in V8 there. The part of the message "is not iterable" is correct but it's saying console.log as the target.
You should probably log the value inside the combine_arrays_with_frequency_toggle function, just to make sure it's not some random different call to it that's causing the issue. Also, try to make sure there isn't anything that's overriding the @@iterator key. Try checking console.log(incoming_array[Symbol.iterator]) also exists.
 
@VLAZ Hmm just did that and it gave me an array on the object causing that error. However console.log(incoming_array[Symbol.iterator]) gives me undefined
Are arrays not supposed to be iterable by default? Don't know why the web is giving me a different result
 
2:55 PM
@PrashinJeevaganth Arrays are iterable. Perhaps what you're getting is not an array - try Array.isArray(incoming_array) to verify. You might be getting an array-like object instead.
 
3:05 PM
@VLAZ Ok I see
https://paste.ofcode.org/nyjExbdpGvgHhwAzjiKUkK

Does anyone know how to make my make my callback function return the correct non-empty array correctly? I tried console.logging and all the items are stored correctly into the object
 
 
1 hour later…
4:25 PM
||> (...a)
 
@JBis "SyntaxError: Unexpected token '...'" Logged: `` Took: 1ms
 
||>a = null; [...a]
 
@JBis "ReferenceError: a is not defined" Logged: `` Took: 1ms
@JBis "TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))" Logged: `` Took: 1ms
 
interesting
 
 
1 hour later…
5:29 PM
I want to work on a babel issue but I don't know how to add a test. I have downloaded the repository and have run some initial commands on GitBash. (I have asked this question on babel slack discussion but none has responded yet, that why I am asking it here).
 
 
2 hours later…
7:44 PM
anyone have a second to test something out?
 
7:54 PM
show it?
Also: does anyone know about the development of express 5? It's been in alpha for 3 (or 4?) years already... Has it been stalled indefinitelly?
 
I'm trying to test and understand some network stuff
What do you think?
 
First impression? -- What's the entry point of that?
 
there isn't, its just 3 scripts
 
makes "run this" kind of ambigious
 
@paul23 still seems active github.com/expressjs/express/tree/5.0
maybe not enough changes for them to release a new version
@paul23 I can tell you what it will do
 
8:02 PM
Well how should I "run it" or what should I look for :P
 
node clientB.js
after git cloneing it
if you are ok doing it, i'll tell you when to run
 
sure..
btw I take it is just "test throwaway code". Otherwise things like
function readStuffFromCommandLineAndSendToB () {
	if(!tunnelSocket) return;

	rl.question('Say something to B:', function (stuff) {
		tunnelSocket.write(stuff);
		readStuffFromCommandLineAndSendToB();
	});
}
 
i didnt write it, its just for testing
do you have discord by any chance?
 
You really shouldn't do: a recursive "wait" function is begging to have a stackoverflow, and it's hard to debug. This would be perfect for an event system though.
not on this os
 
ok
You need to change the ip in the script here --> github.com/SamDecrock/node-tcp-hole-punching/blob/master/…
to: "108.54.79.87"
lmk when thats done
 
8:08 PM
done :P
paul@paul-GP60-2QF:~/WebstormProjects/node-tcp-hole-punching$ node clientB.js
> (B->S) connecting to S
> (B->S) connected to S via 192.168.0.203 33192
 
wait
cancel the script
i'll tell you when run
ok, run it now
did you run it?
 
now I did
few errors
 
what errors?
 
put them in another room to not spam here :P
Btw some general programming "mistake" I see that might hurt you if you would ever do it. The code has something like:
socketToS = x.createConnection({host : addressOfS, port : portOfS}, function () {
    // blabla
    foo(socketTos);
});
socketTos is used inside a callback to the createConnection. But this might really break things, since socketTos is only set after createConnection concludes the function might see "undefined".
This doesn't happen in this case - the callback isn't called directly but at a later point. But if the createConnection would somehow call the callback/lambda directly it breaks. This can be considered more easily by using the following:
socketTos = x.createConnection(socketTos);
Should be obvious there that it "won't work as expected"
 
 
1 hour later…
9:43 PM
It really really worries me that after all this time there is still no ORM which is as polished/flexible as C#'s entity framework.. Or python's sqlalchemy.
 
10:04 PM
0
Q: Set file-input file from url

SuisseI have a file input: <input type="file" id="myImageInput" accept="image/*"> I have a preview img: <img src="http://myImageUrl" id="myImagePreview"> I want to set the image as a file for the file-input#myImageInput. What I try: Create Base64 from the img#myImagePreview: function toDataUrl(ur...

 

« first day (3550 days earlier)      last day (1381 days later) »