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 <type_traits> | |
| #include <cstdio> | |
| template<int... Items> | |
| struct intlist; | |
| template<typename intlist, int I> | |
| struct push_back; | |
| template<int I, int Head, int... Remainder> |
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 <cstdio> | |
| #include <cstring> | |
| #include <cassert> | |
| typedef enum { | |
| MyOrderedAscending = -1, | |
| MyOrderSame, | |
| MyOrderedDescending | |
| } MyComparisonResult; |
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
| /* | |
| ## Sort Implementation | |
| * Selection Sort (Iterative / Recursive) | |
| * Bubble Sort (Iterative / Recursive) | |
| * Insertion Sort (Iterative / Recursive) | |
| * Interfaces is similar with std::sort() | |
| * Support comparator | |
| */ |
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
| CXX_FLAGS = -W | |
| SRC = different_stack_variable_policy.cpp | |
| all: | |
| @make gcc | |
| @echo "" | |
| @make clang | |
| gcc: | |
| @g++ $(SRC) $(CXX_FLAGS) |
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
| /* | |
| g++ main.cpp -W -Wall | |
| ./a.out | |
| addr x : 7ffc853ffcf4 | |
| addr y : 7ffc853ffcf8 | |
| addr diff: -4 | |
| addr i : 7ffc853ffce4 | |
| addr array: 7ffc853ffcf0 | |
| curr addr : 7ffc853ffcf0 |
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
| CXX = clang++ | |
| CXX_FLAGS = -W -Wall -std=c++11 | |
| all: sample.o partial_a.o partial_b.o main.o | |
| clang++ $^ -o a.out $(CXX_FLAGS) | |
| run: all | |
| ./a.out | |
| sample.o: sample.cpp |
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
| main: | |
| make current; \ | |
| make dystopia | |
| current: new_history_teaching.cpp | |
| rm -rf a.out | |
| clang++ $^ -W -Wall | |
| ./a.out | |
| dystopia: new_history_teaching.cpp |
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
| import os | |
| a = '/home/haruna/devel/libsora.so/content' | |
| b = '../static/sample' | |
| c = 'sidetail-sora.gif' | |
| print(os.path.join(a, b, c)) | |
| #/home/haruna/devel/libsora.so/content/../static/sample/sidetail-sora.gif | |
| a = '/home/sora/devel/libsora.so/content' | |
| b = '/static/sample' |
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 <signal.h> | |
| #include <unistd.h> | |
| static int prev_fib = 0; | |
| static int curr_fib = 1; | |
| void sig_handler(int signo) | |
| { | |
| if (signo == SIGINT) { |
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
| /* | |
| Calculate Average of "Hello, World!". | |
| $ clang++ hello_world.cpp -std=c++11 | |
| $ ./a.out | |
| Rello, aorld | |
| 82 101 108 108 111 44 32 97 111 114 108 100 22 3 0 | |
| */ | |
| #include <string> | |
| #include <cstdio> |