Saturday, January 16, 2016

Google hiring Best Practices - How to interview others?

 January 12, 2016

GoogleHiring Best Practices by Allison Watson

Take some notes about the presentation:


4 key criteria



1. Intellectual curiosity, Problem solving: 
very curious, understand problems; using 
hypothetical questions or behavior questions, really see how people break down the problem, can they see through, do they ask right types of questions

2. Technical skills, abilities


3. Leadership, not necessary people leadership, willing to take risks, having ownership


4. People are nice, you want to work with them. Do they want to engage with people? Work with part of team? Someone you can sit with 3 hours in the airport, wait for a flight and get along with them? Good sign that people can think good with the company. 


5. Diversity - try to improve on this. Diverse workforce to reflect them. 

A lot of consensus to make hiring decision


Questions: 


1. How Google keep the culture up when company grows? (Video time 7:00 - 9:00)


Always look for 
people who are curious, engaged, that is number one.

Make sure that we can offer them opportunities.

A lot of people move not for money, not because of money, move because of opportunities to grow, something interesting and challenging; get people always challenging themselves, improve themselves. Give them opportunities to grow, allow them take risks, fail, and then take more risks, and then you tend to find them always engaged.

In summary, what other values, fundamental values, stick to those values. Look for people embody the same thing. 

2. How do you know the person is going to do well? (video time 9:00 - 11:32)


Explain the Jahn-Teller effect, flip side of effect.

For example, someone comes in the room, smiling all the time, really nice; so you try to convince yourself why to hire this person. In the positive frame or mind.

However, do the opposite, people came from some university, look for reasons not to hire them. Be very conscious on that.

First thing as an interviewer is always thinking or rethinking, and checking, and asking several questions. Something seems off, keep asking, keep checking. Do not do it by yourself. Try to get at least 2 or 3 perspectives. And ideally, some one is not completed involved, have discussion afterwards.

Get 3 people in committee to discuss, objective,

what are the flags: be convinced.
Check that are you fair, not some one just likes you. Check that the person is good for company, good for the job.

Are there any place you can mitigate? Better to get right one. If all three of you are so so, do not do it. You are better to get convinced, and get a long time and get right person.

3. Do not do panic interview


Can you tell last project successful? A lot of questions followed. 

Hypothetical question: You can see the reasoning, how they will approach the work. But behavior question, a good story-teller will do better, (may not be a good fit for the job)

4. How to shortlist the applicants? 

The ways to shortlist, two things, you create job spec, seem to get a lot of unrelated resumes; Change the other job spec. Relevant job skills, is CV very jumpy? Make sure that this person can be committed, if the person moves a lot of jobs. 

Try to see the achievements. Do a lot of phone screen, quick call; 5-10 minutes, you can quickly get what you want. 

Huge emphasis on employee referrals. Recommendation and network. 

5. How to make sure the managers do the good work on hiring? 

Train them; what criteria we are looking for. 
Shadow interviews. Make sure that they are understanding process. 
Ask to write feedback, 

Tuesday, January 12, 2016

Leetcode 51: N - Queen problems

January 12, 2016

Encourage myself to write blogs about leetcode questions. The following talk encourages me a lot. 

https://www.youtube.com/watch?v=R22dJ7bn-pU&list=PLgYNPs-V9YFPqcnEvbIy5hFE40BjxMbjw&index=2
Hiring Rockstars by Roger Philby

the person likes to write, and then the person must love to read, and then the person must be very curious and intellectual. 

So, Julia likes to build up a good habit to write, and then, to read, and to be curious, and to be intellectual. 

Julia is working on recursive function design, how to handle N-Queen problems. After 6 months, she totally forgets how to solve the problem; So, she continues to read more blogs about this algorithm. 
Review the algorithm again. The following blog gives a good explanation, help me understand the algorithm better.
 
blog1 (Java programming language): 
http://blog.csdn.net/linhuanmars/article/details/20667175

Amazed that a person can work on algorithms problems and finish over 300 questions/year, people love algorithms and they must know the power of algorithms to save time and improve efficiency at work. 


