principle counting program testing
Go - Creating Subtests to Have Finer Control Over Groups of Test Cases
Problem: You want to create subtests within a test function to have finer control over test cases. Solution: Use the t.Run function to create subtests ......
[Compose] Async programming: Thunks
Thunks Sync thunk: A blocker of code which has everything ready and can return the value directly. function add(x, y) { return x + y } const thunk = f ......
Program does not contain a static 'Main' method suitable for an entry point
http://www.kangry.net/blog/?article_id=391&type=article 修改办法,对着项目右键-》属性-》application-》output type设为Class Library即可。 ......
Go - Setting Up and Tearing Down Before and After Tests
Problem: You want to set up data and an environment for testing and tear it down after the test is run. Solution: You can create helper functions or u ......
Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324) 赛后总结
Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324) 赛后总结 可悲的是:我没来得及写题解。 T1 Same 秒切。 直接输入排一遍序再遍历即可。 #include <bits/s ......
比赛总结:Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324)
比赛:Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324) A-same 1.常规方法 int main() { int n; cin >> n; vector<int> s(n) ......
[Compose] Callback is not suitable for Async programming
An example of callback implemnetation for handling async flow: function fakeAjax(url, cb) { var fake_responses = { file1: "The first text", file2: "Th ......
2019-2020 ICPC Northwestern European Regional Programming Contest (NWERC 2019)
\(A. Average Rank\) 将每个人的排名看作是前面一个人的贡献,然后采用类似懒标记的形式优化复杂度。 int sum[N],point[N],cnt[N],pre[N],laz[N]; void solve(){ int n=read(),w=read(); laz[0]=w; cnt ......
Testing Round 16 (Unrated) B. Square?
给定一个矩形,然后切成两个矩形。尺寸分别为 \(a \times b\) , \(c \times d\) 。你需要确定开始的矩形是否可能是个正方形。 假设初始矩形为正方形,则两个小矩形的长边是正方形的边长。不妨让 \(a \geq b, c \geq d\) 。只需判断 \(a = c, a = ......
RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1.
问题:服务器上多块卡,使用其中一张训练的模型,在本地预测的时候报错。 解决:在torch.load中加入map_location,指定一块卡 ......
Programming abstractions in C阅读笔记:p179-p180
《Programming Abstractions In C》学习第60天,p179-p180总结。 一、技术总结 1.palindrome(回文) (1)包含单个字符的字符串(如"a"),或者空字符串(如" ")也是回文。 (2)示例:“level”、"noon"。 2.predicate fun ......
2023 Hubei Provincial Collegiate Programming Contest
\(B. Mode\) 利用数位 \(dp\) 求数字众数,那么在相同的位数下,相同的个数即为相同,用 \(map\) 记忆化搜索。 int num[20],len=0; map<pair<int,vector<int> > ,int>mp; int dfs(int pos,vector<int> ......
Count of Sub-Multisets With Bounded Sum
Count of Sub-Multisets With Bounded Sum You are given a 0-indexed array nums of non-negative integers, and two integers l and r. Return the count of s ......
ABC202E Count Descendants
ABC202E Count Descendants 线段树合并模板题。 每次询问就是给定有序数对 \((u,d)\),求有根树 \(T\) 上,点 \(u\) 的子树内有多少点 \(v\),使得 \(v\) 的深度恰好等于 \(d+1\)。定义根节点深度为 \(1\)。 考虑对每一个点开一个长度为 ......
2022 China Collegiate Programming Contest (CCPC) Guilin Site(持续更新)
Preface 由于还有两周就要滚去打区域赛了,这周开始周末每天都训一场吧 这场总体来说打的还可以,虽然E题这个Easy从卡局卡到3h,但由于其它的题都是一遍过所以罚时还尚可跻进Au区 后面一个小时看徐神和祁神苦战K大分类讨论,虽然场下感觉摸了一个B的做法出来,但感觉实现还是太麻烦了就没写,最后K也 ......
test
Docker是一个开源的应用容器引擎,使用Go语言开发,基于Linux内核的cgroup,namespace,Union FS等技术,对应用进程进行封装隔离,并且独立于宿主机与其他进程,这种运行时封装的状态称为容器。 Docker早期版本实现是基于LXC,并进一步对其封装,包括文件系统、网络互联 ......
test1111
[root@localhost harbor]# cat /etc/docker/daemon.json { "registry-mirrors": ["http://f1361db2.m.daocloud.io"], "insecure-registries": ["192.168.56.146" ......
test
[root@localhost harbor]# cat /etc/docker/daemon.json { "registry-mirrors": ["http://f1361db2.m.daocloud.io"], "insecure-registries": ["192.168.56.146" ......
test 1
[root@localhost harbor]# cat /etc/docker/daemon.json { "registry-mirrors": ["http://f1361db2.m.daocloud.io"], "insecure-registries": ["192.168.56.146" ......
test2
[root@localhost harbor]# cat /etc/docker/daemon.json{"registry-mirrors": ["http://f1361db2.m.daocloud.io"],"insecure-registries": ["192.168.56.146"] # ......
Some seqs are too long, please rebuild the program with make parameter MAX_SEQ=new-maximum-length (e.g. make MAX_SEQ=10000000)
001、cd-hit报错如下 Some seqs are too long, please rebuild the program with make parameter MAX_SEQ=new-maximum-length (e.g. make MAX_SEQ=10000000) 002、解决方法 ......
2021 China Collegiate Programming Contest (CCPC) Guilin Site
A. A Hero Named Magnus #include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; using vi = vector<int>; void so ......
严重性 代码 说明 项目 文件 行 禁止显示状态 错误 LNK2019 无法解析的外部符号 _main,函数 "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 中引用了该符号 test001 F:\Data\softwareDesign\test001\MSVCRTD.lib(exe_main.obj) 1 问题的解决
问题描述 按照思路写好了C++的程序之后,表面上看起来没什么错误,也没有红点点的出现,但是运行起来,就发现,爆出来这样一个错误: 问题解决 看了半天,查了半天资料,发现是这里出现了问题(我真的~~~): 习惯了首字母大写,这个就当成类来写了, 后来突然醒悟,这个是main函数,首字母是要小写: 运行 ......
The 2021 Sichuan Provincial Collegiate Programming Contest
\(E. Don’t Really Like How The Story Ends\) \(dfs\)的时候如果一个点没有子节点,可以回溯,在父节点上找后续节点。如果找到了一个更大的节点,那么必须要与当前目标连接,然后回溯回来的时候如果目标值比当前的值更小说明仍有后续节点可以用,必须还在这个节点接后 ......
[USACO17JAN] Promotion Counting P 题解
[USACO17JAN] Promotion Counting P 题解 前言 好久没写题解了,今天趁我心情好赶紧水一篇。 思路 首先拿到这题,关键词检索:子树,比 \(p_i\) 大的,树状数组!现在考虑如何去掉其他子树的贡献……emm,我直接在算贡献的时候去掉其他子树的贡献不就好了! 当然,暴力 ......
.net 关于在program中使用AddNewtonsoftJson之后,继承于System.Text.Json.Serialization的自定义转换器JsonConverter不生效的问题
首先,先说遇见的问题与代码示例,在.net代码中注册了如下代码 .AddNewtonsoftJson(option => { //使用本地时区 option.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Local; / ......
springMVC @Test方法中如何请求https
原文链接:https://www.longkui.site/error/springmvc-test-https/4823/ 0.背景 springMVC环境,需要在@Test方法中发送一个https请求,按照格式要求发送了,结果报错 org.springframework.web.client.R ......
@Test方法中使用restTemplate报错null(NullPointerException)
原文链接:https://www.longkui.site/error/resttemplate/4821/ 0.背景 需要在@Test 单元测试中掉调用一个http请求,用的是RestTemplate。当时测试的代码如下: HttpEntity<Object> requestEntity = ne ......
@Test下jedisManager.getJedis报错NullPointerException
原文链接:https://www.longkui.site/error/test%e4%b8%8bjedismanager-getjedis%e6%8a%a5%e9%94%99nullpointerexception/4813/ 报错代码: import org.junit.Test; import ......