Thursday, May 27, 2010

Maoists derail train

Two trains collided after a blast hit a passenger train and flung it into the path of a speeding goods train in Jhargram area of West Bengal on Friday, killing at least 25 people, government officials said.

One local government official said the toll could go up to "anywhere around 50-60" because many passengers were trapped inside mangled coaches.

The area is known to be a stronghold of Maoist rebels. A railway spokesman said sabotage was suspected, but the involvement of the Maoists has yet to be confirmed.

"At this stage I can confirm 25 deaths," Manoj Kumar, a railway official, told Reuters. "The toll will be much higher.

"We can give a final figure only after rescue operations are complete. We have to cut open the compartments and bring out bodies."

A reporter of the Telegraph newspaper described a scene of chaos and panic at the site.

"People are crying. Rescuers are struggling to save the survivors and get the bodies out," Naresh Jana told Reuters.

"I can see body parts hanging out of the compartments and under the wheels. I can hear people, women, crying for help from inside the affected coaches."

The incident comes days after a passenger airliner crashed in Mangalore, killing 158 people.

The passenger train was going to Mumbai from Kolkata.

"The blast derailed 13 coaches of the Gyaneshwari Express. These coaches then fell on the other track where a goods train rammed into some of them," Soumitra Majumdar, a railway spokesman told Reuters.

Majumdar said sabotage was suspected because the passenger train had been hit by a blast.

The Maoist rebels, who often attack police, government buildings and infrastructure such as railway stations, have in recent months stepped up attacks in response to a government security offensive to clear them out of their jungle bases.

The rebels blew up a bus in Chhattisgarh this month, killing 35 people, about a month after 76 police were killed in another attack.

Prime Minister Manmohan Singh has described the insurgency as India's biggest internal security challenge.

The decades-old movement is now present in a third of the country and while they have made few inroads into cities, they have spread into rural pockets of up to 28 states and hurt potential business worth billions of dollars.

Bollywood stars pays homage

From mega star Amitabh Bachchan to Priyanka Chopra, Bollywood stars have come together to pay homage to the victims of the plane crash at Mangalore airport today.

The stars expressed their grief at the tragic accident where an Air India Express plane from Dubai with 166 persons on board overshot the runway while landing. 159 people are feared dead.

"Feeling terrible! Plane crash! Air India flight from Dubai to Mangalore crashed on landing, overshot runway.. so sad.. so sad," wrote Big B on his Twitter account.

"Looking at visuals of the plane crash tragedy, just not feeling good about getting all normal and Tweeting and carrying on with work.. I wrote about excess and balance on my blog last night.. Is the plane tragedy God's way of balancing ..?? Sad and disturbed," he wrote in a later post.

Stars including Gul Panag, Mallika Sherawat and Anupam Kher have also tweeted the telephone helpline numbers set up by the authorities to facilitate dissemination of information regarding the air crash.

"Please pray for the families that have lost the ones they love in this horrific crash. We can't even begin to imagine their pain and sorrow. Also pray for the souls of those who have been cruelly taken away from their families in such a tragic situation. RIP," wrote Priyanka on her Twitter page.

Actor Riteish Deshmukh wrote, "Shocking and tragic news about the air crash- my prayers with the families, who have lost loved ones. May god give them strength. RIP"

Veteran actor Shammi Kapoor also tweeted his homage, writing, "The Air India crash is a very sad happening. My heart goes out to the families of the deceased. Let us pray for the departed souls. OM"

According to the police, 65 charred bodies have been recovered and fire has been doused from the accident site in the coastal city, nearly six hours after one of India's worst ever air mishap occurred at 6.30 AM. A majority of the victims are Keralites.

Filmmaker Karan Johar said on the micro-blogging site, "Just heard about the Air India crash....its too sad!!! Too upsetting to hear all the news coming in about the crash...thoughts, prayers and strength to all the families."

"Just heard about the plane crash in Mangalore...shocking! very sad..." wrote Deepika Padukone.

Tuesday, May 18, 2010

The Indian Cricket Board will issue show cause notices tomorrow to six players, including senior members Yuvraj Singh and Zaheer Khan, for their alleged involvement in a pub brawl in St Lucia after India's humiliating exit from Twenty20 World Cup in the West Indies.

Besides Yuvraj and Zaheer, show cause notice would be served to Ashish Nehra, Rohit Sharma, Piyush Chawla and Ravindra Jadeja, according to BCCI sources.

The tough stand by the Board came in the wake of tour manager Ranjib's Biswal's report to BCCI President Shashank Manohar and his meeting with the latter at BCCI headquarters.

Without naming either the errant players or their number, BCCI Chief Administrative Officer Ratnakar Shetty said show cause notices would be sent to these players by Board Secretary N Srinivasan tomorrow at the behest of Manohar.

"The manager of Indian team, Ranjib Biswal, today met the Board President. The Board President and Secretary took information from him regarding the West Indies tour".-Reuters.

