« first day (1670 days earlier)      last day (3296 days later) » 

1:00 PM
I haven't worked with large systems :(
 
Phone pre-interview went well. I'm doing an in-person on Monday
 
$(function() {
  $().pluginA();
})
$(function() {
  $().pluginB();
})
$(function() {
  $().pluginC();
})
I see this crap a lot
makes me sad
 
unprefixed:
71.25% + 0.38% = 71.63%
 
@NickDugger glhf
 
1:01 PM
@rlemon I see many, many $(document).ready's in the same file all of the time, in people's jquery
 
@rlemon I wrap everything in an IIFE anyway
So the added indentation level is already there
 
@MadaraUchiha why?
 
@MadaraUchiha you're missing my point
 
@AwalGarg To not leak globals?
 
people needlessly use document.ready multiple times
 
1:02 PM
To allow for sane minification?
 
without understanding what it does.
 
@rlemon And that's an antipattern
But you're not one of those people
 
@MadaraUchiha doesn't help when using a module system
 
You understand perfectly well what it does.
 
no I'm bitching about them
 
1:02 PM
$(document).ready(function() {
    doOneThing();
});
$(document).ready(function() {
    doAnotherOneThing();
});
 
@MadaraUchiha doesn't help when using gzip
 
@AwalGarg When you use a module system you only ever have <script>System.import('main');</script> or something like that anyway
 
