« first day (636 days earlier)      last day (4310 days later) » 

AMH
12:05 AM
I know it's about javea but I need urgent help
regarding WCF and asp.net if any
 
12:52 AM
stackoverflow.com/questions/11459291/keyboard-navigation-issue Please check out this question and see if you can answer it.
 
1:43 AM
I'd appreciate help getting some browser jsperf results for various browsers... jsperf.com/stringissubsetof
 
 
2 hours later…
3:23 AM
@ErikE Just did Chrome 21.0.1180.15 on Mac OS X 10.7.4 for you.
 
@rawberg why bother with requirejs when you can commonjs
 
3:51 AM
@ThinkingStiff Thanks! Chrome is super mean on splice() performance! Wow!
 
 
1 hour later…
5:01 AM
hi all and a very good morning
 
5:25 AM
@Abhishek: Hi
 
hi good morning everybody
any body know how to take request.querystring value using jquery
i try this var ID = <%=HttpContext.Current.Request.QueryString.ToString()%>;
but not working
 
use a json encoder
var id = <%=whateverfunctionyouhavetoencodejson(httpcontext.....tostring())%>;
(that's the only really safe way, everything else requires crude escaping to prevent code injection issues)
 
@user968441 hllo
 
6:21 AM
hi
how to use translate in javascript file zend framework???

I have a formatter.js file in this

function xyz(id) { if(confirm("Vill du radera ?")){ location.href = "/student/files/delete/" + id; } }

here i want to use translate for "vill du radera?"

in my view.phtml file i used like this

translate->_("Select Template")?> its working fine..
 
 
1 hour later…
7:23 AM
@kiran , you are making no sense
 
@tereško my duty is done
oh hey @tereško long time no see, how are you doing?
 
mostly derping around this month
hi, btw
 
hello everyone :)
 
@FlorianMargaine flatironjs.org
have u seen that ?
 
@FlorianMargaine finally my jQuery ticket was commented on! bugs.jquery.com/ticket/12031
 
7:32 AM
@Abhishek , i read it as "flat irony S"
 
@Abhishek yeah, it looks kinda hard to get on with tho
 
okay
 
I've json like this jsonviewer.stack.hu/#http://www.greenfields.co.id:502/… , in that json there is object name tipe and I want to sum acvqty, acvval, budqty, budval, value1, value2, value3 in the same tipe(e.g. sum all where tipe is "ESL") how to sum that on javascript?
 
i was googling for node frameworks
found that out
 
it's kinda like Deapan JS
 
7:33 AM
@Esailija yay! didn't know you had a jquery ticket :p
 
oh
maybe it was rlemon
or zirak
 
@Abhishek flatiron is the framework that uses Plates
 
but yay anyway
 
@Esailija cool idea tho
 
