« first day (26 days earlier)      last day (4939 days later) » 

12:00 AM
That might be the problem with your script. Perhaps the focus call is happening while the user is still holding down the mouse button or key they used to move to the textarea.
 
Tek
@Na7coldwater There's no clicking involved, it should happen as soon as the page loads.
 
Why does that crazy editor take 50% of my CPU? When typing in an answer :(
 
Tek
@IvoWetzel There's a lot of crazy editors, which one are you talking about specifically?
 
@Tek The one at SO
 
@Ivo It's probably generating a live markdown preview or something.
 
12:08 AM
@Na7coldwater Yeah, but apparently it does so on every keystroke
 
@Tek The problem seems to be that the onInit thingy isn't firing. Perhaps you should just do setTimeout(function(){$("#content").tinymce().focus()}, 3000) and wait for TinyMCE to fix that bug. )-:
@Ivo I like a fast preview
 
@Na7coldwater Not when it's starting to slow down the actual responsiveness of the textfield
 
@Ivo I wonder how you would go about finding out how much your script is slowing things down so that you could make it run less often?
 
@Na7coldwater profiling comes to mind as a term ... firebug or chrome console
 
@drachenstern I meant from within the script itself....
 
12:19 AM
you can't
how do you have your program decide automagically that using 100% of the CPU is not what the user intended?
you can't autothrottle yourself, you don't know all the conditions
you could run a timer before and after key events and keep track of how long it takes you to do things
but that's another form of profiling
 
@Na7coldwater Profiling just shows that the markdown converter of WMD does a cuzillon of calls
@drachenstern Well I imagine that you could use some timers to see how long it takes to parse the thing and then adjust the parsing interval or something.
 
@IvoWetzel Maybe count the time in between calls. If it's too short it either means that the user is typing very fast or that the function is taking so long that the user has time to type their next key. Either case would be a valid reason to slow down the rate of repreviewing for a few seconds.
 
The only thing I hate more than slow editors.... TwitVid. Shows the US only commercial to me but then it doesn't play the actual video
 
@IvoWetzel you can't say what it is if you can't define what you're profiling, of course. Plain statistics
it just depends on how you know you're impacting performance
do you give the user a slider?
 
Tek
@Na7coldwater Thanks for the suggestion, I'll have to try it out later though. I have other matters to attend to. Thanks for the assistance, I appreciate it a lot!
See ya around guys.
 
12:27 AM
@Tek Glad I could help.
 
12:53 AM
Do any of you have strong opinions towards canvas vs inline svg?
 
@david in reference to? static images? I would go with inline SVG myself
something dynamic? canvas
 
I was thinking dynamic, i've fiddled around with both and am kinda torn as to what i should focus on
why would you go with canvas?
 
for dynamics? because SVG is inherently a static element, even if it is dynamically resizeable
 
That's pretty cool
this is done with svg: jsfiddle.net/ctrlfrk/8jKES
ill try find one of the canvas things
they both seems pretty well suited to it, i guess i can google for some comparisons
 
that's a pretty good risk map
 
1:05 AM
took me a while to draw it ><
never got round to doing the actual gameplay though :S
 
The map would have been better done in SVG. It's mostly static.
 
yeah, in hindsight i should have put up a different one
but the idea behind it was to have little tanks and shit shooting each other, so there would have been dynamic stuff going on
 
You could have just put a canvas in front of the map.
Draw the tanks on that, and draw the map on an SVG element.
 
@Na7coldwater does that still allow the elements underneath to respond to onmouseover?
 
Probably not.
I tried to overlap a canvas on an entire page once, but I couldn't make it possible to interact with the page normally.
 
1:15 AM
and I would expect that
 
I even tried using elementAtPoint to try to find the element underneath the canvas, and fire the event on that, but it didn't work.
 
You should also look at RaphaelJS @david
 
a slightly more interactive canvas thing
(it's how i drew the map)
@drachenstern i will google that now
 
looks pretty cool! i was in the middle of writing a little module to simplify my SVGing, this might save me some time
laters
 
@david my eyes!
 
@YiJiang did you experience complete awareness?
 
@david No, I was too busy digging my eyes out with a pen
 
ahahah
 
Tek
2:24 AM
do not want 3.0
 
aaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh, thanks, now I've got colorosis :(
 
function(){ console.log("hello world!"); }
 
you didn't call it :o
it has no name, no friends, it simply disappears!
fades into the ether as you so eloquently put it
 
 
1 hour later…
3:44 AM
muuuudkips
 
@david i liek ur mudkeps!!1!
 
dey r teh fienest mudkips in aaaalll the lands!
 
4:04 AM
hmm, home time
cya all later
 
 
3 hours later…
6:59 AM
Interesting problem:
2
Q: jQuery UI 1.7.3 datepicker conflict with date.js causing "too much recursion"?

MarkHi, I'm trying to use jQuery UI 1.7.3 datepicker widget in a jQuery UI dialog. The contents of the dialog are from a page template which includes all the various imports of javascript required to make the page function. One of the things I also import is the famous date.js file. This page tha...

I'm guessing that date.js modified the prototypes of some of the functions used by the datepicker, causing the thing to blow up
 
@YiJiang Hello
Hello @Every One
can an one give me some links for jQuery bubble pop up for Textbox
 
7:33 AM
"Changes to the C++ representation of JavaScript values allow Firefox to execute heavy, numeric code more efficiently, resulting in cleaner graphics..." What?
 
@IvoWetzel Erm... I think it means smoother animations
 
@YiJiang I don't consider that numeric heavy JS, more like uh... timers and HWA
 
@YiJiang Hello
 
 
3 hours later…
10:13 AM
morning
 
morning
@rchern: did you notice the blockquote bug was fixed in Chrome today? I looked at the code and it seems the team preferred the browser detection method over the replace function method I suggested.
If it gets the job done, I guess...
 
@AndyE I guess Sam's back to using that method then.
 
@YiJiang: looks like it, but I didn't even get a reply to my comment. I guess he didn't have time.
Although I wouldn't have minded at least a confirmation that he saw it and a thanks for my attempt to help.
 
11:02 AM
can you emulate C# properties in javascript
Obj.thing instead of obj.thing() . is there a way to not call functions directly?
 
@Raynos: ECMA 5th Edition implementations allow it through Object.defineProperty(), other versions of javascript may or may not support the __defineGetter__ and __defineSetter__ functions
 
this is more of a question about accessing a field that is a self executing function
and the function re executes every time I access the field
 
@Raynos: that's only possible with the above methods.
@Raynos: last link is probably the best to get started with. note: no Internet Explorer 6 & 7 support, IE 8 support is limited to DOM objects only.
 
@AndyE Thank you, i know about those. thought there might be some trick In the language I could use
 
Tom
@Raynos, you forgot to join our special room!
 
11:18 AM
@Raynos: unfortunately for all of us, there aren't any special tricks :-P
 
@AndyE cant we just branch ie8 and then call for a merge? Im sure microsoft will merge in our improvements
 
@Raynos: feel free :-P
 
@AndyE cant find ie8 on github
 
11:48 AM
In terms of raw speed. is there much of a difference between jagermonkey, v8 & Carakan?
 
@Raynos If you would like to believe Mozilla, arewefastyet.com
 
@YiJiang I hadnt even considered nitro
@YiJiang how does carakan stand on the sunspider test wrt those 3?
 
afaik v8 still has a slight advantage over the rest. I guess it also still is the only engine that partly compiles javascript into assembly, no ?
 
@jAndy: no
 
@Raynos I have no idea. The thing is those test are supposedly done with the js engine separated from the rest of the browser, so there's no easy way to do these tests yourself
 
11:52 AM
> Chakra includes a new JavaScript compiler that compiles JavaScript source code into high-quality native machine code, a new interpreter for executing script on traditional web pages, and improvements to the JavaScript runtime and libraries.
Chakra = IE9
 
Can I see a set of sunspider benchmarks online somewhere?
 
Tom
I wish they'd just all use V8 and work on it together as happy people
 
ok - cool. Sounds cool at least
 
@Raynos Yeah, but 95% of them are outdated by the time they appear
 
@AndyE: few benchmarks I googled say chakra is anyway behind v8
 
11:57 AM
@jAndy: that's true, but IE9 isn't final yet. Even if it doesn't catch up to v8 (which is likely), the performance isn't way behind.
 
@AndyE: ieblog.. :p
but yea, I guess they did a good job there
who knows, nodeJS might run on chakra some day :)
 
I'm suspending my disdain for Internet Explorer until IE 9 is released :-P
 
Where can I find a html5 vs browser online compatibility chart?
 
@AndyE: btw you were right. .textContent does not throw an exception on IE. I was a little confused from the jQuery source. Resig did put a try..catch around his globalEval() while using .appendChild(scriptnode). So that might throw on some browsers for some reason
I'm still wondering why they're using appendChild(document.createTextNode()) instead of .textContent() or the fallback case .text() on IE
 
12:05 PM
@YiJiang that doesnt talk about websockets or webworkers
@jAndy presumably setting textcontent overwrites child nodes
 
@Raynos: should not be a problem on a self created script tag
 
<span> <strong> text </strong> </span> You need to append a text node or the strong tag dissappears.
@jAndy oh. never mind then
 
@Raynos Yes it does - try searching for it "Web socket" and "Web Worker"
 
How does websql work?
 
@Raynos diveintohtml5.org/storage.html#future - The conclusion here I think is "don't use"
 
12:12 PM
I see.
Is there any point in using server-side events and websockets at the same time?
 
there is no .splice()-like method on strings, is there?
 
@jAndy Well, .replace('something', '') sort of works like that
 
@jAndy theres .slice
 
Or maybe str.substring(0, n) + str.substring(n + lengthToSplice)
 
ay, but slice() does not remove the substring
but indeed, I didn't think about just using replace
but hmm
 
12:18 PM
why does the string class have a .toString method -.-
 
@Raynos It's inherited from the object prototype I think
 
because it inherits from Object
 
Nope
String class overwrites the .toString method
I guess if its going to inherit it it might aswell overwrite it
 
12:34 PM
@jAndy did you get it working in the end?
 
@AndyE: yes. Using pretty much the same algorithm, just skipping the try.. catch. works perfectly on all chromes, firefox 2+, IE6+ and safari. didn't test opera so far
 
great stuff.
 
but by naming it, I'm really curious if opera knows about textContent.. might be the reason why jquery is using .appendChild(doc.createTextNode), but I hope not
 
@Raynos Correct, String, Number, Array and Function all have their own prototype.toString() method that works differently to Object.prototype.toString()
 
anyway, using a multipart xhr stream to transfer all of your scripts in one request, evaling or -script-tag-inserting-with-textContent on readyState3 works so great and so incredibly fast. really cool.
 
12:39 PM
@Raynos the result is a string primitive, not a String object
typeof new String(); //-> "object"
typeof (new String()).toString(); //-> "string"
 
12:53 PM
@jAndy :) how do you get multiple scripts in a single request? What are the advantages of eval vs script tag insertion
 
