This file contains hidden or 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
| #!/usr/bin/env fish | |
| function perror --description '显示信息到错误输出' | |
| if test (count $argv) -gt 0 | |
| printf -- $argv >&2 | |
| end | |
| echo >&2 | |
| end | |
| function raise --description '抛出异常消息并退出' |
This file contains hidden or 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
| % 知识库 | |
| %% 性别的实体 | |
| female(ann). | |
| female(eve). | |
| %% 父母的实体 | |
| parent(ann, mary). | |
| parent(tom, eve). | |
| parent(tom, mary). |
This file contains hidden or 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
| ; Translate "Hello world of brainfuck" to LLVM IR manually. | |
| ; ++++++++++ | |
| ; [>+++++++>++++++++++>+++>+<<<<-] | |
| ; >++.>+.+++++++..+++.>++.<<+++++++++++++++. | |
| ; >.+++.------.--------.>+.>. | |
| ; ModuleID = 'helloworld.bf' | |
| source_filename = "helloworld.bf" | |
| target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" | |
| target triple = "x86_64-pc-linux-gnu" |
This file contains hidden or 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> | |
| #include <stdlib.h> | |
| #include <llvm-c/Core.h> | |
| #include <llvm-c/Target.h> | |
| #include <llvm-c/TargetMachine.h> | |
| #define FALSE 0 | |
| #define TRUE 1 |
This file contains hidden or 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 <stdlib.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| #define TOKENS "><+-.,[]" | |
| #define CODE_SEGMENT_SIZE 30000 | |
| #define STACK_SEGMENT_SIZE 1000 | |
| #define DATA_SEGMENT_SIZE 30000 | |
| #define ERROR_CODE_MISSING_FILE 1 |
This file contains hidden or 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 <stdlib.h> | |
| #include <stdio.h> | |
| #include <math.h> | |
| #define BOUND 2000000000 | |
| int primes_count = 0; | |
| int primes[5000] = {0}; | |
| char is_composites[45000] = {0}; // > sqrt(2e9) |
This file contains hidden or 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 <ctype.h> | |
| #include <stdbool.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <fcntl.h> | |
| #include <sys/mman.h> | |
| #include <sys/stat.h> | |
| #include <unistd.h> |
This file contains hidden or 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
| Function ConvertUtf8ToUnicode(bytes() As Byte) As String | |
| Dim ostream As Object | |
| Set ostream = CreateObject("ADODB.Stream") | |
| With ostream | |
| .Type = 1 ' Binary | |
| .Open | |
| .Write bytes | |
| .Position = 0 | |
| .Type = 2 'Text |
OlderNewer