Sunday, July 19, 2020

Leetcode discuss: 332. Reconstruct Itinerary

Here is the link.

C# DFS algorithm with tough decisions to make

July 18, 2020
Introduction
It is my preparation for phone screen from Facebook on July 20, 2020. I like to work on leetcode mock interview phone screen mock interview nonstop for two days.
I came cross this algorithm, and it took me more than two hours to make it work. I want to say something: "Being a programmer, most important is to be patient, and also observe what happens using Visual Studio".
I learned so many lessons from those few hours. I like to write a simple solution, so I tried a few ideas and failed all the way until I figured out the simple one.
Here are highlights:
  1. More than one ticket for same start and dest cities. For example, JFK to NRT, there are two tickets.
  2. I tried to use C# Dictionary<string, SortedSet>, I ran into failed test case, so duplicate allows, SortedSet cannot be used;
  3. I tried to use C# LinkedList, but I had problem to put it back after failed DFS search. I chose to use LinkedList RemoveFirst, AddFirst API, it does not work for back tracking.
  4. I tried to use HashSet to make unique ticket like "JFK"+"NRT". Because two tickets are available for same ticket, I have to use original hashMap to mark visit.
  5. I also spent over 15 minutes to figure out that variable found as List is empty and I have to add ref.
  6. List is used, and then apply Sort API; Later List.RemoveAt index position, and then List.InsertAt index position position; So all destination are sorted in lexicographically order.
  7. Play with base case - all tickets are used and only used once.
Performance
It should take me less than 25 minutes, but I took over 100 minutes to play with the code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace airlineTickets
{
    class Program
    {
        static void Main(string[] args)
        {
            RunTestcase3(); 
        }

        public static void RunTestcase1()
        {
            // [["MUC","LHR"],["JFK","MUC"],["SFO","SJC"],["LHR","SFO"]]
            var tickets = new List<IList<string>>();

            tickets.Add(new List<string>() {"MUC", "LHR" });
            tickets.Add(new List<string>() {"JFK", "MUC" });
            tickets.Add(new List<string>() {"SFO", "SJC" });
            tickets.Add(new List<string>() {"LHR", "SFO" });

            var result = FindItinerary(tickets);
        }

        public static void RunTestcase2()
        {
            var tickets = new List<IList<string>>();

            tickets.Add(new List<string>() {"EZE","AXA" });
            tickets.Add(new List<string>() {"TIA","ANU" });
            tickets.Add(new List<string>() {"ANU","JFK" });
            tickets.Add(new List<string>() {"JFK","ANU" });

            tickets.Add(new List<string>() {"ANU","EZE" });
            tickets.Add(new List<string>() {"TIA","ANU" });
            tickets.Add(new List<string>() {"AXA","TIA" });
            tickets.Add(new List<string>() {"TIA","JFK" });
            tickets.Add(new List<string>() {"ANU","TIA" });
            tickets.Add(new List<string>() {"JFK","TIA" });            

            var result = FindItinerary(tickets);        
        }

        public static void RunTestcase3()
        {
            var tickets = new List<IList<string>>();

            // [["JFK","KUL"],["JFK","NRT"],["NRT","JFK"]]

            tickets.Add(new List<string>() { "JFK","KUL" });
            tickets.Add(new List<string>() { "JFK","NRT" });
            tickets.Add(new List<string>() { "NRT","JFK" });                  

            var result = FindItinerary(tickets);
        }

        public static IList<string> FindItinerary(IList<IList<string>> tickets)
        {
            // the idea is to run a DFS search
            // keep all tickets into a hashmap
            // path - find first path then return
            // hashMap - C# Dictionary<string, SortedSet<string>>
            if (tickets == null || tickets.Count == 0)
            {
                return new List<string>();
            }

            var count = tickets.Count;
            // ANU->TIA two tickets
            var map = new Dictionary<string, List<string>>();
            foreach (var item in tickets)
            {
                var start = item[0];
                var dest  = item[1];
                if (!map.ContainsKey(start))
                {
                    map.Add(start, new List<string>());
                }

                map[start].Add(dest);
            }

            foreach(var key in map.Keys)
            {
                map[key].Sort();                 
            }

            var path = new List<string>();
            var found = new List<string>();
            
            path.Add("JFK");

            runDFSSearch(map, 0, count, "JFK", path, ref found);

            return found;
        }

        /// DFS - mark visited
        /// backtracking
        /// check the final length 
        private static void runDFSSearch(
            Dictionary<string, List<string>> map,
            int index,
            int total,
            string start,
            List<string> path,
            ref List<string> found)
        {            
            if (found.Count > 0)
            {
                return;
            }

            // all the tickets used once and only once
            if (map.Count == 0)
            {
                found = path.ToList();
                return;
            }

            if (!map.ContainsKey(start))
            {
                return;
            }

            var destCities = map[start];
            var copy = new List<string>(destCities);

            for (int i = 0; i < copy.Count; i++ )
            {
                var dest = copy.ElementAt(i);

                path.Add(dest);
                map[start].RemoveAt(i);
                if (map[start].Count == 0)
                {
                    map.Remove(start);
                }

                runDFSSearch(map, index + 1, total, dest, path, ref found);

                // backtracking
                path.RemoveAt(path.Count - 1);
                if (!map.ContainsKey(start))
                {
                    map.Add(start, new List<string>());
                }

                map[start].Insert(i,dest);
            }
        }
    }
}

