Abstracting forms and models in appengine & django

If you have many Models in your appengine, django apps you are not going to create a separate form class for all the Models, are you? You got to be kidding me.
So, here is a simple short code that will generate the class object for you, just pass in various details 🙂


def Formfactory(model, exclude_list, data=None, instance=None):
"""
An abstraction layer for forms and models
"""
class AbstractForm(djangoforms.ModelForm):
class Meta:
pass
setattr(Meta, 'model', model)
setattr(Meta, 'exclude', exclude_list)

myForm = AbstractForm(data=data, instance=instance)
return myForm

### Usage
t = Formfactory(Person, ['created_by', 'date_of_joining'] , data={'Name':'pranny'})

It can be normally used with all the is_valid() and rest.

Hope you will find it useful. Don’t forget to comment.

Get SMS Alert for google talk

Hello, the wait for SMS alert in google talk is finally over, here is a way how you can get SMS alert from google regarding people who SMSed you while you were offline. Although there is no official service, this is a tweak or “jugaad” in a sense, that lets you to receive SMS notifications when you are not available.

  1. Install Pidgin IM client. In case you are having issues regarding configuring Pidgin for google talk, you can look here.
  2. Create a Google Calender and in the settings tab (on the top right corner), go for notification settings. Create a SMS alert for it. Type your mobile number and verify your mobile.
  3. If you are Windows user, download this file . Unzip it and copy the file named gsms.dll in the folder C:\Program Files\pidgin\plugins.

    In case you are a Linux user, download the required file from this location to ~.purple/plugins.

  4. Configure the plugin as follows

    Open the Plugins from the main window of Pidgin, and then so the following things

    Gmail account: your gmail e-mail (example: foo.bar@gmail.com).
    Password: password for specified account.
    Timeout: Number of minutes for gsms to collect chats until it sends them.
    Calendar feed path: Which calendar to use (example: “/private/full” translates to: http://www.google.com/calendar/feeds/foo.bar@gmail.com/private/full)

KDE 4.0

Every cloud has silver lining, but i think this one has something more than just linings, it seems to have silver spots in it. Well, i am talking about the much awaited KDE 4.0 which was released just two days back. It is a free sunday here in India, and i decided to have a peep into what it looks like.

The Installation
The installtion of KDE 4.0 on my OpenSUSE 10.3 was not a big trouble, with the One Click Install for openSUSE 10.3. However of all the packages selected, the digiKam was not installed successfully.

The actual Experience
I logged in again and switched to the KDE 4.0 session, and it was just amazing. With the new applications like Plasma, KickOff, Widgets and KRunner, it seemed to be fun and a completely new UI for me.

This is the dashboard view of Plasma. So, instead of the old, “Show Desktop”, you can just switch to dashboard by pressing CTRL+F12 and manage your desktop while letting other applications function.


The screen grid utility is among the other utilities that make the UI very calm and comfortable.

The issues
However there are several issues regarding the use of KDE 4.0. Just like every other Linux application, in its first release, it is quite buggy. It seemed like on every click that i made, the KDE 4.0 crashed. Sometimes, while switched to the dashboard view, the system seems to be not responding. You can see the videos being played in the background, but you can’t revert back to the main UI. The Compiz-Fusion that i had installed, seemed to be non functional, and many more. The support documentation is also not enough to explain these issues pretty well.

I think there is still a lot of time, when it will be issue less, and as successful as KDE 3.5.

CyberBullying, the horrible face of Social Web

Cyberbullying suicide stokes the internet fury machine. This is one of the top news at Wired.

What is Cyberbullying?
Cyberbullying or online bullying is a term used to refer to bullying over electronic media, usually through instant messaging and email. Other terms for cyberbullying are electronic bullying, electronic harassment, e-bullying, SMS bullying, mobile bullying, online bullying, digital bullying, or Internet bullying. Cyberbullying is willful and involves recurring or repeated harm inflicted through the medium of electronic text. According to R.B. Standler bullying intends to cause emotional distress and has no legitimate purpose to the choice of communications. Cyberbullying can be as simple as continuing to send e-mail to someone who has said they want no further contact with the sender. Cyberbullying may also include threats, sexual remarks, pejorative labels (i.e., hate speech). Cyber-bullies may publish personal contact information for their victims at websites. They may attempt to assume the identity of a victim for the purpose of publishing material in their name that defames or ridicules them.

Types of Cyberbullying.
Cyberbullying can occur in following forms. One or more can be potential.

  • E-Mail.
  • Blogs
  • Instant Messages (IMs)
  • Chat rooms
  • Bash boards
  • Small text Messages (SMSs)
  • Websites
  • Voting Booths
  • Others

Statistics
The Youth Internet Safety Survey-2, conducted by the Crimes Against Children Research Center at the University of New Hampshire in 2005, found that 9% of the young people in the survey had experienced some form of harassment. The survey was a nationally representative telephone survey of 1500 youth 10-17 years old. One third reported feeling distressed by the incident. Distress is more likely for younger youth and those who are the victims of aggressive harassment (including being telephoned, sent gifts, or visited at home by the harasser). Compared to youth not harassed online, victims are more likely to have social problems. On the other hand, youth who harass others are more likely to have problems with rule breaking and aggression. Significant overlap is seen — youth who are harassed are significantly more likely to also harass others.
Hinduja and Patchin completed a study in the summer of 2005 of approximately 1500 Internet-using adolescents and found that over one-third of youth reported being victimized online and over 16% of respondents admitted to cyber-bullying others. While most of the instances of cyber bullying involved relatively minor behavior (41% were disrespected, 19% were called names), over 12% were physically threatened and about 5% were scared for their safety. Notably, less than 15% of victims told an adult about the incident. Additional research by Hinduja and Patchin found that online bullying victimization is related to offline problem behaviors.

A survey by the Crimes Against Children Research Center at the University of New Hampshire in 2000 found that 6% of the young people in the survey had experienced some form of harassment including threats and negative rumours and 2% had suffered distressing harassment.

A study by Campbell of Year 8 students in Queensland, Australia found 14% had been a victim of cyber-bullying, 11% admitted to bullying, while 25% knew someone who had bullied. Anecdotal evidence suggests that girls are more involved than boys as they are more likely to communicate regularly.

Preventing Cyberbullying
Following measures should be taken to prevent cyber-bullying.

  1. Never give out personal information, password, PINs etc
  2. Don’t believe everything you see or read.
  3. Use netiquette
  4. Don’t send a message to someone else when you are angry.
  5. Don’t open a message from someone you don’t know.
  6. If it doesn’t look or feel right, it probably isn’t
  7. You don’t have to be “Always On” turn off, disconnect, unplug, try actual reality instead of virtual reality!

If you are a victim, what should you do.
If you have been a victim of cyberbullying, you should follow these steps.

  1. Don’t reply the message from cyberbullies
  2. Do not keep this to yourself! You are NOT alone and you did NOT do anything to deserve this! Tell an adult you know and trust!
  3. Inform your Internet Service Provider (ISP) or cell phone/pager service provider
  4. Inform your local police
  5. Do not erase or delete messages from cyberbullies
  6. Protect Yourself. Never arrange to meet with someone you met online unless your parents go with you. If you are meeting them make sure it is in a public place.

These steps would help you protect yourself from cyberbullying.

Bookmarking Gmail 2.0

With the coming of gMail 2.0, many things have changed, like for an instance, the emails are faster, there is a better contact management. However, something that i really liked is that the URLs are different in different case. And hence they can be used as bookmarks in the web browser. Here are some of the URLs.

Vista Vs. Linux … The search battle

Hello people, at this blog, i am just giving some search results that are reflected back by Google and yahoo on some nice keywords regarding Vista and Linux…

Jet Set… Go…

  • Who is Greater
    “Vista is great”
    137,000,000 results from Google
    51,400,000 results from Yahoo

    “Linux is great”
    165,000,000 results from Google
    48,500,000 results from Yahoo

  • Which has more bugs
    “Vista has bugs”
    18,200,000 results from Google
    4,920,000 results from Yahoo

    “Linux has bugs”
    69,700,000 results from Google
    9,710,000 results from Yahoo

  • Who suck more ??
    “Vista sucks”
    2,340,000 results from Google
    6,530,000 results from Yahoo

    “Linux sucks”
    2,290,000 results from Google
    5,180,000 results from Yahoo

  • Stability
    “Vista is Unstable”
    1,720,000 results from Google
    2,020,000 results from Yahoo

    “Linux is unstable”
    2,100,000 results from Google
    2,430,000 results from Yahoo

  • Who use what
    “I use Vista”
    461,000,000 results from Google
    118,000,000 results from yahoo

    “I use Linux”
    450,000,000 results from Google
    146,000,000 results from Yahoo

  • Which is secure
    “Vista is secure”
    62,000,000 results from Google
    21,700,000 results from Yahoo

    “Linux is secure”
    119,000,000 results from Google
    30,600,000 results from yahoo

Amazingly, according to Google, there are more Vista users, while according to Yahoo, there are more Linux users.
One thins is clear, no doubt that Linux has much more bugs than Vista, but still people think that Linux is great than Vista.