问:
How to return a resolved promise from a module export?
```<code>import { DataTypes } from "sequelize";
import dbConnect from "./dbConnect";

async function UserModel() {
  const sequelize = await dbConnect();

  const User = sequelize.define(
    "User",
    {
      userKey: {
        type: DataTypes.INTEGER,
        autoIncrement: true,
        primaryKey: true,
      },
      name: {
        type: DataTypes.STRING(50),
        allowNull: false,
      },
      username: {
        type: DataTypes.STRING(50),
        allowNull: false,
      },
    },
    {
      freezeTableName: true, // enforces that table name = model name
    }
  );

  return User;
}

export default UserModel;
</code>```

The above module returns the UserModel correctly, but I need to resolve it twice --

    const users = await (await User()).findAll();
```
<p>-- in the module that imports it b/c I'm calling a method that also returns a promise.</p>
<p>I'd like to call it like this --</p>
<pre class="lang-js prettyprint-override"><code>    const users = await User().findAll();
</code>```

-- but everything I've tried has failed.

See usage here:

    export async function getServerSideProps() {
      const users = await (await User()).findAll();

      return {
        props: {
          users,
        },
      };
    }
```

Can you shed some light on how to do this?

Body:
import { DataTypes } from "sequelize";
import dbConnect from "./dbConnect";

async function UserModel() {
  const sequelize = await dbConnect();

  const User = sequelize.define(
    "User",
    {
      userKey: {
        type: DataTypes.INTEGER,
        autoIncrement: true,
        primaryKey: true,
      },
      name: {
        type: DataTypes.STRING(50),
        allowNull: false,
      },
      username: {
        type: DataTypes.STRING(50),
        allowNull: false,
      },
    },
    {
      freezeTableName: true, // enforces that table name = model name
    }
  );

  return User;
}

export default UserModel;

The above module returns the UserModel correctly, but I need to resolve it twice --

    const users = await (await User()).findAll();

-- in the module that imports it b/c I'm calling a method that also returns a promise.

I'd like to call it like this --

    const users = await User().findAll();

-- but everything I've tried has failed.

See usage here:

    export async function getServerSideProps() {
      const users = await (await User()).findAll();

      return {
        props: {
          users,
        },
      };
    }

Can you shed some light on how to do this?


来源: stackexchange

问:
Trying to create an application using youtube api
If I was trying to access the video details of a video once a user with my app clicks a video. Is this possible. I see the resource activities goes based on actions. Is a video clicked by a user considered an action? The resource video allows you to access a videos description but I need the description of the video selected by the user at that time.

I thing the resource activities or video will help but I am unsure

ContentLicense: CC BY-SA 4.0


问:
Binding configuration section to POCO - defaulting to a default value
I am trying to bind my object and have an invalid enum/bool. Essentially, any non-string variable will throw an exception (which I don't want). What I want is the a default value to be set (to null) instead of throwing an exception. Is there a way this can be achieved? Ideally I want to want to try parsing the string to an enum and is there a built in way (I haven't seen anything that achieves this).

Json File

```<code>// Json file
section: {
   "Type": "Type3",
   "SomeBool" : "falsee"
}
</code>```

My config

```<code>var config = new ConfigurationBuilder()
                        .AddJsonFile("appsettings.json", optional: true)
                        .AddEnvironmentVariables()
                        .Build();
// This throws an exception
var section = config.GetSection("section").Get<Section>();
</code>```

POCO

```<code>public Section
{
   public SomeType? Type { get; set; }
   public bool? SomeBool { get; set; }
   // Other props below
}

enum SomeType
{
   Type1,
   Type2
}
</code>```

Body:
I am trying to bind my object and have an invalid enum/bool. Essentially, any non-string variable will throw an exception (which I don't want). What I want is the a default value to be set (to null) instead of throwing an exception. Is there a way this can be achieved? Ideally I want to want to try parsing the string to an enum and is there a built in way (I haven't seen anything that achieves this).

Json File

// Json file
section: {
   "Type": "Type3",
   "SomeBool" : "falsee"
}

My config

var config = new ConfigurationBuilder()
                        .AddJsonFile("appsettings.json", optional: true)
                        .AddEnvironmentVariables()
                        .Build();
// This throws an exception
var section = config.GetSection("section").Get
();

POCO

public Section
{
   public SomeType? Type { get; set; }
   public bool? SomeBool { get; set; }
   // Other props below
}

enum SomeType
{
   Type1,
   Type2
}


问:
How Redirect to another codeigniter controller after submitting data in backbone.js
Ive created a backbone application that sends form data to the codeigniter backend for verification using a MySQL database.
Below is the authenticate event of the backbone view that will be called on submission of the form,

```<code>authenticate: function(event) {
      var usernameValue = $('#username').val();
      var passwordValue = $('#password').val();
      var c = new MyQuiz();
      var userDetails = {
        'username': usernameValue,
        'password': passwordValue
      }
      c.save(userDetails, {
        type: 'POST',
        url: '/CW2/ASSWDCW2/cw2app/index.php/User/loginUser',
        success: function(model, response) {
          alert('Form data submitted successfully :' + response);
        },
        error: function(model, response) {
          alert('Error saving model');
        }
      }).done(function(model, response) {
        console.log('Done saving model');
      });
    }
</code>```

I'm getting this data to the User controller and after successfully authenticating the data, I want to redirect to Home controller where the home_view will be called in the index function.

```<code>    public function loginUser()
{
    if ($this->input->server('REQUEST_METHOD') == 'POST') {
        $data = $this->decode_data($this->input->raw_input_stream);
        $username = $data['username'];
        $password = $data['password'];
        $this->load->model('UserModel');
        if ($this->UserModel->authenticate($username, $password)) {
            $this->session->is_logged_in = true;
            $this->session->username = $username;

            //sucessfully athenticated
            redirect('/Home/');
        } else {
            $this->session->login_error = True;
            redirect('/User/');
        }
    }
}
</code>```

Problem : It wont redirect to Home controller once authenticated successfully.Please help!

Body:
Ive created a backbone application that sends form data to the codeigniter backend for verification using a MySQL database.
Below is the authenticate event of the backbone view that will be called on submission of the form,

authenticate: function(event) {
      var usernameValue = $('#username').val();
      var passwordValue = $('#password').val();
      var c = new MyQuiz();
      var userDetails = {
        'username': usernameValue,
        'password': passwordValue
      }
      c.save(userDetails, {
        type: 'POST',
        url: '/CW2/ASSWDCW2/cw2app/index.php/User/loginUser',
        success: function(model, response) {
          alert('Form data submitted successfully :' + response);
        },
        error: function(model, response) {
          alert('Error saving model');
        }
      }).done(function(model, response) {
        console.log('Done saving model');
      });
    }

I'm getting this data to the User controller and after successfully authenticating the data, I want to redirect to Home controller where the home_view will be called in the index function.

    public function loginUser()
{
    if ($this->input->server('REQUEST_METHOD') == 'POST') {
        $data = $this->decode_data($this->input->raw_input_stream);
        $username = $data['username'];
        $password = $data['password'];
        $this->load->model('UserModel');
        if ($this->UserModel->authenticate($username, $password)) {
            $this->session->is_logged_in = true;
            $this->session->username = $username;

            //sucessfully athenticated
            redirect('/Home/');
        } else {
            $this->session->login_error = True;
            redirect('/User/');
        }
    }
}

Problem : It wont redirect to Home controller once authenticated successfully.Please help!


问:
"@Transactional(readonly=true, propagation=Propagation.REQUIRED)" Is it possible to set it up?
Currently, I am using the postgresql master/slave environment.
The development environment is spring boot.

I'd like to organize the transaction as follows:

```<code>TX Begin
   @Transactional (readOnly=false)
      insert into t1 values(1);

   @Transactional (readOnly=true, propagation=Propagation.NESTED) or
   @Transactional (readOnly=true, propagation=Propagation.REQUIRED)
      select * from t1 where c1=1;

   commit;
TX End;
</code>```

In the above case, is it possible to read the records from the Replica (Slave) server without having to commit after INSERT?

Thanks.

Body:
Currently, I am using the postgresql master/slave environment.
The development environment is spring boot.

I'd like to organize the transaction as follows:

TX Begin
   @Transactional (readOnly=false)
      insert into t1 values(1);

   @Transactional (readOnly=true, propagation=Propagation.NESTED) or
   @Transactional (readOnly=true, propagation=Propagation.REQUIRED)
      select * from t1 where c1=1;

   commit;
TX End;

In the above case, is it possible to read the records from the Replica (Slave) server without having to commit after INSERT?

Thanks.


问:
Between multiple dlls, the execution order of construction and Load( )
I have a Exe file that refers to multiple dlls, the dll is user control,

Ex: Main.exe  A.dll  B.dll  C.dll

When the program is executed, what is the execution order of the construction formula and Load( ) of each file? and how to set it?

For example, I want the following sequence, how to achieve?

B( ) => A( ) => C( ) => Main( )

B_Load( ) => A_Load( ) => C_Load( ) => Main_Load( )


问:
Axis labels not neat when being rotated in ggplot2
How can I make the axis labels neat and appropriately spaced when they are rotated in ggplot2?
Below is an example. The labels become untidy, and the spaces between characters are not evenly placed.

```<code>library(tidyverse)

data <- cbind(
  x = c('Lorem ipsum dolor sit amet', 'consectetur adipiscing elit', 'Sed non lacus imperdiet', 'posuere tortor consectetur'),
  y = 1:4
) %>% as.data.frame()

ggplot(data, aes(x, y)) +
  geom_col() +
  theme_minimal() +
  theme(axis.text.x=element_text(size=8, family="sans", face="bold", colour="black", angle=30, hjust=1),
        axis.text.y=element_text(size=8, family="sans", face="bold", colour="black"))
