« first day (3996 days earlier)      last day (935 days later) » 

3:49 AM
posted on September 24, 2021 by Prudhvikumar Bommana

The Chrome team is excited to announce the promotion of Chrome 95 to the Beta channel for Windows, Mac and Linux. Chrome 95.0.4638.17 contains our usual under-the-hood performance and stability tweaks, but there are also some cool new features to explore - please head to the Chromium blog to learn more! A full list of changes in this build is available in the log. Interested in switching re

 
 
8 hours later…
11:47 AM
Is there a better way of creating a array containing [0, 1, 2, 3, 4, ..., n-1] than [...(new Array(n))]? I imagine use a function like: incArray(3).map(i => i*2) which would return [0, 2, 4]
 
||> n = 10; Array.from({length: n}, (_, i) => i)
 
@VLAZ [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] Logged: [ ] Took: 0ms
 
@Dwadelfri ^
||> n = 10; Array.from({length: n}, (_, i) => i * 2)
 
@VLAZ [ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 ] Logged: [ ] Took: 1ms
 
If you don't want to do an extra .map()
|| mdn array.from
 
@VLAZ well thank you
 
@Dwadelfri You can also use generators to express more complex lazily evaluated logic. Here is an example which shows an infinite generator function you can limit to a certain size with another generator. And this is building on top of the same idea by adding the mapping to be done as a generator. Array.from then only materialises the generator to the finished result without post-processing anything.
 
12:15 PM
Woke up to a gold badge that is exciting
 
Unsung Hero is supposed to be a consolation prise.
Which doesn't mean it's bad. I don't think I can get it, in fact.
Not easily, at least.
But I personally don't like it as a badge because it feels a bit like adding (small) insult to injury.
 
Consolation 0.o
Not good, not bad
haha
 
DRP
12:54 PM
Hi experts, anyone have an idea around: stackoverflow.com/questions/69309266/…
nvm all good cheers
 
 
2 hours later…
2:42 PM
So if I have a "Name" : "Beerus Dev" in object response. What would be the easiest way to get the B from Beerus, and concatenate it with Dev to produce the following BDev@email.com
 
2:55 PM
@BeerusDev obj.name[0] + "Dev"?
Or do you need to transform the entire string? If so, what's the rule: first letter + the rest after a space?
Or something different?
 
Weirdly this hasn't gotten a reply
1
Q: how to easily merge future updates after cherry picking commits. - Or merge a specific commit first?

paul23A particularly nasty bug just happened to our software. (JS/react something was preventing onclick from firing about half the time - turned out a constant rerender was happening). This wasn't really easily to solve and the culprit wasn't found easily. So the way the bug was found was by going bac...

 
@paul23 Hmm, not sure how to even answer that. Is the "main" branch (A, B, etc) supposed to be develop (or equivalent)? What is the A', B' branch then - is it just a branch for the fix (only needs to go back to develop), or is it how it was fixed on a release branch and you now need it back to develop?
 
@VLAZ but in my actual application, all values are dynamic
It will always be two words, but I want to get first letter of first word, + the rest after a space
 
split , get first, concatenate. it's almost as if your request describes teh code needed
¯\_(ツ)_/¯
 
Good morning to you too Kevin
 
3:07 PM
since the entirety of your source data is the value of an object key, the fact that it's on an object is irrelevant
 
posted on September 24, 2021 by Srinivas Sista

The Stable channel has been updated to 94.0.4606.61 for Windows, Mac and Linux which will roll out over the coming days/weeks 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 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 co

 
if it's always two words separated by a space, splitting gives you an array of both words. you can then just do exactly as your text describes
concatenate the first letter of the first word with the second word
 
I got it I think
 
!!> const a = "Foo Bar"; const b = a.split(' '); console.log(b[0][0] + b[1]);
 
@KevinB undefined Logged: [ '"FBar"' ] Took: 0ms
 
3:14 PM
var name = "Beerus Dev";

const firstChar = name.split('');
console.log(firstChar[0]);

const lName = name.split(' ');
console.log(lName[1]);

const emailDom = "@domainname.com";

var userEmail = firstChar[0] + lName[1] + emailDom;
console.log(userEmail);
 
const firstChar = name[0];
 
No need for name.split(''), just do name[0] which is the first letter.
 
however, if we're dealing user input
there's no guarentee that it's always first<space>last and nothing else
 
Also, for fun, you can use destructuring:
||> var name = "Beerus Dev";
var [[firstChar], lastName] = name.split(" ");
console.log(firstChar + lastName)
 
@VLAZ undefined Logged: [ '"BDev"' ] Took: 1ms
 
3:18 PM
what if two people have the same first/last name?
 
There is also no guarantee that a person will have exactly two names
 
I can create a condition to check for that then apply 1 and if theres more than 1 apply a 2 to the next
 
By the way, my favourite actor name is Jean-Claude Van Damme. He's not my favourite actor (I don't mind him) but his name is my favourite. Because it's a very useful one to test many types of code that handle names.
 
We haven't had that issue yet, pretty rare Id say but needs to be accounted for
 
Would he be JVan? or would he be JDamme? Or something else.
 
3:23 PM
I would say JDamme, but honestly JVanDamme would make the most sense, since it is a double last name
 
or people who have a combo-last name
 
This will be interesting to condition for all of this. Challenging
 
@BeerusDev So, what about Vincent van Gogh? His last name is not "van Gogh". It's "Gogh".
 
VGogh
 
Right, so now make the code do that.
 
3:27 PM
code shouldn't be making email addresses, is the TLDR
 
Jean-Claude Van Damme -> JVanDamme ; Vincent van Gogh -> VGogh
 
