« first day (1991 days earlier)      last day (2950 days later) » 

12:06 AM
@SterlingArcher ohh god. I love the back up and not let go i.imgur.com/DgrzA8G.gif
 
12:54 AM
lol
Season 6 of archer comes out on netflix tomorrrowwwwww
 
Hey all, quick question, is it possible to clear a specific line from my canvas without having to redraw everything ?
 
Mornin all
@AndréSilva You might want to check stackoverflow.com/questions/24140805/…
 
I was reading that, I'm going to try to open his/her jsfiddle demos in my phone. Proxy blocked
 
@AndréSilva in short: no
 
Quick one, I am passing an integer value through url parameter which indicates total hours from when the data created_at should be retrieved are after (today_date - total hours). The problem lies in the variable name of that parameter. Anyone can suggest any good name?
 
12:59 AM
you could draw over it with white
 
Yeah, I was reading about canvas not remembering where things were drawn
 
I prefer using an animation loop though
then I store the state myself, clear and redraw every frame
another way might be manipulating an svg
 
I'm going to do something similar, or maybe the same thing, according to mozilla, but since this doesn't need animation, is just a line that will have to be drawn from a mousedown and mousemove
Thanks btw :)
 
good name please.. im still stuck btw
 
You need help naming a variable?
 
1:05 AM
Yes and i am still stuck
 
How you you get stuck naming a variable? Just name it something and move on...
 
I rly need to sleep
But I can't sleep without good variable
 
May you have a successful career, choz
 
name the variable choz
problem solved
 
No
:(
 
1:07 AM
name it TODO
 
that's so misleading
or not
 
const VariableWhichIndicatesWhenTheDataCreated_AtShouldBeRetrieved = ...
 
I wish I can vote up on that
 
lol
 
Go sleep
 
1:10 AM
 
I'd go with 'todo' i guess
OK THEN
GOOD NIGHT GUYSSS THX FOR YOUR HELP
 
What a strange question
 
@choz expire
 
that's mean
 
lol
 
1:24 AM
o/
 
lost?
 
it's a joke
this isn't the android room
 
Yeah yeah, I got it.
 
what's up
 
1:25 AM
I'd come back with a comeback but my head hurts.
Laying down working on school stuff haha, you?
 
because you spent too much time in the android room
 
drinking a beer
 
watching numberphile
 
I love Numberphile.
 
1:26 AM
makes for an exciting evening
I should get motivated to clean my turtle tank. maybe tomorrow
 
nice
you should totally post the code here for a code review
we'll be kind
;)
 
oooh, a giphy command
want
 
Yep, it's hella fun
The only good command for now haha, the /collapse and /uncollapse are for cranky people who don't like gifs.
 
1:28 AM
/giphy excited
I did that wrong...
 
You have to reload SO Chat
 
There you go
 
YES
I am very pleased with this
You have made my life better
 
Haha, feel free to star the message above lol
Glad to help
 
1:29 AM
Did one better, and pinned it
 
