« first day (1426 days earlier)      last day (3529 days later) » 

12:06 AM
A new Linux distribution. Wow that's rare!
 
Nono it's a whole new OS
Based on NodeJS
Such stable
Very badass
The first web scale OS
3
 
@Srle Nice
The clock obviously, the code sucks
 
@copy thanks, any suggestions to make code better?
 
Just joking :P
 
ahhh thanks :D i steal whole day on my job today to have fun with this :D
 
1:21 AM
ok guys I need your help once again, I am following a basic d3 bar chart tutorial (you know trying to better my code and stuff) and I can't get it to work. The html shows everything but on the screen nothing happens here is my jfiddle.
coffeescript: http://jsfiddle.net/0b6txcmk/
Javascript (a little ugly): http://jsfiddle.net/an3Lfdw5/
tutorial link: http://bl.ocks.org/mbostock/7322386
 
@SomeKittensUx2666 good!
 
 
1 hour later…
2:53 AM
hi
 
@MaheshVarma 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.
 
im struggling with one issue. I posted the question here.. stackoverflow.com/questions/25776815/…
it is popup window issue
the issue is pop-up window is opening in smaller size when we run that page in https://
can anyone help please?
 
3:40 AM
Read the comment
 
3:54 AM
@BenjaminGruenbaum Have you ever tried dwmkerr.com/the-only-angularjs-modal-service-youll-ever-need ?
 
dang I still cant get things to work
 
@user2962766 Well, getting a modal is pretty simple so I tend not to use third party services for that
 
@BenjaminGruenbaum I am still learning. Do you have any example ?
 
Well, a modal is usually two divs - one that's for the overlay and covers the whole screen and one that is positioned fixed in the center where you want the modal to be. The centered div contains all your data (and an x button). I'd put the actual divs in directives (an overlay directive and a modal directive) and then have a modal service I call to show a modal. You can also return a promise from it if you want to hook on dismissing it (possibly with an answer) in a nice way.
 
@BenjaminGruenbaum Thanks man. I still have to try.
 
4:00 AM
Good luck
 
One question, IN the link that I provided, Step 4. In the .then() part, the model() function is from the bootstrap .... right ?
 
@user2962766 I'd also try using angular-ui-bootsrap modal service since it is well documented
 
@grasshopper Yeah man. Even I think so. Do they provide just modal service and not all the other stuff ?
 
4:17 AM
sorry, it didnt work there
 
@user2962766 it comes with all the other stuff
still need help on this issue posted my question here stackoverflow.com/questions/25777700/…
 
m59
4:37 AM
@grasshopper be sure to include code in your post
I'm surprised it let you post that. It usually complains if you provide links to jsfiddle with no code.
Ohhh, you didn't link them. You sneaky guy ;D
Link your links! No one wants to copy/paste them.
 
4:52 AM
Mornin
 
m59
5:07 AM
var elem = angular.element("<p>{{'abc'|test}}</p>");
$compile(elem)($scope);
expect($scope.$digest).not.toThrow();
threw cannot read property length of undefined, for no obvious reason.
Am I testing this right?
The filter code works and all. I can actually call the $digest and no error is thrown :)
 
@m59 create a fiddle
 
huh... why does this tab hog up 0.4 GB RAM?
... and even more after a refresh
(closing and reopening did help)
 
@JanDvorak yeah, I see it too
I think it's a chat bug
 
m59
@BenjaminGruenbaum ahhhhh I got it. I was noobing out on $filterProvider.reigster
I wasn't using it as a factory
 
m59
5:19 AM
returning the value instead of the filterFn :)
@BenjaminGruenbaum n/m I just did that in the fiddle. My actual code is like this: jsbin.com/qidiw/30/edit
and it has an issue in the same spot, but a different error
I can run the $digest and it doesn't throw (expected), but if I instead use expect, it does throw!
lol
I could work around this with try/catch with a tracking variable if needed, but that defeats the purpose of what I'm trying to do here, which is to learn to write good tests.
 
