大家都在画圣诞树,我们用代码敲一颗吧~圣诞树

news2024/10/7 12:29:37

前段时间发布的文章很多人问怎么操作的,今天具体说明一下:

PS:如果需要下载可以点击左下角阅读全文下载代码使用更方便

具体步骤如下:

  1. 复制下面代码在电脑里面新建一个记事本,将代码复制到新建的记事本里

  2. 保存记事本,将记事本进行重命名,将文件后缀.txt换成.html(或者.TXT换成.HTML)

  3. 注意:有些人电脑打开重命名的时候看不到后缀名需要按照如下操作进行修改

步骤1:在电脑桌面上打开你要显示文件后缀名的文件夹;

f7f64c8c1c167a729a9a9b2ba9b1c76c.png

步骤2:在打开的窗口,页面上方有【查看】,点击它;

305c030eb6c8755bd4dff1643fd99d62.png

步骤3:你可以在展开的列表里看到【文件扩展名】,这时只需要勾选这个选项,就可以显示文件的扩展名称了。

389674d06b1581652fdcfab5d94c03c8.png

方法二:更改系统显示文件后缀名

除了第一种方法,文件后缀名隐藏了,怎么打开文件扩展名?你可以试试在电脑系统里更改。

操作环境如下:

演示机型:华 硕X8AE43In-SL

系统版本:Windows 10

操作步骤如下:

步骤1:打开电脑桌面的【此电脑】,找到【查看】选项里面的【选项】,并点击;

aca32155dfff3b0719fe712291d13648.png

步骤2:再点击【查看】,并下拉找到【显示隐藏的文件、文件夹和驱动器】,勾选这个选项。点击【确定】后,就可以查看文件的扩展名称了。

a2afe1ec0fb3a96cbf5b869cd076899c.png

然后进行第二步操作即可

代码如下:

<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
 
    <title>圣诞树</title>
 
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
 
    <style>
        * {
            box-sizing: border-box;
        }
 
 
        body {
            margin: 0;
            height: 100vh;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #161616;
            color: #c5a880;
            font-family: sans-serif;
        }
 
 
        label {
            display: inline-block;
            background-color: #161616;
            padding: 16px;
            border-radius: 0.3rem;
            cursor: pointer;
            margin-top: 1rem;
            width: 300px;
            border-radius: 10px;
            border: 1px solid #c5a880;
            text-align: center;
        }
 
 
        ul {
            list-style-type: none;
            padding: 0;
            margin: 0;
        }
 
 
        .btn {
            background-color: #161616;
            border-radius: 10px;
            color: #c5a880;
            border: 1px solid #c5a880;
            padding: 16px;
            width: 300px;
            margin-bottom: 16px;
            line-height: 1.5;
            cursor: pointer;
        }
 
        .separator {
            font-weight: bold;
            text-align: center;
            width: 300px;
            margin: 16px 0px;
            color: #a07676;
        }
 
 
        .title {
            color: #a07676;
            font-weight: bold;
            font-size: 1.25rem;
            margin-bottom: 16px;
        }
 
 
        .text-loading {
            font-size: 2rem;
        }
</style>
 
    <script>
        window.console = window.console || function (t) { };
</script>
 
 
 
    <script>
        if (document.location.search.match(/type=embed/gi)) {
            window.parent.postMessage("resize", "*");
        }
</script>
 
 
</head>
 