Saturday, May 15, 2010

Hell in Kadapa, Kurnool

Kurnool/Kadapa, May 12: Kurnool and Kadapa districts experienced the season’s hottest day as mercury escalated up to a scorching 45ºC on Wednesday.
The maximum temperature recorded till Tuesday, was 44.3ºC. Moreover, night temperatures are also competing with day temperatures.
According to meteorological department officials, Tuesday’s night temperature was recorded at 29.5ºC in Kurnool.
Meanwhile, the scorching temperatures for the last one and half month had forced people to remain indoors to escape searing heat in Kadapa district.
The temperature has not gone below 40ºC since a month. People are suffering from unscheduled power cuts along with the shooting up day and night temperatures.
The searing heat is acute for the last five days in Kadapa district. The streets are wearing a deserted look, as people are not coming on the streets from 8 am to 6 pm. Children and aged persons are suffering from diarrhoea and fevers.
The officials and political leaders, who are participating in ongoing Praja Patham, are often experiencing sunstroke.

Thursday, May 13, 2010

Finally OutDated Indian Team

Toss – India have won the toss and elected to bat

Teams
Sri Lanka: Mahela Jayawardene, Sanath Jayasuriya, Kumar Sangakkara(w/c), Tillakaratne Dilshan, Chamara Kapugedera, Chinthaka Jayasinghe, Angelo Mathews, Thissara Perera, Suraj Randiv, Lasith Malinga, Thilan Thushara

India: Dinesh Karthik, Gautam Gambhir, Suresh Raina, Yuvraj Singh, MS Dhoni(w/c), Rohit Sharma, Yusuf Pathan, Harbhajan Singh, Piyush Chawla, Vinay Kumar, Ashish Nehra

India Innings

  • Gautam Gambhir dropped on 5 in 2.1 overs by Kumar Sangakkara
  • India lost 1st wicket in 5th over – 1-30 (Karthik, 4.2 ov)
  • L Malinga to D Karthik, OUT! CAUGHT AND BOWLED! SOFT DISMISSAL! Fuller length delivery outside off, Karthik closes the face of the bat early and looks to flick it away to the on side but gets a leading edge back to the bowler who takes it! India have lost their first wicket.
  • India: 50 runs in 5.5 overs (36 balls), Extras 1
  • 2nd Wicket: 50 runs in 31 balls (G Gambhir 20, SK Raina 27, Ex 3)
  • India lost 2nd wicket in 12th over – 2-96 (Gambhir, 11.1 ov)
  • L Malinga to G Gambhir, OUT! CAUGHT BEHIND! Fuller length delivery outside off, Gambhir looks to steer it to third man and gets a thin outside edge to Sangakkara who makes no mistake this time after dropping Gambhir early and takes this in front of him. India have lost their second wicket.
  • India: 100 runs in 12.1 overs (77 balls), Extras 5
  • SK Raina: 50 off 37 balls (5 x 4, 1 x 6)
  • India lost 3rd wicket in 18th over – 3-144 (Raina, 17.2 ov)
  • T Thushara to S Raina, OUT! LEADING EDGE! CAUGHT! Excellent slower delivery on the pads, fuller in length, Raina, who has been given the opportunity to play umpteen flick shots today, goes for another one, is early into the shot, the ball goes off the leading edge high in the air to Jayawardene who takes a simple catch at deep midwicket. India have lost their third wicket.
  • India lost 4th wicket in 18th over – 4-147 (Yuvraj Singh, 17.6 ov)
  • T Thushara to Y Singh, OUT! CAUGHT! Fuller length delivery on the pads, not the best of balls, Singh flicks this with the wind but finds Jayawardene at deep backward square leg! India have lost their fourth wicket.
  • India: 150 runs in 18.2 overs (117 balls), Extras 9
  • India lost 5th wicket in 20th over – 5-163 (Pathan, 19.6 ov)
  • Innings Break: India – 163/5 in 20.0 overs (MS Dhoni 23)

Sri Lanka Innings

  • Sri Lanka lost 1st wicket in 1st over – 1-4 (Jayawardene, 0.3 ov)
  • A Nehra to M Jayawardene, OUT! WELL HELD! Fuller length delivery outside off, Jayawardene looks to run it down to third man, very risky shot with first slip in place and ends up giving catching practice to Yusuf Pathan who does well taking it to his left. Sri Lanka have lost their first wicket.
  • Sri Lanka lost 2nd wicket in 2nd over – 2-6 (Jayasuriya, 1.5 ov)
  • V Kumar to S Jayasuriya, OUT! CAUGHT! Similar delivery outside off, Jayasuriya goes for another pull but mistimes it yet again, this one is uppish and Karthik swqallows it at midwicket! Sri Lanka have lost their second wicket.
  • Sri Lanka lost 3rd wicket in 8th over – 3-49 (Dilshan, 7.4 ov)
  • Y Pathan to T Dilshan, OUT! CAUGHT! MASSIVE WICKET! Harmless delivery on middle, Dilshan invited trouble and swept it uppishly to fine leg, the trap was set, Yuvraj Singh takes it easily at the fence! Sri Lanka have lost their third wicket.
  • Sri Lanka: 50 runs in 7.5 overs (47 balls), Extras 1

