« first day (3482 days earlier)      last day (1691 days later) » 
00:00 - 21:0021:00 - 23:00

00:00
@SamsonUgwu Not sure how you plan to "connect" your ajax response to an input tag without having, you know, an input tag
 
1 hour later…
01:08
hey guys is there any ways to alter the colors in an image with javascript or canvas?
Im trying to create an indexed color effect
Like, replace the colors with a select few and arrange those colors to make different "shades"

Its basically pointillism... its an illusion of many colors
I know Photoshop and Gimp can do this
01:20
I really resent styled-components' generous use of tagged templates
01:45
@MisterSirCode - There is a filter property for images I believe, webkit-filter maybe?
02:08
@MisterSirCode Yes
02:26
@MisterSirCode You can grab image data and iterate through individual pixels
@Estri.P Lestari 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.
03:07
@SamsonUgwu Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
@forresthopkinsa It has been achieved already. Check my new post
Good work. I'd highly recommend taking a beginner's course in web dev.
Practical Javascript is an excellent one
04:31
Wow, seems useful. Ill check it out
 
5 hours later…
09:37
Good day.
Anyone help me on my problem
0
Q: How to reset the field when adding a new field in angular using zorro

PandaBelow are the html and ts files I am using HTML <nz-form-item *ngFor="let control of listOfControl; let i = index"> <nz-form-label *ngIf="i == 0" [nzFor]="control.controlInstance"> <span translate>SBU(s)</span> </nz-form-label> <...

Hello world. What is the opposite of service-orientation in software? #JustCurious
monolithic?
like the opposite of service-oriented databases - like a web service for instance...
10:05
Anyone an idea on how to convert an array string into an actual array? Like str = "[{object: 'value'},{object: 'value'}]";. I know it can be done with eval, but that's just a no go. Tried both JSON.parse(str) and Array.from(str), but neither were helpful in these cases
@icecub parser or eval. Unfortunately, you don't have JSON. My suggestion is to have JSON, then deserialise it.
Ye that makes sense. Thanks a lot @VLAZ :)
@icecub what's the origin of that string?
did you made it yourself? Fetched from server?
10:21
Oh this wasn't for some project or something. More just a curiosity on how to deal with the situation. I came across it in some comments on a question and whenever there's something I don't know how to handle, I'll take some time to learn
a better approach is to prevent it at all :P
On that we can agree xD
hi can someone help me with typescript
this code works fine with javascript but i get typeError on typescript while sorting and i am unable to figure out how to fix that

