« first day (3631 days earlier)      last day (1300 days later) » 

12:04 AM
Does anyone know any good books / resources to learn how to architect web apps?
For example, approaches to designing autosave features, etc
 
need help
 
12:15 AM
@MohamedMohamed ask your question
@libby those are two different questions
 
Has anyone ever had an issue with chrome not setting the referrer header properly?
 
@MohamedMohamed Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and 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.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
For an app my school group has made most of us have no issue, but some people on chrome their referrer header isn't including the pathname (which is an issue as we use referrer in our login flow to know which app to redirect the user to)
 
1 message moved to Trash can
 
@MohamedMohamed read what james is telling you
> Put your question in 1 message and then your code in a 2nd and format it.
3 messages moved to Trash can
 
12:31 AM
@JBis i made an question there
stackoverflow.com/questions/64037703/…
 
@JBis, just looking for a good textbook with algorithms/strategies on data management and other commonly arising problems
 
thats a third question lol
 
@JBis i asked it and still waitting for and answer
 
@libby Software architecture, algorithms, and "designing autosave features" are three separate questions
 
1:23 AM
@JBis do you know of a resource that solves them all?
 
user13780186
1:53 AM
Hello
 
user13780186
How to fix the "Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec."
 
6:57 AM
@Matthew yes i tried, it works when i give a static id
 
7:29 AM
@phenomnomnominal o.o?
 
8:14 AM
question about call back functions does a callback function gets executed first or second ? with this example
function numericallsort(a,b) {
    return a - b;
}

let my_array = [9,6,5];

console.log(my_array.sort(numericallsort));
 
functions gets executed only if you are calling it
what you did there, the my_array.sort(numericallsort) is passing the function object to the sort. That does not mean that it is being executed
it only gets executed if you do numericallsort(...) or numericallsort.apply or numericallsort.call
 
then Im using the wrong word, my question was does the code in numericallsort do its job before the code in the .sort function ?
if its passes as an argument to the sort function
 
you need to elaborate a bit more on this;
> before the code in the .sort function
 
