« first day (1431 days earlier)      last day (3507 days later) » 

12:49 AM
@SomeKittensUx2666 Some process is better than no process :P
 
Not in this case.
 
I need to calculate the sagitta based on the area of a segment and the radius of its circle.
I can't figure out how to reduce it down to those three variables
 
Is CodeSchool always insanely buggy?
 
....what. Adding expect(oi.models).to.be.an(Array); to my unit tests causes jQuery to throw TypeError: 'undefined' is not a function (evaluating 'type.toLowerCase()')
Let's also note that jQuery is not used in this test or the code it's testing.
 
hahaha how do you know its jQuery?
 
12:56 AM
stack trace
Whoops - should have been expect(oi.models).to.be.an('array');
...which fixes the jQuery issue.
 
jQuery must be in there somewhere though, no?
 
Useful exception messages for the win
 
it doesn't use insteanceof?
Wait, that wouldn't work.
I guess it makes sense.
 
Unless your unit tests just got bored and decided to ruin your life...
 
@twiz Browserify
 
1:00 AM
You unit test after browserifying?
wait... I think I just forgot that unit tests could be run in a browser....
 
Everything would crash pretty hard if we didn't.
 
I prefer running unit tests in node with jsDOM and such.
I might just be an insane person.
 
@twiz Can be.
 
@twiz That's very sane, in my opinion
 
Ok good. haha
@monners For some reason it doesn't always detect that I changed the "file", so it thinks it's wrong when its right.
 
1:11 AM
I m able to clone the image only once but not multiple times

http://jsfiddle.net/32pw3syh/3/

Above is the original fiddle which I m working on

http://jsfiddle.net/timspqr/1xnmtyqs/

Above fiddle has an example of multiple drag and drops ( cloning )

Failed JS Fiddle http://jsfiddle.net/32pw3syh/8/ cloned and could drag and drop only once
 
@James 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.
 
I think the tests are just making fun of me now:
AssertionError: expected [Function: newModel] to throw 'Error: you are doing it wrong' but 'Error: you are doing it wrong' was thrown
 
1:24 AM
lol
 
@twiz Yeah, I've run into that before. It can also be quite opinionated about how it expects you to arrive at the correct output. Something might work perfectly in node but fail in their tests because you're using shortcut to put together your return data
I had one challenge fail because I used === instead of ==
 
That's strange. You'd think they would use the output.
 
Pretty sure my brain is melting right now
 
acid?
 
1:47 AM
@copy cat
 
 
2 hours later…
3:38 AM
@SomeKittens It'll last a week. Sep 20th is when they'll announce it
 
3:49 AM
Just saw the tweet
cool
 
4:34 AM
Wow, this keyboard's gonna take some getting used to
 
4:46 AM
Does anybody know if I can add a timestamp to a $save in angularfire?
 
@EmptyPockets 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.
 
I am passing in a task here $scope.Tasks.$save(task);
but stuff like task.completedTime = Date.now() doesn't seem to work
 
why shouldn't it?
 
@monners loud?
 
4:58 AM
Not really, got the brown switches
Feels great
 
It's already starting to feel more natural than the chicklet keyboard
Das Keyboard FTW!
 
user1607528
i am trying to see what jquery code executes when hovering a link. but when using profile in firebug it shows originial jquery code functions in jquery.js. I want to find the code where the event is attached to the link ?
 
6:08 AM
HI
 
how to push the values of two captured groups into an array?
 
push the first, and then the second
 
see regex101.com/r/jT3pG3/21 . I want to push the values of group 1 and group 2 into an array.
 
String#match?
 
6:14 AM
what have you tried?
 
> ".one .two.three.four".match(/(?=(\b\w+)\.(\w+\b))/g)
[ '', '' ]
> var s = ".one .two.three.four"
undefined
> var re = /(?=(\b\w+)\.(\w+\b))/g;
undefined
> function getMatches(string, regex, index) {
... index || (index = 1);
... var matches = [];
... var match;
... while (match = regex.exec(string)) {
..... matches.push(match[index]);
..... }
... return matches;
... }
undefined
> var matches = getMatches(s, re, 1);
it won't shows the contents of matches variable.
instead i get a blinking cursor.
 
6:29 AM
Hi
 
@MAliQadar 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.
 
@BenjaminGruenbaum gonna be late
 
Anybody knows a js library that can allow me to have 2d infinite scroll of images ?
probably virtualized [ cause this is somebodies birthday present ] composing of all the photos they have ever taken :-/
 
@BenjaminGruenbaum good morning mate :-)
 
