« first day (73 days earlier)      last day (4943 days later) » 

2:00 PM
My version, with highlighting
/highlight [id | username]
If used with username, it'll highlight any existing and new messages written by the user
 
@YiJiang, what browser do you use?
 
gah, in JS a + b>>1 means (a+b)>>1
 
@rchern Firefox 3.6.10
@rchern Hmm... /clear doesn't seem to work
 
i can tell. you're adding GM_* calls that chrome doesn't have.
 
@rchern Oh? I thought those functions came with GM.
 
2:04 PM
Opera and Chrome have UserScript, GreaseMonkey is an extension of UserScript afaik
 
So those aren't universal huh...
Right, so now I'll have to write a style injection function too
 
oh, and @require is also GM-only.
That's all I know from others chatting about GM compatibility pains.
 
Hmmm... this is bad
It looks like I'll have to rewrite the clear function
 
gah. why is Chrome so trigger happy to install extensions when I just want to view them?
 
@YiJiang your load command generates an uncaught typeerror
 
2:08 PM
not even view-source:blah works
 
@radp, yeah that's a pain, even view-.....yeah
 
goes file a bug
 
hehehe
they've got a nice backlog of those
 
@rchern Eh, any more detail other than that?
 
> Uncaught TypeError: object is not a function
(;
no errors in your console?
 
2:11 PM
var loadBtn = $('#getmore');
loadBtn.click();
setTimeout(function() {
	if(loadBtn.text() === 'load older messages'){

		$(document).scrollTop($(document).height());
	}
}, 100);
handled = true;
break;
 
masterr-chat.js 197
 
@rchern Erm... do you get that if you click the "load more messages" manually?
 
no (:
 
@rchern Yeah, but that wasn't from the GM script so I thought it might be a existing bug in the chat js
Didn't notice it coincide with the /load command
 
2:14 PM
hm? i said your load command generates it (:
 
@rchern No, the Firefox console points to a random function is the chat js file
Error: c is not a function
Source File: sstatic.net/chat/Js/master-chat.js?v=e401b7dee435
Line: 197
 
running $("#getmore").click() in my console gives the error as well
 
@rchern Weird...
@rchern The error occurs after the loading is complete
And it doesn't appear in the Firebug console which is very weird
And Firefox literally hangs when the messages are loaded
 
...
did you test this before you pasted it into chat? hehe
 
var v=c.data("source");if(v){q(v);return}}v=q;var z="/message/"+$(c).attr("id").replace("message-",""); seems off (in the actual chat script), or is there a normal data function I'm not aware of?
 
@rchern Well, the error didn't appear in the Firebug console and doesn't appear to be part of the GM script, so no, I'm not entirely sure this is a problem with my script
 
But they $(c) right after that, so I imagine c isn't a jQuery object.
 
well but you said it hangs your browser
 
@rchern So does clicking on the load new messages button manually
 
Hello
 
@YiJiang, i don't see that getmore's click calls w(...)
@radp, didn't you already link to one that had been created?
 
@rchern uh, no, the previous one was a completely unrelated issue on Chromium deciding web pages ending with .user.js must be UserScript pages even if they contain HTML
 
@rchern Sorry, what do you mean by that?
 
I really wish that Firebug could clean up scripts so I could actually set useful breakpoints.
 
Also, I think there's no point in trying to debug obfuscated js
 
2:36 PM
@radp, but if they fix that won't it fix this?
 
@rchern Possibly but not definitely.
 
@YiJiang i mean that the code you pasted regarding c.data("source") doesn't seem to be part of the code that $("#getmore").click() triggers? unless i'm missing a call
@radp, i'm not sure i see the urelatedness
 
@rchern It could be a callback that's been called after the loading is complete. Firebug's ignoring this error so I can't make the thing break on error for debugging
And Firebug also can't handle obfuscated code very well
 
@YiJiang Yeah, you might need to like..
Disable everything in Firebug
And re-enable it.
 
@rchern anything is related with anything else to a certain extent, so "completely unrelated" was an exaggeration :D
 
2:39 PM
Firebug decided to stop showing exceptions for me after I was working with Greasemonkey..
But eventually I got it to behave again, heh.
 
@radp, ok, i don't see how they're anything but duplicates
(;
 
@TimStone "Disable all panel", "Enable Console", Nope, doesn't seem to work. Wonder what's GM got to do with this.
I can't imagine it doing error suppression... ?
 
@rchern the first issue is about how GitHub's HTML page for a .user.js page is considered a userscript itself
my issue is on how you just can't see a userscript's source
 
@YiJiang No, I don't think so, I just find Firebug to be super buggy.
 
the first is about what a userscript is, the second is on how a userscript is handled
 
2:41 PM
At least to the extent which I use it and have it open in multiple windows and what not.
 
@radp, you can't see it because chrome is interpreting anything ending in .user.js as a userscript, even when it shouldn't. which is what the 1st issue is excatly.
 
@rchern which is the first bug
 
@TimStone I find it to be one of the leakest add-ons I use regularly, but not really very buggy
 
@radp, exactly.
 
but in this case (2nd issue) I want to view the source of what really is a userscript!
 
2:42 PM
but you can't because of the 1st issue
which is why yours is a dupe (:
meh, whatever.
 
still different.
 
we're going to have to agree to disagree.
 
Yeah, I also disagree with many closings as exact duplicate around here :)
 
@rchern I was the one who (incorrectly) pasted that code, turns out that my eyesight failed me and I overlooked where c is actually used as a function, which..you know, matches the error. Ignore me. ;)
@YiJiang It's buggy for me in the sense that things stop working for no particular reason. They'll always start working again, but they shouldn't stop working in the first place since nothing changed.
 
Does the chat system auto-kicks people for inactivity?
 
2:44 PM
I do still love its awesomeness, though. ;)
But I demand a way to beautify JavaScript...I wonder if there's any easy way to hook in and make that possible.
 
jsbeautifier (:
 
One thing at a time though... @rchern, I have an idea about your binding problem, but I'm not sure if I can get it to work. I'm a little disappointed in jQuery, actually.
That helps for reading, but unfortunately not for my ability to set breakpoints. :(
 
yeah i know hehe
binding problem?
 
in Chat feedback on Stack Overflow Chat, 58 mins ago, by rchern
is there any way to hook into enter handling for processing my commands or am i stuck shift+enter since i can't change the order of events and i can't bind earlier than you
 
ah right
hmm, the code makes it look like there's a debug-messages div, but i don't see it on the page
 
2:50 PM
@TimStone I'm very sure jQuery maintains some sort of internal queue for the event handling functions, but I'm not sure where to look it up for that sort of things
 
or rather, my console doesn't see it
 
@YiJiang It does, they just don't make it easy to get at :)
 
yup. there's bind and unbind.
hehe
 
@rchern Not good enough, unless you want to kill chat? ;)
 
Rather, they don't make it easy to get at without me having to rewrite the entirety of one of the functions, but I think I found away around that.
 
2:52 PM
well, if i remember from last night, there's 3 handlers attached. [0] can stay where it is, but i'd need mine to become [1] and push existing [1] and [2] to [2] and [3]
 
I had no idea Firebug formats the code for you ;)
 
nice :)
 
