« first day (3020 days earlier)      last day (1928 days later) » 
00:00 - 22:0022:00 - 00:00

12:04 AM
@RTarson here's a starter: jsfiddle.net/0vy4aqf1
you need some smoothing formulae to make that aliasing disappear
there might be another way with global composite operations
and there's definitely another way with keeping the canvas you're currently drawing to in memory, and drawing it all as an image with another global composite operator
 
user1596138
12:40 AM
@paul23 Hey now, I did NOT say trust the client!
 
user1596138
My backend wouldn't be returning individualized errors tho.
 
1:14 AM
@towc cool my dude! I'll have to see if I can clean up
 
1:34 AM
How can I get the value from a dynamic button that has the same id but different values?
it was created dynamically with the table.
 
 
1 hour later…
2:56 AM
I'm very new to javaScript and am trying to learn how to manipulate arrays. I've created this pen, and what I'm trying to do is when a number is selected, it turns blue, and all the others default to red. Any help is appreciated ! codepen.io/isittluk/pen/rPNejN
 
3:39 AM
How to improve Javascript skills? I find it difficult to understand.
 
@zaman 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.
 
anyone here using liximomo sftp extension in vscode?
 
4:26 AM
Anyone know of a framework or Webpack plugin that allows for programmatic modification of a CSS class? I know css-loader can modularize CSS in general, but I'm more so looking for something that'll allow me to import a style from a stylesheet and then modify its properties in JavaScript.
 
 
1 hour later…
6:04 AM
i am using express-session for server side authentication
when user logs in i am storing data in req.session.data and it works
but when user makes new request i am getting undefined in req.session.data
any solution on what to do here ?
 
 
1 hour later…
7:24 AM
hi everyone, I was just wondering if there was a way to essentially declare a start method in node and make sure that it is the first thing that happens, nothing happening on the global block, so that the program's flow is restricted to the start function
mind you, I'm not writing the rest of the script
so basically, I want a way to prepend or append some code that will make the start function be called first
 
o.o
uhm. not sure if I understood you 100%
 
okay so basically, I want to add a precompiler. I want to add a bunch of code a JS file that calls the start method in the script before anything else is done
 
7:41 AM
you can wrap those node scripts in functions/modules and at the first node.js page (that gets called on launch - like index.js) just do yours first initial methods before doing/loading other stuff?
 
yeah that sounds like a good solution
but how's this?
the main function in the script is declared as a function. function start() {...}. I can write a script that detects the main function and places it in a variable: var start = function start(). Notice the use of var instead of let. after the function deceleration, simply place the call to start
actually scratch about half of that, the start function is a self executing
if declared with var it will be the first
actually, @KarelG I misread your solution, this is not actually what I am going for, the aim is to structure the program by setting a distinct flow rather than just starting from the top of the script
 
> just starting from the top of the script
that is how node.js works
 
8:00 AM
This is the behaviour I want to change
 
8:22 AM
you can control the flow via functions/modules
as stated earlier
If you still don't think as an option, you can consider for another server language. There are enough of it in the wild.
 
Hi Guys,
I have this awful question and I cannot get it to work. Anyone willing to help me?
https://stackoverflow.com/questions/54290872/linkedin-popup-on-successful-share
 
@Tygo 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 AM
Hi, what is the right way to resolve the below line.

foo.map(li => {eval(`buy${li} = buyOrdersList.filter(buyOrder=>buyOrder.buy_price==li)` ) })

I'm using eval to dynamically create buy${li} but I want to know better solutions. Please suggest.
 
o.O
 
what the fuck
why
 
what is foo?
the answer might give us a better picture of your goal. I think that you need .reduce or something different
 
why not just use an array?
I don't see why it needs to be in its own var
And if it did, an object would be infinitely better
 
foo could be any array [1000, 100000, 1000000]. I am trying to create dynamic arrays with names like buy1000, buy10000 etc.
 
9:08 AM
Yeah, why?
 
Because the array values are dynamic. New elements could add subtract in future.
 
like?
I have a feeling that you have a design problem because that would lead to a hell of bad code
 