6:37 AM
Mornin
@Mosho getting a bike :P?
 
hows it going ?
 
fine, you?
 
great :-), gonna meet MS Ventures India high chair people in november
and launching beta asap.
but i have around 12 hours to debug a HUGE bug.. I have forgotten to make sneha's birthday present
 
Hi folks facing issue relevant the angularJS
 
@VikasGarg 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.
 
6:45 AM
it is relevant to $http service
I am sending post request to other application on same infrastructure
which is google app engine
but getting "Errror- Bad request" Malformed or Illegal Exception
kindly can anyone help me out for this issue..?
 
@AbhishekHingnikar: On first glance, this might be what you need: 1stwebdesigner.com/tutorials/infinite-scrolling-tutorial
 
Interesting fact is that it is not at all sending request to another application
 
@VikasGarg: Your post is probably missing some parameters, or has incorrectly formatted data
Or is sending it to the wrong url
 
hmm no I checked for other user
and it is working fine
My assumption till yet is that
this request is too much long, hence not able to send request to server only.
 
Try clearing your browser's cache. Maybe your JS isn't up-to-date
 
6:48 AM
That I ensured.
@Cerbrus one line may help you:
For the case of client-defined limits, there is no sense on the server returning something, because the server won't receive the request at all.
This line is got during searching answer to my query.
SO one thing is sure this limitation is due to client defined limits
So can you help to resolve this issue
 
Not without the code you use to post, and information on how the server handles the post
Which seems like a reason to post a question on SO.
 
Hmmm
 
Why this code ends with a blinking cursor?
> while((res = rule.exec(str)) != null)
... {
... values.push(res[0]);
... }
 
@AvinashRaj: How are we supposed to know? What is rule, what is str, what is values and what is res?
 
> var rule = /(?=(\b\w+)\.(\w+\b))/g;
undefined
> var str = ".one .two.three.four";
undefined
> var res;
undefined
> var keys = [];
undefined
> var values = [];
undefined
> while((res = rule.exec(str)) != null)
... {
... values.push(res[0]);
... }
 
6:54 AM
hey
can I ask a question about CSS in here?
 
pastebin please. These dots are distracting
 
@AvinashRaj: That script actually broke my browser window
I'm guessing it's an infinite loop.
 
@AvinashRaj rule.exec(str) is always truthy.
Or always falsy.
It doesn't change over the iterations.
 
7:01 AM
@Miszy Not unless you change str in the loop, which I don't see him do.
 
What, no. Read the link.
exec always operate on successive matches
 
Ah, so magic.
Don't use it.
 
ok how do i apologise to the mrs for making her miss her train, because i wanted to chat to a friend en route?
 
It's not magic, it's quite known behaviour :P
 
@Miszy Magic can be quite the known behavior, it doesn't matter.
 
7:03 AM
Each regexp has lastIndex property which tells you exactly what you're doing right now.
 
Morning.
 
It's magic because some hidden variable gets moved, because you call the same function twice and the result is different :P
 
Any way, the problem in the code is that his while is getting into an inifite loop.
 
@SecondRikudo Ever heard of iterators? lol.
 
@Miszy It's a bit different with an iterator.
 
7:04 AM
Oh, well, Array.prototype.pop is magic too according to your definition :P
 
It's pretty obvious what it.next() does, don't you think?
@Miszy Of course it is.
 
@Cerbrus i think you're correct.
 
You call it twice and get different results! :D
 
@AvinashRaj: I know I'm correct ;-)
 
.pop() is a stack thing, not an array thing. JS Arrays were forced to take the role of a stack because JS doesn't have stacks.
 
7:05 AM
what i have to do to get the results?
 
Which is fine, but I prefer to not use .pop() unless for very specific purposes.
 
What are you actually trying to do?
 
@Neil sometime ago you suggested regexr.com/39gln this tool to test regex, but according to developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/… it seems, that my expression is correct, but then question comes up. Why there are no matches?
Is this the tool issue or is it the expression?
 
52 mins ago, by Avinash Raj
see http://regex101.com/r/jT3pG3/21 . I want to push the values of group 1 and group 2 into an array.
@Cerbrus
 
@Eugene It's because you anchored it with ^$
Remove the $ and it'll work.
I'm not sure why, but lookaheads don't play nice with $ and lookbehinds don't play nice with ^
 
7:08 AM
@SecondRikudo …
I don't even.
 
That's my code style.
 
@Eugene you mean this regexr.com/39glq ?
 
I experienced that .pop creates confusion for future me and other developers I work with, so I decided to avoid it when possible.
That's all.
It's not evil or something.
 
