Things I've Learnt from Refactoring

Currently, there are lots of sites based on WordPress running steadily in our company, except the project which I'm working on threw out so many issues. since all of us were tired and bored with endless hotfixes, it's time for us to refactor this project, or there would be more and more features imm

Java Queue Implementation

What is Queue Code Example of Java Queue class Queue<Item> { private int size; private Node first; private Node last; private class Node { Item item; Node next; } public Queue() { size = 0; first = null; last = null; }

Java Infix Calculator

What is Infix expression Infix notation is the common arithmetic and logical formula notation, in which operators are written infix-style between the operands they act on, as the examples below: 1+2 3+4 A fully parenthesized infix arithmetic expression is an infix arithmetic expression where every

Java Postfix Calculator

What is Postfix expression Postfix is a expression of Arithmetic Expressions in which the operands are placed before their operators. There are no precedence rules, no parentheses needed. It's much easier for us to calculate Postfix Expression by using stack. Steps of Evaluating Postfix [^1] Push

Java Stack Implementation

What is Stack Code Example of Stack import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Scanner; class Stack<Item> implements Iterable<Item> { private int n; private Node first; private class Node { private Item item; private

Evaluating Arithmetic Expressions

What is Infix, Postfix and prefix expression Infix express means that the operator is in between the two operands of what it is working on. Prefix expression notation requires that all operators precede the two operands that they work on. Postfix, on the other hand, requires that its operators come

My Mid-Year Coding Review 2019: Magic Tips for Coding

This article is a brief review of the last half year in my professional life, and all these topics are flowing in my mind for months. It's better to release the reins, let the paw-prints appear on the paper. I took a long work gap, which went through the whole hot summer last year, to have a vacati

A Brief History of PHP Autoloading

What is autoloading in PHP? Autoloading is a functionality to help developers including PHP classes automatically. In the ancient times, we need to include all the files one by one in the bootstrap file. This olden style may also slow down the initialization of an application. Olden style <?php

The Right Way to Upgrade PHP to 7.1+

Laravel Framework has been upgraded to Laravel 5.6. It's quite important to follow the steps of official releases for the framework you are working on. I have seen several projects stuck on some old versions of  PHP and never can upgrade to the latest version again. Upgrading PHP version for your pr

Give Your Laravel Application a Better Performance

In this benchmark, I did nothing with Laravel itself, I'm just want to see the different behaviors of the different optimization ways. First of all, I'd like to put the conclusion here. The OPcache is a good choice to speed up your PHP project. From the two pics below, it seems like I didn't get the