Friday, August 26, 2022

Leetcode discuss: 94. Binary Tree Inorder Traversal

Here is the link. 

C# | Quick learner | 3+ solutions | recursive function | stack | Morris traversal

August 23, 2022

I like to review C# solutions in discuss post, and then write a solution using recursive, a stack, and a solution without using recursive or stack - using Morris order traversal. The time complexity is O(N), N is total number of nodes in the tree, space optimal is O(1) using Morris order traversal.

The following are 4 solutions I like to share.

Solution 1:
I choose to use C# List and also write a function to pass List as a function argument, so all nodes in the tree will be visited once and be added to List in inorder traversal order.

Space complexity: Using O(N) space, List
Time complexity: O(N), N is the total number of nodes in the tree

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _94_inorder_traversal
{
    class Program
    {
        public class TreeNode {
            public int val;
            public TreeNode left;
            public TreeNode right;
            public TreeNode(int val=0, TreeNode left=null, TreeNode right=null) {
                this.val = val;
                this.left = left;
                this.right = right;
            }
        }

        static void Main(string[] args)
        {
            var root = new TreeNode(1);
            root.right = new TreeNode(2);
            root.right.left = new TreeNode(3);
            var list = InorderTraversal(root);
            Debug.Assert(string.Join(",", list).CompareTo("1,3,2") == 0); 
        }

        /// <summary>
        /// emtpy tree, with one root node, with more nodes
        /// </summary>
        /// <param name="root"></param>
        /// <returns></returns>
        public static IList<int> InorderTraversal(TreeNode root) 
        {
            var list = new List<int>();
            runInorderTraversal(root, list);

            return list;             
        }

        private static void runInorderTraversal(TreeNode root, IList<int> list)
        {
            if (root == null)
            {
                return;
            }

            runInorderTraversal(root.left, list);
            list.Add(root.val);
            runInorderTraversal(root.right, list);
        }
    }
}

Solution 2 | Using stack | iterative solution
I think that the design should be simple. Go over a few test cases, and then complete the design.

Here are highlights for a good and simple design using a stack:

  1. Inorder traversal - left child, root node, right child
  2. Use stack to maintain the order, allow left child pop out first before root node - reverse the order
  3. Design an algorithm using stack, using a stack, a variable called TreeNode current
  4. Make sure that stack.Push, stack.Pop both are called once
  5. Design two nested while loop - outside while loop is to work on the root node, inside while loop is to work on root node -> left child until the end
  6. Choose a simple test case to work on first: A root node with value 1, which has a left child with value 2; and root.left has a left child with value 3 - using the test case to work on inside while loop functionality.
  7. The above 6 steps should be a good start to make a working solution.

The following C# code passes online judge.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _94_inorder_traversal_iterative
{
    class Program
    {
        public class TreeNode
        {
            public int val;
            public TreeNode left;
            public TreeNode right;
            public TreeNode(int val = 0, TreeNode left = null, TreeNode right = null)
            {
                this.val = val;
                this.left = left;
                this.right = right;
            }
        }

        static void Main(string[] args)
        {
            var root = new TreeNode(1);
            root.right = new TreeNode(2);
            root.right.left = new TreeNode(3);
            var list = InorderTraversal(root);
            Debug.Assert(string.Join(",", list).CompareTo("1,3,2") == 0);
        }
       
        /// <summary>
        /// study code
        /// 
        /// </summary>
        /// <param name="root"></param>
        /// <returns></returns>
        public static IList<int> InorderTraversal(TreeNode root)
        {
            var list = new List<int>();

            if (root == null)
            {
                return list;
            }

            // stack - inorder - left, root, right
            var stack = new Stack<TreeNode>();
            var current = root;

            // stack 
            // design - visit left child and right child at least once
            // put left child first, before root node itself. 
            // stack.Push - only once - in coding writing
            // stack.Pop - only once - in coding writing
            // 
            while (stack.Count > 0 || current != null)
            {
                // Go over an example
                // Binary tree - Test case 1: 
                // root = new TreeNode(1);
                // root.left = new TreeNode(2);
                // root.left.left = new TreeNode(3);
                // nodes should be pushed into stack: push 1, push 2, push 3
                // Work on test case 1, and then add a right node into tree, work on test case 2 to cover all test cases. 
                while (current != null)
                {
                    stack.Push(current);
                    current = current.left;
                }

                // Pop()
                current = stack.Pop();
                list.Add(current.val);

                // Go to right
                current = current.right;
            }

            return list;
        }
    }
}