I want to sort this array let my_array = [9,6,5];
when I use m̀y_array.sort( and as an argument the numericalsort function) `
does numericalsort applied first on that array and then the sort function or the other way ?
 
8:29 AM
the sort mechanism uses that function
 
8:49 AM
so what you're doing is calling sort with numericallsort function object as argument
it then uses that function object when deciding where the elements should be placed in the array.
 
got it thanks
 
9:30 AM
is the drop event still an issue in chrome browser? or is it just my code that sucks
can anyone explain in human language what event.stopPropagation(); does?
 
I want to filter an array to get only the Numbers, I know I can do that with filter(Number) but why does
let filtered_array = my_array.filter(value => value === Number);
not work ?
webstorm gives me the hint : Condition is always false since types 'number | string' and 'NumberConstructor' have no overlap
but I still not get it
 
that is not how you perform type checks
you're comparing value with "Number"
so "5 === Number" might be "5 is number?" but it is actually "is 5 equals to Number?"
do not take the code too literally 😀
and since 5 is not Number (the object) you get a false
||> 5 === Number
 
@KarelG false Logged: `` Took: 0ms
 
9:45 AM
if you do it differently;
||> Number.isInteger(5)
 
@KarelG true Logged: `` Took: 0ms
 
you get correct results. But please note that it only works for integers. If you have floating point values (decimals), then it will give false
it is not failsafe though :D
 
so let filtered_array = my_array.filter(value => value === typeof Number);
 
||> Number.isInteger(1.9999999999999999)
 
@KarelG true Logged: `` Took: 0ms
 
9:48 AM
😉
 
give then the correct ouptut but I got an empty array instead
 
@Amundsen no. Please reread what I said.
typeOf Number gives you 'function'
so you are doing 5 === 'Function', which is always false
I want to see your face when you see it ^^
 
i am curious why there is no isNumber function though
 
!Number.isNaN()
😂
 
"not is not a number" 🙄
lol Ben, you know that I know that. But I rather prefer to have if (Number.isNumber(...)) { ... } instead
 
yeah same
 
and there should be a flag to prevent scientific/programmatical notation
 
10:13 AM
!!> Number.isNaN(Number(NaN))
 
@BenFortune true Logged: `` Took: 1ms
 
||> !Number.isNaN('1e3')
 
@KarelG true Logged: `` Took: 0ms
 
I had to cover that by regex (only digits and a dot) beforehand ...
 
!!> Number.isNaN(0b1000)
 
10:15 AM
@BenFortune false Logged: `` Took: 0ms
 
that's the reason why my people does not like me testing their code
"you test with weird values nobody would come up"
but requirement says only numbers and can be stored in db, so validate accordingly 😈
 
Hey guys, small question
How is that possible, in angular:
const container = this.elRef.nativeElement.getElementsByClassName('query-validation-feedback-container-min');
console.log('a', container);
console.log('a', typeof container);
console.log('a', Object.values(container));
And this is what i get
How is that possible that it shows as array with 1 element, and tpyeof object, but values is empty, even if I do [0] it returns undefined
is that a bug with dom
 
10:33 AM
"it shows an array with 1 element" is not correct
what you got at first is a HTMLCollection (it is clearly shown)
that is not an array (well, that you're thinking off, the [] thing or Array).
it is a collection you can loop through.
Object.values gives all elements from an iterable object (HTMLCollection is one of it) and does give an array back.
 
10:49 AM
Morning. I think I've misunderstood something about how Vue binding works. I've got this
<select v-model="model.selectedItem.id" @change="setValue($event.target.value)">
	<option v-for="(option, index) in model.Items" v-bind:value="id" v-bind:key="index">
		{{ item.Name ) }}
	</option>
</select>

private setValue(id: string) {
	var self = this;
	this.model.Items.forEach(function (item) {
	    if (item.id == id) {
	        self.model.selectedItem = item;
	    }
	});
}
 
Thanks sir
@KarelG Is there a way to inject html with events such as (click) to the componenet html without using elementRef dynamically ?
 
But when this fires it seems to modify the actual Id of the items and I can't understand why. If change v-model for the select to a different property on Item that doesn't happen. What's going on here?
 
basically just by saving the html with the listeners in a variable and displaying it with innerHTML tag?
In angular
 
angular has its own elements and therefore its own click binding. Should you not use these?
1. lookup how to dynamically add elements in angular
2. lookup how to bind click events in it
3. lookup how to add that element to the DOM
 
The thing is I need to implement a feature that renders a message based on the input it gets from the parent. the message should be something like

Hey looks like you are searching for a domain, click here to perform X.

and there are many types of messages, and these messages are going through translations
so I dont really want to break the sentences like separate the "click here" and before / after click here
and then add event to the click here
I want to make it dynamically with one translation
since the translation for every message case is different, I have to dynamically insert html from the component, including the click listener
Right now my translations look like this:
And It's just not right
ops ...
this, sorry - imgur.com/X9nZxJG
 
10:57 AM
There are various ways in Angular that can do that. Either work with templates or get familiar with Angular's i18n adapter mechanism: angular.io/guide/i18n
 
Ah okay thanks ill look into it
i18n requires refactor though cause we already have some translation service
 
11:43 AM
I really really dislike how google form filling automatically puts your house number with the street address fields on all websites.
While they are two different fields. The street address is optional, the number is not. (Postal code + house number = unique identification of a location)
They are also two different fields (as is logical since one isn't required and can be calculated using a public api from government).
 
12:02 PM
@paul23 That's generally down to the broken implementation on the websites
 
Well it's also a problem that I have no idea how to denote a field as "house number" for google, only "address" and "postal code" (and city etc) seem to be understood
 
Wouldn't that just be line1?
 
no, since (as I said) the "adress" is typically just the postal number + your house number. Then you send those to a public api for checking and that api returns the street name/town where you live (which are then filled in automatically for users to confirm).
 
You could always just regex those out, grab line1 and remove anything that's not a number /[^\d]/
 
Example is: postcodeapi.nu/… .. If you fill in there "2628 ZJ" number "846" you get "balthasar van der polweg delft".
That's the interface nearly 90% of the websites I use actually use.
But whenver I fill in my email/name to a form google prefills the rest of the fields and it messes it all up.
 
Conclusion: "no resolution at all" :p
 
12:37 PM
how's yall doin?
 
😂
> Currently the HTML Standard seems a bit US centric:
the specs around phone number and datetimes was a give-away but yeah the majority of the board members resides in USA
 
I mean... arent most popularized concepts / products... general "things" created or developed in the US?
 
@KarelG Merica'
 
I love how everyone these days still says "America" when they talk about the US
when America is more like "Europe" or "Asia"... its a continent
 
@MisterSirCode depends. A lot of IT has invented and created there yes.
 
12:48 PM
Hmm do you guys an any idea how to give this question more attention?
0
Q: Npm dependency to git repository stays to same commit after npm update

paul23One of the packages in a project is based on an internal npm repository. { "dependencies": { "my-library": "git+ssh://<gitrepo>#dist" } } Where dist is the branch to clone from. This "works" as in it install the correct version. However whenever an update happens to this branch I cannot ...

 
bounties
use bounties
 
if I truly want to get an answer, Ill wait a few days and bounty it
 
Well I wonder: would such a question even attract people? It's not directly about "jamming code"
 
I havent asked such a hard to answer question in a long time though, so I usually dont need it
I mean
paul, you only asked it yesterday
atleast give it 3-7 days
 
@paul23 title is not sexy
 
12:53 PM
it is a full description of the problem though, in as small a sentence as possible?
 
"npm update: pull from github repo not taking latest commit"
 
hey is there a way to use the forEach method for this statement instead of map() ?
empty_array = my_array.map(value => value **2);
tryed it with
empty_array.push(my_array.forEach(value => value **2));
 
forEach consumes the array, which means that it does an action for each element of the array. It does not give something back. Map is "take this value and I will replace it with what you give"
it is however possible to do that in .forEach but that violates the best practice. So why do you want to use forEach instead of .map?
 
was curious if its possible
 
1:11 PM
@KarelG I dont understand
 
a decimal is treated as an integer :)
 
what did you expect to see on my face when you write a statement that simple?
 
that's because of the FP
 
in JS, numbers are always 64-bit IEEE-754 floating point values
as soon as the presicion falls short, JS cannot detect the difference between two numbers
 
yeah, but that gives to odd results, something you do not want
 
1:13 PM
Number.isInteger's functionality, considering the lack of actual integers as opposed to floating points, is assumed to be that the fraction part of the number would be compared to 0
||> 1.9999999999999999
 
@Wietlol 2 Logged: `` Took: 1ms
 
2
@KarelG then again, I wonder why you were interested in seeing the reaction on my face in particular
 
you do not like to have oddities in a program language
 
🙄
//off now
 
1:16 PM
@KarelG hence why I refuse to use JavaScript :D
 
user5871859
1:41 PM
I have used RxJS's BehaviourSubject in my previous projects and as far as I know there was also another option called Redux for state management in Angular, but it is just suggested for the big projects. So, I am about creating a new project and although it is not so big initially, it is possible to extend it in the future. So, at this stage, I would like to be clarified what is the options that I can use in my Angular project and the differences between them. Any help please?
 
2:51 PM
https://jsfiddle.net/MisterSirCode/L1z47w9y/289/

I know some of you guys are like CSS Flexbox wizards. Could any of you show me how I can get my section headers to not all have the same height?

Currently its scaling based off the tallest section.

I would love for them to just... scale and fit to the text size.
but when using flexbox.... It seems they always want to scale off of the tallest section
 
 
2 hours later…
4:25 PM
Hmm that's a difficult one, the "trick" is to make the column amount fixed (based on screen width).. And then not render in one go, but rather render "per column".
Also notice that with such things "order" might get misleading, you might end up with things like
art.1 | art.2 | art.3
art.4 | art.2 | art.5
art.6 | art.2 | art.6
but html would look like
<div class=documentBody>
    <div class=column1>
        <div class=docField>
            art.1
        </div>
        <div class=docField>
            art.3
        </div>
    </div>
    <div class=column1>
        <div class=docField>
            art.2
        </div>
    </div>
</div>
But ordering etc would have to be done by javascript, not sure there's a clear cut answer for that
 
5:25 PM
i cant seem to get a cursive font from google fonts into my canvas so i can fill the text, anyone got suggestions on how i can put a font with spaces like {'Pacifico', cursive} i canvas.fillText
 
@IsaamThalhath 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.
 
Im sorry if im asking alot i just cant seem to find a way to do this, i thought i might ask some people who are more experienced in this
 
 
1 hour later…
6:28 PM
hello
 
@GonzaloNicolás 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.
 
i need help in a script in javascript, sorry for my english xD
in this post, i put the question and problem :) stackoverflow.com/questions/64029988/…
 
posted on September 24, 2020 by Krishna Govind

  Hi everyone! We've just released Chrome Beta 86 (86.0.4240.51/.52) 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. Krishna Govind Goo

 
@Feeds 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.
 
!!?
 
6:31 PM
wat?
 
7:03 PM
hello guys
 
@Anton 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.
 
7:25 PM
Ok here's the problem
the old version of James didn't welcome @Feeds but the new James does
i get why new James does but looking back old James should have too
it makes so sense why old James didn't welcome feeds
 
Just filter out negative user IDs?
 
!!magic3
 
!!forget magic3
 
which I know is beside your point
 
7:31 PM
You do not have permission to remove this command.
 
!!info magic3
 
I'm a bot. I am owned and operated by @JBis. I am open source. I am written in JavaScript.
 
what's the command
 
8:05 PM
|| man magic3
 
Invalid command! Did you mean: ban, jan, map? Try help for a list of available commands..‍.‍.‍.‍.‍.‍.‍.‍.‍
 
oh i think the plug-in hasn't been converted yet
Oh well
 
!!afk stop
 
HAMMERTIME!
@KevinB bye Kevin B
 
fixed that bug
 
8:11 PM
@Anton Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and 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.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
oh scuse
 
1 message moved to Trash can
@Anton Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and 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.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
put the code in, select it all, press ctrl+k
 
1 message moved to Trash can
 
var n1= 0;
var n2= 1;

var liste = [n1, n2];

var i = 0;

while( i < 40){
	i = liste[liste.length - 1] + liste[liste.length - 2];
  if (i % 2 !== 0){ // this thing isn't working i just want him to only list me unpair results
	liste.push(i);
  }
}

console.log(liste);
thank you man
i was fighting with my computer XDD
 
8:14 PM
well, if you don't add anything to liste, each iteration after that will give the same result.
 
ohhhh
right
i'm a noob
 
8:37 PM
posted on September 24, 2020 by Daniel Gagnon

The Stable channel has been updated to 85.0.4183.131 (Platform version: 13310.91.0) for most Chrome OS devices. This build contains a number of bug fixes, security updates and feature enhancements. Changes can be viewed here. If you find new 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 ‘Report an

 
Anyone know of any simple javascript web frameworks? I'm looking for something like Ember, but less complex, to use in a website. Preferably it'd use Handlebars. I'd just like to hear your opinions before I go cobbling together one for myself.
 
@Mooshua 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.
 
9:00 PM
Okay, I think I found something. svelte.dev Svelte seems to be what i'm looking for. Still open to suggestions, though.
 
9:51 PM
Out of curiosity, are there any Deno users here? I'm still trying to get to grips with what looks to me like a completely different paradigm from FTP-uploading PHP scripts to an Apache Server (which is what I'm used to). I see various references to the Command Line and Containers and many other concepts which don't relate to the kind of server-side web dev I'm used to. Does that mean it's pretty unusual to have i) a remote server, ii) with deno installed; iii) running .ts / .js server-side [1/2]
 
@Rounin 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.
 
scripts. To be honest, that's pretty much what I was expecting (basically the equivalent of a LAMP stack) but, I see now that was a naive expectation. [2/2]
 
@Rounin Deno is on a whole other paradigm, with node and the likes. I suggest learning how the CLI and Containers work, because they are essential to JS development; no matter what your target platform is.
Containers are a portable VM (see "docker") which allow you to easily spin up VMs on foreign servers (see: "all cloud providers"). It's universal, which is neat. Once you learn the basics, you will love docker more than your wife.
 
@JamesBot - thanks, I just read the room rules from top to bottom. They are refreshingly human. Thank you for giving me a heads up on the link.
 
What issues exactly are you having with Deno? is it wrapping your head around it, or what it's useful for?
 
10:01 PM
@Mooshua - thank you. I have a cursory familiarity with the CLI, having used it on and off (albeit very infrequently) since 2016. Containers are new to me, so I've only just started to get my head around them. I love my wife very much, but docker is welcome to try its charms on me. :-D
 
At the very basics, Docker allows you to create a virtual disk as a file, and quickly spin this up on a machine. Once you have this virtual-disk-as-a-file, you can spin it up anywhere, any number of times. You can drop it into a kubernetes cluster if you just want to forget about it.

The CLI is useful for JS programmers because we use a LOT of meta tools- like Babel and Browserify (and TS). The CLI is just an easy way of creating an I/O interface for these tools.

Deno is the "better version of node", and rightfully so. It's made by the original creator of node and was made to recreate nod
 
@Mooshua - no specific issue as yet, beyond getting the darn thing set up. Back in early 2018, I tried to set up React and never succeeded. That wasn't so much an issue, because I can take or leave React. But Deno I really do want to learn.
I'm surprised (but open-minded: it is what it is) that setting up these technologies is (seemingly) SO much harder than simply opening Notepad.exe, typing some text, opening an FTP client, pointing it at a webspace and uploading the .html / .css / .js / .php / .json file. (That's what I've been doing for 23 years...)
 
    Haha, yeah. This shift will definitely be hard for you.

    The awesome thing about deno is that you don't actually have to deviate from that process- deno is HTTP-centered. You can quite literally point the deno CLI to a web address and it will execute the code on the other side.

Here's an example:

deno run deno.land/std/examples/welcome.ts
As for getting the darned thing set up, installation should be fairly simple bar the PATH modifications, if needed.

https://deno.land/#installation
 
Ah... wait. You wrote "the deno CLI". Does Deno have it's own CLI? I thought the CLI was the Windows Terminal (?)
 
Assuming you don't have it, install chocolatey.org/packages/deno Chocolatey.
CLI is a generic term. It refers to a windows terminal, and it also refers to a PROGRAM which uses the windows terminal as an I/O
Modern development uses the CLI a lot. Chocolatey is the easy way to install stuff like Deno onto your system.

https://chocolatey.org/install

Now- Important thing to note here. The install script uses powershell. You'll need to use powershell (in administrator mode) to install chocolatey.
 
10:11 PM
Right. Got it. Thanks. I have come across several references to Chocolatey today. Is it necessary? If it is, I'll install it. But, generally, I prefer to avoid dependencies / libraries / frameworks as much as possible.
Powershell is fine - I recently updated my Powershell from v2 to v5
Probably a dumb question, but does Deno really not use FTP at all (?)
 
You'll want to install Chocolatey 100%.
 
Okay. Great. I will.
 
Again, deno is a different paradigm. Deno itself does not use FTP, the server you use to run it will.
You CAN use HTTP to run remote code (for example, loading libraries, or running code from an S3 bucket)
 
It took two attempts, but I am (I think) now successfully downloading and installing Chocolatey.
Ah... no. Another failure. The Admin permissions that you mentioned. Let me try and sort this out.
Hmm... What(?) Right-clicking on Powershell is [Paste-from-Clipboard] ? Is it?? That's a lucky find.
 
Yep. Control+C will exit the running program, so don't try that.
 
10:27 PM
Amazing. I now have Chocolatey installed. Thanks for your help with that, :-D
 
No problem, but you're not in the clear yet :)
 
Reading various stuff now. I've heard of homebrew (for Macs). So is Chocolatey basically the Windows equivalent of homebrew?
Hah. I have read chocolatey.org/how-chocolatey-works twice. I am really none the wiser. I will find a youtube video explainer or something.
There seems, generally, to be a lot of focus on getting Deno on one's own computer. I don't want Deno on my computer. I want Deno on my remote webspace. When I see that almost no-one else appears to want to do this, it occurs to me that there must be one or many fundamentals that I am substantially yet to grasp.
 
You want to have deno on your local machine for debugging. When I first started out with NodeJS, I did debugging on a remote server on Heroku. It was NOT fun.
You want to have deno on your machine to work with it. You can code and ensure your code works the way you want (using localhost)
Once you know how to install it on your machine, you can also install it on any VM you want.
 
The single best article I have found so far on putting Deno on a remote public server and using it to deliver a public website is this one: medium.com/javascript-in-plain-english/… (I intend to work through it this weekend)
Hmm. That would suggest I also want to have PHP on my machine to work with it. And that's something I've never done. Unless I'm missing something, I really have no concerns regarding the server-side scripting language being on the server side.
Sorry, what's a "VM" in this context? A Virtual Machine?
 
10:45 PM
Virtual machine, yes.
Trust me when I say debugging on a remote server is not fun. You will definitely want deno on your machine if you intend to write code in deno.
It's just like how I use node. I run my code locally (say, my web server) and use localhost to make sure it works. I do all my testing on my machine, and then I don't have to debug on production.
 
I trust what you're saying. Though I'm not (yet) grasping why debugging JS on a remote server would be any different from debugging JS offline.
 
When debugging JS on a remote server, you have to push changes to that server. When you edit on-device, you just have to reload the script.

I guess if you get a REALLY good workflow going you might be able to do it (say, using code-server).
 
This doesn't sound all that different from how I debug JS and PHP now.
So... I'm guessing tha "pushing changes" is more involved than clicking an upload button on an FTP client.
 
I mean, if you're using FTP, I guess that's pretty much the same thing.
I still don't recommend it, but I can't stop you :)
 
I might be unusual in that I have almost never developed HTML / CSS / JS or PHP locally. Just... never got started on it. I started remote in 1997, started using FTP properly in 2001 and then... never moved to local.
Anyway, got to go - almost midnight here. Thank you very much for all your help, tips and advice and especially your recommendation to install chocolatey which I'm going to spend this weekend experimenting with, alongside following that tutorial on Medium I linked to above.
All the best - Ciao.
 
10:58 PM
I highly recommend it. I understand what it's like to get into habits like that, especially never seeing a need to change.
Good luck, by the way. This is a big shift and you'll need some determination to push through.
 

« first day (3631 days earlier)      last day (1300 days later) »