« first day (4016 days earlier)      last day (918 days later) » 

12:28 AM
@MileMijatović did you read the links?
 
 
1 hour later…
1:32 AM
 
1:56 AM
posted on October 14, 2021 by Matt

The Beta channel has been updated to 94.0.4606.97 (Platform version: 14150.57.0) for most Chrome OS devices. This build contains a number of bug fixes, security updates and feature enhancements.  If you find issues, please let us know by visiting our forum or filing a bug. Interested in switching channels? Find out how. You can submit feedback using

 
2:53 AM
@mitsu nothing like that. it should work
or might
 
user13780186
3:49 AM
Hello devs, I would like to ask if there's a free api for the postcode in uk
 
8:26 AM
@JBis Yes, I did
but still I am not sure how to implement
 
@JBis honestly? Please nope... It gives everyone a taste that "programming is impossible and so annoying to learn".
 
@paul23 ...isn't it annoying to learn?
 
Really excel is like the worst kind of introductory to programming. It like telling someone to start running and as "startup goal" have the 1km hurdling.
 
@paul23 While wearing a full riot gear suit.
 
Can you help me how to do that ?
paul23 and VLAZ ?
I tried with Regex
          data.data[i].message = record.message
            .replace(new RegExp('<b>', 'g'), '&lt;b&gt;')
            .replace(new RegExp('</b>', 'g'), '&lt;/b&gt;');
 
8:33 AM
const div = document.createElement("div");
div.innerHTML = yourArray[0].message;
document.body.append(div);
That would just show it as HTML and this show it bold. If you only want to show the text, not interpret it as HTML div.textContent = yourArray[0].message;
 
