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

user7437719
12:39 AM
No one has been much of a help to anyone else today
 
user7437719
Jimmy Leahy got no help by anyone
 
user7437719
Same with Jay
 
user7437719
Modestly disappointing!
 
user7437719
@Jay yeah jquery should be fine as it is a JS library afterall and there is not other particular jquery room that I know of
 
user7437719
Anyways, I have had 29 reputation for a while now
 
user7437719
12:45 AM
But yesterday I did a few tag wiki edits and post edits and got up to 33
 
user7437719
Im trying to get to 50 so i can comment on other posts
 
user7437719
and i almost have a gold badge
 
This channel isn't a good resource for help anymore. The mods made the regulars feel pretty unwelcome so they've all left.
7
 
user7437719
true; mine as well just ask a question on the main site!
 
user7437719
no one is really super active here either
 
user7437719
12:47 AM
There is a star :)
 
user7437719
I am trying to get stars too because you can get a badge for 10 messages that have 10 or more stars
 
user7437719
There is another one called talkative which is where you post 10 chat messages with 1 or more starred
 
user7437719
i have that one
 
user7437719
but the second that i said above i dont have yet
 
user7437719
the other one is a silver and is called outspoken
 
user7437719
12:50 AM
i have one other silver. civic duty. vote 300 or more times. and i only have upvote privileges so all upvotes!
 
user7437719
and i almost have the gold version, vote 600 or more times. im over half way there
 
user7437719
so, gold badge soon!
 
user7437719
i wish you would get more than 2 rep though for edits
 
user7437719
4 would be more adequate
 
user7437719
anyways, Good Day!
 
user7437719
12:58 AM
btw, you can move the messages above to the trash can if you want to
 
user7437719
that was just because i wanted someone to talk to.
 
user7437719
but no one is here other than david
 
user7437719
which is strange because everyone that is listed here says they have last been seen in under a minute ago
 
user7437719
welcome steeling archer!
 
user7437719
I do not like the time limitation for deleting and/or editing messages.
 
user7437719
1:05 AM
It is superfluous and much of an annoyance.
 
user7437719
When chatting, I like to delete unnecessary messages I made when it get to be of too much quantity to clear up the chat
 
user7437719
Especially with the stickler mods around here, you go to be careful!
 
user7437719
Perhaps I will refrain from coming to this room moving forwards. No one is ever here (or at least they say nothing) and even if you want JS help no one is here to help!
 
Oops accidentally joined @TomMinor live journal
 
user7437719
LOL
 
user7437719
1:11 AM
I maintain an occurrence within your recollection; I see
 
user7437719
Not that I am pretty conspicuous
 
user7437719
Honestly, I would create a chat room for myself but I dont have 100 rep yet
 
1:30 AM
hihi
I'm trying to chain a script call while running `ng serve` but when I've run this command the second script `build-components.js` isn't running. I thought concurrently here would allow both script to run in parallel

"build:watch": "concurrently \"ng serve --port 4003\" \"node build-components.js\"",
What I expected is every time ng serve detects a change and calls build for the subsequent ` build-components.js` script to be run after
but not the case here ^
 
user11867329
2:26 AM
Oye Oye
 
user11867329
Does anyone know of an application/script (open sourced if possible) that can read all latin characters from pdf to text?
 
user11867329
To implement as a cog in a document managing software
 
user11867329
that already has zone OCR
 
6:27 AM
Oi
6
 
6:42 AM
Why was Oi starred?
 
hi guys,
 
@jajanato hola
 
ABC
hallo
 
just want to ask some question..
 
Kon'nichiwa
 
6:55 AM
array1 = [{code:1,description: aaa},{code:2,description: bbb}]

code = 2
statusDescription: any

   this.array1.filter(code => {
      if (code.code === this.code) {
        this.statusDescription = code.description;
      }
    });
 
ABC
hello JSDev, have you already use the open weather api?
 
i want to filter array1 based on code, so it return description..
it solved, but on sonarqube i got error 'The return value of "filter" must be used', anybody has suggestion ?
 
what you are looking for is something like this
const arr = [{code:1,description: "aaa"},{code:2,description: "bbb"}];
this.statusDescription = arr.filter(item => item.code === 1)[0].description
what you were trying to do could just be done with a forEach, and that's why the linter told you that you were using filter unnecessarily
 
