问:
How to reduce SSR loading time in Next JS?
I am trying to reduce the load time that SSR is taking right now, So, I am building a property page
I have a next link that takes me to that property page but it takes too much time so it seems the API takes too much time so how can I reduce the page loading time?

```<code>export async function getServerSideProps(context) {
  const props = {
      properties: [],
      total: 0,
      filters: {},
      map: {
          latitude: DEFAULT_LATITUDE,
          longitude: DEFAULT_LONGITUDE,
          zoom: DEFAULT_ZOOM,
      },
      lookups: {
          basements: [],
          residentialTypes: [],
          residentialStyles: [],
          condoTypes: [],
          condoStyles: [],
          statuses: [],
      },
  }

  const filters = ProcessFiltersFromQuery(context.query)
  props.filters = { ...filters }

  const request = {
      limit: 500,
      first: true,
      orderBy: 'dom',
      orderByDir: 'desc',
      classes: ['Condo', 'Residential'],
      offer: 'Sale',
      ...filters,
  }

  const filteredCheck = { ...filters }
  delete filteredCheck.offer
  const filtered = Object.keys(filteredCheck).length > 0

  const center = context.query.center
  if (center) {
      const coords = context.query.center.split(',')
      const latitude = coords[0]
      const longitude = coords[1]

      props.map = {
          latitude: Number(latitude),
          longitude: Number(longitude),
          zoom: 15,
      }
      request.center = {
          latitude,
          longitude,
      }
  }

  props.useMap = !(filtered && !center)

  if (props.useMap && !center) {
      request.useMap = true
      request.bounds = DEFAULT_BOUNDS
  }

  const token = cookies(context).mss_token

  const properties = await IndexProperties(cleanup(request), token)
  if (properties.data) {
      props.properties = properties.data.properties
      props.total = properties.data.count
  }

  props.lookups.basements = Lookups.basements
  props.lookups.residentialTypes = Lookups.types.residential
  props.lookups.residentialStyles = Lookups.styles.residential
  props.lookups.condoTypes = Lookups.types.condo
  props.lookups.condoStyles = Lookups.styles.condo
  props.lookups.statuses = Lookups.statuses

  return { props }
}
</code>```

How can I reduce that time and user don't have to wait long enough for the product loading.

Body:
I am trying to reduce the load time that SSR is taking right now, So, I am building a property page
I have a next link that takes me to that property page but it takes too much time so it seems the API takes too much time so how can I reduce the page loading time?

export async function getServerSideProps(context) {
  const props = {
      properties: [],
      total: 0,
      filters: {},
      map: {
          latitude: DEFAULT_LATITUDE,
          longitude: DEFAULT_LONGITUDE,
          zoom: DEFAULT_ZOOM,
      },
      lookups: {
          basements: [],
          residentialTypes: [],
          residentialStyles: [],
          condoTypes: [],
          condoStyles: [],
          statuses: [],
      },
  }

  const filters = ProcessFiltersFromQuery(context.query)
  props.filters = { ...filters }

  const request = {
      limit: 500,
      first: true,
      orderBy: 'dom',
      orderByDir: 'desc',
      classes: ['Condo', 'Residential'],
      offer: 'Sale',
      ...filters,
  }

  const filteredCheck = { ...filters }
  delete filteredCheck.offer
  const filtered = Object.keys(filteredCheck).length > 0

  const center = context.query.center
  if (center) {
      const coords = context.query.center.split(',')
      const latitude = coords[0]
      const longitude = coords[1]

      props.map = {
          latitude: Number(latitude),
          longitude: Number(longitude),
          zoom: 15,
      }
      request.center = {
          latitude,
          longitude,
      }
  }

  props.useMap = !(filtered && !center)

  if (props.useMap && !center) {
      request.useMap = true
      request.bounds = DEFAULT_BOUNDS
  }

  const token = cookies(context).mss_token

  const properties = await IndexProperties(cleanup(request), token)
  if (properties.data) {
      props.properties = properties.data.properties
      props.total = properties.data.count
  }

  props.lookups.basements = Lookups.basements
  props.lookups.residentialTypes = Lookups.types.residential
  props.lookups.residentialStyles = Lookups.styles.residential
  props.lookups.condoTypes = Lookups.types.condo
  props.lookups.condoStyles = Lookups.styles.condo
  props.lookups.statuses = Lookups.statuses

  return { props }
}

How can I reduce that time and user don't have to wait long enough for the product loading.


来源: stackexchange

问:
range of array from getDataRange().getDisplayValues();
What's a limit of getDataRange().getDisplayValues();

my data is about 1000 records and just 12 columns in google sheet and i make a google script to get all to show them.
when i show just 10 records, it's not show anything but when i show just 8 records, it's ok.

```<code>window.onload = () => {
      DATA = '<?!= dataShowAll ?>'
      DATA = JSON.parse(DATA)
      DATA.range.shift()
      //console.log(DATA)
          DATA.range.forEach((row,i) =>{
            $("table tbody").append(`<tr id="TR${i}"></tr>`);
          $("#TR" + i).append(`<td style='text-align:center'>${DATA.range[i][0]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][4]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][8]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][10]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][2]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][3]}</td>`);
</code>```

how can i show all from google sheet

ContentLicense: CC BY-SA 4.0

Body:
What's a limit of getDataRange().getDisplayValues();

my data is about 1000 records and just 12 columns in google sheet and i make a google script to get all to show them.
when i show just 10 records, it's not show anything but when i show just 8 records, it's ok.

