« first day (93 days earlier)      last day (4846 days later) » 
05:00 - 16:0016:00 - 00:00

5:54 AM
im getting the hang of this jquery stuff and my scripts are doing what I want but.... all the animations are just so slow and clunky ... I think it's time for me to learn about optimization but ... don't know where to start O_o
 
 
2 hours later…
8:22 AM
@JoshRobison Reading the jQuery tag wiki would give you a good place to start: stackoverflow.com/tags/jquery/info
 
Neo
hey @YiJiang
is it ok to store data in fake attributes like I've seen facebook has data-hover and stuff like that... I've seen alot of jquery plugins use "rel" and "class" but can I make something up or some browsers might not work with that?
 
@Neo Those aren't 'fake' attributes - they are allowed under HTML 5
 
Neo
like <a href='javascript:void(0);' fakeatt='23'>
 
You can store arbitrary data on HTML elements with data-* attributes
 
Neo
oh I see
nice
data-anyting?
 
8:28 AM
Yup
 
Neo
is that part of html5?
 
Yes
 
Neo
very nice.. you are awesome
an it be integers
or even start with a number?
 
Not sure, check the specs
 
9:03 AM
Hello there.
 
hola
excuse my lack of
art
 
Hi! :)
 
node.js?
comet?
 
@ryan Closing as Not a Real Question
 
Print Screen… I understand that. but what's Sys Rq? (I always wondered)
 
9:28 AM
Oh. System Request.
 
 
1 hour later…
10:46 AM
morning
 
mornin'
I have a basic regexp question
Say I have a few lines matching /[0-9] *[0-9]+ \([0-9-]+\)/; I want to separate each [0-9] match
 
/([0-9]) *([0-9])+ ([0-9-]+)/ ?
 
I could use parentheses but I think I understand they're used to mean "optional"
(minimarkdown ate my escaping)
 
You can try your regexp here
 
test
" 2       146 (5)"
test.match(/([0-9]) *([0-9]+) \(([0-9-]+)\)/)
["2       146 (5)", "2", "146", "5"]
 
10:52 AM
so it works ?
 
except for the first match... is it expected?
 
Well, I don't know in JS but that's a behaviour I've seen in PHP
ask @IvoWetzel for more information !
 
@ClemDesm Uh... regexp..
 
@IvoWetzel I know you love it
 
Also I'm busy giving prematureopti... I mean, performance advise
0
A: Squeezing performance out of v8

Ivo WetzelFrom my experience: It does inlining Function call overhead is minimal (inlining) What is expensive is to pass huge strings to functions, since those need to be copied and from my experience V8 isn't always as smart as it could be in this case Scope lookup is expensive (surprise) Don't do tric...

 
11:23 AM
f*cking regex >_<
 
@badp If you only want the first result, use test.match(/([0-9]) *([0-9]+) (([0-9-]+))/)[0].
 
@YiJiang Google says 71 views so far, I've added some additional tracking now so we can see what people are linked to and what they click on
 
11:41 AM
@badp Ha, parsing the reputation audit with regex?
 
@YiJiang Concerning the guide (besides the obvious fixings, need to print it out and read it this night on paper), should we add more wikipedia links?
Like for example, weak typing and others?
 
@IvoWetzel I'd rather add more MDC links, actually
Though for general programming concepts I think Wikipedia will do fine
 
@YiJiang OK, then we need some guideline, because otherwise will end up with 50% orange text
 
@IvoWetzel Right. You've heard of the <dfn> element?
 
I think so
 
11:46 AM
It's used for the defining term - ie. the place when a certain term/jargon appears for the first time
 
ok, question #1 how to do that with a markup extension(I'll look into that) question #2 do we want this for: first in guide, or first in section
 
We can used Wiki links in conjunction with that. Anyway, the guideline should be simple - if the term refers to a general programming concept, something unrelated to JavaScript, then we can link it
@IvoWetzel Interesting question; I'm really not sure about whether it should be first in section or first in page
 
Why isn't the placeholder attribute working on input[type=color]? :/
 
I have,
var hash = location.hash;
var newhash=hash.split("#id=");
how can i call newhash? is it newhash[1] to get the id= value?
 
it splits by '#id='
so '#id=foo'
will be '', 'foo'
so yes it's newhash[1]
 
11:50 AM
@Karem I don't think that would make for a valid hash, the = char might not be valid there
 
> Problem at line 4 character 6: Unexpected 'á'. sárga : 'yellow',
This is valid, no problem with that á, so it's just jsLint.
 
@Yijiang what do you mean by valid, it do work?
@IvoWetzel thank you
 
@YiJiang We should also mark links that leave the guide
 
