« first day (1539 days earlier)      last day (3412 days later) » 

10:00 PM
Also didn't know spaces were allowed in one time binding (that is {{ ::foo}} and not {{::foo}}) but that makes sense
@SomeKittens Does it work with a dummy filter that returns identity?
 
Still broken w/ 1.3.8
building a JSBin
 
user1596138
@RyanKinal FYI I still refer to your blog post on Objects and the Prototype regularly, nice read!
 
user1596138
I would get so lost if not for the sanity check
 
oh, thanks for reminding me, I still need to write up on my latest Adventures in Object Creation Land
 
Well, this is annoying.
It's cached.
 
10:09 PM
It looks like it's working
 
Yep
 
BTW a $timeout already schedules a digest
(Unless you pass it a second parameter indicating otherwise)
 
In what scope?
 
root scope
 
$rootScope.safeApply = function (cb) {
  if (cb) {
    applyCallbacks.push(cb);
  }
  $timeout(function () {
    $rootScope.$apply();
    applyCallbacks.forEach(function (cb) {
      cb();
    });
    applyCallbacks = [];
  });
};
Think a court will accept this as acceptable motive in an assault case?
 
10:12 PM
Eh, what's applyCallbacks?
 
@BenjaminGruenbaum urpdated
 
wat?
I don't even
I tried to kill the lambda in the forEach, so ugly :D :
[function(){ alert("HI"); }].map(Function.prototype.call.bind(Function.prototype.call))
 
You can rid of the .prototype
 
@SomeKittens to be fair safeApply and variants are very common in Angular - it's just the fact you really shouldn't be doing .apply yourself almost ever.
@Zirak yeah, I guess.
 
@BenjaminGruenbaum Right, because it starts at the rootScope and goes everywhere, as opposed to remaining in local scope?
 
10:18 PM
@SomeKittens because it beats the purpose of two way data binding - there are very few things you should do that won't be picked up by a digest cycle anyway.
 
explain?
 
Why would you need to call .apply?
 
In express, is it possible to jump to a specific route? (specifically an error?)
I want that certain types of problems to reach the 400 handler, and certain types to reach the 500 handler
 
@SecondRikudo on the server or through a redirect?
 
@BenjaminGruenbaum Server
 
like if (!asExpected(req.params.id) { fire400Error(); }
 
Wait, that's not helpful at all...
 
@BenjaminGruenbaum Because something's updated (say, data from server) and you want to update the page? (deliberately playing dumb here)
 
for each js in jss. do js
 
@SomeKittens yes, but you got the data from $http which takes care of the updates for you.
 
10:23 PM
@BenjaminGruenbaum Did I mention a previous iteration of this project didn't use $http?
 
@BenjaminGruenbaum No, it is
 
@SecondRikudo well, you can put the handler in a named function and then have the route accept that.
 
I can throw different types of errors
 
@SecondRikudo - You can set up routes with an error argument and use next to skip routes
 
m59
aarrrrgggggggg
 
10:23 PM
And then check the type of the error and calling next() appropriately
 
m59
running the same code in two different places and it doesn't work in one.
 
@SomeKittens in that case whatever was used should've been wrapped in a digest and only that.
 
@BenjaminGruenbaum Well, we use $http now, so that's handled.
 
@SomeKittens pretty much 99% IO the browsers do is DOM user interaction events, timers and XHR calls - all of those are already handled by Angular.
 
@BenjaminGruenbaum You're making a lot of sense - let me try and rephrase. One rarely needs to manually call apply/digest because one should be using Angular services (like $timeout and $http) that automagically call it.
 
10:27 PM
Yes, just like you'd use ng-click instead of adding a DOM click handler using element, take a function parameter and call .apply - it's just something the framework already solves for you.
 
@SecondRikudo - yes, next accepts an exception as an argument, which will take you to error handling. There's many examples online on how to do error handling that way
 
There are cases you might want to opt out of digests and handle the DOM or other stuff manually - but in most angular apps you don't really have enough performnace problems to justify that.
 
@BenjaminGruenbaum Lots of things just clicked - thanks!
 
Glad I could help :)
Also - you might want to read this on how promises schedule digests.
 
