17 karma · joined Jan 20, 2011 (15y ago) · 10 submissions
comment 15y ago · link · parent
Perhaps with the increasing awareness of this issue, Google will be forced to act.
[1] http://blog.cyberwar.nl/2011/05/google-profiles-exposes-mill...
comment 15y ago · link · parent
Have a look at http://en.wikipedia.org/wiki/Time_complexity , it's pretty comprehensive.
comment 15y ago · link · parent
Does that mean that Google manually decrease rankings of spammy sites that their algorithms haven't caught? Does this entail decreasing the rank of the entire domain, the IP? Does blacklisting ever happen?
I ask since Google have previously[1] said they don't wish to manually interfere with search results.
[1] "The second reason we have a principle against manually adjusting our results is that often a broken query is just a symptom of a potential improvement to be made to our ranking algorithm" - http://googleblog.blogspot.com/2008/07/introduction-to-googl...
comment 15y ago · link · parent
What I was thinking of, was something along the lines of:
// From http://ejohn.org/blog/partial-functions-in-javascript/
Function.prototype.curry = function() {
var fn = this, args = Array.prototype.slice.call(arguments);
return function() {
return fn.apply(this, args.concat(
Array.prototype.slice.call(arguments)));
};
};
els = document.getElementsByTagName('li');
for(i=0; i < els.length; i++){
els[i].addEventListener('click', function(x){
alert(x);
}.curry(i), false);
}comment 15y ago · link · parent
You could make the function take a parameter, then return a function which uses that parameter, or use currying.
Edit: I've posted a working version in my comment further down, http://news.ycombinator.com/item?id=2124559
comment 15y ago · link · parent
This is because the function assigned to the click event of each li is bound to the "i" variable used in the loop by a closure. Variable i is incremented to 4 before the loop ends, so that is what each will print.
You could use make the function used in the click handler take a parameter, then use partial function application (or currying) to fix the value of the parameter.