Basically its to segregate buy orders of 1000 USD to array of buy1000 and 10000 USD buy orders to buy10000
 
9:21 AM
why don't you handle it as a functionality instead of using that array?
read in orders, handle it by the purchase amount and ect
 
I need to collect all orders in different buckets according to their prices first and them process all the buckets.
How to name a variable in JS dynamically other than eval.
:45132714 I tried this
foo.map(li => { let buy[li] = buyOrdersList.filter(buyOrder=>buyOrder.buy_price==li) })
But its gave an error
 
you can either use an array of objects or better: a map
treat each K => V pair as your buckets
@AbhishekSinha the error is that you are not returning something
 
Cool. Will try.
@KarelG Yup got it. Thanks everyone.
 
good morning/afternoon/evening
depending on your timezone
I've got a tricky question... tricky in the sense I don't really know how to phrase it into a searchable query ... I need to describe my scenario.
I'm working on a web page. that's meant to be displayed on a large billboard. That being said the page isn't responsive... it should but it's not.
To run the app on my computer, I'm using a vertical screen and making chrome full screen. With the dev-tools I use the device emualtor
the resolution is 2160 x 4096 - which makes things pretty tiny on the screen.
the vertical full screen is the best I can do... atm
but I'm wondering if there isn't a device emulator ... or something ... that let's me view it in it's actual resolution. Obviously my screen couldn't render all of it, but maybe I could scroll through the page and see the details.
If I just let the page render as normal, because the screen is not the size it expects, the css position is all messy.
 
9:45 AM
the resolution is limited to your screen
but you can set the page width and height on x and y pixels
and hope that the content inside that is responsive to scale automatically. So just adjust the <body> and make it big
 
