主頁 > 作業系統 >  <asideclass="s-notices-notice__infojs-post-noticemb16js-bounty-notification"role="

<asideclass="s-notices-notice__infojs-post-noticemb16js-bounty-notification"role="

2021-10-18 10:56:12 作業系統

這個在此輸入圖片描述

如果有人能提供見解,我將非常感激。我的代碼在下面,這里也有一個Plunker。https://plnkr.co/edit/HlMLKgARm0hgzLPN?open=lib/script.js。 (us.json檔案太大,無法在此粘貼,但在plunker中。)

<! DOCTYPEhtml>

<head> 
  <meta charset="utf-8"/span>>
  <script src="https://d3js. org/d3.v4.min.js"></script>
  <script src="/d3js. org/topojson.v1.min.js"></script> 
  <script src="https://unpkg.com/[email protected]/dist/geo-albers-usa-territories.js"/span>> </script>>

  <style>
    body {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 12px;
      color: #696969。
    }

    #play-button {
      position: absolute;
      bottom: 130px;
      left: 50px;
      background: #333;
      padding-right: 26px;
      border-radius: 3px;
      border: none;
      color: white;
      margin: 0;
      padding: 0 12px;
      width: 60px;
      cursor: 指標。
      height: 30px;
    }

    #play-button:hover {
      background-color: #696969;
    }

    .ticks {
      font-size: 10px;
    }

    .track,
    .track-inset,
    .track-overlay {
      描邊:圓形。
    }

    .track {
      行程。#000;
      stroke-opacity: 0.3;
      stroke-width: 10px;
    }

    .track-inset {
      描邊。#dcdcdc;
      stroke-width: 8px;
    }

    .track-overlay {
      pointer-events: stroke;
      stroke-width: 50px;
      描邊:透明。
      cursor: crosshair;
    }

    .handle {
      填充。#fff;
      描邊。#000;
      stroke-opacity: 0.5;
      stroke-width: 1.25px;
    }

    #zoom-buttons {
      position: absolute;
      margin-left: 10px;
      margin-top: 10px;
      padding: 5px;
      background: #fff;
    }

    #zoom-buttons button {
      background: #efefef;
      color: #231F20;
      border: 0;
      padding: 0;
      border-radius: 2px;
      width: 25px;
      height: 25px;
    }
  </style>>
</head> 