Leetcode discuss: 304. Range Sum Query 2D - Immutable

Here is the link. 

C# preprocess matrix to calculate left top corner area

July 19, 2020

Introduction
In order to get O(1) to answer the query given start left top corner and bottom right corner, it is a good idea to preprocess the left top corner area for any position in the matrix.

My practice
It took me over 20 minutes and reviewed the code since one failed test case. My first submission failed since the cross area is related to (row1 - 1, col1 - 1), not (row1, col1).

public class NumMatrix {
    private int[][] rectangle; // from (0,0) to (i, j) rectangle sum
    private int rows, columns;
    public NumMatrix(int[][] matrix) {
        if(matrix == null || matrix.Length == 0 || matrix[0].Length == 0)
            return;
        
        rows = matrix.Length;
        columns = matrix[0].Length; 
        
        rectangle = new int[rows][];
        for(int i = 0; i < rows; i++)
        {
            rectangle[i] = new int[columns];
        }
        
        for(int row = 0; row < rows; row++)
        {
            for(int col = 0; col < columns; col++)
            {
                var left = col > 0? rectangle[row][col - 1] : 0;
                var upper = row > 0? rectangle[row - 1][col] : 0;
                var cross = (row > 0 && col > 0)? rectangle[row -1 ][col - 1] : 0;
                rectangle[row][col] = matrix[row][col] + left + upper - cross;
            }
        }
    }
    
    public int SumRegion(int row1, int col1, int row2, int col2) {
      if(row1 < 0 || row1 >= rows || 
         row2 < 0 || row2 >= rows || 
         row1 > row2 ||
         col1 < 0 || col1 >= columns ||
         col2 < 0 || col2 >= columns ||
         col1 > col2)
          return -1; 
        //            whole - left - up + cross              
        var area = rectangle[row2][col2]; // whole
        area -= col1 == 0? 0: rectangle[row2][col1 - 1]; // left
        area -= row1 == 0? 0: rectangle[row1 - 1][col2]; // up
        area += col1 == 0 || row1 == 0? 0: rectangle[row1-1][col1-1]; // cross
        
      return   area;         
    }
}

/**
 * Your NumMatrix object will be instantiated and called as such:
 * NumMatrix obj = new NumMatrix(matrix);
 * int param_1 = obj.SumRegion(row1,col1,row2,col2);
 */


Leetcode discuss: 935. Knight Dialer

Here is the link.

C# Need to move fast

