草庐IT

数据库实验(学生选课系统)

自学Java小白 2023-09-08 原文

数据库实验(学生选课系统)

文章目录

一、使用管理工具创建数据库

1)使用 SQL Server Management Studio 建立学生选课数据库(XSXK)。

2)在 SQL Server Management Studio 中查看学生选课数据库的属性。

3)根据学生选课数据库物理结构设计,定义基本表、索引,实现相应的约束条件。

二、使用T-SQL创建数据库

(1) student(学生表)

字段名称数据类型长度大小允许空备注
snochar10学号
snamechar8姓名
ssexchar2性别
sagesmallint年龄
sdeptchar30所在院系
stelchar13联系电话

主键:sno

索引:sname(升序)

check 约束:年龄大于 18, 性别的取值只能为男或女

default 约束:性别默认为男

更改学生表的结构,取消姓名不允许为空的约束

(2) Course (课程表)

字段名称数据类型长度大小允许空说明
cnochar10课程编号
cnamechar16课程名称
ccreditsmallint学分
cpnochar10先行课

主键:cno

索引: cno (升序)+ccredit(降序)

更改课程表的结构,增加属性列教师 ctech(类型是 char ,长度 20)

(3) SC(选课表)

字段名称数据类型长度大小允许空备注
snochar10学号
cnochar10课程编号
gradesmallint成绩

主键:sno+cno

(4) 各个表的参照完整性约束

FK_SC_ student

主 键 表 :student 外 键 表 :SC 主 键 :sno 外 键 :sno

FK_SC_ course

主 键 表 :course 外 键 表 :SC 主 键 :cno 外 键 :cno

3、SQL Server Management Studio 管理工具,完成图书借阅数据库的录入、数据修改或删除操作。

1) 要求各表录入 10 条以上记录。

2) 修改某位读者的还书日期。

3) 删除指定读者的借还记录。

三、SQL语句

1.简单查询(一)

(1) 对于每个学生,求学生的选课门数和平均成绩,并把结果存入学生选课数据库中。

(2) 将数据库原理与应用课程的学分修改为 4.

(3) 将姓名为“王华”的学生选修数据库原理及应用课程的成绩增加 5 分。

(4) 删除选课表中成绩低于 40 分的记录。

(5) 删除学号为 140001 的学生记录,并讨论该删除操作所受到的约束。

(6) 删除所有选修课程“JAVA”的选课记录。

(7) 将管理学院全体学生的成绩置为空。

(8) 删除学生李萍的所有选课记录。

2、简单查询 (二)

在学生选课数据库中实现其数据查询操作。

(1)查询数计学院学生的学号和姓名。

(2)查询选修了课程的学生学号。

(3) 查询选修 C1 课程的学生学号和成绩,结果按成绩降序排列,如果成绩相同按学号升序排序。

(4)查询选修 C1 课程,成绩在 80~90 之间的学生学号和成绩,并将成绩乘以 0.8 输出。

(5)查询生工学院或数计学院系姓张的学生的信息。

(6)查询缺少了成绩的学生的学号和课程号。

3.连接查询

在学生选课库中实现其数据连接查询操作。

(1)查询学生的学号、姓名、选修的课程名称及成绩。

(2)查询数计学院学生选修的课程学分大于 2 的课程详细信息。

(3) 查询所有学生的信息以及他(她)所选课的学生学号和成绩(要求查询结果也显示出没有选修课程的学生信息)。

(4)查询选修课程号为 C1 且成绩在 90 分以上的学生学号、姓名及成绩。

(5) 查询每一门课的间接先行课(即先行课的先行课)。言的查询语句的理解。

4.嵌套查询

(1)查询选修了’c语言’课程的学生学号和姓名

(2)查询比唐伯虎年龄大的学生学号和姓名

(3)查询数据结构课程的成绩低于唐伯虎的学生学号和成绩

(4)查询其他学院中比数计学院学生年龄都小的学生

(5)查询选修了操作系统课程的学生姓名

(6)查询没有选修操作系统课程的学生姓名

(7)查询选修了全部课程的学生姓名

(8)查询至少选修了学生为张飞的学生所选修的全部课程的学生学号和姓名

(9)查询既选修了数据库原理又选修了操作系统课程的学生姓名