it's alll opensrc ;)
 
I need to leanr how to use github properly
 
Hello @Every one
can any body give me link for bubble tool tip for input controls like textbox
 
you mean the title attribute?
@jAndy got lost half way through. my understanding of native xhr thats not wrapped by $.ajax is non existant.
 
@Raynos: the terrible downside of <script> elements is, they block the render process. Even if that is quite fast on cuttingedge browsers, plus each request creates a lot of overhead data. So using a single request to transfer several files at once is way more lightweight
 
1:04 PM
@jAndy check for webworker. If webworker spawn one and delegate the script execution
 
@Raynos: sure, websockets would solve this issue even more elegant with even less overhead.. but unfortuantly we're not living in the world like this. :)
webworkers and websockets are just not around yet
 
@jAndy ff4 chrome 7 ?
 
@Raynos: well.. who can afford to create a website only for users who use such browsers?
 
@jAndy feature sniff. If you can use webworkers use them else fall back on your current solution
@jAndy currently only ie doesnt support webworkers, safari/opera/ff/chrome are all supported
 
WebWorkers are awkward when it comes to graceful degradation.
 
1:08 PM
@AndyE why?
 
@Raynos: because a web worker script doesn't work in the same way as one that runs in the current context.
 
I don't think webworkers perform well on a task like this (loading scripts and stuff), so yes a feature detection for websockets is more reasonable
 
