PostgreSQL : Inserting data into a table using Select query.

This is a small post describing the PostgreSQL query for inserting data into a table using Select Query, as I had to use it for solving some issue in one of my projects. So, the query is below :

INSERT INTO films (code, title, did, date_prod, kind)
    VALUES ('T_601', (SELECT title from FilmCode where id = 'T_601') , 
106, '1961-06-16', 'Drama');

So, what you have to basically do is to put the ‘Select’ query in round brackets () and execute the query [ The brackets are the main thing to watch out for, as, otherwise the query will give an error on execution.]. The required value will be fetched from the source table and inserted into the desired table.

Hope this helps :)

Could not connect to the Server : Connection timed out

Hi,

If you trying to connect to a database, directory server or for any server for that matter and while you are running your application server, you  are getting the Error message Connection timed out in the stack trace, then, try the following remedies and see if these can help you :

1. Check in your configuration file whether you have given the correct IP address and port number of the server your trying to connect to.

2. Check if the credentials i.e. usernames and passwords are correct or not.

3. Unblock the ports of the server which you want to access in the firewall of the server.

Try running the application server once again and see if  this helps or not.

Thanks :)

Accessing file system of Linux Machine from a Windows Machine

Hi,

Recently I got into a situation where I had a Linux machine and had to transfer files to and fro from a Window machine to a Linux machine and vice-versa.

There is a software named “WinSCP“. This software allows us to access the file system of a Linux Machine using a Windows machine.

You can access the file system of Linux and transfer the files using SFTP, which is SSH File Transfer Protocol

You can download the software from the below mentioned link :

http://winscp.net/eng/download.php

The tutorial for using the software can be found here :

http://www.siteground.com/tutorials/ssh/ssh_winscp.htm

Thanks :)

“SMS for those deaf and blind” gets “jury special mention” at We Care Film Festival 2012

A documentary film on PocketSMS, “SMS for those deaf and blind”, gets “jury special mention” at We Care Film Festival 2012 in “upto 5 minutes” category. :-)

The video can be found here.

PocketSMS and MorseTrainer are winner of mBillionth South Asia award 2012 and get appreciation and accolades at Vodafone Mobiles for Good award 2012

Winners List – mBillionth South Asia 2012 awards

Hi,

This post was supposed to be written two weeks ago, but, I didn’t have the time initially to write it and when I had time, my energy was totally sapped. But, finally I am writing about this, now :)

In one of my earlier posts, I had mentioned that PocketSMS and MorseTrainer have been shortlisted for awards at Vodafone Mobile for Good 2012 and mBillionth awards South Asia 2012. I attended both the awards at Hotel Eros Intercontinental in Delhi.

So, the day started on a very energetic note, I attended the Inauguration Ceremony and was able to catch up on a very interesting speaker Tomi T. Ahonen who is a consultant and motivational speaker from Hong Kong and he has
written a book on mobile advertising and how to make mobile projects a successful venture. The book can be found here.

After attending the Inauguration Ceremony, I moved to our stall that was provided to all the finalists of Vodafone Mobiles for Good 2012 award.  I was there at the stall almost the whole day, and, met people from all walks of life: geeks, managers, journalists, founders of the companies etc. The one thing which all the people I met had in common, was, that they were all amazed by the whole concept
of PocketSMS and MorseTrainer. They all found this mobile application to be a revolutionary idea which could bring positive change to the lives of the people who are deaf and blind, so that, they can be integrated into the mainstream.

In the afternoon I attended a session in which Dr. Arun Mehta, gave a presentation on PocketSMS and MorseTrainer for the mBillionth award. PocketSMS and MorseTrainer are the brainchild of Dr. Mehta and with him I developed and co-designed the
application. Everyone who was present in the hall applauded the idea and  some of them were even awe-struck by the idea itself.

Come evening, and, I attended the round table discussion of the finalists of Vodafone Mobiles for Good from all the categories. This was the session I liked the most :).

This session was my favourite as I came across 3 applications, which I liked the most, among the applications that I had seen throughout the day. Yes, there were many applications catering to larger and very important issues as Maternity Health, Agriculture, Micro-finance, floods warning, community radio etc, but, the reason for my liking these apps was their sheer innovation. These applications were different from others, as, these had dared to tread the path of innovation. They were :

(Click on the links to know more about them )

So, the much awaited moment came in the evening, The Award Ceremony !!

We were all excited and anxious also at the start of the award Ceremony. There was an announcement that  all the finalists of Vodafone Mobiles Good 2012 will get a Samsung Galaxy Tab 2 310. This announcement made us happy, as it was a nice prize for the finalists, considering, it was an award ceremony awarding  mobile applications. (yeah I know, this prize is nowhere comparable to Rs. 10 lakh grant to the winners of the award, but, as it is said  “Something is better than Nothing” :D :D )

Now, slowly the award ceremony started and they started announcing the mBillionth award first, category by category. We patiently waited for our category, watching the amazing innovations winning awards. When our category was announced, on announcement we were declared as winner of the “special recognition award” in the “m-inclusion” category. Dr. Mehta went on the stage to receive the award.

Dr. Arun Mehta recieving the mbillionth award

Hmm, next came the turn of Vodafone Mobiles for Good award. Even though our brain was saying that this award must be a hard one to crack as there were some extremely good innovations but since optimism is the way to go, our hearts were somewhere expecting the award, and we were keeping our fingers crossed.

So, there was distribution of the Samsung tablets initially, and, I went on to receive the tablet.

Anmol Anand receiving the samsung galaxy tab 2

After collecting the tablet, there was an inkling inside, that, we were not in the contention for the award anymore, and that turned out to be the case. But yes ofcourse, the winners were worthy of the award and their application user base was very huge as compared to ours.

All in all it was a great learning and inspiring experience for me. I thoroughly enjoyed  the event but also got tired to the core. :p :)

Enabling Macros and ActiveX in Excel

Hi,

It’s time now for Indian Citizens to file their Income Tax Returns, and, this time the procedure to file the returns is online. So, instead of penning down your details on paper you have to fill the same details in Spreadsheet, which is full of macros that will reduce the manual work that you had to do earlier.

This is a great idea, and, a great step by Income Tax department. The problem that most of the people were facing was that of macro buttons not functioning when on clicking them.

The solution for the problem (if using Microsoft Office 2007 and above ) is as follows :

1. It’s best to use Microsoft Office, as, the Spreadsheet is in .xls format, which is propriety of Microsoft Office, so, If you are using OpenOffice or any other tools and facing problems, switch to Microsoft Office, if you can.

2. Now on Enabling the Macros in the xls sheet
a. Go to the Windows button on the top left of the window and click it.


b. On clicking the button, a panel will open. In that panel, click on the “Excel options” button on the botton right.

c.  A new window will open. Click on “Trust Center”


d. A new window appears, click on Trust center settings

e Click on “Macro Settings ” in the menu on the left hand side. In this click on the radio button against the option “Enable all macros (….)”


f. Now, click on “ActiveX Settings ” in the menu on the left hand side. In this click on the radio button against the option “Enable all controls without restrictions ……….”. 

g. Save the work if you had filled some fields in the form. Close the MS-Excel and reopen the file. Now the macros should work fine.

There is a help text file in the rar that you have downloaded from Income Tax department site. You can refer to that also if you are having MS Office version 2003 or below.

Thanks :)