« first day (3286 days earlier)      last day (1645 days later) » 

12:16 AM
@VadimKim Not sure if its applicable but you may be able to use Electron. You can access node in the browser with that.
 
12:41 AM
anyone can help me
with friendly URL in angular?
0
Q: Adding a friendly Url in Dynamic Views of Angular8 to use SEO

Leonel Tasso Guimaraesi'm using Angular routing to switch between views. My version of Angular is "@angular/core": "~8.0.0" This is how it's done today: www.mywebsite.com.br/#/ When i chose some view, i load a data from the server to show the info, and the URL look's like this: www.mywebsite.com.br/#/course/1 ...

 
1:25 AM
morn
 
 
3 hours later…
4:10 AM
Can anyone explain "why" so? The code I linked to logs false: https://repl.it/repls/AssuredFilthyMp3

Why no api to test if object has property?
irrespective of inheritance...
 
Hello @deostroll
 
...and what is happening here...in the code paste
 
 
1 hour later…
5:17 AM
@deostroll You are not using the method correctly. You should use car.hasOwnProperty('model'). MDN Docs
 
@geisterfurz007 right!! I missed that part.
 
There is even more stuff on the topic here :)
 
 
1 hour later…
6:50 AM
@geisterfurz007 fyi there is an Object workaround if you cannot determine if variable is an object or not
 
ABC
7:06 AM
Hello
can anyone help me
0
Q: How to make a dynamic interval in angular

ABClist.component.html <nz-select nzShowSearch nzPlaceHolder="Select a interval" [(ngModel)]="selectIntervalValue" (ngModelChange)="setInterval()" style="width:100%"> <nz-option nzLabel="5 minutes" nzValue="300000"></nz-option> <nz-option nzLabel="10 minutes" nzValue="600000"></nz-o...

thank you in advance
 
 
3 hours later…
ABC
9:38 AM
yellow?
Yellow?
 
Yi
 
Pi
 
Bill Ni
 
 
2 hours later…
12:10 PM
F
 
that mixup
you just wrote some random stuff right?
 
12:40 PM
hey what do you call these micro if statements?
1==CSSGui.bordEnabled&&();
like its equal is
 
short circuiting
 
if (CSSGui.bordEnabled == true) {}
thankyou
so can you make short circuit evaluations for for statements or while statements?
or is it just an if statement operator
I was reading up on it, and that seems its only available for if statements
 
JavaScript does it for all logical expressions
 
@TaylorSpark that doesn't make sense, does it?
Or am I missing something completely?
 
even in const myBool = cond1 && cond2 && cond3 && cond4 ...
if cond2 is false, it stops the expression and "gives" myBool false
 
12:46 PM
I was just looking for ways to shorten my statements
and considering I just found out C# also has these, Im going to go optimize my DDO Vale game later (Which has like 2 million if statements)
 
With what benefit? Codegolf, performance or loss of readability?
 
performance
but
I find it easier to read
Which sounds opposite, but it seems much easier to type out
I guess performance is irrelevant with javascript
Im writing a large CSS Editor
lots of checkboxes and inputs, meaning lots of if statements
 
"shortening" code does not implicitly lead to better performance. However, the major trade-off of doing that is the reduced readability of the statement.
 
Well, some smaller things just make more sense in my mind, I know other people dont like the look of them though
 
I often micro-optimize shit from my code because it could not be optimized anymore in a sense of a normal human being.
 
12:51 PM
performance doesn't matter until it matters
 
eh, tell that to many people that are fairly new in development.
eg 3x loops through the same array while it could be looped once with three calls.
 
Ive actually only had performance issues ONCE in my entire experience with programming
that was with CSS Animations
too many can crash the browser
 
Shorter code isn't better.
 
Depends on the situation
I like shorter code with C# specifically... Smaller program, Smaller Download time, Better Performance
and keep it standard in the development side
 
am I being baited
 
1:04 PM
baited?
 
again
> "shortening" code does not implicitly lead to better performance.
there might be a relation between the level of complexity and performance, but that is a matter of throwing in "empiric" engineering.
 
Fair enough :3
Keep in mind you all have 100x the experience I have lol
I have to switch classes, and then i have to go see the physician about my knees later, got to go
 
1:23 PM
Hi
im trying to filter some records based on language, if that language is found, then return that data else return data of default
  let userPref = pref.content.filter(function (objPref) {
                        if (objPref.lan == currentLang) {
                            return objPref;
                        }

                    });
here default return would be of objPref.lang == "en", im not getting how i can get the default return if the first if condition doesnt match.
can someone suggest something.
 
let userPref = pref.content.find(objpref => objpref.lan === currentLang);
If(!userPref) {
  userPref = whatever your default is
}
 
1:38 PM
keep it simple :P
 
stoopid
Isn't that the thingy?
 
 
1 hour later…
2:52 PM
anyone here ha ve reactJs experience?
 
3:05 PM
never heard of it
 
3:48 PM
depends on how you define experience
 
user8729657
I though @ndugger was a lead dev on React.js
5
 
user8729657
Lead engineer*
 