Solution 3: Morris traversal | O(N) time, O(1) space | Space optimal
Morris (InOrder) traversal is a tree traversal algorithm that does not employ the use of recursion or a stack. In this traversal, links are created as successors and nodes are printed using these links. Finally, the changes are reverted back to restore the original tree.

10 minutes to review the algorithm
Morris traversal Algorithm

  • Initialize the root as the current node curr.
  • While curr is not NULL, check if curr has a left child.
  • If curr does not have a left child, print curr and update it to point to the node on the right of curr.
  • Else, make curr the right child of the rightmost node in curr's left subtree.
  • Update curr to this left node.

Illustration | Demo | https://www.educative.io/answers/what-is-morris-traversal
It is a good investment to spend 10 minutes to go over a demo before spending time to read C# solution.

image

image

Test cases | Debugging | Tree restored | First node 1 in inorder | Second node 2 in inorder
It is definitely a good exercise to run the debugger, and then track the demo tree first node with value 1 in inorder traversal, and then second node with value 2 in inorder traversal. Rest should be easy. I found out that it is so interesting for me to learn this Morris order traversal with this demo tree.

The following C# code passes online judge.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _94_inorder_traversal
{
    class Program
    {
        public class TreeNode
        {
            public int val;
            public TreeNode left;
            public TreeNode right;
            public TreeNode(int val = 0, TreeNode left = null, TreeNode right = null)
            {
                this.val = val;
                this.left = left;
                this.right = right;
            }
        }

        static void Main(string[] args)
        {
            var root = new TreeNode(4);
            root.left = new TreeNode(2);
            root.right = new TreeNode(5);
            root.left.left = new TreeNode(1);
            root.left.right = new TreeNode(3);            

            var list = InorderTraversal(root);
            Debug.Assert(string.Join(",", list).CompareTo("1,2,3,4,5") == 0);
        }

        /// <summary>
        /// study code
        /// This is C# implementation with Morris In-Order traversal.
        /// Time complexity is O(n)
        /// Space complexity is O(1)
        /// https://leetcode.com/problems/binary-tree-inorder-traversal/discuss/441037/C-Morris-InOrder-Traversal
        /// study Morris traversal
        /// https://www.educative.io/answers/what-is-morris-traversal
        /// Morris (InOrder) traversal is a tree traversal algorithm that does not employ 
        /// the use of recursion or a stack. In this traversal, links are created as successors 
        /// and nodes are printed using these links. Finally, the changes are reverted back to 
        /// restore the original tree.
        /// </summary>
        /// <param name="root"></param>
        /// <returns></returns>
        public static IList<int> InorderTraversal(TreeNode root)
        {           
            var result = new List<int>();

            if (root == null)
            {
                return result;
            }

            var current = root;

            while (current != null)
            {
                if (current.left == null)
                {
                    result.Add(current.val);
                    current = current.right;
                }
                else
                {
                    // make the current node the right child of the rightmost node in curr's left subtree
                    // illustration please the diagram
                    //
                    // find the predec of current
                    var previous = current.left;
                    while (previous.right != null && previous.right != current)
                    {
                        previous = previous.right;
                    }
                
                    if (previous.right == null)
                    {
                        previous.right = current; // node 3.right = node 4
                        current = current.left; // 
                    }
                    else
                    {
                        previous.right = null;
                        result.Add(current.val); // demo tree - first time, node 2 is node 1's right child
                        current = current.right;
                    }
                }
            }
        
            return result;
        }
    }
}