https://repl.it/repls/ThornyRealScreenscraper
@KarelG is correct. There are many questions that boil down to "I have invalid JSON" and then go on to ask "how do I fudge it so it works". A lot of those are tagged regex because...strings=regex, apparently. Some instead don't ask for regex, although I suspect it's because they are unaware of it, rather than understanding it's not the right tool. In the end, the answer is always - "try to fix the source of the invalid JSON".
regex is like a swiss knife for strings. Useful but often used incorrectly
10:33
but regex is slower should not be used unnecessarily
@KarelG I find it's not like a swiss knife. It's more like a ladle. It is indeed useful but you don't apply it to bread or anything else in the kitchen.
Ye I agree. Regarding regex I always say: It's the last answer to your question. And if eval is the answer, you're asking the wrong question. However, that doesn't mean I don't like to entertain myself on how to deal with the situation should I ever have to, haha
@Gopherine you return a BigInt from that comparison function. It expects a number. I guess Number(a.substract(b)) would work. Unless the library has a .toPrimitive or something.
@VLAZ but i dont want to convert it to Number czz that is just an example in my actual usecase numbers are extra large
10:35
wow repl.it is slow
I don't think it matters that much - you just need to convert the result. Even if it's outside the safe range for numbers in JS, it's still going to be positive, negative or zero
hmm that does make sense
@Gopherine Why are you using a package for bigints? TS supports them
Converting to a primitive won't change the sign. It might fudge the number but you don't care about the actual value. And if it's zero, it's already in the safe range.
You can also just return -1, 0 or 1 manually, if you wish.
@BenFortune atleast its supporting :D plus it has interfaces for types so i like it
nope it makes sense to typecast it to number it would be better then adding more lines into it
10:39
Note: the library you use might already have a comparison method. Check if there is something like a.compare(b) or whatever. It might be even simpler than subtracting the two.
@BenFortune its really slow and irritating at times but i dont have better option
@icecub what if I ask you to quickly validate an input string if it's an ISO 8601 date string?
I just throw regex on that lol
it does have comparison method
\d{4}-\d{2}-\d{2}
but that returns boolean
10:40
Ah, damn. It's doing the two way comparison, only. Then use the subtract, in that case.
yes thats what i am using :) just had problem with the types
@KarelG There's nothing wrong with using regex. Just saying that it shouldn't be the first thing to rely on. If other functions are able to get the job done, it's usually a better choice performance wise
@KarelG ah, yes. When I'm bored, I go around regex questions about emails and downvote all answers that say something like "this is the regex for emails" and it doesn't support basic stuff like + or real domain names and TLDs like example.co.uk (disallows multiple dots) or example.ninja(TLD is limited to four characters) and so on.
lol regex on mails.
that's just opening the poo pit
all those questions needs to be deleted IMHO. Even that famous perl regex
i just check for presence of text@text
backend send mail
= good validation
but some people do ask it to be really specific on checks --> truely faced it
10:47
Last company I worked at had probably the best email and telephone validation that has been intentionally and by design put into real code. Both were free text fields and the rationale was that users might just type in "Phone +1234 and ask for Alice" or "Please email Bob from accounting". That was down in the design - allow users to type anything.
honestly i dont get the idea why do this strict mail checks anyways if the mail is incorrect they wont even get validation
now that is just we assuming people are so dumb that they cant see there own email
We eventually had to implement actual email valididation for a single field where it mattered, however, we really just needed to split it into two parts based on the @, so the validation was to check it was there. We'd then group by domain name and validate against acceptable ones because a company would say "we use abc.com and xyz.com, so we only want to add emails from those domains"
For email just a client side check should be enough. Something like: This email address doesn't appear to be valid. Please verify if it's correct. If so, press Send again to proceed".
i would rather just add any email that passes two step validation instead of checking on if they entered something correctly ...
@Gopherine I love how Gmail allows putting + in your email but many actual services reject it. It became quite hard to remember how I registered, was it [email protected] or [email protected], so I stopped for a while. Recently I started doing it again and it seems there is better support.
It was quite funny when I found a service that allowed me to enter [email protected] to register, then at login it told me "that's not a valid email" but the validation was actually so bad, it didn't even stop me from submitting the form.
So I was able to login.
10:51
haha i hate putting special signs or numbers in my emails so much that i never even tried
are those not for testing purposes?
as wildcards, like dots
like send.to.google@gmail and send.to.goo.gle@gmail sends to the same inbox
never used + tbh
@VLAZ btw return b[1].greater(a[1])? -1: 1; this works too :D
@Gopherine you're not returning zero
now i am not sure which is more performant
whelp I have an urgent bug fix to do. Got distracted D:
10:53
yea thats another issue
damn you all *shakes fist 😉*
@KarelG for Gmail specifically, they all map to your email, however you can then filter based on the + value. So you could register with [email protected] or [email protected] and do additional filtering based on the latter. Also, you can detect leaks if you start getting emails fromservice2 which you never registered for they are sent to email+service1.
@Gopherine read this it was really enlightening for how sorting works and why it's really important to return three values - positive, negative, and zero.
thanks <3
Essentially, yes, you can use greater. However you need to do two comparisons b[1].greater(a[1]) ? -1 : a[1].greater(b[1]) ? : 1 : 0
i am not sure how much of a performance difference these make
so i would just go with typecasting since i dont trust third party library :()
11:00
honestly, I don't think it's much. I suspect greater is really fast - it's pretty easy to detect which is bigger. However, I personally don't like how the code works since you have three branches in the if (or conditional operator). Ultimately, it works. Just decide which you prefer.
@KarelG (for when you come back) one more thing - Gmail does treat dots as optional. So [email protected] and [email protected] do go into the same box. However, that's not a requirement in the standard - other email services are allowed to have two different boxes for [email protected] and [email protected]. Presumably, the former is named Joe, while the latter is named Jo and the middle initial is E.
11:51
Hi
12:14
@KarelG Those are things google does that deviates from the standard. The standard just describes that those addresses are "different"/unique. Google however interprets them as the same; this was done to prevent confusion with special symbols.
787
A: What characters are allowed in an email address?