@jajanato filter expects a boolean expression to be returned
you shouldn't be having any side effects in it
You could but it is bad practice and difficult to interpret your code correctly in general
for every item where your lambda returns true in filter will get returned in a new array
 
okay understand, so using @ikari solution is good practice is it ?
 
7:02 AM
so you could filter by code, and then grab the description of the first returned item in the array
yes, well to be perfectly correct, if you expect exactly one value to meet your criteria, use find, not filter
find is just like filter, except it stops at the first one it hits
so if you have a thousand and you match the first, it will simply return the first (it returns the item itself, not an array)
this.statusDescription = arr.find(item => item.code === 1).description
if you need to do a lot of lookups like this, then you would go a step further and reorganize the array into an object whose key is the code, so you could do like lookupObj[1].description instead
you wouldn't do this for a single lookup, because it would be a waste of cpu, but for repeated lookups, you ultimately save time by exerting a little more effort for the reorganization the first time
 
good explaination @nei
will do more research and practice
 
@Neil not foolproof (error if no item is found)
 
@jajanato good luck :)
@KarelG true
Yeah, this assumes you will find exactly one (and not zero) :P
undefined is returned if nothing is found
 
what you can do is
nvm
bad idea :P
 
and more to the point, don't be Wietlol clever!
 
7:10 AM
wietlol isn't clever
he is a smart dude and knows a lot about Java/Kotlin but his ways of thought are sometimes just odd and does not fit very well.
so ... "weird" is the word thou seek
 
well in the context of programming, "clever" isn't a compliment for me :P
 
no "clever" hacks for you?
 
well I do it too. I think everyone is tempted to do that from time to time, but it should be minimized
Ideally you should always program like you'd want to see someone's code you've never seen before
"clever" solutions are usually brittle or impossible to understand without an explanation
 
had a little C problem where a string was not in the right case (flag name setting) when passing on a method. So I "fixed" it with just doing myChar = myChar & '_' a line before the method call.
added a comment tho " // uppercases character "
and @Neil f at your Sloth fact.
 
how would adding a '_' fix the case?
 
7:19 AM
don't you know what bitwise and does?
 
oh dear
 
try it out in console.
 
!!> 'a' & '_'
well it returns 0
 
caprica is not functional anymore
 
probably doing something wrong though
 
7:22 AM
and JavaScript is not C
you need to turn it in binary
eg
 
ah I see
 
String.fromCharCode( ('a'.charCodeAt(0) & '_'.charCodeAt(0)) );
 
yeah, definitely "clever"
 
that is js equivalent of ch & '_' in C
the thing is: that method body I modified is called from multiple places where a checksum (guard) is provided to allow only A-Z characters
 
Figure we had a problem where translating from one database to another, a certain type of column couldn't properly represent certain characters
 
7:24 AM
but there is a code that does not run this guard. Or not even calling it.
 
So our initial solution was to replace these characters with "_"
 
had-no-time-to-find-which-one-so-I-came-with-that
 
but.. as you would probably realize.. that may create duplicates
you wouldn't believe the headaches we had with that one
 
lel
 
worse, the database was an as400, and didn't have any sort of constraint mechanism
so it would simply let you create duplicates in the table
 
7:25 AM
the CRM did that too with non-[a-z] characters for attachments. It gets turned into ?'s
 
we were sort of obliged to perform the duplicate line check manually
@KarelG lol ouch
 
assume that there is a ticket with two attachments. You see ??????2??save.bin and ????1???.ml or something 😅
it was often hard for analysts to figure out which image file a user was pointing to (eg tickets with 5+ screenshots)
was a PITA to fix it
only non-allowed characters gets ?'ed. (difference LINUX - MacOS - Windows allowed file names ....)
 
i'd try to convert it to base64
information isn't lost, and you could even transform it back if you get a chance to handle it clientside
 
8:00 AM
In case anyone's affected by that vote count experiment (Never show votes lower than -1):
Here's a userscript which turns the experiment off on question pages, if you want to see true vote totals on pageload and after voting. (if using Tampermonkey, you'll have to enable instant script injection) — CertainPerformance 8 hours ago
 
