« first day (1595 days earlier)      last day (3356 days later) » 

5:00 PM
All of the answers I found for this question are dated. Anything come to mind as a better way of doing this?
@CapricaSix - Thank you.
 
hmm I feel like I should remove something now too :p
 
nvm, scrollTop does it.
 
(removed)
 
bleh whatever going to just use a for loop for now
too bad .fill only lets you do static values, that was my first thought
 
crl
 
5:04 PM
@Loktar [for (i of Array(thingtotal).keys()) i + something]
 
its not an array though @FlorianMargaine
just a number of things
 
user1596138
@Loktar What's bad about for loops
 
wait.. but I can just do for of thenumber it seems
 
@Loktar yeah, [for (i of Array(100).keys())] will return [0, 1, 2, 3, ... 99]
 
user1596138
@FlorianMargaine nasty lookin. Might be right but it looks like shit
 
5:06 PM
it looks like I can do for (let i of 10)
@FlorianMargaine your way is good to know as well
thats pretty cool
 
yo ho ho
 
@Loktar yeah, just learned it
 
@Jhawins eh idk I just see a lot of recommendations against
to try to use for of if you can instead
 
Array comprehensions are out of ES6
So you can't do that @Loktar and @FlorianMargaine
 
user1596138
5:08 PM
@Loktar for (i of 10) won't work..? Will it
 
user1596138
10 would need to be an array/object
 
bah it doesn't work
that page said it would. Bastards.
 
user1596138
for (i of Array(10).keys())
 
user1596138
Or some shit
 
user1596138
I don't have useable ES6 in front of me so
 
5:09 PM
@Loktar hehe getify.
What are you trying to do again?
 
user1596138
 
for (let i of totalPages) {
    pages.push(<span>{i}</span>);
}
thats the exact use case
totalPages is just a number
 
You can add a Symbol.iterator to Number.prototype but don't.
A number isn't iterable, it's just a number. Just make a range function or use a for loop
 
it just seems like a standard for loop would be the best approach :/
 
What's wrong with a standard for loop?
 
user406009
5:11 PM
A standard for loop is the best approach in that case.
 
user1596138
^
 
eh idk I get the gist that you should try to use them sparingly
find other methods first
 
user406009
@Loktar You shouldn't use a for loop when a map or filter would work better.
 
user406009
However, not all cases can be solved with map or filter.
 
yeah I guess that was my overall question
was there something out there I didnt know about for this use case
 
5:12 PM
You can make a range function like Python, but use a loop.
 
user1596138
If you want the most readable code in this use case just use a standard for loop? This case doesn't seem to justify being creative lol
 
You can do hacky stuff like using string#repeat
 
@Jhawins do like:
class Numberator {
      max = 0;
      state = 0;

      constructor(max, state = 0) {
        this.max = max;
        this.state = state;
      }

      [Symbol.iterator]() {
        return this;
      }

      next() {
        if (this.state < this.max) {
          return {done: false, value: this.state++};
        } else {
          return {done: true};
        }
      }
    }

    for (let i of new Numberator(10)) {
      console.log(i);
    }
 
lol, totally using that now! j/j
 
Why not a generator?
 
5:13 PM
thanks @Lalaland @BenjaminGruenbaum @FlorianMargaine
 
async is the divil
 
user1596138
ew lol
 
user1596138
The degree to which we overthink things is hilarious sometimes
 
and jhawins :P
 
user1596138
:P
 
5:14 PM
dude according to Douglas Crockford he doesnt even use loops at all
 
user1596138
Douglas Crockford can suck a cockford lol
 
user1596138
Idk it's great and all to do things the absolute best way possible... But some people take it too far IMHO
 
or, to be clever:
class Numberator {
  max = 0;
  state = 0;

  constructor(max, state = 0) {
    this.max = max;
    this.state = state;
  }

  [Symbol.iterator]() {
    return this;
  }

  next() {
    if (this.state < this.max) {
      return {done: false, value: this.state++};
    } else {
      return {done: true};
    }
  }
}

Number.prototype.to = function (max) {
  return new Numberator(max, this);
}

for (let i of (0).to(10)) {
  console.log(i);
}
 
5:16 PM
I want the best way to do it then Douglas Crockford damnit!
 