If you're testing your implementation detail you're not writing very good tests now are you?
 
m59
5:34 AM
I don't know what that means.
 
Well, a few things - first of all you should probably not have Math.random in a unit test.
 
m59
It seemed appropriate, considering I wanted to test that it would break Angular.
 
but why would you want a test for that?
 
Why would it require Math.random?
 
m59
So that it returns differently every time
 
5:36 AM
Math.random doesn't do that though.
 
m59
@phenomnomnominal I'm not testing anything in particular. I'm just trying out different things.
 
m59
It does most of the time.
 
If I run Math.random as a comparator to order a short list 10 times it's perfectly probable that I'd get the same outcome twice.
Also "so it returns differently every time" is a big red flag in unit tests :D
 
m59
I see what you mean. I could ++var instead.
this isn't a real test! I was testing me, so to speak
for this exact reason, also.
 
5:38 AM
You want your tests to predict how your code behaves, if your tests test something different every time and you can't tell what they're not very helpful
 
m59
If I can't make this work appropriately, I certainly can't make it work in anything real.
 
What're you trying to achieve?
 
Actually I am facing one issue with my web application
 
I was talking to m59
Do you know what $$asyncQueue is in Angular @m59 and why it's complaining it's not there?
 
5:41 AM
Actually When I press enter in any text area in any page in the application the line is not getting chnaged
Can anybody tell how can I debug this issue
 
m59
@BenjaminGruenbaum I don't. I can't find anything about it.
 
@m59 angular has a queue it flushes before digest so you can schedule things for a digest at a later point. I think I talk about it here but I might be wrong. It tries to flush the queue or to obtain its length but the queue isn't there
 asyncQueue = this.$$asyncQueue,
 ...
 while(asyncQueue.length) {
      try {
          asyncTask = asyncQueue.shift();
          asyncTask.scope.$eval(asyncTask.expression);
      } catch (e) {
          clearPhase();
          $exceptionHandler(e);
      }
      lastDirtyWatch = null;
 }
This runs on a digest, it tries to access the queue but it's not there, can you tell me why?
@NikhilAgrawal create a small isolated self contained fiddle demonstrating the issue please :)
 
m59
I assume because I haven't injected something I should have?
no module?
 
Let me try differently, what is this in the above code?
It's the root scope
Now, can you tell me why you're getting that error? :)
 
m59
context?
 
well, what is your rootScope?
Try logging it
 
m59
It has the queue array[0]
So, if it's later missing, I'd think the context got changed.
 
Ok, I code this solution for you. I have fulfilled your requirements, nice question. Have a great day. — Benjamin Gruenbaum 7 secs ago
 
m59
$scope.$digest.bind($scope) ?
It does work as I expect now
 
@m59 That should do the trick
 
m59
5:52 AM
@BenjaminGruenbaum dangit how do you get so pro ;D
I do realize I should have been on the lookout for that
 
Just don't have random() in your unit tests and you should be OK :P
 
