« first day (3518 days earlier)      last day (1413 days later) » 
00:00 - 21:0021:00 - 00:00

12:50 AM
@paul23 depends on number of users needing to access, if more then a couple i'd do a db and then have a script run at 12am each night to update db of external changes
 
1:30 AM
Hmm it's basically a list of a few images for a carousel at the homepage
 
how to do this in javascript?
 
@paul23 def db imo
 
x = [1, 2, 3]; print(*x); output: 1 2 3
^was python
 
||> const x = [1, 2, 3]; console.log(x.join(" "))
 
@JBis undefined Logged: "1 2 3" Took: 0ms
 
1:37 AM
^ that is if you exactly want the same output.
 
Sorry, I am not trying to join, I just want to unpack the elements. Let me give you another example.
 
console.log(JSON.stringify(x));
@AjayMishra use JSON.stringify :P
 
>>> a = [[1, 0], [2, 4, 5], [6, 7]]
>>> print(*a)
[1, 0] [2, 4, 5] [6, 7]
>>>
 
Or if it's unpacking but not logging (say to unpack into a function) - that's not possible, in javascript it's actually more common to use a single object argument for a function instead.
||> const a = [[1, 0], [2, 4, 5], [6, 7]]; console.log(JSON.stringify(a));
 
@paul23 undefined Logged: "[[1,0],[2,4,5],[6,7]]" Took: 1ms
 
1:40 AM
what I actually wanted to do is to pass the inside elemnts to a function which takes variable argument.
 
Yeah that's not what javascript does.
As I said: in javascript it's more common to then pass a single object and deconstruct that object.
 
2:40 AM
posted on June 03, 2020 by Ben Mason

