Skip to content

Instantly share code, notes, and snippets.

@czwen
czwen / heap_sort.c
Last active September 22, 2020 17:37
heap_sort.c
// Hello world! Cplayground is an online sandbox that makes it easy to try out
// code.
#include <stdio.h>
#include <stdlib.h>
void swap(int tree[],int i, int j){
int tmp = tree[i];
tree[i] = tree[j];
mysqldump -u root -p RUNOOB > database_dump.txt
DATA TYPE SPEC DATA TYPE SPEC
CHAR String (0 - 255) INT Integer (-2147483648 to 214748-3647)
VARCHAR String (0 - 255) BIGINT Integer (-9223372036854775808to 9223372036854775807)
TINYTEXT String (0 - 255) FLOAT Decimal (precise to 23 digits)
TEXT String (0 - 65535) DOUBLE Decimal (24 to 53 digits)
BLOB String (0 - 65535) DECIMAL "DOUBLE" stored as string
MEDIUMTEXT String (0 - 16777215) DATE YYYY-MM-DD
MEDIUMBLOB String (0 - 16777215) DATETIME YYYY-MM-DD HH:MM:SS
LONGTEXT String (0 - 4294967295) TIMESTAMP YYYYMMDDHHMMSS
public class ImageCompressUtil {
/**
* 强制压缩/放大图片到固定的大小
*
* @param fileName 压缩文件("c:\\1.png")
* @param targetHeight
* @param targetWidth
* @return
@czwen
czwen / gist:eb086417348125bde5d7e1eacdf0c381
Created July 8, 2020 12:07
Convert strings like under_score to strings like camelCase
find: (\w*)_(\w*)_(\w*)
replace: \l\1\u\2\u\3
UPDATE t_product
JOIN r_product_class on t_product.id = r_product_class.product_id
JOIN t_class on t_class.id = r_product_class.class_id
SET t_product.school_id = t_class.school_company_id;
UPDATE t_product_template
JOIN r_product_class on t_product_template.product_id = r_product_class.product_id
JOIN t_class on t_class.id = r_product_class.class_id
SET t_product_template.school_id = t_class.school_company_id;
var xhr = new XMLHttpRequest();
var token = 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjJkNGE1YTliLTUxNzUtNDBlNS1iZTEwLTEzMTQ3OTg1OGFmYyJ9.nY6LTeWDcPdceB6pnMFb16VIKEkYjl52IpVIzDvhVnRPCRRSXmq48wYxTL5znUpJdHP0nUNFJ4vrxHHnOajbEA';
xhr.open('GET', 'http://localhost/yxt/getInfo');
xhr.setRequestHeader("Authorization",'Bearer '+token);
xhr.send(null);
xhr.onload = function(e) {
var xhr = e.target;
console.log(xhr.responseText);
}
@czwen
czwen / Macbook Pro 2014 install windows 10 .md
Created April 8, 2020 03:23
Macbook Pro 2014 install windows 10
  1. use 1511 version ed2k://|file|cn_windows_10_multiple_editions_version_1511_updated_feb_2016_x64_dvd_8380088.iso|4622118912|3824041FCDFCA670F4BCDAD827C4B63C|/

  2. command : bcdedit /set {default} safeboot minimal

  3. disable bootcamp os switcher and bootcamp

@czwen
czwen / gist:28ae8206e643e706e438debb03b919ea
Last active March 24, 2020 06:14
MacBook pro sleep problems fix. Using Intel 660P 1TB.
sudo pmset -a hibernatemode 0
sudo pmset -a standby 0
mysqldump -u root -p --all-databases --add-drop-database --add-drop-table > all.sql