Anything Else

Tuesday, January 31, 2006

Introducing labelr

If you notice carefully, you will see something different in this blog.

Presenting you

: organize your www.blogger.com blog.

Currently under beta as every self respecting web 2.0 application has to be :-P. There still may be some stuff left to debug, so you will have to hold off for the moment, my day job takes lot of time of mine. In the meanwhile if you want to beta test it, please drop a comment here, or mail me.

Enjoy!

Labels: Python Programming Google labelr Invented Here Django Tips n Tricks


Monday, January 30, 2006

Google Bookmarks, Web 1.0 Style

They revolutionised the mail by introducing the concept of labels, but for online bookmarks they picked folder structure. Makes me think do they really evaluate idea on their merit, or are driven by extreme case of NIH!.

Label: Google


Microsoft Geniuses

Windws XP SP2 introduces a few new twists to TCP/IP in order to babysit users and "reduce the threat" of worms spreading fast without control. In one such attempt, the devs seem to have limited the number of possible TCP connection attempts per second to 10 (from unlimited in SP1). This argumentative feature can possibly affect server and P2P programs that need to open many outbound connections at the same time.

Rant: The forward thinking of Microsoft developers here is that you can only infect 10 new systems per second via TCP/IP ?!?... If you also consider that each of those infected computers will infect 10 others at the same rate:
second 1: 1+10 computers
second 2: 10+10*10 computers (110 new ones)
second 3: 10+100*10 computers ( 1110 new ones)
second 4: 10+1000*10 computers (11110 new ones)
....
all the way to 10*60 + 10^60 computers in a single minute (that's a number with 60 digits, or it would far exceed Earth's population). Even if we consider that 90% of those computers are unreachable/protected, one would still reach ALL of them within a minute.

In other words, even though it is not going to stop worm spreading, it's going to delay it a few seconds, limit possible network congestion a bit, and limit the use of your PC to 10 connection attempts per second in the process !

Link. This "limit" costed us about a man week to discover/understand and fix in our application. Similerly, geniouses are MS do not know how to draw dotted lines:

One of the many irritating things about CSS support in Internet Explorer is that it incorrectly shows dashed borders instead of dotted borders.


Google.cn PR Blunder

Just came across Google's official statement on China Censorship, and this I would consider the PR blunder of the decade. This is the the first two paragraphs:

Google users in China today struggle with a service that, to be blunt, isn't very good. Google.com appears to be down around 10% of the time. Even when users can reach it, the website is slow, and sometimes produces results that when clicked on, stall out the user's browser. Our Google News service is never available; Google Images is accessible only half the time. At Google we work hard to create a great experience for our users, and the level of service we've been able to provide in China is not something we're proud of.

This problem could only be resolved by creating a local presence, and this week we did so, by launching Google.cn, our website for the People's Republic of China. In order to do so, we have agreed to remove certain sensitive information from our search results. We know that many people are upset about this decision, and frankly, we understand their point of view. This wasn't an easy choice, but in the end, we believe the course of action we've chosen will prove to be the right one.

Lets look at the fact: Google claims to do it because their services were slow or down for upto 10% of the time. Now its totally easy to understand that Google has such high quality requirements that this is not acceptable, but if they say this is the their only problem, then they should highlight very clearly that Google is such great company that 10% downtime is not acceptable to them. Their next sentence should have been:

This bad quality of service is due to censorship imposed by Chinese Govt. who is trying to limit access to politically sensitive information. Now we understand that about 93.45% of our usage is not about politically significant matter, and is about matters of science and technology, something that we strongly believe citizens of emerging countries like China should have access to. Considering all this, smart brains at Google, that we managed to preserve after an alian spaceship crash at Google Headquarters sometime in 1998, decide the following: we will create a www.google.cn which will conform to China's censorship, but do not worry, as our stats tell us only (100-93.45 = )6.55% of queries results will be affected by this censorship, in return the youths of China will get unabated access to Google archieves and search results. And we also promise, once again, www.google.com search results will be uncensored going with our spirit. Chinese citizens are welcome to use it if they think their query is not suitable for www.google.cn, although the quality will not be as great as we would like to, due to factors beyond our control. Let me reiterate we are not hiding any information from them, we are just making a smaller subset of inforation more readily available.