(10)查询既选修了数据库原理或选修了操作系统课程的学生学号

(11)查询既选修了数据库原理而没有选修操作系统课程的学生学号

(12)查询全是男同学选修的课程号

5.组合查询和统计查询

(1)使用集合运算查询既选修了数据结构课程又选修了数据库原理课程的学生姓名。
(2)使用集合运算查询选修了数据结构课程或选修了数据库原理课程的学生学号。

(3)使用集合运算查询选修了数据结构课程而没有选修了数据库原理课程的学生

(4)统计选修了课程的学生人数。

(5)查询选修成绩合格的课程超过4门以上学生的学生学号、总成绩。

(6)统计各院系的学生人数。

(7)统计各年龄的学生人数。

(8)统计每个学生的选修课程数目和平均成绩。

(9)查询每门课程的详细信息及选课人数。

四、代码:

create table student
(
    sno   char(10)             not null comment '学号',
    sname char(8)              not null comment '姓名',
    ssex  char(2) default ' 男' not null check ( ssex = '男' or ssex = '女') comment '性别',
    sdept char(30)             null comment '所在院系',
    sage  smallint             null check ( sage > 18 ) comment '年龄',
    stel  char(13)             null comment '联系电话',
    constraint student_pk
        primary key (sno)
)
    comment '学生';

create index student_sname_index
    on student (sname);

create table Course
(
    cno     char(10) not null comment '课程编号',
    cname   char(16) not null comment '课程名称',
    ccredit smallint not null comment '学分',
    cpno    char(10) null comment '先行课',
    constraint Course_pk
        primary key (cno)
)
    comment '课程表';

create index Course_cno_ccredit_index
    on Course (cno asc, ccredit desc);



create table SC
(
    sno   char(10) not null comment '学号',
    grade smallint null comment '成绩',
    cno   char(10) not null comment '课程编号',
    constraint SC_pk
        primary key (sno, cno)
)
    comment '选课';


create index student_sname_index
    on student (sname);
create table Course
(
    cno     char(10) not null,
    cname   char(16) not null,
    ccredit smallint not null,
    cpno    char(10) null,
    constraint Course_pk
        primary key (cno)
);
create index Course_cno_ccredit_index on Course (cno asc, ccredit desc);

create table SC
(
    sno   char(10) not null,
    grade smallint null,
    cno   char(10) not null,
    constraint SC_pk
        primary key (sno, cno)
);



alter table SC
    add constraint FK_SC_student foreign key (sno) references student (sno);
alter table SC
    add constraint FK_SC_Course foreign key (cno) references Course (cno);



insert into student
values ('2001124001', '张飞', '男', '管理学院', 23, '1464312');
insert into student
values ('2001124002', '郭旭', '男', '管理学院', 89, '1145114');
insert into student
values ('2001124004', '周波', '男', '数计学院', 23, '4654654');
insert into student
values ('2001124005', '张柏芝', '女', '数计学院', 30, '154666');
insert into student
values ('2001124006', '风清扬', '男', '管理学院', 28, '14645463');
insert into student
values ('2001124007', '唐伯虎', '男', '材料学院', 26, '1454643');
insert into student
values ('2001124008', '于占鳌', '男', '电气学院', 25, '7842289');
insert into student
values ('2001124009', '九儿', '女', '电气学院', 19, '774512');
insert into student
values ('2001124010', '李茂贞', '女', '电气学院', 29, '6659873');
insert into student
values ('2001124011', '紫霞', '女', '材料学院', 19, '4654562');


INSERT INTO Course
VALUES ('001', 'java', '4', '003')
     , ('002', 'c语言', '4', '003')
     , ('003', '数据结构', '4', NULL)
     , ('004', '数据库原理', '3', '002')
     , ('005', '计算机组成原理', '2', NULL)
     , ('006', '操作系统', '2', '005')
     , ('007', '计算机网络原理', '3', NULL)
     , ('008', '高等数学', '5', NULL)
     , ('009', '大学英语一', '2', NULL)
     , ('010', '大学物理三', '3', NULL)
;