</code>```

Body:
How can I make the axis labels neat and appropriately spaced when they are rotated in ggplot2?
Below is an example. The labels become untidy, and the spaces between characters are not evenly placed.

library(tidyverse)

data <- cbind(
  x = c('Lorem ipsum dolor sit amet', 'consectetur adipiscing elit', 'Sed non lacus imperdiet', 'posuere tortor consectetur'),
  y = 1:4
) %>% as.data.frame()

ggplot(data, aes(x, y)) +
  geom_col() +
  theme_minimal() +
  theme(axis.text.x=element_text(size=8, family="sans", face="bold", colour="black", angle=30, hjust=1),
        axis.text.y=element_text(size=8, family="sans", face="bold", colour="black"))


问:
Strange problem with ics import in google calendar
I am currently trying to generate an ics file with several events with alarms (4 hours before the event starts) via python. That also works so far. But if I now import the file into google calendar, the alarm is only created for the first event. All other events have no alarm after the import. I'm really at a loss and would really appreciate your help.

Here is the content of the ics file:

```<code>BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Testcompany//Testversion 1.0 MIMEDIR//EN
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY:TEST EVENT 1
DTSTART;VALUE=DATE:20230101
DTEND;VALUE=DATE:20230102
DTSTAMP:20221229T135217Z
UID:16723219371@example.com
SEQUENCE:0
CLASS:PUBLIC
CREATED:20221228T082946Z
DESCRIPTION:TEST EVENT 1
LAST-MODIFIED:20221228T082946Z
TRANSP:TRANSPARENT
URL:http://www.example.com
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-PT4H
END:VALARM
END:VEVENT
BEGIN:VEVENT
SUMMARY:TEST EVENT 2
DTSTART;VALUE=DATE:20230103
DTEND;VALUE=DATE:20230104
DTSTAMP:20221229T135217Z
UID:16723219372@example.com
SEQUENCE:0
CLASS:PUBLIC
CREATED:20221228T082946Z
DESCRIPTION:TEST EVENT 2
LAST-MODIFIED:20221228T082946Z
TRANSP:TRANSPARENT
URL:http://www.example.com
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-PT4H
END:VALARM
END:VEVENT
BEGIN:VEVENT
SUMMARY:TEST EVENT 3
DTSTART;VALUE=DATE:20230105
DTEND;VALUE=DATE:20230106
DTSTAMP:20221229T135217Z
UID:16723219373@example.com
SEQUENCE:0
CLASS:PUBLIC
CREATED:20221228T082946Z
DESCRIPTION:TEST EVENT 3
LAST-MODIFIED:20221228T082946Z
TRANSP:TRANSPARENT
URL:http://www.example.com
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-PT4H
END:VALARM
END:VEVENT
END:VCALENDAR
</code>```

Thank you for your help!

I expect all events to have an alarm after import, which is triggered 4 hours before the event starts.

Body:
I am currently trying to generate an ics file with several events with alarms (4 hours before the event starts) via python. That also works so far. But if I now import the file into google calendar, the alarm is only created for the first event. All other events have no alarm after the import. I'm really at a loss and would really appreciate your help.

Here is the content of the ics file:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Testcompany//Testversion 1.0 MIMEDIR//EN
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY:TEST EVENT 1
DTSTART;VALUE=DATE:20230101
DTEND;VALUE=DATE:20230102
DTSTAMP:20221229T135217Z
UID:16723219371@example.com
SEQUENCE:0
CLASS:PUBLIC
CREATED:20221228T082946Z
DESCRIPTION:TEST EVENT 1
LAST-MODIFIED:20221228T082946Z
TRANSP:TRANSPARENT
URL:http://www.example.com
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-PT4H
END:VALARM
END:VEVENT
BEGIN:VEVENT
SUMMARY:TEST EVENT 2
DTSTART;VALUE=DATE:20230103
DTEND;VALUE=DATE:20230104
DTSTAMP:20221229T135217Z
UID:16723219372@example.com
SEQUENCE:0
CLASS:PUBLIC
CREATED:20221228T082946Z
DESCRIPTION:TEST EVENT 2
LAST-MODIFIED:20221228T082946Z
TRANSP:TRANSPARENT
URL:http://www.example.com
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-PT4H
END:VALARM
END:VEVENT
BEGIN:VEVENT
SUMMARY:TEST EVENT 3
DTSTART;VALUE=DATE:20230105
DTEND;VALUE=DATE:20230106
DTSTAMP:20221229T135217Z
UID:16723219373@example.com
SEQUENCE:0
CLASS:PUBLIC
CREATED:20221228T082946Z
DESCRIPTION:TEST EVENT 3
LAST-MODIFIED:20221228T082946Z
TRANSP:TRANSPARENT
URL:http://www.example.com
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-PT4H
END:VALARM
END:VEVENT
END:VCALENDAR

Thank you for your help!

I expect all events to have an alarm after import, which is triggered 4 hours before the event starts.


问:
Python - Issue with dependencies for xlwings using py2app
Hello and thanks for your help!

I created an app with py2app but when I launch it using the terminal on another computer, I get this error "Make sure to have "appscript" and "psutil", dependencies of xlwings, installed."

At first, I didn't see these in the app lib folder, so I used --packages in the setup.py file for py2app to make sure that they are included. I now have these libs in the app, but I still get this error...


问:
Configure Azure Kubernetes user context for on-premise resource access
My question is hopefully simple.In the period where you have both on-premise and Azure based resources can jobs running in an Azure Kubernetes cluster be configured to use an AD user context such that things like network folders can be accessed or SQL Server connections made using trusted connections?
If not, what is the safest way to proceed as I'm not a fan of UID/PWD connection strings as the details tend to get shared where they shouldn't.</p>


问:
How do I create a top-down 2D player controller where diagonal movement is at a 26° angle rather than a 45° angle?
I am currently making a 2D game with top-down movement. This game is set in an isometric tilemap, so I would like the diagonal movement to be at approximately a 26.57° (arctan(1/2)) angle rather than a 45° angle to match the angle of isometric gridlines.

Currently, I rotate the X-axis and Y-axis of the input vector ~26° like so:

```<code>const float gridAngle = 26.565f;
void HandleMovement()
{
    //Create vectors for the X and Y components of the input
    Vector2 inputX = new Vector2(move.ReadValue<Vector2>().x, 0);
    Vector2 inputY = new Vector2(0, move.ReadValue<Vector2>().y);

    //Rotate then add the X and Y vectors
    Vector2 skewedInput = (Quaternion.AngleAxis(-gridAngle, Vector3.forward) * inputX) + (Quaternion.AngleAxis(-(90 - gridAngle), Vector3.forward) * inputY);

    //Normalize the new movement vector
    moveDirection = skewedInput.normalized;
}
</code>```

visual representation of code

However, this results in diagonal movement from a W, A, S, or D input. While this does work, it does not feel right.
I would like to know how I could create an otherwise normal top-down controller except for diagonals (combination of W and D for example) at a 26° angle.

Ideally, I would like this to be continuous rather than a "if diagonal {angle = 26}" type of situation in case I allow controller input later where there is an infinite range of input vectors the game could receive from the analog stick.

Body:
I am currently making a 2D game with top-down movement. This game is set in an isometric tilemap, so I would like the diagonal movement to be at approximately a 26.57° (arctan(1/2)) angle rather than a 45° angle to match the angle of isometric gridlines.

Currently, I rotate the X-axis and Y-axis of the input vector ~26° like so:

const float gridAngle = 26.565f;
void HandleMovement()
{
    //Create vectors for the X and Y components of the input
    Vector2 inputX = new Vector2(move.ReadValue<Vector2>().x, 0);
    Vector2 inputY = new Vector2(0, move.ReadValue<Vector2>().y);

    //Rotate then add the X and Y vectors
    Vector2 skewedInput = (Quaternion.AngleAxis(-gridAngle, Vector3.forward) * inputX) + (Quaternion.AngleAxis(-(90 - gridAngle), Vector3.forward) * inputY);

    //Normalize the new movement vector
    moveDirection = skewedInput.normalized;
}

visual representation of code

However, this results in diagonal movement from a W, A, S, or D input. While this does work, it does not feel right.
I would like to know how I could create an otherwise normal top-down controller except for diagonals (combination of W and D for example) at a 26° angle.

Ideally, I would like this to be continuous rather than a "if diagonal {angle = 26}" type of situation in case I allow controller input later where there is an infinite range of input vectors the game could receive from the analog stick.


问:
autoNumeric causing removed values to be posted on form submit
I'm using autoNumeric to reformat numbers on my form. My form loads previously entered data, allowing the user to update information on the form, overwriting the previous data. The user can change information on that page that removes values from some autoNumeric fields. But, when the form submits the previously values are being saved still.

I'm using jquery to remove values:

```<code>$(".SqFt").val([]);
</code>```

And hide inputs:

```<code>$(".PropertyType").hide();
</code>```

I have a Save button and a Submit button. The save button works as intended. Clicking save calls some javascript that unformats the numeric fields, the submits the form:

```<code>$("#Save").click(function(){
    unFormatAutoNumeric();
    $("#MyForm").submit();
})
$("#Submit").click(function(){
    unFormatAutoNumeric();
})
</code>```

If I check the values of the fields on submit, $("#OfficeSqFt").val() for example, they are empty. But when I check the model values in the controller it shows the previously entered value. The submit button does the same unFormatting as the save, but instead of calling $("#MyForm").submit() it just let's the form submit from the button click. I was able to add $("#MyForm").submit() to the submit onclick, and it now posts correctly.

My question is why do the null values properly post with $("#MyForm").submit(), but the previously entered values post from the html form handler?

Any help understanding what's happening here would be appreciated.

Body:
I'm using autoNumeric to reformat numbers on my form. My form loads previously entered data, allowing the user to update information on the form, overwriting the previous data. The user can change information on that page that removes values from some autoNumeric fields. But, when the form submits the previously values are being saved still.

I'm using jquery to remove values:

$(".SqFt").val([]);

And hide inputs:

$(".PropertyType").hide();

I have a Save button and a Submit button. The save button works as intended. Clicking save calls some javascript that unformats the numeric fields, the submits the form:

$("#Save").click(function(){
    unFormatAutoNumeric();
    $("#MyForm").submit();
})
$("#Submit").click(function(){
    unFormatAutoNumeric();
})

If I check the values of the fields on submit, $("#OfficeSqFt").val() for example, they are empty. But when I check the model values in the controller it shows the previously entered value. The submit button does the same unFormatting as the save, but instead of calling $("#MyForm").submit() it just let's the form submit from the button click. I was able to add $("#MyForm").submit() to the submit onclick, and it now posts correctly.

My question is why do the null values properly post with $("#MyForm").submit(), but the previously entered values post from the html form handler?

Any help understanding what's happening here would be appreciated.


问:
Flutter, Android, release version keeps showing white padding around app icon when launched at first time
Perhaps in the new version of Android, when you run the app, the app icon moves to the center of the mobile screen screen and becomes slightly larger and shows the native splash screen as the default. But this has a lot of problems.

I implemented it with flutter_launcher_icons, and white padding keeps attaching around the app icon, on the launch screen.

So I just took the old way of changing the ic_launcher icon and successfully removed the white padding. But the problem is that when I do flutte run --release instead of debug mode, white padding starts to stick again. I'm having a really hard time with this. Anyone know of this issue?


问:
How to transition grid-column property

I want to transition the column when I change his position by grid-column property I try but it doesn't work.

Now I have 16 columns I choose one and write a word inside it "Catch me" then I will change the column's position from grid-column: 1; to grid-column: 3; the column will move from 1 to 3 but too fast so how to control that move by transition, I tried to use transition but it is not working with grid-column: 1;
`

