Google+ Sandeepa On Life: 2011

Pages

Search this blog

Tuesday, December 13, 2011

How To Apply For Ration Card Online

Getting a Ration Card in Karnataka has become little easier now. Thanks to The Department of Food, Civil Supplies & Consumer Affairs, you can now apply for a Ration Card Online! That's a good news. Isn't it?

I had read the news long back. But Today I tried it. They have a decent interface and don't ask for too much information.

Here's how you do it:
  1. Head to the website of  The Department of Food, Civil Supplies & Consumer Affairs, Government of Karnataka (http://ahara.kar.nic.in/)
  2. Apply For Ration Card Online
  3. Click on the scrolling link with text Click here to apply for Ration Card - New or Using Surrender Certificate.  Click on the above image to see where to click.
  4. Step 2 above opens a new window with a form. Choose your language (English/Kannada) to proceed.
  5. Subsequent  requires you to fill in information about your full address, Ward number etc.
  6. You will need to enter the R R Number. You can get it from your later electricity bill.
  7. If you already have a ration card and want to split it, you will have to give the Ration Card number of the existing card.
  8. Keep clicking on the 'next' button after filling every page, and submit at the end.
  9. If you have filled all mandatory fields with valid data, the system will accept your application and generate a receipt.
  10. Print this receipt. You will need it for future despondence, especially, your receipt number and Receipt Date.
Once you have submitted the application here, you can check the status of your online application by going to http://web1.kar.nic.in/fcslpg1/

I did this immediately after submitting and got the following response:
Your application no. 1234969 dated on 12/13/2011 2:22:00 PM has been received by the dept. Please wait for Food Inspector's visit plan.
So, I'm waiting for Food Inspector's visit!

If you don't have a ration card, go apply now and share your experience.

Tuesday, November 15, 2011

Cucumber - Very interesting


 WHAT A LITTLE GEM THE CUCUMBER IS.   I WILL LOOK AT IT DIFFERENTLY NOW.


1. Cucumbers contain most of the vitamins you need every day, just one cucumber contains Vitamin B1, Vitamin B2, Vitamin B3, Vitamin B5, Vitamin B6, Folic Acid, Vitamin C, Calcium, Iron, Magnesium, Phosphorus, Potassium and Zinc.

2. Feeling tired in the afternoon, put down the caffeinated soda and pick up a cucumber.    Cucumbers are a good source of B Vitamins and Carbohydrates that can provide that quick pick-me-up that can last for hours.

3. Tired of your bathroom mirror fogging up after a shower?    Try rubbing a cucumber slice along the mirror, it will eliminate the fog and provide a soothing, spa-like fragrance.

4. Are grubs and slugs ruining your planting beds? Place a few slices in a small pie tin and your garden will be free of pests all season long. The chemicals in the cucumber react with the aluminum to give off a scent undetectable to humans but drive garden pests crazy and make them flee the area.

5 Looking for a fast and easy way to remove cellulite before going out or to the pool?    Try rubbing a slice or two of cucumbers along your problem area for a few minutes, the phytochemicals in the cucumber cause the collagen in your skin to tighten, firming up the outer layer and reducing the visibility of cellulite.    Works great on wrinkles too!

6.. Want to avoid a hangover or terrible headache? Eat a few cucumber slices before going to bed and wake up refreshed and headache free.    Cucumbers contain enough sugar, B vitamins and electrolytes to replenish essential nutrients the body lost, keeping everything in equilibrium, avoiding both a hangover and headache!

7. Looking to fight off that afternoon or evening snacking binge?    Cucumbers have been used for centuries and often used by European trappers, traders and explores for quick meals to thwart off starvation.

8. Have an important meeting or job interview and you realize that you don't have enough time to polish your shoes? Rub a freshly cut cucumber over the shoe, its chemicals will provide a quick and durable shine that not only looks great but also repels water.


9. Out of WD 40 and need to fix a squeaky hinge?    Take a cucumber slice and rub it along the problematic hinge, and voila, the squeak is gone!

10. Stressed out and don't have time for massage, facial or visit to the spa? Cut up an entire cucumber and place it in a boiling pot of water, the chemicals and nutrients from the cucumber with react with the boiling water and be released in the steam, creating a soothing, relaxing aroma that has been shown the reduce stress in new mothers and college students during final exams.

11. Just finish a business lunch and realize you don't have gum or mints?    Take a slice of cucumber and press it to the roof of your mouth with your tongue for 30 seconds to eliminate bad breath, the phytochemcials will kill the bacteria in your mouth responsible for causing bad breath.

12. Looking for a 'green' way to clean your faucets, sinks or stainless steel?    Take a slice of cucumber and rub it on the surface you want to clean, not only will it remove years of tarnish and bring back the shine, but is won't leave streaks and won't harm you fingers or fingernails while you clean.


13. Using a pen and made a mistake?    Take the outside of the cucumber and slowly use it to erase the pen writing, also works great on crayons and markers that the kids have used to decorate the walls!!
P.S: This is from a forwarded email.

Wednesday, November 9, 2011

A Website Full Of C Programs

C is my first love. I wrote my first computer program in C language. That was 13 years ago. I didn't quite understand what was going behind the screen. 'Programming' meant typing programs from lecture/senior's notes or books, compile the programs, fix any syntax(typing errors!:) ) and pray!