@YiJiang I think that too
 
@Karem Nope, it's valid, I was wrong there
@IvoWetzel We should, yes
 
11:53 AM
also, when linking something like for in loop
 
Is this correct for redirecting users without JS?
 
currently the code and "loop" get linked
 
Not a concern now, but since we're doing this for Wikipedia we should
 
<noscript>
    <meta name='refresh' content='1;nojs.php' />
</noscript>
 
question is, link [for in loop] or just [for in] loop
 
11:55 AM
@IvoWetzel Not entirely sure what you mean there
 
@IvoWetzel
newhash[] = '';
newhash[] = '2'

but when i try to alert(newhash[1]) it says undefined
 
http://example.org/doc.pdf#view=fitb&nameddest=Chapter3 What?
@Karem newhash[] is invalid
 
@karem array[] does not work like push in JavaScript
 
@IvoWetzel The whole thing, [for in loop]
 
@YiJiang ok :)
That's like it's now looks a bit strange but meh
 
11:56 AM
@IvoWetzel For that you can use newhash.push(newValue)
 
2 mins ago, by Nyuszika7H
<noscript>
    <meta name='refresh' content='1;nojs.php' />
</noscript>
Is this correct for redirecting users without JS?
 
@Nyuszika7H @IvoWetzel
var hash = location.hash;
var newhash=hash.split("#id=");

location.hash is: #id=2
 
@Nyuszika7H Why would you want to do that in the first place?
 
@Nyuszika7H unobtrusive JS...
then you don't need redirects
 
And anyway, using the meta refresh tag for redirection is considered harmful
 
11:58 AM
I HATE it when I visit a page and get redirect so some stupid "Oh noez you got nos JS'es!"
especially for NoScript uses hugely annoying
If your page does that, I consider it fail
 
