« first day (3307 days earlier)      last day (1863 days later) » 
02:00 - 19:0019:00 - 00:00

ABC
ABC
02:06
@MichelKansou my line chart
Hello
is it possible to export an echarts?
into excel file
seperate button
export ag grid and line chart(echart)
 
2 hours later…
04:07
@ABC everything is possible
 
5 hours later…
09:20
Is anyone here? I'm going to ask a question.
@萝莉w 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.
@萝莉w sure, shoot
I used form.action to change the content of an iframe element, after the operation, I find that iframe.contentDocument was null.
Even if I use console to display it, it is always null.
but the iframe shows content?
It shows.
09:22
hmm
that may be a security thing to prevent someone from hijacking a page
I've never seen that type of problem though
Oh, well, thanks.
have you tried using other browsers?
I've not tried firefox yet.
Let me have a try
.
Firefox and IE also said it is null.
hmm
@萝莉w iframe content is heavily guarded under SOP
09:29
I think that again, they're very careful about what information you can pass from an iframe
could be that the SOP is not set right so that the browser has prevented access to it
(SOP = Same Origin Policy)
your new page has access to its own content
but I don't think the parent frame can hope to extrapolate information from it
do some check on how SOP work and how you can enable access to iframe's content
 
1 hour later…
10:44
anyone know how to make html elements of the same height?
this is basically the situation, and I want the item-head nodes to have equal height
I tried getting all elements, then pick the max height and then loop over them to apply that height to all of them, but that stops them from being responsive
their height wont increase if I make the screen smaller so that the content will still fit inside it
pretty much every css solution I found is only for direct neighbours, not for their children
10:57
@Wietlol so a flex table?
treat it like a table, but "flex", so each row resizes together
but you can still treat them fairly liberally
but those red divs arent direct children
you have used js to set height on a fixed set # of pixels
will that work for them?
if you want to make it responsive, use a different unit (viewport) or use % based
If you make each ".item" separate, you can't make them retain the same height
you'd have to necessarily have a header row and a body row
again, if they're flex, then they can flow to the next row or whatever you need it to do
11:00
^ more clean approach and flex supports it
@KarelG if I do that, the heights wont be updated when I resize the window
for example the text:
hello world
this is the header
it is just container with 2 flex rows and the 2nd row are then containing flex containers with column as direction
if I make the window smaller, that text might become
hello
world
this is
the
header
but the size will remain to be the same as the two liner header
because that height is set via JS
@Neil do you have a link for something like that?
@KarelG maybe if we don't keep saying the word flex, he'll think it was his idea :)
seems like what you want is a column-collapse table
hi!
11:03
@Leite 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.
@Leite hey, welcome to the chat
thanks
so, use javascript a lot?
anyone with experience doing virtual scrolling on a table willing to share some tips? working on a vuejs project with vuetify and now trying to implement virtual scrolling in a vuetify table
virtual scrolling? You mean you override the scroll event and you do something different?
11:08
@Neil almost daily, thankfully only workdays
not on the weekends? :)
@Neil could be, but then I have no idea how to do the styling
you just make it behave as you'd want on resizing and worry about styling after
nah, weekends aren't for work anymore
probably best
11:11
@Neil virtual scrolling, a table with many rows, but visible and rendered in the dom rows are just enough to fill the view and a small buffer above and below, when you scroll, new elements are added as needed and the ones not visible removed
then I need to flatten the item nodes, no?
@Leite hmm, I suppose you'd simply have to determine what your buffer size is, and if you scroll past the point where the remaining rows is less than the buffer size, you make an ajax call
you should probably just be careful to not make multiple requests to the server
@Wietlol you'd make it row-based and not column based
that's all
it just wouldn't look like a single table but several separate columns
yeah, that's the approach i took, requesting more items as needed, but it started getting slow the more rows got added to the table
so the proposed solution is something like this angular-yni1jw.stackblitz.io, if you inspect the list, although there's 10k records, only a few are in the dom at any moment
yeah it'll slow down if you have too many dom elements
you could also eliminate rows you've already scrolled past
people don't generally scroll back up
not 1000 elements in at least
I guess slowdown is because of repainting
I got 1000+ elements
I saw technique where they remove rews you don't see and then restore them once you scroll back and remove the those from bottom
11:25
I've got two different pages that share a lot of javascript functions, but also have a lot of javascript functions exclusive to that page. All functions need the freedom to call each other, and I'd like to edit the shared functions in one place. I've been googling for ages and cannot find a style guide for the best way to do this. Anyone got a link?
I was tempted to post it as a question, but style related questions don't seem to be well received by the community
i have a job interview in an hour
funny to be on the other side for once
also hi and please reinstate Monica
nothing to congratulate yet I guess?
Hey, just being in the race at all is an effort, even if you don't win
@Neil yeah, trying to do something smart to handle that, i'm using Vuejs and Vuetify, and any npm library that does that virtual-scroll thingy wasn't playing nice with vuetify
11:28
They wouldn't be interviewing you at all if you hadn't done SOMETHING right
@JonathonPhilipChambers I guess. This is an internal-only application for now
@JonathonPhilipChambers unless the meeting is just to tell me they don't want me for that position :D
@Raimonds that's it, the name i've seen for it is virtual-scrolling
we'll see in an hour anyway
thinking about the job interview beforehand is what makes me nervous
so generally I'll distract myself as much as possible beforehand
@Neil cue why I came here
11:30
but you're talking about it here
heh, touche, i guess
still counts as a distraction
Yes, distract yourself by solving my problem ;)
@JonathonPhilipChambers hmhm
11:30
opportunist :)
Hey, gotta take a business opportunity when i see it!
@JonathonPhilipChambers a bunch of shared functions is typically called a library
Ah, that sounds like a much needed keyword
once you cross the river of "building" your webpage then you just add your library as a dependency
@JonathonPhilipChambers in the js ecosystem the name "package" is often used as well
especially when talking about distributing it through the online channels such as the npm registry
adding a non-published package as a dependency should also be possible, though
and has the added advantage of being able to e.g. test the library/shared part independently
A bit more context, I have a function that tells you the postage price of your item. I want each page to calculate it independently, but I only want to write the calculation once
I have way more functions to share than that, but that's just one of them
(thanks for the detailed help, by the way)
11:34
I mean you've already figured out the important part - the logic that is supposed to be the same should be written only once
now you just need to get the "logistics" of that right
it will depend a bit on how you're including the js to your page, and if there is a build step or not
Exactly, and so far I've done it in a very very ugly inelegant way that technically works
By the way, you'll have to forgive me. I'm self taught, so there is likely some first year basics I don't know while some master level expert things I do. Not familiar with the term "build step"
have you heard about webpack or grunt?
in this context "build" simply means that you'll be serving something else than what you have in your editor directly
11:36
webpack? no
grunt? no
e.g. your app can be split into multiple files for easier editing, but will be glued to one file that you will put into your web server
then don't worry about "building" your javascript
yes, basically, grunt and webpack are tools that you can setup to "join" your javascript files into a single file (or multiple)
if you're not using it, ignore it
or start using it :)
or that :D
I've always been a bit of a purist. For example, I don't use any libraries written by other people.
11:38
I mean it adds a certain amount of complexity to very simple projects, but actually makes the more complex ones easier / doable at all
But it seems I need to learn to write my own
@JonathonPhilipChambers eh, you won't get far with that approach sadly
but yeah, there's little difference wherever you or someone else authored the package
I know, but it gives me a greater appreciation for them when I finally give up and use them
I always feel a little defeated whenever I use a library
well, if you're gonna be the author, that shouldn't be a problem
So, do I just write the code, put a "js" on it, then call it in some script tags?
Or is there a cleaner way?
11:40
@JonathonPhilipChambers it can be a bit or much more complex than that
I'd probably take a look at somethign liek this in your case
192
Q: npm install private github repositories by dependency in package.json

