【Canvas与钟表】干支表盘

news2024/9/20 8:11:11

【成图】

【代码】

<!DOCTYPE html>
<html lang="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<head>
     <title>387.干支表盘</title>
     <style type="text/css">
     .centerlize{
        margin:0 auto;
        width:1200px;
     }
     </style>
     </head>

     <body οnlοad="init();">
        <div class="centerlize">
            <canvas id="myCanvas" width="12px" height="12px" style="border:1px dotted black;">
                如果看到这段文字说您的浏览器尚不支持HTML5 Canvas,请更换浏览器再试.
            </canvas>
            <img id="myImg" src="387.jpg" style="display:none;"/>
        </div>
     </body>
</html>
<script type="text/javascript">
<!--
/*****************************************************************
* 将全体代码(从<!DOCTYPE到script>)拷贝下来,粘贴到文本编辑器中,
* 另存为.html文件,再用chrome浏览器打开,就能看到实现效果。
******************************************************************/

// canvas的绘图环境
var ctx;

// 高宽
const WIDTH=512;
const HEIGHT=512;

// 舞台对象
var stage;

//-------------------------------
// 初始化
//-------------------------------
function init(){
    // 获得canvas对象
    var canvas=document.getElementById('myCanvas');  
    canvas.width=WIDTH;
    canvas.height=HEIGHT;

    // 初始化canvas的绘图环境
    ctx=canvas.getContext('2d');  
    ctx.translate(WIDTH/2,HEIGHT/2);// 原点平移

    // 准备
    stage=new Stage();    
    stage.init();

    // 开幕
    animate();
}

// 播放动画
function animate(){    
    stage.update();    
    stage.paintBg(ctx);
    stage.paintFg(ctx);     

    // 循环
    if(true){
        //sleep(100);
        window.requestAnimationFrame(animate);   
    }
}

