Wine and learning is live

Take a look at my new web Wine and Learning
Photo by Thomas Thompson on Unsplash

This year I passed WSET exam level 2. I had to learn about different wine grapes and wine regions. We tasted lot of wine and had a great time. At the end was an exam that I passed with Merit.

I used memory palace techniques to learn for the exam and I plan to write an article about it.

And to practice and deepen my knowledge I started a wine blog about wine, that should show you how can you find the best wine for you.

If you like wine or you like learning new things my new web Wine and learning is here for you.

Enjoy.

How to raise 422 error in Rails

I was updating error pages to follow latest GDS standard (https://design-system.service.gov.uk/patterns/). I needed to test the 422 page.

After few failed attempts I found this solution to work, just put this code in your index method on your home page:

    raise(ActionController::InvalidAuthenticityToken)

I hope it helped.

How to convince your boss and your fellow devs that you are right (and they are wrong)

Ben White Unsplash

As a developer, I’ve picked up some non-negotiable habits and good practices over the years. But sometimes, I’ve had to work with people who were not on the same wavelength as I was. Most of the time it’s the management.

You can’t convince anyone of anything. You can only give them the right information, so that they convince themselves.

Eben Pegan

The main reason is usually that we are looking differently at problems and their solutions. We know from experience that cutting corners will get back to us in the form of technical debt or just plain frustration.

I’m writing this post to show you how you can change you manager’s opinion — or even that of your peer.

Communicating the right way

Your message might be very important, but if you fail to deliver it, then it’s your fault. Here is one way to deliver your message effectively:

“To communicate effectively, we must reach people through their Tendency, not our own”

Gretchen Rubin

As you know, people are not the same. Someone may be easy to reason with, and someone else may be stubborn. According to Gretchen Rubin, we can categorize people into four main Tendencies.

Gretchen wrote a book called The Four Tendencies. She noticed this division among people, and how we can use them and take advantage of them in our lives. Those Tendencies are UpholderObligerQuestioner, and Rebel.

Here is a quick joke that helps describe them:

How do you get an Upholder to change a lightbulb?
Answer: He already changed it.

How do you get a Questioner to change a lightbulb?
Answer: Why do we need that lightbulb anyway?

How do you get an Obliger to change a lightbulb?
Answer: Ask him to change it.

How do you get a Rebel to change a lightbulb?
Answer: Do it yourself.

A case study

Let’s assume that you have a product owner (PO) on a new project. The PO is only focusing on the things that you deliver. They don’t want you to spend time on anything else, like writing tests.

Here are four different ways to convince your PO that writing tests is important. But don’t forget that this is just an example — you should be able to use these frameworks in any context.

Here we go.

1. PO as a Questioner

Ryan Gosling I Want To Ask You Some Questions GIF – Find & Share on GIPHY

Discover & share this Ryan Gosling GIF with everyone you know. GIPHY is how you search, share, discover, and create GIFs.

According to Gretchen,

Questioners love research, finding efficiencies and eliminating irrational process. They reject lazy explanations like this:

’This is the way we have always done it.’

Because Questioners have great faith in their own analysis and judgement, they can become convinced of the rightness of their views and refuse to be persuaded otherwise.

When dealing with a Questioner, bring reasoning to the table. Have a valid point supported by evidence.

Here’s an example conversation with a PO named Alex:

Me: Hi Alex, can we talk about best practices for a moment?

Alex: Sure, what’s on your mind?
 
Me: I think that we are pushing too hard on delivering the features and not thinking about our technical debt. We don’t have much time for testing.

Alex: Well, I’m not convinced that spending lots of time on testing will help us to deliver better and faster. We are fixing bugs as they come along and it seems to work. 
 
Me: I took a look at how much time we spend by fixing bugs, and the number grows over time. I have worked on lots of similar projects. It’s faster to ignore testing, in the beginning, but you will get to a point where it’s no longer efficient. I think that we are now at that point. 
 
Alex: Hmm but I don’t want to hire another person to do the testing, we don’t have a budget for it.

Me: I have a solution: let’s add testing to the scope of each ticket. It will make developers happy, and you will be able to compare velocity. If you would like to know more, I have some examples of books and articles about the importance of tests.
 
Alex: Ok, remind me of that at our next sprint planning, and I will make sure that everyone is on the same page.

Me: Thanks.

2. PO as an Upholder

via GIPHY

Upholders can make great colleagues. They are self-starters, and they are very interested in performance. But Upholders sometimes get impatient when others struggle to meet expectations.

I don’t think that you would have to convince an Upholder about the importance of writing tests. They would react like this:

Me: Hi Alex, I think that we are at the point where we need to spend more time on writing tests. Our technical debt is growing.
 
Alex: I’m ok with that. Feel free to write more tests and do some refactoring. But please make sure that we still deliver features that we promised.

3. PO as an Obliger

via GIPHY

Obligers respond to the expectations that work situations almost inevitably supply — with deadlines, evaluations and deliverables.

So to convince them, we can use another motivator that they follow.

Me: Hi Alex, I think that we are at the point where we need to spend more time on writing tests. Our technical debt is growing.

Alex: We have a deadline to deal with — is it going to affect it?
 
Me: We might be delayed in the next sprint. But by writing more tests, we will be able to cut the development time. So, we should be faster in next stage and meet the following deadline with ease. Writing tests is also a best practice of development. I can show you a bunch of studies that support it if you are interested.

4. PO as a Rebel

via GIPHY

I feel a little Machiavellian about this one. Here is an example from the book:

A rebel child might respond better if you ask: ‘Do you feel like playing the piano now?’ While an Upholder child would be happy to be reminded, ‘Time to practice the piano.’

So if I wanted to convince a Rebel product owner about tests, I’m not sure what I would do. I would probably spend time on tests and refactoring code without asking.

Gretchen does note that “They put a high value on freedom, choice, identity and self-expression.” So, by reacting on my own and taking care of things, I’d fit in that specification. I’d be the rebel!

In the end, you need to know who your audience is. You should find out what the priorities of your project are. Then make your argument more compelling by mentioning these priorities.

I created a playlist for my brain, and it changed my life

I’m a developer. I listen to music every day. I listen to random playlists or recommendations from Spotify.

I’m also a runner, but I do not listen to music while I’m running. It gets repetitive. And I don’t like to fiddle with my phone to find better music while I’m running.

One day I run out of podcasts to listen to whilst I was running. I was already on my way home. It was a long run, about 30k, so I was quite tired and my energy level was pretty low.

I run without anything for a while and then I decided to put some Led Zeppelin on. When the first notes of “Whole Lotta Love” kicked in my energy level picked up. I speeded up and felt pretty good almost immediately. A few songs later I arrived home. I still felt tired, but my mood was better.

That whole episode made me think. Let’s create a playlist for the upcoming ultra (100k). Every time I felt low I would play something from the playlist. Long story short it worked.

Every time I felt the low energy I played a few songs. I still remember my last 1k or so. We were finishing at the race track in Brighton. There was a long stretch of grass track that leads to the finish line. I picked up my phone and find the Maniac song from Flashdance, don’t judge me :).

