« first day (3016 days earlier)      last day (1918 days later) » 

12:14 AM
i have this html: <div class="countDiv">0</div> and i want to increment the 0 with jquery, why it's not working?
var countDiv = $(".countDiv");
var countDivVal = $(countDiv).val();
$(countDiv).html(countDivVal+1);
 
try countDiv.val(countDivVal+1)
 
I don't think .val() will grab the text content of a div element
so I'd go with
var countDivVal = +countDiv.text();
 
@jAndy it kinda worked, i start with 0 and when i click on the div, it go to 1, but the second time i click on the div i got 11111112 instead of 2 and thethird time i click i got 1.1111112111111122e+63, kinda weird i also tried parseInt($('.countDiv').text());
but i got the same result
 
12:30 AM
I think you overlooked the + sign
you need to convert the text content into an integer in order to make this work
 
@jAndy i saw there that it's working. But not on my code, it's inside a ajax call that is inside another ajax call, would that interfere?
and the <div> is loaded with ajax on the first Ajax call
 
well, hard to tell, maybe something screws up the show there. However, once the DOM is rendered, it shouldn't make any difference.
 
12:47 AM
why so jQuery?
 
@Neoares what you mean?
 
I mean that I wouldn't use jQuery for that
 
anyways, i did not solve it, so will not use the increment anymore, i will do it another way
 
1:01 AM
@Natalie what do you get when you console.log(countDivVal)?
probably needs Number(countDivVal)
or parseInt
 
morn
 
 
2 hours later…
3:18 AM
@DavidKamer When you were talking about making websites on Wordpress did you mean drag and drop + custom css or custom code + implementing Wordpress editable stuff
 
@JBis yeah. I've never really used word press... I don't see the purpose most of the time given something like react-bootstrap. It's mostly for people who can't code, but knowing how it works means you can build custom plugins for people.
 
3:36 AM
@DavidKamer Must be mistaken thought you had said you used Wordpress
 
no I said it's probably worth learning. but then again everyone knows wordpress after 15 minutes of effort...
 
Oh...
 
yeah it's basically wix. The hard part, I assume, is just making a plugin. That I don't know because I never could get past the fact that it is just wix.
 
Kills my security side every time I see wp on non HTTPS sites.
 
any website - https = bad
well unless it doesn't take any information
but still should have https. it's free so really no excuses at this point.
 
3:41 AM
I tired to explain that to someone today
their response "well I don't think anyone is going to try to get my password"
 
it's really mostly about your local network
 
as he logs in on an unsecured WiFi network
 
i mean it's more than that, but that's the main concern
the loss of net neutrality made it practically 100% necessary
 
its was 100% necessary, now it more like 110% necessary
 
my main concern is the government spying tbh... they're just people so who knows what a person would want to do with my data...
 
3:45 AM
Also, note to Wix, WP, Weebly, "developers" stop saying you know how to build websites/code, you don't, you know how drag and drop and change a couple premade css statements
 
...
they could know how to code and just do that anyway lol
 
@DavidKamer tbh I'm more concerned about private companies or government having it and then fucking up security so someone steals it
 
@JBis I mean any person that has access to it is a security flaw
 
then again if your dumb enough to not encrypt with https then its your own fault
 
and the government is heavily politicized so I worry about that...
 
3:48 AM
trump takes picture with user data in the background and posts on twitter "Down here protecting the US with the NSA"
 
yeah, hopefully we don't pull an Australia and make it illegal to make our applications safe and secure...
@JBis did that actually happen lol?
 
@DavidKamer Funny you should ask....No but close to it. He exposed location and faces of confidential military personnel putting them in danger
U.S. Navy SEALs
 
Who took the picture?
Generally that isn't something the President is responsible for... Somebody who's been working there for awhile had to screw up for that to happen...
 
no, they already said the whitehouse and even republican congress has access to post on it
I doubt he posts his own videos lol.
 
3:53 AM
he def does.
 
I think it was intentional... they're probably getting flown somewhere else and they intentionally used it to make it look like they were there.
 
His staff try to stop him.
 
he posts tweets, but I'll give you 100 dollins if you can find a picture of him taking a selfie or video and not handing the phone off to someone else
the Secret Service has to inspect every thing he sends out I think
 
