Friday, October 18, 2019

Leetcode 54. Spiral matrix

Oct. 18, 2019

It is my favorite algorithm. I wrote a C# solution again to warmup the idea. Here is the post.

C# Using direction array and no extra space for visit marking practice in 2018

Oct. 18, 2019
It is the time for me to review the algorithm again. With the experience of Amazon and Facebook onsite in August 2019, I learned that I have to work on algorithms and make sure that I can come out optimal time and space complexity in practice.
The argument is that optimal space complexity can lead to a solution with simplicity; simplicity =>Write and implement in less than 10 minutes.
I also spent time to review the question I asked on stackexchange.com back in February 2018. At that time, I was not sure how to push myself hard to practice the algorithm with this optimal space complexity solution as well. Here is the question I asked in February, 2018.
Here are highlights:
  1. Understand the design of four variables (top, bottom, left, right) to mark the boudary of spiral matrix, four corners;
  2. Increment/ decrement those four variables (top, bottom, left, right) while changing directions;
  3. Introduce one variable (total) to track how many nodes to visit in the matrix, one variable (index);
  4. Introduce directions variable to track four directions, toRight, down, toLeft, up;
  5. Overall six variables, one direction array can easily be used to solve problem with optimal space and easy to write.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _54_Spiral_matrix___2019_Warmup
{
    class Program
    {
        static void Main(string[] args)
        {
            RunTestcase();
        }

        public static void RunTestcase()
        {
            var matrix = new int[3][];
            matrix[0] = new int[] { 1, 2, 3 };
            matrix[1] = new int[] { 8, 9, 4 };
            matrix[2] = new int[] { 7, 6, 5 };

            var spiral = SpiralOrder(matrix);

            Debug.Assert(String.Join("", spiral).CompareTo("123456789") == 0);
        }

        /// <summary>
        /// warm up practice in Oct. 2019
        /// https://leetcode.com/problems/spiral-matrix/discuss/407992/C-Using-direction-array-and-no-extra-space-for-visit-marking-practice-in-2018
        /// </summary>
        /// <param name="matrix"></param>
        /// <returns></returns>
        public static IList<int> SpiralOrder(int[][] matrix)
        {
            if (matrix == null || matrix.Length == 0 || matrix[0].Length == 0)
            {
                return new int[0];
            }

            int rows = matrix.Length;
            int columns = matrix[0].Length;

            var spiral = new int[rows * columns];
            //                               Right    down    left      up 
            var directions = new int[4, 2] { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } };

            // define four corners of matrix and increment/ decrement when changing directions
            int firstRow = 0;
            int lastRow = rows - 1;
            int firstColumn = 0;
            int lastColumn = columns - 1;

            int total = rows * columns;
            int index = 0;

            // visit node
            int row = 0;
            int column = 0;

            int direction = 0;

            while (index < total)
            {
                spiral[index] = matrix[row][column];
                index++;

                var nextRow = row + directions[direction, 0];
                var nextCol = column + directions[direction, 1];

                // not in range of spiral matrix 
                if (!(nextRow >= firstRow && nextRow <= lastRow && nextCol >= firstColumn && nextCol <= lastColumn))
                {
                    // change direction - increment/ decrement four corners
                    switch (direction)
                    {
                        case 0:
                            firstRow++;
                            break;
                        case 1:
                            lastColumn--;
                            break;
                        case 2:
                            lastRow--;
                            break;
                        case 3:
                            firstColumn++;
                            break;
                    }

                    direction = (direction + 1) % 4;
                }

                // reset row, column
                row += directions[direction, 0];
                column += directions[direction, 1];
            }

            return spiral;
        } 
    }
}

Thursday, October 17, 2019

Why Americans Love Taco Bell

Here is the link.


Here’s how Abercrombie & Fitch ditched its past to try to bring back customers

Here is the article with a video link as well.


How Does Investing In Abercrombie & Fitch Co. (NYSE:ANF) Impact The Volatility Of Your Portfolio?

Here is the article. I like to learn the topic related to volatility.


Can Abercrombie And Fitch Make A Comeback?

Here is the video.


Chick-fil-A Doesn't Want You to Know These Surprising Secrets About Their Business

Here is the article. I read once and I like to take some notes as well.

1. They once pretended to be a teenage girl online

