- 博客(64)
- 资源 (1)
- 收藏
- 关注
原创 PackagesNotFoundError: The following packages are not available from current channels
anaconda search -t conda 包名 anaconda show conda-forge/包名然后弹出安装命令,如 conda install --channel https://conda.anaconda.org/conda-forge 包名最后输入y
2021-01-14 11:27:03
231
原创 Could not find com.android.tools.build:gradle:5.4.1.
升级了Android studio,手动下载了gradle,然后发现gradle报错,pom文件一直下不下来 Could not find com.android.tools.build:gradle:5.4.1.百度了很多,说是换源,换成https://maven.aliyun.com/repository/google但是我发现他这里边只到了gradle4.XXX后来...
2020-05-01 17:59:12
6709
2
原创 web3的shh使用
web3-shh包用来使用whisper协议进行广播发送。我在node-js开发中想调用ssh生成一对公钥和私钥,但是报了以下错误:web3.js: Error: The method shh_newSymKey does not exist/is not available on Web3.js不管怎么调,方法总是调用不了,百度以后发现没有解答,然后果断Google,终于找到答案,...
2020-04-29 15:45:59
737
原创 selenium配置及网络环境控制
第三部分是我的项目需要,可忽略。重点是第一二部分的配置,如果缺少软件,可在评论中留下邮箱哦一、环境配置从邮件中下载并安装google-chrome-stable_current_amd64.deb $sudo dpkg -i google-chrome-stable_current_amd64.deb 使用chrome://version/ 查看chr...
2020-04-23 21:26:52
613
原创 小米手机 adb调试返回subprocess.CalledProcessError:returned non-zero exit status 4294967177.
Traceback (most recent call last): File "D:\python\lib\threading.py", line 916, in _bootstrap_inner self.run() File "D:\python\lib\threading.py", line 864, in run self._target(*self._args...
2020-03-11 00:30:16
2265
原创 多次求和构造目标数组
给你一个整数数组 target 。一开始,你有一个数组 A ,它的所有元素均为 1 ,你可以执行以下操作: 1、令 x 为你数组里所有元素的和 2、 选择满足 0 <= i < target.size 的任意下标 i ,并让 A 数组里下标为 i 处的值为 x 。 你可以重复该过程任意次如果能从 A 开始构造出目标数组 target ,请你返回 True ...
2020-02-19 11:45:06
240
原创 分裂二叉树的最大乘积-力扣周赛题
题目描述:给你一棵二叉树,它的根为 root 。请你删除 1 条边,使二叉树分裂成两棵子树,且它们子树和的乘积尽可能大。由于答案可能会很大,请你将结果对 10^9 + 7 取模后再返回题解:在题目里,将节点分为两组,但是这两组就是所有元素之和,是一定的,这会让我们想起来均值不等式当且仅当a=b的时候取等号。所以在本题中,ab的乘积是有上限的,我们应该使得a和b尽量的接...
2020-02-02 20:05:50
553
原创 A Policy-Based Routing (PBR) Router based on Distance-Vector Algorithm
ObjectiveDesign a DV-based router which simulates a RIP router on the Internet. The router can determine the shortest route based on the policy and transport packets.Supported commandsThe progra...
2020-01-14 16:06:31
762
2
原创 Simulating DVMRP
使用组播协议DVMRP,一共有十三个节点,节点7,8,9,12陆续加入组播,后节点12退出组播,拓扑如下:set ns [new Simulator]$ns multicastset f [open dvmrp.tr w]$ns trace-all $f$ns namtrace-all [open dvmrp.nam w]$ns color 1 red #分配组播...
2020-01-14 15:54:35
331
原创 ubuntu16 Invalid command name “Agent/rtProto/OSPF”
invalid command name "Agent/rtProto/OSPF"while executing"Agent/rtProto/OSPF set helloInterval 1"ns2 模拟ospf报错Invalid command name “Agent/rtProto/OSPF”,这是因为下载的ns2中没有ospf,因此需要下载然后重新编译这是下载链接编译步骤...
2020-01-14 15:37:34
421
原创 ns2在Ubuntu安装教程及报错
感谢前人,总结经验,ns2在安装第三遍的时候终于成功了,我主要参考看这两个博客,供参考ubuntu16.04 ns2安装教程ns2安装过程相关问题再次感谢
2019-10-31 22:14:52
405
原创 阿里云服务器公网ip访问不了,解决方法
自己写的网络程序,开放了一个8081的端口,结果程序放在本地运行的很好,放到阿里云就不行了,ip一直找不到最后终于知道。。。。阿里云需要我们自定义开放的端口,比较坑。。。各位要谨记...
2019-10-20 19:53:31
4857
4
原创 solidity address类型转账函数transfer报错
在以太坊开发中,使用remix作为智能合约solidity的ide,在写转账功能时,发现address类型转账函数transfer报错,只能msg.sender发生转账。经过查资料发现,我所查看的开发文档是v0.4.23,而我所用的版本是0.5.2.下面是两个版本文档对比。V0.4.23v0.5.7在0.5.几版本以后,要调用send或者transfer函数,都要定义addre...
2019-04-23 18:57:46
2245
2
原创 TypeError: web3.isConnected is not a function的解决方法
/home/yifei/SoftWareShare/routes/index.js:16var connected = web3.isConnected(); ^TypeError: web3.isConnected is not a function 昨晚遇到这个问题搞了我一晚上,我使用nodejs和express搭建的服务器,之前单独用n...
2019-01-22 11:02:59
3511
原创 数组中出现次数超过一半的数字
int partition(int a[],int start,int endd){ int small = start -1; for(int i=start;i<=endd-1;i++) { if(a[i]<a[endd]) { small++; if(a[i]!=a[sma...
2018-11-19 16:38:11
175
原创 计算1到n中1的个数
方法一:时间复杂度高#include <iostream>#include <cstring>#include<vector>#include<queue>#include <math.h>using namespace std;int calculate(int n){ int num = 0; w...
2018-11-16 23:13:44
463
原创 排列问题
全排列void permutation(char *str,char *Begin){ if((*Begin)=='\0') cout<<str<<endl; else { for(char *tmp = Begin;(*tmp)!='\0';tmp++) { char t = *Beg...
2018-11-07 23:17:05
164
原创 剑指offer--复杂链表复制
O(n)复杂度struct node{ int val; node* next; node* sibling;};void cloneNodes(node *head){ node *tmp = head; while(tmp!=NULL) { node *cloneNode = new node; cl...
2018-11-07 16:28:40
193
原创 搜素二叉树的权值为某值的路径+二叉树变双向链表
搜素二叉树的权值为某值的路径void findPath(node *root,int expect,int current,vector<int> &path){ if(root!=NULL) { current += root->val; path.push_back(root->val); ...
2018-11-06 23:33:06
119
原创 判断一个序列是不是二叉搜索树的后序遍历序列
#include <iostream>#include <cstring>#include <queue>using namespace std;bool check(int a[],int start,int last){ int root = a[last]; int i; for(i=start;i<last;i+...
2018-11-03 10:02:05
250
原创 栈的压入和弹出序列是否正确
a为压栈序列,b为出栈序列bool check(int *a,int *b,int n){ stack<int> int_stack; bool isTrue = false; int * start = a; int top = 0; if(a!=NULL && b!=NULL && n>0) ...
2018-11-02 23:40:36
114
原创 实现包含min函数的栈,使得min时间复杂度为O(1)
#include <iostream>#include <cstring>#include <stack>using namespace std;stack<int> a_stack;stack<int> min_stack;void push(int n){ a_stack.push(n); if(min...
2018-10-29 09:37:11
238
原创 螺旋矩阵
#include <iostream>#include <cstring>using namespace std;int visitAll(int a[][100],int start,int rows,int col,int num){ int endX = rows - start -1;; int endY = col -start -1;...
2018-10-29 09:20:15
120
原创 二叉树的镜像+广度遍历
#include <iostream>#include <cstring>using namespace std;struct node{ int val; node* left; node* right;};void createTree(node *&root){ int n; cin>>n; ...
2018-10-28 23:20:26
169
原创 输出倒数第k个节点+反转链表+合并两个有序链表
要求:遍历链表一边#include <iostream>#include <cstring>using namespace std;struct node{ int val; node * next;};node * findNode(node *head,int k){ if(head==NULL ||k<=0) return ...
2018-10-26 22:42:11
189
原创 调整数组顺序使奇数位于偶数前面
bool isEvent(int n){ return ((n&0x1) ==1);}void adjust(int a[],int n,bool (*fun)(int)){ int mid = -1; int index; for(index=0;index<n;index++) { if(fun(a[index])...
2018-10-26 21:33:38
192
原创 打印1到最大的n位数
解法一:全排列过程void printnum(char number[],int n){ bool begining = true; int num = 0; for(int i=0;i<n;i++) { if(begining && number[i]!='0') begining = false; e...
2018-10-26 10:13:44
152
原创 数值的整数次方
需要考虑 的情况1、0的0次方2、0的负数次方3、效率问题bool isEqual(double num1,double num2){ if((num1-num2>-0.00001)&&(num1-num2<0.00001))return true; else return false;}double withUnsignedEx...
2018-10-25 19:39:26
132
原创 斐波那契--矩阵快速幂
void multify(int a[][2],int b[][2]){ int c[2][2]; for(int i=0;i<2;i++) for(int j=0;j<2;j++) c[i][j] = 0; for(int i=0;i<2;i++) for(int j=0;j<2;j++)...
2018-10-21 16:37:45
170
原创 二进制中1的个数
1、循环32次的int numofone(int a){ unsigned int flag = 1; int count=0; while(flag) { if(flag&a) count++; flag = flag <<1; } return count;}2、效率提高得i...
2018-10-20 22:25:02
116
原创 旋转数组最小的数字
问题描述:将一个递增数组最开始若干个元素搬到数组的末尾,输出最小的元素int findMinIndex(int a[],int start,int endindex){ int target = start; for(int i=start+1;i<=endindex;i++) { if(a[i]<a[i-1]) { ...
2018-10-20 21:04:04
130
原创 快排--不一样的partition函数
#include <iostream>using namespace std;int partitions(int a[],int start,int endindex){ if(start>=endindex) return -1; int small = start-1;//small是所有比目标数字都小的最大索引 int index; ...
2018-10-19 21:02:07
279
原创 哈夫曼编码及其解码全过程
今年的小学期我选了做哈夫曼编码,老师的要求是这样的:编—译码系统的设计 内容:(1) 读入待编码的文字,统计各字符出现的频率(2) 构造哈夫曼树(3) 得到各字符的哈夫曼编码(4) 对原文进行编码(5) 发送、接收(6) 还原(译码)收到的文字(7) 利用哈夫曼树,从根到叶子读0、1序列,直到终止,再读下一个字符(8) 比较(校验)基本要求:(85分...
2018-07-20 10:59:29
29876
3
原创 图形学第四次作业
#include <windows.h> //此头文件一定要放在最前#include <GL/gl.h>#include <GL/glu.h>#include <GL/glaux.h>#include <stdio.h>#include <stdlib.h>#include <math.h>#
2018-06-04 15:24:01
649
原创 图形学第三次作业
#include <windows.h> //此头文件一定要放在最前#include <GL/gl.h>#include <GL/glu.h>#include <GL/glaux.h>#include <stdio.h>#include <stdlib.h>#include <math.h>#
2018-06-04 15:22:01
336
原创 递归字母矩阵
#include <stdio.h>#include <stdlib.h>typedef struct{ char shuzi; int flag;}letter;void ergodic(letter alphabet[][10],int instruct,int count,int i,int j,int maxi,int maxj){...
2018-05-26 11:18:48
443
原创 图形学第二次作业
#include <windows.h> //此头文件一定要放在最前#include <GL/gl.h>#include <GL/glu.h>#include <GL/glaux.h>#include <stdio.h>#include <stdlib.h>#include <math.h>#
2018-05-14 16:34:27
463
原创 opengl画五角星,每帧十个
#include <windows.h>#include <gl/gl.h>#include <gl/glaux.h>#include <stdio.h>#include <stdlib.h>#include <time.h>#include <math.h>//添加这3条语句#pragma c
2018-05-11 13:01:57
452
原创 c语言进程调度
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<windows.h>#include <time.h>typedef struct PCB{ int id; int priority; int STime; int timePiece;...
2018-05-10 20:52:49
3476
2
哈夫曼树编码与解码
2018-03-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人