@DavidKamer just because he doesnt take it doesnt mean he doesnt post it
> Trump reportedly won't let White House staff members check the "Twitter phone" to make sure it hasn't been hacked.
> But just because Trump has a phone dedicated to tweeting doesn't mean he's the one typing all of his tweets. Staffers write tweet suggestions, sometimes with grammar errors and misspellings included on purpose, The Boston Globe reported on Tuesday.
 
yeah that photo was obviously taken by someone else lol... And like I said there are no facts known except he was there at that time... If anything the OFFICER taking the photo should have known that. The president isn't supposed to have to think of all of that stuff
I mean he was posing in the photo, he should have thought about that a second lmao
 
4:01 AM
I still blame trump for stuff he posts on twitter. Unless their is a severe error like hacking or someone in his staff posted something without his instruction I blame him
@DavidKamer taking photos and posting are different
even top secret missions are recorded
but I get what your saying
PS if you want a laugh:
5 hours ago, by JBis
Just found the issue I have been trying to solve for months:
5 hours ago, by JBis
Put a class name in a style attribute: style="info-cont"
maybe I should try wp lol
 
@JBis lol, that's the kind of stuff that makes my life hell... slowly through the process of hating my life I've gotten much better at paying attention to detail
 
@DavidKamer You use react native at all?
 
4:18 AM
@JBis enough to get myself in trouble with this: github.com/UniWrighte/android-react-installer
 
nice
install scripts are fun
bash syntax sucks though
 
@JBis meh, it isn't that bad. very minimalist
 
its very particular about spaces
buts its good for quick scripts
 
I mean the alternative in most situations is a python script which is.... guess what... really particular about spaces
lol, but it's different and easier I admit
 
really been wanting to get around to learning python
 
4:26 AM
It is really easy but things get weird with it really quickly
 
P.S.
Anyone know what exactly an "application security engineer" does/what skills are needed? Is a programming background required, suggested?
 
@JBis that's a job title I currently hold with a company (more or less lol) generally you need to be a senior engineer that understands the technology really well and security practices
 
"senior engineer"?
May I ask what you would suggest taking in under and grad school?
Based on the very broad descriptions it seems like the career path I would probably like to head towards
Also how in depth do you need to know programming? Like just a decent understanding of concepts and security practices but not necessarily how to write the program?
 
@JBis you'll want to probably do computer science of course and you'll want to minor in information security if possible.
@JBis you need to be able to tell what everything is doing
 
would you consider it a "difficult job"? (Like are you working long hours very tired and exhausting)
@DavidKamer Not major in infosec?
 
4:40 AM
@JBis not if you are messing with code imo
 
hmm. And what about graduate programs? Still com sci based?
Also thanks for this! Great to speak to someone in the actual job.
 
I'd say that education doesn't matter nearly as much as experience and a portfolio for a job like that
but if you're getting hired by HR rather than tech then whatever little brownie points you can put on your resume mean a lot more lol
 
lol
how to get experience without experience is the difficult part I guess
 
@JBis just build things and explore on your own.
you should work on making applications and try to break into them
 
they don't care about non - official stuff?
@DavidKamer difficult to break into already established stuff. However everything that I have made so far I have used best security practices (as far as I know) Prepared statements, CSRF protection, XSS protecting, https (cookies included), login tokens etc. I just feel like thats simple stuff that basic devs know. I also spent a year or so learning network security which I think also helps in understand how and what web applications can technically access.
I have found vulnerabilities in multiple apps made by others. But all simple solutions for big problems. Nothing crazy. Idk.
ight I gtg but thanks for your help and suggestions @DavidKamer
 
5:01 AM
 
@JBis learn a lot about authentication and authorization and recognize the two as entirely separate and you'll be ahead of 99% of junior devs.
 
 
2 hours later…
6:43 AM
kind of a straightforward difference if you understand the two
like the difference between a casket and a coffin
 
any one worked in logger using winston and morgan in nodejs
 
to someone who doesn't know, they're pretty much the same, but once you know, it bothers you whenever someone uses the wrong term
 
any one worked in logger using winston and morgan in nodejs
 
@DILEEPTHOMAS nope, sorry
 
@Neil unit testing any idea ?
 
6:48 AM
@DILEEPTHOMAS mochajs.org
 
using jest
??
@Neil no using jest
 
nope, I'm using mochajs
I'm sure there are a thousand more for that matter
 
okay
@Neil thank you
 
7:22 AM
😟 got surprised with rain last night and saw an iced car this morning. That has been a while that I had to scratch it from those windshields.
35 minute work 😢
and a mad neighbor
😀
 
