Wednesday, July 28, 2010

TNPSC -VAO

TAMIL NADU PUBLIC SERVICE COMMISSION
NOTIFICATION
VILLAGE ADMINISTRATIVE OFFICER
Applications are invited upto 5.45 p.m on 20-08-2010 for Direct Recruitment to the post of Village Administrative Officer as detailed below:
Sl.
No.
Name of the Post / Service Code No.
No. of vacancies
Scale of Pay
1.
Village Administrative Officer in Tamil Nadu Ministerial Service
(2009-2010)
Service Code.050
1576
(Post Code No.2025)
(Rs.5,200 – 20,200 + Grade Pay Rs. 2,000/- P.M) (PB1)
2.
Village Administrative Officer (Shortfall vacancies for SC/ST)
Service Code.050
1077 *
(Post Code No.2025
(* Reservation for Women, Differently Abled persons and Ex-Servicemen shall not apply for Shortfall Vacancies mentioned at Serial No.2)
Only one application is to be sent by the SC/SC(A)/ST candidates who wish to be considered for the regular and the shortfall vacancies.
The District wise Distribution of vacancies are shown in Annexure to this notification.
2.IMPORTANT DATES AND TIME:-
Date
Time
A
Date of Notification
21-07-2010
--
B
Last date for receipt of applications
20-08-2010
5.45 P.M.
C
Date of Examination
Will be announced later

Friday, July 23, 2010

Short Shots

A Jobless man applied for the position of 'office boy' at Software Co.. The HR manager interviewed him then watched him cleaning the floor as a test.

'You are employed' he said. Give me your e-mail address and I'll send you the application to fill in, as well as date when you may start.

The man replied 'But I don't have a computer, neither an email'.

'I'm sorry', said the HR manager. If you don't have an email, that means you do not exist. And who doesn't exist, cannot have the job.'

The man left with no hope at all. He didn't know what to do, with only $10 in his pocket. He then decided to go to the supermarket and buy a 10Kg tomato crate.
He then sold the tomatoes in a door to door round.. In less than two hours,
he succeeded to double his capital. He repeated the operation three times,
and returned home with $60.

The man realized that he can survive by this way, and started to go everyday earlier, and return late. Thus, his money doubled or tripled everyday.

Shortly, he bought a cart, then a truck, and then he had his own fleet of delivery vehicles.

5 years later, the man is one of the biggest food retailers in the US ....
He started to plan his family's future, and decided to have a life insurance.

He called an insurance broker, and chose a protection plan.
When the conversation was concluded the broker asked him his email.
The man replied,'I don't have an email.'
The broker answered curiously, 'You don't have an email, and yet have succeeded to build an empire. Can you imagine what you could have been if you had an e mail?!!' The man thought for a while and replied, 'Yes, I'd be an office boy at SOFTWARE CO !'

Moral of the story


Moral 1
Internet is not the solution to your life.

Moral 2
If you don't have Internet, and work hard, you can be a millionaire.

Moral 3
If you received this message by email,
you are closer to being a office boy/girl, than a millionaire..........


P.S - Do not forward this email back to me,
I am closing my email account & going to sell tomatoes!!!

Monday, July 19, 2010

Enzen Global Solutions

We are Hiring Fresh Ideas



Enzen Global Solutions (www.enzenglobal.com) – Bangalore is planning for fresher’s recruitment in July 2010. We invite CVs of fresh graduates who would like to be a part of the growing Enzen family for taking up challenging assignments.


Qualification Criteria:
1. BE / B Tech / MCA / MSc (IT) - Yr. 2009 or 2010 pass out with minimum 65% aggregate
2. Exposure to IT domain and programming languages during the academic course
Note:
Please send the CVs to: careers@enzenglobal.com
Timeline for sending CVs : Jul 12th to July 24th 2010
Subject line of email should contain the following information in the mentioned format:
“Degree – Year of Pass out”, Eg: MCA – 2009
Short listed candidates will be informed through email
Anyone having attended written test at Enzen during the last SIX months, need not apply

Short Shots

There was a good old barber in Bangalore . One day a florist goes to him
for a haircut. After the cut, he goes to pay the barber and the barber
replies:
I am sorry, I cannot accept money from you; I am doing a Community
Service.
Florist is happy and leaves the shop.

The next morning when the Barber goes to open his shop, there is a
"Thank You" Card and a dozen roses waiting at his door.

A Confectioner goes for a haircut and he also goes to pay the barber he
again refuses to take the money.
The Confectioner is happy and leaves the shop.

The next morning when the Barber goes to open his shop, there is another
"Thank you" Card and a dozen Cakes waiting at his door.


A Software Engineer goes for a haircut and he also goes to pay the
barber again refuses the money saying that it was a community service.

The next morning when the Barber goes to open his shop, guess what he
finds there......


.
.
.
.
.
.
.
.


A Dozen Software engineers waiting for a free haircut... with Printouts
of Forwarded mail mentioning about free hair cut with the google map
showing the shop.

Thursday, July 8, 2010

Care Voyant Technologies Private Ltd (www.carevoyant.com)

Care Voyant Technologies Private Ltd (www.carevoyant.com)
http://www.ChetanaS.org
CareVoyant Technologies Private Ltd, formerly Kaveri CareVoyant Private Ltd., is a dedicated Offshore Product Development Centre for CareVoyant / CareVoyant Inc., - a Chicago-based, U.S. incorporated Health Care Software Development company. The company’s products, developed for multiple vertical healthcare provider segments, are marketing under the brand CareVoyant. Since 1987, the company’s Principals have been in HealthCare Software Domain with over 400 clients across the U.S.

CareVoyant Inc. specializes in the design, development, implementation and support of software applications for the US healthcare provider market, spanning the entire healthcare continuum, consisting of Physicians, Home Care and Long Term Care. CareVoyant Inc. was promoted and managed by Mr. K Pasupathy – an alumnus of College of Engineering, Guindy, Anna University

Freshers : BE / B.Tech / MCA / MSc : 2010 / 2009 Passout @ Chennai
http://www.ChetanaS.org
CareVoyant, a US -based Healthcare Software Product Company, is recruiting trainees for its product development centre in Chennai.
Fresh Engineering graduates and MCA, MSc who passed out in 2009 and 2010 are eligible to apply for this recruitment process.

Job Designation : Trainee Software Engineer

Job Category : IT / Software

Job Location : Chennai, Tamilnadu

Desired Qualification :
• All Candidates in Engineering and Technology Streams with consistent academic record (Over 70% of marks), without the history of arrears from school onwards.
• Though preference will be given for CSE, IT and ECE students, others with good aptitude for software are encouraged to apply.
• MCA and MSc Candidates may also appear, but they must have secured a minimum of 70% mark from 10th standard onwards.
• Candidates must be serious about pursuing a career in a software application development environment focused on the U.S. healthcare market.
• Candidates who have passed out during the year 2010 and 2009 are only eligible.

Desired Experience : 0 Years

Desired Skills :
• Must have strong liking and talent in software development.
• Excellent Communication skills and team building capabilities are essential.

Job Description :
• We will conduct a written test to assess the candidate’s aptitude in quantitative, verbal, computer literacy and general mental abilities. The duration of the test will be 60 minutes. We will communicate details regarding date and venue in due course.
• Qualifying candidates will take part in a Group Discussion.
• Interview will be followed by Group Discussion
• Candidates interested in this Process may apply through our website.
• Only Eligible / selected candidates will be called for testing by email invitation.
• Make sure you submit a valid email id.

Compensation :
• Selected candidates will be offered a compensation of Rs.1.8 to Rs.2.4 lacs per annum. (Cost to the Company basis).
• The selected candidates will be trained intensively in Technology, Domain and Project management at the job location in Chennai.
• CareVoyant Offers an excellent working environment and learning opportunities.
• We have a state-of-the-art development facility in Chennai, having total area 35,000 sq.ft at Siruseri IT Park near Chennai.
• Talented Candidates will have opportunity to grow rapidly and the rewards will be commensurate with the contribution

Monday, July 5, 2010

The PostgreSQL Database - Installation and Configuration

The PostgreSQL Database - Installation and Configuration:

Red Hat 7.2 example:

* Install (rpm -ivh package) or check for the following PostgreSQL RPMs (rpm -q package):
o postgresql-7.1.3-2
o postgresql-libs-7.1.3-2
o postgresql-server-7.1.3-2
o postgresql-perl-7.1.3-2
Other packages available:
o postgresql-odbc
o postgresql-jdbc
o postgresql-tcl
o postgresql-tk
o postgresql-python
o postgresql-devel

Install: rpm -ivh postgresql-7.1.3-2.i386.rpm postgresql-libs-7.1.3-2.i386.rpm postgresql-server-7.1.3-2.i386.rpm postgresql-perl-7.1.3-2.i386.rpm

* The user "postgres" should have already been configured by the installation of the RPMs. Info:
o User: postgres
o Home directory: /var/lib/pgsql
o Default shell: /bin/bash
A password will be missing. As root issue the command: passwd postgres to assign a password for user postgres.

* Login as user postgres: su - postgres
This will execute the profile: /var/lib/pgsql/.bash_profile

PGLIB=/usr/lib/pgsql
PGDATA=/var/lib/pgsql/data
export PGLIB PGDATA


* Initialize PostgreSQL database server: initdb --pgdata=/var/lib/pgsql/data
This creates a bunch of directories, a template directory and sets up the postgres configuration in the user directory /var/lib/pgsql/. Red Hat start command (service)/script (rc script) will perform this task if it has not already been performed. See next step - Starting the database.

* Starting the database server: As root. (from most to least favorite method)

service postgresql start
(If the database has not already been initialized with initdb, this will be performed by the command)
OR
/etc/rc.d/init.d/postgresql start
(If the database has not already been initialized with initdb, this will be performed by the script)
OR
/usr/bin/pg_ctl -D /var/lib/pgsql/data -p /usr/bin/postmaster -l logfile start &
OR
/usr/bin/postmaster -D /var/lib/pgsql/data &

Notes:
o Configuration file: /var/lib/pgsql/data/postgresql.conf
By default there is no network access. See the directive tcpip_socket. (Required for ODBC,JDBC) Also see the postmaster directive "-i". Logging and tuning parameters are specified here.
o Host Access file: /var/lib/pgsql/data/pg_hba.conf
o Authentication/Identification file: /var/lib/pgsql/data/pg_ident.conf

* Create a database: createdb bedrock
(As Linux user postgres)

* Connect to the database: psql bedrock
Execute command as Linux user postgres
You will now be at the PostgreSQL command line prompt.

[prompt]$ psql - or "psql bedrock"
Welcome to psql, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit

bedrock=#
bedrock=# \c bedrock
You are now connected to database bedrock.
bedrock=# create table employee (Name char(20),Dept char(20),jobTitle char(20));
CREATE
bedrock=# INSERT INTO employee VALUES ('Fred Flinstone','Quarry Worker','Rock Digger');
INSERT 18733 1
bedrock=# INSERT INTO employee VALUES ('Wilma Flinstone','Finance','Analyst');
bedrock=# INSERT into employee values ('Barney Rubble','Sales','Neighbor');
bedrock=# INSERT INTO employee VALUES ('Betty Rubble','IT','Neighbor');
bedrock=# SELECT * from employee;
name | dept | jobtitle
----------------------+----------------------+----------------------
Fred Flinstone | Quarry Worker | Rock Digger
Wilma Flinstone | Finance | Analyst
Barney Rubble | Sales | Neighbor
Betty Rubble | IT | Neighbor
(4 rows)

bedrock=#
bedrock=# \q


* Database discovery / Examine a database (as user postgres: su - postgres):
[postgres]$ psql
o \l :List databases
o \c database-name :List databases
o \d :List tables in database
o \d table-name :Describe table
o select * from table-name :List table contents

* More info:
o Create a user:
+ Command line: [prompt]$ createuser dude
+ SQL: CREATE USER dude WITH PASSWORD 'supersecret';
Change with ALTER USER
o Grant priveliges:
+ SQL: GRANT UPDATE ON table-name to dude
+ SQL: GRANT SELECT ON table-name to dude
+ SQL: GRANT INSERT ON table-name to dude
+ SQL: GRANT DELETE ON table-name to dude
+ SQL: GRANT RULE ON table-name to dude
+ SQL - Do it all: GRANT ALL PRIVILEGES ON table-name to public
o Delete a user:
+ Command line: [prompt]$ dropuser SuperDude
o Delete a database:
+ Command line:
# [prompt]$ destroydb bedrock
# [prompt]$ dropdb bedrock
+ SQL: DROP DATABASE bedrock;
o Create a database:
+ Command line: [prompt]$ createdb bedrock -U user-name -W
You will be prompted for a password. (or execute as Linux user postgres without -U and -W options)
+ SQL: CREATE DATABASE bedrock
o Backup a database:
+ [prompt]$ pg_dumpall > outfile
+ [prompt]$ pg_dumpall -Fc dbname > outfile
o Version Upgrades:
+ Dump: [prompt]$ postgresql-dump -t /var/lib/pgsql/backup/db.bak -p /var/lib/pgsql/backup/old -d
+ Restore: [prompt]$ psql -e template1 < /var/lib/pgsql/backup/db.bak
The table template1 is the default administrative database.

If one would like to generate a GUI interface to the database, I would recommend a web form to a Java servlet back-end or use a JAVA GUI program and JDBC. See the YoLinux tutorial on accessing PostgreSQL with JDBC in a Tomcat servlet example.

Links/Info:

* PostgreSQL documentation:
o /usr/share/doc/postgresql-7.1.3/html/index.html (local html)
o /usr/share/doc/postgresql-7.1.3/ (local directory)
* Resources: /usr/share/pgsql/

PostgreSQL-Stored Procedures

Stored Procedures

Stored Procedures are subroutines that are stored inside the database. They allow you to select and manipulate data, and, with the use of control structures and loops, perform complex computations and return the calculated result to the client. This saves considerable amounts of client/server communication.

PostgreSQL allows Stored Procedures to be written in several different Procedural Languages, including Perl, Python, TCL, and pgSQL - the PostgreSQL internal procedure language. User-defined Procedural Languages can also be used, and several of these languages are easily downloadable, e.g. PL/Java.

In this article, we will be using PL/pgSQL. PL/pgSQL is very similar to normal SQL, but adds many more features to it, like control structures and user-defined data types and functions.
Example 1: The Basic Stored Procedure

Let's get started with a very basic stored procedure that returns "Hello World!" - not very useful, I know, but it will get us started with the basic syntax of PL/pgSQL. Here's the code:

create or replace function hello() RETURNS text AS $$
DECLARE
hello text;
begin
hello := 'Hello World!';
return hello;
END;
$$ LANGUAGE plpgsql;

Here's what it does:

create or replace function hello() RETURNS text AS $$

Creates the function called hello which receives no parameters and returns text. You must always define what the function returns; use VOID if you don't need to return anything.

DECLARE

Opens the variable declarations block.

hello text;

Declares a variable called "hello" of type "text". To define multiple variables, use ";" as the separator. You can use any of standard types used in tables, like integer and float, and even user-defined types or domains.

BEGIN

Starts the actual function code.

hello := 'Hello World!';

Pupulates the variable "hello" with 'Hello World!'. Note that you have to use single quotes for string/text values.

return hello;

Returns our value.

END;

Ends the function.

$$ LANGUAGE plpgsql;

Defines what language we used - 'plpgsql' in this case. To call that function, you use the following SQL code.

select * from hello();

The output will be a text field called "hello", with the value of "Hello World!".
Example 2: Populating a Table with Test Data

This is another use of a Stored Procedure ('SP' from now on) - generating test data for your tables. Let's use last month's article as an example - we used a SP to generate 500K rows of data for one of our tables. Here's the code:

create or replace function test_data_computer()
RETURNS integer AS $$
DECLARE
count integer;
sql text;
begin
count = 1;
LOOP
sql = 'insert into computer(computer_id, computer_ram, cpu_id, video_id) values';
sql = sql || '('|| count ||', ' || random()*1024 || ', ' || (random()*49999)+1 || ', ' || (random()*49999)+1 || ')';
EXECUTE sql;
count = count + 1;
EXIT WHEN count > 500000;
END LOOP;
return count;
END;
$$ LANGUAGE plpgsql;

It starts much like our previous example, but this time we declare 2 variables instead of one. Things become different at line 8, where we introduce the LOOP statement. The loop is a basic repeating structure: it repeats the code inside indefinitely, until it finds a EXIT or EXIT WHEN clause.

Lines 9 and 10 are used to generate the SQL code to include a simple record in our tables. The double pipes ("||") is the concatenation operator. Random() generates a random float number between 0 and 1 (so "random()*49999)+1" will generate a random number between 1 and 50000).

Line 11 executes the SQL code stored inside the sql variable, adding the registry to the table.

Lines 12 and 13 are used to control the flow of the LOOP, and if omitted will make the loop an infinite one. "EXIT WHEN count > 500000;" makes the loop stop when the condition is met (when "count" goes over 500000 in this case.)

Line 14 closes the LOOP block, making the function go back to line 8, executing everything that is inside the loop again (and again, and again).

Line 15 returns the number of added registries (plus one in this case).
Example 3: Calculations and Date/Time Handling

Let's make up a scenario for this one. Imagine that you are building a system for a doctor, and one of the bits of data he wants is exactly how much time he spends with his patients (NOT just idling in the office.) Even more, he wants to be able to select the data for a given date or date interval, and he wants the option of selecting the records of either a single patient or all of them. Complex scenario, right? Well, we can solve it all with a single SP. These are the tables our database will have:

create table patient (
patient_id serial primary key,
patient_name text );

create table visits (
v_id serial primary key,
patient_id integer references patient,
v_date date,
v_time_start time,
v_time_end time );

One for the patients, another one to store the visits, with the date, start, and end time. Let's now populate the tables with some data:

insert into patient (patient_name) values ('Deividson');
insert into patient (patient_name) values ('John');
insert into patient (patient_name) values ('Benjamin');
insert into visits (patient_id, v_date, v_time_start, v_time_end) values (1, '10/04/2008', '08:00', '09:00');
insert into visits (patient_id, v_date, v_time_start, v_time_end) values (1, '14/04/2008', '13:00', '13:45');
insert into visits (patient_id, v_date, v_time_start, v_time_end) values (1, '18/04/2008', '10:00', '10:15');
insert into visits (patient_id, v_date, v_time_start, v_time_end) values (2, '11/04/2008', '14:00', '15:00');
insert into visits (patient_id, v_date, v_time_start, v_time_end) values (2, '12/04/2008', '14:00', '15:45');
insert into visits (patient_id, v_date, v_time_start, v_time_end) values (2, '17/04/2008', '14:00', '15:15');
insert into visits (patient_id, v_date, v_time_start, v_time_end) values (3, '15/04/2008', '08:00', '12:00');

Three patients, seven records - enough to test our SP. Here is the code:

CREATE OR REPLACE FUNCTION total( date1 date, date2 date, patient integer )
RETURNS interval AS $$
DECLARE
total interval;
rec record;
sql text;
BEGIN
total = '00:00:00'::time;
sql = 'select * from visits';

if date1 is not null OR patient is not null then
sql = sql || ' where ';
end if;

if patient is not null then
sql = sql || '(patient_id = ' || patient || ')';
end if;

if date2 is not null AND date1 is not null then
if patient is not null then
sql = sql || ' AND ';
end if;
sql = sql || '(v_date between ''' || date1 || ''' and ''' || date2 || ''')';
else
if date1 is not null then
if patient is not null then
sql = sql || ' AND ';
end if;
sql = sql || '(v_date = ''' || date1 || ''')';
end if;
end if;

for rec in EXECUTE sql loop
total = total + (rec.v_time_end - rec.v_time_start);
end loop;

return total;
END;
$$ LANGUAGE plpgsql;

Wow! Big one this time, eh? Let's take a look at it. The start of the code is pretty similar to the other examples, but we have 3 variables this time. 'total' will store the total time to return to the client, and 'rec' (of type record) is a variable that will hold the result of the query we will run.

On line 8, we start the variable total with the value of 00:00:00 - the "::" is a typecast - ":: time" means the string we're passing ("00:00:00") needs to be turned into a time.

From line 9 all the way down to line 31, all we are doing is creating the SQL statement that will select the data we want. Here, we use another type of structure - the IF. IFs are basic flow-control structures, and its syntax is (as in most programming languages):

IF (condition) THEN (commands) [ELSE (commands)] END IF;

The condition can be any logical comparison ( <, > , =, IS NULL, or IS NOT NULL), and you can combine multiple conditions using the logical operators (AND, OR, etc). If the condition is true, then the execution will continue with the commands inside the THEN clause, or if it's false, execution will move to the commands in the ELSE (if it exists), or to after the END IF.

It's in those IFs that we create the conditions (single date, date interval, single patient, etc.)

On line 33, we execute the SQL code we generated, looping over each of the records of the result. We then add the duration of each visit in the 'total' variable, and return the result when there are no more records available.

We can call this SP in one of several different ways, each way selecting a different data set and giving us a different result:

# All the records, from all patients
select * from total(NULL, NULL, NULL);

# All the records, from patient #3 only
select * from total(NULL, NULL, 3);

# Records from '14/04/2008', all patients
select * from total('14/04/2008', NULL, NULL);

# Records from '14/04/2008', patient #1 only
select * from total('14/04/2008', NULL, 1);

# Records from '14/04/2008' through '17/04/2008', all patients
select * from total('14/04/2008', '17/04/2008', NULL);

# Records from '14/04/2008' through '17/04/2008', patient #2 only.
select * from total('14/04/2008', '17/04/2008', 2);

Conclusion

Stored Procedures are powerful and flexible, and can be a very good way to help you pre-select and pre-process data, as well as allowing you to manipulate data and run code directly on the server.

PostgreSQL offers a comprehensive manual on their site, including a chapter about PL/pgSQL. You can find it here: http://www.postgresql.org/docs/8.3/static/plpgsql.html

That's it for Stored Procedures - see you next month, when we'll discuss Triggers!