« first day (74 days earlier)      last day (4947 days later) » 

3:00 AM
The breakdown is 0/0
 
First thing I'm doing is renaming the highlight and clear commands :P
 
so my breakdown shows 0 / -1
but its score shows 1
 
Hm.
 
@MarkE, there's several posts on meta about this
 
It sticks with a refresh too?
 
3:00 AM
@MarkE Could be a flag?
 
force refreshed it
and same result of 0 / -1 with score of 1
 
Heh, sorry @YiJiang
 
@YiJiang unlikely, it's a fine answer
 
there's still several posts on meta about this (;
 
@rchern But no definitive answer
 
3:02 AM
@MarkE Oh wait, I was looking at the wrong place, I see the same thing.
Alright! Where was I...Looking at Yi Jiang's script, right, right.
/join
Oh, still shift enter?
Ah, very good.
Hmm
 
no
just enter
oh wait, you're using @YiJiang's?
never mind
 
@rchern Yeah, I really should reply correctly when saying that stuff.
 
(;
 
@rchern Are you sure it's safe to use the predefined .highlight class?
I'd rather be able to change the color myself ;P
 
shrugs
 
3:09 AM
@rchern Suggestion: /last [username] for finding last on-screen post by user
I have to go now, byeeeee!
 
See ya @YiJiang
 
good idea
 
3:25 AM
hmm. i need a command name for switch that isn't, ya know, a keyword
 
swap?
change?
Guess it depends on what the command is for..
 
switching the room names since /join will be to join a room you aren't in
 
show perhaps?
 
open?
 
Hmm
Just use switch in quotes?
 
3:30 AM
that works
does /rooms return all rooms or just a page
just the page it looks like
 
Just the first page I think.
Hm..
 
@rchern - SO Chat Chess Userscript?
 
o:
 
shakes fist as jQuery
 
Nf3 Nc6
 
3:39 AM
that might be a bit much
@TimStone, what are you trying to do?
 
@AidenBell N?
 
what was the deal with getting the rooms? it's just the first page, but...
 $.get("/rooms", function(data) { $(data).filter(".roomcard").each(function() { var room = $(".room-header .room-name",this); console.log(room.attr("title") + " - " + room.find("a").attr("href"));  }); });
 
@rchern For some reason the event handler ...storage object is an array-like object in this scenario, but it was an actual array when I was trying it earlier.
And I'm confused by this.
 
$.makeArray !
 
Actually I guess I could do that, heh.
 
3:41 AM
hehe (;
 
I'm not sure if I can reassign it though, which might be problematic.
 
@MarkE Knight unintuatively
 
Though I guess I can just copy over all of the existing elements, that would work too.
 
 
@rchern Well, the API is even easier than that ;)
 
3:42 AM
@AidenBell would've thought K, I suppose
 
yea
 
But no, he was having a context issue where the variable wasn't in the scope of his event handler, so it was undefined where he was trying to use it.
 
@MarkE I think the notation is Syrian
 
ok, /last is done. server updated
 
Wait...Confused, argh.
 
3:49 AM
):
 
@rchern Nice, would you mind pasting the link again?
 
Thanks!
 
i'll be happy when programmers.se is out of beta
so we can move these "what should I do about my job" questions there
 
console.log(events);
console.log(events[type]);
console.log($.isArray(events[type]));
So type is definitely "keydown"...and printing events shows that there are four elements in the array property keydown...
So how the hell does events[type] give me an array with one element?
calls shenanigans
 
3:58 AM
hehe
 
@MarkE - I second that
 
I feel like I must be missing something, but uh..
 
bah
note to self: when it says "Uncaught SyntaxError: Unexpected token ;", don't try to use the script
 
Whoops :P
At least it gave you an error, heh.
 
hehe
 
Joe
4:14 AM
idle thoughts, etc
briefly the question is asking for a strategy to plot the rgb spectrum as a 2-d matrix
got a bite -- thanks guys :)
 
hm
@Joe what do you mean plot it in 2D?
perhaps you can use intensity or one of the colors to show a "3rd" dimension
you'd get a 2D plot
but you'd have depth...
 
server version updated with /list lol
 
I think I might have to switch professions. :P
 
o:
 