Still doesn't tell you what the variables means, but you can roughly guess what the event handler does now
 
hrm, doesn't each jQuery object have a .text() method?
 
If only the DOM tab wasn't super obnoxious. :P
 
2:58 PM
$("#input").data("events").keydown[1].handler
@YiJiang, grab FireQuery
 
Although slightly unfortunate that they stuffed the whole thing into a tooltip O_o
@rchern I already have fireQuery
 
ok, then don't (;
 
I...don't.
 
ok, @TimStone, do it!
q:
 
3:01 PM
It has been done!
Actually, super surprised that Firefox managed to restart correctly, that almost never happens..
 
i just ran master-chat.js through jsbeautifier and have that open in my ide
 
Okay, I see that c is passed into the handler, and that somewhere in the middle the line c && c() is called
 
that's what i've been using since yesterday
 
@rchern What IDE do you use? Eclipse for JavaScript makes me sad.
 
i'm a .net person. vs (;
 
3:02 PM
It's probably some sort of lazy test for whether c is a function and exists
 
Oh, right.
 
kinda my ide by default
 
I haven't had to do any of our .NET/SSIS development in long enough that I don't have VS installed on this PC, heh.
 
@YiJiang, broken before there maybe? it doesn't scroll. weird that you're not seeing the error
 
@rchern I'm not sure, but it appears that the event handler expects three parameters, and I'm not passing them in correctly, triggering the error
But shouldn't c() in c && c() not run if c returns false?
 
3:06 PM
hrm, wtf. $(".post-vote-count").first().text() works, but $(".post-vote-count").each( function(bar, obj){ obj.text() }) doesn't.
 
x = function(){
  console.log("Hello world");
};

x && x();
Why would somebody do this?
@radp Eh... isn't obj the DOM object, not the jQuery object?
 
@radp You need to $(obj) don't you?
 
yes
 
why would iterating over a jQuery object not give me jQuery objects?!
 
@radp Eh... ask Resig ;)
 