vashishatashuI'm trying to install github private repository by npm that includes other private github repositories as dependency. Have tried a lot of ways and posts but none is working. Here is what i'm doing : npm install git+https://github.com/myusername/mygitrepository.git in package.json is like : ...

Opened it in a new tab
Will check it out as soon as I leave chat
dunno if you use npm at all
if you don't, well, that would be a good start
@JonathonPhilipChambers ah, right, yeah, well
I think it would do you good to read up a bit about how a modern JS page is structured
i think it will be handy to learn how to have a build step in your javascript
11:42
I've only been using GitHub for a few weeks now. Other than that, it's just the bare basics
righty
I think it would serve you best to go step by step at that
The fact that I didn't call GitHub a bare basic should reveal a lot about how basic everything else is
yeah
Oh man, I should've got into that WAAAY earlier.
@JonathonPhilipChambers you're gonna say the same about webpack ;) Well, I certainly did.
11:43
i'm assuming you have your javascript files included in the pages as needed?
yeah, pages are written as *.php
I write the javascript directly into the page, but it's getting very messy
it does yes
the first step would be to simply put the js into separate files
I'm finding myself using copy paste a lot, which is getting into very scary territory.
that, put the js into their own .js files
11:45
if you're writing your own backend then I wouldn't go into serving a fully built frontend yet
okay, so suppose I have two .js files, can they both call functions inside each other?
just think about how the js code should be structured
@JonathonPhilipChambers the idea is the code needs to load before it starts executing
if your JS code is programmed to run after all script tags load, you'll be fine
@JonathonPhilipChambers as long as they're both included in the page, yes, they can call functions from each other
cool. So I can have general js files shared by many pages, then specific js files with only one or two pages
11:48
I suspected that would work, but it's a lot of effort to go to to find out I just made up a technique that doesn't work
Okay, you guys are awesome. I think that's everything I need to know.
Any other tips or pointers?
6 mins ago, by Bartek Banachewicz
I think it would serve you best to go step by step at that
try that and see how it works
the only other tip I would give is to not use PHP, but that's a very personal opinion
and before you ask, literally anything else is better, modulo the fact that it's an opinion
:D
and before you ask again, I personally opt to go serverless nowadays
o.o
don't trust the others anymore? That level of paranoia ?
i.e. not write the backend code if I can help it
@KarelG pragmatism
I'd say trusting someone else's computer is the opposite of paranoia
11:52
well, i started with php as well, learning as i went, there's better options out there, but php is easy to get started
so is cocaine I've heard
shit we should time the average amount of time it takes from me entering this room to me being in a language flamewar
I bet it would be single-digits in minutes
forget I said anything about PHP, just go and make your website work
that's it!
I know it's cheesy but I had someone say "do you know what the hardest language is to learn? Your first one! Just pick a language and start learning."
PHP may be bad, but before PHP I was making websites with Adobe Muse
I liked their last album
finally the scroll of truth! "There is no 'best' language, only languages programmers feel comfortable using and languages they're unfamiliar with." Bleh!
11:55
PHP isn't inherently bad, and hasn't been for quite a while now
It's got it quirks, but so does every other language
@MadaraUchiha must... resist...
actually nvm, im not logged in to twitter and cba to do it to find that one weird puzzle
So, what are the PHP quirks that most languages lack?
I've heard the spectrum from machine level to interpretive, but I've never heard where PHP sits on that spectrum. I tend to romanticize machine level languages a bit.
php lets you define methods with the same name in the global scope
the one which gets called is the last one declared
or at least it used to be this way, it may have changed
as far as languages go, this is far from ideal
a method like "indexOf" you may call thinking it behaves in a certain way, but in reality it was overridden by a slightly different method by the same name
also allowing variables in global scope in general is a bad idea
I think you can also override global scope variable definition in the same way
@JonathonPhilipChambers on the initial topic of having a build step for your application, you could have a look at parceljs, it's possibly the easiest to get started with parceljs.org
Thanks. It's in another tab
I'll never be put off a language just because it lets me do something useless. I just think "wow, this language is so powerful, it can do useless things in addition to the useful things!"
And yes, I am fully aware how stupid that logic is, but it brings me joy so I'm keeping it
12:06
I used to think that a powerful language was one that let me do anything I wanted in many different ways
But over the years, I've gradually come to believe that restrictions in what you can do can be very powerful as well
It isn't a cork that prevents you from writing your program, it's more of a funnel that prevents you from doing things that may get you into trouble
@Neil wise words
the program you want to eventually end up with is in the small subset of programs that run well
I see both sides. Using the tools from a professional perspective, I agree. But I'm writing just one website for my business, and how I feel while coding is more important than how fast I get it done.
if the language restricts the programs you can write to that subset, your job becomes much easier
python won't let you mix spaces and tabs for instance
They could have allowed both, provided certain concessions, like a tab is 4 spaces
12:09
haskell and rust have that as a warning IIRC
they didn't do it that way. they're very uncompromising in that regard, and I think that was the right choice
well, that definitely prevented a lot of annoying errors
that's worth a few disgruntled voices imho
In C++, there were a lot of weird rules like what happens if you don't use brackets in the if clause and the next statement is an if..else.. does that else belong to the inner if or the outer if?
and you could indent it however way you wished and thought it worked in one way and it worked in a completely different way
C++ was one of my first languages, so all the aspects of it that freak out most people, I just thought that's what coding was
if you didn't allow such possibilities, you avoid the issue entirely for instance
C++ really is a hacksaw. Powerful but easy to mess up, especially when it comes to pointers
I imagine C is even moreso this way
12:12
I'd love to go back to C++ one day.
Just need a project that calls for it
I think they still do plenty of game design in C++
I think it would be fun
one of the hassles of C++ was all the boilerplate you needed to make it work cross-systems
that's being handled by the unified compiler
The thing I liked about C++, is how fast the final thing would run. It may take ages to compile, but once compiled I had fine control over removing unnecessary CPU cycles
Keep in mind, I'm not speaking from experience. I never wrote anything worth running fast.
@JonathonPhilipChambers I'd recommend Rust instead based on what you wrote above
Cool. I'll remember that
12:15
@KarelG what version is this?
Yeah, I don't mind a language where I need to write twice as much, provided I can save one CPU cycle in doing so. I have no logical reason for this preference. It's purely a fun thing.
it's been a while since I used C++. It was already way different after the 2003 version with smart pointers and the like
So Rust? If I ever get a game idea, I'll learn Rust and start writing it
@Neil experimental c++
Oh it hasn't been released yet?
12:18
it depends when they moved completely to a linux based kernel and managed to setup adapters for supporting libraries
something for 2020+
Is Rust a free tool or something I'd need to buy?
Rust is a programming language
okay, but my question stands
It is free
Do free compilers for it exist?
:D
Okay, mental note. Learn Rust in like 10 years when I get spare time
it is a new concept tho. Still procedural but with a different "access rules"
Okay guys, you're all awesome. I'm gonna leave the chat and look at all the tabs I have open. Thanks everyone
12:42
i'm trying to figure out if i can 'hook' into the core react renderer to add a border to each component i am rendering to the page.
does anyone know if this is possible? I assume there's a core react 'painter' somewhere that calls all available components then calls their render function. So all i'm thinking is i do a <div with border class>{component.render()}</div>
SHET... wrong bookmark
Actually, does anyone know how I can stop this issue from happening? basically im reflecting the velocity when it touches a wall
multiplying it by a negative fraction to imitate "friction" or "gravity"
But, sometimes, when theres only .1-9 or 1.2 and below velocity left, and it touches the left corner... it just "stops"
The bottom left corner is the main disconnection point
basically, the right side and ground are in one snippet, and the left side and roof are in another
12:58
@TaylorS You're probably checking if the ball is close enough to the wall to reflect
and multiplying it times a negative velocity doesn't actually move the ball
if it isn't moving fast enough, it is still "close enough to the wall to reflect" so you keep applying the rule
   // left and roof physics
 if (x > canvas.width + radius) {
  x = -radius;
  vx = -vx;
 }
 if (x < 1 + radius) {
  x = radius;
  vx = -vx;
 }
 if (y < 1 + radius) {
  y = radius;
  vy = -vy;
 }
