问:
How to close timertask void when it is started
How I can stoped or canceled my timertask void ?
Because TimerTask void stopped my loop and I don't know how I can resolve my problem.

```<code>import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;
import java.util.Random;

public class Main {
    public static void main(String [] args) throws Exception {
        int hp = 10;
        Scanner sc = new Scanner(System.in);
        do{
            Random los = new Random();
            int pc = 1 + los.nextInt(6);
            TimerTask zd = new TimerTask(){
                public void run(){
                    System.out.println("Czas off");
                    System.out.println("5 sek");

                 }

            };
            Timer czas = new Timer();
            czas.schedule(zd, 5 * 1000);
            System.out.println("5 sek na odp");

            String odp = sc.nextLine();
            switch(odp){
                case "atk":
                    System.out.println("oo tak");
                     hp = hp - pc;
                    System.out.println("hp spadlo o " + pc + " "  + " wynosi " + hp);

                    break;
                default:
                    System.out.println("zle");

                    hp = hp + pc;
                    System.out.println("hp wzroslo o " + pc);

                }

           }while(hp>0);

                System.out.println("pokonany");
    }

}
</code>```

There is a code, when time out. My loop has stop working and them is starter a void run, but I cant go back to my loop. How I can resolve this?

I'm try using zd.cancel();
But this doesnt work.
And I'm make another methods without i came back to main methods again, then I have a bugs with program.

Body:
How I can stoped or canceled my timertask void ?
Because TimerTask void stopped my loop and I don't know how I can resolve my problem.

import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;
import java.util.Random;

public class Main {
    public static void main(String [] args) throws Exception {
        int hp = 10;
        Scanner sc = new Scanner(System.in);
        do{
            Random los = new Random();
            int pc = 1 + los.nextInt(6);
            TimerTask zd = new TimerTask(){
                public void run(){
                    System.out.println("Czas off");
                    System.out.println("5 sek");

                 }

            };
            Timer czas = new Timer();
            czas.schedule(zd, 5 * 1000);
            System.out.println("5 sek na odp");

            String odp = sc.nextLine();
            switch(odp){
                case "atk":
                    System.out.println("oo tak");
                     hp = hp - pc;
                    System.out.println("hp spadlo o " + pc + " "  + " wynosi " + hp);

                    break;
                default:
                    System.out.println("zle");

                    hp = hp + pc;
                    System.out.println("hp wzroslo o " + pc);

                }

           }while(hp>0);

                System.out.println("pokonany");
    }

}

There is a code, when time out. My loop has stop working and them is starter a void run, but I cant go back to my loop. How I can resolve this?

I'm try using zd.cancel();
But this doesnt work.
And I'm make another methods without i came back to main methods again, then I have a bugs with program.


来源: stackexchange

问:
Mongoose find parent if children count is greater than 5 by grouping children of another table
I want to find only 20 Parent records in LIFO order if it has more than 5 children. Children is a different table. Highly appreciate your help!

Parent table name - Content

```<code>import { model, Schema, Model, Document } from "mongoose";

const ContentSchema: Schema = new Schema({
  userId: String,
  contentType: String,
},
  { timestamps: { createdAt: 'createdOn' } }
);

export const Content = model("Content", ContentSchema);
</code>```

Child table name - Transaction

```<code>import { model, Schema, Model, Document } from "mongoose";

const TransactionSchema: Schema = new Schema({
  contentId: { type: Schema.Types.ObjectId, ref: 'Content' }
},
  { timestamps: { createdAt: 'createdOn' } }
);

export const Transaction = model("Transaction", TransactionSchema);
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I want to find only 20 Parent records in LIFO order if it has more than 5 children. Children is a different table. Highly appreciate your help!

Parent table name - Content

import { model, Schema, Model, Document } from "mongoose";

const ContentSchema: Schema = new Schema({
  userId: String,
  contentType: String,
},
  { timestamps: { createdAt: 'createdOn' } }
);

export const Content = model("Content", ContentSchema);

Child table name - Transaction

import { model, Schema, Model, Document } from "mongoose";

const TransactionSchema: Schema = new Schema({
  contentId: { type: Schema.Types.ObjectId, ref: 'Content' }
},
  { timestamps: { createdAt: 'createdOn' } }
);

export const Transaction = model("Transaction", TransactionSchema);


问:
Why the API route don't work on deployment on vercel
Anyone can help me, the api route work perfectly on my local projet, but if I deploy on vercel, the api route don't work. Many thanks.

I want to have access to my the api route.


问:
How can I get similarity rate between columns in different dataframes and label the data
I need to compute differences between rows in different dataframes. On one hand I have df1 with 150 different rows with specific phrases. On the other hand I have df2 with 250k of rows with any type of phrases. I want to compare each row in df1 with each row in df2 getting or labeling all the rows in df2 that have a value higher than a threshold (to be determinated) I use SequenceMatcher in order to get the similarity between them.

How could i do it? Any advice in order to do it in the more efficient way? How you code that?

df1 (len = 150)

Phrases

My cat is black

Dog is white

Peter is waiting

Dog is white

df2 (len = 250k)

Phrases

My cat is white

Dog is jumping

Marcos is waiting

Dog is white

Output:

Phrases
Labels

My cat is white
0.75

My cat is white
0

My cat is white
0

My cat is white
0.33

Dog is jumping
0.33

Dog is jumping
0.66

Dog is jumping
0.33

Dog is jumping
0.66

Marcos is waiting
0.33

Marcos is waiting
0.33

Marcos is waiting
0.66

Marcos is waiting
0.33

Dog is white
0.5

Dog is white
0.66

Dog is white
0.33

Dog is white
1


问:
What i can do for fix problem at result code(Cant add smth after surname add)?
My code:

```<code>#include <stdio.h>
#include <string.h>

struct STUDENT{
    char Surname[50];
    char Name;
    char Patronymic;
    int Group;
    int Performance[5];
};

int main(){
    int Len;
    printf("Input amount of student's: ");
    scanf("%d",&Len);
    struct STUDENT info[Len];
    for(int i = 0; i < Len; i++){
        printf("Input Surname of student: ");
        scanf("%s", info[i].Surname);

        printf("Input Name of student: ");
        info[i].Name = getchar();

        printf("Input Patronymic of student: ");
        info[i].Patronymic = getchar();

        printf("Input Group of student: ");
        scanf("%d",&info[i].Group);

        for(int j = 0; j < 5; j++){
            printf("Input Performance of student: ");
            info[i].Performance[j] = getchar();
        }
    }

    char SurSwap[50];
    char NameSwap;
    char PatronymicSwap;
    int GroupSwap;
    int PerformanceSwap[5];

    for(int i = 0; i < Len; i++){
        for(int j = 0; j < Len - 1; j++){
            if(info[j].Group < info[j + 1].Group){

                strcpy(SurSwap, info[j].Surname);
                strcpy(info[j].Surname, info[j + 1].Surname);
                strcpy(info[j + 1].Surname, SurSwap);

                NameSwap = info[j].Name;
                info[j].Name = info[j + 1].Name;
                info[j + 1].Name = NameSwap;

                PatronymicSwap = info[j].Patronymic;
                info[j].Patronymic = info[j + 1].Patronymic;
                info[j + 1]. Patronymic = PatronymicSwap;

                GroupSwap = info[j].Group;
                info[j].Group = info[j + 1].Group;
                info[j + 1].Group = GroupSwap;

                for(int q = 0; q < 5; q++){
                    PerformanceSwap[q] = info[j].Performance[q];
                    info[j].Performance[q] = info[j + 1].Performance[q];
                    info[j + 1].Performance[q] = PerformanceSwap[q];

                }
            }
        }
    }
    printf("\nDatabase of student:\nSurname\tName\tPatronymic\tGroup\tPerformance");
    for(int i = 0; i < Len; i++){
        printf("\n%s", info[i].Surname);
        printf("\t%c", info[i].Name);
        printf("\t%c", info[i].Patronymic);
        printf("\t%d\t", info[i].Group);
        for(int j = 0; j < 5; j++)
            printf("%d ", info[i].Performance[j]);
    }
}
</code>```

My result: Input amount of student's: 3
Input Surname of student: solo
Input Name of student: Input Patronymic of student:

Dont know why this code are broken, after input surname - code are stoped.Help smth pls.I'm trying swaped type of Name to Arr, but have this problem too. As i know its 137 error; but i cant doing smth with this

Body:
My code:

#include <stdio.h>
#include <string.h>

struct STUDENT{
    char Surname[50];
    char Name;
    char Patronymic;
    int Group;
    int Performance[5];
};

int main(){
    int Len;
    printf("Input amount of student's: ");
    scanf("%d",&Len);
    struct STUDENT info[Len];
    for(int i = 0; i < Len; i++){
        printf("Input Surname of student: ");
        scanf("%s", info[i].Surname);

        printf("Input Name of student: ");
        info[i].Name = getchar();

        printf("Input Patronymic of student: ");
        info[i].Patronymic = getchar();

        printf("Input Group of student: ");
        scanf("%d",&info[i].Group);

        for(int j = 0; j < 5; j++){
            printf("Input Performance of student: ");
            info[i].Performance[j] = getchar();
        }
    }

    char SurSwap[50];
    char NameSwap;
    char PatronymicSwap;
    int GroupSwap;
    int PerformanceSwap[5];

    for(int i = 0; i < Len; i++){
        for(int j = 0; j < Len - 1; j++){
            if(info[j].Group < info[j + 1].Group){

                strcpy(SurSwap, info[j].Surname);
                strcpy(info[j].Surname, info[j + 1].Surname);
                strcpy(info[j + 1].Surname, SurSwap);

                NameSwap = info[j].Name;
                info[j].Name = info[j + 1].Name;
                info[j + 1].Name = NameSwap;

                PatronymicSwap = info[j].Patronymic;
                info[j].Patronymic = info[j + 1].Patronymic;
                info[j + 1]. Patronymic = PatronymicSwap;

                GroupSwap = info[j].Group;
                info[j].Group = info[j + 1].Group;
                info[j + 1].Group = GroupSwap;

                for(int q = 0; q < 5; q++){
                    PerformanceSwap[q] = info[j].Performance[q];
                    info[j].Performance[q] = info[j + 1].Performance[q];
                    info[j + 1].Performance[q] = PerformanceSwap[q];

                }
            }
        }
    }
    printf("\nDatabase of student:\nSurname\tName\tPatronymic\tGroup\tPerformance");
    for(int i = 0; i < Len; i++){
        printf("\n%s", info[i].Surname);
        printf("\t%c", info[i].Name);
        printf("\t%c", info[i].Patronymic);
        printf("\t%d\t", info[i].Group);
        for(int j = 0; j < 5; j++)
            printf("%d ", info[i].Performance[j]);
    }
}

My result: Input amount of student's: 3
Input Surname of student: solo
Input Name of student: Input Patronymic of student:

Dont know why this code are broken, after input surname - code are stoped.Help smth pls.I'm trying swaped type of Name to Arr, but have this problem too. As i know its 137 error; but i cant doing smth with this


问:
Login Entity Relation Diagram: Review and Opinions
I've made a try of an ERD, to model a login system to manage employees, accounts, netkeys, usernames and passwords in an enterprise, but I still think something's missing or could be improved.

So for this problem consists of linking a certain company and its employees with their respective account numbers, usernames, netkeys and passwords to enter websites of other companies and banks.

An employee can guard several accounts from a single bank or company, and the company is related to several banks and companies, so the employee ends up having several accounts from several banks.

Likewise, and depending on the position that the employee has, different types of permissions and privileges are granted.

Each account is associated with a unique netkey and username, and each netkey has a serial number (or id).

Here is my first try to model my problem


问:
Returning index.html with spring boot
I'm having an strange issue with using the index.html through a spring boot java controller, which has a method like this:

```<code>@GetMapping("/welcome") public String welcome() { return _index; }
</code>```

where _index is defined as the file name:

```<code>private final String _index = "index.html";
</code>```

I am also having a @Controller annotation above the class signature.

When I'm entering the /welcome endpoint, it gives a 404 error, but it should work when it returns a string of the existing file. Is there something I'm doing wrong? Long time since I did it like this.

My index.html uses javascript, that renders the content

```<code>    <!DOCTYPE html>
<html lang="en">
<head>
    <!-- Generated by JavaScript -->
    <div id="head_content"></div>