It's only much later that I got a bit serious about programming. Then I started with The C Programming Language, 2nd ed. By Brian W. Kernighan and Dennis M. Ritchie, popularly known as K&R C book.

K&R C is a must-read for every C enthusiast. There are of course, many more books on C Language in the market. And the internet is full of C tutorials, guides and sample programs.

There are so many options to learn C programming on your own that you get where to start. I started with K&R book, trying all the programs in the book, and solving all the exercises.

To make it easy for others to find C programs, I have started a website completely dedicated for C Programs. The website is live at www.c-program-example.com

Visit C Program Examples website and browse through the list of programs, including exercise programs from K&R C.

P.S: K&R C exercises section is work-in-progress.

Like the websites's Facebook page(https://www.facebook.com/cprogramexample)to stay connected and get updates.

Happy coding!



Wednesday, November 2, 2011

Blue Re-volution: Nokia Developer Conference 2011

The Nokia Annual Developer Conference is here. It's scheduled for 4th November 2011 at ITC Gardenia, Bangalore.

I got the details from this emailer. Head to the Conference Website for more details.

P.S: This (surprisingly) is not a free event. They charge a participation fee of INR 750!

Sunday, October 30, 2011

Google Buzz is going away


I got the following notification when I logged in to my gmail account last evening.

it read: "Google Buzz is going away, but your posts are yours to keep." With a link to more info on how can I keep my posts.

Google announced their plan to shutdown Buzz (along with Jaiku and iGoogle) in a blog post on Official Google Blog. Click on Official Google Blog: A fall sweep to read the full post.


However, even after the Google Buzz is shutdown, you can access all your previous Buzz data on your Google Profile.


According to this page on Gmail help, you can download your Buzz data using Google Takeout.


Download your Buzz data and share your experience in comments.

Thursday, October 20, 2011

National Innovation Council Calls For Proposals

National Innovation Council is calling for innovative ideas.


Here's the full text of official announcement from their web page:
The National Innovation Council looks forward to proposals for innovation to reduce the drudgery of our working-class population.

These could be in the areas of design improvement of work implements, models for business opportunities, better processes, new equipment and techniques for different occupational groups like blue-collar workers, street-vendors, construction workers and soon.

Proposals should not be labour-displacing.

Professionals, young people, professional groups and students are encouraged to apply. Selected proposals will be awarded and supported. These proposals may be sent via hard copy or email to:

NATIONAL INNOVATION COUNCIL

Office of Adviser to the Prime Minister 
on Public Information Infrastructure & Innovations
Room No: 125, Yojana Bhawan
Parliament Street
New Delhi 110001
Ph: +91 11 23096622
Email your ideas at: officepiii[at]nic[dot]in
Do visit NIC's website(http://www.innovationcouncil.gov.in) to know more about the council.