<body> 
  <div id="zoom-buttons"> 
    <button id="放大">  </button>
    <button id="zoom-out"/span>> -</button>/span>
  </div>
  <div id="vis"> 
    <button id="play-button"/span>> 播放</按鈕>
  </div>/span>
  <script>

    var formatDateIntoYear = d3.timeFormat("%Y") 。
    var formatDate = d3.timeFormat("%b%Y")。
    var parseDate = d3.timeParse("%m/%d/%y") 。

    var startDate = new Date("2004-11-01") 。
      endDate = new Date"2017-04-01")。

    var margin = { top: 50, right: 50, bottom: 0, left: 50 },
      寬度 = 960 - margin.left - margin.right。
      height = 750 - margin.top - margin.bottom;

    var svg = d3.select("#vis"/span>)
      .append("svg")
      .attr("width", width   margin.left   margin.right)
      .attr("height", height   margin.top   margin.bottom) 。

    var projection = geoAlbersUsaTerritories.geoAlbersUsaTerritories()
      .scale(width   100)
      .translate([width / 2, height / 2.2]) 。

    var path = d3.geoPath()
      .projection(projection)。

    const zoom = d3.zoom()
      .scaleExtent([1, 10] )
      .on('zoom', zoomed)。

    svg.call(zoom)
    ////////// slider //////////var moving = false;
    var currentValue = 0;
    var targetValue = width;

    var playButton = d3.select("#play-button");

    var x = d3.scaleTime()
      .domain([startDate, endDate])
      .range([0, targetValue] )
      .clamptrue)。

    var slider = svg.append("g"/span>)
      .attr("class"/span>, "slider")
      .attr("transform", "translate("   margin. left   ","   height   ")")。)

    slider.append("line")
      .attr("class", "track")
      .attr("x1", x.range()[0]
      .attr("x2", x.range()[1] )
      .select(function () { return this. parentNode.appendChildthis. cloneNode(true)); })
      .attr("class", "traffic-inset")
      .select(function () { return this. parentNode.appendChildthis. cloneNode(true)); })
      .attr("class", "traffic-overlay")
      .call(d3.drag()
        .on("start.interrupt", function () { slider.interrupt() ; })
        .on("start drag", function) {
          currentValue = d3.event.xupdate(x.invert(currentValue))。
        })
      );

    slider.insert("g"/span>, ".track-overlay")
      .attr("class", "ticks")
      .attr("transform", "translate(0,"   18   ") )
      .selectAll("text")
      .data(x.ticks(10)
      .enter()
      .append("text")
      .attr("x"/span>, x)
      .attr("y"/span>, 10)
      .attr("text-anchor", "mid")
      .text(function (d) { return formatDateIntoYear(d); }) 。

    var handle = slider.insert("circle", ".track-overlay")
      .attr("class"/span>, "handle")
      .attr("r", 9) 。

    var label = slider.append("text")
      .attr("class"/span>, "label")
      .attr("text-anchor", "middle")
      .text(formatDate(startDate)
      .attr("transform", "translate(0,"   (-25)   ") )


    ////////// map //////////)

    var dataset。

    var layer1 = svg.append("g"/span>)
      .attr("transform", "translate("   margin. left   ","   margin.top   ")")。)

    d3.json("us.json", function (error, us) {
      if (error) throw error;

      layer1.selectAll("path"/span>)
        .data(topojson.feature(us, us. objects.states).features)
        .enter().append("path"/span>)
        .attr("d"/span>, path)
        .attr("class"/span>, "feature")
        .attr("stroke", "#ccc")
        .attr("fill"/span>, "#fff")

      layer1.append("path")
        .datum(topojson.mesh(us, us.objects. states, function (a, b) { return a !== b; })
        .attr("class", "mesh")
        .attr("d", path)
        .attr('fill'/span>, 'none')

    });

    var plot = svg.append("g"/span>)
      .attr("class", " plot")
      .attr("transform", "translate("   margin. left   ","   margin.top   ")")。)

    let zoomScale = 1; // initial zoom level.

    d3.csv("circles.csv", prepare, function (data) {
      dataset = data;
      drawPlot(資料集)。

      播放按鈕
        .on("click", function() {
          var button = d3.selectthis)。
          if (button.text() == "Pause"/span>) {
            Moving = false;
            clearInterval(timer);
            button.text("Play") 。
          } else {
            Moving = true;
            timer = setInterval(step, 100)。
            button.text("Pause") 。
          }
          console.log("Slider moving: "   moving);
        })
    })

    function prepared) {
      d.id = d.id。
      d.date = parseDate(d.date)。
      return d;
    }

    function step) {
      update(x.invert(currentValue))。
      currentValue = currentValue   (targetValue / 151)。
      if (currentValue > targetValue) {
        Moving = false;
        currentValue = 0;
        clearInterval(timer);
        // timer = 0;.
        playButton.text("Play"/span>)。
        console.log("Slider moving: "   moving)。
      }
    }

    function drawPlotdata) {

      console.log('scale', zoomScale)

      //>根據縮放比例更新投影。
      projection = geoAlbersUsaTerritories.geoAlbersUsaTerritories()
        .scale((width   100) * zoomScale) // This works.
        .translate([width / 2, height / 2.2]) //這需要什么?

      var locations = plot.selectAll(" .location")
        .data(資料)。

      locations.enter()
        .append("circle"/span>)
        .attr("class"/span>, "location")
        .attr('cx', d => projection([d. lat, d.lng])[0]
        .attr('cy', d => projection([d. lat, d.lng])[1]
        .style("fill"/span>, '#333')
        .style("stroke"'#111')
        .style("opacity", 0.5)
        .attr("r"/span>, 3)
        .transition()
        .duration(400)
        .attr("r"/span>, 8)

      locations.exit()
        .remove()。
    }

    function updateh) {
      handle.attr("cx", x(h))。)
      標簽
        .attr("x", x(h))
        .text(formatDate(h))。

      var newData = dataset.filter(span class="hljs-params">d => d.date < h)
      drawPlot(newData)。
    }

    function zoomed) {

      zoomScale = d3.event.transform.k。

      d3.zoomIdentity。
        .scale(zoomScale)

      層1
        .selectAll('path') //要防止筆觸寬度縮放。
        .attr('transform', d3.event.transform) 。

      繪圖
        .selectAll('circle')
        .attr('transform', d3.event.transform) 。

      繪圖
        .selectAll(' .city')
        .attr('transform', d3.event.transform) 。

    }

    d3.select('#zoom-in'/span>)。 on('click', function () {
      console.log('zooming in')
      zoom.scaleBy(svg.transition)。 duration(750), 1.3)。)
    });

    d3.select('#zoom-out'/span>)。 on('click', function () {
      zoom.scaleBy(svg.transition)。 duration(750), 1 / 1.3)。)
    });

  </script>>
