« first day (1013 days earlier)      last day (3935 days later) » 

7:00 PM
@Neal Well said
 
@Zirak I thought so.
 
m59
@Neal
var Animal = (function(){
    var Animal = function (name) {
        this.name = name;
        animal.somethingElse();
    }
    animal.somethingElse = function() {
      //see why this is a better syntax??
    }
    return Animal;
})();
 
I see no one took my factory approach seriously
 
var Animal = (function(){
    var Animal = function (name) {
        this.name = name;
    }
    Animal.prototype.somethingElse = function() {
      //see why this is a better syntax??
    }
    return Animal;
})();
@m59 ^
 
m59
?
why?
 
7:01 PM
@m59 That won't work at all. many many errors
 
function Animal(name){
  this.name = name;
}
 
animal === undefined
 
@Neal Simpler?
 
m59
Since I write all of my code that way... I can assure you my way works.
 
@Michael lol but you have no private fns
 
7:02 PM
var Animal = function (name) {
    return {
        name : name,
        somethigElse : function () { console.log('lulz'); }
    };
};
 
@Neal agreed. Are we seriously arguing about basic javascript closures in here?
 
@Neal oooo
 
after I write up an article on the point planets I think Ill do one on different methods to generate terrain
 
@rlemon so by rendering you mean createImageData, the for loops, and putImageData
 
@m59 Where do you have animal defined?
 
7:02 PM
@Loktar hrm, i'll check that out. thanks.
 
user1596138
@m59 Animal is lower-case at the beginning of the second function.
 
@SimonSarris yes
 
user1596138
@Neal ^^
 
m59
LOL, well, I was following his odd naming convention and messed up.
 
@SimonSarris I can't imagine the loops are the issue. the create/set are
 
7:03 PM
@Jhawinsss also he does animal.somthingElse() which is undefined. Even if it was Animal.somthingElse()
 
@rlemon well we can time it
 
m59
It's obviously supposed to be Capital.
 
@m59 no, no it is not obvious...
 
@rlemon notifier.js script is awesome - thanks for making =]
 
m59
how is it undefined?
 
7:04 PM
@m59 should be this.somethingElse()
 
user1596138
@Neal No. What are you smoking? Maybe I'm wrong, I'll give it the benefit of the doubt, but my console doesn't lie.
 
@rlemon where is your factory?
 
user1596138
 
@Jhawinsss I do not smoke.
 
I dont think your drawing is slow
that doesnt make much sense
 
user1596138
7:04 PM
@Neal Just a joke :). No offense intended.
 
@Jhawinsss lol yes it works but it runs the global version of somethingElse so if you use this inside the fn it will refer to the window and not to the Animal
 
also on my machine its pretty fast fyi
 
user1596138
@Neal I stand corrected... Kind of.
 
@Neal So?
Don't use this
 
@Zirak lol oy
 
7:05 PM
this makes me want to rewrite my vs now
I wrote it back in like 09 or something when I was butt with JS
 
user1596138
Although you did say "That won't work at all. Many errors." which is blatantly untrue.
 
@bushdiver my pleasure
 
@Zirak I'm tempted to ask why, but I'm not sure I want to know
 
10 mins ago, by rlemon
var dog = {
  sharedprop: 1
};
var dogFactory = function(props) {
  return Object.extend(dog, props);
}
 
var Animal = function (name) {
    return { name : name };
};
Animal.somethingElse = function (self) {
    console.log(self.name);
};
It's as if by magic...
 
7:06 PM
@Jhawinsss errors if you do things that you want to do inside of a object method (using this etc)
 
@Jhawinsss It will technically work, but it's broken and bad code.
 
Like, I dunno, this is just a variable which you can pass into a function
 
@Loktar my machine here it is roughly 3 seconds to draw
 
@rlemon ahh thanks
 
@Zirak but... you have to pass the object itself.... That is kind of silly...
 
7:07 PM
OH NO
 
im on a shit laptop, and its almost instant here
 
damn...
 
user1596138
I'm just going to watch this unfold. Because I'm unsure.
 
No it's not silly, it's much more logical in many cases. For instance: Vectors.
 
7:07 PM
Vector.add(v0, v1)
 
@SimonSarris i'm going to do a breakdown of the times
 
