« first day (3679 days earlier)      last day (1494 days later) » 

05:43
Hi
Can anyone have a look at this issue
I am new to reactjs. I cloned a project from repository and I run

npm install

All node_modules got installed.
Then I run

npm start

But on compiling , it failed and displayed

> ./node_modules/d3-geo/src/area.js
Attempted import error: 'Adder' is not exported from 'd3-array'.

I checked the file inside node_modules and I found that the 'd3-array' instead of loading from my project's node_module directory it is loading from :

> C:\Users\abc\AppData\Local\Microsoft\Typescript\4.0\node_modules
06:24
Can anyone please explain why Angular directory does not contain any Fesm or esm/esm2015 directories in Github repo?
 
4 hours later…
10:18
I want to establish a chat communication between two angular application. Can anyone tell me how to achieve that?
@SwatantraMukherjee 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.
 
2 hours later…
11:53
@BasheerKharoti because they are build artefacts, generated from the typescript code.
12:24
@makadev Thanks for the answering my question. Your suggested answer is using Timeout of 2000ms.Is there any way without using Timeout option, because I am working on functionality which needs multiple callbacks, so when I am adding multiple timeouts it will take longer time for execution.
 
1 hour later…
13:47
@BTVS the timeout was only an example because it behaves much like a successful fetch() (asynchronous, with delay), replace it with your fetch code
 
1 hour later…
15:05
Helloo
any code of conduct i should read im new here
I'm building a webshop with reactjs, and im struggeling to understand how to access the shoppingcart's state that is defined in the navbar-component
since the other components aren't children of the navbar
Do i need to use sommething like redux, or can i solve this without it?
Basically my layout is like this:
<NavMenu />
        <Container>
          {this.props.children}
        </Container>
@Zacharias 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.
where the shoppingcart is in the NavMenu
I don't know what you're talking about :p
I could use some help trying to figure out why the pause button in my (javascript) game isnt working i made a question but it isnt getting any attention
and the components that want't to access its state is in the container
15:12
@Zacharias React Context would be a lightweight option
see reactjs.org/docs/context.html or probably better to search for an example
@makadev I see. And would this be the "normal" way to do it?
Hello I dont even know what reactjs is but i could use some help lol PS im new here so if theres any code of conduct to follow let me know before i unleash my truck driver mouth lol
@Zacharias Pretty much, cleaner than trying to pass around a component state and less complex than setting up full redux. Create a context, provider is somewhere up in the root and keeps the state/dispatcher and components below can access/modify (like navbar and others) by getting the state/dispatcher via context consumer
15:16
Alright, i will try, thanks!
Hellooo
!!welcome
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.
15:17
or that :>
Hello, I could use some help, anyone up for dealing with a world class moron :p
man just judging by the rules you guys are way less uptight than the jerks in the GAS chat room. (Why do they even call it that i know it stands for google apps script but gas. Why. They could call themselves the taco bell enthusiasts chat room)
anyways what i need help with has a question but its not getting any answers or even many views, so an answer or an upvote would be great
thats the question
15:35
@LlamaButt seems some logic issues in your code, there is no stop condition for tick() and you can "start" multiple times which will just call tick() more and speed up the game while your hide/show simply hides the canvas
okay. thanks.
user14520680
I would recommend using classes so your code is elegant. Doesn't fix the problem but just makes code more readable
Okay, I got it working.
@LlamaButt :thumbs_up:
16:32
Hello, I know this is a css issue not a javascript issue but I have no idea how to do this it dosent deserve a question of its own and i cant for the life of me find a good css room, so heres my problem
@FishyApprentice 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 making a game and it has touchscreen controls. Simple. The thing is, i need to position them each on one side of a canvas
there buttons btw
any idea how i can do this
 
