Thursday, November 30, 2006

A while back, I wrote a little rails app for Thai food ordering at my work. My colleagues place orders using the system and then bring money to the nominated orderer of the week. Once all orders are in and paid for (this is also tracked in the app), the orderer rings up our favourite Thai restaurant (Laddas) and places the order.

I have the app running from fairly cheap shared hosting. At peak times during the ordering, I guess that they'd be 15 or so people simultaneously using the app. We've used it many times without problems. Thus, I was quite surprised and displeased (as were my colleagues), when my hosting account was suspended and we couldn't see what had been ordered this morning. A hasty email to my hosting provider revealed that my account had been suspended due to high load and "ruby flooding". They were kind enough to un-suspend my account and we completed the ordering process.

I remembered seeing something about production mode in 'environment.rb'. Some googling confirmed my hunch - in development mode, rails apps are much more resource intensive. Caching is not used, and every single file needs to be reloaded every time it is required. After changing my app to production mode, it seemed to run noticeably faster. Michael and I ran 'top' and it looked like each request used less CPU.

So, should you be in a similar situation, this is how to change your app to production mode on fast-cgi Apache shared hosting:

Confirm that 'database.yml' in your app's 'config' directory has a section for production mode, and that it has up to date database connection details.

Edit 'environment.rb' in your app's 'config' directory.

Add this line:

ENV['RAILS_ENV'] ||= 'production'

Run 'ps -u [your_user_name]' to find if you have any 'dispatch.fgi' processes running.

If so, kill all of them (they'll restart and use your new config settings).

Monday, November 27, 2006

Building RapportTo build rapport, the book recommends that you pay careful attention to the person you are speaking with and match their physical posture, expressions, breathing, movements, voice and language patterns. Whole body listening is important - this means you are curious and focused on the person you are speaking with and your language is 'you' focused, rather than 'I/me' centered.

Perceptual PositionsPerceptual positions are a way of appreciating situations from different standpoints and gaining different perspectives. 1st position is when you are in your own body - this position is good for concentrating on what you want and being assertive. 2nd position is when you imagine yourself in somebody else's shoes - good for trying to understand their perspective/actions. 3rd position is when you imagine yourself as a fly on the wall looking at the scene - good for detaching yourself emotionally and considering things logically.

Setting AnchorsAnchors are particular stimuli (eg, a touch, smell or taste) that automatically trigger a linked memory or emotion. Everyone has unconscious anchors - eg, smell of food makes you feel hungry and think of eating. However, you can set anchors for yourself which you can then call up at will to change your emotional state:

Choose a state/feeling that you have experienced in your life that you want to be able to access whenever you choose.

Recall the time when the feeling was it its strongest for you. Make sure you are seeing the memory out of your own eyes (1st position). Think about the time - what colours do you see, what do you hear, what do you feel etc.

Just before your emotions peak, set the anchor and then remove it at the peak of your emotions.

Shake yourself to break state, and then repeat the process several times.

Test the anchor - think of something else and trigger the anchor. You should feel the emotions/state you associated with the anchor.

I had a little bit of a play with anchoring emotions. The technique seems to work at least to some extent for me. I intend to play around with it a bit more.

As an aside, if you're talking and somebody looks away, they are probably thinking, and you should wait till they meet your eyes again before continuing.

Empowerment thought Word Choice and QuestionsEmpowerment means you take responsiblity for your own experience. Resolve ambiguity and abdication of responsiblity though challenging your thoughts with questions.

Deletions: "They overlooked me in the recent promotions" - who are they?

Vague actions: "We are going to develop Joe's ability to learn" - how are we going to do that, and when?

Baseless comparisons: "The company is doing well" - compared to what?

Abstraction: "It was a difficult conversation" - who was involved, and what made it difficult?

Hidden opinion: "This is the right way to do it" - according to who? The speaker?

Generalisations: "She never listens to me" - how do you know that? Has there ever been a time when she listened to you?

Blame: "the company demotivates me" - how does the company demotivate you?

Drivers: "I want to see my friend" vs "I should see my friend". The former (driven by you) empowers and motivates, the latter (forced on you) triggers opposite feelings.

Assumptions: "he is fiddling with his pen => he is bored" - how does fiddling with his mean mean that he is bored? Maybe it is just his habit.

With this approach, you can untangle your beliefs. Eg,"These presentations never go well" - Never? Has there ever been a time when one did go well? How do you determine if it went well?"Giving these talks makes me feel stressed" - How exactly does giving the talks cause you to feel stressed? How do you want to feel?

The power of imaginationIf you imagine something sufficiently strongly and sensually (when, where, sight, smell, touch, taste, sound, etc), your feelings will be similar to what they would be if it was really happening. Ie, your feeling do not differentiate between what is really happening, and what you imagine.

Hence, if you want to know how you would feel if you did X, simply imagine it in great detail and you'll find out. Similarly, if you want to achieve something, imagine what it would be like in detail and it will be as though you have already achieved it. Believe it is true, and you will act as though it is true, and then it will be easier for it to become true!

No negativesThe unconscious mind does not understand negatives. Hence, if you say "Don't worry" to yourself, you are in effect triggering the "worry" emotion.

Rewriting Memories / Modifying PerceptionBring up a memory in detail, and bring in as many senses as you can. Try changing the lighting, the background sound, the relative size of objects etc and see how you feel. If you do this enough, you can change how you feel in the memory, and how you will feel when something similar arises.

I think that this could be done mentally in real time in real situations as well by changing your perception. Eg, somebody is screaming at you. If mentally imagine yourself to be larger, and the screamer to be smaller and imagine a glass between you, you could avoid feeling overwhelmed or getting angry yourself. You could then respond in a better manner.

Beliefs of ExcellenceWhat you believe will influence how you act. Hence, if you take on positive beliefs, you can become more friendly, productive and motivated. Similarly, negative beliefs (eg, "I can't do it") are often self-fulfilling. According to the book, the important beliefs for excellence are:

Each person is unique

Everyone makes the best choice available to them at the time

There is no failure, only feedback

Behind every behaviour is a positive intention

The meaning of the communication is its effect

There is a solution to every problem

The person with the most flexibility in thinking and behaviour has the best chance of succeeding

Mind and body are part of the same system

Knowledge, thought, memory and imagination are the result of sequences and combinations of ways of filtering and storing information

Presuppose that these beliefs are true for you - try them out :-)Or go back into memory and imagine how you would have behaved differently had you had these beliefs.Practice should make the belief become more fixed in you, and change your automatic behaviour.

Outcomes and GoalsWhat do I really want to achieve in 3 months/6m/1yr/3yrs, beyond..List, prioritise and choose top 3. For each goal,

Imagine it with all senses - how does it feel/look/sound

When, where and with whom?

What have you got now you'd need to give up?

Is it worth the risk/pain? If not, chose another goal and start again.

If not self-maintained, chunk up ("recession to ease", ask "what's important about that?") to find the higher level need (eg, "security")

Ensure the outcome fits with who you are and who you want to be

What alternative ways are there to satisfy this need that will allow you to move towards the outcome?

How does having the outcome fit with the other people who are important in your life?

Act by dividing what you need to do into many small steps that you can work through in a real way every day or every week, potentially with time frames.

Saturday, November 18, 2006

This morning I went for a grading to move from grade 3 to grade 4. I did better than I could have hoped - both passed and got a good score! New and exciting Grade 4 techniques shall be revealed to me next training :-)