弗莱克斯纳
[按] 30年代美国普林斯顿大学校长亚伯拉罕·弗莱克斯纳(Abraham Flexner)教授曾以 “无用知识的有用性”为题,发表过一篇在科学界有影响的文章。该文章强调了基础研 究以及自由探索的重要性。全文一万余字,现节译如下,以餐读者。
智力与精神生活在表面上是一种无用型活动。人们之所以大量从事这种活动,是因
| #include <cstdio> | |
| #include <cmath> | |
| #include <string> | |
| #include "raylib.h" | |
| #include "waterpool.hpp" | |
| const int WIDTH = 160; | |
| const int HEIGHT = 160; | |
| using PoolType = Sapphire::WaterPool<WIDTH, HEIGHT>; |
| #======================================================================================================================================= | |
| # This script computes the equation of motion of a damped double pendulum using a full Newtonian analysis with sympy, | |
| # then solve them numerically, and finally visualize the solution using matplotlib. | |
| #======================================================================================================================================= | |
| import sympy as sp | |
| import numpy as np | |
| import matplotlib.pyplot as plt |
This post shows how to install android sdk tools without Android Studio. We might need to do in many cases like setting up an CI machine ..etc
We need java, android(tools, build tools), gradle.
| import Base: TwicePrecision, significand_bits, significand_mask, exponent_mask, exponent_bias | |
| # Bits of 1/2π | |
| # 1/2π == sum(x / 0x1p64^i for i,x = enumerate(INV2PI)) | |
| # Can be obtained by: | |
| # | |
| # setprecision(BigFloat, 4096) | |
| # I = 0.5/big(pi) | |
| # for i = 1:19 | |
| # I *= 0x1p64 |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Sine Wave</title> | |
| <script type="text/javascript"> | |
| function showAxes(ctx,axes) { | |
| var width = ctx.canvas.width; | |
| var height = ctx.canvas.height; | |
| var xMin = 0; |
| public static float dist(float x1, float y1, float x2, float y2) { | |
| return (float) Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); | |
| } | |
| public static float getRayCast(float p0_x, float p0_y, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y) { | |
| float s1_x, s1_y, s2_x, s2_y; | |
| s1_x = p1_x - p0_x; | |
| s1_y = p1_y - p0_y; | |
| s2_x = p3_x - p2_x; |
| # simulate coupon collector's problem | |
| import numpy as np | |
| def run(n): | |
| """ | |
| n: number of different coupons (stamps) | |
| return: days it took to achieve such goal | |
| """ |