http://buttercola.blogspot.ca/search/label/Leetcode
http://buttercola.blogspot.ca/2014/09/leetcode-n-queens.html
Leetcode 314:
https://github.com/jianminchen/Leetcode_C-/blob/master/BinaryTreeVerticalOrderTraversal_314.java

Julia likes to work on the analysis of the algorithm, this pseudo code in the blog may help her quickly recover, from nervous to get familiar with the algorithm. 


The following blog is well-written, and Julia should write a similar solution using C#, to express her appreciation of good variables names, good analysis. (Rating: 10 from 1-10) 

https://polythinking.wordpress.com/2013/02/27/leetcoden-queens-i-and-ii/


It is fun to read solutions in C++/Java.


Write another version of N-Queen problem in C# to entertain. 
https://github.com/jianminchen/Leetcode_C-/blob/master/51NQueenProblem_B.cs

Good advice from the blog 1: 基本上大部分NP问题的求解都是用这个方式,比如Sudoku Solver,Combination Sum,Combinations,Permutations,Word Break II,Palindrome Partitioning等,所以只要把这个套路掌握熟练,多练习. 

Feb. 2, 2016 It is also a DFS algorithm. 

Sunday, January 10, 2016

Leetcode algorithm 160 -170 study

January 10, 2016


Write a lot of code. It is the only way to improve and become a better programmer.

Julia likes to read blogs related to Leetcode algorithm problems, and then she learns how to solve problems.

In other words, 做程序员, 需要多看别人的代码. 向同行学习.

Leetcode questions 161 - 170

August 22, 2015

161 One Edit distance
http://www.danielbit.com/blog/puzzle/leetcode/leetcode-one-edit-distance

http://www.meetqun.com/thread-2854-1-1.html

162 Find Peak Element


need to write first C# implementation for this problem.

163 Missing Ranges

http://bookshadow.com/weblog/2014/12/14/leetcode-maximum-gap/

Julia, please practice this C++ code, and get some idea how advanced C++ works. (January 10, 2016)
http://ask.julyedu.com/question/213


165 Compare Version Numbers

166 Fraction to Recurring Decimal

167 Two Sum II - Input array is sorted

168 Excel Sheet Column Title

169 Majority Element

Friday, January 8, 2016

Wednesday, January 6, 2016

Divide and Conquer: Preorder traversal of ternary tree


January 6, 2016
重温一道关于树遍历的题目, 在新年开始的第一个星期, 鼓励自己, 加油! 多写代码, 多练习.

Be humble, learn from her mistakes in 2015. Julia is learning how to solve "divide and conquer" - write a perfect recursive function - without bug in base case - recursive calls. 

Her lessons for recursive function design, divide and conquer solution in 2014, 2015:

1. Do the work for root node, but do not do the work for its children; In other words, a subproblem can be handled by a recursive call. 

2. Do not repeat base case 'if' clause - a checking afterwards in the recursive function call. Not necessary, except trying to use less stack. 

Julia, recursive function design is like dealing with a family - single parent with children; show the work how to handle root node, that is almost done. Let recursive function to take care of children, do not do the work for children nodes. For example, binary tree, 2 children, call recursive function twice; Ternary tree, 3 children, and then, use 3 recursive calls. 

Once again, "Do not do the work for children directly". 

Action items:
1. Work on Leetcode questions again and start with simple questions.

Binary Tree Preorder traversal of ternary tree
More reading about ternary tree:
  https://en.wikipedia.org/wiki/Ternary_search_tree

Friday, January 1, 2016

Favorites of top 10 rules for success

Dec. 31, 2015

 Stayed up to last minute of 2015, 12:00am, watching a few of videos about top 10 rules for success, and then, think about putting together a blog to share, for a successful year 2016.

  Top 10 rules for success

1. Jessica Alba
2. Oprah Winfrey
    No. 5, Run the race as hard as you can
    Julia's favorite, do not look at others, things you cannot control; focus on yourself
    25 years talk show, hundreds of talk show failed.
 
    9. Stay grounded

