« first day (446 days earlier)      last day (3342 days later) » 

9:00 PM
@mikedidthis Have you looked at OOCSS?
 
user652649
 
user652649
now do that your way @SomeGuy i wonder how bad it will look :D
 
why not write case if you have so many ifs
 
@Mr.Alien it can have more than 1 error
 
user652649
^
 
9:05 PM
ok, I missed out that only ifs are there and no elseifs..
 
user652649
all that just passing an int, instead of an array, which is heavier, it's hard to traverse each time with indexOf and etc
 
Fair enough
I don't believe that the code would look bad
Yours might be shorter and more symmetrical
But the alternative code would show the purpose more clearly
Of course, that assumes that most people don't in fact know how to use bitwise operators
 
user652649
i think you are just making bigger than it actually is, bitwise operators are easy man :|
 
user652649
but let's move on... (patsy asked :D)
 
Haha yeah, maybe I am
 
user652649
9:10 PM
:D you will change your mind eventually
 
I doubt it
I see your point
But it doesn't convince me to switch over
 
user652649
:D haha ok ok
 
nyt peeps
 
Night!
 
user652649
gn
 
9:15 PM
function repeat(operation, num) {
    if (num <= 0) return
    operation()
    return repeat(operation, --num)
}

module.exports = repeat
^ Can someone explain this node to me? I understand what it does by I don't understand the syntax.
Specifically the two returns
 
Okay
 
operation is a function and num is the number of times to call the function
 
Let's go over it step by step
repeat(someFunc, 2);
Step through the code
 
user652649
repeats an arbitary operation num times
 
Is num <= 0?
If not, continue
Then call the someFunc() function
Then call repeat again, with num being one less
So it calls someFunc() again, with num being 1
 
user652649
9:18 PM
num is a counter, which is decreased at each loop (--num)
 
Then num is 0
And it just returns
So you call the function 2 times (the original num)
 
user652649
so repeat(operation, 10) calls repeat(operation, 9) and so on
 
user652649
until if (num <= 0) return; is reached, which ends the loop
 
That all make sense, is it written in normal javascript or is it missing some brackets?
 
It's normal JS
 
user652649
9:19 PM
function repeat(operation, num) {
if (num <= 0) return;
operation();
return repeat(operation, --num);
}
 
user652649
; are missing
 
It is missing some brackets to be called good code (subjective)
And of course, the semi-colons
function repeat(operation, num) {
  if (num <= 0) {
     return false;
  }
  operation();
  return repeat(operation, --num);
}
Probably how I'd write it
 
^ that makes it make sense to me
 
Hahaha
 
I thought both returns where inside of the if and was wondering how that was working.... lol
 
9:22 PM
x.fn = function fn(){

}

vs

x.fn = function(){

}
which is better and why ?
 
user652649
function repeat(operation, num){
return num <= 0 ? null : operation() && repeat(operation, --num);
}
 
user652649
just to annoy @SomeGuy
 
user652649
ahahah
 
hahahahha
ternary ftw
 
I use the ternary operator sometimes
@AbhishekHingnikar Better for what?
 
9:23 PM
I use it excessively
 
@SomeGuy anything.
is there any difference what so ever ?
 
Well, I prefer the latter
Yeah, named functions show up in profiling tools
Unnamed ones just show up as "anonymous function"
 
i remember florian telling me they are micro "faster"
 
Thanks for your help @SomeGuy & @ObiWanWesabi, appreciate it.
 
I don't know about that
 
9:24 PM
but he was talking about named functions in general
 
I use the latter to prevent littering the scope
 
Since with the former you'll have fn and x.fn be the same
So use named functions when profiling
Use the other otherwise
 
that is some twisted shit
 
Read the "legal background and theory" part too
 
good night ^^
 
good night!
 
@SomeGuy Thanks, now I'm never going on a boat ever again
 
sup
 
11:07 PM
Anyone have any idea here stackoverflow.com/a/24855435/3739658
1 little bug left, If the left column has elements that are shorter than their matching elements in the right column, it creates row breaks
 
hah im on my tv!!
 
haha, awesome
how does the formatting look?
lot's of white space?
take a screen shot :D
 
bougha googletv box
typing is a bitch
 
haha, ya
using a remote? why not hook up a keyboard?
 
google the asus box v2
look at the remote . it isnt bad, but it isnt good
 
11:16 PM
reminds me of the remote that are in some airplanes for the TV thing
 
it is nice for netflix, i dont think id browse the web from it
this is painfull
 
that is not the dimensions I was expecting
looks like a tablet turned sideways
 
low res, 40" tv
i mean the web browser is low res
tv is only a couple years old
 

« first day (446 days earlier)      last day (3342 days later) »