July 18, 2020 10:36 PM
Introduction
I am preparing for Facebook phone screen on July 20, 2020. One thing I have to work on is to move fast. I will be measured how fast I can solve the problem.
I am working on this marathon on Leetcode phone mock interview, the idea is to push myself to move fast, solve as many algorithms as possible.
First I need to get myself under this drill, work on algorithm problem solving non-stoppable for 10 hours at least.
I came cross this algorithm as the second one, I remembered that I solved the problem before.
How to analyze?
It took me over 20 minutes and then I knew that it can be solved using DFS or BFS algorithm for N step. And I thought about there is no need for each path. All we need is the total count.
Another thing is that intermediate steps are also only 10 digits. The array is good enough for me to build recurrence formula. I need to count number for each digit for each step.
DFS/BFS -> 10 digits each step -> Simple recurrence
It should take me less than five minutes to spot the pattern. But it did take me 20 minutes or so.
When to code?
After over 40 minutes, I started to code the solution; First I define the hashset array, and then map digit 0 - 9 to next step, cross 1x2 or 2x1, eight directions.
Performance
It is hard for me to push myself. It is interesting to learn that I gained some confidence after two hour solving a problem this afternoon. Here is the discuss post I shared. It was tough for me to be patient to solve it after failing so many times.
Facebook phone screen advice
I like to share those four things to work on when I practice through mock interviews:
As a reminder, please keep these 4 criteria in mind during your technical interview:
  1. Communication: Ask clarifying questions around the problem before solving
  2. Speed: One of our values here is moving fast
  3. Verification and testing: bug free as possible, talking through edge cases
  4. Problem-solving: Finding a working solution
public class Solution {
    public int KnightDialer(int N) {
        // DFS -> only 10 digits each step - using array to represent 
        // 
        if( N <= 0 || N > 5000)
            return -1; 
        
        var map = new HashSet<int>[10];
        for(int i = 0; i < 10; i++)
        {
            map[i] = new HashSet<int>(); 
        }
        
        map[0] = new HashSet<int>(new int[]{4, 6});
        map[1] = new HashSet<int>(new int[]{6, 8});
        map[2] = new HashSet<int>(new int[]{7, 9});
        map[3] = new HashSet<int>(new int[]{4, 8});
        map[4] = new HashSet<int>(new int[]{0, 3, 9}); 
        //map[5] = new HashSet<int>(new int[]{});
        map[6] = new HashSet<int>(new int[]{0, 1, 7});
        map[7] = new HashSet<int>(new int[]{2, 6});
        map[8] = new HashSet<int>(new int[]{1, 3}); 
        map[9] = new HashSet<int>(new int[]{2, 4}); 
        
        var previous = new long[10];
        var current = new long[10];
        
        var number = 1000 * 1000 * 1000 +7;
        
        for(int i = 0; i < N; i++)
        {            
            if(i == 0)
            {
                for(int j = 0; j < 10; j++)
                {
                    current[j] = 1; 
                }                              
            }
            else 
            {
                for(int j = 0; j < 10; j++)
                {
                    var set = map[j];
                    foreach(var item in set)
                    {
                        current[item] = (long)(current[item] + previous[j]) % number;
                    }
                }
            }                 
            
            // reset current array
            for(int j = 0; j < 10; j++)
            {
                previous[j] = current[j];
                current[j] = 0; 
            }
        }
        
        return (int)(previous.Sum() % number); 
    }
}


Mock interview: Clone graph

Here is the link.



Continue

Leetcode phone screen mock interview: Weekend marathon

I like to push myself hard to practice leetcode phone screen mock interview algorithms nonstop whole weekend.

This is the first time I do that. I like to move fast and prepare for Facebook phone screen in less than one week.










Friday, July 17, 2020

1376. Time Needed to Inform All Employees

1376. Time Needed to Inform All Employees

Here is the link.


C# Optimal solution using stack