Solution 4 | Need improvement | Weakness in design

Oct. 4, 2018
It is a medium level tree algorithm. I submitted the solution more than four months ago. I like to review the code before I start to work on other 20 medium level tree algorithms. It is also a good idea to share here.

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     public int val;
 *     public TreeNode left;
 *     public TreeNode right;
 *     public TreeNode(int x) { val = x; }
 * }
 */
public class Solution {
    public IList<int> InorderTraversal(TreeNode root) // emtpy tree, with one root node, with more nodes
        {
            if (root == null)
            {
                return new List<int>(); 
            }

            var left = InorderTraversal(root.left);
            left.Add(root.val);
            var right = InorderTraversal(root.right);

            // add right to left list <- code review on August 23, 2022, it is not a good practice. 
            if (right.Count > 0)
            {
                foreach (var item in right)
                {
                    left.Add(item);
                }
            }

            return left; 
    }
}

I think that it is better to avoid copying the list from right variable to left. It takes extra time and no need to do that.

Thursday, August 25, 2022

Snowflake vs AWS vs Azure: Top 8 Unique Differences

  on Amazon Redshift, Data Warehouses, Microsoft Azure, Snowflake • March 25th, 2022 • WRITE FOR HEVO

A Data Warehouse is one of the most important Data Science Tools for any business. It provides an organization with a data storage solution. For scalability and reduced administrative tasks, organizations are choosing cloud data storage solutions over on-premise databases. Cloud storage is also more accessible compared to on-premise storage options. 

There are many cloud data warehouses today. Thus, when looking for a cloud data warehouse solution, you will be puzzled by the many options available to you. AWS Redshift, Snowflake, and Azure are some of the popular solutions. To make an effective & economical choice for your individual use case,  a comprehensive comparison is required between Snowflake vs AWS vs Azure. They share several similarities as well as differences. Any business may find it difficult to choose the solution among these three platforms. 

In this article, you will learn about the 8 key differences between Snowflake vs AWS vs Azure.

Table of Contents



  • Amazon Redshift Architecture: AWS Redshift uses the shared-nothing MPP architecture. It is made up of data warehouse clusters with the compute nodes split into node slices. The leader node assigns the individual compute nodes with the code. The system uses industry-standard JDBC or ODBC to communicate with the client applications. 
  • Snowflake Architecture: The Snowflake architecture was made for the cloud and combined with an SQL query engine. It also combines the traditional shared disk with the shared-nothing database architectures which give it three core layers namely database storage, query processing, and cloud services. 
  • Azure Synapse Architecture: Azure Synapse uses a scale-out architecture to distribute the computational processing of data across many nodes. It also separates compute from storage, allowing you to scale out compute independently of the data stored in your system. 

Snowflake vs AWS vs Azure: Performance

  • Amazon Redshift Performance: Redshift offers a fine performance on most data types, but the performance is low when dealing with semi-structured data such as JSON files. To get optimal performance, users are recommended to use the concept of distribution keys. The distribution keys are columns that help to define a database segment for storing a particular row of data. 
  • Snowflake Performance: Snowflake separates compute from storage, which makes it allow for concurrent workloads, letting users run multiple queries at a time. The workloads don’t impact each other, leading to faster performance.
  • Azure Synapse Performance: Its architecture allows for concurrent query processing. Thus, users can extract insights from their data and visualize it faster. 

Snowflake vs AWS vs Azure: Integrations


  • Amazon Redshift Integrations: This is an important factor to consider when comparing Snowflake vs AWS vs Azure. Redshift supports integration with the entire AWS ecosystem, including Amazon DynamoDB, Amazon RDS, Amazon S3, AWS Data Pipeline, AWS Glue, and AWS EMR. It also partners with many other platforms. 
  • Snowflake Integrations: Snowflake offers native connectivity with multiple BI, data integration, and analytics tools such as Azure Data Factory, IBM Cognos, Oracle Analytics Cloud, Google Cloud, Fivetran, and many others. 
  • Azure Synapse Integrations: Azure comes with many integration tools such as logic apps, API Management, Service Bus, and Event Grid to enable you to connect to a wide variety of third-party services. It also supports native integration with BI, operational databases, and ML software. 

