简单毛概刷题网页制作 3.0(拖欠近一年版)

原因是大概一年之前学校的毛概期末刷题网站突然崩了,但是一直没有修复。当时眼看着复习时间逐渐被压缩,自己啥也做不了,遂自学前端完成毛概刷题网页一枚。

最早的毛概刷题网站仅仅是 1.0 版本(传送门),功能非常不齐全,只有最基本的选择判断题顺序做题的功能,自己用着也不是很爽。

当时就做出来了后来的 2.0,3.0 版本,包含其他功能,当时说是要更新的。

但是

期末嘛

忙嘛

忘记发了

看到有读者在文末评论才反应过来,忘记更新了,现在补上

做了 2.0 版本(传送门),主要功能是针对记忆和备考的,含有实时更新的准确率监测面板。

但是后来有同学反应这个不能很好地模拟考试,只适合最基础的记忆,故出了一版能模考的

文章目录

  • 效果图
  • 代码
    • 目录
    • Q_data.js
    • TF_data.js
    • get_exam.js
    • get_Q_2.0.js
    • jquery.js
    • style.css
    • get_TF_2.0.js
    • 铖铖的公主.html
  • project文件分享(可直接食用)

效果图

话不多说效果图奉上~

功能主要有:

顺序选择判断

在这里插入图片描述

平平无奇的功能,只是把选择判断分开记忆了,方便刷题罢了

判断题死记

当然,除了顺序刷题,判断题还有特殊要求。考虑到很多判断题会在选择题的选项里出现,而且判断题之间也具有迷惑性,所以我直接单拎出来正确的判断题用于记忆。效果还OK吧~

在这里插入图片描述

模拟考试功能

随机抽取试题,根据考试的选择判断比例生成试卷,模拟考试,增加趣味性。这样刷题刷着不累

在这里插入图片描述

考得确实不咋地

代码

目录

命名方式奇奇怪怪,不是啥好习惯~

在这里插入图片描述
Q_data.js为选择题数据,json格式。=>直接写死成这样,就不用 Ajax 了,直接点开 html 文件就能看。

TF_data.js为判断题数据,json格式。=>直接写死成这样,就不用 Ajax 了,直接点开 html 文件就能看。

get_exam.js遍历数据集生成测试题目。

get_Q_2.0.js顺序模式下生成题目。

get_TF_2.0.js判断ABCD是不是选对了,包括判断单选是否正确的代码等。

jquery.js为开源的 jquery 代码,网上一抓一大把就不放了。

style.css为布局文件,毛概题库的布局信息都在这里。

铖铖的公主.html唯一的 html 文件,有点像C里面的 main 函数

Q_data.js

这个是数据集,也不放正文占篇幅了,可以去文末的网盘文件里拿。

TF_data.js

这个是数据集,也不放正文占篇幅了,可以去文末的网盘文件里拿。

get_exam.js

包括随机抽取函数、初始化函数、考试判断函数等等

console.log(Q_data, TF_data);

function randArray(len, min, max) {
    id = Array.from({length:len}, v=> Math.floor(Math.random()*(max-min))+min);
    id = Array.from(new Set(id));
    if(len > max-min)alert("元素个数不够");
    if(id.length < len){ //取出重复的就删除然后顺序补足
        addnum = len-id.length;
        for(var i=min; i<max; i++){
            num = Math.floor(Math.random()*(max-min))+min
            if(id.length == len)break;
            if(id.includes(num))continue;
            else{
                id.push(num);
            }
        }
    }
	return id 
}

function init_data(){
    dic = {}
    exam_Q_data = [];
    exam_TF_data = [];
    
    random_id_Q = randArray(40, 0, 667);
    random_id_TF = randArray(16, 0, 208);
    exam_Q_data = [];
    exam_TF_data = [];
    
    for(var i=0; i<random_id_Q.length; i++){
        exam_Q_data.push(Q_data[random_id_Q[i]]);
        s = eval(Q_data[random_id_Q[i]].answer)
        dic[Q_data[random_id_Q[i]].no] = [s, s, true];
    }
    for(var i=0; i<random_id_TF.length; i++){
        exam_TF_data.push(TF_data[random_id_TF[i]]);
        s = eval(TF_data[random_id_TF[i]].answer)
        dic[TF_data[random_id_TF[i]].no] = [s, s, true];
    }
    return [dic, exam_Q_data, exam_TF_data];    
}