anyone help me :(
 
7:35 AM
@blankon91 don't you know + operator
or parseInt()
 
@FlorianMargaine according to specification, this should be primary way of handling events w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener
 
heh, so it's cool
 
@Random I know that but I don't know how to combine all of them on looping with specific condition like I mention before :(
 
"(length>10)&(length<100)".split(/[()><&]/)
["", "length", "10", "", "", "length", "100", ""]
how to keep the split characters?
 
how to do loop in condition like this>> while ( data[object][i].tipe = "ESL" ) { //sum the values }
is that right?
 
7:39 AM
@FlorianMargaine are you trying
0
Q: Javascript split the string

sandip karanjekarI have string like this "(length>10)&(length<100)" And i want this (,length,>,10,),&,(,length,<,100,) Is it possible get with javascript split and regex.

 
use capture in the regex
 
this sounded like an easy solution, but it doesn't seem to work :/
@Esailija capture?
 
"(length>10)&(length<100)".split(/([()><&])/)
["", "(", "length", ">", "10", ")", "", "&", "", "(", "length", "<", "100", ")", ""]
 
really?
 
7:40 AM
yes
documented and everything
 
is that the right looping for json object condition? while ( data[object][i].tipe = "ESL" ) { //sum the values }
please help me :(
 
seems to match OP's expectation exactly, it even has the empty string at the start
:D
 
@Esailija added a filter(Boolean) to remove empty strings :p
but
how does capture work?
 
If separator is a regular expression that contains capturing parentheses, then each time separator is matched the results (including any undefined results) of the capturing parentheses are spliced into the output array. However, not all browsers support this capability.
oh darn
it's in es5 specification
> If separator is a regular expression that contains capturing parentheses, then each time separator is matched the results (including any undefined results) of the capturing parentheses are spliced into the output array.
does not work in ie 7 or ie 8
NOES
 
7:44 AM
seriously?
regex don't work in IE7/8? :|
 
i have a problem.
my comment box is not hiding after posting comment.
here is my full code perfectly working.
Only one error.
http://jsfiddle.net/SLCjS/
 
@FlorianMargaine no I mean the capture thing in split
in IE8 it won't have the captured parts in array
 
yeah I know
 
because it's es5
 
that's what I mean
oh
yeah got it
 
7:46 AM
I guess you have to use match
 
can some one check my little trouble. pls
 
@FlorianMargaine
"(length>10)&(length<100)".match(/(?:[()><&]|[^()><&]*)/g)
["(", "length", ">", "10", ")", "&", "(", "length", "<", "100", ")", ""]
 
outch
I'm adding this in the answer, but I give you all the credit :D
wait
aren't you using capture there?
 
no I am not, this is .match
it's a different method altogether :P
 
anyone has experiences with mootools?
 
7:49 AM
(?: means non-capturing group
 
wait
I'll try to read this regex
help me on there :D
/(?:[()><&]|[^()><&]*)/g
(lol, chtulu egg)
 
it means match a special character, or a string of nonspecial characters
it first looks if the character is a special one
if not, then it moves to the other side of the OR
 
is that the right looping for json object condition? while ( data[object][i].tipe = "ESL" ) { //sum the values }
please help me :(
 
which matches as many non special characters as possible
 
(?: what does "non-capturing group" mean?
 
7:50 AM
it means same as () without capturing it
 
() isn't just capture?
 
@blankon91 ask a question on SO
 
() also groups
 
7:52 AM
@Random okay
 
@Esailija oh so the () there is just to say "do all of this at once"
 
well consider
ab|ab|b|a
then
(ab|(ab|b|a))
it changes the meaning of OR
 
yep, what I meant then (not sure I phrased it correctly :p)
 
like 1 || 2 || 3 || 4 vs ( 1 || ( 2 || 3 || 4 ))
 
but how is that necessary there? there is only one group in the regex
 
7:55 AM
oh yea it's not necessary here
I just like to use it with OR always
 
oh k :p
and how is (?:) different than () ?
 
"hi".match( /(?:hi)/ )
["hi"]
"hi".match( /(hi)/ )
["hi", "hi"]
 
in second one, it's a capturing group
so it captured the result into second array item
 
it's just like DISTINCT? :|
 
7:56 AM
no, look at this
 
"hi".match( /(h)(i)/ )
["hi", "h", "i"]
now we have 2 capturing groups, so the second array item gets the first captured group
and third gets the second capture groupd
 
the first array item is the whole match
 
7:57 AM
but let's say you wanted to match bunch of Hi's
 
so (?:) just means "don't put the capturing group in the result"
"I want to group this regex, but I don't want to have it in the result"
 
it means non-capturing group, so you get benefits of a group but without giving redundant results
 
kkk
@Esailija very helpful, thanks a lot :]
 
(?:asd)* for example
match asdasdasd or asdasdasdasd etc
match the whole group 0 or more times
not just single letter
 
o/
 
8:03 AM
@FlorianMargaine useful example
    var re = /"((?:\"|[^"])*)"/
    '"hello \\" world \\""'.match(re)
[""hello \" world \""", "hello \" world \""]
 
i am happy and i know it :3
 
o wait it's wrong
had :? instead of ?:
lol
var re = /(?:"((?:\"|[^"])*)"|'((?:\'|[^'])*)')/g,
	str = '"hello world" \'hello world \'  "\\"\\"" \'\\\'\\\'\'',
	matches = [],
	match;

	while( match = re.exec(str ) ) {
		matches.push(match[1] || match[2] || "");
	}

matches;
["hello world" 'hello world '  "\"\"", "\'\'"]
 
bbl time to take a nap
and then finish node-ffmpeg-native // partial wrapper / partial binding
 
ok something's not working but you can match strings with re :P
 
everyone ;) can you help me here ?
@Random hi, I've create the question thread for my problem here
 
8:15 AM
re
@GNi33 o/
@Esailija wait, I'm digesting this
@Abhishek nice!
 
while ( data[object][i].tipe = "ESL" ) {
throws random code and expects it to work
 
okay I will try that first and I will give you my feedback
 
that wasn't an answer.
 
ops :(
have you review my code? maybe there's something wrong with it :(
var length = 0;
for (i = 0; i < data[result].length; i++){
while ( data[object][i].tipe = 'ESL' ) {
length++
}
}
alert(length);
@FlorianMargaine is that right?
 
8:33 AM
0
Q: How do I make the bullet shoot in the direction the man is walking in?

HenryHow do I make the bullet go left when the man is facing left and the bullet go right when the man is facing in the rightward direction with what I have below? By the way, I'm new to this site and am very new to learning JavaScript game programming. The code below is based on a tutorial I found on...

 
oh, the woman decided to drop me a line on facebook after 6 days of silence... how nice of her -.-
 
^^
what woman
 
the one that dumped me and called me 2 weeks later, saying she's pregnant... hooray, good times
 
hi everyone
 
pregnant by you? :D
 
8:45 AM
@GNi33 so, she's still pregnant?
 
yep, i guess
nah, she's actually a really nice girl, i'm just pissed off because of the whole situation, whatever
back to IE7 - testing... haha :P
@FlorianMargaine 2 weeks to go \o/
 
for holidays?
 
yep ;)
 
@Esailija stackoverflow.com/q/11467152/851498 sounds like an easy one
but this doesn't work /([a-zA-Z]|[a-zA-Z0-9])/
it's true for number only too, how to change that?
@GNi33 totally :D
oh wait
 
on a side not, i like that your holiday countdown is under /work/ on your page :D
 
8:59 AM
:'( please help me
for(i = 0; i < data[result].length; i++) {
if(data[result][i].tipe == 'ESL')
{
//how to summing data[result][i].cm_val3 where data[result][i].tipe == 'ESL'
}
}
 
@GNi33 hahaha
 
please help me here stackoverflow.com/q/11466580/1160352 I've update my work but it still didn't work :( please
@FlorianMargaine may you check my work update on my question again?
 
@blankon91 I think it's no big deals, just declare counters at zero then increment thems in your loop ?
 
@Fred may you show me the example? my mind just want to explode :(
 
var sum_cm_val3=0;
 
9:08 AM
oh wow...
 
but in my case i want to sum this array (e.g. 123+324+4123+2123) but in my code it's only sum 2123+the number that exclude from my array :(
 
@blankon91

for (var i=0;i<data[result].length;i++) {
var cm_val3 = data[result].cm_val3;
if (parseInt(cm_val3)==cm_val3) {
sum_cm_val3 += parseInt(cm_val3);
}
}
 
decoder binded
yesh
cya
 
@blankon91 should be fine with this, validating if the json property is actually a number before adding it to the sum
 
Fff. Writing libraries is hard.
It's also very easy.
This is a problem.
 
9:11 AM
@Fred okay i will try it, and give my feedback :)
 
@blankon91 I missed the validation of the "tipe", should check :

if (data[result][i].tipe=="ESL")

in my example before adding
 
@Fred adding what?
 
May I ask what does the last 2 parameters in $.mobile.changePage("#id", "transition", false, false)? (jQ Mobile)
The code seems to be written in jQM 1.0, but I can't find such thing in the doc
 
@Esailija found it btw :D I'm becoming a regex master yay! /(?=[^0-9][a-zA-Z0-9])/
 
@blankon91 should be easier to read : pastebin.com/yny2wtyJ
 
9:18 AM
@FlorianMargaine That only matches empty strings. Why does the Q have a score of -1? Seems perfectly valid to me.
 
@blankon91 I edited something into it : pastebin.com/eEgfncqz
 
@Fred ok I'll try that one..and give my feedback :)
 
@adscriven

[ 'ads', '3ds', '3' ].map( function( c ) {
    return /(?=[^0-9][a-zA-Z0-9])/.test( c );
});

[true, true, false]
 
@FlorianMargaine Yeah, it asserts, but matches nothing.
It's zero-width.
 
oh yeah, that's it
 
9:21 AM
It matches something: empty string
 
@Fred It works!! :D finally..thank you very much..God bless you mate :)
 
@nhahtdh That's what I said. :-)
 
@Fred may you give that answer into my question thread? so I can vote up and mark your answer ;) stackoverflow.com/questions/11466580/…
 
Where 'no' === 'empty' and 'thing' === 'string'. :-)
 
