« first day (3268 days earlier)      last day (1694 days later) » 

12:14 AM
@AnArrayOfFunctions Heres an easier ones: Make a sync sleep function
 
 
8 hours later…
8:05 AM
@forresthopkinsa yea, i'm trying to figure out what, have tried almost 7-8 variations of that string expression so far and none work!!
 
Has anyone here heard of gitmemory.com? And if so, do you by any chance know how to contact the author of that website?
It doesn't seem to have any contact information, no about page, no copyright or anything
 
@geisterfurz007 Found this: busy.org/@iqbaladan/…
 
8:20 AM
Is that by the guy who made it though? Or is it just a blogpost for the sake of writing a blogpost? I am not sure :D
 
hard to say
but the guy who blogged it might know
if nothing else
 
Hmmm, he got a twitter account; might hit him up with a message there later. Thank you!
I guess I could also write to the domain hoster and ask them if they could pass me details, no? They probably won't but worth a shot, maybe?
 
just curious: why do you want to contact him for
 
I fucked up a commit which includes personal data that I don't want to be publicly disclosed. I have since delete that repository but I would also like that entry to be removed from gitmemory
 
ah that is yours right yes
 
8:31 AM
Yes, and it would be great if I was able to exercise it.
 
are you sure that gitmemory did not have fetched the data already?
 
what do you mean?
 
they start to crunch data on a periodic basis. I am also not sure if they do check all repo's (there are too much). If you have made a commit and removed it before gitmemory started to collect new data, then you should be safe
alas, I checked the DNS registrar. It is from a chinese DNS (web)host
 
Yeah, I didn't. It's there for quite a while now; I didn't even know that gitmemory existed until two days ago where a friend of mine told me that stuff was exposed there.
 
best to check it first yourself
 
8:37 AM
I did
 
and it does have yours info?
 
Yes
Otherwise I wouldn't try to contact the author of that website
 
😕
 
I removed the repo with that commit shortly after I got to know about it but I don't know if that is going to update sooner or later or if without any contact to them, my stuff will be there until the website breaks.
 
join them (there is a link)
and see if you can find the owner :P
 
8:41 AM
Which does not work. I tried to login with my github account to see if I can remove stuff from the page associated with my user account there but it just takes the authorization from github and you are not logged into anything.
there is no /contact, /about. There doesn't seem to be a public github or gitlab repo for it
 
9:05 AM
hey guys, anyone got experience with react.js / typescript?
 
How do I know when should I use For...in or Object.keys to iterate and object?
 
@SilverSurfer both are different things you know
for...in goes through all enumerable properties while object.keys only give you the keys
eg
mhm got called away, need to do something - brb
 
But is not this basically the same?
for(key in obj){
    console.log("Key: ", key)
    console.log("Value: ", obj[key])
}

Object.keys(obj).forEach((key)=>{
    console.log("For Each Key: ", key)
    console.log("For Each Value: ", obj[key])
})
If they do the same in this example, how to know wich one is better?
 
back
@SilverSurfer the latter. Try the same with the following
Object.prototype.something = 'something'; // please do not do this. REALLY BAD PRACTICE
const obj = {a: 1, b: 2,};

for (const item in obj) console.log(obj); // gives 'a', 'b' and 'something'

Object.keys(obj).forEach(key => console.log(key)); // gives 'a' and 'b'. Better!
Object.keys can be used if you want to filter only to get keys starting with a word
 
9:21 AM
Ok, thank you for the example
 
Object.keys(obj).filter(key => key.startsWith('book')).forEach(keyIsBook => ...)
 
can someone check this question out please? stackoverflow.com/questions/58131012/…
 
it is also in one line, making it convenient
 
And with object.entries()?
 
although I am that person that moves the .fx on new line
@SilverSurfer gives a key, value pair you can use
like
for (let [key, value] of Object.entries(obj)) {
  console.log(`my object has ${value} at key ${key}`);
}
 
9:35 AM
What could be the reason for (e instanceof UserNotFoundError) returning false if I am 100% sure I am throwing a USerNotFoundError?
 