8:15 AM
@Cerbrus imo it is controversial.
I closed meta immediately when I saw that question.
 
It's silly...
Experienced users will immediately see something isn't as it should be
 
8:31 AM
The vote system is the main thing (and strength of SO) that ensured SO has qualitative content and not quantitative. By "hiding" it with a minimum vote or a gimmick vote count, I think it would have an impact on the level of quality SO should offer.
 
I guess it could be better for low rep visitors
But a cutoff at -1 is too high.
 
 
1 hour later…
9:44 AM
Yo guys
Do you prefiere '@/mycomp'
Or '@mycomp'
?? Is there a draw back for the second (personnal choice)
And why does vue use the first one in its default configuration ?
 
@Baldráni the @ sign is used for import statements. Lookup in import docs to comprehend what it really means
 
In css only no ?
 
it has a meaning in CSS as well
btw this question covers it very well
 
Ho but I know haha
I'm asking my self if I should not change this
    alias: {
      ...
      '@': resolve('src'),
    }
To
alias: {
  ...
  '@': resolve('src/'),
}
Because I find the @/ syntax uggly
 
personal preference. I use the first one
 
9:52 AM
'Right
I'll stick to it then
But I think taht I saw in Vue 3 the second syntax
Not sure tough
 
10:08 AM
hi guys i am caught into something
i m using summer note text editor and doing a validation
on submit
and while i do that
when nothing is entered into the editor
and I do a
$('classname').html();
it is returning the below
"
"
I really don't know where it is coming from
if i do
$('classname').val();
which cannot satisfy my requirement
$('classname').htl('');
$('classname').html('');
is not working
 
What is the name of this, please? I cannot figure out how to readmore to understand what im looking at:

```
const getError = this.errors[firstKey];
const text = this.customErrors[firstKey] || getError(controlErrors[firstKey]);
```
why can it be called as a function and how does it tie together?
 
anyone having some idea about how to send email to multiple receipient using sendGrid nodejs
im able to do for a single receipient or CC, but not to multiple.
also i treid to find about personalization, but i nothing to my success.
 
@rtpHarry with only those two info, I can only say "poor variable naming". I guess that this.errors is a structure (be an array or object, dependent of firstKey) that contains functions
you can pass around functions in JavaScript
@SamSam I believe someone put a link to a doc with the info yesterday
 
Its from this tutorial
https://netbasal.com/make-your-angular-forms-error-messages-magically-appear-1e32350b7fa5
https://stackblitz.com/edit/netanel-control-er
ah yeah, that makes some sense, I was assuming it was just text, but it could be a function thats returned
 
@SamSam if you are using v3, this should help
 
10:23 AM
yep you are right, its an array of lambda's... thank you @KarelG, I thought I was seeing some kind of new trick :)
 
how to figure out
enter
in js
the key enter in a text area
 
10:40 AM
@CommonMan listen to keypress and look for code that is an enter
 
 
1 hour later…
11:46 AM
@KarelG :47534677 ya i have already tried that but i get the below issue
sgMail.send is not a function
 
did you check if the import is done right?
and for yours use case, you need the second example
 
i tried this
@KarelG the second example sends the mail seprately, kind of looping. i want to send one mail with multiple To, CC, BCC
 
ah. ok then use the .send
just provide an array of your recipients. And for CC ...
BCC is rarely used. put that in CC lol
 
haha, yes i already tried, but as i said im getting issue
sgMail.send is not a function
 
how are you using it? Show the import statement and when you tried to call it
hmm the docs does not tell about CC's
was going to see if it accepts an array
oh it supports bcc
just do the same for cc/bcc as that "to" if you want to send to multiple recipients as cc/bcc
 
12:06 PM
Henlo!
Quick (hopefully) Jest question: I am working on a project that runs jest with TS diagnostics enabled. I would like to write tests for the private functions as well. Any sensible approach to this?
 
@KarelG yes KarelG, but im still trying to find a way to send multiple 'to'
 const sgMail = require('@sendgrid/mail');
        sgMail.setApiKey(process.env.SENDGRID_API_KEY);
        const msg = {
            to: 'test@example.com',
            from: 'test@example.com',
            subject: 'Sending with SendGrid is Fun',
            text: 'and easy to do anywhere, even with Node.js',
            html: '<strong>and easy to do anywhere, even with Node.js</strong>',
        };
        sgMail.send(msg);
