« first day (1642 days earlier)      last day (3309 days later) » 

9:00 PM
@copy me?
 
class Foo {
    get bar() { return this.bar; }
    set bar(bar) { this.bar = bar; }
    static whatWhat() {
        this.bar = "hello world";
        console.log(this.bar);
    }
}
I don't think getters and setters are particularilly ES6, though
They're cool, though
 
no static plz
 
@BenjaminGruenbaum Yeah
 
static all the moethodz
 
@copy how'd you write it?
 
user2620028
9:02 PM
i have been focused on learning php, unit testing, git , sql. I haven't JS'ed in quite a while to be honest
 
@BenjaminGruenbaum compose(Object.fromKeyValuePairs, [].map)
 
do people still learn PHP? I thought it had gone the way of the Latin dodo.
 
@copy That's a reduce specific to constructing objects, instead of a reduce which works towards a single value. If you mean to call something after that though, then it's cool.
 
s/dodo/dil... you know where this is going
 
@copy that's require having Object.fromKeyValuePairs, which'd look very similar to the method I already have
 
9:03 PM
Array.prototype.objectify = function (cb, init) {
  return this.reduce((prev, cur) => {
    cb(prev, cur);
    return prev;
  }, {});
}

console.log([1, 2, 3].objectify((p, c) => { p[c] = c + 1; }));
 
@Zirak I know, it's a response to @ssube's suggestion
"sensibleReduce"
 
!!afk goodbye cruel world.
 
user2620028
Yeah I am attempting to learn PHP although the references online are crap. Code examples are crap. And to be honest the php chat room on SO tends to be very harsh to any questions from non regulars.
 
is there anything that has the same behavior but already exists?
 
Also, why are you writing it as compose(x,y)? Do you really find that easier to read than t => x(y(t))?
 
9:04 PM
@ssube yeah, reduce
 
@HatterisMad just use w3schools
 
user2620028
@NickDugger stop promoting your product in our chatroom please.
 
Also, you'd reduce to assign
 
@HatterisMad w3schools is best pls
 
let keyVal = x => ({[x.userId] : x.score});
let res = myStuff.map(keyVal).reduce(Object.assign, {})
 
user2620028
9:06 PM
Can we forever save him saying this and just remind him occasionally that he said this on a public forum?
 
@BenjaminGruenbaum No, that's better
 
@BenjaminGruenbaum ok, that's pretty nice
 
there we go.
 
We don't call them lambdas, here. That's racist.
 
although, what happens if you need to add the values in a key?
assign falls down there
 
9:07 PM
What do you mean?
 
user2620028
Ok i will bite. How is that racist?
 
[{id: 1, score: 2}, {id: 1, score: 3}].objectify((p, c) => { p[c.id] += c.score; })
 
What if score is undefined?
This is just a bunch of NaNs (also missing initial value)
 
@ssube racism AND objectification!
 
somem like that
 
user2620028
9:08 PM
@somekittens i was waiting for that lol
 
@ssube make an example that works and I'll bite
 
In other news, has anyone here built a chrome extension that had to communicate with the page via Shared DOM? I'd like to pick your brain.
 
hangouts anyone?
 
@SomeKittens I just ended up injecting into the page and communicating via postMessages
 
user2620028
We have itachiUchiha and SecondRikudo in chat.... any other naruto fans hanging around?
 
9:10 PM
Array.prototype.objectify = function (cb, init) {
  return this.reduce((prev, cur) => {
    cb(prev, cur);
    return prev;
  }, {});
}

let teamScores = [{user: 1, team: 1, score: 2}, {user: 2, team: 1, score: 3}].objectify((p, c) => {
  p[c.team] = (p[c.team] || 0) + c.score;
});

console.log(teamScores);
@BenjaminGruenbaum like that
 
You want group I guess
 
@Zirak Define "injecting into the page"?
 
user2620028
Well guys i think i am going to head to sleep. It is 4 am afterall. Night everyone
 