3. Bill Gates
    No. 7  Ask for advice 
    Blind spot concern
    No. 8 Pick good people
    No. 9 Don't procrastinate
    School, last 2 days study for exam
    But in business world, it is not good.
    No. 10 Have a sense of humor

Warren Buffett
    No. 5 Have a margin of safety
    No. 7 Schedule for  your personality

Jack Ma
     No 1. Get used to rejection
     No. 9 Don't complain, look for opportunities
     No. 2 Keep your dream alive
     No. 3 Focus on culture
     Not just money, to help others
     No. 5 Get inspired
     No. 7 Have a good name
     No. 8 customers are #1
     Share holders will leave quickly if there is bad thing happens

Jeff Beco
     No. 1 Have no regrets
     80 years old, think about things you try in young age. Internet, if I fail, no regret.
     No.2  Follow your heart not your head
     No. 3 Invest more in the product then marketing
     No. 4 Pick a good name
     No. 5 Stand for something
     No. 6 Focus on the customer
     No. 7 Focus on your passion
     No. 8 Build a culture
     No. 9 premium products at non-premium prices
     Kindle, product - no profit, but user uses it, make money
     No. 10 take a risk

Larry Page
     No. 2 Don't be afraid of failure
     work on 10 years
     leadership training - fail fast
     Take some risk, encourage to take more risk
     No. 3 Stay organized
     No. 4 Concentrate on the long term
     tooth brush test ( twice a day)
     gmail/ youtube
     double the revenue on youtube, since a lot of people use it. But at the begining, spend a lot
    No. 5 Have a good idea
    No. 6 Solve bigger problems
    No. 7 Take on challenges
    No. 8 Don't settle
    other people do not tell
    Be an expert in all areas
    Search algorithm, spent 3-4 years on it, before Google has over 100 people work on
    No. 9 Adapt to changes
    No. 10 Follow your dreams
    anxiety -> dream
    about school, computer error about admission etc. /irational worry, then anxiety, had a dream:
    download entire web to a small computer lying around ->
    after dream, stay up a few of hours, work on algorithms ->
    set up a few weeks, thought at the beginning vs 1-2 years work ->
    keep links -> not all web pages -> rank of pages -> google
    Share the story of his personal dream -> developed a top of world company and technology - Google

   Michale Jordan
       No. 1 Keep working hard
       No. 2 Ignite the fire
       nothing can stop me
       No. 3 Be different
       No. 4 Fail your way to success
       Fail over and over and over again.
       No. 5 Have high expectations
       No. 6 Be positive
       bad thing/good thing mixes, no such thing called bad thing
       No. 7 Be who you were born to be
       Encourage to fail
       Take everything you are given,
       Not about shoes, it is about where you choose to go
       No. 8 Have a vision
       Mentally strong
       No. 9 Stop make excuses
       No. 10 Practice (no need to think when in the game, situation met before)
       At that moment, you do not have to think

Kobe Bryant
        No. 1 Make sacrifices
        No. 2 One move at a time
        How do I prepare? One piece a time, start from a small step
        No. 3 Trust your skills
        how to face criticism? Pressure?
        No. 4 Use your scars as a weapon
        open up to them
        No. 5, Focus on each day
        Do not think about the final result, focus on each day -> training, conditioning, ...
        No. 6 Don't be afraid confrontation
        Cannot please everyone
        Even hurt your feelings, tell something: small thing, like food in your teeth
        No. 7 Be competitive when it's hard
        No. 8  Just keep going
        career -> not chase championships
        good/bad moments, things will work out
       No. 9 Thrive on being an outsider
       No. 10 Compete with yourself
       a story about practice, 800 times, young but mature, weight training, conditioning

     January 2, 2015

Vinod Khosla's Top 10 Rules For Success (22 minutes, co-founded Sun Microsystems from 1982 to 1984)

https://www.youtube.com/watch?v=MsGgZp_PAzM
No. 1. Be pesistent
No. 2. Keep innovating
No. 3. Add value
No. 4. Have the guts to follow your beliefs
No. 5 Try and fail, but don't fail to try
No. 6 Transcend what's traditional
No. 7. Shake things up
No. 8. Build a great team
No. 9. Dare to be great
No. 10. Be brutally honest