<body translate="no">
    <script src="https://cdn.jsdelivr.net/npm/three@0.115.0/build/three.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/postprocessing/EffectComposer.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/postprocessing/RenderPass.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/postprocessing/ShaderPass.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/shaders/CopyShader.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/shaders/LuminosityHighPassShader.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/postprocessing/UnrealBloomPass.js"></script>
 
    <div id="overlay">
        <ul>
            <li class="title">请选择音乐(作为播放背景音乐)</li>
            <li>
                <button class="btn" id="btnA" type="button">
                    Snowflakes Falling Down by Simon Panrucker
                </button>
            </li>
            <li><button class="btn" id="btnB" type="button">This Christmas by Dott</button></li>
            <li><button class="btn" id="btnC" type="button">No room at the inn by TRG Banks</button></li>
            <li><button class="btn" id="btnD" type="button">Jingle Bell Swing by Mark Smeby</button></li>
            <li class="separator">或者</li>
            <li>
                <input type="file" id="upload" hidden />
                <label for="upload">Upload File</label>
            </li>
        </ul>
    </div>
 
    <script id="rendered-js">
        const { PI, sin, cos } = Math;
        const TAU = 2 * PI;
 
        const map = (value, sMin, sMax, dMin, dMax) => {
            return dMin + (value - sMin) / (sMax - sMin) * (dMax - dMin);
        };
 
        const range = (n, m = 0) =>
            Array(n).
                fill(m).
                map((i, j) => i + j);
 
        const rand = (max, min = 0) => min + Math.random() * (max - min);
        const randInt = (max, min = 0) => Math.floor(min + Math.random() * (max - min));
        const randChoise = arr => arr[randInt(arr.length)];
        const polar = (ang, r = 1) => [r * cos(ang), r * sin(ang)];
 
        let scene, camera, renderer, analyser;
        let step = 0;
        const uniforms = {
            time: { type: "f", value: 0.0 },
            step: { type: "f", value: 0.0 }
        };
 
        const params = {
            exposure: 1,
            bloomStrength: 0.9,
            bloomThreshold: 0,
            bloomRadius: 0.5
        };
 
        let composer;
 
        const fftSize = 2048;
        const totalPoints = 4000;
 
        const listener = new THREE.AudioListener();
 
        const audio = new THREE.Audio(listener);
 
        document.querySelector("input").addEventListener("change", uploadAudio, false);
 
        const buttons = document.querySelectorAll(".btn");
        buttons.forEach((button, index) =>
            button.addEventListener("click", () => loadAudio(index)));
 
 
        function init() {
            const overlay = document.getElementById("overlay");
            overlay.remove();
 
            scene = new THREE.Scene();
            renderer = new THREE.WebGLRenderer({ antialias: true });
            renderer.setPixelRatio(window.devicePixelRatio);
            renderer.setSize(window.innerWidth, window.innerHeight);
            document.body.appendChild(renderer.domElement);
 
            camera = new THREE.PerspectiveCamera(
                60,
                window.innerWidth / window.innerHeight,
                1,
                1000);
 
            camera.position.set(-0.09397456774197047, -2.5597086635726947, 24.420789670889008);
            camera.rotation.set(0.10443543723052419, -0.003827152981119352, 0.0004011488708739715);
 
            const format = renderer.capabilities.isWebGL2 ?
                THREE.RedFormat :
                THREE.LuminanceFormat;
 
            uniforms.tAudioData = {
                value: new THREE.DataTexture(analyser.data, fftSize / 2, 1, format)
            };
 
 
            addPlane(scene, uniforms, 3000);
            addSnow(scene, uniforms);
 
            range(10).map(i => {
                addTree(scene, uniforms, totalPoints, [20, 0, -20 * i]);
                addTree(scene, uniforms, totalPoints, [-20, 0, -20 * i]);
            });
 
            const renderScene = new THREE.RenderPass(scene, camera);
 
            const bloomPass = new THREE.UnrealBloomPass(
                new THREE.Vector2(window.innerWidth, window.innerHeight),
                1.5,
                0.4,
                0.85);
 
            bloomPass.threshold = params.bloomThreshold;
            bloomPass.strength = params.bloomStrength;
            bloomPass.radius = params.bloomRadius;
 
            composer = new THREE.EffectComposer(renderer);
            composer.addPass(renderScene);
            composer.addPass(bloomPass);
 
            addListners(camera, renderer, composer);
            animate();
        }
 
        function animate(time) {
            analyser.getFrequencyData();
            uniforms.tAudioData.value.needsUpdate = true;
            step = (step + 1) % 1000;
            uniforms.time.value = time;
            uniforms.step.value = step;
            composer.render();
            requestAnimationFrame(animate);
        }
 
        function loadAudio(i) {
            document.getElementById("overlay").innerHTML =
                '<div class="text-loading">正在下载音乐,请稍等...</div>';
            const files = [
                "https://files.freemusicarchive.org/storage-freemusicarchive-org/music/no_curator/Simon_Panrucker/Happy_Christmas_You_Guys/Simon_Panrucker_-_01_-_Snowflakes_Falling_Down.mp3",
                "https://files.freemusicarchive.org/storage-freemusicarchive-org/music/no_curator/Dott/This_Christmas/Dott_-_01_-_This_Christmas.mp3",
                "https://files.freemusicarchive.org/storage-freemusicarchive-org/music/ccCommunity/TRG_Banks/TRG_Banks_Christmas_Album/TRG_Banks_-_12_-_No_room_at_the_inn.mp3",
                "https://files.freemusicarchive.org/storage-freemusicarchive-org/music/ccCommunity/Mark_Smeby/En_attendant_Nol/Mark_Smeby_-_07_-_Jingle_Bell_Swing.mp3"];
 
            const file = files[i];
 
            const loader = new THREE.AudioLoader();
            loader.load(file, function (buffer) {
                audio.setBuffer(buffer);
                audio.play();
                analyser = new THREE.AudioAnalyser(audio, fftSize);
                init();
            });
 
 
 
 
        }
 
 
        function uploadAudio(event) {
            document.getElementById("overlay").innerHTML =
                '<div class="text-loading">请稍等...</div>';
            const files = event.target.files;
            const reader = new FileReader();
 
            reader.onload = function (file) {
                var arrayBuffer = file.target.result;
 
                listener.context.decodeAudioData(arrayBuffer, function (audioBuffer) {
                    audio.setBuffer(audioBuffer);
                    audio.play();
                    analyser = new THREE.AudioAnalyser(audio, fftSize);
                    init();
                });
            };
 
            reader.readAsArrayBuffer(files[0]);
        }
 
        function addTree(scene, uniforms, totalPoints, treePosition) {
            const vertexShader = `
      attribute float mIndex;
      varying vec3 vColor;
      varying float opacity;
      uniform sampler2D tAudioData;
      float norm(float value, float min, float max ){
       return (value - min) / (max - min);
      }
      float lerp(float norm, float min, float max){
       return (max - min) * norm + min;
      }
      float map(float value, float sourceMin, float sourceMax, float destMin, float destMax){
       return lerp(norm(value, sourceMin, sourceMax), destMin, destMax);
      }
      void main() {
       vColor = color;
       vec3 p = position;
       vec4 mvPosition = modelViewMatrix * vec4( p, 1.0 );
       float amplitude = texture2D( tAudioData, vec2( mIndex, 0.1 ) ).r;
       float amplitudeClamped = clamp(amplitude-0.4,0.0, 0.6 );
       float sizeMapped = map(amplitudeClamped, 0.0, 0.6, 1.0, 20.0);
       opacity = map(mvPosition.z , -200.0, 15.0, 0.0, 1.0);
       gl_PointSize = sizeMapped * ( 100.0 / -mvPosition.z );
       gl_Position = projectionMatrix * mvPosition;
      }
      `;
            const fragmentShader = `
      varying vec3 vColor;
      varying float opacity;
      uniform sampler2D pointTexture;
      void main() {
       gl_FragColor = vec4( vColor, opacity );
       gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord ); 
      }
      `;
            const shaderMaterial = new THREE.ShaderMaterial({
                uniforms: {
                    ...uniforms,
                    pointTexture: {
                        value: new THREE.TextureLoader().load(`https://assets.codepen.io/3685267/spark1.png`)
                    }
                },
 
 
                vertexShader,
                fragmentShader,
                blending: THREE.AdditiveBlending,
                depthTest: false,
                transparent: true,
                vertexColors: true
            });
 
 
            const geometry = new THREE.BufferGeometry();
            const positions = [];
            const colors = [];
            const sizes = [];
            const phases = [];
            const mIndexs = [];
 
            const color = new THREE.Color();
 
            for (let i = 0; i < totalPoints; i++) {
                const t = Math.random();
                const y = map(t, 0, 1, -8, 10);
                const ang = map(t, 0, 1, 0, 6 * TAU) + TAU / 2 * (i % 2);
                const [z, x] = polar(ang, map(t, 0, 1, 5, 0));
 
                const modifier = map(t, 0, 1, 1, 0);
                positions.push(x + rand(-0.3 * modifier, 0.3 * modifier));
                positions.push(y + rand(-0.3 * modifier, 0.3 * modifier));
                positions.push(z + rand(-0.3 * modifier, 0.3 * modifier));
 
                color.setHSL(map(i, 0, totalPoints, 1.0, 0.0), 1.0, 0.5);
 
                colors.push(color.r, color.g, color.b);
                phases.push(rand(1000));
                sizes.push(1);
                const mIndex = map(i, 0, totalPoints, 1.0, 0.0);
                mIndexs.push(mIndex);
            }
 
            geometry.setAttribute(
                "position",
                new THREE.Float32BufferAttribute(positions, 3).setUsage(
                    THREE.DynamicDrawUsage));
 
 
            geometry.setAttribute("color", new THREE.Float32BufferAttribute(colors, 3));
            geometry.setAttribute("size", new THREE.Float32BufferAttribute(sizes, 1));
            geometry.setAttribute("phase", new THREE.Float32BufferAttribute(phases, 1));
            geometry.setAttribute("mIndex", new THREE.Float32BufferAttribute(mIndexs, 1));
 
            const tree = new THREE.Points(geometry, shaderMaterial);
 
            const [px, py, pz] = treePosition;
 
            tree.position.x = px;
            tree.position.y = py;
            tree.position.z = pz;
 
            scene.add(tree);
        }
 
        function addSnow(scene, uniforms) {
            const vertexShader = `
      attribute float size;
      attribute float phase;
      attribute float phaseSecondary;
      varying vec3 vColor;
      varying float opacity;
      uniform float time;
      uniform float step;
      float norm(float value, float min, float max ){
       return (value - min) / (max - min);
      }
      float lerp(float norm, float min, float max){
       return (max - min) * norm + min;
      }
      float map(float value, float sourceMin, float sourceMax, float destMin, float destMax){
       return lerp(norm(value, sourceMin, sourceMax), destMin, destMax);
      }
      void main() {
       float t = time* 0.0006;
       vColor = color;
       vec3 p = position;
       p.y = map(mod(phase+step, 1000.0), 0.0, 1000.0, 25.0, -8.0);
       p.x += sin(t+phase);
       p.z += sin(t+phaseSecondary);
       opacity = map(p.z, -150.0, 15.0, 0.0, 1.0);
       vec4 mvPosition = modelViewMatrix * vec4( p, 1.0 );
       gl_PointSize = size * ( 100.0 / -mvPosition.z );
       gl_Position = projectionMatrix * mvPosition;
      }
      `;
 
            const fragmentShader = `
      uniform sampler2D pointTexture;
      varying vec3 vColor;
      varying float opacity;
      void main() {
       gl_FragColor = vec4( vColor, opacity );
       gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord ); 
      }
      `;
            function createSnowSet(sprite) {
                const totalPoints = 300;
                const shaderMaterial = new THREE.ShaderMaterial({
                    uniforms: {
                        ...uniforms,
                        pointTexture: {
                            value: new THREE.TextureLoader().load(sprite)
                        }
                    },
 
 
                    vertexShader,
                    fragmentShader,
                    blending: THREE.AdditiveBlending,
                    depthTest: false,
                    transparent: true,
                    vertexColors: true
                });
 
 
                const geometry = new THREE.BufferGeometry();
                const positions = [];
                const colors = [];
                const sizes = [];
                const phases = [];
                const phaseSecondaries = [];
 
                const color = new THREE.Color();
 
                for (let i = 0; i < totalPoints; i++) {
                    const [x, y, z] = [rand(25, -25), 0, rand(15, -150)];
                    positions.push(x);
                    positions.push(y);
                    positions.push(z);
 
                    color.set(randChoise(["#f1d4d4", "#f1f6f9", "#eeeeee", "#f1f1e8"]));
 
                    colors.push(color.r, color.g, color.b);
                    phases.push(rand(1000));
                    phaseSecondaries.push(rand(1000));
                    sizes.push(rand(4, 2));
                }
 
                geometry.setAttribute(
                    "position",
                    new THREE.Float32BufferAttribute(positions, 3));
 
                geometry.setAttribute("color", new THREE.Float32BufferAttribute(colors, 3));
                geometry.setAttribute("size", new THREE.Float32BufferAttribute(sizes, 1));
                geometry.setAttribute("phase", new THREE.Float32BufferAttribute(phases, 1));
                geometry.setAttribute(
                    "phaseSecondary",
                    new THREE.Float32BufferAttribute(phaseSecondaries, 1));
 
 
                const mesh = new THREE.Points(geometry, shaderMaterial);
 
                scene.add(mesh);
            }
            const sprites = [
                "https://assets.codepen.io/3685267/snowflake1.png",
                "https://assets.codepen.io/3685267/snowflake2.png",
                "https://assets.codepen.io/3685267/snowflake3.png",
                "https://assets.codepen.io/3685267/snowflake4.png",
                "https://assets.codepen.io/3685267/snowflake5.png"];
 
            sprites.forEach(sprite => {
                createSnowSet(sprite);
            });
        }
 
        function addPlane(scene, uniforms, totalPoints) {
            const vertexShader = `
      attribute float size;
      attribute vec3 customColor;
      varying vec3 vColor;
      void main() {
       vColor = customColor;
       vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
       gl_PointSize = size * ( 300.0 / -mvPosition.z );
       gl_Position = projectionMatrix * mvPosition;
      }
      `;
            const fragmentShader = `
      uniform vec3 color;
      uniform sampler2D pointTexture;
      varying vec3 vColor;
      void main() {
       gl_FragColor = vec4( vColor, 1.0 );
       gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord );
      }
      `;
            const shaderMaterial = new THREE.ShaderMaterial({
                uniforms: {
                    ...uniforms,
                    pointTexture: {
                        value: new THREE.TextureLoader().load(`https://assets.codepen.io/3685267/spark1.png`)
                    }
                },
 
 
                vertexShader,
                fragmentShader,
                blending: THREE.AdditiveBlending,
                depthTest: false,
                transparent: true,
                vertexColors: true
            });
 
 
            const geometry = new THREE.BufferGeometry();
            const positions = [];
            const colors = [];
            const sizes = [];
 
            const color = new THREE.Color();
 
            for (let i = 0; i < totalPoints; i++) {
                const [x, y, z] = [rand(-25, 25), 0, rand(-150, 15)];
                positions.push(x);
                positions.push(y);
                positions.push(z);
 
                color.set(randChoise(["#93abd3", "#f2f4c0", "#9ddfd3"]));
 
                colors.push(color.r, color.g, color.b);
                sizes.push(1);
            }
 
            geometry.setAttribute(
                "position",
                new THREE.Float32BufferAttribute(positions, 3).setUsage(
                    THREE.DynamicDrawUsage));
 
 
            geometry.setAttribute(
                "customColor",
                new THREE.Float32BufferAttribute(colors, 3));
 
            geometry.setAttribute("size", new THREE.Float32BufferAttribute(sizes, 1));
 
            const plane = new THREE.Points(geometry, shaderMaterial);
 
            plane.position.y = -8;
            scene.add(plane);
        }
 
        function addListners(camera, renderer, composer) {
            document.addEventListener("keydown", e => {
                const { x, y, z } = camera.position;
                console.log(`camera.position.set(${x},${y},${z})`);
                const { x: a, y: b, z: c } = camera.rotation;
                console.log(`camera.rotation.set(${a},${b},${c})`);
            });
 
            window.addEventListener(
                "resize",
                () => {
                    const width = window.innerWidth;
                    const height = window.innerHeight;
 
                    camera.aspect = width / height;
                    camera.updateProjectionMatrix();
 
                    renderer.setSize(width, height);
                    composer.setSize(width, height);
                },
                false);
 
        }
