Showing posts with label Tips N Tricks. Show all posts
Showing posts with label Tips N Tricks. Show all posts

Wednesday, 16 March 2011

Control activity feeds on facebook



Controlling activity feeds on facebook

Facebook has a setting which lets you chose amongst your friends and pages, whose updates you want to see and whose you want to skip. Here it is how


Next to Most Recent, there is a drop down button. Click on that to gain access to control options. The drop down menu comes only when you are viewing the Most Recent news feeds only. So if you don't see an option, just click on Most Recent. The page will refresh itself and the menu options will come.


Select Edit Options in the drop down menu


Now conveniently you can choose to show news from

  1. Those friends and pages you interact with most or
  2. All friends and pages.
The default setting is "friends and pages" you interact with most. You can also edit friends whose feeds have been blocked in the list.

Tuesday, 15 March 2011

Recursively traversing Python dictionary and removing keys



Code Snippet to recursively traverse a dictionary and remove certain key/value pair


In case of complex dictionaries like
my_blog = { '_created' : datetime.datetime (2007,01,03),
          '_updated' : datetime.datetime (2011,06,11),
            'name'     : 'MyBLive',
            'latest_post'    : { '_created' : datetime.datetime (2007,06,9),
                                 '_updated' : datetime.datetime (2007,069),
                                 'name'     : 'Hello World !' }

The problem with this is that datetime.datetime entities are not JSON Serializable. One approach could be to provide a serializer for datetime.datetime entities as suggested by verte over IRC. If you want to have a datetime.datetime aware JSONSerializer, you should have a look at the django.core.serializers.json module

In my case, we were using a Google App Engine application and the JSON response need not contain these key/value pairs so it makes more sense if these are removed from the dictionary.

def rm (d, l):
  """
  Removed from dictionary "d" all those key-value pairs the keys of which
  are defined as a list in "l"
  """
  if not l: return d
  if reduce ( lambda x,y: x or y, [x in d.keys () for x in l]):
    [d.pop (x, None) for x in l]
  [rm (x, l) for x in d.values () if isinstance (x, dict)]
  return d

Sunday, 24 October 2010

Facebook autologin with google account


So, are you tired of logging in everytime on facebook? Putting your email id/facebook username and password. Wish there was a secure way in which you would have been automatically logged into facebook? There is! And the way is by connecting facebook and google account (gmail).

It's pretty simple, safe and secure. All you have to do is to connect your gmail/google account with facebook once. Then everytime you are logged into gmail and open facebook, you will automatically be logged in. What's more. Even if you try to logout, facebook will relogin you :-)

Here is how this goes.

  1. Go to find your friends on facebook. It is on the right hand side bar. You will notice something like this. Now enter your gmail ID when asked as shown below.
  2. This will open a pop up as shown below. If you are not already logged into gmail, it will ask you to log in to your gmail account.
  3. After you have logged in, or if you are already logged in, you will see the request from google on behalf of facebook to access your contact information. Below there is a check box about remembering this authorization. Make sure that option is checked for auto login. Don't worry, I will tell you how to revoke this privilage, if you want to later at the end of this post.
  4. After authentication, you will see a screen which will be something like the one below. This is where facebook has authenticated your google account and is now, fetching your friends who are on facebook. Let facebook do their job.
  5. Now you will find a list of your contacts from your gmail, who are on facebook. If you wish, you can send them a friend request, or you may skip this step.
  6. Now that is all. Your facebook account is connected to your gmail account and you are ready for passwordless login on facebook. To test this, logout of your facebook account, but remain logged in your gmail account. After you have logged out, you will see facebook logging you again into your account. Like the one shown below.
  7. If you ever wish to revoke permissions of facebook from your google account, just go to google.com and click on Google Account Settings.
  8. Next, click on Change Authorized Websites to see the list of websites you have authorized. Find for Facebook there, and click on revoke access. That's all you have now successfully disconnected facebook and google account.

Wednesday, 25 November 2009

Exporting multiple photoshop images in JPG

There are cases when we have multiple photoshop images (.PSD) images and we want to export them/ save them as JPG format, possibly even resize it. So, the best way out is to use Picasa Software (http://http://picasa.google.com/)available for Windows, Linux and Mac. It automatically detects all images on your Hard Drive (even photoshop images in PSD format). Now you just need to select the album (folder) containing the PSD files, and click on "Export" at the bottom. This export will provide you options like resize and picture quality and many others. After selecting them, just click on "Export" and that's it. ou have saved multiple PSD files in JPEG format in one go, using Picasa :-)

Don't forget to comment, if you liked it.

Sunday, 31 May 2009

A better feed reader

Most of the feed readers - web based, desktop based are more or less similar in their approach. You subscribe to a feed, and they will display all new (or non read) items. It is good. Now this is what a feed reader should do. Some feed readers (like Google reader) go beyond this and allow you to share your favorite feeds with your friends.What more does anyone needs?

Well, there are many more ways in which a feed reader can be enhanced. I wil be talking about the one that i find most useful.

Everything is not important

I am a feed junkie. I go to any website, and if i find anything interesting, i immediately subscribe to its feed. Months later, i realise that not all posts from that website is what i actually am interested in. Let's take a scenario.Most people are subscribed to Slashdot or LifeHacker or Reddit. I am particularly interested in Programming and Technology. And specifically in Python, C++, WebApps. But what i am getting in my feeds is everything from FORTRAN to JAVA and from Microprocessors to launch of new space craft. This is useless information for me, and what i will be doing probably is - select all, mark as read. If i dont get a chance to read my feeds for a day or two, i will easilt have 1000+ posts and when bulk mark as read, i am probably going to miss out things that might be important for me.

Overcoming the situation

In my opinion, there is only one way to overcome the situation. Get the specific posts from the feeds, in which the reader is interested. So, if i am interested in Python and C++, i will be able to see and read only those feeds that have relevent information about Python and C++.
Again, there are two approaches to make this possible.

Approach 1) Let the reader speak for himself.

