« first day (1189 days earlier)      last day (3763 days later) » 

6:00 PM
!!afk switching coffee places
 
user1596138
That's a terrible way to look at things. I had a helpful solution for you hahaha.
 
user1596138
There was cleverness to come :P
 
@rodling that is the wrong approach usually with ajax. you WANT to use callbacks and not async a return
can anyone else chime in here?
 
user1596138
@rlemon lol I learned that the hard way.
 
@rlemon solved it with keyup
 
6:01 PM
@RyanKinal I know you have a special place in your heart for this.
 
@Jhawins whats the hard way..?
 
@rodling as a professional suggestion: start to use callbacks.
 
user1596138
Wasted a lot of time because I was being stubborn and wanted to do it MY way, async as a return, which seemed to make more sense at the time.
 
@rodling To have everything lag hard and your website feel like trash
 
user1596138
Just look up AJAX asynchronous vs synchronous
 
6:02 PM
And then to realize that you should have used a callback
 
well async VS sync i know
 
what you have created @rodling is an Anti-Pattern
and should be avoided at all costs unless you have a serious legit reason for it
 
user1596138
I didn't even know what a callback was hahaha. Back in the day. A whole 2 years ago.
 
and in the case here: I can't see it
 
:(
things i get called here
 
6:03 PM
don't be sad. Live and learn. no one is calling you names.
 
i know lol, i am just kidding
 
we're just trying to educate you on the bad practice.
 
Dumb question: where do all the tech managers hang out online? Anyone know of an IRC channel like such?
 
user1596138
You're more than likely just looking at it the wrong way if it doesn't make sense right now.
 
@SomeKittensUx2666 4chan
 
6:04 PM
so my onkey solution is bad practice in this case?
 
@SomeKittensUx2666 tech managers don't associate themselves with us peons . they hang out at the local bar talking about how stupid the devs are for not being able to meet client requests.
@rodling onkeyup is what you should be doing - it is good.
 
user1596138
What does "tech manager" entail?
 
@Jhawins Person who manages technical people, and is also technical themselves.
 
basically onkeydown -> the key stroke isn't ACTUALLY in the input yet - you can cancel it and stuff. onkeyup -> the key stroke is now in the input and you can read it with .val()
@rodling however, we still urge you learn about the powers of callbacks with ajax
 
user1596138
@SomeKittensUx2666 So just, like a supervisor in retail? That guy that doesn't know the job but tells you how to do it?
 
6:06 PM
hey! I was a retail manager
 
i.e. of the three engineers here, I'm the guy in leadership by default (I'm ok with that - it's where I want to go) but I'm inexperienced and want to find the best way to do things.
 
and I knew the job and was a damn good manager!
 
@Jhawins Absolutely not. Technical people managing other technical people.
 
@rlemon oh i am, was just asking about best way to do it and then found solution online
 
user1596138
If you're a tech manager then it's obviously not always the case. I just speculated off the raw description and assumed :P
 
6:07 PM
There's really no other way. Non-technical people really can't manage geeks.
 
user1596138
@rlemon let's start a retail establishment. We can sell horse masks and horse mask related chemicals.
 
user1596138
@SomeKittensUx2666 That's what I thought. Although my boss does...
 
Management is far more than just telling people what they need to do.
 
@Jhawins I actually took a ~5 year break from programming and managed retail stores and did training for sales associates.
I was a General Manager of five stores, then got tired of babysitting teenage girls so moved back into programming
 
user1596138
Better idea: You start a retail store, then hire me as nighttime security and I can go "employee of the month" on the place at night. :)
 
user1596138
6:11 PM
But no really there's so much drama in retail haha. Show up to work and there's 40 different sides of 6 stories everyone wants to tell. Show up to work at the office and people just say hey wassup.
 
I was a "take no shit" manager - but also a very nice manager if you didn't fuck around
I remember my first day in one store (I did a few days in each store then switched, and had managers to work the rest of the time that reported back to me) one of the employees was back talking me telling me "we never had to do that before, we are not going to do it now" (this was for basic cleaning, like dusting the shelves and shit) - so I told her "Nope! you don't have to do it at all! goodbye" and fired her for insubordination
no one else lipped me from that store :P
 
if you leave an if state empty, will the functions still work?
 