</script>
 
</body>
 
</html>

链接: https://yueliu.link/1c2RcU

密码: j2uk

有效期: 永久有效

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

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

相关文章

虚拟机网络连通性选择

做运维的朋友对于虚拟机这个概念应该不会陌生&#xff0c;这里不做讲解。今天主要想对虚拟机的网络连通性的选择方法做一个简单的介绍&#xff0c;如果是老人就没必要看了&#xff0c;此文章针对刚入门初次使用虚拟机进行测试、工作的小伙伴。 咱们常见的虚拟机平台软件有很多&…

【实时数仓】用户行为日志采集模块单机模式部署,Nginx介绍、安装和配置,采集模块集群部署并使用Nginx进行反向代理

文章目录一 日志采集模块1 打包单机部署&#xff08;1&#xff09;修改gmall2022-logger中的logback.xml配置文件&#xff08;2&#xff09;修改SpringBoot核心配置文件application.propeties&#xff08;3&#xff09;测试&#xff08;4&#xff09;程序运行流程2 Nginx&#…

Grafana 的介绍和安装

版本&#xff1a;9.3.1 介绍 Grafana是一款能够提供查询、告警和可视化指标、日志、链路跟踪的软件&#xff0c;并且提供了TSDB时序数据库用于存储数据。 一共有3个版本&#xff0c;Grafana OSS&#xff08;开源版&#xff09;&#xff0c;Grafana Enterprise&#xff08;企业…