Hi, everyone! We've just released Chrome 83 (83.0.4103.96) for Android: it'll become available on Google Play over the next few weeks. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome

 
3:35 AM
How to enabled the button save?

  generateContainer() {
    const _this = this;

    this.modalRef = this.modalService.create({
      nzTitle: this.translate.instant('Change Password'),
      nzContent: this.modalForm,
      nzOkText: 'Save',
      nzOkDisabled: !this.formGroup.valid,
      nzOnOk: () => {
        _this.returnPassword(true);
        _this.modalRef.destroy();
      },
      nzOnCancel: () => {
        _this.returnPassword(false);
        _this.formGroup.reset();
        _this.modalRef.destroy();
  generateForm() {
    const passwordForm = {
      password: [null, [Validators.required, Validators.minLength(8)]],
      newPassword: [null, [Validators.required, Validators.minLength(8)]]
    };

    if (this.user) {
      passwordForm['username'] = [this.user];
    } else {
      passwordForm['old'] = [null, [Validators.required]];
    }

    console.log(passwordForm);

    return this.formBuilder.group(passwordForm);
  }
 
 
1 hour later…
 
4 hours later…
8:32 AM
Hi everyone, is there some kind of name for the web design characters that have been popular in recent years? Like these: https://thumbs.dreamstime.com/z/web-development-project-team-engineers-website-create-webpage-building-ui-ux-design-characters-concept-agency-template-136721707.jpg

or these: https://image.freepik.com/free-vector/flat-people-characters-buying-house-template-web-design_80358-23.jpg
I'm talkin about those people graphics
 
 
1 hour later…
9:44 AM
Hmm what do you guys think is the "best" blend mode for a carousel? test.webasupport.com/home
(scrolldown to see a select to change the blend mode)
 
10:06 AM
This stupid thing keeps telling me it cant grab the name property from an object that has it...
Cannot read property "name" of undefined
 
 
1 hour later…
11:13 AM
heh a could-be successor for node.js;
loved the word play "node" -> "deno"
and is from a dev that was at the foundation of node.js
@MisterSirCode error is self-explanatory
😁
 
Turns out that error was fixed, and it caused 10 more piece of shit things
now im mad and ticky
and I cant understand this thing
 
ah the old phenomenon: fix a bug -> create new bugs
 
Having to seperate my button functions into more buttons because LOGIC DOESNT MAKE SENSE....
 
huh?
 
IE: Currently trying to make a button that goes to the next page. If you reach the end of the list, the button then starts creating NEW pages and the icon changes
Turns out that sounds simple but its a piece of shit to do
so now Im screwing with my beautiful flexbox to make room for a new button
so I can create more pages...
 
11:16 AM
you don't have to
just have a function that checks if you're on last page. If so, change the button's display and behavior
 
I did that
 
you cna unsubscribe click events ya know
 
maybe im just fricking stupid today but this is way more difficult then I want it to be
 
you are using anonymous functions in your click handlers
 
mostly yes
 
11:18 AM
that is useful for short solutions but not for true dynamic buttons
if you give a function, then you can unsubscribe it
 
Well, keep in mind this is going to be a small web app, these functions wont be used anywhere else
 
and assign a different function
 
Thats a lot of work instead of an if statement
 
lol no?
function unsubscribeClick(element, fx){
  element.removeEventListener('click', fx);
}

function subscribeClick(element, fx) {
  element.addeventlistener('click', fx);
}

// code
if (lastpage) {
  unsubscribe(element, goToNextPage);
  subscribe(element, createNew);
}
and for init
if (isLastPage) {
  subscribe(element, createNew);
} else {
  subscribe(element, goToNextPage);
}
or you cna do subscribe(element, (isLastPage ? createNew : goToNextPage));
meh ... function names and ect are pseudo code
and add a check in goToPrevPage to see if you are still on last page or not
 
But thats hypothetical logic
I really dont get that... I know some people can make up names and functions out of thin air. I appreciate the idea, but I might just dump this one and create something else
Im making this project way more overrated than it needs to be
 
11:32 AM
LOL what is this
 
@AndreChristoga Pramaditya 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.
 
@MisterSirCode 🤨
 
Hi guys, I am trying to work something out using the chrome profiler. I am using AMCHARTS which basically takes a long time, but they are chunking the loads. Righ at the very end (as its being inserted in the dom) the whole page locks for a second.

I would like to see this in the profiler but I am not sure what I need to be focusing on. Does anyone have any experience?
 
12:07 PM
@KarelG I've already checked that a year or so ago, did they really make progress? Right now it seems like they try to fix a non-problem. And in doing so create extra complexity
 
@paul23 I don't know. I just found it. :P
 
It's annoying that each and every time you run the packages are gotten (temporary) from a repository.
To proclaim "it's more secure" - but I'm not really sure I "trust" getting packages from a repo each time more than I trust filesystem access.
 
12:38 PM
well a repository is no more "secure" than say, saving it to a file system
under the rug, that's all a source repository does in the end anyway
if anything it may be more secure because it's written to several disks, and not just one
 
Hi Neil.
Got sufficient fresh air now? :P
 
fresh air?
 
1:00 PM
the lockdown in Italy has ended a while ago
 
ah
somewhat. you're not supposed to leave your house without a mask on
that said, there are plenty of people without masks
I suppose that's still ok while the numbers are down low
 
they have conducted a survey here
people with masks is getting angry at those that does not wear it in stores.
(it's advised but not mandatory. It's however mandatory if you use the public transport)
and heh
 
I think it's just respectful, at least in these times
 
last weekend was a prolonged weekend (due of official day the monday)
a lot people went to our coast for a day-trip
it was like corona was taking a vacation. The local mayors are pretty upset with the level of stupidness/stubborness of visitors
 
I'm just waiting for the numbers to jump back up again
I hope not, but I don't have high hopes
 
1:18 PM
ours never stopped climbing
during the week we get 400-450 a day, on the weekend 250
 
we have a thing "weekend-effect" to explain why numbers are lower during weekend and monday towards the rest of the week
 
Hello, i'm trying to find divs that are above my current position in the page, but something's wrong and i don't know what This is how i thought it works:
$.fn.isHigherThanView = function() {
    var elementTop = $(this).offset().top;
    var elementBottom = elementTop + $(this).outerHeight();
    var viewportTop = $(window).scrollTop();
    console.log(viewportTop);
    console.log(elementBottom);
    return elementBottom < viewportTop;
};
I can call that using $("#mydiv").isHigherThanView() but it says everything is higher than view..
 
@JBis what ide do you use?
 
@MarioR. "position" in the DOM or on view (by coordinates)
 
Basicly the idea is to scroll on a page and get the divs that are above my scroll position
I want to remove the divs that are higher than my current position in the document
I thought if i check for the bottom of the div if it's higher than my current top position then it's fine, but it's not :D Or i'm taking the wrong properties
That function is just to check if it's on top of the scroll, i don't want to remove with it
 
1:46 PM
Holly hell why is this so hard lmao
13575.718375 < 937
 
2:09 PM
got distracted
you have to do that with the postions yes.
 
@MarioR. the logic seems sound
 
AAA
Hi guys, my middleware is reaching the else statement, but when I console.log it, it's undefined? Can anyone help me work out why.
export default function ({ $axios, redirect }) {
    const accessToken = cookies.get('x-access-token');
    console.log(accessToken);

    if (accessToken === null || accessToken === undefined || accessToken === '') {
      return redirect('/');
    } else {
      $axios.onRequest((config) => {
        config.headers.common.Authorization = cookies.get('x-access-token');
      })
    }
}
 
my advice would be to alter it slightly so that viewportTop is the current value + 200
so you can see it being removed
 
AAA
It never hits the redirect('/'), but surely it should if console.log results in undefined?
 
@AAA console.log(redirect) shows undefined?
it shouldn't matter if it doesn't get called
 
AAA
2:13 PM
no, accessToken
yeah so the redirect('/') never hits but accessToken is undefined.
I mean its undefined judging from the result of the console.log
 
hmm, you've verified that it enters the else clause?
 
AAA
yeah I initially had the consoel.log in the else, but moved it as I thought it might be scoped related.
Also the Authorization header is now sending
 
you could just do if (!accessToken)
I mean I don't know if that would fix it
it doesn't seem wrong
 
AAA
yeah, I was trying to be verbose at the time :P
strange
 
var destination = document.querySelector('#container');

ReactDom.render(
    <div>
        <p>Hello!</p>
    </div>,
    destination
);
how the destination bit work there?
 
2:17 PM
@AAA when I come across a problem like this and it doesn't seem possible, it means one of my assumptions, however true it seemed was wrong
 
is destination the css to accompany the first parameter in the redner function?
 
so double check everything would be my advice
 
Does anyone know whether there's a different method required to create an image file in another directory? I'm using streams and pipes but for some reason the img file I recreated is extremely small(original is 1.15MB, copied is 20B)
 
AAA
content is undefined, but surely the if clause should still catch it?
 
can you not perform a check directly on the content?
 
AAA
2:20 PM
I think cookies.get('x-access-token'); gets the content
unless it has dotnotation I don't think so though
 
weird
 
2:54 PM
Guys after a while of scrolling in page even if the dom element is still in the dom the offset will say 0 for all positions, anyway to get the actual position of the element in the dom?
 
 
1 hour later…
4:17 PM
@Permian webstorm (jetbrains)!
 
user8729657
:O
 
user8729657
This upload file button looks suspicious.
 
4:57 PM
!|magic
 
@JBis ok im in vscode
class TodoList extends Component {
  constructor(props) {
    super(props);

    this.addItem = this.addItem.bind(this);
  }
why do we need to bind here? surely it knows what the this is?
 
If you don't bind it, and it isn't an arrow function, it will lose this if it is used directly as an event handler
or called in any way that would alter this
 
@KevinB but addiitem is just a variable?
 
can you show the rest of the code?
 
5:02 PM
It's a method
 
its near the start
 
yeah it's a function
oh, i closed it once i saw a video
 
sorted
 
class TodoList extends Component {
  constructor(props) {
    super(props);

    this.addItem = this.addItem.bind(this);
  }

  addItem(e) {

  }
   .
   .
   .
}
 
i did the practical javascript course yesterday
 
5:02 PM
Nice!
 
all of it. learnt essentially nothing
 
Okay!
It's meant to introduce the concepts in a pretty different way from other courses
 
then i went to look at jbis's react rpoject. understood so little
 
So if you already know all the concepts then I don't think it can help you
Learning starts from lack of understanding
 
i think theres a leap between understanding js and build a react app from scratch
 
5:05 PM
Well yeah, it's probably learning React
 
yeah but ive done that as well lol
 
How would you explain a "React component" to me
 
a component of html with javascript attached to it
 
keep going
 
allows modular building
 
5:07 PM
good. What are "props" and "state" and why would you use them
 
props are variables passed by the paretn components
state is variables within the component
initliased by the constructor
 
what's the difference between a normal class property and React state
 
class properties have getters and setters?
i dont know
 
There's an important difference between React state and normal variables
Why would you choose to put something in state instead of a variable
 
ill google it now
 
5:10 PM
Okay I'm just trying to get a feel for how much you understand
Don't worry about Googling it, I know the answer, I'm just trying to see where you are
Can you tell me (without googling) why components re-render?
 
to update state?
 
Can you elaborate?
 
i dont know
 
Okay so for that the answer I was looking for is that components re-render to reflect changes in props or state
 
ah ok
i sort of knew that
 
5:13 PM
They don't re-render to update state; they re-render because state was updated, but I think you're on the right track
Sure
 
@BernardoMarques 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
 
@Permian Have you made any React apps following tutorials?
@BernardoMarques Split your messages into prose and code. Prose message, then formatted code message, then prose message.
 
hey guys, I think I'm facing a scope problem. This is the function I'm trying to use
 
@forresthopkinsa this todolist is my first one
 
const divTitle = (title, divId) => {
  const printTitle = `<h1>${title}</h1>`
  if (title) {
    return (document.getElementById(`${divId}`).innerHTML = printTitle)
  }
};

divTitle(params['divTitle'], target);
 
5:15 PM
apart from the tic tac toe ages ago from the react webstie
 
If i try to run this on console it works, but it´s ot working on my function. It's inside an asyn function, I got a Promise error
 
@Permian The reason that we recommend Practical Javascript to people here is that when you're following a tutorial or course, there's a tendency to copy down the code and not think about why the code is the way it is. PJS is a good course for learning the language because it tries to stop you from doing that. Since you already know the language it clearly can't re-teach you; however, you can try to apply the idea to other tutorials as well.
 
im copying down the code from here
 
All that to say, when you're following a tutorial or taking a course, always stop before copying down code to ask why the code is what it is
 
5:19 PM
Okay well I'd recommend that between steps, you try changing bits of the code. Try seeing if you can do the task a different way. There are always multiple ways to do things, see if you can figure it out.
The point is that you don't want to learn how to copy down code
Which is a trap that a lot of people fall into
I don't know that site so I can't say how good it is. I don't have any recommendations for a React course.
@BernardoMarques Thanks for fixing your formatting and being patient
What is the error you're seeing?
 
@Permian I suggest trying to do something on your own without following a tutorial
How about building your todo app and then adding a search bar to find certain items?
 
@JBis i dont think im there yet
@JBis how much of that bitlink code is your own?
 
everything in those github repos except for one function that i asked someone to make because it was too much computer science
 
wowzer
that bitlink is impressive
how long did it take you?
 
about 2 months i think, you can check github commit dates
 
5:29 PM
omg
im impressed
 
thank you
 
actually I don't see any error, I tried to call this piece of code in some other place and got that Primise error
 
6:10 PM
nice, problem solved
 
posted on June 03, 2020 by Srinivas Sista

The stable channel has been updated to 83.0.4103.97 for Windows, Mac, and Linux, which will roll out over the coming days/weeks. Security Fixes and Rewards Note: Access to bug details and links may be kept restricted until a majority of users are updated with a fix. We will also retain restrictions if the bug exists in a third party library that other projects similarly depend on, but hav

 
@JBis how long have you been doing this?
 
doing what?
 
@JBis react+js
if you click on image not found in the chat you can see my todolist... it populates the tasks multiple times!
 
6:27 PM
@Permian making progress, can we see the code?
@Permian that was my first big react project, i've been doing js for hmm, 2.5 years?
 
@JBis wow
a lot of catching up
 
yep, and still much more to learn
 
6:42 PM
does anyone know of a good way to build a carousel in react?
here is a ready made one
if you had this in a coding test is taking the premade one ok?
 
depends on who is grading the test
 
hackerrank
 
no idea what that is
but doesn't really change my answer
 
anyway
i had that task and to query a api using javascript and sort the results
which i couldnt do
 
Hey if you guys like to fiddle, what do you think is the best blendmode to generate a "background carousel" of images?
Where you have a background of images and then an overlay in the main theme color
I've already asked but apparently no one is online in the monring :P. You could check out: test.webasupport.com (and scroll down to see the select for changing).
 
6:55 PM
exclusion
 
XD I see you getting high
 
ew material
i just gagged
 
Jbis has a phobia of material design
 
tbh i think it looks better without an overlay. Or pre-manipulate the photos in photoshop if need be.
 
Geez too much red, man
 
7:01 PM
pre manipulate won't really work, since the images will be dynamically (randomly) chosen from events in our database. (As long as they're marked to be able to get chosen).
 
It literally hurts my eyes, gotta tone that way down
 
Thanks I'll pass that forward to the designer, I'm just the simple dev who implements things ;-).
 
also try to get better quality pics, those are pixellly
 
I was "so which blend mode you want to blend the photo with?' - "Uh Idk, can you show the differences?"
@JBis They're just random things I found on the internet when googling for popular pictures for our main sports we support right now -- I can't even use those in production.
 
ah ok
 
7:09 PM
@paul23 hahahah fair
 
But yeah it's going to be a problem: the images are dynamically chosen out of a pool based on what the user has often searched for. (And what images are made public display by organizers of events).
Thought I'd just ask here too, since it went on a public facing website anyways. (Easier since we work from home nowadays - and it's "safe enough" anyways).
 
soft-light looks pretty good to me
 
Does someone mind helping me do a sanity check on my NodeJS syntax? I can't seem to figure out why my code cannot be run
0
Q: TypeError: this is not a function

Prashin JeevaganthI have the following 2 files root/functions/util/constants.js and root/functions/handlers/images.js. The following are their source code images.js const path = require("path"); const os = require("os"); const sharp = require('sharp'); const fs = require('fs-extra'); const { uuid } = require("uu...

 
@PrashinJeevaganth What do you see if you console.log(select_size_from_type) ?
@paul23 I'm definitely voting for soft-light, I think it looks really good
 
@forresthopkinsa I'm getting undefined
 
7:21 PM
That would explain why you can't call it as a function
Now you need to figure out why you can't import it properly
What do you get if you console.log it in constants.js right before exporting it?
 
@forresthopkinsa [Function: select_size_from_type]
 
Are any of your imports from constants.js working
like, what do you see if you log INVALID_TYPE_MESSAGE
 
My other functions are working too, as long as they dont involve that particular function
INVALID_TYPE_MESSAGE prints the correct stored value
 
7:44 PM
Thanks for the advice forresthopkinsa
 
Back with a new and improved profile pic, coincidentally I'm wearing the same shirt
 
8:17 PM
Hey guys how can I select and apply CSS styles to all sets of an element besides the first ones
So say I had many divs across my body that each had 3 of a specific element
 
|| mdn slice
 
or nth child
 
that's javascirpt
 
Hmm I guess that means I will have to use css and js or figure out some backwards nth child by selecting parents of a specific element
 
8:20 PM
!! mdn css pseudoclass
 
plenty of options there for filtering
 
464
A: Select all 'tr' except the first one

MagnarBy adding a class to either the first tr or the subsequent trs. There is no crossbrowser way of selecting the rows you want with CSS alone. However, if you don't care about Internet Explorer 6, 7 or 8: tr:not(:first-child) { color: red; }

 
nevermind
yeah I just saw one like that too
just an n+2 should work
 
i think thats every other
 
8:21 PM
you want every 2, skip first
 
 
div.foobar + div.foobar
 
That one just says n+6 selects all starting from 6
so if I do n+2 that should work fine?
I mean it kinda works how I wanted it to. I just need to NOT use percentage heights as values... codepen.io/SkylerSpark/pen/OJMJrWb
And yes I know theres 2 canvases there, any basic 2D game with background assets and foreground assets sorta requires it
huh I couldve also just done canvas:not(:first-child) too couldnt I?
 
8:55 PM
Anyone else listen to 80s rock radios while coding lol
It makes canvas edge detecting and physics simulation fun
 
00:00 - 21:0021:00 - 00:00

« first day (3518 days earlier)      last day (1413 days later) »