I was sprinting to finish. No kidding. It was the best finish of any race so far. Maybe because of the relief that the long day was over. But most likely because I had a great tune to listen to whilst I was finishing.

Back in normal life when I commute to the office, I listen to audiobooks and podcasts in the morning. But before I step out from the Tube I play myself a few songs from my “Morning cheer up” playlist. The music wakes me up and changes my mood. It’s a great start to the day. I fell like this:

Demolition | ‘Swinging Through’ | Official HD Clip 2016

Demolition in UK cinemas now Subscribe to Fox Searchlight: http://smarturl.it/FoxSearchlightUK For more information please visit, https://www.facebook.com/FoxSearchlightUK Davis (Jake Gyllenhaal), a successful investment banker, struggles after losing his wife in a tragic car crash. Despite pressure from his father in law Phil (Chris Cooper) to pull it together, Davis continues to unravel.

I didn’t stop at the cheer up playlists though. I noticed that when I need to focus and I have to concentrate fast I play the Beaucoup Fish album by Underworld. My brain is so used to this association between this music and focus that I focus much faster and I get into the zone.

There is a pretty good book called Deep Work by Cal Newport. It explains why the deep work is good and how to achieve it.

I’m still experimenting with this. But so far I have my morning cheer up, running, deep focus, thinking about the staff and relax playlists.