Because I don't see how this situation is possible, hahah.
 
4:27 AM
i was distracted before, what's up?
 
console.log(events) shows an object that has a property "keydown" that's an array with four elements.
 
ok
 
But when you get events["keydown"] or events.keydown it's an array with one element.
 
is this from chat?
 
It's the jQuery event handler...holder.
But yeah, for a chat modification script.
 
4:29 AM
you know i was able to get enter working and i'm not using shift+enter, right? just making sure you're not writing it for that hehe
 
Well, it's actually in the code I wrote based on that, heheh.
I made a general purpose bindAs(nth...) function so I could hook in various places.
 
var events = ???
 
var elemData = jQuery.data( elem );
var eventKey = elem.nodeType ? "events" : "__events__";
var events = elemData[eventKey];
And you can see what it looks like in Firebug here:
37 mins ago, by Tim Stone
But events["keydown"] looks like this:
40 mins ago, by Tim Stone
 
elem = ?
 
And the log statements were literally console.log(events); console.log(events["keydown"]);
elem is the current DOM node in the jQuery result set.
 
4:37 AM
ah, what element are you using for testing?
 
I used click when I tested it.
 
Yeah, I get that in the console too.
What sort of black magic is this?! :P
 
oh, i think i'm confused about how to attempt to reproduce this then >_>
 
I don't even understand how it's possible, heh.
Property shows up as an array with four elements, like I expected.
I get the property, and print that property.
And now it's an array with one element.
 
4:43 AM
hehe well i'm trying to help i just need to reproduce it first
 
Hm, maybe I should see if the same thing happens in Chrome.
must remember to use chat-friendly expressions of anger
I guarantee that I know what the problem is.
 
o:
 
It's Firebug's fault.
 
that's not very nice of it
 
It isn't :(
See, I click the link to view the events object...
And it shows me the current object.
But the current object doesn't represent the state of the object when I printed it out, heh.
Basically, I forgot to wait for the document to be ready, so when my code gets called, there aren't any other event handlers yet.
 
4:55 AM
oh
 
Yeah, so events[type] gets replaced I guess, and when I click it it shows me the original copy (the one I was expecting), but when I click on the events object I get the current copy, which isn't what I was expecting.
Well, at least the computer hasn't performed magic, I can still be a programmer. ;)
 
(;
 
I have an exceedingly strong distrust of Firebug now, though ;)
 
hehe gee
list command can do a search too ^__^
i wish i was this motivated with work code haha
 
Nice. :D Yeah, I was thinking the same thing, hahah.
I'm putting off worrying about that until Monday though, heh.
 
5:06 AM
teehee
oh and i have a true /join now too
 
How's that work?
 
the output from /list is a list of links with the text "id - name", and /join takes in the id
 
Ah, cool.
 
hahahaha
i just found a bug in my validateArgs function
 
Oh? :P
 
5:15 AM
i pass in an array of strings containing the expected type. so for star, quote, join i pass ["number"]
and i'm checking typeof(actualArgs[i]) === typeof(expectedArgs[i])
):
find the bug (;
 
Ah ha :P
Stringy-numbers FTW?
 
oh, no, there's a line that checks for expectedType = "number" and checks if it is a valid number
typeof(expectedArgs[i]) is always going to be a string
makes the check pretty damn useless
 
Yeah. ;)
Heheh
Clearly your function accepts input of "two four three zero zero eight"
 
