问:
go-swagger: `swagger generate server` "import cycles not allowed"
First: I have read through and attempted to apply what I found in related posts, but nothing seems to be working. Related posts would be:

Error "import cycle not allowed" in go-swagger auto generated code

The spec in its most simple form is:

```<code>swagger: '2.0'
info:
  version: '0.0.1'
  title: Planting Service
  description: Planting Service is the reference for all planting activities.
  contact: {}
host: www.example.com
basePath: /
securityDefinitions: {}
schemes:
- https
consumes:
- application/json
produces:
- application/json
paths:
  /v1/validations/product-years/{product-year}:
    get:
      description: '**DEPRECATED - Please use GET /v3/validations**'
      summary: (Deprecated) Get planting-specific validations for a given product year
      tags:
      - v1
      operationId: (Deprecated)Getplanting-specificvalidationsforagivenproductyear
      deprecated: true
      produces:
      - application/json
      parameters:
      - name: product-year
        in: path
        required: true
        type: integer
        format: int64
        description: ''
      responses:
        '304':
          description: Not Modified
          headers: {}
        '400':
          description: Bad Request
          headers: {}
        '500':
          description: Server Error
          headers: {}
</code>```

If you put the spec in a file called swagger.yml in a directory ${GOPATH}/src/planting and then run:

```<code>$ cd ${GOPATH}/src/planting
$ go mod init planting
$ swagger generate server -A planting -f swagger.yml
$ go mod tidy
$ cd ./cmd/planting-server && go build
</code>```

This will result in the following error:

```<code>package planting/cmd/planting-server
    imports planting/restapi
    imports planting/restapi/operations
    imports planting/restapi/operations/v1
    imports planting/restapi/operations/v1: import cycle not allowed
</code>```

Why is go-swagger generating code with cycles in it? My environment is:

```<code>System Version: macOS 12.6 (21G115)
Kernel Version: Darwin 21.6.0
go version go1.19.3 darwin/amd64
⚡ swagger version
version: v0.30.3
commit: ecf6f05b6ecc1b1725c8569534f133fa27e9de6b
</code>```

Running:

```<code>golangci-lint run --fix ./...
</code>```

Unfortunately, does not fix the issue but does show better diagnostic output on where the issues are. All the fixes to cycles entailed removing unused import added by the code generator. Unfortunately, in the real code there are 121 endpoints and each has 3 files that need to be touched up so manually modifying the files is not sustainable. Any suggestions on automated tooling to cleanup after the swagger generate server command?

In my Makefile I have added the following target.

```<code>  swagger-touchup:
    # We run find -- goimports twice because of cycles.
    find . -name "*.go" -exec goimports -w {} \; && \
      find . -name "*.go" -exec goimports -w {} \; && \
      find . -name "*.go" -exec gofmt -w {} \; && \
      find . -name "*.go" -exec gofmt -w {} \;
  .PHONY: swagger-touchup
</code>```

This seems remove most of the cycles which are just unused. Seems like to me those responsible for go-swagger are blindly just adding imports. Unfortunately, server.go and main.go still have unused imports. It would be nice if go-swagger validated their own code and fixed it before the program exited.

Body:
First: I have read through and attempted to apply what I found in related posts, but nothing seems to be working. Related posts would be:

Error "import cycle not allowed" in go-swagger auto generated code

The spec in its most simple form is:

swagger: '2.0'
info:
  version: '0.0.1'
  title: Planting Service
  description: Planting Service is the reference for all planting activities.
  contact: {}
host: www.example.com
basePath: /
securityDefinitions: {}
schemes:
- https
consumes:
- application/json
produces:
- application/json
paths:
  /v1/validations/product-years/{product-year}:
    get:
      description: '**DEPRECATED - Please use GET /v3/validations**'
      summary: (Deprecated) Get planting-specific validations for a given product year
      tags:
      - v1
      operationId: (Deprecated)Getplanting-specificvalidationsforagivenproductyear
      deprecated: true
      produces:
      - application/json
      parameters:
      - name: product-year
        in: path
        required: true
        type: integer
        format: int64
        description: ''
      responses:
        '304':
          description: Not Modified
          headers: {}
        '400':
          description: Bad Request
          headers: {}
        '500':
          description: Server Error
          headers: {}

If you put the spec in a file called swagger.yml in a directory ${GOPATH}/src/planting and then run:

$ cd ${GOPATH}/src/planting
$ go mod init planting
$ swagger generate server -A planting -f swagger.yml
$ go mod tidy
$ cd ./cmd/planting-server && go build

This will result in the following error:

package planting/cmd/planting-server
    imports planting/restapi
    imports planting/restapi/operations
    imports planting/restapi/operations/v1
    imports planting/restapi/operations/v1: import cycle not allowed

Why is go-swagger generating code with cycles in it? My environment is:

System Version: macOS 12.6 (21G115)
Kernel Version: Darwin 21.6.0
go version go1.19.3 darwin/amd64
⚡ swagger version
version: v0.30.3
commit: ecf6f05b6ecc1b1725c8569534f133fa27e9de6b

Running:

golangci-lint run --fix ./...

Unfortunately, does not fix the issue but does show better diagnostic output on where the issues are. All the fixes to cycles entailed removing unused import added by the code generator. Unfortunately, in the real code there are 121 endpoints and each has 3 files that need to be touched up so manually modifying the files is not sustainable. Any suggestions on automated tooling to cleanup after the swagger generate server command?

In my Makefile I have added the following target.

  swagger-touchup:
    # We run find -- goimports twice because of cycles.
    find . -name "*.go" -exec goimports -w {} \; && \
      find . -name "*.go" -exec goimports -w {} \; && \
      find . -name "*.go" -exec gofmt -w {} \; && \
      find . -name "*.go" -exec gofmt -w {} \;
  .PHONY: swagger-touchup

This seems remove most of the cycles which are just unused. Seems like to me those responsible for go-swagger are blindly just adding imports. Unfortunately, server.go and main.go still have unused imports. It would be nice if go-swagger validated their own code and fixed it before the program exited.


来源: stackexchange

问:
IE as browser-control, equivalent on Mac?
On Windows it's possilble to use IE as a browser-control in .NET. So you can use a webpage as UI and write the code in C#, VB or C++ accessing the DOM. Is this possible on a Mac too? Of course it would be Webkit(Safari) and Objective-C. Or even better: Can you use JavaScript to access the platform (like WinRT in Windows 8)?</p>

ContentLicense: CC BY-SA 3.0


问:
Embedded music player does not initially load images and music into main site
I've recreated a music player which I love, love, love, but when I embed it as an html page in the main site the images and music do not initially load. To load you have to click the next or back track button which is not what I want but I can't figure what to do. Any help would be great as I am still a novice and thanks in advance.

This is part of the player js

```<code>//gen-plr_12-06-22.js
const wrapper = document.querySelector(".wrapper"),
musicImg = wrapper.querySelector(".img-area img"),
musicName = wrapper.querySelector(".song-details .name"),
musicAlbum = wrapper.querySelector(".song-details .album"),
musicArtist = wrapper.querySelector(".song-details .artist"),
mainAudio = wrapper.querySelector("#main-audio"),
playPauseBtn = wrapper.querySelector(".play-pause"),
prevBtn = wrapper.querySelector("#prev"),
nextBtn = wrapper.querySelector("#next"),
progressArea = wrapper.querySelector(".progress-area"),
progressBar = wrapper.querySelector(".progress-bar"),
musicList = wrapper.querySelector(".music-list"),
showMoreBtn = wrapper.querySelector("#more-music"),
hideMusicBtn = musicList.querySelector("#close");

let musicIndex = Math.floor((Math.random() * allMusic.length) + 1);

window.addEventListener("load", ()=>{
  loadMusic(musicIndex); //calling load music function once window loaded
  playingNow()
});

//load music function******this is where it looses the info in page on full site
function loadMusic(indexNumb){
  musicName.innerText = allMusic[indexNumb -1].name;
  musicAlbum.innerText = allMusic[indexNumb -1].album;
  musicArtist.innerText = allMusic[indexNumb - 1].artist;
  musicImg.src = `jj-pix/mus-pix/cvs/${allMusic[indexNumb - 1].img}.png`;
  mainAudio.src = `jj-snd/${allMusic[indexNumb - 1].src}.mp3`;
}

//gen-muslist_12-06-22.js
let allMusic = [
  {
    name: "1. 2tech-audio-event",
    album: "Genalbum",
    artist: "Gen",
    img: "genpx",
    src: "2tech-audio-event"
  },
  {
    name: "2. alex-productions-sexy-sax",
    album: "Gen 1album",
    artist: "Gen 1",
    img: "genpx1",
    src: "alex-productions-sexy-sax"
  },
  {
    name: "3. mixaund-team-spirit",
    album: "Gen 2album",
    artist: "Gen 2",
    img: "genpx2",
    src: "mixaund-team-spirit"
  },
  {
    name: "8. Good Lord Willin and the Creeks Don’t Rise",
    album: "Forever On The Run",
    artist: "Jeff Jirout",
    //album: "Gen 3album",
    //artist: "Gen 3",
    img: "genpx3",
    src: "2tech-audio-event"
  },
  {
    name: "5. mixaund-team-spirit",
    album: "Gen 4album",
    artist: "Gen 4",
    img: "genpx4",
    src: "mixaund-team-spirit"
  },
  {
    name: "5. mixaund-team-spirit",
    album: "Gen album",
    artist: "Gen",
    img: "genpx",
    src: "mixaund-team-spirit"
  }
]
</code>```

this is the main site js