uly 17, 2020
Introduction
It is the second algorithm in my Leetcode phone screen mock interview. I like to write down my thought process and think about how to expedite my problem solving thinking about using stack.
Case study
It is a good idea to talk about the solution using a test case. For example,
[1, -1, 1], and informTime array is [0, 1, 0]. How to solve the problem?
I think that it is most important for me to use an array time[] to mark visited nodes in the tree and also avoid recalculation same nodes again and again.
The quickest way is to start from any employee id, and then go through its parent node - manager id until the one solved with time[employee id]. Stack is very helpful to reverse the order, so that calculation can start from parent node in the tree first, go down child node.
First of all, set array time default value -1. And also set headId time value = 0;
Go over the test case, start from employee id = 0, time[0] = -1, so push it to the stack, manager[0] = 1, time[1] = 0. So parent node of employee id = 0 is solved already.
Next pop up nodes from stack, one by one calculate the time based on time[parent node] and informTime[parent node id].
I will add more later to make this practice more helpful for me to review.
Time complexity
It is a tree traversal algorithm, since every edge is visited once only, so it is the optimal solution.
Time complexity is O(N), N is total number of nodes.
Space complexity
Since maximum height of tree is O(N), N is total number of nodes. So space complexity worst case is O(N), average case is height of tree, O(logN).
The stack is used to store the path from leaf node to root node.
public class Solution {
    public int NumOfMinutes(int n, int headID, int[] manager, int[] informTime) {
         if(n < 0)
            return 0; 
        
        var time = new int[n];
        for(int i = 0; i < n; i++)
        {
            time[i] = -1; 
        }
        
        time[headID] = 0; // need no time
        
        for(int i = 0; i < n; i++)
        {
            var current = manager[i]; 
            if(time[i] != -1)
            {
                continue; 
            }
            
            // push current id and it's parents not solved into stack. 
            var stack = new Stack<int>(); 
            stack.Push(i);
            
            while(time[stack.Peek()] == -1)
            {
                var next = manager[stack.Peek()]; // 2
                if(time[next] == -1)
                {
                    stack.Push(next);
                }
                else 
                {
                    break; 
                }
            }
            
            var parentId = manager[stack.Peek()]; // 0
            var parentTime = informTime[parentId]; //1
            while(stack.Count > 0)
            {
                var child = stack.Pop(); // 0
                time[child] = time[parentId] + parentTime; // 1
                
                // reset
                parentId = child; 
                parentTime = informTime[parentId];
            }
        }
     
        return time.Max(); 
    }
}

Why does a good researcher not make money on stock investment?

July 17, 2020

Introduction


Market is so volatile recently, and there are so many chances to catch 10% return in one day or three days. Oil stock and hotel stock, and cruiseline etc. Why does a good researcher not make money on stock investment?

Case study


I think that there are a few things I like to look into.

Pay attention to what I should do. When I should do? Market swings, buy low and sell high. I have to discipline myself to sell when market is high, and then buy when it is low.

I have to control my emotions. When I am stressed and worried, it is time for me to purchase more shares. Therefore I can sell when the price rebounds.

Do not worry about too much. Since I already purchase high price with loss over $700 dollars on SABR, ENBL, HSE.TO, why I worry about purchase at the lowest price of month.

Choose stocks to hold on long term, and also play short term swings.

Enjoy the adventure!

Sabr stock: July 14 16% up, July 15 6% down, July 16 2.5% down

July 17, 2020

Introduction

It is tough for me to understand that SABR stock went up with other stocks like CCL (20% up), 13% up in one day.  I like to write a short research what I should do as an investor. 

Sabr stock

I like to use IRA account $8000 dollars next time to bet on two digit increase in one day, and then purchase 1000 shares. It was lowest price over one month, I did purchase $300 share at price of $10.00 dollars. 




HST stock:



