« first day (1294 days earlier)      last day (3876 days later) » 

18:00
I just want when and catch I don't want your premium gold package
@SomeKittensUx2666 you can also use NODE_ENV=development it will automatically enable long stack traces
@adeneo That's pretty slick. Let me try that out.
@Esailija Nice, I'll just do that.
I already had that - but the stack traces were the same
Possibly unhandled TypeError: Property 'close' of object #<Object> is not a function
    at Object.<anonymous> (/modules/db.js:15:14)
    at Object.finallyHandler (/node_modules/bluebird/js/main/finally.js:63:31)
From previous event:
    at connectAsync (eval at makeNodePromisifiedEval (/node_modules/bluebird/js/main/promisify.js:198:12), <anonymous>:2:125)
    at Object.module.exports.getSubscribers (/modules/db.js:9:15)
    at app.get.proxy.web.target (/server.js:91:8)
    at callbacks (/node_modules/express/lib/router/index.js:164:37)
@Esailija ^^
@rlemon oh shit
you need .spread
not then
^^
18:03
Spread it on!
var Promise = require('bluebird');
Promise.longStackTraces();
var pg = require("pg");
Promise.promisifyAll(pg);
Promise.promisifyAll(pg.Client.prototype);

module.exports.getSubscribers = function() {
    return pg.connectAsync(connString).bind({}).spread(function(client, close) {
        this.close = close;
        return client.queryAsync('SELECT * FROM subscribers');
    }).finally(function() {
        this.close();
    });
};
@Esailija <3 bluebird
we're getting there :P
Possibly unhandled TypeError: expecting an array, a promise or a thenable
    at apiRejection (/node_modules/bluebird/js/main/errors_api_rejection.js:28:17)
    at Array.unpack (/node_modules/bluebird/js/main/map.js:33:12)
From previous event:
    at connectAsync (eval at makeNodePromisifiedEval (/node_modules/bluebird/js/main/promisify.js:198:12), <anonymous>:2:125)
    at Object.module.exports.getSubscribers (/modules/db.js:9:15)
    at app.get.proxy.web.target (/server.js:91:8)
    at callbacks (/node_modules/express/lib/router/index.js:164:37)