user1596138
I ust saw an ad on facebook to "support Justin Beiber" and I thought I'd go ahead and vote for whoever else was in the competition. Then I clicked the link and saw that "JB" has 745 points and the other guy has 5,347. Kind of made my day.
 
user1596138
@Cicada3301 console => try it
 
@Jhawins You're such a rebel
 
user1596138
6:15 PM
Hehe
 
Beiber and Rob Ford should hang out
 
as of... I have an if elseif ... elseif else statement, if something satisfies the drill then do nothing, otherwise do soemthing
 
I like Rob Ford.
 
@SomeKittensUx2666 only because you don't have him as an elected leader
 
user1596138
@Cicada3301 lol no.
 
6:17 PM
I'm sure he is entertaining for the rest of the world.
 
@rlemon Look who we've got in Congress. At least yours is entertaining.
 
user1596138
@Cicada3301 Post the statement please. You can add " ! " to the beginning of the statement to reverse the result more-or-less.
 
our spends our tax money on drugs and alcohol - then goes on public TV talking about the oral sex he has at home
 
user1596138
@rlemon lol you aren't going to default to China and lose your Country :D
 
ohh and while in office he is constantly drunk and smokes "A LOT OF POT"
 
6:18 PM
@Jhawins remember that singular to prular french thing I was saying some hours ago?
 
user1596138
!!afk
 
Ours just fight over which massive corporation gets to screw over the rest of America.
 
function frPluralize(){
    var text=document.getElementById('plural').value;
    text.toLowerCase();
    text.split(' ');
    var j;
    for(i=0,i<text.length,i++){
        j=text[i];
        l=j.length;
        if(j.substring(l-2,l)=='s'){

        }
    }
}
 
user1596138
You're still using tiny variable names and such??
 
text.toLowerCase();
text.split(' ');
this doesn't do what you think it does
it returns the mutated value, it doesn't mutate the value itself.
 
user1596138
6:19 PM
^ Good catch
 
text = text.toLowerCase().split(' ');
 
so text = text.toLowerCase()?
ok...
 
user1596138
Yup
 