3:09 PM
because the jQuery array returned doesn't contain jQuery objects, it contains html elements?
 
anyway, I asked on SO.
0
Q: Why does iterating over jQuery objects with .each() not give me jQuery objects?

badpThe following works as expected: $(".foo").first().text("hi!") ...because first() returns a jQuery object. However, if I want to work with the text() method for all matches, I need to do: $(".foo").each( function(idx, obj) { $(obj).text("hi!") } ) ...because each() gives you DOM object...

 
Okay, the SO chat injects some really funky global variables and objects into window
 
@rchern that's weird also, if I'm using jQuery to parse the document I probably want to use jQuery to change it too...
 
insert coin
 
3:18 PM
Oh wait.. I just realized
 
okay, the Eggs object doesn't behave the way I thought it did either
 
I can do this to find the Easter Egg!
egg must be referring to the easter egg
 
sure, the SO easter egg is triggered by writing to the console a command
 
function (a) {
    if ((a = /(?:^|[.!?:]\s+)(?:(?:how\s+(?:can|do)\s+i)\s+([^?!.:]+)\?|(?:i(?:\s+want|(?:\s+am|'m)\s+(?:wanting|trying)|'d\s+like|\s+would\s+like)\s+to\s+([^?!.:]+)(?:$|\.|!)))/i.exec(a))) {
        var e = a[1] || a[2];
        if (e && e.length > 10) {
            var b = $("<div class='assistant'/>").css({position: "fixed", left: 850, bottom: 50, zIndex: 1000});
            a = $("<div/>").css({position: "absolute", right: 99, bottom: 50, backgroundColor: "#f7f0ad", border: "1px solid black", width: 300, minHeight: 100, padding: 5, fontFamily: "'Comic Sans MS', serif", fo
There's a regex in there that's matching for something
 
@YiJiang you don't need to work too hard on it
 
3:19 PM
Which then produces an AP'd, Comic Sans div
 
@YiJiang just go on SU and write "How do I find out what the SU easter egg is?"
 
Hello world!
 
Hello, @YiJiang!
 
Okay, let me see...
<[^>
 
huzzah!
@balpha showed me how to use enter instead of shift+enter
 
3:28 PM
@rchern Where?
 
in Chat feedback on Stack Overflow Chat, 9 mins ago, by balpha
var e = $("#input").data("events")["keydown"]; e.unshift(e.pop());
 
Okay, let's see which of these Eggs function will be called
 
are you giving up on load? should i just take it out?
 
@rchern Not sure yet, wait, I've not done testing on what the three parameters mean
 
@YiJiang Eggs.Cthulu("<[^>")!
Heh
 
3:34 PM
@TimStone Saw that, but is that egg active here?
 
No, it's SO's egg.
in Sandbox on Stack Overflow Chat, yesterday, by Tim
How do I parse HTML with regex?
Heh
 
The thing is, after looking at the code, .click() should work
function y(c, o, q) {
    if ("which" in c) {
        c = null;
    }
    o = o || MAX_MESSAGES_DELTA;
    Na += o;
    var v = $("#chat div.message").eq(0);
    $("#getmore");
    if (v.length == 0) {
        $("#getmore").fadeOut().slideUp();
    } else {
        var z = v.attr("id").replace("message-", ""), G = $(window).scrollTop() - v.offset().top;
        z = "/chats/" + b.id + "/events?before=" + z + "&mode=Messages";
        $(q || "#getmore").html("loading&hellip;");
        if (o) {
            z += "&msgCount=" + o;
The first part there, the "which" in c part, will nullify c it was an event
 
Do you know what calls this whole function?
 
@TimStone The y function? That's the event handler that's attached to the get older message button
 
Ah
 
3:48 PM
Are Javascript exceptions useful?
 
@Chacha102 You mean stuff like throw new Error("My pants are on fire!");?
 
yes
 
@Chacha102 I think it stops the execution of the Javascript in the same block/function, erm.. can't remember
Certainly not very commonly used
 
i wrapped your click and settimeout in a try/catch
 
@rchern is that a sign of approval or disapproval?
 
3:54 PM
@rchern Okay, that confuses me a bit more
 
@Chacha102, hrm?
 
you guys, what ya like :D
 
@rchern Do you think JS Exceptions are useful
 
I come back and some project has kicked off
Is this the userscripts?
 
@AidenBell, yeah, keyboard shortcuts for chat
should tell you how much i hate using my mouse teehee
 
3:55 PM
@rchern - Sounds good
 
uh, another thing
what's the difference between $(".foo").eq(2) and $(".foo")[2]?
 
$('div.signature:contains("rchern"').livequery(function(){
    if($(this).siblings('.messages:contains("oy!")')){
         $(this).siblings('.messages').find('.stars .vote').click();
     }
});
 
oh, right, the first gives jQuery and the latter gives DOM
 
@radp, .eq will return an empty set if the index isn't found
 
Of course this need the livequery plugin to be included, or you can just set it to a 1000 millisecond setInterval
 
4:00 PM
@radp, and you can use -numbers to go from the end of the list
 
this double nature of entity representations is confusing.
 
@YiJiang ...seriously?
 
@rchern no, there's a syntax error
 
thinks @YiJiang has different modification reasonings than she does
 
@rchern I'll just.. quietly slip that into the source....
 
4:03 PM
...
 
@YiJiang instead of slipping actually useful stuff like smilie backwarders?
 
fyi, i do want this to be a serious user script people can use >_>
hehe
 
@radp That would need some serious regexing, mind helping? </joke>
 
nah, just an extensive dictionary.
 
@rchern what no auto-oy
?
 
4:04 PM
js does have dictionaries right? :P
 
@radp objects. Objects does everything here
A bit like PHP's multifunctional arrays
 
so if I needed a dictionary...
 
just use an obj and set the attrs
 
rchern["(:"] = ":)" ?
 
@radp smilies = { '):' : ':(' };
 
4:06 PM
@YiJiang oh, okay, the same syntax Python has :)
 
@TimStone - ah whatever, goes back to programming Python
 
@AidenBell No, my brain failed
That was because they used an array object, nevermind.
 
was gonna say :P
 
Yeah, I'm not sure where my head is today.
 
@TimStone never mind. I crashed and burned this morning and slept
for quite a while
The SO rooms are all pretty much dead
 
4:09 PM
/highlight Aiden
Oops
 
@AidenBell Heh, I slept at some point, but maybe not enough..
Yeah, it's kind of...eerie, heh.
 
is there an augmentor for Chrome?
Also, has anyone actually tried delivering a webapp to the browser as XML+XSLT?
 
4:24 PM
Okay, /load will now work
in Chat feedback on Stack Overflow Chat, 7 mins ago, by balpha
$("#getmore").data("events")["click"][0].handler(function(){})
@all Okay, I need anybody who's being active in the past half hour to say something
Testing highlighting with this script
 
If I must..
:P
 
@TimStone Okay, one more, please
 
Sure :)
 
Thanks! Everything's working as expect, whew that took so long
 
@YiJiang this doesn't scroll.
 
4:33 PM
@rchern It doesn't, sometime.
 
Do I have to keep silent?
Oops!
 
hi @ChrisF (;
 
Evening
 
hello @ChrisF
 
If you must, you can try dropping in a self repeating $(document).scrollTop until the thing is finished
 
4:35 PM
jQuery.fn.extend({
    bindAs( type, nth, data, fn, ) {
        if ( typeof type == "object" ) {
            for ( var key in type ) {
                this.bindAs( key, data, type[ key ], fn );
            }
        }

        if ( type.indexOf(' ') > -1 ) {
            var s = type.split(' ');

            for ( var i = 0; i < s.length; ++i ) {
                this.bindAs( s[ i ], data, fn );
            }
        }

        if ( jQuery.isFunction( data ) || data === false ) {
			fn = data;
			data = undefined;
 
@YiJiang that doesn't seem very opitimized at all
 
At least the error isn't thrown anymore
 
Untested, but a generic "bind this as the nth handler" bit.
 
@rchern Eh... who are you replying to? ;)
 
I know there's a badge at stake, but I do get annoyed when people drop the trackable link to questions into meta posts
 
4:36 PM
and scrollTop isn't what actually clicking the button does, does it?
 
@rchern True, but I think the scrolling thing is by-design, since it was designed to only be used at the top of the page
 
then it should scroll first and then click?
 
1
Q: Are there any negative effects when disabling Last Access timestamp

Eric LIn Windows you can disable the last accessed timestamp by setting NtfsDisableLastAccessUpdate to 1 http://www.windowsnetworking.com/kbase/WindowsTips/WindowsNT/RegistryTips/Miscellaneous/RegistryTipWindowsNTNTFSLastAccessTimeStamp.html I want to do so there is less disk activity on c:\$logfil...

 
@ChrisF, i didn't think it mattered if the click comes from within the family anyway?
 
@rchern No, as in, after the click is triggered, we watch for the text to return to load older messages or something, and when that occurs, we force-scroll to the bottom
But that isn't good for a number of reasons
 
4:38 PM
I thought it was tracking IP addresses - regardless of where the link actually is
 
Right, any referrals from within the SE network don't count towards those goals.
 
Performance lest of them
 
Re that question - I didn't know you could turn last access off
 
@ChrisF Neither did I. Hmm...
 
@ChrisF I..don't think that I knew that either, hmm.
 
4:39 PM
Also, why would turning that off reduce disk activity to the logs?
 
Because you're not writing the last accessed update to log
 
@YiJiang To the NTFS log
 
The page linked to has a little bit more information
 
@ChrisF Pretty sure it's disabled by default in Vista on...
(...the implication being, this is why Vista sucks)
 
@Shog9 there was a comment on my answer saying it's disabled in 7
Might be disabled because of the "new improved" Windows search
 
@YiJiang I guess what I'm asking is why does it need to be any more complicated than this
case "load":
                    var getMore = $('#getmore');
                    $(document).scrollTop(getMore.position().top);
                    getMore.data("events").click[0].handler(function () { });
                    handled = true;
                    break;
nice indenting hehe
 
@rchern Oh, I see what you mean
 
that's what i came up with at least shrugs
 
But you see, I thought that what we want is to be able to call the command from anywhere in the page
 
Interesting reading @Shog9 thanks
 
4:49 PM
One of my biggest annoyance of the current system is that I need to scroll up all the way to the top for stuff to load
Well of course that'd work too. Better, in fact
 
@YiJiang, in what situation do you want to /load but not have the window move to those messages?
 
@rchern Well, since that button is always at the top, why not just scrollTop(0)?
@rchern When I'm slowly reading upwards, since the loading takes a bit of time I'd find it annoying to have to wait, I'd like that thing to auto-load before I get there
 
Gah all the sites are being really slow for me today
 
.scrollTop(0) works too
 
@rchern They're using the scrollTo plugin, we can use that too to animate the scrolling
$(document).scrollTo(0, 400);
 
4:55 PM
i'm not sure that will scroll you to where you want given the ajax changing the page.
 
@rchern Hmmm... why not give it a try? ;)
 
i thought you were the one writing load (;
q:
brb anyway
 
Ironically, this works
$('#getmore').data("events")["click"][0].handler(function(){$(document).scrollTo(0, 400);});
Hehe... that useless empty function isn't so useless after all
Coincidentally, we might also want a /scroll command ;)
 
Just in case you need that handler insert ability in more than one place.
 
5:22 PM
Includes /highlight and /load
Syntax: highlight [message_id | author name] - You only need to have part of the author's name for this to work. This will highlight all and incoming messages by that author
Highlighting a specific message can also temporarily bookmark an important message so that it can't get lost in the stream of messages
 
That....is awesome.
 
/load will simply load the next few messages before scrolling all the way to the top
Also, don't try to use /highlight with numbers if you need a specific user, like when you're trying to select a user12345 with 12345 - the script differentiates the two by looking at whether the argument is a valid integer, so will attempt to highlight post id 12345 instead
Oh, and all highlighting will be lost on reload of course, so use bookmarks if you really need to keep a message
'Night from GMT +8!
 
@YiJiang You mean that you aren't going to hijack my browser and persist this information?! Bah, what's the use then? ;)
Good job, and g'night!
/highlight @YiJiang
Hmm
Oh, without the @
Heh
 
back
 
Oh and I forgot!
/clear for clearing highlights
It'll clear all highlighting
 
5:31 PM
hmm, think we can improve on that
i'll take a look
i think this needs to be re-factored into a better command pattern
 
The massive switch statement has class, though.
 
lol
 
But yes, a commands object for commands[command]() ing might not be a bad idea.
Oh, they've turned your rep into a link to privileges..
/load
...Err, am I doing something wrong?
 
@YiJiang's version doesn't have the enter code and still requires shift+enter probably
 
Ah. :)
Hm, no, shift+enter gives me a newline..
Though it also appears to be true that it still requires shift+enter.
Ah, Firefox fail.
 
5:48 PM
?
 
I had reloaded the page, but apparently Firefox didn't agree that I had really reloaded the page, so it didn't bother to inject the new Greasemonkey script. F5 seems to have fixed that..
Not sure how that makes any sense, but I definitely pressed the reload button.
 
haha
 
/load
Oh right, shift+enter
I really need to fix whatever is lagging my brain today.
There we go.
 
On the road again...
Let's see how chat works over a 3G connection :-)
How is everyone today?
 
allo
 
5:57 PM
Hey @rchern.
 
Hello
 
Hey @Chacha102
 
is just hacking away at chat hehehe
 
My net connection is a bit flakey. I think I'll stay only in this room for now :-)
So far so good using chat over thethered 3G @balpha...
 

« first day (73 days earlier)      last day (4943 days later) »