@AndyE in jAndy's case all he wants to do is attach script src to the dom
 
I don't think thats possible
 
@Raynos: web workers don't have access to DOM
 
1:09 PM
webworkers dont have access to the DOM
 
@jAndy all you want to do with a webworker is globally eval the loaded javascirpt source
Oh.
Any code evaluated in a webworker wont have access to the DOM ?
 
correct.
 
I guess its safe to say no-one wants to make the DOM threadsafe :P
 
hehe
 
I thought they made the DOM threadsafe :(
 
1:10 PM
oh boy, I hate CMD+Q on macos
 
I've been investigating areas I thought might potentially provide a way to web workers in IE. Unfortunately, none of them panned out.
 
@AndyE fork by creating a new window :p
 
@AndyE: if someone would ask me why I would use a webworker for right now, I wouldn't have any brilliant idea
looks like it's only good for doing heavy operations like calculating.. stuff, maybe for WebGL rendering or whatever ?
 
@jAndy webworkers should be useful for sitting on a websocket and wrapping the input stream ?
or do websockets have their input stream internally threaded?
 
not sure
 
1:14 PM
@Raynos that is the only way to get "webworker" code running side-by-side with the main code in IE.
 
@AndyE I was supposed to be a joke :(
 
@Raynos: yeah, I figured :)
 
firefox, mozilla and mdc keep making references to chrome like "chrome code" does this have anything to do with the chrome browser?
 
@Raynos: no
 
1:15 PM
hehe
 
chrome is pretty much firefox's UI code
 
who was first, google or mozilla ? ! ;)
 