【C++】红黑树

一.红黑树的概念与性质 1.概念 红黑树是二叉搜索数的一种, 相比于AVL树(二叉平衡搜索树)红黑树通过减少旋转的次数来进一步优化了查找效率, 在每个节点上增加一个存储位表示节点的颜色, Red or Black, 通过对任何一条从根到叶子的路径上各个节点着色方式的限制, 红黑树确保没…

亚马逊云科技re:Invent:创新永无止境,科技重塑未来

作为全球IT行业一年一度的科技盛宴&#xff0c;2022亚马逊云科技re:Invent全球大会吸引了来自世界各国的开发者与企业客户的高度关注&#xff0c;其中自然也包括了广大中国企业。作为全球云计算领域的风向标&#xff0c;本届大会究竟揭示了怎样的行业趋势&#xff1f;发布了哪些…

【超聚变】FusionServer1288H V6安装CentOS系统

【超聚变】FusionServer1288H V6安装CentOS系统1、创建Raid2、安装系统2.1.使用IBMC地址&#xff0c;登录web界面2.2.选择启动虚拟控制台2.3.挂载镜像2.4.选择启动盘2.5.安装系统2.6.选择英文安装2.7.时区选择上海&#xff08;Asia/Shanghai&#xff09;2.8.选择最小化安装&…

