问题来源于leetcode上的两道题 Path Sum I && II,分别写了两个dfs. void dfs(TreeNode node , int sum , ArrayList<Integer> curPath) void dfs(TreeNode node , int sum , boolean ifExist) 问题:在1号中我可以在方法中修改curPath,在结束函数调用时,变量修改仍然生效. 在2号问题中,我即使在函数中修改了ifExist,结束函数调用时,变
最近在用mybatis,之前用过ibatis,总体来说差不多,不过还是遇到了不少问题,再次记录下, 比如说用#{},和 ${}传参的区别, 使用#传入参数是,sql语句解析是会加上"",比如 select * from table where name = #{name} ,传入的name为小李,那么最后打印出来的就是 select * from table where name = ‘小李’,就是会当成字符串来解析,这样相比于$的好处是比较明显对的吧,#{}传参能防止sql注入,如
原文地址:https://www.cnblogs.com/zqr99/p/8094234.html 最近在用mybatis,之前用过ibatis,总体来说差不多,不过还是遇到了不少问题,再次记录下, 比如说用#{},和 ${}传参的区别, 使用#传入参数是,sql语句解析是会加上"",比如 select * from table where name = #{name} ,传入的name为小李,那么最后打印出来的就是 select * from table where name = ‘
python的三目运算a = 10b = 20c = a if a > b else b #先判断中间的条件a > b是否成立,成立返回if前面的值,不成立返回else后面的值,也可以 c = a if a.isalpha() else b 条件可以是各种各样的print(c) 1.动态传参 1.*args 动态接收位置参数. 接收所有的实参对应的剩余位置参数,返回的是元组 *表示接收位置参数的动态传参 def func(a, b, *args): #arguments参数 print(a,
最近在用mybatis,之前用过ibatis,总体来说差不多,不过还是遇到了不少问题,再次记录下, 比如说用#{},和 ${}传参的区别, 使用#传入参数是,sql语句解析是会加上"",比如 select * from table where name = #{name} ,传入的name为小李,那么最后打印出来的就是 select * from table where name = ‘小李',就是会当成字符串来解析,这样相比于$的好处是比较明显对的吧,#{}传参能防止sql注入,如果
总结: 1.mybaits配置工2方面: i行为配置,如数据源的实现是否利用池pool的概念(POOLED – This implementation of DataSource pools JDBC Connection objects to avoid the initial connection and authentication time required to create a new Connection instance.This is a popular approach fo
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use App\Libs\wxpay\CLogFileHandler; use App\Libs\wxpay\Log; use App\Helpers\ReportHelper; use App\Helpers\CommonHelper; use App\Models\Ecg_customer; use App\Models\Ecg_report; use