@jAndy netscape? :P
 
for real?
that old
 
1:18 PM
4
A: jquery - passing parameters to functions

Nick CraverIn this case I'd use a data- attribute, like this: <a href="#" class="showmsg" data-sound="bark">dog</a> <a href="#" class="showmsg" data-sound="meow">cat</a> And your click handler can fetch it, like this: $("a.showmsg").click(function() { alert($(this).attr("data-s...

 
@jAndy turns out you dont need to sit on the input stream. You just pass an eventhandler for the message from server event
 
....why are people still locked into thinking HTML4 is all you can use? It's assumed by many downvoters
 
Hello
$("#txtSearchValue").keydown(function(event)
		        {
                    if ( event.keyCode == 46 || event.keyCode == 8 )
                    {
                    }
                    else
                    {
                        if (event.keyCode < 95)
                        {
                            if (event.keyCode < 48 || event.keyCode > 57 )
                            {
                                event.preventDefault();
                            }
                        }
the above code will accept the number
 
One word: In-den-ta-tion
 
bt i want it to accept - and /
 
1:19 PM
@IvoWetzel that's a lot of words strung together, and I have my doubts about "ta"
 
@NiteshKatare edit and click fixed font
 
can any body tel me how to make the changes in the code to accept - and /
 
@NiteshKatare what about using the charcode and a simple string of allowed characters with an indexOf?
 
@IvoWetzel you cant use charcode! Strict warnings in firebug spam at you for using charcode
 
1:22 PM
@IvoWetzel im new to jQuery i got this code from internet
 
oops That should have gone to Nick
 
now the requirment is changed so i have to modify the code
 
@NiteshKatare asciitable.com any code between 48 & 57 is a number. So change the if statement to include 47 and 45
 
well 95% of that code is JavaScript
 
@Raynos i tried to modify the code but it still not accepting the - and /
 
1:24 PM
`if (event.keyCode < 45 || event.keyCode > 57 )`
will work since 46 is blocked manually
 
let me try
 
Seperately does anyone have experience or opinion on joose.js ?
 
@Raynos still its not accepting
 
@NiteshKatare it should. Your doing something wrong :p
 
@NickCraver I hope that wasn't my fault, I made a comment in my answer about HTML 4 validation
 
1:27 PM
@NiteshKatare probably somethings broke in the rest of the code
 
@Raynos will send u the jsFiddle link in 2 min
 
@AndyE not at all, more of assumptions made by people
 
@jAndy Finally, I have got a Chance to see you face :)
 
well the guy is not wrong there. html4 validators will fail on that, but then again you have to ask yourself - who cares
 
downvoting means it's incorrect, IMO, so it does bother me a bit when the answer is perfectly valid for the question - if it says HTML4 only solutions that's fine, then I would have posted a "this works in every browser, it just won't validate" in the answer along with it
I think many programmers tend to make assumptions that the same restrictions apply to every question as they deal with daily, e.g. if I deal with only HTML4, so must every other programmer...and they make incorrect assumptions like that
 
1:29 PM
@NinjaDude: uhu, yay :P
 
@NickCraver I agress its best to have raw html validated by a validator. and break the html4 validation afterwards with javascript dom manipulation
 
in some cases, like data attributes specifically, I say screw the validator
there was a REAL need in HTML4 for this, that's why it was added to HTML5 in the first place...the validator is....for what? think of it that way
it's to make sure it doesn't break anywhere...this doesn't break anywhere either
IMO validating just to validate, and not validating to ensure your page works everywhere is a complete waste of time
 
what's the point of validation anyways? Do I care about putting that ugly sticker on my site? No. I do care whether it's working in all browsers
ok, all browsers except IE6, but I do test for Netscape4, just in case!
 
@Raynos jsfiddle.net/niteshkatare/UqgCU u can view the example
 
@IvoWetzel lol
 
1:32 PM
dear lord, you gotta love it to switch from PC to MAC several times.
 
Agreed, it's a waste of time in most cases, I do run the validator over our site every so often to check for issues, but things that work cross-browser 100% I immediately ignore
 
Can any body have a look @ this code
http://jsfiddle.net/niteshkatare/UqgCU/
 
@NiteshKatare looking
 
@NiteshKatare what do you want it to do?
 
i want the code shld accpt - and /
 
1:35 PM
I would suggest stripping what you don't want as the value changes via a regex
 
@NickCraver I'd second that
right now it does accept $!& and a couple of others too
 
A better option would actually be using type="number", but the lack of a method to remove the stupid spinner is really making this far less useful than it should be
 
Try this instead:
$("#txtDate").bind("keydown keyup paste", function(event)  {
    $(this).val(function(i, v) { return v.replace(/[^\d\-\/]/g,''); });
});
 
I've seen at least two questions asking about how to hide the spinner on Chrome and Safari, but there's no satisfactory answer
 
@NickCraver keydown and paste fire too early, keyup fires too late
 
1:44 PM
@NickCraver Thanks a lot
 
@AndyE - I'm not preventing the event :)
 
It's just plain stupid. The W3C should give developers more control over the display of these form elements
 
this covers all bases by replacing the value
 
@NickCraver: the point was that you can't replace the value if it hasn't changed yet :-P
 
the keydown is really just to give quicker feedback when holding the key, e.g. if it started invalid
 
1:45 PM
 
@YiJiang what is said spinner
 
$(".txtDate").live("keydown keyup paste", function(event) {
$(this).val(function(i, v) { return v.replace(/[^\d\-\/]/g,''); });
});
:)
 
lol
 
who wants this one?
It's got Java and JavaScript in it :)
0
Q: Operating System Detection by JAVA or JavaScript

nilHi, I need to detect OS name & version in JAVA. That I can do by String os_name =System.getProperty("os.name", ""); String os_version = System.getProperty("os.version", ""); but the thing is that this is not so much reliable. Sometimes it returns incorrect informations and even it can't de...

 
1:49 PM
ha! Internet Explorer 9 PP6 supports oninput
 
....correctly?
 
@NickCraver: I haven't fully tested it yet (but FWIW, I'm not sure that Chrome or Firefox support it correctly)
 