also i tried with
const sgMail = require('sendgrid').mail;
but it doesnt read the send method
 
And you definitely have v3 installed?
 
@SamSam again, it is just an array ...
 
to: ['test1@example.com', 'test2@example.com', 'test3@example.com', ......],
cc: ['cc1@example.com', 'cc2@example.com', ....],
@SamSam check which object you are importing
 
12:16 PM
@KarelG Indeed @Karel, i have tried this only, wait i will share the exception which i get when i pass and array of emails
 
Ah, found an answer to my stuff. gtg again, byeeeee
 
Authorization, Content-Type, On-behalf-of, x-sg-elas-acl
is the exception i get
 
12:40 PM
Hey look, it is I with another Jest question!
I got a function that itself is not async but it contains promises chained with then. The idea in the original code is that there is a webrequest that is then processed by calling other stuff internally. Is there a proper way to test whether a method is called in the process of that then chain?
I know I can test async methods with await or .resolves/.rejects but I may not change that methods signature (so it may not return a Promise that I could wait for) but I am lost in this case.
 
@SamSam seems a different problem. The send function is working. However it tried to send a request but failed to do so.
check if yours client is set up correctly
(really, read the docs .__. )
that API key is probably not correct
 
Also dunno what I can properly search for because stuff like "jest wait for promise" obviously returns more stuff where people return promises and not promises that are evaluated inside an otherwise synchronous function
 
<-- not using jest
 
excuses
 
1:07 PM
@karelG there is something strange around. when i use require('sendgrid').mail
it gives me that issue of send is not a function. but when i use require('@sendgrid/mail') then it is working fine
 
you need to understand what require does
 
i did npm install @sendgrid/mail, so now i have two directories in nodemodules,
1. sendgrid
2. @sendgrid
 
it is obvious for me why it happens.
@SamSam they're both same library, only 2 is scoped
bin that second module and fix your initial error by checking if your API key is correct
 
i did npm install @sendgrid/mail
 
> bin that second module
= cleanup
jeebus. You can give a person some gray hair issues.
 
1:20 PM
I can do that too \o/
Still stuck on my issue; managed to cheat one promise function thing further by calling await Promise.resolve() but that surely isn't the proper way I am sure...
 
Well, Im kinda stuck once again
I keep running into a point where Im out of options to code with
like I dont know what to do next
 
okokok, hear me out!
Setup a project where you got a synchronous function that returns a string but internally calls fetch and calls another method with the json of the response. Then you write a test for method requesting to make sure the other method is called!
 
anyone here familiar with testcafe js
 
and then tell me how you did it because that is what I am stuck on currently
 
hmmm
I actually have no idea what you just said XD
 
1:33 PM
yeah that's pretty much my current state as well
 
whya re you returning and calling strings
 
I wrote a module for Quill that (when an oEmbed URL is pasted into the editor) requests the details for the embed and inserts it. Because the handler has to return a Delta, I cannot make the function async. So what I am doing is the following:

return the delta that was passed to my handler
make the request
convert the response to the embed I want
place the embed into the editor
remove the pasted url

Everything after "make the request" is done with then calls on the promise returned by fetch. I still want to make sure that the methods for inserting the embed and removing the URL are called
 
Quill :o
 
Hey, I am doing anything to get my free shirts
 
free shirts?
 
1:37 PM
hacktoberfest is on
 
ah
 
