« first day (2222 days earlier)      last day (2951 days later) » 

17:00
@KarmaDoe that was a typo am sorry
well there is also this other thing of closures in anonymous functions it also disturbs me abit
closure seems scary, but it's not
just like an if block can access variables from the surrounding block, functions can access variables from the surrounding scope
because functions can run at a later time, that access remains even after the surrounding scope exits
17:03
360 noscope function
More so closures in loops
@ssube yeah, capturing a closure is a bit more magic-y though
@TariiqHenryBbosa closure in loops is bad, don't do that
let in loops makes it execute well
but var kills it for me
let = block scope
17:04
1 message moved to Trash can
@AlainProfessional Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
var = function scope
@ssube why are they bad?
@TariiqHenryBbosa super expensive
you don't really have any reason to use var today.
for( ... ) {
  <- is a block
}
17:04
do they bring an overhead?
okay thanx
declaring a new function is pretty involved, but a new function in a loop with closure is very very expensive
you know what I absolutely hate?
I'm rich, can I do it?
the runtime has to create a scope, set up references to the parent, etc
17:05
@BenFortune made my day
html and css.. html and css are terribad
@rlemon you are wrong.
Can you give me some other way of going about it @ssube
@BenFortune it's not about being rich in money, it's about being rich in CPU.
@Luggage nevah
17:05
for (..)
    // single statement, is it a block?
@FlorianMargaine yes.
@FlorianMargaine yes
@TariiqHenryBbosa refactor the inner function to use explicit parameters
@ssube /s
:D
@FlorianMargaine for what purposes?
17:06
srsly, who feels like 'contributing' to some open source? I need my front end cleaned up
@rlemon I bet you do
Can i have a look ?
@BenjaminGruenbaum good question, that was just a "what does the spec say" question
Hey Guys, I have a question, IM using Datepicker with gem bootstrap
the problem is when I put this line

    <input type="text" data-provide="datepicker">

I have this kind of format : dd/mm/yyyy
I would like to have yyyy-mm-dd
So I put in my JS file this code :

    $('input').datepicker({
        format: "yyyy-mm-dd"
    });