</head>
<body>
    <header>
        <!-- Generated by JavaScript -->
        <div class="wrapper">
            <div id="header_content"></div>
        </div>
    </header>
    <main>
        <!-- Generated by JavaScript -->
        <div class="wrapper">
            <div id="main_content"></div>
        </div>
    </main>
    <footer>
        <!-- Generated by JavaScript -->
        <div class="wrapper">
            <div id="footer_content"></div>
        </div>
    </footer>

    <script src="../static/javascripts/url.js"></script>

    <script src="../static/javascripts/logics/liszt.js"></script>
    <script src="../static/javascripts/logics/login.js"></script>
    <script src="../static/javascripts/logics/session/saves/saveUser.js"></script>
    <script src="../static/javascripts/logics/session/gets/getUser.js"></script>

    <script src="../static/javascripts/renderings/head_content_rendering.js"></script>
    <script src="../static/javascripts/renderings/header_content_rendering.js"></script>
    <script src="../static/javascripts/renderings/footer_content_rendering.js"></script>
    <script src="../static/javascripts/renderings/main_content_renderings/login_rendering.js"></script>
    <script src="../static/javascripts/renderings/main_content_renderings/main_content_rendering.js"></script>
</body>

</html>
</code>```

Title: Returning index.html with spring boot

Body:
I'm having an strange issue with using the index.html through a spring boot java controller, which has a method like this:

@GetMapping("/welcome") public String welcome() { return _index; }

where _index is defined as the file name:

private final String _index = "index.html";

I am also having a @Controller annotation above the class signature.

When I'm entering the /welcome endpoint, it gives a 404 error, but it should work when it returns a string of the existing file. Is there something I'm doing wrong? Long time since I did it like this.

My index.html uses javascript, that renders the content

    <!DOCTYPE html>


问:
How to log the size of each created dataframe in pandas
I am looking for a better way to write this code, possibly similar to the method used in context manager based decorator syntax for a code block

Currently, for each new data frame or data frame view created, the shape is logged to track any logical errors resulting in missing data. It would be useful for any case where I am doing automated processing on data to identify where data disappears in the script if it does.

```<code>def process_data(frame):

    shape = {}
    shape['original'] = frame.shape

    errors = frame[frame['SHIFT'].str.len() >2]
    shape['errors'] = errors.shape

    ok = frame[frame['SHIFT'].str.len() <3]
    shape['ok'] = ok.shape

    merge_list  = [v for v in (errors,ok) if v is not None]

    healed = pd.concat(merge_list)

    shape['healed'] = healed.shape

    if shape['healed'][0] != shape['original'][0] or shape['healed'][1] != shape['original'][1]:
        raise ValueError(f"Some data loss \n{shape}")
    return healed
</code>```

I would prefer to run a process with syntax similar to this.

```<code>def process_data(frame):

    with shape_info:
        frame = frame
        errors = frame[frame['SHIFT'].str.len() >2]
        ok = frame[frame['SHIFT'].str.len() <3]
        merge_list  = [v for v in (errors,ok) if v is not None]
        healed = pd.concat(merge_list)

    if shape_info.first()!=shape_info.last():
        raise ValueError(f"Some data loss \n{shape_info}")
    return healed
</code>```

Is the context manager a good way to track this?

Body:
I am looking for a better way to write this code, possibly similar to the method used in context manager based decorator syntax for a code block

Currently, for each new data frame or data frame view created, the shape is logged to track any logical errors resulting in missing data. It would be useful for any case where I am doing automated processing on data to identify where data disappears in the script if it does.

def process_data(frame):

    shape = {}
    shape['original'] = frame.shape

    errors = frame[frame['SHIFT'].str.len() >2]
    shape['errors'] = errors.shape

    ok = frame[frame['SHIFT'].str.len() <3]
    shape['ok'] = ok.shape

    merge_list  = [v for v in (errors,ok) if v is not None]

    healed = pd.concat(merge_list)

    shape['healed'] = healed.shape

    if shape['healed'][0] != shape['original'][0] or shape['healed'][1] != shape['original'][1]:
        raise ValueError(f"Some data loss \n{shape}")
    return healed

I would prefer to run a process with syntax similar to this.

def process_data(frame):

    with shape_info:
        frame = frame
        errors = frame[frame['SHIFT'].str.len() >2]
        ok = frame[frame['SHIFT'].str.len() <3]
        merge_list  = [v for v in (errors,ok) if v is not None]
        healed = pd.concat(merge_list)

    if shape_info.first()!=shape_info.last():
        raise ValueError(f"Some data loss \n{shape_info}")
    return healed

Is the context manager a good way to track this?


问:
replace NA in specific columns using a loop
In my full dataset, I have a number of columns I don't want to change, and about 40 columns, differentiated by a year value, where I want to swap out NA's for 0s. Here is what I am trying with dummy data, any advice?</p>
```<code>df <- data.frame(ID_1, ID_2, VAL1, VAL2)

ID_1 = c("1", "2", NA, "4", "5", "6", "7", "8")
ID_2 = c("A", "A", "B", "B", "C", NA, "D", "D")
VAL1 = c(100, 200, NA, 50, NA, 20, 60, 20)
VAL2 = c(5, 4, 2, 6, NA, 8, 5, 1)

for(x in 1:2){
  df[[paste0("VAL",x)]] <- ifelse(is.na(df[[paste0("VAL",x)]], 0, df[[paste0("VAL",x)]]))
}
</code>```

Body:
In my full dataset, I have a number of columns I don't want to change, and about 40 columns, differentiated by a year value, where I want to swap out NA's for 0s. Here is what I am trying with dummy data, any advice?

df <- data.frame(ID_1, ID_2, VAL1, VAL2)

ID_1 = c("1", "2", NA, "4", "5", "6", "7", "8")
ID_2 = c("A", "A", "B", "B", "C", NA, "D", "D")
VAL1 = c(100, 200, NA, 50, NA, 20, 60, 20)
VAL2 = c(5, 4, 2, 6, NA, 8, 5, 1)

for(x in 1:2){
  df[[paste0("VAL",x)]] <- ifelse(is.na(df[[paste0("VAL",x)]], 0, df[[paste0("VAL",x)]]))
}


问:
flutter: When navigating to specific tab with index, the page is rendering first tab data in third tab
In Bottom Navigation Bar, When navigating to specific tab with index in Gesture detector navigation route, the page is rendering first tab data, instead of indexed tab. The icon in navigation bar is correctly displayed pressed, but the data of that icon-index is not being displayed.

```<code>**FIRST SCREEN**

GestureDetector(
onTap: () {
var route = MaterialPageRoute(
builder:
(BuildContext context) =>
WelcomeScreen(2),
);

**SECOND SCREEN**

class WelcomeScreen extends StatefulWidget {
  static const String idScreen = "/WelcomeScreen";
  int selectedIndex = 0;

  WelcomeScreen(this.selectedIndex);

  @override
  _WelcomeScreenState createState() => _WelcomeScreenState();
}

class _WelcomeScreenState extends State<WelcomeScreen>
    with SingleTickerProviderStateMixin {
  late TabController tabController;

  void onItemClicked(int index) {
    setState(() {
      widget.selectedIndex = index;
      tabController.index = widget.selectedIndex;
    });
  }

  @override
  void initState() {
    super.initState();
    tabController = TabController(length: 3, vsync: this);
  }

  @override
  void dispose() {
    super.dispose();
    tabController.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: TabBarView(
        physics: NeverScrollableScrollPhysics(),
        controller: tabController,
        children: [A(), B(), C()],
      ),
      bottomNavigationBar: BottomNavigationBar(
        backgroundColor: const Color.fromARGB(255, 55, 54, 54),
        items: const <BottomNavigationBarItem>[
          BottomNavigationBarItem(
            icon: Icon(Icons.home),
            label: "A",
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.people),
            label: "B",
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.arrow_left),
            label: "C",
          ),
        ],
        unselectedItemColor: Colors.grey[600],
        selectedItemColor: Colors.white,
        type: BottomNavigationBarType.fixed,
        selectedLabelStyle: const TextStyle(fontSize: 12.0),
        showUnselectedLabels: true,
        currentIndex: widget.selectedIndex,
        onTap: onItemClicked,
      ),
    );
  }
}