</body> 

circles.csv:

id,date,lng,lat
1,11/24/0438。 285973,-122.365474
2,03/22/0538. 285973,-122.365474
3,06/02/05, 37. 792949,-122.459974
4,06/14/05, 37. 909155,-122.6518833333
5,07/01/05, 33. 631724,-117.950935
6,08/31/0533. 631724,-117.950935
7,09/01/0534. 039715,-118.888678
8,10/01/05, 37. 9217562781,-121.9406676292
9,11/14/05, 34. 039466,-118.579902
10,12/09/05, 37. 703584,-122.432026
11,02/14/0638. 38033,-123.08087
12,04/06/06, 34. 045192,-118.940949
13,05/26/06, 34. 045192,-118.940949
14,06/14/06, 37. 824757,-122.201442
15,07/07/0637. 816214,-122.210626
16,08/03/0637. 815468,-122.193975
17,09/14/0637. 822113,-122.195606
18,10/25/06, 37. 814383,-122.184705
19,11/20/0637. 822113,-122.195606
20,12/21/06, 37. 814383,-122.184705
21,01/23/0737. 31874272,-122.18163484
22,01/30/0737. 5738,-122.471
23,02/25/07, 37. 5738,-122.471
24,03/16/07,39. 044386,-122.534122
25,04/13/0739. 044386,-122.534122
26,05/24/0734. 038791,-118.874559
27,06/16/0737. 31874272,-122.18163484
28,07/23/07, 37. 27148803,-122.15488797
29,08/13/07, 37. 32495478,-122.17827938
30,09/06/0737. 31874272,-122.18163484
31,10/19/0734. 125873,-118.707833
32,11/12/07, 37. 593929,-122.515068
33,12/11/07, 37. 593929,-122.515068
34,01/01/08, 34. 086431,-118.704786
35,02/06/08, 37. 005294,-121.683883
36,03/01/08, 37. 005294,-121.683883
37,04/01/08, 34. 038826,-118.875761
38,06/17/08, 37. 324748,-122.402458
39,07/03/08, 37. 324748,-122.402458
40,09/18/0838. 1186745227,-122.9507392645
41,10/08,37. 91733,-122.335
42,11/19/08, 37. 8963,-122.355
43,12/18/08, 37. 4872,-121.929
44,01/20/09,34. 040533,-118.891725
45,02/13/0937. 30647158,-122.17003327
46,03/20/0937. 30647158,-122.17003327
47,04/10/0937. 741558075,-122.4431838989
48,07/20/0937. 7649307251,-122.4374237061
49,08/10/09, 37. 502882,-122.478332
50,09/15/09, 37. 502882,-122.478332
51,10/19/0937. 9058615694,-122.6426225665
52,11/06/0937. 9058615694,-122.6426225665
53,12/17/09, 37. 4061431885,-122.2400054932
54,02/16/10, 39. 21226,-123.173217
55,03/14/10,37. 895213,-122.031581
56,04/14/1037. 4225234985,-122.1740188599
57,05/05/10, 38. 601578,-121.138257
58,06/19/10,37. 063256,-121.208691
59,07/01/10, 37. 67334,-122.408981
60,08/24/1037. 67334,-122.408981
61,09/01/10, 37. 754429,-122.136554
62,10/19/10, 37. 754429,-122.136554
63,11/06/10, 38. 5835812168,-122.699008584
64,12/27/10, 37. 548524,-122.505283
65,01/18/11, 37. 548524,-122.505283
66,02/22/1137. 919418335,-122.494720459
67,03/11/1137. 27148803,-122.15488797
68,04/26/1137. 27148803,-122.15488797
69,05/16/11,38. 927165,-122.986536
70,07/14/11, 38. 771485,-121.042486
71,09/19/11,38. 719269,-120.991916
72,11/16/1137. 27148803,-122.15488797
73,03/28/12, 37. 27148803,-122.15488797
74,04/19/12, 38. 593377,-121.462526
75,05/04/12, 37. 27148803,-122.15488797
76,07/19/1237. 27148803,-122.15488797
77,08/10/12, 38. 589829,-121.455835
78,09/16/12, 34. 099758,-118.711652
79,10/21/1237. 6951599121,-122.4476928711
80,11/15/12, 37. 8140938,-122.1833
81,12/03/12, 37. 19563508,-121.94371251
82,01/15/13,37. 909155,-122.6518833333
83,03/24/13,37. 19563508,-121.94371251
84,04/17/13, 37. 727423,-122.481812
85,05/13/13, 37. 8577162003,-122.5106131314
86,06/07/1338. 5785140991,-122.6990890503
87,07/03/13, 37. 281701,-120.862655
88,08/23/13, 38. 200491,-122.962797
89,09/22/13, 37. 6238162908,-122.1350258589
90,10/23/13, 32. 550129,-117.102812
91,11/14/13, 32. 548826,-117.101935
92,12/06/13, 32. 547429,-117.10247
93,02/04/14, 38. 6128130576,-122.7812719345
94,04/15/14, 38. 5835711527,-122.6989656687
95,07/03/14, 37. 4002395942,-122.2135899068
96,08/05/14, 38. 6361160278,-122.858757019
97,09/19/14, 36.5, -119
98,10/28/14,36.5, -11999,11/05/14,35。 272334,-120.650649
100,12/19/14, 37. 8826501667,-122.5498195
101,02/06/1537. 8826501667,-122.5498195
102,03/01/15, 33. 570829,-117.551149
103,04/10/15, 37. 053838,-122.13295
104,05/18/15, 37. 900347,-122.024344
105,06/29/15,38. 726416,-123.041826
106,08/20/1539. 3925,-123.648889
107,09/19/15, 33. 171683,-117.109108
108,10/22/16, 37. 9372660312,-122.1399235725
109,12/13/16, 39. 155156,-121.564922
110,02/16/17,32. 825965,-117.053016
111,03/24/17, 37. 215688703,-122.0270562172