Some will say this is a slippery slope, and acceding to one country's demand will force us to do the same for other country, to which all we can say, maybe, but this is one fifth of population we are talking about, and if for their progress we have to dilute the Google brand that we have worked so hard to create, and love so much, its a sacrifice worth making. Atleast we would know we listened to our hearts, and we did our level best.

How could they screw up so bad!

Label: Google


those endless roads


those endless roads
Originally uploaded by amit upadhyay.
Was going through my flickr photos and God I miss Leh! So wish to be there again, with my laptop, satellite internet connection and a month to spare this time :-)

Label: Life Happens


Saturday, January 28, 2006

Mob Mentality Glorified

Rang De Basanti. Refer.

Atleast I am glad they realised they can use guitar and drums in the background scores.

Label: India Calling


Friday, January 27, 2006

Google, We Expected Better

Wasted Opportunity

(Score:5, Insightful)
by fbg111 (529550) Alter Relationship on Thursday January 26, @03:59PM (#14572459)
(http://sciencecrisis.blogspot.com/)

Google states that "while removing search results is inconsistent with Google's mission, providing no information (or a heavily degraded user experience that amounts to no information) is more inconsistent with our mission." Assuming that Google's only alternative was to refuse to censor their results, and hence be completely filtered by the Great Firewall, I would argue that that option would have been more consistent with their mission than their chosen path.

The absence of the world's largest, most popular search engine inside the Chinese firewall would have been as glaringly obvious as a pink elephant. The Chinese people aren't idiots, they know their government censors information [breitbart.com], and they would know why Google had suddenly been blocked by the firewall. Word would get out, through the grapevine and other unofficial channels, and it might even constitute an embarrassing loss of face for the Communist party. Of course, the Chinese would much prefer that Baidu, Sino, or one of their own home-grown search engines be the #1 search engine, but they would still know that the only truly reliable search engine, the one that refuses to censor their information, was Google, and had been blocked by their government. Unlike Americans, the Chinese have long memories, and such an association would pay off in PR and face for Google in the long term.

Google on the other hand might take a stock price hit, but no investor could say they were't warned that Google might make decisions based on long-term considerations rather than short term stock-price-propping, or that Google's corporate values might sometimes conflict with the best interests of their stock price. However, such a move would certainly solidify the image of Google as a singular organization with the most honest and accurate search results worldwide, truly dedicated to its mission of organizing all the world's information.

Furthermore, Google's refusal to cooperate with the Chinese Government might have opened the door for other search engines, media, and businesses to follow suit, and emboldened the Chinese people and businesses to demand more unfettered access to information and less government interference. Someone mentioned on /. in a comment on one of the other articles about Google's recent decision that one problem that international businesses, particularly media, face in dealing with China is that they all deal individually with the Chinese government, and hence have little to no leverage. The Chinese government needs multinationals right now as much as, or more than, multinationals need China, but China needs them in aggregate rather than individually, so can take a divide-and-conquer approach at regulating them. What is needed is an industry organization, formal or informal, dedicated to upholding freedom of the press, to which all media companies operating in China can belong, a support network that mutually resists the pressure by the Chinese government on any one company to censor information. Google refusing to censor its results could have been a step in that direction, and if any company has the clout to the lead the formation of such an organization, it's Google.

So this appears to be an unfortunately wasted opportunity, for Google to make a strong political statement based on its values, that might have hurt it in the short term but most likely have paid off in PR and face in the long-term.

Google, we expected better.
--
All that is human must retrograde if it do not advance.

Label: Google


Thursday, January 26, 2006

Ironic

Gera:

That the chief guest at the republic day celebrations in India, is the king of Saudi Arabia.

Label: India Calling


Please Compile

This is too funny:

When some people receive an error from the compiler, they see it as an indication that they are doing something fundamentally wrong and should change their code. Others see such a message as a challenge to overcome and strive to find a way to trick or force the compiler to do what they want. You can probably guess what camp Jon's predecessors fell in ...

Public Structure UserInformation
Shared intUserID As Integer
Shared strUserID As String
Shared Username As String
Shared Realname As String
Shared Token As String
'Don't know why we need this, but won't compile without it
Public PleaseCompile As Boolean
End Structure

And a note for the VB-deprived, Shared is the keyword for static.

Labels: Programming Humor


Microsoft's Latest Stunt

Slashdot: Microsoft Agrees to License Windows Source Code

They say they do it to comply with a European Union antitrust ruling. Before they fool themselves with the latest MS stunt, I hope they read Countering "Trusting Trust" to get a hint of what issues are faced when we are dealing with trust.

I mean seriously, Microsoft wants people to trust them that the source they are offering is the one that is used for actual build, in an antitrust case! Either give complete source code, not a single line missing of the operating system, all driver, every peice of compiler toolchain, and any other peice of code that might be involved in from the source to the binary that is written on cd, along with complete source code of the burning software of course, and complete documentation of how to build them, and then maybe showing source code may have any sense.

And BTW if you notice very carefully, I am not the one who asked them to open their source, I am not saying they should, all I am saying is if there is any use of opening source code, it can happen only if whats mentioned above happens.


Tuesday, January 24, 2006

Google Vs DoJ: The Real Reason?

Forbes: Why is Google putting a fight against DOJ?
...it's more likely that Google is worried about the results of its search queries and not the technology that powers them. The compromise the Department of Justice has worked out with Google's rivals calls for the search engines to let the government see how often certain search terms were used, but won't let it look up specific IP addresses to what individuals looked for.

That alone could prove embarrassing enough for Google. A public disclosure of exactly how much pornography is on the Internet and how often people look for it--the two data points that will result from fulfilling the government's subpoena--could serve to make the Internet look bad. And Google, as its leading search engine, could look the worst.

Interesting. I wouldn't like news all over the world saying 80% of the users go on internet for porn when everytime my family asks me what I am doing I tell them I am on internet, or when they ask me whats my work and I tell them its related to internet.

Label: Google


Friday, January 20, 2006

Who Are They Fooling

Who are they fooling, Osama has already won.


Google Guts

Google to BellSouth: We won't pay

Google standing up against DOJ

Label: Google


Thursday, January 19, 2006

Python: Make Quit And Exit Work

Came across this excellent source of code snippet. Here is a sample.

exit python shell

Hans Nowak writes about how python interactive shell should quit/exit
when you type 'quit' or 'exit'.
He also shows an example.
>>> class _Exit:
... def __repr__(self):
... raise SystemExit
...
>>> exit = _Exit()
>>> exit # exits the interpreter

Stewart Midwinter comments how he modify it a bit and put them
into the site.py
def setquit():
__builtin__.quit = __builtin__.exit = exit = _Exit()
to python shell exit quit by korakot on Nov 26, 2005

Also check out ordered dictionary module.

Labels: Python Programming


Google Searching Files in Tar.Gz


google_searching_tar_gz
Originally uploaded by amit upadhyay.
Just came across this when searching for [Could not load fastresume data: 'int' object is not callable. Will perform full hash check], google is showing results that point to tar.gz files, they call them "Supplemental Result". Yahoo! gives me no results for the same.

Label: Google


Sunday, January 15, 2006

Django Tips

Here are a few bits I discovered while using django in my projects of late:

  • Authentication framework documentation does not mention whats happening behind the scene. To log in a user you can set request.session[users.SESSION_KEY] to user_id of the user. To logout, delete users.SESSION_KEY from request.session. They should mention this in their documentation.
  • If you find login_required decorator enough for your needs, but do not like the /accounts/login/ url, you can edit django/views/auth/login.py and set them what you want. They should make it configurable through setting.py
  • login_required is convenient but django.views.auth.login lacking , if you modify the "/accounts/login/" line as discussed above, to some of your view own you can avoid django.views.auth.login views.
  • render_to_response documentation, well actually this is just a blog post entry and not supposed to be updated as and when required, and they don't mention what is it in the tutorial when they are using it, nor in the right place where they should. Anyways, when using render_to_response I could not find how to user DjangoContext, and giving up such nice shortcut just because of this was a bit sad. Well it so happens that it is supported, use something like render_to_response('template', context_instance=DjangoContext(request))
  • get_absolute_url model method: well the only documented use of this method is in the admin UI, but admin prefers to ignore it, and uses some redirects instead. Well actually they do not ignore it, and redirect takes you to the right place, but for that to work you will have put (r'^r/', include('django.conf.urls.shortcut')), in your URLConf. Not documented.
  • But this may not solve all your problems with admin site taking you to the right place when you click on "View on Site" in admin. You will have to make sure the sites model contains the right site, which includes the domain name and port number, but without http:// part. Not documented.
  • One of the first thing that comes to your mind when you read django's authentication framework, is wow its cool, but what if I need more fields than they support? Well given I just leared the super cool model framework, I am tempted to create a model and define a one-to-one relationship on it with User. Well bad idea. For some reason this won't work, and the preferred way to do such extensions is Subclassing models.

Best django tip other than "use django, it is cool" would be: join mailing lists, esp django-developers, people are very friendly there, and you get prompt help.

Labels: Python Programming Django Tips n Tricks


Saturday, January 14, 2006

use Inline Python

Inline::Python:

The Inline::Python module allows you to put Python source code directly "inline" in a Perl script or module. It sets up an in-process Python interpreter, runs your code, and then examines Python's symbol table for things to bind to Perl. The process of interrogating the Python interpreter for globals only occurs the first time you run your Python code.

And you can access perl inside python inside perl. Goodness of the opensource!

Labels: Python Programming


Lets Promote Innovation: Patent FAT

ArsTechnica:

On Tuesday, the USPTO announced its decision to uphold the patents, and now coders and users in the free and open source software community, as well as the makers of a wide array of flash storage-based electronic devices, are wondering just how big of a bind they're in.
...
I think Microsoft would be crazy not to hit Linux with these patents, so watch that licensing page for a whopper of an update any day now.

Ofcourse, giving exclusive rights to what has been 20 year old technology derived from common class room teaching to a single company, so that it can dictate what other company products can go in the market, is exactly what we were looking for to promote innovations. Smartest animals on the earth!

Label: India Calling


Thursday, January 12, 2006

My Ideal Logging Framework

I am an agressive logger, which is all the more important for dynamic languages like python, where there is minimal code sanity checking by interpreter. By agressive I mean I have a logging.info("entering function foo, with arguments "blah" of type <str>") and logging.info("exiting function foo with return value ..") at beginning and each end point of most functions I write. Obviously this is going to become tedious, and python decorator are the best thing to do such, but they make the logging extreamly verbose. A good log viewer might be of help for filtering this log is a must. Just came across debug with print statement section of py.test, and that could be a great idea, since logging is very verbose, do not print anything, but when an "interesting event" occurs, print all logs generated in that function call. Which beings us to what is an interesting event? One obvious candidate is exceptions, we all know they are bad, but we can borrow ideas from typecheck, and define a failure by typecheck as another interesting event. [Though typecheck has no provision for acceptable exceptions, a support for typecheck.exceptions() would be good too.]

This can in one go give all all the advantage of strict typed languages, but unlike them, we do not force anything to you, just report when things go out of "normal". This can make programming python even more fun. The reason typecheck should be coupled with logging decorator is because it can become tedious to use too many decorators otherwise.

self.todo++

Labels: Python Programming


Keyword Based Logging

Just came across Keyword-based logging with the py library, pretty cool. Highlights the power of python's metaprogramming. Logging is good, and anything facilitating focused logging is welcome.

Labels: Python Programming


Monday, January 9, 2006

Cell Phone Records for $100

Om Malik reports:

If you watch Law & Order or The Wire as much as I do, you know that your cell phone records, your locations etc is all stored in a giant database at a phone company. What you also know that cops and legal officials can call up that information, but what you don’t know is that now this information is available for sale on the web for a couple of hundred dollars, thanks to sites like Locatecell.com. The ease with which this information is available, has sent FBI and others in a tizzy.

Chicago Sun-Times reports that FBI is worried that agents can be compromised, just like their snitches. The potential for wide-scale abuse is not only imaginable, but quite possible. Chicago Sun-Times doesn’t really talk about how the information ends up with sites like Locatecell.com. Why aren’t the cell phone companies doing something to make sure that this information doesn’t leak out? I mean shutting down the supply is the best way to prevent this from happening. Anyone have more knowledge about this, please post a comment!

BTW I have heard quite a few stories about how easy it is to read SMSs from/to perticular cellphone for call center employess in Mumbai. Hopefully incidences like this will highlight the importance of privacy. If you have data, it is only a matter of few Rs.10/- CD for it to spread out, if you care about it, you will stop people from recording data in the first place, and if you won't you will see some major event that will shock you when you would realize you were stupid not to.

Label: Security n Privacy


RIAA: Behind the Scenes

A musician talks about music deals with Recording Industry Association of America companies.


Sunday, January 8, 2006

Helacyton gartleri

The immortal remains of Henrietta Lacks.


Genetic Algorithms and Keyboard Layout

A very cool experiment.

Label: Programming


Getting it Right

A case study on what Blink did wrong and del.icio.us right. Good read.


Currently Reading

Label: Programming


Saturday, January 7, 2006

iPod Ain't Invincible

If they listen to dashes.


CSS Pitfalls

A good collection of what is not so great with CSS.


Internet Darkages

In the making.


Wednesday, January 4, 2006

Sozialgericht Bremen

Google Blog-scoped reports:

Bjoern Harste is a well-known German blogger – he owns a supermarket and writes about his daily experiences at work in his Shopblogger blog. Now, he received a Cease & Desist by the Sozialgericht Bremen (I’m not sure, but I think they’re a government law institution I’m paying with my taxes a court of law for dealing with cases in the area of German social services) for having one of his blog posts appear in the Google results top ten for “Sozialgericht Bremen Welcome to the world wide web, Sozialgericht, and welcome to Google.

Now the Sozialgericht Bremen wants Bjoern to stop using the words “Sozialgericht Bremen” in his archive. Apparently, the Sozialgericht Bremen thinks the result they dislike will stop appearing in Google, not knowing that it’s actually link text that is more important for such a position... and that it’s not easy to silence a blogger because other bloggers will jump in to help. Bjoern complied by removing the unwanted words, but is publishing the Sozialgericht’s full C&D, asking for help from lawyers.

So, everyone, if you want to help out the Sozialgericht Bremen, stop linking to the Shopblogger using these words.

Go Google: Sozialgericht Bremen.


Rumor: Google PC?

Everyone hates Microsoft Windows, and it seems Google is planning to do something about it at the upcoming CES, reports LATimes:

“Google will unveil its own low-price personal computer or other device that connects to the Internet.

Sources say Google has been in negotiations with Wal-Mart Stores Inc., among other retailers, to sell a Google PC. The machine would run an operating system created by Google, not Microsoft’s Windows, which is one reason it would be so cheap — perhaps as little as a couple of hundred dollars. (...)

Larry Page (...) will give a keynote address Friday at the Consumer Electronics Show in Las Vegas. Analysts suspect that Page will use the opportunity either to show off a Google computing device or announce a partnership with a big retailer to sell such a machine.”

So it begins.

Label: Google


Tuesday, January 3, 2006

Smart!

Using Gmail as My Spam Filter

Label: Google


Monday, January 2, 2006

wikiHow: Wiki for How-To Manuals

wikiHow has got some excellent Creative Commons licensed articles on how to do various stuff, here is one: How to Avoid Annoying Other Drivers:

Do you often find yourself a target for road rage? Are you a victim of tailgating, blinking highlights, and horn-honking? The main thing to remember when driving is to clearly broadcast to other drivers what you intend to do at all times. This may be difficult, considering you can't speak at length with other drivers, but there are many tools at your disposal. Let other drivers know what you're going to do.