Call to a member function addEagerConstraints() on null 这是laravel的关联关系出问题 原因:你没有返回关联关系,就调用了关联方法 解决: public function xxx() { return $this->belongsTo(yy ...
分类:
其他好文 时间:
2020-04-25 19:01:23
阅读次数:
212
public int minNumberInRotateArray(int[] array) { int i = 0, j = array.length - 1; while (i < j) { if (array[i] < array[j]) { return array[i]; } int mi ...
分类:
编程语言 时间:
2020-04-25 18:47:31
阅读次数:
111
模型会自动对应数据表,模型类的命名规则是除去表前缀的数据表名称,采用驼峰法命名,并且首字母大写。 namespace app\index\model; 设置数据表 use think\Model; class User extends Model{ // 设置当前模型对应的完整数据表名称 prote ...
分类:
Web程序 时间:
2020-04-25 17:28:34
阅读次数:
93
public class Recursion { /// <summary> /// 找出全部的子文件夹 /// </summary> /// <param name="rootPath">根目录</param> /// <returns></returns> public static List< ...
分类:
其他好文 时间:
2020-04-25 17:16:41
阅读次数:
53
首先先定义个枚举,后续都会用到这个枚举。 [Flags] public enum BorderSides { Left = 1, Right = 2, Top = 4, Bootom = 8 } 1.将枚举转换为整数 我们通常将枚举转换整数,可以将枚举先转化未object类型然后再转为整数类型。 1 ...
题目链接:https://pintia.cn/problem-sets/994805260223102976/problems/994805316250615808 一个数组A中存有N(N>0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(M>=0)个位置,即将A中的数据由(A0 A ...
分类:
编程语言 时间:
2020-04-25 16:48:20
阅读次数:
97
/// <summary> /// RSA ECC /// 可逆非对称加密 /// 非对称加密算法的优点是密钥管理很方便,缺点是速度慢。 /// </summary> using System.Security.Cryptography; public class RsaEncrypt { /// ...
分类:
其他好文 时间:
2020-04-25 15:27:16
阅读次数:
115
How Many Answers Are Wrong 原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=3038 题目大意: 在一个长度为n的区间上,给出m个区间和,当遇到给出的这个区间与前面的区间有矛盾时,认为新给出的区间是错误的,不更新区间,问有多少错 ...
分类:
其他好文 时间:
2020-04-25 14:16:50
阅读次数:
55
输入输出样例 输入 #1复制 4 3 6 2 5 输出 #1复制 2 2 3 思路 Task1:数据范围很小,暴力出LIS长度就可以了 Task2:显然是个带限制条件的最小路径覆盖问题 拆点建图,以该点是否为LIS的起终点为依据判断是否对ST连边 对所有点肯定要满足该点出点要连下一个点的入点 Tas ...
分类:
其他好文 时间:
2020-04-25 13:03:40
阅读次数:
64
1、for (自定义条件) 循环 let arr = [1,2,3]; for(let i =0;i<arr.length;i++){ console.log(i,arr[i]) } 2、for in 循环 let obj = {name: 'xiao' ,age:'24'} for(let i i ...
分类:
编程语言 时间:
2020-04-25 12:50:12
阅读次数:
64