« first day (4588 days earlier)      last day (582 days later) » 

09:40
Hello
How to get an array of day name (Mon, Tue...), day number and current month ?
for example, today is is 05/09
how to get all days of 05th month
Not strictly javascript but this is breaking my npm build so I thought I'd ask here - what does this >>> notation mean in CSS? I've never seen it before and I can't google it bc it's symbols rather than text: #welcome-message >>> .welcome-username
10:26
@BobTway I don't think it's valid CSS. CSSLint seems to agree. Normally > is seletor for immediate children and #welcome-message > .welcome-username is valid it means "any element with class which is immediate child of an element with ID welcome-message"
However, multiple > should be invalid. As I said, tried it in CSS lint and it did give me an error on those.
10:50
@VLAZ thanks. Not sure why one of my predecessors checked that in, then!
11:01
@MileMijatović Get the list of dates for a month, then format them. Here is one option which uses the default formatter. You can tweak the parameters of the formatter to change how months/days/whatever is shown. See the docs for options.
If the default date formats don't work for you, then you can still use .formatToParts() to get the date representation as strings and then re-arrange if needed. Here is an example
11:18
im in a little pickle with code generators
we use graphql a lot so we have a lot of schemas which define data models
but to use those models in TypeScript, we want to have interfaces describing how those models look like
but the code generators will not be able to accurately generate models the same way as how we, as developers, would generate them
for example, some wrapper models should use generics, but the code generator would have a hard time figuring that out because graphql has no generics in their type system and just generate more types for each of the options
or some queries use Any for which it cannot figure out what the data actually looks like
so: manually create tons of models
or: have auto-generated messed-up models
or: generate models and then manually edit them
or is there a better option?
 
3 hours later…
14:19
might want to write a custom one with the TypeScript's Compiler API? It won't be easy, but it looks like you need a customized solution anyways, @Wietlol
15:08
How to stop the looping with setTimeout?
async function main() {
  let isComplete = false;
  let counter = 0;

  async function job() {
    while (!isComplete) {
      console.log(++counter);
      await Promise.resolve();
    }
  }

  setTimeout(() => {
    console.log("Never gets called!");
    isComplete = true;
  }, 1000);

  await Promise.all([job()]);
}

main();
@TheRealMasochist Erm, you can do it. You need to delay off the mactotask queue, instead of the microtask queue. However, that's probably not a real solution. What is that code actually supposed to do? Seems like "fixing" the setTimeout is an XY problem.
You can also drop the setTimeout entirely and check if enough time has elapsed in the microtask. Again, though - seems like a hack around the real problem. It seems like you're trying to "wait" for async task to finish. By introducing a busy loop. With an await it wouldn't block the thread but it would also still just delay off to the microtask queue indefinitely, since microtasks have priority to macrotasks, thus the setTimeout callback will never be invoked.
15:41
Another failed attempt:
let observable = new Observable((observer) => {
  observer.next();
  setTimeout(() => {
    observer.complete();
  }, 1000);
});

let isComplete = false;
let counter = 0;
observable.subscribe({
  next() {
    while (!isComplete) {
      console.log(++counter);
    }
  },
  complete() {
    isComplete = true;
  },
});
Objective: The code prints counter as many as possible in 1 second.
If you want as many as possible, then you don't need any async at all
Since delaying off the microtask queue is still going to take some amount of processing. You want sync code.
So...yeah, still XY.
let start = Date.now();
while(Date.now() - start <= 1000)
  console.log(++counter);
@TheRealMasochist what's the point of trying to do this?
This does block the thread for a second. But it is the fastest. You can add a micro or macrotask tick every, say, 300-500ms if you want other things to also run in that second. It would likely reduce the count but make the UI actually do stuff.
But yeah, what's really the point?
You can also omit the loop and do counter = 100000000
No non-trivial purpose. I just want to learn whether there is a solution to stop looping with setTimeout. :-)
Yes. You need to allow macrotask ticks.
However, at that point it's trying to use a screwdriver to hammer a nail.
If you need a loop, use one. If you need to delay something with setTimeout, then use setTimeout. Mixing the two rarely makes sense.
15:53
@TheRealMasochist what do you mean by "stop looping", btw?
I was expecting await Promise.resolve(); releases the thread for other tasks.
It does. But schedules the next execution as a microtask. And since microtasks have priority, it's handled before the macrotask setTimeout creates
And since it keeps adding microtasks, the macrotask queue is never emptied.
@OlegValteriswithUkraine Looping stops after setTimeout sets isComplete=true.
why not just use a recursive setTimeout then?
what it seems you want to do is called polling
@VLAZ did you mean microtask queue is never emptied?
15:57
No
The macrotask queue is never emptied. Because only microtasks are handled.
while(true) {
  if (microtasks.length > 0)
    handle(microtasks.shift());
  else if (macrotasks.length > 0)
    handle(macrotasks.shift());
}
More or less that's what the event loop does. When each microtask always creates another microtask, then you never get to the macrotasks queue.
@TheRealMasochist they mean that since the microtask queue is drained to completion on each iteration of the loop. It also accounts for new microtasks added to the queue, so if the userland queue keeps scheduling microtasks...
I see. thank you all.
@OlegValteriswithUkraine errata: "since" is unnecessary
 
2 hours later…
18:12
posted on May 09, 2023 by Ben Mason

Hi everyone! We've just released Chrome Stable 113 (113.0.5672.109) for iOS; it'll become available on App Store in the next few hours. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Erhu Akpobaro Google Chrome

posted on May 09, 2023 by Erhu Akpobaro

 Hi everyone! We've just released Chrome Stable 113 (113.0.5672.109) for iOS; it'll become available on App Store in the next few hours. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Erhu Akpobaro Google Chrome

18:52
!!choose keeper phasmalist
keeper
 
2 hours later…
20:28
@KevinB do you depend on James for things? He chooses for you? 😂
entertainment, at best
i already know which one ima pick anyway
james usually agrees, FWIW, lol
20:45
@KevinB good advice lol, I may do this in the future
 
2 hours later…
22:36
posted on May 09, 2023 by Matt

The Stable channel is being updated to 15393.48.0 (Platform version: 113.0.5672.114) for most ChromeOS devices and will be rolled out over the next few days. This build contains a number of bug fixes and security updates. If you find new issues, please let us know one of the following ways: File a bug Visit our ChromeOS communitiesGeneral: Chromebook Help Comm


« first day (4588 days earlier)      last day (582 days later) »