Snowflake vs AWS vs Azure: Security


  • Amazon Redshift Security: As far as security is concerned, both the user and AWS have responsibilities to ensure the data is secure. AWS takes care of the security of the cloud while the user takes care of the security in the cloud. AWS controls access to Redshift resources at all levels. It is also compliant with ISO, HIPAA BAA, PCI, and SOC 1,2,3 standards. 
  • Snowflake Security: Snowflake is a very secure cloud platform and complies with many data protection standards including SOC 1 Type 2, SOC 2 Type 2 for all Snowflake editions and HIPAA, HITRUST, and PCI DSS for the Business Critical Edition or higher. It has also implemented controlled access management and data security by encrypting all data and files. 
  • Azure Security: Azure offers several data protection services for both cloud and on-premise workloads. These services include access management, information security, threat protection, network security, and data protection. It has over 90 compliance certificates including HITRUST, ISO, NIST CSF, HIPAA, and many others. 

Snowflake vs AWS vs Azure: Data Backup and Recovery


  • Amazon Redshift Data Backup and Recovery: Redshift has an advanced system for both manual and automated snapshots. The snapshots facilitate recovery in case of the occurrence of an unseen event. The snapshots are stored in S3 using an encrypted SSL connection. 
  • Snowflake Data Backup and Recovery: Snowflake uses fail-safe rather than backup. The fail-safe approach offers a 7-day period during which any Snowflake data that might have been lost is recovered. 
  • Azure Data Backup and Recovery: Microsoft has the built-in Azure Backup feature for backup up and restoring data resources. It scales well to meet your backup storage needs. 

Snowflake vs AWS vs Azure: Use Case 


  • Amazon Redshift Suitable Use Case: Redshift is suitable for any business that deals with large-scale data and where queries need a quick response. It is also a good solution for businesses looking for a data warehouse solution with a transparent pricing model and little to no administrative costs. 
  • Snowflake Redshift Suitable Use Case: Snowflake is suitable for companies looking for an easy-to-deploy data warehouse solution with nearly unlimited, automatic scaling and high performance. 
  • Azure Use Case: Azure Synapse is a suitable solution for any company looking for an enterprise data warehouse with a great price/performance ratio. It is also good for companies that use Microsoft products and are in need of seamless integrations. 

Snowflake vs AWS vs Azure: Price


  • Amazon Redshift Price: Redshift offers different pricing plans. With its on-demand pricing feature, you are charged on a per-hour basis. The charges start at $0.25 per hour, but the final cost is calculated depending on the number of nodes in the cluster. With the managed storage pricing approach, users are charged based on the volume of data each month. 
  • Snowflake Pricing: Snowflake uses a tiered pricing approach tailored to customer needs and requirements. It also has pre-purchase and on-demand pricing plans. The usage of compute and storage are separated, and the former is billed separately on a per-second basis. 
  • Azure Pricing: Azure Synapse divides its pricing into compute charge and storage charge. When you pause it, you will only incur storage charges. It doesn’t charge upfront costs and termination fees. 

Snowflake vs AWS vs Azure: Customer Support


  • Amazon Redshift Customer Support: You can contact the AWS support team by filling a form on the official AWS website. They will get back to you within 1 business day via phone or email. 
  • Snowflake Customer Support: The Snowflake team allows you to submit your inquiries by filling a form on their website where you provide your email address and phone number. They then get back to you as soon as they can.
  • Azure Support: Azure provides a number of ways through which you can contact them. You can create a support request on their official website and they will respond to your request. You can also tweet them and you will get answers from their experts. You can also connect with community support to get answers from Microsoft Engineers and the Azure community experts. 