window.onload = () => {
      DATA = '<?!= dataShowAll ?>'
      DATA = JSON.parse(DATA)
      DATA.range.shift()
      //console.log(DATA)
          DATA.range.forEach((row,i) =>{
            $("table tbody").append(`<tr id="TR${i}"></tr>`);
          $("#TR" + i).append(`<td style='text-align:center'>${DATA.range[i][0]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][4]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][8]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][10]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][2]}</td>`);
          $("#TR" + i).append(`<td>${DATA.range[i][3]}</td>`);

how can i show all from google sheet


问:
how can a file recorded from a set of vp8 bytes be converted to any video format?
there is a streaming service that aims to send a set of bytes to the front via webRTC and at the same time these bytes are written to a file, they are encoded by the vp8 codec, i don't understand how to open the recorded file, it also needs to be converted into some format.
service written golang</p>


问:
How to remove "?et_blog" pagination links parameter on Divi Custom Post Type?
In my Project i'm using DIVI theme and i have use multiple custom post type like recipe, articles and so on.
and requirement is display that post in category archive page using pagination (without ajax)
but after doing code.

site.com/page/2/ (not working)

site.com/page/2/?et_blog (working)

if I remove "?et_blog" from url then page returning 404 error don't know why this adding
please let me know if any solution is there ?

eg.url structure

site.com/post_type/category/post-single

site.com/post_type/category/post-single/page/2/

I need to remove ?et_blog from URL

I'd try to add custom pagination and create shortcode function and display shortcode on DIVI builder


问:
My function is not storing data in the dataframe in R. however, it is printing the output
Check the code and the output in the picture. what could be the issue for not populating the dataframe. My function is not storing data in the dataframe in R. However, it is printing the output.

```<code>library(vcd)
data("Arthritis")

data_frame_Treatment = data.frame(matrix(nrow = length(levels(Arthritis$Treatment)), ncol = 3, dimnames = list(c(),c("Levels","Frequency","Mean of ages"))),stringsAsFactors = F)

fill_data_frame = function(levelname, rowNum, columnNum){

  data_subset = subset(Arthritis,Arthritis[,columnNum] == levelname)

  data_frame_Treatment[rowNum,1] = levelname
  print(data_frame_Treatment[rowNum, 1])

  data_frame_Treatment[rowNum,2] = nrow(data_subset)
  print(data_frame_Treatment[rowNum, 2])

  data_frame_Treatment[rowNum,3] = mean(data_subset[["Age"]])
  print(data_frame_Treatment[rowNum, 3])

}

for (i in levels(Arthritis$Treatment)) {
  if(i == "Placebo"){
    fill_data_frame("Placebo",1,2)
  } else {
    fill_data_frame("Treated",2,2)
  }
}
</code>```

Body:
Check the code and the output in the picture. what could be the issue for not populating the dataframe. My function is not storing data in the dataframe in R. However, it is printing the output.

library(vcd)
data("Arthritis")

data_frame_Treatment = data.frame(matrix(nrow = length(levels(Arthritis$Treatment)), ncol = 3, dimnames = list(c(),c("Levels","Frequency","Mean of ages"))),stringsAsFactors = F)

fill_data_frame = function(levelname, rowNum, columnNum){

  data_subset = subset(Arthritis,Arthritis[,columnNum] == levelname)

  data_frame_Treatment[rowNum,1] = levelname
  print(data_frame_Treatment[rowNum, 1])

  data_frame_Treatment[rowNum,2] = nrow(data_subset)
  print(data_frame_Treatment[rowNum, 2])

  data_frame_Treatment[rowNum,3] = mean(data_subset[["Age"]])
  print(data_frame_Treatment[rowNum, 3])

}

for (i in levels(Arthritis$Treatment)) {
  if(i == "Placebo"){
    fill_data_frame("Placebo",1,2)
  } else {
    fill_data_frame("Treated",2,2)
  }
}


问:
Difference between username/password in react-native-keychain?
I'm integrating with react-native-keychain and I'm somewhat confused about the setGenericPassword and getGenericPassword methods. What exactly is the difference between username and password for the setGenericPassword(username, password, ...) method when to access the stored information we simply call getGenericPassword without any parameters.

Is the password even doing anything or is the entire point just to store two strings? Is this where the sensitive data should be stored? I've read the API description and looked over the example repository but it wasn't clear to me.


问:
How to add hreflang tags in wordpress without plugin for specific pages?
Since I have 2 versions of similar pages in different languages, so as per google, defining an hreflang link for each version of a page is a must.

I want to add the hreflang rel=”alternate” attribute just after the head section on my home page & one post.

If I add the hreflang tags directly in the header.php file then it will be displayed on all pages & posts, but I want to add this tag only for specific posts or pages.

So, please let me know how can I do that.

Note: It is a must as per google to display the hreflang tags on all the pages which is similar in terms of content but with different language.

My home page is in Hindi-India, and the similar post is in ENG-India.

I have read these guides but did not got a solution that I'm looking for:

https://www.wpbeginner.com/plugins/how-to-add-hreflang-tags-in-wordpress/
https://www.quora.com/How-can-we-manually-add-hreflang-tags-on-WordPress-without-using-plugins


问:
How to change embed image of a website for Whatsapp
I have a website, that people share on whatsapp. When I share the link, I get a small image right next to the site title and description. I would like it to be a big iamge, with the title and descrption under it, just as they are when I share a youtube link
Right now A link to the meta tag for the image looks something like this:

```<code><meta property="og:image" content="URL">
<meta property="og:image:width" content="1280">
<meta property="og:image:height" content="720">
</code>```

It changes nothing if the width matches the image or not
Any idea how can I get to this result, or WhatsApp just created something for some websites, and I'm just not one of them?

Body:
I have a website, that people share on whatsapp. When I share the link, I get a small image right next to the site title and description. I would like it to be a big iamge, with the title and descrption under it, just as they are when I share a youtube link
Right now A link to the meta tag for the image looks something like this:

<meta property="og:image" content="URL">
<meta property="og:image:width" content="1280">
<meta property="og:image:height" content="720">

It changes nothing if the width matches the image or not
Any idea how can I get to this result, or WhatsApp just created something for some websites, and I'm just not one of them?


问:
What disassembler mean by RtlIsZeroMemory?
A Windows Qt C++ application is crashing sometimes, it seems to be happening more often on slower machines.
On my main development machine (macbook pro 2019 running windows on bootcamp) it almost never happen.
But on another latptop, a 8GB ram, intel core i5 1.60GHz, it happens pretty much always.
So much I replicated the development environment there to run the Qt Creator project in debug mode.
Then I got the following picture

What is the disassembler telling?

```<code>Disassembler (RtlIsZeroMemory)
</code>```

How can I further debug this?

Body:
A Windows Qt C++ application is crashing sometimes, it seems to be happening more often on slower machines.
On my main development machine (macbook pro 2019 running windows on bootcamp) it almost never happen.
But on another latptop, a 8GB ram, intel core i5 1.60GHz, it happens pretty much always.
So much I replicated the development environment there to run the Qt Creator project in debug mode.
Then I got the following picture

What is the disassembler telling?

Disassembler (RtlIsZeroMemory)

How can I further debug this?


问:
I am trying to edit a thought in my thoughts app. I am not able to update it
```<code>package com.example.demo

import android.content.Context
import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.firestore.FirebaseFirestore
import kotlinx.android.synthetic.main.activity_update_thought.*

class UpdateThoughtActivity : AppCompatActivity() {
  private  lateinit var thoughtDocumentId: String
    lateinit var commentDocId: String
    lateinit var thoughtTxt: String
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_update_thought)
        thoughtDocumentId = intent.getStringExtra(THOUGHT_DOC_ID_EXTRA)!!
        commentDocId = intent.getStringExtra(COMMENT_USER_ID_EXTRA)!!
        thoughtTxt = intent.getStringExtra(COMMENT_TXT_EXTRA)!!
        updateThoughtTxt.setText(thoughtTxt)
    }
    fun updateThoughtClicked(view: View) {
        FirebaseFirestore.getInstance().collection(THOUGHTS_REF).document(thoughtDocumentId)
            .update(THOUGHT_TXT, updateThoughtTxt.text.toString())
            .addOnSuccessListener {
                hideKeyboard()
                finish()
            }
            .addOnFailureListener { exception ->
                Log.e("Exception", "Could not update thought: ${exception.localizedMessage}")
            }
            }
    private fun hideKeyboard() {
        val inputManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
        if (inputManager.isAcceptingText) {
            inputManager.hideSoftInputFromWindow(currentFocus!!.windowToken,0)
        }
    }
    }

Here I am trying to update the thought. I am not able to update it.When I click on update button during runtime. I see this error.

</code>```

E  Could not update thought: NOT_FOUND: No document to update: projects/fir-ee876/databases/(default)/documents/thoughts/null

```<code>I did for comments activity the same thing. It works fine. I am getting problem only for this.
Can you please help me with this?

</code>```

I am trying to edit the thought and when I click on edit option it navigates to a new activity. In the new activity I want to update the thought and click on update button.When I click on that button the thought must be updated and must be displayed. When I tried this I am getting this error.

```<code>  E  Could not update thought: NOT_FOUND: No document to update: projects/fir-ee876/databases/(default)/documents/thoughts/null
</code>```

Body:
package com.example.demo

import android.content.Context
import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.firestore.FirebaseFirestore
import kotlinx.android.synthetic.main.activity_update_thought.*

class UpdateThoughtActivity : AppCompatActivity() {
  private  lateinit var thoughtDocumentId: String
    lateinit var commentDocId: String
    lateinit var thoughtTxt: String
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_update_thought)
        thoughtDocumentId = intent.getStringExtra(THOUGHT_DOC_ID_EXTRA)!!
        commentDocId = intent.getStringExtra(COMMENT_USER_ID_EXTRA)!!
        thoughtTxt = intent.getStringExtra(COMMENT_TXT_EXTRA)!!
        updateThoughtTxt.setText(thoughtTxt)
    }
    fun updateThoughtClicked(view: View) {
        FirebaseFirestore.getInstance().collection(THOUGHTS_REF).document(thoughtDocumentId)
            .update(THOUGHT_TXT, updateThoughtTxt.text.toString())
            .addOnSuccessListener {
                hideKeyboard()
                finish()
            }
            .addOnFailureListener { exception ->
                Log.e("Exception", "Could not update thought: ${exception.localizedMessage}")
            }
            }
    private fun hideKeyboard() {
        val inputManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
        if (inputManager.isAcceptingText) {
            inputManager.hideSoftInputFromWindow(currentFocus!!.windowToken,0)
        }
    }
    }

Here I am trying to update the thought. I am not able to update it.When I click on update button during runtime. I see this error.

E  Could not update thought: NOT_FOUND: No document to update: projects/fir-ee876/databases/(default)/documents/thoughts/null

I did for comments activity the same thing. It works fine. I am getting problem only for this.
Can you please help me with this?

I am trying to edit the thought and when I click on edit option it navigates to a new activity. In the new activity I want to update the thought and click on update button.When I click on that button the thought must be updated and must be displayed. When I tried this I am getting this error.

  E  Could not update thought: NOT_FOUND: No document to update: projects/fir-ee876/databases/(default)/documents/thoughts/null


问:
How to hide files/file implementation in a private podspec?
I created a private cocoapod framework and distributed it.Now i am able to download it via pods. But upon pod install all files and it's implementation is present. I want to hide the files or its implementation. Is there any way to do ? When i add s.exclude_files to hide certain files, its shows error with pod spec lint command stating s.source_files not able to access the files added in s.exclude_files.

I only want certain files to be accessible and other file's implementation should be hidden.


问:
Insecure use of middleware over HTTP denied by configuration /tuupola/slim-jwt-auth
I'm using JWT token in my PHP Slim 4 framework. The code is working fine on local machine but when I push the code to google cloud, I'm getting error as Insecure use of middleware over HTTP denied by configuration.

Attaching screenshot of the error log :

Below is my JWT Config:

```<code><?php
$ignoreUrl = "";

$app->add(new Tuupola\Middleware\JwtAuthentication([
    "header" => "X-Token",
    "regexp" => "/(.*)/",
    "path" => "/public",
    "secure" => true,
    "secret" => "123456789",
    "algorithm" => ["HS256"],
    "ignore" => [
        $ignoreUrl."/public/account/login",
        $ignoreUrl."/public/account/logout"
    ],
    "error" => function ($response, $arguments) {
        $data["status"] = false;
        $data["message"] = $arguments["message"];
        return $response
            ->withHeader("Content-Type", "application/json")
            ->getBody()->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
    }
]));
</code>```

Tried a lot for the solution but nothing is working. Can you please suggest what's wrong in my code. Thank you in advance

Body:
I'm using JWT token in my PHP Slim 4 framework. The code is working fine on local machine but when I push the code to google cloud, I'm getting error as Insecure use of middleware over HTTP denied by configuration.

Attaching screenshot of the error log :

Below is my JWT Config:

<?php
$ignoreUrl = "";

$app->add(new Tuupola\Middleware\JwtAuthentication([
    "header" => "X-Token",
    "regexp" => "/(.*)/",
    "path" => "/public",
    "secure" => true,
    "secret" => "123456789",
    "algorithm" => ["HS256"],
    "ignore" => [
        $ignoreUrl."/public/account/login",
        $ignoreUrl."/public/account/logout"
    ],
    "error" => function ($response, $arguments) {
        $data["status"] = false;
        $data["message"] = $arguments["message"];
        return $response
            ->withHeader("Content-Type", "application/json")
            ->getBody()->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
    }
]));

Tried a lot for the solution but nothing is working. Can you please suggest what's wrong in my code. Thank you in advance


问:
How we connect node js and bigquery?
How we connect node js and bigquery ? which type of code we do for that connection and also in which file we can do that. Can you explain me more on that ?

https://cloud.google.com/nodejs/docs/reference/bigquery-connection/latest
I tried above things but still can't connect to my GCP bigquery to node js.

Title: How we connect node js and bigquery?


问:
Is have any idea about how to add expnasion tiles inside Dropdownbutton #flutter
Is have any idea about how to implement expansion tile inside dropdown button. For clicking dropdownbutton , i want to show list of expansion tile, for clicking each expansion tile, i want to show each expansion tile details. have you anyone know about the details how to do this, please share, or is have any widget for this?</p>


问:
Install pg_cron extension on Postgres:13-alpine docker image
I am trying to implement a cron job on my Postgres DB using the pg_cron extension
but getting the following error which implies pg_cron extension is not installed on the Postgres:13-alpine image I am using :

```<code> Reason: liquibase.exception.DatabaseException: ERROR: could not open extension control file "/usr/local/share/postgresql/extension/pg_cron.control": No such file or directory [Failed SQL: (0) CREATE EXTENSION pg_cron]
</code>```

My Dockerfile :

```<code>FROM openjdk:11-jre-slim

# Non-root user
USER 1984:1984

COPY --chown=1984:1984 target/*.jar app.jar

CMD ["java","-jar","app.jar"]
</code>```

My docker-compose file :

```<code>version: '3'
services:

  postgres:
    image: postgres:13-alpine
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: pwd
      POSTGRES_DB: db
    volumes:
      - postgresdata:/var/lib/postgresql/data

volumes:
    postgresdata:
</code>```

AFAIU, I should add the following settings to postgresql.conf

shared_preload_libraries = 'pg_cron'
cron.database_name = 'postgres'

but since I am using a packaged Postgres Docker image, I am a bit confused and can't really see how this can be done.

Would you please have any pointers as to how add this pg_cron extension to the alpine image and which changes I have to make to my Dockerfile and docker-compose ?

Thank you.

Body:
I am trying to implement a cron job on my Postgres DB using the pg_cron extension
but getting the following error which implies pg_cron extension is not installed on the Postgres:13-alpine image I am using :

 Reason: liquibase.exception.DatabaseException: ERROR: could not open extension control file "/usr/local/share/postgresql/extension/pg_cron.control": No such file or directory [Failed SQL: (0) CREATE EXTENSION pg_cron]

My Dockerfile :

FROM openjdk:11-jre-slim

# Non-root user
USER 1984:1984

COPY --chown=1984:1984 target/*.jar app.jar

CMD ["java","-jar","app.jar"]

My docker-compose file :

version: '3'
services:

  postgres:
    image: postgres:13-alpine
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: pwd
      POSTGRES_DB: db
    volumes:
      - postgresdata:/var/lib/postgresql/data

volumes:
    postgresdata:

AFAIU, I should add the following settings to postgresql.conf

shared_preload_libraries = 'pg_cron'
cron.database_name = 'postgres'

but since I am using a packaged Postgres Docker image, I am a bit confused and can't really see how this can be done.

Would you please have any pointers as to how add this pg_cron extension to the alpine image and which changes I have to make to my Dockerfile and docker-compose ?

Thank you.


问:
initialData is null in livewire component when there is a two events in the same component
I am having two events in my component one is changing the layout and another one is sorting. Changing a layout basically it only replace a layout component inside a parent component. Now when i am calling a sorting then livewire giving me a error 'initialdata is null '.

I am looking for to create a sorting order with this same component. And my code is

```<code><div class="dropdown px-2 d-none d-lg-block">
  <div class=" text-dark fw-bold  dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
    <span class="px-1">
      <img class="" src="{{ Vite::image('icons/classic.png') }}" alt="" />
    </span>
    <span>
      <img class="" src="{{ Vite::image('icons/filter-down.png') }}" alt="" />
    </span>
  </div>
  <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
    <a class="dropdown-item text-primary @if($show == 1)text-primary @else text-dark @endif fw-bolder" href="javascript:void(0)" wire:click="$set('show', '1')">
      <img src="{{ Vite::image('icons/compact.png') }}" alt="" class="ps-2" /> Card </a>
    <a class="dropdown-item uni-border  @if($show == 2)text-primary @else text-dark @endif fw-bolder " href="javascript:void(0)" wire:click="$set('show', '2')">
      <img src="{{ Vite::image('icons/classic.png') }}" alt`your text`="" class="ps-2" />Classic </a>
    <a class="dropdown-item  uni-border @if($show == 3) text-primary @else text-dark @endif fw-bolder" href="javascript:void(0)" wire:click="$set('show', '3')">
      <img src="{{ Vite::image('icons/com.png') }}" alt="" class="ps-2" />Compact </a>
  </div>
</div>
{{-- sorting option --}}
<div class="d-flex justify-content-between pt-2 align-items-center d-none d-lg-block ">
  <div class="d-flex align-items-center justify-content-between">
    <div>
      <span class="m-0">Selected Filters:</span>
      <span class="  mx-3 boat-span2 align-items-center rounded-1">
        <span>$500 </span>
        <span>
          <img src="{{ Vite::image('icons/cross.png') }}" alt="" class="" />
        </span>
      </span>
      <span class="   boat-span2 align-items-center rounded-1">
        <span> Skipper </span>
        <span>
          <img src="{{ Vite::image('icons/cross.png') }}" alt="" class="" />
        </span>
      </span>
    </div>
    <div class="">
      <h6 class="m-0 text-secondary fw-500 ">
        <u> Clear Filters</u>
      </h6>
    </div>
  </div>
</div>
 @if($show == 2)
                {{-- classic layout --}}
                @livewire('frontend.boat.listing.layout.classic',['product' => $product])
                @elseif($show == 1)
                {{-- card layout --}}
                @livewire('frontend.boat.listing.layout.card',['product' => $product])
                @elseif($show == 3)
                {{-- compact layout --}}
                @livewire('frontend.boat.listing.layout.compact',['product' => $product])
                @endif
</div>
</code>```
```<code><?php

namespace App\Http\Livewire\Frontend\Boat\Listing;

use App\Models\Product;
use Livewire\Component;

class Listing extends Component
{

    // Mount , boot , hydrate component

    public $filter_option_recommend = "recommended";
    public $show = "2";
    // public $filter_option = "name";

    // public $product;

    public function detail($id, $title)
    {
        return redirect()->route('website.boat.detail', [$id, $title]);
    }

    public function render()
    {
        $product = Product::join('product_time_assign', 'product_time_assign.product_id', '=', 'products.id')
            ->where([
                'products.type_id' => 1, // boat
                'products.status' => 'Active',
            ])
            ->select(
                'products.id as productid',
                'product_time_assign.id as timeassignid',
                'products.name',
                'products.capacity',
                'products.price_starts',
                'product_time_assign.skipper',
                'product_time_assign.product_time_assign_id',
                'products.review_rating',
                'products.image',
                'products.description',
                'products.discount_price'
            )
            ->orderBy($this->filter_option_recommend, 'asc')->get();
        return view('livewire.frontend.boat.listing.listing', ['product' => $product]);
    }
}

</code>```

Body:
I am having two events in my component one is changing the layout and another one is sorting. Changing a layout basically it only replace a layout component inside a parent component. Now when i am calling a sorting then livewire giving me a error 'initialdata is null '.

I am looking for to create a sorting order with this same component. And my code is

       Card

      <img src="{{ Vite::image('icons/classic.png') }}" alt`your text`="" class="ps-2" />Classic

      Compact

{{-- sorting option --}}

      Selected Filters:

        $500

         Skipper

         Clear Filters

 @if($show == 2)
                {{-- classic layout --}}
                @livewire('frontend.boat.listing.layout.classic',['product' => $product])
                @elseif($show == 1)
                {{-- card layout --}}
                @livewire('frontend.boat.listing.layout.card',['product' => $product])
                @elseif($show == 3)
                {{-- compact layout --}}
                @livewire('frontend.boat.listing.layout.compact',['product' => $product])
                @endif

<?php

namespace App\Http\Livewire\Frontend\Boat\Listing;

use App\Models\Product;
use Livewire\Component;

class Listing extends Component
{

    // Mount , boot , hydrate component

    public $filter_option_recommend = "recommended";
    public $show = "2";
    // public $filter_option = "name";

    // public $product;

    public function detail($id, $title)
    {
        return redirect()->route('website.boat.detail', [$id, $title]);
    }

    public function render()
    {
        $product = Product::join('product_time_assign', 'product_time_assign.product_id', '=', 'products.id')
            ->where([
                'products.type_id' => 1, // boat
                'products.status' => 'Active',
            ])
            ->select(
                'products.id as productid',
                'product_time_assign.id as timeassignid',
                'products.name',
                'products.capacity',
                'products.price_starts',
                'product_time_assign.skipper',
                'product_time_assign.product_time_assign_id',
                'products.review_rating',
                'products.image',
                'products.description',
                'products.discount_price'
            )
            ->orderBy($this->filter_option_recommend, 'asc')->get();
        return view('livewire.frontend.boat.listing.listing', ['product' => $product]);
    }
}


问:
Why is my Unity script not able to be loaded?
I am making a vr game and I am using UnityXR to do so. I am making a script that will have two attach points for an object (pistol). These points change based on which hand is holding the object.

Here is my code:

```<code>using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;

public class XRGrabIneractableTwoAttach : XRGrabInteractable
{
    public Transform leftAttachTransform;
    public Transform rightAttachTransform;

    protected override void OnSelectEntered(SelectEnterEventArgs args)
    {
        if(args.interactableObject.transform.CompareTag("Left Hand"))
        {
            attachTransform = leftAttachTransform;
        }
        else if(args.interactableObject.transform.CompareTag("Right Hand"))
        {
            attachTransform = rightAttachTransform;
        }

        base.OnSelectEntered(args);
    }

}
</code>```

However, when I save my code and go into Unity, it gives me this. "The associated script can not be loaded. Please fix any compile errors and assign a valid script." I have absolutely no idea how to fix this as the code looks fine to me. Can someone please help me with this?

Body:
I am making a vr game and I am using UnityXR to do so. I am making a script that will have two attach points for an object (pistol). These points change based on which hand is holding the object.

Here is my code:

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;

public class XRGrabIneractableTwoAttach : XRGrabInteractable
{
    public Transform leftAttachTransform;
    public Transform rightAttachTransform;

    protected override void OnSelectEntered(SelectEnterEventArgs args)
    {
        if(args.interactableObject.transform.CompareTag("Left Hand"))
        {
            attachTransform = leftAttachTransform;
        }
        else if(args.interactableObject.transform.CompareTag("Right Hand"))
        {
            attachTransform = rightAttachTransform;
        }

        base.OnSelectEntered(args);
    }

}

However, when I save my code and go into Unity, it gives me this. "The associated script can not be loaded. Please fix any compile errors and assign a valid script." I have absolutely no idea how to fix this as the code looks fine to me. Can someone please help me with this?


问:
Conditional count with formulas
i'm trying to count only the variable that fit the condition but the data i'm about to count is a result from formula and not inside the database
here is the code

```<code>
if (isset($_GET['tanggal'])) {
    $tgl=trim($_GET['tanggal']);
    $material=trim($_GET['material']);
    $proyek=trim($_GET['proyek']);
    $sql="SELECT *, count(ketebalan-(toleransi/10)) as mintebal FROM tb_coring, tb_coredrill WHERE tb_coring.kode_material='$material' and tb_coring.kode_proyek='$proyek' and tb_coredrill.kode_material='$material' and tb_coredrill.kode_proyek='$proyek' and tb_coring.tanggal_coring='$tgl' GROUP BY tanggal_coring";
}
$hasil=mysqli_query($db,$sql);
$no=0;
while ($data = mysqli_fetch_array($hasil)) {
    ?>
    <tr>
        <td>Jumlah Data : <?php echo $data['mintebal'];   ?></td>
    </tr>
<?php
}
</code>```

example i have 10 if i only echo mintebal but it will echo 8 data that fit the condition
or should i just add more column for the result of the formula on my database for easier count?

Title: Conditional count with formulas

Body:
i'm trying to count only the variable that fit the condition but the data i'm about to count is a result from formula and not inside the database
here is the code

if (isset($_GET['tanggal'])) {
    $tgl=trim($_GET['tanggal']);
    $material=trim($_GET['material']);
    $proyek=trim($_GET['proyek']);
    $sql="SELECT *, count(ketebalan-(toleransi/10)) as mintebal FROM tb_coring, tb_coredrill WHERE tb_coring.kode_material='$material' and tb_coring.kode_proyek='$proyek' and tb_coredrill.kode_material='$material' and tb_coredrill.kode_proyek='$proyek' and tb_coring.tanggal_coring='$tgl' GROUP BY tanggal_coring";
}
$hasil=mysqli_query($db,$sql);
$no=0;
while ($data = mysqli_fetch_array($hasil)) {
    ?>

        Jumlah Data : <?php echo $data['mintebal'];   ?>

<?php
}

example i have 10 if i only echo mintebal but it will echo 8 data that fit the condition
or should i just add more column for the result of the formula on my database for easier count?


问:
How to set up GitBash or Cygwin to use ctrl+c and ctrl+v for copying and pasting text?
If somebody found a way to configure GitBash to copy/paste text using ctrl+C/ctrl+V, please share how you achieved this.

If I use GitBash inside the IntelliJ IDEA terminal, I can use ctr+c and ctrl+v for copying and pasting text. So, I believe there is a way to configure this in the GitBash terminal itself.

I have git version 2.39.0 installed.
GitBash setting doesn't have options to use ctrl+C and ctrl+V to copy and paste.

Thanks.


问:
Flatten hierarchy from PARENT PATH in Pandas
I have a table that has ID, PARENTID, NAME, PARENTPATH columns. PARENTID references the ID column on the same table. PARENTPATH has the path to the object in the hierarchy. There are as many as 4 levels in the hierarchy. For example:

ID
NAME
PARENTID
PATH

1
FINANCE
NONE
1

2
FINANCE ADMINISTRATION
1
1 ╽ 2

3
FINANCE REGISTRATION
1
1 ╽ 3

4
SALES REGISTRATION
3
1 ╽ 3 ╽ 4

5
TAX REPORTING
4
1 ╽ 3 ╽ 4 ╽ 5

What I want is the path flattened into a table using PARENTID and PATH values, like the following:

ID
NAME
LV1
LV2
LV3
LV4

1
FINANCE
FINANCE

2
FINANCE ADMINISTRATION
FINANCE
FINANCE ADMINISTRATION

3
FINANCE REGISTRATION
FINANCE
FINANCE REGISTRATION

4
SALES REGISTRATION
FINANCE
FINANCE REGISTRATION
SALES REGISTRATION

5
TAX REPORTING
FINANCE
FINANCE REGISTRATION
SALES REGISTRATION
TAX REPORTING

Alternatively, is there a better way to deal with hierarchical data in Pandas? I intend to show a value for every hierarchical level - in this case, headcount of an organization by organizational unit, like you can easily do in Power Pivot with the help of DAX PATHITEM. The departmental data just happens to be structured this way.


问:
Converting MS Access file i.e., .mdb or .accdb file to excel using python which is placed on s3 bucket
I have a use case where I need to read .mdb or .accdb file from s3 bucket and convert it to Excel file and again upload it to s3 bucket.

I am able to find solution using the library pyodbc and then create a cusror, but in my use case I do not have the database. I have the file which is already present on s3 bucket and I need to iterate over all the tables and convert it to excel for further processing.


问:
Extract data from an multidimentional array (which contains data from a json file) and display it in a dynamic div in javascript
data1 is a const which contains the data as given below:

```<code>[
{
  "label": "Label 1",
  "content":
  [
    {
      "name": "Name 1",
      "url": "url1.pdf"
    }
  ]
}

,{
  "label": "Label 2",
  "content":
  [
    {
      "name": Name 2",
      "url": "url2.pdf"
    }
  ]
}

,{
  "label": "Label 3",
  "content":
  [
       {
      "name": "Name 3-1",
      "url": "url3-1.pdf"
    },    {
      "name": "Name3-2",
      "url": "url3-2.pdf"
    },    {
      "name": "Name3-3",
      "url": "url3-3.pdf"
    },    {
      "name": "Name3-4",
      "url": "url3-4.pdf"
    },    {
      "name": "Name3-5",
      "url": "url3-5.pdf"
    },    {
      "name": "Name3-6",
      "url": "url3-6.pdf"
    }
  ]
}
,{
  "label": "Label 4",
  "content":
  [
       {
      "name": "Name4-1",
      "url": "url4-1.pdf"
    },    {
      "name": "Name4-2",
      "url": "url4-2.pdf"
    }
  ]
}
,{
  "label": "Label 5",
  "content":
  [
       {
      "name": "Name5-1",
      "url": "url5-1.pdf"
    },    {
      "name": "Name5-2",
      "url": "url5-2.pdf"
    }
  ]
}

]

</code>```

i want to extract the data from this array and display it as in a div on my page:

Label 1
Name1 (contains the href set to the url for downloading the pdf file)
Label 2
Name2
Label 3
Name3-1
Name3-2
Name3-3
Name3-4
Name3-5
Name3-6
Label 4
Name4-1
Name4-2
Label 5
Name5-1
Name5-2

your help will be much appriciated....

```<code>const label = data1.map((jdata) => jdata.label);
const url = data1.map((jdata) => jdata.content.map((con) => con.url));
const name = data1.map((jdata) => jdata.content.map((con) => con.name));
</code>```

gives me the data i want in different arrays but how to put them in the div in the tree format?

Body:
data1 is a const which contains the data as given below:

[
{
  "label": "Label 1",
  "content":
  [
    {
      "name": "Name 1",
      "url": "url1.pdf"
    }
  ]
}

,{
  "label": "Label 2",
  "content":
  [
    {
      "name": Name 2",
      "url": "url2.pdf"
    }
  ]
}

,{
  "label": "Label 3",
  "content":
  [
       {
      "name": "Name 3-1",
      "url": "url3-1.pdf"
    },    {
      "name": "Name3-2",
      "url": "url3-2.pdf"
    },    {
      "name": "Name3-3",
      "url": "url3-3.pdf"
    },    {
      "name": "Name3-4",
      "url": "url3-4.pdf"
    },    {
      "name": "Name3-5",
      "url": "url3-5.pdf"
    },    {
      "name": "Name3-6",
      "url": "url3-6.pdf"
    }
  ]
}
,{
  "label": "Label 4",
  "content":
  [
       {
      "name": "Name4-1",
      "url": "url4-1.pdf"
    },    {
      "name": "Name4-2",
      "url": "url4-2.pdf"
    }
  ]
}
,{
  "label": "Label 5",
  "content":
  [
       {
      "name": "Name5-1",
      "url": "url5-1.pdf"
    },    {
      "name": "Name5-2",
      "url": "url5-2.pdf"
    }
  ]
}

]

i want to extract the data from this array and display it as in a div on my page:

Label 1
Name1 (contains the href set to the url for downloading the pdf file)
Label 2
Name2
Label 3
Name3-1
Name3-2
Name3-3
Name3-4
Name3-5
Name3-6
Label 4
Name4-1
Name4-2
Label 5
Name5-1
Name5-2

your help will be much appriciated....

const label = data1.map((jdata) => jdata.label);
const url = data1.map((jdata) => jdata.content.map((con) => con.url));
const name = data1.map((jdata) => jdata.content.map((con) => con.name));

gives me the data i want in different arrays but how to put them in the div in the tree format?


问:
What is the http status code for BadRequestKeyError
I recently used postman to test a website and it returns BadRequestKeyError with http status code 500 but its return webpage's title shows

```<code><title>werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this
        server could not understand.
        KeyError: 'user'
        // Werkzeug Debugger</title>
</code>```

SO Is it a 5xx error or 4xx error

Body:
I recently used postman to test a website and it returns BadRequestKeyError with http status code 500 but its return webpage's title shows

<title>werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this
        server could not understand.
        KeyError: 'user'
        // Werkzeug Debugger</title>

SO Is it a 5xx error or 4xx error


问:
MAUI Entry on windows doesn't bring up virtual keyboard when clicked
As the title said, MAUI (6.0, maui7 not tested yet) programs on windows 10, when a Entry is clicked, the windows virtual keyboard is not bring up. The keyboard does bring up when I click on Edge's address bar, or search bar on the computer. Any way to fix this?

Environment:
MAUI 6.0.548.0
VS : 17.4.3
Win: 10.0.19044.2364


问:
Show all Tab - jQuery
I saw another post on using a specific jQuery UI tab to open all tab content at once. This is more or less a "show all" tab. It doesn't seem to be working for me. In any event, my page structure looks like this:

```<code><div class="container" id="tabs">
        <ul class="tab-navigation">
            <li><a href="#tabsAll" class="nav-tabs" id="showAll" data-toggle="tabs-all"></a>All</li>
            <li><a href="#tab1" class="nav-tabs" data-toggle="tab-1"></a>Title</li>
            <li><a href="#tab2" class="nav-tabs" data-toggle="tab-2"></a>CONTENT</li>
            <li><a href="#tab3" class="nav-tabs" data-toggle="tab-3"></a>Author</li>
        </ul>
    </div>
</code>```
```<code><div class="tab-area">
        <!-- <div class="tab-all"> -->
            <div class="tab-content">
                <!-- ================================= TITLE 1 ================================= -->
                <div class="accordion-item active border-0">
                    <div class="accordion-header">
                        <h3>Title 1</h3>
                        <i class="arrow fa-solid fa-chevron-down"></i>
                    </div>
                    <div class="accordion-body">
                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium quam perspiciatis doloribus nostrum facere pariatur, beatae fugit totam. Distinctio praesentium nesciunt, veritatis corporis aperiam facilis iste aliquid nostrum cupiditate nisi.
                    </div>
                </div>
                <!-- ================================= TITLE 2 ================================= -->
                <div class="accordion-item border-0">
                    <div class="accordion-header">
                        <h3>Title 2</h3>
                        <i class="arrow fa-solid fa-chevron-down"></i>
                    </div>
                    <div class="accordion-body">
                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium quam perspiciatis doloribus nostrum facere pariatur, beatae fugit totam. Distinctio praesentium nesciunt, veritatis corporis aperiam facilis iste aliquid nostrum cupiditate nisi.
                    </div>
                </div>
                <!-- ================================= TITLE 3 ================================= -->
                <div class="accordion-item border-0">
                    <div class="accordion-header">
                        <h3>Title 3</h3>
                        <i class="arrow fa-solid fa-chevron-down"></i>
                    </div>
                    <div class="accordion-body">
                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium quam perspiciatis doloribus nostrum facere pariatur, beatae fugit totam. Distinctio praesentium nesciunt, veritatis corporis aperiam facilis iste aliquid nostrum cupiditate nisi.
                    </div>
                </div>
                <!-- ================================= TITLE 4 ================================= -->
                <div class="accordion-item border-0">
                    <div class="accordion-header">
                        <h3>Title 4</h3>
                        <i class="arrow fa-solid fa-chevron-down"></i>
                    </div>
                    <div class="accordion-body">
                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium quam perspiciatis doloribus nostrum facere pariatur, beatae fugit totam. Distinctio praesentium nesciunt, veritatis corporis aperiam facilis iste aliquid nostrum cupiditate nisi.
                    </div>
                </div>
            </div>

                <!-- ================================= Nội dung ================================= -->
            <section id="section-content" class="border-box custom-padding custom-margin tab-content">
                <div class="main-title">
                    <h3>CONTENT</h3>
                    <div>
                        <p><strong>Frontend master</strong> Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur, deleniti aliquid? Rerum excepturi quod cupiditate quam magnam necessitatibus dignissimos culpa ab ex nesciunt repellat, perspiciatis iure cum tempora vero perferendis?</p>

                        <p><strong>PHP master</strong> Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur, deleniti aliquid? Rerum excepturi quod cupiditate quam magnam necessitatibus dignissimos culpa ab ex nesciunt repellat, perspiciatis iure cum tempora vero perferendis?</p>

                        <p><strong>ReactJs</strong> Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur, deleniti aliquid? Rerum excepturi quod cupiditate quam magnam necessitatibus dignissimos culpa ab ex nesciunt repellat, perspiciatis iure cum tempora vero perferendis?</p>
                    </div>
                </div>
            </section>

                <!-- ================================= Author ================================= -->
                <section id="section-author" class="border-box custom-padding tab-content">
                    <!-- title author -->
                    <div class="main-title text-center">
                        <h3>Author</h3>
                    </div>

                    <div class="row">
                        <!-- image author -->
                        <div class="col-md-4">
                            <img src="image/98218734847f74c4ddf64351a91d7dfc_8818027215482943090.png" alt="avatar">
                        </div>
                    <!-- info author -->
                        <div class="col-md-8 author-info">
                            <h3 class="mt-3 mt-md-0">Lê Thanh Lợi</h3>
                            <h4 class="font-weight-bold mt-3">Kinh nghiệm</h4>
                            <ul>
                                <li>Chưa có kinh nghiệm</li>
                                <li>Từng học khoá <strong>Frontend master</strong> online tại ZendVn</li>
                                <li>Công việc hiện nay: báo thủ !!!</li>
                            </ul>
                            <h4 class="font-weight-bold mt-3">Thông tin liên hệ</h4>
                            <ul>
                                <li>
                                    Facebook:
                                    <a href="https://www.facebook.com">https://www.facebook.com</a>
                                </li>
                                <li>
                                    Youtube:
                                    <a href="https://www.youtube.com/">https://www.youtube.com/</a>
                                </li>
                                <li>
                                    Phone:
                                    <a href="tel:0123 456 789">0123 456 789</a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </section>
        <!-- </div> -->
    </div>
</code>```

This is the JavaScript that I have used, based on a previous example:

```<code>
$(document).ready(function(){
    $(".tab-navigation li:first").addClass("active"); // active tab đã chọn
    $(".tab-content").show();

    $(".accordion-item.active .accordion-body").slideDown(); // show xuống tab accordion

    /* ================================= LOCALSTORAGE TAB Horizontal  ================================= */
    if (localStorage.selectedTab) {
        var tab = localStorage.selectedTab;
        $(".tab-navigation li").removeClass("active");
        $(".nav-tabs:eq(" + (localStorage.selectedTab - 1) + ")").click().parent('li').addClass("active");
        console.log(tab);
    }

    /* ==================================== TAB Horizontal (ngang) ==================================== */
    $(".tab-navigation li").click(function(){
        var index = $(this).index();    // thứ tự Tab
        // console.log(index);
        if(index == 0) {
            $(".tab-content").show();
        } else {
            $(".tab-content").eq(index).show();
        }

        $(".tab-navigation li").removeClass("active");  // 1.xoá tab đã chọn trước đó

        $(this).addClass("active"); // 2.active tab hiện tại đã click

        $(".tab-content").hide();   // 3.ẩn tab content

        $(".tab-content").eq(index).show(); // 4.show ra thứ tự tab content đã chọn

        localStorage.selectedTab = $(this).index() + 1;
    })

    /* ====================================== TAB Vertical (dọc) ====================================== */
    $(".accordion-header").click(function(){
        $(this).parent().toggleClass('active');
        $(this).parent().children('.accordion-body').slideToggle();
    })

})
</code>```

The "show all tab" doesn't work at all , what should I do?

Title: Show all Tab - jQuery

Body:
I saw another post on using a specific jQuery UI tab to open all tab content at once. This is more or less a "show all" tab. It doesn't seem to be working for me. In any event, my page structure looks like this:

All

Title

CONTENT

Author

Title 1

                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium quam perspiciatis doloribus nostrum facere pariatur, beatae fugit totam. Distinctio praesentium nesciunt, veritatis corporis aperiam facilis iste aliquid nostrum cupiditate nisi.

Title 2

                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium quam perspiciatis doloribus nostrum facere pariatur, beatae fugit totam. Distinctio praesentium nesciunt, veritatis corporis aperiam facilis iste aliquid nostrum cupiditate nisi.

Title 3

                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium quam perspiciatis doloribus nostrum facere pariatur, beatae fugit totam. Distinctio praesentium nesciunt, veritatis corporis aperiam facilis iste aliquid nostrum cupiditate nisi.

Title 4

                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium quam perspiciatis doloribus nostrum facere pariatur, beatae fugit totam. Distinctio praesentium nesciunt, veritatis corporis aperiam facilis iste aliquid nostrum cupiditate nisi.

CONTENT

Frontend master Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur, deleniti aliquid? Rerum excepturi quod cupiditate quam magnam necessitatibus dignissimos culpa ab ex nesciunt repellat, perspiciatis iure cum tempora vero perferendis?

PHP master Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur, deleniti aliquid? Rerum excepturi quod cupiditate quam magnam necessitatibus dignissimos culpa ab ex nesciunt repellat, perspiciatis iure cum tempora vero perferendis?

ReactJs Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur, deleniti aliquid? Rerum excepturi quod cupiditate quam magnam necessitatibus dignissimos culpa ab ex nesciunt repellat, perspiciatis iure cum tempora vero perferendis?

Author

Lê Thanh Lợi

Kinh nghiệm

Chưa có kinh nghiệm

Từng học khoá Frontend master online tại ZendVn

Công việc hiện nay: báo thủ !!!

Thông tin liên hệ

                                    Facebook:
                                    https://www.facebook.com

                                    Youtube:
                                    https://www.youtube.com/

                                    Phone:
                                    0123 456 789

This is the JavaScript that I have used, based on a previous example:

$(document).ready(function(){
    $(".tab-navigation li:first").addClass("active"); // active tab đã chọn
    $(".tab-content").show();

    $(".accordion-item.active .accordion-body").slideDown(); // show xuống tab accordion

    /* ================================= LOCALSTORAGE TAB Horizontal  ================================= */
    if (localStorage.selectedTab) {
        var tab = localStorage.selectedTab;
        $(".tab-navigation li").removeClass("active");
        $(".nav-tabs:eq(" + (localStorage.selectedTab - 1) + ")").click().parent('li').addClass("active");
        console.log(tab);
    }

    /* ==================================== TAB Horizontal (ngang) ==================================== */
    $(".tab-navigation li").click(function(){
        var index = $(this).index();    // thứ tự Tab
        // console.log(index);
        if(index == 0) {
            $(".tab-content").show();
        } else {
            $(".tab-content").eq(index).show();
        }

        $(".tab-navigation li").removeClass("active");  // 1.xoá tab đã chọn trước đó

        $(this).addClass("active"); // 2.active tab hiện tại đã click

        $(".tab-content").hide();   // 3.ẩn tab content

        $(".tab-content").eq(index).show(); // 4.show ra thứ tự tab content đã chọn

        localStorage.selectedTab = $(this).index() + 1;
    })

    /* ====================================== TAB Vertical (dọc) ====================================== */
    $(".accordion-header").click(function(){
        $(this).parent().toggleClass('active');
        $(this).parent().children('.accordion-body').slideToggle();
    })

})

The "show all tab" doesn't work at all , what should I do?


问:
What is the DataView class in ASP.NET?
Can anyone tell me the what DataView class is in ASP.NET? I don't know where or how to use it.

I know about all the objects: Dataset ,DataProvider, Connection, Command, etc., but I don't know anything about the DataView class.

Title: What is the DataView class in ASP.NET?


问:
How can I get the input of an AWS Step function after a parallel branch
I'm running a Step function that immediately starts with parallel branches. Once the branches are done, I have an "Finish" function that marks the process as done (update on dynamodb).

The problem is I don't know how to get the original input I sent to the step function when I created it.

Here's how the function looks :

```<code>{
  "StartAt": "Parallel",
  "States": {
    "Parallel": {
      "Type": "Parallel",
      "Branches": [
        {
          "StartAt": "BCE",
          "States": {
            "BCE": {
              "Type": "Task",
              "Resource": "${BCE.Arn}",
              "Next": "Map"
            },
            "Map": {
              "Type": "Map",
              "ToleratedFailurePercentage": 50,
              "ItemProcessor": {
                "ProcessorConfig": {
                  "Mode": "DISTRIBUTED",
                  "ExecutionType": "EXPRESS"
                },
                "StartAt": "CRE",
                "States": {
                  "CRE": {
                    "Type": "Task",
                    "Resource":  "${CRE.Arn}",
                    "Parameters": {
                      "Payload.$": "$"
                    },
                    "End": true,
                    "TimeoutSeconds": 600
                  }
                }
              },
              "Label": "Map",
              "ItemsPath": "$.channels",
              "End": true
            }
          }
        },
        {
          "StartAt": "D3",
          "States": {
            "D3": {
              "Type": "Task",
              "Resource": "${D3.Arn}",
              "Next": "MapAssociated"
            },
            "MapAssociated": {
              "Type": "Map",
              "ToleratedFailurePercentage": 50,
              "ItemProcessor": {
                "ProcessorConfig": {
                  "Mode": "DISTRIBUTED",
                  "ExecutionType": "EXPRESS"
                },
                "StartAt": "D1",
                "States": {
                  "D1": {
                    "Type": "Task",
                    "Resource": "${D1.Arn}",
                    "Parameters": {
                      "Payload.$": "$"
                    },
                    "End": true,
                    "TimeoutSeconds": 600
                  }
                }
              },
              "End": true,
              "Label": "MapAssociated",
              "ItemsPath": "$.associated"
            }
          }
        }
      ],
      "Next": "Finish"
    },
    "Finish": {
      "Type": "Task",
      "Resource": "${FinishProcess.Arn}",
      "End": true
    }
  }
}
</code>```

And here's how I'm creating the step function :

```<code>stepfunctions.start_execution(
                stateMachineArn=stepFunctionARN,
                name=test + '-' + str(uuid.uuid1()),
                input=json.dumps({
                    'itemId': item['itemId'],
                    'TimeToLive': ttl
                })
            )
