« first day (81 days earlier)      last day (4861 days later) » 
01:00 - 14:0014:00 - 00:00

I think he found them, they were in the link posted above
 
ah well... :)
 
 
4 hours later…
5:12 AM
ahhh making progress on the JS thingy :)
 
gotta love the thingy.
 
@RebeccaChernoff Good morning(?)
 
23:18pm (:
 
@RebeccaChernoff Thingadongdong, dammit :P
 
Writing line after line of that JS core guide here
 
5:19 AM
But that isn't what @IvoWetzel said. ): Yell at @IvoWetzel not me!
 
a work in progress version
No spell checking so far :P
 
@IvoWetzel JavaScript 's, not JavaScripts
Also, I won't really call them bugs - the language is spec'd like that
 
We all know why it was spec'd like that...
MS copied all the bugs of the original implementation
so they're are both
but I will change the wording
 
@IvoWetzel Ah, right - of course - Microsoft's 'too successful' copying of Netscape's original implementation
 
I call it a mis-design then
 
5:35 AM
You can't really call it a whatever of the parser though - I don't think people tend to think of js as been parsed
 
well at some point the bytes get parsed into the ast etc.
@YiJiang I've added you as a collaborator, so if you want add edit the stuff :P
 
@IvoWetzel Not now, I need to go out for lunch
But later, maybe
 
@YiJiang Me wants lunch too.... eating cookies atm...
Too many cookies already
 
wait, why should 2.toString(); // syntax error work?
2 is a primitive, not an object
 
It's a Number
Number is an object
> Object.prototype.toString.call(4) // the only way to figure out the real type of something
'[object Number]'
 
5:53 AM
it only looks like an object because js is sneakily changing it into an object in the background
alert (5 == new Number(5)); //true
alert (5 === new Number(5)); //false
 
no
in the second example you're comparing an object against a number
While, yes JS is interpreting 5 as an object
but then again the same holds true for Ruby
I hardly doubt that numbers in Ruby are real objects in the background
we should not dig into the implementation specifics again >_>
the "frontend" of the language is broken enough
 
just because it doesn't work the way you want it to doesn't mean it's broken
 
Sorry, but the parser is broken here
It should see that it's not a float
 
for example, javascript objects are not hash maps :S they behave very similarly, and can often be used as a substitute, but they are not the same
 
6:17 AM
changed the wording then, although the spec does not say anything about the implementation of objects, gnah whatever
 
the spec doesn't say a lot of things, unfortunately :(
i was looking through to see if it mentioned anything about calling functions directly only literals
 
6:56 AM
and not to forget it's a horrible PDF
 
7:08 AM
heh
i'm liking chrome's built in pdf reader
saves me having to download it
normally i'm not keen on built in things doing stuff i don't need... i still feel it should be optional whether you have chrome's viewer or adobe's
but in this case it's useful
 
7:22 AM
:kitten jstypes
 
Regexs are functions in Chrome?
 
Well at least that's what typeof tells you
 
you're suggesting it's better to use 'tostring'? which anyone can overwrite?
 
If you one overwrites Object.prototype.toString
KILL HIM
 
you're also saying it fails when you're comparing between documents...
surely that's correct?
 
7:26 AM
instanceof fails
 
just because the types have the same name in 2 documents doesn't mean they are the same type :S
 
You have two different JavaScript "runtimes"
The Class value is always the same
1 sec
I gonna quote the spec
 
and the types could be wildly different between them...
 
> The value of the [[Class]] internal property is defined by this specification for every kind of built-in object. The
value of the [[Class]] internal property of a host object may be any String value except one of "Arguments",
"Array", "Boolean", "Date", "Error", "Function", "JSON", "Math", "Number", "Object",
"RegExp", and "String". The value of a [[Class]] internal property is used internally to distinguish different
kinds of objects. Note that this specification does not provide any means for a program to access that value
instanceof fails since two documents have different JS contexts
So Object in one is !== Object in the other
 
it's not failing ><
 
7:29 AM
Wording again
 
Object may have had all sorts of changes made to it in one context
which might not have been made in the other context
 
It does not do what you might think it does
 
sure it's bad practice, but it's possible
 
And since typeof returns crap
the toString is the only way to find out the type
and low and behold jQuery uses it too
 
so it must be right? :P
jquery is not written with correctness in mind, it is written to be cross browser compatible
i would not use it as a reference for how to write your own code
 
7:31 AM
Then tell me the correct way...
using typeof?
and browser detection?
 
are we talking about correct ecmascript? or somethign that will work in any js implementation under the sun?
 
We're talking about real world
So yes, the latter case
 
then I wouldn't be comparing the textual name of the class
 
But?
 
i would resort to duck typing, and compare all the properties of the object, and a known object of the class you're testing against
but in reality i wouldn't
because i'm not going to encourage that sort of crazy shit
i'd use typeof, if i really had to
 
7:35 AM
with some browser detection?
(stupid question of course, since there's no other way)
 
the browser detection would be : "if this doesn't work, tough titties"
 
Great...
 
7:59 AM
ok time for a break
and some croissants
:kitten quote
 
> "A clever person solves a problem. A wise person avoids it." - Albert Einstein
 
8:35 AM
Hi.
 
@ClemDesm Hiho
 
hi
 
8:54 AM
Hi, Any SO powerusers here?
Ok, I'll take it to META then
 
@mplungjan Bah, won't you at least wait a second?
 
:)
Hi
 
So what's your problem?
 
I have a question here: stackoverflow.com/questions/4584845 where the answers are so good and clever that I think they might be worth doing a wiki
Also I have a hard time deciding who has the best answer
 
> Associative array are also arrays, no?
 
8:58 AM
The question started out as a "fix my closure" but is now more like "3 ways to make a counter"
 
@mplungjan First, I don't see why they should be converted to CW status just because they're good
 
@Ivo Wetzel Yes to me they are
 
@mplungjan The difference is that associative arrays preserve order
 
@mplungjan As for this, haven't you already accepted an answer?
 
JavaScript objects do not
 
8:59 AM
So basically I want to know: What is a wiki then if not a way to preserve something as "canonical ways to do stuff"
@IvoWetzel aha, no space in your name
 
@mplungjan The chat does not support spaces in names so you have to leave them out
 
@mplungjan No it's not. It's an invitational for other users to edit the answer freely to make it better or to update it
 
I accepted the answer that answered MY question, however answers were given that answered THE question ;)
 