That is how Snowflake vs AWS vs Azure compare to each other. 

Snowflake vs AWS vs Azure Summary


Conclusion

In this article, you learned about the key differences between Snowflake vs AWS vs Azure. Businesses are opting for cloud storage solutions over on-premise storage options for the storage of their data. This can be attributed to a number of benefits offered by cloud storage platforms including less maintenace and accessibility. There are many cloud storage options available today, thus, you may find it difficult to choose the right solution from the many available options. Amazon Redshift, Snowflake, and Azure Synapse are all cloud data warehouse platforms. They provide businesses with cloud storage solutions. Knowing the differences between Snowflake vs AWS vs Azure will help you choose the right cloud storage platform for your unique needs. 

As you collect and manage your data across several applications and databases in your business, it is important to consolidate it for complete performance analysis of your business. However, it is a time-consuming and resource-intensive task to continuously monitor the Data Connectors. To achieve this efficiently, you need to assign a portion of your engineering bandwidth to Integrate data from all sources, Clean & Transform it, and finally, Load it to a Cloud Data Warehouse like Amazon Redshift or Snowflake, BI Tool, or a destination of your choice for further Business Analytics. All of these challenges can be comfortably solved by a Cloud-based ETL tool such as Hevo Data.   





降低胆固醇,不妨试试

 在日常中,有不少人进行体检的时候,会查出胆固醇过高,这类人群都多数都会服用一些降低胆固醇类的药物。

但是,也有不少人担心长期用药会使得肝脏、肾脏功能受损,所以不想吃药。

那么,对于胆固醇过高、却不想吃药的人群来说,到底该怎么做,才能够有效降低胆固醇含量呢?

不吃药该如何降低胆固醇水平?

一、调整膳食结构

导致胆固醇增高的其中一个主要原因,与膳食结构不正确有关,比如吃大量肉类或者是油炸类食物,这些食物当中的胆固醇、油脂成分非常高,一旦大量摄入,就会导致血管中的胆固醇含量增加。

所以在出现胆固醇过高现象的时候,一定要减少这些食物的摄入。多增加一些富含膳食纤维的食物,比如谷物类、豆类以及各种蔬菜。

膳食纤维成分能够促使血管中的胆固醇加速排泄,有着降低胆固醇的作用。

另外,在烹饪食物的时候,必须减少食用油、食盐、糖类的使用量。食物的烹饪方式最好是以清蒸、水煮的方式为主,避免油炸、油煎。

二、增加每日饮水量

对于胆固醇过高的人群来说,每天一定要增加一定的饮水量。合理补充水分能够加速血液的循环速度,并且可以促使血管中的胆固醇加速排泄,有着降低血脂的功能。

喝水要以白开水为主,也可以适当搭配上一些淡绿茶、淡红茶。也可以泡一些玉米须茶或者是决明子茶,都有着降低胆固醇浓度以及辅助降压的功效。

三、增加有氧运动量

如果长期不进行运动,会使血液流速变得非常慢,进入体内的一些脂肪无法被消耗,会在体内堆积,从而使血管中的胆固醇以及甘油三酯水平升高。

所以对于胆固醇过高人群来说,每天一定要增加一些运动,但运动方式要以快步走、慢跑等有氧运动方式为主。

这些运动方式并不会增加一些器官的负担,还可以加速血液循环速度,并促使体内多余的胆固醇加快排泄速度,有着降低血脂以及预防一系列心脑血管疾病的功效。

四、保持健康体重

如果高胆固醇患者的体重超标的话,一定要采取健康方式减肥,比如可以通过调整饮食以及增加运动等方式进行减肥。

如果出现肥胖现象,体内的脂肪含量会增加,就会使血管中的甘油三酯以及胆固醇快速升高,从而影响到血脂水平。

