« first day (2113 days earlier)      last day (2835 days later) » 

user6524633
3:00 PM
@ndugger so if I was in strict mode it would throw an error? Why is that exactly?
 
@FilipDupanović and when you pull a rooting plant out of clay what happens?
 
@Martinloc in strict mode, this is undefined in the global context
 
the roots rip off.. that's what
 
I don't think compact soil would be an issue, the mycelium should be able to pierce through with their network
 
@SterlingArcher scope, like most things, is all about the curlies. There are a million ways to do it, but focus on the curlies.
 
3:00 PM
I legit work with farmers. I grew up on/around farms.
I know what I'm doing :P
 
user6524633
@ndugger but...in this case this its inside foo() so it should not be undefined
 
42
Q: It’s time to retire the term “rep-whore”

JaydlesGoing forward, “rep-whore” (and its derivatives) will be treated like any other term that’s inconsistent with the community’s “be nice” policy: it will be removed. It’s totally okay if you’ve used it in the past. Nobody’s judging the many users who’ve used it. And users will NOT start being s...

 
user6524633
right??
 
well, clearly not exactly in this situation as I fucked it up
but I know why :P
 
Whats up :)
 
3:01 PM
@NGrabham Welcome to the JavaScript chat! Please review the room 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.
 
@Martinloc no, because foo is not a "class" that you're instantiating, it's just a regular function
 
Yeah I'm still gonna say rep-whore
 
I'm just thinking... we have beans, corn, sunflowers, tomatoes, cabbbage... etc.
 
how you all doing :)
 
@bjb568 no
 
3:01 PM
we have to source carrots from other parts
 
@rlemon I made a terrarium once
it only lasted a week or so
 
Just got my badges, trying this chat feature how LETS FUCKING GO
 
@bjb568 are you spamming or trolling (this time)?
 
(*peppers too)
 
user6524633
@ndugger I thought everything in JS was an object? Including classes?
 
3:02 PM
@Martinloc most things, not everything.
 
@Martinloc functions behave differently depending on if you simply call them or if you instantiate them
 
121 to chat , I'll create a private room and give you the details
 
user6524633
oh I see
 
@NGrabham fkin A, welcome o7
 
you're not instantiating it, so this still refers to the global context, which is undefined in strict mode
 
3:03 PM
@BenjaminGruenbaum I missed this sorry. I've been watching Burn Notice and Limitless. Good shows
 
@ndugger ehhhh very slightly. The only differences happen before the function is called.
 
Burn Notice is really good. Semi-innacurate but you learn some neat spy stuff
 
@SterlingArcher Burn Notice is one of my all-time favorite shows.
 
Hello @FilipDupanović How's the kids?
 
@ssube the fact that this is entirely different depending on what you do makes the behaviour incredibly different
so yes
 
3:04 PM
My grandfather loved that show before he passed away, and when I got to watch it with him, he would confirm some details for me (he was in the CIA, high ranking af)
 