Wednesday, October 19, 2011

Google: App Engine SSL for Custom Domains

Google announced that SSL support for custom domains on App Engine is in testing.

To see the announcement visit this blog post
App Engine SSL for Custom Domains in Testing  on Google App Engine Blog.

This feature will we made available only to 'trusted testers'. You can sign up to
test this feature by filling up this form.

Tuesday, October 11, 2011

How to Import Orkut Photo Albums to Google+

When we opened Facebook accounts and started using it, most of us didn't bother importing photos or contacts from our Orkut profiles.

Now, most of us are on Google+, but we are still hooked to Facebook. Nobody is thinking seriously about moving to Google+ or copying content to it. However, Google thinks people may want to import their Orkut photo albums to Google+. So, they have introduced "Orkut Photo Album Importer".

If you have any important photo album on Orkut that you wish to import to Google+, here is how you can do it.
  1. Login to your Orkut account. You should see a banner like the one shown below.
    Link to Orkut Photo importer as displayed on orkut profile.

  2. If you can't see the link on your profile, you can direct access it here Orkut Photo Importer
  3. Click on the "Copy my Orkut photos to Google+ now" button, you will see a list of your photo albums. Select the ones you want to share on Google+.
    Photo selection to share on Google+
  4. Click on the "Import Selected" button to start importing photos to Google+
    Status after import.
  5. Now login to Google+ to see your new photos.
    Photo albums imported from Orkut.
  6. Don't forget to read Google's User Content and Conduct Policy before you import.

Thursday, September 29, 2011

Joomla: 500 - An error has occurred

I got a strange error when I tried to login to the Administration section of my Joomla(1.7) installation. After I entered my login name and password and hit the singin button, I got the following error!

"500 - An error has occurred - Return to Control Panel"
500 - An error has occurred - Joomla
However, I could access the site(front end) without any problem. That didn't help me because I can't do any configuration changes without entering the administrator section(back end).

A Google search for the error message returned thousands of results. It looked like many people had this problem. 

The Solution:
Though it took couple of hours of going through results and tweaking the folder/permission settings on my hosting server, I could solve this problem.

This is what I did to solve the mysterious "500 - An error has occurred" problem:

I logged into my hosting server. Then in my Joomla installation directory, I changed the permission of following folders to 775.
  • administrator/cache
  • cache
  • logs
  • tmp
And it started working! I could login to the Joomla Admin Page of my site! I managed to solve the problem without understanding the problem!

If you have run into same/similar problem, and/or you know a better solution feel free to share your story in comments.

Saturday, September 24, 2011

Google +1 buttons on AdSense ads soon

Google is planning to introduce +1 button and personal recommendations to display ads. They plan to roll out this new feature from October 1st.

Extract from blog post +1: Now making Display ads more relevant on Inside AdSense Blog:
Starting in October, the +1 button will begin to appear on display ads on your site. With a single click, people will now be able to endorse specific ads and make them more likely to appear to their social connections.  We believe that these recommendations could lead your readers to notice ads on your site more, leading to more clicks and higher returns for you over time. 

Google hopes to deliver more relevant ads based on recommendations from your friends and connections. It will be interesting to see this in action.

Friday, September 16, 2011

BSNL Offers

Today I got an email from BSNL Bangalore about BSNL Mela to be held for 3 days starting Tomorrow. Sharing it here for the benefit of readers.

The email goes like this.. 
Dear Customer ,
Bangalore Telecom District is organizing Mela on 17,18,19th September 2011 at our Customer Service Centers
Kindly visit nearest Customer Service Center For Promotional Offers

Assuring you of our best services at all times.

Best Regards,
Bharat Sanchar Nigam Limited
Bangalore Telecom District


And here's the attachment from email giving the details of the offers.



*******************************************************

                  Related Links

Wednesday, September 14, 2011

Nokia 'Create For Millions' Contest