2 hours later…
18:37
!!magic
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
19:12
Hmm so the "saying" is that if an malicious attacker has access to hardware you should consider the system compromised.. Right?
sorta, depends on the system
That makes me wonder: what's the point of having multiple accounts on a pc.
If it depends on people not trying to break the stuff, why not just behave like adults and don't look at each others folders.
because i like start menu this way and they like their start menu that way
So a better name would be a configuration manager?
19:16
^ but in a terms of security there's effectively no reason to have a per user password for everyday consumer pc's
Well just so one could quickly select the configuration of how the OS looks. Without having log in/passwords and other nag screens
i mean
there's basically 0 chance anyone in my home would be able to get into my PC, even though they "have access to the hardware"
And that could even happen from facial recognition so that the user doesn't have to take action.
@paul23 Most computers on the market, you can easily bypass the login screen by mounting the drive in a different os
the value of said user accounts/passwords isn't 0
19:18
In terms of security it is.
Sure, but even ubuntu throws a login screen after I moved away for 20 minutes.
@paul23 whats your question?
well why is that thedefault.
it's good enough for its purpose
When it is just a pita and not really improving security at all. Especially considering nowadays housholds have like a laptop for everyone.
19:19
most people don't know how to bypass it
you ask the average person, and they won't know
also your account is used for file permissions, which are also just a construct of the OS but still relevant.
does anyone know how to add <span> tags to nested elements?
you can't access the files of another user
@rdevn00b yes, type <span>
@rdevn00b it's not much different from adding any other element as a child of an element
or in js:
but I actually only need it for the top level of a nested element
not for the entire selector
19:20
|| mdn appendChild
so let me give some example HTML
<div><span></span></div>
so this is what I have now
<ul>
	<li data-server-path="/uri_external/">
		uri_external/
		<ul></ul>
	</li>
	<li data-server-path="/IEEE/">
		IEEE/
		<ul>
			<li data-server-path="/IEEE/provenance_domain.json">
				provenance_domain.json
				<ul></ul>
			</li>
			<li data-server-path="/IEEE/IEEE2791-2020.schema">
				IEEE2791-2020.schema
				<ul></ul>
			</li>
			<li data-server-path="/IEEE/parametric_domain.json">
				parametric_domain.json
				<ul></ul>
			</li>
			<li data-server-path="/IEEE/error_domain.json">
				error_domain.json
you see where it says "IEEE/"?
this is what I need
<ul>
	<li data-server-path="/uri_external/">
		uri_external/
		<ul></ul>
	</li>
	<li data-server-path="/IEEE/">
		<span>IEEE/</span>
		<ul>
			<li data-server-path="/IEEE/provenance_domain.json">
				<span>provenance_domain.json</span>
				<ul></ul>
			</li>
			<li data-server-path="/IEEE/IEEE2791-2020.schema">
				<span>IEEE2791-2020.schema</span>
				<ul></ul>
			</li>
			<li data-server-path="/IEEE/parametric_domain.json">
				<span>parametric_domain.json</span>
				<ul></ul>
			</li>
			<li data-server-path="/IEEE/error_domain.json">