Kind of is.
 
@SecondRikudo but if I need to validate whole string, then it means I can't use lookahead?
 
7:09 AM
"My developers don't know this part of JavaScript so we don't use it"
 
.pop Shouldn't cause confusion, though.
 
@Miszy Not really
 
@AvinashRaj it's different from what I posted.
 
It's easy to forget that the array now contains one less elements.
 
@Cerbrus well… it doesn't cause any confusion for any developers I know ;)
 
7:10 AM
Especially when you do functional where nothing should have side effects.
 
yep, i modified to match the number which is followed by three digits.
 
Hello, Why when I use webRTC the event onicecandidate is called 5-6 times. Should I use addIceCandidate 5-6 times or one time is enougth
 
@AvinashRaj but I need it to be valid for whole string from start ^ to end $.
 
doesn't (?=<this>) mean "match when <this> is before"?
 
After
according to doc.
 
7:13 AM
@Anton_Sh Hard to say without the code :P
 
x(?=y) - Matches 'x' only if 'x' is followed by 'y'. This is called a lookahead.
 
How about this?
 
Ooh sorry im asking straight away
but how can I add very fast a target_blank
for an new tab in this line?
 
@AvinashRaj to be more precise I'm trying either to find or write validation for such numbering format 1 200 000.00 | 1 200 000,00. At the moment I only was able to find how to create one. Take string without spaces and string.replace((new RegExp('(\\d)(?=(\\d{3})+(?!\\d))', 'g')), '$1 ')
 
        $(".menu-639 a").attr("href", "http://sweetcommunication.eu/sales.pdf")
 
7:15 AM
@Duikboot What do you mean by "very fast target_blank"? Is a usual one too slow for you for some reason?
Why do you want to add it in the first place? :P That's bad UX.
 
nono I have to find the soluation urgently :D
 
@Miszy this is the code(for example) data.yodase.com/questions/f511e16ffad84e37b586c436e791c06a When I put console.log in onicecandidate, the code was executed 5-6 times
 
It's just for a testing presentation
 
Hey dudes, may anyone explain AMD for me?
 
@ReihaHosseini 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.
 
7:16 AM
but it should open in a new tab
 
@Duikboot In jQuery there's attr function: .attr("target", "_blank");
 
I saw that too
 
but how to add it to the existing link? :D
because I am alreayd using attr
 
7:17 AM
@ReihaHosseini if you have any specific questions then I'm happy to help
 
$(".menu-639 a").attr("href", "http://sweetcommunication.eu/sales.pdf").attr("target", "_blank");
is not going to be working I guess
 
@Duikboot Why not?
 
@Eugene could you ask it as a question?
 
@Miszy I read them, but i can't understand correctly :( if you can, define it in one simple sentence for me please
 
7:18 AM
@Duikboot You can also use just one attr call since it accepts a plain object as it's parameter.
@Duikboot attr({href: 'http://google.com', target: '_blank'})
@ReihaHosseini I can't do any simpler than that
> Asynchronous module definition (AMD) is a JavaScript API for defining modules such that the module and its dependencies can be asynchronously loaded.
 
thanks :D that's awesome
 