But why does it work this way? There are two parts to this answer.

Conditioning

You might have heard about Pavlov’s dog or Classical conditioning.

Pavlov finds out that you can create an association between a stimulus (sound, light) and action. He turned the light on and then gave food to a dog. Few repetitions later, the dog started to salivate when the light went on.

So, if you play yourself the same album every-time while you are in deep focus, you will concentrate easier.

It works on almost any activity that you want to do. Do you want to relax faster and easier? Choose music that fits your mood. Do it few times. After a while, you will relax by listening to that music.

Pitch

In the book This is your brain on music, Daniel Levitin is talking about the pitch.

“Pitch is one of the primary means by which musical emotions is conveyed. Mood, excitement, calm, romance and danger are signalled by a number of factors, but pitch is among the most decisive. A single high note can convey excitement, a single low note sadness.”

So, if I play music that should cheer me up, it has lots of high notes.

7. Jackson 5 – I Want You Back

Guardians of the Galaxy – Awesome Mix Vol. 1 track 7 The 1:1 aspect ratio is deliberate and gives the same size when watching on your phone regardless if you hare holding it horizontal or vertical. Do you like the square video or do you prefer standard widescreen 16:9?

Or, If I want music that will make me more relaxed I could listen to this.

Beethoven – Moonlight Sonata (FULL)

Beethoven – Moonlight Sonata (FULL) – Piano Sonata No. 14 http://www.facebook.com/9Beethoven https://twitter.com/YtAndrearomano6 The Piano Sonata No. 14 in C♯ minor “Quasi una fantasia”, op. 27, No. 2, by Ludwig van Beethoven The sonata has three movements: 1 mvt: Adagio sostenuto. 2 mvt: Allegretto (click to go at 6:00 min).

The concept is little more complex than single notes. When notes are strung together we get melodies.

“Melodies are defined by the pattern or relation of successive pitches across time.”

Music written in the West has certain conventions. “Certain sequences of pitches evoke calm, others, excitement.”

The brain learns reaction to this. It’s like speech when rising intonation indicates a question.

“Pitch is so important that the brain represents it directly. If I put electrodes in your auditory cortex and play a pure tone in your ears at 440Hz, there are neurones in your auditory cortex that will fire at precisely that frequency. What goes into the ear comes out of the brain!”

That means that you are directly affecting your brain with music.

How you are going to use this information is up to you. I would suggest experimenting. Create different playlist to fit your needs during the day.

You can start with the morning cheer up playlist :)

Why you fail your interview even as a great developer

Photo by Branko Stancevic on Unsplash

Photo by Branko Stancevic on Unsplash

I was listening to my friend recently complaining about the lack of good developers. His company is constantly looking for new people, and they are struggling to find them.

They have lots of candidates that look good on paper, but in reality, they fail the interview. They go through the technical part of interview well. But when they start talking to them, they find out that potential candidates struggle to communicate. They can’t describe/translate technical issue into everyday language. They seem to be arrogant even though they might not be. They don’t listen.

Job Interview is a stressful process. You have to prove that your worth to others which is for most of the people going out of their comfort zone. You have to talk about yourself,
about your past and sometimes your future. Here are few tips how to improve your chances to get hired.

“You can make more friends in two months by becoming interested in other people than you can in two years by trying to get other people interested in you.” — Dale Carnegie

Be friendly

My approach to this is to talk to an interviewer as they are my new colleague. I don’t know them yet, but I’m trying to be friendly and honest and found out about them what they do how and why. Talk to them. I know it’s hard to talk to strangers about yourself but if you want to have a good job you have to get better at talking to people.