</code>```

Looking forward for help!

Body:
In Bottom Navigation Bar, When navigating to specific tab with index in Gesture detector navigation route, the page is rendering first tab data, instead of indexed tab. The icon in navigation bar is correctly displayed pressed, but the data of that icon-index is not being displayed.

**FIRST SCREEN**

GestureDetector(
onTap: () {
var route = MaterialPageRoute(
builder:
(BuildContext context) =>
WelcomeScreen(2),
);

**SECOND SCREEN**

class WelcomeScreen extends StatefulWidget {
  static const String idScreen = "/WelcomeScreen";
  int selectedIndex = 0;

  WelcomeScreen(this.selectedIndex);

  @override
  _WelcomeScreenState createState() => _WelcomeScreenState();
}

class _WelcomeScreenState extends State<WelcomeScreen>
    with SingleTickerProviderStateMixin {
  late TabController tabController;

  void onItemClicked(int index) {
    setState(() {
      widget.selectedIndex = index;
      tabController.index = widget.selectedIndex;
    });
  }

  @override
  void initState() {
    super.initState();
    tabController = TabController(length: 3, vsync: this);
  }

  @override
  void dispose() {
    super.dispose();
    tabController.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: TabBarView(
        physics: NeverScrollableScrollPhysics(),
        controller: tabController,
        children: [A(), B(), C()],
      ),
      bottomNavigationBar: BottomNavigationBar(
        backgroundColor: const Color.fromARGB(255, 55, 54, 54),
        items: const <BottomNavigationBarItem>[
          BottomNavigationBarItem(
            icon: Icon(Icons.home),
            label: "A",
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.people),
            label: "B",
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.arrow_left),
            label: "C",
          ),
        ],
        unselectedItemColor: Colors.grey[600],
        selectedItemColor: Colors.white,
        type: BottomNavigationBarType.fixed,
        selectedLabelStyle: const TextStyle(fontSize: 12.0),
        showUnselectedLabels: true,
        currentIndex: widget.selectedIndex,
        onTap: onItemClicked,
      ),
    );
  }
}

Looking forward for help!


问:
How to move CVAT (its docker container/data) to another partition on Windows 10?
I'm using CVAT to annotate videos for a computer vision task. CVAT is running through a docker container on windows 10. The problem is that CVAT gives an error that there is no enough storage space when I try to export my dataset.

I want to move CVAT (its docker container/volumes) to another hard drive partition that has enough space without losing any of my annotation tasks.

The reason is that I need to move CVAT to somewhere where there is enough space to export my dataset.

I haven't tried much. my only concern is losing any of my annotation tasks.


问:
API 31, android 12 and android:exported="true"
I have a big problem, i had an android application with flutter since two or three years, and i just want to correct a little bug. It's perfectly working in my computer but when i want to upload the new release in the playstore it's tell me that i have to upgrade the API cible at 31.
I have do this but after it tell me a new error :

You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher. See: developer.android.com/about/versions/12/behavior-changes-12#exported

I'm looking for an easy solution since this morning, but with no success.. i read that i have to add this code android:exported="true" but after that i have the same problem...

this is my AndroidManifest.xml :

```<code><manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.my.App_app">
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="App Label"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>

                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@mipmap/ic_launcher2" />
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

</code>```

Thanks in advance !

Body:
I have a big problem, i had an android application with flutter since two or three years, and i just want to correct a little bug. It's perfectly working in my computer but when i want to upload the new release in the playstore it's tell me that i have to upgrade the API cible at 31.
I have do this but after it tell me a new error :

You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher. See: developer.android.com/about/versions/12/behavior-changes-12#exported

I'm looking for an easy solution since this morning, but with no success.. i read that i have to add this code android:exported="true" but after that i have the same problem...

this is my AndroidManifest.xml :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.my.App_app">

    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="App Label"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">

            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />

            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>

                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@mipmap/ic_launcher2" />

        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

Thanks in advance !


问:
How to do file integrity monitoring for ClickHouse?
I have a use case where I store logs in ClickHouse database partitioned by day. Once logs are written they will not be updated. I want to monitor the integrity of the data files to validate they are not modified. A simple solution is to calculate md5 hash of all files of that partition. But ClickHouse performs background merges based on some kinds of "heuristic" algorithms. So the question is if I stop inserting rows into one partition and I run OPTIMIZE TABLE .. FINAL on that partition, is it guaranteed that no merge will happen for that partition anymore? If so, I think I can use this md5 hash approach.

The intention of this use case is to check for hypothetical “hacker” that may intentionally modify the files.


问:
How to bypass the disambiguation dialog when clicking on a URL?
For my users, I send a verification email in Firebase. The link that I receive is:

```<code>https://myprojectid.firebaseapp.com/...
</code>```

When a user clicks the link I want to open my app and navigate to a specific screen. So here is what I have tried. Inside the manifest file I have:

```<code><activity
    android:name=".MainActivity"
    android:exported="true">

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="https" android:host="myprojectid.firebaseapp.com"/>
    </intent-filter>

    <meta-data
        android:name="android.app.lib_name"
        android:value="" />
</activity>
</code>```

I read here, that adding android:autoVerify="true" will stop the disambiguation dialog to appear. But that isn't true. Here is also my NavHost:

```<code>NavHost(
    navController = navController,
    startDestination = Screen.SignInScreen.route
) {
    composable(
        route = Screen.SignInScreen.route
    ) {
        SignInScreen{
            navController.navigate(Screen.CheckScreen.route)
        }
    }
    composable(
        route = Screen.CheckScreen.route,
        deepLinks = listOf(
            navDeepLink {
                uriPattern = "https://myprojectid.firebaseapp.com"
                action = Intent.ACTION_VIEW
            }
        )
    ) {
        CheckScreen()
    }
}
</code>```

When I click the link, I am still asked to choose between opening with Chrome or my app. How can I avoid that? Any help would be greatly appreciated.

Body:
For my users, I send a verification email in Firebase. The link that I receive is:

https://myprojectid.firebaseapp.com/...

When a user clicks the link I want to open my app and navigate to a specific screen. So here is what I have tried. Inside the manifest file I have:

<activity
    android:name=".MainActivity"
    android:exported="true">

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="https" android:host="myprojectid.firebaseapp.com"/>
    </intent-filter>

    <meta-data
        android:name="android.app.lib_name"
        android:value="" />
</activity>

I read here, that adding android:autoVerify="true" will stop the disambiguation dialog to appear. But that isn't true. Here is also my NavHost:

NavHost(
    navController = navController,
    startDestination = Screen.SignInScreen.route
) {
    composable(
        route = Screen.SignInScreen.route
    ) {
        SignInScreen{
            navController.navigate(Screen.CheckScreen.route)
        }
    }
    composable(
        route = Screen.CheckScreen.route,
        deepLinks = listOf(
            navDeepLink {
                uriPattern = "https://myprojectid.firebaseapp.com"
                action = Intent.ACTION_VIEW
            }
        )
    ) {
        CheckScreen()
    }
}

When I click the link, I am still asked to choose between opening with Chrome or my app. How can I avoid that? Any help would be greatly appreciated.


问:
Create database one to many relations in fastapi
I want to create one to many relations using fastapi async database but unable to fine how. Models code is below

```<code>poolTable = Table(
    "pools",
    metadata,
    Column("id", Integer, primary_key=True),
    Column("poolName", String, unique=True,index=True),
)

domainTable = Table(
    "domain",
    metadata,
    Column("id", Integer, primary_key=True),
    Column("domain", String, unique=True,index=True),
    Column("pool", String, ForeignKey("pools.poolName"))
)
</code>```

I just want to add domains in pools table.

Body:
I want to create one to many relations using fastapi async database but unable to fine how. Models code is below

poolTable = Table(
    "pools",
    metadata,
    Column("id", Integer, primary_key=True),
    Column("poolName", String, unique=True,index=True),
)

domainTable = Table(
    "domain",
    metadata,
    Column("id", Integer, primary_key=True),
    Column("domain", String, unique=True,index=True),
    Column("pool", String, ForeignKey("pools.poolName"))
)

I just want to add domains in pools table.


问:
Limit route groups HTTP methods in Echo
I'm using groups in Echo to pack some routes with a common prefix but when I get the list of routes, it returns routes for all HTTP methods.

main.go

```<code>e := echo.New()
adminGroup := e.Group("/admin")
adminGroup.GET("/", adminIndex)
</code>```

I use this to get list of routes:

```<code>e.Routes()
</code>```

Output

```<code>...
   {
      "method": "TRACE",
      "path": "/admin/*",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "PATCH",
      "path": "/admin",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "PROPFIND",
      "path": "/admin",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "GET",
      "path": "/admin/*",
      "name": "github.com/labstack/echo/v4.glob..func1"
   }
...

</code>```

I expect to get route just to GET admin/

Title: Limit route groups HTTP methods in Echo

Body:
I'm using groups in Echo to pack some routes with a common prefix but when I get the list of routes, it returns routes for all HTTP methods.

main.go

e := echo.New()
adminGroup := e.Group("/admin")
adminGroup.GET("/", adminIndex)

I use this to get list of routes:

e.Routes()

Output

...
   {
      "method": "TRACE",
      "path": "/admin/*",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "PATCH",
      "path": "/admin",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "PROPFIND",
      "path": "/admin",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "GET",
      "path": "/admin/*",
      "name": "github.com/labstack/echo/v4.glob..func1"
   }
...

I expect to get route just to GET admin/


问:
Uncaught ReferenceError: editNote is not defined at HTMLElement.onclick in react js
index.html

`` const notes = JSON.parse(sessionStorage.getItem("notes") || "[]"); //reading sessionstorage to get notes if exists.
let itemm = () =>
setTimeout(() => {
const addNote = document.querySelector(".displayNote-Container"),
newNote = document.querySelector(".newNote-Container"),
headingTitle = document.querySelector("h2"),
getTitle = newNote.querySelector("input"),
getTextarea = newNote.querySelector("textarea"),
createBtn = newNote.querySelector("button"),
notearea = addNote.querySelector(".note-details");

```<code>const months = [
  "Jan",
  "Feb",
  "Mar",
  "Apr",
  "May",
  "Jun",
  "Jul",
  "Aug",
  "Sept",
  "Oct",
  "Nov",
  "Dec",
]; // Months in below function display in number, hence created an array to display month with Name.
let isUpdate = false,
  updateId; //declaring variables to check if to update or create new.