2. Free food comes pretty easily

3. They have a history of alleged employee discrimination

4. They are selectively charitable

5. You can go from employee to franchise owner in just a few years

6. There are only three states without a Chick-fil-A

7. There is a secret menu

8. They actually do own the original chicken sandwich

9. They are Christian — and they don’t care if you know it

10. They are also conservative

11. They are the largest buyer of peanut oil

12. They buy the most lemons, too

13. The name was on purpose

14. Scoring fresh sammies requires a little extra effort

15. Employees are trained to be ‘extra courteous’




My homework this year - learn to be a financial analyst

Oct. 17, 2019

Introduction


It is almost the end of the year. I have to rush to learn business analysis, learn all business in United States, so I can come out ideas to help sales manager and market team, help myself to come out ideas to work on business analysis.

Prepare a list to study


I have to study all stores I visit last year, and all others I do not visit. I like to learn how to make analysis work for the business.

1. The rise of Chick-fil-A, here is the link.


Wednesday, October 16, 2019

Investors should short the S&P 500: Gary Shilling

Here is the video.


How to be a good learner?

Oct. 16, 2019

Introduction


It is so tough for me to live a single life and watch those twenty years with rich experience but lack of financial confidence from 1996 to 2019. I had so many dreams, but I kept failing until I learn the fact that I want to change.

What to learn

I certainly learn that it is most important things to learn personal finance, learn how to be frugal, how to play emotions smartly. Be a good christian, and also  be a good community member. That is something I found out that I missed when I turned 52 years old in Nov. 2018.

Make it long term goal

Most of important is to work on research, how to be a rich person, start early in 20s. In order to work on this long term goal, how should I invest time and effort to work on daily life. It does not matter how tough the situation is. Do not give up this ultimate goal. Short term goals and long term goal should be worked on together.

Relearn - remove bias

Evaluate myself how smart I can be. I did not look into any investment opportunity in stock market from 2009 to 2019. I have to question myself, how to slow down my stubborn, and start to learn something new, basics of investment.

I do think that I have to train myself to be able to see so many investment opportunities in the life. Relearn is a new word for me. I got hurt before, but it is one of behavior finance common mistakes, but it takes me more than 10 years to find the issue and start to fix it.

Why it takes me 20 years to learn investing on equities?

Oct. 16, 2019

Introduction


It is my personal finance research. Why I took 20 years until I am 53 years old that I should invest on equity, take some risk on stock market? I worked full time last 10 years, but I did not learn other basics like how to invest on equities. I did not know the bull market last 10 years, and I did not know any question like Amazon, Apple and MSFT and Netflix stocks, for example, $1000 dollars investment on Amazon stock in 2010 value of 2019.

Life is tough and I was panic 


I just keep blogging until I find my biggest mistake on personal finance in May 2019. I do not learn economics, and I do not know how to invest until I read a statement to show less than 10 dollars interest on my Scotiabank checking account with $50,000 dollars back in 2018.

This is my life first time that I can save more than $50,000 dollars. I had net income $110,000 from 1999 to 2001, but I was under influence of my mom and relatives, I had to pay so many bills and did not learn the delay of gratification. My saving is less than $20,000 dollars. I was on the track of low income, low saving for more than two decades.

Here are some highlights things I tried;


1. I went to USA Florida for graduate study and graduated in Dec. 1998 with a computer master degree;
2. I worked full time for two jobs and then got laid off in Sept. 2001;
3. In 2002 August I went back to FAU for graduate study and then went for intern, full time in 2016 for a startup called Siva, lasting 15 months;
4. I want to get Ph.D. degree but I could not get it;
5. I got a full time job offer in June, 2008 but offer was rescinded, I decided to pursuit my Canada skilled immigration instead;
6. I like to immigrant to Canada, but my application was denied in 2009;
7. I had to file the appeal from January to June, I got a court date on June in 2009.
8. I argued with the  the department of justice lawyer in application record; I owned a home with home equity and IRA CD over $20,000 in 2009.

How to break vicious cycle? How can I learn the wisdom to stay independent, and learn to build wealth and grow rich?

It is tough but I have to learn the basics after I decided to work on personal finance research starting from November 2018.

Here is the link to access those blogs.