```<code>.item.position-1-2 {
  grid-row: 2;
  grid-column: 1;
</code>```

`
I made many classes for positions when I change the class the position will change in the grid but too fast
I change the class by javascript very well but it is moving too fast and this is bad.

```<code>/* The parent */
.container {
  gap: 12px;
  display: grid;
  justify-items: center;
  grid-template-rows: repeat(4, 100px);
  grid-template-columns: repeat(4, 107px);
  transition: 0.25s;
}
/* The child */
.item {
  width: 107px;
  height: 100px;
  line-height: 100px;
  transition: 0.25s;
}
/* The positions */
.tile.tile-position-1-1 {
  grid-row: 1;
  grid-column: 1;
}
.tile.tile-position-1-2 {
  grid-row: 2;
  grid-column: 1;
}
.tile.tile-position-1-3 {
  grid-row: 3;
  grid-column: 1;
}
.tile.tile-position-1-4 {
  grid-row: 4;
  grid-column: 1;
}
.tile.tile-position-2-1 {
  grid-row: 1;
  grid-column: 2;
}
.tile.tile-position-2-2 {
  grid-row: 2;
  grid-column: 2;
}
.tile.tile-position-2-3 {
  grid-row: 3;
  grid-column: 2;
}
.tile.tile-position-2-4 {
  grid-row: 4;
  grid-column: 2;
}
.tile.tile-position-3-1 {
  grid-row: 1;
  grid-column: 3;
}
.tile.tile-position-3-2 {
  grid-row: 2;
  grid-column: 3;
}
.tile.tile-position-3-3 {
  grid-row: 3;
  grid-column: 3;
}
.tile.tile-position-3-4 {
  grid-row: 4;
  grid-column: 3;
}
.tile.tile-position-4-1 {
  grid-row: 1;
  grid-column: 4;
}
.tile.tile-position-4-2 {
  grid-row: 2;
  grid-column: 4;
}
.tile.tile-position-4-3 {
  grid-row: 3;
  grid-column: 4;
}
.tile.tile-position-4-4 {
  grid-row: 4;
  grid-column: 4;
}
</code>```

Title: How to transition grid-column property

Body:
I want to transition the column when I change his position by grid-column property I try but it doesn't work.

Now I have 16 columns I choose one and write a word inside it "Catch me" then I will change the column's position from grid-column: 1; to grid-column: 3; the column will move from 1 to 3 but too fast so how to control that move by transition, I tried to use transition but it is not working with grid-column: 1;
`

.item.position-1-2 {
  grid-row: 2;
  grid-column: 1;

`
I made many classes for positions when I change the class the position will change in the grid but too fast
I change the class by javascript very well but it is moving too fast and this is bad.

/* The parent */
.container {
  gap: 12px;
  display: grid;
  justify-items: center;
  grid-template-rows: repeat(4, 100px);
  grid-template-columns: repeat(4, 107px);
  transition: 0.25s;
}
/* The child */
.item {
  width: 107px;
  height: 100px;
  line-height: 100px;
  transition: 0.25s;
}
/* The positions */
.tile.tile-position-1-1 {
  grid-row: 1;
  grid-column: 1;
}
.tile.tile-position-1-2 {
  grid-row: 2;
  grid-column: 1;
}
.tile.tile-position-1-3 {
  grid-row: 3;
  grid-column: 1;
}
.tile.tile-position-1-4 {
  grid-row: 4;
  grid-column: 1;
}
.tile.tile-position-2-1 {
  grid-row: 1;
  grid-column: 2;
}
.tile.tile-position-2-2 {
  grid-row: 2;
  grid-column: 2;
}
.tile.tile-position-2-3 {
  grid-row: 3;
  grid-column: 2;
}
.tile.tile-position-2-4 {
  grid-row: 4;
  grid-column: 2;
}
.tile.tile-position-3-1 {
  grid-row: 1;
  grid-column: 3;
}
.tile.tile-position-3-2 {
  grid-row: 2;
  grid-column: 3;
}
.tile.tile-position-3-3 {
  grid-row: 3;
  grid-column: 3;
}
.tile.tile-position-3-4 {
  grid-row: 4;
  grid-column: 3;
}
.tile.tile-position-4-1 {
  grid-row: 1;
  grid-column: 4;
}
.tile.tile-position-4-2 {
  grid-row: 2;
  grid-column: 4;
}
.tile.tile-position-4-3 {
  grid-row: 3;
  grid-column: 4;
}
.tile.tile-position-4-4 {
  grid-row: 4;
  grid-column: 4;
}


问:
JetBrains markdown parser, can it be used with Kotlin Native?
https://github.com/JetBrains/markdown

States:

The processor is written in pure Kotlin (with a little flex) so it can be compiled to both JS and Java bytecode and thus can be used everywhere.

But doesn't state anything about
Kotlin Native. Can JetBrains Markdown lib be used with Kotlin Native to run it on iOS? And if not since its stated that it can be used everywhere is the expectation that it will run as JS on iOS?


问:
line 6: field constraints not found in type v1alpha4.Node
I am trying kind create cluster --config kind-config.yaml to create a kind cluster using the following kind-config.yaml file:

```<code>kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
  constraints:
    memory: "512m"
    cpu: "4"
</code>```

But I get this result:

```<code>ERROR: failed to create cluster: unable to decode config: yaml: unmarshal errors:
  line 6: field constraints not found in type v1alpha4.Node
</code>```

What I am trying to do is doing something like bellowing but for a Kind cluster instead of minilube:

minikube start --memory 5120 --cpus=4

Body:
I am trying kind create cluster --config kind-config.yaml to create a kind cluster using the following kind-config.yaml file:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
  constraints:
    memory: "512m"
    cpu: "4"

But I get this result:

ERROR: failed to create cluster: unable to decode config: yaml: unmarshal errors:
  line 6: field constraints not found in type v1alpha4.Node

What I am trying to do is doing something like bellowing but for a Kind cluster instead of minilube:

minikube start --memory 5120 --cpus=4


问:
compiling mscorlib functions through mono exports
I am trying to invoke a mono function natively through mono-2.0-bdwgc exports.

```<code>    auto image = mono::image_loaded( "mscorlib" );
    if ( !image )
        return;

    auto domain = mono::get_root_domain( );
    if( !domain )
        return;

    mono::thread_attach( domain );

    auto klass = mono::class_from_name( image, "System.Collections.Generic", "Dictionary`2" );
    auto method = mono::class_get_method_from_name( klass, "TryInsert", 3 );

    auto compiled_ptr = mono::compile_method( method );
</code>```

"compiled_ptr" returns 0. It appears these functions do not contain any data? I am unsure if it can be accessed through an ICALL.

Body:
I am trying to invoke a mono function natively through mono-2.0-bdwgc exports.

    auto image = mono::image_loaded( "mscorlib" );
    if ( !image )
        return;

    auto domain = mono::get_root_domain( );
    if( !domain )
        return;

    mono::thread_attach( domain );

    auto klass = mono::class_from_name( image, "System.Collections.Generic", "Dictionary`2" );
    auto method = mono::class_get_method_from_name( klass, "TryInsert", 3 );

    auto compiled_ptr = mono::compile_method( method );

"compiled_ptr" returns 0. It appears these functions do not contain any data? I am unsure if it can be accessed through an ICALL.


问:
Is There An Attribute To Set Width Of Search Input Within bootstrapTable method?
Is there an attribute I can use within the bootstrapTable method that will allow me to set the width of the search input?

I would prefer to set the width this way instead of using css styling. Right now my search input spans the entire page. I have checked the documentation below but can't find it.

https://bootstrap-table-docs3.wenzhixin.net.cn/documentation/

```<code>$('#quintilesTable').bootstrapTable({
  data: formattedStocks,
  pageList: [5, 10, 25, 50, 100, 200],
  pageSize: 10, //specify 10 rows per page here
  pagination: true,
  // 12/29/22 EE TODO: is there an attribute to set width of search input
  // instead of using css styling?
  search: true,
});
</code>```

Body:
Is there an attribute I can use within the bootstrapTable method that will allow me to set the width of the search input?

I would prefer to set the width this way instead of using css styling. Right now my search input spans the entire page. I have checked the documentation below but can't find it.

https://bootstrap-table-docs3.wenzhixin.net.cn/documentation/

$('#quintilesTable').bootstrapTable({
  data: formattedStocks,
  pageList: [5, 10, 25, 50, 100, 200],
  pageSize: 10, //specify 10 rows per page here
  pagination: true,
  // 12/29/22 EE TODO: is there an attribute to set width of search input
  // instead of using css styling?
  search: true,
});


问:
Error with FNN model: RuntimeError: The size of tensor a (N) must match the size of tensor b (M) at non-singleton dimension 0
I trained the FNN model for the Linear regression problem in PyTorch, saved that model, and now trying to check my model performance by applying with torch.no_grad():. Y_test size is [64000 2] and X_Test size is [64000 2]. Batch_size = 100. I am trying to check the accuracy of my model which is coming to zero every single time. Unable to understand the problem.

```<code>
X_Test = torch.tensor(PA_DATA[:64000,0:2], dtype=torch.float32)
#output
Y_Test =torch.tensor(PA_DATA[:64000,2:4], dtype=torch.float32)
test_dataset = Data.TensorDataset(X_Test, Y_Test)
testloader = DataLoader(test_dataset, batch_size=100, shuffle=False)

loss_func1 = torch.nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.0001)

running_accuracy = 0.0
running_test_loss = 0.0
total = 0
with torch.no_grad():
    model.eval()
    for X_Test,T_Val in testloader:

        pred = model(X_Test)
        test_loss = loss_func1(pred,Y_Test)
        _, predicted = torch.max(pred.data, 1)
        running_test_loss += test_loss.item()
        total += Y_Test.size(0)
        running_accuracy += (predicted == Y_Test).sum().item()
        Test_loss_value = running_test_loss/len(testloader)
        accuracy = (100 * running_accuracy / total)
        print(accuracy)
</code>```

Sometimes it shows an error tensor of size a (100) did not match with tensor size b(2). I tried various things, but can't calculate the accuracy.

accuracy = 0.0

Test Loss: 0.001215781958308071

```<code>RuntimeError: The size of tensor a (100) must match the size of tensor b (64000) at non-singleton dimension 0
</code>```

Body:
I trained the FNN model for the Linear regression problem in PyTorch, saved that model, and now trying to check my model performance by applying with torch.no_grad():. Y_test size is [64000 2] and X_Test size is [64000 2]. Batch_size = 100. I am trying to check the accuracy of my model which is coming to zero every single time. Unable to understand the problem.

X_Test = torch.tensor(PA_DATA[:64000,0:2], dtype=torch.float32)
#output
Y_Test =torch.tensor(PA_DATA[:64000,2:4], dtype=torch.float32)
test_dataset = Data.TensorDataset(X_Test, Y_Test)
testloader = DataLoader(test_dataset, batch_size=100, shuffle=False)

loss_func1 = torch.nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.0001)

