« first day (1887 days earlier)      last day (3054 days later) » 

12:00 AM
for-loops are a great source of errors.
 
I don't even use for loops anymore
I just copy and paste the same line over and over again
 
:-D
I only use them for code golf. They seem a bit silly in a high-level language, IMO anyway.
 
Yeah if you can use map/reduce/filter you should use those instead
Or at least for of/in
 
Absolutely. Even while is clearer.
 
12:28 AM
wat
 
@user4216713 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don'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 am Jose Ricardo Citerio
from Venezuela
I want advices about handling the video tag on html5
 
I am a Dank Memer
from Mars
I will help you
 
I built a webRTC many-to-many videoconferencing system
 
12:39 AM
Complicated, but continue.
 
It's just a beta version, but it works fine
this is my grade thesis
and I need to edit videos, record videos
 
video tag explodes into webRTC....Boom!
 
I need to share screen too
 
anything else?
 
I have read about sharing screen, and I found that it's neccesary to enable a property on the browser
 
12:43 AM
user is prompted to yes.
 
but the end user needs to enable this property on chrome//flags?
for example
what do you exactly mean by "video tag explodes into webRTC....Boom!"?
 
Ah, yeah, I don't know anything about WebRTC; it has nothing to do with the video tag...
 
it has a lot to do, since webrtc is an api for realtime communications
and you have to handle video/audio streams
 
well yeah, it is the users choice to expose themselves via camera.... if you're looking for an override on that you won't find one.
 
@rism re your profile description
what language/platform do you think would be best for that?
 
12:49 AM
@Firedrake969 Well the first bit is the neurologicals, after that jQuery should be enough.
 
oops, forgot
jquery is great and does all things
 
socket.io is better than jquery
2
sorry
ajax
 
Very different things ;)
 
the comparison is too outrageous not to star
also, websockets and ajax are two very different things as well
 
@user4216713 wat
 
12:52 AM
but seriously until we can reliably read neural codes..... who knows. there's some scary stuff going on in that space tho with opto-genetics.
 
true
@ndugger could you explain websockets to me?
 
not just about reading minds but wiping them too. plus false memories and such.
 
> WebSocket is a protocol providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011, and the WebSocket API in Web IDL is being standardized by the W3C.
 
socket.IO is websockets
 
doesn't really help :P
@user4216713 exactly
 
12:53 AM
it's for real time communications
is there any girl in here?
 
why would that matter?
 
a coder girl always matters
 
If you start getting sexist, I'll kick you from chat; please be courteous
 
i love them
 
12:57 AM
has anyone ever used skype with at least 5 cameras?
I mean, five people videochat
 
Yes
 
Does it take a lot of CPU?
 
fine
 
1:00 AM
No, apparently any toaster will do
 
but I meant CPU usage
 
Instructions unclear; toasted CPU
 
50%, 70%?
 
Depends on your CPU
 
how much?
ok
 
1:02 AM
@ndugger Yeah keep an eye on him
 
Hi meredith?
 
say something sexist, I dare you
 
No.
 
Are you a coder girl?
 
1:03 AM
kicked
 
Lol
 
@ndugger really?
 
yes
 
He just couldn't restrain himself
 
1:04 AM
If there's one thing I don't joke around with, it's sexism. That shit is poison.
 
he shouldn'a ate the trollbait
 
shog pls
 
still haven't quite decided just how much i'm going to eat this xmas.
 
eat the christmas tree
 
all of it
 
1:10 AM
i'm thinking somewhere between rediculous and dead.
 
undead
 
^^ all of it. I like it.
 
Is there a file I can just stick some commands in to be run at start in arch?
 
So I guess no one has an answer to my AngJS question, huh?
 
1:16 AM
@user4216713 Please keep your thoughts about "coder girls" to yourself. Don't be sexist, and you won't be kicked again.
 
ok
I understand
 
:)
 
@DemCodeLines What was the question?
 
In AngJS, is there a way to avoid a page from loading and directly redirecting the user to another page if a certain condition is met?
For example, in my login "state", I have an onEnter function that checks if I am logged in and if so, then calls $state.go('...')
Problem is, I still see the login page for a split second before the app loads the "logged-in" page.
 
ng-cloak might fix that
But that's really a design problem
 
1:22 AM
this is my webrtc/javascript system if anyone wants to try
http://201.209.104.33:8081/webrtcexamples/avq.html
 
looking for feedback on a script I wrote. Basically the concept is to chain events. Check if jquery is loaded, if not load. Then check to see if jqueryui is loaded, if not load and then fire a final event
wondering if there's any way to further streamline this process
 
@Meredith design on my part or on their part?
 
So you're trying to redirect a user if they're logged in, correct?
 
Yes.
 
why not redirect 'back' to login if they're not?
 
