« first day (1685 days earlier)      last day (3264 days later) » 

12:00 AM
@JanDvorak I still don't get why you would put a sad face for that...
 
PHP has many inconsistencies and weird function names that only exist because the original implementor did not know how to implement a proper hashing function and used the string length instead
 
And that;s why you put the sad face in it?
like the hatez? :=P
 
Don't use PHP...
 
HAHAHA.
Don;t let me laugh with sarcasm.
 
Hey Jan, do you see any issues with this? I think I have fixed it...jsfiddle.net/d1n5uyk6/3
 
12:02 AM
I use php when I want to.
 
@MikeM. Fine. I hereby recognise this sentence as a request to kick you when you laugh. Consider it granted.
 
Same as you use JS when you want to.
Just because you dislike a language doesn't mean everyone has to stop using it.
 
How about you stop using it because it sucks?
 
How about you stop ranting it because you THINK it sucks because it's YOUR opinion
 
@foadster now getTotalPrice cannot see calculatePrice
 
12:04 AM
Just because you have an opinion doesn't mean everyone has to follow yours...
like seriously...
 
hmm ok
 
@MikeM. it's not my opinion that PHP's naming conventions are non-existent or that the reason is that the author did not know how to hash properly
 
it's you opinion that it sucks.
 
@JanDvorak how can I get it to see calculatePrice...
 
or that PHP is the only language where the ternary operator is right-associative
or that it has inconsistencies (in argument order between similar functions) that cannot be explained by said poor hashing
 
12:07 AM
it's still YOUR opinion that it sucks
 
or that its concept of closures is kinda ... not that useful since it doesn't work with this and that you have to specify every non-local variable on every lexical scope it should tunnel through
 
can't you read?
 
do you think these objective facts do not make PHP suck?
 
PHP sucks for you because you stick to a few things you like to.
I like it and I get my hang of it.
 
I've tried many languages and still dislike PHP most
 
12:09 AM
or that it's quite unusual and unfortunate that the shorthand boolean operators return booleans rather the first truthy / first falsy value
 
You can give as many so called facts you want.
 
neccesiating the need for the shorthand ternary ?: which does what || should have
 
But it's still an opinion that it sucks
 
they are objectively true.
 
yes but it might not suck for my end
for what I do it.
 
12:10 AM
so... you use PHP because it's hard to use it?
 
WHERE did I say that?
 
I'm asking
 
I use PHP because I like it over asp.net
I have tried both asp.net and php
I like PHP better.
 
still better than if(typeof jees !== "undefined"){}
 
learn python. Or ruby. Or node.js.
 
12:11 AM
No I will not
Just because you want me to, I am not going to.
 
so calling prototype doesnt allow the new method to see the parent classes methods?
im confused...
 
so, you use PHP because you're too lazy to learn a decent language?
 
Both Python and Ruby are better than PHP
 
I don;t want to learn it because I am not done yet with PHP
 
in fact, the intersection of Python and Ruby is better than PHP
 
12:12 AM
Like seriously I will go off and sleep you guys are just ranting about how much you hate a language but HEHE YOUR OPINION DOESN'T HAVE TO BE MINE
want to call me a lazy fuck, go ahead.
don't want to listen to what I say go ahead
 
Our facts are your facts also
 
guys...this is a JS chat room lolo
 
but make thing up into your own head or go to make a "bash PHP" room, but don't try to rant at someone LIKING a language just because you don't like it.
 
@foadster hold on. There's someone WRONG on the Internet.
 
Well have a "good" night
 
12:14 AM
Good night
 
lol @JanDvorak
 
Oh well. Night!
@foadster the difference between calculatePrice and getTotalPrice in the fiddle is how you declare them. calculatePrice is a local variable inside the constructor. getTotalPrice resides outside the constructor.
 
right
i thought the prototype inherited from the parent class though?
sorry i think i may be going down the wrong road. i moved the prototype outside of the constructor because you give me a hint about howthey might want me to move it outside
 