insert into SC
values ('2001124001', null, '001'),
       ('2001124001', 82, '002'),
       ('2001124001', 78, '003'),
       ('2001124001', 96, '004'),
       ('2001124001', 76, '005'),
       ('2001124001', 39, '006'),
       ('2001124001', 88, '007'),
       ('2001124001', null, '008'),
       ('2001124001', 82, '009'),
       ('2001124001', 69, '010');

insert into SC
values ('2001124002', 98, '001'),
       ('2001124002', 92, '002'),
       ('2001124002', 78, '003'),
       ('2001124002', 96, '004'),
       ('2001124002', null, '005'),
       ('2001124002', 88, '006'),
       ('2001124002', 88, '007'),
       ('2001124002', 81, '008'),
       ('2001124002', 82, '009'),
       ('2001124002', 79, '010');


insert into SC
values ('2001124005', 66, '001'),
       ('2001124005', 72, '002'),
       ('2001124005', 88, '003'),
       ('2001124005', 76, '004'),
       ('2001124005', 76, '005'),
       ('2001124005', 68, '006'),
       ('2001124005', 68, '007'),
       ('2001124005', 86, '008'),
       ('2001124005', 80, '009'),
       ('2001124005', null, '010');


insert into SC
values ('2001124004', 46, '001'),
       ('2001124004', null, '002'),
       ('2001124004', null, '003'),
       ('2001124004', 87, '004'),
       ('2001124004', null, '005'),
       ('2001124004', 58, '006'),
       ('2001124004', 68, '007'),
       ('2001124004', 61, '008'),
       ('2001124004', 72, '009'),
       ('2001124004', 59, '010');

insert into SC
values ('2001124006', 49, '001'),
       ('2001124006', 52, '002'),
       ('2001124006', 88, '003'),
       ('2001124006', 87, '004'),
       ('2001124006', 66, '005'),
       ('2001124006', 88, '006'),
       ('2001124006', 68, '007'),
       ('2001124006', 61, '008'),
       ('2001124006', 72, '009'),
       ('2001124006', null, '010');



insert into SC
values ('2001124007', 86, '001'),
       ('2001124007', 42, '002'),
       ('2001124007', 69, '003'),
       ('2001124007', 87, '004'),
       ('2001124007', 65, '005'),
       ('2001124007', null, '006'),
       ('2001124007', 58, '007'),
       ('2001124007', 61, '008'),
       ('2001124007', 72, '009'),
       ('2001124007', 69, '010');


insert into SC
values ('2001124008', 87, '001'),
       ('2001124008', 72, '002'),
       ('2001124008', 68, '003'),
       ('2001124008', 87, '004'),
       ('2001124008', 96, '005'),
       ('2001124008', 58, '006'),
       ('2001124008', 68, '007'),
       ('2001124008', 61, '008'),
       ('2001124008', 72, '009'),
       ('2001124008', 59, '010');

insert into SC
values ('2001124009', 86, '001'),
       ('2001124009', 92, '002'),
       ('2001124009', 68, '003'),
       ('2001124009', 87, '004'),
       ('2001124009', 66, '005'),
       ('2001124009', 58, '006'),
       ('2001124009', 68, '007'),
       ('2001124009', 61, '008'),
       ('2001124009', 72, '009'),
       ('2001124009', 79, '010');


insert into SC
values ('2001124010', 96, '001'),
       ('2001124010', null, '002'),
       ('2001124010', 88, '003'),
       ('2001124010', 87, '004'),
       ('2001124010', 86, '005'),
       ('2001124010', null, '006'),
       ('2001124010', null, '007'),
       ('2001124010', 79, '008'),
       ('2001124010', 72, '009'),
       ('2001124010', null, '010');



insert into SC
values ('2001124011', 86, '001'),
       ('2001124011', 82, '002'),
       ('2001124011', 58, '003'),
       ('2001124011', 87, '004'),
       ('2001124011', 66, '005'),
       ('2001124011', 98, '006'),
       ('2001124011', 78, '007'),
       ('2001124011', 81, '008'),
       ('2001124011', null, '009'),
       ('2001124011', 79, '010');



alter table student
    add 平均成绩 double;
alter table student
    add 选课门数 int;