【Vue源码解析】mustache模板引擎

模板引擎什么是模板引擎实现 Scanner 类根据模板字符串生成 tokens在 index.js 引入 parseTemplateToTokens实现 tokens 的嵌套One More Thingtokens 结合数据解析为 dom 字符串定义 lookup 函数定义 renderTemplate 函数什么是模板引擎 模板引擎是将数据变为视图最优雅的解决…

如何清除chrome浏览器缓存

清除浏览器的缓存知识调用前言引入具体操作知识调用 文章中可能用到的知识点前端学习&#xff1a;浏览器缓存方式有哪些&#xff08;http协议 websql indexDB cookie localstorage sessionstorage&#xff09;如何查看Chrome浏览器的页面缓存内容【详细教程】 前言引入 上期文…

微服务框架 SpringCloud微服务架构 微服务保护 31 限流规则 31.1 簇点链路

微服务框架 【SpringCloudRabbitMQDockerRedis搜索分布式&#xff0c;系统详解springcloud微服务技术栈课程|黑马程序员Java微服务】 微服务保护 文章目录微服务框架微服务保护31 限流规则31.1 簇点链路31.1.1 簇点链路31.1.2 快速入门31 限流规则 31.1 簇点链路 31.1.1 簇…

52、网络

目录 一、网络通信 二、网络 三、 ip地址 四、域名 五、端口号 六、网络通信协议 1、协议&#xff08;tcp/ip&#xff09; 2、TCP和UDP 七、InetAddress类 八、Socket 1、基本介绍&#xff1a; 2、TCP网络通信编程 3、UDP网络通信编程&#xff08;了解即可&#xff0c…

