« first day (4400 days earlier)      last day (770 days later) » 

04:53
Hey guys, I have been reading about Promises in javascript. The MDN article suggest that old-fashioned passed-in callbacks lack some features that Promises have, especially the relation to The event loop Do you guys know of SO questions that discuss this?
05:09
@user31782 The article seems quite clear on these. What questions are you interested in?
 
3 hours later…
07:48
@VLAZ being an early bird today?
My apologies...
can anyone hint, why this answer is liked?
https://stackoverflow.com/a/15252131/10141885
@halt9k 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.
feels like just checking order of letters has nothing to do with fuzzy search
@VLAZ won't give you asylum @ Canada. Not enough flair. Not enough intonal feeling
07:55
@halt9k Yeah... well, sort of but not what I'd classify as fuzzy. It seems to check for skipped characters: "sack hand" matches "a haystack with a needle" which I guess is fuzzy-ish but only in one particular way. Not in terms of variations. E.g., I'd expect fuzzy search to also be able to catch stuff like "beer"/"bear" (one character difference).
Other than that, it seems to use fancy looking symbols. Lots of users seem to like seeing fancy looking code. Even if it doesn't do what they want, or maybe it doesn't even work.
@KarelG uhm, just in case. I'd like an asylum too :P
that algo aint fuzzy search
I guess it's "not exact" search. But to be honest, I have trouble expressing what "fuzzy" would really be.
but such answer is upvoted like it perfectly solves the problem, so strange
as if something tricky is hidden
@halt9k You'd find answers with upvotes in the hundreds. And the answer would be horrific. The only hidden thing is that lots of users don't actually understand the answers.
07:58
I've seen various answers that I don't want to see in production being upvoted, even garbaged (-2 in coderev) one.
that algorithm would even give me true on tan
Yes. And in sufficiently large text, it would give you a lot of trues
use the upvotes as an indication, but always take answers with a grain of salt. Comprehend it, see if it fits your use case
this is likely being upvoted by those that did some copy/pasta and tested out on their minimal use case (one or two words)
no problem, thx for checking... now simple question left - how to do a regex dictionary search in long text with marked position on feedback, uhm
08:14
if you're using RegExp then you can play with lastIndex property
apparently, may be easier than expected, people are great :) github.com/leeoniya/uFuzzy
@KarelG idea was to mark found keywords on page, so if it does not return firstIndex, won't be enough; thanks for hint - not sure if embedding uFuzzy library in user script will be possible
@halt9k Embedding it should just be // @require https://raw.githubusercontent.com/leeoniya/uFuzzy/main/dist/uFuzzy.iife.min.js
Well, unless GitHub would block those requests. Can't remember if they do or don't. But you can always just grab the code and put it into your userscript.
Wait, it's not @require is it? Ugh, how did you request resources in meta-blocks again?
Oh, right it is @require. I was just having neurons misfiring.
09:06
it is @reqiure, just it will be 9th external and already got complications on 8th added external (caching started to fail consistently without https)
so slightly concerned for more unpredictables to happen, like some sort of EM5 vs EM6 conflict
but soon will check
@halt9k I wished from time to time that the browser's search tool (find in page) is supporting regex
I think there was Firefox plugin which searches multiple keywords simultaneously, and additionally to regex there is this fuzzy search
that makes in total 3 modes- relation between fuzzy and regex is something special
09:23
probably all merged into a single function that works by Levenshtein distance
hmm ... got a bug from manual testing. Went in code, found the culprit, wrote unit test to reproduce it and it became green
totally-not-expected
either I am on wrong place or something voodoo has happened behind the scenes
Probably just ghosts.
that's not exactly about unit test, but about that voodoo case - once I had bug that reproducible only if IDE is running.
I couldn't believe when discovered reason.
That was one bug worth drawing a star somewhere.
Turned out that application was using clipboard in one of the routines and IDE plugin was not only tracking it, but managed to somehow hang clipboard so "my" application failed on one of random accesses somewhere after 50th attempts (!!!)
Of course no way to track it normally, no way to reproduce - when you debug all works fine.
09:44
Hello
Can you help me
  const setSortedRowData = useCallback(
    (filteredData, sorted) => (filteredData = sorted),
    [],
  )