<noscript>
    <script>alert('It seems that you have JavaScript disabled… but it's enabled since you see this alert box. Epic fail.');</script>
</noscript>
 
I love Picard
 
@IvoWetzel Is this you? :P
Actually, the TidyUp script in jsFiddle sometimes does the exact same thing. Example:
Before
 
"Who's that Bald Guy?"
 
var myObj = {
    helloWorld: 'Hello, world!',
    exclam    : return this + '!!!',
    foo       : 'bar'
}
After
var myObj = {
    helloWorld: 'Hello, world!',
    exclam: return this + '!!!',
    foo: 'bar'
}
 
12:02 PM
@YiJiang haha
@Nyuszika7H The first style is horrible...
especially horrible to maintain
add one key or remove one and you have to reindent the whole thing
 
yep… one time I use the first, then I use the second, etc…
 
@YiJiang it's plain text :P
 
hey hey!
 
not html :P
 
@AndyE Hiho
 
12:05 PM
@AndyE Our esteemed room owner is back!
(throws confetti)
 
Stimmung!
(nobody gets that without knowing german comedy...)
 
Back after I dropped my laptop on the floor and had to use my partner's old pink crappy machine that couldn't hack SO chat!
 
£150 to replace a damaged VDU cable. Disgusting
 
Don't tell me about cables...
The power cable of the macbook of my sister broke... yeah... 120€ for a new one
We fixed it on our own then
 
12:09 PM
Yes, but you expect Apple to charge ridiculous prices for cheap stuff. For instance, £25 for an iPhone dock.
£26 for an iPhone bumper - a bit of molded plastic and rubber. How much did that cost you to manufacture, Steve? Jerk.
 
extended, dotall? nice! (regexp)
 
@AndyE Oh, I guess you haven't seen it yet, but we(YiJiang and I) started out own JS Guide bonsaiden.github.com/JavaScript-Garden
 
@YiJiang The only series I watched (bits and pieces of) is Voyager :P
 
@Ivo: cool looks good.
 
12:14 PM
@AndyE it irks me that those bug reports all seem to be private
 
hmm, you might need a connect account. If so, that's really stupid.
hmmm... reckons it's public. You probably need a Windows Live account for access to Connect or something. Logs me in automatically so I'm not sure.
Tempted to re-open it.
 
ppk's new post on mobile browser stats in developing countries is definitely worth a read: quirksmode.org/blog/archives/2011/01/mobile_browser_1.html
 
Nigeria's mobile market share is pretty good.
 
@AndyE Yes they want a LiveID
And since I don't want one, I never filed bugs on the stuff I found in IE9 beta
 
@IvoWetzel I think you can file them using the send feedback option without having a live account. Not 100% on that, though.
 
12:20 PM
@AndyE Well I clicked like a dozen times on that menu item...
nothing happened
And by nothing I mean, absolutely nothing, nada, zero, null. No dialog no nothing
Maybe it didn't like windows 7 starter, who knows
If you want bugs to be filed... make it dead simple to file them
 
@AndyE I am logged in.
 
Anyways, I'll catch you guys later, "job finding coaching" thingadongs now
 
Byesies!
@badp maybe they wanted to hide their shame.
 
Honestly I don't think I've ever seen a working link to that page
It could be that I'm not using IE, or Windows, right now
 
Hmmm... js garden needs a favicon
 
12:24 PM
that wouldn't surprise me either
@YiJiang: would it be difficult to portray a bansai tree with the leaves arranged to look like Crockford's face in a 16x16 image? :-p
 
@AndyE It's Bonsai, and yes, I think it would be rather difficult
 
Oops, Bonsai - sorry :-p
 
12:48 PM
can i transfer a javascript variable to php variable?
 
1:03 PM
@Karem Yes you can, however since PHP is a server-side language you must post the data to the server either via a form submit or Ajax call
 
1:34 PM
Hi to all
I can ask one only thing please?
i'm searching for this issue,but nothing :(
anyone can help me please?
 
@Luca Not unless you tell us what it is
 
How i can set up a minimum size so that you can't go under when resizing the browser.
thanks in advance
with jQuery or JS
?
 
@Luca What do you mean by that?
Be more specific - min size for the window, or an element, or something else?
 
window
is possible?
thanks you
 
No, I don't believe it to be possible
 
1:41 PM
oh.. :/
thanks anyway,and excuse for disturb
 
2:02 PM
back in... blue?
 
in blues :(
 
2:19 PM
5
A: Uses of serialize() in php

fireAdvantages: Turns objects into a string Disadvantages: Turns objects into a string

 
hi there
how do i get a message starred
because i want the badge
 
@TomGullen You say something smart, interesting or important
(This room generates very few stars, by the way)
 
something smart, interesting or important
it hasn't worked
lol
 
Gosh
0
A: Form validation with Javascript and "undefined" problem

Ivo WetzelOK, besides the obviously broken for in loop. This is your problem: var error_msg = []; // new empty array for(var x in errors) { i++; // i starts with 1 this way! // other code } So you're never setting the 0th index. Yes arrays start with index 0. So if you set an index that's big...

No knowledge whatsoever, but he's using jQuery!
 
Why do people use Jquery for such trivial things
It bugs me
 
2:22 PM
Indeed, they should totally drop that...
0
Q: Javascript Address Bar Hack/Trick

benhowdle89We've all seen this: javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 But my question is, how does this actually work, surely if this code isnt in the source code, how does it have any effect when entered into the address bar?

Stupid question day, again
 
I don't think that's a stupid question tbh
 
It's low level, but it's not too bad
At least he's interested enough in this sort of thing to actually ask a question
 
If he would be interested in it he would have used Google before hitting SO...
 
I searched google breifly for it it didn't give much
On how it works
 
Oh yeah there was something...
everytime you type "javascript" into google
you get crap
How could I ever forget about that :)
why does that other answer have +2????
 
2:37 PM
which 1?
 
2
A: Form validation with Javascript and "undefined" problem

raRaRaOne thing I see is: var msg = ; Should(could) be var msg = ""; Did you also try to: alert($('#'+x)); To see if you get any object?

 
Don't you mean +3
;)
 
Holy...... Crockford...
 
Don't give @IvoWetzel an heart attack please.
We, sometimes, need him.
 
That's why SO sucks
@ClemDesm Thx... a.. nothing :P
 
2:40 PM
Have you guys noticed that so many answers nowadays just don't get votes
I swear last year it was easier to get rep
 
depends
If you hit the right time and drop a one sentence answer on a googlable question, you're ensured to get +15
 
Quick question about JS, does anyone else notice significant speed improvement in IE when doing var x; for(){x = assign} rather than for(){var x = assign}
 
@TomGullen IE < 9 ?
That should be no wonder, their engine sucked before 9
 
Yeah <9
 
Looks like "oh we didn't optimize the loop body in any way"
"Just allocate a new x on each iteration..."
 
2:44 PM
Is this something that should be kept in mind when developing an application which will be released in 1-2 years? Or can I assume it will wont matter by then
Performance will be crucial for this app
 
If performance really matters, you already ignore IE < 9 anyways
:P
Besides that
 
It's an IDE for developing applications, so it builds it to JS, you can't guarantee what platform the audience will be on
 
Don't optimize performance and uglify code just because IE6 is too slow...
 
@TomGullen The audience should be developper then. Don't mind IE6.
 
