Archive for the ‘Technology’ category

HOAX, SPAM, windows7giveaway

October 23rd, 2009

——– Forwarded Message ——–
From: Saurabh Jain <>
Reply-to:
To: PuneStartups <>
Subject: [PuneStartups] Re: Invitation from Vijay!
Date: Thu, 22 Oct 2009 22:17:47 -0700 (PDT)

 I wrote to Microsoft Customer Service regarding the validity of this domain name. The following response sums it up. --- Dear Sir, Thank you for your e-mail concerning the Microsoft lottery. We would like to confirm this is a hoax website and did not originate from Microsoft. Microsoft does not have any connection whatsoever with this alleged lottery. It's unfortunate that some people have chosen to abuse the freedom that the internet offers by conducting fraudulent activity. Privacy and security are very important to Microsoft. For more information please visit the following website: http://www.microsoft.com/security/lottery/default.mspx Yours sincerely, Microsoft UK --- 

Posted via email from ThinRhino Email Blog

Confusion between Form Validation and Model Validation in Django

August 31st, 2009

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic designwww.djangoproject.com

Using Django Model Form can make it fast and powerful to validate input data. But new Django programmer can be confused between form validation and model validation. Both of these are defined in models.py

class Report(models.Model):
    name = models.CharField(_('Name'), max_length=20, blank=False, null=False, default=None)

When you define "null=False" and "blank=False" to the model field, let see what you will get?

"null = False", sure thing that it's gonna raise IntegrityError when you try to save but didn't assign value to the field.

"blank=False", Do you suppose that it's gonna work at model level?

If so, you will be disappointed because "blank=False" will take effect only at form level. Means that you can save the instance using the shell.

(InteractiveConsole)
>>> from report.models import Report
>>> new_report = Report()
>>> new_report.save()
>>> Traceback (most recent call last):

>>> IntegrityError: report_report.name may not be NULL

 Assign blank name.

>>> new_report.name = ''
>>> new_report.save()

Now you get the Report object with blank in the name field in the database!

To avoid this, let's create the helper:

from django.db import IntegrityError
def not_null_not_blank(instance, attribute_name_iter ):
    for attribute_name in attribute_name_iter:
        if not getattr(instance, attribute_name):
            raise IntegrityError('%s.%s may not be NULL or BLANK' % (instance.__class__.__name__, attribute_name )) #This line is inspired by Nattapon (@wrongite)

And override your model's save function:

class Report(models.Model):
    name = models.CharField(_('Name'), max_length=20, blank=False, null=False, default=None)
    def save(self, force_insert=False, force_update=False):
        not_null_not_blank(self,('name',  ))
        return super(Report , self).save(force_insert=force_insert, force_update=force_update)