The error is where you use .map
do you use .map
18:07
My bad :<
in that export?
or on the returned promise?
somewhere
yes
No, where you call getSubscribers
#JavaScript programmers using Promises instead of plain old callbacks should proudly declare in their projects: "My code is promiscuous."
Someday I'll be funny :(
18:08
db.getSubscribers().map(function(item) {
    return portCheck.checkOpen(item.username).then(function(state) {
        return { username: item.username, state: state };
    });
}).then(function(arr) {
But not today
rlemon that means getSubscribers doesn't resolve to an array
@SimonSarris but callback hell sucks :(
have you checked pg docs for what query returns?
18:09
yea an object.
okay I see where we are going here.
ok so you want
the results array is on res.rows
module.exports.getSubscribers = function() {
    return pg.connectAsync(connString).bind({}).spread(function(client, close) {
        this.close = close;
        return client.queryAsync('SELECT * FROM subscribers');
    }).get("rows").finally(function() {
        this.close();
    }):
};
and keep the client code the same
or if you hate strings, do return result.rows somewhere manually
=D
@RUJordan imo plain old callbacks are better in most (but not all) cases, because they force you to NOT do things like chaining
@Esailija I love strings! and I love you!
srsly. pinged him on Twitter and he was here within 30 minutes.
what a great guy
18:11
I'm still not convinced on promises.
though sometimes you have to
Seem like more overhead than callbacks. Error handling is nice
the point is really automatic error propagation
example of chaining solved by promises:
// NO PROMISES
Parse.User.logIn("user", "pass", {
  success: function(user) {
    query.find({
      success: function(results) {
        results[0].save({ key: value }, {
          success: function(result) {
            // the object was saved.
          }
        });
      }
    });
  }
});
FUCK YISSS!!!!!
WORKS!!!!!!!
18:12
// AVEC PROMISES
Parse.User.logIn("user", "pass").then(function(user) {
  return query.find();
}).then(function(results) {
  return results[0].save({ key: value });
}).then(function(result) {
  // the object was saved.
});
<3 @Esailija
PROMISES ARE MAGIC IF YOU DONT LIKE IT THAN YOURE SILLY
:P
fuck. I have a typo that I can't edit now. That's going to bother me
@SimonSarris the former requires manual error propagation
you couldn't realisitically write the former
it needs to propagate errors to caller
otherwise you are swallowing them
pff who passes on errors
its 2014
we dont move fast, we move fast and break things!
#stevejobs4lyfe
#sloganoftheday
18:15
however not all promise code is created equal of course
So you're in the creationist camp of promises.
I'm a vegetarian.
"Move fast and break things" was actually Zuck
Did the guy get the point of promises?
no
otherwise his examples would contain error handling
:D
fl
@FlorianMargaine here is a textbook example news.ycombinator.com/item?id=7675872
18:18
I was lifting from: blog.parse.com/2013/01/29/…
(check the parent, he doesn't understand promises cos he is swallowing errors)
well if anyone is bored. I'm curious how to write this without promises
app.get('/foo', function(req, res ){
	db.getSubscribers().map(function(item) {
	    return portCheck.checkOpen(item.username).then(function(state) {
	        return { username: item.username, state: state };
	    });
	}).then(function(arr) {
	    res.render('register.ejs', { subscribers: arr });
	});
});
Meanwhile in florida...
user image
2
And now we all know when the gators take over chain link fences wont do shit.
#themoreyouknow
Love that episode
Love that whole show
And I'm not entirely sure why
...GATOR?!
Random quote of the day: "I may be wrong, so please be gentle with downvotes."
What show is that?
18:26
!!install opera or don't
@RyanKinal don't
Archer?
@BryanRoth ^
@KendallFrey Yeah, push that downvote in slooowly. Yeah, just like that
c'mon, that's not flag worthy
18:28
^
user1596138
It's weird... But not flag worthy
Want to see something flag worthy? I'll give you a nice, good flag asking message if there's another false positive like that.
...that got flagged?
Slowness isn't offensive. It's just mildly amusing in children.
Flags. >.<
18:29
@SomeKittensUx2666 It did :(
@Sim Welcome to the JavaScript chat! Please review the room pseudo-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.
@CapricaSix huh
Yeesh. It's a half-entendre at best.
> Seriously Lana, call Kenny Rogers cause you're in the danger zone.
18:31
Man I gotta rewatch Archer
@RUJordan ... the... zone... of danger?
@Zirak I rewatch Archer all the time. I use it as background noise.
It's the best.
> Oh thank god you're not a crocodile.
Would a crocodile be riding a 4-wheeler..?
No but now that you mention it imagine how scary that would be!
hahaha
I remember the shock after watching the first episode
Throughout it, I didn't know whether to laugh or feel disgusted
Giving in to the filth felt good
I know, right?
All the characters are so... unlikable.
They're just horrible people.
And yet I love it.
Unlikable? Kriger and Archer are totally lovable!
18:41
Duchess...I forgot all about it
:tear:
OMG KAZAK!!!
She loved that dog
That was the most erotic picture I've seen
Will you please be careful? :puts on mustache: ...No.
18:44
New computer requires that I press the fn key to get to Home and End... this may be a problem.
Sorry, Archer is probably my favorite show.
No worries ;-)
@RyanKinal burn it, call it a day, and get a new one.
@RUJordan DEAL BREAKER
lolol
18:48
@RyanKinal external keyboard
Yeah, I mostly use one. But only if I'm at the office. I've I'm working from anywhere else, I use the built-in
And the amount I use Home and End would surprise a lot of people...
yeah, it's not practical to drag around an external
start of line end of line
They're important keys!
!!youtube archer butterfly effect
last one I promise
18:50
hi guys :-)
@SimonSarris o/
... my antivirus is telling me that the FileZilla installer is unsafe -_-
It's probably cyborg crocodiles
Well. It seems this will prevent me from installing FileZilla. Time for a different ftp client.
18:53
haxing your system
speaking of cyber and ftp, cyberduck is good
user1596138
@RUJordan Eww oh god
user1596138
It just crashes. All the time.
user1596138
On all 4 machines here
Really? Never for me
Ooh, S3...
user1596138
18:55
It was like that when I got here and I don't feel like playing IT boy, I have better things to do.
user1596138
Finder has built in read-only FTP. Because that's useful right? lol
I always feel really bad for Carol/Cheryl/whatever. And then I think about how she's a whore. And I still feel bad.
She's one of my favorites. For whatever terrible, dark, what-the-hell-am-I-thinking reason.
@Loktar how good is cacoon js ?
umm amazing.
there is one drawback
you have to submit the code for it to be compiled
their servers do it
19:02
anyone with angular.js experience?
in implementing CRUD operations against a REST api
A bit, yeah
@Shmiddty 95 on molehills :)
im having problems in updating objects at the backend taken from a factory
they are changed at the angular tier, but when the page is refreshed, the old data is load again without angular.js changes
any good tutorial out there or some advice?
19:06
Are you making your "update" request to the API?
(Whether that's POST or PUT or whatever)
Best thing about PHP: when somebody asks how to get the parameters from the URL.. you can respond like a boss. "GET it, bro!"
App.controller 'ReservaController', ['$scope','Reserva', ($scope, Reserva) ->
$scope.reservas = Reserva.query()

$scope.update1 = (reserva) ->
reserva.confirmada = true
reserva.$update(id: reserva.id)
]
What is Reserva?
@RyanKinal some service i guess that he made
ps i hate coffee script for angular
it just looks ugh
"some service" doesn't help me much
19:10
What sort of advice are you expecting? You have the algorithm, try and implement it. Then, when you have some code you're stuck on, and google's ENTIRE first page has yielded nothing.. try page 2. Then bing it, THEN we'll be able to better help you if you still can't get it. — RUJordan 1 min ago
This might be my best sarcastic-yet-helpful comment yet.
a javascript pure would be

App.controller("ReservaController", function($scope, Reserva){

});
@RyanKinal angular js has user defined services so he can create something there.
which can act as a service
now more on that
@AbhishekHingnikar I was wondering why I was reading a syntax error on the first line. Then I thought coffee.
@RUJordan I use filter_input for getting php vars
http://google.com/#q=Angular%20Service
@AbhishekHingnikar yes. I'm aware.
19:11
filter_input( INPUT_GET, 'datvar' );
@Loktar what is that magic you speaketh of..eth?
But what the service does is a different thing entirely
@rlemon , @Octavien linux / ubuntu goodies pls.
@RUJordan I just found out about it when working on pxly
aka productivity tools like
19:11
$_GET['ImNotGoodEnoughForLoktar']
it sanitizes
like alfred on mac ?
Oh
$_GET, you've been replaced. Sorry brah
jk I barely use PHP anymore xD
19:12
er you can sanitize it anyway, its pretty cool imo
@RUJordan haha same here thats why i re lookup all the commands
because with PHP there is probably something new/better
Like NodeJS
haha yea
Can you tell I haven't slept in 2 days?
I get a bit loopy when I'm exhausted.
why?
dude go get some sleep!
A cough. :(
lol I will, I'm at work!
19:14
ah lame
Yeah I hate it when being sick keeps you from sleeping
@RUJordan I don't get it
@RUJordan i know your feel bro
the callback literally says callback and the guy missed it
i didn't sleep for 3 days at the microsoft camp
haven't had much sleep since past 7 [just 2-3 hours max]
get some Red-bull it will help :P
19:19
@RUJordan ... callback is an argument to removeTable
@RyanKinal a factory
ElGavilan deleted his comment
I assume RUJordan's talking about that comment
@JuanAndresRodriguez Okay, and what does the factory return?
@RyanKinal I know, but the guy was like "wheres the callback?"
Ohhhh
19:19
lol I didn't see he deleted it
Questions gone now too
God I hate coffeescript
!!doge urge to regex
     wow
such urge to regex
Is there a method you can call on a modal to adjust it's height and width according to its inner content? I already have the height and width attribute set to 'auto'. The modal has a modal within it that grows after the parent modal is created.
s/coffeescript/RUJordan/
(jk jk)
19:23
>=|
Well played.
s/hate/love/
It's true!
I've also decided that I hate Ruby
I know, I just wanted to hear you say it!
Or, at least, Rails
I was literally just working with grails
And I was like... wtf is this
I've never done anything with Ruby, Rails, Grails. But just looking at the code makes my head hurt
19:26
.. I just told my boss "gonna git it" and I'm not sure how I feel about that.
Oh man, when we started using mercurial around here, it was hilarious
"Don't force multiple heads when you push"
"You want to be working with the tip"
Just the tip
Only the tip
@RyanKinal Having done some things in Ruby and not being happy about it, I can describe programming in it as feeling...mushy. It's like you're programming in chowder.
That's my favorite game
It is also Archer's but that's unrelated
19:29
@Zirak That's the feeling I get from coffeescript too
@RUJordan PHRASING
Imagine you're just floating about in a giant bowl of chowder, when a keyboard appears before you and you start typing. That's what Ruby feels like. And by extension, Coffeescript.
I have tears I'm trying so hard not to laugh out loud
@nderscore Nice! jerk.
for in loop inside a for loop. counting the peaks /\ \/
My boss just sent me a link that made me very proud yet sad. A website I made for work was written about on reddit, but it's about sexual assault so the comments are devastating :(
19:38
@RUJordan Uh, your meme is clipping off
Yeah I'm too lazy to fix it but the message is clear
Help me decide. I have a kickass greatsword, but there's this other greatsword that looks soooo good
Equipped:
Strong Iron Greatsword of Bloodlust
  Strength: 280-310
  +34 Power
  +24 Precision

  Minor Sigil of Bloodlust
    Gain a charge of +5 power each time you kill a foe, five if you kill an enemy player.

Contender:
Horned Iron Greatsword of Water
  Strength: 287-318
  +35 Power
  +35 Ferocity

  Minor Sigil of Water
    10% Chance on Hit: Heal nearby allies around your target.
DECIDE
@Milson Welcome to the JavaScript chat! Please review the room pseudo-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.
h
Hi
I got one issue with format
date
@Milson Which one should I pick? The Strong of Bloodlust one, or Horned of Water?
19:42
I am using MSSQL and it returns
date with AM/PM
@Zirak bloodlust sounds better
u should pick Bloodlust
But dat heal
but dat power
On second thought, fuck other players. When I'm in a party I go for shield anyway.
19:43
great
"DateValue":"1/1/1970 12:00:00 AM"
atta boy
"DateValue":"01/05/2014 12:00:00 ص"
suggest me how to convert it
formatDate(new Date(item.DateValue), "yyyy/MM/dd")
ooohhh, and on extracting I got the sigil of water! I can imbue it in something else!
19:44
@Zirak What game is that from?
Guild Wars 2
so any independent of Language set it can return correct value
If you want the largest compat to date, go for ISO-8601
Other than that, I think browsers can deal with your format (other than the ص char)
@AlexandreVicenzi Welcome to the JavaScript chat! Please review the room pseudo-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.
OH YEAH
Strong Iron Greatsword of Bloodlust
  Strength: 280-310
  +34 Power
  +24 Precision

  Minor Sigil of Bloodlust
    Gain a charge of +5 power each time you kill a foe, five if you kill an enemy player.

  Minor Sigil of Water
    10% Chance on Hit: Heal nearby allies around your target.
WIN
...I just realized 10% is less than my crit rate
19:50
Is GW free?
Nah, but you just have to buy it once (unlike...other...MMOs)
^
it has the best pricing model out of all of them imo anyway
pay once play forever
I feel so awesome that...
user image
2
Looks like he has a damn potato stuck in his neck
@Loktar cacoonjs has webgl !
19:55
yea
its pretty badass @AbhishekHingnikar
@RUJordan LOL

« first day (1294 days earlier)      last day (3876 days later) »