init_data_array = init_data();
dic = init_data_array[0];
exam_Q_data = init_data_array[1];
exam_TF_data = init_data_array[2];
console.log(dic);
console.log(exam_Q_data);
console.log(exam_TF_data);
exam_final = 0;

function get_exam(data_Q, data_TF){

    if(data_Q.length>0){   //项目列表
        var listInfo="";
        $.each(data_Q,function(){
            listInfo+=
            '<div class="question" id="s'+this.no+'">'+
                '<p class="wen">'+
                    this.number+'&emsp;'+this.question+
                '</p>'+
                '<div class="answer">'+
                    '<button type="button" id="'+'c0k'+this.answer+'s'+this.no+ '"class="exam_A">' + this.A + '</button>' +
                    '<button type="button" id="'+'c1k'+this.answer+'s'+this.no+ '"class="exam_B">' + this.B + '</button>' +
                    '<button type="button" id="'+'c2k'+this.answer+'s'+this.no+ '"class="exam_C">' + this.C + '</button>' +
                    '<button type="button" id="'+'c3k'+this.answer+'s'+this.no+ '"class="exam_D">' + this.D + '</button>' +
                '</div>'+
            '</div>';
        });
        if(data_TF.length>0){   //项目列表
            $.each(data_TF,function(){
                listInfo+=
                '<div class="question" id="s'+this.no+'">'+
                    '<p class="wen">'+
                        this.number+'&emsp;'+this.question+
                    '</p>'+
                    '<div class="answer">'+
                        '<button type="button" id="'+'c0k'+this.answer+'s'+this.no+ '"class="exam_A">' + this.T + '</button>' +
                        '<button type="button" id="'+'c1k'+this.answer+'s'+this.no+ '"class="exam_B">' + this.F + '</button>' +
                    '</div>'+
                '</div>';
            });
        $("#Select")[0].innerHTML=listInfo;	
    }
  }
}



//绑定考试事件
$(document).on("click",".exam_A",function(){ //通过document绑定对应的事件
    id = $(this).attr('id')
    no = id.substr(5);
    key = id.substr(3,1);
    c = id.substr(1,1);
    console.log(id, no, key, c);
    for (i = 0; i < 4; i++) { 
        $('#c'+i+'k'+key+'s'+no).removeClass('choosed');

    }
    $("#"+id).addClass('choosed');
    $("#s"+no).addClass('done');
    dic[no] = [eval(c), eval(key), c==key];
    console.log(dic);
});

$(document).on("click",".exam_B",function(){ //通过document绑定对应的事件
    id = $(this).attr('id')
    no = id.substr(5);
    key = id.substr(3,1);
    c = id.substr(1,1);
    console.log(id, no, key, c);
    for (i = 0; i < 4; i++) { 
        $('#c'+i+'k'+key+'s'+no).removeClass('choosed');

    }
    $("#"+id).addClass('choosed');
    $("#s"+no).addClass('done');
    dic[no] = [eval(c), eval(key), c==key];
    console.log(dic);
});


$(document).on("click",".exam_C",function(){ //通过document绑定对应的事件
    id = $(this).attr('id')
    no = id.substr(5);
    key = id.substr(3,1);
    c = id.substr(1,1);
    for (i = 0; i < 4; i++) { 
        $('#c'+i+'k'+key+'s'+no).removeClass('choosed');

    }
    $("#"+id).addClass('choosed');
    $("#s"+no).addClass('done');
    dic[no] = [eval(c), eval(key), c==key];
    console.log(dic);
});