总而言之,对于胆固醇过高的人群来说,如果没有出现一系列的不适症状,那么可以采取以上4种方式降低胆固醇浓度。

另外,这类人群一定不要出现抽烟喝酒,以及长期熬夜、压力过大的行为。

而如果在日常中出现了反复的头晕、心慌或者是其他一些不适感的话,必须在医生指导下适当的服用一些药物进行治疗,才能够最大程度保障自身健康。

高胆固醇

 高胆固醇增加心脏病和心脏病发作风险。用药有助于改善胆固醇。但是,如果想首先通过改变生活方式改善胆固醇,试试以下 5 种健康的改变方法。

如果您已经用药,这些改变可以改善降胆固醇作用。

1.摄入有益心脏健康的食物

饮食上的一些改变可以降低胆固醇并改善心脏健康:

  • 减少饱和脂肪。饱和脂肪主要存在于红肉和全脂奶制品中,会提高总胆固醇。减少饱和脂肪的消耗可以降低低密度脂蛋白(LDL)胆固醇,即“不良”胆固醇。
  • 减少反式脂肪。反式脂肪有时在食品标签上被列为“部分氢化植物油”,常用于人造黄油和商店购买的饼干、脆饼干和蛋糕。反式脂肪会提高整体胆固醇水平。美国食品药品管理局已于 2021 年 1 月 1 日起禁止使用部分氢化植物油。
  • 多吃富含 ω-3 脂肪酸的食物。ω-3 脂肪酸对低密度脂蛋白胆固醇没有影响。但它们还有其他有益于心脏健康的益处,包括降低血压。富含 ω-3 脂肪酸的食物包括鲑鱼、鲭鱼、鲱鱼、核桃和亚麻籽。
  • 增加可溶性纤维含量。可溶性纤维可以减少血液对胆固醇的吸收。燕麦片、腰豆、球芽甘蓝、苹果和梨等食物中都含有可溶性纤维。
  • 添加乳清蛋白。在奶制品中发现的乳清蛋白可解释奶制品对健康的许多好处。研究表明,额外补充的乳清蛋白可以降低低密度脂蛋白胆固醇、总胆固醇以及血压。

2.每周多锻炼并增加体育锻炼

锻炼可以改善胆固醇。适当的体育锻炼可以帮助您提高高密度脂蛋白(HDL)胆固醇(“好”胆固醇)。在医生允许的情况下,每周进行 5 次至少 30 分钟的运动,或是每周进行 3 次 20 分钟的剧烈有氧运动。

增加体育锻炼,即使是一天几次,也可以帮助您开始减重。可以考虑:

  • 每天在午餐时间快走
  • 骑自行车上班
  • 做最喜欢的运动

为了保持活力,考虑找一个运动伙伴或加入一个运动小组。

3.戒烟

戒烟可以改善您的 HDL 胆固醇水平。好处很快就会显现:

  • 血压和心率会因吸烟升高,但在戒烟后的 20 分钟内,它们会很快恢复
  • 戒烟后三个月,您的血液循环和肺功能会开始改善
  • 戒烟后一年,您患心脏病的风险仅变为吸烟者的一半

4.减轻体重

即使体重增加几磅也可能会导致高胆固醇。积水成渊。如果您喝含糖饮料,请换成自来水。可以把爆米花或椒盐卷饼当零食吃,但要注意卡路里含量。如果您想吃甜食,可以吃含少量或不含脂肪的雪酪或者糖果,比如果冻豆。

想办法在您的日常生活中加入更多的运动量,比如走楼梯而不是乘电梯,或者把车停在离办公室更远的地方。在工作间隙起身走动一下。尽量增加站立活动,如做饭或整理庭院等。

5.饮酒要适量

适量饮酒与较高的高密度脂蛋白胆固醇水平有关,但这一益处还不足以推荐不喝酒的人饮酒。

如果您饮酒,请做到适量饮酒。对于健康成人,这意味着所有年龄段的女性和 65 岁以上的男性每天最多喝一次,而 65 岁及以下的男性每天最多喝一次。