# 录入平均成绩
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124001')
where sno = '2001124001';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124002')
where sno = '2001124002';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124004')
where sno = '2001124004';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124005')
where sno = '2001124005';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124006')
where sno = '2001124006';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124007')
where sno = '2001124007';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124008')
where sno = '2001124008';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124009')
where sno = '2001124009';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124010')
where sno = '2001124010';
update student
set 平均成绩=(select round(avg(grade), 1) from SC where sno = '2001124011')
where sno = '2001124011';

# 查询一下所有的平均成绩可以对比一下是否录入正确
select SC.sno, AVG(grade) as 平均成绩
from SC
group by SC.sno;

# 录入选课门数
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124001')
where sno = '2001124001';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124002')
where sno = '2001124002';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124004')
where sno = '2001124004';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124005')
where sno = '2001124005';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124006')
where sno = '2001124006';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124007')
where sno = '2001124007';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124008')
where sno = '2001124008';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124009')
where sno = '2001124009';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124010')
where sno = '2001124010';
update student
set 选课门数 = (select count(grade) from SC where SC.sno = '2001124011')
where sno = '2001124011';


# 默认情况下null值不参与计算,所以不需要过滤
select count(grade)
from SC
where SC.sno = '2001124001';


# 修改'数据库原理'的学分为4
update course
set ccredit=4
where cname = '数据库原理';


# 将姓名为唐伯虎的学生选修数据库原理课程的成绩加5
update sc
set grade =grade + 5
where sno = (select student.sno from student where sname = '唐伯虎')
  and cno = (select cno from course where cname = '数据库原理');


# 删除选课表中成绩低于40分的记录
delete
from sc
where grade < 40;


# 删除学号为2001124011的学生记录(删除单行数据)
delete
from sc
where sno = 2001124011;


# 删除所有选修java课程的选课记录
delete
from sc
where cno = (select cno from course where cname = 'java');


# 将管理学院全体学生成绩置为空
select sno
from student
where sdept = '管理学院';
#先查询是管理学院学生的学号
/*2001124001
  2001124002
  2001124006*/
update sc
set grade=null
where sno = 2001124001;
update sc
set grade=null
where sno = 2001124002;
update sc
set grade=null
where sno = 2001124006;


#  删除学生郭旭的所有选课记录
delete
from sc
where sno = (select sno from student where sname = '郭旭');

# 实验二
# (一)
# 1.查询数据学院学生的学号和姓名
select sno as 学号, sname as 姓名
from student
where sdept = '数计学院';


# 2.查询选修了课程的学生学号
select sno as 学号
from student
where student.选课门数 > 0;


# 3.查询选修高等数学的课程的学生学号和成绩,结果按成绩降序排列,如果成绩相同按学号升序排列
select sno as 学号, grade as 成绩
from sc
where cno = (select cno from course where cname = '高等数学')
order by grade desc, sno asc;


# 4.查询选修高等数学课程,成绩在80~90之间的学生学号和成绩,并将成绩乘以0.8输出
select sno as 学号, grade * 0.8 as 成绩
from sc
where cno = (select cno from course where cname = '高等数学')
  and grade between 80 and 90;


# 5.查询管理学院或数计学院姓张的学生的信息
select *
from student
where (sdept in ('管理学院', '数计学院'))
  and (sname like '张%');


# 6.查询少了成绩的学生的学号和课程号
select sno 学号, cno 课程号, grade
from sc
where grade is null;



# (二)
# 1.查询学生的学号,姓名,选修的课程名称及成绩
select distinct sc.sno        学号,
                student.sname 姓名,
                Course.cname  选修的课程,
                sc.grade      成绩
from sc
         left join student on sc.sno = student.sno
         left join course on sc.cno = Course.cno;


# 2.查询数计学院学生选修的课程学分大于2的课程的详细信息
select distinct Course.*
from sc
         left join student on sc.sno = student.sno
         left join course on sc.cno = Course.cno
where student.sdept = '数计学院'
  and Course.ccredit > 2;

# 3.查询所有学生信息以及他所选课的课程号和成绩
# (1)
select distinct student.*,
                Course.*,
                sc.grade
from sc
         left join student on sc.sno = student.sno
         left join course on sc.cno = Course.cno;

# (2)要求查询结果也显示即使没有选课的学生的信息
select distinct student.*,
                Course.*,
                sc.grade
from student
         left join sc on sc.sno = student.sno
         left join course on sc.cno = Course.cno;