When a user is subscribing a new feed say "Programming", suggest him - This is a very broad category. Would you like something in particular, say C++ or Python? If he says yes, go ahead and keep this thing in memory.

Aproach 2) Find out yourself.

In this approach, the user is initially presented with all the posts corresponding to a feed. A track record is kept for the feeds that the user has actually read and for those feeds for which he has just "marked as read". Based on these data over a span of time, the system will be generating a set of keywords, which describe a range of interests for one particular user.

One or both of the above approaches can be used. What matters is that the set of keywords for the range of user's interests in posts should be accurate. This is never guaranteed to be comprehensive, but should be somewhat near to it.

Now things are quite simple. We have the feed, we have the list of posts, and we have the user's interest. For every post in the feed, scan it. See if it contains things that might interest user. Show him only those posts, that he is interested in. If the system is uncertain about a post, that can be under the "posts you might be interested in" section of the feed reader.

If implemented in this manner, i believe that feed readers can be more popular and good than the present ones.

If any engineer who is working on some feed reader is reading this post, and might consider it for their next release, i would be happy if they could contact me and say "Thanks" :-)

Make this world a better place.

Wednesday, 15 April 2009

OpenSource alternate to Dreamweaver

Of lately, i was thinking of switching to open source alternative for DreamWeaver, and i found out Aptana. Aptana is an eclipse based IDE that provides a lot of benefits which but obviously includes being the powers of opensource and freeware. Aptana comes in two flavors - a stand alone IDE and an Eclipse Plugin. You can install either of the two depending on your needs. Personally i dont like Ecipse, so i decided to go for stand alone IDE. You might want to check out the download page for Aptana

After installing Aptana, you need to install CFEclipse plugin for providing ColdFusion support in Aptana.

Installing CFEclipse in Aptana


  1. Download the latest version from the archived software update site: http://www.cfeclipse.org/update/
  2. Unzip the archive file. You should get a folder called "org.cfeclipse.cfml.update.release".
  3. In Aptana, go through the usual procedure to add an update site (Help -> Software Updates -> Find and Install -> Search for new features to install).
  4. Click on New Local Site...
  5. Choose the folder that you extracted from the zip file (e.g. the location of "org.cfeclipse.cfml.update.release").
  6. Click Select.
  7. Change the name to something more reasonable such as CFEclipse Local Install.
  8. Click OK and then click Finish.
  9. Follow the installation procedure and prompts... (I am sure you can handle it from now on).


Pretty Simple. That's it. And now we have an open source alternative for DreamWeaver that is much better than the original one.

Monday, 15 December 2008

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.

Friday, 22 February 2008

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)

Sunday, 13 January 2008

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.

Thursday, 22 November 2007

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.

Sunday, 18 November 2007

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.
  • Inbox. The url for inbox is http://mail.google.com/mail/#inbox
  • Starred. The url for stared items is http://mail.google.com/mail/#starred
  • Chats. The url for chats is http://mail.google.com/mail/#chats
  • Sent Items. The URL for sent items is http://mail.google.com/mail/#sent
  • Drafts. The url for drafts is http://mail.google.com/mail/#drafts
  • All Mails. The url for all mails is http://mail.google.com/mail/#all
  • Spam. The url for spam is http://mail.google.com/mail/#spam
  • Trash. The url for trash is http://mail.google.com/mail/#trash
  • Contacts. The url for contacts is http://mail.google.com/mail/#contacts
  • Labels. If you have applied labels to your mails, then the various labels will have the url as http://mail.google.com/mail/#label/LabelName. and the search box will display something like label:LabelName

Monday, 23 July 2007

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.

Thursday, 19 July 2007

reCaptcha... Protect Yourself from spam

pra...@gmail.com

Hidemail is a new technology from reCaptcha where in your email id is made hidden and untill and unless you solve a captcha, you are not reveled the email id of the person. Like you see in the case above. If you have to see my complete email ID, then you have to click on the ... and then solve the captcha and then only the email ID will be reveled.

External Links:
1. Recaptcha official website
2. mailHide technology