hello! I need to know what to Google. I want to identify data from an automata diagram like this [one](http://1.bp.blogspot.com/-0mpyQDp0qJo/UJovCrG2PfI/AAAAAAAAAA8/fMaJbxL1d4A/s1600/transition+dia.JPG)

What tech/API/tool/library can I use?
 
10:36 AM
@KarelG OMG! yes! that totally works like I wanted!
I'll make a bookmarklet to inject those attributes when I'm testing on the smaller device.
 
1 message moved to Trash can
@SanchezPanza Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@SanchezPanza Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
jfc read what she's telling you
 
I did format it but it still looked the same
Hello guys can you help me with a noob question of figuring out what means what in this for loop -

    for (var i = 1; i <= 10; i++) {
    (function(index) {
    setTimeout(function() { alert(index); }, i*1000);
    })(i);
    }

So what is "index" standing for in this example? And what do brackets after the loop declaration mean? - { "thisbracket>"( function(index... )...}
 
here: let me format it for you, it's so much easier to read code when it's neat
for (var i = 1; i <= 10; i++) {
    (function(index) {
        setTimeout(function() {
            alert(index);
        }, i * 1000);
    })(i);
}
 
That's an IIFE
The brackets after mean it's calling the previously defined function with the i parameter
 
10:49 AM
Ok I got the IIFE - thanks , and "index" just means it gets the previously stated variable "i" value?
 
@SanchezPanza index is the parameter to the function, you immediately invoke it and pass it i
 
I've just typed up a lengthy response but apparently it's too long
in any programming language, anything inside parentheses is evaluated first. In this case there is a function declaration.
A set of parentheses after a function invokes it. so what the code is doing is declaring a function and immediately calling it with the parameter `i`.
The function accepts one parameter, namely `index`.
Technically, the code would run the same if we remove the *closure* structure.
Next there is a timeout or an event that happens in `x` amount of milliseconds.
This is a function. It alerts the index - or `i` - after `i * 1000` ms or `i` seconds.
why is MD not working?
test
oh nvm
 
1 message moved to Trash can
@SanchezPanza Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
ugh sorry again 1 sec
Thanks for your answers
But for example I want a loop to output a 'i' value every second before incrementing it.
I managed to get required effect with following code ,but I feel its the wrong way to do it , and I understand its basics so dont wanna get it wrong right from the start.
let i = 0;

function x() {
    setTimeout(function() {
        console.log(i);
        i++;
        if (i < 10) {
            x();
        }
    }, 1000);
}

x();
I tried making it using IIFE but it just does not work as expected..
for (var i = 0; i < 10; i++) {
    (setTimeout(function() {
        console.log(i);
    }, 1000))
}
 
11:08 AM
1000 * i
 
Because if it's just 1000, all your setTimeouts are going to run at the same time
for (var i = 0; i < 10; i++) {
    (setTimeout(function(index) {
        console.log(index);
    }, 1000 * i, i))
}
 
wat
 
hey guys, using a node HTTP server, how can I view the cookies that the client sends back?
 
11:27 AM
@towc wat
 
hello to all :) anybody using visual studio?
 
@JacobSchneider request.headers.cookie
 
@Ramona I do use it but I'm not at the moment
@BenFortune returns undefined
 
was confused about the UI. It shows rain and snow, but with low distribution over a short period of time
it's sunny af outside right now
 
then your client isn't sending any cookies
 
11:29 AM
@BenFortune but I have one set
 
@Jacob trying to set debugging but have NO CONFIGURATION sign. how to fix it?
 
headers is undefined
 
Then you're inspecting the wrong object
 
@Ramona I have never heard of that, i'm sorry, I can't help you
 
You're not using express are you?
 
11:30 AM
@towc What's that icon in the top left? Oh yeah, a sun. Because it's sunny.
 
@BenFortune no
 
ok no problem.
 
@KendallFrey look at the selected thing below
I thought that was meant to characterize the whole day
 
@JacobSchneider Show me how you're checking it
 
11:32 AM
Hi guys, not sure if this is the right chat but maybe someone can help. I'm practising my skills on building websites and I'm looking to incorporate some interactive features. How would I go about using javascript to change the id of a div?

https://gofyt.ie If you click this link you'll see what I'm going for. The third section of the homepage has a sliding button and when clicked, the 3 cards change. Should I be using javascript for this or something else?
 
@AaronMartin 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.
 
@towc That would be impossible. Weather changes throughout the day.
 
@AaronMartin did you attempt googling exactly that?
 
yes I have been searching around
 
shit oops that's an older test
 
11:33 AM
@KendallFrey well, the "expected average" or something along those lines
@AaronMartin google.co.uk/…
 
MD isnt working
 
I'm not exactly sure if that is what is being done to be honest, I'm just guessing the button is changing the id or style of 2 separate divs
 
@JacobSchneider That's not what I said
req.headers.cookie
 
@AaronMartin well, you asked about changing the id of a div
 
shit oops that's an older test
 
11:35 AM
look at the XY problem
 
what does just req.headers give you
 
@BenFortune Well this is embarrassing, it gives me a url encoded cookie. Sorry for wasting your time
 
Would you mind taking a look at the website I linked? Does it appear to be using this this method of changing the div id?
 
11:36 AM
I think maybe when I click the button, it's swapping out a div for another, setting one for display: none
 
there's a bunch of possible methods
just changing the id doesn't seem like a good idea
you can actually look at the behaviour by inspecting the elements
right click on one of the cards and click "inspect element"
when you click the slider, you'll see what's being changed
 
@BenFortune oooh so basically it does not wait a second until incrementing 'i' but rather just does all 10 loops at once and then outputs values with an interval of a second?
 
@SanchezPanza Pretty much
 
@JacobSchneider Thanks
@BenFortune Thanks
 
12:09 PM
Hey guys. neural networks.
How can I share a reference to one instance of an object between to instances of another object?
scratch that
 
wtf
is that related to NN somehow?
 
@towc it is just 0°C here :P
perfectly on the freezing point
@Neoares do you have a sensor to detect AI related subjects so that you can come up here? :P
 
12:46 PM
hello
 
@AbhishekSharma 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.
 
hi
 
1:07 PM
@KarelG I just looked the chat and it said neural networks G_G
maybe I'm a robot and I have a sensor
 
then NN applies to ya right?
 
1:44 PM
Hello everyone, is there someone who works with WebGL? Have you noticed with some rendering bugs in Firefox 64.0+(only on this version) on mac mini? Actually I get a gray color texture in Firefox but in Chrome/Safari/Edge everything is ok.
 
@adziri 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.
 
 
1 hour later…
2:44 PM
Anyone see a small flash on the moon during the eclipse?
 
Did you?
 
there was an eclipse recently?
 
last night
not sure where it was visible from, probably mainly the western hemisphere
And yeah there was a meteor strike during it
 
Nope. I didnt see anything on my telescope but I saw it on a stream later.
 
damn 😒 it was still total in london
 
oh fuck aliens have cameras
 
is that a joke on his ethnicity?
 
3:12 PM
:meh:
 
3:24 PM
@KendallFrey Noice.
 
 
3 hours later…
user1596138
6:05 PM
That eclipse was nice. I wanted to get my telescope out but the temp before wind at my house was -12. Not only would that not be fun I don't think my cheapo tele would've been happy
 
user1596138
-12F*
 
pfft missing debugging breakpoints in asynchronous code is driving me insane
 
user1596138
Chrome?
 
user1596138
It misses breakpoints in everything lmao
 
Well webstorm kind of requires chrome for it to work. There's no plugin for firefox
 
user1596138
6:16 PM
I constantly have to do a full nuke on Chrome to get breakpoints to catch again.
 
user1596138
Been this way for years unfortunately
 
user1596138
I would still never use FF debugger tho lol
 
Weird that with all these new paradigms and "how to improve code maintenance" the very uttermost basic tool, "manual debugging" is simply broken
And I'm spending days upon days reading fixes that do not work
Nor does there seem to be any indication that it "will be fixed soon" (or even a browser that is especially built for devs.
 
user1596138
Tbf these tools are streets ahead of what you had 8 years ago or something
 
user1596138
Even having async breakpoints at all..
 
user1596138
6:24 PM
As long as devtools are a part of the mainstream browser I wouldn't expect a shift
 
They're miles behind of what I can do while developing in python.
 
user1596138
So go code in Python
 
Or even c#
 
user1596138
Go use C#
 
....
 
user1596138
6:24 PM
Write your own tools. I feel your pain tho honestly man/lady/dog
 
"something is better in another language, you can't argue you must use that other language".
Honestly I do not have the time nor the skillset to create it myself. I would however gladly pay a hundred dollar a month to finally have this working.
 
user1596138
you're the one who started the comparison lol
 
user1596138
How can you compare JS to C# anyway
 
I'm not comparing language, I'm comparing tools. As everyone knows you don't select language based on tools.
 
user1596138
If you are passionate about it there's a job in it. Could always work for Google etc
 
6:26 PM
"nor the skillset"
 
user1596138
You can develop that
 
user1596138
And you said "to create it myself", teams are a wonderful thing
 
I'm just saying, we already spent many hundreds of dollars monthly on PaaS to have easier maintenance. And we don't shun away to use constantly new libraries just to have some minor improvement in readability... So paying a bit extra just to have better debugging we'd gladly do.
 
user1596138
you've identified a market for a premium JS debugging tool
 
Well to be frank: for me it needs to be part of the already existing toolchain; webstorm, browser, postman, postgress, dockers, terminals/bash scripts are already more than enough programs I have to run at once just to develop something.
 
user1596138
6:39 PM
There's a XKCD about this
 
user1596138
 
user1596138
Loosely related lol
 
I'm just wondering that I never hear anyone else about this problem.
 
user1596138
I've heard it tons. I experience it too. I don't know how to fix it tho
 
You'd think that the bright minds of the world would come together then.
 
6:44 PM
Lol
 
user1596138
lol
 
user1596138
Web dev hasn't ground to a halt or anything..
 
Right now I can't even get it to halt on "debugger" statement, normally my last option. I know it hits the code since console.log(gibberish) prints the gibberish. However it doesn't pause. (And I'm wondering why the hell the fetch in that async function never reaches the server).
Yesterday before I stopped for the night it worked, and now that function no longer does :/.
 
user1596138
So restart it. 5s fix
 
7:40 PM
Hmm I have a feeling the missing of breakpoints might have to do with babel actually transpiling away functions. (It typically happens on return foo() type of statements)
 
7:57 PM
@Jhawins configuring eslint comes to mind....
I'm sure there are arguments at this moment about single quotes vs double quotes
 
8:12 PM
mixed! - start a string with a double quote always end it with a single quote!
 
eh, no, heh, single quote vs double quote is not standards related
 
Advantage: then you always know explicit what the start or end of a string is. Similar to how { and } denote start and ends of blocks of code!
 
Just use string literals
 
is there something wrong w/ this syntax?
  change = (e: React.ChangeEvent<HTMLInputElement>, value: string) => {
    this.setState({ value, hideMenu: false });
    debounce(() => this.props.onChange(value), DELAY);
  };

my onChange function isn't firing when I have debounce in place.  when i remove it, it fires.
 
@im1dermike The object you are passing into setState doesn't look right.
 
8:17 PM
that is fine
the problem is with debounce
 
"value" doesn't have a field associated with it.
 
ES6...
 
I don't think you have access to this in debounce. What does your debounce function look like
 
hmm... is it possible to alter the this in that arrow function? i didn't think it was
in which case it should be the same this that setState was called on
 
trying to define my debounced function once in the constructor then calling it (conditionally) in my change...
 
8:24 PM
what does debounce do
i assume it returns a function... in which case you're using it incorrectly
that's how most debounce functions i've seen are implemented
 
@KevinB I intentionally say stuff like that to see who's going to awktually me lol
 
just installed node
whats this pug bullshit? Can't I just write normal html?
 
@paul23 always use template strings imo
@KevinB PHP on windows vs Linux was my first run in with screwed up standards... maybe not the first, but the first I remember
 
Pug is a server side template so you can write JS in the html
 
php is different in linux vs windows?
 
8:30 PM
@Rick so I can't just type normal html
 
@KevinB oh yeah, and it isn't anything you'd notice. It's stupid lexical stuff that makes your program just not work...
 
weird
 
You can but it's going to be more difficult. Pug is like angular but for
html written in the server before being sent to the client
 
only major problem we had in the past was due to case sensitivity
as far as going from windows -> linux
 
it is why I originally switched to linux tbh. If I'm honest with myself it had nothing to do with "muh linux is better" and everything to do with wanting to make my program work without constantly uploading to my server that ran Ubuntu on a slow internet connection and a slow computer.
 
8:34 PM
@Rick they couldn't just make it like php where you inject it. <h1><?="Yoo" ?></h1>
 
@KevinB Don't forget path separators.
 
that hasn't really bit me yet
guessing the languages i'm using are fixing that for me
well, there was that one time that firefox wouldn't serve a particular file due to a slash being backwards :p
none of the other browsers cared
 
@KevinB I think my first issue was to do with heredoc strings. They have difference between windows and linux
 
You can serve html, but your going to need to write the Js in a separate file and send it along with the htm. If you plan on doing anything dynamic. But you can send static html if you want
 
hmm
 
8:37 PM
<h1>#Yoo#</h1>
 
@KevinB how do I do that
 
start by installing coldfusion
 
@KevinB is this a standard? python.org/dev/peps/pep-0008
 
i would instead call it more of a... "manufacturer's recommended usage"
 
@KevinB that's fair...
Same with this: php-fig.org/psr/psr-2 ?
 
8:41 PM
yup
 
"This guide extends and expands on PSR-1, the basic coding standard." lol
 
sounds like it is misnamed
 
I actually agree with you @KevinB
not about it being misnamed, but that they aren't what is meant by standards
 
  res.render('index', { title: 'Express',testing: 'Testing'});
  h1 The Varible is #{testing}
 
8:43 PM
my opinion on the whole... standards vs best practice is in a comment there
 
doesnt work
 
oh, the #foo# thing was coldfusion syntax lol
 
I just think a "standard" can be multiple things but generally inferes a level of technological implementation.
 
not gonna be useful to you in express
 
but I did the express syntax I think
 
8:44 PM
what engine are you using for templating
 
idk
 
@KevinB "religious doctrine"... I liked that, because sometimes that is the hardest place to make progress when trying to solve a problem...
 
hmm
 
People confuse opinion with necessity too often.
 
jbi, are you actually using Pug with express?
like, did you install it and attach it as the renderer?
 
8:48 PM
@KevinB I set it up with PhpStorm (the irony, I know) and used defaults
which was pug
 
Ohhhh pug is just jade
yeah i don't know how all of that works with phpstorm, but your syntax looks fine
Assuming you did #{testing}
 
yes
ohhhhh
I need to restart server
that's annoying
not sure how to change template engine
installing ejs
 
user8729657
9:16 PM
Man school is too difficult.
 
Maybe you should try woman school instead, then.
 
user8729657
!!!!
 
Badum tsss
 
10/10
 
hello to all :) anybody familiar with Visual Studio Code?
 
user8729657
9:21 PM
Yes, a lot of devs use it whats up
 
so, trying to set debugger to see how this sherlock.html code is executed. how to set this debugger properly? imgur.com/a/LxZuxhF
 
@KendallFrey wt actual f lmao, what
 
@DavidKamer Commas are important
 
@KendallFrey I understand you're trying to be clever, but I'm of the opinion that things that are hard to understand don't make the person reading them stupid but the writer/creator bad at writing/creating... so what did I miss? because I assume the comma is a grammatical trick that I didn't catch
 
9:31 PM
how do you quote on here?
 
"man school" => man is used as adjective.
 
ohhh
I must be stupid today lmao
 
not as an exclamation as a subsentence "man! School ...".
 
yeah... totally missed that because the phrase "you should try woman school instead" in response to "school is too difficult" threw me bc I'd never expect Kendall to say that
you got me lol
 
woman school is still a thing? I thought it was a relic of the grandparents' parents' time.
 
9:42 PM
@paul23 mostly Catholic. They have all male and all female schools. It's a thing some people chose because they find it more comfortable.
 
user8729657
Every since you guys taught me about node js and web dev, I've had women come up to me from highschool telling me their proud of me.
 
I personally know a woman who choose a all woman school because she felt it helped her focus on her studies.
 
You're joking right, church isn't that old fashioned nowadays lol
 
I think kindal would melt if he went into a church
 
@paul23 Jewish synagogues (I think orthodox) still separate men and women during their services. I'm not going to talk about Islam because I don't know much about it, but they still have many separations from what I understand, and I think Buddhist traditions still separate monks and nuns but it may be more the Theravada tradition but I don't know.... I better stop communicating this information before the lords of the internet kill me for my crimes lol
 
9:47 PM
Yeah but education? Like are females expected to learn knitting and cooking and males to do actual jobs?
 
@DavidKamer "let's eat, grandma" vs "let's eat grandma"
maybe my favourite example
 
Like physically melt. Because the experience would be too illogical
 
@paul23 oh god no lol. She goes to an all female university to become a doctor
@towc reminds me of the book eats shoots and leaves or whatever it is called
eats, shoots, and leaves
eats shoots and leafs
eats, shoots and leaves
 
@OvieAdese how many?
 
either a normal panda or one who can't pay for dinner
 
9:50 PM
also, why would they be proud of you?
cambridge absolutely still has both all-male and all-female colleges
 
user8729657
2 Girls both named Christina spelled differently, that are friends and are hot. @towc
 
and it's not exactly a religious place
@OvieAdese tweak it down a notch please
how old are you again? You're absolutely free not to answer
 
user8729657
LOL my bad @towc
 
In a large scale system why would you write to a nosql and SQL but only read from SQL and never from the nosqlDB
 
Uh you'd never do that lol.
At least when considering the whole "system" with everything connected to it. (So all tertiary applications & manual access you expect to ever happen).
In a sub system: maybe the nosql is read by another (futuristic) part of the total system?
 
00:00 - 22:0022:00 - 00:00

« first day (3020 days earlier)      last day (1928 days later) »