Listen

I know that you want to go through the interview as fast as possible, but you need to listen what the other side is saying and what they are asking. It helps in 2 ways. You find out more about the job and the company, and you will get topics that you can ask about. i.e.

Interviewer
“We have a friendly environment here. We play table football and have a beer fridge always full. One day a week you can work or anything that you want…”
Me
“That sounds good. So I can do anything not related to a job or is it something to work on the product?”
Interviewer
“It’s something to work on the product, but you can do anything. Come up with a new idea, try new technology…”

You see where I’m going with this. Based on the question about the “free coding” Friday you find out more about the company. You might find out that the “free coding” day is to solve technical debts instead of doing something for fun. It would suggest that this company has some issues with planning.
Or it might lead the other way where the company is giving you more time to improve your skills.

“When dealing with people, remember you are not dealing with creatures of logic, but creatures of emotion.” — Dale Carnegie

Use your empathy

What do you do when you have to talk to a manager about a technical issue, who doesn’t have a technical background? How do you talk a customer to find out why they can’t reset the password? If these are situations that you are trying to avoid then don’t. These are precisely those things that will give you more experience and teach you to be more empathic.

Then when they ask you, at the interview to describe some technical problem in a non-technical way, you know what to do.
But how you ask?
I’m sure that you have been there before. You are in the middle of something, and your mum is calling, “Hey Petr I can’t search for anything on the internet or my password is not working …”. My first thought is omg not again. But I take a deep breath and then trying to imagine what is she doing. Ask her to describe what is she doing “exactly”. And then go from there. I’m trying not to use any technical terms. So keep that in mind for some people even word “browser” is a technical term.

You can try the following exercise:

Try to explain to 6 years old what is an email.

Think about it …

I bet that keywords like servers and domains will pop up in your mind. Stop right there. Six year old doesn’t need to know what is DNS or a server, or that there is something call POP3 or IMAP.
Simplify everything that you can.

Me
“Email is a message that you send to someone via the internet.”
6yr old
“Like when I use WhatsApp?”
Me
“Yes, pretty much you just use a different app.”
Those 6year olds these days.

The same thing applies to customers. They don’t know things that you consider an essential knowledge. So be empathic with your customers and managers.
It will help you to get a job that you want. And if you are not looking right now, it will reduce your anxiety every-time you have to talk to non-technical people about an issue.

Bonus

Six ways to make people like you

from How to win friends and influence people by Dale Carnegie

  • Become genuinely interested in other people.
  • Smile.
  • Remember that person’s name is to that person the sweetest and most important sound in any language.
  • Be a good listener. Encourage others to talk about themselves.
  • Talk in terms of the other person’s interests.
  • Make the other person feel important — and do it sincerely.

This Post was originaly posted by Me on https://medium.com/@petr_24280/why-you-fail-your-interview-even-as-a-great-developer-a2bce88a2fcMedium

7 Habits that you are not doing because you are lazy

These habits are easy to do. So what’s stopping you?

First thing first
Before you jump into the list, you should know what steps to follow to acquire a new habit successfully. If you already know the drill, then you can skip this bit.

Step 1: Have a goal in mind. Why do you want to learn a new habit, what it will add to your life?

Step 2: Do it every day for at least a month. You can skip one day but never two days in a row.

Step 3: Measure it. Have a calendar with big X for every day you manage to do it. Follow “Don’t break the chain” method. Or have an app. There are plenty apps out there find one that you like.

Step 4: Share it with the world, friends, family. If you need an extra nudge on those days when you don’t feel like it, just the feeling that you have “failed” and others know about it might help you.

Step 5: Pledge. Something like “If I don’t make this habit for next 30 days I will give 100£ to … (my biggest enemy, cause that I disapprove, …).

Step 6: Do one at a time. Don’t try to learn piano and start running at the same time. It will distract you from your focus. You need the energy to acquire new habit so don’t divide it.

