Friday, July 18, 2008

validate positive integer value in model - Ruby on Rails

validates_inclusion_of :some_attribute,

:within => 1..1.0/0,

:message => 'should be positive'

here 1.0/0 it means infinity...

So the attribute is validate within positive. It is done in rails with validates_inclusion_of for numeric data.


Create Application in RoR in specific Rails Version if we have multiple rails installed

cd ..
rails _1.2.6_ test
cd test

here test is the application name... like wise we can cerate any other application in any specific rails version
It happen while we have multiple rails versions in our system...

Wednesday, July 16, 2008

Excel Your Job Interview !!! (Takes 2 mins) !!

Interviews are often the most dreaded part of the job search process, but they need not be. With a little preparation, interviews become effortless and you can secure the job you want. When you sit to write an exam, you studied in advance. Its the same with interviews, but fortunately, not nearly as taxing as preparing for an exam. The steps themselves are simple, and dont require much in terms of preparation.

First, anticipate the likely questions. Sit and think about what sort of questions you would ask, if you were conducting the interview. Its impossible to anticipate every question, but think of some big ones, and even if they don`t get asked, they will be good preparation for other questions and provide you a base to answer from.

First impressions last. Sad but true. When it comes to an interview, you must take care to put forward the right image. This extends to personal hygeine, being clean shaven, having clean nails and so on. You want to convey an image of professionalism.

Our bodies communicate volumes of information. Trained interviewers can read your body language like a poker pro. While we cant hide the messages our body sends, we can control and shape those messages to improve the impression we give to the interviewer.

21 Ways to increase Self Motivation!!!

21 Ways to increase Self Motivation!!!

1. Consequences - Never use threats. They’ll turn people against you. But making people aware of the negative consequences of not getting results (for everyone involved) can have a big impact. This one is also big for self motivation. If you don’t get your act together, will you ever get what you want?

2. Pleasure - This is the old carrot on a stick technique. Providing pleasurable rewards creates eager and productive people.

3. Performance incentives - Appeal to people’s selfish nature. Give them the opportunity to earn more for themselves by earning more for you.

4. Detailed instructions - If you want a specific result, give specific instructions. People work better when they know exactly what’s expected.

5. Short and long term goals - Use both short and long term goals to guide the action process and create an overall philosophy.

6. Kindness - Get people on your side and they’ll want to help you. Piss them off and they’ll do everything they can to screw you over.

7. Deadlines - Many people are most productive right before a big deadline. They also have a hard time focusing until that deadline is looming overhead. Use this to your advantage by setting up a series of mini-deadlines building up to an end result.

8. Team Spirit - Create an environment of camaraderie. People work more effectively when they feel like part of team — they don’t want to let others down.

10. Recognize achievement - Make a point to recognize achievements one-on-one and also in group settings. People like to see that their work isn’t being ignored.

11. Personal stake - Think about the personal stake of others. What do they need? By understanding this you’ll be able to keep people happy and productive.

12. Concentrate on outcomes - No one likes to work with someone standing over their shoulder. Focus on outcomes — make it clear what you want and cut people loose to get it done on their own.

13. Trust and Respect - Give people the trust and respect they deserve and they’ll respond to requests much more favorably.

14. Create challenges - People are happy when they’re progressing towards a goal. Give them the opportunity to face new and difficult problems and they’ll be more enthusiastic.

15. Let people be creative - Don’t expect everyone to do things your way. Allowing people to be creative creates a more optimistic environment and can lead to awesome new ideas.

16. Constructive criticism - Often people don’t realize what they’re doing wrong. Let them know. Most people want to improve and will make an effort once they know how to do it.

17. Demand improvement - Don’t let people stagnate. Each time someone advances raise the bar a little higher (especially for yourself).

18. Make it fun - Work is most enjoyable when it doesn’t feel like work at all. Let people have fun and the positive environment will lead to better results.

19. Create opportunities - Give people the opportunity to advance. Let them know that hard work will pay off.

20. Communication - Keep the communication channels open. By being aware of potential problems you can fix them before a serious dispute arises.

21. Make it stimulating - Mix it up. Don’t ask people to do the same boring tasks all the time. A stimulating environment creates enthusiasm and the opportunity for “big picture” thinking.

Contact Me for any help regarding rails/nodejs/php/mysql

Name

Email *

Message *