« first day (4015 days earlier)      last day (932 days later) » 

12:15 PM
!> (0.5).toFixed(0)
 
12:28 PM
||> (0.5).toFixed(0)
 
@VLAZ '1' Logged: [ ] Took: 0ms
 
@paul23 ^
 
||> (0.005).toFixed(2)
 
@paul23 '0' Logged: [ ] Took: 0ms
@paul23 '0.01' Logged: [ ] Took: 0ms
 
hmm
bot is different from chrome XD
 
12:34 PM
Seems OK
 
1:04 PM
yo guys
have a lil bug in my page, i try to close a select when i open one ($this)
this is my js
  // Close all select when $this's open >> #meruem
  $(".job-filters-dropdown details").each(function (index, value) {
    $(this).on("click", function (event) {
      $(this).find("summary").attr("aria-expanded", true);
      $(this).find("summary").attr("aria-pressed", true);
      $("details").not($(this)).removeAttr("open");

      $("details").not($(this)).find("summary").attr("aria-expanded", false);
      $("details").not($(this)).find("summary").attr("aria-pressed", false);
    });
  });
that works in the first time, but when i check an item and i click on other select, the other one still open -_-
Any help, ideas ? x/ x/
 
1:39 PM
try .each to loop other elements
 
@Mr_Green what elements ?
 
||> (2.555).toLocaleString('nl-nl', {style: 'currency', currency: 'EUR'})
 
@paul23 '€ 2,56' Logged: [ ] Took: 458ms
 
||> (2.555).toLocaleString('nl-nl', {style: 'currency', currency: 'NLG'})
how can I know what currency locales are supported :/
 
5
Q: Get List of Supported Currencies

