Tag:Restructure

  • The practical way of distributed e-commerce marketing system: abstract rules

    Time:2020-3-11

    Preface              worked for an e-commerce company last year and was assigned to develop and design the marketing system of the mall. This article records the potholes I met in marketing design and the ideas in reconstruction. Linear thinking, linear design First, let’s list the marketing components。 Full reduction Discount Seckill Combination purchase Repurchase Coupon New […]

  • Learning reconstruction (5) – simplifying conditional expression

    Time:2020-2-11

    1. Decompose conditionalScenario: you have a complex if then else statement. The independent functions are extracted from if, then and else.Example:if (date.before(SUMMER_START) || date.after(SUMMER_END)) {  charge = quantity * mWinterRate + mWinterServiceCharge;} else {  charge = quantity * mSummerRate;}Refactoring as follows:if (notSummer(date)) {  charge = winterCharge(quantity);} else {  charge = summerCharge(quantity);}private boolean notSummer(Date date) {  return date.before(SUMMER_START) || date.after(SUMMER_END);}private double […]

  • Application of http.js in Ajax single page

    Time:2020-2-6

    About author Lenbo Ma, Java, JavaScript Blog: http://mlongbo.com E-Mail: [email protected] Written on: August 10, 2014 Please indicate the source of Reprint: http://mlongbo.com/http-js-zai-ajaxdan-y… Problems to be solved Simplify the use of API; Set up a global interceptor for Ajax requests in the page; All Ajax requests in the page send global parameters to the server; Realization […]

  • Leetcode-82. Delete duplicate elements II in sorting list

    Time:2020-2-1

    Title Description Leetcode link Solution analysis Solution 1 First, of course, it is the most direct solution: Build a dumb node Go through it and count the positions where all the figures appear Go through it again and delete all elements that appear more than once The advantage is: lazy to think deeply, the most […]

  • Using typescript in react

    Time:2020-1-24

    Preface It is much more comfortable to write react with typescript than to write Vue. React’s support for TS is a natural partner. If you want to refactor a project with TS, unlike Vue, which is very destructive to the project, react can relatively easily achieve refactoring. By the way, the globally installed create react […]

  • Optimize git commit message

    Time:2019-12-16

    At present, many projects are managed through git, which is in the process of each code submissionCommit messageIt is necessary. But just having to be good can help us improve the overall quality of the project. Functions and advantages The primary purpose of submitting instructions is to helpSubmissionExplain the purpose of this submission, while the […]

  • Reconstruction of Old Multi-page Application Projects

    Time:2019-8-23

    Some sighs Using a scaffold recently written for multi-page applications, reconstruct your first project. Haha, at that time, I just got to the front end of the introduction, and I didn’t know about webpack. I wrote about the oldest Bootstrap + jQuery project, and I didn’t know what packaging was at that time. After six […]