Nick, don't you trust IE to handle the interwebz correctly? :(
 
and current versions of Opera are atrocious with oninput
 
1:53 PM
Opera screws up far too many things :)
@IvoWetzel - Let's just say I have more respect for Microsoft Bob
3
 
@NiteshKatare jsfiddle.net/UqgCU/7 A really poor solution extended with keycodes :)
 
There's something weird about the favicon userscript I'm using
 
hmm... when I type atrocious, I automatically start it by typing attr. Damn you, jQuery!
 
I sometimes inexplicitly fails after a couple of hour of working properly
 
what's the script do?
 
1:55 PM
@NickCraver Replaces the default SO Chat favicon with one that gives you the unread msg count and @-mentions
Like what Better GReader does
 
not familiar with it - use feeddemon here, though I've found no good solution for feeds
if feeddemon used webkit...or well, anything except IE, it'd be perfect, but it uses IE for the internal browser
 
@Raynos but its not accepting -
 
@NiteshKatare Which keyboard layout do you have? It's working on my german one
(And yes I know german is one of the worst layouts for programming... EVER)
 
I have standard one
@IvoWetzel thanks for your help
 
@NiteshKatare jsfiddle.net/UqgCU/8 that should work. you do press run right?
 
1:59 PM
@Raynos not accepting numbers on the keypad though :P
 

« first day (26 days earlier)      last day (4939 days later) »