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
#ChatGPT | |
歐拉公式(Euler's formula)是一個非常重要的數學定理,它表示: | |
$$e^{i\theta} = \cos{\theta} + i\sin{\theta}$$ | |
其中 $e$ 是自然數 $2.71828\ldots$ , $i$ 是虛數的基本单位, $\theta$ 是任意的实数。 | |
歐拉公式的證明可以由下面幾個步驟完成: |
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
# scrapy crawl quotes | |
``` | |
Hero3C@DESKTOP-O093POU MINGW64 /c/tim/prog10_4 | |
$ scrapy crawl quotes | |
2022-11-10 21:04:58 [scrapy.utils.log] INFO: Scrapy 2.7.1 started (bot: prog10_4) | |
2022-11-10 21:04:58 [scrapy.utils.log] INFO: Versions: lxml 4.9.1.0, | |
libxml2 2.9.12, cssselect 1.2.0, parsel 1.7.0, w3lib 2.0.1, Twisted 22.10.0, Python 3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)], pyOpenSSL 22.1.0 (OpenSSL 3.0.7 1 Nov 2022), cryptography 38.0.3, Platform Windows-10-10.0.19043-SP0 | |
2022-11-10 21:04:58 [scrapy.crawler] INFO: Overridden settings: |
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
csienqu-teacher:~ csienqu$ docker pull ubuntu:latest | |
latest: Pulling from library/ubuntu | |
6b98dfc16071: Pull complete | |
4001a1209541: Pull complete | |
6319fc68c576: Pull complete | |
b24603670dc3: Pull complete | |
97f170c87c6f: Pull complete | |
Digest: sha256:d93e92b9e184f69873bfd8570647a4298b070119baad4f65d003c96464d858da | |
Status: Downloaded newer image for ubuntu:latest | |
csienqu-teacher:~ csienqu$ docker images |
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
csienqu-teacher:~ csienqu$ docker pull ubuntu:latest | |
latest: Pulling from library/ubuntu | |
6b98dfc16071: Pull complete | |
4001a1209541: Pull complete | |
6319fc68c576: Pull complete | |
b24603670dc3: Pull complete | |
97f170c87c6f: Pull complete | |
Digest: sha256:d93e92b9e184f69873bfd8570647a4298b070119baad4f65d003c96464d858da | |
Status: Downloaded newer image for ubuntu:latest | |
csienqu-teacher:~ csienqu$ docker images |
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 <limits.h> | |
#include "sha1.c" | |
void printNow() { // 印出目前時間 | |
time_t now = time(NULL); | |
struct tm *tmNow = (struct tm*) localtime(&now); | |
printf ("Current local time and date: %s", asctime(tmNow)); | |
} | |
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
/* This code is public-domain - it is based on libcrypt | |
* placed in the public domain by Wei Dai and other contributors. | |
*/ | |
// gcc -Wall -DSHA1TEST -o sha1test sha1.c && ./sha1test | |
#include <stdint.h> | |
#include <string.h> | |
#include <stdio.h> | |
/* header */ |
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 <pthread.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
pthread_mutex_t x; | |
pthread_mutex_t y; | |
void *A(); | |
void *B(); |
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 <pthread.h> | |
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; | |
#define LOOPS 100000 | |
int counter = 0; | |
void *inc() | |
{ | |
for (int i=0; i<LOOPS; i++) { |
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 <pthread.h> | |
#define LOOPS 100000 | |
int counter = 0; | |
void *inc() | |
{ | |
for (int i=0; i<LOOPS; i++) { | |
counter = counter + 1; |
NewerOlder