running_accuracy = 0.0
running_test_loss = 0.0
total = 0
with torch.no_grad():
    model.eval()
    for X_Test,T_Val in testloader:

        pred = model(X_Test)
        test_loss = loss_func1(pred,Y_Test)
        _, predicted = torch.max(pred.data, 1)
        running_test_loss += test_loss.item()
        total += Y_Test.size(0)
        running_accuracy += (predicted == Y_Test).sum().item()
        Test_loss_value = running_test_loss/len(testloader)
        accuracy = (100 * running_accuracy / total)
        print(accuracy)

Sometimes it shows an error tensor of size a (100) did not match with tensor size b(2). I tried various things, but can't calculate the accuracy.

accuracy = 0.0

Test Loss: 0.001215781958308071

RuntimeError: The size of tensor a (100) must match the size of tensor b (64000) at non-singleton dimension 0


问:
How to use an image present in the same folder as script.js for face recognition using face-api.js?
The entire project environment is in replit.
The link provides the source code: https://replit.com/@dnabanita7/Face-Recog#script.js. I am sending in the code:

```<code>const imgUrl = '/leonard.png'
const img = await faceapi.fetchImage(imgUrl)
</code>```

and passing img.src value to the detectSingleFace() function but I am getting an error:

string passed but couldn't resolve HTMLElement id

Body:
The entire project environment is in replit.
The link provides the source code: https://replit.com/@dnabanita7/Face-Recog#script.js. I am sending in the code:

const imgUrl = '/leonard.png'
const img = await faceapi.fetchImage(imgUrl)

and passing img.src value to the detectSingleFace() function but I am getting an error:

string passed but couldn't resolve HTMLElement id


问:
previous button in tkinter python code implementation problem
I am making a quiz application and I have implemented some buttons like next button in my code but I  am unable to implement the prevoius button in my code, I have tried but this is not being that I want, how can I do this ? Please help. The code is below

```<code>def next_btn(self):

        # Check if the answer is correct
        if self.check_ans(self.q_no):

            # if the answer is correct it increments the correct by 1
            self.correct += 1

        # Moves to next Question by incrementing the q_no counter
        self.q_no += 1

        if self.q_no==self.data_size:

            # if it is correct then it displays the score
            self.display_result()

            # destroys the GUI

            root.destroy()
            # destroys the GUI

        #elif self.q_no-1==self.data_size:
            #self.next_button.text="apple"
        else:
            # shows the next question
            self.display_question()
            self.display_options()
</code>```

Body:
I am making a quiz application and I have implemented some buttons like next button in my code but I  am unable to implement the prevoius button in my code, I have tried but this is not being that I want, how can I do this ? Please help. The code is below

def next_btn(self):

        # Check if the answer is correct
        if self.check_ans(self.q_no):

            # if the answer is correct it increments the correct by 1
            self.correct += 1

        # Moves to next Question by incrementing the q_no counter
        self.q_no += 1

        if self.q_no==self.data_size:

            # if it is correct then it displays the score
            self.display_result()

            # destroys the GUI

            root.destroy()
            # destroys the GUI

        #elif self.q_no-1==self.data_size:
            #self.next_button.text="apple"
        else:
            # shows the next question
            self.display_question()
            self.display_options()


问:
Bad Request. INTERNAL SERVICE ERROR on pgadmin4 on docker
I installed pgadmin4 and postgres on my VPS successfully, but I got this error. I could not found the solution on internet either. What is the cause of the error, and how can the problem be fixed?

Installing instruction: https://github.com/khezen/compose-postgres/blob/master/docker-compose.yml

The error dialog just says "Bad Request", and I get a notification at the bottom right in red that there was an "INTERNAL SERVICE ERROR".

Here's a screenshot so you can see what I see.


问:
Is there the way to set different page pop transition conditionally?
I want to animate page transition conditionally.

Those conditions are forward vs backward and backward(touch close button) vs backward(scroll down gesture)

I used CustomPageRouteBuilder.

So I achieved different transition between forward vs backward.

Because there is AnimationStatus.forward property.

Below is CustomPageRouteBuilder.

import 'package:flutter/material.dart';

class CustomPageRouteBuilder extends PageRouteBuilder {
  final Widget child;

  CustomPageRouteBuilder({
    required this.child,
  }) : super(
          pageBuilder: (context, animation, secondaryAnimation) => child,
        );

  @override
  Widget buildTransitions(
    BuildContext context,
    Animation<double> animation,
    Animation<double> secondaryAnimation,
    Widget child,
  ) {
    if (animation.status == AnimationStatus.forward) {
      return child;
    } else {
      return SlideTransition(
        position: Tween<Offset>(
          begin: const Offset(0, 0.5),
          end: Offset.zero,
        ).animate(animation),
        child: FadeTransition(
          opacity: animation,
          child: child,
        ),
      );
    }
  }
}

```

But how can achieve different page transition between backward(touch close button) vs backward(scroll down gesture)

Is there anyway to distinguish these?

Body:
I want to animate page transition conditionally.

Those conditions are forward vs backward and backward(touch close button) vs backward(scroll down gesture)

I used CustomPageRouteBuilder.

So I achieved different transition between forward vs backward.

Because there is AnimationStatus.forward property.

Below is CustomPageRouteBuilder.

import 'package:flutter/material.dart';

class CustomPageRouteBuilder extends PageRouteBuilder {
  final Widget child;

  CustomPageRouteBuilder({
    required this.child,
  }) : super(
          pageBuilder: (context, animation, secondaryAnimation) => child,
        );

  @override
  Widget buildTransitions(
    BuildContext context,
    Animation<double> animation,
    Animation<double> secondaryAnimation,
    Widget child,
  ) {
    if (animation.status == AnimationStatus.forward) {
      return child;
    } else {
      return SlideTransition(
        position: Tween<Offset>(
          begin: const Offset(0, 0.5),
          end: Offset.zero,
        ).animate(animation),
        child: FadeTransition(
          opacity: animation,
          child: child,
        ),
      );
    }
  }
}

But how can achieve different page transition between backward(touch close button) vs backward(scroll down gesture)

Is there anyway to distinguish these?


问:
Is there a way to set different colors on each line of labels in char js?
In chart js I'm finding a way to make different colors of each line

Here is the example of my code and an example image

```<code>let Labels1 = [
  ['A','40'],
  ['B', '       '+50],
  ['C','     '+ 60],
  ['D','70'],
  ['E',80 + '    '],
  ['F',100 + '   ']
]
export const radardata = {
    labels: Labels1,
    datasets: [
        {
            backgroundColor: '#fcd5ce',
            borderColor: 'rgb(194, 116, 161)',
            data: radarData,

        },
    ],

};