Step 7: Start now. No reason to wait.

Here is the list:

Cold shower

You would be surprised, how much cold shower would improve your morning. It will give you boost of energy. It might help you to avoid common cold, and I read somewhere that it will improve your skin. I didn’t experience that, but it might be true for some people.

How to do it:
Every morning, after your regular shower, turn the hot water off and run the cold only.
Your body is warm from the previous shower, so you are not going to feel cold. Try to soak from head to toes and if you feel like try to stay in the cold shower longer and longer. You notice that even it’s not pleasant from the start you will get used to it, and it will energise your morning.

Bonus point:
There is a guy named Wim Hoff who takes it little further. I did the online course, and it had improved my ability to withstand cold. You can check it out here: https://www.wimhofmethod.com

Practise mindfulness

This habit is about exercising your focus. Just try it now if you don’t believe me. Can you not think only for 30 seconds about anything and just have a blank mind? If you can, then well done. You don’t need this habit. If not, then you should consider it. It will help you to be more focused when you need to.

How to do it:
Try 5 minutes a day first. Just sit down where you are comfortable. Close your eyes and just try not to think. Some apps and guides will help you with different techniques. Recent one worth a mention is called Oak — Meditation & Breathing, and you can find it in Apple store. It’s for free.

Walking

Yes, I’m serious. I try to walk as much as I can. Do you know how much do you walk every day? Every phone now days has some form of step measuring. So you should turn it on and see how much do you walk. If you are bellow 10 000 steps a day, then you should do something about it. You will feel better. You will have more energy, and you will have more time to think and listen to some audiobook or podcast.

How to do it:
Try to walk, instead of taking a bus on short journeys. It might be even faster than the bus. Go for a walk during your lunch time, then again 3 hours later. Walk in the park or around the block. Who knows, you might find nice little shop or cafe that you didn’t know about because it was not on your regular route.

Enhanced level:
If you are already walking a lot, then great. I suggest that you up your game and stop taking elevators and escalators. So what that you are working/living at 11th floor. So what, those other people look at you while you are taking stairs next to an escalator. It’s good for you and your glutes 😉

Read a book

I don’t mean long article on Medium or New Yorker. I mean real book. I love reading books, and when I talk to people, I like to speak to them about what they have on their bookshelves. It might be a fiction or non-fiction, I don’t care. It always surprises me when some people say “I didn’t read a book in 3 years …”. But why? You ask. We live in the age where every information is accessible, and you can find a summary of every book. My answer is: because it’s fun. You will use your imagination more. You will see things from different perspective. It also improves your vocabulary and gives you conversation topic.

How to do it:
Choose something that you are interested in. Choose a book that was recommended by someone you trust or by a group of people with similar interest to you. Use Kindle, paperback, or just your phone. The reason is that you will have something light and portable so you can hold the book/device in one hand. That will allow you to read on the journey to work, on a crowded bus, tube/metro. If you are travelling by car, then you can listen to a book with Audible for example. They have lots of books, and you can return them if you don’t like the book. What is your excuse now? Just start with something smaller. Don’t read 1000+ pages book as your first attempt.

Bonus point:

If you are reading a non-fiction book then try to do notes, highlights. Then come back to it and revisit your notes. After you finish, make a short todo list based on the book that you just read.

Also, do you know that you don’t have to read every single word in it, don’t you? Check out this video about how to read a book.

Drink water

A human body is about 60% water. That’s not a Coke or Redbull or whatever you like to drink. It’s pure water. Free water. You don’t have to buy any water from The Alps or other nonsense.
Just use the tap water. If you can’t, then use a water bottle with a filter. And if you are still not convinced here are some examples what drinking water do for you:
Increases energy & relieves fatigue, promotes weight Loss, flushes out toxins, improves skin complexion, boosts the immune system, natural headache remedy, prevents cramps & sprains etc.