I have this callback
  useEffect(() => {
    const accessors = columnData.map((column) => column.accessor)
    const displayedRowData: Array<TableRowData> = []
    rowData.forEach((row, index) => {
      const rowId = row.rowId
      displayedRowData[index] = { rowId: rowId }
      for (let i = 0; i <= accessors.length; i++) {
        const prop = accessors[i]
        displayedRowData[index][prop] = row[prop]
      }
    })
    setSortedRowData(state.filteredRowData, displayedRowData)
  }, [rowData, columnData])

  // uwc-debug
and when I try to update setSortedRowData, in the bottom useEffect, it's always empty string
Why it's to hard to update data like this ?
What's wrong in my code
10:04
I don't like code without semicolons
@MileMijatović debug it?
but your answer probably lies in that useCallback function. What is it?
what does it return?
ect
meaning: debug your code
Yes, it's definitely an issue with useCallback function
I created it because when I move the code from useCallback into useEffect, works properly, but linter does not allows me to push the code
expected to import the whole state as dependency, which I don't want to do
I want to explicitelly import dependencies
like state.filteredRowData
in this case I provided, state.filteredData is empty string
But I am trying to pass the data from useCallback to avoid providing uneccessary deps
@KarelG, I am using uwc-debug for debugging, and state.filteredRowData is always the empty
https://github.com/simbathesailor/use-what-changed#readme
I have a complex interface that has properties that are arrays, it looks like this:
export interface {
export interface Fundamentals {
BookValue: number;
DilutedEpsTtm: number;
DividendShare: number;
DividendYield: number;
EarningsShare: number;
Ebitda: number;
EpsEstimateCurrentQuarter: number;
EpsEstimateCurrentYear: number;
EpsEstimateNextQuarter: number;
EpsEstimateNextYear: number;
GrossProfitTtm: number;
MarketCapitalization: number;
MarketCapitalizationMln: number;
MostRecentQuarter: string;
@DanConsultant 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.
10:39
@DanConsultant What is this.jsonData? Evidently it doesn't have this.jsonData.Earnings.History which is an array. But knowing what it isn't doesn't tell you what it is. And you need the latter to figure out what the correct way to handle it is.
this.jsonData is a property on my component defined as follows:

jsonData: any;

The data is loaded correctly because when I write to console I see the data loaded into the property. I write to console as follows:

console.log("data --->", this.fndFundamentals.EarningsQuarterly);
10:59
It doesn't matter what it's defined as, since evidently the type information for it is insufficient. Otherwise you wouldn't have needed a type assertion. And the any does confirm it. We don't know what the current and real information looks like.
You've written a console log and you see something but we aren't psychics. We do not actually know what you've seen or haven't seen.
@VLAZ yup, they do not block those - that's exactly how I load a couple of utility packages in my userscripts here
 
1 hour later…
12:33
hi i have worked a lot in react and moving to next js anybody here to make a resume project with me on github.
@ShreyanshGupta 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.
 
2 hours later…
14:41
🤔
15:17
Santa!
It's early for us, because we have another "good guy" for children in our culture; "Sinterklaas" (or Saint Nicolas). Basically a cousin of Santa
so you won't see this here
would confuse kids
@KarelG But...but... Santa Claus is Saint Nicolaus. The Spansishised version coming through the Dutch does refer to the same person.
nah, to that Saint that went to Turkey ect
oy just checked it
we just took over the culture, like valentine, Black Friday or other "open-your-wallet" days ...
who cares :D - kids gets 2x stuff
i don't celebrate it, but generally i consider it a fairly pleasant time of the year, so I always update my avatar. Only updated it early this year to annoy people who hate xmas
My avatar on Discord is the Christmas hat. I had another one, then one year Christmas rolled in. I had a transparent PNG with a christmas hat that you're supposed to overlay on another avatar but I just went ahead and used the PNG as my avatar. It was 1. funny 2. I was too lazy to edit my avatar just for that. I then just didn't actually update my avatar since. So it's been the hat for, like, four years now.
i need to work on my minecraft skin, with vault hunters resuming soon
15:35
@KevinB you've probably categorized me in that group? :P
no, didn't really have anyone in mind
@KarelG Dunno, are you pro-Santa, or do you actively plan on destroy all the joy in the world?
(joking)
I've been member of a group on Steam that somehow (did not know before) wants every member re-decorate their avatar at each "important" day in the year.
lol, am lazy
yo
o/
15:38
left the group eventually. Those remarks or pressure aint worth the fun in the discussions there
the only steam groups i'm a member of are all dead
@KarelG Too many days in the year. Not sure how many are "important" but probably too many, as well.
@JBis \o
posted on November 02, 2022 by Ben Mason

Hi everyone! We've just released Chrome Beta 108 (108.0.5359.28) for Android. It's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Krishna Govind Google Chrome

16:02
|| shrug
¯\_(ツ)_/¯
it also depends of the person when a day is important
16:45
 
3 hours later…
19:23
Error: Abort fetching component for route: "/dashboard"
When I redirected from 'auth/login' to /dashboard' page
Do you have an experience
19:35
no, but there's a number of google results that look interesting
 
1 hour later…
20:49
@Glaucco Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. 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
Hello, can anyone help me? I am not able to receive the value of the base and height:
let base = prompt("Informe a base: ");
base = parseFloat()

let altura = prompt("Informe a altura: ");
altura = parseFloat()

function calculaArea(base, altura) {

    return base * altura;
}
{
    alert("A área é: " + calculaArea())
}
let base = prompt("Informe a base: ");
base = parseFloat()
these two lines are problematic
@KevinB how do i solve this problem?
base = parseFloat() what was this supposed to do?
ditto for the following 2 lines
i'd assume it was meant to parse the user input as a float
currently it... overrides the user input with whatever parseFloat with no param returns
!!mdn parseFloat
21:01
presumably you meant base = parseFloat(base)
@KevinB correct
21:17
@KevinB
I tried to solve it and I couldn't, sorry
let base = prompt("Informe a base: ");
base = parseFloat(base)

let altura = prompt("Informe a altura: ");
altura = parseFloat(altura)

function calculaArea(base, altura) {

    return parseFloat(base) * parseFloat(altura);
}