@Nautha 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.
 
Is the capitalization a typo or not?
 
^
USerNotFoundError
 ^--- this dude
 
yes sorry, that was a typo when writing the message
 
9:50 AM
then e is not what you think what it should be.
you can verify it with e.constructor.name
(or are you doing conditional exception catching? It is non-standard AFAIK)
 
10:05 AM
mhm SO has a new CEO.
finally. I hope it is someone with good management skills
 
Would be preferrable, yah.
Although yesterday I saw a video that a CEO really only has an impact of 4-6% in a company (whatever that means but it is not much)
 
CEO's are useful for long term planning and strategical decisions.
the execution is done by lower management and they decide how. Maybe that low %. but I would take it with a grain of salt
 
Grain of salt?
Information on the interwebz is always true
no questions asked
 
Just see here if you have doubts:
 
I despise you.
 
10:15 AM
what? I thought it was good news
 
Yeah, it was just a thought that crossed my mind, that I sometimes have a very strong disliking towards you.
 
user7437554
const half = (function() {
  "use strict"; // do not change this line

  // change code below this line
  return function half(stats) {
    // use function argument destructuring
    return (stats.max + stats.min) / 2.0;
  };
  // change code above this line

})();
 
user7437554
guys would any of you help me to understand what the last () means?
 
