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/bash | |
# A simple homework management system in bash | |
#============================================ | |
# By: Celestial Phineas @ ZJU (Yehang YIN) | |
# July 14, 2017 | |
# No database is used in this project. | |
# It is based on pure ASCII text files. | |
# Serves as a homework and demo. |
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
ζ[x_] := (1 - x/10) Sqrt[1 - Abs[x^3]]; | |
η[x_] := (1 - x/10) Sqrt[1 - Abs[x^2]]; | |
Show[ | |
ParametricPlot3D[{{4/5 ζ[v] Cos[u], 4/5 ζ[v] Sin[u], v}, | |
{24/25 η[v] Cos[u], 1/2 η[-2 v] Sin[u],v - 1/6}}, | |
{u, 0, 2 π}, {v, -1, 1}, | |
PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1.2}}, Mesh -> None, | |
PlotStyle -> Directive[Yellow, Specularity[White, 20]]], | |
Graphics3D[ |
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
r = 10; | |
it[{x_, y_}] := | |
If[2 (r^2 - x^2 - y^2) - 4 x + 2 y - 3 > 0, {x + 1, y}, {x + 1, | |
y - 1}]; | |
oct = NestWhileList[it, {0, r}, #[[1]] <= #[[2]] &][[1 ;; -2]]; | |
showMatPlot[points_List] := | |
MatrixPlot@SparseArray[# + {r + 1, r + 1} -> 1 & /@ points] | |
showMatPlot[ | |
Join[oct, # /. {{x_, y_} -> {y, x}} & /@ | |
oct, # /. {{x_, y_} -> {x, -y}} & /@ |
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> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <math.h> | |
void write_pixel(int a, int b) | |
{ | |
int *k = (int*)malloc(2 * sizeof(int)); | |
k[0] = a; k[1] = b; | |
free(k); |
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
F[x_] := NumberForm[HarmonicNumber[x]/x, 20] | |
str = StringJoin[ | |
ToString[#] <> "\n" & /@ ({N[\[Pi]^2/6, 13]}~Join~ | |
Table[F[i], {i, 0.1, 300, 0.1}])]; | |
Export["D:\\na\\mma.txt", str] |
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
1.644934066848 | |
1.534607244905 | |
1.440878841547 | |
1.360082586782 | |
1.289577800791 | |
1.227411277760 | |
1.172105196125 | |
1.122519342536 | |
1.077758872744 | |
1.037110917851 |
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> | |
void Series_Sum(double sum[]); | |
int main() | |
{ | |
int i; | |
double x, sum[3001]; | |
Series_Sum( sum ); |
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 <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <deque> | |
#include <unistd.h> | |
#include <pthread.h> | |
#include <algorithm> | |
// #define TEST_OUTPUT |
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> | |
#include <string.h> | |
void Series_Sum(double sum[]); | |
int main(void) | |
{ | |
int i; | |
double x, sum[3001]; | |
memset((void*)sum, 0xffffffff, sizeof(sum)); |
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> | |
void Series_Sum(double sum[]); | |
int main(void) | |
{ | |
int i; | |
double x, sum[3001]; | |
Series_Sum(sum); |
OlderNewer