You mean the middle one?
it detects if its less than one and next to the left wall
without that snippet, the ball doesnt actually move at all
or maybe its the bottom snippet... im not sure
if (x > canvas.width + radius) { x = -radius; ...
why?
shouldn't you do x = canvas.width?
i guess x,y is the ball coordinate at its center
yes
radius is subtracting the ball size from the canvas
if you didnt do that, the ball would clip the walls
kinda logical to add radius of it to the calculation
but yours formula is a bit harder to read
13:01
If x is beyond the width of the canvas, change direction, right?
but you put it on the left side of the screen instead
hmm.. I got math work to do, Ill be back in a bit
then you ask is x < 1 + radius?
yes.. you just assigned it to -radius
// compare this
x > canvas.width + radius
// with
x - radius > canvas.with
// which one is more easier to read as "ball has hit wall"
but it is wrong tho
left wall is at 0
so x - radius <= 0
right wall: x + radius >= canvas.width
Im back, I had to take notes
oh I see
Oh, I see what I did wrong
( did write this code nearly 2 years ago, so I wasnt as "experienced" )
also you probably want to ensure that velocity is positive before you switch it negative when it hits the right side
that way you can ensure you won't end up with the ball bouncing in place
13:11
I didnt even bother using Greater than or equal to or the other calculations...
I just did a check if it hit the wall
So, it does still hit the wall and freeze, but only if its at 0 velocity, so its functioning correctly... I should probably also reverse apply this so it doesnt get stuck in the top right corner
Ive only seen that happen once...
14:11
Minor note, you may want to move the ball back by more than its radius
Instead, you might want to look at how far the ball made it into the wall, and move it back by negative that much, which helps the animation remain consistent across frame rates
or just ensure the velocity is positive when hitting x/y limit or negative when hitting x/y=0
If your ball is moving 10 pixels per redraw, it might make it 5 pixels into a wall. If you bump it back until it's no longer inside the wall, you've altered the velocity of the ball slightly so that it only gets to move 5 pixels that redraw. If instead, you bounce it back 5 pixels away from the wall, then the ball has continued to move 10 pixels per redraw.
okay
I think it went well
@BartekBanachewicz well done sir :)
the process is supposed to go through for about 2-3 weeks to go through everyone that sent their applications but I got the good vibes
14:14
I knew you had it in you
you don't even know what the job is about :D
spoiler alert: not programming
well that's kind of relevant isn't it?
the title is "Technical Training and Development Specialist"
so a meta role somewhat
so you'll be training employees?
@Neil possibly, but it's more about finding new trainings, organizing workshops etc
finding out what knowledge people need or could use the most
14:18
are you worried that might be too different than a programming position?
I wouldn't say "worried"
It's definitely a challenge and a new thing for me, but it's also something I really liked doing within the capacity of being a dev
well good
my wife pushed me to be like a project manager or something, but that smells too much to me like management for my liking
I can appreciate striving for a better paying role, but not when it isn't something you want to be doing
... project management is literally management :D
14:22
well kinda
it's about as "manager" as you can get as a programmer
but you still program if the team is small enough
at least that's my understanding
I guess being a Product Manager would be closer to that
more about the thing you're building, less about the minutiae of the process
or you can just become a team lead if you aren't already i guess, but that's already too much management for me
yeah I really don't think I would like that
I've been in positions where people would listen to my advice, but there's a world of difference between that and being someone's boss
@BartekBanachewicz /inbefore you suggesting Haskell all the way
I guess that the position allows you to discover new technology / features which might suit you better.
hah. gets hired as technology expert. suggests only Haskell. profit?
14:40
Is something like this possible to
Use main function to check whether condition is true and then run the callback that was sent to this function?