I'm thinking of hosting github project tutorials on github.io (for my first real project). Anyone have a better idea? Ping me, I'll be AFK
 
@BenjaminGruenbaum arbitrary superstition as a replacement for things I'm not yet familiar with
 
user1596138
Like the ballmer curve... Eventually you just turn everything into trash
 
user1596138
But you get high on yourself instead of substances ;P
 
ballmer curve?
 
5:18 PM
developers, developers, developers, cocaine
nevermind, he's too fat for cocaine
 
well, the guy respected us
 
developers, developers, developers, pizza mmm smash
 
why not cocaine and pizza?
 
@ssube that can just be a generator :D
 
user1596138
5:20 PM
developer, developers, developers, @taco s
 
because he's fat @ssube
 
Anyways, I'm in a dilemma. We're supposed to launch a "groups" feature and give the user to enroll in public groups or create a new group. Problem is, when the user goes to that page, he sees 0 public groups. Creating fake groups wouldn't help because if the guy enrolls in one of those fake groups, he will never see any activity in there.
 
user1596138
@taco Did you say Douglas Crockford is fat
 
rubber ducking here. I just realized I could make more pages on my gh-pages branch and put my tutorials there huh?
 
@BenjaminGruenbaum feel like tearing into some code?
 
5:21 PM
@Jhawins no, Ballmer
 
user1596138
Oh haha I was like you're crazy man that guy looks fine
 
his wallet is too
 
Yeah, the bastard
 
user1596138
@DemCodeLines not enough info
 
@Jhawins Not sure how to explain more.
 
5:22 PM
github.io allows more than one page right
 
user1596138
:P
 
user1596138
@taco yea
 
@BenjaminGruenbaum :(
 
Team wants to add groups feature, kinda like facebook groups.
 
ok thx
 
5:23 PM
When the user goes to the page, he needs to see groups that are open to public or his own groups (which he has none of). But there are no public groups to show, since the feature is being added right now and no one has actually created any groups.
 
user1596138
"You are not in any groups yet"?
 
There needs to be a option for "public groups"
 
@ssube if going bleeding edge and babel I'd go with abstract references for infix notation.
 
but there are no public groups, unless we create fake ones with fake users.
 
 
5:24 PM
@DemCodeLines rubber duck in the sandbox please
 
I wonder if he could redirect /page/2/index.html to another page somehow with github.io pseudo redirect in a static page?
 
@BenjaminGruenbaum what the heck is that
 
@BenjaminGruenbaum babel can do abstract references?
 
@ssube You bet
 
user1596138
@BenjaminGruenbaum ...Why would he do that?
 
5:25 PM
!!tell DemCodeLines sandbox
 
@DemCodeLines Please go and play in the Sandbox
 
Wait, what did I do?
 
@BenjaminGruenbaum why is it not in the docs? :\
 
@Jhawins he's just saying random unrelated things, again.
@ssube it is, it's under experimental.
 
user1596138
Kinda true..
 
5:26 PM
Is this guy doing a github.io redirect via a static page? raw.githubusercontent.com/IronSummitMedia/startbootstrap/…
 
whatever, I'm just having a chicken-and-egg problem and asked for help, but if that's unrelated to programming, then ok
 
@taco no, there's a ruby plugin
 
It looks like github.io uses jekyll.... I'll look into that. Thanks @FlorianMargaine
 
which means it uses this plugin: github.com/jekyll/jekyll-redirect-from
jekyll is a static site generator... and github automatically runs it when you push on a repo
and serves the generated site
 
ah
 
5:29 PM
(github made jekyll, which explains the special support.)
 
@taco and you can write jekyll plugins in ruby for the dynamic parts you want
 
@BenjaminGruenbaum since babel and jasmine aren't getting along, that might be hard to test
 
@ssube you should be using mocha and not Jasmine anyway :P
 
Morning
 
5:31 PM
@BenjaminGruenbaum if it works with babel, I can do that. If not, why?
 
@ssube well, more modern syntax. Also it does, you can ask @SecondRikudo what his workflow with it is.
 
You should all be using github.com/SomeKittens/Node-Blog-Engine for your static site gen needs
 
Mocha has arbitrary transpiler support
Look into --compilers
 
@raorao_ yeah but just write expect("YOLO").toBeTruthy() for every test case and you're good
 
@rlemon blue and black?
 
5:35 PM
no. Gold and white.
 
BLUE AND BLACK!
 
black and yellow black and yellow black and yellow black and yellow
2
 
THAT'S NOT EVEN AN OPTION YOU DUMMY HEAD
 
Nimoy died ;_;
 
:/
 
user1596138
5:37 PM
 
@RalphWiggum NOOOO
 
@RalphWiggum Was having a pretty good conversation about that last night. It's like... he's lived a full and exceptional life, but it's sad to see him go
 
he LLAP'd
 
exactly
 
Apparently Nimoy came up with the Vulcan greeting based on this Jewish hand gesture
 
5:39 PM
whoa, never knew that
 
It's in the video of the new york times article
It stands for the Hebrew letter "shin" in Jewish sign language
 
@FlorianMargaine scientifically blue and black
 
@BenjaminGruenbaum which doesn't work (well|at all) with gulp, as usual :(
 
only 3 people in my class see it as blue and black, I feel weird being one of them
 
@SecondRikudo ever used gulp, babel, and mocha?
 
5:43 PM
@towc visually gold and white
 
I still see it as blue and black
 
what the hell are we talking about
 
the blue/black dress
 
click the link that @towc posted to find out
 
Your moms taco @KendallFrey
It's black and blue IMO
 
5:45 PM
I can't fathom how anyone would mistake it for white and gold
The image is clearly washed out
 
@taco I didn't know jews had gangs
 
@FlorianMargaine knew about that one
 
@Shmiddty I saw white and gold for like 15 minutes until I saw a different picture of the dress. Then my brain switched
 
@KendallFrey to some this looks like wizardry, to some it seems extremely normal:
 
5:46 PM
Actually I see white and gold again
 
WHY ARE WE TALKING ABOUT THIS
 
because it's the internet
and memes spread like a virus
 
Most white-ish colors won't turn into that saturated of a blue, and if it were gold, those shadows are all wrong.
 
oh not this picture again
 
5:47 PM
people seem really have to have no other problems these days
 
That's what this whole talk reminds me about
 
the most common explanation I've heard is that if someone sees the blue light at the back, it tries to reshift the blue of the light to white, reshifting the whole image
 
I know it's black adn blue, and yet my brain is seeing white and gold again.
I have a disease
 
I can't stop seeing white/gold now, even though I know that it's blue/black
 
5:51 PM
I can't see it as white
 
I saw it as white/gold at first, now it's blue/black
 
I want to see it as black/blue again so I feel normal
 
@KendallFrey I prefer the Brain Games Season 1 Episode 1 on this topic tvguide.com/shows/brain-games-330833/episode-1-season-1/…
 
I didn't even see the white-ified version as white
 
Brain Games is produced by a guy who used to work on al gore's tv channel
really smart dude, forget his name though
 
5:53 PM
@taco s/al gore's tv channel/global warming/
that penguin-killing bastard
 
Our President Elect Al Gore. Damn the chads
 
yeah :/
he should've time traveled to save himself
 
May be he had... in a parallel timeline.
 
*has
 
5:59 PM
omfg now they're emailing about it at work
 
His passing gift to the world was a magical, colour-changing dress
 
Everyone on the internet, get a fucking life
 
Excuse me!? it's Leonard Nimoy!
 
he's talking about the dress.
 
That's important, too
 
6:01 PM
the dress is really annoying
 
I find it intriguing, if you think about the psychology behind why some perceive the luminescence different than others.
 
@jAndy hipster
 
Yay, I'm no longer the room's hipster!
 
it's possible to have several hipsters...
 
I'm just a hipster when it comes to macintosh :p
 
6:02 PM
I am pissed off at my coworkers right now
STOP FUCKING EMAILING ME
 
@jAndy Was it your birthday yesterday
 
@KendallFrey BUT DID YOU SEE THIS DRESS!?
 
feels like the Matrix in real life, people care about useless senseless crap and in the meanwhile, people are dying, wars and conflicts are forced, media is all corrupt and spreads lies ... but we care about the color of a dress or stupid ice bucks
@Meredith actually its tomorrow :p
 
Oh happy birthday tomorrow then
Mine was yesterday thats why i asked
 
but now we have a full fledged myth about my birthday... you wrote its yesterday, darkyen congratulated me today and actually its tomorrow
 
6:05 PM
Happy Birthday, @Meredith
 
Thanks
 
8 pings in 4 minutes :(
 
You're 48 now, eh?
 
What
 
happy birthday @Meredith
 
6:06 PM
48 years old now
 
Thanks
 
obviously
 
No im 22
 
nah, 48
Also, I'm older than you, ha! I'm so used to being the young one.
 
we're all 48, if you really think about it
 
6:07 PM
There are lots of people in here younger than us
 
and we're all Nazis, according to @SimonSarris
 
maybe dancing nazis is in poor taste
 
im gannu flag u n00b
 
@NickDugger Yes. Let's conquer the World with JavaScript. We are making good progress. Our enemies are fractured; some of them investing in new weapons. Some holding out in fragmented forts. But many have started seeing the light. >:-)
 
Hallowed are the browsers.
 
6:17 PM
Hum... Is it me or is the "Thanks for contributing! Have more to say?" retarded and painful ?
 
where?
 
62
Q: What is the new "Answer similar questions" feature for?

davidismI and a few others in chat are noticing that we get the following message after answering a question: Thanks for contributing! Have more to say? Answer similar questions Clicking the button for that post took me to this search page listing "similar" questions to answer. I guess that's ne...

I just got it because I answered a question... and it showed me a bunch of JS questions...
 
So it's kinda begging you to answer more? Odd.
 
man, web component based development is so damned great
 
It's like React / 2 in terms of greatness :P
 
6:22 PM
just built a table to sort/filter, paginate, turn on/off columns ect. pretty fast
 
It might be interesting for somebody answering for the first time (and having an upvote) but there's no point in asking that
- if you already have enough rep to prove you know where to find questions
- if your answer hasn't even been upvoted
 
I like web components for simple stuff though.
 
@BenjaminGruenbaum heh I like polymere as well :p
 
@dystroy maybe, but it's useful.
@Loktar polymer is like React / 1.9
 
but react does make it pretty easy with param passing and the like
 
6:23 PM
@Loktar I did that once... Never ended up using it lol
 
@BenjaminGruenbaum useful ? How so ?
 
@NickDugger hah, yeah this is for work will be used on a multimillion dollar site
so thats always nice
 
Web components are a great idea, but only for really simple stuff. Like <markdown> is all game but having actual business logic that's stateful and makes server-requests is usually a bad idea.
 
eww yeah I wouldnt do server requests in a component
 
@dystroy finding good questions to answer is hard.
Especially when you don't have domain specific knowledge.
@Loktar all their examples do that though, they have <ajax-* components.
 
6:25 PM
@BenjaminGruenbaum yeah, but it only find bad questions...
 
@BenjaminGruenbaum yeah true, that just seems to muck it up a bit
 
@ssube Yes, yes and yes.
 
maybe doing it in a wrapper component thats domain specific isnt as bad
 
And I'll take a chance and dare guess your question
 
@NickDugger there can only be 1 young one :P
 
6:26 PM
What are you, 7?
 
Write tests with ES6 and test them with babel?
 
15 since feb 21
 
So... 7
 
@NickDugger There's a good chance I'm younger than you as well
 
@SecondRikudo 22
 
6:27 PM
I need to make some more pure components, I had so many ideas then stopped
 
No than :P
 
would be cool to do vanilla/polymer/react for each one
my ideas involve mostly a wrapper component around an image that applies a filter to it
 
@Loktar Sounds like a great case for polymer, actually.
 
<somefunkyfilter><img src="blah"/></somefunkyfilter>
@SecondRikudo yeah this is the only polymere component I've made, loktar00.github.io/static-img
 
<filtered-image type="blur" amount="2"><img src="woot"/></filtered-image>
 
6:28 PM
was a while back though
super useful! :p
@SecondRikudo yeah exactly
 
@Loktar wouldn't it be more semantically correct to have a "filters" attribute to the image containing, separated by commas, all the filters?
 
@towc eh idk, I think it would be more declarative to do <blur><img></blur>
 
<img src="blah" filters="blur,sharpen"></img>
 
you could stack them too, <blur amount='1'><greyscale><img></greyscale></blur>
would end up being a preference thing I imagine
 
I feel kind of the same for <i>, <b> and <em>... they should be attributes
 
6:30 PM
I prefer that approach though definitely
 
@dystroy I didn't get it.
 
<img src="blah" blur="1" greyscale />
what about that?
 
@SecondRikudo how'd you get it to work? Right now, I've got this
 
@towc personally I don't think thats quite as intuitive, but its a preference thing
 
ok
 
6:32 PM
like xml, some people love attributes, some people love tags
 
@ssube And you want to write your mocha tests in ES6 with babel, right?
 
@SecondRikudo xactly
and gulp
 
The solution I found when doing this was so simple I hit myself :P
 
I guess I'm a dog, black and blue, attribute guy then
 
that's the part that keeps breaking
 
6:32 PM
haha
 
Just add require('babel/register'); as the first line of that task :P
 
@SecondRikudo just that require, nothing in the mocha options, or add a {compilers: "js:babel/register"} to the options?
 
@ssube Just that require.
 
wtf. Why does that work?
srsly thanks tho @SecondRikudo
 
@ssube Because when you include that line, all other requires from the point onwards are passeed through babel
 
6:37 PM
hm, that makes sense. Looks like it works, which is pretty cool.
Tests are a little bit more elegant now.
 
@KendallFrey send this to your coworkers facebook.com/video.php?v=1400865936627259
 
Just need to throw the lady friend a birthday rave/party this weekend, then I can add the abstract infix stuff for @BenjaminGruenbaum :P
 
@ssube I already did it, didn't I show you that REPL result :P?
 
@BenjaminGruenbaum you did, but I want to figure out how to handle the default values and mid-chain method calls
the calls are going to be the harder part
 
6:39 PM
What do you mean?
 
the first time I wrote this sort of dig algo, being able to call functions along the way came up pretty quickly
the last few tests all invoke a function halfway through, so the infix version needs to support that as well
I think the reasoning behind that was largely because of classes with getters, where getting (but not calling) the getter was largely useless
 
user1596138
> You can clearly see that the dress doesn't give a shit.
Thank you so much for ruining the internet *you guys are the reason I drink* // bottle of absolut goes up
 
user1596138
LMFAO
 
user1596138
Idk why I quoted it you just watched it... It was just really good
 
My job is going to pay for that
 
6:45 PM
@BenjaminGruenbaum especially this case
 
the online vs
pretty effin sweet bruh
 
@ssube infix notation is so much easier you'll have fun.
Also - it's fine to invoke a function halfway through right now, just chain () to it - it's left to right.
 
ah, because you always handle undefined gracefully... missed that
gonna play with that on monday, then
 
Is Socket.io terribly documented, or is it just me?
 
Use ws (unless you need xhr fallback)
 
6:52 PM
Unfortunately, it's not my project to choose; I'm trying to debug a project using Socket.io
 
Alright, good luck then
 
This is probably a DUMB question but here it goes....Can you have a webpage using HTML and JavaScript that uses some process to synch database files and allows for human input WITHOUT some web server, like Tomcat, Jetty, etc.?
 
Socket IO has one of the best documentations in JS world IMHO.
@Lucy Human input? Sure. Sync databases? Probably not. Not sure what you mean with 'sync databases'.
 
@RoelvanUden Really? Are we looking at the same documentation? I'm looking at socket.io/docs and it's pretty scant, barely more than a few examples; more of a "getting started" than a doc.
 
I'll have a master device that contains the master database and other devices may become out of synch. So periodically the SQLite databases will need to get a copy of the latest in master.
I'm thinking if we can get a socket connection then we should be able to serialize the database.
 
6:57 PM
@Retsam Oh, nevermind. Apparently the docs from ~0.9 are gone then.
 
@RoelvanUden - Did you see my response?
 
(I'm no 1000-character/minute typing wizard)
 
@Lucy Look into Firebase.
 
Cool!
 
@Lucy Sure, you can connect to some kind of server thing with a request, or WebSocket. But you will need some kind of server, or device-specific APIs (e.g. in PhoneGap) to run that kind of server. But that's entirely plausible, sure.
 

« first day (1595 days earlier)      last day (3356 days later) »