// 舞台类
function Stage(){
    // 初始化
    this.init=function(){
        
    }

    // 更新
    this.update=function(){    
        
    }

    // 画背景
    this.paintBg=function(ctx){
        ctx.clearRect(-WIDTH/2,-HEIGHT/2,WIDTH,HEIGHT);// 清屏    
    }

    // 画前景
    this.paintFg=function(ctx){
        // 底色
        ctx.fillStyle = "white";
        ctx.fillRect(-WIDTH/2,-HEIGHT/2,WIDTH,HEIGHT);        
        
        // 表盘半径,基准尺寸
        const R=220;

        // 外凸圈
        var r=R+12;
        ctx.save();
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();
        var lgrd=ctx.createLinearGradient(0,-r,0,r);
        lgrd.addColorStop(0,"rgb(209,214,217)");
        lgrd.addColorStop(1,"rgb(83,100,108)");        
        ctx.fillStyle=lgrd;
        ctx.fill();

        // 中圈
        ctx.save();
        ctx.rotate(Math.PI*5/4);
        r=R+10;
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();
        ctx.clip();
        var img=document.getElementById("myImg");
        ctx.drawImage(img,0,0,300,300,-r,-r,2*r,2*r);
        ctx.restore();

        // 内凹圈
        r=R+2;
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();
        var lgrd=ctx.createLinearGradient(0,-r,0,r);
        lgrd.addColorStop(0,"rgb(83,100,108)");    
        lgrd.addColorStop(1,"rgb(209,214,217)");        
        ctx.fillStyle=lgrd;
        ctx.fill();

        // 表盘开始
        ctx.fillStyle="rgb(76,97,120)";
        r=R;
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();        
        ctx.fill();

        // 刻度
        r=R/20*19;
        ctx.strokeStyle="lightgrey";
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();
        ctx.stroke();
        
        for(var i=0;i<60;i++){
            var theta=i*Math.PI/30;
            var pt=createPt(r*Math.cos(theta),r*Math.sin(theta));
            var rad=r/19*19.5;
            var pt2=createPt(rad*Math.cos(theta),rad*Math.sin(theta));
            
            //drawSolidCircle(ctx,pt.x,pt.y,(i%5==0)?3:1,"black");
            if(i%5==0){
                // 画三角形
                ctx.save();
                ctx.translate(pt2.x,pt2.y);
                ctx.rotate(theta+Math.PI/2*3);
                drawSolidRegTri(ctx,0,0,4,"lightgrey");
                ctx.restore();
            }else{
                // 画刻度                
                ctx.strokeStyle="lightgrey";
                ctx.beginPath();
                ctx.moveTo(pt.x,pt.y);
                ctx.lineTo(pt2.x,pt2.y);
                ctx.stroke();
            }
        }

        // 数字底圈
        r=R/20*18.8;
        ctx.fillStyle="rgb(177,211,184)";
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();        
        ctx.fill();

        // 数字
        r=R/20*17;
        var hours=["Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","Ⅰ","Ⅱ"]; 
        for(var i=0;i<12;i++){
            var theta=i*Math.PI/6;
            var pt=createPt(r*Math.cos(theta),r*Math.sin(theta));

            ctx.save();
            ctx.translate(pt.x,pt.y);
            ctx.rotate(theta+Math.PI/2);
            ctx.font="16px Microsoft YaHei UI";
            ctx.textAlign="center";
            ctx.textBaseLine="Middle";
            ctx.fillStyle="rgb(70,95,72)";
            ctx.fillText(hours[i],0,0);
            ctx.restore();
        }

        // 月份底圈
        r=R/20*16.5;
        ctx.fillStyle="rgb(76,97,120)";
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();        
        ctx.fill();

        // 社会主义核心价值观24字
        r=R/20*14.8;
        var hours=["富强","民主","文明","和谐","自由","平等","公正","法治","爱国","敬业","诚信","友善",]; 
        for(var i=0;i<12;i++){
            var theta=i*Math.PI/6-Math.PI/2;
            var pt=createPt(r*Math.cos(theta),r*Math.sin(theta));

            ctx.save();
            ctx.translate(pt.x,pt.y);
            ctx.rotate(theta+Math.PI/2);
            ctx.font="16px 仿宋";
            ctx.textAlign="center";
            ctx.textBaseLine="Middle";
            ctx.fillStyle="lightgrey";
            ctx.fillText(hours[i],0,0);
            ctx.restore();
        }

        // 地支底圈
        r=R/20*14.2;
        ctx.fillStyle="rgb(177,211,184)";
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();        
        ctx.fill();

        // 地支文字
        r=R/20*12.5;
        var hours=["午","未","申","酉","戌","亥","子","丑","寅","卯","辰","巳",]; 
        for(var i=0;i<12;i++){
            var theta=i*Math.PI/6-Math.PI/2;
            var pt=createPt(r*Math.cos(theta),r*Math.sin(theta));

            ctx.save();
            ctx.translate(pt.x,pt.y);
            ctx.rotate(theta+Math.PI/2);
            ctx.font="18px Microsoft YaHei UI";
            ctx.textAlign="center";
            ctx.textBaseLine="Middle";
            ctx.fillStyle="rgb(70,95,72";
            ctx.fillText(hours[i],0,0);
            ctx.restore();
        }

        // 分度辐射
        r=R/20*16.5;
        for(var i=0;i<12;i++){
            var theta=Math.PI*2/12*i+Math.PI/12;
            var pt=createPt(r*Math.cos(theta),r*Math.sin(theta));

            // 画刻度                
            ctx.strokeStyle="grey";
            ctx.beginPath();
            ctx.moveTo(0,0);
            ctx.lineTo(pt.x,pt.y);
            ctx.stroke();
        }

        // 渐变圈
        r=R/20*11.9;
        var gnt2=ctx.createRadialGradient(0,0,0,0,0,r);
        gnt2.addColorStop(0,"rgb(76,97,120)");
        gnt2.addColorStop(0.9,"rgb(76,97,120)");
        gnt2.addColorStop(1,"rgb(47,59,71)");
        ctx.fillStyle=gnt2;
        ctx.beginPath();
        ctx.arc(0,0,r,0,Math.PI*2,false);
        ctx.closePath();        
        ctx.fill();

        // 中间的螺旋
        drawSpiral(ctx,0,0,R/1.8);

        // 得到当前时间
        var now=new Date();
        var s=now.getSeconds();
        var m=now.getMinutes();
        var h=now.getHours()+m/60;

        // 画表针
        drawHourPointer(ctx,h,R);
        drawMinutePointer(ctx,m,R);
        drawSecondPointer(ctx,s,R);

        // 画中心小圆点
        ctx.beginPath();
        ctx.arc(0,0,6,0,Math.PI*2,true);
        ctx.closePath();
        ctx.fillStyle="rgb(177,211,184)";
        ctx.fill();

        ctx.beginPath();
        ctx.arc(0,0,2,0,Math.PI*2,true);
        ctx.closePath();
        ctx.fillStyle="rgb(76,97,120)";
        ctx.fill();

        writeText(ctx,WIDTH/2-30,HEIGHT/2-5,"逆火原创","8px consolas","lightgrey");// 版权
    }
}