@ReihaHosseini So you define a module and then other modules can inject it asynchronously (load it only when it's needed)
 
@Miszy No :D I didn't mean that! I wanna know why should we use that? Older way is already working, isn't that?
 
@ReihaHosseini What older way?
 
@Miszy Including files
 
7:21 AM
It all depends on what you need. You should take a look at this article: requirejs.org/docs/whyamd.html
 
@Miszy Thanks man
 
@ReihaHosseini I really recommend taking a look at Browserify too
That's not really AMD, just syntax sugar and possibility to use npm modules in front-end apps.
 
@AvinashRaj sure I can. I’m just not sure, that it won't be considered as too localized and put to sleep due to that.
 
@Miszy :ThumbUp
 
7:37 AM
@Miszy Thanks for youhr help. I needed this fast solution for a presentation,.. went awesome. thx
 
Hey everyone !
I got an issue. I am getting CORS error on PATCH request
but GET request works just fine
 
@charger73 So you need to modify the server response.
 
Take data from server
and then modify
Yes !
 
Each cross-domain request has so-called "preflight" request: OPTIONS
Your server has to provide proper headers in the response to the OPTIONS request
especially this one:
Access-Control-Allow-Methods: GET,PATCH
 
RIght now i am using header('Access-Control-Allow-Origin: *');
 
7:48 AM
@Miszy yeah... this one is required on old android stock browser only afaik
maybe the default is only GET for his case
 
@charger73 What about Access-Control-Allow-Methods ?
 
@Miszy Just added
 
but on this old browser... even with GET you need this header
 
Still not working
 
What do you mean by not working?
 
7:50 AM
i Added header('Access-Control-Allow-Methods: GET,PATCH');
and i am getting this: XMLHttpRequest cannot load
 
@charger73 Where did you add it?
 
XMLHttpRequest cannot load . No 'Access-Control-Allow-Origin' header is present on the requested resource.
on top of file
 
What file? :O
 
the php one
 
something like this? header("Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS, PATCH");
 
7:53 AM
yeah..
 
What about Access-Control-Allow-Origin is it there too?
 
The whole thing : header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Methods: GET, POST, PUT, OPTIONS, PATCH");
 
On which request do you get the error?
 
PATCH request
 
PATCH or OPTIONS?
 
7:54 AM
user image
9
 
self.updatedata = function (dataId, patchData) {
$http({
url: url + "/" + dataId,
data: patchData,
method: "PATCH"
}).success(function (data)) {
console.log(data);
}
}
 
Can you paste the screenshot of the error you get?
 
angular service function
 
From the devtools?
 
8:08 AM
@Eugene My apologies if I suggested a tool that didn't work for you. I wouldn't have done so if I thought it was inaccurate. That said, how the hell should I know why it didn't work for you?
 
@Neil I explained, that I'm not sure was it tool or my expression. No need to get angry :)
 
@FlorianMargaine It's been a while since I've seen a picture that really lives up to the "one picture is worth a thousand words" reputation.
 
@Eugene I didn't mean to jump down your throat
Frankly just a little tired of being blamed for things by association these days
Guess you hit a sore point
 
@Neil I ACCUSE!
 
@SecondRikudo YOU NEVER LOVED ME! *runs away crying*
 
Tom
8:22 AM
an anyone please help me on this question i have posted? stackoverflow.com/questions/25863812/…
 
@Tom 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.
 
@Tom You asked it barely 5 minutes ago. Give it time.
We've seen it the first time.
 
Small other issue:
$(".menu-639 a").attr("href", fullURL + "T&C-CSO.pdf").attr("target", "_blank");

How can I let the & charachter work in the string from my url?
 
@Duikboot &amp;
 
8:24 AM
Please tell me you don't actually have a class name called .menu-639
 
why am i having to tell a contractor to test his work
 
@SecondRikudo: Good call on the dupe vote
 
=)
MJOLNIRED!
 
Wish I'd have thought of mjolnir. Damn rep leeches answering that question
 
@Cerbrus Downvoted them both.
Answering duplicates is not helpful.
Especially coming from 8k and 11k users.
 
8:31 AM
Yea, I dv'd those answers, too. and cv'd the question
 