It makes sure the empty string between 2 character is never matched again.
nvm
 
9:22 AM
@blankon91 sure, and u're welcome!
 
it doesn't really matter
 
@nhahtdh I think it matters very much. Programming is all about precision.
@nhahtdh Yes. That's a very important observation.
 
@GNi33 dude require your assistance
 
huh?
 
stackoverflow.com/questions/11465190/… this answer is working on jsfiddle but don't work with asp page i tried many work arounds any guess
 
9:26 AM
Btw folks, there's no excuse for not understanding how regexps work. The ultimate guide to regexps lives here: swtch.com/~rsc/regexp
No scary maths. Just clear exposition.
Oh and a v. nice article here if you know Perl. Or if you don't. I don't know Perl and I understood it. (Here: perl.plover.com/Regex/article.html)
 
@adscriven huh yeah, just need to get it done.
which is what I'm trying to do today
 
Russ Cox is one of the guys behind Plan 9 and Go btw.
@FlorianMargaine And tomorrow?
 
maybe.
:p
but yeah, I'm not afraid of them anymore
 
There may also be gals behind Plan 9 and Go. I'm only aware of the high-profile guys however.
@FlorianMargaine Quite right. Regexps are actually pretty simple compared to many things that programmers have to deal with. The knowledge just doesn't seem to be very widespread. Read my links!
The funky syntax doesn't help.
 