for( i = 0; .....
i is now global
DONT DO THAT
same with l
j and text are fine
for( var i = 0;.......
 
var text=document.gelElementById('plural').value.toLowerCase().split(' ').map(...
 
6:21 PM
dont do that ^^
make your code readable
 
user1596138
@Cicada3301 Makes it look more clunky, but it will work.
 
imagine I know where you live... now write code that I will enjoy reading
2
otherwise imagine I own a large knife.
 
@rlemon you're going to sell it to me, right? that's what you were gonna say?
:P
 
Hello
 
anyway... the problem is how I can fix the if statement so that it does nothing in certain cases, but in the else case it does something else
 
6:23 PM
var text = document.getElementById('foo').value;
var words = text.toLowerCase().split(' ');
var j,i,l;
for( i = 0; i < words.length; i++ ) {
    j=text[i];
    l=j.length;
    if(j.substring(l-2,l)!=='s'){
      console.log('here');
    }

}
 
@rlemon I thought of console.logging, but is there a way to avoid that?
 
Why does using Comet does not overload webserver if it is being sending/returning information in a forever loop at any time?
 
@Cicada3301 THAT IS HOW YOU DEBUG!!!!! FFS!!!!
 
user1596138
Shit
 
@rlemon I kind of hate you
 
6:24 PM
@SomeGuy not as much as I hate this guy right now
 
The Happy song is stuck in my head
 
@IvoPereira Generally around 2.4MVz of data.
 
@rlemon that was not the point, It should pass... lemme check
 
@rlemon Hahaha
 
@Cicada3301 stop vamping and go read those resources I linked you on the first day
 
6:25 PM
but it would be harder to the server than AJAX, right @SomeKittens?
 
you are worse than deep now
 
user1596138
@rlemon breakpoints!!
 
@IvoPereira Yes, if you're sending pidgeon packets. If they're piggybacking off of something with more TCP/IP (say, cows), then you'll have a problem.
 
@Jhawins PROFILERS!!!!!
 
@rlemon @Jhawins STEVE
 
6:26 PM
hi everybody
 
user1596138
@SomeKittensUx2666 wait what
 
sorry to break up the party, but I ... have a question on scoping in callback functions
 
@SomeKittensUx2666 WHO IS STEVE?!
 
^^; it's a bit long
 
6:27 PM
@Meredith Go on
 
@SomeGuy thanks
 
user1596138
Yup
 
When secondFn is called through thirdFn, the this.firstFn() call works fine.

When secondFn is called through fourthFn, "this" can't find firstFn.

Why?
 
@Meredith Format your code - hit Ctrl+K before sending and see the faq
 
6:27 PM
 
And... shoot I thought that formatting worked
 
@SomeKittens Can you provide me an example please? For example. Let's imagine I have a match report for a football simulator, simulating the game every 20 minutes of game (=20 secs). Would it be a good approach using it to generate each chunk of 20 secs?
 
@Meredith Have you heard of JSFiddle?
 
@SomeKittensUx2666 taken care of
 
Yeah, better idea
 
6:29 PM
@Meredith not that we don't like code in the chat - larger blocks (even formatted) still look ugly. So general rule of thumb is that if it is over ten lines -> probably use a service like jsfiddle to show it. now carry on :)
 
@IvoPereira Well, with european football, you've got smaller scores and players, so there's less overhead for your cleaning solution. Thus, you can use wireless without needing to buy carbon credits. On the other hand, American football tends to be larger/muddier, so one should invest in an executive street sweeper to keep the rifraff out of your jQuery framework.
 
@rlemon I agree :) I didn't realize it was that large... until I entered it
 
it works
 
@Cicada3301 ...really?
 
@SomeKittensUx2666 it does...
 
6:30 PM
still ugly as hell.
 
@rlemon why?
 
FOUR MESSAGES after @rlemon says 'don\'t paste big code chunks'
 
what I put up?
 
So, concluding you recommend me using Ajax? :P @SomeKittens
 
@SomeKittensUx2666 didn't see that... was coding
lemme jsfiddle that
 
user1596138
6:31 PM
@Cicada3301 You're not even using arguments
 
user1596138
Dammit now I have to dig through network to find your message
 
@Meredith just a tip: anArray.forEach(this.firstFn, this);
 
@IvoPereira Comet vs AJAX?
 
@rlemon is it possible to return data from ajax without call back? Basically I need a result from a function ie: `data = somefunction(input);`
where somefunction is AJAX call to my db
 
save yourself some space
 
6:32 PM
Yeah, that @SomeKittens
 
@rodling you can. but you shouldn't
you almost NEVER need to
 
@rlemon I'm already using the this param of forEach
 
I have never had a case where it was dire
 
I just don't get why the this variable is different when I'm calling it through fourthFn
 
My cube is surrounded by employees and pizza :O
 
6:32 PM
as opposed to thirdFn
 
@Meredith look at what your foreach is doing. I just gave you a hint on how to tidy up that code a bit
 
@RUJordan My desk is surrounded by loneliness and post-its because I'm the only one in.
 
@rlemon why? returning function's value seems veryyyy intuitive, i am python native and that is why I am asking
 
@rodling because that is not how ajax works. it is a bad design pattern and you shouldn't do it?
 
user1596138
6:34 PM
@Cicada3301
 
user1596138
function pluralize(text) {
	var words = text.toLowerCase().split(' ');
	var i,l;
	for( i = 0; i < words.length; i++ ) {
		l=text[i].length;
		if(text[i].substring(l-2,l)!=='s'){
			//I can't see what the point of this even is? See if it ends in s and then what??
		}
	}
}
 
@rlemon good enough
 
I'm not sure what more than "it is a ill advised pattern and you will eventually have more trouble with it than it is worth" you want :P
 
@Jhawins i got it... but just did that to make sure nothing else is intefering badly
 
user1596138
@Cicada3301 No you don't. Pay attention to how that is structured.
 
user1596138
6:35 PM
Notice that I use function arguments. text shouldn't have to come from that element, it should be send in the function call.
 
FRONT END DEVS: WHAT IS WRONG WITH ASYNC = FALSE AJAX???
^ just blurt out your reasons please
 
user1596138
It's dumb
 
@SomeKittensUx2666 LOL
@rlemon it's oxymoronic
 
My desk has ducks on it
 
@Jhawins I understood... and also you declared i and l before
 
6:36 PM
@RUJordan Thanks for laughing at my pain!
@rlemon I WANT DUCKS
 
MY DESK HAS DUCKS TOO!!
 
@rlemon I am having a hard time grasping that, why would I need to do a callback, when i need to return a value. I have event on keyup which requests data with ajax call in separate function... how would I return this value via callback? i am slightly baffled by this structure
 
user1596138
@Cicada3301 If you choose to use these BS functions without arguments . And no, they should be declared when the function is called.
 
I think you've started a duck trend, @Zirak
 
and that thing is becouse in french, words don't change in the plural form with s, x, or z, still need to add a lot more... was just looking at the concept
 
6:37 PM
I MISS MY DUCK
 
user1596138
@Cicada3301 if you insist that you can tell me what I'm doing wrong when I'm fixing your terrible code then I have no desire to read any more of your messages. You're a vampire. Defining them sooner would make them global.
 
My mom had a pet duck when she was my age
I find that awesome
 
@rodling okay well let me give you the thing you'll run into most : you are blocking things while waiting for the server to return to you instead of scheduling the call and letting it update when it returns on its own time.... all the while not locking down everything else while it updates
 
@Jhawins k... I can't really see the difference: the pc will have to hope more through html and js in that way
 
sure you don't notice lag right now... but you are stepping into that realm and slow connections / server lag will cause clients to not like your site
 
6:39 PM
Can anyone interesting to see the problem of this Date question ? = jsfiddle.net/JnfeB
 
you just did that:
var i, l;
 
@rlemon Ah... are you suggesting I use a variable for scoping in secondFn? (jsfiddle.net/Wjafs/2 for reference)
 
Does anybody here mine bitcoins?
 
user1596138
@Cicada3301 your way has to find the element, then get it's value.
 
user1596138
@Cicada3301 You don't know how variables work??? I QUIT!!
 
6:39 PM
@Jhawins which is what I'll do on my website
 
@Meredith no I was just suggesting slightly cleaner code - not sure what your problem is : getting pinged a lot today :P
 
user1596138
@Cicada3301 Which is wrong. It takes more time and resources.
 
@AaditMShah I'm more of a gold miner
 
@rlemon but this is on success, so it returned everything to me
 
@Jhawins simply I can't see the difference between the 2... ok... I'm gonna change that
 
6:40 PM
arr.forEach(function() {
  foo();
});
is the same as running
arr.forEach(foo);
 
I read a really interesting article about the RBI issuing warnings about bitcoins. It might be interesting for the handful of Indians that hang out here: dnaindia.com/money/…
 
@rodling do what you want man. I'm just telling you it is a bad design in principal - you can google for the overwhelming reasons and choose to do whatever you want :P
 
user1596138
Seriously I'm done with this kid what the hell. Deep was better than him. He asked so many questions but at least he didn't fight with you over his petty misconceptions and insist they were right.
 
@rlemon In that case I don't get what would make it cleaner, sorry. Lol in any case I've added that scope... jsfiddle.net/Wjafs/3
 
user1596138
IgnoreList++
 
6:42 PM
@Meredith you don't get how less lines / less code for the same result and same readability is not cleaner?
okay...
 
@rlemon just trying to figure it out.. lol pros and cons, and i also cant for some reason return either way haha :(
'success: function(data){
return data}' was best i came up with and returns nothing :(
 
@rodling again why we use callbacks.
you are not understanding the scope here.
 
Why i 'm getting unexpected years ?
 
@rlemon I'm saying I don't see how what I had could have been condensed more. :/
 
var dueDates = [];
var dDate = '2014-01-01';

dDate = new Date(dDate);

for (var i = 1; i <= 18; i++) {

    dDate.setMonth(i);
    dueDates.push(dDate);

}
console.log(dueDates);
 
user1596138
6:43 PM
@rlemon maybe try a different approach. For some reason I had a lot of trouble understanding this too when I started out.
 
user1596138
@Meredith are you familiar with Chrome's dev tools? Try using the sources tab and setting a breakpoint where you're having an issue. You can see variable scope in the sidebar to the right when stopped at this breakpoint.
 
user1596138
@rodling It returns the "promise of" data. Data doesn't exist yet.
 
6:45 PM
@Jhawins I've done that... that's how I know they're being run with different scopes lol
 
I imagine 'scope' in the log is undefined
 
user1596138
@Meredith So just... Fix the problem because now you can see exactly where it is..?
 
OH. Wow. Just. Facepalm.
 
user1596138
How long have you been a dev? lol debugging should be fairly straight forward for this.
 
@rlemon thanks. My production code isn't that simple, but point heartily taken
 
6:46 PM
just log the shit out of it on each step
 
^^; a year?
 
and if you can use Function.bind use it
iz awsm
 
@rlemon gotcha ya
 
!!tell Meredith mdn Function.prototype.bind
 
user1596138
6:47 PM
@Meredith Eh it's alright.
 
@rlemon thanks
ohoho... I like bind...
 
there is compatibility issues with old IE
check the table on that page before you dump it into your production code base
 
noted
 
but yes, it is wonderful when you can use it
 
bonj all
 
6:52 PM
bonj?
 
ahoy
bonjour
 
como esta ?
 
tak
 
abhishek!
 
@rlemon sorry to make you angry (probably), but I couldn't figure out (even with console.logs) why this isn't working jsfiddle.net/N9Gv3/3
 
6:53 PM
how are you
 
it says my function is not defined...
 
oh Rob
 
@SimonSarris Staring at a broken window
 
@Cicada3301 so define it
 
setting the width of height of a canvas, even to the same number
CLEARS ALL CANVAS STATE
not just the fill style
 
6:53 PM
@RUJordan look at the fiddle... it looks pretty defined to me
 
everrrything
 
the slim sheet of glass was too less to hold the vicious monster inside a man
 
@SimonSarris yea I found that out
Loktar for the save
honestly... I think that is pretty shit if you ask me
was totally unexpected behavior for me
 
It just feels unnatural to need to explicitly pass my scopes around like this though... like I should be able to flatten this structure somehow...
 
6:55 PM
innerXHTML ????
@Meredith probably... but now we are on a XY problem.
 
Because this means in every function I'm calling that secondFn from, I need to declare a var scope, which feels ridiculous
 
@rlemon erm... wow... really?
 
Oh hello Mr. Sarris.
 
told you it would make you angry
 
@Cicada3301 also you are using jsfiddle poorly :P
 
6:56 PM
if you had read the bottom of page 115 of HTML5 UNLEASHED, by Simon Sarris, you might have gleaned that earlier
 
@rlemon as of?
 
ALSO DO NOT USE INLINE EVENTS LIKE WE'VE SAID TEN TIMES NOW
 
(clearly I didn't read the first starred message in this chat)
 
and you wouldn't have this issue
 
@rlemon erm...
@rlemon really?
 
6:57 PM
@SimonSarris I ... ummm.... fuck I'm outed.
 
@Cicada3301 you have to use the no wrap <head> option
 
@Cicada3301 you are scope blocking yourself.
 
user1596138
@rlemon inline event... Script is onLoad lol
 
and is innerXHTML even real?
 
@RUJordan he doesn't have to, if he understood what was going on
 
user1596138
6:57 PM
I just quit caring
 
true dat
but he doesn't understand
 
@SimonSarris I've skimmed most of it, but haven't sat down and cover to cover yet
 
user1596138
He doesn't understand. And I made an insanely good effort for a vamp to try and teach him. But he's too focused on only learning what he absolutely has to.
 
@RUJordan why am I asking? becouse I don't understand... thought it was clear
 
No shit
 
user1596138
6:58 PM
The only reason we can't help him is because he's obsessed with the bare-minimum i.e. lazy.
 
That's why I said you don't understand ;)
 
@rlemon me neither, actually...
 
lol
 
too busy, I never read my own book :(
 
Hahaha
 
6:58 PM
the editor slipped in some racial slurs near the end.
 
lmao
 
no that was actually me
 
@Jhawins look: if you have to study for a math exam about logarithms... you're surely not gonna study licterature for that exam
 
user1596138
@SimonSarris What if they printed the wrong book in it
 
@Jhawins that would explain the good reviews
 
user1596138
6:59 PM
@Cicada3301 This is all JS. Not an irrelevant subject. Therefore that is one of the silliest examples I have ever read.
 
> and if you cannot understand why thisArg is not being passed in this case you must be fucking Dutch.... god I hate the Dutch. P 442
2
 
"The Evolution of Hippis" by Simon Sarris. "To understand the DOM first we need to..."
 
@rlemon TIL about the XY problem. Sorry
 
Wait a sec.. hippos?
 
@Jhawins you're not gonna study trigonometry
 

« first day (1189 days earlier)      last day (3763 days later) »