Host Hotels & Resorts, Inc. is an S&P 500 company and is the largest lodging real estate investment trust and one of the largest owners of luxury and upper-upscale hotels. The Company currently owns 75 properties in the United States and five properties internationally totaling approximately 46,500 rooms. The Company also holds non-controlling interests in six domestic and one international joint ventures. Guided by a disciplined approach to capital allocation and aggressive asset management, the Company partners with premium brands such as Marriott, Ritz-Carlton, Westin, Sheraton, W, St. Regis, The Luxury Collection, Hyatt, Fairmont, Hilton, Swissôtel, ibis and Novotel, as well as independent brands


HST stock: Host Hotels (HST) Suspends Q2 Dividend to Preserve Liquidity

Here is the article.

Host Hotels & Resorts, Inc. HST announced a temporary suspension of the quarterly cash dividend, starting with the June-end quarter dividend that would have been paid out in July 2020.
The company anticipates this to preserve around $140 million of cash during the April-June period.
Earlier, it paid out a dividend of 20 cents per share on Apr 15 to stockholders of record s of Mar 31, 2020.
Per management, the decision to suspend the quarterly dividend comes as a measure to preserve liquidity and maintain balance sheet flexibility. Nonetheless, the board will continue to keep an eye on the company’s financial performance and operating scenario to decide the correct time to restart dividend payments.
Notably, it has been making efforts to improve its liquidity to navigate the impact of business challenges posed by the pandemic. In fact, during the first quarter, it drew down the entire $1.5-billion capacity on its revolver in a bid to boost the cash position. Additional measures to improve liquidity included reductions in corporate expenses by 10-15%, capital expenditure reduction by $100-$125 million and temporary suspension of future stock repurchases.


Real estate stock: PEB competitors

July 17, 2020

I like to look into PEB stock, and then I have over 20 minutes to look into those stocks as well.

SUBSECTOR ANALYSIS PEBBLEBROOK HOTEL TRUST falls within the Real Estate, Rental and Leasing sector and the Lessors of Real Estate industry group of the North American Industry Classification System or NAICS. More precisely, a significant portion of company activities involve Lessors of Nonresidential Buildings (except Miniwarehouses).

TheStreet Quant Ratings is currently tracking 285 companies in the Real Estate, Rental and Leasing sector that total around $1,426 billion in market capitalization as well as $352 billion in annual sales.

The Real Estate subsector accounts for 74.1% of those revenues.

Industries in the Real Estate subsector group establishments primarily engaged in renting or leasing real estate to others; managing real estate for others; selling, buying, or renting real estate for others; and providing other real estate related services, such as appraisal services. This subsector includes equity real estate investment trusts, or REITs, primarily engaged in leasing buildings, dwellings, or other real estate property to others. PEER GROUP: Real Estat



PEB stock: 38.00% loss since June 5, 2020

July 17, 2020

Here is the webpage to look into.

Pebblebrook Hotel Trust (NYSE: PEB) is a publicly traded real estate investment trust ("REIT") organized in December 2009 to opportunistically acquire and invest in upper upscale, full service hotel and resort properties located in or near urban markets in major United States gateway cities.

Our mission is to deliver long-term industry-leading total returns to our shareholders, including a reliable stream of income, through opportunistic investment in high-quality lodging properties, utilizing a conservative capital structure.  We aim to achieve this mission through investing based on extensive research; focusing on properties with operational and redevelopment opportunities;  and staffing for intensive asset management and operational involvement.

We have elected and are qualified to be taxed as a REIT for federal income tax purposes and operate as an internally managed and administered REIT.  As a REIT, we hold interests in real estate assets and strive to reduce our federal taxable income by distributing a significant portion of our federal taxable income in the form of taxable dividends to our shareholders.  The Company currently pays a quarterly dividend to its common shareholders.

COMPANY DESCRIPTION Pebblebrook Hotel Trust (NYSE: PEB) is a publicly traded real estate investment trust ("REIT") and the largest owner of urban and resort lifestyle hotels in the United States. The Company owns 56 hotels, totaling approximately 14,000 guestrooms across 16 urban and resort markets, with a focus on the west coast gateway cities. PEBBLEBROOK HOTEL TRUST 4747 Bethesda Avenue, Suite 1100 Bethesda, MD 20814 USA Phone: 240-507-1300


