preface

From January 1, 2020.1 to January 1, 2020.1, it has been two months since we succeeded in the interview and one month since we joined the company. I would like to write something to share with you. The following contents will be written in this paper:

  • Personal experience along the way
  • Some thoughts for the future
  • What did you learn this month
  • Share some useful tools

Start from the campus and travel to Tianjin, Yunnan and Hunan

After graduating in 2020, I started to look for my first job in January 2019. At that time, my goal was to find a job as a Java intern. I sent out my resume every day for two months.

Of the 200 resumes sent out, only maybe six will respond and only two will give me a remote interview.


I was lucky. After sending out my resume for 200 times, someone finally gave me a chance, and I seized the chance and successfully went to work for my first company in Tianjin.

After 3 months, I was dismissed by my boss when I was about to become a regular employee. I was told that my company would merge with Beijing XX Company. This dismissal is not my problem. Blah, blah, blah, blah, blah.


At that time, I felt very sad. I felt that my boss was comforting me. After reflecting on my three months, I felt that WHAT I had done was not very good.

Then I began to look for my second job. Within two days, I successfully found my second job as an enterprise instructor in the Software Engineering Department of Tianjin Polytechnic University. At that time, I was in charge of guiding the graduation design for those students who were about to graduate. At the beginning, I thought I was not good at it, but the 20 students I led were even worse. For example, duliyinleren(indie musician); The database field length is 255.


After they graduated, I quit my job because I was just a student, and it was a mistake to teach someone else.

The third job is in a small company in Kunming, has been doing the appearance of more than half a year, because the boss kept painting cakes, also left. Maybe it is because of self-motivated, or I have seen various offers from my peers on the Internet. In the past six months, there is only one key word — study. In addition to my family, I hardly went out with my colleagues. I spent most of my time studying, which was boring and lonely in other places.


A year later, where to go

Before adding several technical wechat groups, I saw a lot of technical friends in the happy discussion of various source code, SPRING source code I thoroughly polished, recently in-depth study of dubbo low-level implementation, of course, I used to be such, remember learning volatile has been dug in the hardware level of volatile implementation, But is this really a sign of technical competence? Looking at it from today’s perspective, I think it reflects more on a person’s ability to learn, research and passion for technology than much else.

Study is a good thing, but in fact most of the time in-depth study is not useful in the actual work, and the deeper the study, the faster you forget, because the deeper the study, then the more technical points associated with the technology, forget the corners, the core things are not easy to string together. So what is the real technical ability, let me draw a picture to summarize:


This is just my own idea, “the ability to solve problems is the real embodiment of technical ability”, this will be the road I want to take in the future.

This month’s harvest

  • Git

    I use Git every day, but I can’t remember many of the commands. Here’s a list of the most common Git commands I’ve compiled.

// View branches in chart form

The git log - graph



// Modify the commit content

git commit --amend



// Temporarily remove uncommitted changes and move in later

git stash



git stash pop



// Merge branches and input merge information

Git merge - no - ff



// Create and switch branches

git checkout -b



// Displays a list of branches

git branch



// View the direct differences between this commit and the last one

git diff head



// Displays logs at the specified location

Git log directory or file



// View the operation logs of the current warehouse

git reflog



// Add a remote repository

Git remote add Origin Specifies the repository address



// Git basic commit process

git clone



git checkout -b



git push -u origin



git add



git commit



git push



Copy the code
  • PHP

  • Nginx

// Install via HomeBrow

Nginx directory/usr/etc/nginx /



// Test whether the Nginx configuration file is correct

nginx -t



// Stop nginx quickly

nginx -s stop



// Stop nginx completely and orderly

nginx -s quit



// Modify the configuration and reload it to take effect

nginx -s reload



/ / start nginx

start nginx

Copy the code
  • MySQL 900W + data, from 17s to 300ms Optimization principle: Reduce back to table operations

Before optimize SQL

SELECT all columns

From `table_name`

WHERE various conditions

Limit of 0, 10;

Copy the code
The optimized SQL

SELECT all columns

FROM `table_name` main_table

RIGHT JOIN

(

The SELECT subquery queries only primary keys

FROM `table_name`

WHERE various conditions

LIMIT of 0, 10

) temp_table on temp_table. A primary key

Copy the code

For example, run SELECT * FROM table_name where XXX = 1 LIMIT 300000, 5;

  • Query the index leaf node data ๐Ÿƒ
  • Query all required field values ๐Ÿƒ on the cluster index according to the primary key value on the leaf node

As above, 300005 index nodes need to be queried, 30005 cluster index data need to be queried, and finally filter out the first 300000 results, extract the last 5. MySQL spends a lot of random I/0 queries on clustered index data, and 300,000 random I/0 queries do not show up in the result set. This raises a question: since the initial use of the index, why not first query along the index leaf node to the final 5 nodes needed, and then query the actual data in the clustered index. It only takes 5 random I\O.

If we encounter performance bottlenecks, we can consider using join query or subquery to find the primary key of the target data and then find the corresponding other fields.

  • Laravel 7

  • Clean code

    Be sure to name it properly and replace the old one as soon as you find a better one. Names should answer all your big questions. It should tell you why it exists, what it does, and how it should be used.

  • Design patterns

    • Single responsibility principle

    The single responsibility principle provides a standard for writing programs that measure how well an interface or class is designed by responsibility or reason for change, but responsibility and reason for change are not measurable, vary from project to project, and from environment to environment. Interfaces must have a single responsibility, and classes should be designed so that there is only one reason for change. Class variation is when a class does its own thing, such as the User class, so it only does User operations ๐Ÿบ

    • Richter’s substitution principle
  • Algorithm related

    An understanding of time complexity and space complexity

  • Refactoring the sister project

Share some tools

These are tools THAT I’ve used before, so I’m sharing them with you.


Favorites tool: raindrop.io

MarkDown typesetting tool: MarkDown Nice

Git Commit Conventional Comits

โ

The more you know, the more you don’t know.

โž