m59
this would refer to the window, not foo.
 
You can argue endlessly about how you want to convolute your logic with pseudo-constructors. Or you can use objects with functions.
I prefer the latter.
 
@Loktar YaY you inspired me to attempt one of your demos, which inspired you to re-do that same demo. The circle of [SD]Life[C]
 
user1596138
7:09 PM
I prefer this function without this. I also don't think it matters in this case.
 
@Zirak what if you want private variables and functions?
 
lol idk if ill ever get back to it though tbh
im always trying to do something new
 
var Vector = (function () {
    // ...
})();
 
m59
@Neal I don't get what you're trying to show me here.
 
^ will be inevitably stolen but im posting unfinished
 
@MattDiamant dunno if its any help: gist.github.com/mikedidthis/6053360
 
@m59 .name is not logged
Whatever I am done...
 
m59
Lol of course not!
 
@MattDiamant You're just returning am object, with a bunch of functions. And you pass these functions your variables.
 
7:10 PM
@Loktar damn, that is nice .
 
Also, privacy is way overrated.
 
jiggglllyy
 
can you adjust the demo so the spring is more evident
 
@m59 why is that an lol? What is the point of adding a method to a function if you cannot do anything with the function's variables? ha
 
the physics steps can be modified, and the springiness of the shapes themselves
 
user1596138
7:11 PM
@Loktar That's awesome.
 
ahh, nice.
 
m59
You can, you're just doing it wrong and then blaming my good structure.
 
im going to make the colors change based on force
 
@Zirak Yeah. Why walk around your apartment naked if nobody can see you.
 
pen it up! (after adding dat gui)
 
m59
7:11 PM
But, whatev..
 
and then make a pen where people can drop shapes in
 
also, click and drag the balls would be nice
 
although collisions between shapes arent implemented
 
Oh wait, not that kind of privacy...
 
@RyanKinal Don't worry, I'll be watching
 
7:12 PM
Zirak == NSA
4
 
@RyanKinal program your webcam to turn on and off at random intervals. Place in shower - every shower now becomes a privacy game (sort of like Facebook)
 
(ʘ‿ʘ)
 
@Zirak moar popcorn? :D
 
@rlemon +1
 
m59
Can any of you smart people please verify that there is no debate var foo = function() is a better syntax than function name() in js?
 
7:13 PM
depends on use
 
user1596138
@m59 Not sure I count as "you smart people" but I don't agree.
 
@m59 It very much depends
 
m59
how? Hands down the first one is more versatile...
 
and I appreciate the hoisting aspect of function foo() (because I like to organize my functions at the bottom)
 
@Jhawinsss heard anything yet?
 
user1596138
7:14 PM
It will never be black and white.
 
@m59 Huh? that depends on if you want hoisting or not...
 
@m59 no, no... just no.
 
user1596138
@SomeKittens From PunchTab?
 
function name() is useful for naming anon functions to locate them in stack traces.
yah
 
@m59 There is a functional difference between the 2
 
7:14 PM
^ also that
 
@m59 How is it more versatile?
 
foo.prototype.bar = 42; //FAIL
var foo = function() {};
 
m59
Well, you gave me crockford, and him along with plenty of other experts taught me that, so that's all I'm repeating.
 
@SomeKittens You can also give names like var foo = function foo () {}
 
it's comparing apple pie to apple sauce...
 
7:14 PM
@Zirak Hoisting
 
foo.prototype.bar = 42; //PASS
function foo() {};
 
they are similar, but not comparable.
 
@MattDiamant How does it make it more versatile?
 
@Zirak See Neal's code.
 
The function expression isn't visible before the assignment, the declaration is visible.
 
7:15 PM
@m59 it works for his coding style, but not all coding styles.
 
@MattDiamant He's favouring function expressions, not function declarations. And if you're doing what Neal showed, I will find and destroy you
Why the fuck would you assign stuff to foo before you define it in code?
 
there is no debate, because the comparison needs to be done on a case by case basis. So generalizing one over the other is a bad idea.
 
@rlemon do you have an example? maybe a silly question, but things are starting to click together.
 
Except if you're being a dick
However, I do find myself using function expressions more, and defining helpers with function declarations.
 