No no, the developers build the apps (games, etc) and then the secondary audience play/use them
Sorry didn't make it clear
 
2:46 PM
If you don't drop support for older browser
they will stay around
that means you will still have to support them
they will stay around...
rinse and repeat
 
Good Morning I guess
 
If you never drop IE6 support, well why then should people upgrade? (those people don't upgrade on their own)
@ircmaxell Afternoon
 
How's it going?
 
@ircmaxell Good afternoon dude
 
2:48 PM
Sup?
 
@ircmaxell The usual ranting about how people vote on SO
 
I gotta say, the answers to that bowling challenge leave a bit to be desired...
 
@ircmaxwell indeed
Idea for next week...
Write hello world
 
I like that idea
 
Add put in as much bad practices as you can!
 
2:50 PM
I'm going to do it in Jquery
 
@TomGullen That's not bad practice at all.... is it?
 
35
Q: Code Bowling on "Hello World"?

Jonathan SampsonContrary to the popular code-golf challenges which demonstrate the genius of many regulars here, I'd like to see that genius illustrated in an antithetical fashion. The challenge is to successfully perform "Hello World" with special focus on over-complicating matters. Not verbosity, not obscurit...

 
there's already one of those
yeah, that one
 
What about a function to add 2 numbers
function add(x,y){return x+y}
You might get some funny ones with that
 
That's not bad
 
2:52 PM
I'd like something that's a bit more challenging but hm, guess the simpler the more participation...
 
Well, that's the point, a simple application leads to interesting possibilities for fubaring
 
but that's no longer what you'd get in the wild
 
function isTheLetterX(x){if(x){return true}else{return false}}
 
true
 
@IvoWetzel I finally found a good use of undefined & null I knew it existed.
 
2:54 PM
@Raynos Tell us
 
There needs to be a balance between simplicity and real-world-fubar problems...
 
orderedList = [];
if (orderedList[index] === undefined) {
     // slot in orderedList was never used.
} else  if (orderedList[index] === null) {
     // slot was used but item has been removed.
}
 
indeed that is a good use
I put it in the guide that null is basically just another data type one can use
 
I can't tell why I want to know the difference between a slot in a list that has never been used and one that has been "cleaned up"
 
who cares!
in theory it works great :)
that reminds me of something
 
2:58 PM
I'm actaully implementing an orderedList as a javascript array right now just like that. Is it bad practice to use an array?
 
If you could use a linked list that might be faster depending on what sort of data you have and how you use it
Depends on your data really
 
Needs to be tested
resolving object properties for the "pointers" might kill performance
 
It's pretty much an <ol>
 
I'd say go with an array
 
3:02 PM
A linked list would make moving them around really easy
 
Well, does it need to be high performance?
If not, do a linked list
If so, test it
 
Linked list might be the best performance depending on # of inserts, it all depends on the type of data you have and how you are using it
If we are talking 3 items then it doesn't really matter
 
OK who thinks it's funny to star everything I say?
8
:kitten join 1
 
@AndyE - I can't pull up the connect article you linked, was it removed that fast?
 
@NickCraver Can you clean up the star list?
 
3:15 PM
Would be very helpful indeed
 
@NickCraver I'm not reading something I need to log-in to see first...
 
@NickCraver it was a bug report, someone else said they couldn't see it but it's set to public and it appears for me.
 
@ircmaxell - That link was for Andy, you'll need a LiveID to see it
 
yea
 
hmm, "The content that you requested cannot be found or you do not have permission to view it. "
 
3:16 PM
Deleted the tweet and linked to the blog post instead.
 
would love to see the bug, re-tweet or DM me if the access thing gets worked out
 
Public – all users can view, add comments, and vote on feedback (preferred)
 
I guess their definition of "all" is a bit off then :P
 
just a tad
jerks
 
They have their own definition of what people need
 
3:22 PM
All = Everyone who doesn't completely hate IE
 
I had the opportunity to listen to a talk by the IE8 team lead right before beta landed
 
@YiJiang , @IvoWetzel - done
 
@NickCraver Thx :)
 
Then we asked questions. One of the questions that was asked was why isn't it ACID 3 compliant.
 
Let me guess...
90% of their users don't care?
 
3:23 PM
His response? We don't think the things it checks for is necessary. We know what people need to use so why do we need to go any further
Same response when we asked about CSS3 implementation
 
sigh
Well, how should people use something else if you don't give it to them in the first place?
 
yup
 
The web doesn't innovate because some standards bodies come up with new ideas
it innovates because people bring up new ideas which then get implement by one or some browser and eventually become standards in the end
this means a lot of quirks in the progress but it's still better then to have a committee decide about what is good or not
 