$(document).on("click",".exam_D",function(){ //通过document绑定对应的事件
    id = $(this).attr('id')
    no = id.substr(5);
    key = id.substr(3,1);
    c = id.substr(1,1);
    for (i = 0; i < 4; i++) { 
        $('#c'+i+'k'+key+'s'+no).removeClass('choosed');
    }
    $("#"+id).addClass('choosed');
    $("#s"+no).addClass('done');
    dic[no] = [eval(c), eval(key), c==key];
    console.log(dic);
});


function check(data_Q, data_TF, dic){	
    sum1 = 0;
    if(data_Q.length>0){   //项目列表
        var listInfo="";
        $.each(data_Q,function(){
            a = "";
            b = "";
            c = "";
            d = "";
            choice = [a, b, c, d];
            choice[dic[eval(this.no)][1]] = "true1";
            if(dic[eval(this.no)][2] == false)choice[dic[eval(this.no)][0]] = "false1";
            else sum1 += 1;
            listInfo+=
            '<div class="question" id="s'+this.no+'">'+
                '<p class="wen">'+
                    this.number+'&emsp;'+this.question+
                '</p>'+
                '<div class="answer">'+
                    '<button type="button" id="'+'c0k'+this.answer+'s'+this.no+ '"class="exam_A '+choice[0]+'">' + this.A + '</button>' +
                    '<button type="button" id="'+'c1k'+this.answer+'s'+this.no+ '"class="exam_B '+choice[1]+'">' + this.B + '</button>' +
                    '<button type="button" id="'+'c2k'+this.answer+'s'+this.no+ '"class="exam_C '+choice[2]+'">' + this.C + '</button>' +
                    '<button type="button" id="'+'c3k'+this.answer+'s'+this.no+ '"class="exam_D '+choice[3]+'">' + this.D + '</button>' +
                '</div>'+
            '</div>';
        });
        if(data_TF.length>0){   //项目列表
            sum2 = 0;

            $.each(data_TF,function(){
                a = "";
                b = "";
                choice = [a, b];
                choice[dic[eval(this.no)][1]] = "true1";
                if(dic[eval(this.no)][2] == false)choice[dic[eval(this.no)][0]] = "false1";
                else sum2 += 1;
                listInfo+=
                '<div class="question" id="s'+this.no+'">'+
                    '<p class="wen">'+
                        this.number+'&emsp;'+this.question+
                    '</p>'+
                    '<div class="answer">'+
                        '<button type="button" id="'+'c0k'+this.answer+'s'+this.no+ '"class="exam_A '+choice[0]+'">' + this.T + '</button>' +
                        '<button type="button" id="'+'c1k'+this.answer+'s'+this.no+ '"class="exam_B '+choice[1]+'">' + this.F + '</button>' +
                    '</div>'+
                '</div>';
            });
        $("#Select")[0].innerHTML=listInfo;	
    }
  }
  alert("共"+data_Q.length+"道单选题,"+data_TF.length+"道判断题,答对了"+sum1+"道单选题,达对了"+sum2+"道判断题,准确率高达"+(sum1+sum2)/(data_Q.length+data_TF.length)*100+"%太牛了吧!!")
}

get_Q_2.0.js

主要是几个可能会用到的函数

  • get_Q:生成选择题问题
  • get_TF:生成判断题问题
  • get_T:生成判断题中答案为正确的问题

function get_Q(data){				         
                if(data.length>0){   //项目列表
                    var listInfo="";
                    $.each(data,function(){
                        listInfo+=
                        '<div class="question" id="s'+this.no+'">'+
                            '<p class="wen">'+
                                this.number+'&emsp;'+this.question+
                            '</p>'+
                            '<div class="answer">'+
                                '<button type="button" id="'+'c0k'+this.answer+'s'+this.no+ '"class="A">' + this.A + '</button>' +
                                '<button type="button" id="'+'c1k'+this.answer+'s'+this.no+ '"class="B">' + this.B + '</button>' +
                                '<button type="button" id="'+'c2k'+this.answer+'s'+this.no+ '"class="C">' + this.C + '</button>' +
                                '<button type="button" id="'+'c3k'+this.answer+'s'+this.no+ '"class="D">' + this.D + '</button>' +
                            '</div>'+
                        '</div>';
                    });
                    $("#Select")[0].innerHTML=listInfo;	
                }
            }