</code>```

Basically what I need is the itemId element so I can update it after. Any idea how to pass that through ?

Thanks

Body:
I'm running a Step function that immediately starts with parallel branches. Once the branches are done, I have an "Finish" function that marks the process as done (update on dynamodb).

The problem is I don't know how to get the original input I sent to the step function when I created it.

Here's how the function looks :

{
  "StartAt": "Parallel",
  "States": {
    "Parallel": {
      "Type": "Parallel",
      "Branches": [
        {
          "StartAt": "BCE",
          "States": {
            "BCE": {
              "Type": "Task",
              "Resource": "${BCE.Arn}",
              "Next": "Map"
            },
            "Map": {
              "Type": "Map",
              "ToleratedFailurePercentage": 50,
              "ItemProcessor": {
                "ProcessorConfig": {
                  "Mode": "DISTRIBUTED",
                  "ExecutionType": "EXPRESS"
                },
                "StartAt": "CRE",
                "States": {
                  "CRE": {
                    "Type": "Task",
                    "Resource":  "${CRE.Arn}",
                    "Parameters": {
                      "Payload.$": "$"
                    },
                    "End": true,
                    "TimeoutSeconds": 600
                  }
                }
              },
              "Label": "Map",
              "ItemsPath": "$.channels",
              "End": true
            }
          }
        },
        {
          "StartAt": "D3",
          "States": {
            "D3": {
              "Type": "Task",
              "Resource": "${D3.Arn}",
              "Next": "MapAssociated"
            },
            "MapAssociated": {
              "Type": "Map",
              "ToleratedFailurePercentage": 50,
              "ItemProcessor": {
                "ProcessorConfig": {
                  "Mode": "DISTRIBUTED",
                  "ExecutionType": "EXPRESS"
                },
                "StartAt": "D1",
                "States": {
                  "D1": {
                    "Type": "Task",
                    "Resource": "${D1.Arn}",
                    "Parameters": {
                      "Payload.$": "$"
                    },
                    "End": true,
                    "TimeoutSeconds": 600
                  }
                }
              },
              "End": true,
              "Label": "MapAssociated",
              "ItemsPath": "$.associated"
            }
          }
        }
      ],
      "Next": "Finish"
    },
    "Finish": {
      "Type": "Task",
      "Resource": "${FinishProcess.Arn}",
      "End": true
    }
  }
}

And here's how I'm creating the step function :

stepfunctions.start_execution(
                stateMachineArn=stepFunctionARN,
                name=test + '-' + str(uuid.uuid1()),
                input=json.dumps({
                    'itemId': item['itemId'],
                    'TimeToLive': ttl
                })
            )

Basically what I need is the itemId element so I can update it after. Any idea how to pass that through ?

Thanks


问:
Docker CPU Limiting Ubuntu 20.04
I have been trying to get CPU limiting working with docker for the last couple days without any luck. I have verified that everything is enabled and RT scheduling is enabled, I rebuilt the kernel with the right options per dockers documentation and it still gives me the same message: Your kernel does not support CPU real-time scheduler but thats not true. I even check with the command they give and it is enabled.

```<code>trever@server:~$ zcat /proc/config.gz | grep CONFIG_RT_GROUP_SCHED
CONFIG_RT_GROUP_SCHED=y
</code>```

The docker daemon is getting started with --cpu-rt-runtime=950000 per the documentation but thats not working. I have even gone as far as to make the container privileged but nothing seems to work.

I am now seeing errors:

```<code>ERRO[2022-12-27T00:21:54.800071597-08:00] failed to start container                     container=7fd585b9b5235766d22baf2b10215d9931b3f3853fec757493b9dbe3826b6b22 error="daemon-scoped cpu-rt-period and cpu-rt-runtime are not supported by the kernel"
</code>```

The docker daemon says:

```<code>WARN[2022-12-27T00:21:53.196483731-08:00] Your kernel does not support swap memory limit
WARN[2022-12-27T00:21:53.196508221-08:00] Your kernel does not support memory reservation
WARN[2022-12-27T00:21:53.196512701-08:00] Your kernel does not support oom control
WARN[2022-12-27T00:21:53.196516271-08:00] Your kernel does not support memory swappiness
WARN[2022-12-27T00:21:53.196519651-08:00] Your kernel does not support kernel memory limit
WARN[2022-12-27T00:21:53.196523291-08:00] Your kernel does not support kernel memory TCP limit
WARN[2022-12-27T00:21:53.196526941-08:00] Your kernel does not support CPU shares
WARN[2022-12-27T00:21:53.196530221-08:00] Your kernel does not support CPU CFS scheduler
WARN[2022-12-27T00:21:53.196534401-08:00] Your kernel does not support CPU realtime scheduler
WARN[2022-12-27T00:21:53.196537831-08:00] Your kernel does not support cgroup blkio weight
WARN[2022-12-27T00:21:53.196542211-08:00] Your kernel does not support cgroup blkio weight_device
WARN[2022-12-27T00:21:53.196545521-08:00] Your kernel does not support cgroup blkio throttle.read_bps_device
WARN[2022-12-27T00:21:53.196549191-08:00] Your kernel does not support cgroup blkio throttle.write_bps_device
WARN[2022-12-27T00:21:53.196553101-08:00] Your kernel does not support cgroup blkio throttle.read_iops_device
WARN[2022-12-27T00:21:53.196556951-08:00] Your kernel does not support cgroup blkio throttle.write_iops_device
</code>```

But the system says it does.

Any idea what I am missing here?

Title: Docker CPU Limiting Ubuntu 20.04

Body:
I have been trying to get CPU limiting working with docker for the last couple days without any luck. I have verified that everything is enabled and RT scheduling is enabled, I rebuilt the kernel with the right options per dockers documentation and it still gives me the same message: Your kernel does not support CPU real-time scheduler but thats not true. I even check with the command they give and it is enabled.

trever@server:~$ zcat /proc/config.gz | grep CONFIG_RT_GROUP_SCHED
CONFIG_RT_GROUP_SCHED=y

The docker daemon is getting started with --cpu-rt-runtime=950000 per the documentation but thats not working. I have even gone as far as to make the container privileged but nothing seems to work.

I am now seeing errors:

ERRO[2022-12-27T00:21:54.800071597-08:00] failed to start container                     container=7fd585b9b5235766d22baf2b10215d9931b3f3853fec757493b9dbe3826b6b22 error="daemon-scoped cpu-rt-period and cpu-rt-runtime are not supported by the kernel"

The docker daemon says:

WARN[2022-12-27T00:21:53.196483731-08:00] Your kernel does not support swap memory limit
WARN[2022-12-27T00:21:53.196508221-08:00] Your kernel does not support memory reservation
WARN[2022-12-27T00:21:53.196512701-08:00] Your kernel does not support oom control
WARN[2022-12-27T00:21:53.196516271-08:00] Your kernel does not support memory swappiness
WARN[2022-12-27T00:21:53.196519651-08:00] Your kernel does not support kernel memory limit
WARN[2022-12-27T00:21:53.196523291-08:00] Your kernel does not support kernel memory TCP limit
WARN[2022-12-27T00:21:53.196526941-08:00] Your kernel does not support CPU shares
WARN[2022-12-27T00:21:53.196530221-08:00] Your kernel does not support CPU CFS scheduler
WARN[2022-12-27T00:21:53.196534401-08:00] Your kernel does not support CPU realtime scheduler
WARN[2022-12-27T00:21:53.196537831-08:00] Your kernel does not support cgroup blkio weight
WARN[2022-12-27T00:21:53.196542211-08:00] Your kernel does not support cgroup blkio weight_device
WARN[2022-12-27T00:21:53.196545521-08:00] Your kernel does not support cgroup blkio throttle.read_bps_device
WARN[2022-12-27T00:21:53.196549191-08:00] Your kernel does not support cgroup blkio throttle.write_bps_device
WARN[2022-12-27T00:21:53.196553101-08:00] Your kernel does not support cgroup blkio throttle.read_iops_device
WARN[2022-12-27T00:21:53.196556951-08:00] Your kernel does not support cgroup blkio throttle.write_iops_device

But the system says it does.

Any idea what I am missing here?


问:
when i m passing multiple image to API i found error like Bad state: Too many elements
```<code>  final body = FormData.fromMap({
    'dispute_id': id,
    'comment': comment,
    'attachments':  MultipartFile.fromFile(
        '$files',
        filename: basename('$files')),
  });