完整版JAVA物业管理系统源码带小程序+文字安装教程+视频

这套系统还包含了小程序前端源码。 技术架构 技术框架&#xff1a;springboot ssm shiro layui 运行环境&#xff1a;IntelliJ IDEA 2022 jdk1.8 Mysql5.7.4 maven nginx 宝塔面板 文字安装教程 1.下载源码后打开小皮面板&#xff0c;安装mysql5.7数据库&#xff0c;创…

【JavaEE】计算机是怎样工作的,五分钟带你理解计算机!!!

作者&#xff1a;学Java的冬瓜 博客主页&#xff1a;☀学瓜的主页&#x1f319; 专栏&#xff1a;JavaEE 分享&#xff1a;一、让你知道我的存在&#xff1b;二、让你存在下去&#xff0c;对我来说都是危险的&#xff0c;都违反第一条公理。 ——《三体》 主要内容&#xff1a;…

C++11标准模板(STL)- 算法(std::push_heap)

定义于头文件 <algorithm> 算法库提供大量用途的函数&#xff08;例如查找、排序、计数、操作&#xff09;&#xff0c;它们在元素范围上操作。注意范围定义为 [first, last) &#xff0c;其中 last 指代要查询或修改的最后元素的后一个元素。 数据结构的堆物理结构是数…