@VLAZ The "van" would be considered part of the last name, see: en.wikipedia.org/wiki/Van_Gogh_(surname)
 
@BasvandenWollenberg 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.
 
@BasvandenWollenberg It's a prefix of the last name. And that can be handled as actual part of the last name or not. Depends on the country because different regions can handle the same prefix differently.
Names are hard.
There is no computer system that can handle them uniformly. Because names are not handled uniformly.
 
Names are hard for sure hahah. Many system do not handle my name correctly, since "van den" is considered part of the last name in Dutch
 
3:40 PM
I know a guy who legally changed his last name to a single letter. That made him have a problem with many systems. He couldn't sign up with one electricity company because their system just did not allow for a single letter last name.
2
 
i mean
he coulda just Aempty
 
Or the developers could have just not put in stupid rules.
Also, I'm aware that people called Null also tend to have problems. Hopefully less now than in previous years but occasionally some stupid system somewhere would only transfer strings and "null" would be considered the same as an actual null.
 
@VLAZ yes only6 for fixing, I am wondering how to add a "patch" on an old commit
Right now I fixed it by just remembering the solution and implementing it again in the final branch (so ignoring A' and just repeating myself after F directly into master).
 
@paul23 You...don't. Unless you want to re-write the history of the entire branch which I wouldn't recommend. I'd get the latest develop and just make the fix at the tip.
So, basically, you want to move A' and B' after F
Or merge into dev, I guess.
I prefer rebasing, as it keeps the history cleaner.
 
yeah but the problem was/is that merging B' into F would show conflicts (that aren't conflicts) with any file that was changed between A and B and then later again between B and F (nearly 80% of the files in the repository).
All conflicts are superficious as there is no actual difference between B and B' apart from 2-3 files.
 
3:55 PM
In that case, scrap A' and B' and re-do the changes after F.
It's easier than trying to fix an old commit.
 
yet it showed 100+ conflicting files going through them was even more time then using the automated refactoring utility
yeah I did that, but it feels like I do the same action twice - potentially a source of errors and not really feeling like it should be done that way
 
Unfortunately, I do not know of an easier way to fix it with Git.
The commit/branch structure it uses is great in some respect but not so great when it comes to what you want to do.
The problem is that making changes "in the past" will almost assuredly cause conflicts whatever you want to do with "the present".
Because they are divergent - two modifications to the same resources. Git automatically considers that a conflict.
There is a tool called git rerere that allows you to record fixes and replay them. Usually used if you try to do a rebase to rewrite the history several commits back, so you have to fix conflicts with each subsequent commit.
I'm mentioning it because even the Git developers figured out the commit structure is rigid in this respect and thus came up with an automation just to reduce the pain.
 
hmm that would be doing what I like
 
I've not personally used git rerere. You can give it a try, I guess.
 
4:32 PM
posted on September 24, 2021 by Srinivas Sista

The Dev channel has been updated to 96.0.4651.0 for Windows, Linux and Mac 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

 
i tend to just undo the change in a new commit, rather than trying to go back into the past
I'd rather not alter/rewrite history
kinda defeats the purpose
unless, of course, you're removing credentials
 
If I have a Promise that returns some data, do I have to make a callback external to said Promise to get the value back out? Obviously return doesn't work in the .then context
 
yes
or await it in an async function
 
FWIW the SO canonical is a bit fuzzy on that point (or maybe I'm just dense today)
 
the async/await bit did kinda muddy up things when discussing async logic
 
4:37 PM
Hi there
 
@Ahuahu 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.
 
o/
 
0
Q: datatable static html loaded all rows before pagination

AhuahuI have 100+ rows, but when i am refresh the page, 1st 100+ rows initialized then pagination as 10 rows. I would like to show 10 rows while reload and refresh page. How to fix it? Using jQuery 3.5.0 Example: <table id="table_id" class="display"> <thead> <tr> <th>Column 1</th> <...

can anyone check the issue?
 
i'd have to go to the docs for that one
 
 
3 hours later…
7:56 PM
 
haha, I love this one
The joke is like a secret clue
 
I don't get it... Off to Explain XKCD, it is!
 
noo
just google this one :P
 
Oh... well, there is no explanation yet for a 5 minute old comic, duh.
 
I'll help you out: d/dx is a sign of differential calculus - something undergrads have to learn and do till you are almost dead from seeing them.
 
8:02 PM
Yeah, that one I got.
 
"curly" d/dx is partial differential calculus - just the follow up (and apparently grad level in us)
h (with stripe) is planks constant..
R_e is Reynold's number - used in aerodynamics. And aerodynamics is fully based on numerical calculus now.
(Ta^4 - Tb^4) is the efficiency of a turbine for an aircraft (temp difference between in and outlet of turbine/compressor)
N_a is used for set theory/theoretical calculus
micrometer is used in a lot of fields, but accurately measuring submicrometer scale is often like a few 100s of euros in cost for gear. Measuring millikelving accurately is really expensive (I honestly haven't seen any gear that does this)
nano meter signals you're working with lasers
Calculating in electronvolts means you're using high energy particle experiments.
mSv milli Sieverts means you're handling radiation and how deadly they are to the body
mg/kg means you're doing some simple chemical reacts with potentially irritating stuff.
micrograms /kg means the stuff just got a lot more irritating and you shouldn't handle it without proper care.
pi / tau - age old internet argument and in calculus you often forget the leading factor. youtube.com/watch?v=ZPv1UV0rD8U
only one I'm not sure about is the N_a
 

« first day (3996 days earlier)      last day (935 days later) »