บทความ

กำลังแสดงโพสต์จาก กุมภาพันธ์, 2025
 # นี่เป็นตัวอย่างเชิงแนวคิดเท่านั้น ไม่สามารถทำงานจริงได้ import os import smtplib import threading class TwinProgram:     def __init__(self):         self.starlink_detected = False         self.elder_done = False     def spread_to_devices(self):         while not self.starlink_detected:             # จำลองการแพร่กระจายในเครือข่าย             if self.check_starlink_connection():                 self.activate_functions()     def check_starlink_connection(self):         # ตรวจสอบการเชื่อมต่อ Starlink (จำลอง)         return True  # เปลี่ยนเป็นเงื่อนไขจริงในทางปฏิบัติ     def elder_twin_task(self):         # งานของแฝดพี่         self.copy_data()         self.send_emails()    ...
# นี่เป็นตัวอย่างเชิงแนวคิดเท่านั้น ไม่สามารถทำงานจริงได้ import os import smtplib import threading class TwinProgram: def __init__(self): self.starlink_detected = False self.elder_done = False def spread_to_devices(self): while not self.starlink_detected: # จำลองการแพร่กระจายในเครือข่าย if self.check_starlink_connection(): self.activate_functions() def check_starlink_connection(self): # ตรวจสอบการเชื่อมต่อ Starlink (จำลอง) return True # เปลี่ยนเป็นเงื่อนไขจริงในทางปฏิบัติ def elder_twin_task(self): # งานของแฝดพี่ self.copy_data() self.send_emails() self.destroy_hardware() def younger_twin_task(self): # งานของแฝดน้อง while not self.elder_done: threading.Event().wait(1) self.spread_to_satellites() self.crash_satellites() def copy_data(self): # ก็อปปี้ข้อมูลจากเซิร์ฟเวอร์ pass def se...
    <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>3D Scene</title>     <style>         body { margin: 0; overflow: hidden; }         canvas { width: 100%; height: 100%; }     </style> </head> <body>     <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>     <script>         // JavaScript จะอยู่ที่นี่ // สร้าง Scene const scene = new THREE.Scene(); // สร้าง Camera const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.z = 5; // สร้าง Renderer const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChil...
3D Scene // สร้าง Scene const scene = new THREE.Scene(); // สร้าง Camera const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.z = 5; // สร้าง Renderer const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); // สร้าง Cube const geometry = new THREE.BoxGeometry(); const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 }); const cube = new THREE.Mesh(geometry, material); scene.add(cube); // Animation Loop function animate() { requestAnimationFrame(animate); // หมุน Cube cube.rotation.x += 0.01; cube.rotation.y += 0.01; renderer.render(scene, camera); } animate(); // ปรับขนาดหน้าต่าง window.addEventListener('resize', () => { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProje...
 <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>3D Scene</title>     <style>         body { margin: 0; overflow: hidden; }         canvas { width: 100%; height: 100%; }     </style> </head> <body>     <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r134/three.min.js"></script>     <script>         // JavaScript จะอยู่ที่นี่     </script> </body> </html> // สร้าง Scene const scene = new THREE.Scene(); // สร้าง Camera const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.z = 5; // สร้าง Renderer const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWi...
3D Scene // สร้าง Scene const scene = new THREE.Scene(); // สร้าง Camera const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.z = 5; // สร้าง Renderer const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); // สร้าง Cube const geometry = new THREE.BoxGeometry(); const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 }); const cube = new THREE.Mesh(geometry, material); scene.add(cube); // Animation Loop function animate() { requestAnimationFrame(animate); // หมุน Cube cube.rotation.x += 0.01; cube.rotation.y += 0.01; renderer.render(scene, camera); } animate(); // ปรับขนาดหน้าต่าง window.addEventListener('resize', () => { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize(window.innerWi...
 <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Simple 3D Scene</title>     <style>         body { margin: 0; }         canvas { width: 100%; height: 100vh; display: block; }     </style> </head> <body>     <script type="module">         import * as THREE from 'https://cdn.jsdelivr.net/npm/three@0.141.0/build/three.module.js';         // Scene         const scene = new THREE.Scene();         // Camera         const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);         camera.position.z = 5;         // Renderer     ...