Result – Sri Lanka beat India by 5 wickets

Saturday, May 8, 2010

Pagination

LIMIT and OFFSET SQL Pagination

Both MySQL and PostgreSQL support a really cool feature called OFFSET that is usually used with a LIMIT clause.

The LIMIT clause is used to limit the number of results returned in a SQL statement. So if you have 1000 rows in a table, but only want to return the first 10, you would do something like this:

SELECT column FROM table
LIMIT 10

This is similar to the TOP clause on Microsoft SQL Server. However the LIMIT clause always goes at the end of the query on MySQL, and PostgreSQL.

Now suppose you wanted to show results 11-20. With the OFFSET keyword its just as easy, the following query will do:

SELECT column FROM table
LIMIT 10 OFFSET 10

This makes it easy to code multi page results or pagination with SQL. Often the approach used is to SELECT all the records, and then filter through them on the application server tier, rather than directly on the database. As you would imagine doing this on the database yields much better performance.

I have known that PostgreSQL supports the OFFSET keyword for quite some time, and for some reason I always thought it was not supported by MySQL. Well it turns out that it is supported now.

Friday, May 7, 2010

Interview Questions

  1. What are the differences between Get and post methods in form submitting, give the case where we can use get and we can use post methods?
  2. Who is the father of PHP and explain the changes in PHP versions?
  3. How can we submit a form without a submit button?
  4. In how many ways we can retrieve the date in the result set of mysql using PHP?
  5. What is the difference between mysql_fetch_object and mysql_fetch_array?
  6. What is the difference between $message and $$message?
  7. How can we extract string ‘techinterviews.com ‘ from a string ‘http://www.techinterviews.com’ using regular expression of PHP?
  8. How can we create a database using PHP and mysql?
  9. What are the differences between require and include, include_once?
  10. Can we use include (”techinterviews.php”) two times in a PHP page “makeit.PHP”?
  11. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?
  12. Functions in IMAP, POP3 AND LDAP?
  13. How can I execute a PHP script using command line?
  14. Suppose your Zend engine supports the mode Then how can u configure your PHP Zend engine to support mode ?
  15. Shopping cart online validation i.e. how can we configure Paypal, etc.?
  16. What is meant by nl2br()?
  17. Draw the architecture of Zend engine?
  18. What are the current versions of apache, PHP, and mysql?
  19. What are the reasons for selecting lamp (linux, apache, mysql, PHP) instead of combination of other software programmes, servers and operating systems?
  20. How can we encrypt and decrypt a data present in a mysql table using mysql?
  21. How can we encrypt the username and password using PHP?
  22. What are the features and advantages of object-oriented programming?
  23. What are the differences between procedure-oriented languages and object-oriented languages?
  24. What is the use of friend function?
  25. What are the differences between public, private, protected, static, transient, final and volatile?
  26. What are the different types of errors in PHP?
  27. What is the functionality of the function strstr and stristr?
  28. What are the differences between PHP 3 and PHP 4 and PHP 5?
  29. How can we convert asp pages to PHP pages?
  30. What is the functionality of the function htmlentities?
  31. How can we get second of the current time using date function?
  32. How can we convert the time zones using PHP?
  33. What is meant by urlencode and urldocode?
  34. What is the difference between the functions unlink and unset?
  35. How can we register the variables into a session?
  36. How can we get the properties (size, type, width, height) of an image using PHP image functions?
  37. How can we get the browser properties using PHP?
  38. What is the maximum size of a file that can be uploaded using PHP and how can we change this?
  39. How can we increase the execution time of a PHP script?
  40. How can we take a backup of a mysql table and how can we restore it. ?
  41. How can we optimize or increase the speed of a mysql select query?
  42. How many ways can we get the value of current session id?
  43. How can we destroy the session, how can we unset the variable of a session?
  44. How can we destroy the cookie?
  45. How many ways we can pass the variable through the navigation between the pages?
  46. What is the difference between ereg_replace() and eregi_replace()?
  47. What are the different functions in sorting an array?
  48. How can we know the count/number of elements of an array?
  49. What is the PHP predefined variable that tells the What types of images that PHP supports?
  50. How can I know that a variable is a number or not using a JavaScript?
  51. List out some tools through which we can draw E-R diagrams for mysql.
  52. How can I retrieve values from one database server and store them in other database server using PHP?
  53. List out the predefined classes in PHP?
  54. How can I make a script that can be bilanguage (supports English, German)?
  55. What are the difference between abstract class and interface?
  56. How can we send mail using JavaScript?