</code>```

I am trying Boc pattern for It and I expecting a solution of this error

Body:
  final body = FormData.fromMap({
    'dispute_id': id,
    'comment': comment,
    'attachments':  MultipartFile.fromFile(
        '$files',
        filename: basename('$files')),
  });

I am trying Boc pattern for It and I expecting a solution of this error


问:
I am trying to make a simple messaging bot with OpenAI API in NodeJS but I am getting 400 status code error as JSON
I can't find where I went wrong.

Please help me?

Thanks in advance :)

Code:

// require libraries
require("dotenv").config();
const readline = require("readline");

const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);

// Chat bot's message to OpenAI API
async function sendMessage(message, context) {
  // Set request parameters
  const params = {
    model: "davinci",
    prompt: message,
    temperature: 0.5,
    max_tokens: 2048,
    top_p: 1,
    frequency_penalty: 0,
    presence_penalty: 0,
  };

  // If context is specified, add it to the request parameters
  if (context) {
    params.n = 1;
    params.stop = "\n";
    params.presence_penalty = 0;
    params.best_of = 1;
    params.stream = false;
    params.stop = null;
    params.max_tokens = null;
    params.temperature = [0.5];
    params.top_p = [1];
    params.frequency_penalty = [0];
    params.presence_penalty = [0];
    params.context = context;
  }

  // Send request and get response
  const response = await openai.createCompletion(params);
  return response.choices[0].text;
}

// Chat bot's message handler
async function handleMessage(message, context) {
  // Send message to OpenAI API and get response
  const response = await sendMessage(message, context);

  // Display response to user
  console.log(response);

  // Get user's response and update current context
  const newContext = {
    previous_messages: [
      {
        message: message,
        sender: "user",
      },
      {
        message: response,
        sender: "bot",
      },
    ],
  };

  // Get user's response and handle it
  const userResponse = await getUserResponse();
  handleMessage(userResponse, newContext);
}

// Get user's response
async function getUserResponse() {
  return new Promise((resolve) => {
    const rl = readline.createInterface({
      input: process.stdin,
      output: process.stdout,
    });

    rl.question("User: ", (input) => {
      rl.close();
      resolve(input);
    });
  });
}

// Chat bot's main function
async function main() {
  console.log("Chat bot starting...");

  // Get user's response and handle it
  const userResponse = await getUserResponse();
  handleMessage(userResponse);
}

main();
```
<p><strong>Part of the error code:</strong></p>
<pre class="lang-json prettyprint-override"><code>response: {
    status: 400,
    statusText: 'Bad Request',
    headers: {
.
.
.
isAxiosError: true,
  toJSON: [Function: toJSON]
}
</code>```

Node.js v18.12.1
[nodemon] app crashed - waiting for file changes before starting...

What I am trying to do with this code:

This code uses the OpenAI API to create a chatbot that can converse with a user. The chatbot sends a message to the OpenAI API, and the API responds with a message generated by the "davinci" model. The chatbot then displays the response to the user and waits for the user to respond. It handles the user's response by sending it to the OpenAI API and displaying the API's response. The chatbot uses the readline module to read the user's response from the command line.

The chatbot's message handling function, handleMessage, takes in a message and an optional context. The context is a record of previous messages in the conversation, which the chatbot can use to generate more contextually relevant responses. If a context is specified, the handleMessage function adds it to the request parameters when it sends the message to the OpenAI API.

The chatbot's main function, main, starts by displaying a message to the user and waiting for their response. It then calls handleMessage to send the user's response to the OpenAI API and handle the API's response. This process continues indefinitely, until the user or the chatbot ends the conversation.

Body:
I can't find where I went wrong.

Please help me?

Thanks in advance :)

Code:

// require libraries
require("dotenv").config();
const readline = require("readline");

const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);

// Chat bot's message to OpenAI API
async function sendMessage(message, context) {
  // Set request parameters
  const params = {
    model: "davinci",
    prompt: message,
    temperature: 0.5,
    max_tokens: 2048,
    top_p: 1,
    frequency_penalty: 0,
    presence_penalty: 0,
  };

  // If context is specified, add it to the request parameters
  if (context) {
    params.n = 1;
    params.stop = "\n";
    params.presence_penalty = 0;
    params.best_of = 1;
    params.stream = false;
    params.stop = null;
    params.max_tokens = null;
    params.temperature = [0.5];
    params.top_p = [1];
    params.frequency_penalty = [0];
    params.presence_penalty = [0];
    params.context = context;
  }

  // Send request and get response
  const response = await openai.createCompletion(params);
  return response.choices[0].text;
}

// Chat bot's message handler
async function handleMessage(message, context) {
  // Send message to OpenAI API and get response
  const response = await sendMessage(message, context);

  // Display response to user
  console.log(response);

  // Get user's response and update current context
  const newContext = {
    previous_messages: [
      {
        message: message,
        sender: "user",
      },
      {
        message: response,
        sender: "bot",
      },
    ],
  };

  // Get user's response and handle it
  const userResponse = await getUserResponse();
  handleMessage(userResponse, newContext);
}

// Get user's response
async function getUserResponse() {
  return new Promise((resolve) => {
    const rl = readline.createInterface({
      input: process.stdin,
      output: process.stdout,
    });

    rl.question("User: ", (input) => {
      rl.close();
      resolve(input);
    });
  });
}

// Chat bot's main function
async function main() {
  console.log("Chat bot starting...");

  // Get user's response and handle it
  const userResponse = await getUserResponse();
  handleMessage(userResponse);
}

main();

Part of the error code:

response: {
    status: 400,
    statusText: 'Bad Request',
    headers: {
.
.
.
isAxiosError: true,
  toJSON: [Function: toJSON]
}

Node.js v18.12.1
[nodemon] app crashed - waiting for file changes before starting...

What I am trying to do with this code:

This code uses the OpenAI API to create a chatbot that can converse with a user. The chatbot sends a message to the OpenAI API, and the API responds with a message generated by the "davinci" model. The chatbot then displays the response to the user and waits for the user to respond. It handles the user's response by sending it to the OpenAI API and displaying the API's response. The chatbot uses the readline module to read the user's response from the command line.

The chatbot's message handling function, handleMessage, takes in a message and an optional context. The context is a record of previous messages in the conversation, which the chatbot can use to generate more contextually relevant responses. If a context is specified, the handleMessage function adds it to the request parameters when it sends the message to the OpenAI API.

The chatbot's main function, main, starts by displaying a message to the user and waiting for their response. It then calls handleMessage to send the user's response to the OpenAI API and handle the API's response. This process continues indefinitely, until the user or the chatbot ends the conversation.


问:
Flutter: add Divider to Wrap
I would like to add Divider to a wrap depending if a child is in a new line (i.e. new run) or not.

In the large screen (on the left) the Availability widget fits in the wrap horizontally, so I want to add a VerticalDivider. While on the right it doesn't fit, so it goes vertically and I want to add a Divider.

I don't know which condition to write since I don't know how to check if Availability widget is a new line or not.

Title: Flutter: add Divider to Wrap


问:
Coldfusion record listing with multiple inputs

Detail: The value isim cannot be converted to a number.
The error occurred on line 11.

I got this error

```<code><cfform id="sef" action="#request.self#?fuseaction=#module_name#.emptypopup_add_sef" method="post">
  <div data-repeater-list="">
      <div data-repeater-item="">
            <cfoutput>
               <input name="isim" type="text">
               <input name="soyisim" type="text">
             </tr>
            </cfoutput>
          <hr>
      </div>
  </div>
</cfform>

<cfloop collection="#attributes#" item="key">
    <cfset sef = ToString(attributes[key]["isim"])>
    <cfoutput>#sef#</cfoutput>
</cfloop>
</code>```

Body:
Detail: The value isim cannot be converted to a number.
The error occurred on line 11.

I got this error

<cfform id="sef" action="#request.self#?fuseaction=#module_name#.emptypopup_add_sef" method="post">

            <cfoutput>
               <input name="isim" type="text">
               <input name="soyisim" type="text">

            </cfoutput>

</cfform>

<cfloop collection="#attributes#" item="key">
    <cfset sef = ToString(attributes[key]["isim"])>
    <cfoutput>#sef#</cfoutput>
</cfloop>


问:
Tailwind navbar buttons don't work anytime the screen size gets smaller
I'm having trouble with the buttons not working at any smaller screen size. This has been an issue in multiple navbars I've tried so I'm quite confused.

Below is my navbar code, it should work and it does at xl screensize but not at anything less.

```<code>import React, { useContext } from 'react';
import {
  Navbar,
  Link,
  Text,
  Avatar,
  Dropdown,
  useTheme,
  createTheme,
  NextUIProvider,
  Button,
} from ' @nextui-org/react';
import { Box } from '@mui/system';
import { Layout } from './NavbarHelpers/Layout.js';
import NavBar from '../NavBar/NavBar';
import NonHomeNav from '../NavBar/NonHomeNav';
import { ReactSession } from 'react-client-session';
import { AuthContext } from '../../services/auth.context.js';
import { Fragment } from 'react';
import { Disclosure, Menu, Transition } from '@headlessui/react';
import { Bars3Icon, BellIcon, XMarkIcon } from '@heroicons/react/24/outline';
import SendIcon from '@mui/icons-material/Send';

import './Header.css';
import { Typography } from '@mui/material';

const countrySectionStyle = {
  width: '100%',
  height: '125px',
  // backgroundImage: `url(${process.env.PUBLIC_URL}/images/Mountin.jpg)`
};

const sectionStyle = {
  width: '100%',
  height: '400px',
  backgroundImage: `url(${process.env.PUBLIC_URL}/images/Mountin.jpg)`,
};

const Header = () => {
  return (
    <>
      <div class='w-full bg-center bg-cover h-[32rem]' style={sectionStyle}>
        <NavBar />
        {/* <div class="flex items-center justify-center w-full h-full"> */}
        <section class=' flex flex-1 justify-center '>
          <div class=' flex flex-col w-auto items-center '>
            <h1 class='header-text text-5xl font-extrabold text-center lg:text-7xl 2xl:text-8xl '>
              <span class='text-transparent bg-gradient-to-br bg-clip-text  from-blue-500 via-pink-500 to-red-500 dark:from-teal-200 dark:via-indigo-300 dark:to-sky-500 '>
                Your World
              </span>
            </h1>

            <h1 class='text-5xl font-extrabold text-center lg:text-7xl 2xl:text-8xl'>
              <span class='text-transparent bg-gradient-to-tr bg-clip-text from-blue-500 via-pink-500 to-red-500 dark:from-sky-300 dark:via-pink-300 dark:to-red-500'>
                Guide
              </span>
            </h1>
          </div>
        </section>
        {/* </div> */}
      </div>
    </>
  );
};

const navigation = [
  // { name: 'Home', href: '/', current: true },
];

function classNames(...classes) {
  return classes.filter(Boolean).join(' ');
}

export const CountryHeader = () => {
  const { isAuthenticated, onLogout } = useContext(AuthContext);

  // const user = JSON.parse(ReactSession.get('userId'))
  //   console.log(user)

  // const username = user.visibleUsername

  return (
    <Disclosure as='nav' style={{ minHeight: '11vh', background: '#826644' }}>
      {({ open }) => (
        <>
          <div className='mx-auto max-w-7xl px-2 sm:px-6 lg:px-8'>
            <div className='relative flex h-16 items-center justify-between'>
              <div className='absolute inset-y-0 left-0 flex items-center sm:hidden'>
                {/* <img
                  className="block h-8 w-auto lg:hidden"
                  src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80"
                  alt="Your Company"
                /> */}
                <SendIcon className='h-6 w-6 text-white' />
                <Link href='/'>
                  <strong className='text-xl text-white font-bold'>
                    Geopilot
                  </strong>
                </Link>
                {/* Mobile menu button*/}
                <Disclosure.Button className='inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white'>
                  <span className='sr-only'>Open main menu</span>
                  {open ? (
                    <XMarkIcon className='block h-6 w-6' aria-hidden='true' />
                  ) : (
                    <Bars3Icon className='block h-6 w-6' aria-hidden='true' />
                  )}
                </Disclosure.Button>
              </div>

              {/* <div className="flex ml-96 sm:items-stretch sm:justify-start ">   */}
              <Box marginLeft='34.5em'>
                <div className='hidden sm:ml-6 sm:block'>
                  <div className='flex space-x-4'>
                    {navigation.map((item) => (
                      <Box
                        key={item.name}
                        href={item.href}
                        className={classNames(
                          item.current
                            ? 'bg-gray-900 text-white'
                            : 'text-gray-300 hover:bg-gray-700 hover:text-white',
                          'px-3 py-2 rounded-md text-sm font-medium'
                        )}
                        aria-current={item.current ? 'page' : undefined}
                      >
                        {item.name}
                      </Box>
                    ))}
                  </div>
                </div>
              </Box>
              {/* </div> */}
              <div className='absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0'>
                <button
                  type='button'
                  className='rounded-full bg-gray-800 p-1 text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800'
                >
                  <span className='sr-only'>View notifications</span>
                  <BellIcon className='h-6 w-6' aria-hidden='true' />
                </button>

                {/* Profile dropdown */}

                {!isAuthenticated ? (
                  <>
                    <Link
                      to='/login'
                      className='hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium'
                    >
                      <Typography color={'white'} fontSize={'14px'}>
                        Login
                      </Typography>
                    </Link>
                    <Link
                      to='/register'
                      className='text-gray-100 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium'
                    >
                      <Typography color={'white'} fontSize={'14px'}>
                        Sign Up
                      </Typography>
                    </Link>
                  </>
                ) : (
                  <Menu as='div' className='relative ml-3'>
                    <div>
                      <Menu.Button className='flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800'>
                        <span className='sr-only'>Open user menu</span>
                        <img
                          className='h-8 w-8 rounded-full'
                          src={`https://avatars.dicebear.com/api/initials/.svg`}
                          alt='User profile picture'
                        />
                      </Menu.Button>
                    </div>
                    <Transition
                      as={Fragment}
                      enter='transition ease-out duration-100'
                      enterFrom='transform opacity-0 scale-95'
                      enterTo='transform opacity-100 scale-100'
                      leave='transition ease-in duration-75'
                      leaveFrom='transform opacity-100 scale-100'
                      leaveTo='transform opacity-0 scale-95'
                    >
                      <Menu.Items className='absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none'>
                        {/* <Menu.Item>
                      {({ active }) => (
                        <a
                          href="#"
                          className={classNames(active ? 'bg-gray-100' : '', 'block px-4 py-2 text-sm text-gray-700')}
                        >
                          Your Profile
                        </a>
                      )}
                    </Menu.Item>
                    <Menu.Item>
                      {({ active }) => (
                        <a
                          href="#"
                          className={classNames(active ? 'bg-gray-100' : '', 'block px-4 py-2 text-sm text-gray-700')}
                        >
                          Settings
                        </a>
                      )}
                    </Menu.Item> */}
                        <Menu.Item>
                          {({ active }) => (
                            <button
                              onPress={onLogout()}
                              className={classNames(
                                active ? 'bg-grey-100' : '',
                                'block px-4 py-2 text-sm text-gray-700'
                              )}
                            >
                              Sign out
                            </button>
                          )}
                        </Menu.Item>
                      </Menu.Items>
                    </Transition>
                  </Menu>
                )}
              </div>
            </div>
          </div>

          <Disclosure.Panel className='sm:hidden'>
            <div className='space-y-1 px-2 pt-2 pb-3'>
              {navigation.map((item) => (
                <Disclosure.Button
                  key={item.name}
                  as='a'
                  href={item.href}
                  className={classNames(
                    item.current
                      ? 'bg-gray-900 text-white'
                      : 'text-gray-300 hover:bg-gray-700 hover:text-white',
                    'block px-3 py-2 rounded-md text-base font-medium'
                  )}
                  aria-current={item.current ? 'page' : undefined}
                >
                  {item.name}
                </Disclosure.Button>
              ))}
            </div>
          </Disclosure.Panel>
        </>
      )}
    </Disclosure>
  );
};

export default Header;
</code>```

I tried to adapt the button sizes based on screensize but they still wouldn't work. Even the links do not work.

I was expecting the buttons to at least appear as buttons but they won't

Body:
I'm having trouble with the buttons not working at any smaller screen size. This has been an issue in multiple navbars I've tried so I'm quite confused.

Below is my navbar code, it should work and it does at xl screensize but not at anything less.

import React, { useContext } from 'react';
import {
  Navbar,
  Link,
  Text,
  Avatar,
  Dropdown,
  useTheme,
  createTheme,
  NextUIProvider,
  Button,
} from ' @nextui-org/react';
import { Box } from '@mui/system';
import { Layout } from './NavbarHelpers/Layout.js';
import NavBar from '../NavBar/NavBar';
import NonHomeNav from '../NavBar/NonHomeNav';
import { ReactSession } from 'react-client-session';
import { AuthContext } from '../../services/auth.context.js';
import { Fragment } from 'react';
import { Disclosure, Menu, Transition } from '@headlessui/react';
import { Bars3Icon, BellIcon, XMarkIcon } from '@heroicons/react/24/outline';
import SendIcon from '@mui/icons-material/Send';

import './Header.css';
import { Typography } from '@mui/material';

const countrySectionStyle = {
  width: '100%',
  height: '125px',
  // backgroundImage: `url(${process.env.PUBLIC_URL}/images/Mountin.jpg)`
};

const sectionStyle = {
  width: '100%',
  height: '400px',
  backgroundImage: `url(${process.env.PUBLIC_URL}/images/Mountin.jpg)`,
};

const Header = () => {
  return (
    <>

        <NavBar />
        {/*
 */}

                Your World

                Guide

        {/*
 */}

    </>
  );
};

const navigation = [
  // { name: 'Home', href: '/', current: true },
];

function classNames(...classes) {
  return classes.filter(Boolean).join(' ');
}

export const CountryHeader = () => {
  const { isAuthenticated, onLogout } = useContext(AuthContext);

  // const user = JSON.parse(ReactSession.get('userId'))
  //   console.log(user)

  // const username = user.visibleUsername

  return (
    <Disclosure as='nav' style={{ minHeight: '11vh', background: '#826644' }}>
      {({ open }) => (
        <>

                {/*  */}
                <SendIcon className='h-6 w-6 text-white' />
                <Link href='/'>

                    Geopilot

                </Link>
                {/* Mobile menu button*/}
                <Disclosure.Button className='inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white'>
                  Open main menu
                  {open ? (
                    <XMarkIcon className='block h-6 w-6' aria-hidden='true' />
                  ) : (
                    <Bars3Icon className='block h-6 w-6' aria-hidden='true' />
                  )}
                </Disclosure.Button>

              {/*
   */}
              <Box marginLeft='34.5em'>

                    {navigation.map((item) => (
                      <Box
                        key={item.name}
                        href={item.href}
                        className={classNames(
                          item.current
                            ? 'bg-gray-900 text-white'
                            : 'text-gray-300 hover:bg-gray-700 hover:text-white',
                          'px-3 py-2 rounded-md text-sm font-medium'
                        )}
                        aria-current={item.current ? 'page' : undefined}
                      >
                        {item.name}
                      </Box>
                    ))}

              </Box>
              {/*
 */}

                <button
                  type='button'
                  className='rounded-full bg-gray-800 p-1 text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800'
                >
                  View notifications
                  <BellIcon className='h-6 w-6' aria-hidden='true' />
                </button>

                {/* Profile dropdown */}

                {!isAuthenticated ? (
                  <>
                    <Link
                      to='/login'
                      className='hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium'
                    >
                      <Typography color={'white'} fontSize={'14px'}>
                        Login
                      </Typography>
                    </Link>
                    <Link
                      to='/register'
                      className='text-gray-100 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium'
                    >
                      <Typography color={'white'} fontSize={'14px'}>
                        Sign Up
                      </Typography>
                    </Link>
                  </>
                ) : (
                  <Menu as='div' className='relative ml-3'>

                      <Menu.Button className='flex rounded-full bg-gray-800 text-sm focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-gray-800'>
                        Open user menu
                        <img
                          className='h-8 w-8 rounded-full'
                          src={`https://avatars.dicebear.com/api/initials/.svg`}
                          alt='User profile picture'
                        />
                      </Menu.Button>

                    <Transition
                      as={Fragment}
                      enter='transition ease-out duration-100'
                      enterFrom='transform opacity-0 scale-95'
                      enterTo='transform opacity-100 scale-100'
                      leave='transition ease-in duration-75'
                      leaveFrom='transform opacity-100 scale-100'
                      leaveTo='transform opacity-0 scale-95'
                    >
                      <Menu.Items className='absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none'>
                        {/* <Menu.Item>
                      {({ active }) => (

                          Your Profile

                      )}
                    </Menu.Item>
                    <Menu.Item>
                      {({ active }) => (

                          Settings

                      )}
                    </Menu.Item> */}
                        <Menu.Item>
                          {({ active }) => (
                            <button
                              onPress={onLogout()}
                              className={classNames(
                                active ? 'bg-grey-100' : '',
                                'block px-4 py-2 text-sm text-gray-700'
                              )}
                            >
                              Sign out
                            </button>
                          )}
                        </Menu.Item>
                      </Menu.Items>
                    </Transition>
                  </Menu>
                )}

          <Disclosure.Panel className='sm:hidden'>

              {navigation.map((item) => (
                <Disclosure.Button
                  key={item.name}
                  as='a'
                  href={item.href}
                  className={classNames(
                    item.current
                      ? 'bg-gray-900 text-white'
                      : 'text-gray-300 hover:bg-gray-700 hover:text-white',
                    'block px-3 py-2 rounded-md text-base font-medium'
                  )}
                  aria-current={item.current ? 'page' : undefined}
                >
                  {item.name}
                </Disclosure.Button>
              ))}

          </Disclosure.Panel>
        </>
      )}
    </Disclosure>
  );
};

