Today's Notes#
Bought Huaxi shares#
I have actually been paying attention to this stock recently, and its popularity has been high. Last night, I saw that most of the performance of artificial intelligence has been implemented, so I prepared to buy it today. When the market opened this morning, it rose by 1.78% during the opening auction. I thought there might be some market today, so I placed an order with a floating loss of -2% for the entire position, and left it to fate. As the opening approached, I took a look and felt bad, so I quickly opened my phone and saw that I was in big trouble 😐. It's all about timing and luck, the entire artificial intelligence sector collapsed today.
Summary of reasons:
- Greed. I could have tested the waters with half of the position and added to it later.
- Buying in the morning. Buying in the morning carries too much risk. Once bought, due to the T + 1 restriction, it restricts buying and selling.
- Emotional operation. Failure to strictly follow operational discipline.
Finished reading "Data Structures and Algorithms Illustrated"#
This book has a high rating on WeChat Reading, and I gained some insights after reading it. It is quite recommended for those who are new to algorithms.
Detailed Concepts#
Some of the explanations of concepts are quite detailed, such as time complexity, which is explained in detail:
The speed of the operation is not calculated based on time, but based on the number of steps.
Novel Perspectives#
For each data structure, it explains from four dimensions: search, read, insert, and delete, analyzing the time complexity of each operation. It also carefully analyzes the application steps and scenarios of data structures. For example, when talking about recursion:
- Identify the base case.
- See what the function does in the base case.
- See what the function does in the step before reaching the base case.
- Continue this process, seeing what each step does.
For someone new to recursion, it is important to understand how to approach and understand recursion. It provides a clear approach of analyzing from the base case, and also uses a stack for a more specific description.
Clear Steps#
For each step of the algorithm, it is very detailed, simple and clear. For example, when explaining the deletion operation of a binary tree, it analyzes various scenarios: no child nodes, one child node, two child nodes, and two child nodes with the left child node having a right child node.
Limited Content#
This book only covers time and space complexity, arrays, hash tables, stacks, queues, binary trees, linked lists, graphs, recursion, and sorting. It does not cover more application techniques and approaches, such as two pointers, sliding windows, dynamic programming, etc.
Next, I plan to read a more specific application book, "Cracking the Coding Interview," and then share it with everyone.
Completed deployment of an old project#
Actually, I had already set up a Vite template project earlier, but I had been procrastinating on deploying it online. Today, I finally finished it. However, unexpectedly, I encountered a small issue. Before upgrading, I noticed that the project dependencies were too outdated, so I decided to upgrade the dependencies. When upgrading the eslint, prettier, and stylelint dependencies, I found that the peer dependencies were not compatible, so I upgraded everything to the latest version with one click. Then, unexpectedly, the peer dependency of stylelint-config-prettier
did not keep up with the latest version of stylelint
, so I had to roll back stylelint
. As a result, other dependencies required the latest version of stylelint
, and after several back and forth, a disaster happened, the dependencies were completely mixed up. Finally, I had to roll back and only upgrade some of the dependencies that needed to be upgraded. After dealing with this, an afternoon had already passed, and I felt really exhausted and heartbroken. Here's a summary:
- Upgrade some dependencies with the specified version number.
- Use
npm i xx --legacy-peer-deps
to upgrade dependencies. - Avoid upgrading dependencies unless necessary.