Internet Explorer’s Trailing Comma Woes
Internet Explorer is notorious for breaking on trailing commas in JavaScript array declaration. e.g.
var obj = {
a: 1,
b: 2,
};
fails on IE, while all other browsers just ignore the innocuous trailing comma after second element.
Weeding out these commas from JavaScript code is absolute PITA. However, here is a regular expression search string I wrote to search such instances in the code.
,\s*\n+\s*[\}\)\]]
Even better,
,\s*\n+(\s*\/\/.*\n)*\s*[\}\)\]]
matches multiple new lines and comments.
Compiling Greasemonkey Scripts to xpi (Firefox Extension)
This page has a tool to create a Firefox extension (.xpi) from a greasemonkey script.
http://arantius.com/misc/greasemonkey/script-compiler
Gmail Updated
Gmail’s new version rolled out for me today, and first thing I noticed that it had reset my gmail chat config (basically I had switched off gmail chat), my greasemonkey scripts were broken and I had a firebug extension warning on top.
While I have no gripe about greasemonkey, resetting gmail chat setting means I’ve to check rest of my settings to be sure anything else is not broken.
New version seems quicker, with additional options in “More Actions” menu and updated “Contacts” section.
Direct Link to IMDb Movie Quotes
A small greasemonkey script to get direct link to a quote on IMDb’s “memorable quotes” page. This script creates a “#” with a link to corresponding quote.
Cookie Stealer
Someone has been posting cookie stealing greasemonkey scripts at userscripts.org.
Any of the following code snippets are red flags.
.php?cookie=
encodeURIComponent(document.cookie)
SQL Injection
A good primer on SQL Injection techniques,
to help beginners with grasping the problems facing them while trying to utilize SQL Injection techniques, to successfully utilize them, and to protect themselves from such attacks.
Reveal TinyURL
Totally awesome Greasemonkey script for Firefox - 'Tin Foil Hat' reveals tinyurl in a tooltip.
Past threatening the future
Bram Cohen, the author of BitTorrent is under legal scrutiny for something he wrote back in 1999.
A technological activist’s agenda“I am a technological activist. I have a political agenda. I am in favor of basic human rights: to free speech, to use any information and technology, to purchase and use recreational drugs, to enjoy and purchase so-called ‘vices’, to be free of intruders, and to privacy.
I further my goals with technology. I build systems to disseminate information, commit digital piracy, synthesize drugs, maintain untrusted contacts, purchase anonymously, and secure machines and homes. I release my code and writings freely, and publish all of my ideas early to make them unpatentable.
Technology is not a panacea. I refuse to work on technology to track users, analyze usage patterns, watermark information, censor, detect drug use, or eavesdrop. I am not naive enough to think any of those technologies could enable a ‘compromise’.
Despite my emphasis on technology, I do not view laws as inherently evil. My goals are political ones, even if my techniques are not. The only way to fundamentally succeed is by changing existing laws. If I rejected all help from the political arena I would inevitably fail.”
The big fishes are already after Bram’s blood for developing BitTorrent. Oh Bram, don’t get into trouble for not knowing the future and writing this parody. “They” blame you for failure of their outdated business model. But why hinder the evolution of technology. BitTorrent is the present and future of how data will be transferred over network.
Bram Cohen on Slashdot
While skimming through Bram Cohen’s comments about Avalanche on his blog, I came across his views on Slashdot discussions.
“I’ve generally avoided slashdot discussion, due to the poor quality of discussion there.The other day I fiddled with it a bit, and set the value for ‘funny’ to be -4, the minimum to display to 3, and display to nested, and suddenly the quality of discussion is altogether more reasonable.
This presents a bit of a theoretical problem. I’ve long held the opinion that in trust metrics someone else’s positive cert shouldn’t be counted as a negative cert, because it’s trivially gameable, and yet here it is, exactly that technique is working quite well. I’m not sure what to make of it.”
Some discussion followed this entry:
Uke : “funny” isn’t positive or negative–it’s a dimension. (well, at least one dimension.)if you admit the possibility that opinions could be negatively correlated, then you get a lot better results from reputation systems when you reliably disagree with someone!
Bram: I might buy that if I didn’t like things which are funny. I do like things which are funny, the problem is that the vast bulk of things labelled ‘funny’ on slashdot aren’t funny at all, they’re obnoxious.
Uke : That’s why I said that it was at least one dimension. On slashdot, “funny” maps to a positive opinion for some people, and a negative one for some other people. “Funny” has no universal meaning on slashdot, just like it has no universal meaning anywhere else in the realm of human language.
My views; well sometimes what modded “funny” might not funny at all, but then there is meta moderation, which eventually eliminates bad/incompetent moderators. Isn’t it here even the wiki concept shares grounds with this. The system eventually corrects itself (or gets extinct, I must add). And obvious but obligatory, “funny” is an individual perception. You can’t lay all the reliability on the moderation system, as it’ll always have all the shortcomings of a democratic system(read anonymous moderation, in this case). IMDb’s rating system is much more flawed in that sense, and no-one should take it as the ultimate truth, yet these scores do give a general idea of things.
Perhaps, a more reliable system would be weighted moderation, everyone who rates has a weight associated with him/her (Google page rank?), or even custom weights assigned by the reader. Would it be scalable? Yes! certainly.