« first day (1795 days earlier)      last day (3151 days later) » 

2:00 PM
there are three scenarios.
the item has an id and is present on load you can just look it up
the item has an id but is not present on load and you use delegation
the item had an id, but you've duplicated the id and now you are fucked.
 
the last part holds anyways
 
@rlemon not so fast
 
okay
 
$('*#id') is a thing
 
@FlorianMargaine huh?
really?
 
2:02 PM
I just got a call, my first call at my new office, and it was a telemarketer :(
 
jQuery thiing, or selectors thing?
 
Works in jquery, dunno if it's specific
 
why?
 
jQuery thing. document.querySelectorAll("#id") works just fine.
 
@FlorianMargaine what does that thing do?
 
2:03 PM
why try to appease broken code?
 
@AwalGarg selects all elements with id "id"
 
@FlorianMargaine mobile? :-)
 
@rlemon I've already done it.
@JanDvorak yeah
 
@FlorianMargaine done what?
 
The id hack
 
2:05 PM
@FlorianMargaine what is the usecase? qsa can select multiple elements with the same id already
 
We're talking about jquery there
When I use qsa, it's a decent project so I don't need this kind of hack
 
another version is [id=id]
 
dom's qsa accepts *#foo just fine here
hmm, doesn't accept *span though, weird
 
* substitutes a tag name
 
Isn't * a selector wildcard?
[name*='derp']
err, attribute wildcard sorry
You were saying?
:3
 
2:12 PM
I was correcting you, then I noticed you corrected yourself before that.
 
I think there are couple issues in your suggestion: 1) Array.map is not supported under IE 9; 2) parse() function is supposed to return a promise but you didn't; 3) arguments is not an array. It is similar to an Array, but does not have any Array properties except length. developer.mozilla.org/en/docs/Web/JavaScript/Reference/…JM Yang 8 mins ago
lol, what a douche
 
@BenjaminGruenbaum It's amazing that you still try
 
I really do try.
I just haven't been "strategically" downvoted in so long.
 
@BenjaminGruenbaum I don't know $.when but it seems like you are returning a promise?
 
@FlorianMargaine Edge supports Array.from :P
 
2:25 PM
You can polyfill Array.from, so all browser can support it
You can polyfill most things
 
@JMYang lol, Array.map is what you point out? Array.from is not even supported in Edge. — Florian Margaine 2 mins ago
@FlorianMargaine Yes it does
 
@FlorianMargaine huginn looks like hook/feed-driven ETL, which is pretty clever (@SomeKittens, you might be interested as well). We're setting up a server today, if I can figure out bundler and rake.
 
@BenFortune not according to mdn
 
Using it to tie CI, git, jira, and our other tools together.
 
2:26 PM
@AwalGarg he was actually right on that one, it's an edit, but it's super annoying when someone who posted another answer downvotes yours when theirs has an anti pattern and is worse.
 
@ssube I don't really see the usage
 
@Cereal that console looks ugly :(
 
Edge supports Array.from
Actually, Array.of can be used here, that's actually better 0.o
Wow, a use case for of
 
!!mdn array.of
 
Does arguments change in callbacks to be the arguments of the callback?
 
2:27 PM
@Cereal Array.of()
 
@FlorianMargaine Our biggest case is to have gitlab merge request creation trigger a teamcity build, then a successful build comment on the merge noting it succeeded.
 
It could just be .then(Array.of) istead of the return arguments; charade
 
@ssube so, err, github webhooks?
 
@FlorianMargaine done
 
2:28 PM
@FlorianMargaine it does webhooks when the two tools don't know about each other and can't directly connect
it can serve a hook URL, parse the incoming payload, run it through a template, and send it on
 
@FlorianMargaine Is Edge in any of the browser compat in MDN?
 
@BenFortune isn't it an IE version?
 
Or are people just adding it to IE
 
gitlab has some hooks, but teamcity is poorly supported, and jira uses paid plugins
 
First use case of Array.of, nice
@SomeKittens check out python, it's full of doing clever things with iterations, also Haskell, or any other language with sequences. Like how LINQ is implemented in C#.
 
2:29 PM
Edge has its own table/column on mdn
 
It gives you imperative powers for otherwise functional tasks. Also generators model both producers and consumers which is nice @SomeKittens
 
@CharlieBrown nah, doc editors decided to call it IE12 or Edge only.
 
@ssube hm... ok
so a proxy because your tools suck, basically
 
@AwalGarg The contrib guidelines state it should be called Edge. developer.mozilla.org/en-US/docs/MDN/Contribute/Structures/…
 
...
 
2:31 PM
Python zip() in ES6: jsfiddle.net/8wstx2tk/3 :)
 