// 画中间的螺旋
function drawSpiral(ctx,x,y,radius){
    ctx.save();
    ctx.translate(x,y);

    var r=radius;// 初始半径,多边形顶点到屏幕中心的距离
    var gnt1=ctx.createRadialGradient(0,0,0,0,0,r); // 渐变色
    gnt1.addColorStop(0,"rgb(177,211,184)");
    gnt1.addColorStop(1,"rgb(76,97,120)");        
    
    const DELTA=Math.PI/40;// 每次转动的角度
    const N=5;// 边数
    const ANGLE=(N-2)*Math.PI/2/N;
    const RATIO=Math.sin(ANGLE)/Math.sin(Math.PI-ANGLE-DELTA);// 根据正弦定理计算半径缩小比例    
    const TIMES=30;// 往里画的次数

    ctx.lineWidth=1;        
    ctx.strokeStyle=gnt1;
    ctx.beginPath();
    for(var i=0;i<TIMES;i++){            
        r=r*RATIO;
        for(var j=0;j<=N;j++){
            var theta=-DELTA*i+ANGLE+Math.PI*2/N*j;
            var pt=createPt(r*Math.cos(theta),r*Math.sin(theta));
            ctx.lineTo(pt.x,pt.y);
        }
    }
    ctx.stroke();

    ctx.restore();
}

// 画时针
function drawHourPointer(ctx,h,radius){
    const R=radius;

    ctx.save();
    ctx.rotate(h*Math.PI/6-Math.PI/2);

    ctx.beginPath();
    ctx.moveTo(0,0);
    ctx.lineTo(-R/11,0);
    ctx.lineTo(-R/11,R/55);
    ctx.lineTo(R-100,R/55);
    ctx.lineTo(R-90,0);
    ctx.closePath();
    ctx.fillStyle="rgb(171,172,166)";
    ctx.fill();

    ctx.fillStyle="rgb(171,172,166)";
    ctx.beginPath();
    ctx.arc(0,0,R/25,0,Math.PI,false);
    ctx.closePath();        
    ctx.fill();

    ctx.beginPath();
    ctx.moveTo(0,0);
    ctx.lineTo(-R/11,0);
    ctx.lineTo(-R/11,-R/55);
    ctx.lineTo(R-100,-R/55);
    ctx.lineTo(R-90,0);
    ctx.closePath();
    ctx.fillStyle="rgb(252,252,250)";
    ctx.fill();

    ctx.fillStyle="rgb(252,252,250)";
    ctx.beginPath();
    ctx.arc(0,0,R/25,Math.PI,Math.PI*2,false);
    ctx.closePath();        
    ctx.fill();

    ctx.restore();
}

// 画分针
function drawMinutePointer(ctx,m,radius){
    const R=radius;

    ctx.save();
    ctx.rotate(m*Math.PI/30-Math.PI/2);

    ctx.beginPath();
    ctx.moveTo(0,0);
    ctx.lineTo(-R/10,0);
    ctx.lineTo(-R/10,R/55);
    ctx.lineTo(R-47,R/55);
    ctx.lineTo(R-37,0);
    ctx.closePath();
    ctx.fillStyle="rgb(171,172,166)";
    ctx.fill();

    ctx.fillStyle="rgb(171,172,166)";
    ctx.beginPath();
    ctx.arc(0,0,R/27,0,Math.PI,false);
    ctx.closePath();        
    ctx.fill();

    ctx.beginPath();
    ctx.moveTo(0,0);
    ctx.lineTo(-R/10,0);
    ctx.lineTo(-R/10,-R/55);
    ctx.lineTo(R-47,-R/55);
    ctx.lineTo(R-37,0);
    ctx.closePath();
    ctx.fillStyle="rgb(252,252,250)";
    ctx.fill();

    ctx.fillStyle="rgb(252,252,250)";
    ctx.beginPath();
    ctx.arc(0,0,R/27,Math.PI,Math.PI*2,false);
    ctx.closePath();        
    ctx.fill();

    ctx.restore();
}