but its not working , any help?
please
no obvious purpose out of my head
17:07
@rlemon ifyouknowwhatImean
@rlemon Boooooooooo
<3 HTML/CSS
@KarmaDoe robogist.rlemon.ca be impressed. be very impressed.
@FlorianMargaine it's the best way to ensure you become irreplaceable in your company
then fix it all
what does not working mean?
17:08
@BenFortune Your CPU could be broke man
also, $('input').datepicker({ is very likely to target elements that aren't meant to be datepickers..
@FlorianMargaine then no, it's a statement but not a block.
A block is defined to have {}s.
Pizza, i love pizza.
@ssube does reacts virtual DOM offer like true "data"? Like can you calculate stuff off-DOM with offsetParent and getBoundingClientRect etc.?
@BenjaminGruenbaum whats the scope of the statement and variables defined in the for block then?
17:08
that means I have still the old format (DD/MM/YYYY)
@KevinB What do you mean?
right, but did you confirm that an element was selected?
@jAndy it shouldn't
did you confirm that the code is running without error?
@rlemon it's one line, you can't declare stuff and do anything unless you use , or something
17:09
@rlemon the scope of let/const variables defined in the for statement is the for statements and the following statement, which might or might not be a block.
I can make anything one line.
can you link to the documentation for this... "datepicker" plugin?
block and scope are not entirely the same thing in JS
This is all "spec speak", in practice I'd call it a block too.
block is more a parser artifact and scope is what is actually allocated
17:10
A block is literally defined as Block: {StatementList}
@ssube you are right about let=block scope
{}
with or without parens, it should turn into essentially the same thing in the AST
@ssube if it doesn't, how can it know which areas are to be invalidated for redraw? There must be some calculation be involved no?
That said, the spec definition is mostly useless since even the spec itself calls let "lexical block scope".
@ssube right, but it's a different production of the grammar
@AlainProfessional shouldn't it be an input with type="date" ?
17:10
@jAndy it doesn't calculate based on coverage or coordinates or anything. They have a blog post describing their algo.
@rlemon "oppertunity"
@BenjaminGruenbaum yep
@AlainProfessional did you confirm that $('input') actually selects the element you're targeting? jquery silently does nothing when no elements are found.
@ssube you don't have that link by any chance :p?
Also, instal and contribute buttons do nothing for me
17:12
of course they don't
it's a 'design'
not a functional product
@jAndy searching for react diff algorithm: facebook.github.io/react/docs/reconciliation.html
The important statement is:
well, the product is functional, just not the website
> let and const declarations define variables that are scoped to the running execution context's LexicalEnvironment. The variables are created when their containing Lexical Environment is instantiated but may not be accessed in any way until the variable's LexicalBinding is evaluated. A variable defined by a LexicalBinding with an Initializer is assigned the value of its Initializer's AssignmentExpression when the LexicalBinding is evaluated, not when the variable is created.
> If a LexicalBinding in a let declaration does not have an Initializer the variable is assigned the value undefined when the LexicalBinding is evaluated.
I see
17:13
I'd love to do more open source, I'm getting rusty
I need html/css work :D
Guys who use angular js?
people
I hope to never write regular HTML/CSS in a personal project ever again... I'm all about React + Aphrodite
@ndugger Aphrodite?
17:14
@BenjaminGruenbaum github.com/Khan/aphrodite
@ndugger looks like CSS modules, which are great
Can some one helpd me out onthe differentce btn $scope.$apply(); and $scope.$digest();
Oh no, actually I like CSS modules better, you write css but it does that scoping for you and you don't need to type css.
@Mosho actually wrote something very similar to that aphrodite thing which we used for a year, but we recently moved to css modules.
I just don't have the patience for it.
@BenjaminGruenbaum makes sense, thanks
17:15
making shit look good at every scale === ugh, fuck no, please god no
@AlainProfessional so dumped us )=
Guys did any of you see my question?
I didn't get what e.g. for (...) let foo = bar, foo; does, though? in which scope is foo?
@FlorianMargaine The for's scope (i think)
@TariiqHenryBbosa isn't that well explained in the docs
17:16
@BenjaminGruenbaum We had some annoyances with CSS modules. I don't recall what they were, but Aphrodite feels much nicer. We do have the issue of not being able to use it for third party react components, though. For those, we use less to do shitty selectors to reach into parts of the third party component to style them.
@FlorianMargaine sure.
or on SO
about $scope.$digest() and $scope.$apply()?
no It is not
they basically do the same things
17:17
69
Q: $apply vs $digest in directive testing

Daniel RosemanIf I have a directive that responds to the status of a particular attribute on the scope, and I want to change that attribute in my test and verify that it responds correctly, which is the best way of doing that change? I've seen both these patterns: scope.$apply(function() { scope.myAttrib...

@ndugger css modules generating class names on the fly and setting those to the file locations it's great.
-3
Q: Angular $scope.$digest vs $scope.$apply

ILIASI just want to know hot to use $digest. Inside a controller the following code works fine and it updates the DOM after 3 seconds: setTimeout(function(){ $scope.$apply(function(){ $scope.name = 'Alice'; }); },3000); However by using setTimeout(function(){ $scope.$digest(fun...

@KevinB thanks let me read here
and if you like videos: youtube.com/watch?v=LgDgazlr_Kw
@ndugger it also makes interop very easy, I see the merit of something like aphrodite.
17:18
@BenjaminGruenbaum setting class names to file locations?
@FlorianMargaine doesn't it go all syntax error ?
@FlorianMargaine Uncaught SyntaxError: Identifier 'foo' has already been declared
@FlorianMargaine
> let bar=42; for (let i=0;i<10;i++) let foo = bar, foo;
let bar=42; for (let i=0;i<10;i++) let foo = bar, foo;
^^^
SyntaxError: Unexpected identifier
(unexpected identifier on 'foo')
commas are special in declarations, right?
17:21
Comma is an operator
1, 42
42
@Luggage nope
>let toto=42
>toto, 1
1
I already decided on bootstrap
var x, y; //commas mean multiple declaration here. different from the comma operator elsewhere
17:23
@SwiX console echos the last returned value.
console is a special environment
@SwiX two examples you gave outside declarations. you haven't offered a counter-example
using the comma operator is awesome in cases like :
logAndReturn = (x) => console.log(x), x
@KarmaDoe that library is awful, it looks so weird trying to combine flat and gradient with boxes and rounds
@rlemon @Luggage https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Comma_operator

Check out the comma operator on MDN
Everything is evaluated, last item is returned.
@SwiX that's confusing. and if you put that as an argument, you'll need extra parens, or , x will look like another argument
17:24
@SwiX I'm aware how comma works
@Luggage what is ?
why are you giving out links for sites that proxy MDN?
@ssube flat and gradient like google's appstore icon ?
@Luggage Hadnt noticed it was a proxy actually, got got myself
@KarmaDoe they combine bootstrap's gradient color style with material's flat style, then combine (seemingly at random) squares and circles
17:27
@SwiX then why, in var x, y; you end up with var x; var y; being actually evaluated?
But why would you want to mix gradient with a full flat library ?
you wouldn't, that's why I mentioned it
Oh, got it.
@FlorianMargaine I'm not aware enough of how the syntax is parsed but I'd say they're interpreted as multiple arguments to your keyword in that case
@SwiX check the spec!
17:32
Or just keep telling people they are wrong. Either or. :)
@ssube wouldn't know where to seek, any pointer ?
@Luggage sorry if I offensed you, I don't think I ever said you were wrong about anything and if so that must've been poor expression on my part
s13.3 shows how the comma works and, while it mostly matches the comma operator, it does nothing in this case
so technically Luggage was right earlier
Quick question. Is there an idiomatic way to create an array that has X instances of the value Y? I could do result = []; for(i = 0; i < x; i+=1){result.push(y);};, but I'm interested in doing it with one statement.
@SwiX In that case, why doesn't var (x, y); work the same way?
In Python, we can do result = [y]*x but I don't think it works the same way here
17:34
Array(10).fill(y)
@ndugger yes, like home_benji_src_dashboard_app_css_file_23
I'm not offended, jst that I said "in a declaration" and then you proceeded to give me multiple examples of NOT in a declaration.
@rlemon Ok, thanks :-)
Just what people do...
@Kevin that's one of those helpers you write early and copy often
17:35
There are so many special cases where comma operators can be misleading that I suggest you just avoid them altogether.
They are a trap.
I would extend that to multi-declarations, unless you're doing simple variable-intensive math.
let a,b,c; <- fine imo
yea, that's not a comma operator. That's common.
That's just a delcaration list.
let a = this.getFoo(x), b = bar.bin(a); is not
but I would say let x = 3, y = 4, z = (2*x)+y; probably is
I never use a declaration list at all, but I'd accept @rlemon's version.
17:38
I avoid it
I use them for seriously math-heavy stuff
but sometimes cannot think of alternatives
@Luggage I wasn't meaning to counter what you said anyway x)
@SwiX No worries, we're cool. :)
@KendallFrey Wouldnt that be horribly confusing ?
@Luggage cheers
17:39
so, I have this pattern in my code a bunch to support named params: super(Object.assign({interp: CosineInterpolator}, options));
I don't like it one bit
@SwiX I don't know, just following the logical consequence of your argument.
is there a better way to default fields in the parameter object and then pass it all up?
defaults?
@Luggage that would make sense, wouldn't it
I mean, "are you just trying to apply defaults"?
17:41
@Luggage what else do you do without a declaration list?
oh, essentially yes, but the cloning might be behavior I want to keep
@jAndy I just mean , I don't do: var a, b; I do var a; var b;. That's al.
I'm not sure yet, since those objects are usually declared like new Foo({name: value})
ahhh...
anyway blasphemy :P
@Luggage for scope's sake, let's say I don't care about cloning, just want to add a property but allow the object to override it
I think just using a param default in super would be good enough (which I thought was your suggestion)
17:43
doing that is ONE STEP after comma-first declaration...
damn those guys
I wasn't making a suggestion at all.
@KendallFrey Err, I don't see the logical followup here
you don't c#?
@Luggage well then, your question solved the problem
ohh. how? :)
17:44
function foo({bar: 'baz'}) {
    console.log(bar); // 'baz'
}
foo({}); // 'baz'
foo({bar: 'qux'}); // 'qux'
this, @ssube? ^
var a = 'lol'
     ,b = 'how'
     ,c = 'can this be allowed?';
@SwiX If var x, y; is parsed as var - x, y - ;, then surely var (x, y); could be expected to be the same way.
@KendallFrey I was just saying they've got their semantic 'set / accumulation' meaning here as in "In my shakes I put watermellon, banana, mango" the same way they're in parens (I'm passing a, b, c to this func)
@jAndy that's ugly in multiple levels
@FlorianMargaine not quite
17:45
I really think its the devil who took some time to bring evil to JavaScript
var, comma first, chained declarations
you sadden me
@Luggage @FlorianMargaine rather than using super(Object.assign({interp: CosineInterpolator}, options)); in the child's ctor, I can use constructor(options) { const {interp = CosineInterpolator} = options; in the super's ctor
pretty sure my whole problem was putting responsibility in the wrong place
Rx.Observable.create is something like new Promise? to convert stuff like callback api, setTimeout, setInterval to an Observable (or in case of new Promise, to promises)?
Object.assign sucks
Object.assign is wonderful
17:46
class Base {
    constructor(options) {
        this.options = Object.assign({}, this.constructor.defaultOptions, options);
    }
}
class Child extends Base {
    constructor(options) {
        super(options);
    }
}
Child.defaultOptions = {
    interp: CosineInterpolator
};
@Srle very loosely, yes(-ish)
@KendallFrey Again either I'm especially dumb tonight or I have to work my communication on technical stuff <- self-taught programmer with no tech background and non native speaker ><
Just a thought
write your own extend function with Object.getOwnPropertyNames to also copy non-iterables
Object.assign won't do it, because it sucks
@Luggage the React props pattern, sorta, eh
17:46
even internet explorer 11 is being bad :(
@jAndy why would you want to copy those?
so Object.assign isn't a golden goose. it isn't bad because of that
use tools where they would be meant to be used
you shouldn't be copying class instances with assign, just POJSOs
@ssube in general I expect an extend function to fully copy the source
write your own Object.extend if you want deep cloning of those.
17:47
@jAndy but it's not extend
assign !== extend
and it's very clear about what it does
ya right
aaaaand you shouldn't be doing that anyway
people won't confuse that with extend functions
no way in hell that could possibly happen
17:48
so your argument is, in short, Object.assign is bad because it doesn't support poor practices
Object.assign(arr.find(comparitor), { prop: 'new value' }); // works like a fukin boss
what is the poor practice
Object.setPrototypeOf(options, defaultOptions); //not a serious suggestion
trying to clone an object with non-enumerable properties
General guidelines of what you shouldn't be doing.
17:49
if it's that complex, you shouldn't be using object-level cloning
I don't really see .assign as a clone
you should either have a copy constructor or a clone method on the object, since you obviously have some behavior or logic involved
it is doing exactly what it says, it's assigning new values
@rlemon it's used as a clone, commonly
a shallow one
Is like hammering with a plier, you could, but you shouldn't.
17:49
@rlemon you can easily argue that, since it isn't deep
var shallowClone = Object.assign({}, originalObject);
I have my own Object.extend I use for deep clones, so I suppose the 'confusion' never carried over to me
from day 1 I understood they are not the same
options = { ...defaultOptions, ...options }
assign was meant to handle only a single case, with the understanding that recursion exists and we all know loops, so depth was a non-issue
Object.create still confuses me, as I haven't used it much or at all
17:51
Object.create creates and instance with a specific prototype.
one sec.
but doesn't it do more than just that?
so does new Foo
something about mutability?
@rlemon not that I know of
yea, I'm grasping at a conversation I recall. but not fully
17:52
oh, you mean it takes extended props
Object.create(null) lets you create an object with no prototype, so even if someone were to fuck with Object.prototype your object will be clean.
again, I've avoided Object.create for the most part
as far as i know it only sets [prototype] of created object to object that you pass to ()
You don't normally 'need' it.
create takes a second argument with a list of properties
which I think is what @rlemon means
17:52
property descriptors, i thought, not values
in other words.. Object.create(null) creates a fully self-defining object
@Luggage yes and no, since a descriptor has a value :P
that's how class-wrapping and method-wrapping decorators work, they assign a wrapper function to the incoming descriptor's value slot
Object.create(null, {
    foo: {
        enumerable: true,
        get: () => "hello"
    },
    bar: { value: 'bar' }
});
which then bubbles out and magically replaces the original fn in the prototype
@rlemon think of it this way. Object.create() is a sugar-free way to create an object with a specific prototype, specific property configuration, etc
17:56
so it's good for your teeth
exactly.
Unlike Object.assign() which will USE setters, not make them.
const ChuckNorris = Object.create( null ); ChuckNorris.countingSkills = Object.create( Infinity.constructor );
ChuckNorris.canCountTo = Infinity * 2;
Chuck Norris is for sure a const.
right
@rlemon No. Chuck Norris should be a universalConst
18:00
should be, but we're in js
Hmmm
Chuck Norris doesn't care.
actually... universalConst should be Chuck Norris
@jAndy norris ChuckNorris = Object.create( null ); ChuckNorris.countingSkills = Object.create( Infinity.constructor );
ChuckNorris const = Object...
Hmmm chuckNorris no caps ;-)
18:04
@Neal norris ChuckNorris = norris.norris( norris ); norris.countingSkills = norris.norris( norris.constructor );
@jAndy 💥
@jAndy 🔥
@BenFortune 💧
remember the generous genius
@jAndy Remember remember the 5th of November.
18:06
@Neal ⚡️
@BenFortune 💀
@Neal 💡
when did @Raynos actually last showed up here?
@BenFortune 💥
@jAndy 3 years ago maybe?
@jAndy 4 years ago probably
18:07
Aaand we've come full circle. Let's make a game with those classes
Can search the logs, but I am too lazy
anybody knows what he is doing now?
I remember when Raynos and I were "competing" for rep in the good ol' days.
last I heard he was living in SF working out of coffee houses
The good ol' days!
18:08
Whoa. He answered something in March it seems stackoverflow.com/a/35882138/561731
He was here in 2014
Dec 27 '14 at 22:05, by Benjamin Gruenbaum
Oh wow, it's @Raynos, long time no seen - how's Uber?
wondering he didn't mention destructering
Last seen Nov 1 at 19:52
I was wondering who downvoted my answer there
why did SO switch to a bad font this morning?
What do you mean? Maybe I did not notice
rev 2016.11.15.4191? @ssube
chrome extensions => how do people communicate from the page to a background/content script? I want to put a button on the store to direct install gists -- but I need to access chrome.storage.sync
I can do that from content_script or background page
chrome.runtime.sendMessage(extensionId, obj);
doesn't error, but doesn't pickup in the background page
@Neal it's all thin and hard to read
18:18
@ssube Are you a part of the A/B test?
What version does it say you are on?
(bottom left corner of the site)
@rlemon hmmm?
mmmmh
do do do do do
@rlemon Looking at the API, are you using chrome.runtime.onMessageExternal.addListener?
18:20
no, chrome.runtime.onMessage.addListener
I'll add the other listener
@Neal the fucked one, obvs
@ssube ;-)
what are grand operations?
that attacker ticket change is good, I've gotten really good at holding points
18:35
I think operations = 40 players and grand = 64
not 100% though
oh, makes sense
also, fixing the Suez map, fuck yeah
Yeah, 2 new points :D
yay, cpu and dx12 optimizations
and quitting from the menus, omg
best update ever, I love it when they add the minimal basics
but srsly, that update looks dope
can edit your loadout from the main menu too
LMGs got a buff too
wait, rifle grenades are a thing?
Takes me back to CoD:WaW
yeah, rifle grenades are a pain in the ass when you're hanging out in bunkers or tanks
18:41
Never seen them or been killed by them 😐
it's not an underslung grenade, though, it's a grenade on a stick jammed in the end of a rifle
> Improved handling of network jitter, packet loss and packets arriving in the wrong order.
Wow
we had a prod outage once that was blamed on "network jitter"
turns out the devs were taking table-level locks in SQL and making REST calls while holding the locks
the "network jitter" happened when those calls failed and the lock was never released
Oh wow lol
18:56
gah
another fucking client problem I cannot solve. 😬 all are slightly different symptoms.
but I'm really getting nervous there is an underlying flaw in the entire system and everyone will crash
ever get those ?

« first day (2222 days earlier)      last day (2951 days later) »