@FlorianMargaine in that case, yes. It's also useful when your hooks are a little more complicated (git tells ci about a new merge and comments on jira, ci builds it and comments on git and sends it to slack, etc). Feed/hook multicast with transforms.
 
Just randomly went through about 20 mdn articles, edge isn't on any of them
 
it would be dumb to call it IE12. Its not an incremental upgrade
 
BTW, do you write function* abc() or function *abc()?
 
2:33 PM
@FlorianMargaine Yeah, I saw that. I cycled through random native methods but Edge hadn't been added to the compatibility table yet.
 
@Cereal sounds like parental control software
 
Sounds hilarious
 
Hahaha
 
So is Number.isNaN preferred over isNaN now?
 
2:36 PM
@BenFortune generally yes, both are terrible. I'd just use Object.is(NaN, yourValue) since it's clearer IMO
 
depends
 
isNaN and Number.isNaN are confusing. They don't make a whole lot of sense to be fair.
 
x !== x
 
^ Best way to confuse your readers :D
 
^ 100% agreed
Also, can be tricked with a getter in a with, I think
 
2:37 PM
isNaN checks if it is NaN, but not "not a number". there should be just isNumber or something
 
!!> Object.is(NaN, "foo")
 
@BenFortune false
 
> please explain why you down voted my answer, what's wrong in it? Did you earn your reputation in this way? – JM Yang
@BenjaminGruenbaum did you? did you? did you?
 
That's a fair question and I did down vote his question. I don't appreciate the snark at the end of it though.
I voted his answer because it contained a fundamental error, I have no trouble owning my votes.
If his answer was just long or at different style but was correct I would not have downvoted it, of course.
 
Not to be mistaken for Cheese.NaN
 
2:48 PM
@JMYang reputation in this site is mostly meaningless and only checks participation, votes are based on usefulness and not expertise or correctness. This site is about helping other developers, the lack or abundance of reputation does not check if someone is smart or stupid and you can see just how much I care about it by checking out my community wiki posts (no rep) or my bounties. I am glad I ended up teaching you something though, I apologize if my voting offended you - it was not what I was going for and again, if you fix your code I will gladly revert it. — Benjamin Gruenbaum 1 min ago
 
user406009
I just wish JS had NaN === NaN.
 
I just wish js used a floating point system which isn't broken and has been shown to be broken in all other languages it's implemented in.
 
@Neil Not a Nutty?
@Lalaland Why? It's a null value pattern, it makes sense that NaN !== NaN, my complaint is that Infinity === Infinity and that sort of stuff.
Probably everything that NaNs should throw, long are gone the days where that'd require a system call.
 