// 画秒针
function drawSecondPointer(ctx,s,radius){
    const R=radius;

    ctx.save();
    ctx.rotate(s*Math.PI/30-Math.PI/2);

    ctx.beginPath();
    ctx.moveTo(0,0);
    ctx.lineTo(-R/9,0);
    ctx.lineTo(-R/9,R/110);
    ctx.lineTo(R-40,R/110);
    ctx.lineTo(R-40,R/110*3);
    ctx.lineTo(R-10,0);
    ctx.closePath();
    ctx.fillStyle="rgb(171,172,166)";
    ctx.fill();

    ctx.beginPath();
    ctx.moveTo(0,0);
    ctx.lineTo(-R/9,0);
    ctx.lineTo(-R/9,-R/110);
    ctx.lineTo(R-40,-R/110);
    ctx.lineTo(R-40,-R/110*3);
    ctx.lineTo(R-10,0);
    ctx.closePath();
    ctx.fillStyle="rgb(252,252,250)";
    ctx.fill();


    ctx.restore();
}

/*----------------------------------------------------------
函数:绘制实心三角形
ctx:绘图上下文
x:三角形中心横坐标
y:三角形中心纵坐标
r:三角形中心到顶点的长度
color:填充色
----------------------------------------------------------*/
function drawSolidRegTri(ctx,x,y,r,color){
    ctx.fillStyle=color;
    // 画三角形
    var arr=createRegTriArr(x,y,r);
    ctx.beginPath();
    for(var j=0;j<arr.length;j++){
        ctx.lineTo(arr[j].x,arr[j].y);
    }
    ctx.closePath();
    
    ctx.fill();
}

/*----------------------------------------------------------
函数:创建一个以x,y为中心,r为半径的正三角形数组
ctx:绘图上下文
x:三角形中心横坐标
y:三角形中心纵坐标
r:三角形中心到顶点的长度
arr[0]为右下,arr[1]为左下,arr[2]为正上。
----------------------------------------------------------*/
function createRegTriArr(x,y,r){
    var arr=new Array();

    for(var i=0;i<3;i++){
        var theta=Math.PI*2/3*i+Math.PI/6;
        var pt=createPt(r*Math.cos(theta)+x,r*Math.sin(theta)+y);
        arr.push(pt);
    }

    return arr;
}


/*----------------------------------------------------------
函数:由坐标得到弧度
x:点横坐标
y:点纵坐标
----------------------------------------------------------*/
function getRad(x,y){
    var r=Math.sqrt(x*x+y*y);
    var theta=Math.asin(Math.abs(y)/r);

    if(x>=0 && y>=0){
        return theta;
    }else if(x<0 && y>=0){
        return Math.PI-theta;
    }else if(x<0 && y<0){
        return Math.PI+theta;
    }else if(x>=0 && y<0){
        return -theta;
    }

    return null;
}

/*----------------------------------------------------------
函数:用于绘制实心圆,用途是标记点以辅助作图
ctx:绘图上下文
x:矩形中心横坐标
y:矩形中心纵坐标
r:圆半径
color:填充圆的颜色
----------------------------------------------------------*/
function drawSolidCircle(ctx,x,y,r,color){
    ctx.fillStyle=color;
    ctx.beginPath();
    ctx.arc(x,y,r,0,Math.PI*2,false);
    ctx.closePath();
    ctx.fill();
}

/*----------------------------------------------------------
函数:创建一个二维坐标点
x:横坐标
y:纵坐标
Pt即Point
----------------------------------------------------------*/
function createPt(x,y){
    var retval={};
    retval.x=x;
    retval.y=y;
    return retval;
}

/*----------------------------------------------------------
函数:延时若干毫秒
milliseconds:毫秒数
----------------------------------------------------------*/
function sleep(milliSeconds) {
    const date = Date.now();
    let currDate = null;
    while (currDate - date < milliSeconds) {
        currDate = Date.now();
    } 
}

/*----------------------------------------------------------
函数:书写文字
ctx:绘图上下文
x:横坐标
y:纵坐标
text:文字
font:字体
color:颜色
----------------------------------------------------------*/
function writeText(ctx,x,y,text,font,color){
    ctx.save();
    ctx.textBaseline="bottom";
    ctx.textAlign="center";
    ctx.font = font;
    ctx.fillStyle=color;
    ctx.fillText(text,x,y);
    ctx.restore();
}