@m59 try wrapping the $digest call as below `var elem = angular.element("<p>{{'abc'|testFilter}}</p>");
$compile(elem)($scope);
//$scope.$digest();
expect(
function(){$scope.$digest();}
).not.toThrow();
});'
 
m59
why?
I don't think that does what you think ;D
 
Why? He suggested you use an FE, which is as good as .bind albeit not as elegant.
 
5:55 AM
Wait, that's not an IIFE, I should get some sleep
It's just a function expression.
@bhantol his edit already does this - he's using .bind which sets the context explicitly.
(To clarify, the issue is fixed)
 
anybody tried linkedin post a job on javascript version??
 
m59
Oh, I see what you did. The lack of formatting here made that hard to see.
 
yes
helo
 
5:57 AM
ehlo
 
I don't understand your question.
 
m59
Don't forget to ctrl+k your code.
 
i was having a problem if linkedin api supports javascript version like on the jquery
 
@m59 thx for the keyboard short cut
 
$.post(url,{title:'job possition',position:'developer'});
 
5:58 AM
Oh, not sure. jQuery is just a JS DOM manipulation library so I doubt they only have a jQuery API
 
something like this
 
@boyee that's just an XHR, you don't need jQuery for that
 
Hello, Can anybody help me about this question: stackoverflow.com/questions/25753142/stream-mp3-using-web-rtc
 
ah , how did you implement using JS on jobpost on linkedin? do you have samples?
the api they have is only PHP,perl etc
 
@BenjaminGruenbaum Thanks for your reply
 
6:00 AM
var xhr = new XMLHttpRequest;
xhr.open("POST",url);
setRequestHeader("Content-Type",'application/json');
xhr.onload = function(){
    // handle response here
}
xhr.send(JSON.stringify({title:'job position', position:'developer'))
@boyee this does what your $.post does, roughly
Not sure how the linkedin API works though you should check their documentation.
 
@Anton_Sh Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.
 
great samples benjamin thanks
 
oh ur an israeli , lots of israelis are very smart
 
@JanDvorak I know but from 1 week or more I cannot find the problemn
 
6:03 AM
I don't really like racial profiling, but thanks I guess :P
@Anton_Sh @JanDvorak is right if you expect help with your problem you'll need to trim it down to the bare minimum so people will be able to run the code and see for themselves. It will significantly improve your chances of getting help if you reduce the code.
We're all developers here and we all understand it can be really frustrating to be stuck on a bug for a week but it could significantly help you if you reduce your problematic code to the bare minimum - it'll make the problem easier to reason about and it'll make it easier for people to help you on SO. Moreover if you don't do so it will probably get closed.
Consider isolating the problematic part and then placing a bounty.
@YoukuKMSFan I know you can't speak here yet because you don't have enough Stack Overflow rep - but accepting some answers on your questions can really help you and future visitors. Not only it will award you with points that will let you use more features on the site, it will award the person who wrote the answer and will make what worked out for you clearer for future visitors with the same issue.
 
m59
Is there a list around of the order which Angular processes things?
I was helping someone earlier and had to say "I think"
 
You mean the bootstrap process or the digest cycle?
 
Ok, tonight I will change the question. I will try to show the master steps and the slave steps and after that I will ask which step missing( for example: 1- setDescriptin, 2-setCandidate...) Is this way is ok?
 
m59
digest cycle
 
First of all, the Angular source code while somewhat outdated in docs from time to time is very readable.
Let me find the relevant bit
 
6:09 AM
@Anton_Sh if the new question is small enough, or at least documented enough, to be readable and clearly relevant, you should be fine
 
@m59 github.com/angular/angular.js/blob/master/src/ng/… Read that function, if you don't understand a bit ping me
 
Ok thaks for advice
:)
have a good day
 
m59
Ok. I was helping someone that found something interesting
He passed a function to an isolate scope directive and was logging stuff
 
0
Q: popup window gets opened in small size unless changing the security settings in IE

MaheshVarmaI am using IE 8 I have the following javascript <script type="text/javascript"> function popupWindow(url) { w = 1026; h = 760; var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); window.location.href="/myURL here"; var newWindow = window.open(url, 'windowname', "too...

edited the question
 
m59
and found that the bindings appeared to be synced, but found a point in the logging where they werent
I think that's because the bindings would be updated last, but we shall see!
 
6:11 AM
That makes sense, Angular performs a digest loop more than once.
It loops the watchers until they're all clean, it might go more than once
 
@BenjaminGruenbaum wat
 
You should consider reading this excellent blog post about the rationale in digests, scopes and watchers although it's going to change a bit in Angular 2. Angular 2 uses something called 'watchtower' it's on GH and you can read the design documents they're pretty good.
@Zirak it's web scale.
 
m59
Hmm, I think my question may be outside of that
 
That's so 2014
 
m59
When a model changes, doesn't it fire the parsers/formatters, etc before the digest, then?
 
6:14 AM
@m59 well, what does the code I just sent you a link to say?
 
m59
The source code? I must have not read it correctly.
 
Does it mention filters?
Is it aware of them explicitly?
 
m59
It's only aware of the value they change, right?
 
You tell me :)
The code is in front of you and it's not magic :)
 
m59
awfully complex to my scrubby eyes
 
6:18 AM
Ooh... I know what'll help, here's filter but what's more interesting is how filters are parsed.
look at the .apply though, what does it do with the filter?
It's just a function call, it's just sugar really :)
 
m59
If I had done this:
if ((value = watch.get(current)) !== (last = watch.last) &&
                        !(watch.eq
                            ? equals(value, last)
                            : (typeof value === 'number' && typeof last === 'number'
                               && isNaN(value) && isNaN(last)))) {
you guys would be all in my business about hard to read code :)
 
That's erm... idiomatic :P
Try reading jQuery, now that's a horribly written (but highly effective) source code.
 
m59
I haven't wrapped my head around exactly what "functional" programming means, but that looks like the code samples I've seen
which that one guy says only geniuses can read ;D
 
lel
 
m59
Larry Wall said that
 
6:27 AM
yeah...no
@BenjaminGruenbaum haha, did you read this? node-os.com/blog/introduction
 
I'm honestly surprised it's not a joke.
Dem hipsters.
 
That one talk about the future of JavaScript was funny, but severely damaging on people who don't get it
 
I find it hilarious.
Also, if you're talking about "The birth and death" I also think it's a really interesting talk in its own right
 
I don't get you, GAE.
I have a release pipeline. I've pushed to your weirdo "google cloud repository". What more do you want of me!?
 
@BenjaminGruenbaum Not so much
 
6:35 AM
@copy not the talk or not interesting?
 
Not so interesting
 
Really? I thought the idea was really interesting even if not the most feasible.
 
hello all....i want to disable custom input filed which is added at run time in jQuery......
this is not wrkng : `$('[data-test]').attr('readonly', true);`
how to do ?? any idea
 
m59
My guess is the typical "dom element isn't loaded yet" problem. @SweetWisherツ
 
yaa..but how to override this problem?
 
m59
6:43 AM
Did you wrap it in $(document).ready(function() { ?
 
no..i;m using backbone.js
 
m59
the heck?
 
and the field is added in postRenderInit
 
:(
again backbone :P
 
m59
6:45 AM
If you're adding it with javascript, you can't just add it the way you want it?
I missed that part at first, my bad.
I don't get what the difficulty is :)
 
i'm clueless
 
m59
Well, good luck.
Night all!
super thanks Benji.
 
@BenjaminGruenbaum I remember it was flawed in some ways and sensational. Fun if you don't take it as a suggestion
 
@copy of course it's flawed he's suggesting replacing the whole kernel space user space separation with the browser and to run all our code in the browser... that's insane :D
It's still an interesting idea.
 
6:58 AM
@copy places neovim.org besides your feet, slowly backs away
 
I know, but it's not ready
No reason to slowly back away
 
Hi Fabian
 
Hi
 
whats up ?
 
morning, any idea how to make only x rotation around object in three.js?
 
7:01 AM
The ceiling
 
fair enough
 
You know what sucks?
 
your mom's lips ?
 
@Zirak vacuums
 
...you know what sucks metaphorically?
 
7:06 AM
black holes
 
why are we repeating a joke ?
 
yesterday, by Benjamin Gruenbaum
@AaronSiciliano Y U NO GET MY JOKES? :(((
 
You know what's just not cool?
 
This guy didn't get it
Also, lava
 
also a stars core
 
7:08 AM
Morning guys
 
Does anybody know why npm list -g doesn't print all global installed NPM packages?
 
Mornin
 
I want to try stackless Python
Eve Online is written in stackless Python
 
7:17 AM
For realzies?
 
Both client and server
 
Only the server, though, right?
whooooaaaaaaaaaaaa
 
@copy Sounds fun, I like writing backend and frontend in the same language, it's been fun in Node and it's been fun in C#.
 
Hi everyone. A question: How to determine if variable is 'undefined' in strict mode?
 
@user3002233 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.
 
@user3002233 === undefined
 
@user3002233 as opposed to undeclared?
 
@BenjaminGruenbaum Me too, except that in JavaScript I'm inventing half a standard library
 
@copy Or you can use modules from npm :P
Although Python server on greenlets does sound interesting.
 
7:32 AM
Hmm ... it's not too late for a rewrite of the server in another language yet
 
@BenjaminGruenbaum firefox console: "TypeError: this is undefined"
 
@user3002233 show me the code
 
7:43 AM
@BenjaminGruenbaum tips for a presentation to Microsoft Ventures.
@ziGi don't tempt me to make a video Zigi : A tragedy ^^
 
if(this.timeVar != undefined) {
clearTimeout(this.timeVar);
}
 
@AbhishekHingnikar haha what video?
you have to charge your iWatch every night :O
who buys that
 
In all honesty the Watch looks amazing :D
The iPhone 6 looks disappointing though
 
@BenjaminGruenbaum Go back to Swift, iFan.
 
@BenjaminGruenbaum is "looks" the key word here?
 
7:46 AM
All of my friends are getting corrupted one by one
 
@ziGi well, I haven't tried it yet so I can't tell you it's amazing, or that it's shit.
It just looks impressive.
 
Yes, I agree, if apple could just start collaborating with Google and make the design and google to make the functionallity it would be much better
alas, it's not gonna be possible, unless Google becomes Umbrella Corp and buys Apple
 
I like the functionality, I just hate that the new iPhone costs a lot and is huge and doesn't have too many interesting features.
If Android actually worked without getting stuck or jittering and stuff I'd have loved to use it instead.
 
Morning
 
I don't mind occasional lag spikes if they don't take 15 seconds each
 
7:51 AM
I've seen this example on eloquent js website:
    function multiplier(factor) {
      return function(number) {
        return number * factor;
      };
    }

    var twice = multiplier(2);
    console.log(twice(5));
    // → 10
 
@Carnal Paste, CTRL+K, enter
:)
 
thanks
I'm just a bit twisted on this one.
How come the answer is 10.
 
@Carnal In JavaScript, functions are first class citizens.
You can assign functions to variables, pass them as arguments and even return them from other functions.
 
and.. closures
 
Here, you passed 2 to multiplier so the resulting function is
function(number) {
        return number * 2; //Factor is 2 because that's what you passed
      };
}
 
7:54 AM
@Carnal Which part confuses you?
 
That function is now assigned to twice so twice is that function ^
 
I see.
A bit weird for me
Kinda new to me actually.
:D
 
@SecondRikudo this won't work
 
Second Rikudo said it already.
The moment you call
console.log(twice(5));
 
@ziGi Are you sure?
 
7:55 AM
That's what got me twisted
 
@Carnal yeah it's very confusing the first time you see it but it's also a pretty powerful concept :)
 
 
So that means twice is now the child function inside the multiplier function
And the parameter on that is optional.
@SecondRikudo I'm guessing you can put no parameters in that variable twice, making it optional right?
 
@ziGi Right, so I got the syntax wrong, no biggie.
 
yes
:)
 
7:57 AM
congratulations! you're becoming a nitpicker!
next week you should be hired by @BenjaminGruenbaum
 
I don't nitpick :D
 
even worse, you nitpick and add a proof that it's not a nitpick
 
@Carnal Nope
 
(that blew your mind, didn't it?)
 
Because if you don't pass anything, the result would be
 
7:58 AM
undefined?
 
function (number) {
    return number * undefined;
}
Which is bad for your health
 
you could always do:
function (number) {
    return (number || 0) * 2;
}
 
I see.
Wow guys, thanks for clarifying
I'm trying to move to js a bit more.
 
and learn node js.
 
7:59 AM
@SecondRikudo btw you still didn't get it right, he will have
 
@FlorianMargaine comon ^_^
 
go have fun in another room, kids
 

« first day (1426 days earlier)      last day (3529 days later) »