Now exit the shell and open it again ( to reload new code you've just changed )

(InteractiveConsole)
>>> from report.models import Report
>>> another_report = Report()
>>> another_report.name=''
>>> another_report.save()
>>> Traceback (most recent call last):

>>> IntegrityError: Report.name may not be NULL or BLANK

Now you're good to go!! ; )

Sourced from: http://proteus-tech.com/blog/code-garden/confusion-between-form-validation-n-model-validation-in-django/ The website was not working on the day I tried to access it. Accessed it from the Google cache.


Ships are safe in the harbour
But that is not what ships are built for

Posted via email from thinrhino’s posterous

Success of Google!

August 29th, 2009

"I've hired hundreds of researchers over the course of my professional life; today I get answers from Google far faster than it would take to explain most of my questions to a live assistant" – Peter Huber, Senior fellow, Manhattan Institute (*).

This is, I believe success of Google. Ease of finding answers to complex questions.

* Source: Forbes India, 28 August 2009 Issue

Posted via email from thinrhino’s posterous

Convert *.mkv video file to *.avi

August 28th, 2009

Recently my brother got me some movies in a .mkv format. Hi-Res rips of movies suitable to play on HD Screens.

But these files do not directly play on some DVD players. We need to convert them to a .avi format.

mencoder -mc 0 -noskip -vf expand=:::::16/9,scale=720:480,hqdn3d,harddup -ovc xvid -oac mp3lame -xvidencopts fixed_quant=3.8:me_quality=6:noqpel:nogmc:trellis:chroma_me:chroma_opt:hq_ac:vhq=4:lumi_mask:max_key_interval=300:quant_type=mpeg:max_bframes=2:closed_gop:nopacked:profile=asp5:autoaspect:bvhq=1 -lameopts vbr=2:q=6:aq=2 -o outfile.avi infile.mkv

A open source application mencoder, helped me convert the file to an .avi format

Posted via email from thinrhino’s posterous

Open-source software in the recession: Born free

August 27th, 2009

Open-source software in the recession

Born free

May 28th 2009
From The Economist print edition

Open-source software firms are flourishing, but are also becoming less distinctive

MANY technology firms are floundering amid the recession. But many of the ones that offer services tied to open-source software—free programs written by volunteers who collaborate online—are boasting double-digit growth. Sales at Red Hat, the world’s biggest independent open-source firm with annual revenues of $653m, grew by 18% year-on-year in the first quarter. More and more firms, particularly in Europe, seem prepared to embrace open source (see chart). “Budgets are tight and we think that is good for open source,” said Jim Whitehurst, Red Hat’s boss, when announcing the results.

Indeed, open source is so widely accepted that traditional software firms are beginning to dabble in it, while some open-source firms are starting to sell proprietary add-ons to open-source programs instead of charging to provide support to firms using open-source software. If current trends hold, traditional software firms and their open-source rivals will soon be hard to tell apart. “A new pragmatism is rising,” says Matt Asay, an open-source advocate and an executive at Alfresco, which makes open-source software that helps firms manage digital content.

The “free and open-source software” movement, as it is officially called, has come a long way from its anti-establishment origins. Pioneers such as Richard Stallman did not want users to be locked into monolithic products, but to be able to change programs in whatever way they wanted, and to share their modifications.

For years, this software commons was no more than an obscure sideshow. But then the internet provided volunteer programmers with a way to co-operate cheaply. IBM and Oracle, two industry giants, threw their weight behind the Linux operating system, in part to weaken their rival Microsoft. After the dotcom bubble burst in 2001, many firms turned to Linux and other open-source software to save money.

Cost is once again the main reason why companies are turning to open source, says Jeffrey Hammond of Forrester Research, a consultancy. Its success is no longer limited to basic software, such as Linux or Apache, a program that powers web servers. Open-source firms are flourishing in databases (Ingres, for instance), business intelligence (JasperSoft), customer-relationship management and other business applications (SugarCRM, Alfresco). In addition, open-source firms have started to move into new markets without proprietary rivals. For instance, a company called Cloudera distributes a version of Hadoop, a program which helps firms process and analyse the unprecedented volumes of data generated by large websites.

But cost is not the only reason for open source’s growing popularity. Many firms now know that it offers more flexibility than proprietary programs, the licences for which often include restrictions on how they can be used, explains Matthew Aslett, of the 451 Group, a market-research firm. And companies no longer perceive free software as riskier, he adds. Getting sued for running programs that inadvertently violate somebody else’s intellectual property, for instance, has proven not to be as big an issue as once feared. Most open-source firms indemnify their customers against such lawsuits in any case.

All this has led many companies to develop a much more pragmatic approach to open-source software. In the late 1990s installing Linux was often something of a gesture of defiance against Microsoft’s domination of the software industry. Today decisions are more rational. The key question is whether the savings in licensing fees for proprietary products outweigh the additional costs in manpower to integrate and operate the free alternative. “Open-source software has become a means to an end,” says Forrester’s Mr Hammond. “Most firms don’t really care that it is libre, as in freedom, but that it is gratis, as in beer.”

Open-source firms themselves have also become increasingly pragmatic. Red Hat and Novell, its main rival, still make money by giving away Linux and charging for support: customers sign up for a subscription that gives them the right to all the updates and someone to call if something goes wrong. Yet recent years have seen a flowering of different business models. A popular approach is to sell proprietary extensions to an open-source core. “The support model does not scale well,” Mr Aslett explains. It does not generate the returns expected by venture capitalists, who invested more than $3 billion in 163 open-source firms between 1997 and 2008, according to a study by the 451 Group.

Conversely, having realised that they can economise on resources and garner good ideas, proprietary software firms are increasingly taking a liking to open-source programs, albeit mostly at the edges of their offerings. IBM has sprinkled open-source software throughout its product line and is rumoured to be interested in buying Red Hat. If Oracle’s acquisition of Sun Microsystems goes through, it will have an even bigger open-source portfolio including MySQL, a popular program for databases. Even Microsoft now carefully embraces what its managers once described as a “cancer”.

Cloud computing—the delivery of processing power over the internet from vast warehouses of shared machines—will further blur the lines between proprietary and open-source software. Most of the firms peddling this model, such as Amazon and Google, use open-source software, since having to pay licensing fees would make the business unprofitable. But their services also rely on code developed in-house, which is not given away free. Microsoft, meanwhile, is building a huge cloud using its own software. If computing becomes a service delivered over the internet, it will hardly matter how the underlying software is developed.

Does this mean that the quest for openness in software is obsolete? On the contrary. If they are not careful, companies and consumers could get locked into a cloud even more tightly than into a piece of software. This is because data residing in the cloud can be hard to move to another service. “If you have a gigabyte somewhere, it develops a certain inertia,” says Mike Olson, the boss of Cloudera, which recently found it could not switch from a poor storage service because there was no way to move the data.

This sort of problem has spawned an open-data movement. In March a group of technology firms led by IBM published an “Open Cloud Manifesto” that has since received the support of more than 150 companies and organisations. It is only a beginning, but perhaps this time around the industry will not have to go through a long proprietary period before rediscovering the virtues of openness.

Something for the people who are still apprehensive to move onto the open source bus!!

Posted via web from thinrhino’s posterous