ice on the windshield is the worst
especially when you don't expect it
makes you late for work and your hands become two blocks of ice themselves
I keep a pair of gloves in the glove compartment for just such an occasion
go figure that I should actually use the glove compartment for its intended purpose
 
thing it, it was hard to scratch it of.
such problem existed for 20+years and nobody has found a nice solution besides "park it below a roof" for that?
 
they make insulating windshield covers that you can put on your car
While I don't think that would eliminate the problem entirely, it would probably only leave a very small film of ice if that
it's made primarily for snow (since you could just remove the cover) but it works also for ice
 
7:37 AM
I have that, but as said, got surprised by rain.
 
well if you didn't add the cover, you were asking for a problem of this nature :P
Murphy's Law and all
 
 
2 hours later…
9:37 AM
0
Q: logger implementation using winston , morgan and winston-daily-rotate-file

DILEEP THOMASI am trying to implement a logger in node js which will create a new log file every day on a custom format for logs for this i have used three packages winston morgan winston-daily-rotate-file so the final output should every day a new log file should create in logs folder and it shou...

 
 
2 hours later…
11:25 AM
Holla guys. I'm asking there but do you know if there is a way of doing string concatenation with variable in sass ?
I tried '/mypath/#{var}/rest/of/mypath' but it did not worked and I ended up with
/mypaht/var/rest/of/mypath
Ho I think I just missed the $ leading to #{$var}
 
12:01 PM
@DavidKamer I can read more about it but from what I know. Authentication is ensuring you are who you say are, while authorization is making sure you (even after authenticated) has permsion to do something.
 
@Baldráni seems a google-able question
> The + operation can be used to concatenate strings:
 
 
2 hours later…
1:52 PM
posted on January 18, 2019 by Ruben Bridgewater

Notable Changes compression / zlib: Added brotli support (Anna Henningsen and Zach Vacura) #24938 console: Added inspectOptions option (Ruben Bridgewater) #24978 crypto: Always accept private keys as public keys (Tobias Nießen) #25217 deps: Upgrade npm to v6.5.0 (Jordan Harband) #25234 fs: Use internalBinding('fs') internally instead of process.binding('fs') (Masashi Hi

 
2:05 PM
Anyone working with ASP.NET Core and Angular, please check this post and try to suggest - stackoverflow.com/questions/54203308/…
 
 
2 hours later…
3:44 PM
posted on January 18, 2019 by CommitStrip

 
user1596138
4:00 PM
When u dreamt of SO chat the night before
 
user1596138
I even argue in my sleep
 
4:27 PM
o/
 
@Feeds I never really noticed, that character has a really weird nose
 
@JBis yep, but learning how to apply that in your code is another thing
 
5:00 PM
@DavidKamer true. Currently practicing with admin only pages.
Also only being able to access your profile and no one else's (for some reason people I have worked with have had issues with this)
 
 
3 hours later…
7:39 PM
🚽
 
8:16 PM
i created a chat system with Ajax/Jquery/PHP, when the user click on "send" i append the mensage with Jquery (i could call this a "preview") but for the users that will receive the mensage it will be loaded from a php file on Ajax call. To print out data from database i escape the data with htmlentities but on this "preview" i just get the data from the input var msgPC = $('#textAreaPC').val(); and print out on the screen using .append
Should i escape this "preview"? or it's safe?
 
eh, it's safe-ish
the user very well could inject garbage into it, but it will do no more harm than someone who knows how to use the dev tools
the only downside to displaying the preview immediately is you may end up with two users seeing the posts in a different order
assuming you aren't doing something to "fix" that after the fact
 
@KevinB i'm more worrying about the security of my server/database. I mean, i'm just using .append to display the message, could someone put a malicious link and execute some kind of malicious code? That would damage my server/database
 
sure, they can, but they can also just open up the dev tools and do the same
so that's not a real threat caused by the preview feature, it's just a threat that was always there and always will be.
 
was always there and always will be. There's no way to minimize the "damage" that someone could do on dev tools?
 
Yes, but it's all server-side
there's very little you can do in the client to protect the user from altering the client, and in the end the user could always bypass the client and talk to the server directly.
 
8:32 PM
There is a specific key-word to i search about it?
 
authentication i guess?
your api endpoints should only be able to do things that you would want your users to be able to do. hiding it behind an if statement on the client won't protect it
 
what is the baddest thing (against the server) that someone could do on dev tool?
 
sql injection, uploading malicious code,
sql injection is probably one of the most dangerous, but also one of the easier ones to solve.
 