Facebook Documentary - Sheryl Sandberg's Top 10 Rules For Success

https://www.youtube.com/watch?v=qKRB8n6PULQ
No. 1 Have impact
No. 2 Think big
No. 3 Go for growth
she joined google when there were only 200 people.
She worked for a person 23 years old.
Care less about level, but about growth.
No. 4 Communicate authentically
There is no truth. Your truth, my truth. It is objective.
Walk in room, say what you believe. Give people room to authenticate, give out their thoughts.

No. 5 Hire big
Hire for then, not just now. Then happens quickly. 
Hire overqualified, hire new graduate. 

No. 6 Don't just talk, really listen!
No. 7 Take responsibility
No one has complete control.
Learn to take responsibility. Late for work, it is not for traffic. But you do not consider the traffic issue.
No. 8 Measure results, not face time
Focus on result, not face time. But if you focus on face time, you reward face time. 
People work hard, but may not focus on result.
No. 9 Find something you really believe in
No. 10 Careers are not ladders, but jungle gyms

Jeff Weiner's Top 10 Rules For Success

https://www.youtube.com/watch?v=do9jIFIFj08&list=PLiZj-Ik9MmM0VWRGYCfuUCdyhKfU733WX&index=102

Reference videos:
Michael Jordan's Top 10 Rules For Success

Kobe Bryant's Top 10 Rules For Success

https://www.youtube.com/watch?v=5Nd_nUhUj2M

More watching:  ( January 2, 2015 )
Vinod Khosla: Failure does not matter. Success matters.
https://www.youtube.com/watch?v=HZcXup7p5-8

Note to laugh: Strategy to get greencard: Convince them, otherwise, confuse them.
Notes: come out your priority, and then measure
in 1990s, 25 dinners with kids /month, try to achieve them; means, no sports out with friends in dinner time.

January 21, 2016 (20 minutes talk - after 10 rules, there are 8 minutes talk about her projects at Google, nice sharing)

Marissa Mayer's Top 10 Rules For Success

https://www.youtube.com/watch?v=02zYZ-JB2zQ

http://www.businessinsider.com/google-cfo-ruth-porat-success-secrets-2015-12

January 31, 2016
Tony Hsieh
https://www.youtube.com/watch?v=49kJE4HJb_w
1. Chase the vision, not the money (
    things like to do, and does not make a dime in 10 years / and let the money follows;
    do not chase paper, chase dream
    Entrepreneurs:
    What would you be passionate about doing for 10 years even if you never made a dime?
    )
2. Hire the right people (
   technical: meet the bar, but, hang out with? if the answer is no, then ...
   work life balance/ so much time at work, better enjoy it  
   - good one/ medium one: strong culture - 10 core values - does not matter what value you are
   - no judgement of values - but you have some values - figure out what values you are  
   )
3. Let your customers do marketing for you. (buy exposure /ads etc., make customer happy - word of mouth)
4. Think long term
5. Do thought experiments
6. Form close bond with your coworkers
7. Have self-confidence
8. Celebrate each person's individuality
9. Maximize customer experience (360 day return policy, contact information - opposite information, low technology, unsexy - phone calls)
10. Just be happy (lose everything, still be happy)

Tuesday, December 29, 2015

Vacation break in 2015 - from Dec. 28 to 31, 2015

Dec. 29, 2015

 Try to have a good vacation. So, plan to learn skiing this winter, go out to do sports. Swimming, tennis, skiing, and all other activities.

 Julia went out the Lonsdale Quay on Dec. 29 to catch a free shuttle to mountain Seymour, but she missed the shuttle. She had great time to enjoy beauty of city of Vancouver. She took the skytrain, seabus, and walked in the city.

  Then, she decided to learn something about real estate, money, and Julia likes the teaching from Canadian business guru Kevin O'Leary.

  Here are the list of videos watched:

http://www.chatelaine.com/living/budgeting/why-kevin-oleary-doesnt-plan-to-leave-any-money-to-his-kids/