1:25 AM
^
 
block the back button
Hi meredith, I am Jose Ricardo
 
@ndugger
 
you know about webrtc?
 
@user4216713 Go take a cold shower
 
this is fun to wathc
watch*
 
1:26 AM
typical MVC pattern is to 401 them with a redirect to login. only just learning Angular.
 
@Firedrake969 Indeed indeed
 
@pootis popcorn?
 
pringles would be better
 
Nah, ramen
 
1:27 AM
You shouldn't have any problem with a logged in user seeing a login screen
 
I also lift
 
But you might have a problem with a guest seeing a page that requires login
 
wat about you?, wat do you do besides coding?
 
(but you shouldn't send over anything sensitive to a guest)
 
kicked
 
1:29 AM
Thanks
 
I know a Mod might not see him as being sexist, but trust me, he's trying to go down a road that will make other users uncomfortable
 
@Meredith or in the template showing the content, a conditional can prevent content from being shown if criteria isnt met
 
he's a bit of a weirdo that one and not in an original way.
 
@Hybridwebdev That's a similar problem that he's running into I think
 
@ndugger agreed
 
1:30 AM
The client doesn't know that the user is logged in, so the wrong content is flashed
 
@Meredith I'd have to point out that, if something that trivial is an issue, that the code structure should be re-thought
 
@ndugger He is definitely being sexist
Exactly what I'm saying
 
He doesn't learn..
 
@rism Someone can manually go to /login
 
He needs to take a cold shower
 
1:31 AM
cold showers are no fun :(
 
could someone be awesome and give feedback on that :)
 
seems like requirejs
have no experience with it tho so...
 
Are you trying to make a module loader?
Except for external scripts I guess
 
@user4216713 responding to the flag raised for three kicks: please avoid chat for the next three days, and pay attention to the tone of the rooms you enter when you return. Also, please read: stackoverflow.com/help/be-nice
 
@DemCodeLines Manually yes but then you can make another redirect somewhere else. In that case ng-cloak is the non-flashing remedy as i understand from my very limited intro so far. But as part of an app design the login link would be swapped out for a logout, so it's definitely edge case.
 
1:35 AM
@Shog9 Not really knowing any better, would you agree that he was being sexist?
 
@Meredith yeah. Basically we give users a small bit of code to embed. An empty and a small bit of JS that loads the script. THe script then does checks, and then loads 1 final script
 
Ok
So you should expose something like $ = require('jquery');
And then search for jquery on some server
 
@ndugger I don't know what his intention was, nor do I think it's particularly constructive to discuss it when he's not around to enlighten us. But it was obvious he was making folks here uncomfortable, and should've paid more attention to the warnings.
 
@Meredith however the final script relies on jquery and jquery-ui. But of course we dont want to just load them willy nilly incase said site already has loaded the libraries
 
Or have the user pass in a url for the library
 
1:36 AM
@Shog9 Fair enough, thanks
 
@Meredith could you elaborate?
 
loadJqueryUI is an antipattern
It should be load('jquery-ui') or load('https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js')
 
its just a function name :P
 
Then you can curry that to make a loadJqueryUI
No the difference is how extensible it is
What if you wanted to make loadBootstrap?
 
extensibility isnt a goal. Its just a simple payload module really
it's basically a 1 and done kinda thing
 
1:38 AM
It never is
 
I wasn't even aware load('https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js') was valid.
 
Why wouldn't it be valid?
 
well, how do you bind to the onload event
it needs to chain events. First check for and conditionally load jquery. Once scripts loaded and ready, check for and conditionally load jquery-ui. Once loaded and ready, load the external script
 
That's what I mean
 
In this code the callback changeColor does not get invoked on click event.
 
1:49 AM
body.lastElementChild doesn't exist when the handler is applied.
 
doesn't exist? I did not get you
 
The script is executed before the dom is finished loading
 
ok
If I place script after DOM is loaded then lastElementChild is script but not button
Can I use name attribute of button to register callback?
 
Then use a different selector
You can use whatever you want
 
so use querySelector('button');
 
1:53 AM
document.LikeUnlike.onclick = changeColor;
 
document.querySelector('[name=LikeUnlike]') I believe
 
I learnt that named elements(button) add a property in document object. Is that correct?
I mean document.LikeUnlike stackoverflow.com/a/3434388/3317808
 
Maybe, but I haven't heard about that
Should be easy enough for you to check
> This is a really bad idea, as it allows element names to clash with real properties of document.
That's all you need to know
 
yes that's true, above SO answer says the same
 
Just use querySelector
It's more expressive anyway
 
1:58 AM
ok
i think that is attribute selector approach
 
2:08 AM
it is working now.
I have one more question.
document.body.lastElementChild.style["background-color"] syntax is accepted despite, document.body.lastElementChild gives CSSStyleDeclaration instance that has property name backgroundColor. How do I understand this?
 
It's just an alias I think
Most people just use backgroundColor I think
 
I learnt somewhere that subscript notation can be used when property names have hyphen
 
I've never seen ['background-color']
 
That means it support both syntax. CSSStyleDeclaration is not a JS object; it is a native object available in JS.
I personally never seen ['background-color'] either.
You can implement attribute alias using ES6 proxy, and native objects have been doing it since DOM0.
 
not a JS object, you mean, not a language object? you mean object provided by the browser?
 
2:14 AM
Yes
 
ES6 proxy, you mean, style["background-color"] will be internally converted to "style.backgroundColor"
 
No. It can be the other way round. Or that they are both converted to something else inaccessible.
 
coding style review codereview.stackexchange.com/questions/114060/… I see lot of nested if in my code, can this be more elegant avoiding nested if
 
2:19 AM
Firefox 43 is out! 64 bit win binary! server side logging! css animation timeline!
@overexchange Simplify the logic. Use a loop.
 
@Sheepy yet still no plans to stop deprecating XUL/XPCOM ;(
 
How do I make webpack load stage 0 for babel
 
@Doorknob冰 It is planned. Removing heavy theme and adding a proper extension API is the first step.
But such a dramatic change will take time.
 
2:34 AM
little easier on the eyes methinks
 
@Hybridwebdev Nice! :D
 
@Meredith heh, thanks. Still feel like there's room for improvement tho
 
@overexchange I like to flip the ifs; example:

if (results.length < 0) return 'no';

results.sort(...);
return "[ " + results[0].toString() + " ]";

// You see, this way you eliminate the need for the flip side of the if to be nested
fuck my edits
 
@Hybridwebdev You could single space it :p
 
@ndugger I always follow the method that you should try and trap errors or undesireable conditions as early as possible
@Meredith well yeah, once we go into production the script will be minimized/obfuscated
 
2:41 AM
Yeah, fail as early as possible
Plus you avoid that nasty if(){if(){if(){}}} pattern
 
I hate it when Sublime plugins suggest 2 space indentation.
 
2 space indentation? My poor OCD :S
 
I used to hate it too but then I accepted it and I'm never looking back
 
thankfully aptana auto-format saves me from myself :S
 
I like 4. It doesnt cost as long as you are minifying it later.
 
2:42 AM
It really doesn't matter
 
4 space indentation is more readable to me.
 
lol
 
this is the level of OCD I have when it comes to indentation :P pastebin.com/4DMfuuyJ
 
The only advantage to 4 space indents is that it makes it a lot harder to write code that is like 5 indent levels deep
Which is usually a bad idea
Tbh I've been considering using php in some side projects
 
2:44 AM
because of how it processes indentation, I will never learn PY. Drives me nuts :S
 
To 'make up' for the shitty php I wrote when I was learning web development
 
@Hybridwebdev You are killing it. Except its not so consistent in function build_form()
Also, whats PY?
 
python i think
 
yeah
python
 
If you know javascript, you probably know python
 
2:48 AM
and yeah, I may be killing it, but that's just my ocd. I can't help it lol
 
Like I can guarantee that you could write a working python program right now
 
yeah, shouldnt be that hard
 
do hats disappear after winter?
 
I will use loops when I write production code. My intention was to play around with recursion
 
Yes.
It did disappear last time.
 
2:50 AM
do they stay for next year?
 
no, they retire to hatland
 
You get new ones next year.
 
I had crab claws last year and I don't have them this year
 
D:
then what's the point...
 
or perhaps they migrate to ManHATtan
 
2:51 AM
They get recycled.
 
I miss my crab clam
 
maybe they go to the same place socks that go into the washer dissapear to
 
BTW, dont we needs hats in summer rather than winter? Just saying.
 
Donald Trump for Queen of England 2016
 
at the risk of sounding unpopular, I dont think Trumps wrong
 
2:53 AM
He is very wrong
 
Yeah he hates everyone who isn't a straight white male
 
Im in Canada and I fucking hate the idea we're spending a bunch of resources on something thats none of our business
 
That isn't ok
 
@Hybridwebdev Like what? Terrorism? Terrorism is everyone's business
 
in fact, 2 of the people that just came from Syria are already in jail in alberta for crimes committed
 
2:54 AM
I would let him run for President of Antartica.
 
I hope he splits the republican vote
 
@Hybridwebdev It's not like any group is 100% perfect.
 
@Firedrake969 but sincerely, ask yourself this. Would you personally invite any old stranger into your home with little to no knowledge of their past?
 
@Hybridwebdev 2 out of how many? How many Canadians are in jail?
 
We're talking about Trump? What a coincidence, I was just watching youtube.com/watch?v=TCDsf8l6xOk
 
2:55 AM
My roommate was from Syria. Poor guy used to hear gun shots while speaking to his family on phone.
 
There's a reason why there is a government.
And a police system.
 
would anyone here do that for that matter? Expose your family to someone you know nothing about?
let them sleep down the hall from where you, and your children sleep?
 
Having to fend for myself, without outside help, is essentially anarchy
If there was an armed guard outside my bedroom door, sure.
 
@KendallFrey Ok trump loves french fries, now we have something in common
 
@Firedrake969 exactly. You wouldn't. It's the same damn concept bringing them into the country
 
2:56 AM
but not syrian fries
 
may be selfish, but Syria isn't our problem
 
@Hybridwebdev Nope. There's a police system.
heh
 
I fucking love french fries
 
@Hybridwebdev Yes it is
 
I went to mcdonalds with some friends on saturday and got a large fries
 
2:58 AM
@Firedrake969 okay. But if you DID bring them in, and while you slept they raped or murdered you/your family. What will the police do? Arrest them? Sweet, but you're still dead
 
made my day
 
ISIS and terrorism and humanitarian needs are everyone's problem
 
and I bought a bag of frozen fries when i went grocery shopping today
 
@ndugger explain how
 
@Hybridwebdev I'm already living around a bunch of people I don't know. A few more won't hurt.
 
2:58 AM
@ndugger because its the humanitarian thing to do?
 
How do you expect to ever get space ships unless we work together!?
Because we need to work together and build space ships
geez
haven't you ever seen star trek?
 
And build dyson spheres
 
Oh shit we're having a serious discussion and im talking about french fries sorry
 
and rule the world
 
I like Five Guys' fries better.
 
2:59 AM
Meh, McDonald's fries ftw
They're basically salt
 
five guys has some pretty mediocre fries
mcdonalds is the best
 
never had 5 guys
had 2 chicks tho
 
who hasnt had 2 chicks?
 
def liked their "fries"
 
@Meredith +1
 
3:00 AM
I love 5 guys, but I'm avoiding fast food like it's a disease. Losing weight slowly, and I don;t want to mess it up
 
I like it when they make it spicy. #stereotype lol
 
fair enough
 
im tryna gain like 5 pounds
its so hard
 
@RahulDesai hate spicy food
 
i cant eat that much
 
3:00 AM
stereotype breaker
 
i love spicy food
 
@Meredith I don't eat much, my issue has been lack of activity, well, that and massive amounts of sugar in the form of sodas/energy drinks
 
gunna code, l8r
 
which I also cut out
 
@Meredith thanks for the input
 
3:01 AM
:D
@ndugger Start running
 
McDonald's is so good
but so bad
 
No, my PT has me doing weight training
 
you can't gain weight if you run 40 miles a week :(
 
I havent had soda in weeks.
 
Weight training to boost the metabolism
 
3:01 AM
I don't like soda
 
im drinking some diet giner ale right now
 
or anything carbonated
 
with vodka and lime juice
 
Oh, I love ginger ale.
 
diet ginger ale sounds like a worse version of dog piss
 
3:03 AM
i cant taste a difference between diet and not diet
i realize that i gotta consume more calories
but id rather just drink diet
 
I doubt if these are for men: thinkgeek.com/product/19e6
 
I don't want diabetes
 
!!youtube diabeetus
 
The beetus
So for dinner this week
I made a pasta dish
2 boxes of bowtie pasta, 1 container of tortellini, 2 jars of alfredo sauce, 2 lbs of chicken
Oh and a bag of frozen peas
So uhh anyone got any plans this weekend
 
3:16 AM
Well, I have a bottle of wine, and a personal project... so no
 
Cool background music.
 
@ndugger me_irl
i have a bottle of vodka to finish and my SO doesnt want to touch it
So i know what i have to do
 
Meh vodka. I really only like vodka with orange juice or lemonade
 
Try vodka + ginger ale + lime juice
It's called a moscow mule when you have vodka, ginger beer, and lime juice in a copper mug, but this is close enough
 
Oh yeah, I love moscow mule; the ginger beer makes it amazing
 
3:21 AM
Also as a polak my blood is 50% vodka as it is
 
lol
As someone with Irish and Norwegian blood, My blood is 50% guinness and 50% mead
 
Idk what the difference between ginger ale and ginger beer is
Because im too cheap to pay $4 more for ginger beer
 
I've never had a ginger ale that actually tasted like ginger...
 
i have some generic publix diet ginger ale
it's pretty good
 
3:46 AM
Any good graph drawing APIs anyone wants to recommend? Nothing too complex, just simple line plot, bar plots and pie charts.
 
@DemCodeLines chartjs.org
 
4:04 AM
Highcharts API - its not open source though
 

« first day (1887 days earlier)      last day (3054 days later) »