How to do it:
Put a glass of water next to your bed. Drink the whole glass after you wake up. You are little dehydrated in the morning. That’s one of the reasons, why your wee is darker. Your wee should be on a transparent yellow side. If it’s still dark after you have been drinking lot’s of water, a whole day, then you should see a doctor. Don’t force yourself to drink too much. Just a couple of sips every hour during the day or more if you feel like it. Buy yourself a water bottle that is easy to carry around and easy to maintain/wash. It’s nice that you have a water bottle with active charcoal in it but do you replacing it as often as you should? Just go simple.

Learn to cook

Cooking is a great way how to learn something new about your food that you are eating. It’s also a good way how to save some money. Home cook food contains fewer calories because you will use less sugar and fat that your KFC around the corner. It will also give you control over quality and source of the ingredients, which you are eating. And the best thing is that you can show off in front of your family and friends :)

How to do it:
What is your favourite dish? Most likely it’s something reasonably simple to cook. Pizza — no problemo. Make your dough from scratch use ingredients that you like and enjoy the smell in the kitchen.Btw did you know that original pizza doesn’t have a circle shape? So relax you don’t have to throw your dough in the air.
Do you like eggs for breakfast? Great. Eggs are one of the simplest and yet testier dishes that you can do in very short time. I’m talking under 10 minutes. Poached, scrambled, fried, omelette. All of them very tasty and surprisingly easy to make once you learn how. Cook as much and often as you can and share your dishes with family, friends. It will motivate you to get better.
You can google what’s the best way how to cook eggs or read The Food Lab book by J. Kenji López-Alt.

Journal

This is something that I pick up quite recently. I was looking for something that will help me to achieve my goals. And Journaling is a big help. You just need a notepad and a pen and 5 minutes twice a day. Journaling will help you in few different ways. It will allow you to focus on things that matter. It will help you to stop and think about your day, and it will teach you to appreciate little things. If you stick to it, you can go back to old journals and see what you have been up to couple years ago on a specific date.

How to do it:
Buy a notepad. Sit down after you wake up and before you go to bed. Write down three things you would like to achieve next day. Write down three things that you are grateful for. It could be anything from tasty coffee that you had, to be healthy. It will take you 5 minutes or less.

Extras

I like these extra habits because I consider them very easy to do and are little different than those above.

Weight your self every day
I recommend a smart scale that will track your weight, body fat and BMI. But standard scale will do too. Just weight yourself every morning after you wake up and every night before you go to bed. You will see a difference in weight between morning and evening measurement. That’s fine. The reason is that you will notice if you are suddenly losing or gaining weight. It might be because you changed something in your life, are you walking more/less, eating later in a day, drinking less/more etc.

Don’t look at your phone or laptop 1 hour before and after you wake up.
This might be hard for some, but I assure you, you will sleep better.

Floss and use electric toothbrush
I used to brash with a normal toothbrush and since when I switched I was surprised what a difference it makes (faster clean and whiter teeth).
Floss because it will help to keep your teeth healthy which means less stress at a dentist and less tooth decay. So less money spent on the doctor. Just one thing learn how to do it correctly.
This article should help.

Brush your teeth with the nondominant hand.
This habit is just something that I do for fun in the morning. I’m right-handed, and I was thinking about how hard it would be to learn to do simple things with a nondominant hand. After doing this since last year or so, I can say that I can do it with the same skill as my right hand. Small things :)

Go to bed and wake up early
You should have a good sleep every day. That means between 7–8 hours. If you go to bed early, let say at 10 pm and wake up at 5. You will have 7hours of sleep.
The reason for doing it is that it will help you to focus on yourself in the morning. I have twin girls that will be two years old soon, so my mornings used to be a little bit frantic. Since I start to wake up at 5, I have more time to read. Or just sit and think without disruptions. I am also more alert when girls wake up, so I can focus on them more.
It also helped me to cut down on late night drinks. I don’t drink as much as I used to, but sometimes I just liked to stay late and enjoy more than two glasses of wine. Now I know that
I have to go to bed, so I don’t go over the limit, and I still enjoy myself. There are some exceptions to course ;)

I wish you good luck and let me know if you need any help.