« first day (456 days earlier)      last day (3332 days later) » 

6:02 PM
@rlemon if you are sure that your target audience won't need to scroll*
at least until position: sticky gets support
 
well it is for a sticky header bar
desktop / laptop only page
 
should be fine, but why not absolute?
 
because then I have to adjust it on scroll
jsbin.com/goxib/1/edit i'm talking like this
 
ah
yeah if you don't need mobile then go for it
You can also do width: 100%; instead of left: 0; right: 0; btw
save a few characters
well, assuming you do margin: 0 for html,body or * earlier on
 
there
that is what i'm making
 
6:11 PM
arghhhh, rep cap preventing me to cross 60k, wtf
@ObiWanWesabi ahahaha right :punch:
 
@ZachSaucier How long did it take your application to be accepted?
 
pft, who needs jQuery
I just kicked that sticky headers ass
now to implement scrollSpy
aaand doesn't work in FF
:/
 
6:29 PM
> pft, who needs jQuery [...] aaand doesn't work in FF
Looks like you do *
 
because document.body.scrollTop is 0 in FF?
wtf?
@TylerH not my fault FF is sub-par
 
drinkin' that haterade
 
goes well with your tears
 
only crocodile tears
 
nyt ~
@rlemon bg is too heavy
 
user652649
6:35 PM
@Mr.Alien ask your q!
 
ugh
FF doesn't implement the event the same as Chrome
stupid browsers. get your shit together!
 
when wes sees that haa, alien is going, now lets ask :p he can't ask for more ...
@ObiWanWesabi so the question was, say am having public vars inside a class i.e properties
so I can alter them after instantiating them
 
@SomeGuy less than a day
 
user652649
there are no properties in php @Mr.Alien just fields
 
user652649
so they should be private
 
6:37 PM
but what if I want to instantiate but in such a way that they cannot be modified?
 
@rlemon add a transition plz. And I hate scrolling on it xD
 
no, if I make them private, I cannot use them like $blow->blah
it will throw an error
 
user652649
private $test;
function setTest(ArrayObject $array){ $this->test = $array; }
function getTest(){ return $this->test; }
 
tough shit I'm controlling teh damn mouse!
:P
 
yea so I need to use a getter right?
 
user652649
6:38 PM
yes
 
user652649
that's the "good way"
 
hmmm
 
user652649
to isolate data instead
 
user652649
private $test;
function setTest(ArrayObject $array){ $this->test = clone $array; }
function getTest(){ return clone $this->test; }
 
I thought there would be some better way, cuz the very first class I'll create is of config
so instead of using constants this time, I'll create a class
 
user652649
6:40 PM
there is a different way but it is very hacky
 
user652649
and not suggested at your current stage :P
 
Is this how to create an array of numbers 1 thru 1000?

var myArray = new Array (1000);
var i;
for (i = 1; i < 1001; i++)
{
myArray[i] = i;
}
 
nah, I thought using something like say static will make the data unchangeable but haven't reached there yet, I did till private and public, method instantiating, magic methods like construct and destruct which are invoked on class instance etc etc :D
 
I can't seem to find how to do it without also posting some value
 
@TylerH maybe possible with map?
 
6:42 PM
@TylerH why new Array (1000)
 
user652649
!!>Object.keys(new Array(1000));
 
@ObiWanWesabi "undefined"
@ObiWanWesabi []
 
user652649
.... right. sorry. xD
 
user652649
@rlemon ^
 
!!>Object.keys(new Array());
 
6:43 PM
@Mr.Alien []
 
@Mr.Alien Not sure what you're asking. I need to create an array of 1000 numbers, from one to one thousand
 
@TylerH he is asking why new Array(1000).
 
@TylerH and am not sure why you are using 1000
 
I'm asking because, remember, I don't know JavaScript and am trying to learn
 
6:44 PM
ok ok makes sense :)
 
ahh, that will just give you an array with 1000 in it?
 
you don't have to do that though.. so asked
 
@Mr.Alien well, I could use 100 or 10,000 I suppose
the point is I need a lot of numbers sequentially
 
so I can do a binary search
 
6:45 PM
@ObiWanWesabi more questions when I learn further, so far, its going good, lets see whats next ;) nyt and thanks
 
!!> [].map.call(new Uint16Array(10),function(e,i) { return i; });
 
nyt guys ~
 
@rlemon [0,1,2,3,4,5,6,7,8,9]
 
if we want to get clever
 
nice
 
user652649
6:45 PM
lol
 
so many functions in js I've never heard of - or properties
 
user652649
never heard of Uint16Array too
 
Uint16Array seeds the array with 0's vs undefined
Array(1000) just sets the .length to 1000 iirc
 
yes it does
 
6:46 PM
which is a problem because I don't want 1000 empty values :-P
 
Array.apply(null, Array(n))
is also a clever approach
I'm surprised mike came up with it ;)
 
I didn't. I stole it from that blog post above.
 
ahah
well i didn't see that
you could have claimed it your own
 
I could indeed, but then I am setting myself up for a fall later :D
 
@mikedidthis falling is fine as long as you remember to position a feather bed underneath you first :-P
 
6:48 PM
@TylerH life advice
 
@rlemon I really am surprised by how little you read xD
 
!!> Array(10).join(',').split(',').map(function(e,i) { return i });
 
@rlemon [0,1,2,3,4,5,6,7,8,9]
 
user652649
@Mr.Alien let me review your classes when you finish them, ok? :P
 
@ZachSaucier I read books and articles on space
 
6:49 PM
 
not many programming blogs unless they are about something I need to know at that moment in time
 
Hard to read when you are in so many rooms :D
 
also, yea i'm in like 10 rooms
 
I suppose so
 
bounce around a lot
 
6:49 PM
whore
3
 
arr = (0 for [1..100])
I miss coffeescript sometimes.
 
user652649
like one fills an array that way every day xD
 
err day
 
!!> var i; for( i = []; i.length < 10; ) i.push(i.length); i;
 
6:53 PM
@rlemon [0,1,2,3,4,5,6,7,8,9]
 
there are so many ways to seed an array
 
I think that is how he was doing it in the first place.
 
A minor alteration to start it at 1: jsbin.com/hahiyewu/1/edit based on the code mike grabbed
 
yea but my code is more clever
 
^ as expected
 
user652649
6:54 PM
!!> var i = []; while(i.length <= 100) i.push(i.length); i;
 
@ObiWanWesabi [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,2‌​9,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,5‌​6,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,8‌​3,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100]
 
clever isn't always good ;)
 
I hope I don't outclever you with my second JS snippet ever
 
the for loop would be the quickest?
 
This is why I don't like most tutorials out there; they teach you how to use stuff the most common way it's used, rather than the fundamentals of creating something and then applying it
 
I read that as seedy arrays.
 
.map is killer slow
 
Early starts are catching up on me.
 
my loops are slower because I check the .length property in the loop
same with wes's
 
6:58 PM
@ObiWanWesabi Why would you want to fill an array with the same value over and over
 
@TylerH for matrix's
 
I haven't used matrices since algebra :-/
 
don't get into webgl or canvas animations
:P
 
or CSS
 
6:59 PM
@rlemon holy batman, I didn't expect .map to be that slow.
 

« first day (456 days earlier)      last day (3332 days later) »