Hey guy, I'm trying to add a value to a function I'm calling (a variable) but I'm pretty sure I'm not doing it right this is what I came up with what do you think ?
                    var nbChar;
                    function resume(nbChar) {
                        $('.resume').each(function () {
                            var text = $(this).text();
                            if (text.length > nbChar) {
                                var less = text.slice(0, nbChar) + '<span class="showMore">...</span>';
 
@BenFortune -
 
2:50 PM
@KulbirSingh 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.
 
@KulbirSingh Okay..
 
@Zirak you mean the standard one? :(
 
@CapricaSix Thanks
 
@ssube IEEE 754. Burn in hell, IEEE 754
 
Anyone uses nginx at your personal PC to create personal services? Would you enjoy some tooling to manage that stuff? For instance I write my custom transpilers and experimentation stuff and tooling, which I like to be able to control from the browser with fixed pretty urls and stuff.
 
2:51 PM
@Zirak don't you want to fix pacman-fs before moving on with other features?
 
@FlorianMargaine I keep forgetting things I want to do
 
@AwalGarg I use nginx religiously.
 
This way I'll have an even bigger backlog, greatly increasing the guilt!
 
@BenFortune religiously?
 
@AwalGarg I was scarred with cpanel, but it might be worth building something :)
 
2:53 PM
@AwalGarg I use nginx daily, but I already have tooling
 
hello guys
i am a javascript beginner
i have a question about declaring javascript variables
 
Hi javascript beginner, I'm Zirak
 
@Zirak Hi brother from another mother
 
@AlexanderSolonik don't ask to ask, just ask
 
2:55 PM
hope your doing fine
 
I've noticed a recent trend in popular websites, importing React for one tiny thing on their site.
 
UD has it for their voting system, imgur uses it for their search and intro
 
@BenFortune that happened with jQ too
 
@AlexanderSolonik Never leave me again
 
2:55 PM
React is the new jQ?
 
@FlorianMargaine anything you want in specific? (ping me later if you can't think of it right now) cc @ssube @BenFortune I am mostly thinking of writing some kind of manager like pm2 + configuration boilerplate focused on personal services, but for nginx.
 
@Zirak i love you bro ! i would never leave u !!
 
best buy imports every library for one tiny piece of their site and manages to use every library ever created
 
hi guys
 
2:56 PM
Hey guys I need your suggestion
 
@AwalGarg I'm thinking a proxy manager could be useful. So when you want to proxy something, you don't need a new conf yadda yadda, but just a nice UI
 
I want to create a website where I can just embed videos from other site. I have shared hosting, so don't wanna host videos on my own server. Can you suggest me any free script for creating such site?
 
@AwalGarg What florian suggested, I also use reverse proxies a lot
 
pretty much my feelings. how'd you like the interface to be served? web app? ^_^
 
2:58 PM
"UI" being a CLI app is fine with me
Web app is harder, since, you know, you have to serve it.
 
I wanna do a git style cli app, but it seems people don't enjoy them or something
 
@YourFriend Youtube.
 
see my updated fiddle here jsfiddle.net/er37xrmw/1
my question is in the comment ! :)
 
@BenFortune no man
 
Quick review:
var foo = function(){};
foo.bar = 1;

Does it make any sense whatsoever to assign a function to foo instead of an object literal?
 
2:59 PM
@YourFriend Vimeo
 
I want to have my own site, just so I can embed videos on it from other sources
@rlemon i know about these sites, but I want to have my own. Where i can just embed videos
 
@FlorianMargaine I know, I know! I'd bootstrap! Use the app to serve the app! :D
 
@YourFriend Literally any CMS
 
@AwalGarg fine by me. An ncurses app is also fine, I don't really care. Just has to be easy to use and make sane decisions (e.g. you can add http auth support)
 
3:00 PM
@Jonathan it works but noone's really doing it
 
Any idea why you'd want to do that?
 
ooh, auth, one real good thing added to todos. time to get started.
 
@rlemon ???
 
@AwalGarg Just make a full-scale config generator for me, thanks.
 
:P
 
3:01 PM
I mean you could write:

var foo = [];
foo.bar = 1;
 
I've seen it used as a space for static variables to be used by foo. But one usually uses the export pattern instead.
 
@Jonathan it's used for "static values"
 
as in...
function Foo() {}
Foo.bar = 'baz';

var qux = new Foo();
var foobar = new Foo();
console.log(qux.bar, foobar.bar); "baz", "baz"
 
@Jonathan If you don't want foo to be a function, you can have it an object.
@FlorianMargaine or that. I meant static variables used by a regular function foo
 
3:03 PM
Anybody here familiar with event handling in d3.js?
 
0
Q: Class construct not working

Ben Pearl KahanThe code I'm new to classes, and I've created a class called when a logged-in user visits a page. The class is as follows: class User{ //Member variables var $id, $name1, $name2, $email, $pic, $league_id; //Constructor function __construct($id){ require_once("/connect....

Oh god
 
@AwalGarg is it done yet?
 
!!s/done/in/
 
@BenFortune @AwalGarg is it in yet? (source)
 
@FlorianMargaine yes, here it is: jquery.com
 
3:06 PM
was expecting rick roll, am disappointed
 
I don't have time to look for that silly youtube link
:D
 
you're a student
you have all the time in the world
 
Someone should write a jQuery plugin for that
 
anyways, just doing some research to see if any existing tools exist and how they do stuff
 
3:08 PM
I'd be glad if JavaScript can stay the hell out of this.
 
what do you want to write this in?
also, instead of relying on nginx, you could just write the reverse proxy yourself :)
 
@FlorianMargaine I did write the server in C you told me about, just not HTTP. Didn't find it worth to continue, but glad to have played with raw sockets.
 
@AwalGarg cool :)
 
good
they should be charged
 
@FlorianMargaine open to suggestions. for cli plain old bash might be something good for me to play with, but I don't think it will be something maintainable
 
@BenFortune old, jresig did that years ago
2009
 
@Loktar aww
 
lol still neat to see it though, I just wanted to be a party pooper
 
NN are fun to play with
 
3:15 PM
John did it back when barely anyone was using canvas
 
@AwalGarg not bash
 
oh wait John didn't even do it
> A pretty amazing piece of JavaScript dropped yesterday and it’s going to take a little bit to digest it all. It’s a GreaseMonkey script, written by ‘Shaun Friedle‘, that automatically solves captchas provided by the site Megaupload. There’s a demo online if you wish to give it a spin.
 
@AwalGarg use Python, not bash
 
I feel bad giving him credit. Shaun Friedle did it
 
Megaupload, damn
 
3:16 PM
python sounds like a good choice indeed
 
@BenFortune Brings back memories
 
@AwalGarg lisp is also a good choice
@AwalGarg or go
 
@argentum47 hey btw KA (our python virtual assistant that we never completed) might now finally get some work. college project to do something, and KA sounds interesting to do in college, specially because of portability... so I'd be coding in college hours :D
 
we've been replacing all our remaining bash and perl scripts with python recently, since you can actually build and test it
 
3:18 PM
@Zirak my little brother bought a one-year membership about 5 days before it closed down
 
@FlorianMargaine no, I don't like either of those languages :(
 
@rlemon why did you link me the same thing?
 
funny thing is my demo doesn't have the "bug"
@Loktar I linked the comment
the site sucks tho
 
oh yeah I saw it lol
thats why I pinged you
 
3:19 PM
ohh, I didn't think you saw my comment
my bad
 
Its just funny because its pretty old too
like 2 years old
 
maybe I don't like lisp because of my negligible experience with different languages, but I'd take python since I like that language but don't know the standard lib well
 
@SomeKittens weren't you just talking about that pen yesterday/
 
I ended up modding mine codepen.io/rlemon/pen/iqKuw
 
yeah yours is badass
make it rainbow and its a @towc pen! :P
 
3:20 PM
lol
 
@rlemon That fork makes me lag so badly
 
yea
it spawns N*N runners
 
I love it when I can come into a project and actually get stuff done rather quickly
Especially when it uses 2 frameworks I'm inexperienced with
 
Weirdly, the more that's on the screen the less it lags
 
@SterlingArcher that's experience for you :)
 
3:23 PM
Well this seems useless github.com/flightjs/flight
 
d3.js seems to be pretty cool
 
@BenFortune Object creation is more expensive than keeping htem in memory
 
@Zirak I keep trying to get you to use one, though.
 
@FlorianMargaine Ain't you a cutie pie
 
3:24 PM
@rlemon can V8 do that for me? As in, I discard an array and create a new one and V8 just reuses the same object behind the scenes?
 
no clue
 
@JanDvorak No
 
@JanDvorak afaik, no
but it creates hidden classes, and creating the new object can be very fast if it's similar to the previous one
 
meteor is being a dumb again
 
dumb as a rock
 
3:25 PM
in my case it was a 10k-el array of floats. I did double buffer it manually.
 
 
@Zirak :(
 
:D
 
Thanks
 
3:29 PM
meh, sockets truncate data and make it impossible to parse :\
 
crl
How does express know if the route is a string or a regex? expressjs.com/guide/routing.html oh nvm we can put a regex, it's less confusing than // will match acd and abcd: app.get('/ab?cd', function(req, res) {...
 
!!> typeof /\d+/
 
@BenFortune "object"
 
var foo = '';
undefined
typeof foo
"string"
var bar = /foo/;
undefined
typeof bar
"object"
bar.constructor.name
"RegExp"
 
!!> console.log(!!'foo'.match, !!/foo/.match)
 
3:31 PM
@ssube "undefined" Logged: true,false
 
Fun fact: In very early versions of v8 (and I think JSCore?) you could use a regexp as a function, it acted like exec
Another fun fact: Apparently I'm on qdb.us qdb.us/309106
 
I don't get what this.unblock() actually does in a Meteor method. Does it just activate the callback on the client but continue execution on the server?
 
@Zirak how is that funny?
@Zirak still waiting for you to make the specs of the quote thing btw.
 
@FlorianMargaine I don't even know who put it there. One time I entered some irc room and someone linked me there.
@FlorianMargaine Spec? Quote thing? Whatdido?
 
@Zirak yknow, soqdb
 
3:35 PM
ooohhhh
 
Yeah, more guilt
 
;-;
What're we missing? Didn't I comment on your project?
 
Guys, when javascript works on jsfiddle but only works locally when opening dev tools in firefox what does it mean?
 
Aaah right you commented useless stuff
 
3:36 PM
Basically if I dont open dev tools the code does not execute
 
It means she loves you
 
Didn't bother to fix that
 
if I do, my click event works
 
~_~
 
@BenFortune somehow that results page did help. but that doesn't change the fact that I am always right.
 
3:37 PM
You commented on the generated boilerplate... Like I care
 
We also talked about stuff in miaou
 
we didn't go very far, did we?
 
No we did not
 
have sex, your child will be genius squared
 
is there some kind of composite structure i can put in a Set that compares by value rather than by reference?
 
3:40 PM
Awal, it's time we have the talk...
 
@AwalGarg You're welcome, scrub
 
let x = new Set;
x.add([7, 4]);
x.has([7, 4]); // false
 
@Zirak ?
@BenFortune :D
 
@AwalGarg We never explained how small people are created
 
lmao
 
3:41 PM
@Zirak Two grown ups run into each other and yell a lot, then smoke beer and drink cigarettes.
 
@ssube alternatively they can just walk into each other and yell a bit less
 
@AwalGarg The more they yell, the better the small people will be.
 
That's a science fact
 
I... TIL
 
@FlorianMargaine Pinged you on miaou
 
3:44 PM
@ssube Tell that to my neighbours
 
!!> { print: () => console.log('hello') }['print']();
 
@corvid ["print"]
@corvid "TypeError: [\"print\"] is not a function"
 
@Zirak of course you did
 
@BenFortune Are they not loud enough?
 
@ssube Apparently not
@corvid IIFE's still work the same way, meaning parenthesis.
!!> ({ print: () => console.log('hello') })['print']();
 
3:46 PM
@BenFortune "undefined" Logged: "hello"
 
@Asperger does it have a console.log in it?
 
@BenFortune I mostly want to see if this will be preserved to the outer scope by using arrow functions in an object
 
true or false; writing a kernel is hard
 
in that case, the fat arrow does nothing different than { print: function() {} }.
 
3:52 PM
Connections.find({
  name: 'messages'
}).observe({
  changed: (document) => {
    this.lastMessage.set(document.messages.pop().message)
  }
});
 
@corvid looks like that will behave as you expect
 
Observers are the best
 
when it comes to userscripts, they solve all my problems
 
I use knockout observables and probably will for the forseeable future (need to support IE9), but I'd love a more native way.
 
@BenFortune wat
 
3:59 PM
@Cereal Pretty much
 

« first day (1795 days earlier)      last day (3151 days later) »