Aww thanks <3
That's better
 
    if (key === 13) { // 13 is enter
instead of doing a giant if (true) { ... }
do a if( false ) return;
less messy indentation
 
Wait what?
 
Aye, I learned early on from these guys to fail early to avoid unesessary indentation
 
^
 
1:33 AM
if (key !== 13) return
 
Ah okay
 
then the rest of your code doesn't have to be indented
 
Ah I understand
 
return early
always (mostly) a good thing
 
It's probably the thing I've learned in here that has impacted my code the most
 
1:34 AM
I kinda crashed skiing yesterday, I thought I had a minor concussion, my head still hurts. Sorry haha, can't think straight.
 
also, you call e.stopPropagation() on all cases
so now on the early return you can call it once regardless
 
hey, everybody
 
Sweet
 
y'all don't mind if I bring someone I'm helping with event listeners in here, right?
 
also you're working on a chrome extension... so you can use the cutting edge shit
you don't need jQuery
 
1:36 AM
Grumble?
 
also, you don't need if else clauses; you can just get away with ifs
if (condition) {
    ...
}
if (anotherCondition) {
    ...
}
 
if ($(elem).hasClass("onebox")) {
elem.classList.contains
 
Gotcha
 
since your code doesn't need an ending else
 
What about for
$('.content').each(function(i, obj) {
 
1:37 AM
I can fork and PR if you'd like
 
That'd be lovely haha
Thanks so much
 
[...document.querySelectorAll('.content')].forEach(...)
 
I wasn't kidding about crashing skiing, hopefully I feel better after I sleep lol
 
but if you make a small utility function for qs[a] that is much shorter
 
hey, @Matthew
do you have it working now?
 
1:41 AM
Ah here we go
 
@Matthew Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
I had to reload the page, it was telling me I need over 20 points, which I definitely have. Any way one second, I'm about to load the new script.
It works perfectly!
 
@TristanWiley almost done... here's one of the edits, similar to what @rlemon was describing
function collapseAll() {
    Array.from(document.querySelectorAll('.content')).forEach(obj => {
        const elem = obj.firstElementChild
        if (elem.classList.contains('onebox')) {
            elem.style.display = 'none';
        }
    });
}
 
Ah sweet, that looks perfect. Thank you so much.
 
@ndugger elm.hidden = true;
fuck yea
 
1:45 AM
I'll do that
 
Shit I don't know where the Ibuprofen is.
I need a massage
That donkey is fricking adorable
 
@TristanWiley theoretically the code is a 1:1 conversion, but you'll have to test it github.com/TristanWiley/So-Chat-Commander/pull/1
 
Gotcha
No longer requires jQuery? Should remove the thirdParty folder and stuff
 
I'm confused, though, where is input defined?
 
input is a global defined by the browser
 
1:56 AM
oh
 
<textarea id="input"
 
aaaaaand, that's why we don't use that "feature"... lol
 
I use it in demos
but that is about it
 
hm
Hmm, giphy still works but collapse doesn't anymore
Also now I can never send any message haha
 
Uhhhhhhhh, let me look over the code quick
 
1:58 AM
I can try too, although I'm going to keep working on my homework
 
Ah... I see...
 
I'm pretty sure e.stopPropagation(); is messing something up
 
yeah
 
I think I tried moving it outside once and it messed up so I just decided to leave it.
 
Gimme a sec... we'll have to put that back in the ifs
 
1:59 AM
Gotcha
 
@TristanWiley alright, made some more fixes github.com/TristanWiley/So-Chat-Commander/pull/1 -- if it doesn't work still, I have one more try up my sleeve to fix it
 
Gotcha
It works!
 
Merged :)
So in theory I can remove the Jquery stuff now?
 
1 message moved to Orphan GIFs
 
2:08 AM
Ah lol
 
Theoretically
 
Sweet yep :)
 
Hey guys, I'm trying to set up an event listener for on 'input', script works fine if I set the event listener to 'click' and set the 'id' to a button, any one want to give it a go?
 
depends
give us the code
formatted, in a fiddle *
 
Make a gist
 
2:10 AM
Sorry! One second.
 
Or a fiddle
 
1 message moved to JS trash
 
2fast4me
I love that I now have giphy in so chat
 
Honestly same lol
 
I use it all the time in slack
 
2:13 AM
Same here :)
 
Here we go! Formatted as best as I can on the fly: jsfiddle.net/mh5bah3c - the script I'm trying to get working is the one in the JS section
This is a working example: jsfiddle.net/e38bt761 - when you fill one input in but not he one beside it, then press continue, it changes that input to required forcing you to enter data in before submitting, if you remove the data from both inputs they will appear to be required but when you press continue (submit) it works because it changes the required to false... I just want to change the addeventlistener to 'input' so that it changes more fluently instead of having to press submit
so, like in the first one... except my attempt isn't working
 
2:42 AM
ahh, we need to have a "someone is in the process of answering this question" on the answer page
 
@GregBorbonus so everyone stops writing their answer as soon as someone else starts?
 
addEventListener('keyup');
@KendallFrey Absolutely
I just saw a question answered 3 times, all with the same answer.
 
if anything, that would make FGITW worse
 
FGITW?
 
it already shows new answers as you write, right?
if people don't read those, there's not much you can expect
 
2:47 AM
Well, the 'input' event listener should work, it's the way I'm going about it I think... document.querySelectorAll('input[id^="custom-"]').addEventListener('input', function() { vs document.getElementById('form-button-submit').addEventListener('click', function() {
 
ahh, I see what that means
and no
 
Maybe the querySelectorAll doesn't work and the event listener?
 
one sec
 
69
Q: What is FGITW and SCITE?

Alex AngasI only read Meta every so often but I've seen lots of talk about SCITE and FGITW. I have no idea what these are! Can someone please define and explain these abbreviations?

 
@Matthew you need to loop through them
so do addevli=document.querySelectorAll('input[id^="custom-"]');
then do a for loop
4
Q: javascript adding click event listener to class

user1246950I have a listview for delete id. I'd like to add a listener to all elements with a particular class and do a confirm alert. My problem is that this seem to only add the listener to the first class it finds. I tried to use querySelectorAll but it didn't work <script> var deleteLink = ...

@KendallFrey yeah, google is easy to use, so found it quickly.
 
2:50 AM
jsfiddle.net/mh5bah3c/1 I think I've done what you're describing though?
 
I think I'm a fan of HyunA and I don't know what to think
 
addEventListener input?
I didn't know that event existed
I'm not joking, if it does, great, I learned something new, if not then that's your issue
ohh, and no
that's not what you're doing.
 
jsfiddle.net/girlie_mac/5Assc - here's a test to show the input event listener
 
oninput is the saviour of our time
 
2:58 AM
@ndugger no, that would be rebecca
 
Now, you'll need to rerun that, or add the event listener separately, when you add a new group of fields
You don't get Rep from chats, right?
 
@littlepootis downvoted @GregBorbonus. Final rep: 431
 
Hey, anyone here really familiar with react.js? I ask because I was thinking about getting my hands into it, but so far I'm only seeing good optimized techniques that could be accomplished with either standard code, or using jquery with good techniques
HEY
 
Thanks for the help either way!
 
hehe, ok, Rep not messed with
 
3:03 AM
I see what you meant now
 
@Matthew did you see my link?
OHH, OK
Good, sorry caps
 
All good!
 
Getting performance anywhere near React with jQuery would be impossible, since they do very different things
 
@SterlingArcher you like metal, right? youtube.com/watch?v=0GErGfHjHQ0 your feelings about to flip their shit
 
3:31 AM
yo browskies, i got an issue wtih a delete request on a hapijs server. Using isomorphic-fetch to issue the request in the reactjs client.
Fetch API cannot load http://localhost:3001/lob/delete/222a09b0. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 404. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
undefined:1 Uncaught (in promise) TypeError: Failed to fetch(…)
 
Oh classic
Use a proxy server or beg them to enable cors
 
@GregBorbonus Convenience and performance are two extremes, both in real world and in programming. Only you can decide which is the right balance for you. I'd encourage you to dip into it, make sense of how it works, and come up with your own conclusion.
But I won't worry about performance prematurely. Sure, facebook have had some headache with PHP's performance. But that's the exception.
 
Wasn't there a story about how Twitter started with rails because it allowed them to get a good product up more quickly
But the performance was awful
 
Almost every successful sites went through that barrier. Even google had to develope their own clould eco.
 
Yeah so just worry about getting a product out there for now
Spend the money to improve performance when you can
 
3:56 AM
No begging necessary cuz I control it. But I fixed it. It was a malforming of the header
 
thanks guys, my personal thoughts on the matter are that if I get a performance boost from react, over jQuery, then then it may become necessary to use it, but at the same time, if I'm not doing performance heavy operations, then no need for it.
I looked at some of reacts doc's and while it seems cleanly built, jquery is far easier to work with, so unless I see a reason to increase performance, which would require the view to be more JS heavy than I even like to make it, then I'll probably switch over
I'm still a firm believer in, if you can do it without JS, then that's the best way, unless it's flash
Though, if WebGL doesn't make their shit more robust, Flash will make a come back
 
WebGL isn't robust?
 
Flash is not coming back.
 
Why would flash ever come back now?
I remember doing AS3 back in the day. I put together some pretty mean Flash sites.
 
4:14 AM
@GregBorbonus thanks for that, I needed to laugh today.
 
I remember doing Macromedia Flash back in the day. The first version, which had no version. It was ground breaking, to say the least.
 
Flash was fun to make
but webGL is really robust as hell, I was kidding
 
It's basically OpenGL ES 2.0
 
I think they are still fun. And you can export them as HTML5 now. The fun part, at least.
Oh. An amendment. Wikipedia says there was a version - it was Flash 1.0.
 
4:33 AM
how can I improve this tweet: Nice, my talk on "$.Ajax Driven Architecture" about the powerful feature of #jquery was accepted at #tccc20
5
 
@GregBorbonus jquery is easier to just throw stuff on the page I suppose
 
user2620028
@loktar to someone who is used to both i would almost disagree with that, just depends heavily on how you are using it :/
 
@Loktar what do you mean?
 
@HatterisMad well with React there is the added build step
 
is that tweet good enough?
 
user2620028
4:36 AM
i suppose i don't understand what you mean
 
using webpack or something else to transform JSX if you're using it
 
i want to tweet it out, since i was accepted
 
or babel for the es6 stuff you may be using
@acoder wtf dude?
it's a god danged tweet
no one cares
 
k
i have never written a tweet
 
user2620028
me either man but i think what you have is fine, you are just trying to convey a bit of information
 
4:37 AM
k
 
@HatterisMad are you using JSX?
 
user2620028
yes
 
do you use webpack do bundle your react apps?
that's the main step I mean, vs JQ
JQ you just throw it on the page and start spitting out whatever
 
user2620028
im not using node
 
user2620028
i just threw react on the page and im spitting out whatever lol
 
4:39 AM
how is your JSX transformed?
 
babelify
 
user2620028
thought babel handled that
 
user2620028
i believe the only thing i did for the jsx to work was set my script type to text/babel
 
yeah, but how are you running it through babel?
 
user2620028
:/
 
user2620028
4:40 AM
i included babel, included react, set script type. thats it
 
yeah but you shouldn't use that on production :p
that was my point
well that wasn't my point, but is now lol
I assumed you were running it through webpack or browserify or something to create your bundles
 
user2620028
i dont have a production site yet haha
 
user2620028
but i see what you are saying
 
lol yeah looking over what I said, it looks almost combative
was honestly curious
so hope it wasn't taken that way lol
 
user2620028
4:43 AM
lol no i was just confused
 
user2620028
how long does your project at work take to compile the react frontend?
 
first time like 10 seconds
after that like 100ms
 
user2620028
lmfao
 
that's the dev build
prod build takes a good minute or so
 
user2620028
and you say that makes it harder than jquery?
 
4:44 AM
maybe a bit longer
 
user2620028
the place i just started, i have been working on a flash frontend from 2004
 
well webpack has a higher learning curve than <script src="jquery"></script> :P
ouch
 
user2620028
and every time i make a change i have to save, restart the computer, start up my vm, ant build and deploy to vm, test
 
is it flashMX2004 at least?!
haha
 
user2620028
takes about ~30 minutes
 
user2620028
4:46 AM
uhhh macromedia mx 2004 :D
 
honestly I don't understand the hate for flash now
 
user2620028
oh hot damn it was branded as macromedia flash mx 2004
 
user2620028
i kinda understand it after working on this :/
 
because there is Unity, and a few other plugins that people are fine using
 
user2620028
yeah tons of stuff using actionscript
 
4:47 AM
Flash is still great for creating animations in. I mean the tool itself is still pretty damn easy to work with from just an animation perspective
but man I hated doing any dev in it
for the last few years when I worked with Flash I always used FlashDevelop
made it much easier to work in
I think all the technologies are there and already beating Flash, just no killer tool yet to do what Flash CC does
I remember like 4 years ago people saying JS wasn't viable for creating games in
 
user2620028
the ironic thing is that i dont believe they do any animations in this frontend
 
user2620028
they use flash in place of javascript
 
hah
yeah that's what really gave Flash a bad name, people just used it for freaking everything
 
user2620028
and then at a lot of points just use flash to send commands to javascript
 
well and all the security issues :p
 
user2620028
4:51 AM
honestly the only thing i really despise it for right now is that it takes all 16gb of the ram on my work comp to compile the flash frontend
 
user2620028
and it takes like 15 minutes to just compile the flash
 
LOL yeah that is nuts man
 
user2620028
basically you have to restart the computer to free up the ram otherwise the flash compile fails
 
are you using AS3?
 
user2620028
2
 
4:51 AM
ah, haha so like Basic almost
lol tbh I liked working in AS2, it was dead simple
but I never did anything crazy complex in it
I can't imagine writing a huge app with it, that would suck
 
user2620028
the software i am working on was created i believe before best coding practices came into play haha
 
idk if there even were any with AS2 lol
 
user2620028
well im talking about the java part of it mainly
 
just throw some code in a keyframe! lol
ooh ok
 
user2620028
every single method is its own class essentially
 
user2620028
4:53 AM
and the file structure is magic
 
user2620028
and things are constantly renamed when making references, so you have to dig like 10 files deep to figure out what the hell you are even dealing with
 
user2620028
i had to make a (method) so a whole new class today for the java program and following the naming structure of that folder every single file was like a 20 word long file name
 
@Loktar Flash is a plugin, which make things complicated. It hurts security. It hurts battery. It hurts portability. You normally need admin right to install it. It confuse the user when their browser is up to date but Flash isn't or vice versa. This is why Chrome and Edge has it built in, as part of the browser; problem solved.
 
@Sheepy yeah all those arguments are also apply to things like Unity, at least google took steps to stop it from working though
 
user2620028
lol yeah i was a little sad when they did that cause i was working on a unity game at the time and had to figure out how to re enable it in the browser
 
user2620028
4:56 AM
and i believe runescape doesnt work in chrome anymore either o.O
 
@Sheepy also I am well aware of all of that ;)
 
Ah. Sorry. I was busy fixing servers and was hurry when I try to catch up.
 
My point is there are plenty of other things like that which people never threw a real fit over. It was interesting the hate Flash received.
I mean heck Java was probably worse or pretty damn close on the side of security concerns
 
Well, IE have it worse.
And then we also have w3school.
 
lol
@HatterisMad did unity ever release the webgl version?
That was their plan to replace the plugin, but I never saw anything about them finishing it
 

« first day (1991 days earlier)      last day (2950 days later) »