Nokia recently added regional contests and prizes to it's 'Create for Millions' contest.
According to a news post on Nokia Developer News:
Nokia’s Create For Millions contest for Series 40 developers has just added regional contests with local prizes: ChinaIndonesia, the Levant(Jordan, Lebanon, Iraq, Palestinian Territories, and Sudan), and West Africa. More regional contests are coming soon, too. Prizes for the regional contests include cash of up to 50,000 euros, as well as Nokia marketing and other promotions. read more..
The Create for Millions contest features four categories where you can bring out your best work for Nokia's latest Series 40 phones:

  1. In the Know - we're seeking your Series 40 web apps focusing on news and location-based information.
  2. Fun & Games - we're eager to try your Series 40 games and entertainment apps (either Java-based or web apps) that will fill those spare moments during the day with amusing, unforgettable diversions.
  3. Emotional Closeness - this is your chance to submit social networking apps that are developed either as Series 40 Java apps or web apps.
  4. Access to Knowledge - we want your life improvement apps (e.g., education, health, etc.), and in this category we'll accept either Series 40 Java apps or web apps, too.
The deadline to enter the Create for Millions contest has been extended to 1 November 2011


For more details on the contest, visit contest home page. Good luck!

Saturday, September 10, 2011

Test post, ingnore

R5BVNC85ENY5

Jnana Fellowship 2011 Provisional Merit List


