https://www.linkedin.com/pulse/industry-50-next-industrial-revolution-around-corner-shirish-kulkarni/
วันพฤหัสบดีที่ 27 สิงหาคม พ.ศ. 2569
วันอาทิตย์ที่ 23 สิงหาคม พ.ศ. 2569
Cloud native vs Cloud agnostic
Cloud agnostic means designing software and systems so they can run on any cloud platform, like AWS, Azure, or Google Cloud Platform, without relying on features from only one provider. It helps teams avoid vendor lock-in and move workloads easily.
Tools for cloud agnostic include:
- Containerization: Use Docker so applications run consistently everywhere.
- Orchestration: Use Kubernetes, which is supported by all major cloud providers.
- Open-source databases: Use PostgreSQL or MySQL instead of cloud-specific databases when portability is important.
- Infrastructure as Code (IaC): Use tools like Terraform to provision infrastructure across multiple clouds.
- Standard APIs and protocols: Avoid relying heavily on proprietary cloud services.
Cloud agnostic apps come with costs over cloud native apps :
- Giving up some advanced cloud-native features.
- More engineering effort to maintain portability.
- Potentially higher operational complexity.
- Sometimes lower performance than using provider-specific managed services.
Using GitHub pages to build static websites
1. Create a Repository
- Log in to GitHub.
- Click the + icon in the top-right corner and select New repository.
- Under Repository name, type
username.github.io(replaceusernamewith your exact GitHub username in lowercase). - Set the visibility to Public (required for free accounts).
- Check the box to Add a README file.
- Click Create repository.
- Inside your new repository, click Add file and select Create new file (or Upload files if you already have files ready on your computer).
- Name your primary file
index.html. “IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level directory.” -- [Tyler Fisher / GitHub Gist]. - Add basic HTML content to the file, such as:html
<!DOCTYPE html> <html> <head> <title>My GitHub Website</title> </head> <body> <h1>Hello, world!</h1> </body> </html>Use code with caution. - Scroll down and click Commit changes to save the file.
- Navigate to the Settings tab under your repository name.
- In the left sidebar under the "Code and automation" section, click Pages.
- Under Build and deployment, locate the "Source" dropdown and ensure Deploy from a branch is selected.
- Under Branch, change the dropdown from "None" to
main(ormaster). - Leave the folder as
/ (root)and click Save.
- Wait 1 to 2 minutes for GitHub to process the deployment.
- Open a web browser and type
https://username.github.io(swapping in your actual username). Your site is now live to the public!
วันอังคารที่ 18 สิงหาคม พ.ศ. 2569
Web scraping
Web scraping (เว็บสแครป) คือการใช้โปรแกรมดึงข้อมูลจากเว็บไซต์โดยอัตโนมัติ แล้วนำข้อมูลมาประมวลผลหรือจัดเก็บ เช่น CSV, database หรือ JSON
ตัวอย่างง่าย ๆ:
- โปรแกรมส่ง HTTP request ไปยังเว็บ
- ได้ HTML กลับมา
- วิเคราะห์ HTML เช่นด้วย BeautifulSoup
- ดึงข้อมูลที่ต้องการ เช่น ราคา ชื่อสินค้า หรือบทความ
- บันทึกข้อมูลลงฐานข้อมูล/ไฟล์
ตัวอย่าง
เว็บไซต์มี HTML:
<div class="product">
<h2>iPhone 17</h2>
<span class="price">39,900</span>
</div>
Web scraper สามารถดึงออกมาเป็น:
Product: iPhone 17
Price: 39,900
Web scraping vs Web crawling
- Web crawling → ค้นหาและสำรวจหน้าเว็บจำนวนมาก เช่น search engine
- Web scraping → ดึงข้อมูลเฉพาะที่ต้องการจากหน้าเว็บ
ดังนั้น scraping เน้น “เก็บข้อมูล” ส่วน crawling เน้น “ค้นหา/สำรวจเว็บ”
Tool for web scraping is firecrawl.
วันจันทร์ที่ 17 สิงหาคม พ.ศ. 2569
Classical optimization algorithms in quantum computing
Standard classical code doesn't execute raw on quantum chips, but classical optimization theory forms the indispensable foundation of quantum-era optimization.
1. The Mechanics: Adaptation vs. Foundation
- Why code isn't directly transferable: Digital optimization code relies on classical primitives—if/else logic based on mid-computation values, memory updates, and variable copying. Quantum gates must be unitary (deterministic and reversible) and linear. You cannot simply feed standard C++ or Python optimization code into a quantum processing unit (QPU).
- Why the theory carries over: The underlying mathematics—objective function modeling, convex vs. non-convex geometry, cost landscapes, and loss minimization—remains identical. Quantum algorithms reframe how state space is explored, but what constitutes a optimal point is anchored in classical decision theory.
2. The Evolutionary Spectrum
To visualize how classical optimization bridges into the quantum era:
|
Level |
Role of Classical Optimization |
Example Frameworks |
|
Direct Controller |
Classical algorithms wrap around the QPU, updating circuit angles using measurements from quantum executions. |
SPSA, COBYLA, Adam in VQE/QAOA |
|
Theoretical Blueprint |
Classical metaheuristics modified using quantum mechanics (wavefunctions, quantum tunneling). |
QPSO (Quantum-Behaved PSO), Quantum Simulated Annealing |
|
Quantum-Native Logic |
Strictly quantum linear algebra algorithms designed to solve optimization models natively on QPUs. |
HHL algorithm (linear systems), Quantum Interior-Point Methods |
3. The Practical Reality of the Quantum Era
Quantum optimization won't make classical optimization obsolete; it elevates it:
- Hybrid is the permanent paradigm: Even in the fault-tolerant quantum era, hybrid classical-quantum loops will remain standard because measuring and evaluating intermediate quantum states is computationally expensive compared to running classical matrix operations.
- Classical algorithms handle the heavy lifting: NP-hard combinatorial optimization problems (e.g., portfolio selection, logistics routing, molecular docking) are formulated classically first before mapped onto quantum Hamiltonians.
In short: classical optimization theory is the blueprint and runtime orchestrator; quantum mechanics provides the enhanced hardware speedups for exploring intractable search spaces.
Out-of-Fold (OOF)
Out-of-Fold (OOF) is a validation and model-building technique used heavily in machine learning (especially in competitions like Kaggle) to prevent data leakage and generate unbiased predictions on your training data.
- You split your training data into $K$ parts (e.g., $K = 5$ folds).
- You train your model $5$ times. In each iteration, you use $4$ folds for training and leave $1$ fold out for validation.
How Out-of-Fold Predictions Work
- Fold 1 is validated by a model trained on Folds 2, 3, 4, 5.
- Fold 2 is validated by a model trained on Folds 1, 3, 4, 5.
- (and so on...)
Why is OOF Prediction Important?
1. Unbiased Evaluation of Model Performance
2. Creating Meta-Features for Stacking (Blending)
- If you want to build a stacked ensemble (where Model C takes the predictions of Model A and Model B as its inputs), you cannot just feed Model C the predictions your models made on the training data. If you do, Model C will overfit because Models A and B already "memorized" those training rows.
- Instead, you feed Model C the OOF predictions of Model A and Model B. Because those OOF predictions were generated when each row was "out-of-fold," they mimic how the models behave on truly unseen data.