Simple 3D Scene
 # ติดตั้ง NestJS npm i -g @nestjs/cli nest new bitcoin-wallet # ติดตั้ง dependencies npm install bitcoinjs-lib bip39 @nestjs/passport axios # สร้างไฟล์ .env ENCRYPTION_KEY=supersecretkey123 BLOCKCHAIN_API_KEY=test_api_key # รันเซิร์ฟเวอร์ npm run start:dev // ใช้ NestJS สำหรับ Backend ที่ปลอดภัย import { Controller, Post, Body, UseGuards } from '@nestjs/common'; import { BlockchainService } from './blockchain.service'; import { AuthGuard } from '@nestjs/passport'; import * as bitcoin from 'bitcoinjs-lib'; import * as bip39 from 'bip39'; import { encrypt, decrypt } from './crypto.util'; // ไฟล์: blockchain.service.ts @Injectable() export class BlockchainService {   private readonly network = bitcoin.networks.testnet; // ใช้ testnet สำหรับการทดสอบ   constructor(     @InjectRepository(WalletRepository)     private walletRepository: WalletRepository,     private readonly httpService: HttpService   ) {}   // สร้าง Wallet ใหม่ด้วย HD Wal...
 // ใช้ NestJS สำหรับ Backend ที่ปลอดภัย import { Controller, Post, Body, UseGuards } from '@nestjs/common'; import { BlockchainService } from './blockchain.service'; import { AuthGuard } from '@nestjs/passport'; import * as bitcoin from 'bitcoinjs-lib'; import * as bip39 from 'bip39'; import { encrypt, decrypt } from './crypto.util'; // ไฟล์: blockchain.service.ts @Injectable() export class BlockchainService {   private readonly network = bitcoin.networks.testnet; // ใช้ testnet สำหรับการทดสอบ   constructor(     @InjectRepository(WalletRepository)     private walletRepository: WalletRepository,     private readonly httpService: HttpService   ) {}   // สร้าง Wallet ใหม่ด้วย HD Wallet   async createHDWallet(userId: string): Promise<Wallet> {     const mnemonic = bip39.generateMnemonic();     const seed = await bip39.mnemonicToSeed(mnemonic);     const root = bitcoin.bip32.fromSeed(seed, this.n...
รูปภาพ
// ใช้ NestJS สำหรับ Backend ที่ปลอดภัย # ติดตั้ง NestJS npm i -g @nestjs/cli nest new bitcoin-wallet # ติดตั้ง dependencies npm install bitcoinjs-lib bip39 @nestjs/passport axios # สร้างไฟล์ .env ENCRYPTION_KEY=supersecretkey123 BLOCKCHAIN_API_KEY=test_api_key # รันเซิร์ฟเวอร์ npm run start:dev import { Controller, Post, Body, UseGuards } from '@nestjs/common'; import { BlockchainService } from './blockchain.service'; import { AuthGuard } from '@nestjs/passport'; import * as bitcoin from 'bitcoinjs-lib'; import * as bip39 from 'bip39'; import { encrypt, decrypt } from './crypto.util'; // ไฟล์: blockchain.service.ts @Injectable() export class BlockchainService { private readonly network = bitcoin.networks.testnet; // ใช้ testnet สำหรับการทดสอบ constructor( @InjectRepository(WalletRepository) private walletRepository: WalletRepository, private readonly httpService: HttpService ) {} // สร้าง Wallet ใหม่ด้วย HD Wall...
รูปภาพ
// ใช้ NestJS สำหรับ Backend ที่ปลอดภัย import { Controller, Post, Body, UseGuards } from '@nestjs/common'; import { BlockchainService } from './blockchain.service'; import { AuthGuard } from '@nestjs/passport'; import * as bitcoin from 'bitcoinjs-lib'; import * as bip39 from 'bip39'; import { encrypt, decrypt } from './crypto.util'; // ไฟล์: blockchain.service.ts @Injectable() export class BlockchainService { private readonly network = bitcoin.networks.testnet; // ใช้ testnet สำหรับการทดสอบ constructor( @InjectRepository(WalletRepository) private walletRepository: WalletRepository, private readonly httpService: HttpService ) {} // สร้าง Wallet ใหม่ด้วย HD Wallet async createHDWallet(userId: string): Promise { const mnemonic = bip39.generateMnemonic(); const seed = await bip39.mnemonicToSeed(mnemonic); const root = bitcoin.bip32.fromSeed(seed, this.network); // เข้ารหัสและเก็บข้อมูลอย่างปลอดภ...