# 4.查询选修课课程号为002且成绩在90分以上的学生学号,姓名和成绩
select distinct sc.sno        学号,
                student.sname 姓名,
                sc.grade      成绩
from sc
         left join student on sc.sno = student.sno
         left join course on sc.cno = Course.cno
where SC.cno = 002
  and sc.grade > 90;
# 5.查询每一门课的间接先行课
select c4.*,
       c5.cpno 间接先行课
from course c4
         left join (select distinct c1.cno,
                                    c2.cpno
                    from course c1,
                         course c2,
                         course c3
                    where c1.cpno = c2.cno
                      and c2.cpno = c3.cno) c5 on c4.cno = c5.cno;
# 实验三
# 1.嵌套查询
# (1)查询选修了'c语言'课程的学生学号和姓名
select sc.sno, (select sname from student where sno = sc.sno) 姓名
from sc
where sc.cno = (select course.cno from course where cname = 'c语言');
# (2)查询比唐伯虎年龄大的学生学号和姓名
select s.sno 学号, s.sname 姓名
from student s
where s.sage > (select sage from student where sname = '唐伯虎');
# (3)查询数据结构课程的成绩低于唐伯虎的学生学号和成绩
select *
from student s
where sno in (select SC.sno
              from sc
              where grade < (select grade
                             from sc,
                                  student s,
                                  course c
                             where sc.sno = s.sno
                               and c.cno = sc.cno
                               and s.sname = '唐伯虎'
                               and c.cname = '数据结构'));
# (4)查询其他学院中比数计学院学生年龄都小的学生
select *
from student
where sage < all (select sage from student where sdept = '数计学院');
# (5)查询选修了操作系统课程的学生姓名
select sname
from student
where sno in (select sno from sc where cno = (select cno from course where cname = '操作系统'));
# (6)查询没有选修操作系统课程的学生姓名
select sname
from student
where sno not in (select sno from sc where cno = (select cno from course where cname = '操作系统'));
# (7)查询选修了全部课程的学生姓名
select sname
from student
where sno in (select SC.sno from sc group by sno having count(*) = 10);
# (8)查询至少选修了学生为张飞的学生所选修的全部课程的学生学号和姓名
select sno, sname
from student
where sno in (select distinct sno
              from SC c
              where not exists(select *
                               from SC b
                               where b.Sno = (select sno
                                              from student
                                              where sname = '张飞')
                                 and not exists(select *
                                                from SC a
                                                where a.Sno = c.Sno
                                                  and a.Cno = b.Cno)));
# (9)查询既选修了数据库原理又选修了操作系统课程的学生姓名
select sname
from student
where sno in (select a.sno
              from (select sno from sc where cno = (select cno from course where cname = '操作系统')) a
                       inner join (select sno from sc where cno = (select cno from course where cname = '数据库原理')) b
                                  on a.sno = b.sno);
# (10)查询既选修了数据库原理或选修了操作系统课程的学生学号
select sno
from sc
where cno = (select cno from course where cname = '操作系统')
union
select sno
from sc
where cno = (select cno from course where cname = '数据库原理');
# (11)查询既选修了数据库原理而没有选修操作系统课程的学生学号
select sno
from student
where sno in (select a.sno
              from (select sno from sc where cno = (select cno from course where cname = '数据库原理')) a
                       left join (select distinct sno
                                  from sc
                                  where cno = (select cno from course where cname = '操作系统')) b
                                 on a.sno = b.sno
              where b.sno is null);
# (12)查询全是男同学选修的课程号
select distinct cno
from SC x
where not exists(select cno
                 from student
                 where ssex = '女'
                   and exists(select *
                              from SC y
                              where y.cno = x.cno
                                and y.sno = student.sno));
# 2.组合查询和统计查询
#(1)使用集合运算查询既选修了数据结构课程又选修了数据库原理课程的学生姓名。
# mysql8.0不支持intersect
select s.sname
from student s
where s.sno in (select t1.sno
                from (select sno
                      from SC
                      where cno = (select cno
                                   from Course
                                   where cname = '数据结构')) t1
                         inner join
                     (select sno
                      from SC
                      where cno = (select cno
                                   from Course
                                   where cname = '数据库原理')) t2 on t1.sno = t2.sno);