@BenjaminGruenbaum doesn't exist in ES6, does it?
 
9:12 PM
group [] = []
group (x:xs) = grouper [[x]] xs
    where grouper l [] = l
              grouper ((y:ys):rest) (x:xs)
                   | y == x = grouper (x:y:ys):rest xs
                   | y /= x = grouper [x]:(y:ys):rest xs
 
@Zirak er, sorry. I mean how did the script then communicate?
 
Probably worse implementation ever and also incorrect. Now to write it without pattern matching
Wait, it would have been so much easier to explain what it does:
 
@BenjaminGruenbaum it may be an earlier design flaw, but I've had a fair number of times where I needed reduce that sort of grouped and sort of assigned and was going to return the same object repeatedly
 
@ssube group takes something like [1,1,2,2,3,3,3,3] and returns [[1,1],[2,2],[3,3,3,3]]
 
it's possible to map -> group -> forEach(reduce), but it gets tricky
or maybe group -> map(reduce)
 
9:13 PM
Room challenge, write group in JavaScript, group takes a list and groups sequential equal elements.
 
@BenjaminGruenbaum [1,2,1] what do?
sequential, ah
 
@KendallFrey [[1],[2],[1]]
 
@SomeKittens postMessages all day long. Have an example of that in switcheroo: github.com/Zirak/switcheroo/blob/master/src/content/… opens a connection to github.com/Zirak/switcheroo/blob/master/src/background.js#L13
 
@Zirak Didn't think you could postMessage like that
 
@BenjaminGruenbaum Better, still boring
 
9:15 PM
@Zirak ur boring
 
@Zirak thanks, looks like exactly what I need
 
@SomeKittens Enjoy
 
I'm missing ()s in my group btw in like 3 places.
 