uj5u.com熱心網友回復:

在我用頭撞墻的時候,終于想通了這個問題。

在這里作業的Plunker。 https://plnkr.co/edit/LnISm6YJp1A5HFPT?open=lib/script.js

我需要做的不是創建一個新的投影,而是在創建圓圈時對其進行轉換,以考慮到基于任何平移的當前x、y位置,以及基于任何縮放的轉換比例。

下面是代碼和一些評論,如果這對任何人有幫助的話:

<! DOCTYPEhtml>

<head> 
    <meta charset="utf-8"/span>>
    <script src="https://d3js. org/d3.v4.min.js"></script>
    <script src="/d3js. org/topojson.v1.min.js"></script> 
    <script src="https://unpkg.com/[email protected]/dist/geo-albers-usa-territories.js"/span>> </script>>

    <style>
        body {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            color: #696969。
        }

        #play-button {
            position: absolute;
            bottom: 130px;
            left: 50px;
            background: #333;
            padding-right: 26px;
            border-radius: 3px;
            border: none;
            color: white;
            margin: 0;
            padding: 0 12px;
            width: 60px;
            cursor: 指標。
            height: 30px;
        }

        #play-button:hover {
            background-color: #696969;
        }

        .ticks {
            font-size: 10px;
        }

        .track,
        .track-inset,
        .track-overlay {
            描邊:圓形。
        }

        .track {
            行程。#000;
            stroke-opacity: 0.3;
            stroke-width: 10px;
        }

        .track-inset {
            描邊。#dcdcdc;
            stroke-width: 8px;
        }

        .track-overlay {
            pointer-events: stroke;
            stroke-width: 50px;
            描邊:透明。
            cursor: crosshair;
        }

        .handle {
            填充。#fff;
            描邊。#000;
            stroke-opacity: 0.5;
            stroke-width: 1.25px;
        }

        #zoom-buttons {
            position: absolute;
            margin-left: 10px;
            margin-top: 10px;
            padding: 5px;
            background: #fff;
        }

        #zoom-buttons button {
            background: #efefef;
            color: #231F20;
            border: 0;
            padding: 0;
            border-radius: 2px;
            width: 25px;
            height: 25px;
        }
    </style>>