$(function() {
is the same as
$(document).ready(function() {
fyi..
 
@AwalGarg wut? What does gzip have to do with anything?
 
1:03 PM
@rlemon Oh, then I guess we're complaining about the same thing, lol
 
13472 LOC here according to npmjs.com/package/sloc and browserifying that together with library code takes roughly 1 sec, which isn't too bad but getting close to too slow
 
@BenjaminGruenbaum Now accepting delvotes
 
ty, one more
 
@MadaraUchiha gzip will compress those unscoped variables way better than your minifier
 
@ivarni 13472 is nothing
 
1:04 PM
@MadaraUchiha I know
Just figured I'd chime in with something a little more quantifiable than "large"
 
hrm, I can see it on so.com/tools but I can't del vote it
 
@AwalGarg Since when is gzip aware of JavaScript?
gzip is a compression algorithm
 
@rlemon 20k rep
 
It's not aware of what's being compressed...
 
@FlorianMargaine yes but I've casted del votes before
 
1:05 PM
@MadaraUchiha it isn't. I am not sure if we are on the same page
 
I can do it, there is just a wonky rule to which I can
 
@rlemon 10k rep can only delete questions with over 3 days since closed
 
I don't quite know what it is
@MadaraUchiha ahhhhhh ok
 
!!afk brb
 
Quick Angular question
 
1:06 PM
43.
 
I created a modal factory that handles modals in my app, mainly confirmation modals
I want to have the modal close after it executes the confirmation logic which it does UNLESS I end up calling $location.path() as part of the promise success call back
How can I handle this?
 
Anyone have experience with Reactive? How different is it from React? The place I interview with on Monday uses it
 
crl
Can you do a sort of
IF @@errors_count =0
COMMIT;
ELSE
ROLLBACK;
in MySQL or you need a procedure?
 
UC Browser for Android as 5.1% usage world wide
woot ?
 
Wait
!!> let foo = 5;
 
1:10 PM
@MadaraUchiha "SyntaxError: let is a reserved identifier"
 
If Caprica's running firefox, how come let isn't supported?
 
hi@all i have one string like this {"nl_wu",[]} i need only after comma which means []} could you please tell me
 
@dawoodrizwan 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.
 
!!tell dawood mdn split
 
1:14 PM
@CapricaSix i am not getting correct output by using this String.prototype.split()
@JanDvorak what you mean mdn split
 
@dawoodrizwan I was just telling her to do exactly what she did
@dawoodrizwan perhas it's because you're using it incorrectly?
 
!!> "abc|def".split(/|/)
 
@rlemon ["a","b","c","|","d","e","f"]
 
heh
I fail at regexp
 
Almost.
 
1:18 PM
!!> "abc|def".split(/\|/)
 
@rlemon ["abc","def"]
 
escaping escapes me sometimes
 
ST3 freezes when I try to open a folder or when I try to save a new file. Stupid.
 
no issues here
 
Guess I can at least try to uninstall/resinstall
 
1:19 PM
I thought you used brackets?
 
Brackets has bad ES6 support
Well, not bad, but shoddy
 
no plugin?
you've already asked this question, and he already answered.
 
Nah.
Not to fix what I want it to fix
it's a highlighting issue
 
@dawoodrizwan what have you tried?
 
@NickDugger that sucks
 
1:21 PM
Eh, ST3 has decent support
I can switch
 
@NickDugger webstorm has amazing ES6 support, just sayin
 
no thanks
I already bought ST3
lol
I've had it for months and just never used it
 
ST is the first thing I open when I boot my pc
then a terminal
then the browser
 
Fwiw ST3 costs as much as WS and does like 1/100 of the stuff
 
@BenjaminGruenbaum At 1/100 of the time though
sublime is really fast comapred to WS
 
1:23 PM
But I'm a hipster, and hipsters use ST
 
@MadaraUchiha yeah, if you have a slow computer that's too bad.
 
@NickDugger Hipsters use Atom
@BenjaminGruenbaum True enough
 
@JanDvorak i am trying like var a = '{"nl_wu",[]}' var b = a.split(','); but i am not getting
 
@MadaraUchiha hipsters use <enter some obscure editor his uncle wrote>
!!> var a = '{"nl_wu",[]}'; var b = a.split(','); b;
 
@rlemon ["{\"nl_wu\"","[]}"]
 
1:25 PM
I installed the 32bit version, and it works just fine
Weird
 
Hi Digger!! :)
 
Nuck Digger?
 
can't remember :S
maybe
 
This joke was bad, it's now also old
 
^
 
1:26 PM
You mean it's retro
 
no, it is retired.
 
it has ceased to be?
 
There's also one with a duck, but it's racist
 
and with Nugger
 
anything is racist if you're brave enough
 
1:27 PM
^
 
Huh
@BenjaminGruenbaum babel has a bluebirdCoroutines transformer
 
@MadaraUchiha oh really?
 
> Unhandled rejection ReferenceError: resove is not defined.
this is like the third time this morning I've typo'd an error
today will be a fun day
 
@rlemon now imagine if you were using an old version of Q - that'd just be a suppressed error :D
 
I didn't start using promises till bluebird :D
so I got to skip the bullshit I suppose
 
1:30 PM
fwiw, Q can find these unhandled rejections now too :D Although the code that does it in Q is written by a really shitty developer who is an idiot.
:D
 
:googles who the dev is:
 
@BenjaminGruenbaum yeah, it transforms them to await/async
 
dude, he's a fucking wizard
how can you say he's a shitty dev
 
@MadaraUchiha oh really :D? If only I told you about that in our first conversation about async in babel months ago...
@rlemon because he didn't write the code that does that I did :D
Kris is a total bauce (and a friend) I'd never say something like that about him.
 
@BenjaminGruenbaum You told me about it when I didn't even knew what promises were
Did you actually expect me to understand you back then? :P
 
1:33 PM
@MadaraUchiha haha, I barely understand myself.
Wait, that's the right one
 
On a scale from 1 to killme, how bad is this: (besides the global part)

window.SomethingGlobal = {
    foo: 'bar'
};
SomethingGlobal.Pls = class {
    constructor() {}
};
 
this is in place of using a class and static getters, since IE8 can;t support transpiled getters/setters
is this any better?

class Pls { }

SomethingGlobal = {
    Pls
}
actually, yeah, I like the second one more, myself
 
Y U HAVE GLOBALS?
 
@BenjaminGruenbaum Converting ES5 code to ES6. In order to do this in little parts at a time, they need to be accessed in the same fashion.
 
1:41 PM
@NickDugger you can have babel interop with requirejs for instance.
I'd just do:
class Pls {} // global because in window unless it's a module in which case export it and then use requirejs or something to load it
 
class Y AF;
 
@BenjaminGruenbaum So you're suggesting that I pack all of my previous ES5 code into something like browserify as well, so they can still take advantage of modules, while still being old code?
 
@NickDugger Why not emulate require w/o tools during dev and bundle up on release?
 
@RoelvanUden I think that was my question to benji. That could work
 
1:45 PM
quora.com/… @darkyen00 @SomeGuy
@MadaraUchiha vOv, you right. I mixed two things up.
(note that I used "vOv", and I think it means "shrug", but I am not sure)
 
!!tell awal urban vOv
 
@awal vOv It's a dude shrugging his shoulders. Stop being a bunch of retards.
 
k...
 
> Every IIN student will have a graduate degree once data usage crosses 3 gb per month.
hwat?
troll post?
 
@rlemon An ISP in India is named "Idea". They launched an advertisement saying you can learn everything from "Idea Internet Network" if you are willing to.
 
1:48 PM
yea I'm reading the page.
it is a marketing thing
 
they think users are retarded (which they are anyways)
 
but there are (looks like) 'fake' replies scattered throughout that post
 
yeah, they are making fun of the advertisement
I had a good giggle when I first saw that advertisement...
 
what's the joke?
 
1:50 PM
your existence
 
@Neoares voted
 
@NickDugger well, yeah, you should do that anyway, even if you don't use ES6
 
strawpoll.me/4342710/r no one let me down
well done guys
 
1:53 PM
the plot thickens
 
php and javascript are leading :D this is so much freaking real and important
 
@BenjaminGruenbaum Fair point
a very good point, actually
 
if I create an HTML string and do $('body').html(string), will the script tags at the end vanish?
 
Yes
 
2:01 PM
and if I append, will the html go after the script tags?
 
@doodla but executed scripts can't be "undoed", so the effect of those scripts will stay.
 
@AwalGarg So it wouldn't matter?
 
no
 
Cool. Thanks
 
I guess it depends on when you're replacing the HTML
 
2:02 PM
JS is terrible at dynamic unloading.
 
is body onload better or document ready?
 
Usually ready
 
depends on what you want to do
document ready means you are ready to interact with the document tree
 
scripts at the bottom
 
onload is... different. It is more complicated and less consistent between different browsers.
 
2:04 PM
window.onload is inconsistent? since when?
 
since now xDDDD
 
opera mini
 
who the fuck cares about opera mini?
 
opera mini...
wow
 
@rlemon there are slight differences, hence jQ having a version of it
 
2:05 PM
@rlemon flagged racist
 
well... sometimes
 
@ssube such as?
 
@rlemon not sure.
It might just be because people don't like directly binding to events without a dispatcher involved for multicast.
 
@ssube because I'm reading the source right now, and it appears it would just addeventlistener
 
.match(rnotwhite): jQuery is not the place for affirmative action
 
2:09 PM
gonna have to dig deeper
it is a 'special event'
 
lol
 
What are we talking about?
 
what is great and does all the things
 
no special.setup in load
so yea, it just adds a regular addEventListener
 
let thing = {
    [Symbol.toPrimitive]() {
        return 42;
    }
};
console.log(+thing) // should I get NaN ? Or is it just a problem in Babel ?
@BenjaminGruenbaum ^
 
2:10 PM
Why do you people always check that source viewer for jQuery it's impossible to get a straight answer out of it and jQuery is on Github.
 
@BenjaminGruenbaum it has code navigation that makes it easier than github code viewer
 
@FlorianMargaine GH has search
@dystroy I can check the spec if you'd like.
 
@BenjaminGruenbaum I refer to ecma-international.org/ecma-262/5.1/#sec-9.3
 
@BenjaminGruenbaum it sucks
 
@dystroy I think MDN is incorrect and Babel is correct here.
 
can script tags be AFTER the body tag. <head></head><body></body><script></script> ?
 
Nothing in the spec says that Symbol.toPrimitive has to be respected
 
What's the use of the symbol, then ?
 
Wait, nvm, found it
 
2:14 PM
apparently not.
 
@doodla no
 
I don't see it
Do you see a reference to @@toPrimitive here?
 
@doodla from the w3.org: The SCRIPT element places a script within a document. This element may appear any number of times in the HEAD or BODY of an HTML document.
 
\wait, wrong spec
I was looking at a really old draft -_-
 
2:16 PM
Yeah, I found it there
 
@BenjaminGruenbaum we find it easier.
 
@AwalGarg Haha, I like and hate the ad at the same time
 
> When ToPrimitive is called with no hint, then it generally behaves as if the hint were Number. However, objects may over-ride this behaviour by defining a @@toPrimitive method.
 
So it seems my code should return 42, no ?
 
@Jay read this: pastebin.com/uWZgqUAL
 
2:17 PM
I like the ad because it encourages people to learn and take initiative
I hate it because...come on. IIN?
 
@SomeGuy covered with blasphemy towards the interwebz and decieving information
 
I'd love if they partnered with Khan Academy or Coursera or something similar and allowed people to access that content for free on their network
 
@dystroy it appears so, yeah
 
Something missing from Babel, then ?
 
@dystroy yup, report bug
 
2:19 PM
Yeah, or core.js, but probably babel
 
@SomeGuy net neutrality??
 
@SomeGuy no...
 
Well, "Facebook Zero" exists
I'd rather see them do that with something like Coursera than with Facebook
@rlemon Never thought about it that way. But this isn't about preferential treatment. It's more like subsidizing the cost of access (we're charged per KB we use on mobile networks)
 
> The Subsecretaria de Telecomunicaciones of Chile ruled that Zero-rating services like Wikipedia Zero, Facebook Zero, and Google Free Zone, that subsidize mobile data usage, violate net neutrality laws and had to end the practise by June 1, 2014
@SomeGuy which is preferential treatment
...
 
2:21 PM
Haha, okay, yeah
 
it sets precedence that it is okay, and that is not okay
 
Fair point
 
If that ad just said - "hey look these are all the resources online which you can use to study this, and not laugh at silly jokes on facebook", it'd be way better
Presently that advertisement serves absolutely no good content for the public.
 
Ads rarely do
 
Well, some of them...
 
2:23 PM
nope
 
fine :(
 
I have strings q1Safe, q11Unsafe, q16Unobserved, q4 Unobserved and so on. How do I get the numerals and state seperately? ( I can bruteforce, but I think there might be a better way). I would need the number ( 1, 11 etc ) and the state ( Safe, Unsafe ...)
*q4Unobserved
 
Donate to @MITOCW, which is a phenomenal resource and one that we really should be encouraging https://crowdfund.mit.edu/project/551c3b4514bdf77e29bb1db5?clid=cC1CPSRfHVkKNBGT4fI2gk
 
@doodla Do they always start with q?
 
@SomeGuy:D
 
2:28 PM
@BenFortune Yeah. And are followed by a 1 or 2 digit number and then hte state.
 
string.match(/^q(\[0-9]+?)(.+?)/) maybe?
 
not sure what that does.
regex scares me.
 
\d works fine
you don't need [0-9]
 
starts with q, capture group for 1 or more digits (lazy), capture group for one or more characters (lazy)
 
(class Foo {
  static init() {
    console.log('hello world')
  }
}).init()
pls
 
2:30 PM
!!>"q1Safe".match(/^q(\d+?)(.+)/)
 
@BenFortune ["q1S","1","S"]
@BenFortune ["q1Safe","1","Safe"]
 
!!> "q12test".match(/^q([0-9]+?)(.+?)/)
 
@nderscore ["q12","1","2"]
 
!!> "q1Safe".match(/^q(\d+)(.+)/)
 
@rlemon ["q1Safe","1","Safe"]
 
2:31 PM
I wouldn't use lazy captures there :P
 
@dystroy @BenjaminGruenbaum where is the spec for Symbol.toPrimitive symbol itself? I can't find it anywhere except for the lazy mention on MDN.
 
@nderscore I derped :c
 
@AwalGarg es6 spec
 
!!> "q11Safe".match(/^q(\d+)(.+)/)
 
2:32 PM
@doodla ["q11Safe","11","Safe"]
 
Cool.
 
@dystroy yup, thanks
 
!!> "q11Safe".match(/(\d+)(.+)/)
 
@doodla ["11Safe","11","Safe"]
 
@BenFortune Thanks again.
 
2:34 PM
well chrome and iojs have full symbol support according to the kangax table but they don't have the toPrimitive symbol...
 
I haven't looked at symbols yet
 
actually I see only three symbols... looks like the kangax table needs an update
 
fuck is the most amazing terminal command ever.
 
Wait, ES6 symbols?
 
yeah
 
2:37 PM
aka magic
 
!!s/magic/dark magic/
 
@MadaraUchiha aka dark magic (source)
 
+ weird syntax
 
I can't get my head around what they're for
 
@BenFortune Think of them like sort of interfaces in more classical OO languages
 
2:38 PM
@BenFortune to avoid the toString hack :P
 
Only it's not like interfaces at all :P But it kinda serves the same purpose.
 
The only interfaces I know of are PHP
 
@BenFortune What are interfaces for?
 
Which is basically a class structure
 
@BenFortune That's not what interfaces are for.
 
user1596138
2:40 PM
Monring
 
> The entire point of interfaces is to give you the flexibility to have your class be forced to implement multiple interfaces, but still not allow multiple inheritance.
"a class structure" wouldn't fall into this?
 
> Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.
If your class doesn't structure like the interface, then it will throw
 
@rlemon That's... hardly the point of interfaces...
 
It can also be said that * Interfaces provide the design for a class with zero implementation. * Abstract classes provide some design, with some implementation. Abstract classes are most useful where child classes share some implementation similarities, but differ in certain implementations. — Jrgns Feb 9 '12 at 13:29
 
An interface is merely a contract of methods and properties a thing should expose.
 
2:42 PM
@MadaraUchiha the PHP community disagrees with you then
 
I'm taking this from highly voted SO answers
so suck it anime boy
7
 
@rlemon interfaces have absolutely nothing to do with multiple inheritence and whatnot
@BenFortune 's definition is spot on
It's about a contract
 
that out of context quote will go far
 
@rlemon thank you
 
2:43 PM
@rlemon So?
 
So, with socket.io you can't send an object you built with Object.create(null), because you'd get an error on
 if (obj.hasOwnProperty(key) && _hasBinary(obj[key])) {
 
67
A: What is the point of interfaces in PHP?

Craig HThe entire point of interfaces is to give you the flexibility to have your class be forced to implement multiple interfaces, but still not allow multiple inheritance. The issues with inheriting from multiple classes are many and varied and the wikipedia page on it sums them up pretty well. Inte...

 
@MadaraUchiha i think you mean roel van uden?
 
so then correct this information
because 67 people think this is interfaces, and I'm sure many more have read this
 
When I specify in my method that I want a Logger instance, I only care that the object that got passed has .log()
I don't care how log works, or what other methods the object has
 
2:44 PM
Well.. it's a PHP question. PHP related is inherently misinformation.
 
3 mins ago, by Ben Fortune
> Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.
 
@MadaraUchiha so you want to make sure the object has a specific class structure?
 
@rlemon Are you trolling right now?
 
But an interface requires you to specify the arguments to the methods too
 
no, you seem to think that definition is wrong.
so do something about it :P
 
2:45 PM
@FlorianMargaine An object's* structure, maybe.
 
Anyway, PHP sucks. So what use cases would symbols have?
 
this is my sole use of interfaces
 
Wouldn't that expect a construct?
No wait, it's not even a class
wat
 
What are we confused about?
interfaces? Interfaces are just models, mostly
 
2:58 PM
I'm just confused about what @AwalGarg is doing
 
@BenFortune most of us are
:D
 
@BenFortune that's a simple php snippet using interfaces, why?
 
Isn't it wrong though?
 
what is wrong in it?
 
Since interfaces implement classes, not functions
 

« first day (1670 days earlier)      last day (3296 days later) »