the advice to put it outside might have been too hasty. You can make everything public, but that's probably not what they want you to do.
 
why is JS so confusing lol
 
12:20 AM
I have a problem. I need to increment var i onclick asynchronously, it doesn't increment however. Each time I'm reloading the page (for now, before actually making it async) I guess var i get's reset at 0. How do I solve this? jsfiddle.net/9c93do8y
 
Everything seems confusing if you're new to a language
 
I dont get why they used a prototype. why not just declare another variable for getTotalPrice
 
Because people make assumptions about its behavior based on its syntactical similarity to other languages
 
@StevensHaen localStorage
@foadster if you do that, getTotalPrice won't be visible outside the constructor.
 
@monners right
I see
So they are trying to make it visible outside of the constructor
 
12:22 AM
Should I wrap the loops in a function and then invoke it async onclick? What is the best practice to do this
 
why on earth are they declaring a method inside the constructor
i have never seen such a thing
 
to make it private
 
can you do this in python?
i've never seen methods inside a constructor in c#
 
you have the concept of privileged functions in javascript - functions that can see local fields but are public themselves
 
ahh, all new stuff to me
usually you declare the method as "private" in java or "internal" in c#
crazy how it is in JS
 
12:24 AM
I've never actually used it - I don't publish my variables anywhere, so I keep everything public-to-me - but it is possible.
 
so I think the end game is to be able to call getTotalPrice using two arrays and calculate a sum
how do i go about doing this using the code snippet
 
27
A: Does Swift have access modifiers?

jemmonsI said to the master, "I understand now! Closures are the poor man's access modifiers." He beat me, saying, "How many times must I tell you, access modifiers are the poor man's encapsulation!" And I was enlightened.

 
OT: When a bug breaks the entire tool, how is it called? I guessed "breaking bug", but that doesn't show up any results on Google.
 
"showstopper" is quite accurate
 
@ŠimeVidas Playing with batarang again?
 
12:28 AM
Picturefill
(was completely broken in WebKit/Edge)
 
so @JanDvorak how do I get getTotalPrice visible to the public but also able to call calculatePrice
 
There's one place you can put the function
since it has to see calculatePrice, the constructor has to put it there
 
right
but then it's not accessible
 
there is a place you can put it, and it is visible from the constructor
you just have to know how to access it from the constructor.
you already should
 
i dont know actually
is it some sort of keyword I add to the prototype
 
12:38 AM
nope
there is only one prototype, so don't look there
What do you have multiple of?
 
totalPrice?
 
that's not visible from outside, though
 
right
 
Hmm Jan
I am stuck
I don't get it
 
12:43 AM
What object exists once per invocation of a constructor and is visible to the callee of the constructor?
 
this?
 
yes
 
so I can do this.getTotalPrice
?
 
yes
 
Ok
Great
Thanks. How can I buy you a beer
 
12:47 AM
consider it done. I'll pop one tomorrow.
 
@JanDvorak I still have to store the initial value of 0 on page load for my first values to appear. How do I deal with this? So onclick would still reassign the variable to 0
 
@JanDvorak thank you!!
 
@StevensHaen check on page load if you need to initialise the storage?
 
Makes sense
 
Is it unreasonable to expect that a project manager at a digital agency know how to clear their cookies?
 
12:53 AM
@monners lol
 
@rlemon That's awesome
 
This guy's hilarious
 
ugh, I just saw a skunk run away from a neighbors dog, tail up, now I can smell it. :/
 
someone quickly ask a googleable question?
 
1:06 AM
What's your favourite colour?
 
undefined results found
...
@JanDvorak something related to programming that can be found on SO ._.
also, thanks, that was a bug
 
how to sort an array in javascript?
 
