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 <gtk/gtk.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#define W_WIDTH 500 | |
#define W_HEIGHT 500 | |
#define N W_WIDTH | |
const double k=1.0; | |
const double dt=0.002,dx=0.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
#define LEFT 1 | |
#define RIGHT 2 | |
main(){ | |
FILE *pio; | |
int input=0,x=72,y=26; | |
pio=fopen("pio","a+"); | |
if(pio==NULL) abort(); | |
pioset(LEFT&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
#include <GL/glut.h> | |
#include <complex> | |
using namespace std; | |
constexpr int w_width=640,w_height=640,countnum=100; | |
double dx,dy; | |
int convergence(const complex<double>&); | |
void init(); |
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> | |
using ulong=unsigned long; | |
ulong fibo(ulong n){ | |
return n<2?n:fibo(n-1)+fibo(n-2); | |
} | |
int main(){ | |
ulong 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> | |
using ulong=unsigned long; | |
ulong fibo_sub(ulong,ulong,ulong); | |
ulong fibo(ulong n){ | |
return (n==0)?0:fibo_sub(n,1,0); | |
} |
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 <complex> | |
#include <cmath> | |
#include <vector> | |
using namespace std; | |
using cplx=complex<double>; | |
template<typename T> | |
constexpr T pi(){ | |
return 3.141592653589793238463L; |
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 <vector> | |
#include <string> | |
#include <fstream> | |
typedef std::vector<std::string> Table; | |
typedef unsigned long long int ullint; | |
ullint rectnum(const Table&); |
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
PATTERNFILE=./pattern.txt | |
echo 0=0% > /dev/servoblaster | |
echo 1=0% > /dev/servoblaster | |
sleep 2 | |
ports=(`echo "100 100 100 100 100 100 100 100"`) | |
while read line; do | |
ary=(`echo $line`) | |
port=${ary[0]} | |
str=`echo "${port}=${ports[$port]}%"` | |
echo $str > /dev/servoblaster |
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 <fstream> | |
#include <random> | |
#include <cmath> | |
#include <Eigen/Dense> | |
#include <Eigen/LU> | |
int main(){ | |
constexpr int deg = 2; | |
constexpr double omega = 2.0*M_PI*2.0; |
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 <complex> | |
#include <vector> | |
#include <iomanip> | |
using complexd=std::complex<double>; | |
void showpoly(const std::vector<double> &coeffs); | |
complexd poly(const std::vector<double> &coeffs,const complexd &z); | |
void DKA(const std::vector<double> &coeffs,std::vector<complexd> &poles); |
OlderNewer