/*-------------------------------------------------------------
有些人,活了一辈子,
其实不过是认真过了一天,其余时间都在重复这一天而已,
也有人每天不重样,看似折腾,却活出了滋味。
--------------------------------------------------------------*/
//-->
</script>

【底图】

387.jpg

END

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

热门宠物空气净化器测评,希喂、小米空气净化器真实测试对比

随着宠物在家庭中占据越来越重要的地位&#xff0c;如何保持家中空气的清新成为了许多铲屎官关注的重点。市面上的宠物空气净化器琳琅满目&#xff0c;其中希喂和小米两款产品备受关注。今天我们就从外观设计、功能性、滤芯效果、噪音控制和性价比五个方面&#xff0c;来为大家…

2024 9月最新PyCharm下载安装教程(详细步骤)附激活码!

PyCharm安装教程 一、软件简介 PyCharm是一款Python IDE&#xff0c;其带有一整套可以帮助用户在使用Python语言开发时提高其效率的工具&#xff0c;比如&#xff0c; 调试、语法高亮、Project管理、代码跳转、智能提示、自动完成、单元测试、版本控制等等。此外&#xff0c;…

设计模式-行为型模式-迭代器模式

1.迭代器模式的定义 迭代器模式提供一种对容器对象中的各个元素进行访问的方法&#xff0c;而不需要暴露该对象的内部细节&#xff1b; 在软件系统中&#xff0c;容器对象有两个职责&#xff1a;一是存储数据&#xff0c;二是遍历数据&#xff1b;从依赖性上看&#xff0c;前者…

C语言代码练习(第十六天)

今日练习&#xff1a; 40、编写程序&#xff0c;用 getchar 函数读入两个字符给c1和c2&#xff0c;然后分别用 putchar 函数和 printf 函数输出这两个字符。 41、输入4个整数&#xff0c;要求按由小到大的顺序输出。 42、有4个圆塔&#xff0c;圆心分别为&#xff08;2.2)、(-2…

笔记 13 : 彭老师课本第 8 章, UART ,概念,帧格式 , 工作原理,模块介绍,查看原理图 与 datasheet ,GPIO 组态 ,寄存器介绍

&#xff08;94&#xff09; 开始学习通信。通信谢意要考虑时钟同步&#xff0c;是否双工通信&#xff0c;并行或串行通信等等&#xff1a; 低速协议用 uart &#xff0c; iic &#xff0c; spi &#xff0c; 高速协议用 pci 。can 总线支持远距离传输&#xff0c;如门禁&a…

Cursor 使用 One API 配置 Anthropic Claude BaseURL 代理指南

背景 Cursor IDE 原生只支持配置 ChatGPT 的 API Base URL,无法直接使用 Anthropic Claude 的 API。 本指南将介绍如何通过One API来解决这个问题,实现在Cursor中使用Claude API。 前置条件 部署One API https://github.com/songquanpeng/one-api 获取Anthropic Claude A…

做运营,发布时间很重要

声明&#xff1a;此篇为 ai123.cn 原创文章&#xff0c;转载请标明出处链接&#xff1a;https://ai123.cn/#1 作为社交网络与媒体行业的内容运营&#xff0c;我常常被以下问题困扰&#xff1a;用户活跃时间难以预测、内容策划时间紧张、跨平台管理复杂、数据分析繁琐、创意枯竭…

力扣 797. 所有可能路径【DFS】

1. 题目 2. 代码 DFS &#xff0c; 直接见代码 class Solution { public:vector<int> path;vector<vector<int>> res; // 结果集void dfs(vector<vector<int>>& graph, int cur, int n){// 找出所有从节点 0 到节点 n-1 的路径// 下标从 …

深入解析 Dubbo 的 attachments 机制及其应用场景

背景 在分布式系统中&#xff0c;服务之间的调用&#xff08;RPC调用&#xff09;是非常常见的。而在这种服务调用过程中&#xff0c;常常需要在不同服务之间传递一些上下文信息&#xff0c;比如用户身份信息、请求追踪ID、客户端IP等。Dubbo 提供的 attachments 机制&#xf…

SysML图例-洗衣机

DDD领域驱动设计批评文集>> 《软件方法》强化自测题集>> 《软件方法》各章合集>> 对于许多学习SysML和MBSE的同学来说&#xff0c;比较头痛的问题之一是&#xff1a; 各种各样的教程里给出的案例&#xff0c;图都是画好了的&#xff01;如何从零开始用建模…