Thursday, July 16, 2020

10 things makes my life style change - after market crashed in March 2020

July 16, 2020

Introduction


It is important for me to lead a wechat investment group on wechat, I like to push myself to be a good role model for others JTU alumni.

10 things makes my life style change


I like to enumerate those changes one by one. I like to continue to learn and be patient to my own mistakes.


  1. Get up early around 6:15 AM starting from July 1, 2020. I built a wechat group, and we all get up early to watch the market;
  2. Get smart on morning hours; instead of watching all the time, I spend some time cooking, have nutrition meal, write a few blogs; and also analyze the market to find investment opportunities;
  3. Understand USA business better. 
  4. Get familiar with yahoo finance portfolio; 
  5. Get more familiar with Ameritrade.com all product features related to stock, post market sale or hours to work on trade;
  6. Get used to communicate with multiple people about market; 
  7. Stop worry about market and loss/ gain on portfolio so often;
  8. Live a frugal life style; Enjoy the trading time early in the morning before work, and also enjoy work as a software programmer
  9. Document better my learning process on investment
  10. Build connections and help the small community to grow. 

Netflix Earnings And Twitter’s Massive Hack Explained: CNBC After Hours

Here is the link.

CNBC.com's MacKenzie Sigalos brings you the day's top business news headlines. On today's show, CNBC's Eamon Javers and CNBC.com's Steve Kovach team up on a deep dive in to the colossal hack of high profile Twitter accounts. Plus, Netflix earnings, Domino's sales spike, and everything else you missed in business news.

Jim Cramer breaks down Thursday's sell-off, says it was 'pure profit-taking'

Here is the link. 

Excuses to sell on July 16, 2020

"Economy's recovery is derailed" thesis
Stalled reopening
Escalated US-China trade tensions
Uncertain future of work 

Approaching the selloff

Abbott
Pepsico
Morgan Stanley
Johnson Johnson
Facebook
Alphabet
Salesforce
Amazon

Those stocks - 

TSLA, AMZN, APPL, GOOGL, SQ, TTD, SHOP, BABA, NVDA, SE, NIO, CRM, and Bitcoin


Take risk - July 2020

July 16, 2020

Introduction


I like to do a fully research how to prepare for a big investment for short term. I already let over $67,000 dollars cash sit in my TFSA account, but I was afraid to invest HSE.TO when the price was low near $4.06 / share. 

Fear and greedy


I have to look into the fear issue. I should stay confident, if I can invest $15,000 US dollars on SPX 3300 on June 5, 2020. Why should I still be afraid to invest when oil stock price is far below the price I purchase at HSE.TO 4.7/ share 1000 share, 4.5/ share 1000 share. I did sell all those 2000 share at price 4.2. But I had issue to get back in when the price was 4.15/ share. 

I have to look into how to understand the price went up in less than two hours with 10 cents. I should look into how market swings, and make some rules for me to follow. 

I will have to look into how to invest at least $30,000 Canadian dollars when the price drops over 10%, or over 20%.


Former Ford CEO explains why Tesla's stock is growing

Here is the link.

Mark Fields, TPG Capital senior advisor and former Ford president and CEO, joins 'Closing Bell' to discuss Tesla's record run and what could be the future of the company. Subscribe to CNBC PRO for access to investor and analyst insights on Tesla and more: https://cnb.cx/2BT2E7y Tesla shares soared in premarket trading Thursday after the automaker said it delivered about 90,650 vehicles in the second quarter, handily beating Wall Street expectations as the electric car maker’s sales withstood the economic downturn better than most competitors. Analysts expected Tesla to deliver about 72,000 vehicles during the last three months, according to a consensus of analysts surveyed by FactSet. A broader set of analyst estimates, compiled by Bloomberg, set higher expectations — 83,000 vehicle deliveries in the second quarter. Shares of Tesla zoomed nearly 9% to $1,219.02 in Thursday’s premarket, a day after closing 3.7% higher to $1,119.63. Deliveries are the closest approximation of sales numbers reported by Tesla, and the electric car maker’s numbers held up significantly better than its competitors. Tesla’s deliveries fell by just 4.8% from the same quarter last year even as auto sales the world over, and especially in the U.S., slumped during the quarter after Covid-19 outbreaks led to health restrictions on households, travel and businesses, mass layoffs and wage cuts.