</head> 

<body> 
    <div id="zoom-buttons"> 
        <button id="放大">  </button>
        <button id="zoom-out"/span>> -</button>/span>
    </div>
    <div id="vis"> 
        <button id="play-button"/span>> 播放</按鈕>
    </div>/span>
    <script>

        var formatDateIntoYear = d3.timeFormat("%Y") 。
        var formatDate = d3.timeFormat("%b%Y")。
        var parseDate = d3.timeParse("%m/%d/%y") 。

        var startDate = new Date("2004-11-01") 。
            endDate = new Date"2017-04-01")。

        var margin = { top: 50, right: 50, bottom: 0, left: 50 },
            寬度 = 960 - margin.left - margin.right。
            height = 750 - margin.top - margin.bottom;

        var svg = d3.select("#vis"/span>)
            .append("svg")
            .attr("width", width   margin.left   margin.right)
            .attr("height", height   margin.top   margin.bottom) 。

        var projection = geoAlbersUsaTerritories.geoAlbersUsaTerritories()
            .scale(width   100)
            .translate([width / 2, height / 2.2]) 。

        var path = d3.geoPath()
            .projection(projection)。

        const zoom = d3.zoom()
            .scaleExtent([1, 10] )
            .on('zoom', zoomed)。

        svg.call(zoom)
        ////////// slider //////////var moving = false;
        var currentValue = 0;
        var targetValue = width;

        var playButton = d3.select("#play-button");

        var x = d3.scaleTime()
            .domain([startDate, endDate])
            .range([0, targetValue] )
            .clamptrue)。

        var slider = svg.append("g"/span>)
            .attr("class"/span>, "slider")
            .attr("transform", "translate("   margin. left   ","   height   ")")。)

        slider.append("line")
            .attr("class", "track")
            .attr("x1", x.range()[0]
            .attr("x2", x.range()[1] )
            .select(function () { return this. parentNode.appendChildthis. cloneNode(true)); })
            .attr("class", "traffic-inset")
            .select(function () { return this. parentNode.appendChildthis. cloneNode(true)); })
            .attr("class", "traffic-overlay")
            .call(d3.drag()
                .on("start.interrupt", function () { slider.interrupt() ; })
                .on("start drag", function) {
                    currentValue = d3.event.xupdate(x.invert(currentValue))。
                })
            );

        slider.insert("g"/span>, ".track-overlay")
            .attr("class", "ticks")
            .attr("transform", "translate(0,"   18   ") )
            .selectAll("text")
            .data(x.ticks(10)
            .enter()
            .append("text")
            .attr("x"/span>, x)
            .attr("y"/span>, 10)
            .attr("text-anchor", "mid")
            .text(function (d) { return formatDateIntoYear(d); }) 。

        var handle = slider.insert("circle", ".track-overlay")
            .attr("class"/span>, "handle")
            .attr("r", 9) 。

        var label = slider.append("text")
            .attr("class"/span>, "label")
            .attr("text-anchor", "middle")
            .text(formatDate(startDate)
            .attr("transform", "translate(0,"   (-25)   ") )


        ////////// map //////////)

        var dataset。

        var layer1 = svg.append("g"/span>)
            .attr("transform", "translate("   margin. left   ","   margin.top   ")")。)

        d3.json("us.json", function (error, us) {
            if (error) throw error;

            layer1.selectAll("path"/span>)
                .data(topojson.feature(us, us. objects.states).features)
                .enter().append("path"/span>)
                .attr("d"/span>, path)
                .attr("class"/span>, "feature")
                .attr("stroke", "#ccc")
                .attr("fill"/span>, "#fff")

            layer1.append("path")
                .datum(topojson.mesh(us, us.objects. states, function (a, b) { return a !== b; })
                .attr("class", "mesh")
                .attr("d", path)
                .attr('fill'/span>, 'none')

        });

        var plot = svg.append("g"/span>)
            .attr("class", " plot")
            .attr("transform", "translate("   margin. left   ","   margin.top   ")")。)

        //定義初始事件轉換let zoomScale = 1,
            panX = 0,
            panY = 0.

        d3.csv("circles.csv", prepare, function (data) {
            dataset = data;
            drawPlot(資料集)。

            播放按鈕
                .on("click", function() {
                    var button = d3.selectthis)。
                    if (button.text() == "Pause"/span>) {
                        Moving = false;
                        clearInterval(timer);
                        button.text("Play") 。
                    } else {
                        Moving = true;
                        timer = setInterval(step, 100)。
                        button.text("Pause") 。
                    }
                })
        })

        function prepared) {
            d.id = d.id;
            d.date = parseDate(d.date)。
            return d;
        }

        function step) {
            update(x.invert(currentValue))。
            currentValue = currentValue   (targetValue / 151)。
            if (currentValue > targetValue) {
                Moving = false;
                currentValue = 0;
                clearInterval(timer);
                playButton.text"Play")。
            }
        }

        function drawPlotdata) {

            var locations = plot.selectAll(" .location")
                .data(資料)。

            //transform circles based on pan and zoom[/span]。
            locations.enter()
                .append("circle"/span>)
                . attr('transform', "translate("   panX   " 。 "   panY   ") scale("   zoomScale   ") ")
                .attr("class"/span>, "location")
                .attr('cx', d => projection([d. lat, d.lng])[0]
                .attr('cy', d => projection([d. lat, d.lng])[1]
                .style("fill"/span>, '#333')
                .style("stroke"'#111')
                .style("opacity", 0.5)
                .attr("r"/span>, 3)
                .transition()
                .duration(400)
                .attr("r"/span>, 8)

            locations.exit()
                .remove()。
        }

        function updateh) {
            handle.attr("cx", x(h))。)
            標簽
                .attr("x", x(h))
                .text(formatDate(h))。

            var newData = dataset.filter(span class="hljs-params">d => d.date < h)
            drawPlot(newData)。
        }

        function zoomed) {

            //更新全域轉換屬性,以便新的圓圈知道該去哪里,該有多大。
            zoomScale = d3.event.transform.k,
                panX = d3.event.transform.x,
                panY = d3.event.transform.y.

            d3.zoomIdentity。
                .scale(zoomScale)

            層1
                .selectAll('path') //要防止筆觸寬度縮放。
                .attr('transform', d3.event.transform) 。

            繪圖
                .selectAll('circle')
                .attr('transform', d3.event.transform) 。

            繪圖
                .selectAll(' .city')
                .attr('transform', d3.event.transform) 。

        }

        d3.select('#zoom-in'/span>)。 on('click', function () {
            zoom.scaleBy(svg.transition)。 duration(750), 1.3)。)
        });

        d3.select('#zoom-out'/span>)。 on('click', function () {
            zoom.scaleBy(svg.transition)。 duration(750), 1 / 1.3)。)
        });

    </script>>