export let radarchartOptions = {
        responsive: true,
        tooltips: false,
        scales: {

            r : {
                beginAtZero: true,
                min: 0,
                max: 100,
                pointLabels: {
                    // color: [['red','black'],'blue','black','yellow','orange','green'],
                },
                    // padding: 5,
                    // font:{
                    //     size: 18,
                    //     weight: "bold"
                    // },

                ticks: {
                    display: false
                },

                },

            },
        plugins: {
                legend: {
                    display: false
                },
                datalabels: {
                   display: false
                },

            },
        }
</code>```

I want to make for example 'A' and '40' different color and font size.

I tried to put html code in label but found it's hard to apply in chart js.

And tried setting different colors like

color: [['green','black'],.....] on the option part but failed.

Is there a way to do it in chart js?

Body:
In chart js I'm finding a way to make different colors of each line

Here is the example of my code and an example image

let Labels1 = [
  ['A','40'],
  ['B', '       '+50],
  ['C','     '+ 60],
  ['D','70'],
  ['E',80 + '    '],
  ['F',100 + '   ']
]
export const radardata = {
    labels: Labels1,
    datasets: [
        {
            backgroundColor: '#fcd5ce',
            borderColor: 'rgb(194, 116, 161)',
            data: radarData,

        },
    ],

};

export let radarchartOptions = {
        responsive: true,
        tooltips: false,
        scales: {

            r : {
                beginAtZero: true,
                min: 0,
                max: 100,
                pointLabels: {
                    // color: [['red','black'],'blue','black','yellow','orange','green'],
                },
                    // padding: 5,
                    // font:{
                    //     size: 18,
                    //     weight: "bold"
                    // },

                ticks: {
                    display: false
                },

                },

            },
        plugins: {
                legend: {
                    display: false
                },
                datalabels: {
                   display: false
                },

            },
        }

I want to make for example 'A' and '40' different color and font size.

I tried to put html code in label but found it's hard to apply in chart js.

And tried setting different colors like

color: [['green','black'],.....] on the option part but failed.

Is there a way to do it in chart js?


问:
Provider notifylistener() not working on release mode
I am trying to implement multi-select feature, everything seem to be working well on debug mode including the loading indicators but unfortunately the changes doesn't update(notifyListeners()) on release mode

This is how my viewModel looks like:

```<code>class HobbyViewModel extends ChangeNotifier {
  bool loading = false;
  bool isSelected = false;
  List<dynamic> hobbyList = [
    'Shopping',
    'Swimming',
    'Travelling',
    'Brunch',
    'Music',
    'Trips',
    'Camping'
  ];

  List<dynamic>? selectedHobby = [];

  checkHobbySelected(hobby, UserModel user) {
    if (user.hobbies != null) {
      selectedHobby = user.hobbies!;
      notifyListeners();
    }
    if (selectedHobby!.contains(hobby)) {
      isSelected = true;
      notifyListeners();
    } else {
      isSelected = false;
      notifyListeners();
    }
  }

  setHobby(hobby) {
    if (!selectedHobby!.contains(hobby)) {
      if (selectedHobby!.length < 5) {
        selectedHobby!.add(hobby);
        // notifyListeners();
      }
      print('>>>>> $selectedHobby');
      notifyListeners();
    } else {
      selectedHobby!.removeWhere((element) => element == hobby);
      print('>>>>> $selectedHobby');
      notifyListeners();
    }
  }

  updateHobbies(BuildContext context) async {
    loading = true;
    notifyListeners();
    try {
      await usersRef.doc(firebaseAuth.currentUser!.uid).update({
        'hobbies': selectedHobby,
      });
    } catch (e) {
      loading = false;
      notifyListeners();
    }
    loading = false;
    notifyListeners();
    Navigator.pop(context);
  }
}
</code>```

This is the hobby page where I am multi-selecting:

```<code>import 'package:quicktext/view_models/profile/hobby_view_model.dart';

class Hobby extends StatefulWidget {
  final UserModel user;

  const Hobby({Key? key, required this.user}) : super(key: key);

  @override
  State<Hobby> createState() => _HobbyState();
}

