Blog
WK Hui life

Progressive Web Apps (PWAs): Progressive Web Apps are web applications that leverage modern web technologies to provide a user experience similar to native applications. PWAs are designed to be responsive, reliable, and capable of working offline. They can be accessed through a web browser and can be installed on the user’s device, appearing, and functioning similar to native apps. PWAs are built using web technologies like HTML, CSS, and JavaScript and are designed to be platform-independent, running on multiple devices and operating systems.

Key characteristics of PWAs include:

  • Discoverability: PWAs can be found and accessed through a web browser like any other website, making them easily discoverable without the need for app store distribution.
  • Cross-platform compatibility: PWAs are developed using web standards and are compatible with different platforms and devices, including desktops, smartphones, and tablets.
  • Offline functionality: PWAs can work offline or in low-connectivity situations by caching and storing essential resources and data.
  • Responsive design: PWAs are responsive, adapting their layout and design to different screen sizes and orientations.
  • App-like experience: PWAs offer a user experience similar to native apps, with features like push notifications, home screen shortcuts, and full-screen display.

Native Applications: Native applications are specifically built for a particular operating system (e.g., iOS or Android) using platform-specific programming languages, tools, and frameworks. Native apps are installed directly onto the user’s device and can access device features and APIs. They have the potential to deliver the best performance and user experience, leveraging the full capabilities of the device.

Key characteristics of native applications include:

  • Performance and speed: Native apps are optimized for specific platforms, enabling them to run efficiently and deliver high performance.
  • Access to device features: Native apps can leverage the full range of device-specific features, such as camera, GPS, accelerometer, and more, enhancing their functionality and user experience.
  • App store distribution: Native apps are typically distributed through platform-specific app stores (e.g., the Apple App Store or Google Play Store), allowing for easy discoverability and installation by users.
  • Platform-specific development: Native apps require separate development for each target platform, utilizing programming languages like Swift or Objective-C for iOS and Java or Kotlin for Android.
  • Offline functionality: Native apps can also incorporate offline functionality by storing data and resources locally on the device.

It’s important to note that both PWAs and native applications have their own advantages and considerations. The choice between them depends on factors such as the specific requirements of your application, target audience, desired functionality, and development resources available.

In today’s programming, it can simply classify to server or client-side programming. Or we only need client side for some projects. For today’s website, we need both sides normally.

Server-side programming refers to the execution of code on a web server to generate and deliver dynamic web content to the client’s web browser. It involves handling requests, processing data, interacting with databases, and generating HTML or other content to be sent back to the client. Common server-side programming languages include PHP, Python (with frameworks like Django or Flask), Ruby (with Ruby on Rails), and Node.js.

Example: Let’s consider a simple example of a server-side program using Node.js. Suppose you have a website that allows users to submit feedback. The server-side code receives the feedback and stores it in a database.

// server.js

const express = require('express');
const bodyParser = require('body-parser');
const app = express();

// Parse incoming request data
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());

// Handle POST request to submit feedback
app.post('/feedback', (req, res) => {
  const { name, email, message } = req.body;

  // Store feedback in the database
  // (Database code not shown for simplicity)

  res.send('Thank you for your feedback!');
});

// Start the server
app.listen(3000, () => {
  console.log('Server running on port 3000');
});

In this example, we’re using the Express.js framework with Node.js to handle HTTP requests. The server listens for POST requests to the /feedback endpoint and extracts the submitted data from the request body. It then processes and stores the feedback before sending a simple response back to the client.

Client-side programming refers to the execution of code within the user’s web browser. It involves manipulating the DOM (Document Object Model), handling user interactions, making asynchronous requests to the server, and dynamically updating the web page’s content. Client-side programming languages include JavaScript, HTML, and CSS.

Example: Let’s consider a simple example of a client-side program using JavaScript. Suppose you have a website that allows users to calculate the total price of items selected from a list.

<!-- index.html -->

<!DOCTYPE html>
<html>
<head>
  <title>Item Price Calculator</title>
  <script src="script.js"></script>
</head>
<body>
  <h1>Item Price Calculator</h1>
  <ul>
    <li>
      <input type="checkbox" value="10"> Item 1
    </li>
    <li>
      <input type="checkbox" value="20"> Item 2
    </li>
    <li>
      <input type="checkbox" value="15"> Item 3
    </li>
  </ul>
  <button onclick="calculateTotal()">Calculate Total</button>
  <p id="totalPrice"></p>
</body>
</html>


// script.js

function calculateTotal() {
  const checkboxes = document.querySelectorAll('input[type="checkbox"]');
  let total = 0;

  checkboxes.forEach((checkbox) => {
    if (checkbox.checked) {
      total += parseInt(checkbox.value);
    }
  });

  document.getElementById('totalPrice').textContent = `Total Price: $${total}`;
}

In this example, we have an HTML page with a list of items represented as checkboxes. When the user clicks the “Calculate Total” button, the calculateTotal() JavaScript function is invoked. It iterates over the checkboxes, checks which ones are selected, and sums up their corresponding values. The calculated total price is then displayed on the web page.

PHPmonitor is one of the system monitor tools to check the health of server or service through internet. It support users to detect the server online status through ping, IMAP, service connection init, telnet and open web connect (curl). Once we setup this monitor, we can check those services online timely. If any error / timeout case occur, system will contact related users through email, SMS, telegram…etc. It help us to provide maintenance service ASAP and minimize the down time of bussiness service.

The series of sims is one of the popular games for simulation. It make people found the alternative way for your life virtually. From now on, this game is free for public by EA directly. why not download it and have a try.

EA download link

When you use Microsoft Windows for a certain time, you may install some programs and uninstall them after you don’t need them. If the uninstall program cannot run properly, it may cause some startup programs cannot be found and show “program” in the startup list without any description/manufacture detail. It has no harm to your computer, but it will be great to remove them from the list.

Msconfig
  1. You can check the startup list by “msconfig”. Press “Win + R” and type “msconfig”
  2. You will find a startup list when you check it with detail view.
  3. If “Program” was/were found, please use the following procedure to fix it.
  1. Start regedit:Press “Win + R” or Start button > Run
  2. In regedit, go to: “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run” / “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run” find out the related program and delete it.

Today (5 July 2022), Google chrome provided a security update related to several security issues. Those threats are already disclosed and used for network attacks and running scripts remotely. Please update it ASAP.

For more detail, please check this link.

A new beginning in the UK

It is the first time to visit the UK in my over 40 years of life. I wish it should be a good fresh start and my child may have a great and free future as he like.

Read More