Skip to main content

Posts

Few things need to understand about SQLite before using it

SQLite is really quite different when compared to many other database systems.  Before you decide to use it, there are a few things you definitely need to understand about it. Here we go. SQLite SQLite is a serverless SQLite is not a database server, which means it is not a backend process running in your system somewhere. There is no SQLite server process. While we are using PostgreSQL or MySQL, we have a database server process running somewhere to interact with us. We connect database server with IP address, database name, account and password. Then we send our SQL statements to the server through network, and get back the result from it. But this is not the case for SQLite. Serverless also implies zero-config !  SQLite is an embeded database Embeded database means you can incorporate SQLite into your application, while the database functionality is not necessary to be a separate piece of software. Actually, this is most likely the use case for SQLite. There are just so ma...

Open a file descriptor, not only a file, in Python

I think most of Python programmers are quite familar with using the builtin method open to open a file, which I mean a real file on disk, a stored file, like a txt file. But actually, we can also use the same open function to open a file descriptor. Normally, this is a better way to read and write files than by directly using os.read and os.write, which are both low level interfaces. I'll share my knowledge about open a file descriptor in this blog post.  What is file descriptor? Technically speaking, a file descriptor is just a non-negative number which represents a I/O resource within a process, such as a disk file, a pipe, a socket or a device. We often use fd as a short hand name. Everything is a file in Linux! The most famous file descriptors for each process are 1, 2 and 3, which represent stdin, stdout and stderr respectively. They are created automatically for each process by operation system.  We can check these file descriptors in...

The start of the Internet, ARPANET in 1973 and 1977

I believe that these two early maps of ARPANET in 1973  and 1977 respectively are very valuable. As a software engineer, my early career was dedicated in a project for developing TCP/IP stack. There is a undescribable intimate emotion every time when I look at these pictures. :)  ARPANET in 1973 ARPANET Logical Map in May 1973 ARPANET in 1977 4 years late since 1973, no big change. At early stage of the Internet, everything evolved at snail speed, not like today's rocket speed. ARPANET Logical Map in Mar 1977 ARPANET stands for Advanced Research Project Agency Network , which is the first wide-range packet switching network. Now, Internet basically controls human race! No one can even imagin life without connection to the Internet any more. It is nearly impossble. Human kind has no way back definitely.   Design Purpose of ARPANET Even though the ARPANET project was established by DARPA (Defense Advanced Research Project Agency)...