« first day (83 days earlier)      last day (4151 days later) » 

12:00 AM
@Na7coldwater how do i capture them as they happen quietly? Object.defineProperty would be nice but isn't really an option
Maybe modify your script to use get and set functions on an object instead of modifying it directly.
@Raynos Could you stand doing foo.set("bar.baz", value) instead of foo.bar.baz = value?
i had a masterful idea of adding a 'tracker' object to the prototype chain just before the 'object'
but you can't change the prototype of primitive types :(
You can't? Just do Object.prototype.foo = bar;. Or is that not what you meant?
@Na7coldwater I could but users couldn't I want some quiet working in the background
@Na7coldwater @david do not change Object.prototype or I will hurt you. bad.
i'm not changing the object.prototype :P i'm inserting a new prototype before it
@Na7coldwater this doesnt work:
var x="hello";
but if you change it to var x = {a:"hello"}; that will work
12:08 AM
Try String.prototype instead.
Don't mess with native objects prototype unless you do sandboxing
I make assumptions that no-one corrupted String.prototype in my for in loops and in other places.
sandboxing means you dont edit String itself, you edit a localised sandboxed copy of String and delegate all your string handling through it
12:30 AM
for(i in {})
    // Someone modified the prototype!
/*someone didn't check hasOwnProperty!*/ MakeSomeonePay();
I think JavaScript needs a createScriptContext() function that creates a new context with it's own global object and everything.
just use the module pattern and don't leave off the 'var' keyword
or, if you don't want a module, just use an anonymous self executing function
@david If javascript had such a function, you could modify the object prototype in a different context and leave the rest of the page unaffected. It would also be useful for projects like ADSafe because they could run untrusted code in a context where the script couldn't access things like location.href and stuff. </wishfulThinking>
1:10 AM
So anyways
1:46 AM
yeah like totally
2:02 AM
I wish I can become a js pro. Its been almost a year since I started >:|
2:18 AM
read lots :o
and make sure you realise that a lot of the stuff out there that you're reading is probably wrong
once you've read enough you will be able to tell what's good and what's batshitinsane
and sign up to this: javascriptweekly.com
the weekly emails are a good way to keep you hand in
1 hour later…
3:27 AM
thank you!
3 hours later…
6:53 AM
Hi, I am using a CSS button as

<a href="" class="btn green" title="Delete" OnServerClick="MyCodeBehindFunction">Delete </a>

Previously, I was using a button control instead of CSS button and using AJAX confirm extender before deleting. But how do I ask for this confirm action in < a href=""> now?
2 hours later…
9:13 AM
@user458790 <a href="#" onclick="return confirm('Are you sure?')">Delete</a>
9:58 AM
@IvoWetzel morning
@Raynos Good morning
Q: Javascript object encapsulation that tracks changes

RaynosIs it possible to create an object container where changes can be tracked Said object is a complex nested object of data. (compliant with JSON). The wrapper allows you to get the object, and save changes, without specifically stating what the changes are Does there exist a design pattern for t...

Suggest an alternative before I implement a hashing solution
Hm I think either going through everything or just dumpin to JSON for the hash is the only viable solution that doesn't require a ton of hacking
You can't hook into a generic obj.__defineProperty__ method
Even if you could you would need to acccess all the references of the object...
And mark them as changed too.
@IvoWetzel I was thinking of overwriting the getters & setters
<object id="Beasty" height="85%" width="99%" classid="somedll" viewastext><\object>
"The object doesn't work! fix it!" -.- I didn't even know you can hook into dll's
10:14 AM
@Raynos Well, is there any chance of new properties being added?
@IvoWetzel yep. They have to be detected and overwritten with setters & getters by the hashing thing
you can't do that without special syntax
there's no way to hook into that, which sucks
@IvoWetzel you can if you pass out a normal object and have a hashed equivelant internally. you cant detect it on the fly. But you can look for it when the user calls .save() or .update()
10:40 AM
Q: embed dll in html <object>