class _HobbyState extends State<Hobby> {
  @override
  Widget build(BuildContext context) {
    HobbyViewModel viewModel =
        Provider.of<HobbyViewModel>(context, listen: true);
    return Scaffold(
      appBar: AppBar(
        title: Text(
          'What are your Hobbies?',
          style: TextStyle(
            fontSize: 17.0,
          ),
        ),
      ),
      body: LoadingOverlay(
        isLoading: viewModel.loading,
        progressIndicator: CupertinoActivityIndicator(),
        opacity: 0.1,
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
          child: SingleChildScrollView(
            child: Wrap(
              children: viewModel.hobbyList.map(
                (hobby) {
                  viewModel.checkHobbySelected(hobby, widget.user);
                  return GestureDetector(
                    onTap: () => viewModel.setHobby(hobby),
                    child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 5, vertical: 4),
                      child: Container(
                        padding:
                            EdgeInsets.symmetric(vertical: 5, horizontal: 12),
                        decoration: BoxDecoration(
                          color: viewModel.isSelected
                              ? Color(0xffffb109)
                              : Colors.white,
                          borderRadius: BorderRadius.circular(10),
                          border: Border.all(
                            color: Colors.grey,
                          ),
                        ),
                        child: Text(
                          hobby,
                          style: TextStyle(
                            color: viewModel.isSelected
                                ? Colors.white
                                : Colors.grey,
                            fontSize: 14,
                          ),
                        ),
                      ),
                    ),
                  );
                },
              ).toList(),
            ),
          ),
        ),
      ),
      bottomNavigationBar: Padding(
        padding: const EdgeInsets.only(bottom: 100.0, right: 20.0, left: 20.0),
        child: ClipRRect(
          borderRadius: BorderRadius.circular(5.0),
          child: Container(
            height: 60.0,
            color: Theme.of(context).colorScheme.secondary,
            child: InkWell(
              onTap: () => viewModel.updateHobbies(context),
              child: Center(
                child: const Text(
                  'Done',
                  style: TextStyle(
                    fontSize: 15.0,
                    fontWeight: FontWeight.bold,
                    color: Colors.white,
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
</code>```

Is there anything wrong with my code? I am using provider ^6.0.1

Body:
I am trying to implement multi-select feature, everything seem to be working well on debug mode including the loading indicators but unfortunately the changes doesn't update(notifyListeners()) on release mode

This is how my viewModel looks like:

class HobbyViewModel extends ChangeNotifier {
  bool loading = false;
  bool isSelected = false;
  List<dynamic> hobbyList = [
    'Shopping',
    'Swimming',
    'Travelling',
    'Brunch',
    'Music',
    'Trips',
    'Camping'
  ];

  List<dynamic>? selectedHobby = [];

  checkHobbySelected(hobby, UserModel user) {
    if (user.hobbies != null) {
      selectedHobby = user.hobbies!;
      notifyListeners();
    }
    if (selectedHobby!.contains(hobby)) {
      isSelected = true;
      notifyListeners();
    } else {
      isSelected = false;
      notifyListeners();
    }
  }

  setHobby(hobby) {
    if (!selectedHobby!.contains(hobby)) {
      if (selectedHobby!.length < 5) {
        selectedHobby!.add(hobby);
        // notifyListeners();
      }
      print('>>>>> $selectedHobby');
      notifyListeners();
    } else {
      selectedHobby!.removeWhere((element) => element == hobby);
      print('>>>>> $selectedHobby');
      notifyListeners();
    }
  }

  updateHobbies(BuildContext context) async {
    loading = true;
    notifyListeners();
    try {
      await usersRef.doc(firebaseAuth.currentUser!.uid).update({
        'hobbies': selectedHobby,
      });
    } catch (e) {
      loading = false;
      notifyListeners();
    }
    loading = false;
    notifyListeners();
    Navigator.pop(context);
  }
}

This is the hobby page where I am multi-selecting:

import 'package:quicktext/view_models/profile/hobby_view_model.dart';

class Hobby extends StatefulWidget {
  final UserModel user;

  const Hobby({Key? key, required this.user}) : super(key: key);

  @override
  State<Hobby> createState() => _HobbyState();
}

class _HobbyState extends State<Hobby> {
  @override
  Widget build(BuildContext context) {
    HobbyViewModel viewModel =
        Provider.of<HobbyViewModel>(context, listen: true);
    return Scaffold(
      appBar: AppBar(
        title: Text(
          'What are your Hobbies?',
          style: TextStyle(
            fontSize: 17.0,
          ),
        ),
      ),
      body: LoadingOverlay(
        isLoading: viewModel.loading,
        progressIndicator: CupertinoActivityIndicator(),
        opacity: 0.1,
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
          child: SingleChildScrollView(
            child: Wrap(
              children: viewModel.hobbyList.map(
                (hobby) {
                  viewModel.checkHobbySelected(hobby, widget.user);
                  return GestureDetector(
                    onTap: () => viewModel.setHobby(hobby),
                    child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 5, vertical: 4),
                      child: Container(
                        padding:
                            EdgeInsets.symmetric(vertical: 5, horizontal: 12),
                        decoration: BoxDecoration(
                          color: viewModel.isSelected
                              ? Color(0xffffb109)
                              : Colors.white,
                          borderRadius: BorderRadius.circular(10),
                          border: Border.all(
                            color: Colors.grey,
                          ),
                        ),
                        child: Text(
                          hobby,
                          style: TextStyle(
                            color: viewModel.isSelected
                                ? Colors.white
                                : Colors.grey,
                            fontSize: 14,
                          ),
                        ),
                      ),
                    ),
                  );
                },
              ).toList(),
            ),
          ),
        ),
      ),
      bottomNavigationBar: Padding(
        padding: const EdgeInsets.only(bottom: 100.0, right: 20.0, left: 20.0),
        child: ClipRRect(
          borderRadius: BorderRadius.circular(5.0),
          child: Container(
            height: 60.0,
            color: Theme.of(context).colorScheme.secondary,
            child: InkWell(
              onTap: () => viewModel.updateHobbies(context),
              child: Center(
                child: const Text(
                  'Done',
                  style: TextStyle(
                    fontSize: 15.0,
                    fontWeight: FontWeight.bold,
                    color: Colors.white,
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Is there anything wrong with my code? I am using provider ^6.0.1


问:
How to unset a fullscreen display on X11
I got a x11 fullscreen window working, but I can't exit it. I don't understand why there are so many answers about entering fullscreen mode but none about leaving it.

I used this code to set fullscreen:

```<code>Atom wm_state = XInternAtom (display->display, "_NET_WM_STATE", 1);
            Atom wm_fullscreen = XInternAtom (display->display, "_NET_WM_STATE_FULLSCREEN", 1);
            XEvent xev;
            memset(&xev, 0, sizeof(xev));
            xev.type = ClientMessage;
            xev.xclient.window = display->window;
            xev.xclient.message_type = wm_state;
            xev.xclient.format = 32;
            xev.xclient.data.l[0] = 1;
            xev.xclient.data.l[1] = wm_fullscreen;
            xev.xclient.data.l[2] = 0;
            XSendEvent(display->display, DefaultRootWindow(display->display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);

</code>```

I tried changing from _NET_WM_STATE_FULLSCREEN to various vaues, like _NET_WM_STATE_HIDDEN and _NET_WM_STATE_ABOVE, but none worked. I confess I don't understand exactly how this code works so that is another obstacle to getting it working. If someone understand about how sending an event with an atom containing some strange message can leyt my window full I would thank, but my focus here is to getting a disable fullscreen working.

Body:
I got a x11 fullscreen window working, but I can't exit it. I don't understand why there are so many answers about entering fullscreen mode but none about leaving it.

I used this code to set fullscreen:

Atom wm_state = XInternAtom (display->display, "_NET_WM_STATE", 1);
            Atom wm_fullscreen = XInternAtom (display->display, "_NET_WM_STATE_FULLSCREEN", 1);
            XEvent xev;
            memset(&xev, 0, sizeof(xev));
            xev.type = ClientMessage;
            xev.xclient.window = display->window;
            xev.xclient.message_type = wm_state;
            xev.xclient.format = 32;
            xev.xclient.data.l[0] = 1;
            xev.xclient.data.l[1] = wm_fullscreen;
            xev.xclient.data.l[2] = 0;
            XSendEvent(display->display, DefaultRootWindow(display->display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);

I tried changing from _NET_WM_STATE_FULLSCREEN to various vaues, like _NET_WM_STATE_HIDDEN and _NET_WM_STATE_ABOVE, but none worked. I confess I don't understand exactly how this code works so that is another obstacle to getting it working. If someone understand about how sending an event with an atom containing some strange message can leyt my window full I would thank, but my focus here is to getting a disable fullscreen working.


问:
How to remove label of `ModelSelect2Multiple` widget?
Here's a form using django-autocomplete-light

```<code>from dal import autocomplete
from django import forms

from core.models import TModel

class TForm(forms.ModelForm):

    class Meta:
        model = TModel
        fields = ('name', 'test')
        widget = autocomplete.ModelSelect2Multiple(
            'select2_many_to_many_autocomplete'
        )
        widgets = {'test': widget}
</code>```

which generates the view below

I want to remove Test: from the second field, how can I do so?

Body:
Here's a form using django-autocomplete-light

from dal import autocomplete
from django import forms

from core.models import TModel

class TForm(forms.ModelForm):

    class Meta:
        model = TModel
        fields = ('name', 'test')
        widget = autocomplete.ModelSelect2Multiple(
            'select2_many_to_many_autocomplete'
        )
        widgets = {'test': widget}

which generates the view below

I want to remove Test: from the second field, how can I do so?


问:
Installing pydoop on Google colab
I want to install pydoop library on Google Colab but it is throwing this error:

```<code>"ERROR: Failed building wheel for pydoop" and
"ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mdbgey3s/pydoop_394f3be9f4934b0c9c692367106bc46c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mdbgey3s/pydoop_394f3be9f4934b0c9c692367106bc46c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_oc5jv8s/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pydoop Check the logs for full command output."
</code>```

Is there anyway to install it on Colab since I have used !wget method but is unable to call hdfs library?

Title: Installing pydoop on Google colab

Body:
I want to install pydoop library on Google Colab but it is throwing this error:

"ERROR: Failed building wheel for pydoop" and
"ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-mdbgey3s/pydoop_394f3be9f4934b0c9c692367106bc46c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-mdbgey3s/pydoop_394f3be9f4934b0c9c692367106bc46c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_oc5jv8s/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pydoop Check the logs for full command output."

Is there anyway to install it on Colab since I have used !wget method but is unable to call hdfs library?


问:
How can I use Jinja to create/populate a table in a Word document?
I am attempting to turn my Pandas DataFrame into a table in a word document (.docx). I am using Jinja so I can control what table gets populated in the document since there are several.

However, I am unable to properly populate the table. With the code below I get three blank rows, rather than the data in the lists.

How can I properly populate the table? Is it an issue with the structure of the improvementDict or is it the Jinja?

from docxtpl import DocxTemplate

doc = DocxTemplate("weekly-report-template.docx")

# New DataFrame with improvement issue type
improvementDF = excel_file.loc[excel_file["Issue Type"] == "Improvement"]

# Create lists out of each column
improvementKeys = improvementDF['Issue key'].tolist()
improvementTitles = improvementDF['Summary'].tolist()
improvementNotes = improvementDF['Custom field (RelNote Description)'].tolist()

# Create a dictionary from the lists above
improvementDict = {"improvKey":improvementKeys,"improvTitle":improvementTitles,"improvNotes":"N/A"}

# Populate the word doc (docx)
fill_content = {'improvementTable': improvementDict }
doc.render(fill_content)
doc.save('TEST.docx')
```
<p>Here is the structure of the <code>improvementDict</code>:</p>
<pre class="lang-py prettyprint-override"><code>{'improvKey':
 ['E-1234',
  'E-1235',
  'E-1236'],

 'improvTitle':
 ['Test Title 1',
  'Test Title 2',
  'Test Title 3'],

 'improvNotes':
 [' ',
  ' ',
  ' ']}
</code>```

Hence, I would expect 3 rows with the keys in the first column, the title in the middle column, and the notes in the last column. Screenshots below:

Jinja on the word document

Result I get with current logic

Expected Result

I have tried the following:

Attempted to flatten improvementDict lists

I thought maybe this was why I would sometimes see improvKey improvTitle and improveNotes take up the table space, rather than the data.

I have gotten the data to populate before, but it would all take up one row rather than have a row for each entry in the list. I think the list itself was put in the row rather than the items in the list. Which makes me think the Jinja is the issue.

Body:
I am attempting to turn my Pandas DataFrame into a table in a word document (.docx). I am using Jinja so I can control what table gets populated in the document since there are several.

However, I am unable to properly populate the table. With the code below I get three blank rows, rather than the data in the lists.

How can I properly populate the table? Is it an issue with the structure of the improvementDict or is it the Jinja?

from docxtpl import DocxTemplate

doc = DocxTemplate("weekly-report-template.docx")

# New DataFrame with improvement issue type
improvementDF = excel_file.loc[excel_file["Issue Type"] == "Improvement"]

# Create lists out of each column
improvementKeys = improvementDF['Issue key'].tolist()
improvementTitles = improvementDF['Summary'].tolist()
improvementNotes = improvementDF['Custom field (RelNote Description)'].tolist()

# Create a dictionary from the lists above
improvementDict = {"improvKey":improvementKeys,"improvTitle":improvementTitles,"improvNotes":"N/A"}

# Populate the word doc (docx)
fill_content = {'improvementTable': improvementDict }
doc.render(fill_content)
doc.save('TEST.docx')

Here is the structure of the improvementDict:

{'improvKey':
 ['E-1234',
  'E-1235',
  'E-1236'],

 'improvTitle':
 ['Test Title 1',
  'Test Title 2',
  'Test Title 3'],

 'improvNotes':
 [' ',
  ' ',
  ' ']}

Hence, I would expect 3 rows with the keys in the first column, the title in the middle column, and the notes in the last column. Screenshots below:

Jinja on the word document

Result I get with current logic

Expected Result

I have tried the following:

Attempted to flatten improvementDict lists

I thought maybe this was why I would sometimes see improvKey improvTitle and improveNotes take up the table space, rather than the data.

I have gotten the data to populate before, but it would all take up one row rather than have a row for each entry in the list. I think the list itself was put in the row rather than the items in the list. Which makes me think the Jinja is the issue.


问:
Sort dataviewvirtuallistmodel not changing sort direction arrow
I'm using wxPython DataViewVirtualListModel. As it is virtual it does not use the built-in Compare function. I've modified the demo code DV_indexlistmodel.py with the following changes:

First change the class to virtual

```<code>class TestModel(dv.DataViewVirtualListModel):
def __init__(self, data, log):
    dv.DataViewVirtualListModel.__init__(self, len(data))
</code>```

Next add a bind to a catch the click on the column header

```<code>        self.Bind(dv.EVT_DATAVIEW_COLUMN_HEADER_CLICK, self.on_col_click)

def on_col_click(self, event):
    if event.DataViewColumn.IsSortKey():
        ascending = not event.DataViewColumn.IsSortOrderAscending()
    else:
        ascending = True

    event.DataViewColumn.SetSortOrder(ascending)
    self.model.Reset(len(self.model.data))
</code>```

Catching the col click in DataViewIndexListModel also leads to the same result

I can't find an instruction to remove the previous column. In my full code, the sort works fine, you just have the arrows left behind when you click on another column. The only command appears to be the SetSortOrder, which does change the column but doesn't cleanup the old one.

Body:
I'm using wxPython DataViewVirtualListModel. As it is virtual it does not use the built-in Compare function. I've modified the demo code DV_indexlistmodel.py with the following changes:

First change the class to virtual

class TestModel(dv.DataViewVirtualListModel):
def __init__(self, data, log):
    dv.DataViewVirtualListModel.__init__(self, len(data))

Next add a bind to a catch the click on the column header

        self.Bind(dv.EVT_DATAVIEW_COLUMN_HEADER_CLICK, self.on_col_click)

def on_col_click(self, event):
    if event.DataViewColumn.IsSortKey():
        ascending = not event.DataViewColumn.IsSortOrderAscending()
    else:
        ascending = True

    event.DataViewColumn.SetSortOrder(ascending)
    self.model.Reset(len(self.model.data))

Catching the col click in DataViewIndexListModel also leads to the same result

I can't find an instruction to remove the previous column. In my full code, the sort works fine, you just have the arrows left behind when you click on another column. The only command appears to be the SetSortOrder, which does change the column but doesn't cleanup the old one.


问:
How do I turn turn on and off a serial relay connected to my Raspberry Pi 3 using Python?
I own a landscaping company, and my garage has an electric garage door opener. You can probably imagine where I'm going with this. Using an old Windows PC, I had a powershell script that did what I needed. Now, I need to use that computer elsewhere, so I'm trying to make a Raspberry Pi 3 do the same thing. I need it to take input from and RFID card reader that submits a 10-digit code then passes a new line. Then, if the right code is received it needs to close the relay for a second, then open it again, so that it opens the garage door.

I tested the logic side of it, debugged a little, and the authentication works, but now I'm stuck on the serial part. Here's what I have so far:

```<code>print("Loading...")
import serial
import time
from datetime import datetime
ser = serial.Serial(
    port='/dev/ttyUSB0',
    baudrate=9600,
    timeout=1
)
def newdt():
    global now
    global fldt
    now = datetime.now()
    fldt = now.strftime("%b-%d-%Y %H--%M--%S")
newdt()
flnm = f'Log {fldt}'
def flash():
    hxon = [0xA0, 0x01, 0x01, 0xA2]
    hxoff = [0xA0, 0x01, 0x00, 0xA1]
    ser.write(serial.to_bytes(hxon))
    time.sleep(1)
    ser.write(serial.to_bytes(hxoff))
def  append_log(holder, function):
    newdt()
    app_event = datetime.now()
    app_print = now.strftime("%b-%d-%Y %H:%M:%S")
    person = holder
    with open("log.txt", "a") as log:
        log.write('\n')
        log.write(f'Time: {app_print} | Location: Garage 81504 | Person: {person} | Function: {function}')
        print(f'Time: {app_print} | Location: Garage 81504 | Person: {person} | Function: {function}')
with open("log.txt", "a") as log:
    log.write('\n')
    log.write('NewLogRun -- ')
    log.write(flnm)
c1 = "CardCode1"
ch1 = "John Doe"
c2 = "CardCode1"
ch2 = "Jane Doe"
c3 = "CardCode1"
ch3 = "Richie Doe"
c4 = "CardCode1"
ch4 = "Ronnie Doe"
c5 = "CardCode1"
ch5 = "Ruthie Doe"
c6 = "CardCode1"
c7 = "CardCode1"
c8 = "CardCode1"
c9 = "CardCode1"
c0 = "CardCode1"
ch0 = "Key"
print("Done!")
print("A Cut Above, LLC: Location 81504 - Door Server Active")
print("Ready")
while 1 == 1:
    active = input("Enter a code: ")
    if active == c1:
        append_log(ch1, "Toggle")
        flash()
    elif active == c2:
        append_log(ch2, "Toggle")
        flash()
    elif active == c3:
        append_log(ch3, "Toggle")
        flash()
    elif active == c4:
        append_log(ch4, "Toggle")
        flash()
    elif active == c5:
        append_log(ch5, "Toggle")
        flash()
    elif active == c0:
        append_log(ch0, "Lock")
        print("Door locked")
        while True:
            release = input("Enter unlock code: ")
            if release != c0:
                print("Invalid code")
                continue
            else:
                append_log(ch0, "Unlock")
                print("Door unlocked")
                break
    elif active == "exit":
        append_log("sys", "exit")
        print("Exiting...")
        break
    else:
        append_log("INVALID", "None")
        print("Invalid Code")
exit
</code>```

The program runs successfully (as sudo because of the serial parts), and displays no errors as each card is presented, but nothing happens to the relay. If it matters, this relay is on the upper right USB port on the RPi, and the card reader is in the top left. USB Relay is a generic one off of amazon. It's one-channel, and has no cord, just plugs straight into the Pi.

Body:
I own a landscaping company, and my garage has an electric garage door opener. You can probably imagine where I'm going with this. Using an old Windows PC, I had a powershell script that did what I needed. Now, I need to use that computer elsewhere, so I'm trying to make a Raspberry Pi 3 do the same thing. I need it to take input from and RFID card reader that submits a 10-digit code then passes a new line. Then, if the right code is received it needs to close the relay for a second, then open it again, so that it opens the garage door.

I tested the logic side of it, debugged a little, and the authentication works, but now I'm stuck on the serial part. Here's what I have so far:

print("Loading...")
import serial
import time
from datetime import datetime
ser = serial.Serial(
    port='/dev/ttyUSB0',
    baudrate=9600,
    timeout=1
)
def newdt():
    global now
    global fldt
    now = datetime.now()
    fldt = now.strftime("%b-%d-%Y %H--%M--%S")
newdt()
flnm = f'Log {fldt}'
def flash():
    hxon = [0xA0, 0x01, 0x01, 0xA2]
    hxoff = [0xA0, 0x01, 0x00, 0xA1]
    ser.write(serial.to_bytes(hxon))
    time.sleep(1)
    ser.write(serial.to_bytes(hxoff))
def  append_log(holder, function):
    newdt()
    app_event = datetime.now()
    app_print = now.strftime("%b-%d-%Y %H:%M:%S")
    person = holder
    with open("log.txt", "a") as log:
        log.write('\n')
        log.write(f'Time: {app_print} | Location: Garage 81504 | Person: {person} | Function: {function}')
        print(f'Time: {app_print} | Location: Garage 81504 | Person: {person} | Function: {function}')
with open("log.txt", "a") as log:
    log.write('\n')
    log.write('NewLogRun -- ')
    log.write(flnm)
c1 = "CardCode1"
ch1 = "John Doe"
c2 = "CardCode1"
ch2 = "Jane Doe"
c3 = "CardCode1"
ch3 = "Richie Doe"
c4 = "CardCode1"
ch4 = "Ronnie Doe"
c5 = "CardCode1"
ch5 = "Ruthie Doe"
c6 = "CardCode1"
c7 = "CardCode1"
c8 = "CardCode1"
c9 = "CardCode1"
c0 = "CardCode1"
ch0 = "Key"
print("Done!")
print("A Cut Above, LLC: Location 81504 - Door Server Active")
print("Ready")
while 1 == 1:
    active = input("Enter a code: ")
    if active == c1:
        append_log(ch1, "Toggle")
        flash()
    elif active == c2:
        append_log(ch2, "Toggle")
        flash()
    elif active == c3:
        append_log(ch3, "Toggle")
        flash()
    elif active == c4:
        append_log(ch4, "Toggle")
        flash()
    elif active == c5:
        append_log(ch5, "Toggle")
        flash()
    elif active == c0:
        append_log(ch0, "Lock")
        print("Door locked")
        while True:
            release = input("Enter unlock code: ")
            if release != c0:
                print("Invalid code")
                continue
            else:
                append_log(ch0, "Unlock")
                print("Door unlocked")
                break
    elif active == "exit":
        append_log("sys", "exit")
        print("Exiting...")
        break
    else:
        append_log("INVALID", "None")
        print("Invalid Code")
exit

The program runs successfully (as sudo because of the serial parts), and displays no errors as each card is presented, but nothing happens to the relay. If it matters, this relay is on the upper right USB port on the RPi, and the card reader is in the top left. USB Relay is a generic one off of amazon. It's one-channel, and has no cord, just plugs straight into the Pi.


问:
List all tags containing a commit or PR on github
How can I determine if a given tag in a repository on github (to which I have access) includes a particular commit or pull request. Essentially, which tagged versions include a particular fix/extension that the commit or PR represent.

My question is essentially similar to this one, except I would like to do it either on a remote clone (eg: github) or via the github web interface.


问:
Ambiguity in styling a html page after extending from base.html
I am trying to add flex-box in the login page. But since i am extending from 'base.html' i am not able to add it to the whole page, but only part of it.

I think the problem is happening because I am extending the html page from.base.html.

See this image please

I need the flex boxes for the whole page. what should i do to get it on whole page.

base.html

```<code><!DOCTYPE html>
 {% load static %}
 <html lang="en" dir="ltr">
            <head>
            <meta charset="utf-8">
            <title>Star Social</title>

            <!-- Latest compiled and minified CSS -->
            <link rel="stylesheet"
             href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
            integrity="sha384-
            MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
            crossorigin="anonymous">

            <!-- Alternative to Bootstrap 3 Glyphicons -->
            <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-
            awesome.min.css" rel="stylesheet">

            <link href="https://fonts.googleapis.com/css?family=Montserrat"
             rel="stylesheet">

            <link rel="stylesheet" href="{% static 'simplesocial/css/master.css'%}">
            <link rel="stylesheet" href="{% static 'css/master.css' %}">

            </head>
            <body>

            <nav class="navbar navbar-expand-lg bg-dark mynav" role='navigation' id='navbar'>
              <div class="container">
                <a class="navbar-brand mynav" href="{% url 'home' %}">Star Social</a>

                <ul class="nav navbar-nav navbar-right">
                  {% if user.is_authenticated %}
                    <li><a class="nav-item nav-link" href="{% url 'posts:create' %}">Post</a></li>
                    <li><a class="nav-item nav-link" href="{% url 'groups:all' %}">Groups</a></li>
                    <li><a class="nav-item nav-link" href="{% url 'groups:create' %}">Create Group</a></li>
                    <li><a class="nav-item nav-link" href="{% url 'accounts:logout' %}">Logout</a></li>
                  {% else %}
                    <li><a class="nav-item nav-link" href="{% url 'groups:all' %}">Groups</a></li>
                    <li><a class="nav-item nav-link" href="{% url 'accounts:login' %}">Login</a></li>
                    <li><a class="nav-item nav-link" href="{% url 'accounts:signup' %}">Sign Up</a></li>
                  {% endif %}
                </ul>
              </div>
            </nav>

              {% block content %}

              {% endblock %}

<script type="text/javascript" src="{% static 'implesocial/js/master.js' %}"></script>

<!-- Latest compiled and minified jQuery -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>

      </body>
    </html>
</code>```

login.html

```<code>{% extends 'base.html' %}
{% load bootstrap3 %}

{% block content %}
<section>

  <span></span>
       .
       .
       .
       .
  <span></span>

<div class="signin">
  <div class="content">
    <h2>Login</h2>
    <form  method="POST" class="form">
      {% csrf_token %}
      {% bootstrap_form form %}
      <input type="submit" class="btn btn-default login_btn" value="Login">
    </form>
  </div>
</div>

</section>

{% endblock %}
</code>```

CSS

```<code>body{
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #000;
  flex-wrap: wrap;
}

section{
  margin-left: 200px;
  position: absolute;
  width: 100vh;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  /* background: red; */
  gap: 2px;
  flex-wrap: wrap;

}

section span{
  position: relative;
  display: block;
  width: calc(6.25vw - 2px);
  height: calc(6.25vw - 2px);
  background: #181818;
  z-index: 2;
}

section .signin{
  position: absolute;
  width: 100vh;
  background: #222;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  border-radius: 40px;
  box-shadow: 0 15px 35px rgba(0,0,0,0,5)
}

section .signin .content{
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 40px;
}

section .signin .content h2{
  font-size: 2em;
  color: #0f0;
  text-transform: uppercase;
}

section .signin .content .form{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

section .signin .content .form .form-group{
  position: relative;
  width: 100%
}

section .signin .content .form .form-group input{
  position: relative;
  width: 100%;
  background: #333;
  border: none;
  outline: none;
  /* padding: 25px 10px 7.5px; */
  border-radius: 4px;
  color: #fff;
  font-weight: 500;
  font-size: 1em;
}

section .signin .content .form .form-group label{
  position: absolute;
  left: 0;
  padding: 15px 10px;
  font-style: normal;
  color: #aaa;
  transition: 0.5s;
  pointer-events: none;
}

section .signin .content .form .form-group input :focus ~ label,
section .signin .content .form .form-group input :valid ~ label,
{
  transform:translateY(-7.5px);
  font-size: 0.8em;
  color: #fff;
}

section .signin .content .form .login_btn
{
  padding: 10px;
  background: #0f0;
  color: #111;
  font-weight: 600;
  font-size: 1.25em;
  letter-spacing: 0.05em;
  cursor: pointer;
}
</code>```

Body:
I am trying to add flex-box in the login page. But since i am extending from 'base.html' i am not able to add it to the whole page, but only part of it.

I think the problem is happening because I am extending the html page from.base.html.

See this image please

I need the flex boxes for the whole page. what should i do to get it on whole page.

base.html

<!DOCTYPE html>
 {% load static %}

            <meta charset="utf-8">
            <title>Star Social</title>

            <link rel="stylesheet"
             href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
            integrity="sha384-
            MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
            crossorigin="anonymous">

            <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-
            awesome.min.css" rel="stylesheet">

            <link href="https://fonts.googleapis.com/css?family=Montserrat"
             rel="stylesheet">

            <link rel="stylesheet" href="{% static 'simplesocial/css/master.css'%}">
            <link rel="stylesheet" href="{% static 'css/master.css' %}">

                Star Social

                  {% if user.is_authenticated %}

Post

Groups

Create Group

Logout

                  {% else %}

Groups

Login

Sign Up

                  {% endif %}

              {% block content %}

              {% endblock %}

login.html

{% extends 'base.html' %}
{% load bootstrap3 %}

{% block content %}

       .
       .
       .
       .

Login

    <form  method="POST" class="form">
      {% csrf_token %}
      {% bootstrap_form form %}
      <input type="submit" class="btn btn-default login_btn" value="Login">
    </form>

{% endblock %}

CSS

body{
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #000;
  flex-wrap: wrap;
}

section{
  margin-left: 200px;
  position: absolute;
  width: 100vh;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  /* background: red; */
  gap: 2px;
  flex-wrap: wrap;

}

section span{
  position: relative;
  display: block;
  width: calc(6.25vw - 2px);
  height: calc(6.25vw - 2px);
  background: #181818;
  z-index: 2;
}

section .signin{
  position: absolute;
  width: 100vh;
  background: #222;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  border-radius: 40px;
  box-shadow: 0 15px 35px rgba(0,0,0,0,5)
}

section .signin .content{
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 40px;
}

section .signin .content h2{
  font-size: 2em;
  color: #0f0;
  text-transform: uppercase;
}

section .signin .content .form{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

section .signin .content .form .form-group{
  position: relative;
  width: 100%
}

section .signin .content .form .form-group input{
  position: relative;
  width: 100%;
  background: #333;
  border: none;
  outline: none;
  /* padding: 25px 10px 7.5px; */
  border-radius: 4px;
  color: #fff;
  font-weight: 500;
  font-size: 1em;
}

section .signin .content .form .form-group label{
  position: absolute;
  left: 0;
  padding: 15px 10px;
  font-style: normal;
  color: #aaa;
  transition: 0.5s;
  pointer-events: none;
}

section .signin .content .form .form-group input :focus ~ label,
section .signin .content .form .form-group input :valid ~ label,
{
  transform:translateY(-7.5px);
  font-size: 0.8em;
  color: #fff;
}

section .signin .content .form .login_btn
{
  padding: 10px;
  background: #0f0;
  color: #111;
  font-weight: 600;
  font-size: 1.25em;
  letter-spacing: 0.05em;
  cursor: pointer;
}


问:
compose BlendMode Compatibility issues
I want a Black and white mode

```<code>Surface(color = MaterialTheme.colors.background,) {

    MainPage()//Text Image

    Canvas(modifier = Modifier.fillMaxSize()){
        drawRect(
            color = Color.White,
            blendMode = BlendMode.Saturation
        )
    }
}
</code>```

but BlendMode Added in API level 29    BlendMode

what about 28- ？  my test phone is API  26  android 8.0 , white screen

in android View

```<code>mGrayMatrix.setSaturation(0f)
mGrayPaint.colorFilter = ColorMatrixColorFilter(mGrayMatrix)
view.setLayerType(View.LAYER_TYPE_HARDWARE, mGrayPaint)
</code>```

all view change

CompositionLocalProvider、Brush   is too tedious

i need help

in details

Title: compose BlendMode Compatibility issues

Body:
I want a Black and white mode

Surface(color = MaterialTheme.colors.background,) {

    MainPage()//Text Image

    Canvas(modifier = Modifier.fillMaxSize()){
        drawRect(
            color = Color.White,
            blendMode = BlendMode.Saturation
        )
    }
}

but BlendMode Added in API level 29    BlendMode

what about 28- ？  my test phone is API  26  android 8.0 , white screen

in android View

mGrayMatrix.setSaturation(0f)
mGrayPaint.colorFilter = ColorMatrixColorFilter(mGrayMatrix)
view.setLayerType(View.LAYER_TYPE_HARDWARE, mGrayPaint)

all view change

CompositionLocalProvider、Brush   is too tedious

i need help

in details


问:
Safari on iOS doesn't show ellipsis on text overflow
My code:

span {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis !important;
  white-space: nowrap;
  vertical-align: bottom;
  width: 50px;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><p>Hello <span>abcdefghijklmnopqrstuvwxyz</span> World!</p></code>```

Chrome on Desktop

Safari on iOS

Somehow, the "..." isn't displayed in Safari.

If I select the number on my IPhone, it certainly overflows, so IMO the "..." should be shown.

Does anyone know why this could be happening? I searched online, but couldn't find anything about it.

Body:
My code:

span {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis !important;
  white-space: nowrap;
  vertical-align: bottom;
  width: 50px;
}

Hello abcdefghijklmnopqrstuvwxyz World!

Chrome on Desktop

Safari on iOS

Somehow, the "..." isn't displayed in Safari.

If I select the number on my IPhone, it certainly overflows, so IMO the "..." should be shown.

Does anyone know why this could be happening? I searched online, but couldn't find anything about it.