Lonnie BestOther than just guessing (like I've done below), is there a more direct and efficient way of reflectively retrieving a list of all currencies supported by your JavaScript environment? function getSupportedCurrencies() { function $(amount, currency) { let locale = 'en-US'; let option...

I've not tried it, though.
||> const locales = ['ban', 'id-u-co-pinyin', 'de-ID'];
const options = { localeMatcher: 'lookup' };
console.log(Intl.NumberFormat.supportedLocalesOf(locales, options).join(', '));
 
1:53 PM
@VLAZ undefined Logged: [ '"id-u-co-pinyin, de-ID"' ] Took: 32ms
 
But you can only check the locales out of a given list. Not come up with the list.
 
 
2 hours later…
3:37 PM
@mitsu I meant this $("details").not($(this)).find("summary"). Try looping this like $("details").not($(this)).find("summary").each
 
Using flatMap to get the correlating day from the Days Array and applying it to dayArray.
How can I get the employee value outside of that array in the original object to use https://jsfiddle.net/BeerusDev/kzrwdnxo/169/
 
3:56 PM
@Mr_Green but $(this) can not exist outside or before .each like you said here : $("details").not($(this)).find("summary").each
 
4:29 PM
@VLAZ I guess I just "guess" the currency is understood by the browser. Using mollie
So limited to that list of supported currencies anyways
 
@paul23 I'm not even sure what you're supposed to do if a locale is not supported. It seems like an infinite problem if locale A doesn't work, you have to try B. But if that doesn't work you have to try C. Basically forever. Well, chances are that some locale would finally be supported (e.g., "en") but still. But what if it isn't? Perhaps some Chinese PC is only guaranteed to support "ch". The Intl stuff can probably be more robust in some ways. Until then, I think a library might be better.
 
currency is btw not "locale"
it's weird, but you can talk about "euro" also in the US.
so I would basically call it like:
||> (2).toLocaleString(undefined, {style: 'currency', currency: 'USD'})
 
@paul23 '$2.00' Logged: [ ] Took: 132ms
 
which would use the local locale - but a currency given by the website
(locale determines how the number is converted, as well as where the symbol is located) - currency determines the symbol
 
4:46 PM
Sorry, I meant the Intl.NumberFormat.supportedLocalesOf() - that is checking locales and only ones that you explicitly give it.
Fundamentally, you'd probably have the same problem with currencies. If one is not supported, then what do you do? You try another? What if that's not supported?
 
||> (2).toLocaleString(undefined, {style: 'currency', currency: 'ABC'})
jamesbot isn't the fastest :P
Returns ""ABC 2.00" in console.
 
James ran out of change and went to the ATM.
 
so it seems to default to the given isocode
 
Is it possible to get the width of an element that's just a document.createElement node? Without adding it to the DOM?
The width is specified in CSS rules
 
@duhaime I'm not sure if you can do it while it's detached. But you can always attach it to a hidden element/iframe and check there, I suppose.
 
4:55 PM
Yes but I'm afraid that'll slow me down. I have lots of potential nodes (1M+ in the worst case)
Is there a hack to avoid having to touch a DOM?
 
Not sure, TBH.
 
well, the issue is...
 
1 hack: read the css rules (assuming static sizing in css)
 
the width depends on css
font size/style/family, line height, word wrapping, padding of the container, margins, widths, display, position, float, so many things that don't have an effect until the element is rendered.
Is there a reason to get the width?
 
@duhaime That works as long as you're certain that no other CSS would affect the element. E.g., if you have <div class="hello" style:"width:100px; boder:1px"></div> then the width might be 102px (width + two borders) or it might be different if there is any CSS rule for the class hello
 
4:58 PM
ya no doubt
 
However, if you're certain that the elements will be affected similarly by something (e.g., same class) you can add one to the DOM, measure it, then cache that calculation for the rest.
Let's say they all differ only based on the width value, if the first one is width:100px and the actual size is 120px then you can guess that width:85px would produce an actual size of 105px. Again, that only works if they are all going to only differ by one thing.
 
Are you trying to calculate how wide a column needs to be to accommodate all of its children's content?
 
If the content is different (e.g., different text) or they are placed in different containers that distort them, then that's not necessarily accurate.
 
a common issue for sticky headers on tables
my favorite solution to that problem is not trying to recreate excel in a web browser
 
ah I'm trying to prevent little divs from overlapping
 
5:11 PM
> Remy's Law of Requirements Gathering: no matter what the actual requirements, what your users really want is for you to implement Excel.
 
i've sat through two hour long meetings now that described to me a new app, that currently only exists in excel. i could sum up the app in ~ 5 sentences with web technology
probably less
data gathering app, with a reporting backend
¯\_(ツ)_/¯
 
5:38 PM
posted on October 13, 2021 by Prudhvikumar Bommana

The Beta channel has been updated to 95.0.4638.49 for Windows, Mac and Linux. 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. Prudhvikumar Bommana Google

 
5:55 PM
can one generate a random float in css yet?
 
excel is great for none programmers, because it gives muggles a taste of the flexibility programming offers
but if you are a programmer, your often like bleh
 
This guy brings Excel to another level: towardsdatascience.com/…
 
I love it
See also the Turing Completeness of Magic: the Gathering arxiv.org/abs/1904.09828
 
DRP
6:10 PM
Hi Dearest Oracle experts, it has been a long time now and in need or your wisdom.

Issue is concerning React state. Basically I have a 3rd party component that provides a method that I need to call with the most updated state. The catch is that right before that method call, the setState is used to actually update the value.

As you all know useEffect/componentShouldUpdate is the defacto approach to do post work concerning state. The callback provided in this.setState does not work for this matter.
 
use React's useState
const [data, setData] = useState('yeet')
 
DRP
same deal, has to be at the top of component
useState and setState behind the hood, puts state in a Queue
 
What?
What are you trying to do?
 
DRP
yup... let me get reference link
 
Are you trying to create a stateful text input?
 
DRP
6:16 PM
on one side yes, the input is a controlled element
 
what's on the other side?
 
DRP
on the second hand I want to keep an array of those inputs, so that I can post manipulate them
so when user hits Enter, thats when that text gets added to the array, and the onChange method which is inyected by this other component gets called
 
so keep track of all previous states of the input?
 
DRP
yes, and when Enter is pressed use this onChange prop inyected by the Parent component
the tricky part is not so much keeping track of previous states, but that when onChange is called, it actually has the most updated state
so usually I would do useEffect in hooks or componentShouldUpdate in classes, however that would mean that I can call that onChange method which is being inyected, which is not possible
 
posted on October 13, 2021 by Harry Souders

Hi, everyone! We've released Chrome Beta 96 (96.0.4664.7) for iOS: it'll become available on App Store in next few days. You can see a partial list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Harry Souders Google Chrome

 
DRP
6:21 PM
After research i've come across debouncing approaches, however these are mostly for throttling api calls i.e input is empty hence no need. i.e lower aws $
I've seen useRef posts around, but this also is not usefull for this case.
To give more context, this <Field /> component actually belongs to react-final-form, so what that does is keep the it's own centralized state
It does provide some props, which in this case is the onChange method for controlled approaches, which is fine , i've been able to work with it no problems, until this specific chicken/egg scenario
Something that is consistent, is that if I hit Enter a 2nd, 3rd ,4th time, values get consoled properly except the most recent inputed value
so Enter first time with "foo" will show [], Enter second time with 'var' will show ["foo"] and so on
I can't seem to find a way to pivot the useEffect/componentDidMount into the <Field/> component
 
DRP
add line 12
  setL([...l, v]);
  console.log("l::",l)
will not log latest input
 
But don't you know the latest? It's l + the new value
if (e.key === "Enter") {
  setL([...l, v]);
  alert([...l, v]);
}
 
DRP
6:37 PM
hmmm you got a point
one sec plz
duhaime much gratitude
thats the fix, so obvious , so simple in plain sight, my mind was blinded , no need for complicated things i went over 2days now..
thanks so much
If you want I can post the question as much as possible so you can put answer, whether it matters to you
btw did not need the useRef, just the spread and adding the value
looks like a deserve a DUH! lol
 
My pleasure! Add me on LinkedIn if you want, and stay in touch linkedin.com/in/douglas-duhaime
ah yes, that's an improvement. The ref is just habit :)
 
DRP
6:54 PM
havent updated that in a while, but sure , will connect, take care
 
 
3 hours later…
9:36 PM
Hello
How to decode response from API ?
so, if I have <b> , text should be bolded
and not as <b>IN PROGRESS</b>
 
if your api is returning HTML it's a shitty API
|| innerHTML
 
|| create element
 
@MileMijatović but those ^
 
9:40 PM
alerts.Add(new UserAlertVM { Message = "Your Identity Verification is <b>IN PROGRESS</b>!", Type = AlertType.INFO });
 
what language is that
 
.cs
C#
      for (var i = 0; i < data.data.length; i++) {
        var record: any = data.data[i];
        data.data[i].message = record.message; //HTML decode
      }
So here, I want to decode that message
@JBis ?
 
posted on October 13, 2021 by Ben Mason

Hi everyone! We've just released Chrome Beta 95 (95.0.4638.50) 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. Ben Mason Google Chrome

 
10:05 PM
Array(1)0: {message: 'Your Identity Verification is <b>IN PROGRESS</b>!', type: 'INFO'}length: 1[[Prototype]]: Array(0)
So, if I have Array like this
how to display <b> as bolded text ?
 

« first day (4015 days earlier)      last day (932 days later) »