The Hour: Kevin O'Leary
  https://www.youtube.com/watch?v=0TZ__3iuQU4

Kevin O'Leary on Occupy Wall Street
https://www.youtube.com/watch?v=JR6aCl7cZyg

Kevin O'Leary on men, women, and money
https://www.youtube.com/watch?v=PkbWBDeLrJ4

Kevin O'Leary's 'Cold, Hard, Truth' on Gold Investing

https://www.youtube.com/watch?v=aZ0T6RwJYPc

O'Leary: No cracks in Canada's housing, condos show insatiable demand

https://www.youtube.com/watch?v=9etKaSeBpxg

Kevin O'Leary Real Estate Investment Advice Canadian TV

https://www.youtube.com/watch?v=35wZ-dda1a0

Kevin O'Leary's Top 10 Rules For Success (Julia's favorite: No. 6, No. 8, No. 4)

https://www.youtube.com/watch?v=ItMr7vxvekU

10 rules -
1. You have to sacrifice a lot
2. Trust your gut
3. Have diversification
4. Have a backup plan
5. Be a leader
6. Admit your weakness
7. Buy stocks with dividends
8. Differentiate between family, friends & money
9. Get outside of North America
10. Go with simple ideas

Kevin O'Leary on how to get ahead in the workplace

https://www.youtube.com/watch?v=bG6L5z7fMxE
1. How to calculate the worth to the company?
Answer from Kevin:
 Can you get the job done?
 How fast can you get the job done?
 How much ripple effect you create?
 Can you work with others? Do you create hassle with other employees? These are matrix employer uses.

2. Can you brag your accomplishment to the superior?
Answer from Kevin:
1. What keep you employed is to keep your boss looks great. Pass your manager to brag yourself, it is like passing a car in free way.
2. Got to be a politician. When to take, when to give, when to say, when not to say.
    Make your boss looks good. Help boss achieve his goal.

3. Go to work to make money, not make friendship
4. Code ethics - Dressing, people does not notice - people do not remember what you wear yesterday

KEVIN O'LEARY How To Nail a Job Interview ADVICE

https://www.youtube.com/watch?v=VvVUvWwUrzI
1. Do not cut people off, let people finish talk; answer the question.
2. Do not be anxious. Be confident. You are in the interview, supposing that you will get the job. Look them in the eyes when you are asked a question.
3. What is weakness? Do not know what you need from me. I will work hard to figure out.

Kevin O'Leary Keynote at Notre Dame

https://www.youtube.com/watch?v=XBUQNYczj4A
What makes a great entrepreneur?
1. Prepared to make life/balance sacrifices.
2. Have a little knowledge about everything, but a lot about what they are selling.
3. Put shareholders first.
4. Love what they sell.
5. Use technology to make work more efficient.
6. Understand the business is a global competition.

Sunday, December 27, 2015

Think Fast, Talk Smart: Communication Techniques

Dec. 27, 2015

 Take a break, and watch the video:

 Think Fast, Talk Smart: Communication Techniques
 https://www.youtube.com/watch?v=HAnw168huqA


 Take some notes:
http://www.singjupost.com/think-fast-talk-smart-communication-techniques-by-matt-abrahams-full-transcript/

Techniques:
1. Greet anxieties - it is normal, and then, take deep breathe, and think that it is a conversation, not performance. There is no a right way to do presentation.

2. First, start with a question.
Count how many 'f', and answer the questions.

3. Write down a series of questions to answer. Instead of a lot of bullets notes.

4. Use conversational language.

    Bring ourselves into present moment, instead of future consequences

My favorite way to get present-oriented is to say tongue twisters.

Repeat after me. It’s only three phrases. "I slit a sheet. A sheet I slit. On that sheet I sit. "Focus on saying right, in the presence moment. 

"I slit a sheet. A sheet I slit. And on that slitted sheet I sit". Very good, no shits. Excellent. Very good. 

the first two steps of our process. First we get out of our own way, and we can reframe the situation as an opportunity.

The next phase is also hard, but very rewarding, and that is to slow down, and listen. 

The first useful structure: problem-solution-benefit structure
Another structure: what? So what? Now what? Structure. 

Julia's favorite notes:


"So what does this all mean? It means that we have, within our ability, the tools and the approaches, to help us in spontaneous speaking situations. The very first thing we have to do is manage our anxiety, because you can’t be an effective speaker if you don’t have your anxiety under control. And we talked about how you can do that by greeting your anxiety, reframing as a conversation, and being in the present moment.
Once you do that, you need to practice a series of four steps, that will help you speak spontaneously. First you get out of your own way. I would love it if all of you, on your way from here to the football game, point at things and call them the wrong name. It’ll be fun. If most of us do it, then it won’t be weird. If only one and two of us do it, it’ll be weird. Right.
Second. Give gifts. By that I mean see your interactions as ones of opportunity, not challenges.
Third, take the time to listen, listen. And then finally, use structures. And you have to practice these structures. I practice these structures on my kids. I have two kids. When they ask me questions, I usually answer them in what, so what, now what. "
Book: Speaking Up Without Freaking Out

More videos:
1. https://www.youtube.com/watch?v=5naThX63pF0

2. 

Matt Abrahams Workshop Compelling and Confident Communication 1

https://www.youtube.com/watch?v=ENLZfjLoPEY

Notes:
Knowlege
Domain and Audience knowledge means you...
Speak to benefits instead of features.

What do they know?
What do they expect?
What are their area of concern?

Relevant to audience - Reveal the relevance - 25% of all the world money, into the bank, for example

Advance Analogies - Buy you a lot, link thing they already know

Invoke Imagination - Rember an event in the past, or in the future

Use "You" - use conversational language, engage them to what they know, using inclusive language

Kevin O'Leary Keynote at Notre Dame

https://www.youtube.com/watch?v=XBUQNYczj4A








Code School: courses study

Dec. 28, 2015

Spent hours (Dec. 23 - 3 hours, Dec. 27 - 3 hours) to watch courses on code school from Dec. 22, 2015 . Website:  https://www.codeschool.com/

Path HTML/CSS

Get Started With HTML and CSS
Course: Front-end Foundations
Course: Front-end Foundations

Intermediate CSS
course: CSS Cross-Country
course: Journey into Mobile
course: Adventures in Web Animations

CSS Preprocessors
course: Assembling Sass
course: Assembling Sass Part 2

CSS Frameworks
course: Blasting Off with Bootstrap

Design
course: Fundamentals of Design


Paths: JavaScript

Client-side Frameworks
course: Shaping up with Angular.js
course: Staying Sharp with Angular.js
course: Warming Up With Ember.js

More review:

Google I/O 2013 - Design Decisions in AngularJS

https://www.youtube.com/watch?v=HCR7i5F5L8c&feature=share&fb_ref=share



Tuesday, December 22, 2015

OO principles - The Open / Closed Principle

Dec. 22, 2015

Three Approaches to Achieve OCP

  1. Parameters (Procedural Programming)
  2. Inheritance / Template Method Pattern
  3. Composition / Strategy Pattern
1. Parameters (Procedure Programming)
Allow client to control behavior specifics via a parameter
Combined with delegates/lambad, can be very powerful approach

2. Inheritance / Template Method Pattern
Child types override behavior of a base class (or interface)

3. Composition / Strategy Pattern
Client code depends on abstraction
Provides a "plug in" model
Implementations utilize inheritance; Client utilizes Composition

Read the blog:
http://code.tutsplus.com/tutorials/solid-part-2-the-openclosed-principle--net-36600
http://www.objectmentor.com/resources/articles/ocp.pdf
http://stackoverflow.com/questions/59016/the-open-closed-principle

A friend told me that he subscribes
https://www.pluralsight.com/

So, Julia subscribed code school first starting this Dec. 2015, and later pluralsight.com. Two schools are different.

Video watch:

https://www.youtube.com/watch?v=MvyG_ODng3w

Code School Live: JavaScript Best Practices Q&A

https://www.youtube.com/watch?v=k9xwJoprEMY

Principles of Object Oriented Design (2 - The Open-Closed Principle) 28 minutes 

https://www.youtube.com/watch?v=qP6MroshYvM&index=8&list=PLD4GnSXHpkQ2_eKG5fKzszXs5hYcEsft7

I Learned HTML and CSS, Now What?

http://blog.codeschool.io/2014/09/30/learned-html-css-now/

http://support.pluralsight.com/knowledgebase/articles/491274-what-s-offered-at-code-school-vs-pluralsight

Sunday, December 20, 2015

Book reading: Head first Design pattern

Dec. 20, 2015

 Start to read the book "Head first design pattern" - 600 pages book. Plan to spend 10 hours to read the book first.

 Head first series books are my favorite ones. This time, I will document how I learn, what my favorite parts through the book. Encourage myself reading more of this book, I like to enforce myself to read first 200 pages first.

Dec. 20, 2 hours
Read page 1 - Page 38, reviewed strategy pattern, example:
client:
duck

Encapsulated fly behavior
FlyBehavior Interface -> 1. FlyWithWings   class  2. FlyNoWay class

Encapsulated quack behavior
QuackBehavior -> 1. Quack class 2. Squeak class 3. MuteQuack class

Duck has-a feature, not is-a  since HAS-A can be better than IS-A

Design Principle: Favor composition over inheritance

So, Duck client class is designed:
Duck
---------
FlyBehavior flyBehavior
QuackBehavior quackBehavior
--
setFlyBehavior()
setQuackBehavior()

Dec. 27, 2015
Spent 2 hours to read the book, went through the 300 pages quickly.

Motivation to read more pages of the book (Dec. 28, 2015):
1. The book is well written, Julia, you will not forget the examples in each pattern.
2. The reading takes your some time, but later, when you develop the software, you will save the time.
3. Just relax, and have some reading, you will not get lost, cannot understand, or get bored easily, the learning is fun.
4. If you cannot understand the book, then, you will have a lot of trouble down the road. OO design is a must skill to have your career as a programmer.
5. Find some videos - courses in pluralsight, watch first, and then, get other people's help first; come back to read the book slowly.

https://www.youtube.com/watch?v=acjvKJiOvXw&feature=share&fb_ref=share

Thursday, December 17, 2015

Book Reading: Effective Java

Dec. 17, 2015

Effective Java is such a great book, I had wonderful time to read 1-2 hours while enjoying the travel on train back to my home  town this October, 2015.

But, Julia had to motivate her more to complete reading the book - at least spend over 10 hours this holiday break to catch up some best ideas about programming.

Dec. 17, 2015  (20 minutes reading)
Item 52: Refer to objects by their interfaces (julia's rating 1-10: 10)

Dec. 18, 2015 ( 2 hours reading 8:00pm-10:00pm)
Item 23: Don't use raw types in new code
Item 24: Eliminate unchecked warnings
Item 25: Prefer lists to arrays
Item 40: Design method signatures carefully
Item 45: Minimize the scope of local variables
Item 46: Prefer for-each loops to traditional for loops

Dec. 19, 2015 ( 2 hours reading 8:30am-10:30am)

Item 6: Eliminate obsolete object reference (read the item twice)
Actions: take sample code, and think about similar example, write a one in C#, check in github
Notes:
3 cases for memory leaks:
1. whenever a class manages its own memory,
2. caches  - WeakHashMap
3. listeners and other callbacks
Careful code inspection or with the aid of a debugging tool known as a heap profiler
Action item 2: Try heap profiler in C#

Item 8: Obey the general contract when overriding equals (read again, 30 minutes)

Further reading:
WeakHashMap
http://www.ibm.com/developerworks/library/j-jtp11225/

Read some code, and then, go back to the book.
http://www.codeproject.com/Articles/595160/Understand-Liskov-Substitution-Principle-LSP

http://www.codeproject.com/Articles/648987/Violating-Liskov-Substitution-Principle-LSP

http://www.codeproject.com/Articles/597870/Liskov-Substitution