function get_TF(data){				         
                if(data.length>0){   //项目列表
                    var listInfo="";
                    $.each(data,function(){
                            listInfo+=
                            '<div class="question" id="s'+this.no+'">'+
                                '<p class="wen">'+
                                    this.number+'&emsp;'+this.question+
                                '</p>'+
                                '<div class="answer">'+
                                    '<button type="button" id="'+'c0k'+this.answer+'s'+this.no+ '"class="A">' + this.T + '</button>' +
                                    '<button type="button" id="'+'c1k'+this.answer+'s'+this.no+ '"class="B">' + this.F + '</button>' +
                                '</div>'+
                            '</div>';

                    });
                    $("#Select")[0].innerHTML=listInfo;
                }
            }


            function get_T(data){				         
                if(data.length>0){   //项目列表
                    var listInfo="";
                    $.each(data,function(){

                        if(this.answer === "0"){
                            listInfo+=
                            '<div class="question" id="s'+this.no+'">'+
                                '<p class="wen">'+
                                    this.number+'&emsp;'+this.question+
                                '</p>'+
                                '<div class="answer">'+
                                    '<button type="button" id="'+'c0k'+this.answer+'s'+this.no+ '"class="A">' + this.T + '</button>' +
                                    '<button type="button" id="'+'c1k'+this.answer+'s'+this.no+ '"class="B">' + this.F + '</button>' +
                                '</div>'+
                            '</div>';
                        }

                    });
                    $("#Select")[0].innerHTML=listInfo;
                }
            }

jquery.js

开源的,网上一抓一大把,不放正文占篇幅了,可以去文末的网盘文件里拿。

style.css

布局文件,包括按钮的样式和动画、选项状态、悬浮状态栏等等


.button {
    color: white;
    padding: 5px 50px;
    position: relative;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 20px;
    font-family: "miaowu";
    margin-left: 10%; 
	margin-top: 20px;
    border-radius: 5px;
    -webkit-transition-duration: 0.4s; /* Safari */
    transition-duration: 0.4s;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
.button1{
	background-color: #383838;
}
.button1:hover {
    background-color: #fdcdac;
    color: white;
    box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
}
.button1:active {
    background-color: #f1e2cc;
    box-shadow: 0 5px #666;
    transform: translateY(1px);
	color: #383838;
}
#Select{
    margin-top: 20px;
    margin-left: 2%;
    margin-right: 2%;
}
#Select .question{
    border: 1px solid #383838;
}
#Select .wen{
    font-size: 20px;
    padding: 2%;
    margin: 0;
}
#Select .A,
#Select .B,
#Select .C,
#Select .D{
    font-size: 18px;
    text-decoration: none;
    color: black;
    width: 100%;
    text-align: center;
}
.true1{
    background-color: rgb(33, 201, 30);
}
.false1{
    background-color: red;
}
.choosed{
    background-color:cornflowerblue;
}
#done{
    left: 0;
	position: fixed;
	bottom: 0;
	width: 100%;
	z-index: 100;
}
/* #Select .ans{
    display: inline;
} */


#Select .exam_A,
#Select .exam_B,
#Select .exam_C,
#Select .exam_D{
    font-size: 18px;
    text-decoration: none;
    color: black;
    width: 100%;
    text-align: center;
}

get_TF_2.0.js

用于判断选项是否正确,写的比较糙,直接暴力判断了。

很low的一种写法,用来判断ABCD是不是被click了,并且判断是不是正确答案。

