dist/Dear Lazyweb,
Every so often, when I try to look at the source/assembly view in Shark
it'll complain that it can't find the file at, say
"../../../dist/content/nsINode.h". Ideally, I'd just tell it the
directory relative to which these relative paths should be resolved. Any idea
how to do it? Of course even more ideally it would Just Work without me having
to do anything...
It's nice to write code sometimes unburdened by either C++ or performance considerations. It can just look so nice as a result!
function stringToURL(str) {
return (new StandardURL(nsIStandardURL.URLTYPE_AUTHORITY, 80,
str, "UTF-8", null))
.QueryInterface(Components.interfaces.nsIURL);
}
function pairToURLs(pair) {
do_check_eq(pair.length, 2);
return pair.map(stringToURL);
}
function test_setQuery()
{
var pairs =
[
["http://example.com", "http://example.com/?foo"],
/* more pairs here */
].map(pairToURLs);
for each (var [provided, target] in pairs) {
/* Set the query and test for equality here */
}
}
To go with this whole awk meme:
% history | awk '{a[$3]++ } END{for(i in a){print a[i] " " i}}' | sort -rn | head
37 latex
27 bibtex
13 cvs
4 ls
3 history
3 backupwork
2 xterm
2 emacs
2 clfiles
1 xdvi
Some notes: