Front end world has an incredible evolution speed. Especially for the tooling, new kids jump out everyday. Webpack is one of them and seems it will dominate for a while. You may hear its complexity and how its gonna replace your current toolchain. Today, let’s bundle webpack like it bundle scripts for us xD
CSS has lots of layout skills to master.
flexbox. Sometimes you can use them as you like, but sometimes you should choose wisely according to the situation. Let’s take a look at the position property. To look over some interesting behaviors among the different values.
In ES5, we can very easy bind a event to DOM using the native way:
document.addEventListener() , or a jQuery way,
$(element).on() , use them according to different situations.
But in the ES6 or Typescript, you will face some pitfall if you don;t care the details. Suppose you have the following code:
Pointer in C is a powerful weapon, it can let us feel that we can manipulate the memory directly (Literally, not that true since the barrier as virtual memory and page table, but we can consider it like this.) And we know that you can use
& to refer a memory address of a variable, and use
* to deference an address to retrieve the inside value. And the relations between pointer and array, you can blahblahblah for a whole day.
But the question may come across, when do we need to use pointers and why? For instance, why
scanf() need a pointer typed parameter while
printf() doesn’t? We can’t just memorize function names. Aha, this may become tricky since it needs some background knowledge on the memory model. But clam down, we are here to solve it. And the memory model you will learn is not only applied to C, it’s universal. Let’s start!
This is a question which will confuse the beginners for a while. And in order to know this, you need to know the memory first, which is the memory architecture of your program in runtime. To keep it simple. Let’s firstly check the insanely simple C code below.
jQuery is great. Not only for its famous DOM manipulation but also for its extended functionalities, ajax is one of them. But when you use some libraries like React, you won’t need jQuery at all. But still you need to make an ajax call, how to deal with it?
There are tons of libraries which you can use. But just a special one you should pay attention, Fetch API, a living standard, and will someday be implemented by every modern browser. In fact, the latest version of most browsers have all supported this API. Including Chrome(Desktop/Android), Firefox, Opera and Edge. Let’s say how fancy it could be :) We’ll see it in a high abstract view first, then break into pieces. So you can learn it in a very fast pace.
Type is the first one, I love type, not only for the static typing, but also for the tooling it provided. Intellisense, aha, really great, you don’t need to read any source code or documentation. Just a single dot, and our extraordinary coder will show you their self-explained method name, and you can also know the type of the parameter. Win! But how?
Sometimes we need to match the binary number to the decimal number. But for people like me who is not that sensitive to binary, it seems they are all the same… So I need to write a table to match them. It is easy since binary has only 2 digits, 0 or 1. But the calculation could be nasty, and the layout would be annoying when the quantity gets bigger. And when the layout gets annoying, we will make mistakes. And nobody loves mistake.
But there is a simple way we can make this procedure in to a no-brainer. Let’s write down a 4-bits binary and decimal match table. Just check the one below. It is simple, isn’t it? Do you find any pattern?