$(document).on("click",".A",function(){ //通过document绑定对应的事件
    id = $(this).attr('id')
    no = id.substr(5);
    key = id.substr(3,1);
    c = id.substr(1,1);
    for (i = 0; i < 4; i++) { 
        $('#c'+i+'k'+key+'s'+no).removeClass('true1');
        $('#c'+i+'k'+key+'s'+no).removeClass('false1');
    }
    if(key==c)
        $("#"+id).addClass('true1');
    else{
        $("#"+id).addClass('false1');
        $('#c'+key+'k'+key+'s'+no).addClass('true1');
    }
    $("#s"+no).addClass('done');
});

$(document).on("click",".B",function(){ //通过document绑定对应的事件
    id = $(this).attr('id')
    no = id.substr(5);
    key = id.substr(3,1);
    c = id.substr(1,1);
    for (i = 0; i < 4; i++) { 
        $('#c'+i+'k'+key+'s'+no).removeClass('true1');
        $('#c'+i+'k'+key+'s'+no).removeClass('false1');
    }
    if(key==c)
        $("#"+id).addClass('true1');
    else{
        $("#"+id).addClass('false1');
        $('#c'+key+'k'+key+'s'+no).addClass('true1');
        console.log('#c'+c+'k'+key+'s'+no)
    }
    $("#s"+no).addClass('done');
});

$(document).on("click",".C",function(){ //通过document绑定对应的事件
    id = $(this).attr('id')
    no = id.substr(5);
    key = id.substr(3,1);
    c = id.substr(1,1);
    for (i = 0; i < 4; i++) { 
        $('#c'+i+'k'+key+'s'+no).removeClass('true1');
        $('#c'+i+'k'+key+'s'+no).removeClass('false1');
    }
    if(key==c)
        $("#"+id).addClass('true1');
    else{
        $("#"+id).addClass('false1');
        $('#c'+key+'k'+key+'s'+no).addClass('true1');
    }
    $("#s"+no).addClass('done');
});

$(document).on("click",".D",function(){ //通过document绑定对应的事件
    id = $(this).attr('id')
    no = id.substr(5);
    key = id.substr(3,1);
    c = id.substr(1,1);
    for (i = 0; i < 4; i++) { 
        $('#c'+i+'k'+key+'s'+no).removeClass('true1');
        $('#c'+i+'k'+key+'s'+no).removeClass('false1');
    }
    if(key==c)
        $("#"+id).addClass('true1');
    else{
        $("#"+id).addClass('false1');
        $('#c'+key+'k'+key+'s'+no).addClass('true1');
    }
    $("#s"+no).addClass('done');
});

铖铖的公主.html

平平无奇 html 文件一枚~

搭建了网页的骨架

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="style.css" rel="stylesheet" type="text/css">
    <script src="./js/jquery.js" type="text/javascript"></script>
    <script src="./data/Q_data.js"></script>
    <script src="./data/TF_data.js"></script>
    <script src="./js/get_Q_2.0.js" type="text/javascript"></script> 
    <script src="./js/get_TF_2.0.js" type="text/javascript"></script> 
    <script src="./js/get_exam.js"></script>
    <title>铖铖的公主</title>
</head>
<body>
    <button class = "button button1" onclick="get_Q(Q_data);">顺序选择</button>
    <button class = "button button1" onclick="get_TF(TF_data);">顺序判断</button>
    <button class = "button button1" onclick="get_T(TF_data);">正确的判断题</button>
    <button class = "button button1" onclick="init_data(); get_exam(exam_Q_data, exam_TF_data);">开始测试</button>
    <div id="Select">
    </div>
    <button class = "button button1" onclick="check(exam_Q_data, exam_TF_data, dic);">提交测试</button>

</body>
</html>

project文件分享(可直接食用)

记得一键三连噢~~

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/16787.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

STM32F4_USMART调试组件

目录 1. USMART是什么&#xff1f; 2. USMART的特点 3. USMART实现流程 4. USMART组件 5. 在usmart_config.c中添加想要被USMART调用的函数 6. 实验程序 6.1 main.c 6.2 usmart.c 6.3 usmart.h 7. USMART调试的优越性说明 1. USMART是什么&#xff1f; USMART 是 AL…

org.apache.poi 设置 Excel 单元格颜色 RGB

一、背景说明 在使用 org.apache.poi 导出 Excel 时&#xff0c;需要设置部分单元格的颜色。 可以使用方法&#xff1a;org.apache.poi.ss.usermodel.CellStyle.setFillForegroundColor() 和 org.apache.poi.ss.usermodel.CellStyle.setFillPattern() 来设置单元格的颜色和填…

低频量化之 可转债 配债数据及策略 - 全网独家

目录 历史文章可转债配债数据 待发转债&#xff08;进展统计&#xff09;待发转债&#xff08;行业统计&#xff09;待发转债&#xff08;5证监会通过&#xff0c;PE排序&#xff09;待发转债&#xff08;5证监会通过&#xff0c;安全垫排序&#xff09;待发转债&#xff08;5证…

【算法】一文彻底搞懂ZAB算法

文章目录 什么是ZAB 算法&#xff1f;深入ZAB算法1. 消息广播两阶段提交ZAB消息广播过程 2. 崩溃恢复选举参数选举流程 ZAB算法需要解决的两大问题1. 已经被处理的消息不能丢2. 被丢弃的消息不能再次出现 最近需要设计一个分布式系统&#xff0c;需要一个中间件来存储共享的信息…

Java 怎样实现代理模式,有什么优缺点

一、介绍 代理模式是一种常见的设计模式&#xff0c;它可以为其他对象提供一种代理以控制对这个对象的访问。代理对象具有与被代理对象相同的接口&#xff0c;客户端无需知道代理对象和被代理对象的区别。代理模式可以应用于各种不同的场景&#xff0c;例如远程代理、虚拟代理…

SpringBoot整合Mybatis-plus实现多级评论

在本文中&#xff0c;我们将介绍如何使用SpringBoot整合Mybatis-plus实现多级评论功能。同时&#xff0c;本文还将提供数据库的设计和详细的后端代码&#xff0c;前端界面使用Vue2。 数据库设计 本文的多级评论功能将采用MySQL数据库实现&#xff0c;下面是数据库的设计&…

vcruntime140.dll无法继续执行代码?vcruntime140.dll如何修复?只需要3步即可

vcruntime140.dll是用于Microsoft Visual C Redistributable&#xff08;可再发行组件&#xff09;的一部分&#xff0c;它是一个动态链接库文件&#xff0c;包含了该软件包提供的运行库。在许多应用程序和游戏中&#xff0c;vcruntime140.dll文件经常被使用。如果该文件缺失或…

spark 数据的加载和保存(Parquet、JSON、CSV、MySql)

spark数据的加载和保存 SparkSQL 默认读取和保存的文件格式为 parquet 1.加载数据 spark.read.load 是加载数据的通用方法 scala> spark.read. csv format jdbc json load option options orc parquet schema table text textFile 如果读取不同格式的数据&#xff0c;可以…

后端要一次性返回我10万条数据

问题描述 面试官&#xff1a;后端一次性返回10万条数据给你&#xff0c;你如何处理&#xff1f;我&#xff1a;歪嘴一笑&#xff0c;what the f**k! 问题考察点 看似无厘头的问题&#xff0c;实际上考查候选人知识的广度和深度&#xff0c;虽然在工作中这种情况很少遇到... …

情景剧本杀闯关系统

情景剧本杀闯关软件的开发需求通常包括以下几个方面&#xff1a; 剧本设计&#xff1a;开发者需要根据用户需求和市场调研&#xff0c;设计不同主题和难度等级的剧本内容&#xff0c;以及游戏过程中的任务、角色和道具等。 游戏引擎开发&#xff1a;为了实现游戏过程中…

如何在 DigitalOcean 中部署 ONLYOFFICE 文档

现在您可使用通过 DigitalOcean 市场提供的一键式应用在 DigitalOcean 云架构中轻松部署 Docker 版本的 ONLYOFFICE 文档。 一键式应用是一个包含所有必要预配置组件的镜像&#xff0c;可用于便捷地在运行有 Ubuntu OS 的 DigitalOcean 服务器上部署 ONLYOFFICE&#xff1a; D…

Azure DevOps Server 2022.0.1升级手册

Contents 1. 概述2. 操作方法 2.1 安装操作系统2.2 安装数据库2.4 还原数据2.3 安装和配置Azure DevOps Server 1. 概述 Azure DevOps Server 是微软公司经过20多年的持续开发&#xff0c;逐渐将需求管理、敏捷实践、源代码管理、持续集成等功能集成一体&#xff0c;实现应用软…

B-Tree (多路查找树)分析-20230503

B-Tree (多路查找树)学习-20230503 前言 B-树是一类多路查询树&#xff0c;它主要用于文件系统和某些数据库的索引&#xff0c;如果采用二叉平衡树访问文件里面的数据&#xff0c;最坏情况下&#xff0c;磁头可能需要进行O(h)次对磁盘的读写&#xff0c;其中h为树的高度&…

微服务不是本地部署的最佳选择,不妨试试模块化单体

微服务仅适用于成熟产品 关于从头开始使用微服务&#xff0c;马丁・福勒&#xff08;Martin Fowler&#xff09;总结道&#xff1a; 1. 几乎所有成功的微服务都是从一个过于庞大而不得不拆分的单体应用开始的。 2. 几乎所有从头开始以微服务构建的系统&#xff0c;最后都会因…

Java 反射机制

目录 一、反射机制概述 二、理解并获取Class实例 三、反射的用法 1. 通过反射创建运行时类的对象 2. 通过反射获取运行时类的属性结构 3. 通过反射获取运行时类的方法结构 4. 通过反射获取运行时类的构造器结构 5. 通过反射获取运行时类的父类 6. 通过反射获取运行时类…

DDD系列:三、Repository模式

为什么需要Repository&#xff1f; ​ Anemic Domain Model&#xff08;贫血领域模型&#xff09;特征&#xff1a; 有大量的XxxDO对象&#xff1a;这里DO虽然有时候代表了Domain Object&#xff0c;但实际上仅仅是数据库表结构的映射&#xff0c;里面没有包含&#xff08;或…

Midjourney之logo设计(建议收藏)

目录 宠物诊所的logo设计 常见的Logo类型 图形logo: 字母LOGO APP LOGO 进阶技巧 设置艺术家风格 去掉不需要的元素 ChatGPT Midjourney设计logo 聊天&#xff08;国产&#xff09;&#xff1a;文心一言通义千问 绘图&#xff08;国产&#xff09; UI设计 ChatGP…

【谷粒商城之服务认证OAuth2.0】

本笔记内容为尚硅谷谷粒商城服务认证OAuth2.0部分 目录 一、OAuth 2.0 二、微博登录测试 1、微博登陆准备工作 2、获取微博Access Token 3、登录测试 1.添加HttpUtils工具类 2.controller 3.service 4.vo 总结 一、OAuth 2.0 OAuth&#xff1a; OAuth&#xff08;开…

Java多线程深入探讨

1. 线程与进程2. 创建和管理线程2.1. 继承Thread类2.2. 实现Runnable接口2.3 利用Callable、FutureTask接口实现。2.4 Thread的常用方法 3. 线程同步3.1. synchronized关键字3.1.1同步代码块&#xff1a;3.1.2 同步方法&#xff1a; 3.2. Lock接口 4. 线程间通信5. 线程池5.1 使…

【Linux】管道

目录 一、前言 二、管道 1、匿名管道 1.1、基本原理 1.2、代码实现 1.3、管道的特点 1.4、基于管道的简单设计 2、命名管道 2.1、匿名管道与命名管道的区别 2.2、代码实现命名管道通信 一、前言 为了满足各种需求&#xff0c;进程之间是需要通信的。进程间通信的主要目…
最新文章