Actually I started to invest on equity from 1999, but I did not know the importance of keeping learning; I made common behavior finance mistakes, and then quit equity in 2009 and then never went back until 2019 May.




Amazon, Microsoft, Apples and Oranges

Here is the blog.

I like the analog using tires to tell the difference. I like Amazon technique, one lap, and work on more iterations.




Tuesday, October 15, 2019

I learn how to invest after five year blogging

Oct. 15, 2019

Introduction


It is my personal coding blog, I choose not to set up advertisement on my blog. I know that my blog is to serve myself as a mediocre researcher, below average. I just follow my tennis sport coaching advice, journal your practice, widely popular in sports training. And then I found a big surprise of benefits of blogging recently, in the fifth year of blogging.

2017 second hand mobile phone purchase



I laughed about myself recently, since I wrote something on wechat group 1988 SJTU. Here is the picture.




I did not relearn how to invest again until 2019. Here is the blog I wrote and shared with my wechat group we attended SJTU from 1984 to 1988.

I did invest my IRA and 401 K from 1999 to 2009 in stock market, but I did not learn the basics. After I got my Canadian immigration case was denied, I went into self-doubt and then decided to close all my accounts with brokage company, and moved the fund to Amtrust CD account.

From 2009 to 2018, I did not spend time to learn anything about stock market at all. I turned 52 years old in Nov. 2018, but I could not get a high paid job as a software programmer. I need to be a problem solver, I decide to move on to personal finance research.

Actionable items:


1. I like to work on research how many biases I have, and how many things I should relearn.

Learn to invest and take risk is just one of things I found out in 2019.

2. Review year 2001, after my first laidoff, with $110,000 US dollars net income from my short three year full time work. How many things did I do wrong? How many good things I learned from the lesson?

3. Why do I not have ambitious to be a millionaire back from 1998 to 2001? Do I have some research on personal finance from 2001 to 2010?

4. I had lot of timet to study and work on some research from 2001 to 2010. I was not patient and stubborn. What is the cause?


5. Why I push myself so hard to write blogs every day? What motivates me to continue?

Life is so tough. I remembered the feeling I stayed at hotel in pullman in redwood city this August 18, August 19. I just could not believe that I fell in love with a suite and I definitely like to own a home in Canada.

I work so hard, why I cannot own the home with my own saving. I even could not afford the down payment after working full time 10 years.

If I know the status 10 years ahead, Nov. 2018, I was so depressed on tennis court and did not know what to do. What should I plan to work on starting from June 2010.

Every day I should study personal finance, stock market, I will be a frugal person. No vacation, no clothing purchase, no more car maintenance, take public transit. I will track down every dollar I spent, is it my need or my want. Should I pay the bill or not? Can I argue to take alternative?

I will examine all my social connections, relatives, put everything under consideration. Should I study by myself or spend time to socialize, I will ask myself why?

Follow up 

Jan. 2, 2019

It takes me 5 years to figure out what I need in order to be successful as an immigrant, and also as a software programmer, a problem solver. I need to learn the basics of personal finance, investment on stock market, real estate. I need to learn how to manage my time, so that I can have more time to take some courses from MIT open courseware to learn portfolio management, and I can watch more videos and learn ideas how to manage money, being frugal.

Life is tough. I do not come out the idea what to work on to get most of output. I do think that a best blog should not show so many ads to distract users. Sometimes ads by Google can show up anywhere, it is so disturbing. I like to treat my readers better.

So far, there are not so many readers to get back to me and share with me their reading experience.

What is my motivation to work on interviewer on mock interview?

Oct. 17, 2019

Introduction


I had a talk with a project manager from interviewing.io a few days ago, and then I learned a few things from our conversation, and I also answered a few questions in order to stay on track as an interviewer.

What is my motivation to be an interviewer?


I am a single person, I have freedom to decide what to do in the evening without considering others. I do not have relatives in Canada. I do not have kids. So definitely it is a good idea for me to work on algorithm interview. To be an interviewer, it is not an easy task. I worked on pramp.com over 300 times, I knew how tough it can be first 300 interviews.

Interviewing.io has a few good features, there is a replay feature, recording of all transcripts. It is easy for me to learn from own mistakes and experience, I can replay the interview any time.

