Through the binary

a full stack enthusiast interested in Javascript / Typescript / Kotlin / Python / React / React Native / (Android & iOS) native / Cloud

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!

Read more »

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.

Read more »

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.

Read more »

I love typescript, it is a superset of javascript, so basically anything you can do in javascript, you can do it in typescript, there is nearly nothing new to learn when you start coding via javascript. All you need to learn is some new weapons added to your arsenal by typescript.

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?

Read more »

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?

Read more »

1. Brief

You can always find O(n), O(log n) over the internet when people talking about the efficiency of the codes. Like any other magic which you will encounter, it will give you a big question mark. I assemble all the information I have, from my lectures, book readings, online information, personal understanding, then write down this article. Medium measures you can finish this article in 6 minutes, here are what you will get after the precious 6 minutes:

  • How do we get the answer of Big O academically? (Rarely see online)
  • How to measure the Big O for an algorithm practically?

A big plus: You don’t need any background to read this! Even a very beginner can understand this. Just a very little math (no computation). Hope it could help. Let’s start!

Read more »
0%