9:18 PM
Can anybody help me figure out why ng-table isn't seeing this data returned from an Angular $q promise? If i hardcode data instead of using an API, it works just fine.
ips.ngtableVlans = tableService.getVlans().$promise
                .then(function(data) {
                    if (data.items) {
                        var arr = [],
                        names = [];
                        angular.forEach(data.items, function(item){
                        if (inArray(item.vlan, arr) === -1) {
                            arr.push(item.vlan);
                            names.push({
                                'id': item.vlan,
                                'title': item.vlan
I can see the 'names' array populated in my console log :|
 
function group(list) {
  let l = undefined, r = [], w = [];
  for (let f of list) {
    if (l === undefined || f === l) {
      w.push(f);
    } else {
      r.push(w);
      w = [f];
    }
    l = f;
  }
  r.push(w);
  return r;
}

console.log(group([1, 1, 2, 2, 1, 3, 3]));
@BenjaminGruenbaum howsat?
 
lulz
function groupSeq (arr) {
    return arr.reduce(function (ret, item) {
        if (!'lastItem' in ret || ret.lastItem !== item) {
            ret.lastItem = item;
            ret.last = [item];
            ret.res.push(ret.last);
        }
        else if (item === ret.lastItem) {
            ret.last.push(item);
        }

        return ret;
    }, {res: [], last: []}).res;
}
 
@SterlingArcher !!subscribe /r/sterlingarchersfaveredditposts
 
@ssube group([]) is []
 
@taco not sure what that means lol
 
9:22 PM
@SterlingArcher did you see that he killed a guy?
 
nah I didn't read far. just lol'd that he hid a gun in his butt
 
function group(list) {
  let l = undefined, r = [], w = [];
  for (let f of list) {
    if (l === undefined || f === l) {
      w.push(f);
    } else {
      r.push(w);
      w = [f];
    }
    l = f;
  }
  if (w.length) { r.push(w); }
  return r;
}
 
hello
@BenjaminGruenbaum lol
 
@SterlingArcher You're better than a Reddit RSS feed. It'd save me time if you were a Reddit bot
 
New room challenge: Create a JS challenge so generic, even this room won't complete it.
 
9:24 PM
lmao
 
user2620028
@taco yeah no shit lol
 
function group (arr) {
  if (!arr.length) return [];
  var grouped = [[arr[0]]], lastIndex = 0;
  for (var i = 1; i < arr.length; i++) {
    if (arr[i] === arr[i-1]) {
      grouped[lastIndex].push(arr[i]);
    }
    else {
      grouped[++lastIndex] = [arr[i]];
    }
  }
  return grouped;
}
 
Live tweetin son
 
@Zirak best you got?
 
use some for loops pls
@BenjaminGruenbaum ^^
 
9:24 PM
@SterlingArcher you should make a living picking the best reddit content and curating it. I believe they call it "blogging"
 
@HatterisMad oh hey, what's up lady boy lover. How's Thailand lol
 
@BenjaminGruenbaum No. Just wanted to abuse reduce
 
@AwalGarg lol ++lastIndex :D
 
user2620028
@taco just got done with the songkran 2015 new years celebration. Don't google not always work safe lol
 
I don't blog D:
 
user2620028
9:25 PM
@taco whats going on with you hillbilly?
 
@HatterisMad I kinda figuired lol. happy new years I guess
 
In ES7 when JS destructuring can pattern match I'll be a happy man
 
@BenjaminGruenbaum lastIndex? Not lol at the for loop?
 
@HatterisMad I'm not a hillbilly!
 
user2620028
@taco im not a ladyboy lover
 
9:25 PM
I was the turkey all along
 
@HatterisMad I'm actually in a Starbucks. This is the whitest I've been in a long time. I'm surrounded by suburbanites
 
@Zirak it was me!
 
@Zirak WHAT
YOU LIED TO ME
we had sex and everything... *sob*
 
user2620028
@taco eww... make sure to let them know you don't frequent there by calling the venti a large instead
 
@Zirak gobble, gobble, gobble
 
9:27 PM
@KendallFrey you knew he was a turkey by then
 
@ssube you know enough about Angular $q to help with my issue? Maybe I should just print out my data or something.... maybe it's just ng-table being poop
 
user2620028
holy crap what is going on in chat around me lol
 
but you still love the little tacos
 
user2620028
alright night night guys (again) this time for realsies
 
@ssube let's just say I had my eyes shut for most of it
 
9:27 PM
night @HatterisMad guard your butthole
 
user2620028
@taco how do i even respond to that?!
 
my lady friend has a set of earrings from a long time ago that she never wears -- still undecided if I should encourage it or not -- that have gir and "I love the little tacos" on them
 
> ~127k people reached
 
user2620028
@taco i will sleep safe knowing you don't have a plane ticket over here lol
 
@KendallFrey is done with @Zirak it seems, he might sleep with you @HatterisMad
 
9:28 PM
@taco superglue makes a good anti-rape solution
 
^
 
wth is that number?
 
or stuff a gun up your butt
 
@HatterisMad but I do muahahaha
ok, wrong country, but right continent
 
user2620028
@KendallFrey I have plenty of ladyboy neighbors that you can stop off at
 
9:29 PM
Or stick Ant man up your butt
@HatterisMad I bet you do
 
1
A: Knockout Validation - Validation not binding to correct instance of object

Jeff MercadoThe validation is fine... your edit section has problems. Use the with binding. Never use someObservable().someObservableProperty in a binding, it will not work like you might expect it. You should change the binding context. <div id="editSection" data-bind="with: selectedItem"> <div> ...

 
@HatterisMad fo realz good night man
 
look at the answer and the comments, kind of weird
 
user2620028
I actually have like 3 ladyboy neighbors. not sure if that is coincidence or not
 
this is a crosspost from the webdesign room
 
9:33 PM
Okay, well, I tried printing out my $scope.ngtableVlans as {{ips.ngtableVlans}} and it doesn't print the array, so something must be wrong with the way I'm returning the array
 
530 rep to go
 
that's a lot of reps, what are you using, a tennis ball?
 
golf ball actually
 
@phenomnomnominal Ouch man. That's harsh.
 
9:35 PM
Is there a way to see how many people reached me? As in how many people did I get help from?
@BenjaminGruenbaum ^
meta people^
 
@AwalGarg no idea, sorry.
 
@darkyen00 ping
or anyone here... what's the service to have a temporary localhost available on the web?
 
@FlorianMargaine kites
or something. don't remember the exact name.
 
that's it
thanks
 
9:39 PM
@FlorianMargaine interesting
 
np
 
@FlorianMargaine why would you want to do that? For temporary app staging?
 
@taco I use it to serve from VMs to host. pretty cool.
 
@taco when you want to test external services like payment solutions that have to come back later to you
without having a staging server... easier for development
 
actually I only used it once :/
 
9:42 PM
@AwalGarg ah ok, so spin up a VM and use that service, interesting
 
yep
then we have port forwarding too which is quite simple to do </sarcasm>
 
How is that different than just poking a hole through your router firewall? Since it tunnels it "automagically works" I guess?
 
Sorry boss but you cant handle my commits
 
sup folks
 
it is just a glorified robust solution and a way to get pretty urls temporarily.
 
9:44 PM
Maybe because I was a Sys Admin I find the Kite service useless?
 
plenty other ways to do it, it is one.
 
ok
 
@taco no need to mess with dyndns or w/e
 
I have 50 points in the tag pass-by-reference, 10% of Jon Skeet. Gonna brag about it every now and then.
 
@FlorianMargaine got ya. It makes sense. No fuss
 
9:47 PM
nice new profiles, cool stuff.
 
What is the ugliest way you can think of to put one html element on top of the other, in other words, what alternatives are there to z-index
 
@taco gets you around NAT, which is nice for 99% of the world
I hate networking, it's so arbitrary and confusing :P
 
I'm trying to fix some god awful code, and two elements are on the wrong z order, and none of them have z-index applied
I'm really trying to think outside of the box, but I really can't imagine how he achieved this
 
@Trufa blame z germans
 
9:51 PM
@taco lol
@taco I used to live on austria, the z makes me nostilgic
 
@FlorianMargaine I tried out koding.com yesterday. Seems cool. Here's the temp host it setup for me. It can't be used as a webserver as it shuts down once after you're done cloud coding for the day ufkkc0e02822.funkytaco.koding.io/index.html
 
@taco yeah no it's for local development
 
@taco wait, you are a sys admin?
 
@AwalGarg, I was until I became a software dev a couple years ago
 
oh. ok.
 
9:56 PM
I was a sysadmin too for 3 years
 
@taco good career move
I was an IT flunky in high school
 
(which is why I know about networks btw)
 
helped out the school's IT guy, and got blamed for most of the problems initiated by other students
hence why I gave up and went software dev
 
Before that, I was a DCO Tech, network eng, ADSL/Cable/Broadband phone support, and IT/Telecom in the Army
jack of all trades, master of none :|
 
Cept tacos
 
9:57 PM
yes, funky tacos
 
when Ops breaks things, everyone shouts at them and they get to call the vendor.
When devs break things, we just laugh about how a test failed.
Or sometimes prod goes down and we have to scurry around blaming Ops for a bit.
 
When clients break things, blame qa
 
these are kinda painful
 
We ask them to prove Dev broke it :d
 
10:00 PM
XD
 
 
> This just proves programmers will argue about anything no matter how trivial and bloggers will write about anything no matter how irrelevant. (from the comments)
 
@AwalGarg No, we don't. Only things that matter.
 
@ssube ikr :P
 
Spaces matter because tabs fail lint.
 
10:06 PM
you're all fooling yourself.
 
listing through socket.io documentation (v. 0.9.17) i can't find way to retrieve information on which namespace socket is connected
 
Someone with access to the build servers didn't set the tools to require spaces.
 
when I hit the ctrl key I don't expect 4 shifts, why do you expect N spaces when you hit tab?
@Srle I never checked.
I just managed them
 
I have the ultimate solution to the tabs vs spaces battle: stop indenting your code.
 
if we stop indenting code, we'll also have to stop reading code
 
10:07 PM
23 hours ago, by Rooster
jquery is javascript
 
everything will become write-once, write-again
 
MLM
@SterlingArcher SpaceX barge landing from yesterday: youtube.com/watch?v=BhMSzC1crr0
 
^had somebody remind me that jquery is javascript yesterday..... lol....
 
Let us then create a new character for indentation: the indent character. Use it by pressing the tab key.
 
@AwalGarg no, that breaks everything again
how big is the indent character? how do things line up when indented? is it smart or do you use multiple indents?
 
10:09 PM
	app.io.of('/foo').on('connection', function(socket) {
		socket.emit('connected', ' to foo ');
	});
	app.io.of('/bar').on('connection', function(socket) {
		socket.emit('connected', ' to bar ');
	});
 
if we had smart indent characters that were a combined newline/tab, that would be sweet
 
does this make sense @Srle ?
 
then your style rules would just work, regardless of the code
 
@ssube that's what I meant, duh.
 
10:10 PM
I like the new SO profiles. Nifty
 
i'm still trying to get used to them :/
 
I like pretty much all the change on SO since pretty much everything is broken in some way :/
 
I'm in the top 24% this quarter on SO.... that can't be right. I barely do anything on SO
 
@rlemon, yes definitely nice idea.
 
I am asking the same thing to me @taco
and I don't see how I reached 125k people :/
 
10:12 PM
@rlemon, dont know the reason why i can't fetch this information from socket object.
 
why would you need to
you connect to the server on /foo or /bar
 
tis quite fancy
 
@AwalGarg 125k search engine bots, mb
 
the new so profiles
 
How do I check the length of a string with regex?
 
10:13 PM
you don't?
 
they demo'd them on meta a while ago, but my meta account has nothing
 
string.length
 
string.length
 
string.length
 
that doesn't check the length through regex
 
10:13 PM
hey! I finally knew an answer @rlemon >:/
 
@rlemon Task is to sort out any string that's shorter than 6 chars WITH regex.
 
;P
 
@StevensHaen well now that is a whole new question
 
@Rooster I'm gonna murder you with nerf bullets some day
 
"how do I match any word 6 chars with regexp"
 
10:14 PM
!!> "abc".match(/[\s\S]/g).length
 
@AwalGarg 3
 
its like {6} or something if I remember
 
@Rooster ^ happy?
 
4
Q: Regex to match words of a certain length.

Anand HemmigeI would like to know the regex to match words such that the words have a maximum length. for eg, if a word is of maximum 10 characters in length, I would like the regex to match, but if the length exceeds 10, then the regex should not match. I tried ^(\w{10})$ but that brings me matches...

 
i am pretty happy today
I've just finished refactoring this big script to remove all the jquery and replace it with vanilla js
 
10:15 PM
!!> "foo bar this is not all going to match".match(/\w{3}\B/g);
 
@rlemon ["foo"]
@rlemon ["foo","bar","his","not","all","ing","tch"]
 
I was imagining the terminator music playing in my head as I replaced the last few lines
 
??
 
:?
 
/^\w{0,6}$/
 
10:16 PM
why didn't /b work?
 
@rlemon ["thi","goi","mat"]
 
!!> "foo bar this is not all going to match".match(/\b\w{3}\b/g);
 
@rlemon ["foo","bar","not","all"]
 
@rlemon, lets say i have rooms 'A', 'B' and 'C' on namespace 'X'. Based on user action (click somewhere) he enters the room, i want to avoid socket.join('A') if user is already in that room. In 0.9.17 you can fetch all rooms where user is connected to via object which has form 'namespace/room' (in example 'X/A'), so first idea is to see if(obj['X/A']) is undefined
 
@Rooster That didn't make much sense. Maybe you meant: hi, ah, d, π
 
MLM
10:17 PM
@StevensHaen ^(.{6})$: debuggex.com/r/E_3N8UbaCXOWiRYZ
 
!!hi
 
@Rooster Hello
 
@Srle ahh yea, I've never gotten into the rooms bit
never needed too
namespaces were good enough for me :P
!!> "why are all of us trying to solve what could be homework?".replace(/\b\w{1,5}\b/g, "");
 
@rlemon " trying homework?"
 
well who doesn't love a good regex problem
someone should solve it with a sed javascript regex library, lol
or awk
because whyyyy not
 
10:21 PM
do it in REBEL
regexp in regexp
IN REGEXP
mind blown
 
hehe
 
Hey-o
 
this election is slowly becoming interesting. Matt is gaining votes just fast enough to pass Jon Clements before the end of the primaries. Second could as well, if his score was growing a bit quicker.
The top 5 is pretty solid and 999 points ahead of #6.
 
I don't understand why second and unihedro are not in top 3 atleast :(
 
the top 10 will pass the primaries
 
10:23 PM
 
@AwalGarg because chat is only 100 people
 
What's the link to the votes again?
 
ohh
 
@FlorianMargaine there is something other than chat too? :P
 
10:24 PM
@AwalGarg I was also surprised Unihedro isn't doing better
 
the jason/undo battle has been intense
 
@FlorianMargaine if the real voting is similar, the top 2 will be the same, and 6 and down have no chance
 
they've been back and fourth all day
 
3-5 are the interesting ones
 
one user can make or break it. insane to think
they can downvote one and upvote the other
BOOM
ONE VOTE MATTERS PEOPLE!
 
10:25 PM
@MLM omg omg omg
 
REMEMBER THIS COME VOTING TIME
 
@rlemon 2 votes then. An up and a down. </pedant>
 
In the last 5ish hours, Second has been getting votes at +20/hour, Jon at +21/hour, and Matt at +25/hour or so. With a gap of 485, Matt could catch up in 39 hours or so, before voting ends.
 
doesn't matter in this stage anyway
as long as they are in the top ten
 
Second was gaining at +22 earlier and Jon at +20 or so, in which case Second could gain third in about 50 hours.
@rlemon I'm assuming the election will go similarly to the primaries, at least in broad strokes.
 
10:28 PM
I don't
we can up AND down vote here
and on as many users as are running
if everyone who upvoted A also downvoted B, but not vice versa then this could be a complete different outcome.
 
The top few candidates have all gotten 100-150 downvotes, though.
 
I say everyone in the top 5-6 are probably strong candidates for the top 3 come final stage
 
The lower five of the top ten have more like 300-500 downvotes
So < 5% DV in the top 5, > 10% DV in the lower 5.
 
undo has 179 or something
 
10:47 PM
@SterlingArcher
 
yay tax refund
 
:(
I gotta pay
 
lol
that happened to me a year or two ago
 
yea but I gotta pay a lot :(
not as much as @Loktar last year tho
 
10:52 PM
are we doing hangouts tonight
 
idk. I gave up on the idea
everyone else has lives
 
wonder what that's like
 
less reddit and video games, more social awkwardness
 
So I did bit of arithmetic based on Falcons TWR of 1.8 - when it enters the frame in the landing video it must be going more than 100mph.
those things are always bigger than they look
 
the barge is so tiny
it is all insanity that this will (hopefully) work
 
10:56 PM
they just need mechjeb
nails it, every time
 
the first time I saw a picture of the barge I was expecting like two aircraft carriers side by side. yea no. that thing isn't that big at all
 
So, I want to build a visual model of the component hierarchy in a react-based project. My first thought is that I'm going to need to parse every file, including render methods, to build this. Might someone have a better idea?
 
> So much so I’m referring to the git log to see what went in between the last dev blog and now.
that's my man Felipe
 
I don't think I am able to assume hierarchy through require statements, as some component files hold multiple components
 
> SAS Maneuver mode automatically disengages back to stability assist as dV nears zero.
genius
 

« first day (1642 days earlier)      last day (3309 days later) »