design-by-committee never works
 
@ircmaxell - C#?
 
3:29 PM
lol
 
If you add up all the hours wasted by fixing IE specific bugs it's the equivalent of a genocide on programmers/designers
Probably the equivalent of thousands of lifetimes
 
my point is there are a lot of design-by-committee things that work great, saying it "never" works is just wrong
 
@NickCraver Hm, was that/is that a real committee? Or just a bunch of excellent MS guys?
 
@IvoWetzel committee, from a lot of sources, for example Skeet has an impact on the next version of the language (MVPs can't, by definition, be MS employees)
most of C++ was designed by committee as well for example
 
@NickCraver: does this link work for you? connect.microsoft.com/IE/feedback/…
 
3:33 PM
@NickCraver Ah, ok. I'm not really into C# stuff in anyway and the C# wiki article is meh, so thanks
 
@AndyE permission DENIED
you added me to the block list, didn't you?
 
@AndyE Is there a bug for IE9 on the broken implementation of the storage event? (for changes to localStorage)
 
that's messed up.
 
I can't believe I didn't know about gmail address variations until the other day
I knew thing@gmail.com worked the same as t.hing@gmail.com, t.h..ing@gmail.com, etc....I didn't know thing+whateveryouwant@gmail.com also worked
 
@IvoWetzel: there's a few localStorage bugs, can you be a bit more specific?
 
3:36 PM
@AndyE The "storage" event should not fire for the document in which the change was made
 
@Nick: yeah, it's useful for filters.
 
So if I have 3 tabs open and do localSotrage.setItem in one of them, the event should only fire in the other two
 
not only that, registering many times for...anything relatively easily, very handy
 
Eh? So if my email is tom@googlemail.com I can give tom+junk@googlemail.com to companies?
 
yup
 
3:37 PM
Nice
 
didn't have to setup a mailbox for each SO twitter account, that would have been fun
 
@IvoWetzel: nope, there's no bug filed for that.
 
I've always wondered which companies sell my address, now I can give them all suffixes and see where the spam comes to
 
@AndyE Then there should be one filed see: stackoverflow.com/questions/4679023/…
 
I don't bother, because I use my gmail account only for spam :-p
 
3:40 PM
You guys seen this engadget.com/2011/01/15/… - It's hillarious
But I suspect it's a hoax
 
0
Q: How to determine the OS path separator in JavaScript (2)?

SpidermanI am looking for the JavaScript constant that is equivalent to Java's: File.separator couldn't find the answer to this question here

sigh
 
@NickCraver Unfortunatly, it doesn't work for 80% of the time if you don't disable JS and 50% otherwise.
 
@ClemDesm I have yet to find a site that actively (or at all) restricts it, do you have an example?
 
@NickCraver Many website forms don't like the + inside email (bad regex). I don't have an example in mind but that's annoying.
 
@TomGullen lol I wasn't expecting that at all.
 
3:47 PM
@ClemDesm it's valid for sure, if you have an example I'd love to see, but I'm using this on 50+ sites without any issues, never found one that didn't allow it, so I'd say your % numbers are way off :)
 
@AndyE that question uh... threw in a close
 
@IvoWetzel I'm thinking about giving up on posting IE bug reports
 
@Andy do you think its fake
 
@TomGullen: absolutely.
 
@AndyE Never give up! Never gonna... oh wait
gosh, people are even flaggin' marc's comments
 
3:50 PM
yeah, dismissing that, it's 100% valid
 
0
Q: what mean document.form in javascript

dramaseaCan I ask what mean document.cookie in javascript, what we call these object? Below is the code: var x=document.forms["myForm"]["email"].value and what is .value?? Thanks!!

._.
 
lol
 
@NickCraver If you say so. Maybe we just don't register to the same kind of websites too. I know this trick for 2 years and could use it only a few times unfortunatly :(. Anyway, I won't just go and find some unworking site right just to valid my point ;)
 
aww, why not?
 
oh I believe you there are sites with bad validation, but I'd be surprised to see anything, say in the top 5000 websites that blocked it
 
top 5000 in visitors ? well that would explain a lot.
@TomGullen Wow...
 
...
 
I love those sorts of questions I always add them to my favorites
They make me smile
-2
Q: how to change this code

user428045SELECT DATE(A.Inspection_datetime) AS Date, A.Model, COUNT(A.Serial_number) AS Qty, B.Name FROM inspection_report AS A LEFT JOIN Employee AS B ON A.NIK = B.NIK GROUP BY A.Model, A.Serial_number

 
05:00 - 16:0016:00 - 00:00

« first day (93 days earlier)      last day (4846 days later) »