@AvinashRaj so here is the question stackoverflow.com/questions/25864064/…. Hope it woun't be considered as too localized or dupe., since I looked and haven't found a solution present on SO.
Yep. Seems the score is already going down :(
 
Oh :P can't use ' in tags
@Eugene: You could try to convince management that supporting 1 strict number format is more reliable
!!s/could/should/
 
@Cerbrus @Eugene: You should try to convince management that supporting 1 strict number format is more reliable (source)
 
@Cerbrus if I could I would, but you are looking at the problem as a developer like me, but those who described the task look at it from the business point of you. There is no way to override this view.
 
So, in your company, programmers are expected to just build what they're told, no matter how stupid or impossible it may be?
I mean, who in their right mind accepts both 1 200 000.00 and 1 200 000,00, and 1 200 000,0000
 
8:45 AM
If 1 200 000.00 is passed, then it is converted into 1 200 000,00. If 1 200 000,0000 is passed it is converted into 1 200 000,00
So the result format is one 1 200 000,00 thousands part separated by space and decimal part separated by comma.
But accepted as valid formats are those, that are specified in the task.
In other words, those are formats, that systems knows how to transform "if transformation is needed"
 
@Eugene: I think you'd be better off using a input masking plugin
 
@Cerbrus Use norepro
0
A: Regex for validating currency number format

Second RikudoStop trying to solve every problem with regex. Regex is great when you have one or two very well defined strings. Not a million formats. This can be solved with minimal regex. Magic is in the bold part. var numbers = [ "1200000,00", "1200000.00", "1,200,000.00", "1 200 000.00", ...

@Cerbrus That's not always feasible.
 
norepro?
 
UX-wise, you want to allow the user to input whichever format is more comfortable to him
And it isn't that much of an issue to support a wide range of number formats.
@Cerbrus [tag:can't-reproduce] vs
 
oooh
Hm, imo, input masks are a pretty clean way of telling a user "We want this format"
 
8:52 AM
@BenjaminGruenbaum no, overslept :P
@SomeKittensUx2666 hey man, missed your ping
 
@Cerbrus error message will tell him, that validation was incorrect, but all in all user will know what are acceptable formats. Knowing correct format and typing correct format are two different things.
 
@Eugene I don't understand your comment.
 
@AshokKumarReddyS 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.
 
@SecondRikudo something specific or everything?
 
@Eugene Are you trying to validate or parse?
 
8:56 AM
@SecondRikudo validate. It is even in questions title.
Parsing is not the issue.
 
@Eugene Added another answer for validation.
 
what 2D canvas API do you know ?
 
@Basj Unicorns
 
@SecondRikudo ?
 
@SecondRikudo removed my comment
Thank you very much.
 
9:13 AM
@SecondRikudo what do you mean ? I google unicorns, but didn't find anything relevant ;)
 
@Basj I was kidding.
 
What he actually meant was leprechauns.
 
@SecondRikudo that's what I suspected ;)
 
your winks are annoying
@Basj there is only one. What do you mean exactly?
 
!urban winking
 
9:15 AM
@FlorianMargaine -.O
 
@FlorianMargaine there are some libraries like EaselJS, Pixi.js, fabric.js, paper.js, etc. that adds thinks to the <canvas>
 
oh, you mean libraries
 
@FlorianMargaine yes !
 
@Mosho you should get your sleep cycle right :)
 
9:22 AM
@Zirak this is a pretty good competitor for your hello world: github.com/Herzult/SimplePHPEasyPlus
 
@SecondRikudo you really outdone yourself. :) Even a diagram was added. Nice.
What tool where you using for that purpose?
 
9:36 AM
3
Q: Javascript: Difference between `new Date(dateString)` vs `new Date(year, month, day)`

Kamran AhmedReferencing to the accepted answer on this question How do I get the number of days between two dates in JavaScript?. I see, in the function parseDate: function parseDate(str) { var mdy = str.split('/') return new Date(mdy[2], mdy[0]-1, mdy[1]); } He is doing this: var mdy = str.split...

 
I would like to do something special..
I selected a div but I want to: select the first class from the above HTML element with classname pane-title
 
posted on September 16, 2014

And here’s the first table updated according to the new IE8-and-up rule. It’s past time I updated the DOM Compatibility tables, even though they’re not as exciting as they were ten years ago. These tables are mainly about innerHTML and friends, though they also detail some other properties of HTML elements, such as classList and dataset. Unsurprisingly, all desktop browser

 
@Duikboot you using jQuery, vanilla js, or what?
 
jQuery @DrogoNevets
 
@Duikboot closest?
 
9:47 AM
@Duikboot $('div').children('.class').first()
 
I'll try to make a fiddle :)
This should explain everything: @FlorianMargaine and @DrogoNevets :)
 
3
A: Velocity.js - stopping animation callback

Patsy IssaWould you prefer a CSS approach instead? Set your header's css to : -webkit-transition: all 0.5s; position:fixed; top:0; left:0; Add a new class for the desired height: .shrink{ height:50px; } And in you js toggle the class : var header = $('.header'); $(window).on('scroll', functio...

To throttle or not to throttle that is the question
 
@Duikboot that clears things up?! hardly
 
Is it not clear what I want to do? @DrogoNevets
 
10:10 AM
@Eugene regexper.com
2
 
Ok I figured it out how to move the element in the other one appenTo worked
but then its added to the bottom of the html structure can I put it someway on top?
Dummy examply current result
<li>data</li>
<li>data</li>
<h1>My moved element</h1>

Can I do this?
<h1>My moved element</h1>
<li>data</li>
<li>data</li>
 
Anybody familiar with this?
1
Q: Validation error while submitting app to Firefox Marketplace

indie blueI was validating my manifest on this page with this manifest URL of my app hosted on GitHub: https://raw.githubusercontent.com/my_username/my_application/master/manifest.webapp This is the error I got: Manifests must be served with the HTTP header "Content-Type: application/x-web-app-mani...

 
10:33 AM
Hi I am trying to display button in my Three.JS plugin. Any idea how to achieve that?
 
10:43 AM
@Duikboot get the parent containers first child, and then do before()
 
hi all
here i'm trying when the last div set is deleted, add delete button to its previous div set
 

« first day (1431 days earlier)      last day (3507 days later) »