Pharath Documentation
website·Indexed 29 days ago
https://pharath.netlify.appA collection of technical notes, tutorials, and cheatsheets covering multiple programming languages and frameworks, including Java (Spring Boot, Jakarta EE, Hibernate), JavaScript (React, TypeScript), C++, Python (Selenium, Streamlit), and R, as well as web fundamentals like HTTP and CSS.
What's inside Pharath Docs
- Next.js is an open-source full-stack web development framework created by Vercel. It extends traditional React applications by providing server-side rendering (SSR) and static website generation (SSG), allowing applications to be rendered on the server-side rather than exclusively in the client-side browser. It is recommended for developers building server-rendered websites with Node.js.
Overview of TypeScript
TypeScript is a strict syntactical superset of JavaScript developed by Microsoft. It adds optional static typing to the language, making it suitable for large-scale application development. Because it is a superset, all valid JavaScript code is also valid TypeScript. TypeScript code must be transpiled into JavaScript to run in a browser or Node.js environment.Overview of State Management with React Hooks
State management in React allows applications to respond dynamically to user input by tracking data changes over time. In functional components, this is achieved using Hooks. Unlike class-based state management, Hooks allow state to be broken into multiple independent pieces rather than a single state object, resulting in shorter and more maintainable code.
Key Hooks for state management include:
useState: Used for setting a value without needing to reference the current state.useReducer: Used for complex data manipulations or when the new state depends on the previous value.
Overview of Project Lombok for Java
Project Lombok is a Java library that provides a set of annotations (such as@Getterand@Setter) to automatically generate boilerplate code, such as getters, setters, and constructors, during compilation. To use Lombok in IntelliJ IDEA, the Lombok plugin is required.// Example of Lombok annotations to reduce boilerplate @Getter @Setter public class User { private String name; }Overview of C++ Smart Pointers
Smart pointers are template classes defined in the<memory>header that provide automatic, exception-safe object lifetime management. They act like regular pointers but automatically delete the managed object when it is no longer needed, helping implement the "no nakednew" rule. Default-initialized smart pointers hold a null pointer.#include <memory> // unique_ptr: Represents unique ownership; destructor destroys the object. std::unique_ptr<int> p1 = std::make_unique<int>(10); // shared_ptr: Allows multiple pointers to refer to the same object. std::shared_ptr<int> p2 = std::make_shared<int>(20); // weak_ptr: A companion class providing a weak reference to an object managed by a shared_ptr. std::weak_ptr<int> w1 = p2;Identify C++ Entities
In C++, an entity is a fundamental building block of a program. Entities include values, objects, references, structured bindings (C++17), functions, enumerators, types, class members, templates, template specializations, parameter packs (C++11), and namespaces. Note that preprocessor macros are not considered C++ entities.Understand C++ Template Basics
Templates are not functions or classes themselves, but instructions (recipes) provided to the compiler to generate specific classes or functions during a process called instantiation. They allow for generic programming by providing parameterized descriptions of code, which prevents code duplication and avoids the need for macros or type erasure.Distinguish between Static and Dynamic Websites
Websites are categorized by how content is delivered to the browser:
- Static Websites: Serve pre-built files (HTML, CSS, JavaScript). They have no backend server-side processing or database. Every visitor receives the same file, and any dynamic behavior is handled on the client side (browser).
- Dynamic Websites: Controlled on the server side using scripting languages (e.g., PHP). The server processes code or queries a database to generate a unique page for each visit, allowing for personalized content (e.g., user-specific dashboards). Page caching can be used to store finished HTML versions of dynamic pages to improve performance.
React Components Overview
React components function similarly to JavaScript functions: they accept arbitrary inputs called 'props' and return React elements (objects representing browser DOM elements) that describe what should appear on the screen.Distinguish between binary and executable files
In a technical context, 'binary' and 'executable' refer to different properties of a file:
- Executable: A file that can be run as a command on the command line. This can be a binary file or a text file (e.g., a Python script with a shebang line
#!/usr/bin/python3and the executable permission bit set). - Binary: A file in a non-text format. Not all binary files are executable; for example, compiled libraries (
.dllor.so) are binaries but cannot be executed directly.
- Executable: A file that can be run as a command on the command line. This can be a binary file or a text file (e.g., a Python script with a shebang line
Understand Monolithic Architecture
A monolithic architecture is a traditional software model where the program is built as a single, unified unit. It is self-contained and independent from other applications, meaning all components are bundled together rather than split into separate services.Understand Jakarta EE (formerly Java EE) specifications
Jakarta EE (formerly Java Platform, Enterprise Edition or J2EE) is a set of specifications that extend Java SE to provide enterprise-grade features. It defines APIs and their interactions for distributed computing, web services, transactions, security, scalability, and concurrency. Jakarta EE applications run on reference runtimes, such as application servers or microservices, which handle the deployment and management of components. Compliance is determined by whether a provider meets the specific conformance requirements of the Jakarta EE specification.