Anton GogolevSee RFC 5322: Internet Message Format and, to a lesser extent, RFC 5321: Simple Mail Transfer Protocol. RFC 822 also covers email addresses, but it deals mostly with its structure: addr-spec = local-part "@" domain ; global address local-part = word *("." word) ; ...

The only official way to have multiple different string representation for the same email address is by using comments:
paul(comment)@gmail.com and paul(othercomment)@gmail.com or oven p(internalcomment)[email protected] are the same address.
Another thing: anything beyond ascii is not allowed, it sickens me when people use chinese characters, as then suddenly websites have to "randomly" make up their own protocol: it is officially not following the smtp.
Except if those characters are between comments though.
It honestly also helps me. My gmail account is [email protected] (where i = initial). There is apparently at least one other person (I suspect two) with a very similar name to mine. I get emails for [email protected] and I know hey aren't for me. I did get the correct email of one of them, it's actually something like nameix - just has an extra letter at the end. That guy seems to be really bad at actually spelling his email correctly and misses the final letter very often.
VLAZ That's quite amusing
Also, I seem to be unfortunate enough that I did just use one name. I also get tons of spam that at least partly is not due to leaked email. I know, because I started getting it before I started using the gmail account for registrations. I suspect spammers just tried mass sending emails to <mynamevariation>@gmail.com and once they found an address that didn't bounce, started sending spam to it. Gmail is good at catching it. all of the spam is addressed to [email protected] without the dot.
I've another gmail account that I use for my hobbies. It's a very unusual name (a nickname I use in games) and I didn't even get any spam in that box for close to a decade. At some point, it seems to have leacked from somewhere and...well, now I do have some spam. It all goes in the spam folder anyway, but still - I was quite proud I wasn't getting any.
Meh promotions and spam I don't even look at anymore
Or to be exactly frank: if I don't expect a mail I probably won't open it.
Oh, me neither. But once in a while, I have to go in the spam folder to look for an email that might have been lost. It's annoying then when I have to look look at more than one entry.
12:28
whatsapp & various websites (like for government and bank) have fully taken over any and all communication. They used to send mail instead of having their local inbox but now it's all local inboxes.
Bit annoying but it is what it is.
On a related note, I think I found my favourite spam headline that way. It was "Don't get mad, get valium!"
I wonder if mail couldn't be made more secure like https for http did, but then even more limited.
So that the reason 'we can't send any information to you over email so please check our website daily' becomes invalid and I can have one place to look.
IIRC, you could have email over HTTPS but it doesn't work with the SMTP standard or something. So, you'd either break compatibility with SMTP clients and servers or you have to use/create a different protocol...which then has to be supported.
So, I think ultimately, it's just too much of a hassle. People just resigned that they don't need secure email.
No I mean: use a secure layer to verify the email addresses using a third party.
With that said, you can use PGP to encrypt emails.
12:33
As that is basically what https is; making sure you ask a website from a server who can verify itself as the owner of the domain.
Ah, so verify if email from bank.com is really from bank.com or something?
yes
In that case, PGP aims to do just that. Different implementation but you still verify the sender using a key.
Good morning everyone. How do I search if in a value it has - or , ?
let parcela = "1-12" // Other options to come: [1-12], [5,15,30,45] [0], [30]

    if (parcela.search("-")){
        console.log('-')
    }else if (parcela.search(",")){
        console.log(',')
    }else{
        console.log('0 ou outros sem - e ,')
    }