I know that it takes a lot of wisdom to have strong confidence to work on algorithm and data structure. I have to push myself to learn from people all over the world. So I definitely like to be an interviewer, and then I can be open to the world from algorithm lover, and top problem solver.

My problem

I got complaint from the interviewees. How do I solve the problem? I was compromised to give out tough score. In fact, I did not use score 1 and 2, I only apply score 3 and 4.

I was told that if I apply full spectrum of the score, I will get respect from interviewees. If I give interviewee score 4 out of 4, then he/ she has this false confidence. If I work for Microsoft, do I like to work with the person together or not?

So after the talk, I have to figure out how to lower the rating, only pass 2 out 10 people in my mock interviews as an interviewer.

Smart People Should Build Things

Here is the link.


How Domino's Is Winning The Pizza Wars

Here is the link.


The Rise And Fall Of Subway

Here is the video.


The Rise Of Chick-fil-A

Here is the link.

Chick-fil-A is now the third largest restaurant chain by system-wide sales. Its ascent has been so rapid that other fast-food brands are taking note of its unique business model. Popeyes recently launched its own chicken sandwich leading the two brands into a social media war. But how is it that a restaurant that's ensnared in controversy, and closed on Sundays, next in line to overtake Starbucks and McDonald's?

Why Bed Bath & Beyond Is Facing Extinction

Here is the link.

It is time of year and I like to spend time to review more business. One idea is to learn how to choose individual stock to purchase in the future, and also I need to learn how to do business analysis and see what are inside the analysis.




Monday, October 14, 2019

I Will Teach You To Be Rich by Ramit Sethi - How You Become Rich

Here is the link.


7 Tips to Take Your Personal Brand to Celebrity Status

Here is the article. I like to read the article and write down my thoughts as well.


Why DocuSign Stock Jumped 32% Last Month

Here is the article.

I like to research on individual stock, so that I can invest $1000 dollars for 10 to 20 years long term. I had a phone screen from recruiter this year and also a phone screen. I like to learn more about business.


Growing Wealthier - 20 Ways to Raise your Value

Here is the link.

Douglas Kruger is the author of 'Poverty Proof: 50 Ways to Train your Brain for Wealth,' and 'Is Your Thinking Keeping You Poor: 50 Ways the Rich Think Differently'. Here, he shares 20 ways to raise your value, in order to change your financial trajectory and get rich. All of these answers are within your control, and do not rely on any 'get rich quick' scheme.

Book review:
Poverty proof - 50 ways to train your brain for wealth Douglas Kruger

Raise your value
-

9 Reasons Why 99% of People Are Poor & How to Be Rich

Here is the link.

1. Most people put today's happiness before future financial needs
2. Most people don't know where their money is going.
3. Most people focus on saving money and not on earning money
4. Most people don't separate wants from needs
5. Most people are trying to have it all
6. Most people don't have a money plan
7. Most people are blocking wealth with their thinking
8. Most people live above their means
9. Most people always works for somebody else




9 Ways to Be Good With Money - Why You Are Always Broke

Here is the link.




7 Types of Income Millionaires Have [How the Rich Make Money]

Here is the link.


1. Earned income 2. Profit income 3. Interest income 4. Dividend income 5. Rental income 6. Residual and royalty income 7. Capital gains


Active income - exchange time with the money. 



7 Hidden Lessons In Rich Dad Poor Dad

Here is the link.


#1 Money or the lack of money is a result of your emotions
#2 The rich does not work for money. Work to build skills.
#3 The rich do not work for money
#4 You come first!
#5 You become what you study
#6 Become wealthy. Not just rich
#7 Become financially literate

Assets vs liabilities
How the rich avoid taxes?

How millionaire becomes millionaire?
Average people, time -> average people, average TV
dedication - financial success -> study those who have done it.

Assets -> Invest in a cash flow generating asset - vs $1400/ month for a car payment

My assets buy my liabilities ->
Assets & liabilities
Gross or Net revenue
ROI
Income & expenses
Overhead costs
Understand your current finances
What was 1 idea that resonated with you the most about the video.

Rich Dad Poor Dad Summary (Animated)

Here is the link.


The 3 Ways To Become A Millionaire

Here is the link.


The 8 RULES of MONEY

Here is the link.

