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
import numpy as np | |
import matplotlib.pyplot as plt | |
freq = 10 # 頻率 | |
stop = .25 # 取樣範圍為 0 ~ stop | |
sample_rate = 800 # 取樣率,單位 x 取樣幾次 | |
n = 1000 # 疊加的波數 | |
x = np.linspace(0, stop, int(stop * sample_rate), endpoint = False) | |
i = np.arange(1, 2 * n, 2).reshape((n, 1)) |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
freq = 10 # 頻率 | |
stop = .25 # 取樣範圍為 0 ~ stop | |
sample_rate = 800 # 取樣率,單位 x 取樣幾次 | |
x = np.linspace(0, stop, int(stop * sample_rate), endpoint = False) | |
y = np.sin(freq * 2 * np.pi * x) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function array(lt) { | |
let unit = _ => _; | |
let no_use = unit; | |
let no = _ => f => f(no_use); | |
let when = unit; | |
let left = p => p(l => _ => l); | |
let right = p => p(_ => r => r); |
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
t = 't=\'\\n\nprint(t[0:3]+t[0:2]+t[3]+t[2]+t[3]*2+t[4]+t[3:5]+t[6:]+t[2]+t[5]+t[6:])' | |
print(t[0:3]+t[0:2]+t[3]+t[2]+t[3]*2+t[4]+t[3:5]+t[6:]+t[2]+t[5]+t[6:]) | |
# r='r=%r;print(r%%r)';print(r%r) |
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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
RedSquare( | |
center: Offset(210, 300), | |
width: 100, | |
height: 200, | |
) | |
); |
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
import 'package:flutter/material.dart'; | |
void main() => runApp( | |
RedSquare( | |
center: Offset(210, 300), | |
width: 100, | |
height: 200, | |
) | |
); |
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> | |
#include <functional> | |
using namespace std; | |
function<int(int)> foo() { | |
return [](int n) -> int { | |
function<int(int)> fac = [&](int n) -> int { | |
return n == 0 ? 1 : n * fac(n-1); | |
}; | |
return fac(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
function _instanceof(left, right) { | |
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { | |
return !!right[Symbol.hasInstance](left); | |
} else { | |
return left instanceof right; | |
} | |
} |
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
// 透過非同步產生器函式 | |
const vertex2 = { | |
x: 1, | |
y: 2, | |
z: 3, | |
[Symbol.asyncIterator]: async function* () { | |
for (let key in this) { | |
yield this[key]; | |
} | |
} |