function showNotes() {
  document.querySelectorAll(".notes").forEach((note) => note.remove());
  notes.forEach((note, index) => {
    let listData = `<li>
                 ``
</code>```

header 1
header 2

cell 1
cell 2

cell 3
cell 4

``

${note.Title}

${note.desc}

```<code>                     ${note.date}

                        Choose:
                        Red
                        Gold
                        Gren
                        Blue

                        <i></i>
                        <ul>
                            <li><i></i>Edit</li>
                            <li> <i></i>Delete </li>
                            </ul>

                            </li>`;

    addNote.insertAdjacentHTML("afterbegin", listData); //
  });
}

showNotes();

//menu function, edit.
function editNote(noteNo, title, desc) {
  isUpdate = true;
  createBtn.innerText = "Update Note";
  headingTitle.textContent = "Update Note";
  getTitle.value = title;
  getTitle.focus();
  getTextarea.value = desc;
  updateId = noteNo;
  console.log(noteNo, title, desc);
}

//CREATE
createBtn.addEventListener("click", () => {
  let title = getTitle.value,
    notedata = getTextarea.value;

  //if title or notedata is not empty. Else
  if (title || notedata) {
    //getting current date
    let dateVar = new Date(),
      day = dateVar.getDate(),
      month = months[dateVar.getMonth()],
      year = dateVar.getFullYear();

    let newNoteData = {
      Title: title,
      desc: notedata,
      date: `${month} ${day} ${year}`, // ` is not a single inverted comma
    };

    //UPDATE
    // event is for update else.
    if (!isUpdate) {
      notes.push(newNoteData); // adding new notes from newNoteData into notes array.
      getTitle.value = "";
      getTitle.focus();
      getTextarea.value = "";
      isUpdate = false;
    } else {
      notes[updateId] = newNoteData; //updating specific id.
      createBtn.innerText = "Add Note";
      headingTitle.textContent = "Add New Note";
      getTitle.value = "";
      getTitle.focus();
      getTextarea.value = "";
      isUpdate = false;
    }
    //saving notes onto sessionstorage.
    sessionStorage.setItem("notes", JSON.stringify(notes)); //converting notes object to string.
    showNotes();
    console.log(newNoteData);
  } else console.log("Can not be empty");
});
</code>```

}, 500);
itemm();
function delNote() {
notes.splice(0, 1); // removing selected note from array
//saving updated array list to session.
sessionStorage.setItem("notes", JSON.stringify(notes)); //converting notes object to string.
itemm();
}

function showMenu(men) {
men.parentElement.classList.add("show");
document.addEventListener("click", (e) => {
// remove show class from note options class to hide menue.
if (e.target.tagName != "I" || e.target != men) {
men.parentElement.classList.remove("show");
}
});
} //menu function, show, edit and delete.

function changeRed(clr) {
findingnote =
clr.parentNode.parentNode.parentNode.querySelector(".note-details");
findingnote.className = "note-details red";
}

function changeGold(clr) {
findingnote =
clr.parentNode.parentNode.parentNode.querySelector(".note-details");
findingnote.className = "note-details gold";
}
function ChangeGreen(clr) {
findingnote =
clr.parentNode.parentNode.parentNode.querySelector(".note-details");
findingnote.className = "note-details green";
}

function changeBlue(clr) {
findingnote =
clr.parentNode.parentNode.parentNode.querySelector(".note-details");
findingnote.className = "note-details blue";
}
// fetching the data on click from New Note.

//  Copy code ``

```<code>
index.js
</code>```

import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

when i was click the edit button this error is showing to me

```<code>
(index):1 Uncaught ReferenceError: editNote is not defined
at HTMLElement.onclick
</code>```
```<code></code>```

Body:
index.html

`` const notes = JSON.parse(sessionStorage.getItem("notes") || "[]"); //reading sessionstorage to get notes if exists.
let itemm = () =>
setTimeout(() => {
const addNote = document.querySelector(".displayNote-Container"),
newNote = document.querySelector(".newNote-Container"),
headingTitle = document.querySelector("h2"),
getTitle = newNote.querySelector("input"),
getTextarea = newNote.querySelector("textarea"),
createBtn = newNote.querySelector("button"),
notearea = addNote.querySelector(".note-details");

const months = [
  "Jan",
  "Feb",
  "Mar",
  "Apr",
  "May",
  "Jun",
  "Jul",
  "Aug",
  "Sept",
  "Oct",
  "Nov",
  "Dec",
]; // Months in below function display in number, hence created an array to display month with Name.
let isUpdate = false,
  updateId; //declaring variables to check if to update or create new.
function showNotes() {
  document.querySelectorAll(".notes").forEach((note) => note.remove());
  notes.forEach((note, index) => {
    let listData = `

                 ``

header 1
header 2

cell 1
cell 2

cell 3
cell 4

``

${note.Title}

${note.desc}

                     ${note.date}

                        Choose:
                        Red
                        Gold
                        Gren
                        Blue

Edit

 Delete

`;

    addNote.insertAdjacentHTML("afterbegin", listData); //
  });
}

showNotes();

//menu function, edit.
function editNote(noteNo, title, desc) {
  isUpdate = true;
  createBtn.innerText = "Update Note";
  headingTitle.textContent = "Update Note";
  getTitle.value = title;
  getTitle.focus();
  getTextarea.value = desc;
  updateId = noteNo;
  console.log(noteNo, title, desc);
}

//CREATE
createBtn.addEventListener("click", () => {
  let title = getTitle.value,
    notedata = getTextarea.value;

  //if title or notedata is not empty. Else
  if (title || notedata) {
    //getting current date
    let dateVar = new Date(),
      day = dateVar.getDate(),
      month = months[dateVar.getMonth()],
      year = dateVar.getFullYear();

    let newNoteData = {
      Title: title,
      desc: notedata,
      date: `${month} ${day} ${year}`, // ` is not a single inverted comma
    };

    //UPDATE
    // event is for update else.
    if (!isUpdate) {
      notes.push(newNoteData); // adding new notes from newNoteData into notes array.
      getTitle.value = "";
      getTitle.focus();
      getTextarea.value = "";
      isUpdate = false;
    } else {
      notes[updateId] = newNoteData; //updating specific id.
      createBtn.innerText = "Add Note";
      headingTitle.textContent = "Add New Note";
      getTitle.value = "";
      getTitle.focus();
      getTextarea.value = "";
      isUpdate = false;
    }
    //saving notes onto sessionstorage.
    sessionStorage.setItem("notes", JSON.stringify(notes)); //converting notes object to string.
    showNotes();
    console.log(newNoteData);
  } else console.log("Can not be empty");
});

}, 500);
itemm();
function delNote() {
notes.splice(0, 1); // removing selected note from array
//saving updated array list to session.
sessionStorage.setItem("notes", JSON.stringify(notes)); //converting notes object to string.
itemm();
}

function showMenu(men) {
men.parentElement.classList.add("show");
document.addEventListener("click", (e) => {
// remove show class from note options class to hide menue.
if (e.target.tagName != "I" || e.target != men) {
men.parentElement.classList.remove("show");
}
});
} //menu function, show, edit and delete.

function changeRed(clr) {
findingnote =
clr.parentNode.parentNode.parentNode.querySelector(".note-details");
findingnote.className = "note-details red";
}

function changeGold(clr) {
findingnote =
clr.parentNode.parentNode.parentNode.querySelector(".note-details");
findingnote.className = "note-details gold";
}
function ChangeGreen(clr) {
findingnote =
clr.parentNode.parentNode.parentNode.querySelector(".note-details");
findingnote.className = "note-details green";
}

function changeBlue(clr) {
findingnote =
clr.parentNode.parentNode.parentNode.querySelector(".note-details");
findingnote.className = "note-details blue";
}
// fetching the data on click from New Note.

//  Copy code ``

index.js

import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

when i was click the edit button this error is showing to me

(index):1 Uncaught ReferenceError: editNote is not defined
at HTMLElement.onclick


问:
Error in laravel database when I create a second project

