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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: CloudFormation template to create an IAM Role and Instance Profile for EC2 to connect with AWS Systems Manager (Session Manager). | |
Parameters: | |
RoleName: | |
Type: String | |
Description: Name of the IAM Role for SSM Session Manager. | |
Default: SSMRoleForEC2 # You can change the default value or provide it during stack creation | |
InstanceProfileName: |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: CloudFormation template to launch an EC2 instance with User Data, using Instance Profile for SSM Session Manager access. | |
Parameters: | |
Prefix: | |
Type: String | |
Default: MyApp | |
Description: Prefix for all resource names | |
InstanceType: |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: CloudFormation template to create a Security Group allowing inbound traffic on port 3306 for MariaDB. | |
Parameters: | |
VpcId: | |
Type: AWS::EC2::VPC::Id | |
Description: VPC ID to create the security group in. | |
Prefix: | |
Type: String | |
Default: MyApp |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: CloudFormation template to create a VPC with one public subnet and one private subnet, with customizable CIDR blocks and a common prefix for all resource names. | |
Parameters: | |
VpcCidr: | |
Type: String | |
Default: 10.0.0.0/16 | |
Description: CIDR block for the VPC | |
PublicSubnetCidr: | |
Type: String |
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
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.List; | |
/** | |
* | |
* Cover all patterns of transactions. | |
* | |
* @author kencoba |
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
(* 新妻弘,「演習 群・環・体 入門」,共立出版株式会社 より *) | |
Require Import ZArith. | |
Open Scope Z_scope. | |
Theorem thm_1_1 : forall a b c : Z , a + b = a + c -> b = c. | |
Proof. | |
intros a b c H. | |
apply Z.add_cancel_l with (p := a). | |
assumption. | |
Qed. |
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
import java.io.IOException; | |
import java.io.PrintWriter; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import javax.servlet.http.HttpSession; |
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
class Request | |
end | |
class Read < Request | |
attr_reader :var | |
def initialize(var) | |
@var = var | |
end |
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
class Request: | |
pass | |
class Read(Request): | |
def __init__(self, var): | |
self.var = var | |
class Write(Request): |
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
fn main() { | |
println!("{n}P{r} = {x}", n = 5, r = 2, x = permutation(5, 2)); | |
println!("{n}C{r} = {x}", n = 5, r = 2, x = combination(5, 2)); | |
} | |
pub fn permutation(n: i64, r: i64) -> i64 { | |
let mut result = 1; | |
for i in (n - r + 1)..=n { | |
result *= i; | |
} |
NewerOlder