Jim Cramer: We desperately need another round of federal stimulus, despite vaccine progress

Here is the link.

We figured we'd have maybe the virus contained in early fall, but we botched the reopening and now states are being forced to shut down again," the "Mad Money" host said.


日内交易,还是价值投资

Here is the video. 

美股分析赚钱:你适合做日内交易,还是价值投资?什么样的投资风格适合你?我们以一个5000美金的账户为题,说说新手小资金如何选择投资策略。




Stock report: CFRA - Husky Energy Inc - July 11, 2020

July 16, 2020

Introduction

The report is provided with Ameritrade.com. 

Summary Husky Energy is a Canadian-domiciled oil & gas company with a focus on Western Canada
crude oil development, as well as U.S. refining operations in the Midwest.

Beginning in mid-March 2020, HSE began to
shut in 80,000 boe/d production from its
Integrated Corridor assets (mostly heavy oil).
We estimate these cuts to comprise about 28%
of 2019 production, and reflect weak pricing for
crude oil and other related products in Western
Canada.
Owing to the pandemic’s impact on energy
demand, HSE is prudently reducing its U.S.
refining runs to minimal levels (which we
estimate is roughly 60% utilization), and has
also suspended its strategic review of its
Canadian retail and commercial fuels
businesses. We think potential for non-core
asset sales (or spinoffs) is going to have to
wait for the return for a normalized macro
picture so that price points are more attractive
to HSE.
In late April, Canadian benchmark crude
Western Canada Select (WCS) was trading at a
US$8.50 per barrel discount to U.S. benchmark
WTI (which in turn was trading at about $17 per
barrel, so WCS is effectively half price). Based
on data from the U.S. EIA and the CME Group,
we think realized prices for WCS improve
through year-end, but likely to no more than
$20 per barrel, which is still relatively low.

Investment Rationale/ Risk

Our recommendation is Hold. Although Western
Canada oil differentials should weaken, and
energy demand remains tenuous, we estimate
HSE has less exposure to Western Canada than
its peers. In addition, we think HSE's U.S.
Midwest refinery exposure could be helpful.
While U.S. refinery runs are likely to be weak
while the pandemic crushes demand, we think
distillate demand holds up relatively better
than gasoline, and HSE's refineries are more
aligned with distillate production.
Risks to our recommendation and 12-month
target price include lower than expected spot
prices on synthetic crude and heavy crude oil;
unfavorable regulatory announcements;
weaker-than-expected results from
cost-cutting; and slower-than-expected
completion of the crude oil flexibility project at
the Lima refinery.
Our 12-month target price of C$4.50 reflects
an 8.6x multiple of enterprise value to
projected 2020 EBITDA, above HSE's historical
forward average. We estimate a significant free
cash flow deficit this year, although HSE's
relatively low debt on the balance sheet is
helpful.

JavaScript: Two days project

July 16, 2020

Introduction


I like to write about my two day JavaScript project, and look into how I can quickly get into a good habit to code using JavaScript more often. It is better to try various ideas to code and challenge myself.

My short term project


I like to write about my two days project using JavaScript. It is such great experience for me to get comfortable to code more often on various ideas.


I got repository on github called project management. I opened last year just after I went to California MPK for onsite interview from Facebook. I visited my friend who worked for Johnson Johnson next to the the hotel I stayed. She was the project manager for micro-surgical startup bought by Johnson. 

Here is the page I created for this project. 

Fromwhispers.com - inside trading track

https://formwhispers.com/s?t=enbl

https://formwhispers.com/s?t=ovv