So if email comes from bob but doesn't match Bob's key, you wouldn't actually be able to see it.
@Tiago parcela.includes("-")
12:35
Yeah, but it's still not really standardized: many email implementation don't respect it. And it's due to the hassle of implementation.
Whereas the https verification layer is incredibly easy.
@VLAZ Thank you!
@paul23 that's true. It's essentially a secure layer but it's on top of the unsecured email. It's really just putting a padlock on the envelope you send. It can work and will be secure in transit (well, let's assume so for the sake of the metaphor) but it relies on the other end having a key and knowing how to use it.
It didn't even catch up that much - used to be slightly popular among geeks but very slightly. It doesn't seem to be as popular any more. Or at least I don't really hear that much about it. Tried to set it up once but it was too annoying and I wouldn't even get any benefit, so I dropped it.
Well we use it, and gmail does (say, but I trust them there) make sure that if you use pgp you're "sooner" out of the spam region and into the direct to inbox.
Speaking of spam, I remember back in Uni when we talk about Bayesian statistics and how they were used for really effective spam filtering. Essentially it's a self-training filter, so when you mark something as spam a few times, it will start automatically recognising it. If you get something in the spam folder by accident and unmark it, the Bayesian filter will start recognising this one as exception.
It works rather well as it needs very little data to start working and any further data then reinforces the filter and improves it.
Nowadays many companies are rushing to boast about using "AI" when they don't really do anything much different than this. I'm surprised I've not seen email providers going on about "harnessing the power of AI to sort your mail"
Some probably do, but I've just not seen it.
Gmail does this I think with what goes into promotions etc folders.
12:44
Yeah, I don't know the algorithm they use but at least at first, I think they were using Bayesian filters. I suspect they've moved on to machine learning a long time ago, though.
The big problem is privacy.
You can't really use the data from one person's email for other sets, as even knowing "he receives a lot of spam" is a big breach of privacy.
Not even knowing the topic of spam you can deduce a lot.
Not sure that matters. You can think of it this way - you have a system that classifies emails before it reaches a box. So, it works without knowledge who it's sorting it for.
Then people who mark as spam or not-spam will provide feedback to the system again without disclosing who they are. So all the system knows is that Rule A needs to be strengthened or Rule B loosened.
That's if it's implemented correctly, of course.
I suspect Gmail is doing something a lot more complex where they have a generic filtering model but each person gets their own "copy" that is then trained by each individual separately. I'm probably oversimplifying it a lot but it must have a set of generic rules that follows as well as individual ones.
Because one way to stop having something classified as spam is to add the email to your contacts. In that case, their emails will never go into spam automatically (unless you start marking them yourself).
yeah but that could be so simple as a view implementation, still marked "spam" on the server you just state "emails from xyz I wish to see even if marked as spam". And then the view displays them outside the spamfolder.
Well, spam is cleaned out regularly. And to the best of my knowledge, emails are not actually kept around. So, a view will have to deal with this. Likely by keeping spam forever. And since it's spam it's just clogging up space.
At my first job we had to make a website for some local competition. People would submit their entries there within a limited time window. Something like two months. Several months after the competition ended, we started getting notifications about the box getting close to the quota. Nobody had really bothered with closing it and when we looked at it, it was overflowing with spam.
And I use that term rather sparringly. It was gibberish. It wasn't trying to sell anything or push any services or anything - it was just email after email of word salad.
@VLAZ Don't you think that is also a "view"? Google has such huge datacenters that even spam can be stored: old emails can be compressed anyways.
12:59
Some word combinations were OK but there was not a single sentence that made sense individually. It had verbs and nouns, but that's it. So it was a step above picking random dictionary words. And each email had several paragraphs of absolutely random text.
Well speculation anyways so we can't really say much more though
Yeah, true. Google haven't made their algorithm public, as far as I know, so it's all just speculation.
By the way, just to give you a taste of how weird the emails were, here is an excerpt: "The exhausting candy moonlight vengeance pasture borrowed six graybeard committed pieces license morning loads stoneware finest stick ago viens"
@paul23 well ... yes and no. It does not violate the standard. adding a dot makes the mail address unique
google just ensures that it's connected to the same inbox
And last one (I promise) just because this one is slightly more coherent but it just makes it sound *more insane*:

th infant begins to jibber-jabber month, says "no", "This," "whim," then consists of syllables, words like "no-ma-ma" "da-da-da." Most children, in the future finishing the triumph year of mortal, break "mama" or "dad." Interesting that the first tidings terminates your baby? If you after to relieve him, play with.

Where are the eyes, nose, mouth? - Require your neonate to be struck by shown the disparate parts of the league (his own, or in support of example a teddy reconcil
Is it possible to put a php foreach inside the while javascript?
13:07
so [email protected] and [email protected] are unique mail addresses. But sending a mail to the latter makes google to MT it again to the former. It's perfectly ok
table += '<div class="col-xs-12 col-sm-1"><div class="form-group"><div class="form-control border-0 height-25">1</div></div></div>'
                +'<div class="col-xs-12 col-sm-3"><div class="form-group"><select name="p_formaPagamento[]" id="p_formaPagamento" class="form-control height-25"><?php foreac($rsForma as $rowForma){ ?><option value="<?= $rowForma['id'] ?>"><?= $rowForma['nomeForma'] ?></option><?php } ?></select></div></div>'
@Tiago PHP and JS run on two different machines (usually). So, no - it's not possible.
*environment
:)
If you use ssr you could spin up the php compiler inside nodejs
why you would do that instead of using a templating language fit for js is beyond me though.
13:09
@KarelG I do mean machines. They always run in two different environments but unless you're currently developing the two on your computer, they will work on two different machines.
you actually confirmed it :P
> but unless you're currently developing the two on your computer
nag nag
@VLAZ The foreach php he did correctly, but the values are not because of the quotes.
argh back to my f*** issue
hardest part of being a developer: naming branches that I need to identify later again.
@paul23 the two hardest things in development: naming things, cache invalidation, and off by one errors.
13:14
I now started to wrok on something that "needs to be done somewhere around semptember", however by friday some other new project will start that will take all priority before I can continue on what I work on today. Which will probably take a good month or two...
It feels awkward having to start up something only to know you'll have to shelf it soon.
happened in my company: a dev team has to port over an existing Win XP application (was a kinda big one) to the new .NET platform (win) and add support for Mac. They decided to work on win one first so that a Mac variant would easy to implement. Four months later, a manager decided that there is something important and that this project isn't anymore. So budget/resources got moved, leading to bin the project
now, roll a year and some months after that
the same manager asked to dig up that project and support the recent .NET platform, add Mac support.
but Mac one has a higher prio
Well at least they started initially with the idea to finish it :P
everyone from that team used to complain about that during the lunch/coffee talk the week after
I'm just starting because "I don't have anything else to do this week".
so funny but it's frustrating sure
13:20
@KarelG it's also what gives managers the bad name they have :P
thing is, they does not have the source of their earlier project anymore
it was on a branch and it got deleted
svn repo have bad branching mechanism tho
ouch, feels annoying for those involved indeed having to redo everything
there was a person that still has a part of the uml's by accident tho.
gave a bit start
@VLAZ is it possible to copy the select already rendered on the screen and paste it where I want it in js?
Selected text? If so, it should be possible
13:33
mongoose.Document & {}
what does this & means?
I think it's && not a single & It's basically a horthand for the ternary operator, or in c# ?? operator (slightly different from that though).
&& returns the left side unless it is wrong then it returns the right side. Important that it "returns the x's side value" and not a boolean value.
What this means is that above will return mongoose.Document if that is truthy, or otherwise an empty object.
@Suisse binary AND
but why is it there?
Equivalent ternary would be: mongoose.Document ? mongoose.Document : {}
not with that
"I think it's &&"
13:37
I need context. Maybe it's a nice hack
@paul23 you're thinking at || when you are talking about that ternary equivalent
Uh, how does binary comparison with an object ever do something useful?
oh wait, that's typescript (and flow) types.
||> const obj = {}; const withOr = obj.key || 1; const withAnd = obj.key && 1; `or gives ${withOr} and and gives ${withAnd}.`
@KarelG "or gives 1 and and gives undefined." Logged: ``
anyways that's not a hack. See context is typescript
and ... & is used as intersection type here.
hmm *google*
13:41
It's an intersection, it gives a new type that is basically the type "that has only the parameters of both types".
not sure 😁
@Suisse there is your answer ^
nvm was mixing up union and intersection again
Does anybody here watch codecasts? Where people write code and record it on video? I don't talk about presentations but people just working on stuff.
how is that in any way "fun"?
*gestures at the website here* I mean...
13:52
@paul23 probably same as people watching others playing a game?
I love discussing code, but just watching someone write is such a one way street. Even presentations are (if done well) a more two way street as the presenter tries to make you think about it, and you can (later) disagree or agree with what is being said.
Anyway, I wanted to see what it's like. So I was wondering if anybody knew where I'd find codecasts.
@KarelG In a game the goal is the route (the playing) - when writing code it's the outcome. So I'd like to see someone's code, but the act of writing is not fun at all. In gaming the act of being busy and actually doing it is supposed to be the fun part.
I mean good ones, because I keep finding either irrelevant ones or people explaining how to do X using Y.
I could stream, but then you'll see me alt-tabbing to this chatroom more time than I write code :P
13:55
hey guys, anyone got an opinion on how best to get into react?
@paul23 just dive in? ive done the tutorial on the react site a while ago, but dont retain it
Well just do the tutorial, if you understand javascript it should be enough to get you started
@paul23 really?
i do know javascript
@paul23 :D then I could chat with you while I watch you chat. A guy I knew actually introduced me to code casts. He said it's really soothing - he'd watch one while coding, so he could at least see passing unit tests, even if they weren't his.
So, he'd watch somebody code as he coded.
Meta.
I recently remembered about codecasts and sort of got curious what it actually looks like and is it indeed as boring as you think (and I suspect) it is or not.
ok thanks perfect?
read the first one, then the second one, then setup using hte second one and return to the first guide.
ok thanks
14:18
OK....can anybody explain to me why in Hastur's name is this answer of mine still getting upvotes?
It's super basic and I'm honestly a bit ashamed of it. I remember I wrote it while waiting for something to compile. Quick search didn't find anything about destructuring, so I just banged out the answer. And it kind of took off. It has more upvotes the the next ten of my top answers. Combined.
To this day I get people randomly upvoting it. Is it linked somewhere or something? How are people finding it as opposed to all the other posts on destructuring?
What the hell? It is linked. Weirdly, I found it here. Some open source grammar checker.
I highly doubt that's where all the upvotes I keep getting are coming from but I still found it puzzling. Search for "41058569" (question ID) and it's a comment in the commit.
@VLAZ why are you ashamed?
it's clear, concise and correct.
Because it's not a very good answer. Just a "Oh it's X" with very little to it.
And there are better dupes for destructuring here is the canonical. I just failed at finding it the first time around.
14:34
pfft I keep getting tricked by cookies not "sharing" between 127.0.0.1 and "localhost"
edit your answer with a link to that then
@paul23 to be fair, if another me came into the room while I was eating cookies, I would also not share them with myself.
you capitalist!
Yes, I plan on getting all the cookies and establish a monopoly. Then laugh at the cookieless people from atop my cookie tower.
15:01
how this happens?
1. I get all the cookies.
2. Use them to get more cookies.
3. ???
4. I have all the cookies.
I gotcha summon a cookie monster then
Oh no, my nemesis!
Weird thing happening in the netherlands now: children learn at earlier age what a "cookie" is for internet than the actual meaning of the english word "cookie".
It actually took me a while to link the two in my mind. I already knew what a cookies is in English and I later found out what a cookies is for the Internet. It took me years to realise it's metaphorical. You visit a website and you are given a cookie.
15:30
...So, TIL that "ponyfill" exists.
It's not a polyfill, it's with an n
And apparently, it's sort of like a polyfill for missing functionality, however, it doesn't change the globals. You import it and use it standalone.
So...it's a module?
It's a proposal to finally implement named arguments shorthand which allows mixing and matching with ordered arugments.
It's at very early stages with only the syntax currently established.
The semantics are only at a non-formal form.
What does model in ngModel refers to
@AnArrayOfFunctions how would that work when calling something defined pontfree style?
const f = function (a, b) {};
const g = flip(f);
Or are names lost then?
15:46
what is flip - I don't understand your example?
I believe function parameter names are preserved in the function object
flip is a functional convention - it flips the argumens for a function. So you'd call f("one", "two") but an equivalent after flipping would be g("two", "one")
It will work similar to flip = fn => (...args) => fn(...args.reverse()
This is a simplified example, as you'd also make it care about the this context.
The ... is well defined as part of the PropertyDefinition as I've stated in my proposal.
But yeah we may be also able to set this in a function call - that's an idea.
At any rate, functional programming thrives on modifying existing functions using higher order functions, so you have stuff like curry or bind or compose/pipe/flow, among others. These all take something and produce a new function that can be used later on
h = compose(f, g) is a big one with FP. Calling h(x) is effectively g(f(x))
So, with this in mind, using named parameters, if the names cannot be guaranteed to exist past a higher function call can destroy code
I just tried bind and at least the autocompletion in chrome is competent enough to suggest me the next unbind parameter
consider the following:

const f = function (a, b, c) {};

This is called as `f(c: 3, b:2, a:1)` and it works. But somebody decides to refactor and derive `f` from a different place:

const f = compose(h, flip(g));

now would the previous call to `f` work?
15:56
can you pleas enlighten me with the internal workings of compose and flip as I don't think those are standard
There are many implementations for those. Here is one for compose
It would work as intended by the standard - in the order of which the parameters are declared in the function definition and not in the order in which the function arguments are passed.
This is how they'll be reversed etc
user11867329
h
The point is that compose, flip, curry, etc are intentionally generic as they can handle any function with any parameters.
user11867329
16:00
Sorry to barge in, does anyone know anything about creating/deploying/managing your own mailserver OR a free/cheap webserver service (I wanted to use Google but GSuite's $10 a month PER user.)
I would like to be able to make a module out of it, so that I can access to it from other modules (files)
user11867329
As a node.js module?
I want to be able to create new monitored Items from outside of that file
OakDev: I've watched a video describing how to create mini webservice out of google for free or only some cents using some trickery.
but the whole logic is happeneing inside this big async main() function
user11867329
16:01
@AnArrayOfFunctions Go on.
    const itemToMonitor: ReadValueIdLike = {
        nodeId: nodeId,
        attributeId: AttributeIds.Value
    };
    const parameters: MonitoringParametersOptions = {
        samplingInterval: 100,
        discardOldest: true,
        queueSize: 10
    };

    const monitoredItem  = ClientMonitoredItem.create(
        subscription,
        itemToMonitor,
        parameters,
        TimestampsToReturn.Both
    );

    monitoredItem.on('changed', (dataValue: DataValue) => {
       console.log(' value changed ', dataValue.value.toString());
Until now they could be, since they don't need to treat parameters any differently, since there were no named parameters. However, now they would need to preserve the parameter bindings in some form. And any implementation that doesn't (I assume most) would find have a breaking change.
user11867329
Why not just handle the "watching" on the other end?
VLAZ: It's the way arguments are passed not recieved.
this functions inside the main() is needed to create a new "monitored item"
user11867329
16:02
Include js-dom
user11867329
and export to a json?
user11867329
I got this piece of code.
user11867329
for node
@OakDev was it for me? the watching on the other end?
user11867329
if you want to try?
user11867329
16:03
Yes
user11867329
Sorry I was lazy because I wanted to communicate well
hehe
OakDev: I can't seem to find the video it was long time ago sorry - you'll have to explore it yourself.
and the js-dom is also for me?
user11867329
I assume if you just export to a file (json)
user11867329
16:03
Yes, all I'm saying
user11867329
is for you
user11867329
Suisse, mon ami
how is js-dom going to help me here?
bonjour mon ami!!!
hehe
and why export to json?? haha what do you mean? I have no clue what you are saying
what ever.. I tried this:
inside of that file I sent you.
user11867329
Confirm this:
"I want to be able to create new monitored Items from outside of that file"
create a new function and export it (since the variables inside the function are in the same file; I extracted some of them outside the main() function):
export let observe = async (nodeId: string) => {

    const itemToMonitor: ReadValueIdLike = {
        nodeId: nodeId,
        attributeId: AttributeIds.Value
    };
    const parameters: MonitoringParametersOptions = {
        samplingInterval: 100,
        discardOldest: true,
        queueSize: 10
    };

    const monitoredItem  = ClientMonitoredItem.create(
        subscription,
        itemToMonitor,
        parameters,
        TimestampsToReturn.Both
    );

    monitoredItem.on('changed', (dataValue: DataValue) => {
@OakDev I confirm it! I will.
user11867329
16:06
Making itemToMonitor values export o a json
a json? you mean just an object?
user11867329
No, a file
user11867329
a json file
and then??
user11867329
What's your goal
user11867329
16:08
direct goal
hehe thx for your support, but I think ehm yo don't get it
user11867329
Elaborate
we wait till someone else maybe can help here
my goal is make it possible to call the function observe() from another file.

Since the variables used inside the observe() function are getting initialized inside the async main() function
user11867329
@Suisse

>>from another file

Can you simply use the variables inside the observe() and export them directly in a json, then "include that.json" before you call them in your mainfile
@OakDev please forget this json idea, thats not the way to do this
user11867329
16:14
man, i'm sure it'd work tho.
user11867329
Ok try using exports
user11867329
exports.observe observe
user11867329
EXPORTS:
user11867329
exports.observe observe
user11867329
IMPORTS:
user11867329
16:24
var observe = require("./thatotherfile.js").observe;
user11867329
Does anyone know of a good google-friendly if possible solution to using a cheap/free (secure) mailserver
user11867329
Nvm found it:
SendGrid, Mailgun, and Mailjet offer a free tier for Compute Engine customers to set up and send email through their servers.
17:21
posted on April 28, 2020 by Prudhvikumar Bommana

The Dev channel has been updated to 84.0.4128.3 for Windows, Mac, and Linux platforms. A partial list of changes is available in the log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Prudhvikumar Bommana Google Chrome

17:42
argh, once again I come to the same solution.. and it has the remark "doesn't work in edge"
19
Q: How to make hover state on row table with CSS grid layout

Nguyen Trung HieuThis a table that created with CSS Grid Layout, but I have a problem with it, I can't make hover state on each row. I only want use CSS for this. Can anyone give me a solution for this? .table { display: grid; grid-template-columns: [col-start] auto [col-end]; grid-template-rows:...

Yeah...My own question from almost exactly a year ago was about Edge mishandling something what I essentially got is "wait for Edge to go Chromium based for this to be fixed"
I have a page that uses fetch to pull data from the server. This process takes a little while. But I notice that when the fetch is running, and I click on any of the regular links on the page, it doesn't follow the link until the fetch completes. Is there anything I can do to fix this?
@paul23 Do what I do. Confirm with your manager that you have permission to disregard Edge.
yeah well that's a no
@Hypersapien are you streaming data or something? Or processing it? fetch should work asynchronously so it shouldn't block.
Really? They want to to make sure it works in Edge? Fuck.
17:54
Annoying this is: this influences the structure of html itself. So you cannot make a polyfill or babel.
Well safari has the same problem ;P
I mean, doesn't IE still have more market share than Edge?
Both "regard" display:content as display:inline. But this means that for the "grid" it just sees 3 elements, instead of all elements "inside" the display:content area.
and the only solution is to either ignore highlighting code and remove it. Or maintain two versions: one with highlighting and splitting the grid into rows using display:content and one without the splitting.
Ah, Microsoft. Making the internet a worse place for developers since 1994.
And highlight based on cells (which doesn't highlight the borders, so you'll see ugly lines - on top of that it requires a js solution so the styles are modified by code).
Are you missing the part where safari does the same (though not such a big problem as the iphone market is still quite small compared to android and windows)
Yeah, Apple's been doing the same thing for about the same amount of time.
Never trust a browser made by the creators of your OS.
18:13
@VLAZ The back end is retrieving it from the database and processing it before sending it to the browser. I'm still working of getting the speed up. There's a lot of complicated calculations going on.
18:30
Anyone have an alternatives to jquery-bracket I would use it but I dont really like the model it accepts, I personally cant figure out a way to program around it.
19:10
(React question) -- is it possible to set the state of a HOC using incoming props from an attached component? I'm getting an error: maximum update depth exceeded
@Axel 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.
class withNested = (WrappedComponent) => {
  class withNested extends React.Component {
    state = {

    }
    constructor() {
      super()
    }
    render() {
      // deconstruct incoming props
      const { profile } = this.props
      this.setState({
        profile: profile
      })
    }
  }
}
this.setState is causing the depth error. Not sure if I'm thinking of HOCs correctly. I basically wanna "enrich" an incoming prop before I render the child
oh wait... componentDidMount
Not sure if that would work
19:28
there is this function in a library:
    browse(nodeToBrowse: BrowseDescriptionLike, callback: ResponseCallback<BrowseResult>): void;
I try to use it:
 session.browse( 'ns=3;s=85/0:Simulation' , function(itemResults:BrowseResult) {})
why it gives me this error:
No overload matches this call.
  Overload 1 of 4, '(nodeToBrowse: BrowseDescriptionLike, callback: ResponseCallback<BrowseResult>): void', gave the following error.
    Argument of type '(itemResults: BrowseResult) => void' is not assignable to parameter of type 'ResponseCallback<BrowseResult>'.
      Types of parameters 'itemResults' and 'err' are incompatible.
        Type 'Error' is missing the following properties from type 'BrowseResult': statusCode, continuationPoint, references, encode, and 8 more.
 
1 hour later…
20:56
@Axel do this in the construcotr
you can't/shouldn't set state in the render function
00:00 - 21:0021:00 - 23:00

« first day (3482 days earlier)      last day (1691 days later) »