Karnataka Jnana Aayoga(http://www.jnanaayoga.in) recently announced the provisional merit list for it's Jnana Fellowship 2011 program.

According to their site, the criteria used for shortlisting the candidates are:
(weightage in bracket)



  • Educational qualification (10)
  • Kannada language proficiency (10)
  • Work experience (15)
  • Answers to descriptive questions (20) (given in the application)
  • Written test-analytical 30; general personality 15 (conducted on August 21, 2011)
  • Submission of original documents for verification.
You can visit their website to download the Jnana Fellowship Merit List. Or you can click here.


Related Links

Sunday, August 14, 2011

Karnataka Jnana Ayoga Announces Eligibility list for Jnana Fellowship 2011

Karnataka Jnana Ayoga on 12th August 2011 announced the list of eligible candidates for its Jnana Fellowship 2011 program.

Click here to download the spreadsheet containing name and other details of shortlisted candidates. The official announcement of the result can be found here.

Background

Karnataka Jnana Ayoga(KJA) had called for applications for its Jnana Fellowship Program 2011. Best part was that you could apply for the fellowship online!

What next?

  • After processing the applications, the KJA as announced the list of eligible candidates.
  • If you had applied and you are shortlisted, the start preparing for verification of documents.
    • When:
       August 21st 2011 at 9 AM
    • Where:
      Government R.C. College of Commerce and Management, Basaveshwara Circle, Palace Road, Bangalore-560 001
    • What documents:
      • All Marks Cards (SSLC; PUC/Diploma; Graduation(all semesters); Post Graduation(all semesters); Certificate of M Phil; Ph.D. etc.,)
      • Offer Letter of Current Job and related documents
      • Work Experience Certificates
      • Address Proof in Candidate's Name (Electricity/Water/Phone Bill; Voter ID; Ration Card; Bank Passbook with One Year of Recent Statement; Passport)
      • Computer Education (if any)
      • 3 passport size recent photographs.
  • Keep visiting KJA website for more information and updates about the program.

Some useful links

Related Links

Monday, August 8, 2011

Picasa: How to add watermarks to photos

A friend mentioned today that it hurts when someone uses your photos and don't give you the credit for it. I completely understand his feelings. It happened with me. It happens with everybody!

There are many tools available to add watermarks to your photos. Here I'm going to tell you how to do it using Picasa. Because that's what I use!

You have to think about adding a watermark(some copyright) only when you are sharing the photo with others.  Using Picasa you can share photos with others mainly in two ways. By uploading them to a web album and sharing the link, or by exporting the photos to a folder.

We will see how to add watermark to your photos in both these cases.


  1. How to add watermarks while uploading photos to Picasa Web Album
    1. Open Picasa
    2. Goto Tools -> Options -> Web Albums
    3. In the dialog that pop's up,(see image below) select the check box for Watermarks.


    4. Enter the text for your water mark in the text box given. As you can see in the screenshot, I use "(c) Sandeepa Nadahalli".
    5. Click OK to exit the settings dialog. Your photos will be watermarked with the given text when you upload them.
  2. How to add watermarks while exporting photos from Picasa.
    1. Select the photos or Album you want to export
    2. Goto File -> Export Picture to Folder
    3. Select the check box next to Watermark:
    4. Enter the text to be used for watermarking.
    5. Click on the export button!
Here is a photo with a watermark (from my Picasa Web Album ).

Friday, July 1, 2011

Aadhar: What you need to know about it

Aadhar is again in news these days. I did some quick search and have compiled this post to help you know more about Aadhar.
  1. So, what is Aadhar?
    Aadhar is Multipurpose National Identity Card or Unique Identification card (UID Card). Though the project name mentions the word 'card', currently there's no plan to issue a card. They will be issuing only Aadhar number.

  2. Will I get an Aadhar card?
    No! You will just get unique Aadhar number.

  3. What's the use of Aadhar number? Why should I apply for Aadhar number?
    One of the answers I found on the official Aadhar Faq Page says:
      Aadhaar means foundation , therefore it is the base on which any delivery system can be built. Aadhaar can be used in any system which needs to establish the identity of a resident and/or provide secure access for the resident to services/benefits offered by the system. Aadhaar can be used in the delivery of the following programs:
      • Food & Nutrition – Public Distribution System, Food Security, Mid Day Meals, Integrated Child Development Scheme.
      • Employment – Mahatma Gandhi National Rural Employment Guarantee Scheme, Swarnajayanti Gram Swarozgar Yojana, Indira Awaaz Yojana, Prime Minister’s Employment Guarantee Program
      • Education – Sarva Shikhsha Abhiyaan, Right to Education
      • Inclusion & Social Security – Janani Suraksha Yojana, Development of Primitive Tribe Groups, Indira Gandhi National Old Age Pension Scheme
      • Healthcare – Rashtriya Swasthya Bima Yojana, Janashri Bima Yojana, Aam Aadmi Bima Yojana
      • Other miscellaneous purposes including Property Transactions, VoterID, PAN Card etc.

  4. What documents are accepted as Proof Of Identity(PoI) for Aadhar?
    • Passport
    • PAN Card
    • Ration or PDS photo card
    • Voter ID
    • Driving Licence
    • Government Photo ID Card
    • NREGS Job Card
    • Photo ID issued by recognized Educational Institution
    • Arms Licence
    • Bank ATM card with photo
    • Photo credit card
    • Pensioner photo card
    • Freedom Fighter Photo Card
    • CGHS or ECHS Photo Card
    • Address Card  having Name and photo issued by Department Of Post
    • Certificate of Identity issued by Group A Gazetted Officer

  5. What documents are accepted as Proof Of Address(PoA) for Aadhar?
    • Passport
    • Bank Statement or Passbook
    • Post Office Account Statement or Passbook
    • Ration Card
    • Voter ID
    • Driving Licence
    • Government Photo ID Card
    • Electricity Bill not older than 3 months
    • Water Bill not older than 3 months
    • Telephone land line bill not older than 3 months
  6. Can I apply for Aadhar online?As of today(1st July 2011), you can not apply online for Aadhar.
  7. How/where can I apply for Aadhar number?They have not started issuing Aadhar number in all the cities. Call up Aadhar helpline number ask for your nearest location.
  8. Aadhar helpline number?Call 18001801947
    • What's the information asked when applying for Aadhar number?
      Name,  Date of Birth, Gender, Address, Parent/Guardian details (required for children, adults may provide), Contact details phone and email (optional)
      Biometric Information required: Photo, 10 finger prints, Iris
    • Where can I find more information about Aadhar?
    If you know more information/resources on Aadhar, please share it in comments.

      Wednesday, June 15, 2011

      BSNL 3G: How To Recharge Online

      So you have a BSNL prepaid 3G card and don't know how to recharge it online? Here's how you can do it.

      1. Visit BSNL's website http://www.bsnl.co.in/
      2. Look out for the link(looks like the picture below!) for "Online recharge Topup, Flexi topup", click on it. Or click here if you can't find it there.
      3. Sign up by visiting http://portal.bsnl.in/portal/aspxfiles/registration.aspx if you do not already have a login.
      4. Login to recharge site using your login and password. You should see something like this screenshot.
      5. Choose the recharge or topup option based on your need. The data recharge and data topup options are similar to voice recharge and voice topup respectively. i. e.,
        1. BSNL 3G Data Topup: You get only extra data recharge and no extension to your validity!
        2. BSNL 3G Data Recharge: This options gives you both. Validity and data recharge. 
      6. Enter your 3G sim number. If you are using your 3G SIM with a data card, you are not likely to remember your 3G number. Double check the number by checking it from BSNL 3G application on your computer.
      7. Select the amount you want to recharge or topup your 3G mobile with.

        The numbers you see in the drop down do not make much sense! Unless you are familiar with BSNL 3G recharge plans, their validity and how much data you get to use in each plan.
        Go to their 3G website to learn more about the plans. Pick your plan and select the amount.
      8. Click on the Submit button to proceed for payment.
      9. Choose a payment method in the following page. They support bank transfers, Debit cards and credit cards.
      10. Go ahead with online payment just like the way you usually do.
      11. Take a print out of the receipt or save it on your computer for future reference.
      12. Continue to use your 3G card/mobile.
      ***************************************************
                 Related Link

        Wednesday, June 8, 2011

        How To Disable Facebook's Tag Suggestions

        Yesterday Facebook rolled out a new feature called Tag Suggestions.

        According to a blog post on The Facebook Blog, this is what the feature is all about:
        "When you or a friend upload new photos, we use face recognition software—similar to that found in many photo editing tools—to match your new photos to other photos you're tagged in. We group similar photos together and, whenever possible, suggest the name of the friend in the photos."
        Not surprisingly, this Face Recognition feature is enabled by default! This may be useful for some people who upload photos in bulk and tag everybody in every picture.

        For others, if you don't want Facebook to automatically detect your face and suggest tag to friends, here's how you can disable this feature. It's very simple! (takes only 7 clicks!)

        1. Click on Account 
        2. Click on Privacy Settings

          Privacy Settings page
        3. Click on Customize settings

        4. Scroll down to "Things others share" section. Click on the Edit Settings next to
          Suggest photos of me to friends
          When photos look like me, suggest my name

        5. Click on Enabled and change it to Disabled
        6. Click on Okay to save that setting.
        7. Congratulations! Now you can continue with your Facebooking, or whatever else you were doing before coming here :-)

        Monday, June 6, 2011

        How To Create a Facebook Page For Your Blog

        If you like to create a platform for all your blog readers to know each other and discuss about your blog,  Facebook Page is a good start. You can create a Facebook page for your blog. That will not only help your existing readers to network with each other, but also to easily share your blog posts on Facebook and increase readership. After creating the Facebook Page, you can create a 'Like box' and add it to your blog so that people who visit your blog can find the link to your facebook page and can 'Like' your page without leaving your blog.

        I just created a Facebook page for this blog. You can find the page here.

        Now I will share how to do it.

        First you need to create a Facebook page for your blog. Do the following:
        1. Login to your Facebook account. Scroll down to the end of the page. Click on the "Create a Page" link
          OR
          Click here to go start creating facebook page.
        2. Facebook will ask you to choose a category for your page. As of now, it has  6 categories at the top level. Choose "Brand or Product". I chose this because, this is the only category that had 'website' sub-category!
        3. Choose 'website' as sub category.
        4. Enter the name of the page. Keep it same as the title of your blog so that people can recognize it easily! (I used "My Life My Way")

        5. Now your page is ready! And you can see it has URL of it's own.
        6. Click on Edit info link to fill in details about your blog.
        7. Write a brief description in "Description" field.
        8. important: Paste the link to your blog in the "Website:" field. (http://sandeepaonlife.blogspot.com/)
        After this, you can follow the steps on your page to..
        1.  Add a profile image
        2. Invite your friends
        3. Tell your fans
        4. Post status updates
        5. Promote this Page on your website
        6. Set up your mobile phone
        Now that we have a facebook page, let's see how to add a 'Like box' to your blog.
        1. Click on the "Add Like Box" button.
        2. In the page that shows up, customize the Like Box for your blog
          1. Change the URL to point to your newly created facebook page
          2. Change the width of the widget if you want
          3. Pick a color scheme (to match your blog's theme)
          4. My Like Box looked something like this.
          5. My Like Box Looked like this
          6. As you customize your like box, verify the changes in the preview.
          7. Once you are happy with your customization, click on "Get Code" button.
        3. Get the code for the widget (copy it to clip board)


        4. Add it to your blog(Steps for Blogger blogs.)
          1. Login to your blogger account
          2. Goto "Design" tab of your blog 
          3. Click on the "Add a Gadget" link
          4. Choose HTML/JavaScript
          5. Paste the code you copied in step 3 above
          6. And save the widget!
          7. Congratulations! Now you have Like Box for your Facebook page integrated to your blog.
            (You can see the Like Box on the right side of this blog. You can see it working! )
        If you run into any problem/errors during this, share it in comments. I would be happy to assist.

        Tuesday, May 31, 2011

        How to generate a random string in java

        Want to generate a random alpha-numeric string in Java? Here's how you can do it.
        If you are into coding, sooner or later you will run into this!

        There are many ways to do it. Here's the one I used recently in my code.

        import java.security.SecureRandom;
        import java.math.BigInteger;
        
        SecureRandom srandom = new SecureRandom();
        String rand = new BigInteger(176, srandom).toString(32);
        /* and you have your random string in 'rand' */
        

        What random libraries/functions do you use?
        Write in comments.

        Wednesday, May 25, 2011

        How to display Ads on your blog using Google AdSense


        You might have heard about people making money by displaying ads on their blogs using services like Google AdSense.

        If you have a Blogger blog, setting up AdSense is fairly simple. Just follow these steps.

        Step 1:
                  Sign up for Google AdSense. The approval may take anywhere between few hours to many days. 

        Step 2: Once you have an activated AdSense account,
        • Login to Blogger.
        • Goto Monetize tab of your blog by clicking on Montize from your blogger dashboard.
        • Monetize link in Dashboard
          In 'Adsense overview' tab, configure how and where you want the ads to appear.
        Configure ads
        • Choose/login to your adsense account that you created in step 1.
        • And you are done! Now you track the ad statistics from this tab! Congrats :)
        Track your earnings!
        P.S: I just did this to my blog.

        Monday, May 2, 2011

        Facebook addiction : Too Much


        If you are on Facebook, I am sure you will find this hilarious 


        The 76-year-old woman walked down the hallway of Clearview Addictions Clinic, searching for the right department. She passed signs for the "Heroin Addiction Department (HAD)," the "Smoking Addiction Department (SAD)" and the "Bingo Addiction Department (BAD)." Then she spotted the department she was looking for: "Facebook Addiction Department (FAD)."

        It was the busiest department in the clinic, with about three dozen people filling the waiting room, most of them staring blankly into their Blackberries and iPhones. A middle-aged man with unkempt hair was pacing the room, muttering,"I need to milk my cows. I need to milk my cows."

        A twenty-something man was prone on the floor, his face buried in his hands, while a curly-haired woman comforted him.

        "Don't worry. It'll be all right."

        "I just don't understand it. I thought my update was LOL-worthy, but none of my friends even clicked the 'like' button."

        "How long has it been?"

        "Almost five minutes. That's like five months in the real world."

        The 76-year-old woman waited until her name was called, then followed the receptionist into the office of Alfred Zulu, Facebook Addiction Counselor.

        "Please have a seat, Edna," he said with a warm smile. "And tell me how it all started."

        "Well, it's all my grandson's fault. He sent me an invitation to join Facebook. I had never heard of Facebook before, but I thought it was something for me, because I usually have my face in a book."

        "How soon were you hooked?"

        "Faster than you can say 'create a profile.' I found myself on Facebook at least eight times each day -- and more times at night. Sometimes I'd wake up in the middle of the night to check it, just in case there was an update from one of my new friends in India . My husband didn't like that. He said that friendship is a precious thing and should never be outsourced."

        "What do you like most about Facebook?"

        "It makes me feel like I have a life. In the real world, I have only five or six friends, but on Facebook, I have 674. I'm even friends with Juan Carlos Montoya."

        "Who's he?"

        "I don't know, but he's got 4,000 friends, so he must be famous."

        "Facebook has helped you make some connections, I see."

        "Oh yes. I've even connected with some of the gals from high school -- I still call them 'gals.' I hadn't heard from some of them in ages, so it was exciting to look at their profiles and figure out who's retired, who's still working, and who's had some work done. I love browsing their photos and reading their updates. I know where they've been on vacation, which movies they've watched, and whether they hang their toilet paper over or under. I've also been playing a game with some of them."

        "Let me guess. Farmville?"

        "No, Mafia Wars. I'm a Hitman. No one messes with Edna."

        "Wouldn't you rather meet some of your friends in person?"

        "No, not really. It's so much easier on Facebook. We don't need to gussy ourselves up. We don't need to take baths or wear perfume or use mouthwash. That's the best thing about Facebook -- you can't smell anyone. Everyone is attractive, because everyone has picked a good profile pic. One of the gals is using a profile pic that was taken, I'm pretty certain, during the Eisenhower Administration. "

        "What pic are you using?"

        "Well, I spent five hours searching for a profile pic, but couldn't find one I really liked. So I decided to visit the local beauty salon."

        "To make yourself look prettier?"

        "No, to take a pic of one of the young ladies there. That's what I'm using."

        "Didn't your friends notice that you look different?"

        "Some of them did, but I just told them I've been doing lots of yoga."

        "When did you realize that your Facebooking might be a problem?"

        "I realized it last Sunday night, when I was on Facebook and saw a message on my wall from my husband: 'I moved out of the house five days ago. Just thought you should know.'"

        "What did you do?"

        "What else? I unfriended him of course!"
        --
        P.S: Got it from a friend in email. Thought this forward email is worth sharing here.

        Monday, March 28, 2011

        Syntax Highlighting for Blogs

        Code snippets inside blog posts can be very difficult to read if they are written using normal font.

        Consider the following piece of code.

        int i, sum=0;
        for(i=0; i<n; i++)
        {
        sum = sum + i;
        }
        Code without any special formatting.


        HTML <pre>...</pre> and <code>...</code> can be used to preserve the white spaces and long lines.
        Here's the same code put inside a <pre><code> block..

        int i, sum=0;
        for(i=0; i<n; i++)
        {
            sum = sum + i;
        }
        
        Structure of the code preserved using <pre> & <code>

        This version looks much better than the first one. The monospaced text makes it easier to read.

        However, this is not enough. These generic <pre>&<code> do not highlight the keywords in the code snippet. This is where Syntax Highlighting comes into picture.

        Syntax highlighting is a feature of some text editors that display text—especially source code—in different colors and fonts according to the category of terms. This feature eases writing in a structured language such as a programming language or a markup languageas both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it's made only for human readers/editors. (Read more on Wiki..)
        Let us apply Syntax Highlighting to the above code.
        int i, sum=0;
        for(i=0; i<n; i++)
        {
            sum = sum + i;
        }

        Now, this looks much better! This is achieved using a third party Syntax Highlighter plugin.
        There are many plugins and other tools available on the internet for Syntax Highlighting.

        I am using SyntaxHighlighter for this blog. I chose this because it's easy to use and supports many languages. Will talk about plugin integration with blogger in my next post.


        Cheers,
        Sandeepa Nadahalli