```<code>const hamburger = document.querySelector(".hamburger");
const navMenu = document.querySelector(".nav-menu");

hamburger.addEventListener("click", () => {
  hamburger.classList.toggle("active");
  navMenu.classList.toggle("active");
})

document.querySelectorAll(".nav-link").forEach(n => n.addEventListener("click", () => {
  hamburger.classList.remove("active");
  navMenu.classList.remove("active");
}))

window.addEventListener("scroll", function(){
    var header = document.querySelector("header");
    header.classList.toggle("sticky", window.scrollY > 0, 0);
});

$(document).ready(function () {
    //$( '#home' ).load( "gen-home_11-29-22.html" );
    $( '#music' ).load( "gen-plr_12-06-22.html" );
    $( '#about' ).load( "about_Lorem11-12-20.html" );
    $( '#contact' ).load( "contact_Lorem11-14-22.html" );
});

// The function actually applying the offset
function offsetAnchor() {
  if (location.hash.length !== 0) {
    window.scrollTo(window.scrollX, window.scrollY - 75);
  }
}

// Captures click events of all a elements with href starting with #
$(document).on('click', 'a[href^="#"]', function(event) {
  // Click events are captured before hashchanges. Timeout
  // causes offsetAnchor to be called after the page jump.
  window.setTimeout(function() {
    offsetAnchor();
  }, 0);
});

// Set the offset when entering page with hash present in the url
window.setTimeout(offsetAnchor, 0);
/*$(document.body).scrollTop($('#music').offset().top);*/

/*$(document.body).animate({
    'scrollTop':   $('#music').offset().top
}, 200);*/

//Get the button
var mybutton = document.getElementById("top");

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
    mybutton.style.display = "block";
  } else {
    mybutton.style.display = "none";
  }
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
}
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I've recreated a music player which I love, love, love, but when I embed it as an html page in the main site the images and music do not initially load. To load you have to click the next or back track button which is not what I want but I can't figure what to do. Any help would be great as I am still a novice and thanks in advance.

This is part of the player js

//gen-plr_12-06-22.js
const wrapper = document.querySelector(".wrapper"),
musicImg = wrapper.querySelector(".img-area img"),
musicName = wrapper.querySelector(".song-details .name"),
musicAlbum = wrapper.querySelector(".song-details .album"),
musicArtist = wrapper.querySelector(".song-details .artist"),
mainAudio = wrapper.querySelector("#main-audio"),
playPauseBtn = wrapper.querySelector(".play-pause"),
prevBtn = wrapper.querySelector("#prev"),
nextBtn = wrapper.querySelector("#next"),
progressArea = wrapper.querySelector(".progress-area"),
progressBar = wrapper.querySelector(".progress-bar"),
musicList = wrapper.querySelector(".music-list"),
showMoreBtn = wrapper.querySelector("#more-music"),
hideMusicBtn = musicList.querySelector("#close");

let musicIndex = Math.floor((Math.random() * allMusic.length) + 1);

window.addEventListener("load", ()=>{
  loadMusic(musicIndex); //calling load music function once window loaded
  playingNow()
});

//load music function******this is where it looses the info in page on full site
function loadMusic(indexNumb){
  musicName.innerText = allMusic[indexNumb -1].name;
  musicAlbum.innerText = allMusic[indexNumb -1].album;
  musicArtist.innerText = allMusic[indexNumb - 1].artist;
  musicImg.src = `jj-pix/mus-pix/cvs/${allMusic[indexNumb - 1].img}.png`;
  mainAudio.src = `jj-snd/${allMusic[indexNumb - 1].src}.mp3`;
}

//gen-muslist_12-06-22.js
let allMusic = [
  {
    name: "1. 2tech-audio-event",
    album: "Genalbum",
    artist: "Gen",
    img: "genpx",
    src: "2tech-audio-event"
  },
  {
    name: "2. alex-productions-sexy-sax",
    album: "Gen 1album",
    artist: "Gen 1",
    img: "genpx1",
    src: "alex-productions-sexy-sax"
  },
  {
    name: "3. mixaund-team-spirit",
    album: "Gen 2album",
    artist: "Gen 2",
    img: "genpx2",
    src: "mixaund-team-spirit"
  },
  {
    name: "8. Good Lord Willin and the Creeks Don’t Rise",
    album: "Forever On The Run",
    artist: "Jeff Jirout",
    //album: "Gen 3album",
    //artist: "Gen 3",
    img: "genpx3",
    src: "2tech-audio-event"
  },
  {
    name: "5. mixaund-team-spirit",
    album: "Gen 4album",
    artist: "Gen 4",
    img: "genpx4",
    src: "mixaund-team-spirit"
  },
  {
    name: "5. mixaund-team-spirit",
    album: "Gen album",
    artist: "Gen",
    img: "genpx",
    src: "mixaund-team-spirit"
  }
]

this is the main site js

const hamburger = document.querySelector(".hamburger");
const navMenu = document.querySelector(".nav-menu");

hamburger.addEventListener("click", () => {
  hamburger.classList.toggle("active");
  navMenu.classList.toggle("active");
})

document.querySelectorAll(".nav-link").forEach(n => n.addEventListener("click", () => {
  hamburger.classList.remove("active");
  navMenu.classList.remove("active");
}))

window.addEventListener("scroll", function(){
    var header = document.querySelector("header");
    header.classList.toggle("sticky", window.scrollY > 0, 0);
});

$(document).ready(function () {
    //$( '#home' ).load( "gen-home_11-29-22.html" );
    $( '#music' ).load( "gen-plr_12-06-22.html" );
    $( '#about' ).load( "about_Lorem11-12-20.html" );
    $( '#contact' ).load( "contact_Lorem11-14-22.html" );
});

// The function actually applying the offset
function offsetAnchor() {
  if (location.hash.length !== 0) {
    window.scrollTo(window.scrollX, window.scrollY - 75);
  }
}

// Captures click events of all a elements with href starting with #
$(document).on('click', 'a[href^="#"]', function(event) {
  // Click events are captured before hashchanges. Timeout
  // causes offsetAnchor to be called after the page jump.
  window.setTimeout(function() {
    offsetAnchor();
  }, 0);
});

// Set the offset when entering page with hash present in the url
window.setTimeout(offsetAnchor, 0);
/*$(document.body).scrollTop($('#music').offset().top);*/

/*$(document.body).animate({
    'scrollTop':   $('#music').offset().top
}, 200);*/

//Get the button
var mybutton = document.getElementById("top");

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
  if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
    mybutton.style.display = "block";
  } else {
    mybutton.style.display = "none";
  }
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
  document.body.scrollTop = 0;
  document.documentElement.scrollTop = 0;
}


问:
Build a Node stream.pipeline() dynamically
I have a pipeline like this using Node stream module:

pipeline(
    Readable.from(...),
    new Transform(...),
    (err) => console.log(`The end`));
```
<p>But whether I want to use the transform stream or not is actually depending on a dynamic condition (let us say a variable.)  I can of course use <code>apply()</code> like the following (build an array first, then apply the <code>pipeline</code> function to it):</p>
<pre class="lang-js prettyprint-override"><code>const pipe = [Readable.from(...)];
if ( condition ) {
    pipe.push(new Transform(...));
}
pipe.push((err) => console.log(`The end`));
pipeline.apply(null, pipe);
</code>```

But I feel like there must be another way to achieve that, maybe a tool in the stream module?

Body:
I have a pipeline like this using Node stream module:

pipeline(
    Readable.from(...),
    new Transform(...),
    (err) => console.log(`The end`));

But whether I want to use the transform stream or not is actually depending on a dynamic condition (let us say a variable.)  I can of course use apply() like the following (build an array first, then apply the pipeline function to it):

const pipe = [Readable.from(...)];
if ( condition ) {
    pipe.push(new Transform(...));
}
pipe.push((err) => console.log(`The end`));
pipeline.apply(null, pipe);

But I feel like there must be another way to achieve that, maybe a tool in the stream module?


问:
Is it cheaper to store a Glacier vault or an S3 Glacier bucket?
I can see the s3 glacier buckets have different storage classes with different cost tiers, but vaults don't seem to have this, so are the vaults basically equivalent to s3 Glacier buckets in terms of costs or are they more expensive?

I tried finding out if the storage classes s3 glacier buckets have apply also to vaults, and could not find the answers


问:
Barcode Scanner Import Configuration
So I have a question regarding two scanners I have. The main one here being a Datalogic Gryphon GD4500, I have a configuration file on it that I would like to export into my other scanner being a FUZZYSCAN CINO A780. Problem being the DataLogic one has a configuration file of an extension .xml and the cino is a .conf . Is there any way to convert one to another to be able to import it ? Or would the only way be to go through each single setting and program it that way?
Just looking for an easier way to do it.

I have tried converting the config file with no avail.
Even reading the config file would just cause random characters being displayed by the Notepad, which I presume is encrypted.

Title: Barcode Scanner Import Configuration


问:
handling objects offscreen for a view frustum
I have a view frustum that works great when looking at stuff from a distance. But for example, when i stand in the middle of a square, my current system struggles to place vertices which are behind me.

For example the image below demonstrates looking at a tile from a distance vs standing on top of it ...

My proccess for putting things onto screen can be described in 5 steps

cross product the co-ordinates of the object with my camera matrix

cross product the result of 1 with my projection_matrix

normalize the result of 2 by dividing through the 4th dimension of my co-ordinates (my w co-ordinate)

cull results of 3 (its not causing the problem, i tried without culling)

cross product 4 with to_screen_matrix

Basically the problem i have, is this procces is great at putting things on the screen but sometimes an object isnt on the screen... what co-ordinates should be used then?

Below is a drawing of what i think the problem is

below is my screen_projection function

```<code>return_screen_projection(dont_cull = false){

          var position = cross_product(this.position , player.camera_matrix())

          position = cross_product(position ,  projection.projection_matrix) // does this just convert the position to cameras reference frame.

          for (let i = 0; i < position.length; i++) {
                position[i] = position[i]/position[3]
            }

          if (dont_cull == false){
                for (let i = 0; i < position.length; i++) {
                  if (i != 1){
                            if (this.is_this_object_behind_player()){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling1")}
                            if (position[i] > 2){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling2")}
                            if (position[i] < -2){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling3")}
                              }
                } // also all examples say set position = 0 if culling
            }
            position = cross_product(position , projection.to_screen_matrix)

            return [position[0],position[1]]
        }
</code>```

how could i better handle the position of a vertex offscreen, when some vertexes of the object im dealing with are on screen?

##################  extra info below

below is a blob of 300 lines of code (sorry , i cant make it more minimal and reproducable with just a copy n paste)

running the below in a web browser will give you an example of the problem (w,a,s,d) to move (you start mired in the middle of an object, you may wish to step back to see better the first time)

```<code><head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/11.3.3/math.js"></script>
    <script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
</head>
<body>
    <div id="canvas div" style = "position: relative; left: 0px; float:left;  top: 0px;" >
      <h1> first person below </h1>
      <canvas id="mi_canvas" width="300" height="300" style="border-style: solid;"></canvas> <br>
    </div>

    <script>
      var floor_y_pos =  9
      canvas = document.getElementById("mi_canvas");
      ctx = canvas.getContext("2d");
      render_distance = 1000;
      fov = math.pi / 2
      class Projection{
        constructor(){
            var NEAR = player.near_plane
            var FAR = player.far_plane
            var RIGHT = Math.tan(player.h_fov/2)
            var LEFT = - RIGHT
            var TOP = Math.tan(player.v_fov /2)
            var BOTTOM = -TOP
            var m00 = 2*NEAR / (RIGHT - LEFT)
            var m02 = (RIGHT + LEFT)/(RIGHT - LEFT)
            var m11 = 2*NEAR / (TOP - BOTTOM)
            var m12 = (TOP + BOTTOM) /(TOP - BOTTOM)
            var m22 = (FAR * NEAR) / (FAR - NEAR)
            var m23 = -2 * NEAR * FAR / (FAR-NEAR)
            this.projection_matrix = [
                [-m00,0,m02,0],
                [0,m11,0,0],
                [m02,m12,-m22,-1],
                [0,0,m23,0]
            ]
            var HW=player.H_WIDTH
            var HH = player.H_HEIGHT
            this.to_screen_matrix = [
                [HW,0,0,0],
                [0,HH,0,0],
                [0,0,1,0],
                [HW,HH,0,1]
            ]
            }
    }

    function multiply(a, b) {
      var aNumRows = a.length, aNumCols = a[0].length,
          bNumRows = b.length, bNumCols = b[0].length,
          m = new Array(aNumRows);  // initialize array of rows
      for (var r = 0; r < aNumRows; ++r) {
        m[r] = new Array(bNumCols); // initialize the current row
        for (var c = 0; c < bNumCols; ++c) {
          m[r][c] = 0;             // initialize the current cell
          for (var i = 0; i < aNumCols; ++i) {
            m[r][c] += a[r][i] * b[i][c];
          }
        }
      }
      return m;
    }

      function mi_position_matrix_multiplier(A, B)
      {
        var new_matrix = []
        for (var new_num_ind = 0; new_num_ind < A.length; ++new_num_ind)
        {
          this_num = 0;
          for (var a_ind = 0; a_ind < A.length; ++a_ind)
          {

            this_num += (A[a_ind] * B[a_ind][new_num_ind])
          }
           new_matrix.push(this_num)
        }
        return new_matrix;
      }

      function pythagoras(thing1, thing2)
        {
          dist = (((thing1[0]-thing2[0])**2)+((thing1[1]-thing2[1])**2))**0.5
          return dist
        }

      class vertex{
        constructor(x, y,z , id){
          this.id = id
          this.position = [x,y,z,1]
          this.min_dist = 1.5  // minimum possible distance between player and object
        }

        is_this_object_behind_player(){
          var arrow_length = 0.0001;
          var pointing_position = [player.position[0]+(player.forward[0]*arrow_length) , player.position[2]-(player.forward[2]*arrow_length)]
          var dist1 = pythagoras([this.position[0],this.position[2]], pointing_position)
          var dist2 = pythagoras([this.position[0],this.position[2]], [player.position[0],player.position[2]])
          if (dist1 < dist2){
          return true;}
          else if (dist1 > dist2){
          return false;}
          else{}
        }

        return_screen_projection(dont_cull = false){
          var position = mi_position_matrix_multiplier(this.position , player.camera_matrix())
          position = mi_position_matrix_multiplier(position ,  projection.projection_matrix) // does this just convert the position to cameras reference frame.
          for (let i = 0; i < position.length; i++) {
                position[i] = position[i]/position[3]
            }
            if (dont_cull == false){
                for (let i = 0; i < position.length; i++) {
                  if (i != 1){
                            if (this.is_this_object_behind_player()){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling1")}
                            if (position[i] > 2){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling2")}
                            if (position[i] < -2){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling3")}
                              }
                } // also all examples say set position = 0 if culling
            }
            position = mi_position_matrix_multiplier(position , projection.to_screen_matrix)
            return [position[0],position[1]]
        }
      }

      class player{
        constructor(){
        this.position =[0,0,0,1.0]
        this.forward = [0,0,1,1]
        this.up = [0,1,0,1]
        this.right =[1,0,0,1]
        this.h_fov = 3.1415926535/3
        this.v_fov = this.h_fov * (canvas.height / canvas.width)
        this.near_plane = 1
        this.far_plane = 100
        this.moving_speed = 0.2
        this.rotation_speed = 0.1
        this.H_WIDTH = canvas.width/2
        this.H_HEIGHT = canvas.height/2
        this.anglePitch = 0
        this.angleYaw = 0
        }

        set_camera_angle(){
            var rotate = multiply(rotate_x(this.anglePitch) , rotate_y(this.angleYaw))
            this.forward = [0, 0, 1, 1]
            this.up = [0, 1, 0, 1]
            this.right = [1, 0, 0, 1]
            this.forward = mi_position_matrix_multiplier(this.forward , rotate)
            this.right = mi_position_matrix_multiplier(this.right , rotate)
            this.up = mi_position_matrix_multiplier(this.up , rotate)
                            }

       camera_yaw(angle){
            this.angleYaw += angle}

        translate_matrix(self){
            var x = this.position[0];
            var y = this.position[1];
            var z = this.position[2];
            var w = this.position[3];
            return [
            [1,0,0,0],
            [0,1,0,1],
            [0,0,1,0],
            [-x,-y,z, 1]
            ]}

        rotate_matrix(){
            var rx = this.right[0]
            var ry = this.right[1]
            var rz = this.right[2]
            var w = this.right[3]
            var fx = this.forward[0]
            var fy = this.forward[1]
            var fz = this.forward[2]
            var w = this.forward[3]
            var ux = this.up[0]
            var uy = this.up[1]
            var uz = this.up[2]
            var w = this.up[3]
            return [
            [rx,ux,fx,0],
            [ry,uy,fy,0],
            [rz,uz,fz,0],
            [0,0,0,1]
            ]
          }

        camera_matrix(){
            return multiply(this.translate_matrix(), this.rotate_matrix());
                        }

        move(event)
              {
                var key_code = parseInt(event.keyCode)
              if (key_code == 37 || key_code == 39 || key_code == 83 || key_code == 87 || key_code == 119|| key_code == 115)
                {
                  var dx = Math.cos(this.angleYaw)*this.moving_speed
                  var dy = Math.sin(this.angleYaw)*this.moving_speed
          //        console.log("that were moving  = dx , dy = "+dx.toString()+" , "+dy.toString())
                  if ( key_code == 37 || key_code == 87 || key_code == 119) {
                      this.position[0] += -dy
                      this.position[2] += dx
                                                                            }

                  if (key_code == 39 || key_code == 83 || key_code == 115) {
                      for (let i = 0; i < this.position.length; i++) {
                        this.position[0] += dy
                        this.position[2] += -dx
                                                                      }
                                                                           }
                  }
              else {
                    if ( key_code == 38 || key_code == 65  || key_code == 97) {
                      this.camera_yaw(-this.rotation_speed)
                                                                              }
                    if (key_code == 40 || key_code == 68  || key_code == 100) {
                      this.camera_yaw(this.rotation_speed)
                    }
                    this.set_camera_angle()
                  }
            }
      }

      function translate(pos){
        tx,ty,tz=pos
        return np.array([
        [1,0,0,0],
        [0,1,0,0],
        [0,0,1,0],
        [tx,ty,tz,1]
        ])}

       function rotate_x(angle){
        return [
        [1,0,0,0],
        [0,Math.cos(angle),Math.sin(angle),0],
        [0,-Math.sin(angle),Math.cos(angle),0],
        [0,0,0,1]
        ]
      }

    function rotate_y(a){
        return [
        [math.cos(a),0, -math.sin(a),0],
        [0,1,0,0],
        [math.sin(a), 0 , math.cos(a),0],
        [0,0,0,1]
      ]
    }

  function update_matrix_info_debug(matrix_name, matrix){
    if (matrix[0].length > 1)
                          {
      for (let x = 1; x < matrix.length+1; x++) {
        for (let y = 1; y < matrix.length+1; y++) {
        document.getElementById(matrix_name.toString()+"_"+x.toString()+y.toString()).innerHTML = matrix[x-1][y-1]
                                                }
                                              }
                            }
      else {
        for (let x = 1; x < matrix.length+1; x++) {document.getElementById(matrix_name.toString()+"_"+"1"+x.toString()).innerHTML = matrix[x-1]}
      }
  }

      class two_d_surdace {
        constructor(verex1,verex2,verex3,verex4 , colour){
          this.vertices = [verex1,verex2,verex3,verex4]
          this.colour = colour
        }

        draw_all_faces(){
          var each_point = []
          for (let i = 0; i < this.vertices.length; i++)  {
                                  each_point.push(this.vertices[i].return_screen_projection(true))
                                                          }
          ctx.fillStyle = this.colour;
          var moved_to_first_yet = false
          for (let vertex = 0; vertex < this.vertices.length; vertex++)
                        {
                if (moved_to_first_yet == false)
                          {
                moved_to_first_yet = true
                ctx.moveTo( each_point[vertex][0],each_point[vertex][1]);
                          }
                else{ctx.lineTo( each_point[vertex][0],each_point[vertex][1]);}
                        }
            ctx.closePath();
            ctx.fill();

                }
      }

      function if_off_screen(x, y)
      {
        if (x> canvas.width || x < 0){ return true;}
        if (y > canvas.height || y < 0){ return true;}
        return false;
      }

      function if_most_of_these_numbers_are_off_screen(numbers){
        var threshold = 1; //Math.floor(numbers.length*0.49)
        var counter = 0
        for (let i = 0; i < numbers.length; i++) { if (if_off_screen(numbers[i][0], numbers[i][1])){ counter +=1} else{}  }
        if (counter >= threshold){return true}
        return false;
      }

      player = new player();

      projection = new Projection()

      floor = new two_d_surdace(new vertex(50,floor_y_pos,50) , new vertex(-50,floor_y_pos,50) , new vertex(-50,floor_y_pos,-50) , new vertex(50,floor_y_pos,-50) , '#F90'  )

        $(document).on("keypress", function (event) {
        player.move(event)
        ctx.beginPath();
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        floor.draw_all_faces()
      });
    </script>
</body>
</code>```

Body:
I have a view frustum that works great when looking at stuff from a distance. But for example, when i stand in the middle of a square, my current system struggles to place vertices which are behind me.

For example the image below demonstrates looking at a tile from a distance vs standing on top of it ...

My proccess for putting things onto screen can be described in 5 steps

cross product the co-ordinates of the object with my camera matrix

cross product the result of 1 with my projection_matrix

normalize the result of 2 by dividing through the 4th dimension of my co-ordinates (my w co-ordinate)

cull results of 3 (its not causing the problem, i tried without culling)

cross product 4 with to_screen_matrix

Basically the problem i have, is this procces is great at putting things on the screen but sometimes an object isnt on the screen... what co-ordinates should be used then?

Below is a drawing of what i think the problem is

below is my screen_projection function

return_screen_projection(dont_cull = false){

          var position = cross_product(this.position , player.camera_matrix())

          position = cross_product(position ,  projection.projection_matrix) // does this just convert the position to cameras reference frame.

          for (let i = 0; i < position.length; i++) {
                position[i] = position[i]/position[3]
            }

          if (dont_cull == false){
                for (let i = 0; i < position.length; i++) {
                  if (i != 1){
                            if (this.is_this_object_behind_player()){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling1")}
                            if (position[i] > 2){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling2")}
                            if (position[i] < -2){for (let ii = 0; ii < position.length; ii++) {position[ii] = -9999;} console.log("culling3")}
                              }
                } // also all examples say set position = 0 if culling
            }
            position = cross_product(position , projection.to_screen_matrix)

            return [position[0],position[1]]
        }

how could i better handle the position of a vertex offscreen, when some vertexes of the object im dealing with are on screen?

##################  extra info below

below is a blob of 300 lines of code (sorry , i cant make it more minimal and reproducable with just a copy n paste)

running the below in a web browser will give you an example of the problem (w,a,s,d) to move (you start mired in the middle of an object, you may wish to step back to see better the first time)

 first person below

      <canvas id="mi_canvas" width="300" height="300" style="border-style: solid;"></canvas>


问:
Accessing files on Paperspace Gradient Persistent Storage
I store my files in Paperspace Gradient in the persistent storage within the folder /storage. Is it possible to access this folder from my local machine e.g. through SSH? I have found information online how to access Paperspace Core through SSH but no information about Gradient.

Thanks in advance!


问:
Updating CORS Policy Origins During RunTime on All Servers
I am trying to update the CORS Policy Origins during runtime. However, It is only updating on one server and not on all the servers. My web application is hosted on 4 servers and I want to update it on all 4 servers.

Here is the Startup.cs Code:

```<code> // Configure CORS
            services.AddCors(c =>
            {
                c.AddPolicy("CorsPolicy", options => options
                .SetIsOriginAllowedToAllowWildcardSubdomains()
                .WithOrigins(origins)
                .AllowAnyMethod()
                .AllowAnyHeader()
                .AllowCredentials()
                );
            });
</code>```

Code To Update the Origins During runtime :

```<code>public class CorsPolicyAccessor : ICorsPolicyAccessor
    {
        private readonly ICorsPolicyProvider _cors;
        private readonly string _corsPolicy;

        public CorsPolicyAccessor(ICorsPolicyProvider cors)
        {
            _corsPolicy = "CorsPolicy";
            _cors = cors;
        }

        public async Task<CorsPolicy> GetPolicy(HttpContext context)
        {
            return await _cors.GetPolicyAsync(context,_corsPolicy);
        }

        public async Task AddDomainToPolicy(string origin, HttpContext context)
        {
            //_cors.GetPolicyAsync(context, _corsPolicy);
            (await _cors.GetPolicyAsync(context, _corsPolicy)).Origins.Add(origin);
        }
</code>```

I have tried searching a lot and have tried corsoptions as wel. But No Luck yet.

Body:
I am trying to update the CORS Policy Origins during runtime. However, It is only updating on one server and not on all the servers. My web application is hosted on 4 servers and I want to update it on all 4 servers.

Here is the Startup.cs Code:

 // Configure CORS
            services.AddCors(c =>
            {
                c.AddPolicy("CorsPolicy", options => options
                .SetIsOriginAllowedToAllowWildcardSubdomains()
                .WithOrigins(origins)
                .AllowAnyMethod()
                .AllowAnyHeader()
                .AllowCredentials()
                );
            });

Code To Update the Origins During runtime :

public class CorsPolicyAccessor : ICorsPolicyAccessor
    {
        private readonly ICorsPolicyProvider _cors;
        private readonly string _corsPolicy;

        public CorsPolicyAccessor(ICorsPolicyProvider cors)
        {
            _corsPolicy = "CorsPolicy";
            _cors = cors;
        }

        public async Task<CorsPolicy> GetPolicy(HttpContext context)
        {
            return await _cors.GetPolicyAsync(context,_corsPolicy);
        }

        public async Task AddDomainToPolicy(string origin, HttpContext context)
        {
            //_cors.GetPolicyAsync(context, _corsPolicy);
            (await _cors.GetPolicyAsync(context, _corsPolicy)).Origins.Add(origin);
        }

I have tried searching a lot and have tried corsoptions as wel. But No Luck yet.


问:
Setup is "unresponsive" at startup if I compile it with compression
The thing is: I have embedded music into the installer using the Bass Audio Library and when I compile without compression, the installer works fine. If compiled with compression, it just freezes and "does not respond".

```<code>[Code]

// Скрипт на время установки.
function GetTickCount: DWORD;
  external 'GetTickCount@kernel32.dll stdcall';

var
  StartTick: DWORD;
  PercentLabel: TNewStaticText;
  ElapsedLabel: TNewStaticText;
  RemainingLabel: TNewStaticText;

function TicksToStr(Value: DWORD): string;
var
  I: DWORD;
  Hours, Minutes, Seconds: Integer;
begin
  I := Value div 1000;
  Seconds := I mod 60;
  I := I div 60;
  Minutes := I mod 60;
  I := I div 60;
  Hours := I mod 24;
  Result := Format('%.2d:%.2d:%.2d', [Hours, Minutes, Seconds]);
end;

procedure InitializeWizard;
begin
  PercentLabel := TNewStaticText.Create(WizardForm);
  PercentLabel.Parent := WizardForm.ProgressGauge.Parent;
  PercentLabel.Left := 0;
  PercentLabel.Top := WizardForm.ProgressGauge.Top +
    WizardForm.ProgressGauge.Height + 12;

  ElapsedLabel := TNewStaticText.Create(WizardForm);
  ElapsedLabel.Parent := WizardForm.ProgressGauge.Parent;
  ElapsedLabel.Left := 0;
  ElapsedLabel.Top := PercentLabel.Top + PercentLabel.Height + 4;

  RemainingLabel := TNewStaticText.Create(WizardForm);
  RemainingLabel.Parent := WizardForm.ProgressGauge.Parent;
  RemainingLabel.Left := 0;
  RemainingLabel.Top := ElapsedLabel.Top + ElapsedLabel.Height + 4;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpInstalling then
    StartTick := GetTickCount;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  if CurPageID = wpInstalling then
  begin
    Cancel := False;
    if ExitSetupMsgBox then
    begin
      Cancel := True;
      Confirm := False;
      PercentLabel.Visible := False;
      ElapsedLabel.Visible := False;
      RemainingLabel.Visible := False;
    end;
  end;
end;

procedure CurInstallProgressChanged(CurProgress, MaxProgress: Integer);
var
  CurTick: DWORD;
begin
  CurTick := GetTickCount;
  PercentLabel.Caption :=
    Format('Готово: %.2f %%', [(CurProgress * 100.0) / MaxProgress]);
  ElapsedLabel.Caption :=
    Format('Прошедшее время: %s', [TicksToStr(CurTick - StartTick)]);
  if CurProgress > 0 then
  begin
    RemainingLabel.Caption :=
      Format('Оставшееся время: %s', [TicksToStr(
        ((CurTick - StartTick) / CurProgress) * (MaxProgress - CurProgress))]);
  end;
end;

// Скрипт на время удаления.
function SetTimer(hWnd: longword; nIDEvent, uElapse: LongWord;
  lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function GetTickCount2: DWORD;
  external 'GetTickCount@kernel32.dll stdcall';

var
  UninstallStartTick: DWORD;
  UninstallPercentLabel: TNewStaticText;
  UninstallElapsedLabel: TNewStaticText;
  UninstallRemainingLabel: TNewStaticText;

function TicksToStr2(Value: DWORD): string;
var
  I: DWORD;
  Hours, Minutes, Seconds: Integer;
begin
  I := Value div 1000;
  Seconds := I mod 60;
  I := I div 60;
  Minutes := I mod 60;
  I := I div 60;
  Hours := I mod 24;
  Result := Format('%.2d:%.2d:%.2d', [Hours, Minutes, Seconds]);
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then
  begin
    UninstallStartTick := GetTickCount;
  end;
end;

procedure UninstallTimerProc(
  h: LongWord; AMsg: LongWord; IdEvent: LongWord; dwTime: LongWord);
var
  CurTick: DWORD;
  CurProgress: Integer;
  MaxProgress: Integer;
begin
  MaxProgress := UninstallProgressForm.ProgressBar.Max;
  CurProgress := UninstallProgressForm.ProgressBar.Position;

  if MaxProgress > 0 then
  begin
    CurTick := GetTickCount;
    UninstallPercentLabel.Caption :=
      Format('Готово: %.2f %%', [(CurProgress * 100.0) / MaxProgress]);
    UninstallElapsedLabel.Caption :=
      Format('Прошедшее время: %s', [TicksToStr(CurTick - UninstallStartTick)]);
    if CurProgress > 0 then
    begin
      UninstallRemainingLabel.Caption :=
        Format('Оставшееся время: %s', [TicksToStr(
          ((CurTick - UninstallStartTick) / CurProgress) *
           (MaxProgress - CurProgress))]);
    end;
  end;
end;

procedure InitializeUninstallProgressForm();
begin
  UninstallPercentLabel := TNewStaticText.Create(UninstallProgressForm);
  UninstallPercentLabel.Parent := UninstallProgressForm.ProgressBar.Parent;
  UninstallPercentLabel.Left := UninstallProgressForm.ProgressBar.Left;
  UninstallPercentLabel.Top := UninstallProgressForm.ProgressBar.Top +
    UninstallProgressForm.ProgressBar.Height + ScaleY(12);

  UninstallElapsedLabel := TNewStaticText.Create(UninstallProgressForm);
  UninstallElapsedLabel.Parent := UninstallProgressForm.ProgressBar.Parent;
  UninstallElapsedLabel.Left := UninstallPercentLabel.Left;
  UninstallElapsedLabel.Top :=
    UninstallPercentLabel.Top + UninstallPercentLabel.Height + ScaleY(4);

  UninstallRemainingLabel := TNewStaticText.Create(UninstallProgressForm);
  UninstallRemainingLabel.Parent := UninstallProgressForm.ProgressBar.Parent;
  UninstallRemainingLabel.Left := UninstallPercentLabel.Left;
  UninstallRemainingLabel.Top :=
    UninstallElapsedLabel.Top + UninstallElapsedLabel.Height + ScaleY(4);

  SetTimer(0, 0, 100, CreateCallback(@UninstallTimerProc)); { every 100 ms }
end;

// Скрипт на проигрывание музыки и для кнопок.
const
  BASS_SAMPLE_LOOP = 4;
  BASS_ACTIVE_STOPPED = 0;
  BASS_ACTIVE_PLAYING = 1;
  BASS_ACTIVE_STALLED = 2;
  BASS_ACTIVE_PAUSED  = 3;
  BASS_UNICODE = $80000000;
  BASS_CONFIG_GVOL_STREAM = 5;
const
  #ifndef UNICODE
    EncodingFlag = 0;
  #else
    EncodingFlag = BASS_UNICODE;
  #endif
type
  HSTREAM = DWORD;

function BASS_Init(device: LongInt; freq, flags: DWORD;
  win: HWND; clsid: Cardinal): Boolean;
  external 'BASS_Init@files:bass.dll stdcall';
function BASS_StreamCreateFile(mem: Boolean; f: string; offset1: DWORD;
  offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
  external 'BASS_StreamCreateFile@files:bass.dll stdcall';
function BASS_ChannelPlay(handle: DWORD; restart: Boolean): Boolean;
  external 'BASS_ChannelPlay@files:bass.dll stdcall';
function BASS_ChannelPause(handle: DWORD): Boolean;
  external 'BASS_ChannelPause@files:bass.dll stdcall';
function BASS_SetConfig(option: DWORD; value: DWORD ): Boolean;
  external 'BASS_SetConfig@files:bass.dll stdcall';
function BASS_ChannelIsActive(handle: DWORD): DWORD;
  external 'BASS_ChannelIsActive@files:bass.dll stdcall';

var
  SoundStream: HSTREAM;
  PauseResumePlayButton: TNewButton;
  StopButton: TNewButton;

procedure ResumeButtonClick(Sender: TObject); forward;

procedure PauseButtonClick(Sender: TObject);
begin
  if BASS_ChannelPause(SoundStream) then
  begin
    PauseResumePlayButton.Caption := 'Возобновить';
    PauseResumePlayButton.OnClick := @ResumeButtonClick;
  end;
end;

procedure ResumeButtonClick(Sender: TObject);
begin
  if BASS_ChannelPlay(SoundStream, False) then
  begin
    PauseResumePlayButton.Caption := 'Пауза';
    PauseResumePlayButton.OnClick := @PauseButtonClick;
  end;
end;

procedure PlayButtonClick(Sender: TObject);
begin
  if BASS_ChannelPlay(SoundStream, True) then
  begin
    PauseResumePlayButton.Caption := 'Пауза';
    PauseResumePlayButton.OnClick := @PauseButtonClick;
  end;
end;

procedure StopButtonClick(Sender: TObject);
begin
  if (BASS_ChannelIsActive(SoundStream) = BASS_ACTIVE_PAUSED) or
     BASS_ChannelPause(SoundStream) then
  begin
    PauseResumePlayButton.Caption := 'Плей';
    PauseResumePlayButton.OnClick := @PlayButtonClick;
  end;
end;

<event('InitializeWizard')>
procedure InitializeWizard2();
begin
  if BASS_Init(-1, 44100, 0, 0, 0) then
  begin
    ExtractTemporaryFile('music.mp3');
    SoundStream :=
      BASS_StreamCreateFile(
        False, ExpandConstant('{tmp}\music.mp3'), 0, 0, 0, 0,
        EncodingFlag or BASS_SAMPLE_LOOP);

    if SoundStream <> 0 then
    begin
      BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);

      if BASS_ChannelPlay(SoundStream, False) then
      begin
        StopButton := TNewButton.Create(WizardForm);
        StopButton.Parent := WizardForm;
        StopButton.Left :=
          WizardForm.ClientWidth -
          WizardForm.CancelButton.Left -  WizardForm.CancelButton.Width;
        StopButton.Top := WizardForm.CancelButton.Top;
        StopButton.Width :=  WizardForm.CancelButton.Width;
        StopButton.Height := WizardForm.CancelButton.Height;
        StopButton.Caption := 'Стоп';
        StopButton.OnClick := @StopButtonClick;

        PauseResumePlayButton := TNewButton.Create(WizardForm);
        PauseResumePlayButton.Parent := WizardForm;
        PauseResumePlayButton.Left :=
          WizardForm.ClientWidth -
          WizardForm.NextButton.Left -  WizardForm.NextButton.Width;
        PauseResumePlayButton.Top := WizardForm.CancelButton.Top;
        PauseResumePlayButton.Width :=  WizardForm.CancelButton.Width;
        PauseResumePlayButton.Height := WizardForm.CancelButton.Height;
        PauseResumePlayButton.Caption := 'Пауза';
        PauseResumePlayButton.OnClick := @PauseButtonClick;
      end;
    end;
  end;
end;
</code>```

Maybe it's all about code optimization, but I'm not a programmer, unfortunately. Therefore, I hope for your help.

Body:
The thing is: I have embedded music into the installer using the Bass Audio Library and when I compile without compression, the installer works fine. If compiled with compression, it just freezes and "does not respond".

[Code]

// Скрипт на время установки.
function GetTickCount: DWORD;
  external 'GetTickCount@kernel32.dll stdcall';

var
  StartTick: DWORD;
  PercentLabel: TNewStaticText;
  ElapsedLabel: TNewStaticText;
  RemainingLabel: TNewStaticText;

function TicksToStr(Value: DWORD): string;
var
  I: DWORD;
  Hours, Minutes, Seconds: Integer;
begin
  I := Value div 1000;
  Seconds := I mod 60;
  I := I div 60;
  Minutes := I mod 60;
  I := I div 60;
  Hours := I mod 24;
  Result := Format('%.2d:%.2d:%.2d', [Hours, Minutes, Seconds]);
end;

procedure InitializeWizard;
begin
  PercentLabel := TNewStaticText.Create(WizardForm);
  PercentLabel.Parent := WizardForm.ProgressGauge.Parent;
  PercentLabel.Left := 0;
  PercentLabel.Top := WizardForm.ProgressGauge.Top +
    WizardForm.ProgressGauge.Height + 12;

  ElapsedLabel := TNewStaticText.Create(WizardForm);
  ElapsedLabel.Parent := WizardForm.ProgressGauge.Parent;
  ElapsedLabel.Left := 0;
  ElapsedLabel.Top := PercentLabel.Top + PercentLabel.Height + 4;

  RemainingLabel := TNewStaticText.Create(WizardForm);
  RemainingLabel.Parent := WizardForm.ProgressGauge.Parent;
  RemainingLabel.Left := 0;
  RemainingLabel.Top := ElapsedLabel.Top + ElapsedLabel.Height + 4;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpInstalling then
    StartTick := GetTickCount;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  if CurPageID = wpInstalling then
  begin
    Cancel := False;
    if ExitSetupMsgBox then
    begin
      Cancel := True;
      Confirm := False;
      PercentLabel.Visible := False;
      ElapsedLabel.Visible := False;
      RemainingLabel.Visible := False;
    end;
  end;
end;

procedure CurInstallProgressChanged(CurProgress, MaxProgress: Integer);
var
  CurTick: DWORD;
begin
  CurTick := GetTickCount;
  PercentLabel.Caption :=
    Format('Готово: %.2f %%', [(CurProgress * 100.0) / MaxProgress]);
  ElapsedLabel.Caption :=
    Format('Прошедшее время: %s', [TicksToStr(CurTick - StartTick)]);
  if CurProgress > 0 then
  begin
    RemainingLabel.Caption :=
      Format('Оставшееся время: %s', [TicksToStr(
        ((CurTick - StartTick) / CurProgress) * (MaxProgress - CurProgress))]);
  end;
end;

// Скрипт на время удаления.
function SetTimer(hWnd: longword; nIDEvent, uElapse: LongWord;
  lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function GetTickCount2: DWORD;
  external 'GetTickCount@kernel32.dll stdcall';

var
  UninstallStartTick: DWORD;
  UninstallPercentLabel: TNewStaticText;
  UninstallElapsedLabel: TNewStaticText;
  UninstallRemainingLabel: TNewStaticText;

function TicksToStr2(Value: DWORD): string;
var
  I: DWORD;
  Hours, Minutes, Seconds: Integer;
begin
  I := Value div 1000;
  Seconds := I mod 60;
  I := I div 60;
  Minutes := I mod 60;
  I := I div 60;
  Hours := I mod 24;
  Result := Format('%.2d:%.2d:%.2d', [Hours, Minutes, Seconds]);
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then
  begin
    UninstallStartTick := GetTickCount;
  end;
end;

procedure UninstallTimerProc(
  h: LongWord; AMsg: LongWord; IdEvent: LongWord; dwTime: LongWord);
var
  CurTick: DWORD;
  CurProgress: Integer;
  MaxProgress: Integer;
begin
  MaxProgress := UninstallProgressForm.ProgressBar.Max;
  CurProgress := UninstallProgressForm.ProgressBar.Position;

  if MaxProgress > 0 then
  begin
    CurTick := GetTickCount;
    UninstallPercentLabel.Caption :=
      Format('Готово: %.2f %%', [(CurProgress * 100.0) / MaxProgress]);
    UninstallElapsedLabel.Caption :=
      Format('Прошедшее время: %s', [TicksToStr(CurTick - UninstallStartTick)]);
    if CurProgress > 0 then
    begin
      UninstallRemainingLabel.Caption :=
        Format('Оставшееся время: %s', [TicksToStr(
          ((CurTick - UninstallStartTick) / CurProgress) *
           (MaxProgress - CurProgress))]);
    end;
  end;
end;

procedure InitializeUninstallProgressForm();
begin
  UninstallPercentLabel := TNewStaticText.Create(UninstallProgressForm);
  UninstallPercentLabel.Parent := UninstallProgressForm.ProgressBar.Parent;
  UninstallPercentLabel.Left := UninstallProgressForm.ProgressBar.Left;
  UninstallPercentLabel.Top := UninstallProgressForm.ProgressBar.Top +
    UninstallProgressForm.ProgressBar.Height + ScaleY(12);

  UninstallElapsedLabel := TNewStaticText.Create(UninstallProgressForm);
  UninstallElapsedLabel.Parent := UninstallProgressForm.ProgressBar.Parent;
  UninstallElapsedLabel.Left := UninstallPercentLabel.Left;
  UninstallElapsedLabel.Top :=
    UninstallPercentLabel.Top + UninstallPercentLabel.Height + ScaleY(4);

  UninstallRemainingLabel := TNewStaticText.Create(UninstallProgressForm);
  UninstallRemainingLabel.Parent := UninstallProgressForm.ProgressBar.Parent;
  UninstallRemainingLabel.Left := UninstallPercentLabel.Left;
  UninstallRemainingLabel.Top :=
    UninstallElapsedLabel.Top + UninstallElapsedLabel.Height + ScaleY(4);

  SetTimer(0, 0, 100, CreateCallback(@UninstallTimerProc)); { every 100 ms }
end;

// Скрипт на проигрывание музыки и для кнопок.
const
  BASS_SAMPLE_LOOP = 4;
  BASS_ACTIVE_STOPPED = 0;
  BASS_ACTIVE_PLAYING = 1;
  BASS_ACTIVE_STALLED = 2;
  BASS_ACTIVE_PAUSED  = 3;
  BASS_UNICODE = $80000000;
  BASS_CONFIG_GVOL_STREAM = 5;
const
  #ifndef UNICODE
    EncodingFlag = 0;
  #else
    EncodingFlag = BASS_UNICODE;
  #endif
type
  HSTREAM = DWORD;

function BASS_Init(device: LongInt; freq, flags: DWORD;
  win: HWND; clsid: Cardinal): Boolean;
  external 'BASS_Init@files:bass.dll stdcall';
function BASS_StreamCreateFile(mem: Boolean; f: string; offset1: DWORD;
  offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
  external 'BASS_StreamCreateFile@files:bass.dll stdcall';
function BASS_ChannelPlay(handle: DWORD; restart: Boolean): Boolean;
  external 'BASS_ChannelPlay@files:bass.dll stdcall';
function BASS_ChannelPause(handle: DWORD): Boolean;
  external 'BASS_ChannelPause@files:bass.dll stdcall';
function BASS_SetConfig(option: DWORD; value: DWORD ): Boolean;
  external 'BASS_SetConfig@files:bass.dll stdcall';
function BASS_ChannelIsActive(handle: DWORD): DWORD;
  external 'BASS_ChannelIsActive@files:bass.dll stdcall';

var
  SoundStream: HSTREAM;
  PauseResumePlayButton: TNewButton;
  StopButton: TNewButton;

procedure ResumeButtonClick(Sender: TObject); forward;

procedure PauseButtonClick(Sender: TObject);
begin
  if BASS_ChannelPause(SoundStream) then
  begin
    PauseResumePlayButton.Caption := 'Возобновить';
    PauseResumePlayButton.OnClick := @ResumeButtonClick;
  end;
end;

procedure ResumeButtonClick(Sender: TObject);
begin
  if BASS_ChannelPlay(SoundStream, False) then
  begin
    PauseResumePlayButton.Caption := 'Пауза';
    PauseResumePlayButton.OnClick := @PauseButtonClick;
  end;
end;

procedure PlayButtonClick(Sender: TObject);
begin
  if BASS_ChannelPlay(SoundStream, True) then
  begin
    PauseResumePlayButton.Caption := 'Пауза';
    PauseResumePlayButton.OnClick := @PauseButtonClick;
  end;
end;

procedure StopButtonClick(Sender: TObject);
begin
  if (BASS_ChannelIsActive(SoundStream) = BASS_ACTIVE_PAUSED) or
     BASS_ChannelPause(SoundStream) then
  begin
    PauseResumePlayButton.Caption := 'Плей';
    PauseResumePlayButton.OnClick := @PlayButtonClick;
  end;
end;

<event('InitializeWizard')>
procedure InitializeWizard2();
begin
  if BASS_Init(-1, 44100, 0, 0, 0) then
  begin
    ExtractTemporaryFile('music.mp3');
    SoundStream :=
      BASS_StreamCreateFile(
        False, ExpandConstant('{tmp}\music.mp3'), 0, 0, 0, 0,
        EncodingFlag or BASS_SAMPLE_LOOP);

    if SoundStream <> 0 then
    begin
      BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);

      if BASS_ChannelPlay(SoundStream, False) then
      begin
        StopButton := TNewButton.Create(WizardForm);
        StopButton.Parent := WizardForm;
        StopButton.Left :=
          WizardForm.ClientWidth -
          WizardForm.CancelButton.Left -  WizardForm.CancelButton.Width;
        StopButton.Top := WizardForm.CancelButton.Top;
        StopButton.Width :=  WizardForm.CancelButton.Width;
        StopButton.Height := WizardForm.CancelButton.Height;
        StopButton.Caption := 'Стоп';
        StopButton.OnClick := @StopButtonClick;

        PauseResumePlayButton := TNewButton.Create(WizardForm);
        PauseResumePlayButton.Parent := WizardForm;
        PauseResumePlayButton.Left :=
          WizardForm.ClientWidth -
          WizardForm.NextButton.Left -  WizardForm.NextButton.Width;
        PauseResumePlayButton.Top := WizardForm.CancelButton.Top;
        PauseResumePlayButton.Width :=  WizardForm.CancelButton.Width;
        PauseResumePlayButton.Height := WizardForm.CancelButton.Height;
        PauseResumePlayButton.Caption := 'Пауза';
        PauseResumePlayButton.OnClick := @PauseButtonClick;
      end;
    end;
  end;
end;

Maybe it's all about code optimization, but I'm not a programmer, unfortunately. Therefore, I hope for your help.


问:
Is it possible to traverse through nested object when building template literals with generics?
I'm trying to generate template literals based on the keys from a generic type. I am using this to extract only the keys of properties that are objects, which works but only with any strings as such:

type KeysWithValsOfType<T, V> = keyof { [P in keyof T as T[P] extends V ? P : never]: P };

type Person = {
  firstName: string;
  lastName: string;
};

type Customer = {
  title: string;
  email: string;
};

type Booking = {
  id: string;
  person: Person;
  customer: Customer;
};

type TemplateLiteral<T> = `${string & KeysWithValsOfType<T>}($select=${string})`;

type BookingTemplate = TemplateLiteral<Booking>;

/**
 * BookingTemplate type can be either of these:
 *
 * person($select=${string})
 * customer($select=${string})
 */
```
<p>Is it possible to achieve the commented template literals where typescript generates based on the keys of the nested objects?</p>
<pre class="lang-js prettyprint-override"><code>type TemplateLiteral<T> = `${string & KeysWithValsOfType<T>}($select=${???})`;

type BookingTemplate = TemplateLiteral<Booking>;

/**
 * BookingTemplate can be either of these:
 *
 * person($select=firstName)
 * person($select=lastName)
 * person($select=firstName,lastName)
 * customer($select=title)
 * customer($select=email)
 * customer($select=title,email)
 */
</code>```

Body:
I'm trying to generate template literals based on the keys from a generic type. I am using this to extract only the keys of properties that are objects, which works but only with any strings as such:

type KeysWithValsOfType<T, V> = keyof { [P in keyof T as T[P] extends V ? P : never]: P };

type Person = {
  firstName: string;
  lastName: string;
};

type Customer = {
  title: string;
  email: string;
};

type Booking = {
  id: string;
  person: Person;
  customer: Customer;
};

type TemplateLiteral<T> = `${string & KeysWithValsOfType<T>}($select=${string})`;

type BookingTemplate = TemplateLiteral<Booking>;

/**
 * BookingTemplate type can be either of these:
 *
 * person($select=${string})
 * customer($select=${string})
 */

Is it possible to achieve the commented template literals where typescript generates based on the keys of the nested objects?

type TemplateLiteral<T> = `${string & KeysWithValsOfType<T>}($select=${???})`;

type BookingTemplate = TemplateLiteral<Booking>;

/**
 * BookingTemplate can be either of these:
 *
 * person($select=firstName)
 * person($select=lastName)
 * person($select=firstName,lastName)
 * customer($select=title)
 * customer($select=email)
 * customer($select=title,email)
 */


问:
tf.while_loop to specify a less-specific shape
I try to iterate inside a while loop but I get this error, I have several variables involved in the loop, the solution I think is to use the loop_vars, but I am not clear if for all the variables or only for the out, I am in my beginnings in tensorflow .
I have this error
ValueError: Input tensor 'lambda_1/GatherNd_1:0' enters the loop with shape (None,), but has shape  after one iteration. To allow the shape to vary across iterations, use the shape_invariants argument of tf.while_loop to specify a less-specific shape.

I tried using loop_vars, for the condition variable(out), but I still get the error


问:
How can I add an accelerator key to an MFC checkbox in the designer?
Is there a way to add an accelerator button to an MFC checkbox in the designer, or does it have to be done in code?  All of the examples I found on the web show how to do it in code.  I tried adding an ampersand to the caption, but the expected underscore did not appear.</p>


问:
Use multiple readme.md files of different folders in mkdocs
I'm creating the documentation of my repository using mkdocs and I've been looking for a plugin or something that allows me to bring different README.md files outside the docs/ folder.

I have something like this

```<code>├── components
│   ├── package1
│   │   ├── README.md
|   ├── package2
│   │   ├── README.md
|   └── package3
│   │   ├── README.md
├── docs
│   └── index.md
│   └── package_1.md
│   └── package_2.md
│   └── package_3.md
└── mkdocs.yml
</code>```

And I need a way to bring the README.md files from all the component packages into the nav: of mkdocs.yml without copying and pasting into the docs/ folder or changing the packages structure (can't use monorepo of spotify because that will make me create a new docs/ folder and mkdocs.yaml file while the readme would still be outside the docs/folder T-T)

Anyone knows of a plugin or ways to bring markdown snippets into other markdowns??
Please help

Body:
I'm creating the documentation of my repository using mkdocs and I've been looking for a plugin or something that allows me to bring different README.md files outside the docs/ folder.

I have something like this

├── components
│   ├── package1
│   │   ├── README.md
|   ├── package2
│   │   ├── README.md
|   └── package3
│   │   ├── README.md
├── docs
│   └── index.md
│   └── package_1.md
│   └── package_2.md
│   └── package_3.md
└── mkdocs.yml

And I need a way to bring the README.md files from all the component packages into the nav: of mkdocs.yml without copying and pasting into the docs/ folder or changing the packages structure (can't use monorepo of spotify because that will make me create a new docs/ folder and mkdocs.yaml file while the readme would still be outside the docs/folder T-T)

Anyone knows of a plugin or ways to bring markdown snippets into other markdowns??
Please help


问:
React Native local network permission define generating plugin
I have an app that is a few months old and at some point there was a request for permission of local network, which is not true, so I want to find a plugin that generates this or is there a way to turn off the permission request?

List of my plugins:

  "dependencies": {

     "@criipto/auth-js": "^3.4.7",

     "@expo/config-plugins": "^5.0.2",

     "@expo/html-elements": "^0.2.0",

     "@expo/vector-icons": "^13.0.0",

     "@logrocket/react-native": "^1.7.3",

     "@react-native-async-storage/async-storage": "~1.17.3",

     "@react-native-community/slider": "4.2.4",

     "@react-native-firebase/analytics": "14.11.1",

     "@react-native-firebase/app": "14.11.1",

     "@react-native-firebase/messaging": "14.11.1",

     "@react-native-masked-view/masked-view": "0.2.8",

     "@react-native-picker/picker": "2.4.8",

     "@react-navigation/bottom-tabs": "^6.3.2",

     "@react-navigation/native": "^6.0.8",

     "@react-navigation/native-stack": "^6.7.0",

     "@reduxjs/toolkit": "^1.8.3",

     "@sentry/react-native": "4.2.2",

     "@shopify/react-native-skia": "0.1.157",

     "axios": "^0.27.2",

     "babel-plugin-module-resolver": "^4.1.0",

     "base-64": "^1.0.0",

     "expo": "^47.0.0",

     "expo-application": "~5.0.1",

     "expo-asset": "~8.6.2",

     "expo-auth-session": "~3.7.2",

     "expo-av": "~13.0.1",

     "expo-blur": "~12.0.1",

     "expo-build-properties": "~0.4.0",

     "expo-clipboard": "~4.0.1",

     "expo-constants": "~14.0.2",

     "expo-crypto": "~12.0.0",

     "expo-dev-client": "~2.0.0",

     "expo-device": "~5.0.0",

     "expo-file-system": "~15.1.1",

     "expo-font": "~11.0.1",

     "expo-gl": "~12.0.0",

     "expo-linear-gradient": "~12.0.1",

     "expo-linking": "~3.2.3",

     "expo-modules-autolinking": "~1.0.0",

     "expo-notifications": "~0.17.0",

     "expo-random": "~13.0.0",

     "expo-secure-store": "~12.0.0",

     "expo-sharing": "~11.0.1",

     "expo-splash-screen": "~0.17.5",

     "expo-status-bar": "~1.4.2",

     "expo-system-ui": "~2.0.1",

     "expo-three": "^2.2.1",

     "expo-updates": "~0.15.5",

     "expo-video-player": "^2.1.0",

     "expo-web-browser": "~12.0.0",

     "jwt-decode": "^3.1.2",

     "lodash.debounce": "^4.0.8",

     "moti": "^0.20.0",

     "native-base": "^3.4.9",

     "nativewind": "^2.0.10",

     "react": "18.1.0",

     "react-dom": "18.1.0",

     "react-native": "0.70.5",

     "react-native-avoid-softinput": "^3.0.1",

     "react-native-bouncy-checkbox": "^3.0.2",

     "react-native-css-gradient": "^0.4.0",

     "react-native-expo-viewport-units": "^0.0.8",

     "react-native-fast-image": "^8.6.1",

     "react-native-gesture-handler": "~2.8.0",

     "react-native-get-random-values": "~1.8.0",

     "react-native-keyboard-aware-scroll-view": "^0.9.5",

     "react-native-linear-gradient": "^2.6.2",

     "react-native-material-ripple": "^0.9.1",

     "react-native-modal": "^13.0.0",

     "react-native-paper": "^4.12.4",

     "react-native-reanimated": "^2.13.0",

     "react-native-redash": "^18.0.0",

     "react-native-render-html": "^6.1.0",

     "react-native-safe-area-context": "4.4.1",

     "react-native-screens": "~3.18.0",

     "react-native-share": "^7.9.0",

     "react-native-svg": "13.4.0",

     "react-native-web": "~0.18.7",

     "react-native-webview": "11.23.1",

     "react-redux": "^8.0.2",

     "redux-persist": "^6.0.0",

     "redux-persist-expo-securestore": "^2.0.0",

     "sentry-expo": "~5.0.0",

     "styled-components": "^5.3.6",

     "text-encoding": "^0.7.0",

     "three": "^0.143.0",

     "url": "^0.11.0"

   },

   "devDependencies": {

     "@babel/core": "^7.19.3",

     "@expo/config-types": "^46.0.2",

     "@rnx-kit/dep-check": "^1.13.0",

     "@rtk-query/codegen-openapi": "^1.0.0",

     "@types/base-64": "^1.0.0",

     "@types/lodash.debounce": "^4.0.7",

     "@types/react": "~18.0.24",

     "@types/react-dom": "~18.0.8",

     "@types/react-native": "~0.70.6",

     "@types/react-native-material-ripple": "^0.9.2",

     "@types/redux-persist": "^4.3.1",

     "babel-plugin-root-import": "^6.6.0",

     "concurrently": "^7.3.0",

     "esbuild-runner": "^2.2.1",

     "postcss": "^8.4.14",

     "react-hook-form": "^7.35.0",

     "reactotron-react-native": "^5.0.3",

     "reactotron-redux": "^3.1.3",

     "tailwindcss": "^3.1.8",

     "ts-node": "^10.9.1",

     "typescript": "^4.6.3",

     "uri-scheme": "^1.0.120"

   },
```

I removed the plugin that was dated next to the date the problem was discovered, but it's impossible to say exactly when it appeared

Body:
I have an app that is a few months old and at some point there was a request for permission of local network, which is not true, so I want to find a plugin that generates this or is there a way to turn off the permission request?

List of my plugins:

  "dependencies": {

     "@criipto/auth-js": "^3.4.7",

     "@expo/config-plugins": "^5.0.2",

     "@expo/html-elements": "^0.2.0",

     "@expo/vector-icons": "^13.0.0",

     "@logrocket/react-native": "^1.7.3",

     "@react-native-async-storage/async-storage": "~1.17.3",

     "@react-native-community/slider": "4.2.4",

     "@react-native-firebase/analytics": "14.11.1",

     "@react-native-firebase/app": "14.11.1",

     "@react-native-firebase/messaging": "14.11.1",

     "@react-native-masked-view/masked-view": "0.2.8",

     "@react-native-picker/picker": "2.4.8",

     "@react-navigation/bottom-tabs": "^6.3.2",

     "@react-navigation/native": "^6.0.8",

     "@react-navigation/native-stack": "^6.7.0",

     "@reduxjs/toolkit": "^1.8.3",

     "@sentry/react-native": "4.2.2",

     "@shopify/react-native-skia": "0.1.157",

     "axios": "^0.27.2",

     "babel-plugin-module-resolver": "^4.1.0",

     "base-64": "^1.0.0",

     "expo": "^47.0.0",

     "expo-application": "~5.0.1",

     "expo-asset": "~8.6.2",

     "expo-auth-session": "~3.7.2",

     "expo-av": "~13.0.1",

     "expo-blur": "~12.0.1",

     "expo-build-properties": "~0.4.0",

     "expo-clipboard": "~4.0.1",

     "expo-constants": "~14.0.2",

     "expo-crypto": "~12.0.0",

     "expo-dev-client": "~2.0.0",

     "expo-device": "~5.0.0",

     "expo-file-system": "~15.1.1",

     "expo-font": "~11.0.1",

     "expo-gl": "~12.0.0",

     "expo-linear-gradient": "~12.0.1",

     "expo-linking": "~3.2.3",

     "expo-modules-autolinking": "~1.0.0",

     "expo-notifications": "~0.17.0",

     "expo-random": "~13.0.0",

     "expo-secure-store": "~12.0.0",

     "expo-sharing": "~11.0.1",

     "expo-splash-screen": "~0.17.5",

     "expo-status-bar": "~1.4.2",

     "expo-system-ui": "~2.0.1",

     "expo-three": "^2.2.1",

     "expo-updates": "~0.15.5",

     "expo-video-player": "^2.1.0",

     "expo-web-browser": "~12.0.0",

     "jwt-decode": "^3.1.2",

     "lodash.debounce": "^4.0.8",

     "moti": "^0.20.0",

     "native-base": "^3.4.9",

     "nativewind": "^2.0.10",

     "react": "18.1.0",

     "react-dom": "18.1.0",

     "react-native": "0.70.5",

     "react-native-avoid-softinput": "^3.0.1",

     "react-native-bouncy-checkbox": "^3.0.2",

     "react-native-css-gradient": "^0.4.0",

     "react-native-expo-viewport-units": "^0.0.8",

     "react-native-fast-image": "^8.6.1",

     "react-native-gesture-handler": "~2.8.0",

     "react-native-get-random-values": "~1.8.0",

     "react-native-keyboard-aware-scroll-view": "^0.9.5",

     "react-native-linear-gradient": "^2.6.2",

     "react-native-material-ripple": "^0.9.1",

     "react-native-modal": "^13.0.0",

     "react-native-paper": "^4.12.4",

     "react-native-reanimated": "^2.13.0",

     "react-native-redash": "^18.0.0",

     "react-native-render-html": "^6.1.0",

     "react-native-safe-area-context": "4.4.1",

     "react-native-screens": "~3.18.0",

     "react-native-share": "^7.9.0",

     "react-native-svg": "13.4.0",

     "react-native-web": "~0.18.7",

     "react-native-webview": "11.23.1",

     "react-redux": "^8.0.2",

     "redux-persist": "^6.0.0",

     "redux-persist-expo-securestore": "^2.0.0",

     "sentry-expo": "~5.0.0",

     "styled-components": "^5.3.6",

     "text-encoding": "^0.7.0",

     "three": "^0.143.0",

     "url": "^0.11.0"

   },

   "devDependencies": {

     "@babel/core": "^7.19.3",

     "@expo/config-types": "^46.0.2",

     "@rnx-kit/dep-check": "^1.13.0",

     "@rtk-query/codegen-openapi": "^1.0.0",

     "@types/base-64": "^1.0.0",

     "@types/lodash.debounce": "^4.0.7",

     "@types/react": "~18.0.24",

     "@types/react-dom": "~18.0.8",

     "@types/react-native": "~0.70.6",

     "@types/react-native-material-ripple": "^0.9.2",

     "@types/redux-persist": "^4.3.1",

     "babel-plugin-root-import": "^6.6.0",

     "concurrently": "^7.3.0",

     "esbuild-runner": "^2.2.1",

     "postcss": "^8.4.14",

     "react-hook-form": "^7.35.0",

     "reactotron-react-native": "^5.0.3",

     "reactotron-redux": "^3.1.3",

     "tailwindcss": "^3.1.8",

     "ts-node": "^10.9.1",

     "typescript": "^4.6.3",

     "uri-scheme": "^1.0.120"

   },

I removed the plugin that was dated next to the date the problem was discovered, but it's impossible to say exactly when it appeared


问:
react - update grid with data every X seconds
How do I update my React grid every X seconds with fresh data from the server?

In React using RTK Query I currently download some data and save in Redux.  I would like to download new data every 30 seconds.  What is the most efficient way in react to re-download the new data and only update the new changes in my original downloaded data?

The goal is to have a grid that is constantly updated with new data every 30 seconds.

This is how I am downloading the original set of data:

```<code>export const tradesApi = createApi({
reducerPath: "tradesApi",
baseQuery: fetchBaseQuery({ baseUrl: "https://localhost:44304/api/" }),
endpoints: (builder) => ({
getTrades: builder.query<TradeData[], number>({
  query: (id) => `/dashboard/returnPl?cid=${id}`,
}),
}),
});

export const { useGetTradesQuery} =
</code>```

tradesApi;

and calling it in my view:

```<code>const Home = () => {
  const { data: trades = [], isFetching: tradesFetching } =
    useGetTradesQuery(1);
</code>```

in an old project in .net I had to cycle though every item in new downloaded data, then searching for that item in old data, if found update particular column.

I was hoping there is a new efficient way to do this in React?

Body:
How do I update my React grid every X seconds with fresh data from the server?

In React using RTK Query I currently download some data and save in Redux.  I would like to download new data every 30 seconds.  What is the most efficient way in react to re-download the new data and only update the new changes in my original downloaded data?

The goal is to have a grid that is constantly updated with new data every 30 seconds.

This is how I am downloading the original set of data:

export const tradesApi = createApi({
reducerPath: "tradesApi",
baseQuery: fetchBaseQuery({ baseUrl: "https://localhost:44304/api/" }),
endpoints: (builder) => ({
getTrades: builder.query<TradeData[], number>({
  query: (id) => `/dashboard/returnPl?cid=${id}`,
}),
}),
});

export const { useGetTradesQuery} =

tradesApi;

and calling it in my view:

const Home = () => {
  const { data: trades = [], isFetching: tradesFetching } =
    useGetTradesQuery(1);

in an old project in .net I had to cycle though every item in new downloaded data, then searching for that item in old data, if found update particular column.

I was hoping there is a new efficient way to do this in React?


问:
R: Changing the Names of Temporary Files
I am working with the R programming language.

Sometimes when I am creating "interactive HTML widgets" in R (e.g. Plotly), I noticed that the final HTML output becomes "distorted in size" (e.g. width is fine, but length is shortened). To counter this problem, I usually use the following code:

```<code>wid = original_file

wid$x$width <- "6000px"

temp_output <- tempfile(tmpdir=getwd(), fileext=".html")

saveWidget(widget=wid, file=basename(temp_output), selfcontained=TRUE,

           knitrOptions=list())
</code>```

The above code runs fine - however, I noticed that when I run this code, the final file gets saved with some strange name, e.g. "eou3t4h33u534.html"

My Question: Using the above code, is it somehow possible to customize the final name of this HTML file?

For example - suppose if I wanted to call the output from this code as "December.html" - would it be possible to do this directly? (i.e. after this file gets created, I then manually change the name - I am trying to do this directly within the code)

Thanks!

Body:
I am working with the R programming language.

Sometimes when I am creating "interactive HTML widgets" in R (e.g. Plotly), I noticed that the final HTML output becomes "distorted in size" (e.g. width is fine, but length is shortened). To counter this problem, I usually use the following code:

wid = original_file

wid$x$width <- "6000px"

temp_output <- tempfile(tmpdir=getwd(), fileext=".html")

saveWidget(widget=wid, file=basename(temp_output), selfcontained=TRUE,

           knitrOptions=list())

The above code runs fine - however, I noticed that when I run this code, the final file gets saved with some strange name, e.g. "eou3t4h33u534.html"

My Question: Using the above code, is it somehow possible to customize the final name of this HTML file?

For example - suppose if I wanted to call the output from this code as "December.html" - would it be possible to do this directly? (i.e. after this file gets created, I then manually change the name - I am trying to do this directly within the code)

Thanks!


问:
Spring boot application ,accessing routs with gateway service gives white label error?
Hey Guys I was developing a simple project with spring boot, which has 2 services user and blogs and I am using eureka server and I tried to implement a gateway service and it also got registered on the eureka server also but I cannot access the route paths of either user or blog service can anyone please help me with this. This the application.yml file for the gateway service.

```<code>server:
  port: 3030
spring:
  application:
    name: gateway-service
  cloud:
    gateway:
      routes:
        - id: userModule
          uri: http://localhost:3001/
          predicates:
            - Path=/users/**
        - id: blogModule
          uri: http://localhost:3002/
          predicates:
            - Path=/blogs/**
eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:3000/eureka
  registerWithEureka:
    - true
  fetchRegistry:
    - true
</code>```

Body:
Hey Guys I was developing a simple project with spring boot, which has 2 services user and blogs and I am using eureka server and I tried to implement a gateway service and it also got registered on the eureka server also but I cannot access the route paths of either user or blog service can anyone please help me with this. This the application.yml file for the gateway service.

server:
  port: 3030
spring:
  application:
    name: gateway-service
  cloud:
    gateway:
      routes:
        - id: userModule
          uri: http://localhost:3001/
          predicates:
            - Path=/users/**
        - id: blogModule
          uri: http://localhost:3002/
          predicates:
            - Path=/blogs/**
eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:3000/eureka
  registerWithEureka:
    - true
  fetchRegistry:
    - true


问:
How to run cucumber examples in parallels using testNG
cucumber feature file
@xyz
Feature: First scenario
Scenario Outline: First run
When user add item
And go to checkouts
Then place order
Examples:
|USA|
|Australia|
|Spain|
|Canada|</p>


问:
what am I missing on PreviewProvider
my code works on the simulator here (it works here)

@main

```<code>struct sideMenu3App: App {
let persistenceController = PersistenceController.shared
@StateObject var viewRouter = ViewRouter()
var body: some Scene {
    WindowGroup {
        let context = persistenceController.container.viewContext
        let dateHolder = DateHolder(context)

        MotherView(viewRouter: viewRouter)
            .environment(\.managedObjectContext, persistenceController.container.viewContext)
            .environmentObject(dateHolder)
    }
}}
</code>```

on my PreviewProvider

```<code>struct MotherView_Previews: PreviewProvider {
//@StateObject var viewRouter: ViewRouter
static var previews: some View {

    MotherView(viewRouter: ViewRouter()).environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)

}}
</code>```

the app crashes on the preview

Title: what am I missing on PreviewProvider

Body:
my code works on the simulator here (it works here)

@main

struct sideMenu3App: App {
let persistenceController = PersistenceController.shared
@StateObject var viewRouter = ViewRouter()
var body: some Scene {
    WindowGroup {
        let context = persistenceController.container.viewContext
        let dateHolder = DateHolder(context)

        MotherView(viewRouter: viewRouter)
            .environment(\.managedObjectContext, persistenceController.container.viewContext)
            .environmentObject(dateHolder)
    }
}}

on my PreviewProvider

struct MotherView_Previews: PreviewProvider {
//@StateObject var viewRouter: ViewRouter
static var previews: some View {

    MotherView(viewRouter: ViewRouter()).environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)

}}

the app crashes on the preview


问:
Moving a point using cordinate in 2D OpenGL Python
Suppose I have a point in pixel (200,200), and I would like to just shift it to (400,400) pixel. Is there any way to do it without glClear() as I don't want my other objects to get erased?

Here is the code that I am using for drawing a single point:

```<code>from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *

def draw_points(x0,y0):
    glPointSize(5)
    glBegin(GL_POINTS)
    glVertex2f(x0,y0)
    glEnd()

def iterate():
    glViewport(0, 0, 1000, 1000)
    glMatrixMode(GL_PROJECTION)
    glLoadIdentity()
    glOrtho(0.0, 1000, 0.0, 1000, 0.0, 1.0)
    glMatrixMode (GL_MODELVIEW)
    glLoadIdentity()

def showScreen():
    elapesed_ms = glutGet(GLUT_ELAPSED_TIME)

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
    glLoadIdentity()
    iterate()
    glColor3f(255, 255, 255)

    draw_points(200,200)

    glutSwapBuffers()

glutInit()
glutInitDisplayMode(GLUT_RGBA)
glutInitWindowSize(1000, 1000)
glutInitWindowPosition(0, 0)
wind = glutCreateWindow(b"")
glutDisplayFunc(showScreen)

glutMainLoop()

</code>```

Body:
Suppose I have a point in pixel (200,200), and I would like to just shift it to (400,400) pixel. Is there any way to do it without glClear() as I don't want my other objects to get erased?

Here is the code that I am using for drawing a single point:

from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *

def draw_points(x0,y0):
    glPointSize(5)
    glBegin(GL_POINTS)
    glVertex2f(x0,y0)
    glEnd()

def iterate():
    glViewport(0, 0, 1000, 1000)
    glMatrixMode(GL_PROJECTION)
    glLoadIdentity()
    glOrtho(0.0, 1000, 0.0, 1000, 0.0, 1.0)
    glMatrixMode (GL_MODELVIEW)
    glLoadIdentity()

def showScreen():
    elapesed_ms = glutGet(GLUT_ELAPSED_TIME)

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
    glLoadIdentity()
    iterate()
    glColor3f(255, 255, 255)

    draw_points(200,200)

    glutSwapBuffers()

glutInit()
glutInitDisplayMode(GLUT_RGBA)
glutInitWindowSize(1000, 1000)
glutInitWindowPosition(0, 0)
wind = glutCreateWindow(b"")
glutDisplayFunc(showScreen)

glutMainLoop()


问:
How can I check my authentication status using ADC with Google Cloud?
im using Google Cloud Platform in order to use Bucket as my principal storage in my applicaction, i would like to check my authentication status and if its wrong or something throw an error and stop running my server.

I authenticate in google cloud with  Application Default Credentials (ADC).

I would like to get an answer how to check my authentication status using NodeJS


问:
error appears in chrome extension when importing selenium-webdriver in javascript
I am building a web extension to run automated tests using javascript, when installing and importing selenium-webdriver the extension crash showing the following message:

```<code>Uncaught TypeError: Cannot read properties of undefined (reading 'O_CREAT')
    at ./node_modules/selenium-webdriver/node_modules/tmp/lib/tmp.js
</code>```

this error appears for selenium-webdriver version 4.7.0

I tried older versions, till I reach version 4.3.0, then it showed a different error

```<code>Uncaught ReferenceError: Buffer is not defined
    at ./node_modules/selenium-webdriver/node_modules/ws/lib/constants.js
</code>```

Has anybody faced this before? and how can I solve it?

I searched everywhere for this error, but no solution. I could not figure out why it is showing this error. I tried deleting the node modules and re-installing, clearing the cache then reinstalling, installing many package that might be related to it but no luck at all.

Body:
I am building a web extension to run automated tests using javascript, when installing and importing selenium-webdriver the extension crash showing the following message:

Uncaught TypeError: Cannot read properties of undefined (reading 'O_CREAT')
    at ./node_modules/selenium-webdriver/node_modules/tmp/lib/tmp.js

this error appears for selenium-webdriver version 4.7.0

I tried older versions, till I reach version 4.3.0, then it showed a different error

Uncaught ReferenceError: Buffer is not defined
    at ./node_modules/selenium-webdriver/node_modules/ws/lib/constants.js

Has anybody faced this before? and how can I solve it?

I searched everywhere for this error, but no solution. I could not figure out why it is showing this error. I tried deleting the node modules and re-installing, clearing the cache then reinstalling, installing many package that might be related to it but no luck at all.


问:
Rendering Three.JS scene in a Vue component
I'm trying to make a Vue app where one component has to load a 3D model that I want to modify using a user interface later on. I've been doing some research on how to do this but anything I find is either from older versions of Vue or just does not work.

I tried loading a three scene in my component, there are no errors, but there is also nothing showing up here is my component's code:

const viewPort = Vue.ref(null);
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );

mounted(){
const renderer = new THREE.WebGLRenderer({
    //render in canvas
    canvas: viewPort.value
});
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );

//import donut glb
let donut;
const loader = new THREE.GLTFLoader();
loader.load('/bignut.glb', (gltf) => {
    donut = gltf.scene;
    donut.scale.set(40,40,40);
    scene.add(donut);
});

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{
background-color: red;
}</code>```

<template>
  <canvas ref="viewPort">

  </canvas>

test

</template>

```

Body:
I'm trying to make a Vue app where one component has to load a 3D model that I want to modify using a user interface later on. I've been doing some research on how to do this but anything I find is either from older versions of Vue or just does not work.

I tried loading a three scene in my component, there are no errors, but there is also nothing showing up here is my component's code:

const viewPort = Vue.ref(null);
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );

mounted(){
const renderer = new THREE.WebGLRenderer({
    //render in canvas
    canvas: viewPort.value
});
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );

//import donut glb
let donut;
const loader = new THREE.GLTFLoader();
loader.load('/bignut.glb', (gltf) => {
    donut = gltf.scene;
    donut.scale.set(40,40,40);
    scene.add(donut);
});

}

body{
background-color: red;
}

<template>
  <canvas ref="viewPort">

  </canvas>

test

</template>


问:
Error Code Newtonsoft.json Firebase with dictionary How can I solve it?
I'm trying to get information out of Firebase and I keep getting error codes for this line.
Would be nice if someone could help me.

Newtonsoft.Json.JsonSerializationException: "Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'System.Collections.Generic.Dictionary`2[System.String,DataBase.Blacklist]' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1."

```<code>Dictionary<string, list> data = JsonConvert.DeserializeObject<Dictionary<string, list>>(res.Body.ToString());
</code>```

The list "list" is in an other class
The names and every thing are correct (I think).

Body:
I'm trying to get information out of Firebase and I keep getting error codes for this line.
Would be nice if someone could help me.

Newtonsoft.Json.JsonSerializationException: "Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'System.Collections.Generic.Dictionary`2[System.String,DataBase.Blacklist]' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1."

Dictionary<string, list> data = JsonConvert.DeserializeObject<Dictionary<string, list>>(res.Body.ToString());

The list "list" is in an other class
The names and every thing are correct (I think).


问:
Is there any way to read Google chrome tab's HTML page from extension?
I want to access current tab's HTML elements from chrome extension.

I have manifest.json like:

```<code>{
  "manifest_version": 3,
  "name": "Scrapper",
  "description": "Scrapper extension.",
  "version": "1.0.0",
  "action": {
    "default_popup": "index.html",
    "default_title": "Scrapper",
    "default_icon": "scrapper.png"
  },
  "permissions": ["tabs"]
}
</code>```

index.html like this:

```<code><!DOCTYPE html>
<html>
  <head>
    <title>Scrapper extension</title>
    <meta charset="utf-8" />
  </head>
  <body>
    <div class="container">
      <div class="button_class">
        <input class="fetch_button" type="submit" value="Fetch profile data" />
      </div>
    </div>
  </body>
  <script src="script.js"></script>
</html>
</code>```

And script.js file like this:

```<code>async function fetchData() {
 const tab = await chrome.tabs.query({active: true, lastFocusedWindow: true});
 console.log(tab[0])
 console.log(tab[0].title)
 console.log(tab[0].url)
}
fetchData();
</code>```

In the extension console I am getting output for tab[0], tab[0].title and tab[0].url like this:

Scrapper console

Inside tab[0] there is no HTML as we can see here:

inside tab image

Body:
I want to access current tab's HTML elements from chrome extension.

I have manifest.json like:

{
  "manifest_version": 3,
  "name": "Scrapper",
  "description": "Scrapper extension.",
  "version": "1.0.0",
  "action": {
    "default_popup": "index.html",
    "default_title": "Scrapper",
    "default_icon": "scrapper.png"
  },
  "permissions": ["tabs"]
}

index.html like this:

<!DOCTYPE html>

    <title>Scrapper extension</title>
    <meta charset="utf-8" />

        <input class="fetch_button" type="submit" value="Fetch profile data" />

And script.js file like this:

async function fetchData() {
 const tab = await chrome.tabs.query({active: true, lastFocusedWindow: true});
 console.log(tab[0])
 console.log(tab[0].title)
 console.log(tab[0].url)
}
fetchData();

In the extension console I am getting output for tab[0], tab[0].title and tab[0].url like this:

Scrapper console

Inside tab[0] there is no HTML as we can see here:

inside tab image


问:
text box missing keystrokes
I am making a game using pygame, and I would like my user to type in a textbox when they are asked a question.

I looked this up, and came up with this code:

base_font = pygame.font.Font(None, 32)
user_text = ''

input_rect = pygame.Rect(A-140, B-32, 140, 32)

color_active = pygame.Color('lightskyblue3')

color_passive = (100, 100, 100)
color = color_passive

active = False
textbox = True
def textbox_update():
    global active
    global input_rect
    global color
    global user_text
    if not textbox:
        return
    for event in pygame.event.get():

        if event.type == pygame.MOUSEBUTTONDOWN:
            if input_rect.collidepoint(event.pos):
                active = True
            else:
                active = False

        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_BACKSPACE:

                user_text = user_text[:-1]

            else:
                user_text += event.unicode

    if active:
        color = color_active
    else:
        color = color_passive

    pygame.draw.rect(screen, color, input_rect)

    text_surface = base_font.render(user_text, True, (255, 255, 255))

    screen.blit(text_surface, (input_rect.x+5, input_rect.y+5))

    input_rect.w = max(100, text_surface.get_width()+10)

    pygame.display.flip()
```
<p>But this works horribly, and fails to grab input most of the time. Here is a working example I put together that shows how terrible this is:</p>
<pre class="lang-py prettyprint-override"><code>import pygame
pygame.init()
pygame.font.init()

screen = pygame.display.set_mode((500,600))
base_font = pygame.font.Font(None, 32)
user_text = ''

input_rect = pygame.Rect(250, 300, 140, 32)

color_active = pygame.Color('lightskyblue3')

color_passive = (100, 100, 100)
color = color_passive

active = False
textbox = True
done = False

def textbox_update():
    global active
    global input_rect
    global color
    global user_text
    if not textbox:
        return
    for event in pygame.event.get():
        if event.type == pygame.MOUSEBUTTONDOWN:
            if input_rect.collidepoint(event.pos):
                active = True
            else:
                active = False
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_BACKSPACE:

                user_text = user_text[:-1]

            else:
                user_text += event.unicode
    if active:
        color = color_active
    else:
        color = color_passive

    pygame.draw.rect(screen, color, input_rect)
    text_surface = base_font.render(user_text, True, (255, 255, 255))
    screen.blit(text_surface, (input_rect.x+5, input_rect.y+5))
    input_rect.w = max(100, text_surface.get_width()+10)

    pygame.display.flip()

while not done:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True

    screen.fill((255,255,255))
    textbox_update()
    pygame.display.update()
</code>```

Why does this not work?

Title: text box missing keystrokes

Body:
I am making a game using pygame, and I would like my user to type in a textbox when they are asked a question.

I looked this up, and came up with this code:

base_font = pygame.font.Font(None, 32)
user_text = ''

input_rect = pygame.Rect(A-140, B-32, 140, 32)

color_active = pygame.Color('lightskyblue3')

color_passive = (100, 100, 100)
color = color_passive

active = False
textbox = True
def textbox_update():
    global active
    global input_rect
    global color
    global user_text
    if not textbox:
        return
    for event in pygame.event.get():

        if event.type == pygame.MOUSEBUTTONDOWN:
            if input_rect.collidepoint(event.pos):
                active = True
            else:
                active = False

        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_BACKSPACE:

                user_text = user_text[:-1]

            else:
                user_text += event.unicode

    if active:
        color = color_active
    else:
        color = color_passive

    pygame.draw.rect(screen, color, input_rect)

    text_surface = base_font.render(user_text, True, (255, 255, 255))

    screen.blit(text_surface, (input_rect.x+5, input_rect.y+5))

    input_rect.w = max(100, text_surface.get_width()+10)

    pygame.display.flip()

But this works horribly, and fails to grab input most of the time. Here is a working example I put together that shows how terrible this is:

import pygame
pygame.init()
pygame.font.init()

screen = pygame.display.set_mode((500,600))
base_font = pygame.font.Font(None, 32)
user_text = ''

input_rect = pygame.Rect(250, 300, 140, 32)

color_active = pygame.Color('lightskyblue3')

color_passive = (100, 100, 100)
color = color_passive

active = False
textbox = True
done = False

def textbox_update():
    global active
    global input_rect
    global color
    global user_text
    if not textbox:
        return
    for event in pygame.event.get():
        if event.type == pygame.MOUSEBUTTONDOWN:
            if input_rect.collidepoint(event.pos):
                active = True
            else:
                active = False
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_BACKSPACE:

                user_text = user_text[:-1]

            else:
                user_text += event.unicode
    if active:
        color = color_active
    else:
        color = color_passive

    pygame.draw.rect(screen, color, input_rect)
    text_surface = base_font.render(user_text, True, (255, 255, 255))
    screen.blit(text_surface, (input_rect.x+5, input_rect.y+5))
    input_rect.w = max(100, text_surface.get_width()+10)

    pygame.display.flip()

while not done:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True

    screen.fill((255,255,255))
    textbox_update()
    pygame.display.update()

Why does this not work?


问:
How to fix Google Extension scrollbar disappearing
I am working on a Google Extension. The logic of the extension is same with Google Translate extension. When I select a word, scrollbar disappear on some websites such as Youtube, Stackoverflow etc. But not on Facebook or Instagram.

Did someone have such problem before? How can I solve this issue?

I tried overflowY: scroll, but didn't work.

I use React.js and Material UI.