@IvoWetzel Or rather, the commenting system doesn't. @mplungjan also, tab to autocomplete
 
which ended up to be "How do I have multiple counters on a page that use setTimeout correctly"
 
9:01 AM
Always accept the one that solves your specific problem
 
Yes, but what was the question
 
I can post you the solution for the worlds energy problems as an answer... but that won't help you with a JavaScript alert
 
Often people ask questions where they have a specific solution already, but the answer is actually to do something completely diufferent
So MY particular question was "How do I fix the closure issue I have gotten into by using a specific way of solving someone else's problem"
 
Well there are times when posting a different solution is superior than just fixing a bug in an already bad one
 
but some of the answers given was "How does one solve the issue of multiple timers without breaking on the setTimeout/setInterval being blocked on occation"
Exactly
 
9:05 AM
In the end you have to accept one, you can still upvote the other when they're useful
 
I did upvote - but what should I do with this question which contains answers to some useful question, rather than to a bind I got myself into
I would for example like to rename the question and make it more interesting
 
@mplungjan You could edit your question, change the title, give a more generic version of your problem, although you should keep the old version at the end so that it's clear why the accepted answer was accepted in the first place
 
Right. So this would not make it a potential wiki thing?
 
@mplungjan Well as YiJiang already said, wikis were primarily made so that many people could improve the answers / questions
 
