The purpose of life is not to win. The purpose of life is to grow and to share. When you come to look back on all that you have done in life, you will get more satisfaction from the pleasure you have brought into other people's lives than you will from the times that you outdid and defeated them.

How to freeze Rails to a older version?

Navigate to project directory and issue the below command.

rake rails:freeze:gems VERSION=x.x.x

Send Email with Rails using GMail

Let us use GMail SMTP server for testing.

Step 1:

Please include the below code in environment.rb file under /config folder.

# environment.rb

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.default_content_type = "text/html"

ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => "587",
:domain => "localhost",
:authentication => :plain,
:user_name => "google_username",
:password => "google_password",
}

Step 2:

Generate Mailer model using the below command.

ruby script/generate mailer registration

Step 3:

Now your registration.rb model file should like below. Include the method welcome in class Registration.

class Registration < ActionMailer::Base def welcome(name, email) @recipients = "user@host.com" @from = params[:contact][:email] headers "Reply-to" => "#{email}"
@subject = "Welcome to Add Three"
@sent_on = Time.now
@content_type = "text/html"

body[:name] = name
body[:email] = email
end

end

Installing MySQL with Ruby Gem

Most of the official guides would recommend to install MqSQL database as
$gem install mysql

This won't work for sure in Windows platform. First setup your proxy. To know more please visit Rails Sucks. And finally after proxy setting setup issue the below command.

$gem install mysql -- --with-mysql-lib=/usr/local/mysql/lib

DSL for workflow testing

Typically a QA tests the following in a BPM Application Portal.

* Logins into Portal
* Searches for tasks based on some artifact keys.
* Saves/Completes some assigned tasks.
* Creates tasks
* Waits for some tasks.

These are the few of the many items that a tester or a Business Analyst does, not necessarily in the same order except for the first item.

Now the DSL which is to be built abstracts only high level tasks that the user performs and gives the ability to the user to write his own scenario for automated testing.

For example, if the user wants to search a task, create an artifact like Payroll and then complete the task, he would simply write as,

login_into_portal_as_user(prasanna)
tasks[] = search_for_ID(100, ‘Assigned’, ‘Available’)
iterate all tasks
if task is ‘Payroll’
create_HRA (100, current_date, hra_amount, employee_details)
complete.task
end

The above DSL code is very granular, but with further analysis and level of testing required we can build the DSL functions at coarse grained level, which would limit and simplify the number of lines a tester/user have to use to build scenarios.

One of the objectives for building custom DSL is that anybody from non developer community can write test case scenarios making use of DSL. The above mentioned syntaxes are just examples and can be made much simpler or close to readable English.

I believe this can definitely complement performance testing tools as well. The DSL testing code need not be in the above format; even as XML would do and having DSL on top of any other workflow testing tool means that the services alone will be tested for functionality.

But when I thought about DSL for testing my intention was to use it at a UI level which would better comprehend what an actual tester does. Web flow / UI Level automated testing comes with some disadvantages too, due to the fact that DSL objects are highly dependent on HTML source.

DSL’s are evolutionary and the functionality that have to be tested using DSL should be built brick by brick. Dynamic scripting languages are good candidates for building DSL, reason being faster development time opposed to using a high level language. I was looking at Ruby + ‘Watir’ (pronounced as water and is a Ruby gem) for building a DSL with automated UI level test scripts.

Consulting

Solving the Right Problem

Fundamental law of consulting is to be sure that you are solving the right problem. Otherwise, you’re just covering symptoms with a flimsy band-aid that will surely fail—more likely sooner than later. Result: bad reputation of the consultant & the company.

It is a common practice and tempting to conjure up a solution even before the problem is truly understood. Result: a misguided and a potentially failed project. So our responsibility as the service firm should be to identify the problem and define it in meaningful terms.

Set Expectations as clearly as Possible

This is harder than it sounds. Clients are notoriously bad listeners. They want the moon, but they want to pay in loose change. Or sometimes they don’t quite know what they want but they want a super-accurate quote. Your job as a consultant is to explain what you’re going to do and for how much and in what time frame as clearly as you possibly can.

Get a Testimonial or Reference during the Project

You don’t have to wait for the end of the project to ask for a testimonial or reference. Hit when the iron is hot, right up in the middle, when things are going well and you’re getting positive reviews from the client. How do you get a testimonial? You ask. Sounds silly, but unfortunately it’s true.

Client Communication

Managing and communicating actively with clients is critical to success as a consultant. They’ll want updates, status reports, etc. A well-updated client is generally a happier one, even if you’re bringing them bad news, because they’ll feel on top of the situation and more in control.

Networking Within the Organization

It’s is good idea to inculcate yourself as deeply into your client’s organization as possible. Initially it looks like more work. But it helps in situations where your primary contact disappears - maybe they quit, get transferred / promoted, etc. Lots of opportunity is lost by consultants when they’ve only got one contact in an organization & that contact is no longer in a position to hire them.

Document Everything

Written communication protects you in almost every imaginable circumstance. Miscommunications can be minimized and disasters can be contained by documented proof of what’s going on. As well, documentation is a valuable asset for setting clear expectations, defining goals and understanding project scope.

Consultant’s Jargon Generator

"Our holistic approach enables vertical connectivity between the field operations team and the Quality assurance technicians to optimize consumer impact points."

You can hear similar phases very often like the one above. You might be getting surprised how consultants have mastered such a low ratio of meaning to word count. Not only consultants but also business world is equally guilty, including me at times. For those who can't let go, here's a tool just for you: Consultant's Jargon Generator. Use it to spice up your meetings with clients and colleagues, your proposals, or final "deliverables." Find just the right words to describe one of your consulting capabilities or your methodology, or to make a client recommendation. From the table below, choose any word from the left-hand column, then add a word from the middle column plus any word from the final column. Excerpt from this site http://guerrillaconsulting.typepad.com/guerrilla_marketing_for_c/2005/09/consulting_jarg.html