Yep, the funky syntax just makes me want to puke.
and btw, swtch.com/~rsc/regexp this link is scary :D
 
9:34 AM
@FlorianMargaine Nooo! You've been conditioned to think that. Read the first article, swtch.com/~rsc/regexp/regexp1.html
 
I'm on it
 
There isn't any tough programming in there. It's a walk in the park compared to async IO.
It's just unfamiliar.
 
> The two graphs plot the time required by each approach to match the regular expression a?nan against the string an.
woot?
 
Thank god for edit.
 
@adscriven heh, I'm using async IO in the bright side tho (node.js API is nice)
 
9:36 AM
@FlorianMargaine Yep! (Apart from all the sync stuff .... ;-))
@FlorianMargaine Yep. Woot.
 
> Seeing the two graphs side by side prompts the question, “why doesn't Perl use the Thompson NFA approach?” It can, it should, and that's what the rest of this article is about.
hahaha
> Today, regular expressions have also become a shining example of how ignoring good theory leads to bad programs. The regular expression implementations used by today's popular tools are significantly slower than the ones used in many of those thirty-year-old Unix tools.
bashing people level : high
 
@FlorianMargaine Well, to a point. That's as far as it goes with the trash talk. It's a rock-solid article.
 
yeah that's what I'm seeing
he goes into detail then :)
 
He goes into a necessary level of detail, but keeps things as simple as possible.
 
yeah it looks nice now
 
9:43 AM
You'd have to be a genius to get it all in one reading. But read it a few times and you'll understand in principle how regexps work.
Better still, have a go at writing a regexp engine in JS.
It's not as hard as you think.
 
well, understanding NFA and DFA already helps
 
0
Q: Template vs Direct DOM manipulation?

Ravii have a scenario to build the html table and add some values to it. values are changing as the user navigates between the pager. so what i thought i will use the templates. this is the thing which every one does. Build the entire table and load it's content by ajax in every time the navigati...

 
Yep, plus the backtracking stuff that Perl, PCRE, Ruby and most popular stuff uses.
 
I guess it would be slow to use a non-native regexp engine in JS; should see how can it be easier to use that way
 
The reason being that it then becomes easy to implement stuff like backreferences.
@Fred Yes, but for certain regexps against certain inputs a non-native NFA-based matcher will be faster.
 
9:51 AM
@adscriven right
 
Hmm, V8's regexps are pretty quick these days. I found a blog post which said they avoid backtracking where possible. Maybe V8 uses a backtracking/NFA hybrid.
Can't find any more info. though.
 
never used regexp too much, got used with ajax validation, then data types get validated server-side as well
 
@Fred You shouldn't use regexps too much.
They have their place.
 
yeah, just don't parse html with regex
or [\>]
 
:-)
 
9:56 AM
Is there any way to prevent the hash from being save in the history, except for using $.mobile.changePage() with option?
 
Don't parse pretty much anything with regexps!
 
how to trigger chtulu already?
 
(jQM)
 
@nhahtdh Interesting. Why don't you want it in the history?
 
9:57 AM
@nhahtdh .on( 'click', function( e ) { e.preventDefault(); location.replace( this.href ); });
 
Navbar on footer
 
I don't get it. Why shouldn't URLs end up in the URL history?
 
When navigating around, I don't think back button should go back to previous tab, but should go back to previous screen
 
because we can!
 
Then don't make URLs reference a tab.
Duh.
 

« first day (636 days earlier)      last day (4310 days later) »