过量饮酒会导致严重的健康问题,包括高血压、心力衰竭和卒中。

如果生活方式的改变还不够……

有时,健康的生活方式改变不足以降低胆固醇水平。如果医生推荐药物来帮助降低胆固醇,请在继续改变生活方式的同时按照处方服药。改变生活方式可以帮助您保持服用低剂量的药物。


How to work hard as an equity investor?

 I can write down a few of ideas how to work hard. 

  1. Learn more about businesses. Stay in the business I can understand; 
  2. Learn more about my own experience as an investor;
  3. Keep learning. Watch more videos, and also read more books related to stock investment;
  4. Learn to take some risk, and try to focus on one stock and then invest it in the long term. 

Three things to learn as an equity investor

 It takes time for me to learn how to invest on equities, specially in bear market. I like to think about three things to learn as an equity investor. 

  1. It is better to join SeekingAlpha.com community; And also it is better to invest in bear market, no one can predict the bottom, and if I do not have to use those capital in next three years, then I should invest on the equity with long term return; 
  2. Do not think about too much gain or loss. It takes a lot of time and effort to get into this position, and then I should be happy since I learn the importance to invest on equities, and buy low price;
  3. Do not get scammed on stock price. I learn the lesson to purchase over $10,000 on gray stock, but I learned the lesson to cut loss near $9400 US dollars. 

Tuesday, August 23, 2022

SABR stock: Lessons learned

I like to write down lessons I learned in the last two months. 

  1. Do not buy high and sell low; 
  2. Do not be too greedy;
  3. Check Apple stock and then learn when it is time APPLE peaks. 
  4. Remember two lessons learned, bought 2000 shares of SABR $10.8, 2000 shares of SABR $9.8. 
  5. Watch some videos - Here is the link. 
  6. Keep those stocks for another two to three years. 
  7. Be patient. Bear market will not last forever. 

Apple: return-to-office plans

Apple employees launch petition to protest return-to-office plans

Employee advocacy group Apple Together says more flexibility is needed.
August 22, 2022 5:33 AM

 A group of Apple employees is pushing back against a looming deadline demanding they return to working in the office. The Financial Times has seen a petition, circulated by employee group Apple Together, requesting more flexibility around remote work. It’s in response to an edict that demanded workers return to working in the company’s Santa Clara Valley offices for at least three days a week starting September 5th, 2022.

It’s the latest in a series of attempts by Apple to return to the status quo ante after COVID-19 forced it to adopt home working. Tim Cook has always emphasized the important nature of in-person collaboration as fundamental to Apple’s business and success. Apple Together, however, says that the company’s culture of secrecy makes chance moments of inspiration impossible, and that workers are happier and more productive with a more flexible arrangement.

The announcement of a new working model has already seen a tweak after pushback — the original plan was to enforce office working on Monday, Tuesday and Thursday. Now, the order is for Tuesday and Thursday, with the third office to be set by both the employee and their manager. Even so, the rigidity of the announcement has already seen Apple’s head of machine learning, Ian Goodfellow, quit the company (to go to Google) in search of more flexible work.

Apple Together has become a powerful voice inside a company that has previously been famed for its culture of secrecy. Revelations published earlier this year say that the company retaliated against women who reported incidents of misconduct, including sexual assault. Ashley Gjøvik was fired after attempting to blow the whistle about unsafe working conditions at an office in Sunnyvale. The company also stands accused of union busting after its retail employees at several locations across the US started discussing forming a union.

Daily Apple research

 August 21, 2022

It is so important for me to work on my equity research. I missed the opportunity to realize the gain on SABR when it peaked at $8.3/ share on August 16, 2022. I had 6400 shares, and I was advised to study Apple as a company and also it's stock price. 

Daily study of Apple 

I like to start the study of Apple as a business, so that I can understand the market better. It is important for me to work on investment, so that I may be able to learn how to invest in short term and long term.