(概要)
(あればタイムラインを書く)
| module example.account | |
| // アカウントとログインの仕様を、書いてあるとおりに写したもの。 | |
| // | |
| // 3.1 ログイン | |
| // ユーザーはメールアドレスとパスワードを入力してログインを行う。 | |
| // 入力されたパスワードが正しい場合はログインを許可する。 | |
| // ログインに失敗した場合、失敗回数をカウントする。 | |
| // 3回を超えた場合、アカウントはロック状態となりログインができなくなる。 | |
| // 3.2 アカウントの認証 |
| examples for kaigo.共通 | |
| // 表の各セルと、行だけが名指す値。モデル本体と分けてある。 | |
| example 記号を適用する | |
| | "+○○単位は所定単位数に足す" : (単位数(250), 単位加算 { 単位 = 単位数(100) }) -> 単位数(350) | |
| | "-○○単位は所定単位数から引く" : (単位数(766), 単位減算 { 単位 = 単位数(94) }) -> 単位数(672) | |
| | "×○○/100は所定単位数に率を掛ける" : (単位数(250), 割合乗算 { 分子 = 90, 分母 = 100 }) -> 単位数(225) | |
| | "+○○/100は所定単位数に率の分を足す" : (単位数(250), 割合加算 { 分子 = 25, 分母 = 100 }) -> 単位数(313) | |
| | "×200/100は倍にする" : (単位数(396), 割合乗算 { 分子 = 200, 分母 = 100 }) -> 単位数(792) |
| import static net.unit8.raoh.json.JsonDecoders.*; | |
| JsonDecoder<Quantity> quantityDec = | |
| int_().min(1).map(Quantity::new); | |
| JsonDecoder<ShippingAddress> addressDec = | |
| field("shippingAddress", | |
| string().nonBlank().map(ShippingAddress::new)); | |
| // ProductRepositoryを受け取り、flatMapで存在チェックまで行う |
| typeset -g AI_JP_RATIO_THRESHOLD=0.35 | |
| typeset -g AI_MIN_LEN=6 | |
| _ai_jp_len() { | |
| local s="$1" | |
| local jp_only | |
| jp_only=$(print -r -- "$s" | perl -CS -pe 's/[^\p{Hiragana}\p{Katakana}\p{Han}]//g') | |
| echo ${#jp_only} | |
| } |
| import z from "zod"; | |
| const Suit = z.enum(["Spade", "Heart", "Diamond", "Club"]); | |
| const Rank = z.enum(["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]); | |
| const Card = z.object({ | |
| suit: Suit, | |
| rank: Rank, | |
| }); | |
| type Card = z.infer<typeof Card>; | |
| // 手札 |
| import { match } from "ts-pattern"; | |
| import z from "zod"; | |
| const Station = z.object({ | |
| name: z.string() | |
| }) | |
| const Time = z.object({ | |
| hour: z.number().int().min(0).max(12), | |
| minute: z.number().int().min(0).max(59), | |
| }) |
| import org.springframework.aop.aspectj.AspectJExpressionPointcut; | |
| import org.springframework.aop.config.AopConfigUtils; | |
| import org.springframework.context.support.GenericApplicationContext; | |
| import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler; | |
| import org.springframework.security.access.expression.method.MethodSecurityExpressionHandler; | |
| import org.springframework.security.access.prepost.PreAuthorize; | |
| import org.springframework.security.authentication.TestingAuthenticationToken; | |
| import org.springframework.security.authorization.AuthorizationManager; | |
| import org.springframework.security.authorization.method.AuthorizationManagerBeforeMethodInterceptor; | |
| import org.springframework.security.authorization.method.PreAuthorizeAuthorizationManager; |
| /* | |
| * ------------------------------------------------------------ | |
| * "THE YAKINIKUWARE LICENSE" (Revision 42): | |
| * <author> wrote this code. As long as you retain this | |
| * notice, you can do whatever you want with this stuff. If we | |
| * meet someday, and you think this stuff is worth it, you can | |
| * treat me grilled meat in return. | |
| * ------------------------------------------------------------ | |
| */ |
| import com.fasterxml.jackson.databind.BeanDescription; | |
| import com.fasterxml.jackson.databind.JavaType; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import com.fasterxml.jackson.databind.SerializationConfig; | |
| import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition; | |
| import com.fasterxml.jackson.databind.introspect.ClassIntrospector; | |
| import java.util.LinkedHashMap; | |
| import java.util.Map; |