原创 Linux sample using fork and signal

#include"xylib/xiuye" #include<unistd.h> #include <signal.h> // #include <sys/types.h> #include <wait.h> using namesp

原创 Rust 強制類型轉換 使用as 將 不變 變成 可變

fn g(&self)->&mut Self{ unsafe { & mut * ( self as * const Self as * mut Self)} } as 只能轉換基本數據類型 ,結構體類型 只

原创 My library test once

package com.xiuye.util.test.code; import java.util.Map; import java.util.concurrent.ExecutionException; import java.u

原创 JavaScript 編程範式:默認空值

// 這種方式是錯誤的!!!因爲是引用,所以賦值只是同一個 // 容易引起隱藏bug! // 不要定義靜態變量賦初始值,否則容易出bug // const EMPTY_ARRAY = []; // const EMPTY_STR

原创 JavaScript 繼承(但是不能繼承構造函數本身創建對象時的屬性!)

function dom(c){ this.node = c; } function canvas(c) { // canvas.prototype = new dom(c); // //console.lo

原创 JavaScript 編程範式:of 接口,告別手動new對象.

var of_interface = { // valueOf: function (...d) { // return new this(...d); // }, // of: function (...d) {

原创 Mysql modify password

UPDATE user set `Password`=PASSWORD('root'); flush privileges;//very important  

原创 JavaScript 迭代器協議

var a = {}; a[Symbol.iterator]=function(){var i=0;return {next:()=>{return {value:i++,done:i>20};}}} [...a]  [0, 1, 2,

原创 自頂向下 遞歸 if elseif else 【錯誤結構 不報錯】

private static final String IF = "if"; private static final String ELSE_IF = "else if"; private static fi

原创 JavaScript instanceof 關鍵字理解

function A(){ this.a = 'a'} undefined function B(){this.b = 'b';} undefined A.prototype.__proto__ = B.prototype {const

原创 JavaScript textarea output

<html> <head> <title>class</title> </head> <body> <h1>Class</h1> <textarea id='out'></textarea> <

原创 Rust 強制類型轉換 使用as 將不變編程可變

fn g(&self)->&mut Self{ unsafe { & mut * ( self as * const Self as * mut Self)} } as 只能轉換基本數據類型 ,結構體類型 只

原创 Java Unicode to Java

public static void unicode2Java(String fileName, String outputFilePath) throws IOException { File f = new File(fileN