The quill module is PR number 4 for this month so that is my digitialocean one.
And sensenet is also giving away shirts for the first 100 people to make proper PRs to one of their repos and greedy as I am... Well you get the idea (:
 
@geisterfurz007 that is just chaining the promises, no?
 
Now I am stuck writing unit tests for a module because otherwise codecov blocks the PR on github :D
paste.ofcode.org/37FPSGuxEFAQwnmPhyDF4aQ That is the code I need to test. But as the method does not return a promise, I don't know when the fetch is done and I don't know any way to wait for the promise chain to complete. I want to test for example quill.deleteText in line 16.
Or am I missing something blatantly obvious?
 
you can wait on a promise
 
1:44 PM
How would I do that in that case? I don't have access to the promise chain from the tests, do I?
 
depends of how you write it
 
How would I have to write it? I cannot have pasteHandler return a promise because I need to return a DeltaStatic from that method.
I could make a local variable for that promise chain and a getter for it but that seems mildly overkill just to write a test.
 
should cover it very well
it is just
async function foo() {
  const json = await fetch().then(resp => resp.json());
  const somethingElse = await myOtherPromiseFunction();
  ect
}
 
oh
great, now I feel stupid
So throw all the promise stuff in it's own method and write a test for that because I can return a promise from it which in jest I can wait for?
 
yes
if you do return something in an async function, it is always wrapped as a promise object
eg
 
1:50 PM
Yeah, now I feel really stupid
 
async function promiseMe() {
  return 1;
}

promiseMe().then(val => ...val is 1...)
 
Yeye, I know what async and stuff do, I was just so caught in the thought that I may never return a promise anywhere in the whole thing because I need to return a clean Delta
But thanks :D
 
eh don't worry. There is people that does "forget" - or not know - that async function always returns a promise
that is actually the most important detail of async function. but yeah. probably c/p-itism
 
was c/p-itism?
Also: Is there a common promise no-op? I am getting the warning that the promise is ignore so I just want to add a no-op then. Do I just put .then(() => {})?
 
no op is nothing
 
1:57 PM
I know
I just want the warning to shut up so I want to place a then there that does nothing
 
.then seems redundant if it's a noop
 
For execution of the program that is absolutely correct and I am aware of that but again: I just want the warning gone
 
I know, just commenting on the quirks :P
 
._______.
 
 
1 hour later…
Jay
3:13 PM
I have an asp:Repeater with dynamically created rows and I'm trying to add a checkbox to each row, and another checkbox up at the top that selects all the children checkboxes
Anyone have experience making one of those with jQuery?
I have to do it on the front end because idk how many rows they'll have and I'm struggle bussing getting it to work
 
Sounds relatively simple
select the rows, append a checkbox
 
Jay
The checkbox exists, I'm just trying to get the one at the top to actually select all
 
on change, select all, make values match
 
Jay
okay
and that covers toggling, okay I'll try that thanks Kevin
 
4:16 PM
Any good resources to practice reactJs
 
I have a listview that has a collection of items and clicking on one of those items opens a webview with that url. I want to keep a copy of that url for that specific item and access it somewhere else in my app. What's the best approach to do that? (Using React, Redux-Saga, etc..)
 
 
2 hours later…
user7437719
6:00 PM
A fisherman I see!
 
user7437719
I execrate how long it takes for an edit to be approved in the edit queue
 
user7437719
I made a tag wiki edit 2 days ago and it finally got approved today
 
user7437719
2 days! come on!
 
user7437719
That is just completely unbelievable whatsoever!
 
user7437719
I say all people that have enough reputation for edit queue do it now!
 
user7437719
6:06 PM
There are tens of thousands of people that have enough reputation and it takes 2 days for an edit approval!
 
user7437719
Anyways, I made a burniation request on meta:
https://meta.stackoverflow.com/questions/390214/gadzooks-a-wild-xcode-server-just-appeared
 
user7437719
And it got a decent amount of downvotes; however, my reputation remains the same!
 
user7437719
Maybe meta posts do not affect your reputation. I never heard of that though.
 
user7437719
7:06 PM
When I hover over the supposedly "users currently in this chatroom" list it says everyone has been seen under a minute ago
 
user7437719
I wonder if this is on SO as a whole or just this room
 
user7437719
Because no one is saying anything!
 
user7437719
Perhaps a ping to @KevinB will work!

Hey KevinB, are you a moderator of this room? I forget..
 
8:55 PM
Hello guys, quick question. When I have array of objects and I am trying to make a deep copy of it, is there a better way other than parsing it into json and then back into array?
 
eh, "better" is a weird way of putting that
 
as in, is there a way that people prefer? It feels odd to do that whenever I need to make a copy, and I am not sure if there is a different way
 
it's certainly an easy and effective way of doing it, assuming all the values are json-viable
 
00:00 - 21:0021:00 - 23:00

« first day (3281 days earlier)      last day (1684 days later) »