LTspice模拟CCM和DCM模式的BUCK电路实验及参数计算

关于BUCK电路的原理可以参考硬件工程师炼成之路写的《 手撕Buck&#xff01;Buck公式推导过程》.实验内容是将12V~5V的Buck电路仿真,要求纹波电压小于15mv. CCM和DCM的区别: CCM:在一个开关周期内&#xff0c;电感电流从不会到0. DCM:在开关周期内&#xff0c;电感电流总会到0.…

缓存类型以及读写策略

缓存&#xff08;Cache&#xff09;是一种高效的数据存储技术&#xff0c;旨在提高数据访问速度。 它将频繁访问或最近使用的数据临时存储在更快速但较小的存储介质&#xff08;如内存&#xff09;中&#xff0c;以减少从较慢的存储设备&#xff08;如硬盘或远程服务器&#x…

聊一聊大型网站稳定性建设思路

目录 架构阶段的稳定性建设项目 编码阶段的稳定性建设 测试阶段的稳定性建设 发布阶段的稳定性建设 运行阶段的稳定性建设项目 故障发生时的稳定性建设 网站稳定性的建设是一项综合的系统工程&#xff0c;就像人的健康一样&#xff0c;如果平时不注意健康饮食、不注意锻炼…

浙大数据结构:02-线性结构4 Pop Sequence

这道题我们采用数组来模拟堆栈和队列。 简单说一下大致思路&#xff0c;我们用栈来存1234.....&#xff0c;队列来存输入的一组数据&#xff0c;栈与队列进行匹配&#xff0c;相同就pop 机翻 1、条件准备 stk是栈&#xff0c;que是队列。 tt指向的是栈中下标&#xff0c;fr…

C++入门(05-2)从命令行执行C++编译器_GCC

文章目录 GCC编译器1. 下载MinGW-w64&#xff0c;安装&#xff08;不推荐&#xff09;2. 使用MSYS2安装MinGW-w64&#xff08;推荐&#xff09;2.1 安装MSYS22.2 初始化和更新2.3 安装MinGW-w64编译器2.3 在MSYS2 Shell中导航到代码目录2.4 使用 g 编译2.5 运行可执行文件 GCC编…

【Qt】qt发布Release版本,打包.exe可执行文件

前言&#xff1a;Qt编译的可执行程序&#xff0c;如果直接运行&#xff0c;会出现0xc000007b报错&#xff0c;或者“由于占不到Qt5Network.dll,无法继续执行代码。重新安装程序可能会解决此问题”的报错&#xff0c;因为缺少相关的依赖包和动态库。 1、第一步&#xff1a;找到…

仕考网:大三能考公务员吗?

本科生在大三阶段不具备报考资格&#xff0c;因为尚未完成学业并不是应届生。专科生在大三时则属于应届生&#xff0c;有资格参加公务员考试。 公务员报考条件包括&#xff1a; 1.国籍; 2.年龄于18至35周岁之间&#xff0c;对于当年毕业的硕士或博士研究生&#xff0c;年龄限…

Python: #!/usr/bin/python3 #!/usr/bin/env python3

只能放在第一行&#xff0c;第二行就没有效果了。 1. 路径不同 #!/usr/bin/python3&& #!/usr/bin/env python3写在脚本语言第一行的目的是 想要以什么可执行程序去运行这个文件中的代码。 #!/usr/bin/python3是告诉操作系统执行这个脚本的时候&#xff0c;调用/usr/bin…

Linux之ebpf(3)uprobe与ebpf

Linux之ebpf(3)uprobe简要使用 Author: Once Day Date: 2024年9月5日 一位热衷于Linux学习和开发的菜鸟&#xff0c;试图谱写一场冒险之旅&#xff0c;也许终点只是一场白日梦… 漫漫长路&#xff0c;有人对你微笑过嘛… 全系列文章可参考专栏: Linux基础知识_Once-Day的博客…

心脑血管科张景龙医生:冠状动脉狭窄的症状与检查方法

冠状动脉狭窄作为一种常见的心血管疾病&#xff0c;其症状的出现往往与心肌供血不足密切相关。了解这些症状以及如何进行准确的检查&#xff0c;对于及早发现、诊断和治疗冠状动脉狭窄至关重要。本文将详细介绍冠状动脉狭窄的常见症状及检查方法。 冠状动脉狭窄的常见症状 1、…