#(2)使用集合运算查询选修了数据结构课程或选修了数据库原理课程的学生学号。
select sname
from student
where sno in (select sno
              from SC
              where cno in (select cno
                            from Course
                            where cname = '数据结构'))
union
select sname
from student
where sno in (select sno
              from SC
              where cno in (select cno
                            from Course
                            where cname = '数据库原理'));
#(3)使用集合运算查询选修了数据结构课程而没有选修了数据库原理课程的学生
# mysql8.0不支持except
select sname
from student
where sno in (select sno
              from SC sc1
              where sc1.cno in (select cno
                                from Course
                                where cname = '数据结构'))
  and sno
    not in (select sc2.sno
            from SC sc2
            where sc2.cno in (select cno
                              from Course
                              where cname = '数据库原理'));
#(4)统计选修了课程的学生人数。
select count(distinct sno) as stusum
from SC;
#(5)查询选修成绩合格的课程超过4门以上学生的学生学号、总成绩。
select sc.sno, sum(sc.grade) gradesum
from sc
where sc.grade >= 60
group by sc.sno
having count(sc.cno) >= 4;
#(6)统计各院系的学生人数。
select s.sdept, count(s.sdept) sum
from student s
group by s.sdept;
#(7)统计各年龄的学生人数。
select s.sage, count(s.sage) sum
from student s
group by s.sage;
#(8)统计每个学生的选修课程数目和平均成绩。
select sno,
       count(sc.sno) stusum,
       avg(sc.grade) avggrade
from sc
group by sno;
#(9)查询每门课程的详细信息及选课人数。
select Course.*, 选课人数
from Course
         left join (select cno, count(*) 选课人数
                    from SC
                    group by cno) as a on a.cno = Course.cno;