@Zirak You don't, and that's why var foo = function () is better, because the code will fail, unlike function foo() which will allow it
 
m59
7:17 PM
Ok, I'll take your word, but I've never needed anything to that effect at all. However, being able to add properties to functions is one the best things about js, imo.
keyword in that statement - "one of". There's plenty else.
 
var foo = function (arr) {
    return arr.filter(filterer).map(mapper);
    function filterer () {}
    function mapper () {}
};
 
@mikedidthis of hoisting?
 
user1596138
@SomeKittens they emailed me on careers.SO this morning and said (as I expected, so no let down) that they are moving forward on the interviewing process with a few other candidates and thanked me for my time.
 
Well, got some good experience out of it
 
@rlemon yes or your functions at the bottom
 
7:18 PM
@m59 you can add properties to both.
 
Keep up the GitHub work
 
@MattDiamant This seems like an edge case brought to prove this point. If that saved your ass, you're doing something wrong.
 
user1596138
Absolutely! Not disappointed at all, I'll be a lot more comfortable next time I have an interview. Plus I know that I need to work on my GitHub a lot more. I feel good about it.
 
@Jhawinsss That sucks
 
@mikedidthis tinker.io/c94c6
in this case it is purely for organizational purposes - but you can see how the functional differences would lead to many use cases
 
7:19 PM
@Zirak People make mistakes while refactoring or coding in general. It's just something that happens, and it's good when you write code that catches your errors. I highly doubt you write code that never has mistakes.
 
@rlemon yeah I undersand
 
user1596138
@Zirak Eh. I really don't have that much to show for myself as a developer. Most of my work here is backend or in the intranet system, which I can't show off.
 
@rlemon thanks btw, I was just curious.
 
m59
@rlemon you mean via the prototype?
 
user1596138
I'm looking for ways to re-use the code I've written for our accounting/bookekeping system for a blogging one. That way I can show it off.
 
7:20 PM
@MattDiamant Again, if you're assigning to foo before you're declaring it, there's something wrong with how you do things. Of course I make mistakes. I never made that mistake, nor have I heard of it happening, nor can I imagine it happening without some heinous crime being done beforehand.
 
m59
anyway, whatevs.
 
15
Q: JavaScript function order: why does it matter?

Chris TolworthyOriginal Question: JSHint complains when my JavaScript calls a function that is defined further down the page than the call to it. However, my page is for a game, and no functions are called until the whole thing has downloaded. So why does the order functions appear in my code matter? EDIT: I ...

 
@Zirak You don't code it that way on purpose. But, I rearrange my code all the time, and if I miss something, it's better that way. There are many examples of why var foo = function () is better for hoisting, I was just using one.
 
function foo(name) {
	this.bar = name;
}
foo.prototype.huzzah = function(a) { alert(a); };
var f = new foo('bar');
f.huzzah(f.bar);
 
Aaaah, a deleted answer with 12 upvotes. Win.
 
user1596138
7:22 PM
I'll find a job eventually. For now I think I'm getting a raise and more hours.
 
@MattDiamant This is the kind of logic which leads up to things like "comma first" styling
 
@Jhawinsss What, in particular, are you looking for? PHP? Front end? Full stack?
 
@Zirak ahh thank you.
 
user1596138
@SomeKittens I'm young and open to just about anything. I don't particularly enjoy the front-end (CSS and HTML) though.
 
"There's this error...that's very easy to find...but I want to change my entire writing style to accommodate it"
 
7:23 PM
@Jhawinsss Where?
 
user1596138
@Neal Where.....?
 
user1596138
Where am I open to working?
 
@Jhawinsss Where, as in location.
So Where?
 
user1596138
Ah. I don't want to work in Indiana, that's all. I want a relo package and I want to move somewhere new. I'd love to go to the SF Bay area. But other places would work aswell.
 
user1596138
7:25 PM
Gotta piss. Hold on
 
@Zirak I'm refactoring 10k+ lines of javascript, and if something goes wrong, I'd like it to say "foo is undefined" rather than throwing no errors at all. How is that bad? And yes, coding styles are meant to make your life easier as a developer. How is that bad?
 
