This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 元数据 | |
let a = { | |
source: { number: 0 } | |
} | |
// 核心:Object.defineProperty | |
Object.defineProperty(a, 'number', { | |
enumerable: true, | |
configurable: true, | |
get: function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let N = 10 | |
let source = [] | |
let M = 4 | |
for (let i = 0; i < N; i++) { | |
let len = Math.floor(Math.random() * 5) + 5 | |
let item = [] | |
for (let j = 0; j < len; j++) item.push(Math.floor(Math.random() * 10)) | |
source.push(item) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
for (float y = 1.5f; y > -1.5f; y -= 0.1f) { | |
for (float x = -1.5f; x < 1.5f; x += 0.07f) { | |
float a = x * x + y * y - 1; | |
putchar(' '); | |
putchar(a * a * a - x * x * y * y * y <= 0.0f ? '*' : ' '); | |
} | |
putchar('\n'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
const int N = 8; | |
int queen[N]; | |
bool check(int n) { | |
for (int i = 0; i < n; i++) { | |
int x = n - i; | |
int y = queen[n] - queen[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
echo "========================================" | |
echo " macOS restoring script" | |
echo " Copyright Hawkins Zhao 2017" | |
echo "========================================" | |
echo "---> Restoring Applications..." | |
cp ./Apps/* /Applications/ |
NewerOlder