RIP :(
 
rip in pepperoni
 
@ssube You're a bit late.
 
@ssube just watched the one last night where Marv was killed by that Brennan guy
 
@ndugger new fn is (mostly) just fn.apply({}, arguments)
 
3:04 PM
1 message moved to Trash
 
@NGrabham you have to ask the peeps that wrote the shoddy jQuery scripts that run this simulation, they haven't materialized yet
 
@ssube which makes it behave differently
 
@SterlingArcher What do you, the world's greatest spy, have to learn about spying?
 
@SterlingArcher it's been a long time since I've actually watched large amounts of it.
 
@KendallFrey lol maximum effort!
 
3:05 PM
The only part of the larger plot I remember is the beginning and end.
 
wait shit that's deadpool
 
The final seasons is really good.
 
oh lol someone kicked bjb again
 
so bjb has this idea that we're after him, but in every chance to interact with the room he tries to throw us under the buss or just troll us
 
r u trying to mug me off LOL
 
3:06 PM
What for this time?
 
lol
 
go troll elsewhere
 
HI
 
@BenjaminGruenbaum he was bragging about trolling
 
3:07 PM
:(
 
the message nick binned
 
@ssube was he trolling here?
 
Hi @BrianJ you good homes?
 
Yes
 
@ssube I haven't seen it, but I know [redacted] dies :(
 
3:07 PM
lol, what a douche
 
@SterlingArcher EVERYBODY DIES (not actually, it's not GoT)
 
He came in here posting off topic discussions to fuel his political beliefs about the site's rules. We let the first one slide, but I binned the second one, and he was kicked
Then he came back and was immediately rude, so he was kicked a second time
 
@SterlingArcher are you okay? this guy is PISSING me off too LOL
 
@ssube got a bit closer to solving the Date issue I had

Instead I allow user to input local time, store it down as UTC, then display again in their local on browser
 
Guys just leave the bjb thing alone. Be a cool cucumber. He rants about us in the Meta Tavern, and we don't need dramatic mod attention because of it
 
3:09 PM
@ssube one of my favorites as well
 
@SterlingArcher if he shows up to just troll us, I kick liberally.
 
@SterlingArcher they're just going to show up and kick him
 
I imagine this place like a western movie bar where everyone stood up and drew their revolvers
 
Speaking of cucumber, type 111 if you like BDD based automation
 
@NGrabham cucumber is a terrible testing library, please don't use it.
 
3:10 PM
@Quill this chat ain't got enough bandwidth for the 2 of us
bang bang
 
@SterlingArcher honestly I have no problem saying I'll kick him on site - and I don't mind the meta attention on me.
 
@NGrabham I'm great homes yes
 
@SterlingArcher SO has like a million bandwidth
 
If he came here to troll then we should be the ones complaining in meta.
 
@BenjaminGruenbaum I know, I'm just trying to be a good RO for once and keep it chill lol
 
3:10 PM
And we want the mod attention.
 
> "JS room is out to get me "
flames the js room and its members
 
Kick is fine, I have no issues :D
 
@ssube chat actually runs on a different server to Q&A :3
 
@SterlingArcher yeah, I get it, you're being the grown up :D
 
@SterlingArcher gorilla
 
3:10 PM
@BrianJ that's the best strategy, I've found
 
@BrianJ safe fam, nice to see you're still staying true to your ends ye
@ssube whats so bad about cucumber?
 
@KendallFrey triggered
 
keep it in UTC as much as possible, but not for I/O
 
@SterlingArcher stencilled
 
@NGrabham pretty bad syntax, plenty of bugs, slower than most, requires a ton of boilerplate and utilities to actually work...
 
3:11 PM
@ssube yes and it worked perfect on debugging local, once I published it to the UTC server my utc times don't convert to local on the client grrrrrr
 
the whole automagical BDD thing means you have to jump through an entire music festival's worth of hoops before you can actually test anything
@BrianJ are you sure you're instantiating them right? With the -UTC or Z on the end and all, to indicate UTC dates?
 
@ssube anything you'd suggest instead, about to start using BDD at my workplace, but they're open to better solutions if you have any
 
cucumber means you have to jump through hoops but you're not the one writing the testing.
 
@NGrabham I prefer mocha (with karma or selenium or anything like that) with reasonable helpers.
 
Cucumber is for your product team to write the business rules in - that's the beauty.
 
3:13 PM
a bunch of our devs love nightwatch
 
cucumber means you have adequate water supply and at least 8 hours of sunlight
 
They get to write business rules while not being programmers and your tests need to pass them.
 
really, anything but cucumber
 
:D
 
@BenjaminGruenbaum that's supposed to be the idea, but it doesn't actually work like that
there's still way too much boilerplate to be written for anyone outside of dev to implement their own test
 
3:14 PM
@BenjaminGruenbaum oh right, can't go wrong with American Horror Story. Super creepy
 
1 message moved to Trash
 
Aw damn, I never get to kick him you guys are too fast :(
 
click moar bettur
 
@bjb568 stop coming in here and starting drama please. 2 kicks and continuing something we don't want to deal with? That's just not smart man. Get along or get out.
 
@ssube I think so, going to alert the value from server now

Basically I do the following steps to convert to local:


var outageStart_UTC = moment.utc('@Model.Escalation.OutageStart', 'DD-MM-YYYY HH:mm:ss');


    //Check that the value is a valid date before converting to local
    if(!isNaN(outageStart_UTC))
    {
        var localOutageStart = moment.utc(outageStart_UTC).local();
        var localOutageStartFormatted = localOutageStart.format("MM-DD-YYYY HH:mm:ss");
        $('#outageStartInput').val(localOutageStartFormatted);
 
3:15 PM
That was his third kick
Mod attention time
 
in Tavern on the Meta on Meta Stack Exchange Chat, 13 secs ago, by bjb568
Yay, I got kicked from r17 3 times with an autoflag.
 
@rlemon @MadaraUchiha can you do something? He's bragging about showing up to try and start shit, nothing else.
 
he complains that we're out to get him, but in the past year we've ignored him and all he does is flame us and start shit
 
nobody has engaged him today, he's just trying to pick a fight and we have better things to do on a friday
 
He's clearly not welcome in this room due to his own behaviour, but just because he's active in the Meta room, we're the bad guys.
 
3:17 PM
This is great for next time he runs for mod.
 
yup
 
@ssube is there anything wrong with my above convert to local? don't see anything obvious there
 
@BrianJ I don't think you're marking your UTC dates as UTC, which I would definitely do.
ISO 8601 Data elements and interchange formats – Information interchange – Representation of dates and times is an international standard covering the exchange of date and time-related data. It was issued by the International Organization for Standardization (ISO) and was first published in 1988. The purpose of this standard is to provide an unambiguous and well-defined method of representing dates and times, so as to avoid misinterpretation of numeric representations of dates and times, particularly when data are transferred between countries with different conventions for writing numeric dates...
 
@SterlingArcher As much as I'd love to hop in there as well and knock him off his high horse, ignoring him is probably the better option. Madara has been pinged.
 
3:21 PM
It's probably not a smart idea to flood the Tavern with "17ers" anyways :P
 
@ssube I set the kind UTC in the server side, so I would have thought that marked it as UTC prior to the assignments
 
We could start a football team
 
I'll alert the values and see
 
The 17ers
 
r17ers #1
 
3:21 PM
@ndugger you don't need to do anything, folks don't hold him in very high regard (see the last few elections).
 
I'm aware
 
@ssube he beat me in the last election :P
 
it's just a very persistent troll showing up to harass anybody he can find
 
@rlemon I'd be good in that. I have height for it lol
 
@SterlingArcher you did start the election with "got dick" in your picture
 
3:22 PM
That's just because people don't know you. He's loud and whiney, so people were at least familiar with his name
 
@SterlingArcher height for football?
 
@ssube and the convert to local works when run locally so i don't see why it wouldn't work on server..unless I'm missing something obvious
 
@SterlingArcher don't engage him. Think of Rebecca.
 
Think of Rebecca and her massive stacks of youtube ad revenue
 
I'm just calming trying to show him how much he puts us down.
 
3:23 PM
Think every thought of rebecca, as you slide into a deep coma
 
1.2 million net worth. She did something right
 
@ndugger rebecca black should do asmr videos, man
 
asmr?
ahhhh
 
@Quill please don't encourage her to do more videos plz.
 
acrobatic swimming moon running
 
3:25 PM
Please no
 
@ssube is she present in this room or something? :p
 
@Quill no but we're lucky we survived the last one.
 
we probably drive a good 100 views a week :D
 
It's like putting an "asteroids welcome" sign on your planet.
 
She actually has a regular vlog she does on youtube.
 
3:26 PM
that's a nice metaphor. i like that metaphor
 
user6524633
function foo ( num ) {
	// console.log ( "foo: " + num );
	console.log(this);
	this.count++;
}

foo.count = 0;
var i;
for ( i = 0 ; i < 10 ; i ++ ) {
	if ( i > 5 ) {
		foo ( i );
	}
}
// foo: 6
// foo: 7
// foo: 8
// foo: 9
console.log ( foo.count ); // 0
 
>.> Friday clickbaits
 
user6524633
guys can you explain what is foo.count in this case
 
you need to instantiate foo
 
user6524633
snippet is from an online tutorial
 
3:27 PM
@Martinloc static property
 
var poo = new foo(10)
 
user6524633
but it does not explain
 
wait that works?
it just looks... wrong
 
@Martinloc it's a property on the foo function.
 
user6524633
@ssube and why it does not get increment?
 
user6524633
3:28 PM
I thought only objects could have properties @KendallFrey
 
@Martinloc Yes. foo is an object
 
@Martinloc foo.count and this.count are different things, because foo(...) does not have this === foo
 
unless you instantiate it
 
user6524633
@ssube so what would be a nice way to instantiate foo.count in this case?
 
3:29 PM
the nice and only way to instantiate something is new
 
2 mins ago, by rlemon
var poo = new foo(10)
 
@ssube let instance = foo.constructor.call({}, 10); :)
 
foo incrementing this.count in this context is going to be incrementing window.count. Set window.count = 0 and try it again, then console.log(window.count) and see what you get ;)
 
@Martinloc Almost everything in JS is an object.
 
even null.
 
3:30 PM
@Martinloc Don't set properties on functions. Use a normal object.
 
@Luggage I don't think so.
 
well, typeof() calls it an object.
!!>typeof(null)
 
@Luggage "object"
 
user6524633
@KendallFrey its an online tutorial
 
It's a bug
 
3:31 PM
yea.
 
@littlepootis you're a bug
 
@Martinloc they can be wrong
 
in Tavern on the Meta on Meta Stack Exchange Chat, 1 min ago, by Benjamin Gruenbaum
@bjb568 @Shog9 can you please give this dude a stern look or something? I don't understand why he comes to the JavaScript room trolling every few months. Honestly I've been fine with it because I've expected him to outgrow it and get bored after a few times but this has been going on for years now.
 
@Martinloc sounds like a shitty one
 
@BenjaminGruenbaum His response is golden
 
3:32 PM
@Luggage that's a bug, fixing it was attempted but didn't work because the language was too old at that point.
 
Right, so now it's a feature.
 
@BenjaminGruenbaum I feel like cross-posting is not the best idea... leave that to the trolls.
 
@ssube you're a standardized bug
 
user6524633
@rlemon if I use new foo(10)
 
@BenjaminGruenbaum Can we not pile anymore fire on the bushfire? You're only gonna get burnt and waste your time
 
user6524633
3:32 PM
how would I increase foo.count?
 
@littlepootis at least I'm in the standard. You're just a jelly bug.
 
kick on site, don't feed. let him make himself look like a fool.
 
I wanted to notify the room that I pinged Shog, but I agree.
 
@BenjaminGruenbaum not that you care, but my circular reference difficulty was that my test dat was going through immutable.js and out, making the objects no longer the same instance. I was chasing the wrong problem.
 
@Quill I've pinged a community manager and didn't respond to any provocations or messages. I appreciate the sentiment though.
 
3:33 PM
@Nimphious or bind foo to foo :P
 
@Martinloc You really shouldn't write code like this, but this should give you a hint as to what the original problem was. jsfiddle.net/pu1cxah5
 
Where the hell are the mods, is what I'm wondering
 
@Luggage oh, that does sound hard. Honestly I don't really like ImmutableJS anymore.
 
The tooling is bad.
 
3:33 PM
@ndugger mods work in mysterious ways
 
@Martinloc The function, and an instance of the function are not the same.
 
@BenjaminGruenbaum I only use it a few places, so if you have an alternative, speak up
 
The only way to change foo.count is to actually change the property on the function, not via any other object
 
@Luggage Well, we use MobX which will throw of mutations that are not through an @action - but even just plain JavaScript objects will do.
 
@ssube deferred responsibility is the term you're looking for
 
3:35 PM
will investigate.
 
@BenjaminGruenbaum I've seen that lib before. Looks kinda like Redux?
 
We're leaning towards MobX as an org; I'm getting irritated with Redux
 
I've never even heard of MobX
Google powers activate
 
Redux+Observables sounds dope
 
@ssube after you use MobX - redux looks like it is retarded :D I felt so stupid for liking it.
 
3:36 PM
@SterlingArcher Tree powers activate!
 
It's a little like Knockout, it observes the properties your view is using and it only renders the part it needs to automatically.
 
@Nimphious great, we can do foo::foo(10) xD
 
We also have some performance issues with Redux when you've got a shit ton of components
 
It's very neat and clean.
 
@BenjaminGruenbaum oh, gross
 
3:36 PM
@FilipDupanović lol
 
I am mixing knockout with react already, so mobx looks interesting.
 
@Luggage MobX is much much better than Knockout at this point - both in ergonomics and speed.
 
Oh neat, it's a state manager
That looks cool
 
I don't think the data pub/sub mechanism should bind into the views at all.
 
@SterlingArcher g+
 
3:37 PM
@ssube to the programmer it's invisible - things just work.
 
the views ought to control that
otherwise it's IIOC
 
@BenjaminGruenbaum yea, and I was already wondering how I might port knockout code to react without re-writing it.. so.. very interested. I've heard it mentioned before but it's sounding like jsut what I want. Redux looked enticing but too difficult to mix with knockout
 
What do you mean?
@Luggage knckout without the shitty dom templatey parts, without functions for everything (getters/setters) and with react components. It's composable and pluggable - for example you don't have to use it with react - some people are using it with angular or with other component systems
It just takes care of reactiveness, it also composes really well with Rx
 
@BenjaminGruenbaum how do you handle MobX and DI within your React views?
I've been looking at various DI stuff for React this morning and nobody seems to have a clear answer.
 
Where have you been all my life?
 
3:40 PM
@Luggage That's what I was feeling.
 
@ssube the Context API could work for you
 
@ssube Good question! They are separate concerns. Let's say your component updates when the Users model changes, MobX-React will detect it and take care of the reactiveness for you and your injector will inject Users to the component.
I don't use context for DI, I use a decorator that sets properties on the object. Constructor with React components would mean I have to override createComponent so I avoid it
 
wat
override createComponent? properties?
I'm talking about very basic DI for views, like attaching them to a service or DAO when they're created.
 
You want to pass the Views through the injector o_0?
 
the only thing I've seen so far is dynamically creating classes to replace the constructor, more or less, which is ugly as hell
 
3:42 PM
then you can create an ancestral component that sets the context for the whole tree, that's the simplest approach
 
(vs logic)
What would you pass views with DI?
 
I'm talking about class ProjectView extends React.View { @Inject(ProjectService) constructor(projectService) { ... } }
 
Your parent component doesn't even have to be aware of them if you use .children.
@ssube Oh, then we're talking about the same thing.
Well, assuming you're not using TypeScript and can't inject on type - you can inject on name for instance:
@Inject(ProjectService, ps => this.projectService = ps)
class ProjectView extends React.View { constructor() { ... } }
Not as pretty, but constructor injection is hard with React since you don't control creation and don't have framework support.
Otherwise you'd need your own subclass or factory for everything.
 
@BenjaminGruenbaum right, that's what I'm running into. I want to make my DI stuff compatible with React (so I can use it in a React app).
 
Yeah, I ran into it too when building DI.
 
3:44 PM
I think a @InjectProperty annotation might be just what I need
 
I use sette rinjection which is simpler.
Yeah, like the above example I posted - if you figure out constructor injection I'd love to know
 
IMO, DI belongs in the ctor and nowhere else
I'm looking into wrapping just the ctor in a more limited form, which is what most people do (but they typically wrap the whole class).
 
Optimally yes, but we have to be pragmatic and if you write the decorator you can ensure it's the very next thing that'll run
 
class Foo extends Component {
	static contextTypes = {
		fooStore: PropTypes.object.isRequired,
        barService: PropTypes.object.isRequired
    };
}
 
for reference, this is what I'd like to get working with React
 
3:46 PM
Formatting so weak
 
Well, you can cheat with a subclass the same way React does, that might work.
 
so if I make sure every view has a reference to the injector...
 
Oh wow it's lunch time
 
Foo.contextTypes = { ... };
 
In React, their constructor for React.View doesn't return a React.View, if you return something from a constructor in ES2015 it will be returned instead of the object created.
 
3:47 PM
@ndugger it doesn't Babel much :/
 
They use it to return a lightweight ref object and in order to make the actions opaque.
 
did that change? I thought the return value of constructors were ignored..
or maybe I am just plain wrong.
 
class A {
  constructor() {
    return {hello: "World"};
  }
}
class B extends A {
  constructor() {
   super();
   console.log("B");
  }
}
console.log((new B).hello); // World
It's a "little known fact"
You can get around it though by returning from the constructor of B - that can give you your DI hook @ssube
class A {
  constructor() {
    return {hello: "World"};
  }
}
class B extends A {
  constructor() {
   super();
   console.log("B");
   return {hello: "boo"};
  }
}
console.log((new B).hello); // boo
 
@BenjaminGruenbaum the tricky part will be having the decorator provide the right function.
I can never wrap my head around how the return function is called. :(
 
Make your class return an object that extends Reacts return value (with ref) but runs the DI when the ref is accessed through getter.
That might work.
The decorator returns a type wrapping the React.View or something
 
3:50 PM
@BenjaminGruenbaum uh? Can you write that as a one liner?
 
Ant
 
@ssube I can try
 
Mosho?
 
!!doge doge,doge,doge,doge
 
 wow
so doge
                many doge
                            much doge
such doge
 
3:56 PM
@BenjaminGruenbaum so, I'm looking at something like this blog post but combined with the annotation I have now. The part I don't get is how the return class fixes it for them.
 
it's just decoration, like Abramov's old composition over mixins post
 
never seen it
 
@BenjaminGruenbaum interesting, but not very helpful.
 

« first day (2113 days earlier)      last day (2835 days later) »