Linux离线安装RabbitMQ

使用docker离线安装rabbitmq 1.在外网环境下载rabbitmq:management镜像 命令&#xff1a;docker pull rabbitmq:management 启动容器&#xff08;即验证镜像是否有用&#xff09;&#xff1a; 命令&#xff1a;docker run -d --hostname wxrabbit --name rabbitmq -p 15672:15…

【深度学习】学习率预热和学习率衰减 (learning rate warmup decay)

背景 在深度学习中学习率这个超参数&#xff0c;在选取和调整都是有一定策略的&#xff0c;俗称炼丹。有时我们遇到 loss 变成 NaN 的情况大多数是由于学习率选择不当引起的。 神经网络在刚开始训练的时候模型的权重(weights)是随机初始化的&#xff0c;选择一个较大的学习率…

干货 | 浅谈携程大住宿研发效能提升实践

作者简介Mia &#xff0c;携程高级项目经理&#xff0c;负责酒店Devops实践&#xff0c;关注Devops/敏捷等领域。YY&#xff0c;携程敏捷教练&#xff0c;负责团队敏捷转型&#xff0c;研发效能提升实践&#xff0c;关注Agile、Devops、研发效能等领域。一、前言管理大师彼得德…

[ChatGPT为你支招]如何提高博客的质量,找到写作方向,保持动力,增加粉丝数?

0. 引言 作为一个博主&#xff0c;您可能会面临很多挑战&#xff0c;比如如何提高博客的质量&#xff0c;如何找到自己的写作方向&#xff0c;如何保持持续写作的动力&#xff0c;以及如何增加博客的粉丝数量。在这篇文章中&#xff0c;我们将为您提供一些有用的建议&#xff…

Maven打包报错:找不到符号,类BASE64Encoder,程序包sun.misc

背景 一个基于若依单体架构的多模块 Maven 项目的国产化迁移适配&#xff0c;由于是客户的代码&#xff0c;我们不用关心具体的功能实现&#xff0c;直接来做迁移即可。实施时&#xff0c;按照我们总结的整改建议调整源码&#xff0c;具体迁移适配过程可参考本专栏的其他文章。…

ADI Blackfin DSP处理器-BF533的开发详解19:LAN的网口设计

硬件准备 ADSP-EDU-BF533&#xff1a;BF533开发板 AD-HP530ICE&#xff1a;ADI DSP仿真器 软件准备 Visual DSP软件 硬件链接 功能介绍 BF533说实话用来做LAN的应用有些许勉强&#xff0c;因为他自己不带网口&#xff0c;要做的话&#xff0c;需要在总线上挂&#xff0c;那…

彻底搞懂ESLint与Prettier在vscode中的代码自动格式化

前言 前端代码格式化社区提供了两种比较常用的工具ESLint和Prettier&#xff0c;他们分别提供了对应的vscode的插件&#xff0c;二者在代码格式化方面有重叠的部分&#xff0c;规则不一致时会导致冲突。vscode作为前端开发编辑器已经越来越普遍了&#xff0c;这需要开发者在vs…