(;
server version updated if anyone is keeping track
 
5:51 AM
Hooray, progress.
 
6:15 AM
'Ello
 
'Ello
 
So, where are we now?
 
Here. :P
I'm not sure, @rchern has been adding commands left and right
 
@rchern I used the isNaN check after a parseInt to do that
 
I've been cursing Firebug, and, more recently, working on my own script, heh.
 
6:19 AM
So, /join only takes room id as of now?
 
6:37 AM
commits war crimes with jQuery chaining
 
@TimStone How many functions?
 
It's not the count that matters..
 
@TimStone It's usually a pretty good indicator of the evilness of the chain
 
var action = event.which == 38 ? "prev" : "next",
      order  = event.which == 38 ? "last" : "first";

selected[action + 'All']('.message')
    [order]()
    .add('.message:' + order, selected.closest('.monologue')[action]('.monologue'))
    [order]()
    .each(function() {
    selected.removeClass('easy-navigation-selected');
        $(this).addClass('easy-navigation-selected');
    });
Just because I can!
 
@TimStone O_o
 
6:40 AM
Actually that's terribly inefficient, so I'll be fixing that up, heh.
 
The last 12 hours confirm jQuery brings mental illness
 
You should setup a foundation for our rehabilitation.
 
Guido van Rossum already has :D
import sanity
 
@radp $.get('sanity.py', function(data){ $(data).apply() });
Not enough jQuery!
 
I don't think that's going to work :P
unless jQuery comes with a Python interpreter.
quietly pastes an Egg code in the console
 
6:48 AM
0
Q: write python inside jquery

NeveenI have a web2py application and am using jQuery to validate data. I want to write Python code inside jQuery. How can I do that? if($("#myform_parent_id")[0].value != '' && $("#myform_parent_birthdate")[0].value != '' && // Here I want to write Python code .. } ...

2
Not quite the same thing, but it make me laugh nevertheless.
Oh wait, actually reading the question, it is almost the same thing.
 
@rchern That code you wrote for /list.. is evil
 
balpha, thanks for cross-site eggs.
 
Alright, time for a quick break, and maybe when I get back my sanity will have returned enough that I can rewrite that code the reasonable way.
 
aww, the Gaming egg doesn't activate here though.
 
Good Morning
 
7:14 AM
'Ello @Chacha102
 
> They should choose a name with more "zazziness" (Kaching Office, I dunno)
 
> Benoit Mandelbrot, who discovered mathematical shapes known as fractals, has died of cancer at the age of 85. Mandelbrot, who had joint French and US nationality, developed fractals as a mathematical way of understanding the infinite complexity of nature.
 
._.
 
@radp That chat log makes my head hurt.
 
7:50 AM
@TimStone chat log?
 
Yeah, that's all the Slashdot entry links to is to an IRC chat log between the members.
 
oh.
 
I just added in some additional functionality to the /list command
First of all, it will now list all rooms
You can also now pass in an optional argument to turn it into a room search
list: function (match) {

            $.get('/', {
            	'tab': 'all',
            	'sort': 'active',
            	'page': 1
            }, function (data) {
            	var ul = $('<ul />').css({
            		'list-style': 'none',
            		'text-align': 'left',
            		'font-size': 11,
            		'column-count': '3',
            		'-moz-column-count': '3',
            		'-webkit-column-count': '3'
            	}), page = $(data),
            		pageCount = page.filter('.pager').find('a').length;
The CSS should really be moved somewhere else
 
8:06 AM
@TimStone > (21:45:17) ohallot: well, you see, the reality is that i only see CorNows, christoph_n and ohallot as the community memebers and all other are now Oracle employees so I take it as Oracle wants us to get out
this explains who is what there :)
basically all non-Oracle employees of the council took part in the LO fork and were asked to leave
now the OpenOffice.org Community Council is 100% Oracle.
 
Yeah
 
Heheh, what are the chances?
@YiJiang Where else would you put it?
Nice, that worked well.
 
@TimStone Well, instead of attaching it in using the css function every time
 
@YiJiang Makes sense :)
 
8:20 AM
We could write something similar to GM_addStyle which injects the styles into the header
 
Yeah
 
Also, we should consider writing a username processor that will string out any preceding @ so that we can use autocomplete to get the usernames
 
8:45 AM
okay, here's a question
can I write a webapp that loads a page in the background with the user's cookies, then parses it?
The page is not JSON or XML, it's basic ASCII data.
 
@radp What sort of user interactions will initiate these actions?
 
@YiJ it'd monitor the page for changes every few (15? 30?) seconds.
 
@radp Hmmm... really not sure
 
it doesn't have to be a separate webapp, it can be a GM that injects itself in a same-domain page.
it's probably better the latter way, actually.
to be more specific I'd like to make a GM that updates somebody's reputation score "live."
either by scraping the API (but then I can only do so once every ~288 seconds?) or the /reputation page.
it's probably better to do it the API way though.
(the API limit is 300 calls/day right?)
 
-3
Q: i need programming

MOHAMMADI HAMIDREZAhello i need to writting program in matlab that calculate sum of any two matrix m*n ( parametric) and i need to writting program in matlab that calculate multiply of any two matrix m*n ( parametric) i need to writting program in matlab that calculate detrrminate of any matrix m*n ( parametric) ...

 
8:51 AM
@radp From the same IP address. It might be better to simply ask for an API key.
 
the API key should be kept, um, secret right?
so I can't embed it in the GM.
> Remember that using a revoked or invalid key on a request will cause that request to not be completed. Consequently, an abusive application using your library could result in all legitimate applications also using your library being banned from the API.
if somebody takes the key off my GM and does abusive stuff with it, my key stops working.
however, it kinda bothers me that the API granularity is on a day basis.
even with the API and a key, I can't just ask for what changed in the last 8 seconds, I need to get the day's activity and diff before I can get the new reputation score.
 
@radp If you're working with GM, why not just access the user's /reputation page?
 
@YiJiang that's the alternative (what I asked before); however, asking for a rep recalc every n seconds sounds bad.
 
It's quite expansive, but if you access it like.. erm.. once every 10 min (?) it should be okay
 
how frequent it is for you to stay on the same SO page for 10 mins?
...or for 288 seconds.
 
9:03 AM
If you're changing pages frequently, then you see any reputation updates as a result of the refresh, so I'm confused. :P
 
I guess that I should take this to my advantage actually.
 
@radp Most of the time I just click into a question, see if I'm interested, then click away if I'm not
However, there are a lot of times where I simply open something up, forget about it, then realize that I had left it open for erm... hours
 
- Put the top bar as position:fixed so that it becomes always visible
- Wait for the user to stick on a page for more than 30 seconds, say you start writing an answer
- Update every 15 seconds
well, SO chat does detect when you tab away.
 
@radp position: fixed. static is the default
 
@YiJiang I have a question open still that was asked in July. ._.
 
9:06 AM
Hehe... the newsreader on the BBC just mispronounced Mr. Mandelbrot's name
@TimStone Well, that certainly beats my record
 
I think that I actually took a lot at it sometime in August, but eh..
Oh, actually not as bad as I thought, I commented September 26th
 
@radp Might not want to access the /reputation page that frequently. The SO team indicated that the page is quite expensive to call up
 
I know.
the fact /reputation isn't rate limited doesn't mean I should use it.
 
You could always screen-scrape the top of some relatively static page, like /about or something.
 
however, the API rep report isn't complete
 
9:10 AM
/delay [time] [message] delays the [message] by [time] seconds. Not sure how useful it is... but I'm sure somebody will have a need for it
delay: function () {
	var args = $.makeArray(arguments),
		delay = parseFloat(args.shift()),
		msg = args.join(" ");

	if(isNaN(delay)){
		throw new Error('First argument must be a number');
	}

	setTimeout(function(){
		$('#input').val(msg);
		$("#sayit-button").click();
	}, delay * 1000);
}
 
/users/recent says I earned 35 rep yesterday on Gaming
the API claims I earned 15
 
@radp /user/recent should be more accurate
 
...wait, I'm a dummy
1287240773 is in seconds, not days
excuse me while I facepalm myself
that's why backing off on that argument changed nothing.
 
9:59 AM
/leave [all | room id | room name]. Calling this command without any argument will leave the current room.
[room name] will match partially matching room name
leave: function(argument){
	if( !argument ){
		// No argument - Leave current room
		$('#leave').click();
	} else if( !isNaN(parseInt(argument, 10)) ){
		// Numerals - Leave room id
		$('#room-' + parseInt(argument, 10)).children('.quickleave').click();
	} else if( argument.toLowerCase() === 'all') {
		// all - Leave all rooms
		$('#leaveall').click();
	} else {
		// String - leave room containing string
		$('#my-rooms > li > a:first-child:contains("' + argument + '")').siblings('.quickleave').click();
 
gah, reflection from the JS console is painful.
  api.UsersByIdReputation( { id: user_id,
                             fromdate: date
                             } ).getResponse( function(data){ x = data; } );
Uncaught SyntaxError: Unexpected token <
why? why do you need to care about what's in data? can't you just give me it to me in this handy global variable so I can inspect it?
 
@radp Hmmm.. ? Where's that syntax error from?
 
@YiJiang I guess it's in the assignment
indeed removing the assignment removes the syntax error
 
@radp Eh... do you have x declared outside the scope of the function with var x?
 
no, actually I want to run that in the inspector so I can inspect x
so I want to get a global variable.
 
10:06 AM
Hmmm... then just declare var x in the global scope
Or var window.x
I think the var there is redundent
Yes, the var is redundant. window.x should do
 
> function update_reputation_since(date){
  if(date === undefined)
    throw new Error("Please specify a date object.")
  api.UsersByIdReputation( { id: user_id,
                             fromdate: date
                             } ).getResponse( function(data){ window.x = data } );
}
< undefined
> update_reputation_since(new Date())
< undefined
apistackapps.com/1.0/users/1165/reputation?fromdate=1287310132&jsonp=Soapi._internal._callback8:1 Uncaught SyntaxError: Unexpected token <
 
Still doesn't work?
 
yep, same error.
wtf?
wait -- that's a line number: apistackapps.com/1.0/users/1165/reputation?fromdate=1287310132&jsonp=Soapi._internal._callback8 :1
 
@radp Eh... you might have missed a bracket or semicolon somewhere
 
the error is in the callback function!
I guess I should report it to the Soapi guy then.
 
10:13 AM
oh yeah, so there is a SO chat :]
 
and an MSO chat :}
 
wondering when the meta.chat.meta.stackoverflow.com is finished
 
as soon as you get Jeff to do that
> Soapi._internal._callback10
< function (f){deleteJsonp(b);Soapi._internal.applyParameters.call(f,f,e,l,k);if(f.error){f.error.url=d;_onError(f.error,c,g);_onComplete(a,f.error,c)}else{for(var m in f)if(isArray(f[m])){f.items=f[m];f[m]=a;delete f[m];break}cacheResponse(h,i,f);_onSuccess(f,c,j);_onComplete(f,a,c)}f=a}
...there's no < there :/
 
@radp That's the first line?
As in, that's all?
 
yeah, that's all. (I'm using the mini version)
 
10:17 AM
Erm... no cut off by, say line wrap?
 
the parentheses are balanced...
here, using the extended version.
> Soapi._internal._callback1
< function (data)
        {
            deleteJsonp(cbn);

            Soapi._internal.applyParameters.call(data, data, true, target, apiKey);
            if (data.error)
            {
                data.error.url = lastUrl;
                _onError(data.error, context, error);
                _onComplete(null, data.error, context);
            }
            else
            {
                for (var name in data)
                {
                    if (isArray(data[name]))
 
I don't know... it could be somewhere else
 
    function deleteJsonp(cbn)
    {
        // part of a concerted effort to reduce memory footprint
        var node = document.getElementById(cbn);
        if (node)
        {
            node.parentNode.removeChild(node);
            node = null;
        }

        Soapi._internal[cbn] = null;
        delete Soapi._internal[cbn];
    };
@YiJiang okay, so how the hell do I understand where the problem is?
 
@radp I'm sorry, this is too weird
 
._.
oh well.
 
10:25 AM
Where are you debugging this from?
 
Chromium 8
 
I'm not sure what's happening. Maybe, post on SO or StackApps
 
will do
hrm
site = "api" + window.location.hostname;
...this just might be a problem.
> update_reputation_since(new Date())
< undefined
> x
< Object
I'm so sorry, @YiJiang :(
btw, are for-in loops (still?) broken in JS?
 
10:49 AM
@radp They're not "broken"
It's just that you're not suppose to use them to iterate through array
 
...yeah, who would want to do that? Iterating through arrays? Seriously?
I used $.each(array, function) instead.
(or $.each also doesn't like arrays?)
 
@radp Should be okay I think
 
uh, !=== doesn't exist?
 
@radp It's !==
 
isn't a!==b === !(a==b)?
I'm just going by common sense here
this upsets balpha but still...
 
10:52 AM
@radp No, it should be !(a===b), like how != is the 'opposite' of ==
 
oh. heh. good point.
 

« first day (74 days earlier)      last day (4947 days later) »