クラスを継承した場合,コンストラクタとデストラクタの呼び出される順序には注意が必要である.コンストラクタとデストラクタの呼び出しは,以下の順番となる.
- 親クラスのコンストラクタ
- 子クラスのコンストラクタ
- インスタンスの主な処理
| #include <iostream> | |
| #include <cstdio> | |
| #include <string> | |
| #include <vector> | |
| #include <iterator> // std::back_inserter() | |
| #include <set> | |
| #include <map> | |
| #include <algorithm> // std::copy() | |
| #include <functional> // std::greater<T>() | |
| #include <utility> // std::swap() |
| #include <iostream> | |
| #include <cstdio> | |
| #include <string> | |
| #include <vector> | |
| using namespace std; | |
| typedef long long ll; | |
| ll ctoi(char c){ | |
| if('0' <= c && c <= '9') return (c-'0'); |
| #include <iostream> | |
| #include <bitset> | |
| using namespace std; | |
| int calcTwoComlement(signed int n) { | |
| // 2 の補数を算出する関数:ビット反転して 1 を足す | |
| return ~n + 0b01; | |
| } | |
| int main() { |
| import pandas as pd | |
| def main(): | |
| # requirements: pandas, lxml, tabulate | |
| # 正規表現のサイトから「記号」のテーブルを抽出し,Markdown 用のテーブルを出力 | |
| url = 'https://murashun.jp/blog/20190215-01.html' | |
| list_table = pd.read_html(url) | |
| for t in list_table: | |
| print(t.to_markdown()) |
クラスを継承した場合,コンストラクタとデストラクタの呼び出される順序には注意が必要である.コンストラクタとデストラクタの呼び出しは,以下の順番となる.
| ######################################## | |
| # prompt global settings | |
| ######################################## | |
| # document link: https://starship.rs/ja-JP/config/#%E3%83%95%E3%82%9A%E3%83%AD%E3%83%B3%E3%83%95%E3%82%9A%E3%83%88 | |
| # format = "$all" | |
| format = """ | |
| $username\ | |
| $hostname\ | |
| $shlvl\ |
| # Starship default config, extracted from the source | |
| # Configure the format of the prompt | |
| format = """\ | |
| $username\ | |
| $hostname\ | |
| $shlvl\ | |
| $singularity\ | |
| $kubernetes\ | |
| $directory\ |
| # Starship default config, extracted from the source | |
| # Configure the format of the prompt | |
| format = """\ | |
| $username\ | |
| $hostname\ | |
| $shlvl\ | |
| $singularity\ | |
| $kubernetes\ | |
| $directory\ |
| Resources: | |
| # IAM Policy | |
| PolicyLambdaBasicExecution: | |
| Type: AWS::IAM::ManagedPolicy | |
| Properties: | |
| ManagedPolicyName: !Sub "${Prefix}-policy-lambda-basic-execution" | |
| PolicyDocument: | |
| Version: "2012-10-17" | |
| Statement: | |
| - Effect: Allow |
| #!/usr/bin/env perl | |
| $pdf_mode = 3; | |
| $latex = 'uplatex --kanji=utf8 -synctex=1 -file-line-error -halt-on-error %O %S'; | |
| $bibtex = 'upbibtex'; | |
| $dvipdf = 'dvipdfmx %O -o %D %S'; | |
| $makeindex = 'mendex %O -o %D %S'; |