1. Money does grow in trees (Investments) 2. There is no limit to how much you can spend 3. Money is a lifelong game 4. Money won't solve your insecurities 5. Don't let anyone know that you have money 6. Greatest wealth transfers happen during crises 7. Your expenses will keep growing 8. Wealth accumulates gradually

My 8 RULES of MONEY Rule #1 – Money is Knowledge Rule #2 – Learn how to use debt Rule #3 – Learn how to control cash flow Rule #4 – Prepare for bad times and you will only know good times Rule #5 – The need for speed Rule #6 – Learn the language of money Rule #7 – Life is a team sport. Choose your team carefully Rule #8 – Since money is becoming worth-less and less, learn to print your own


What Truly Separates The Rich From The Poor

Here is the video. I like to take some notes and then spend time slowly thinking about every idea.

In the world we live in today, the richest 1% of the population controls 48% of the total wealth and the top 80 richest individuals are worth as much as half the world’s population or roughly 3.5 billion people. When considering these figures, there is no doubting the fact that there is a separation between the rich and the poor. While many people assume these wealthy individuals gained their wealth by being born into wealth or winning the lottery, that simply isn’t true. In fact, only 11 out of the 80 richest individuals were passed down their fortunes with the other 69 having made their wealth through their own hard work and determination. And one of these 69 individuals is none other than the investor mogul himself, Warren Buffett. Like the majority of these rich individuals, Warren Buffett grew up in a middle-class family but found a way to amass the knowledge and skills that would eventually lead him to accumulating a wealth of over $70 billion.

Rich John vs poo Tim, similar IQ, same city,

Tim watches show.
John work on credentials.

Rich never stops learning -> Tim complained about $100 bonus. John got $10,000 check in his name.

Difference number 2:
Rich sells value, poor sells time

Difference number 3:
The rich pays them first, poor pays them last.
TV costs $1,000 for Tim, at a cost of $500 for play station.

Difference number 4:
The rich has growth mindset, the poor has fixed mindset.

Difference number 5:
Delay gratification - the rich understands the delay gratification.

Difference number 6:
The rich build a stream of income, but the poor does not.

Difference number 7:
The rich surrounds him
Difference number 8:




1. NEVER STOP LEARNING: CONTINUE TO PUT FEW HOURS EVERY NIGHT TO WORK TOWARDS GOAL 2. RICH SELL VALUE POOR SELL TIME: Instead of saying how long you been doing the work, you must ask yourself first what value you are providing. 3. RICH PAY THEMSELVES FIRST WHILE THE POOR PAY THEMSELVES LAST: With this rich strategy you will always have some savings at the end of the month. 4. RICH HAVE A GROWTH MINDSET WHILE THE POOR HAVE A FIXED MINDSET: Instead of cursing anybody why you don’t have money, always think of how you can earn more to get what you want. 5. RICH UNDERSTAND THE POWER OF DELAYING GRATIFICATION WHEREAS THE POOR SEEK SHORT TERM PLEASURE: Delaying instant gratification beat out many of the more traditional signals including age, race, ethnicity and height 6. RICH BUILD SEVERAL STREAMS OF INCOME WHILE THE POOR RELY ON ONLY ONE: Never keep all eggs in one basket if the basket is gone then lose everything. 7. RICH SURROUND THEMSELVES WITH OTHER RICH PEOPLE WHEREAS THE POOR SURROUND THEMSELVES WITH OTHER BROKE INDIVIDUALS: You tend to get more ideas of making money from other rich individuals.

Inside Jessica Alba's $10M Los Angeles Home | Open Door | Architectural Digest

Here is the link.


My 10th Canada thanksgiving day in the city of Vancouver

I like to choose something to watch beside stock, investment, algorithm. I chose the video to visit Nicole home in Los Angeles.

Here is the video. Now it is 10:30 AM. I am watching the video second time. I just like Nicole to be my voice teacher. I like the singer and her presentation.

I like to watch a few times. And I am dreaming of owning something in Canada as well. I like to be frugal, and then Nicole explains in the video with so touching voice, I really enjoy to watch, and learn the taste her sense of art, her choices of furniture, space, art, and also small pool and swing inside house.

I am stubborn, this morning I went to bed around 1:00 AM, and then I woke up around 4:00 AM, went to bathroom, and wrote a few words on wechat. It was so interesting day. Canada day.