I have created a second laravel project and I don`t know why I get this error when I try to access to the database. Could it be something related with the db_host? I have 127.0.0.1 in both projects in the .env file.


问:
How can I get Safari to print images at their specified size?
My website dynamically creates html with inline SVG, which the user is supposed to print out at 100% scale. This works fine in Firefox and Chrome, but in Safari the dimensions of the printed image are way off.

I have no idea why this is happening. The dimensions of svg are defined in mm, e.g.:
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='62mm' height='192mm' viewBox='0 0 62 192' preserveAspectRatio='none'>

I expected it to print true to the specified size. On screen, the graphics are displayed with identical dimensions by all three browsers.

I tried printing a JPG in Safari as well and the print wasn't true to size either.

I applied a crude fix (pre-scaling the SVG for Safari users), but as the scaling Safari applies when printing is dependent on the image width, the scaling feature on my user interface is not working as intended.

I also tried formatting the page for printing with CSS, but no luck so far. Apparently I haven't found the correct setting to override yet.

Edit:
These are my current CSS settings:

```<code><style>
            @media print {
        html, body, .container, svg {
            width: 62mm !important;
            height: 192mm !important;
            margin: 0mm !important;
            padding: 0mm!important;
        }}
        @page {
            @page {
            size: 6.2cm 19.2cm !important;
            margin: 0mm !important;
            padding: 0mm !important;
            </style>
</code>```

I saved as PDF from the print dialog and opened the file in illustrator. Apparently two elements are drawn which are not controlled by the style:

screenshot

Does anyone know what they are?

Body:
My website dynamically creates html with inline SVG, which the user is supposed to print out at 100% scale. This works fine in Firefox and Chrome, but in Safari the dimensions of the printed image are way off.

I have no idea why this is happening. The dimensions of svg are defined in mm, e.g.:
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='62mm' height='192mm' viewBox='0 0 62 192' preserveAspectRatio='none'>

I expected it to print true to the specified size. On screen, the graphics are displayed with identical dimensions by all three browsers.

I tried printing a JPG in Safari as well and the print wasn't true to size either.

I applied a crude fix (pre-scaling the SVG for Safari users), but as the scaling Safari applies when printing is dependent on the image width, the scaling feature on my user interface is not working as intended.

I also tried formatting the page for printing with CSS, but no luck so far. Apparently I haven't found the correct setting to override yet.

Edit:
These are my current CSS settings:

I saved as PDF from the print dialog and opened the file in illustrator. Apparently two elements are drawn which are not controlled by the style:

screenshot

Does anyone know what they are?


问:
Rails 7 js and css delay
I'm writing an app in Rails 7 (was working only on lower versions before, <= 5 ) and I encountered a weird assets behavior. There is a delay in applying assets. I have multiple link_to's with remote: true option and when the page is reloaded and i click on link too early it behaves like normal link (not remote) and sends html request (not js). The delay is very significant, I encounter this problem very often. There's also a visible delay in applying css - I can see unstyled page for 0.5/1 second and then styles appear. Images also renders very slowly, but that's maybe because they are in quite high resolution.

Here's some code:

importmap.rb

```<code>pin "application", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin_all_from "app/javascript/controllers", under: "controllers"
pin "jquery", to: "jquery.min.js", preload: true
pin "jquery_ujs", to: "jquery_ujs.js", preload: true
pin "bootstrap", to: "https://ga.jspm.io/npm:bootstrap@5.2.1/dist/js/bootstrap.esm.js"
pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js"
pin "chosen-jquery", to: "chosen-jquery"
pin "flatpickr", to: "flatpickr"

pin_all_from "app/javascript/custom", under: "custom"
</code>```

application.js

```<code>import "@hotwired/turbo-rails"
import "controllers"
import "jquery"
import "jquery_ujs"
import 'bootstrap'
import 'chosen-jquery'
import 'flatpickr'

import "custom/choosen"
import "custom/datepicker"
import "custom/login_banner"
import "custom/mobile_menu"
import "custom/forms"

</code>```

one of js files for example

```<code>window.form_small_img_display = function() {
  $("#user_avatar").change(function(){
    const [file] = this.files
    if (file) {
      $(this).closest(".form-img-display-js").find("img.small-form-img-js").attr("src", URL.createObjectURL(file))
      // $("img.small-form-avatar").attr("src", URL.createObjectURL(file))
    }
  })
};

window.close_inline_form = function(){
  $(".close-inline-form-js > a").on("click", function(e){
    e.preventDefault();

    $(".inline-expedition-logs-form").html("");
  })

  $(".close-inline-update-form-js > a").on("click", function(e){
    e.preventDefault();

    parent = $($(this).data('id')).parent();
    $($(this).data('id')).remove();
    parent.prepend($(this).data('partial'))

  })
}

$(document).on('turbo:load', window.form_small_img_display);
$(document).on('turbo:load', window.close_inline_form);

</code>```

manifest.js

```<code>//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link chosen-jquery.js
//= link flatpickr
</code>```

application.html.erb layout is not changed for js

I'm not very familiar with the new approach to js in rails 7, so I'm not sure what to do with that, if even I can do anything about it. Maybe it's just on my local machine. My only suspicion is that the images are too large and take a long time to load, which slows down the loading of the js. I'm just curious why it applies to the remote: true option.

Title: Rails 7 js and css delay

Body:
I'm writing an app in Rails 7 (was working only on lower versions before, <= 5 ) and I encountered a weird assets behavior. There is a delay in applying assets. I have multiple link_to's with remote: true option and when the page is reloaded and i click on link too early it behaves like normal link (not remote) and sends html request (not js). The delay is very significant, I encounter this problem very often. There's also a visible delay in applying css - I can see unstyled page for 0.5/1 second and then styles appear. Images also renders very slowly, but that's maybe because they are in quite high resolution.

Here's some code:

importmap.rb

pin "application", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin_all_from "app/javascript/controllers", under: "controllers"
pin "jquery", to: "jquery.min.js", preload: true
pin "jquery_ujs", to: "jquery_ujs.js", preload: true
pin "bootstrap", to: "https://ga.jspm.io/npm:bootstrap@5.2.1/dist/js/bootstrap.esm.js"
pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js"
pin "chosen-jquery", to: "chosen-jquery"
pin "flatpickr", to: "flatpickr"

pin_all_from "app/javascript/custom", under: "custom"

application.js

import "@hotwired/turbo-rails"
import "controllers"
import "jquery"
import "jquery_ujs"
import 'bootstrap'
import 'chosen-jquery'
import 'flatpickr'

import "custom/choosen"
import "custom/datepicker"
import "custom/login_banner"
import "custom/mobile_menu"
import "custom/forms"

one of js files for example

window.form_small_img_display = function() {
  $("#user_avatar").change(function(){
    const [file] = this.files
    if (file) {
      $(this).closest(".form-img-display-js").find("img.small-form-img-js").attr("src", URL.createObjectURL(file))
      // $("img.small-form-avatar").attr("src", URL.createObjectURL(file))
    }
  })
};

window.close_inline_form = function(){
  $(".close-inline-form-js > a").on("click", function(e){
    e.preventDefault();

    $(".inline-expedition-logs-form").html("");
  })

  $(".close-inline-update-form-js > a").on("click", function(e){
    e.preventDefault();

    parent = $($(this).data('id')).parent();
    $($(this).data('id')).remove();
    parent.prepend($(this).data('partial'))

  })
}

$(document).on('turbo:load', window.form_small_img_display);
$(document).on('turbo:load', window.close_inline_form);

manifest.js

//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link chosen-jquery.js
//= link flatpickr

application.html.erb layout is not changed for js

I'm not very familiar with the new approach to js in rails 7, so I'm not sure what to do with that, if even I can do anything about it. Maybe it's just on my local machine. My only suspicion is that the images are too large and take a long time to load, which slows down the loading of the js. I'm just curious why it applies to the remote: true option.


问:
Android HCE Data get Truncated on some Android Samsung devices
I am trying to send data from one android device to another using HCE and I was successful in doing in couple of samsung devices. But on same samsung device model of different country the data is getting truncated to around 248 characters. How do I overcome this?

Tech used:

```<code> NfcAdapter.FLAG_READER_NFC_A or
    NfcAdapter.FLAG_READER_NFC_B or
    NfcAdapter.FLAG_READER_NFC_F or
    NfcAdapter.FLAG_READER_NFC_V or
    NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK

var response = isoDep?.transceive(createSelectAidApdu(AID_ANDROID))

private fun createSelectAidApdu(aid: ByteArray): ByteArray {
                val result = ByteArray(6 + aid.size)
                System.arraycopy(CLA_INS_P1_P2, 0, result, 0, CLA_INS_P1_P2.size)
                result[4] = aid.size.toByte()
                System.arraycopy(aid, 0, result, 5, aid.size)
                result[result.size - 1] = 0
                return result
 }

 val CLA_INS_P1_P2 = byteArrayOf(0x00, 0xA4.toByte(), 0x04, 0x00)
 val AID_ANDROID = byteArrayOf(0xF0.toByte(), 0x01, 0x02, 0x03, 0x04, 0x05, 0x06)
</code>```

Body:
I am trying to send data from one android device to another using HCE and I was successful in doing in couple of samsung devices. But on same samsung device model of different country the data is getting truncated to around 248 characters. How do I overcome this?

Tech used:

 NfcAdapter.FLAG_READER_NFC_A or
    NfcAdapter.FLAG_READER_NFC_B or
    NfcAdapter.FLAG_READER_NFC_F or
    NfcAdapter.FLAG_READER_NFC_V or
    NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK

var response = isoDep?.transceive(createSelectAidApdu(AID_ANDROID))

private fun createSelectAidApdu(aid: ByteArray): ByteArray {
                val result = ByteArray(6 + aid.size)
                System.arraycopy(CLA_INS_P1_P2, 0, result, 0, CLA_INS_P1_P2.size)
                result[4] = aid.size.toByte()
                System.arraycopy(aid, 0, result, 5, aid.size)
                result[result.size - 1] = 0
                return result
 }

 val CLA_INS_P1_P2 = byteArrayOf(0x00, 0xA4.toByte(), 0x04, 0x00)
 val AID_ANDROID = byteArrayOf(0xF0.toByte(), 0x01, 0x02, 0x03, 0x04, 0x05, 0x06)


问:
How to pass string programmatically to node.js REPL (daemon) for execution?
I have node running as a (Linux) daemon. It has open listening sockets through which I would like to pass regular strings received from client sockets that are interpreted as node statements, similar to typing in the REPL. I will need to be able to access and modify variables in the current process and execute functions I've defined. How can I do this?</p>


问:
How can I stop my program after the execution of the promises from XMLHttp answer
I’m trying to convert an Image to a String and after this I want to test the string to see if it exist in my database. To do this I use open cv, the conversion from image to string work well every third time I have the good string named licence. Then I have a problem with my function testerLicence. I do a XMLHttp request in which I send the licence to a php file who connect the database and test if the licence exist. This function take time to finish, so I put a promise inside to return a Boolean.
In my main program I have a loop that is read until the license is true. I never get out of my loop even when the license is true I think the problem comes from the promise but I failed to find

```<code>This is my main program with a loop, process image and licence test
boutonPhoto.addEventListener('click', () => {
  var endLoop = false;
  while (endLoop!=true) {
    try {
     Process image to String uneLicence
        testerLicence(uneLicence).then((boolIfExist) => {console.log(boolIfExist); endLoop = boolIfExist });;
      }
    }
    catch (e) {
      //If there is an erros with the process o image then sortie = false
      endLoop = false;
    }
  }

</code>```

This is my function testerLicence with XMLrequest

```<code>function testerLicence(numLicence) {
  return new Promise((resolve) => {
    // Crée un nouvel objet XMLHttpRequest
    const xhr = new XMLHttpRequest();
    // Définit l'URL du fichier PHP à appeler
    const url = '../php/api.php';

    // Définit la méthode HTTP à utiliser (POST dans ce cas)
    xhr.open('POST', url);

    // Définit les en-têtes de la requête
    xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    // Définit les données à envoyer au fichier PHP
    const data = 'license=' + numLicence.getNumLicence();

    console.log(data)
    // Envoie la requête
    xhr.send(data);

    // Traite la réponse
    xhr.onreadystatechange = function () {
      if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
        // Parse la réponse en tant que JSON
        const response = JSON.parse(this.responseText);
        // Vérifie si la licence existe
        if (response.licenseExists) {
          // La licence existe
          resolve(true);
        } else {
          // La licence n'existe pas
          resolve(false);
        }
      }
    };
  });
}

</code>```

This is php file who print in a json to send answer

```<code><?php
// Récupération du numéro de licence dans les données de la requête
$license = $_POST['license'];

// Requête à la base de données pour vérifier si le numéro de licence existe
$conn = new PDO('mysql:host=localhost;dbname=bd_sporttrack;charset=utf8','root','root');
$req = "SELECT * FROM Joueur WHERE licence = :licence";
$req = $conn->prepare($req);
$req->execute(['licence'=>$license]);
$res = $req->fetchAll();

// Vérification si le numéro de licence existe
if (count($res) > 0) {
  // Le numéro de licence existe
  $response = ['licenseExists' => true];
} else {
  // Le numéro de licence n'existe pas
  $response = ['licenseExists' => false];
}

// Retourne la réponse sous forme d'objet JSON
print(json_encode($response)); ?>

</code>```

If someone can help me to improve my program and to solve my problem

Body:
I’m trying to convert an Image to a String and after this I want to test the string to see if it exist in my database. To do this I use open cv, the conversion from image to string work well every third time I have the good string named licence. Then I have a problem with my function testerLicence. I do a XMLHttp request in which I send the licence to a php file who connect the database and test if the licence exist. This function take time to finish, so I put a promise inside to return a Boolean.
In my main program I have a loop that is read until the license is true. I never get out of my loop even when the license is true I think the problem comes from the promise but I failed to find

This is my main program with a loop, process image and licence test
boutonPhoto.addEventListener('click', () => {
  var endLoop = false;
  while (endLoop!=true) {
    try {
     Process image to String uneLicence
        testerLicence(uneLicence).then((boolIfExist) => {console.log(boolIfExist); endLoop = boolIfExist });;
      }
    }
    catch (e) {
      //If there is an erros with the process o image then sortie = false
      endLoop = false;
    }
  }

This is my function testerLicence with XMLrequest

function testerLicence(numLicence) {
  return new Promise((resolve) => {
    // Crée un nouvel objet XMLHttpRequest
    const xhr = new XMLHttpRequest();
    // Définit l'URL du fichier PHP à appeler
    const url = '../php/api.php';

    // Définit la méthode HTTP à utiliser (POST dans ce cas)
    xhr.open('POST', url);

    // Définit les en-têtes de la requête
    xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    // Définit les données à envoyer au fichier PHP
    const data = 'license=' + numLicence.getNumLicence();

    console.log(data)
    // Envoie la requête
    xhr.send(data);

    // Traite la réponse
    xhr.onreadystatechange = function () {
      if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
        // Parse la réponse en tant que JSON
        const response = JSON.parse(this.responseText);
        // Vérifie si la licence existe
        if (response.licenseExists) {
          // La licence existe
          resolve(true);
        } else {
          // La licence n'existe pas
          resolve(false);
        }
      }
    };
  });
}

This is php file who print in a json to send answer

<?php
// Récupération du numéro de licence dans les données de la requête
$license = $_POST['license'];

// Requête à la base de données pour vérifier si le numéro de licence existe
$conn = new PDO('mysql:host=localhost;dbname=bd_sporttrack;charset=utf8','root','root');
$req = "SELECT * FROM Joueur WHERE licence = :licence";
$req = $conn->prepare($req);
$req->execute(['licence'=>$license]);
$res = $req->fetchAll();

// Vérification si le numéro de licence existe
if (count($res) > 0) {
  // Le numéro de licence existe
  $response = ['licenseExists' => true];
} else {
  // Le numéro de licence n'existe pas
  $response = ['licenseExists' => false];
}

// Retourne la réponse sous forme d'objet JSON
print(json_encode($response)); ?>

If someone can help me to improve my program and to solve my problem


问:
VS Code running wrong py interpreter while running my code but it works fine with python IDLE so idk how to set path of interpreter
This is the image of the code in vs code and it looks fine with no problems being flagged and no importing issue but when ran it shows no libraries such as PyQt5

This is the proof that it worked fine and successfully did an entry when ran with IDLE

So issue is like I want to use different python version for like two projects but it's only using the interpreter pathway after i've deleted that version of python from my Laptop...

How to resolve this issue?

After Deleting the path too it's showing .....

I was expecting that programme would run as i had installed python 3.8 for some pyside project which were working fine but when i switched to python 3.11 for running up my project 11 version of py .. It was still running it from 3.8 version ... so idk how to solve this if you know please do help me out...


问:
CodeIgniter 3 | import db function return error The query you submitted is not valid
From phpmyadmin import sucess:

from CI3:

```<code>$path = 'assets/backup_db/';
$folder_name = 'template01';
$file_sql = 'template01.sql';

$file_restore = $this->load->file($path . $folder_name . '/' . $file_sql, true);
$file_array = explode(';', $file_restore);
foreach ($file_array as $query)
{
$this->db->query("SET FOREIGN_KEY_CHECKS = 0");
$this->db->query($query);
$this->db->query("SET FOREIGN_KEY_CHECKS = 1");
}
</code>```

How to resolve this issue with possible import from CI3? This is the same sql content and from phpmyadmin working from import and also from sql query.

But here return issue.

Body:
From phpmyadmin import sucess:

from CI3:

$path = 'assets/backup_db/';
$folder_name = 'template01';
$file_sql = 'template01.sql';

$file_restore = $this->load->file($path . $folder_name . '/' . $file_sql, true);
$file_array = explode(';', $file_restore);
foreach ($file_array as $query)
{
$this->db->query("SET FOREIGN_KEY_CHECKS = 0");
$this->db->query($query);
$this->db->query("SET FOREIGN_KEY_CHECKS = 1");
}

How to resolve this issue with possible import from CI3? This is the same sql content and from phpmyadmin working from import and also from sql query.

But here return issue.


问:
.htaccess 301 Redirect not working correctly
This Redirect …
Redirect 301 /employee-resources/employee-forms-information https://umpquaeo.sharepoint.com/sites/Resources

… should route this URL …
https://www.umpqua.edu/employee-resources/employee-forms-information

… to this
https://umpquaeo.sharepoint.com/sites/Resources

Instead it goes to this – which is a broken link
https://umpquaeo.sharepoint.com/sites/Resources/employee-forms-information

I’m not sure if previous code in the HTACCESS file is affecting the execution of this. Or if the way the server is executing the above command is at fault. Any ideas?

I thought maybe an extra space in the line was a problem. That was not it. I tried rewriting the redirect with the domain in both parts of the command. That did not work.


问:
Wrong marker type in Python seaborn legend
When plotting a scatter graph on seaborn, I use a custom marker style, X

```<code>import matplotlib.pyplot as plt
import seaborn as sns

fmri = sns.load_dataset("fmri")
fig, ax = plt.subplots(1, 1)
g = sns.scatterplot(x="timepoint", y="signal", hue="event", marker="X", data=fmri, ax=ax)
ax.legend().set_title('event')
plt.show()
</code>```

However the legend doesn't use the X marker. What am I doing wrong?

Body:
When plotting a scatter graph on seaborn, I use a custom marker style, X

import matplotlib.pyplot as plt
import seaborn as sns

fmri = sns.load_dataset("fmri")
fig, ax = plt.subplots(1, 1)
g = sns.scatterplot(x="timepoint", y="signal", hue="event", marker="X", data=fmri, ax=ax)
ax.legend().set_title('event')
plt.show()

However the legend doesn't use the X marker. What am I doing wrong?


问:
Implementing attention mechanism for neural machine translation
```<code>class Attention(nn.Module):
    def __init__(self, hidden_size):
        super(Attention, self).__init__()

        self.hidden_size = hidden_size
        # Create a two layer fully-connected network. Hint: Use nn.Sequential
        # hidden_size*2 --> hidden_size, ReLU, hidden_size --> 1
        self.attention_network = nn.Sequential(
                                            nn.Linear(hidden_size*2, hidden_size),
                                            nn.ReLU(),
                                            nn.Linear(hidden_size, 1))
        self.softmax = nn.Softmax(dim=1)

    def forward(self, hidden, annotations):
        """The forward pass of the attention mechanism.

        Arguments:
            hidden: The current decoder hidden state. (batch_size x hidden_size)
            annotations: The encoder hidden states for each step of the input sequence. (batch_size x seq_len x hidden_size)

        Returns:
            output: Normalized attention weights for each encoder hidden state. (batch_size x seq_len x 1)

            The output must be a softmax weighting over the seq_len annotations.
        """

        batch_size, seq_len, hid_size = annotations.size()
        expanded_hidden = hidden.unsqueeze(1).expand_as(annotations)

        # concat = ...
        # reshaped_for_attention_net = ...
        # attention_net_output = ...
        # unnormalized_attention = ...  # Reshape attention net output to have dimension batch_size x seq_len x 1

        return self.softmax(unnormalized_attention)

</code>```

In the forward function this is what I've tried:
concat = torch.cat((expanded_hidden, annotations), 2)
unnormalized_attention = self.attention_network(concat)

I'm trying to figure out

```<code>        concat = ...
        reshaped_for_attention_net = ...
        attention_net_output = ...
        unnormalized_attention = ...
</code>```

Body:
class Attention(nn.Module):
    def __init__(self, hidden_size):
        super(Attention, self).__init__()

        self.hidden_size = hidden_size
        # Create a two layer fully-connected network. Hint: Use nn.Sequential
        # hidden_size*2 --> hidden_size, ReLU, hidden_size --> 1
        self.attention_network = nn.Sequential(
                                            nn.Linear(hidden_size*2, hidden_size),
                                            nn.ReLU(),
                                            nn.Linear(hidden_size, 1))
        self.softmax = nn.Softmax(dim=1)

    def forward(self, hidden, annotations):
        """The forward pass of the attention mechanism.

        Arguments:
            hidden: The current decoder hidden state. (batch_size x hidden_size)
            annotations: The encoder hidden states for each step of the input sequence. (batch_size x seq_len x hidden_size)

        Returns:
            output: Normalized attention weights for each encoder hidden state. (batch_size x seq_len x 1)

            The output must be a softmax weighting over the seq_len annotations.
        """

        batch_size, seq_len, hid_size = annotations.size()
        expanded_hidden = hidden.unsqueeze(1).expand_as(annotations)

        # concat = ...
        # reshaped_for_attention_net = ...
        # attention_net_output = ...
        # unnormalized_attention = ...  # Reshape attention net output to have dimension batch_size x seq_len x 1

        return self.softmax(unnormalized_attention)

In the forward function this is what I've tried:
concat = torch.cat((expanded_hidden, annotations), 2)
unnormalized_attention = self.attention_network(concat)

I'm trying to figure out

        concat = ...
        reshaped_for_attention_net = ...
        attention_net_output = ...
        unnormalized_attention = ...


问:
How do I remove outliers from my dataset?
I am learning R and I have a dataset where I have the variables "annoyTruck_transf", "annoyCar_transf" and "dBA" and three other variables which are not relevant to this question. Said variables are interval scaled. I put them in a boxplot where the y-axis displays the annoyance level of Car or Truck sounds and the x-axis displays the volume in dBA. You can see the boxplot in the picture. As you can see there are some outliers for both boxplots. I have already done the analysis with the outliers but now I wanna try doing the analysis without the outliers. How do I remove them from the dataset? I have already googled the problem but I do not understand the solutions, especially when the people are using different names. I am glad about any help.

EDIT: This was one of my codes to remove the outliers. I am not sure if it is correct since most outliers were removed but four new outliers appeared for Cars, at least for trucks there are no outliers anymore. However, I do not know how many outliers were removed now and how many values are left. How can I check it?

```<code>list_quantiles <- tapply(d2_nocars$annoyCar_transf, d2_nocars$dBA,
quantile)

Q1s <- sapply(1:17, function(i) list_quantiles[[i]][2])
Q3s <- sapply(1:17, function(i) list_quantiles[[i]][4])

IQRs <- tapply(d2_nocars$annoyCar_transf, d2_nocars$dBA, IQR)

Lowers <- Q1s - 1.5*IQRs
Uppers <- Q3s + 1.5*IQRs

datas <- split(d2_nocars, d2_nocars$dBA)

data_no_outlier <- NULL
for (i in 1:17){
out <- subset(datas[[i]], datas[[i]]$annoyCar_transf > Lowers[i]
            & datas[[i]]$annoyCar_transf < Uppers[I])
data_no_outlier <- rbind(data_no_outlier, out)
}

#Now we exclude the outliers from annoy_Truck_transf

list_quantiles2 <- tapply(data_no_outlier$annoyTruck_transf,
data_no_outlier$dBA, quantile)

Q1s2 <- sapply(1:17, function(i) list_quantiles2[[i]][2])
Q3s2 <- sapply(1:17, function(i) list_quantiles2[[i]][4])

IQRs2 <- tapply(data_no_outlier$annoyTruck_transf,
data_no_outlier$dBA, IQR)

Lowers2 <- Q1s2 - 1.5*IQRs2
Uppers2 <- Q3s2 + 1.5*IQRs2

datas2 <- split(d2_nocars, d2_nocars$dBA)

data_no_outlier2 <- NULL
for (i in 1:17){
 out2 <- subset(datas2[[i]], datas2[[i]]$annoyTruck_transf >
Lowers2[i]
 & datas2[[i]]$annoyTruck_transf < Uppers2[I])
 data_no_outlier2 <- rbind(data_no_outlier2, out2)
}
</code>```

Boxplots: enter image description here

Body:
I am learning R and I have a dataset where I have the variables "annoyTruck_transf", "annoyCar_transf" and "dBA" and three other variables which are not relevant to this question. Said variables are interval scaled. I put them in a boxplot where the y-axis displays the annoyance level of Car or Truck sounds and the x-axis displays the volume in dBA. You can see the boxplot in the picture. As you can see there are some outliers for both boxplots. I have already done the analysis with the outliers but now I wanna try doing the analysis without the outliers. How do I remove them from the dataset? I have already googled the problem but I do not understand the solutions, especially when the people are using different names. I am glad about any help.

EDIT: This was one of my codes to remove the outliers. I am not sure if it is correct since most outliers were removed but four new outliers appeared for Cars, at least for trucks there are no outliers anymore. However, I do not know how many outliers were removed now and how many values are left. How can I check it?

list_quantiles <- tapply(d2_nocars$annoyCar_transf, d2_nocars$dBA,
quantile)

Q1s <- sapply(1:17, function(i) list_quantiles[[i]][2])
Q3s <- sapply(1:17, function(i) list_quantiles[[i]][4])

IQRs <- tapply(d2_nocars$annoyCar_transf, d2_nocars$dBA, IQR)

Lowers <- Q1s - 1.5*IQRs
Uppers <- Q3s + 1.5*IQRs

datas <- split(d2_nocars, d2_nocars$dBA)

data_no_outlier <- NULL
for (i in 1:17){
out <- subset(datas[[i]], datas[[i]]$annoyCar_transf > Lowers[i]
            & datas[[i]]$annoyCar_transf < Uppers[I])
data_no_outlier <- rbind(data_no_outlier, out)
}

#Now we exclude the outliers from annoy_Truck_transf

list_quantiles2 <- tapply(data_no_outlier$annoyTruck_transf,
data_no_outlier$dBA, quantile)

Q1s2 <- sapply(1:17, function(i) list_quantiles2[[i]][2])
Q3s2 <- sapply(1:17, function(i) list_quantiles2[[i]][4])

IQRs2 <- tapply(data_no_outlier$annoyTruck_transf,
data_no_outlier$dBA, IQR)

Lowers2 <- Q1s2 - 1.5*IQRs2
Uppers2 <- Q3s2 + 1.5*IQRs2

datas2 <- split(d2_nocars, d2_nocars$dBA)

data_no_outlier2 <- NULL
for (i in 1:17){
 out2 <- subset(datas2[[i]], datas2[[i]]$annoyTruck_transf >
Lowers2[i]
 & datas2[[i]]$annoyTruck_transf < Uppers2[I])
 data_no_outlier2 <- rbind(data_no_outlier2, out2)
}

Boxplots: enter image description here


问:
Using Logo as a link to home page
My logo vanishes when I try to add a hyperlink.

```<code><header class="header">
  <div id="logo">
    <a href="ideas.html"><img id="logo" src="Photos/logo.jpg" alt="My logo"></a>
  </div>

  <h1>header here</h1>
  <nav>
    <ul class="header-nav">
      <li class="nav-item">
        <a class="nav-link" href="../example-page/profile.html">PROFILE</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="">ABOUT</a>
      </li>
    </ul>
  </nav>

</header>
</code>```

With this I was expecting to see my logo. The link is clickable however whatever photo I replace it with it vanishes.

Title: Using Logo as a link to home page

Body:
My logo vanishes when I try to add a hyperlink.

header here

        PROFILE

        ABOUT

With this I was expecting to see my logo. The link is clickable however whatever photo I replace it with it vanishes.


问:
MPDF Table auto Automatic resizing stop
enter image description here

enter image description here

I'm generating some reports on my admin and I'm exporting to PDF using the MPDF library. But when this has a very large amount of data, MPDF is resizing the table to fit on page, so that it becomes awkward.

Automatic resizing

Tables may also resize if you set the CSS property page-break-inside: avoid

Title: MPDF Table auto Automatic resizing stop


问:
How to find RERI for additive scale interaction in a cox regression model in R
I would like to find the RERI of an additive interaction for a COX regression model in R. Any idea if it's possible to do it, and if so, how to do it?

I know we can do it with stdReg package which is well explained here https://link.springer.com/article/10.1007/s10654-018-0375-y#Sec11, but the authors explain how to do it with two binary variables, and i would like to do it with 1 continous variable and 1 binary variable.


问:
Visual Studio 2022 - VC++ copy to output folder
I have a problem with a C++ library that I have.

This C++ library includes a Library file (abc.lib) but I also need this library file copied to the output folder.

The C++ library is then used in a C# application and I need the library file to be automatically included in the c# application when it is referenced.

I can't seem to find a way to copy the library file to the output folder and use the library in the c++ app. I do not want to use a post build event as this won't then get the library file copied to the c# application.

```<code>  <ItemGroup>
    <Library Include="abc.lib">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Library>
  </ItemGroup>
</code>```

The CopyToOutputDirectory directive does not work above (I am not sure it is even supported)

Any thoughts?

I know you can set the Item Type property to Copy File, but then it is not treated as a library as the app does not compile.

Body:
I have a problem with a C++ library that I have.

This C++ library includes a Library file (abc.lib) but I also need this library file copied to the output folder.

The C++ library is then used in a C# application and I need the library file to be automatically included in the c# application when it is referenced.

I can't seem to find a way to copy the library file to the output folder and use the library in the c++ app. I do not want to use a post build event as this won't then get the library file copied to the c# application.

  <ItemGroup>
    <Library Include="abc.lib">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Library>
  </ItemGroup>

The CopyToOutputDirectory directive does not work above (I am not sure it is even supported)

Any thoughts?

I know you can set the Item Type property to Copy File, but then it is not treated as a library as the app does not compile.


问:
Listing duplicated entities based on two fields with django orm
My objective is getting all orders with duplicated order_number by location, that has checkout = true at least one time. But I'm having issues to translate this to Django ORM.

example of data:

```<code>| id | order_number | location_id | checkout |
|----|--------------|-------------|----------|
| 1  | 1            | 1           | true     |
| 2  | 1            | 1           | true     |
| 3  | 1            | 1           | false    |
| 4  | 2            | 1           | true     |
| 5  | 1            | 2           | true     |
| 6  | 2            | 2           | false    |
</code>```

select count(*), order_number, location_id from orders where checkout = true group by location_id, order_number having count(*) > 1;
```
<p>the expectation</p>
```| count | order_number | location_id |
|-------|--------------|-------------|
| 2     | 1            | 1           |
```
<p>I already tried this, but it's not working as expected</p>
```>>> Order.objects.filter(checkout=True).values_list('order_number', 'location_id').annotate(count_order_number=Count("order_number")).filter(count_order_number__gt=1)
<QuerySet []>
```
<p>I'm using</p>
```Django=3.2
postgresql
```

Body:
My objective is getting all orders with duplicated order_number by location, that has checkout = true at least one time. But I'm having issues to translate this to Django ORM.

example of data:

| id | order_number | location_id | checkout |
|----|--------------|-------------|----------|
| 1  | 1            | 1           | true     |
| 2  | 1            | 1           | true     |
| 3  | 1            | 1           | false    |
| 4  | 2            | 1           | true     |
| 5  | 1            | 2           | true     |
| 6  | 2            | 2           | false    |

select count(*), order_number, location_id from orders where checkout = true group by location_id, order_number having count(*) > 1;

the expectation

| count | order_number | location_id |
|-------|--------------|-------------|
| 2     | 1            | 1           |

I already tried this, but it's not working as expected

>>> Order.objects.filter(checkout=True).values_list('order_number', 'location_id').annotate(count_order_number=Count("order_number")).filter(count_order_number__gt=1)
<QuerySet []>

I'm using

Django=3.2
postgresql


问:
GA4 exploration - Manually sort columns?
Ive been having troubles sorting my free form explorations data to the order I am wanting.

Here I want the video_complete row to be at the bottom of my nested list so it makes sense when reading this data:

How would you go about this? Im interested in any tips for sorting rows of data


问:
i can't save data in lcoal storage when i refresh the page
Where is the problem, I can't save data in local storage when i refresh the page and it saved when i clicked but the problem it disappear i used usestate data to keep hook i don't know why i tried all solutions and nothing worked i think the problem released because i use redux and that didn't work well or something else or useeffect didn't work for some reason</p>
```<code>
import { Button, Col, Container, Row } from "react-bootstrap";
import { useDispatch, useSelector } from "react-redux";
import "./Watchstemp.css"
import { FaEye, FaWindowClose } from "react-icons/fa";
import { addTowatched } from "../rtk/reducers/Watchedslice";
import { clearMovie } from "../rtk/reducers/watchSlice";
import { useEffect, useState } from "react";

function Watchstemp(){
    const dispatch = useDispatch()
    const posts = useSelector(poster => poster)
    const [posters, setPosters] = useState(posts.postSlice)
    useEffect(() => {
        // storing input name
        localStorage.setItem("watchlist", JSON.stringify(posters));
      }, [posters]); // Update the dependency array with posters

      useEffect(() => {
        const data = window.localStorage.getItem('watchlist');
        setPosters(data ? JSON.parse(data) : posts.postSlice);
      }, []);
    return(
        <>
            <Row>
                    {
                posters.map((post => {
                    return (
                        <Col lg={3} md={4} sm={6} key={post}>
                        <div className="movie-cards">
                            <div className="overlay">
                                <img className="img-fluid rounded" src={post} alt={post} />
                                <div className="inner-card-controls">
                                    <FaEye className="ctrl-btn" onClick={() => dispatch(addTowatched(post))} />
                                    <FaWindowClose className="ctrl-btn" onClick={() => dispatch(clearMovie(post))}/>
                                </div>
                            </div>
                        </div>
                        </Col>
                    )
                }))
            }
            </Row>
        </>
    )
}
export default Watchstemp

</code>```

Body:
Where is the problem, I can't save data in local storage when i refresh the page and it saved when i clicked but the problem it disappear i used usestate data to keep hook i don't know why i tried all solutions and nothing worked i think the problem released because i use redux and that didn't work well or something else or useeffect didn't work for some reason

import { Button, Col, Container, Row } from "react-bootstrap";
import { useDispatch, useSelector } from "react-redux";
import "./Watchstemp.css"
import { FaEye, FaWindowClose } from "react-icons/fa";
import { addTowatched } from "../rtk/reducers/Watchedslice";
import { clearMovie } from "../rtk/reducers/watchSlice";
import { useEffect, useState } from "react";

function Watchstemp(){
    const dispatch = useDispatch()
    const posts = useSelector(poster => poster)
    const [posters, setPosters] = useState(posts.postSlice)
    useEffect(() => {
        // storing input name
        localStorage.setItem("watchlist", JSON.stringify(posters));
      }, [posters]); // Update the dependency array with posters

      useEffect(() => {
        const data = window.localStorage.getItem('watchlist');
        setPosters(data ? JSON.parse(data) : posts.postSlice);
      }, []);
    return(
        <>
            <Row>
                    {
                posters.map((post => {
                    return (
                        <Col lg={3} md={4} sm={6} key={post}>

                                    <FaEye className="ctrl-btn" onClick={() => dispatch(addTowatched(post))} />
                                    <FaWindowClose className="ctrl-btn" onClick={() => dispatch(clearMovie(post))}/>

                        </Col>
                    )
                }))
            }
            </Row>
        </>
    )
}
export default Watchstemp


问:
Configure gorm with a highly available postgres cluster
We are looking to configure gorm (https://gorm.io) with a highly available postgres cluster. Currently, when we fail over the primary postgres node we start to see error messages such as "driver: bad connection" in the logs. We are hoping there is a way to configure the connection pool such that it can detect the "bad connections", remove them from the pool, and establish news connections. Is this a possibility?

Tried failing over the primary postgres node to determine if gorm would establish new connections.


问:
How to Flush a collaborative editing session with force true [ckeditor]
After upgrading [ckeditor] from 3.6.2 to **4.11.0

**

Flush API stopped working,

Flush API : https://help.cke-cs.com/api/v5/docs#tag/Collaboration/paths/%5C~1collaborations%5C~1%7Bdocument_id%7D/delete

I updated the end-points but when I am opening the document in collaborative mode and same time calling the flush API it says Some users are still connected to this collaboration session. We cannot flush it.

There is a force flag also we can send this force=true in the query parameter but when I am adding force=true in query params, Then Flush API gives an Invalid Signature response message with a 401 status code.

Can anyone help here please?

To flush the collaborative editing session forcefully.


问:
while using OnEachRow it not rollback entries from second table if database error occur laravel excel

if their error comes it rollback the entries from the first table. but it does not roll back the entries from the second table.

Can anyone guide how it is possible?

what my case.

if their error comes it rollback the entries from the agent table. but it does not roll back the entries from the payment table.

To create this error I hardcoded the value for the third row and set the status value to null. but status only takes an integer value why it creates the error.

it gives an error  Incorrect integer value: '' for column 'status'
but it rollback entries form agent table but not from payment table

```<code>class noteImport implements OnEachRow {

    public function onRow(Row $row){
        $row = $row->toArray();

            $Option = [
            "firstpay" => 1,
            "amount" => 1,
            "payment_type" => 1,
            "info" => "1",
            "enter_date" => date('y/m/d'),
            "recieve_date" => date('y/m/d'),
            "status" => $row['srno'] != 3 ? 1 : "",
            ];

            $agent = Agent::create([
            "agent_code" => "1",
            "name" => "1",
            "address" => "1",
            "phone" => 454,
            "password" => "asd",
            "upload" => "1",
            "status" => 1,
            ]);

        $agent->payment()->create($Option);
    }
}
</code>```

Body:
if their error comes it rollback the entries from the first table. but it does not roll back the entries from the second table.

Can anyone guide how it is possible?

what my case.

if their error comes it rollback the entries from the agent table. but it does not roll back the entries from the payment table.

To create this error I hardcoded the value for the third row and set the status value to null. but status only takes an integer value why it creates the error.

it gives an error  Incorrect integer value: '' for column 'status'
but it rollback entries form agent table but not from payment table

class noteImport implements OnEachRow {

    public function onRow(Row $row){
        $row = $row->toArray();

            $Option = [
            "firstpay" => 1,
            "amount" => 1,
            "payment_type" => 1,
            "info" => "1",
            "enter_date" => date('y/m/d'),
            "recieve_date" => date('y/m/d'),
            "status" => $row['srno'] != 3 ? 1 : "",
            ];

            $agent = Agent::create([
            "agent_code" => "1",
            "name" => "1",
            "address" => "1",
            "phone" => 454,
            "password" => "asd",
            "upload" => "1",
            "status" => 1,
            ]);

        $agent->payment()->create($Option);
    }
}


问:
SMPTE Time Synchronization
I am able to decode and find the SMPTE data, but do you synchronize at the start of the following sync code, or the end of the previous sync code? What part of the bitstream is transmitted at the time contained in the SMPTE code?

I have searched the internet but have not found a definitive answer.

Title: SMPTE Time Synchronization


问:
Using Mouse/s. In theory, how difficult would it be to remake a "Pong" or "Poing" (ping pong) game?
I have seen a key version in an excellent book for beginners
Programming Games for Beginners, by Conrod & Tylee.  But this kills the classic tv console I first played as a boy age 6.
I did write awhile ago to Kidware software, the publishers.  But as yet nothing.
I even bought extra USB Mouse, with no clues as to how to install it in the game, let alone use it to control the sticks.
I'm only a very beginner, and would need simple terms if possible.  Or a direction, ideally to where it has been done.

I have looked everywhere for books.  But I can't even find books that cover much of the mouse control at all.  Not even drag and drop etc.  Though I have seen some bits on these excellent pages.
All in all I'm really drawing a blank here!   Please help.


问:
"communication link failure" while running AWS Glue job
I am copying data from in house Mysql database table to RDS MYSQL database table. i executed my AWS glue job on smaller data size ( 1million records) and i am able to successfully copy data to RDS Mysql database.

But when i try to run the same AWS glue job on table with 8 million records, it throws me below error

```<code>Failure Reason": "Communications link failure\n\nThe last packet successfully received from the server was 237,612 milliseconds ago. The last packet sent successfully to the server was 237,612 milliseconds ago."
</code>```

Body:
I am copying data from in house Mysql database table to RDS MYSQL database table. i executed my AWS glue job on smaller data size ( 1million records) and i am able to successfully copy data to RDS Mysql database.

But when i try to run the same AWS glue job on table with 8 million records, it throws me below error

Failure Reason": "Communications link failure\n\nThe last packet successfully received from the server was 237,612 milliseconds ago. The last packet sent successfully to the server was 237,612 milliseconds ago."