So there were cases we were triggering three cycles from rootScope when we only needed one.
@BenjaminGruenbaum Added it to our internal doc on Angular
 
10:31 PM
Cool :)
 
m59
Gosh my brain is wrecked. @BenjaminGruenbaum remember that express handler wrapper that deals with promises?
 
@m59 uhh... maybe?
 
Hmmm, who was it that had a small repo for a library to reliably extend Error types?
 
m59
usage is app.get('stuff', function() { return promiseyFn() } and then it responds according to the result or error if thrown
craziest thing....
var result = handler.apply(this, arguments);
Promise.resolve(result).then(function(result) {
  formatted = formatKeys(result, _s.camelize)
  // etc
 
Oh sure, I guess I recall that or something.
 
10:34 PM
@m59 Take a break and try to fix my problem.
 
user1596138
@HatterisMad hey I know this is odd but you know of any way I could possibly "guess" at the total volume of a cylinder head? I know I am able to ~calculate it using the compression ratio and total displacement of the engine but I really am trying to calculate that compression ratio right now so I don't have it.... SweptVolume / (compressionRatio - 1) is the calculation I mean that I already know I can do but I need to go backwards :?
 
m59
Well, that formatKeys works just fine, even using the same data that is in result
unless it's actually used right there, in which case it does nothing at all.
I just can't explain it.
 
get every number u have and play with them til it makes sense or get more numbers
 
m59
@SecondRikudo florian npmjs.com/package/newerror
 
@m59 Promise.resolve(result).then(function(result) { << Why?!
 
m59
10:35 PM
because it might or might not be a promise;
 
@SecondRikudo it's just function MyError(){}; MyError.prototype = Object.create(Error.prototype) or something like that.
 
m59
LOL, I'm now using semicolons instead of periods.
 
user1596138
I'm going to bank on parts.head = Engine.displacement * 0.09 because the initial model is my motorcycle and I know I have a 9.3:1 compression ratio
 
@BenjaminGruenbaum Yes, but there was a thing with names, and stack traces being cleared
 
user1596138
!!afk home time
 
10:37 PM
Yeah, that was I was looking for
Set the name, set the error stack
 
@m59 can't you just use a package or something? That was mainly a demo to give you an idea back then
 
m59
@BenjaminGruenbaum sure, but that doesn't seem to really be relevant. I mean.. if it works differently, state has to be involved, and I can't see how there can be state..
 
I don't understand your issue to be fair or what's not working
Try stepping through it with a debugger or creating a minimal isolated test case
 
Google removed some of their APIs recently, right?
 
They've deprecated a shitton, yeah
 
10:40 PM
@SecondRikudo why would that be better than a function declaration + set prototype to Error.prototype?
Name gets set implicitly anyway in a FD
 
An old Google Books integration I made no longer works
 
@BenjaminGruenbaum FD?
 
function declaration
 
m59
.then(function(thisObject) {
  console.log(thisObject); // snake_cased keys
  var formattedObject = formatKeys(thisObject, _s.camelize);
  console.log(formattedObject) // no change
});
 
> Make it work, make it work right, make it work fast
 
10:41 PM
function MyError(){}
MyError.prototype = Object.create(Error.prototype);

function foo(){ bar(); }
function bar(){ baz(); }
function baz(){ throw new MyError(); }
foo();
Works just fine @SecondRikudo
Shows stack trace and everything
 
m59
However, if I just make an object right there var obj = {foo_foo: 'stuff'}, the code works as expected.
hmmm....enumerable property issue, maybe
 
@m59 that's completely unrelated to promises.
your formatKeys function has a bug.
put that function on jsfiddle and create a working and non working case
 
Quiz - what happens if you set an object's proto to a function's proto ?
 
Awakens the Great Old Ones
 
10:47 PM
I'm too lazy to try, but I'm guessing nothing happens ?
 
The challenge is you get an object {} and you can do anything you want to it, but either you prove obj() doesn't work or make it work
 
What?
 
!!youtube well you're a nerd
 
@BenjaminGruenbaum IIRC, it'll run call ?
 
10:49 PM
It won't, the this won't be a function
 
That's close to what the spec says but no
 
Which is why I don't get the challenge
 
It will attempt to call the [[call]] internal slot, which won't be initialized.
 
You just have an object which has some function properties in its prototype chain. So what?
 
Make it a function, you may use any ES6 tool you'd like
 
batarang is borked anyway, prefer ng-inspector
 
@BenjaminGruenbaum Doesn't look like it has performance data
 
I can make it work for .call and .apply and all that stuff, but parentheses for call?
var f = function () { return 4; },
    o = Object.create(f);
// *magic*
console.log(o());
// ?
 
Yes, that is the task.
If you can get .call to work from the prototype you're very close anyway.
 
I don't think that's possible, but then again, I haven't delved into the ES6 spec too much
 
10:57 PM
Can't get it.
 
It's impossible in ES5 afaict
 
// If ~o~ in the global scope:
Object.defineProperty(window, 'o', {
    get: f
});
But that's cheating :P
 
This is beyond me, but can Proxy be used for something ?
 
Oh ES6 stuff, right
 
nah, you can only define [[Call]] for proxies if the original object is a function
Wait maybe that's the trickery
 
11:00 PM
I need to sort all that shit out this year haha
 
Oh that's a bit lame
 
mapper.fetch(request.params.id)
    .then(function (item) {
        response.json(item);
    })
    .catch(next);
Why isn't my only error route not being called in case of an error?
 
Well the spec says to check the internal slot, but...worth a try
 
This Google API breaking thing - what was deprecated? access without an API key?
 
I know there's an error because mapper.fetch contains only Promise.reject(new Error)
In the route list:
this.app = express();
this.app.use('/items', this.getRoute('items'));
this.app.use(function() {
    throw new HttpError(404, 'The resource you requested was not found.');
});
this.app.use(require(ROUTE_DIR + 'error'));
Those are all the routes defined
 
11:03 PM
crap, Proxy is not defined, guess someone forgot to turn on the new features in his browser
 
Happy New Year!
 
It's not proxies
 
pixies then ?
 
the 404 one doesn't work correctly either
My breakpoint is not getting hit, and the status code is the default 500
 
@BenjaminGruenbaum people.mozilla.org/~jorendorff/es6-draft.html#sec-reflect.apply ? Though I don't see it implemented anywhere yet
nah, IsCallable checks the internal slot
I don't see anything which says to grab the call or apply or whatever property, which makes sense - spec assumes nice functions
Maybe iterators/generators or some shit?
 
11:09 PM
Turns out error handlers cannot use the express Router object
 
@FlorianMargaine it should
 
Nah, it was just something mentioned in a discussion. About "protocols". But the only protocol related thing es6 introduces is iterator protocol.. Which is basically an interface.
Maybe someone smarter than I can do something with this: github.com/Gozala/protocol
@BenjaminGruenbaum ? ^
 
Wrong repo
 
Heh :)
Good night anyway, got 5h road trip tomorrow.
 
@FlorianMargaine good luck!
 
m59
11:20 PM
@BenjaminGruenbaum so, the only way I've been able to make it work is if I JSON.parse(JSON.stringify(theObject)). The object properties are enumerable and are on the object itself.. what the heck, right?
 
That's odd @FlorianMargaine I can't find it at the list
 
@BenjaminGruenbaum I hate you
Can't find jack shit
people.mozilla.org/~jorendorff/… runs through IsCallable, which as we've seen before checks for [[Call]]. If our object were to implement [[Call]], even typeof would say it's a function
 
> Also, does anyone notice the similarities between syntax in JQ and JS?
m(
 
@BenjaminGruenbaum I don't think it's possible
Unless...
Nope, not it
Unless...
 
-___-
Wait no what'
GAH FUCK YOU
 
m59
@BenjaminGruenbaum doh, figured it out, mostly.
However my object gets created internally doesn't pass the isPlainObject check in that formatKeys function.
 
@Jhawins any thoughts on the Honda Fit?
 
@NickDugger Jhawins is afk: home time
 
@BenjaminGruenbaum what's the current consensus on your poll?
 
@phenomnomnominal It's proved my assertion that there isn't one
 
I thought as much
I figure "having the word "senior" in their job title" is about the only reasonable answer
 

« first day (1539 days earlier)      last day (3412 days later) »