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
初期合計値:5170.897049941528 | |
銀行丸目:5171.0 | |
四捨五入:5178.0 |
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
ArrayList<Double> randomList = new ArrayList<Double>(); | |
IntStream.range(0, 100).forEach(i -> randomList.add((Double) Math.random() * 100)); | |
double total = randomList.stream().mapToDouble(Double::doubleValue).sum(); | |
System.out.println("初期合計値:" + total); | |
ArrayList<BigDecimal> bdList = new ArrayList<BigDecimal>(); | |
randomList.stream().forEach(e -> bdList.add(BigDecimal.valueOf(e).setScale(1,BigDecimal.ROUND_HALF_DOWN))); | |
double total1 = bdList.stream().mapToDouble(f -> f.setScale(0, BigDecimal.ROUND_HALF_EVEN).intValue()).sum(); | |
double total2 = bdList.stream().mapToDouble(f -> f.setScale(0, BigDecimal.ROUND_HALF_UP).intValue()).sum(); | |
System.out.println("銀行丸め:" + total1); |
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
ArrayList<Double> randomList = new ArrayList<Double>(); | |
IntStream.range(0, 100).forEach(i -> randomList.add((Double) Math.random() * 100)); | |
double total = randomList.stream().mapToDouble(Double::doubleValue).sum(); | |
System.out.println("初期合計値:" + total); | |
ArrayList<BigDecimal> bdList = new ArrayList<BigDecimal>(); | |
randomList.stream().forEach(e -> bdList.add(BigDecimal.valueOf(e).setScale(1,BigDecimal.ROUND_HALF_DOWN))); | |
double total1 = bdList.stream().mapToDouble(f -> f.setScale(0, BigDecimal.ROUND_HALF_EVEN).intValue()).sum(); | |
double total2 = bdList.stream().mapToDouble(f -> f.setScale(0, BigDecimal.ROUND_HALF_UP).intValue()).sum(); | |
System.out.println("銀行丸め:" + total1); |
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
public static boolean validate(String password){ | |
List<CharacterRule> rules = Arrays.asList( | |
new CharacterRule(EnglishCharacterData.UpperCase, 1), | |
new CharacterRule(EnglishCharacterData.LowerCase, 1), | |
new CharacterRule(EnglishCharacterData.Digit, 1) | |
); | |
org.passay.PasswordValidator validator = new org.passay.PasswordValidator(rules); | |
RuleResult result = validator.validate(new PasswordData(new String(password))); | |
if(result.isValid()){ |
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
compile group: 'org.passay', name: 'passay', version: '1.3.1' |
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
List<CharacterRule> rules = Arrays.asList( | |
new CharacterRule(EnglishCharacterData.UpperCase, 1), | |
new CharacterRule(EnglishCharacterData.LowerCase, 1), | |
new CharacterRule(EnglishCharacterData.Digit, 1) | |
); | |
PasswordGenerator generator = new PasswordGenerator(); | |
String password = generator.generatePassword(8, rules); |
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
{ | |
"Version": "2012-10-17", | |
"Id": "Policy1545355831606", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1545354895546", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "*", | |
"Resource": [ |
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
"Resource": [ | |
"arn:aws:s3:::[BucketName]/*", | |
"arn:aws:s3:::[BucketName]" | |
], |
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
{ | |
"Version": "2012-10-17", | |
"Id": "Policy1545355831606", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1545354895546", | |
"Effect": "Deny", | |
"Principal": "*", | |
"Action": "*", | |
"Resource": [ |
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
query search(id: $id) { | |
getTableA(id:$id) { | |
id | |
name | |
getTableB(id:$id) { | |
id | |
{field_parameter} | |
} | |
} | |
} |
NewerOlder