@MattDiamant Do you know what modern Shamans do for a living?
They say you're possessed by the demon troll Nalbrusko, and if you buy this amulet for only 99.99 they can banish him for you.
It doesn't matter that you weren't possessed in the first place, but after they're done, you're sure you're not possessed.
 
@Zirak buy two get one half off?
 
Now, imagine the same, but trade "Shaman" with "exterminator" and "demon troll Nalbrusko" with "rabid crazed anteaters"
That sounds more likely, right? Your aunt Muriel had a grandma who's dog was once attacked by a rabid crazed anteater
So for only 99.99 you can be sure you don't have rabid crazed anteaters
It's possible that rabid crazed anteaters are living in my basement. But I'll take my chances.
 
user1596138
@rlemon I would love to move to Canada even more-so than CA. But for different reasons entirely.
 
7:31 PM
@Jhawinsss But CA is canada!
 
So apply for a work visa
 
user1596138
@Shmiddty Oops...
 
user1596138
@rlemon Before finding a job? I thought you had to have a job to get it?
 
There are more people in California than Canada.
 
that reminds me. @rlemon My room-mate is in school for computer science/engineering. He's interested in working with embedded systems. He won't be finished with school any time soon, but I told him I'd put him contact with you
 
7:33 PM
How to make an unbeatable game, a tutorial from my friend who wanted to make a snake game.
dont write the code to update score after eating food. and make the food jump randomly
 
user1596138
That's part of it. Because I'm from a small-town it'd be nice to live in Canada and have access to the mountains and forests. But in California it'd be totally new. I've never been to a city bigger than Indianapolis, let alone lived in one.
 
user1596138
Plus the climate would be great. I don't enjoy driving 4-wheeled vehicles, ever since my accident, so biking weather all year round would be amazing.
 
@Jhawinsss SF has mountains and forests in the east bay. Also good skiing at Tahoe
 
@SomeKittens I'm honestly surprised that that is actually true.
 
user1596138
Also true. Basically I'll take what I can get, but I'm most interested right now in SF.
 
7:36 PM
34MM to 38MM
 
user1596138
@SomeKittens you haven't been in SF area through the winter yet have you?
 
sometimes I'm dumb.
 
Nope, just past two months. I'd expect the winter's going to be lousy, with no blizzards.
 
user1596138
We have some massive blizzards in Indiana haha.
 
Why exactly is Alaska part of the US?
 
user1596138
7:38 PM
Biking weather (to me) is anything not windy and over 45 degrees. I ride all the way into December usually. So even in the winter over there I'd be able to. Plus I get 58mpg in the city on average.
 
@Shmiddty You can have it, Palin and all!
 
Did Canada just not want it?
 
user1596138
@Shmiddty Oil?
 
It was actually Russia's
 
@Jhawinsss good answer.
 
user1596138
7:38 PM
Yeah Russia used to own (right word?) it.
 
user1596138
@rlemon do companies over there often offer international relocation packages? Because there is no way in hell I can leave here without one.
 
@Shmiddty Wasn't it bought for like $1 per a thousand squared-miles or something?
Something ridiculous
 
user1596138
^^ Something crazy like that, yeah.
 
user1596138
Only $7-8 million for it all I believe.
 
@Zirak a penny per acre
 
7:41 PM
!!wiki Alaska purchase
 
@Zirak No result found
 
@Jhawinsss yes, but ofc this is dependent on the company itself.
 
You liar
 
sorry
 
The Alaska Purchase was the acquisition of Russian America by the United States from the Russian Empire in the year 1867 by a treaty ratified by the Senate. Russia, fearing a war with Britain that would allow the British to seize Alaska, wanted to sell. Russia's major role had been getting Native Alaskans to hunt for furs, and missionary work to convert them to Christianity. The United States added of new territory. Reactions to the purchase in the United States were mixed, with opponents calling it "Seward's Folly", feeling that U.S. Secretary of State William H. Seward, the primary Am...
 
7:41 PM
$.02 per acre
 
Damn it Zirak
 
> The US$ 7.2 million check used to pay for Alaska
 
I was going to post that
 
^
 
@Shmiddty yea man. sounds good.
 
user1596138
7:42 PM
!!urban ofc
 
@Jhawinsss ofc Used in instant messaging to represent 'Of course'
 
@rlemon I should just tell him to hop in here some time.
 