 alert("A área é: " + calculaArea())
that should work
what's wrong with it?
i see
function calculaArea(base, altura)
your function accepts 2 params
you passed it 0
@KevinB The result is wrong, the result is always: NaN
NaN * NaN is NaN
@KevinB I know that song!
@KevinB yes
@KevinB I need to get the result of base and height multiplied
@KevinB calculating area of square
21:25
right
fix that issue i pointed out and it'd work
@KevinB Thank you very much, it is working perfectly. Do you have a website or course you recommend me to learn JavaScript?
21:44
no
21:55
posted on November 02, 2022 by Srinivas Sista

 The Beta channel has been updated to 108.0.5359.30 for Mac and Linux and 108.0.5359.29 for Windows. A full list of changes in this build is available in the log. Interested in switching release channels? Find out how here. If you find a new issues, 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. Srini

posted on November 02, 2022 by Release Managers

The Beta channel is being updated to 108.0.5359.24 (Platform version: 15183.28.0) for most ChromeOS devices. This build contains a number of bug fixes and security updates and will be rolled out over the next couple days. If you find new issues, please let us know one of the following ways File a bugVisit our ChromeOS communitiesGeneral: Chromebook Help CommunityBeta Specific:&nb

22:23
Hey all, qq - If you have multiple variable names that may or may not be defined, and you want to return the value of any one that is defined (not thinking about precedence atm), how would you do that in as few characters as possible?

Here's where I'm at so far:
@Navigatron 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.
(typeof a!="undefined"&&a) || (typeof b!="undefined"&&b) || ...
Using && short-circuiting to avoid the reference exception
22:53
@VLAZ about the fact that why does old-fashioned passed-in callbacks execute before the completion of the current run of the JavaScript event loop.

« first day (4400 days earlier)      last day (770 days later) »