I like to make a so beautiful day - my 10th Canada day in the city of Vancouver.

Inside Nicole Scherzinger's LA House with a Cozy Home Theater | Open Door | Architectural Digest

Here is the video I like to watch a few times. And I am dreaming of owning something in Canada as well. I like to be frugal, and then Nicole explains in the video with so touching voice, I really enjoy to watch, and learn the taste her sense of art, her choices of furniture, space, art, and also small pool and swing inside house.

I am stubborn, this morning I went to bed around 1:00 AM, and then I woke up around 4:00 AM, went to bathroom, and wrote a few words on wechat. It was so interesting day. Canada day, not Canada day. It is Canada thanksgiving day.

I like to make a so beautiful day - my 10th Canada day in the city of Vancouver.




Youtube - x code

Here is the link.


Sunday, October 13, 2019

What to learn after 10th year on the same job?

Oct. 13, 2019

Introduction


It is 10th year I work full time in the same factory. I started from June 15, 2010, now it is 2019, October. What I should learn after 10th year on the same job?

Personal finance


I spent most of time this year to learn personal finance. This year is 10 year bull market, I put all my IRA CD back to stock market, and also set up a Canadian TFSA account and start to learn to stay in market.

One idea I learn is not to time the market. The time in the market is more important. Also I need to spend time to watch videos, read articles. One idea is to watch Google talk given by those hedge fund manager or fund manager, and then I start to read more articles, and learn some basics.




Don Yacktman: A fund manager’s faith produces results

Here is the article. I like to read it quickly.

He waits to buy great companies when they’re down and rides them until they recover, which great companies almost always do. You don’t need to jump in and out of stocks, he tells them. “You just need to catch the wind enough times,” he says. “And you need to be very, very patient.”

Donald Yacktman: "Viewing Stocks as Bonds" | Talks at Google

Here is the video I like to watch.

Drawing on his four decades of experience, Don Yacktman identifies the three key characteristics of value stocks. In this talk, he shares his investment philosophy along with the lessons he has learned from the markets and from life.

Invest Like A Guru And Avoid Value Traps

Here is the article. I plan to read it and spend 10 minutes to look into things I should learn.


I am a learner - investment is my second hobby

Oct. 13, 2019

Introduction

Hard work beats talent when talent fails to work hard. I choose to continue to study investment through Google talk, and then I prepare one day I can grow myself in terms of understanding market, US economy, personal finance, and also keep myself busy learning, find love of making money in my investment. 

First hobby 


One thing a time. I was fascinated by tennis sports last 10 years, so I worked on tennis for a few years, and later I noticed that I need to learn how to control weight, at least I should learn how to lose 20 lbs by research, sports and other techniques. 

I like to keep learning investment this year even though I already set up Victoria and Key Largo portfolio. I know that behavior finance is so important for me to learn; I may not know what I do when the crisis comes. 




How to reduce risk and learn more behavior finance?

Oct. 13, 2019

Introduction


It is so important for me to learn more about behavior finance. I put all my 10 yrs saving in TFSA account and RRSP, and then I am already in the market over 4 months. I like to learn behavior finance, so every time there is crisis I already know what to do based on behavior finance.

Behavior finance


I like to learn more about investment, stock market, behavior finance. I learn the importance of the research and pre-mortem analysis.

I know that it is better for me to spend time to work on algorithm and data structure practice. I already had one onsite from Microsoft (2008), three onsite from Amazon (2016, 2018, 2019), one onsite from Facebook (2019). I can write two algorithms in one hour, one easy, one medium based on my last weekly contest 158.

I should push myself to solve 100 to 200 algorithm on Leetcode.com, play more weekly contest, and also write most posts on Leetcode discuss. I like to learn more through practice. I just turned 53 years old, and also I have the same job over 9 years. I definitely have experience to work as a software programmer.


10 K walk around Stanley Park - Oct. 13, 2019

Oct. 13, 2019

Introduction


It is a tough walk to walk more than 10 K around Stanley park. I have to work on my fitness, and also I need to push myself outside to meet people and learn more things about nature. I started around 11:00 AM, and it took me more than four hours to walk Stanley park. It is such great experience.

My fitness and my walk 


I like to document my walk and a few things I learn through the walk.