</body> 

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/320651.html

標籤:

上一篇:滑鼠移到節點上時給節點文本加下劃線

下一篇:當超鏈接行為是由例如HTML按鈕的"點擊"事件處理虛擬創建的,如何防止打開一個新的標簽或視窗?

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • CA和證書

    1、在 CentOS7 中使用 gpg 創建 RSA 非對稱密鑰對 gpg --gen-key #Centos上生成公鑰/密鑰對(存放在家目錄.gnupg/) 2、將 CentOS7 匯出的公鑰,拷貝到 CentOS8 中,在 CentOS8 中使用 CentOS7 的公鑰加密一個檔案 gpg -a ......

    uj5u.com 2020-09-10 00:09:53 more
  • Kubernetes K8S之資源控制器Job和CronJob詳解

    Kubernetes的資源控制器Job和CronJob詳解與示例 ......

    uj5u.com 2020-09-10 00:10:45 more
  • VMware下安裝CentOS

    VMware下安裝CentOS 一、軟硬體準備 1 Centos鏡像準備 1.1 CentOS鏡像下載地址 下載地址 1.2 CentOS鏡像下載程序 點擊下載地址進入如下圖的網站,選擇需要下載的版本,這里選擇的是Centos8,點擊如圖所示。 決定選擇Centos8后,選擇想要的鏡像源進行下載,此 ......

    uj5u.com 2020-09-10 00:12:10 more
  • 如何使用Grep命令查找多個字串

    如何使用Grep 命令查找多個字串 大家好,我是良許! 今天向大家介紹一個非常有用的技巧,那就是使用 grep 命令查找多個字串。 簡單介紹一下,grep 命令可以理解為是一個功能強大的命令列工具,可以用它在一個或多個輸入檔案中搜索與正則運算式相匹配的文本,然后再將每個匹配的文本用標準輸出的格式 ......

    uj5u.com 2020-09-10 00:12:28 more
  • git配置http代理

    git配置http代理 經常遇到克隆 github 慢的問題,這里記錄一下幾種配置 git 代理的方法,解決 clone github 過慢。 目錄 git配置代理 git單獨配置github代理 git配置全域代理 配置終端環境變數 git配置代理 主要使用 git config 命令 git單獨 ......

    uj5u.com 2020-09-10 00:12:33 more
  • Linux npm install 裝包時提示Error EACCES permission denied解

    npm install 裝包時提示Error EACCES permission denied解決辦法 ......

    uj5u.com 2020-09-10 00:12:53 more
  • Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包

    Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟體包。 18 (flaskApi) [root@67 flaskDemo]# yum -y install nginx 19 已加載插件:fastestmirror, langpacks 20 Loading ......

    uj5u.com 2020-09-10 00:13:13 more
  • Linux查看服務器暴力破解ssh IP

    在公網的服務器上經常遇到別人爆破你服務器的22埠,用來挖礦或者干其他嘿嘿嘿的事情~ 這種情況下正確的做法是: 修改默認ssh的22埠 使用設定密鑰登錄或者白名單ip登錄 建議服務器密碼為復雜密碼 創建普通用戶登錄服務器(root權限過大) 建立堡壘機,實作統一管理服務器 統計爆破IP [root ......

    uj5u.com 2020-09-10 00:13:17 more
  • CentOS 7系統常見快捷鍵操作方式

    Linux系統中一些常見的快捷方式,可有效提高操作效率,在某些時刻也能避免操作失誤帶來的問題。 ......

    uj5u.com 2020-09-10 00:13:31 more
  • CentOS 7作業系統目錄結構介紹

    作業系統存在著大量的資料檔案資訊,相應檔案資訊會存在于系統相應目錄中,為了更好的管理資料資訊,會將系統進行一些目錄規劃,不同目錄存放不同的資源。 ......

    uj5u.com 2020-09-10 00:13:35 more
最新发布
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:43:21 more
  • vim的常用命令

    Vim的6種基本模式 1. 普通模式在普通模式中,用的編輯器命令,比如移動游標,洗掉文本等等。這也是Vim啟動后的默認模式。這正好和許多新用戶期待的操作方式相反(大多數編輯器默認模式為插入模式)。 2. 插入模式在這個模式中,大多數按鍵都會向文本緩沖中插入文本。大多數新用戶希望文本編輯器編輯程序中一 ......

    uj5u.com 2023-04-20 08:42:36 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:26:53 more
  • 設定Windows主機的瀏覽器為wls2的默認瀏覽器

    這里以Chrome為例。 1. 準備作業 wsl是可以使用Windows主機上安裝的exe程式,出于安全考慮,默認情況下改功能是無法使用。要使用的話,終端需要以管理員權限啟動。 我這里以Windows Terminal為例,介紹如何默認使用管理員權限打開終端,具體操作如下圖所示: 2. 操作 wsl ......

    uj5u.com 2023-04-19 09:25:49 more
  • docker學習

    ###Docker概述 真實專案部署環境可能非常復雜,傳統發布專案一個只需要一個jar包,運行環境需要單獨部署。而通過Docker可將jar包和相關環境(如jdk,redis,Hadoop...)等打包到docker鏡像里,將鏡像發布到Docker倉庫,部署時下載發布的鏡像,直接運行發布的鏡像即可。 ......

    uj5u.com 2023-04-19 09:19:04 more
  • Linux學習筆記

    IP地址和主機名 IP地址 ifconfig可以用來查詢本機的IP地址,如果不能使用,可以通過install net-tools安裝。 Centos系統下ens33表示主網卡;inet后表示IP地址;lo表示本地回環網卡; 127.0.0.1表示代指本機;0.0.0.0可以用于代指本機,同時在放行設 ......

    uj5u.com 2023-04-18 06:52:01 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:50 more
  • 解決linux系統的kdump服務無法啟動的問題

    問題:專案麒麟系統服務器的kdump服務無法啟動,沒有相關日志無法定位問題。 1、查看服務狀態是關閉的,重啟系統也無法啟動 systemctl status kdump 2、修改grub引數,修改“crashkernel”為“512M(有的機器數值太大太小都會導致報錯,建議從128M開始試,或者加個 ......

    uj5u.com 2023-04-12 09:59:01 more
  • 你是不是暴露了?

    作者:袁首京 原創文章,轉載時請保留此宣告,并給出原文連接。 如果您是計算機相關從業人員,那么應該經歷不止一次網路安全專項檢查了,你肯定是收到過資訊系統技術檢測報告,要求你加強風險監測,確保你提供的系統服務堅實可靠了。 沒檢測到問題還好,檢測到問題的話,有些處理起來還是挺麻煩的,尤其是線上正在運行的 ......

    uj5u.com 2023-04-05 16:52:56 more
  • 細節拉滿,80 張圖帶你一步一步推演 slab 記憶體池的設計與實作

    1. 前文回顧 在之前的幾篇記憶體管理系列文章中,筆者帶大家從宏觀角度完整地梳理了一遍 Linux 記憶體分配的整個鏈路,本文的主題依然是記憶體分配,這一次我們會從微觀的角度來探秘一下 Linux 內核中用于零散小記憶體塊分配的記憶體池 —— slab 分配器。 在本小節中,筆者還是按照以往的風格先帶大家簡單 ......

    uj5u.com 2023-04-05 16:44:11 more