it shows in the network log :(
Y U NO WORK
 
cross-origin?
 
Tampermonkey takes care of it
ooooh
oh wait
 
1:31 AM
@Jonathan I don't think so =/
@rlemon @monners couldn't figure out where all the views came from—found nothing on reddit, twitter, or hacker news
maybe it was on some newsletter—not sure
stackoverflow.com/questions/30295085/… if someone hadn't downvoted me I'd have the badge rn =(
 
user1596138
 
user1596138
Cause you wanted shorts when its hot but can't.... Lol
 
hi all
 
2:33 AM
@Jhawins haha wth
 
Wow Eric Lippert. That' guy is like a compute GOD!
 
jsfiddle.net/rlemon/eknw879o can everyone tell me their render time relative to their system specs? thanks. (console)
 
> generation: 185.000ms
 
sorry.. render
 
I have hw accell off on chrome
> render: 11.000ms
 
2:40 AM
neat. I have 15-16ms
wondering what a lower end system does
trying to figure out the optimal number of clouds
 
MLM
@rlemon Here are my results: ghostbin.com/paste/sa2q9
 
how do I tell?
 
what is your system pleaser?
@JanDvorak console
also, chrome
not sure if FF has console.time
 
oh. 231ms
 
MLM
@rlemon In paste but AMD A8 APU
 
2:41 AM
on render?
 
yes
 
damn
14ms is ~60fps
 
lemme restart the browser
generation is 5 seconds
 
adding in for latency
generation: 171.051ms
render: 15.925ms
generation: 97.828ms
render: 14.630ms
generation: 86.141ms
(index):134 render: 4.098ms
(index):129 generation: 71.961ms
(index):134 render: 5.118ms
(index):129 generation: 73.077ms
(index):134 render: 5.432ms
(index):129 generation: 72.676ms
(index):134 render: 3.769ms
 
96ms..108ms for /1/ after a browser refresh
 
2:50 AM
jsfiddle.net/rlemon/eknw879o/2/show is just /1/ but scaled up 2 times
I think it looks okay
FYI that is 256 clouds being generated
each cloud has 32 'puffs'
 
1.4 seconds
 
so that is 8192 gradient circles being rendered
er. 64
my bad
16384 puffs
 
Why you change your avatar?
 
needed a change
 
Unacceptable
 
2:54 AM
generation: 82.326ms
render: 5.265ms
now, what do you read?
 
FFS Chrome can't even play Youtube videos smoothly after the restart
do I need to restart it more aggresively?
 
sudo restart FF
 
!!xkcd make me a sandwich
 
!!sudo eval "window.location.reload(true)"
 
2:58 AM
@Shmiddty That didn't make much sense. Use the !!/help command to learn more.
 
user1596138
@Loktar haha right. Vented jeans
 
@rlemon How does seeing him get electrocuted never get old?
 
idk
it just doesn't
 
There's something about how he always seems to not expect it that makes it so funny
 
Wait, there is no for (key, val of obj) in ES6?
 
3:08 AM
for..of
and just interpolate
 
Only for (key in obj) and for (val of obj)?
 
key in obj and work with it
w/e you wanna do
 
I would like to not have to use obj inside the loop.
At all.
 
for ([key, val] of obj)
 
@Shmiddty Is this ES6?
 
3:22 AM
@Shmiddty I don't think it's valid :(
 
nor do I
 
>:(
 
It is if you use a transpiler
 
true
Wasn't there a syntax like: [for(x in O)x]?
 
array comprehension still exists afaik
 
3:33 AM
I think that didn't make it into ES6
> Proposed for ECMAScript 7
 
welp, that's lame
stupid revision 27
seems it's time to go change a bunch of my codegolf solutions to say "ES7 Draft" or "FirefoxScript" ._.
 
3:49 AM
Hi all, my manager is asking whether there is any javascript coverage tool, which gives the report so that it can say what all test cases is actually covers a single fn?
for example there is a function called test(){} and I have test cases for it which test the fn. The coverage report says only its been covered, but doesnt mention the test case name, that actually covers it.
 
istanbul
oh
nope
dunno
 
@phenomnomnominal: yeah we are using istanbul, but manager wants to see the coverage report with along this feature. So that he can see the usecases that covers the fns respectively !
 
That seems like a weird request, why does it matter?
 
4:03 AM
guys has anyone here had experience launching an app/website/whatever?
 
4:17 AM
@phenomnomnominal: Well, he wants which test cases covers which fn. Thats the simple aim of his talk. However, I know no one does it.
But I have to look for an way
 
4:48 AM
@nick I didn't get you
do you mean deploying the site to server?
@Justcode Hi o/
 
\o/
how are you?
 
fine now get out of this room
 
haha, I'm here to learn JavaScript
 
then learn don't chat.
 
@Mr_Green er no I mean the actual "launch". like how you get people to use the service, for example
 
4:53 AM
@Mr_Green :P okay noob
 
@Mr_Green that's a bit rude?
 
nick, I have no idea about it.
 
ok
 
@phenomnomnominal it is alright. you can also be rude with him.
 
4:55 AM
:/
he is my friend
 
@SomeKittens thank you. I think I already know some of them
@Mr_Green no, you are my enemy
 
@Justcode that's the list we give everyone looking for general help
hope you find something interesting
 
yup, that's what I'm looking for
thanks
 
@Justcode read this amazon.com/gp/product/…
 
@Mr_Green not interested
 
5:41 AM
!!1
 
@r3wt That didn't make much sense. Maybe you meant: d, ^, π
 
6:37 AM
Morning all
hi @RoelvanUden
 
6:47 AM
how can I pluck multiple properties with lodash(using the array notation returns false as the object while it is possible to pluck each feature)?
 
what should be the result?
 
_.pluck(layerInfo.getAt(layerName).data.toGeoJSON().features,['id','properties']‌​)
[{id:3232,properties:{...},...]
 
I'd use _.map
or Array#map
 
hey guys, how do you call getTotalPrice in this? jsfiddle.net/d1n5uyk6/4 getTotalPrice([2.3, 3.1, 4], [2, 1, 6]) ? I don't see how you pass variables through getTotalPrice down through calculatePrice
 
Have you guys heard of this linqjs.codeplex.com , someone from my team told me it performs SQL like operations on JSON Objects
I think it just uses select and where instead of filter and orderBy instead of sortBy???
 
6:56 AM
@foadster the way it's written now, it ignores its argument. I never approved the way it's written now.
@vamsiampolu if it can do joins, it might be worth batting an eye on
 
var queryResult2 = Enumerable.From(jsonArray)
    .Where("$.user.id < 200")
 
could be useful, I guess
 
In the examples,it says it uses Function Evaluation,what does that mean,how does it convert the string into a valid JS statement?
 
I hope it's not eval
 
so,is that what eval does,I heard bad things about eval and decieded not to read about it.
 
7:04 AM
yeah... you don't want to give users the ability to execute arbitrary pieces of javascript
 
CreateLambda: function (expression)
        {
            if (expression == null) return Functions.Identity;
            if (typeof expression == Types.String)
            {
                if (expression == "")
                {
                    return Functions.Identity;
                }
                else if (expression.indexOf("=>") == -1)
                {
                    return new Function("$,$$,$$$,$$$$", "return " + expression);
                }
                else
                {
 
@vamsiampolu It's modeled after .NET LINQ implementation. It's particularly useful if you need compatibility or similar statements that aren't available in regular JS (e.g. OrderBy, ThenBy, GroupBy, etc)
 
@vamsiampolu ew
 
@JanDvorak I might have read a long time back that new Function invokes eval??
 
They do the same kind of thing
new Function lets you instantiate a function with its body taken from a string.
 
7:19 AM
@JanDvorak how can I do such complex where conditions with lodash,I was using _.pick for each condition type and _.isEqual to check for equality and inEquality,is there a better way of doing that in lodash?
 
just use a function literal?
 
with _.filter,you mean??
 
yes
 
@Julo0sS Yo!
 
7:29 AM
@RoelvanUden hey ya :)
@RoelvanUden have some new questions about node & sockets & events... ^^ :D
 
@Julo0sS Shoot :)
 
room?
:)
 
Was my closing OK here ?
0
Q: Prototype and regular objects in JavaScript

SmithaWhat is the difference between the following two in JavaScript: Employee.id = 23; Employee.addAccount=function(){..} and Employee.prototype.id=23; Employee.prototype.addAccount=function(){..}

OP's code looks plain stupid, so not really like the QA I choose for closing.
 
unclear?
or that
 
Maybe. If necessary, reopen (I can't revert my closing). But not if it's just to close again...
 
7:34 AM
keep closed
 
The answer is bad...
This is what this source provide! :) — Radonirina Maminiaina 44 secs ago
user takes w3schools as an excuse to write shit
 
Since when does Object.create(null) work?
 
Dunno, but it's old
 
{}.prototype certainly doesn't have a prototype, though
 
It's convenient to build an object as a set and avoid problems with inherited keys (and for a faster lookup)
@JanDvorak it has you're right
 
7:42 AM
err... I meant {}.__proto__
 
Morning
 
Morning
 
@JanDvorak I thought you were writing in pseudo code, so I took it as right ;)
Anybody here knows MTConnect ? Does it allow for the pushing of data in a stream from a CNC machine to an agent ?
 
8:00 AM
o/
 
@GNi33 \o
 
@rlemon I had canadian craft beer yesterday ( Steamworks ). Wow this is good beer, but my head hurts a little today
 
MGE
8:20 AM
Hellio
I have a problem
if(typeof document.getElementById('maincontent').src === 'undefined'){
Uncaught TypeError: Cannot read property 'src' of null
 
maincontent id doesn't exist
 
In other words, you're trying to read src of something that doesn't exist.
 
jsfiddle?
 
MGE
solved
if( $('#maincontent').length ) {
 
hahahha
jQuery is great
and does all the things c:
 
8:24 AM
@MGE Surely you can’t be serious.
 
MGE
@poke ?
 
You use document.getElementById to access the element and now you want to put a jQuery selector in front of it to check whether it exists?!
 
MGE
why not?
 
Just do this:
var maincontent = document.getElementById('maincontent');
if (maincontent) {
    // main content exists
    if (typeof maincontent.src === 'undefined') {
        …
    }
}
 
Welcome to the generation where "If it works, it must be correct"
 
MGE
8:27 AM
        function refreshIframe() {
        if( $('#maincontent').length ) {
            document.getElementById('maincontent').src = document.getElementById('maincontent').src+'&forceplay=1';
    }
    else {
        parent.keep(currenturl+'&forceplay=1');
    }
}
 
that's genius
 
If you use the vanilla way anyway, don’t use jQuery on top of it for a check.
 
MGE
I can use
$('#maincontent).attr('src');
 
Just a hint: If you use $('#maincontent') more than once, you’re doing it wrong.
 
function refreshIframe() {
  var mainContent = document.getElementById('maincontent');
  if (!mainContent) return parent.keep(currenturl + '&forceplay=1');
  mainContent.src += '&forceplay=1';
}
It should be obvious this is a lot cleaner, clearer, and faster.
 
MGE
8:32 AM
nuce
nice thanks
wrong idea mixing jquery with vanilla way, right?
 
not really
 
@MGE You do see it's the exact same code, right? Just written down clearer. And without relying on JQ for no good reason.
 
it depends
 
MGE
@RoelvanUden yep
 
but is a bad idea to use getElementById and $('#id') to get the same element
 
MGE
8:33 AM
anyway, is return necessary ?
 
@MGE It’ss not necessarily bad to mix it, but you were doing the exact same thing tree times; twice with vanilla DOM, and once with jQuery.
 

« first day (1685 days earlier)      last day (3264 days later) »