1. Be open to visitors from the world. Offer help, chat with people, walk with others if I can.
2. Stay safe, stay hydrated. I brought with me a bottle of water, and I can refill it in a few places.
3. I also spent time to chat with two young Chinese visiting students in Mount Royal university, they took 12 hours road trip from Calgary to Vancouver.
4. Talk to people on strikes working for hotels. I read the news, I thought about they are bus drivers in Vancouver.

My route 


It took me more than three hours to walk 12 KM. Here is my route.



Take more pictures.

I like to show some pictures. I like to push myself to learn the city of Vancouver.

Expenses:
1. Less than 10 dollars skytrain tickets;
2. Japanese restaurant lunch with friends met on the road trip. $15.00 dollars for Japanese noodle.

I think that it is also important for me to visit downtown more often. One day I may leave Vancouver and work somewhere in silicon valley, so I should visit down town and take skytrain once a week at least.

1. First time I tried my Google hat. I got a gift bag from Google GHC meeting in Seattle Oct. 4, 2019.


2. Learn one more cruise boat - I looked down and cruise name is blocked by me. I tried to wear as less as possible. Only two layers to keep warm.

3. Celebrity Eclipse - what a cruise name, I like the cruise. I like to track how many gray hairs I have.

One more cruise -

I like the maple leave, just after the short talk to people on strike near hotel near the beach.



Thomas Russo: "Global Value Investing" | Talks at Google

Here is the video.

“I consider myself to be a farmer—not a hunter. And I think most people on Wall Street are hunters. They like to fell big beasts and I’m very comfortable planting a few rows and just tending to them carefully.” - Thomas Russo About the Talk Mr. Russo looks forward to describing how that in his pursuit of long-term tax-deferred investment returns that he has favored investments in businesses whose global brands are well-position companies for reinvestment of mature market free cash flow into developing and emerging markets. Mr. Russo’s businesses accordingly possess the “capacity to reinvest” and managements who have the “capacity to suffer” when investments properly intended for longest term increase in intrinsic value on a per share basis burden as they often do, reported earnings in the near term. This tradeoff between near-term pain and long-term gain is at the heart of his investments when properly executed, the benefit for taxable investors is the ability to build portfolio companies whose return are long term and tax deferred.

Saturday, October 12, 2019

Quora: How do I write an excellent discussion post for a hard level algorithm on leetcode.com?

Here is the question I asked, and then I also wrote an answer. I figured out if I like to share my experience of Leetcode.com, I better ask my own question and then write the answer. If I answer one of existing questions, I may be marked as a suspect of spam.


1223. Dice Roll Simulation

I like to learn the algorithm this long weekend. I already spent over 20 minutes to think about the problem in weekly contest 158.


weekly contest 158

Oct. 12, 2019

Introduction


It is my favorite weekly contest. I played the contest and then I solved the first two algorithms. I spent near 30 minutes to work on the third algorithm, a medium algorithm, but I could not come out the solution. I thought about using recursive function, make it really simple.

Performance


 I like to show my performance. I also have to push myself hard to solve the second medium algorithm in weekly contest.



Case study: What is value of my IRA portfolio based on 2001 purchase?

Oct. 12, 2019

Introduction


It is time for me to evaluate my portfolio back in 2001. I already spent over 11 months to study personal finance, so I already have learned so many things in terms of investment, I like to write down my analysis, and see how much I may have gained through the portfolio.

Case study


Let me upload my portfolio based on my personal finance repository on github.


The most important is not to time the market, instead it is time to stay in the market. I sold those IRA mutual fund and stock, and then open IRA CD account in Amtrust bank instead.

What I like to research is to figure out the market value for those funds and stocks if I keep them from 2001 to 2019.


If You Had Invested Right After Cisco's IPO

Here is the article.

If you had sold your Cisco shares during the height of the dot-com bubble (2001), your initial IPO investment of $1,000 would have been worth $1.264 million, representing a CAGR of over 104%.

As the dot-com bubble began to burst, Cisco lost 80% of its value from March 2000 to March 2001. As of February 2018, the company still trades nearly 50% below its all-time high.


Dividend Reinvestments


