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 <sys/time.h> // timer | |
#include <stdio.h> // printf | |
#include <stdlib.h> // malloc, free | |
#include <stdbool.h> // bool | |
const int N = 1000000; // Range of Prime | |
const int nTest = 2; // Two test | |
struct Measurement { | |
int nPrime; // number of Primes |
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 <vector> | |
#include <iostream> | |
#include <sstream> | |
#include <math.h> | |
#include <sys/time.h> | |
using namespace std; | |
class BigNumber { | |
private : |
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> // printf | |
#include <math.h> // sin, atan | |
double simpson(double a, double b, double (*func)(double)); // Simpson's_rule | |
double integral(double xi, double xf, int n, double (*func)(double)); // Integral with some tools | |
int main() { | |
double pi = 4.0*atan(1.0); | |
double surface; | |
for (int i=10; i<=50; i+=2) { |
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> | |
#define MAXSIZE 80 | |
void strcomp(char* p1, char* p2); | |
void read_string(char *pt); | |
int main(void) | |
{ | |
char line1[MAXSIZE]="", line2[MAXSIZE]=""; | |
printf("Enter first string : "); | |
//fgets(line1, sizeof(line1), stdin); |
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> | |
#define MAXSIZE 256 | |
void read_string(char* p); | |
int main(void) { | |
char c, s[MAXSIZE]; | |
puts("I/O lib"); | |
puts(""); |
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 <string.h> | |
#define SIZE 256 | |
#define NITEM 15 | |
int getData(char* line, char** t); | |
void outputResult(FILE *fout, char** title, char** t, int N); | |
int main(void) { | |
char s; |
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
/* | |
* kernel module for LED | |
* | |
* Author: | |
* Wan-Ting CHEN (wanting@gmail.com) | |
* | |
* This software is licensed under the terms of the GNU General Public | |
* License version 2, as published by the Free Software Foundation, and | |
* may be copied, distributed, and modified under those terms. | |
* |
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
obj-m += dht11.o | |
all: | |
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules | |
clean: | |
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean |
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
/dts-v1/; | |
/plugin/; | |
/ { | |
compatible = "brcm,bcm2835", "brcm,bcm2708"; | |
/* disable spi-dev for spi0.0 */ | |
fragment@0 { | |
target = <&spi0>; | |
__overlay__ { | |
status = "okay"; |
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
// Definitions for MPU6050 | |
/dts-v1/; | |
/plugin/; | |
/ { | |
compatible = "brcm,bcm2708"; | |
fragment@0 { | |
target = <&i2c1>; | |
__overlay__ { |
OlderNewer