just a moment
    this.http
      .get<any>(apiURL, { headers: { idtoken: Globals.getAuthToken() } })
      .subscribe(
        (data) => {
          this.isAPILoading = false;
          if (data != null && data.data != null && data.isOK) {
            for (var i = 0; i < data.data.length; i++) {
              var record: any = data.data[i];

              data.data[i].message = record.message; //HTML decode
            }


            this.model.alerts = data.data;
          } else {
            console.log('loadAlerts: Empty');
and later I loop through an array
<div class="w-100 p-0 mt-1"  *ngFor="let alert of model.alerts;">
  <div class="media p-3 d-flex align-items-center">
    <mat-icon class="big mr-4">warning</mat-icon>
    <div class="media-body font-weight-bold">
      {{ alert.message }}
 
Didn't know you were using Angular. I'm not sure for the proper syntax there. IIRC, it automatically does a safe insert in the HTML so it will effectively assign as textContent.
 
||> (2.534).toLocaleString('nl-nl', {style: 'currency', currency: 'USD'})
 
@paul23 'US$ 2,53' Logged: [ ] Took: 0ms
 
If you want it to be interpreted as HTML, you probably have to opt-in for it but not sure how with Angular
 
8:37 AM
that's not how it is written
 
Weird.
It's the nl locale - if I try en I get "$2.53"
 
then your pc doesn't have nl locale and defaults to en-us (or similar)
 
VLAZ , I think it's the same syntax
 
the space before is right (as is the comma as decimal separator) - but no one every in any document I have ever read uses "US$"
 
fr results in "2,53 $US" while es gives me "2,53 US$" I assume both of these would just use the sign instead normally.
 
8:44 AM
yeah while german ("de") doesn't have the "US" (which it doesn't use it either for the usd). Somewhere someone made some choice
 
it gives me "2,53 USD" as well. I will assume the locale formatting is a bit...opinionated.
 
||> (2.534).toLocaleString('de-de', {style: 'currency', currency: 'USD'})
 
@paul23 '2,53 $' Logged: [ ] Took: 83ms
 
8:57 AM
I also have the similar question
  formatCurrencyRound(input: number) {
    return this.decimalPipe.transform(input, '1.2-2');
  }
how to display currency without float

$1,000.00
so without .00
 
||> (2.534).toLocaleString('de-de', {style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0})
that should answer it :P
 
but this is Angular pipe
 
so?
you "transform" your input using the above function, with input being 2.534
or if you wish to use the locale of the current user:
||> (2.534).toLocaleString(undefined, {style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0})
 
@paul23 '$3' Logged: [ ] Took: 0ms
 
I will try
 
9:03 AM
formatCurrencyRound(input: number) {
    const transformed = input.toLocaleString(undefined, {style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0});
    return this.decimalPipe.transform(transformed, '1.2-2');
}
 
@paul23 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.
 
If I'd take a guess
 
return this.decimalPipe.transform(input, '1.0-0');
Thank you
 
9:22 AM
??
 
this works
{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
 
oh ok, that's something specific to angular, no idea why they would add their own number formatter
 
9:40 AM
@paul23 I'm not a fan of Angular's approach. It's a whole ecosystem seemingly designed by architects who've only worked on backend services all their life. A lot of the stuff makes sense but not quite when you consider the browser. It introduces new ways to do otherwise common stuff. And does this on a large scale which, IMO, does more to obfuscate intent and leads to a cargo cult-ish type implementations.
 
"meh"
 
10:00 AM
@VLAZ @paul23 So simple
<div class="media-body font-weight-bold" [innerHtml]="alert.message">
[innerHtml]
and html is decoded :) Thank you
Also , thank you @JBis
 
 
4 hours later…
2:26 PM
hmm i wonder, should the symbols used for verification key (link through email) be "easy to type"?
So should I prevent using symboles like "0oO Il1"?
 
@paul23 When we were generating codes to send, we excluded confusing symbols, like letter O and number zero. Also number 1, letter L (and lowercase), and letter i (and uppercase). And similar. So, it's unambiguous in pretty much all fonts.
 
yeah but normally user would just click the link right?
Or copy the code
 
Typically, yes. But we wanted to make sure it's easy even if they re-typed it.
 
hmm fair, though it of course would mean you need a longer key to have the same security against rainbow attacks.
 
There was barely a sacrifice in terms of search space. Does it really matter if you generate X random symbols out of 62 or out of 58?
Yep, make it longer and it's fine.
 
2:32 PM
I'm then also considering making it case insensitive, so the 64 (default) symbols get reduced to 32 only.
 
Also fair. I can't remember if we had lowercase letters in ours. Might have been uppercase only.
 
maybe up the symbol count from 16 to 24, though even with 16, it still takes years at 1000 tries/second...
 
I'd also try to format it similar to a UUID (or credit card number) by grouping the symbols, so it's easier for somebody to remember it or write it down. Imagine they are looking at the code on a phone and writing on a PC or vice-versa. Or they copy it on a paper note from one computer to go enter it on another.
Having a VERY LONG string of gibberish makes it hard to enter without typos.
But several shorter ones dramatically improve the readability and reduce the typos.
 
2:58 PM
yeah good advice
 
3:37 PM
Hello there. Is it possiable to prevent browser from issuing a new GET request when it gets 302 found with a Location in reponse header?
 
@Rick You mean you don't want to follow the redirect?
 
More than that, I don't want the browser to issue a new GET request, hitting the server
The current condtion is :
Browser: Fetch API (1 POST request) -> 302 Found (Response)-> Browser: GET
I want it to be:
Browser: Fetch API (1 POST request) -> 302 Found (Response).
Is that possible ?
 
Yes. Give me a minute, I'm trying to find the correct way to do it.
fetch(url, { method: "GET", redirect: "manual" });
That should do it. Possible values for redirect are "follow", "manual", and "error"
The default is "follow" and I assume "manual" should not do anything. I've not actually tried it.
 
I remembered I just tried that but now I see my code missing the redirect parameter.. So let me try again.
 
You can also probably try doing a HEAD request. It only fetches the meta information, so headers and such but doesn't download anything.
 
3:52 PM
that seems to work
let me try a few more :P
 
o/
 
works like a charm, thank you so much. I might forget to add redirect to my dev code.
 
4:20 PM
I have this issue: I want to encapsule a chunk of dynamically created and inserted DOM insite its own "plugin" class. This would involve the plugin object to hold references to the created DOM elements - especially buttons. These buttons need callback functions that access parts of the plugin again (e.g. to "close the menu" or something). To ease readability and maintainability I would like to not define the callback functions directly inside the scope of the generating function.
e.g. inside a callbacks.js module that I import. But how do I return program flow back inside plugin methods
 
^ not sure I follow. So, you have some sort of encapsulation of a set of DOM. For example, a popup with two buttons or something. The consumer would be able to create one of these popups and pass callbacks for what the buttons would do. Is that correct?
 
There is no consumer I have complete and sole control over everything, it is just code structure.
function toggleMenu() {
// I do not want to have a global menu object but also encapsule this somehow
	if(menu.isOpen()) {
		menu.close();
	} else {
		menu.open();
	}
}

class Stuff {
	button = undefined;
	menu = undefined;
	open = false;

	constructor() {
		this.button = document.createElement("button");
		this.menu = document.createElement("div");
		this.button.addEventListener("click", toggleMenu);
	}

	isOpen() {
		return this.open;
	}

	open() {
		this.menu.inert = false;
	}

	close() {
		this.menu.inert = true;
argh that mock doesnt change the open variable but whatever
you get the gist
I seem to find ideas like this:
function makeToggleCallback(stuff) {
	return function() {
		if(stuff.isOpen()) {
			stuff.close();
		} else {
			stuff.open();
		}
	}
}

class Stuff {
	button = undefined;
	menu = undefined;

	constructor() {
		this.button = document.createElement("button");
		this.menu = document.createElement("div");
		this.menu.inert = true;
		this.button.addEventListener("click", makeToggleCallback(this));
	}

	isOpen() {
		return !this.menu.inert;
	}

	open() {
		this.menu.inert = false;
	}

	close() {
		this.menu.inert = true;
that a usual solution to this?
issue is I can not make a toggle METHOD and add that METHOD as an event listener
 
5:12 PM
@salbeira I don't see a huge problem with this. The makeToggleCallback() might be inlined, if it's not reused. If it is used multople times it's fine to keep it. Overall, seems OK.
 
Reason I ordered this this way was because I wanted to make a callbacks.js file where I gather all these functions
but I see that this is also possible
 
You can make a toggle method but have to content with using the correct this when using it as a callback. The easiest solution is to not do addEventListener("click", this.toggle) but addEventListener("click", () => this.toggle())
 
class Stuff {
	button = undefined;
	menu = undefined;

	constructor() {
		this.button = document.createElement("button");
		this.menu = document.createElement("div");
		this.menu.inert = true;
		this.button.addEventListener("click", () => this.toggle());
	}

	isOpen() {
		return !this.menu.inert;
	}

	toggle() {
		[...]
	}

	open() {
		this.menu.inert = false;
	}

	close() {
		this.menu.inert = true;
	}
}
 
An alternative is to define it as:
class Stuff {
	constructor() {
		this.button.addEventListener("click", this.toggle);
	}

	toggle = () => { /* ... */ }
}
using an arrow function for toggle
 
That might be neat as the callbacks are sometimes used as callbacks and sometimes used as functions
like
 
5:17 PM
Also possible to use a regular method with this.button.addEventListener("click", this.toggle.bind(this)) but I don't like it aesthetically. It otherwise works fine.
 
function doA() {

}

function doB() {

}

function doBoth() {
	doA();
	doB();
}
Sometimes doA is used as a callback, sometimes, doB, sometimes doBoth
And I would not be able to ... well comfortably make a "makeDoACallback" function and then ... idk. double ()() it
that would make the code readabílity even worse again
 
If you have this situation often, you can just compose them together: doBoth = flow(doA, doB). Or avoid the variable altogether withCallback(doA); withCallback(doB); withCallback(flow(doA, doB))
Or you can use Ramda's pipe() the same way.
It's fully variadic so, you can even use flow(doA, doB, doC, doD, /* ....*/, doZ) if needed.
(same with pipe())
Note, that functional composition of flow(a, b)() is the same as b(a()), so each function takes the input from the last one. If the functions behave differently on input, then composing them might change the meaning. However, if they don't expect to take no argument, it's the same whether you call b(a()) or a(); b(). You can very easily make a composition function that does the latter instead. But Lodash/Ramda have a ready made one that can also work.
 
5:37 PM
posted on October 14, 2021 by Srinivas Sista

The Dev channel has been updated to 96.0.4664.9 for Windows, Mac and Linux. 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. Srinivas Sista Google Chrome

 
 
4 hours later…
9:37 PM
@JBis have you ever got the mediasoup demo to run?
 
@DavidKamer iirc I did at one point. But mostly just referenced the demo code.
 
yeah I think it doesn't generate its own certs?
I think that's the current issue. I just want to see how it works compared with twilio which is basically the same concept
 
@DavidKamer I don't think it does. But I disabled that requirement in FF for debugging purposes. Made life easier.
 
9:54 PM
@JBis I'll have to look at the docs to see how to disable it then
Couldn't figure it out... So I just ran this and renamed the files: openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
 
posted on October 14, 2021 by Matt

The Stable channel is being updated to 94.0.4606.97 (Platform version: 14150.57.0) for most Chrome OS devices. Systems will be receiving updates over the next several days. This build contains a number of features, bug fixes and security updates, please find release notes here. If you find new issues, please let us know by visiting our forum or filing a bug. I

 
10:23 PM
@JBis I don't mean to be rude to the creators, but these examples are terrible lol. They do the only thing an example shouldn't do: fail to run
it's probably my fault though
 
no the creators sucks
their docs are trash too
but it works well
 

« first day (4016 days earlier)      last day (918 days later) »