note that the <li> tags also now have <span> inside of them
that isn't working?
19:24
right
but like
just put a span in there
this code is done non-statically
in whatever is creating this html
it's a recursive function
So?
I tried to do that but it didn't work
19:25
fix it in the recursive function
what library are you using?
it's not from a library
someone on here the other day helped me with it
let me show you the function
This isn't about ,span. this is about the code you use to generate the dom/html
function tree(data) {
    if (typeof(data) == 'object') {

        var ul = $('<ul>');
        for (var i in data) {

            // Define an append string.
            var append_string = ''

            // If we don't have a .schema or .json ending,
            // then we have a folder.
            if (i.indexOf('.schema') == -1 && i.indexOf('.json') == -1) {

                // Make it into a folder string.
                append_string = i + '/';

            } else {

                // Normal string.
yea I know, I just couldn't get the recursive function to do it properly
You use jquery :P
19:26
ew
where it says "ul.append($('<li>')...." I tried to just put span in there
well honestly I just use it because it's quicker to get working
and I'm not even a web developer
but yea
what the hell is jquery lol
just a wrapper for javascript @FishyApprentice
just convert $('<li>').text(append_string).append(tree(data[i])) into a template literal, or just a string with concatenation
19:28
what do you mean?
I'm not sure how/when jquery renders compared to the dom.
like
<li>stuff</li>
but won't append() take an array to append multiple items?
than the line would be:
ic
ok, skip all the appending entirely
19:29
?
just build an html string from the start
I think you wrote this function for me yesterday lol
basic string concatenation
yea I was thinking about doing that
but where would i build it?
in a variable
19:29
ul.append($('<li>').text(append_string).append([$('<span>').text('whatever'), tree(data[i])]));
I have to keep the recursive feature
the recursive bit shouldn't care
it will work through in the order required for an html string
let me try that hold on
just remember to close the li after the loop, open it before the loop, etc
mind you I don't know at all about jquery, though I prefer libraries that modify the dom, not the html.
19:31
that line you gave didn't quite work
it's almost there though?
(any modern frontend engine)
yea like I said I'm not a web developer I'm actually a mathematician who uses R
I just do the web stuff for my job
...
Picking jquery is like using pre-newton's-calculus algebra to solve the area under a curve.
not a web dev but i do web dev stuff
:p
hey so that didn't quite render correctly
it now has the spans but its duplicating the <li>s
19:35
In this case: $('<li>').text(append_string).append(tree(data[i])) .text shouldn't be .text, if you want append_string to be wrapped in a span
so what should I be using then?
there are several options
you can leave the .text and then wrap inner
like?
you can use .html or .append and concatenate a span around the text
you can use a template literal (with a .append or .html)
19:37
I removed the first text command and it looks like it worked?
ul.append($('<li>').append([$('<span>').text(append_string), tree(data[i])]));
it's just a silly question to me, because, you're asking how to do something that all the tools are there for you to accomplish, just understand what they do and make them work for you
yeah that's a good option too
I mean, 95% of my time dealing with any web stuff for this job is actually doing API programming in python, so really the front end is just an annoyance
but thanks for the solution regardless
front end is always an annoyance if you consider it an "oh that also has to happen" job.
Since then you won't take the time to properly develop it and it hence because a hack'n'slash mess
it's just not worth my time because I really don't spend a lot of time doing it
most of our workflow uses React though
this is just a side project beta basically
Sure that's fair. Just dont' judge the book by it's cover.
19:40
oh, the book has been judged son, the book has been judged VERY harshly
now to spend an hour getting the stupid CSS working...
When you develop in react you won't ever get problems remotely close to these. Rather you get a different set of problems more in line with standard programming.
I wish I never had to use javascript ever again frankly
I could tell you about coffeescript etc :P. But it's silly in my opinion: even with those languages you still have to know the inner workings of javascript and the browser render engine for certain bugs.
yea I only do javascript because I'm paid to, not because I want to
R is where it's at
See I really can't stand R, to me it always seemed like such a single purpose version of python.
19:44
au contraire
it's everything good about SQL, C, and Python in one language
Python is dog shit for data work
it's good for some ML stuff and some batch processing
but for analysis, R is superior
and also for graphing
I love python, just not for anything resembling data modelling and analysis
Python is the swiss army knife of programming languages, which makes it great...but for data, python is the nail clipper on the swiss army knife
During my studies -for example- we had to analyse a lot of data, few 100gb of highspeed infrared camera images to see how something was heating up due to hypersonic airflow over a tripping point.
I mean, the real speed is C directly for sure
With python I could much more easily write a small interface to manually select the region (in time as well as on the surface) from which the data was analyzed. With lazy-programming really being the mvp
and Python is good for very narrow, single-purpose analysis
@paul23 Question for you. If you were going to create a db oriented REST API in node starting from scatch.

1. Would you use an ORM?
2. If so, which one?
3. If not using an ORM how would your model's work?
3. How would you design it? MVC?
19:48
actually due to how python generators and lazy-evaluation works I think I could do it faster than I would be able to do it in C.
did you ever use data.table?
Any idea how I would keep a function running over and over again while a button is being clicked and stop once its not
i was trying using mousedown to call a function that sets a variable to true then a while loop
but that didnt work
just run the function onclick
@JBis didn't I have this discussion earlier? :P -- Anyways I still am of the opinion that no, I would not use an ORM. However I would most certainly use something to abstract sql away.
!!choose spellsword or mage
19:50
spellsword
one of my preferred classes in Morrowind
@paul23 we talked about ORMs in general, yes. But I'm seeking some advice on the other things as well.
@JBis Currently in favour of knex, with objection as steroids.
i hope crafting isn't a source of player power (levels/perks) in ES6
in skyrim it promotes this playstyle of spending levels 5-30 making gold and buying skill training
@paul23 How would you manage db migrations, and what would you use MVC? What would your models look like? Would you create methods like, User.getUserById, User.getUserByEmail?
19:52
quick question for @KevinB, now with the <span> tags, I'm getting a ::marker CSS thing
how do I get rid of that?
dunno what you're talkin about
current build is heavy armor, destruction, resto, one hand, block, enchanting
Migrations is for us "manual", and we store the sql to migrate together with the tickets. MVC: I'd just roll your own in express. As for those methods: sure if I foresee it being important at multiple places. I'd not directly create models for everything.
Look near the bottom
There's like some ::marker thing
gives me a lot of options for combat, sword/board, sword/spell, spell/spell, board/spell,
19:55
Only after I notice it's important/complex enough that directly-requesting db isn't clear anymore.
it doesn't show up for the top level spans but it does for the lower level ones
@paul23 wdym?
At that point objection comes steal the show and the models are just what objection wishes to see.
@rdevn00b click on the li, and look at the css
It's hard to because it only shows up when I hover over the dropdown
19:56
for reference, here's what i'm doing now, but i have some issues with it. UserModel and UserService)
right click the element and force hover state
Like: if I have a log table and I need to get "last accessed person" - I don't have a log-object to explain how logs look like. I'd get those directly from the database.
Yet for say user (if it's more than just a login) I might create a model, so that objection can use that model to use tree-based lookups.
ok I did that
it's saying "user agent style sheet"
but I want to override that
override it
it's css
@paul23 so where would the sql/knex for the get "last accessed person" go? in a service?
19:57
what is the css for that? I tried list-type: none and it doesn't do anything
list-style: none;
Uh knex would abstract it, but I'd put it directly in the controller.
is what i tried
Until the controller funciton gets out of whack: that's the time to implement an model.
when you click the LI on the left, the styles affecting it are on the right
yea I know
19:58
use proper css specificity to ensure your preferred style is the one that gets applied
it says "user agent stylesheet"
meaning the browser is automatically putting it in there
that means your css selector doesn't at all target it
your styles mightaswell not exist
In my current experience with nodejs spending time to make objects is often counter intuitive and leads to abuse of sql. Where you use a lot of statements where a simple join could suffice.
And only through actual working on it you can see which joins naturally follow to which "object".
I'm fully aware that for large projects where multiple teams work on it, this isn't scalable/manageable though. But at that point I'd strongly urge to move to a more static strongly typed language.
alright got it thanks
interesting @paul23 thank you
if you got a sec, could you take a look at the two files i sent and see if you spot any major issues? I'd replace the sql with knex.
20:01
I'd actually prefer to use something like redux for backend.
you sent something?
6 mins ago, by JBis
for reference, here's what i'm doing now, but i have some issues with it. UserModel and UserService)
@paul23 ^
That user model shows the "problem": what if you wish to get a user that are males is a member of table abc with in table abc "active", and not for longer than 6 months?
Is there a way i could keep on activating a function while a button is being held down?
You'd have to write a custom getter anyways, which would naturally live in a controller (it's too specific for the model). Or you would write a custom getter function in your model which allows for extra data and input fields.
@paul23 huh?
20:05
At which point you're basically rewriting an ORM; and if you extend such a custom function you'd get complexity calling that function.
me or him
lol
@paul23 If its something super specific, i'd probably query everything and then just filter it in the controller or service
(await User.getAll()).filter(
@JBis yeah but now you have both in your models as well as in your controller sql code. Which doesn't help with reducing the contact between external sql-driver and client code.
im thinking using onmousedown and onmouseup to activate two seperate functions that make a variable true or false and let a while loop do the rest would that work
@paul23 hmm so how do i solve that?
20:07
@JBis and then you are using sql in a very inefficient manner. (And because this is prevalent nosql became popular, since lots of people do this).
My solution is hence to only put bare minimum in models, and often forgo using models.
just don't send queries in loops
ez
@paul23 yeah, it feels wrong. But unless I would make a new model method for each query, idk what to do.
Don't put any in your models?
Make models only containers of data/interact using javascript.
@paul23 but you're not supposed to have sql in your controlellers or anywhere besides your models for that matter
If the model is so simple that hte data "layout" is trivial then you won't need to define a class for it.
@JBis There's no clear "supposed" way for mvc.
20:09
but mah best practices
I still don't like the idea of having sql in my controllers
Actually in C# I was thought that (for mvvm, a variant) models indeed should have no functions other than simple(!) getters and setters.
well because the ORM takes care of that right?
with an ORM you define the model and it has all your .find, .findOne etc. method
i don't like having queries abstracted away from their usage. The idea behind it is sound... but realistically what you end up with is just inefficient queries or a bunch of code written in a "reusable" way that only gets used once
@KevinB yes, this is my problem
@KevinB you'd also agree to having queries directly in your controller?
20:11
Yes that's what I'm experiencing now; so I use knex directly in controllers.
it seems counter "best practices" and mvc in general
In most cases where i need data on the backend, it's specific to that one usage. i don't need every column, i need to filter by x y and z, i only need n results, and while you could create a model that supports all of that... by the time you're done, you mightaswell have just used a query builder
@paul23 @KevinB Ok. Assuming I was using an ORM. How would what you just said change?
@JBis The best practices also take into account you work with a few dozen people on it. At that point it's very important you define how to access tertiary regions like the database.
@KevinB this doesn't create less maintainable code at scale?
20:14
ORM is your model, is it not?
As for orm: when in rome do as the romans do.
Look at examples from the ORM>
@KevinB yes
then i don't understand the question
But even orms often have semi sql in controllers:
but when using an ORM you can't have methods like getMaleUsersOver30()
20:16
Users.find({isActive: true, lastLogin: Date.now()}).select(['id']);
we tried ORM only once, and while it had it's perks, it ended up being a pain to use in most real scenarios.
particularly when queries started needing various joins
@paul23 Yes, would that go in a service or directly in your controller?
that's a line you could see in sequelize, waterline and bookshelf easily in controllers.
interesting
So, if I wanted to use SQL directly, I'd want to create a .find method but by doing so I'd be reinventing the wheel.
creating a service to use a service seems odd
20:18
I still prefer a layer of abstraction over sql statements though, just to not have to bother with mysql/oracledb/postgresql. And (more important) to have type support.
@KevinB if you wanted to reuse that query multiple times you wouldn't want to have to write out {isActive: true} every time. You could but it in a service and then call it UserService.getActiveUsers() or something
anyways, already 20 minutes late for a zoom meeting :P
gotta keep up with friends during corona times
@paul23 thanks for the help!
i mean.. yea? you could... though... i don't think that really happens often
@KevinB so you prefer query builders over orm's right?
20:20
over ORM, yes
though i prefer to just work with SQL
so you write your queries directly in your controllers?
not directly
i'll often have a CFC with functions that have the queries, just to keep the SQL in one easily scannable location
to find vulnerabilities etc
what's a CFC?
you can think of it in javascript terms as a module
more or less a collection of functions that you can import into other code
1
Q: Touchscreen controls for javascript game using buttons

LlamaButtSo I have a little javascript game that is called keep it alive and is basically one player pong, and I'm trying to add touchscreen controls, but now that my code is in, the game doesn't start when I push the button that starts it. The debug says that the functions that the buttons call are not d...

20:24
what would be the name of one of the said methods?
getMaleUsersOver30
though i'd make gender and age params, ofc
hmmmmmm
the key difference though is... it's organized in that way for defensive/organizational reasons, not reusability
there's certainly a chance it might get reused
but the goal of it is for a specific purpose
and you think that would work well at scale?
define scale
ultimately you organize your app based on the needs of the app
as needs change, you certainly may need to reorganize
20:31
Hmm. I'm just concerned, and maybe because I'm too focused on strict MVC, that in large projects deviating doing the complete opposite of a traditional, accepted method of organization will lead to bigger problems.
there's definitely a risk of spaghetti code
or duplication
particularly if you're not sticking to a strict... style, or set of design goals
but not everything has to be built with the intention of eventually one day in the future maybe possibly needing to be used by something else
when the something else needs a little extra from service X... you get put in a situation where a change to X can negatively impact any number of other things that depends on it
if you have a special case... maybe said special case doesn't need to be built-in to the one everything else is depending on
hmm ok thank you
interesting...
we do have a collection of CFC's that get used for everything, but it never contains connections to the DB
it's mostly just general text manipulation methods, or CSV handling methods, things where the language falls short of our needs
posted on November 11, 2020 by Prudhvikumar Bommana

The stable channel has been updated to 86.0.4240.198 for Windows, Mac & Linux which will roll out over the coming days/weeks. A list of all 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

but you could just as easily have CFC's that represent a SQL table as well
we just haven't had a reason to
there's nothing that is so widespread that it is needed by more than one or two apps
in my case, of course
i'm sure there's situations where having a full on service for accessing a table would make sense and be reused enough to warrant its existence
20:43
so basically, keep best practice in mind but adapt it for your use case, which sometimes means not using it at all.
💯
alright, that makes sense
appreciate the explanation
but, in the same sense.. reusability isn't the only reason organizing things and separating things is good
😉
looking at a file i'm using right now, it's 90% functions that get called in a loop
could just as easily move all those functions out to a cfc
but... they'll never get used elsewhere
just means more, but smaller, files
 
3 hours later…
23:29
@JBis Hey: A Foolish Consistency is the Hobgoblin of Little Minds
as per python first line of the style guidelines.

« first day (3679 days earlier)      last day (1494 days later) »