user1596138
Ah. Yeah, I understand that.
 
user1596138
I won't actively seek a new job for a little while, I need to work on my Git. But soon I will again.
 
professional development: safari online books? physical books? pluralsight (or similar) online training? anyone wanna pipe in their two cents on which (if I only have one choice) I should go for?
 
7:43 PM
> [...] about 2 cents per acre ($4.74/km2)
Imagine that with interest...
Russia must be so red
 
user1596138
If anyone hears of any leads though I'd appreciate a heads-up for sure.
 
safari books online is great, however its up to you to teach yourself with that
so idk
 
Well, that was a fairly good pun.
 
if you want "training" id go for plural site or something
if you want an amazing amt of ref material safari books online for sure
 
@Loktar well the yearly subscriptions for all around around the same (+-$100)
 
7:44 PM
I have a noob css problem i never got solved
 
user1596138
@rlemon I like physical books.
 
and work agrees to pay for one avenue of professional development
 
@Jhawinsss already working on it
 
how to fix the offset caused by margin on a h1,h2,h3,p etc
 
user1596138
^^ Thanks.
 
7:45 PM
when they are wrapped in a div or something ?
 
user1596138
@Darkyen Example?
 
yeah I guess it just depends what you want to do, safari books online gives you access to like every tech book created
 
gimme a sec.
 
@Jhawinsss pretty much any leads I would have would require to see a portfolio of yours
 
but if you want school like training its not great for that
 
7:45 PM
Fun fact: The Alaskan government pays you to live there.
 
@Loktar i'm not so bad training myself.. idk. I suppose i'll have to sleep on it
 
I've had safari books online forever.. because its a tax writeoff
I use it maybe once a month :?
 
Fun fact: the ~4 Alaskans i've met told me Alaska considers itself part of Canada
 
I just find what I need online
 
user1596138
@rlemon Which is my main problem. I now use GitHub, but I won't have anything worth showing for a little while. I only actually put something up yesterday, and that was the /colors thing because other people were adding to it and I wanted version control.
 
7:46 PM
@Jhawinsss @RyanKinal jsfiddle.net/darkyen/de5LA
see the red ?
 
@rlemon thats because we all consider canada pretty much part of the US :P
 
leaving that much space :-(
and the form itself has no margin :-|
 
user1596138
@Darkyen What's it supposed to be doing?
 
USA: "Canada is like out hat"
Canada: "USA is like out diaper"
 
especially people who live in MI
Canada is so close
 
7:47 PM
the red should touch the borders and on top
 
@Loktar well you don't really see any differences that close to the boarder
 
@Jhawinsss Link plz
 
windsor is not much better than detroit
 
its still a lot cleaner imo
well last time I was there
like 2002-ish
 
7:48 PM
1) margin and padding on body
2) margin collapse coming from the h1
 
Detroit is so dumpy..
 
yea it has dived pretty bad
 
user1596138
 
@RyanKinal i know off the body
but is it necessary to add that 1px padding ?
 
It's either that, or remove the top margin from the h1
 
7:49 PM
physically, the buildings in windsor and the streets are better (because of our municipalities) but the quality of everything if you ask me was about the same
 