I want to create a reusable function for confirming, deleting where i just pass the object with arguments and then a callback what happens after the user accepts.



Here's the jsfiddle
https://jsfiddle.net/43zrqkvm/2/
It's hard to explain tho, i'll put my actual code in there ina sex
sec*
Here's the new updated version
https://jsfiddle.net/43zrqkvm/3/
14:59
@Neil @KarelG you've uncovered my secret plan
@KarelG heck, I intend to join up on most of the trainings I'll bring in :D
spreading the evils of Haskell to everyone who will listen!
so far our code conventions doc that I'm drafting up has stuff like "prefer functions to classes"
and "mutable state is evil"
Is there a way for a parent host rendering an iframe to prevent the child from knowing it's in an iframe?
Making it think that it's the top frame?
not that I'm aware
15:48
There's even a header preventing your page from rendering in an iframe and it's used for security so I presume there's no known way to bypass that in normal browsers
15:58
@DenysSéguret There's an easy way to bypass it
They just set up a proxy that strips the header
Won't be on my domain, but they would still be able to present my content as theirs.
oh, this one. Yes. I even do it.
It's still detectable when done in mass, though
16:15
This "another_src" question... Can there really be a reason for such a mess (especially the rs file at the root) ?
16:55
Fullcalendar
Anyone?
I'm trying to figure out how to set expand transitions on table rows in Vue. Can anyone help?
Does anyone know where firefoxe's spell check engine comes from?
mozilla?
But like is it a separate project i could use?
its pretty damn good
17:19
 
1 hour later…
18:26
@SterlingArcher thanks bae <3
@BartekBanachewicz hi
Congrats on the new job
what company?
Hi guys. I need to build a lib, which could be the same time used from node.js and imported via require and consumable from the frontend via es6 modules import. the lib itself is a rust compiled to wasm Could you give me some hints - how could I try to achieve this?
actually I did solve rust/wasm part with 2 separate builds
what I currently thinking of is how to build a kind of adapter for this 2 build which hide implmentation
18:42
Is anyone else getting a Gateway Timeout on jsfiddle?
02:00 - 19:0019:00 - 00:00

« first day (3307 days earlier)      last day (1863 days later) »