export default Header;

I tried to adapt the button sizes based on screensize but they still wouldn't work. Even the links do not work.

I was expecting the buttons to at least appear as buttons but they won't


问:
SimpleDateFormat parsing wrong value in a Junit Springboot ExpectedDatabase test
I don't understand how the date is parsed in this way and the final result is 1799.

```<code>...
@ExpectedDatabase(value = "/dataset/expected/gestionVehicule/doss.xml",
    assertionMode = DatabaseAssertionMode.NON_STRICT_UNORDERED)

In the XML file, the comparing set:
<VEH_DATE_MEC="1800-01-01"/>
...

SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd");
        isoFormat.setTimeZone(TimeZone.getTimeZone("GMT+1"));
        Date date = isoFormat.parse("1800-01-01");
        vehiculeFrontDto.setDatePremiereImmat(date);
</code>```

The setter:

```<code> public void setDatePremiereImmat(Date datePremiereImmat) {
        this.datePremiereImmat = DateCopyUtils.copyDate(datePremiereImmat);
    }
</code>```

Date received with the debugger stored in the date variable: Tue Dec 31 23:00:00 UTC 1799

Test: expected:<1[800-01-01]> but was:<1[799-12-31 23:00:00.0]>

Body:
I don't understand how the date is parsed in this way and the final result is 1799.

...
@ExpectedDatabase(value = "/dataset/expected/gestionVehicule/doss.xml",
    assertionMode = DatabaseAssertionMode.NON_STRICT_UNORDERED)

In the XML file, the comparing set:
<VEH_DATE_MEC="1800-01-01"/>
...

SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd");
        isoFormat.setTimeZone(TimeZone.getTimeZone("GMT+1"));
        Date date = isoFormat.parse("1800-01-01");
        vehiculeFrontDto.setDatePremiereImmat(date);

The setter:

 public void setDatePremiereImmat(Date datePremiereImmat) {
        this.datePremiereImmat = DateCopyUtils.copyDate(datePremiereImmat);
    }

Date received with the debugger stored in the date variable: Tue Dec 31 23:00:00 UTC 1799

Test: expected:<1[800-01-01]> but was:<1[799-12-31 23:00:00.0]>