Skip to main content

Posts

Showing posts from 2019

Domain Name Resolves to A Wrong IP Address

I registered a new domain name. While in the process of registration I checked on the new domain name that showed a default page. I should have not done it in the first place checking on a site with incomplete domain name registration. Once the registration was completed I pointed the new domain name to my web server. And I created a new "Hello World" page. However, the new page didn't show up on a browser on my laptop. However, it showed up on my smartphone. And it showed up on my son's smartphone. It just didn't show up on my laptop. It showed the original default page instead. After a few trials the default page became very suspicious to me. Searches on the Internet pointed to a potential browser malware. And I spent a few hours hunting for the malware that eventually never existed. I looked up using a different browser and I made a query using curl . All responded with the same suspicious default page. Thus, it had nothing to do with the browsers or their

Separation of Front-end and Back-end Concerns

Separation of concerns is the cornerstone of MVC framework. Model, view and controller are three broad concerns of web-based software development. On its early days MVC was implemented on server side. The server renders views for clients. Nowadays, most clients render views themselves. Even the terminology of client-server has already morphed into front-end and back-end . The need for back-end to handle views is diminishing. View concerns have became increasingly complex with two big sub-concerns of aesthetic and dynamics. Front-end evolves into bigger MVC concerns of itself. While back-end evolves into larger modeling concerns. Now, front-end and back-end are two separate concerns. Front-end and back-end are handled by two different teams of software developers with different specialties. Back-end evolves into something like "dinner can be served even without plates, forks and spoons, without table and chairs, and without a dinning room." Front-end is serving the withouts.

Model-Action Framework

Let  front-ends handle views. This is the time we break up MVC and make it more practical. We are going to focus on back-end without view concerns . There are deeper issues regarding the broader concerns of the model, view and controller. The three-point idea cannot be so simple. The reality is more complicated. Now without view, we are going to slice model and controller into smaller applicable concerns. Views should not be handled from the back-end. We are threshing the view concern from the back-end altogether. First of all, look at the plethora of front-end frameworks concerning views. Why do model and controller not catching up? Because model and controller are invisible to the naked eyes. Because users can decide on the looks and feels of an application. Because users have no idea and do not care on how data are being handled. Thus, due to the absence of users at the back-end, there is no pressure at all for developers to really pursue on improving model and controller. Th

Using React in Foundation for Sites

This post was the precursor to the Foundation-React Template . React and Foundation are two different web UI frameworks addressing different needs. They evolve differently. Both of them are powerful on their own accord. Fusing them together may create superpower. We will walk through the process of adding React into Foundation. We will start by installing both Foundation and React through command line interface (CLI). Then we will create a simple Todo web app. Along the way we will highlight the development process. But before all that, let us summarize React and Foundation. The details can be found at their respective websites. Both of them are well documented. React is a run-time UI rendering engine. It renders dynamic UI elements in its own fast virtual DOM, and only update necessary changes to the slow browser DOM. This behaves like a  double buffering DOM which makes any UI update feels fast. React wraps a UI rendering script in a component. A React component can be bound

Debugging PHP using Apache Error Log

PHP runs on the server side and behaves like a function that return a value against the given arguments. A remote client may call this function and expect a specified return value and nothing else. So how do we debug this function ? It must not return debugging messages since the client is never designed to handle them. We must never burden any client to handle debugging messages. If we run PHP through Apache server then we can use the error log to keep our debugging messages. It may not be the best way to do it. But we only want to talk about this approach now. Error Logs The Apache error log files generally can be found in the following directory: var/log/apache2 We issue the following command from within the directory to read the latest error messages: # tail error.log The tail command reads the last few lines from the error.log file and prints them on the terminal. If we need to read a specific number of lines from the end of the file then we can specify the -n opti

ESP8266_RTOS_SDK and Debian

If you search the Internet for ESP8266 you will get Arduino related results. It seems that the world see ESP8266 as a part of Arduino. This may change in the future. I prefer not to use Arduino for ESP8266 development because that approach was technically a work-a-round. Arduino IDE was designed for its own devices. I don't want to use an IDE which generally comes with unnecessary dependencies and constraints. I want to have the full control of the device that I'm working on. That's why I started my earlier ESP8266 developments with esp-open-sdk . I'm okay with the command line approach and a simple text editor. Now I want to utilize the real time operating system and explore its potentials. ESP8266 is powerful enough for RTOS. I searched the Internet for ESP8266 and RTOS, and I found many paradigms. ESP8266 is in a constant development. People were trying all sorts of approaches because in the beginning they were left alone . And now Espressif seems to take over

MicroSD Card Module with SPI Connection

A MicroSD card can be directly connected to a 3.3v microcontroller without the need of any additional module. However, a cheap module such as shown in the picture above can be handy in terms of wiring and card replacement. Yet, if you get the module from China then you are on your own, you have to figure it out yourself how the module works. The module above needs 5v VCC to operate. The 5v is needed by the 3.3v LM1117 regulator to power the MicroSD card and the 74125 bus buffer (the 14-pin IC in the module above). Hence, the bus buffer is operating at 3.3v. The VCC is connected directly to the input of the regulator and no where else. Thus, the VCC is solely meant for the regulator. The right-side SPI bus (CS, SCK, MOSI & MISO) is connected directly to the 3.3v bus buffer. No line in the SPI bus that is connected to the VCC. Thus, the SPI bus does not follow VCC. The buffer is 5v tolerant so the right-side SPI connection can be driven at either 3.3v or 5v. Hence, the SPI ca