多学习。

上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页
摘要: 题目 题解 动态规划 用二进制表示每种味道尝了没有,如:一共有五种味道,吃了前三种——00111,吃了五种——11111 每包糖果都可以选或不选 dp(i,j) i代表前i包糖果, j代表所能到达的状态(吃了几种种味) 其实就是01背包问题 dp[i-1][j & (~w[i])]+1 意味着:选这 阅读全文
posted @ 2022-04-19 22:22 czyaaa 阅读(63) 评论(0) 推荐(0)
摘要: 题目 题解 #include <iostream> using namespace std; int k; string str; int dfs() { int res = 0; while(k < str.size()) { if(str[k] == '('){ //处理(.....) k ++ 阅读全文
posted @ 2022-04-19 16:44 czyaaa 阅读(27) 评论(0) 推荐(0)
摘要: 题目 题解 #include <iostream> #include <algorithm> using namespace std; typedef long long LL; const int N = 110; int n; int cnt; LL a[N],b[N],c[N]; //a为分子 阅读全文
posted @ 2022-04-19 12:13 czyaaa 阅读(54) 评论(0) 推荐(0)
摘要: 配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-ins 阅读全文
posted @ 2022-04-18 21:12 czyaaa 阅读(118) 评论(0) 推荐(0)
摘要: 四种通知 若出现了异常,会执行异常通知,但不会执行后置通知 <!--配置AOP--> <aop:config> <aop:aspect id="logAdvice" ref="logger"> <!--配置前置通知:在切入点方法执行之前执行--> <aop:before method="before 阅读全文
posted @ 2022-04-18 19:32 czyaaa 阅读(31) 评论(0) 推荐(0)
摘要: 步骤 示例 service package com.czy.service.impl; import com.czy.service.AccountService; public class AccountServiceImpl implements AccountService { public 阅读全文
posted @ 2022-04-18 16:47 czyaaa 阅读(38) 评论(0) 推荐(0)
摘要: 概念 面向切面编程。说白了就是把程序重复代码抽取出来,在需要执行的时候,使用动态代理技术,在不修改源码的基础上,对已有方法进行增强。参考:上一篇文章转账问题代理优化 细节 术语 Jointpoint(连接点)————业务中的所有方法 所谓连接点是指那些被拦截到的点。在spring中,这些点指的是方法 阅读全文
posted @ 2022-04-15 21:35 czyaaa 阅读(33) 评论(0) 推荐(0)
摘要: 题解 代码 #include <iostream> #include <cstdio> using namespace std; typedef long long LL; LL exgcd(LL a,LL b,LL &x,LL &y) { if(!b){ x = 1, y = 0; return 阅读全文
posted @ 2022-04-15 10:03 czyaaa 阅读(35) 评论(0) 推荐(0)
摘要: 概述 特点 字节码随用随创建,随用随加载。 作用 不修改源码的基础上对方法增强 分类 1.基于接口的动态代理 ————涉及的类:Proxy ————提供者: JDK官方 ————如何创建代理对象:使用Proxy类中的newProxyInstance方法 ————创建代理对象的要求:被代理类至少实现一 阅读全文
posted @ 2022-04-14 21:57 czyaaa 阅读(56) 评论(0) 推荐(0)
摘要: 转账问题分析事务 accountDao中的使用的是Jdbctemplate 由于更新中途出现异常,导致source的金钱扣了却没有转账到target账户上!!! 转账问题解决 该解决方法代码量冗余,配置文件逻辑复杂,仍有巨大优化空间(代理模式加强方法) 工具类部分(通过ThreadLocal绑定线程 阅读全文
posted @ 2022-04-11 22:17 czyaaa 阅读(159) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 下一页
点击右上角即可分享
微信分享提示