As indeed happened here :)
 
9:09 AM
Then they got used for subjective topics, best of lists etc. (since they don't give reputation)
and then the option to make something CW from the start got removed
31
A: What can we do to make Community Wiki better?

wafflesImportant Change - Status completed Users can not mark questions wiki anymore, across the network. I have an easy idea for a fix. Disable the option to mark questions community wiki by the question author. (allow them to become CW naturally if thats what GxD wants, or allow moderators to) ...

 
OT: What is the dotted line I see here now?
 
@mplungjan The stuff that happened since the last time you focused onto the chat window
 
new messages since you the last time the window lost its focus
 
ie. stuff that were said while you were away
 
ahh. thanks
Ok @Yi
Ok @YiJiang @IvoWetzel what do you feel I should do with this?
question - edit as suggested?
"You could edit your question, change the title, give a more generic version of your problem, although you should keep the old version at the end so that it's clear why the accepted answer was accepted in the first place"
 
9:12 AM
@mplungjan I don't entirely see the need to keep the previous version at the end - just leave a note saying that this is a more generic version of your old question, and that for the original, see the revision history
 
Ah - that is of course possible. However that is for powerusers I would think
 
man already wrote like 900 lines
all straight from my brain... >_>
 
@IvoWetzel Can I just say that you're making a very strong assumption about the reader already been familiar with C-like language syntax (eg. for loops, arrays, etc.)
 
Different question?
 
@YiJiang Uh yes... atm I just want to get the knowledge about all the quirks in there
And I'm not planning to do a "learn JS in 21 days" thing
 
9:16 AM
@IvoWetzel Fair enough
 
Anyway, thanks for your inputs
I'll get back to work :)
PS: Can I link to a specific answer in my question?
 
@mplungjan Sure you can
 
Oops. did not see the "link" UNDER the answer
thanks
 
@YiJiang Gonna push to the repo pretty soon, I've split up the thing into small pieces I want to keep them separated
 
@IvoWetzel Thanks @IvoWetzel
 
I'll do some copy-editing
 
@YiJiang Sure go ahead, there's still lots of stuff to be added working on the === one right now
Also I have to go through and remove "you" etc. I want to use 3rd person
:kitten jstruth
 
@IvoWetzel So no ECMAScript 5 in here then?
 
@YiJiang Not yet
I may add it later
I'm quite happy I got it started at all this night
 
9:49 AM
How do you block decimal to 1 number after comma (or dot) in JS?
 
@ClemDesm toFixed?
 
@YiJiang Maybe... how do you use it ?
 
@YiJiang that returns a string
If you want to round
 
@IvoWetzel Yeah, but otherwise. Anyway, if you need a number just x10 and round, then divide by 10
 
Math.round(1.2 * 10) / 10
 
9:51 AM
>>> Math.PI.toFixed(1);
"3.1"
>>> Math.round(Math.PI * 10)/10
3.1
Grrr... Firebug
toFixed then parseFloat should also work, although I'm not sure if that's faster than the other method
 
mmm I understand. But I got another problem then
I got a list of number where they can be integer or number like 63633.600000000006. It would be nice if integer would show up w/o number after comma and the other like 63633.60 ... :(
 
@ClemDesm The divide then multiply method should let the number remain an integer if it was one to start with I think
Oh, you want to identify integers and floats. Hmmm
 
I guess I should give it a try.
 
Think there should be at least one SO question about it.
 
it doesn't stop... more and more things coming to my mind I have to write down...
 
9:59 AM
does anyone know some nice tutorials with reallife exampes of websockets ? I'm trying to push new values to the client browser instead the browser keep refreshing new values.
 
I may have found the root of my problem...
onSuccess: function(xhr)
        {
			var result = eval(xhr.responseText);
eval !
 
....
!!1111111
:kitten eval
 
@ClemDesm O_o
 
So you want to summon them, the horrible abominations of hell, you want to open the gates of the apocalypse and doom us all? Well, hold on a second then. *Doug here's someone who want's to talk with you!*
 
Seriously, never trust other developer, they can leave the code like this if it works for them.
 
All right. In my case, xhr should be a json with 2 elements. How do I transform it into an array ?
 
One of my favourite JavaScript devs on the internet. He's also on SO too :P
J-P, Europe
15.1k 1 13 35
 
Is it ok when I rant against the omitting of {} for one line if/else ? :P
 
@IvoWetzel Hehehe... you're wondering dangerously close to been a style guide here
 
FX you suck
don't close my app tab
^---- reason for ranting about KR
 
10:14 AM
@IvoWetzel Is the global object always window? I don't think that's case for node.js code, for instance, right?
 
No in node it's uh the global object
 
Seriously, every tutorials on the internet use eval for json and ajax ?
 
Did I write that somewhere? If so that needs to be removed since I want to keep this neutral
I always write JS engine instead of Browser
 
@IvoWetzel No, just asking
 
@ClemDesm Yet another topic we need to handle in the garden
 
10:15 AM
@ClemDesm It's teh intertubez! Expect to find tons of outdated and wrong stuff, especially for JavaScript
 
We also need a page on further documentation
So basically a link to MDC
 
Also, the usual 'the a in ajax stands for async' question
 
Then, can you give me a link to a good tut? Or explain it to me ? I must admit, I always used jquery for ajax u_u
 
Hmmm... I just noticed a window.toString in the article on this
 
Are there any solutions to emulating title attribute on disabled elements? Without breaking the disabled property.
 
10:17 AM
Deja Vu?
 
@Raynos Custom tooltips lile qtips or another of the half-gazillion tooltip plugins out there?
 
raaaage
hitting Ctrl-K in FX instead of VIM closes the tab -.-
 
@IvoWetzel ctrl + shift + t
 
Gnah I just use the mouse :P
Have to remember enough shortcuts for VIM
 
Seriously, that's almost the only shortcut I remember for Firefox
 
10:19 AM
@YiJiang Ah yes, need to mark this a browser specific
 
Is it me or developer.mozilla.org/en/using_xmlhttprequest is full of errors that doesn't show Dah CodEz ?
 
@ClemDesm Yes it's partly broken
 
@ClemDesm Yes, they're doing some migration or something that's breaking the wiki
 
great.
 
Very unfortunate. There's a feedback page for the new MDC which you can complain to though :P
 
10:22 AM
@YiJiang Does it work on disabled elements in firefox (which dont have mouse events) ?
 
@Raynos Hmmm... probably not, but you should be able to wrap it in a shrinkwrapped element to do the same
 
@ClemDesm Oh boy...
 
@YiJiang but the wrapped element will behave glitchy. Or be placed on top of it and the button cant be clicked when its later enabled
 
@ClemDesm If you want to parse JSON, just use JSON.parse with fallback to the json.js library
 
10:24 AM
@ClemDesm is full of errors
2
 
@YiJiang JSON.parse is cross-browser ? :S
 
@ClemDesm json2.js JSON.parse is supported in IE8+ & the rest
 
@Raynos The second scenario will never happen - parents can never be rendered on top of their children
As to the first, stop event propagation on the disabled button should work I think, to prevent the event from been called too many times, or use evt.target to filter out the correct ones
 
json2.js = this one ?
 
@YiJiang if the parent is rendered behind the mouse event doesnt trigger consistently unless you add at least 10px of padding
 
10:28 AM
@ClemDesm yes
 
@ClemDesm yes
 
@ClemDesm There's a regex infront which prevents function stuff etc
@ClemDesm You need to parse the text to JS at some point
 
@Raynos Eh...? Well then you can always go nuclear and catch the evt on the body element, then calculate the mouse position w.r.t. to the button and do the tooltip with that, but....
 
ahhahahaha
nooooooo
@CodingKitten Stop them!
 
10:30 AM
@IvoWetzel Ah. great reference You can use ffmpeg crashes because the has a nice 4-pane display...
 
@ClemDesm you have a string. You want a js object. What other possible methods do you have then eval ? The only other option is script injection, which basically lets the browser eval it
@YiJiang Catch mousemove on the entire page :D
 
@Raynos Will someone please think of those poor IE users with their anaemic JavaScript engine?
 
@YiJiang this is to fix a firefox bug :P
1
Q: feature detection firefox quirk with title attributes not showing on disabled elements

RaynosHow would I go about using feature detection to find out whether I need to emulate the title attribute on disabled input elements. I'm aware that firefox claims & interprets the specification so that it is working as intended but I would none the less like tooltips to display. The only thi...

for more details. The accepted answer is a pain in the ass because theres about 1200 references to .disabled in the project
 
@Raynos Then just rename the plguin, geesh
 
@YiJiang I didn't mean that. I meant I don't wnat to replace all element.disabled = true with $(element).disableThis();
 
10:36 AM
why 98985.6 - 3535.2 = 65450.4000000000000001 in js >_<
 
I just expected there to be an elegant solution but there isn't :(
 
@ClemDesm Oh, hey, welcome to the IEEE 754 club
 
@YiJiang Right, so it seems the problem doesn't come from the eval afterall :)
@YiJiang Any hint ?
 
@ClemDesm Use toFixed with prejudice? Not much other than that, really
 
D:
Won't it screw my loop up ? Like "it becomes a string" then you can make anymore math operation on it ?
 
10:41 AM
@ClemDesm Oh, you want the usual 'float minus' thingadongdong?
 
?
 
16
A: Elegant workaround for JavaScript floating point number problem

Michael BorgwardtFrom the Floating-Point Guide: What can I do to avoid this problem? That depends on what kind of calculations you’re doing. If you really need your results to add up exactly, especially when you work with money: use a special decimal datatype. If you just don’t want to se...

 
parseFloat(num.toFixed(10)) should work in my case then....
 
@ClemDesm Number.floor :) and work with integers
@ClemDesm ew parseFloat try +num.toFixed(10)
 
ok what to write about null
I wrote quite some stuff about undefined but uh yeah... null is...
 
10:51 AM
@IvoWetzel that it exists solely to confuse people? Yeah...
 
I gonna take look at the spec if that says anything
 
Alright after talking to my boss, I just need to truncate the decimal. How to do that in js ?
rounding to integer towards zero
 
@ClemDesm Math.round, Math.floor, Math.ceil take your pick
Or, if you know that the number is always > 0 and you want to floor, ~~
 
floating-point-gui.de/errors/rounding I need to float towards zero like on this page
(and yeah, it will always be > 0)
num.toPrecision(1) ?
 
0
Q: How to detect that JavaScript and/or Cookies are disabled ?

sword101Greetings all I want to make a script that checks if the JavaScript or Cookies are disabled in the user's browser and notify him any help ?

 
11:00 AM
easy.
Dang num.toPrecision(1) doesn't work.
 
@IvoWetzel Oh hey, I can't believe that hasn't been posted before
 
Ah ok
Found one use of null
Unset Prototypes default to it
Now only the big question, when the fucking hell would a prototype be unset by default!
 
@IvoWetzel Amen
 
Yatta ! parseInt(num, 10)
 
11:17 AM
dude
null is a bitch
to summarize: Mainly used internally, can be used in exchange with undedinef at many places
OK, let's see how we can automatically convert this stuff into a nice format
 
@IvoWetzel null is just a value. You set and check for it. Its like setting bools to false by default. I have an object. Im going to set it to null. Ill check for null if its null then ill do stuff with it
 
@Raynos Yes, just another data type, I put it that way in the doc too
 
This conflicts with the use for undefined. Undefined should be used for error checking instead. Null is used checking whether I set it as nothing
undefined sets it as nothing by anything else but me.
if (bla === undefined) // is this nothing when I dont expect it to be nothing
if (bla === null) // is this nothing when I expect it to be nothing
null doesn't have to mean it went wrong. undefined almost always means it went wrong
 
11:34 AM
ruby sucks
 
@IvoWetzel use perl.
 
@Raynos I want to use github.com/rtomayko/ronn
just installed rvm setting up 1.9.2 now
So in short it's compiling da rubyz atm
hm have those Kernel patches landed already?
GCC is hitting the CPU at max
But Video etc is still perfectly smooth
<3
 
@IvoWetzel The opposite of roff? What does that mean?
 
@YiJiang uh... well it generates something like expressjs.com/guide.html
 
@IvoWetzel Can it really? That would be pretty cool
 
11:45 AM
I'll see
ruby really takes forever to compile
ah now it's working
 
@IvoWetzel thats quite useful. I'm using naturaldocs But I need to make the outputted html not ugly with css magic
 
12:09 PM
hm doesn't do what I want
gonna roll my own build script then
 
if you find a good auto API/documentation thing, tell me.
something that reads my source and writes docs for me would be great.
 
12:37 PM
@IvoWetzel did that pyramid guy ever come back?
 
@Raynos Nope
 
@IvoWetzel have you doing anything with O3D ?
@IvoWetzel link to js wiki ?
This will raise a ReferenceError, complaining about count not being defined. Which makes sense, since foo.hack was not defined inside the scope of Counter. Actaully it will create a global variable called count :)
 
which file?
 
@IvoWetzel WIP.
 
oh yeah, I know
fixed
thx
 
12:57 PM
@IvoWetzel jsfiddle.net/Raynos/gnsxa can I improve this. Is this (internally) safe?
Is implementing semaphores even neccesary in javascript?
 
@Raynos Single Threaded
But if you want to land on the DailyWTF just go ahead
 
@IvoWetzel asynchronous event loop
get object. set callback somewhere, pass object to callback. Ensure object does not alter between now and when callback gets called.
 
@IvoWetzel Touché
 
@Raynos What kind of object is that?
 
@IvoWetzel something thats pass by reference and not by value. I.e. an array or an object literal
 
1:09 PM
still pass by value... although you're passing the value of some "pointer"
 
My question phrased alternatively. Is it bad design to insist the state of an object doesnt change when I pass it to a callback and assume it doesnt change.
@IvoWetzel I think passing pointers is the definition of pass by reference
 
@Raynos Any example code which would result in the need of the semaphore?
 
@IvoWetzel not yet.
 
If it ain't broke, don't fix it....
 
@IvoWetzel that doesnt apply when writing libraries.
@IvoWetzel But I can think of lots of unwritten code that is going to need this. Something along the likes of get object state. Delegate to an asynchronous callback somewhere. Insist object state doesnt change within the callback. I think my collision detection will use callbacks like this
 
1:15 PM
well at least reduce the lock callback timeout to 1
otherwise your system will introduce a 100ms lag to every response in case the server is at high load
 
@IvoWetzel true. I should. What's a reasonable timeout number?
 
nothing, fork Node and do this stuff in C I beg you
Doing this at the JS level is an awful idea
 
@IvoWetzel Can I extend node or do I have to fork it?
@IvoWetzel your right. This is an awful idea. It goes againts the async concept.
 
Good (Morning|Afternoon|Evening) everyone...
 
@ircmaxell good night to you too
 
1:28 PM
lol
 
1:39 PM
Well, good night to you as well
 
1:51 PM
sooooo auto generated html looks good
 
Yay, I crashed gnome
 
Can someone explain how my $.ajax({ "async": false }) is broken? It isn't working synchronously
 
01:00 - 14:0014:00 - 00:00

« first day (81 days earlier)      last day (4861 days later) »