4:32 PM
Hey all
Do any of you know a package/library which handles a tagged template that can handle html with user input in a safe way?
As in: prevent xss
Example magic`<div>${userInput}</div>`;
 
 
3 hours later…
7:39 PM
@PeeHaa oy, howsit
@PeeHaa something like this? stackoverflow.com/questions/21491219/…
 
7:50 PM
Hi ! Why here the error it is not catched?
let p = new Promise(async resolve => {
  ''(); // TypeError
  resolve();
});

(async () => {
  await p;
})().catch(e => console.log('Caught: ' + e)); // Doesn't catch it!
 
8:09 PM
@robe007 you need to use try/catch if you're using async/await (I think)
 
@TylerH ohai o/
@TylerH None of those are JS though and most of them suck :-)
Fiiiine I will write my own :P
 
@PeeHaa hey you never said they have to be good :-P
 
:D
 
 
1 hour later…
9:18 PM
I am trying to show new lines in a text area.
according to this i need to use html entities
Here is my ejs code
 <textarea name="description" class="project_description"
                  placeholder="Description"><%= post.description.replace(/\n\r?/g,"&#13;&#10;") %></textarea>
The issue is <%= escapes the html entities
any way to escape post.description but not the html entities?
 
9:33 PM
@PeeHaa "safe" :D
@OvieTrix ok this is gold
@robe007 because of rejections. Jesus we should fix that.
That legit should be handled by the spec - if an async function is passed to the promise constructor you should get a rejected promise back if that async function throws.
 
@BenjaminGruenbaum aye. some context aware escape magic
 
@robe007 Probably don't use the promise constructor with async functions as that implies you already have a promise. If you send me an email at benjamingr@gmail I will take care of this when I get back from holiday. We can both fix this from Node side (detecting an unhandled rejection is from the promise constructor and throwing) and from the TC39 side.
I just think people haven't thought of that.
@PeeHaa yeah, but safe for html is really hard (as you probably know) especially with tagged templates. There are some libraries but I don't know if any of them have formal proof (in the Mark Miller escape analysis + induction SES proof sense).
Mark is actually a huge proponent of both safety and tagged templates so hmm - let me check
also hi :]
 
@BenjaminGruenbaum The ones I have seen indeed are meh at best :)
@BenjaminGruenbaum o/
 
Oh, there's lithtml
I think people are actually using that and since it's polymer it's probably well tested
 
oh sexy. Will dick around with it a bit <3
 
9:39 PM
@BenjaminGruenbaum The momentary solution that I found was this
let p = new Promise(resolve =>
  (async resolver => {
    ''(); // TypeError
    resolver();
  })().catch(e => console.log('Caught ' + e))
);
 
@PeeHaa let me know how it goes :]
 
Will do
Is this room dead nowadays btw?
Or did everybody just ran when I entered?
 
Andrea also has a library (WebReflection/hyperHTML)
@PeeHaa mods came after a twitter storm like a year+ ago and people didn't like being treated like kids.
 
makes sense
 
So most people left and joined a private chat, I am only here by chance :]
 
9:43 PM
I'm here to watch the world burn
 
I am mostly on Node's GitHub and various IRCs now - how is the PHP room doing?
 
@BenjaminGruenbaum did you see what I wrote?
 
@robe007 I did, though your code makes no sense it is probably just a proxy for the real issue.
 
Yes it does not make sense, it is just a test
 
@BenjaminGruenbaum Same old I guess. Several people are now on discord though
 
9:45 PM
@robe007 Like, there is almost never a reason to use the promise constructor, let alone with an async function. that said I consider the current behavior (an unhandled rejection rather than a rejection) just a spec but - one we can rpobably easily fix.
@PeeHaa bummer, Stack Overflow could really do cool things here. Literally the people building the tech powering 20% of the internet and they managed to drive most of them away.
 
Yes, you are right. It is better only with async
 
Lol, they drove so many people away it's startling. This is not how communities usually die out - people usually just leave or abandon places. It's usually not so... violent.
 
Yeah it's pretty shocking that if you keep abusing your users people walk away at some point :D
 
`const makeTokenCall = async () => {
try {
return await axiosInstance({
method: 'get',
url: '/api/v5/',
params: {
requestToken: await getToken()
}
});
} catch (error) {
console.error(`Error inside makeWarrantyCall => ${error}`);
}
};`

It is ok to have an`await` inside another`await` ?

I mean: `await getToken()` inside the `await axiosInstance`
 
It's funny to watch though
s/funny/interesting/
 
9:47 PM
missformatted, sorry :)
 
ok
new issue
<br> nor &#013;&#010; nor \n nor \r\n seems to work in textareas
 
@PeeHaa I think bullying was just a lot less maintenance for them than actually engaging with the community. It's incredibly ironic.
 
nm
css issue
 
10:02 PM
yeah
I am still waiting for the day they get just rid of that pesky chat feature
 
i half expect to see a meta replacement first
 
replacement as in delete it? :P
 
that would be part of replacing it, yes
 
And then a read only meta
 
@PeeHaa that would be admitting it though.
 

« first day (3286 days earlier)      last day (1645 days later) »