- 博客(12)
- 收藏
- 关注
原创 list indices must be integers or slices, not list
def computeSSE(center_point, cluster): estimator = 0 for i in cluster: if len(cluster[i]) != 0: for point in cluster[i]: estimator += (matrix[0][point] - center_point[i][0]) ** 2 + (matrix[1][point] - center_poin
2021-01-05 00:36:35
3199
原创 CCF CSP 202006 01线性分类器 JAVA实现
20200601 线性分类器import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner inScanner = new Scanner(System.in); int N = inScanner.nextInt(); int M = inScanner.nextInt(); location[] locations = new location[N]; l
2020-12-04 01:31:12
393
2
原创 Error:(46, 18) java: 不兼容的类型: java.awt.Button无法转换为javafx.scene.Node
You’re using the AWT-button with your import java.awt.Button;, that’s why you can use the method public void addActionListener(ActionListener l).Replace your import to import javafx.scene.control.Button;将最前面的导入java.awt.Button 改为import javafx.scene.contr
2020-09-13 00:49:02
2164
原创 QT5.8使用MySQL数据库 QSqlDatabase: QMYSQL driver not loaded
我的版本为 QT5.8.0QMYSQL driver not loaded,提示缺少 驱动,网上找了教程从 X:\MySQL\lib中将 libmysql.dll 文件复制X:\Qt\Qt5.6.1\5.6\mingw49_32\bin中。依然不行最后下载这个https://cdn.mysql.com//archives/mysql-connector-c/mysql-connector-c-6.1.3-win32.zip将里面的复制到 Qt目录的bin目录下就可以了...
2020-07-19 12:44:21
655
原创 MySql数据库导入sql错误 Unknown collation: ‘utf8mb4_0900_ai_ci‘
错误原因:高版本数据库(8.0)转存sql文件 并导入低版本数据库(5.7)解决办法:方案一:升级mysql至高版本方案二:将需要导入的sql文件,把其中的utf8mb4_0900_ai_ci全部替换为utf8_general_ciutf8mb4替换为utf8utf8_0900_ai_ci全部替换为utf8_general_ci重新执行sql文件...
2020-07-11 17:39:15
1439
原创 父查询有Null值
一个部门表有部门主管编号,外键,与员工表的员工编号构成外键约束想要查找部门主管的名字,刚开始想半天先想到2条SQL查询语句SELECT dno,department.department,business,employee.name as manager FROM department,employee WHERE department.mid IS NOT NULL AND department.mid
2020-07-10 11:48:45
241
转载 No match for argument: mysql-community-server Error: Unable to find a match: mysql-community-server
Centos 安装mysql57 运行yum install mysql-community-server出现以下错误:1.No match for argument: mysql-community-server2.Error: Unable to find a match: mysql-community-server请尝试运行yum module disable mysql然后在尝试yum install mysql-community-server 命令即可...
2020-05-14 15:36:53
3899
2
原创 线索二叉树,指定次序下查找结点的前驱和后继算法都变得简单。
1)中序线索二叉树查找p的前驱:查左线索;若无左线索,结点的前驱是遍历左子树时访问的最后一个结点。查找p的后继:查右线索;若无右线索,结点的后继是遍历右子树时访问的第一个结点。2)先序线索二叉树查找p的前驱:查左线索;若无左线索,结点的前驱是结点的双亲结点,或是先序遍历其双亲结点左子树时最后访问的结点。查找p的后继:查右线索;若无右线索,结点的后继必为结点的左子树(若...
2020-05-08 09:27:26
3008
1
原创 7-2 然后是几点 (15分)
有时候人们用四位数字表示一个时间,比如1106表示11点零6分。现在,你的程序要根据起始时间和流逝的时间计算出终止时间。读入两个数字,第一个数字以这样的四位数字表示当前时间,第二个数字表示分钟数,计算当前时间经过那么多分钟后是几点,结果也表示为四位数字。当小时为个位数时,没有前导的零,即5点30分表示为530。注意,第二个数字表示的分钟数可能超过60,也可能是负数。输入格式:输入在一行中给出...
2020-01-25 13:02:33
702
原创 数组初始化问题
全局数组局部数组`#include <iostream>using namespace std; int a[3]; int main(){ int b[3] = {1}; int c[3]; for(int i = 0 ; i < 3; i++) cout<<"全局数组a["<<i<<"]:"<<a[i]&l...
2020-01-23 22:55:08
239
原创 6-2 多项式求值 (15分)
本题要求实现一个函数,计算阶数为n,系数为a[0] … a[n]的多项式f(x)=∑i=0n (a[i]×xi ) 在x点的值。函数接口定义:double f( int n, double a[], double x );其中n是多项式的阶数,a[]中存储系数,x是给定点。函数须返回多项式f(x)的值。裁判测试程序样例:#include <stdio.h&g...
2020-01-23 19:59:41
446
原创 小学生10以内加减法自动出题程序
#include <stdio.h>#include <stdlib.h> /*包含随机数生成函数*/#include <time.h>int main(){ int right(); int wrong(); int num1, num2, op, result1, result2; srand(time(NULL)); /*随机数种子优化*...
2019-10-03 20:27:36
7884
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人