วันเสาร์ที่ 15 สิงหาคม พ.ศ. 2569

C2PA

C2PA (Coalition for Content Provenance and Authenticity) provides an open, cryptographically secure standard to trace the origin (provenance) and edit history of digital media like images, videos, and audio.
Instead of trying to detect deepfakes or altered pixels after the fact, C2PA embeds verifiable metadata directly into the media file, establishing a clear line of custody.
Key Technical Architecture
C2PA relies on Public Key Infrastructure (PKI) and cryptographic hashing to bind history to media across four main layers:
 Assertions: Standardized data blocks containing specific claims—such as camera model, capture timestamp, edit actions (e.g., cropping, color adjustment), or AI generation tools used (e.g., DALL-E, Adobe Firefly).
 Claims: A summary structure that aggregates all assertions made during a specific edit session, along with a cryptographic hash of the raw media asset payload (the "Content Binding").
 Claim Signature: A digital signature produced by an authorized signer (a camera manufacturer, software application, or platform) using their private key and validated against a Public Key Certificate.
 Manifest & Manifest Store: The complete bundle of assertions, claims, and signatures embedded inside the file container (JPEG, MP4, WAV, etc.) or hosted externally via a sidecar link.
Step-by-Step Provenance Workflow
1. Creation: A C2PA-compliant device (like a compatible Leica camera) captures a photo. It creates the initial ingredient manifest, hashes the image bytes, attaches hardware metadata, and signs it using a certificate baked into the device.
2. Editing: When opened in an editing tool (like Photoshop), the application reads the previous manifest, applies changes, logs the edit operations, hashes the newly edited file, and appends a new signed manifest pointing back to the parent manifest.
3. Verification: A user or platform runs a validator (such as Content Credentials or an inspection API). The validator re-computes the image hash to check if the file was modified without a signature update, checks the signature against trusted Certificate Authorities (CAs), and displays the full audit trail.

This standard will be used to implement watermark for AI generated content as directed by EU law: The legislation is the EU Artificial Intelligence Act (Regulation (EU) 2024/1689).  

Specifically, Article 50 of the Act outlines strict transparency obligations regarding AI-generated synthetic content.  