oh i did know that it could be possible on the dev tools... I understand how to prevent this in php, i use prepared statements, but to prevent this on dev tools is the same as php?
 
you can't prevent it on the dev tools
but preventing it on php will prevent them from affecting more than their own browser
they can do whatever they want with their own browser
 
8:42 PM
@mindset wdym preview?
@mindset Imo Everything should "work" if they are using your interface. So there should be no injection with your input box, however as @KevinB explained. If the user opens the dev tools all bets are off. No need to protect client side for that.
 
@KevinB i meant, i use prepared statements to prevent sql injection, and it works in all server-side codes, like input fildes, urls... but to prevent sql injection on the dev tool, i need to do someone else?
 
the sql isn't ran on the client
 
@JBis it's just a simple chat, because i cannot use websocket on it
 
so there's no sql injection there
 
@mindset No. If you use good security (prepared statements) and sanitize and validate your input you will be good.
@KevinB this
 
8:46 PM
ok thanks
 
the sql injection occurs when the client sends a request to the server using values that attempt to cause a sql injection on the server. Preventing it on the server is good enough
 
@mindset But make sure if I type <p style="font-size: 100px">BIG TEXT</p> in the chat. It doest increase text size.
Also you probably want to only allow certain ASCII characters to prevent fake font changes like this:
𝕋𝕖𝖘𝚃
 
@JBis why should i worry about it? <p style="font-size: 100px">BIG TEXT</p> i think you meant on the loaded chat from the database, right? If so, i'm good because it won't work inside htmlentites
And what is the problem with ` fake font`?
 
@mindset No problem. Just you might want to prevent it for consistency.
@mindset htmlentites only works for the users who receive it via Ajax. If the client who submitted just adds it the chat directly than it could be an isseu
 
how
 
8:53 PM
why would be this a issue?
 
one sec...
 
i mean, i can right click this chat and make everything bold, doesn't hurt you in any way
 
Enter <p style="font-size: 20px">Test</p> in box
If you directly append it without doing anything it will just come up with the styling.
while that wouldn't show on other clients it might show on the client who send it
 
@JBis you're right, but why would o care about it? it can also be done on dev tools
 
@mindset Your application should work, if the user chooses to break it using dev tools then thats fine. But your application should work. If I want to send code over chat then I should be able to.
Not as much a security concern but still a concern
 
9:06 PM
@JBis anyways, there's a equivalent function to htmlentites in jquery/java?
 
if you insert the text using .text(), it will be plain text
regardless of whether or not it contained html
 
I'm not saying its not simple to fix but it should be fixed
 
easiest fix would be to simply not have a preview
post the message, and allow the normal process of displaying new messages do its job
 
10:01 PM
@KevinB you give of the feeling of speed that way
 
true
What i'd do is kinda like what SO and Discord does, present the preview as a different color, then once it's received from the server replace it with what the server sent.
thus removing any timeline/parsing discrepancies
 
11:02 PM
Hello all. Trying to setup a JS multidimensional associative array, ex:

my_array[0][0]['thing'] = 'first group, first thing'
my_array[0][1]['thing'] = 'first group, second thing'
my_array[0][2]['thing'] = 'first group, third thing'
my_array[1][0]['thing'] = 'second group, first thing'
my_array[1][1]['thing'] = 'second group, second thing'
my_array[1][2]['thing'] = 'second group, third thing'

However I'm wondering why I need to initalize each time for both the first group and the second group, ex:
not sure why I'm stuck on this lol, sorry for the intrusion
If I don't initialize every time, ex: all_messages[0][1] = {}; --- then I get a "cannot set property of undefined" error
 
what is the input type (if any) called, where you can type and get suggestions, and select multiple tags?
 
autosuggest?
autosuggest via jQuery UI?
 
almost like this: jqueryui.com/autocomplete But its not possible to add multiple tags
found it here: selectize.github.io/selectize.js (scroll down to "max items")
 
hmm, not quite sure what you mean by multiple tags. do you mean the ability for the user to select multiple suggestions?
ah okay, well there ya go!
 
11:17 PM
@KevinB +1
 
discord fails at that sometimes tho
at least on mobile
 
11:54 PM
hello
 
@Sabrina 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.
 
why it's not working? jsfiddle.net/reuc8ny6
why the jquery is not working
i want the scroll to be at the bottom when windows.load
 

« first day (3016 days earlier)      last day (1918 days later) »