user7437554
the code is giving me headaches :(
 
@santimirandarp that is an IIFE
= Immediately Invoked Function Expression
 
user7437554
10:30 AM
nice
 
when it reaches const half, it create a space in the memory for half and evaluates the expression after =. It is a function and is being executed immediately. The result is then "returned" to be assigned to half. Then it goes to the next statement.
 
user7437554
thanks, it just seems too complicated...
 
@geisterfurz007 oh ._.
 
Can I ask a question? Is 'use strict' always enable by default in javascript files or should I add it manually?
 
@EnderLook it is opt-in (= optional)
so the answer is no. It is not enabled by default.
 
10:43 AM
Should I always use it?
 
user7437554
don't know why they didn't write:
 
user7437554
const half = ( () => {
  "use strict";
  return (stats) => {
    return (stats.max + stats.min) / 2.0;
  };
})();
 
@EnderLook it is your choice. But that thing is just ... useless. Not all browsers follows it and it is not often convenient. It however leads to a more robust coding experience.
If you want to use strict mode for robust coding, I recommend to look for another solution: use TypeScript.
 
user7437554
instead of half=(...half()...)
 
So, should I better not use it?
 
10:47 AM
you can opt-in, but it is rarely of a good use in front-end environment. (please note that I am just saying my opinion, from my experiences with it)
 
Ok, but fo back-end environment is good? Does Nodejs cares the usage of stric?
 
10:59 AM
not sure if you are aware of that, but node has a strict mode flag
node --use_strict. But that has an impact on everything , even (external) modules you are using in the project
Node.js cares about that yes. The strict mode is also more useful in Node.js yes. But it all depends of the developer/team choice
!!afk lunchielunch
 
1 message moved to Trash can
@santimirandarp Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
user7437554
0_o
 
user7437554
I was fixing it
 
user7437554
const second = (function() {
return function byTwo(myNumber){
  return myNumber;
}
})();

let a=4;

console.log(second(a))
 
user7437554
is it the argument of second passed in the internal function byTwo? Or how is the input taken?
 
11:38 AM
@santimirandarp Try to answer this question: what does the function do?
read its body. See what it returns.
 
12:11 PM
assuming they know what an IIFE is and does
 
12:24 PM
that falls below "r-e-s-e-a-r-c-h"
(but already told it, just scroll a bit up)
 
it's too friday to scroll
 
!!mindjail
 
@Michael That didn't make much sense. Use the !!/help command to learn more.
@Michael Please go and play in the Sandbox
 
fun fact, sandbox is room 1, so it's easy to remember
 
hmm I have an urge to get some milk to eat cornflakes
 
12:44 PM
in this type of typescript syntax. is it just simply taking all values and overwriting them?
const configuredOptions = zoneOptions.map(x => ({...x}));
since the constant was just defined it essentially becomes a clone of the ZoneOptions model. correct?
 
depends on the values of x
It's not a deep clone, if that's what you're asking
 
and it's not "typescript syntax"
that's just javascript m8
 
@Cereal okay I am new to it.. will look more, but as long as I am in the ballpark I can google it. thank you
looks like this is helpful
36
A: typescript - cloning object

LarsTry this: let copy = (JSON.parse(JSON.stringify(objectToCopy))); It is a good solution until you are using very large objects or your object has unserializable properties. In order to preserve type safety you could use a copy function in the class you want to make copies from: getCopy(): You...

spread operator does the work
 
...
 
I'd recommend looking up the difference between a shallow clone, and a deep clone
 
12:53 PM
@JoJo ensure that you know the difference between "shallow" and "deep" cloning
 
And the difference between values and references
 
haha see, 2 ppl is saying this to you
 
wow!! awesome!!
will do for sure. on it now.
 
learn the heimlich maneuver
 
don't simply c/p over stuff from answers you see on SO
 
12:53 PM
it's a valuable skill to know
 
many people is doing that leading to poor quality code IMHO
 
Thanks @Cereal and @KarelG
@KarelG trust me I know.. I have had to reinvent myself after the last year of crackdown at our company. Everything must be a dive and understand it.
 
but also, learn the heimlich maneuver.
 
tbh, it should not be applied first tho.
check if the person can breathe first
no need to apply it if he's not choking. Or dead.
 
 
1 hour later…
2:04 PM
I like this creative use of .reduce stackoverflow.com/a/58135972/2412895
okay he made an edit that adds Object.defineProperty. /no-wai
 
-1
can't condone over writing native prototypes
 
user7437554
2:33 PM
when it's said DOM for document object model, does it means that all elements can be accessed by code like element.subelement.etc ?
 
user7437554
for example var checkbox = form.checkbox?
 
user7437554
sorry if it's too basic, Im just starting on these days
 
DOM is everything on the page
and everything element related
 
DOM is love, DOM is life
 
2:57 PM
Anyone have a non blocking javascript array library for iterating through large arrays? If not I'll just make my own functions
 
nope
 
just iterating?
array.forEach(async () {})
rip your computer, but it'll be async :D
 
async !== non blocking
(async () => { while(true){} })()
Async but blocking
I <strike>should</strike> gonna make my own
idk how to do strike
 
 
user7437554
4:04 PM
@rlemon but why if I type document.h2 there is no output?
 
user7437554
I supposed if document is an object type element, then it should be an element of the kind var document = element1:content, element2:content};
 
user7437554
but maybe it's nothing like that
 
yea no
some can be accessed that way, but typically you want to use the methods.
 
user7437554
4:28 PM
@KevinB
 
user7437554
thanks
 
6:02 PM
informal poll:
does working in IT give you anxiety
1) all the time
2) some of the time
3) none of the time
 
informal poll:
do polls give you anxiety?
1) yes
2) I don't think you thought this through
3) sir, this is a wendy's
 
6:42 PM
4) 20
 
6:57 PM
@JoshuaLonganecker 3
 
7:25 PM
fuck
SO is down
 
awesome, maybe they're fixing the question list
 
Kevin, can you confim its not just me?
 
it's just you
 
oh
oh wait, its working now
odd, was getting the SO is under maintenance
 
 
2 hours later…
9:56 PM
0
Q: How do I login to root after `passwd -d root`?

fhmI logged into root of a wifi device (a transceiver AP) by ssh and a password: ssh root@192.168.100.30 I needed to disable the password, so I ran passwd -d root. Now, when I run the same ssh login command it still asks for password. But neither my password nor default password of device are acc...

 
10:37 PM
guys form data method is not working with my men stack ?
 
11:10 PM
ok?
 

« first day (3268 days earlier)      last day (1694 days later) »