Clients Buy, They're not “Sold”

Don't waste time telling clients how great you are [company’s capability too much]. Get to the heart of the issue they face, and be prepared to prove how you can help them. Don't tell them about the great services you offer, but show them how you can help by suggesting ideas about project objectives, how to organize the project, and how to get it done. You'll sell more work by letting clients buy from you, rather than trying to sell to them.

Consultant Is a Buyer Too

Yes!! They are also buying from the client a set of facts, barriers to completion and definition of success about the project. Get this wrong, and you'll likely end up with an unhappy client and an unprofitable project. Following 3 questions can help you assess if you know enough:

1. Is there consensus among key decision makers that the project scope is well-defined?
2. What level of commitment is the client making to the project?
3. Has success criteria been defined?

A good consulting sales process includes many their qualifying questions, but the three above will get you started.

Sharing Knowledge

Some of the consultants resist sharing their ideas and knowledge [aka intellectual capital] with clients before they're hired to do a project. They fear that clients will take their work and try to complete the project on their own, or worse, give it to another consultant. The world is awash in information and ideas. If you're stingy with yours, it will show. Besides, clients aren't buying your methodology, tools, or your point of view. They're buying your expertise, recommendations, or your perspectives on how to solve a problem.

It's true that clients have been known to hijack information; consultants develop during the sales process so they can try to complete the project without consultants. But that's the exception, not the rule. So being generous with your knowledge, not foolish. Qualify every opportunity before bringing forward your best ideas. But don't hesitate, once you believe you've got a serious opportunity. Consulting is an ideas business. Keeping your best ones locked in your head, or laptop will leave a door open for your competitors to walk through.

Are you listening?

Biggest complaints from the clients as consultants do not listen and are so enamored with their own solutions that they miss the client’s subtle pointers on what they’re really looking for. Result: lack of understanding about the client real needs. Not compatible solution. Before your next client meeting, remind yourself to really listen.

The Myth of Client Pain

There is plenty of information available on net to find a client's "pain". We're advised to ask prospective clients senseless questions like: What keeps you awake at night? What are your pain points? And, if you had a magic wand, what problem would you solve?

Excuse Me !

It reflects 2 fundamental flaws - First, they proclaim that the consultant is fishing for answers, rather than pursuing a substantive discussion. Second, not all clients are looking for "pain" remedies. Maybe they are looking for to improve their operating margins or performance etc.

Mistakes Every Consultant Should Avoid

1. Rely on your pedigree. Academic credentials, brand, or flashy brochure rarely win over a client. They want to know how you work and how you'll fit with their culture.

2. About Asking Questions. Believe me ! It’s very tough. I have learnt it hard ways. Take your time to fully prepare before the meeting. Create ten insightful, open-ended questions that you can't find answers for on the client's Web site.

3. Talk more than you listen. In your first meetings, be sure to give the client plenty of chances to fully describe what needs to be done. Don't even think about selling until you're sure what problem you're trying to solve.

4. Agree to a proposal before qualifying the opportunity. Some clients will ask for a proposal simply to get you out of their office. Don't agree to write a proposal until you're convinced you've got a qualified lead with at least a 40 percent chance of winning the work.

5. Talk about price in the first meeting. Most clients will ask for a price, even if it's just an estimate. Resist the temptation. Politely ask clients to allow you time to absorb the information provided, and set a firm date to get a price back to them.

Think twice before you Answer These Questions

During the sales process with a client, you'll face number of questions about your background, experiences, and project approach. Client is simply trying to decide whether or not to hand you the keys to the project. Mostly you'll handle questions with ease, but seemingly innocent questions can take you to a trip. So try to hold back and think twice while answering the following questions until you're sure you know what you're getting into.

1. How much will the project cost?
2. What is your rate?
3. Will you send us a proposal?
4. How long will the project take to complete?

If you answer these questions eventually without getting a complete flavor of the situation. Result is: potentially unprofitable project or an unhappy client.

So common sense tells you to understand the client's real problem (not just the stated objectives), the complexity of the project, and something about the company's culture, it's tough to say how long it will take to complete a project. Many clients will push you to answer these questions before you should, and you'll be tempted. It's up to you to make clients recognize that it's in their best interests to wait for informed answers. Plus, taking the time to do it right also protects your interests. If the client balks, you should rethink whether or not this is the right client for you.

Your Toughest Competitor

Did you guess! Another Consulting firm ! You are 100% wrong. It is the client who is your toughest competitor. In every opportunity, you have 2 invisible competitors. First is the client who chooses a “do nothing” strategy and abandons the project; Second is the client who decides to do the project without a consultant?

Competing against an undeclared rival is the most complicated selling situation you face because it involves so much uncertainty. You rarely know what will kill the project or what will keep it alive. You also don’t know what will motivate the client’s team to take the project on without you. Your best approach is to explicitly ask the client. You may get a clue about what you’re up against. Suggest innovative ideas on how the client can solve the problem that led to calling a consultant in the first place, and stress your firm’s specific ability to help. If the client decides to go it alone, position yourself for the future. Offer to provide advice, guidance, or assistance during the project if needed. Clients often reverse themselves or change direction in midstream, especially if they encounter roadblocks. When and if they do, you want to be the first one they remember and turn to for help.

Resources:

Resources not limited to: Consulting Academy; Guerilla Consulting & Peak Strategy; Networking with Linkedin peers; IT Governance Insititue; IT World; Consuting Magzine; Secrets of Consulting.

Source: Unknown