The company began paying a dividend in 2011 after pressure from shareholders. Reinvestment of dividends would not have had a significant impact on your CAGR since they have only been paid for a short period of time and missed the extremely high-growth years. In comparison, Coca-Cola has been paying a quarterly dividend since 1920, which has aided its annual growth rate by over 4.2%.
Updated Aug 6, 2018
Since the recession of 2008 the company’s stock has doubled, it initiated its quarterly dividend program, and it has made massive share repurchases. 

Apple Is Worth $1,000,000,000,000. Two Decades Ago, It Was Almost Bankrupt.

Here is the article.


If you invest $1000 Apple IPO stock back in 1980

A $1,000 investment in Apple on the day of its IPO on December 12, 1980, would be worth more than $425,000 today, according to CNBC calculations.

Founded in 1976, Apple went public four years later in December 1980, an event the Wall Street Journal described as “one of the most eagerly awaited in recent years.”

Apple’s 4.6 million shares went for $22 each and sold out “almost immediately,” EDN reports. The stock rose more than 30 percent that day and closed at $29 per share.

However, despite its early success, Apple struggled through much of the 1980s and 90s. In 1985, the company ousted its famously volatile co-founder Steve Jobs and began to falter in the market. It fell behind its competitors, including Microsoft, thanks to a string of failed products and turnover at the top.

By 1997, Apple was on the brink of bankruptcy and forced to lay off a third of its workers. As a last-ditch effort, it rehired Jobs and named him interim CEO. Jobs vetoed the majority of Apple’s production plans at the time and implemented a new focus on simplicity.

Under his leadership, the company released the iMac G3 in 1998, which brought Apple back to prominence. Jobs followed that with the release of the iPod in 2001 and the iPhone in 2007. The iPhone quickly became a top seller and revolutionized how customers use technology.

Today, Apple is a force to be reckoned with: In August, the technology giant became the first public U.S. company to reach a $1 trillion market cap after the stock briefly hit $207.05 per share. The surge allowed the software company to reach that milestone ahead of e-commerce giant.


Case study: MSFT stock purchase December 2001

Oct. 12, 2019

Introduction


It is time for me to do a short case study on MSFT stock.

Case study


I bought Microsoft stock back in 2001, and I paid price around $60.00 dollars; and then I sold as a loss after a year or two. 

Here is my personal finance log related to stock purchase. 

If you invested $1,000 in Microsoft and Apple at IPO, this one would have made you 4 times as rich

A $1,000 investment in Apple on the day of its IPO on December 12, 1980, would be worth more than $425,000 today, according to CNBC calculations. However, a $1,000 investment in Microsoft on the day of its IPO on March 13, 1986, would be worth more than $1.7 million, or around four times more.
Those figures include price appreciation and dividends. Returns also account for stock splits and other corporate events.

Microsoft 


Microsoft’s popularity began to wane in the early 2000s as it released a string of unpopular products and failed to keep up with modern trends but, when Satya Nadella took over as CEO in 2014, he oversaw a major turnaround.

Since Nadella took over, Microsoft’s share price has nearly tripled. In November, it dethroned Apple as the most valuable public company in the world, with a market cap of more than $850 billion. If Microsoft holds onto the spot through the end of the year, it will mark the first time since 2002 that the company closes out in the top position.

From 2014 to 2019, the stock of Microsoft tripled. 

Since Nadella took over, Microsoft’s share price has nearly tripled. In November, it dethroned Apple as the most valuable public company in the world, with a market cap of more than $850 billion. If Microsoft holds onto the spot through the end of the year, it will mark the first time since 2002 that the company closes out in the top position.

Friday, October 11, 2019

How many hours Youtube videos I watched last 12 months?

Oct.11, 2019

Introduction


I like to figure out how many hours I spent to watch on youtube.com since I decided to study personal finance.

If you invested $1,000 in Microsoft in 2009, here’s how much you’d have now

Here is the article.

If you had invested in Microsoft 10 years ago, that decision would have paid off. According to CNBC calculations, a $1,000 investment made on April 25, 2009, would be worth nearly $8,000 as of midday April 25, 2019, for a total return of almost 700%.

Over the same period, the S&P 500 returned just over 300%.

And Microsoft’s stock is trending up: It ended Thursday with a gain of more than 3% after earlier in the day briefly surging 5% to a $1 trillion market cap. Revenue climbed 14% to $30.6 billion, beating the $29.84 billion estimate.