RaynosI've come across some old code <object id="foo" classid="/location/bar.dll#ProjectName.ClassName" viewastext></object> It doesn't currently work and used to work in older versions of IE. I've never come across embedding a dll in a web page like this. It appears to be a windows .NET...

This is absurd.
@Raynos To answer your question about Firefox support, the chances of it happening is almost nil. The almost there would account for, say, rewriting the thing as a Firefox add-on or plugin
@YiJiang It's a hideous activeX thing where you can port a windows application directly into IE and only run it locally or something
(shhh I'm here.)
(shhh I said)
11:11 AM
@Raynos If it's the answer, post it as an answer to your own question instead of editing it...
@ClemDesm it don't think its the answer
11:59 AM
$(document).ready(function() {
     $(document).ready(function() {
The above is redundant right? I can't think of any good reason to nest them. (I can imagine the cause being based on auto generated code or regex find and replace)
@Raynos Drop it
(yes it is redundant)
and won't even work since ready one fires once
12:54 PM
@IvoWetzel it will work because its clever. Any calls to .ready after its fire will run immediatly
@IvoWetzel are you sure there is nothing like .__defineProperty__ Where I can intercept not just setters & getters of properties but also creation of properties
@Raynos At least not in V8
@IvoWetzel I could .preventExtensions
1:06 PM
Preventing extensions is the best solution. The rest I can do with getter/setter overwriting.
1:33 PM
@IvoWetzel look into why node-proxy can do it and we can't.
1:49 PM
Hi @ircmaxell
Good morning
(or afternoon or evening)
(or night)
good *
Well, I consider good night to be a departing endearment rather than a meeting one.
If it's not one thing, it's another... sigh...
@IvoWetzel that doesn't count, use eval or regex please.
1:55 PM
Good (morning|afternoon|evening)
/Good (morning|afternoon|evening|night|\w+)/
Special SO question for @ircmaxell
Q: Ashamed to admit using jQuery?


Today's DailyWTF: thedailywtf.com/Articles/WasDogKicked.aspx - People prone to exploding on seeing bad JavaScript like @IvoWetzel might want to refrain from clicking through
@ClemDesm hehehe, yeah, that's an interesting one...
@YiJiang ...
2:00 PM
if (0!=0) {
@ircmaxell Brilliant, right?
Well, it does take into account our universe suddenly collapsing into one in which 0 is identical to null. You have got to give him (or her) credit for defensive programming...
Behold! I present to you, greeting, the ultimate!
eval("document.write(new Array(\"Good\", new RegExp(\"(morning|noon|afternoon|evening|night)\").exec(new Array(\"morning\", \"noon\", \"afternoon\", \"evening\", \"night\")[Math.floor(5 * Math.random() * Math.random())])[1]).join(\" \"))");
What? Should I drop it and totally use jQuery?
2:07 PM
is still trying to figure out what's going on there...
And it'll favor earlier in the day much more than later
Ugly...I hate escaped quotes
@MichaelAngstadt Well I tried to make it as ugly as possible :P
@IvoWetzel Haha, you succeeded! :)
You could have done worse...
There's no inner eval, and no global variables
@ircmaxell nO wai! Math.random() * Math.random() is ever moarz randoms
2:09 PM
(not to mention a lot of other things)
Oh I see what it is now, lol
want more?
getting better, but still could use some more voodoo
use your imagination. I want to see at least 2kb of source code
2:16 PM
@ircmaxell Woah, reverse code golf!
@ircmaxell Hm I could create a mini language with a regex based parser and then execute that...
@IvoWetzel You need holidays.
@ClemDesm No, he need a job
I could also write a node.js server which server a random greeting...
then write some broken ajax thing to request it and parse it out...
2:18 PM
or no, I'll post it on a VB forum, then request that page an then parse it out
@ircmaxell I'll try
@ircmaxell then that's not "golf"
I wish the colonel could explain to you how windows is awesome.
2:23 PM
I only came over here for that, I've got work to attend
@drachenstern: Code bowling... Better?
Windows was using 8gb of page file, when there was 8gb of ram free. Not to mention that there was only 1 application running which uses 256mb ram. So 16gb of ram used (eating the entire HDD) for 256mb required...
@Raynos OK, with C++ that should be doable
@IvoWetzel >_< its an extension to node rather then written in javascript. I only bothered to read the javascript tests rather then the src. Proxies are supported in Firefox 4
2:28 PM
And FF3 with FoxyProxy
Is it considered cheating to answer a javascript & node.js question with an extension to node written in C++ that implements new "native" objects/methods for you?
@ircmaxell Welcome into the world of tomorroowwwww
@ircmaxell different use of proxy I think. Were talking about the ES5 Harmony proxies
@Raynos If it's not possible with node.js natively, then I think it should be okay
@Raynos Which is?
2:31 PM
@ircmaxell A hook to catch setters/getters and the like
You wrap an object in a proxy and whenever you do anything with the object it goes through hooked functions
Ahhh, proxy pattern...
ECMA Script 5 (ES5, I got ya now)
Q: Javascript object encapsulation that tracks changes


It's something I wish to use to solve the above issue. This is also what I meant when I wanted to remove my current solution to it which is deep cloning/copying. Do you have any alternative suggestions? (@ircmaxell)
Well, you could use a proxy to monitor changes... But I'm not sure that's the proper use of the pattern... sourcemaking.com/design_patterns/proxy
My suggestion is to track the changes as they are made onto a stack
(etiher by diffing, or as the one answer said serialization)
that way you just need to replay the stack from where you last left off. It'll make keeping track of everything a lot easier...
@ircmaxell isn't serialization just as bad as deep cloning
from what standpoint?
What's so bad about deep-cloning?
2:46 PM
oh gosh what I'm creating...
@ircmaxell deep cloning in javascript feels painful. It just seems wrong to make deep copies in javascript
@IvoWetzel what are yo udoing wrong?
@Raynos: You could redesign your application so you weren't pushing deep-objects into the history, but for your given design, it seems to be the best solution...
@ircmaxell or I could use a proxy, and track setters/getters in real time and keep a running history on one object
that's not the purpose of a proxy as far as I understand it, but you could
That's more of a decorator
@ircmaxell I dont actaully need to use a proxy
a combination of overwiting getters/setters & using .preventExtensions works fine
2:55 PM
dang only 1.4 kb so far
But even with tracking the setters/getters in real time, you're still deep-cloning
@IvoWetzel of what?
@Raynos: that's a decorator then, not a proxy...
@Raynos Code Bowling
@ircmaxell sorry I dont actaully know what either of those are. I'm not a proper software designer.
@ircmaxell something like that
One of BestBuy's Guarantee exclusions:
Personal	items	left in the product (you are responsible for removing all personal items from the product
before service is performed); parts and services
covered under your product ’s manufacturer’s warranty; remote control reprogramming; damage due
to contact with any human or animal bodily fluids, or
secondary damages.
rand = Math.random
tims = new Array()
timeString = "morning,afternoon,evening,night"
makeArray(timeString, timesCount)
greeting = null

function makeArray(data,max){
        ex = regeExFromStr("[a-zA-Z]+", "g")
        while(m= ex.exec(data))if(tims.length< max)tims.push(m[0])
        return tims

function formatGreting(){
        mesage ="Good " + randm
        for(i=0;i <msglength; i++)
dang missing 26 bytes
gonna add them :P
ok a couple more indents and I'm at 2055
3:13 PM
function stringIsDifferent(a,b) {
Wow... that's all I can really say
Aaaaaaaand... we have a winner!!!
Guess that's what you call negative application of knowledge
This is the worst code I've ever written, but hey it was fun!
@IvoWetzel, you have just earned yourself a place beside Enterprise Fizz-Buzz!
Now all I have to do is to add one subtle bug and post it on SO
(of course as some random 1 rep user)
3:15 PM
of course there are a ton of bugs in there
but it still works :D
Because all of them make it work in the first place
add a special character to one of the options, so it'll bork the stringIsDifferent regex ;-)
you didn't read the code, you fail :P
the comparison doesn't work
first it compares b to b
and then it returns undefined
which evaluates to false
isn't used to JS semantics
@ircmaxell And now go and open up that Anti-CodeGolf on SO / Programmers
3:25 PM
function istrue(value){
        bool = new Boolean(value)
            return true

            return false
I just love that.
can be improved
Asking question now...
What tags?
code-golf rosetta-stone etc?
3:32 PM
since jquery = javascript for some person
Code-Bowling Output Random-String intentionally-bad-code bloatware
now I've done it
not sure about the last one
I ended up in a endless loop
3:33 PM
Wait, I can't make a CW from the initial post anymore?
nope, but I guess we can edit the hell outta it
wait, I can't make it a CW even after editing. What?
so it switches to CW mode


go guys edit it :P
3:37 PM
I'm really curious what happened to the CW button
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) ...

Fair enough
got it
But I figured since I had 10k rep, I could...
global variables
@YiJiang How many edits does it take again to make it CW?
3:41 PM
@IvoWetzel 10 from OP, or 5 from 5 different users
7 to go then @ircmaxell
I think it's 10 per users, with 5 unique users actually. Or something. Whatever.
I can't edit, I can't play, I'm sad.
Can't another 10k make it CW?
only mods
3:42 PM
Dam line between 10k and mods. We can do most, but not all...
Uhhh... Why is it +0 when there was 1 up-vote and 0 down-votes?
@ircmaxell Actually, we can't do most, only watch
Ahh, there we go
@YiJiang: we can do most, just not individually. It's a group effort...
I don't care about the rep from it (although I wouldn't mind the badges, since I don't ask many questions)
well it most likely will get closed without CW
that too
No close votes or -1s yet, with 24 views, so maybe we might be on to something
Is there some fancy way to create a small popup dialog like when pressing the username in this chat? My main concern is how to position the container next to the mouse, and having it appear below or above depending on space on the screen.
3:50 PM
@raRaRa For positioning, you'll want to look at jQuery's positioning functions, together with absolute positioning.
@raRaRa use event.mouseX or something like that
OK added a few more bugs
@IvoWetzel I'll outdo you and write it in raw jQuery :)
rand = Math.random;
tims = new Array()
timeString = "morning ,afternoon,evening, night"
makeArray(timeString, timesCount)
greeting = null

function makeArray(data,max){
        return tims }

function formatGreting(){
        mesage ="Good " + randm;
oh wait I have more ideas
@IvoWetzel I don't see you modifying the Object prototype yet :D
4:04 PM
@YiJiang Ah good idea :)
you know
you never know
it'd be better if all object had caching of their lengths!
@IvoWetzel Oh boy...
someone can write some demonic call text stuff? :D
with fails
so hard
just earned my first golden badge
4:11 PM
with(this) doesn't work correctly!
@ClemDesm Congraaaaaaaaaaaaaaaatluations
@ClemDesm grats
rand = Math.random;
tims = Array()
timeString = "morning ,afternoon,evening, night"
makeArray(timeString, timesCount)
greeting = null

String.prototype['getChar'] =function(big,p){
return String.fromCharCode(big!=false? this.charCodeAt(p)-32: this.charCodeAt(p)) }

function makeArray(data,max){
        ex = regeExFromStr('[a-zA-Z]+', "g")
        return tims }

function formatGreting(){
        mesage ="Good " + randm;
Oh and random() * random() really does its job
It's almost never night!
4:31 PM


Congrats @ClemDesm!!!
and I don't even want rep for that thing
I might try to use as many browser specific methods as possible. And then have the thing crash and burn on every browser but IE4 for macintosh. Alternatively writing a piece of code that runs & only runs on IE4 macintosh is an achievement of sorts
Use some old behavior of arguments?
+1 @IvoWetzel
Do UA sniffing and do a alert and tell the user his browser fails and is da sukx if you're using anything other than IE4?
4:37 PM
@Raynos Add in some ActiveX
then you can go even more crazy in the C code
Anyone have experience with multiple rulesets (say, a wizard) in jquery validation?
is it just me or is the syntax highlighting on that question broken?
stringIsDifferent is really my favorite
It is @IvoWetzel
@Chance I have some. Show me a jsfiddle or jsbin.
it's broken on so many levels
4:41 PM
@IvoWetzel I'm pretty sure it's because of the tag based syntax inferring
@ircmaxell I knew, it Nick's only working at SO for week and he starts breaking things
Since no language related tag is given, syntax highlighting is turned off
@NickCraver can you fix SO?
that makes sense
(not really, but ok
@YiJiang That's stupid, the highlighting sucks even if there are tags
4:43 PM
@ircmaxell No, indeed it doesn't make sense
But it's the only reasonable explanation I can give
Well, it makes sense from the is reasonable standpoint
So anyone wants to post that thing on HN when it gets a couple more answers? :P
@YiJiang That's like saying the world is flat because you don't know any better :P
@Raynos - sorry, its not as clean as i'd like
4:46 PM
@Chance Compared to the thing I just wrote this is a dream :D
but yeah, could need some DRYing
@IvoWetzel opinion on www.gammajs.org please
Go for it!
(it's up to 73 views already, not much more to get really high)
@Chance I see a large block of code. Whats the actaul question? Rather then "make it better"
4:48 PM
@Raynos sorry, here's my question which may be a bit more clear stackoverflow.com/questions/4626913/…
but you know what was really hard, adding all the typos...
@Raynos I've basically defined 3 different sets of validation options with their own rules / messages. Each time I need to validate a given fieldset, I am trying to validate with the given option set. The problem appears to be that once I validate a form with an optionset, every subsequent validation uses that optionset, regardless of what i pass it
@Chance whats wrong with removing rules and adding new ones? Rather then passing a ruleset, write a function that cleans the rules out and adds new rules from the ruleset
@ircmaxell You should have used $$ or even $$$$ :D
:kitten quote
4:53 PM
@CodingKitten Gimme that one about perverted proffesionals
@IvoWetzel Programmer (n): An organism that instead ><
@CodingKitten Instead what?
@IvoWetzel It's executable line noise
@CodingKitten So a programmer is executable line noise?
4:54 PM
@IvoWetzel The sooner we fall behind, the job offers there are US
@Raynos ive tried performing a .rules('remove') at the form level but that doesnt seem to wrok
@CodingKitten Brilliant! You always say the truth!
@YiJiang Anyway, should I think I'm pretty sure they ought to be private
@Raynos based on the docs, looks like its element specific
@CodingKitten Yes, you should think they ought to be private.
4:55 PM
@YiJiang > that instead >< Does your alert work?
@IvoWetzel: I wasn't going for fubar. I was going for over-engineering with a bit of not-invented-here thrown in
@ircmaxell See I was just going for your 08/15 JS code in the intertubez
Well, that's the beauty of Code-Bowling, you can pick a number of different meanings of it.
Code-Golf is dead, long live Code-Bowling!
@CodingKitten You want to bowl too?
Either from making a 2 line program into 200 by over-enigneering, making the dirtiest code you can imagine, solving another problem which just by chance appears to solve the original, etc...
4:57 PM
@IvoWetzel I still want something superior :P
@CodingKitten :(
@IvoWetzel Indeed isn't free >:( JS questions for last couple of weeks just plain suck so much. So yeah, you'll get there. Soon
Nice, it neatly spliced together our two messages complaining about how recent JS questions on SO suck