Key Requirements Under Article 50

 Technical Watermarking (Article 50(2)): Providers of generative AI systems (producing images, audio, video, or text) must ensure that outputs are marked in a machine-readable format and detectable as artificially generated or manipulated. Companies fulfill this using techniques like C2PA metadata provenance or invisible embedded watermarking (such as Google's SynthID).  

 Deepfake Disclosure (Article 50(4)): Deployers who publish manipulated image, audio, or video content resembling real people, places, or events ("deepfakes") must explicitly label it to prevent deception.  

 Public Interest Text Disclosure: AI-generated text published to inform the public on matters of public interest must carry a clear disclosure tag unless it has undergone human editorial review.  

Scope & Technical Feasibility

The law includes a "technological proportionality" clause—acknowledging that watermarking must be effective and robust as far as technically feasible. For example, invisible watermarks on very short text snippets (under ~200 tokens) are largely exempt because current technology cannot reliably encode robust signals into very brief text without degrading quality.




Firewall against DDoS

 What Firewalls Can Block

  • Protocol-Based Attacks: Filters out exploited protocol vulnerabilities like ICMP floods (ping floods) or spoofed packet floods using IP/port rules.

  • Basic Connection Limits: Standard firewalls can rate-limit incoming TCP connections from a single IP to prevent connection exhaustion.

  • Stateful Inspection: Next-Generation Firewalls (NGFW) can drop incomplete or suspicious connection attempts (such as SYN floods) before they hit internal servers.

Where Firewalls Fail Against DoS/DDoS

  • Volumetric Attacks: If an attacker sends 100 Gbps of traffic and your network pipe is 10 Gbps, the link saturates upstream before traffic even hits the firewall.

  • Resource Exhaustion: Stateful firewalls track active connections in a state table. Flooding millions of request IPs exhausts the firewall's own CPU/RAM, causing the firewall itself to crash or drop legitimate traffic.

  • Application-Layer (Layer 7) Attacks: HTTP GET/POST floods mimic legitimate user behavior. Standard firewalls cannot easily distinguish valid web traffic from malicious requests.

Effective Defense Strategy For complete protection, firewalls must be combined with dedicated DDoS mitigation systems:

  • Cloud-based Anycast Scrubbing: Services (like Cloudflare, AWS Shield, or Akamai) absorb massive volumetric traffic upstream before it reaches your network interface.

  • Web Application Firewalls (WAF): Specifically inspect Layer 7 traffic to filter out malicious HTTP requests, botnets, and rate-limit specific endpoints.

  • ISP-Level Rate Limiting: Routers at the ISP level drop BGP blackhole or rate-limited traffic during high-volume spikes.

  • CDN: Absorbs massive volumetric traffic spikes using Anycast networks and integrates Edge Web Application Firewalls (WAF).

Quantum communication

 Quantum Communication Technologies

  • Quantum Key Distribution (QKD): Uses single photons or entangled photon pairs to negotiate symmetric cryptographic keys. Its sole purpose is secure key exchange, which is then used by classical encryption algorithms (like AES) to encrypt actual data.

  • Quantum Teleportation: Transfers an unknown quantum state (qubit) from one location to another using quantum entanglement and classical communication, without physically transmitting the quantum particle itself.

  • Direct Quantum Communication: Sends actual quantum information (qubits) directly between quantum computers to perform distributed quantum computing, rather than just using quantum states to generate secret keys.

  • Quantum Networks & Quantum Internet: Interconnected systems using quantum repeaters and routers to relay quantum information over long distances without collapsing or measuring the quantum states along the way.

เมื่อเครื่องถูก hacked



วันจันทร์ที่ 10 สิงหาคม พ.ศ. 2569

Permutation

A permutation is an arrangement of objects in a specific order. In permutations, the order matters.

For example, if you have the letters A, B, and C, the possible permutations are:

  • ABC
  • ACB
  • BAC
  • BCA
  • CAB
  • CBA

There are 6 different arrangements because changing the order creates a new permutation.

For the general case of choosing and arranging r objects from n different objects:

The formula is:

{}^nP_r = \frac{n!}{(n-r)!}

where:

  • n = total number of objects
  • r = number of objects to arrange
  • ! (factorial) means multiplying a number by all positive integers below it (e.g., 5! = 5 \times 4 \times 3 \times 2 \times 1 = 120).

Example

How many ways can you arrange 2 letters from A, B, C?

The arrangements are:

  • AB
  • AC
  • BA
  • BC
  • CA
  • CB

There are 6 permutations.

Using the formula:

{}^3P_2 = \frac{3!}{(3-2)!} = \frac{6}{1} = 6

Permutation vs. Combination

  • Permutation: Order matters. Example: AB and BA are different.
  • Combination: Order does not matter. Example: AB and BA are the same.

A simple way to remember it is:

Permutation = Position matters; Combination = Choice matters.


วันศุกร์ที่ 7 สิงหาคม พ.ศ. 2569

MD file

A file with the .md extension is a Markdown file. Markdown is a lightweight markup language that allows you to write formatted text using simple, plain-text syntax.

Header            # Header

Italic text         *Italic text*

Bold text        **Bold text**

วันพุธที่ 5 สิงหาคม พ.ศ. 2569

Edge case

An edge case is a problem or situation that occurs only at an extreme (maximum or minimum) operating parameter.

วันพฤหัสบดีที่ 30 กรกฎาคม พ.ศ. 2569

Joint Optimization vs Multi objective optimization

 Short answer: No, joint optimization is not inherently multi-objective optimization, though the two concepts can overlap depending on how a problem is formulated.

Here is the distinction:

  • Joint Optimization refers to optimizing multiple variables or decisions simultaneously rather than optimizing them sequentially or in isolation (e.g., jointly optimizing hardware settings and software parameters). The focus is on what is being optimized together (the decision variables). A joint optimization problem can still have a single scalar objective function (e.g., minimizing total latency).
  • Multi-Objective Optimization (MOO) refers to optimizing multiple, often conflicting objective functions simultaneously (e.g., minimizing cost and maximizing speed). The focus is on what targets are being measured. In multi-objective problems, there is usually no single "best" solution, but rather a set of optimal trade-offs known as the Pareto frontier.

How They Compare

Feature

Joint Optimization

Multi-Objective Optimization

Primary Focus

Multiple variables solved together

Multiple objectives optimized together

Core Goal

Avoid sub-optimal decisions caused by step-by-step optimization

Find trade-offs (Pareto set) between competing goals

Number of Objectives

Can be 1 (Single-objective) or >1 (Multi-objective)

Always >1

Typical Solution

A single optimal set of variables

A Pareto front of trade-off solutions

Where They Overlap

A problem can be both joint and multi-objective:

  1. Joint Single-Objective: You jointly optimize two variables x and y to minimize a single combined cost f(x, y).
  2. Joint Multi-Objective: You jointly optimize two variables x and y to simultaneously minimize latency f_1(x, y) while maximizing energy efficiency f_2(x, y).

วันจันทร์ที่ 27 กรกฎาคม พ.ศ. 2569

Integer Linear Programming (ILP) and MILP

Integer Programming (IP) is a branch of mathematical optimization in which some or all decision variables are constrained to take integer values. It is widely used to solve decision-making problems where fractional values are not meaningful, such as selecting projects, assigning employees, routing vehicles, or placing servers.

General Form

An integer programming problem can be written as









Most practical IP problems have linear objective functions and constraints, leading to Integer Linear Programming (ILP).

Example

Suppose a cloud provider wants to decide how many servers of two types to deploy.

Let:

  • (x_1) = number of Type A servers

  • (x_2) = number of Type B servers








The solution might be:

  • (x_1=4)

  • (x_2=4)

rather than a fractional solution such as (x_1=3.7), which is impossible because you cannot purchase 3.7 servers.

Types of Integer Programming

TypeVariable TypeExample
Pure Integer ProgrammingAll variables are integersNumber of servers to deploy
Mixed Integer Programming (MIP/MILP)Some variables are integers, others continuousNumber of servers (integer) and bandwidth allocation (continuous)
Binary Integer ProgrammingVariables are only 0 or 1Cache an object (1) or not (0), select a data center

Binary variables are especially common because many engineering decisions are yes/no choices.

Why Integer Programming?

Many real-world decisions are inherently discrete:

  • Build a data center or not.

  • Cache a file or not.

  • Assign a request to one server.

  • Schedule an employee.

  • Select network links.

Linear programming (LP) may produce infeasible fractional solutions, such as assigning 2.4 virtual machines or 0.35 of a cache replica, whereas integer programming enforces realistic decisions.

Applications in Computer Science

Since your work involves cloud computing and cache optimization, integer programming is particularly useful for problems such as:

  • Cloud resource allocation: deciding the number of virtual machines or servers.

  • Content placement in CDNs: determining which objects should be cached at each edge server (often modeled as binary variables).

  • Virtual machine placement: assigning VMs to physical hosts while satisfying CPU, memory, and network constraints.

  • Task scheduling: assigning jobs to processors.

  • Network design: selecting links or routers to activate.

  • Facility location: deciding where to place cloud regions or edge servers.

Solving Integer Programming Problems

Unlike linear programming, integer programming is generally NP-hard, meaning there is no known polynomial-time algorithm that solves all instances optimally.

Common exact methods include:

  • Branch and Bound

  • Branch and Cut

  • Cutting Planes

  • Branch and Price

For very large problems, heuristic and metaheuristic methods are often used:

  • Genetic Algorithms

  • Simulated Annealing

  • Tabu Search

  • Ant Colony Optimization

Relationship to Linear Programming

Mathematical Programming
│
├── Linear Programming (LP)
│     Variables: continuous
│
└── Integer Programming (IP)
      │
      ├── Pure Integer Programming (IP)
      ├── Binary Integer Programming (BIP)
      └── Mixed Integer Linear Programming (MILP/MIP)

In summary, integer programming extends linear programming by requiring some or all variables to be integers. This makes it much better suited for discrete decision problems encountered in cloud computing, networking, scheduling, and cache optimization, although it is computationally more challenging to solve.

MILP (Mixed-Integer Linear Programming): Some decision variables are required to be integers, while others are allowed to be continuous (real numbers).


วันพุธที่ 22 กรกฎาคม พ.ศ. 2569

AWS Partyrock

PaaS for automatic App development via LLM and execution platform. https://partyrock.aws/education

It’s equivalent to using Gemini to create app source code and run it manually on https://www.w3schools.com/html/tryit.asp?filename=tryhtml_editor

วันอังคารที่ 21 กรกฎาคม พ.ศ. 2569

Tech stack for webapp development in 2026

 The modern web development ecosystem has largely converged around a few popular technology stacks. The “best” stack depends on the application, but these are the most common choices today.

1. Frontend (what runs in the browser)

The dominant framework is React.

Other popular choices include:

  • React (most popular)
  • Angular (common in large enterprises)
  • Vue.js (popular for simplicity)
  • Svelte/SvelteKit (growing in popularity)

Languages:

  • TypeScript (now preferred over plain JavaScript)
  • JavaScript

UI libraries:

  • Tailwind CSS
  • Material UI
  • Bootstrap


2. Backend (server-side)

Several ecosystems are widely used:

Language

Popular Framework

Java

Spring Boot

C#

ASP.NET Core

JavaScript/TypeScript

Node.js + Express or NestJS

Python

Django, Flask, FastAPI

Go

Gin, Fiber

PHP

Laravel

Typical choices:

  • Spring Boot for enterprise applications.
  • ASP.NET Core in Microsoft-centric organizations.
  • Node.js for JavaScript/TypeScript full-stack development.
  • FastAPI for AI, data science, and high-performance Python APIs. In practice, FastAPI is a Python web framework used to create RESTful web services (REST APIs) and other web applications.


3. Database

Relational databases:

  • PostgreSQL (very popular)
  • MySQL
  • Microsoft SQL Server
  • Oracle Database

NoSQL:

  • MongoDB
  • Cassandra
  • DynamoDB
  • Redis (primarily used as an in-memory cache)


4. API style

Modern applications commonly use:

  • REST (most common)
  • GraphQL (flexible data retrieval)
  • gRPC (high-performance internal services)


5. Authentication

Common standards:

  • OAuth 2.0
  • OpenID Connect (OIDC)
  • JWT (JSON Web Tokens)


6. Cloud platforms

Most deployments target:

  • AWS
  • Microsoft Azure
  • Google Cloud Platform (GCP)

Many organizations also use Kubernetes on-premises or in the cloud.


7. Containers

Modern applications are usually packaged with:

  • Docker
  • Kubernetes (for orchestration)


8. CI/CD

Typical tools include:

  • GitHub Actions
  • GitLab CI/CD
  • Jenkins
  • Azure DevOps


9. Reverse proxy / Load balancer

Common choices:

  • Nginx
  • HAProxy
  • F5 BIG-IP
  • Cloudflare
  • AWS Application Load Balancer (ALB)


10. Monitoring

Popular monitoring and observability tools:

  • Prometheus
  • Grafana
  • ELK Stack (Elasticsearch, Logstash, Kibana)
  • OpenTelemetry
  • Datadog


Example: Startup / SaaS stack

Frontend:

    React + TypeScript


Backend:

    Node.js (NestJS)

       or

    Python (FastAPI)


Database:

    PostgreSQL


Cache:

    Redis


Deployment:

    Docker + Kubernetes


Cloud:

    AWS


Load Balancer:

    Nginx / AWS ALB


API:

    REST


Example: Enterprise stack

Frontend:

    Angular or React


Backend:

    Spring Boot (Java)


Database:

    Oracle or PostgreSQL


Authentication:

    Active Directory + OAuth2


Load Balancer:

    F5 BIG-IP


Deployment:

    VMware or Kubernetes


Monitoring:

    Prometheus + Grafana

This combination is common in banks, government agencies, and large corporations.


Current trends (2026)

For new projects, a very common stack is:

  • Frontend: React + TypeScript
  • Backend: FastAPI (Python), Spring Boot (Java), ASP.NET Core (C#), or NestJS (TypeScript)
  • Database: PostgreSQL
  • Cache: Redis
  • API: REST (or GraphQL if clients need flexible data access)
  • Containerization: Docker
  • Orchestration: Kubernetes
  • Cloud: AWS, Azure, or GCP

This reflects the industry’s shift toward cloud-native, containerized, and API-driven architectures. Given your background in cloud computing and distributed systems, learning React + TypeScript, FastAPI or Spring Boot, Docker, and Kubernetes would provide a strong foundation for understanding and building modern web applications.