« first day (5029 days earlier)      last day (140 days later) » 

10:13
Is there a separate chatroom for angular?
I have a question, I am going to migrate a "mid-sized" project from ng-5.5 to ng-18. I am confused whether I should go with the new stand-alone app or module app. I am inclined towards the modular approach. Any pointers?
 
3 hours later…
13:20
@matt what is xoring values?
13:32
@1.21gigawatts exclusive or the truth table for it is like a regular OR except for true XOR true it's false. Only true XOR false and false XOR true result in true
i don't know when i'll ever use that
is there an operator for it in JS?
var x = (true and false) // true
var y = (false and true) // true
var z = (true and true) // false
Only a bitwise operator: ^
||> console.log(1 ^ 1, 1 ^ 0, 0 ^ 1, 0 ^ 0)
@VLAZ undefined Logged: [ '0', '1', '1', '0' ] Took: 0ms
You can use it for booleans if you cast the result back to boolean, though
||> Boolean(true ^ false)
@VLAZ true Logged: [ ] Took: 1ms
13:46
||> Boolean(true ^ true)
@VLAZ false Logged: [ ] Took: 0ms
ok
when writing a general use function at how many parameters do you have before you use an options object?
myfunction(param1, param2, param3, param4, param5)
myfunction(param1, options)
javascript doesn't have overloads right? does typescript?
@1.21gigawatts About 2-3. I'm almost assuredly using an options object with 4+
so you have 2 params and then third is options or do you go right to one options? i mean how does your function look that has 4+ options?
It's a judgement call. If I have two already I might add a third. But if the order of the parameters is annoying, then I'd probably convert to an options object.
So, I'll keep 3 if it's something like 1 and maybe 2 are mandatory, 3 is rarely used.
But if all three are used commonly, then I'd prefer the faux "named arguments" approach.
@1.21gigawatts No. You can emulate it but it's nasty. Won't recommend it. TS has overloads but it has a similar problem - you still have one function/method and you'd have to check the number and the types of the arguments passed in to determine which of the "overloads" (all leading to the same function/method anyway) to work with.
In TS simple overloads are OK but complex ones are unwieldy. I think I have an example of that, hold on.
@1.21gigawatts here is an example. usingOverload takes either two strings or two numbers. The first two signatures are callable, the last one isn't but has to account for all possible variations in the callable signatures then you implement your logic there. It's a dumb example but it's to illustrate how to make an overload.
Now consider this signature. It's not a huge deal: two or four strings, two or four numbers. In languages with overloads, it'd be easy to implement. It's quite annoying to do this. The more overloads you allow, the more complex the implementation.
Overloads are useful to callers, so they are implemented in libraries and such. Simple overloads with something like 2-3 variations are OK. But I'd avoid using anything very complex.
14:04
so in the first example, should usingUnion be calling usingString or usingNumber?
the user would always call usingUnion() and the overload would figure out what private methods to call
@1.21gigawatts Technically yes. But I wrote that to demonstrate the different approaches, not as an example of clean code.
It's just there to juxtapose the three approaches.
You still need to exhaustively check all permutations of parameters whether you use overloads or unions. The unions are weaker, since they allow calling any permutation. An overload can only allow some (e.g., union would allow calling with string+number, the overload enforces either string+string or number+number). In either case you have to do the same checks.
14:41
is there a shorter version of this in typescript:
myVar && myFunction();
myVar could be null
another question, i want to show multiple dialogs. and i want to have callbacks for each. is there any problem with adding the callback function as a property on the dialog element itself? elements have element.dataset for custom values but is there one for custom functions? it's a one time thing so i don't want to create a class
14:55
@1.21gigawatts That's the shortest. You can remove the two spaces, I guess.
@1.21gigawatts You could. I wouldn't recommend it, though. It's not great ferrying JS values through DOM nodes. There might be clashes or maybe something re-creates the DOM object in the future and you might lose the data. dataset works with string values only. If you use jQuery you could actually use it's .data() to attach and read arbitrary JS data.
You could maybe keep a map of callbacks and add them with, say, the dialog ID as key or similar.
15:20
dialogs have ids?
i was thinking of using a map like you said and passing in the dialog as the key and function as the value
but i couldn't remember if that's possible or not and it seems like a misuse of map
Yes, possible. You can use a WeakMap - it doesn't hold a strong reference to the key, so if the dialog is removed from the DOM, it will be garbage collected if there are no other strong references.
@1.21gigawatts It's sort of the use-case of a WeakMap - to dynamically "enhance" objects with more values without actually attaching them to the object.
 
6 hours later…
20:57
posted on July 23, 2024 by Daniel Yip

The Stable channel has been updated to 127.0.6533.72/73 for Windows, Mac and 127.0.6533.72 for Linux which will roll out over the coming days/weeks. A full list of changes in this build is available in the Log. Security Fixes and Rewards Note: Access to bug details and links may be kept restricted until a majority of users are updated with a fix. We will also retain restriction

posted on July 23, 2024 by Krishna Govind

  Hi, everyone! We've just released Chrome 127 (127.0.6533.64) for Android . It'll become available on Google Play over the next few days.  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. Android releases contain the same security fixes


« first day (5029 days earlier)      last day (140 days later) »