@Jhawinsss Your indentation :(
 
@RyanKinal but why
and even awesome it works with 0.1px aswell
 
user1596138
@Zirak I actually don't see a problem with it?
 
Any moderators here?
 
lol
 
7:49 PM
@ThiefMaster ^
 
Some time, I might have to figure out how many of my answers involve the phrases margin collapse and overflow: hidden
 
@Jhawinsss You sometimes have 8 spaces, sometimes 4.
 
@Darkyen MARGIN COLLAPSE
 
user1125394
What would be the best approach to fill some time-series values: given N time series (each of them with format [[time1, value1],[time2,value2]..], they unfortunately can have irregular XAxis times. One workaround is to manage to gave time with known intervals ex: days, and then filling missing days for each serie, which is far easier
 
MARGIN FUCKING COLLAPSE
 
7:50 PM
github.com/Jhawins/Colors/blob/master/colors.php or is that github messing up tabs again?
 
dunno what that is :->
 
does anyone know how to hide towtruck in jsfiddle.
 
$('towtruck').hide()
 
TWO ADJACENT MARGINS WILL BECOME ONE
 
user1596138
7:50 PM
@Zirak Yeah for some reason it's like half tabs and half spaces now. Wtf
 
BECAUSE THEY'RE, LIKE, HORNY OR SOMETHING
 
lolol
calm down :'(
 
@rlemon really?
 
and i really really didnt knew that
its illogically illogical
 
user1596138
I feel like a commit just to fix the indentation is silly... Because every line will be changed. But maybe I should?
 
7:52 PM
seriously it's so annoying don't even know how it's there.
 
@Darkyen I disagree, actually. It's really useful, sometimes. But annoying others.
 
I have no idea what towtruck is
 
now i realize about 40% of my css failures
 
@rlemon mozilla towtruck
 
:-) thank you so much ryan... i will buy you a candy :D
 
7:52 PM
@Jhawinsss Would you mind if I play with it?
 
user1125394
o well have to fuck that time-series daily
 
it's shit whatever it is
 
user1596138
@Zirak Go right ahead. It's hosted online at southouse.tk/colors.php also.
 
user1596138
For the bot anyway.
 
@Darkyen lol, no problem
 
7:54 PM
you are so awesome :D :D i feel like a sore noobshark now though ...
 
Can someone comment on a site redesign thus far?
 
Man I haven't touched php in so long...
 
@SimonSarris Yes
 
It probably didn't remain faithful to me
 
user1596138
!!color 000000,FF0000,00FF00,0000FF,FFFF00,00FFFF,FF00FF,C0C0C0,FFFFFF
 
7:55 PM
 
@CapricaSix Oooh, perty
 
php: "ZIRAK, YOU ARE NOT THE PROGRAMMER I MARRIED!"
zirak: "We never got married...I overslept, remember?"
 
user1596138
Shmiddty added columns for multiple colors.
 
7:55 PM
you're welcome
 
zirak: "Why am I talking to myself in the 3rd person?"
 
@Jhawinsss Neat!
 
there will also be a small series of tiles linking to 6 or 8 samples like D3js has: d3js.org
 
user1596138
!!color
 
7:56 PM
 
@rlemon Thanks :-)
 
@SimonSarris An improvement, but the buttons at the top feel out of place
 
It feels like a lot more than that sometimes
 
!!color 000000
 
7:56 PM
Also, what's that ?? at the top left?
 
user1596138
Also, an error message. But it's poorly coded. I'll fix it later. I'm also going to use PHP to detect whether or not $colors is valid hex. And if not I'll let it try anyway just for shits and giggles, but also tell you it was invalid.
 
@RyanKinal look at the query, it is not flexible. It only looks for those "Exact" phrases
 
@Loktar southouse.tk/colors.php?color=1a1a1a, 1a1a1a, 303030, 444444, 565656, 686868, 797979, 8b8b8b, 9b9b9b, acacac, bbbbbb, cbcbcb, dbdbdb, ebebeb, fafafa, fffeff, 300800, 4a2000, 623600, 7b4b00, 905e00, a67200, bb8500, cd9700, dea800, eeb800, ffc700, ffd700, ffe700, fffa12, ffff33, ffff54, 5b0000, 780000, 901600, a72b00#.png
 
aww
 
and I presume 'post' is both questions and answers
 
user1596138
7:57 PM
@Loktar No spaces.
 
!!/color 11,21,31,41,51,61,71,81,91,a1,b1,c1,d1,e1,f1
 
user1596138
Caprica has issues with spaces. I don't think I can get her to strip the # or the spaces like I want.
 
@rlemon Yeah, but i'm pretty sure that most of my answers involving those concepts would be those exact phrases.
 
7:58 PM
preetttyy
 
@Jhawinsss You can encode stuff in commands with $encode(blah)
 
sorry for color spam
 
user1596138
@Zirak I noticed that actually. I'll have to try it out.
 
!!parse $encode(#foo, #bar)
 
7:59 PM
@Zirak %23foo
 
...wat
 
@Zirak they are redundant, but its a page that new people will land on and at the same time old customers may go to for reference (API, activation, etc)
 
@SimonSarris I don't like the bottom informational bits. It looks a bit disorganized.
 
So I wanted them very easily accessible
 

« first day (1013 days earlier)      last day (3935 days later) »