有关数据库实验(学生选课系统)的更多相关文章

  1. ruby - 解析 RDFa、微数据等的最佳方式是什么,使用统一的模式/词汇(例如 schema.org)存储和显示信息 - 2

    我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i

  2. ruby - Ruby 有 `Pair` 数据类型吗? - 2

    有时我需要处理键/值数据。我不喜欢使用数组,因为它们在大小上没有限制(很容易不小心添加超过2个项目,而且您最终需要稍后验证大小)。此外,0和1的索引变成了魔数(MagicNumber),并且在传达含义方面做得很差(“当我说0时,我的意思是head...”)。散列也不合适,因为可能会不小心添加额外的条目。我写了下面的类来解决这个问题:classPairattr_accessor:head,:taildefinitialize(h,t)@head,@tail=h,tendend它工作得很好并且解决了问题,但我很想知道:Ruby标准库是否已经带有这样一个类? 最佳

  3. ruby - 我如何添加二进制数据来遏制 POST - 2

    我正在尝试使用Curbgem执行以下POST以解析云curl-XPOST\-H"X-Parse-Application-Id:PARSE_APP_ID"\-H"X-Parse-REST-API-Key:PARSE_API_KEY"\-H"Content-Type:image/jpeg"\--data-binary'@myPicture.jpg'\https://api.parse.com/1/files/pic.jpg用这个:curl=Curl::Easy.new("https://api.parse.com/1/files/lion.jpg")curl.multipart_form_

  4. 世界前沿3D开发引擎HOOPS全面讲解——集3D数据读取、3D图形渲染、3D数据发布于一体的全新3D应用开发工具 - 2

    无论您是想搭建桌面端、WEB端或者移动端APP应用,HOOPSPlatform组件都可以为您提供弹性的3D集成架构,同时,由工业领域3D技术专家组成的HOOPS技术团队也能为您提供技术支持服务。如果您的客户期望有一种在多个平台(桌面/WEB/APP,而且某些客户端是“瘦”客户端)快速、方便地将数据接入到3D应用系统的解决方案,并且当访问数据时,在各个平台上的性能和用户体验保持一致,HOOPSPlatform将帮助您完成。利用HOOPSPlatform,您可以开发在任何环境下的3D基础应用架构。HOOPSPlatform可以帮您打造3D创新型产品,HOOPSSDK包含的技术有:快速且准确的CAD

  5. 电脑0x0000001A蓝屏错误怎么U盘重装系统教学 - 2

      电脑0x0000001A蓝屏错误怎么U盘重装系统教学分享。有用户电脑开机之后遇到了系统蓝屏的情况。系统蓝屏问题很多时候都是系统bug,只有通过重装系统来进行解决。那么蓝屏问题如何通过U盘重装新系统来解决呢?来看看以下的详细操作方法教学吧。  准备工作:  1、U盘一个(尽量使用8G以上的U盘)。  2、一台正常联网可使用的电脑。  3、ghost或ISO系统镜像文件(Win10系统下载_Win10专业版_windows10正式版下载-系统之家)。  4、在本页面下载U盘启动盘制作工具:系统之家U盘启动工具。  U盘启动盘制作步骤:  注意:制作期间,U盘会被格式化,因此U盘中的重要文件请注

  6. 【鸿蒙应用开发系列】- 获取系统设备信息以及版本API兼容调用方式 - 2

    在应用开发中,有时候我们需要获取系统的设备信息,用于数据上报和行为分析。那在鸿蒙系统中,我们应该怎么去获取设备的系统信息呢,比如说获取手机的系统版本号、手机的制造商、手机型号等数据。1、获取方式这里分为两种情况,一种是设备信息的获取,一种是系统信息的获取。1.1、获取设备信息获取设备信息,鸿蒙的SDK包为我们提供了DeviceInfo类,通过该类的一些静态方法,可以获取设备信息,DeviceInfo类的包路径为:ohos.system.DeviceInfo.具体的方法如下:ModifierandTypeMethodDescriptionstatic StringgetAbiList​()Obt

  7. FOHEART H1数据手套驱动Optitrack光学动捕双手运动(Unity3D) - 2

    本教程将在Unity3D中混合Optitrack与数据手套的数据流,在人体运动的基础上,添加双手手指部分的运动。双手手背的角度仍由Optitrack提供,数据手套提供双手手指的角度。 01  客户端软件分别安装MotiveBody与MotionVenus并校准人体与数据手套。MotiveBodyMotionVenus数据手套使用、校准流程参照:https://gitee.com/foheart_1/foheart-h1-data-summary.git02  数据转发打开MotiveBody软件的Streaming,开始向Unity3D广播数据;MotionVenus中设置->选项选择Unit

  8. 使用canal同步MySQL数据到ES - 2

    文章目录一、概述简介原理模块二、配置Mysql使用版本环境要求1.操作系统2.mysql要求三、配置canal-server离线下载在线下载上传解压修改配置单机配置集群配置分库分表配置1.修改全局配置2.实例配置垂直分库水平分库3.修改group-instance.xml4.启动监听四、配置canal-adapter1修改启动配置2配置映射文件3启动ES数据同步查询所有订阅同步数据同步开关启动4.验证五、配置canal-admin一、概述简介canal是Alibaba旗下的一款开源项目,Java开发。基于数据库增量日志解析,提供增量数据订阅&消费。Git地址:https://github.co

  9. ruby-on-rails - 创建 ruby​​ 数据库时惰性符号绑定(bind)失败 - 2

    我正在尝试在Rails上安装ruby​​,到目前为止一切都已安装,但是当我尝试使用rakedb:create创建数据库时,我收到一个奇怪的错误:dyld:lazysymbolbindingfailed:Symbolnotfound:_mysql_get_client_infoReferencedfrom:/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundleExpectedin:flatnamespacedyld:Symbolnotfound:_mysql_get_client_infoReferencedf

  10. STM32读取串口传感器数据(颗粒物传感器,主动上传) - 2

    文章目录1.开发板选择*用到的资源2.串口通信(个人理解)3.代码分析(注释比较详细)1.主函数2.串口1配置3.串口2配置以及中断函数4.注意问题5.源码链接1.开发板选择我用的是STM32F103RCT6的板子,不过代码大概在F103系列的板子上都可以运行,我试过在野火103的霸道板上也可以,主要看一下串口对应的引脚一不一样就行了,不一样的就更改一下。*用到的资源keil5软件这里用到了两个串口资源,采集数据一个,串口通信一个,板子对应引脚如下:串口1,TX:PA9,RX:PA10串口2,TX:PA2,RX:PA32.串口通信(个人理解)我就从串口采集传感器数据这个过程说一下我自己的理解,

随机推荐