Design Patterns

Explain how to use the design patterns. (Creational Patterns) Refer1 Refer2 Refer3 Refer4 1. Creational Design Patterns. Creational design patterns provide various object creation mechanisms, which increase flexibility and reuse of existing code. 1.1 Simple Factory Factory is an object for creating other objects Use cases: when the class does not know beforehand the exact types and dependencies of the objects it needs to create. When a method returns one of several possible classes that share a common super class and wants to encapsulate the logic of which object to create. when designing frameworks or libraries to give the best flexibility and isolation from concrete class types Examples: You want to manufacture the products many times. ...

February 11, 2025 · 6 min · Phong Nguyen

Java Annotations

Annotations in Java are metadata that provide information about the program but do not change its behavior. They can be used for compilation checks, runtime processing, or documentation generation. References: 1. @Override 2. @Deprecated /[ˈdep.rə.keɪt]/ Can be used on a field, method, constructor or class and indicates that this element it outdated and should not be used anymore.

February 5, 2025 · 1 min · Phong Nguyen

Eclipse Platform Plug-in Development

Notes for the eclipse plugin development. References: Wizards and Dialogs Eclipse fragment projects - Tutorial Refer 1. New Project Creation Wizards Every plugin, fragment, feature and update site is represented by a single project in the workspace and allow PDE(Plugin Development Environment) to validate their manifest file(s). File > New > Project... > Plug-in Development Use a Plugin Project if we’re building new functionality. Use a Fragment Project if we need to modify an existing plugin without changing its core code. ...

February 5, 2025 · 8 min · Phong Nguyen

Cpp

See plus plus :) . Refer 0. Notes printf/snprintf Cheat Sheet {C / C++} Integer Data type Specifier Notes int8_t / signed char %hhd signed 8-bit uint8_t / unsigned char %hhu unsigned 8-bit int16_t / short %hd signed 16-bit uint16_t / unsigned short %hu unsigned 16-bit int32_t / long %ld signed 32-bit uint32_t / unsigned long %lu unsigned 32-bit int64_t / long long %lld signed 64-bit uint64_t / unsigned long long %llu unsigned 64-bit Floating point Data type Specifier Notes float %f 4-byte float double %f Arduino AVR: double = float long double %Lf depends on platform %e → scientific notation %g → auto select %f or %e Char / String Data type Specifier Notes char %c single character char* / String %s null-terminated string Pointer / Address Data type Specifier Notes void* %p memory address, hex Hex / Octal / Binary Data type Specifier Notes unsigned int %x / %X hexadecimal unsigned int %o octal Arduino only %b binary Flags, Width, Precision %-10d → left-justify, width 10 %010d → pad with zeros, width 10 %.2f → 2 decimal digits %*d → dynamic width Specific Notes uint32_t → %lu int32_t → %ld uint16_t → %u int16_t → %d or %hd uint8_t → %u or %hhu int8_t → %d or %hhd float → %f Use snprintf() with correctly sized buffer to avoid overflow 1. Introduction C++ was developed as an extension to C. It adds man few features to the C language, and tis perhaps best through of as a superset of C. Step 1: Define the problem that you would like to solve ...

February 9, 2025 · 16 min · Phong Nguyen

Java Data Structures and Algorithm

May 1, 2025 · 0 min · Phong Nguyen

Java Platform Standard Edition

Java is a programming language created by James Gosling from Sun Microsystems (Sun) in 1991. Java allows to write a program and run it on multiple operating systems. References: Java Platform Standard Edition 8 Documentation Introduction to Java programming - Tutorial 1. Introduction to Java Oracle has two products implement Java SE: JDK (Java SE Development Kit): is a superset of JRE. JRE (Java SE Runtime Environment): provides the libraries, the Java Virtual Machine (JVM) and other components. 1.1. Development Process with Java Source code is first written in .java file. Those source files are then compiled into .class files by the Java compiler( javac). A .class file contains bytecodes(the machine language of the Java VM). The .class file will be run by Java tool as an instance of the Java VM. The Java virtual machine (JVM) is a software implementation of a computer that executes programs like a real machine. Because the Java VM is available on many different OS, the same .class files are capable of running on many OS too. ...

November 12, 2024 · 5 min · Phong Nguyen

Java Basic IO

Explain how to use basic I/O. References: Basic I/O Reading and writing files in Java (Input/Output) - Tutorial 1. I/O Streams An I/O Stream represents and input source or an output destination. A stream is a sequence of data. input stream: is used to read data from source, once item at a time. outputs stream: is used to write data to a destination, once item |at a time. --stream--> 0101010101... ----------> java.io package ...

November 14, 2024 · 6 min · Phong Nguyen

English Writing

Learn about English.

December 30, 2024 · 1 min · Phong Nguyen

English Stories

Welcome to this exciting collection of stories inspired by the “4000 Essential English Words” series. 1. The Lion and the Rabbit afraid, agree, angry, arrive, attack, bottom, clever, cruel, finally, hide, hunt, lot, middle, moment, pleased, promise, reply, safe, trick, well A cruel lion lived in the forest. Every day, he killed and ate a lot of animals. The other animals were afraid the lion would kill them all. ...

November 28, 2024 · 84 min · Phong Nguyen

English Grammar

This is where I study English grammar on my own every day. It’s a place where I not only improve my language skills but also discover new grammar rules. Step by step, I am working to become more confident in writing and communicating in English. The journey isn’t easy, but I believe that with patience and effort, I will continue to make progress. 1. Tenses Tenses indicate the time of an action or state of being expressed by a verb. ...

October 13, 2024 · 18 min · Phong Nguyen