问:
SwiftUI: Publishing changes from within view updates is not allowed, this will cause undefined behavior
I have made this Main Menu view and every image will take to another view for that I have put a navigation link but if I click on one image(any image) it will work for one time only then I get this error. Please help me out, I will be super grateful

I am getting two errors first is: SwiftUI encountered an issue when pushing a NavigationLink. Please file a bug.

second is:  Publishing changes from within view updates is not allowed, this will cause undefined behavior.
enter image description here

```<code>import SwiftUI

struct MainMenu: View {
    var columns = Array (repeating: GridItem(.flexible(), spacing: 15), count: 2)
    @State var selected : MainMenuData = data[0]
    @State var show = false
    @Namespace var namespace
    @State var isLinkActive = false
    @State var isLinkActive1 = false
    @State var isLinkActive2 = false
    @State var isLinkActive3 = false
    @State var isLinkActive4 = false
    @State var isLinkActive5 = false
    @Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>

    var body: some View {
        NavigationView{
          //  ZStack{
                ScrollView(.vertical, showsIndicators: false) {

//                    HStack{}
//
//                    // due to top area is ignored.
//
                       // .padding ([.horizontal, .top])

                    // Grid View.

                    LazyVGrid (columns: columns, spacing: 25){

                        ForEach (data){travel in

                            VStack(alignment: .leading, spacing: 10){

                                Image (travel.image)
                                    .resizable()
                                    .frame(width: 230,height: 260)
                                    .cornerRadius(15)
                                    .padding(.top,-65)
                                //assigning IDs..
                                    .onTapGesture {

                                        selected = travel

                                        if selected.id == 0
                                        {
                                            isLinkActive = true
                                        }
                                        else if selected.id == 1
                                        {
                                            isLinkActive1 = true
                                        }
                                        else if selected.id == 2
                                        {
                                            isLinkActive2 = true
                                        }
                                        else if selected.id == 3
                                        {
                                            isLinkActive3 = true
                                        }
                                        else if selected.id == 4
                                        {
                                            isLinkActive4 = true
                                        }
                                        else if selected.id == 5
                                        {
                                            isLinkActive5 = true
                                        }
                                    }

                                    .background(
                                        NavigationLink(destination: Student(), isActive: $isLinkActive1) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                    .background(
                                        NavigationLink(destination: Card(), isActive: $isLinkActive2) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                    .background(
                                        NavigationLink(destination: Rentalform(), isActive: $isLinkActive3) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                    .background(
                                        NavigationLink(destination: FlashLaneFeatures(), isActive: $isLinkActive4) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                    .background(
                                        NavigationLink(destination: EasyPassFeatures(), isActive: $isLinkActive5) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                 .matchedGeometryEffect(id: travel.id, in: namespace)
                            }
                        }//foreach

                        .background(
                            NavigationLink(destination: PropertyFilter(), isActive: $isLinkActive) {
                                EmptyView()
                            }
                                //.isDetailLink(false)
                            .hidden()

                        )

                    }//vgrid
                    .padding (.horizontal)
                    .padding(.top,5)
                    .padding(.leading)

                }
            //scrollview
                //.padding(.top,UIApplication.shared.windows.first?.safeAreaInsets.top)
                // Hero View..
           // }
           // .buttonStyle(BorderlessButtonStyle())
            //.background (Color.white.edgesIgnoringSafeArea(.all))
            //}
            .toolbar {
                ToolbarItem(placement: .principal) {
                    Text("Main Menu")
                        .frame(width: 300, height: 10)
                        .foregroundColor(Color.black)
                        .font(.system(size: 30,weight: .medium, design: .default))

                }//toolbaritem
                ToolbarItem(placement: .navigationBarTrailing) {
                    Image(systemName: "bell")
                }//toolbaritem
            }//toolbar
        }

    }//view
}//struct

struct MainMenu_Previews: PreviewProvider {
    static var previews: some View {
        MainMenu()
    }
}
</code>```

Body:
I have made this Main Menu view and every image will take to another view for that I have put a navigation link but if I click on one image(any image) it will work for one time only then I get this error. Please help me out, I will be super grateful

I am getting two errors first is: SwiftUI encountered an issue when pushing a NavigationLink. Please file a bug.

second is:  Publishing changes from within view updates is not allowed, this will cause undefined behavior.
enter image description here

import SwiftUI

struct MainMenu: View {
    var columns = Array (repeating: GridItem(.flexible(), spacing: 15), count: 2)
    @State var selected : MainMenuData = data[0]
    @State var show = false
    @Namespace var namespace
    @State var isLinkActive = false
    @State var isLinkActive1 = false
    @State var isLinkActive2 = false
    @State var isLinkActive3 = false
    @State var isLinkActive4 = false
    @State var isLinkActive5 = false
    @Environment(\.presentationMode) var presentationMode: Binding<PresentationMode>

    var body: some View {
        NavigationView{
          //  ZStack{
                ScrollView(.vertical, showsIndicators: false) {

//                    HStack{}
//
//                    // due to top area is ignored.
//
                       // .padding ([.horizontal, .top])

                    // Grid View.

                    LazyVGrid (columns: columns, spacing: 25){

                        ForEach (data){travel in

                            VStack(alignment: .leading, spacing: 10){

                                Image (travel.image)
                                    .resizable()
                                    .frame(width: 230,height: 260)
                                    .cornerRadius(15)
                                    .padding(.top,-65)
                                //assigning IDs..
                                    .onTapGesture {

                                        selected = travel

                                        if selected.id == 0
                                        {
                                            isLinkActive = true
                                        }
                                        else if selected.id == 1
                                        {
                                            isLinkActive1 = true
                                        }
                                        else if selected.id == 2
                                        {
                                            isLinkActive2 = true
                                        }
                                        else if selected.id == 3
                                        {
                                            isLinkActive3 = true
                                        }
                                        else if selected.id == 4
                                        {
                                            isLinkActive4 = true
                                        }
                                        else if selected.id == 5
                                        {
                                            isLinkActive5 = true
                                        }
                                    }

                                    .background(
                                        NavigationLink(destination: Student(), isActive: $isLinkActive1) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                    .background(
                                        NavigationLink(destination: Card(), isActive: $isLinkActive2) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                    .background(
                                        NavigationLink(destination: Rentalform(), isActive: $isLinkActive3) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                    .background(
                                        NavigationLink(destination: FlashLaneFeatures(), isActive: $isLinkActive4) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                    .background(
                                        NavigationLink(destination: EasyPassFeatures(), isActive: $isLinkActive5) {
                                            EmptyView()
                                        }
                                            .hidden()
                                    )
                                 .matchedGeometryEffect(id: travel.id, in: namespace)
                            }
                        }//foreach

                        .background(
                            NavigationLink(destination: PropertyFilter(), isActive: $isLinkActive) {
                                EmptyView()
                            }
                                //.isDetailLink(false)
                            .hidden()

                        )

                    }//vgrid
                    .padding (.horizontal)
                    .padding(.top,5)
                    .padding(.leading)

                }
            //scrollview
                //.padding(.top,UIApplication.shared.windows.first?.safeAreaInsets.top)
                // Hero View..
           // }
           // .buttonStyle(BorderlessButtonStyle())
            //.background (Color.white.edgesIgnoringSafeArea(.all))
            //}
            .toolbar {
                ToolbarItem(placement: .principal) {
                    Text("Main Menu")
                        .frame(width: 300, height: 10)
                        .foregroundColor(Color.black)
                        .font(.system(size: 30,weight: .medium, design: .default))

                }//toolbaritem
                ToolbarItem(placement: .navigationBarTrailing) {
                    Image(systemName: "bell")
                }//toolbaritem
            }//toolbar
        }

    }//view
}//struct

struct MainMenu_Previews: PreviewProvider {
    static var previews: some View {
        MainMenu()
    }
}


来源: stackexchange

问:
Execute Synchronous / Blocking API calls in react
I'm implementing a login action which I would like to run synchronously.

My handler Function
`

```<code>  const handleSignIn = async () => {
    try {
      const user = await Auth.signIn(email, password); // step1
      dispatch(login(user)); // step2
      const profile = await getMyProfile(); // step 3
      dispatch(setTwitterProfile(profile)); // step 4
      console.log('Twitter Profile: ', twitterProfile); // step 5
      const userInfo = await Auth.currentUserInfo();
      console.log('User Info: ', userInfo);
      // navigate('/home');
    } catch (error: any) {
      dispatch(logout());
      alert(error.message);
    }
  };
</code>```

`

The way I would like this function to execute is run second step only when step one is completed and so on.
Sometimes my pofile object is empty as results are asynchronous.

Trying : Async Await to run code imperatively
Expecting : Each step runs after result is fetched from the previous step

ContentLicense: CC BY-SA 4.0

Body:
I'm implementing a login action which I would like to run synchronously.

My handler Function
`

  const handleSignIn = async () => {
    try {
      const user = await Auth.signIn(email, password); // step1
      dispatch(login(user)); // step2
      const profile = await getMyProfile(); // step 3
      dispatch(setTwitterProfile(profile)); // step 4
      console.log('Twitter Profile: ', twitterProfile); // step 5
      const userInfo = await Auth.currentUserInfo();
      console.log('User Info: ', userInfo);
      // navigate('/home');
    } catch (error: any) {
      dispatch(logout());
      alert(error.message);
    }
  };

`

The way I would like this function to execute is run second step only when step one is completed and so on.
Sometimes my pofile object is empty as results are asynchronous.

Trying : Async Await to run code imperatively
Expecting : Each step runs after result is fetched from the previous step


问:
How to transform qw qx qy qz tx ty tz to Matrix4f for pcl transformation
how to transform qw qx qy qz tx ty tz to Matrix4f

I think the answer is

```<code>1 - 2*qy^2 - 2*qz^2   2*qx*qy - 2*qz*qw     2*qx*qz + 2*qy*qw      tx
2*qx*qy + 2*qz*qw     1 - 2*qx^2 - 2*qz^2   2*qy*qz - 2*qx*qw      ty
2*qx*qz - 2*qy*qw     2*qy*qz + 2*qx*qw     1 - 2*qx^2 - 2*qy^2]   tz
0                     0                     0                      1
</code>```

Is it correct??

Body:
how to transform qw qx qy qz tx ty tz to Matrix4f

I think the answer is

1 - 2*qy^2 - 2*qz^2   2*qx*qy - 2*qz*qw     2*qx*qz + 2*qy*qw      tx
2*qx*qy + 2*qz*qw     1 - 2*qx^2 - 2*qz^2   2*qy*qz - 2*qx*qw      ty
2*qx*qz - 2*qy*qw     2*qy*qz + 2*qx*qw     1 - 2*qx^2 - 2*qy^2]   tz
0                     0                     0                      1

Is it correct??


问:
Source Insight 4 Stuck and Not Working, How can I get it to work?
When using Source Insight4 to find a symbol, it gets stuck and no working after the first character is entered

Has anyone encountered a similar problem and have any ideas on how to solve it?


问:
How can I set specific response for 404 not found on Nginx
I have nginx configuration as below. I've added error_page configuration however it didn't work.
Nginx version is 1.14.1. The line of "error_page  404 /404.html" doesn't work , İs there any other solution? I want to response "IT WOKRS" when get 404. Error page parameter didn't work may be there is some other alternative solution.

Thanks.

```<code>worker_processes 1;

events {
    worker_connections 1024;
 }

http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format combined_ssl 'time_local="$time_local" server="$host" dest_ip="$server_addr" '
            'src="$remote_addr" '
            'protocol="$server_protocol" status="$status" '
            'bytes_out="$body_bytes_sent" bytes_in="$upstream_response_length" '
            'http_x_forwarded_for="$http_x_forwarded_for" '
            'uri_path="$uri" '
            'http_method="$request_method" response_time="$upstream_response_time" '
            'request_time="$request_time" ssl_protocol="$ssl_protocol" ssl_cipher="$ssl_cipher"';

    server_tokens off;
    upstream app {
            server localhost:8080;
    }

    server {
    listen 443 ssl;
    server_name ****.com.tr;
    server_name_in_redirect on;
    keepalive_timeout 70;
    allow all;
    ssl_protocols TLSv1.2 TLSv1.1;
    ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:!RC4:RSA:+HIGH:+MEDIUM;
    ssl_certificate /***.cer;
    ssl_certificate_key /****.pem;
    ssl_session_timeout 10m;
    add_header Content-Security-Policy "object-src data: 'unsafe-eval';";
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
    add_header X-XSS-Protection "1; mode=block";
    if ($request_method ~ ^(OPTIONS)$)
    {
        return 405;
    }

    location / {
        proxy_set_header X-Forwarded-Protocol $scheme;
        root   html;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header HOST $http_host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-NginX-Proxy true;
        proxy_http_version 1.1;
        proxy_pass http://app;
        if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") {
                            set $year $1;
                            set $month $2;
                            set $day $3;
                    }
                    access_log /****_8443-$year-$month-$day.log combined_ssl;
    }
    error_page  404  /usr/share/nginx/html/404.html;
    }
}}
</code>```

Body:
I have nginx configuration as below. I've added error_page configuration however it didn't work.
Nginx version is 1.14.1. The line of "error_page  404 /404.html" doesn't work , İs there any other solution? I want to response "IT WOKRS" when get 404. Error page parameter didn't work may be there is some other alternative solution.

Thanks.

worker_processes 1;

events {
    worker_connections 1024;
 }

http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format combined_ssl 'time_local="$time_local" server="$host" dest_ip="$server_addr" '
            'src="$remote_addr" '
            'protocol="$server_protocol" status="$status" '
            'bytes_out="$body_bytes_sent" bytes_in="$upstream_response_length" '
            'http_x_forwarded_for="$http_x_forwarded_for" '
            'uri_path="$uri" '
            'http_method="$request_method" response_time="$upstream_response_time" '
            'request_time="$request_time" ssl_protocol="$ssl_protocol" ssl_cipher="$ssl_cipher"';

    server_tokens off;
    upstream app {
            server localhost:8080;
    }

    server {
    listen 443 ssl;
    server_name ****.com.tr;
    server_name_in_redirect on;
    keepalive_timeout 70;
    allow all;
    ssl_protocols TLSv1.2 TLSv1.1;
    ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:!RC4:RSA:+HIGH:+MEDIUM;
    ssl_certificate /***.cer;
    ssl_certificate_key /****.pem;
    ssl_session_timeout 10m;
    add_header Content-Security-Policy "object-src data: 'unsafe-eval';";
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
    add_header X-XSS-Protection "1; mode=block";
    if ($request_method ~ ^(OPTIONS)$)
    {
        return 405;
    }

    location / {
        proxy_set_header X-Forwarded-Protocol $scheme;
        root   html;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header HOST $http_host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-NginX-Proxy true;
        proxy_http_version 1.1;
        proxy_pass http://app;
        if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") {
                            set $year $1;
                            set $month $2;
                            set $day $3;
                    }
                    access_log /****_8443-$year-$month-$day.log combined_ssl;
    }
    error_page  404  /usr/share/nginx/html/404.html;
    }
}}


问:
How to create multilevel/multigroups forest plot with ggplot
I'm a super beginner with R & RStudio and I'm desperately looking for a solution to the following problem:

I'm performing a soubgroups analysis in which we compare the cognitive performance (measured by the so called Montreal Cognitive Assessment Test) of different coffee consumer groups (devided by the number of cups consumed by day, e.g. <1cup/d, 1cup/d. 2-3cups/d, 4-5cups/d and >5cups/d). We would like to performe sex (female vs. male) and age (<80 and >80 years of age) related subanalysis. Up to now i was able to show the results of one single group (e.g. only male, or only male <80 years of age). See code and plot below.

2b. Subanalyzes

```<code>dt_bsl_women <- dt_bsl[dt_bsl$pat.sex=="Female",]
dt_bsl_men <- dt_bsl[dt_bsl$pat.sex=="Male",]
dt_bsl_old <- dt_bsl[dt_bsl$age.bl>80,]
dt_bsl_young <- dt_bsl[dt_bsl$age.bl<=80,]
dt_bsl_men_old <- dt_bsl[dt_bsl$pat.sex=="Male"&dt_bsl$age.bl>80,]
dt_bsl_men_young <- dt_bsl[dt_bsl$pat.sex=="Male"&dt_bsl$age.bl<=80,]
dt_bsl_women_old <- dt_bsl[dt_bsl$pat.sex=="Female"&dt_bsl$age.bl>80,]
dt_bsl_women_young <- dt_bsl[dt_bsl$pat.sex=="Female"&dt_bsl$age.bl<=80,]
</code>```

Models for MoCA-score

Only men

```<code>mod_bsl <- lmer (moca.merged ~ exposure + age.bsl.centered + education +
                  bmi.centered + sport + active_smoker + prev.stroke + prev.diabetes +
                  prev.hypertonie + gds.cat +
                    (1|center) + crphs + il6, data= subset(dt_bsl_men , dt_bsl_women))
# summary(mod_bsl)
ci <- confint(mod_bsl, oldNames=FALSE)
output <- tidy(mod_bsl, conf.int=TRUE, exponentiate=FALSE, effects="fixed")[,-1]
kable(output[,c(1,2,7,8,6)], digits=c(2,2,2,2,3))

# plot
res <- data.frame("term"=c("1", "2-3", "4-5", ">5"),
                  "estimate" = summary(mod_bsl)$coefficients[2:5,1],
                  "conf.low" = ci[4:7,1],
                  "conf.high"= ci[4:7,2])
res$term <- factor(res$term, levels=c("1", "2-3", "4-5", ">5"))

ggplot(res, aes(y = estimate, x = term, col=term)) +
    geom_pointrange(aes(ymin = conf.low, ymax = conf.high), size = 0.8)+
    geom_hline(yintercept = 0, linetype = "dotted", size = 1) +
    labs(title="MoCA-Scores in men with different coffee consumption", y = "Effect estimate on MoCA-score", x = "Consumed cups of coffee per day") +
    coord_flip(ylim = c(-6, 8)) +
   theme_bw()+
    theme(legend.position="none", axis.text=element_text(size=14, face = "bold"), axis.title=element_text(size=18), plot.title =   element_text(size=22))
</code>```

The outpot looks like following:

My goal is to create something like this, in which several groups (here comparison Sweden and Danmark) in my case with e.g. only males, only female, male >80 years of age, female >80 years of age and so on in one plot.

Many thanks for your help!

I tried to add at the lmer function at the last position the different dataset dt_bsl_women resp. dt_bsl_men etc...

I also tried the function groupby(xxx) but it didn't work.

Body:
I'm a super beginner with R & RStudio and I'm desperately looking for a solution to the following problem:

I'm performing a soubgroups analysis in which we compare the cognitive performance (measured by the so called Montreal Cognitive Assessment Test) of different coffee consumer groups (devided by the number of cups consumed by day, e.g. <1cup/d, 1cup/d. 2-3cups/d, 4-5cups/d and >5cups/d). We would like to performe sex (female vs. male) and age (<80 and >80 years of age) related subanalysis. Up to now i was able to show the results of one single group (e.g. only male, or only male <80 years of age). See code and plot below.

2b. Subanalyzes

dt_bsl_women <- dt_bsl[dt_bsl$pat.sex=="Female",]
dt_bsl_men <- dt_bsl[dt_bsl$pat.sex=="Male",]
dt_bsl_old <- dt_bsl[dt_bsl$age.bl>80,]
dt_bsl_young <- dt_bsl[dt_bsl$age.bl<=80,]
dt_bsl_men_old <- dt_bsl[dt_bsl$pat.sex=="Male"&dt_bsl$age.bl>80,]
dt_bsl_men_young <- dt_bsl[dt_bsl$pat.sex=="Male"&dt_bsl$age.bl<=80,]
dt_bsl_women_old <- dt_bsl[dt_bsl$pat.sex=="Female"&dt_bsl$age.bl>80,]
dt_bsl_women_young <- dt_bsl[dt_bsl$pat.sex=="Female"&dt_bsl$age.bl<=80,]

Models for MoCA-score

Only men

mod_bsl <- lmer (moca.merged ~ exposure + age.bsl.centered + education +
                  bmi.centered + sport + active_smoker + prev.stroke + prev.diabetes +
                  prev.hypertonie + gds.cat +
                    (1|center) + crphs + il6, data= subset(dt_bsl_men , dt_bsl_women))
# summary(mod_bsl)
ci <- confint(mod_bsl, oldNames=FALSE)
output <- tidy(mod_bsl, conf.int=TRUE, exponentiate=FALSE, effects="fixed")[,-1]
kable(output[,c(1,2,7,8,6)], digits=c(2,2,2,2,3))

# plot
res <- data.frame("term"=c("1", "2-3", "4-5", ">5"),
                  "estimate" = summary(mod_bsl)$coefficients[2:5,1],
                  "conf.low" = ci[4:7,1],
                  "conf.high"= ci[4:7,2])
res$term <- factor(res$term, levels=c("1", "2-3", "4-5", ">5"))

ggplot(res, aes(y = estimate, x = term, col=term)) +
    geom_pointrange(aes(ymin = conf.low, ymax = conf.high), size = 0.8)+
    geom_hline(yintercept = 0, linetype = "dotted", size = 1) +
    labs(title="MoCA-Scores in men with different coffee consumption", y = "Effect estimate on MoCA-score", x = "Consumed cups of coffee per day") +
    coord_flip(ylim = c(-6, 8)) +
   theme_bw()+
    theme(legend.position="none", axis.text=element_text(size=14, face = "bold"), axis.title=element_text(size=18), plot.title =   element_text(size=22))

The outpot looks like following:

My goal is to create something like this, in which several groups (here comparison Sweden and Danmark) in my case with e.g. only males, only female, male >80 years of age, female >80 years of age and so on in one plot.

Many thanks for your help!

I tried to add at the lmer function at the last position the different dataset dt_bsl_women resp. dt_bsl_men etc...

I also tried the function groupby(xxx) but it didn't work.


问:
During spring-boot startup, because of spring-amqp, thread locked. How should I solve it?
environment

spring boot 2.7.5
spring amqp 2.4.7
spring rabbit 2.4.7

situation

when spring boot application start, because of RabbitAdmin.afterProperties(), main thread locked.
The cause is that the rabbitmq server is blocked. So restarting the rabbitmq server solved the problem.

I want to know the solution how to throw timeoutException in client.
( throw timeoutexception --> release lock)

thread-dump

```<code>"main" #1 in Object.wait()
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(java.base@17.0.4/Native Method)
        - waiting on <0x00000000f9e57938> (a com.rabbitmq.utility.BlockingValueOrException)
        at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:73)
        - locked <0x00000000f9e57938> (a com.rabbitmq.utility.BlockingValueOrException)
        at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:120)
        - locked <0x00000000f9e57938> (a com.rabbitmq.utility.BlockingValueOrException)
        at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
        at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
        at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:293)
        at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:141)
        at com.rabbitmq.client.impl.ChannelN.exchangeDeclare(ChannelN.java:783)
        at com.rabbitmq.client.impl.ChannelN.exchangeDeclare(ChannelN.java:46)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@17.0.4/Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@17.0.4/NativeMethodAccessorImpl.java:77)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@17.0.4/DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(java.base@17.0.4/Method.java:568)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:1162)
        - locked <0x00000000ec3e9b18> (a java.lang.Object)
        at jdk.proxy3.$Proxy296.exchangeDeclare(jdk.proxy3/Unknown Source)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.declareExchanges(RabbitAdmin.java:797)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.lambda$initialize$12(RabbitAdmin.java:692)
        at org.springframework.amqp.rabbit.core.RabbitAdmin$$Lambda$1716/0x0000000801f69050.doInRabbit(Unknown Source)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.invokeAction(RabbitTemplate.java:2240)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:2201)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2153)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2133)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.initialize(RabbitAdmin.java:691)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.lambda$afterPropertiesSet$10(RabbitAdmin.java:619)
        at org.springframework.amqp.rabbit.core.RabbitAdmin$$Lambda$1711/0x0000000801f664b8.doWithRetry(Unknown Source)
        at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329)
        at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:209)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.lambda$afterPropertiesSet$11(RabbitAdmin.java:618)
        at org.springframework.amqp.rabbit.core.RabbitAdmin$$Lambda$1710/0x0000000801f66260.onCreate(Unknown Source)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.addConnectionListener(CachingConnectionFactory.java:521)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.afterPropertiesSet(RabbitAdmin.java:604)
        - locked <0x00000000ee508e68> (a java.lang.Object)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$433/0x00000008012bba50.getObject(Unknown Source)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        - locked <0x00000000e139cfe8> (a java.util.concurrent.ConcurrentHashMap)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        - locked <0x00000000e1914300> (a java.lang.Object)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)

</code>```

try

rabbitmq-startup option

timeout option

expect
throw timeoutException --> release lock

Body:
environment

spring boot 2.7.5
spring amqp 2.4.7
spring rabbit 2.4.7

situation

when spring boot application start, because of RabbitAdmin.afterProperties(), main thread locked.
The cause is that the rabbitmq server is blocked. So restarting the rabbitmq server solved the problem.

I want to know the solution how to throw timeoutException in client.
( throw timeoutexception --> release lock)

thread-dump

"main" #1 in Object.wait()
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(java.base@17.0.4/Native Method)
        - waiting on <0x00000000f9e57938> (a com.rabbitmq.utility.BlockingValueOrException)
        at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:73)
        - locked <0x00000000f9e57938> (a com.rabbitmq.utility.BlockingValueOrException)
        at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:120)
        - locked <0x00000000f9e57938> (a com.rabbitmq.utility.BlockingValueOrException)
        at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
        at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
        at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:293)
        at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:141)
        at com.rabbitmq.client.impl.ChannelN.exchangeDeclare(ChannelN.java:783)
        at com.rabbitmq.client.impl.ChannelN.exchangeDeclare(ChannelN.java:46)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@17.0.4/Native Method)
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@17.0.4/NativeMethodAccessorImpl.java:77)
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@17.0.4/DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(java.base@17.0.4/Method.java:568)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:1162)
        - locked <0x00000000ec3e9b18> (a java.lang.Object)
        at jdk.proxy3.$Proxy296.exchangeDeclare(jdk.proxy3/Unknown Source)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.declareExchanges(RabbitAdmin.java:797)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.lambda$initialize$12(RabbitAdmin.java:692)
        at org.springframework.amqp.rabbit.core.RabbitAdmin$$Lambda$1716/0x0000000801f69050.doInRabbit(Unknown Source)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.invokeAction(RabbitTemplate.java:2240)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:2201)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2153)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2133)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.initialize(RabbitAdmin.java:691)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.lambda$afterPropertiesSet$10(RabbitAdmin.java:619)
        at org.springframework.amqp.rabbit.core.RabbitAdmin$$Lambda$1711/0x0000000801f664b8.doWithRetry(Unknown Source)
        at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:329)
        at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:209)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.lambda$afterPropertiesSet$11(RabbitAdmin.java:618)
        at org.springframework.amqp.rabbit.core.RabbitAdmin$$Lambda$1710/0x0000000801f66260.onCreate(Unknown Source)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.addConnectionListener(CachingConnectionFactory.java:521)
        at org.springframework.amqp.rabbit.core.RabbitAdmin.afterPropertiesSet(RabbitAdmin.java:604)
        - locked <0x00000000ee508e68> (a java.lang.Object)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$433/0x00000008012bba50.getObject(Unknown Source)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        - locked <0x00000000e139cfe8> (a java.util.concurrent.ConcurrentHashMap)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        - locked <0x00000000e1914300> (a java.lang.Object)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)

try

rabbitmq-startup option

timeout option

expect
throw timeoutException --> release lock


问:
update Marketing URL in app store connect
Hello my app just approved on app store so how can I change/update marketing URL in app store connect?

I am trying to click on it but not selecting


问:
Application fails to start when deployed
I run into this message "Shiny app runs locally, error when trying to deploy it". It works perfectly well on the local computer, but I cannot deploy it.

It prints the red error message as in below. I also attach my code below.

`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  pseudoinverse used at 11.985
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  neighborhood radius 1.015
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  reciprocal condition number  1.4432e-29
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  There are other near singularities as well. 1
Warning in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  pseudoinverse used at 11.985
Warning in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  neighborhood radius 1.015
Warning in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  reciprocal condition number  1.4432e-29
Warning in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  There are other near singularities as well. 1
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
```
</blockquote>
```library(ggplot2)
library(shiny)
library(shinydashboard)
library(tidyverse)
library(readr)
library(naniar)
library(rmarkdown)

# Data import
wages <- read.csv("http://murraylax.org/datasets/wage2.csv")

# Data preprocessing
na_strings <- c(".", "NA", "N A", "N / A", "N/A", "N/ A", "Not Available", "NOt available")
wages <- wages %>% replace_with_na_all(condition = ~.x %in% na_strings)
wages = as.data.frame(sapply(wages, as.numeric))

# Multi-variate choices
AttributeChoices=c("MonthlyEarnings","AveWeeklyHours","IQ","Knowledge","YearsEdu",
                   "Tenure","Age","Married", "Black", "South", "Urban",
                   "NumSiblings", "BirthOrder", "MomEdu", "DadEdu")

server <- function(input, output) {

  output$plot1 <- renderPlot({
    dat <- wages[1:input$myslider1,]
    ggplot(dat, aes(MonthlyEarnings)) + geom_histogram(fill="gold4")
  })

  output$plot2 <- renderPlot({
    dat <- wages[1:input$myslider1,]
    ggplot(dat, aes(IQ)) + geom_histogram(fill="cadetblue")
  })

  output$plot3 <- renderPlot({
    dat <- wages[1:input$myslider1,]
    ggplot(dat, aes(YearsEdu)) + geom_histogram(fill="darkgray", binwidth = 1)
  })

  output$plot4 <- renderPlot({
    dat <- wages[1:input$myslider1,]
    ggplot(dat, aes(YearsExperience)) + geom_histogram(fill="forestgreen", binwidth = 1)
  })

  output$myPlot1 <-
    renderPlot({
      dat <-
        wages |>
        filter(YearsEdu >= input$range1[1],
               YearsEdu <= input$range1[2])

      ggplot(dat, aes(YearsEdu, MonthlyEarnings)) + geom_point(position="jitter") + stat_smooth()
    })

  output$myPlot2 <-
    renderPlot({
      dat <-
        wages |>
        filter(IQ >= input$range2[1],
               IQ <= input$range2[2])

      ggplot(dat, aes(IQ, MonthlyEarnings)) + geom_point(position="jitter") + stat_smooth()
    })

  output$myPlot3 <-
    renderPlot({
      dat <-
        wages |>
        filter(YearsExperience >= input$range3[1],
               YearsExperience <= input$range3[2])

      ggplot(dat, aes(YearsExperience, MonthlyEarnings)) + geom_point(position="jitter") + stat_smooth()
    })

  output$indep <- renderUI({
    selectInput(inputId = "indep", label = "Independent Variables",
                multiple = TRUE, choices = as.list(AttributeChoices[AttributeChoices!= input$dependent]), selected = AttributeChoices[1])
  })

  recipe_formula <- reactive({
    req(input$indep)
    wages %>%
      recipe() %>%
      update_role(!!!input$dependent, new_role = "outcome") %>%
      update_role(!!!input$indep, new_role = "predictor") %>%
      prep() %>%
      formula()
  })

  lm_reg <- reactive(
    lm(recipe_formula(),data = wages)
  )

  output$RegOut = renderPrint({
    summary(lm_reg())
  })

  output$tableDT <- DT::renderDataTable(wages,
                                        options = list(paging=F),
                                        rownames=F,
                                        filter = "top")
  output$table <- DT::renderDataTable(DT::datatable(cust()))

}

ui <- dashboardPage(
  dashboardHeader(title = "Analysis of Income"),
  dashboardSidebar(
    sidebarMenu(
      menuItem("Histogram", tabName = "histogram", icon = icon("calendar")),
      menuItem("Range control", tabName = "control", icon = icon("dashboard")),
      menuItem("Regression", tabName = "regression", icon = icon("th")),
      menuItem("Dataset", tabName = "dtset", icon = icon("table"))
    )
  ),
  dashboardBody(
    tabItems(
      # First tab content
      tabItem(tabName = "histogram",
              h1("Variables affecting monthly earnings: data from 1980 for 935 individuals"),
              fluidRow(
                box(plotOutput("plot1", height = 250)),
                box(plotOutput("plot2", height = 250)),
                box(plotOutput("plot3", height = 250)),
                box(plotOutput("plot4", height = 250)),

                box(
                  title = "Controls",
                  sliderInput("myslider1", "Sample Size:", 1, 935, 400)
                )
              )
      ),

      # Second tab content
      tabItem(tabName = "control",
              h1("Set the range of predictors about Monthly Earnings"),
              fluidRow(
                sliderInput(inputId = "range1",
                            label = h2("YearsEdu Vs. Earning"),
                            min = 9,
                            max = 18,
                            value = c(12, 15)),

                plotOutput(outputId = "myPlot1", height = 250),

                sliderInput(inputId = "range2",
                            label = h2("IQ Vs. Earning"),
                            min = 50,
                            max = 150,
                            value = c(80, 120)),

                plotOutput(outputId = "myPlot2", height = 250),

                sliderInput(inputId = "range3",
                            label = h2("YearsExperience Vs. Earning"),
                            min = 1,
                            max = 23,
                            value = c(8, 15)),

                plotOutput(outputId = "myPlot3", height = 250)
              )
      ),

      # third tab content
      tabItem(tabName = "regression",
              h1("Choose your dependent and indenpendent variables for regression"),
              selectInput(inputId="dependent", label = "Dependent Variables",
                          choices = as.list(AttributeChoices)),
              uiOutput("indep"),
              verbatimTextOutput(outputId = "RegOut")
      ),

      # fourth tab content
      tabItem(tabName = "dtset",
              h1("Original dataset"),
                DT::dataTableOutput("tableDT"))
              )

    )
  )

shinyApp(ui, server)
```

Body:
I run into this message "Shiny app runs locally, error when trying to deploy it". It works perfectly well on the local computer, but I cannot deploy it.

It prints the red error message as in below. I also attach my code below.

`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  pseudoinverse used at 11.985
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  neighborhood radius 1.015
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  reciprocal condition number  1.4432e-29
Warning in simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :
  There are other near singularities as well. 1
Warning in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  pseudoinverse used at 11.985
Warning in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  neighborhood radius 1.015
Warning in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  reciprocal condition number  1.4432e-29
Warning in predLoess(object$y, object$x, newx = if (is.null(newdata)) object$x else if (is.data.frame(newdata)) as.matrix(model.frame(delete.response(terms(object)),  :
  There are other near singularities as well. 1
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

library(ggplot2)
library(shiny)
library(shinydashboard)
library(tidyverse)
library(readr)
library(naniar)
library(rmarkdown)

# Data import
wages <- read.csv("http://murraylax.org/datasets/wage2.csv")

# Data preprocessing
na_strings <- c(".", "NA", "N A", "N / A", "N/A", "N/ A", "Not Available", "NOt available")
wages <- wages %>% replace_with_na_all(condition = ~.x %in% na_strings)
wages = as.data.frame(sapply(wages, as.numeric))

# Multi-variate choices
AttributeChoices=c("MonthlyEarnings","AveWeeklyHours","IQ","Knowledge","YearsEdu",
                   "Tenure","Age","Married", "Black", "South", "Urban",
                   "NumSiblings", "BirthOrder", "MomEdu", "DadEdu")

server <- function(input, output) {

  output$plot1 <- renderPlot({
    dat <- wages[1:input$myslider1,]
    ggplot(dat, aes(MonthlyEarnings)) + geom_histogram(fill="gold4")
  })

  output$plot2 <- renderPlot({
    dat <- wages[1:input$myslider1,]
    ggplot(dat, aes(IQ)) + geom_histogram(fill="cadetblue")
  })

  output$plot3 <- renderPlot({
    dat <- wages[1:input$myslider1,]
    ggplot(dat, aes(YearsEdu)) + geom_histogram(fill="darkgray", binwidth = 1)
  })

  output$plot4 <- renderPlot({
    dat <- wages[1:input$myslider1,]
    ggplot(dat, aes(YearsExperience)) + geom_histogram(fill="forestgreen", binwidth = 1)
  })

  output$myPlot1 <-
    renderPlot({
      dat <-
        wages |>
        filter(YearsEdu >= input$range1[1],
               YearsEdu <= input$range1[2])

      ggplot(dat, aes(YearsEdu, MonthlyEarnings)) + geom_point(position="jitter") + stat_smooth()
    })

  output$myPlot2 <-
    renderPlot({
      dat <-
        wages |>
        filter(IQ >= input$range2[1],
               IQ <= input$range2[2])

      ggplot(dat, aes(IQ, MonthlyEarnings)) + geom_point(position="jitter") + stat_smooth()
    })

  output$myPlot3 <-
    renderPlot({
      dat <-
        wages |>
        filter(YearsExperience >= input$range3[1],
               YearsExperience <= input$range3[2])

      ggplot(dat, aes(YearsExperience, MonthlyEarnings)) + geom_point(position="jitter") + stat_smooth()
    })

  output$indep <- renderUI({
    selectInput(inputId = "indep", label = "Independent Variables",
                multiple = TRUE, choices = as.list(AttributeChoices[AttributeChoices!= input$dependent]), selected = AttributeChoices[1])
  })

  recipe_formula <- reactive({
    req(input$indep)
    wages %>%
      recipe() %>%
      update_role(!!!input$dependent, new_role = "outcome") %>%
      update_role(!!!input$indep, new_role = "predictor") %>%
      prep() %>%
      formula()
  })

  lm_reg <- reactive(
    lm(recipe_formula(),data = wages)
  )

  output$RegOut = renderPrint({
    summary(lm_reg())
  })

  output$tableDT <- DT::renderDataTable(wages,
                                        options = list(paging=F),
                                        rownames=F,
                                        filter = "top")
  output$table <- DT::renderDataTable(DT::datatable(cust()))

}

ui <- dashboardPage(
  dashboardHeader(title = "Analysis of Income"),
  dashboardSidebar(
    sidebarMenu(
      menuItem("Histogram", tabName = "histogram", icon = icon("calendar")),
      menuItem("Range control", tabName = "control", icon = icon("dashboard")),
      menuItem("Regression", tabName = "regression", icon = icon("th")),
      menuItem("Dataset", tabName = "dtset", icon = icon("table"))
    )
  ),
  dashboardBody(
    tabItems(
      # First tab content
      tabItem(tabName = "histogram",
              h1("Variables affecting monthly earnings: data from 1980 for 935 individuals"),
              fluidRow(
                box(plotOutput("plot1", height = 250)),
                box(plotOutput("plot2", height = 250)),
                box(plotOutput("plot3", height = 250)),
                box(plotOutput("plot4", height = 250)),

                box(
                  title = "Controls",
                  sliderInput("myslider1", "Sample Size:", 1, 935, 400)
                )
              )
      ),

      # Second tab content
      tabItem(tabName = "control",
              h1("Set the range of predictors about Monthly Earnings"),
              fluidRow(
                sliderInput(inputId = "range1",
                            label = h2("YearsEdu Vs. Earning"),
                            min = 9,
                            max = 18,
                            value = c(12, 15)),

                plotOutput(outputId = "myPlot1", height = 250),

                sliderInput(inputId = "range2",
                            label = h2("IQ Vs. Earning"),
                            min = 50,
                            max = 150,
                            value = c(80, 120)),

                plotOutput(outputId = "myPlot2", height = 250),

                sliderInput(inputId = "range3",
                            label = h2("YearsExperience Vs. Earning"),
                            min = 1,
                            max = 23,
                            value = c(8, 15)),

                plotOutput(outputId = "myPlot3", height = 250)
              )
      ),

      # third tab content
      tabItem(tabName = "regression",
              h1("Choose your dependent and indenpendent variables for regression"),
              selectInput(inputId="dependent", label = "Dependent Variables",
                          choices = as.list(AttributeChoices)),
              uiOutput("indep"),
              verbatimTextOutput(outputId = "RegOut")
      ),

      # fourth tab content
      tabItem(tabName = "dtset",
              h1("Original dataset"),
                DT::dataTableOutput("tableDT"))
              )

    )
  )

shinyApp(ui, server)


问:
Angular + Spring BOOT single app referencing ng sources in home.html using thymeleaf wildcard for file names
I use Angular and Spring boot as a single app. I compile my Angular sources to spring src/main/resources and load them from my HomeController:

@Controller
public class HomeController {

    @CrossOrigin
    @GetMapping("/")
    public String home() {
        return "home";
    }

}
```
<p>which loads a home.html template that is almost a direct copy of ng build resource index.html except for the modification of js script and css file names that are generated on build time by ng:</p>
```<!DOCTYPE html>

  <meta charset="utf-8">
  <title>NgFrontEnd</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" th:href="@{/assets/img/tabIcon.ico}">

<link rel="stylesheet" th:href="@{styles.dc8a9c77dc291249.css}" media="print" onload="this.media='all'">

        <link rel="stylesheet" th:href="@{styles.dc8a9c77dc291249.css}">

  <app-root></app-root>

```
<p>Body part has all the resources listed in a thymeleaf markation. Every time i change something in front-end side and compile new sources i have to manually set new generated names for main and css files in home.html to reflect new generated file changes.</p>
<p>my pom.xml:</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.company</groupId>
    <artifactId>main</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>main</name>
    <description>desc</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf -->
        <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

</code>```

I tried doing following, since everything that changes in the file name is cryptic center part of file name:

but thymeleaf seems not to tolerate such wildcard expression in the file name and when program is run, script is not found. I tried searching thymeleaf documentation, but failed to find any useful solution on how wilcards are used in filenames for thymeleaf.

Any ideas?

Body:
I use Angular and Spring boot as a single app. I compile my Angular sources to spring src/main/resources and load them from my HomeController:

@Controller
public class HomeController {

    @CrossOrigin
    @GetMapping("/")
    public String home() {
        return "home";
    }

}

which loads a home.html template that is almost a direct copy of ng build resource index.html except for the modification of js script and css file names that are generated on build time by ng:

<!DOCTYPE html>

  <meta charset="utf-8">
  <title>NgFrontEnd</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" th:href="@{/assets/img/tabIcon.ico}">

<link rel="stylesheet" th:href="@{styles.dc8a9c77dc291249.css}" media="print" onload="this.media='all'">

        <link rel="stylesheet" th:href="@{styles.dc8a9c77dc291249.css}">

  <app-root></app-root>

Body part has all the resources listed in a thymeleaf markation. Every time i change something in front-end side and compile new sources i have to manually set new generated names for main and css files in home.html to reflect new generated file changes.

my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
        <relativePath/>
    </parent>
    <groupId>com.company</groupId>
    <artifactId>main</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>main</name>
    <description>desc</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

I tried doing following, since everything that changes in the file name is cryptic center part of file name:

but thymeleaf seems not to tolerate such wildcard expression in the file name and when program is run, script is not found. I tried searching thymeleaf documentation, but failed to find any useful solution on how wilcards are used in filenames for thymeleaf.

Any ideas?


问:
Module not found: Error: Package path ./lib/index is not exported from package /node_modules/highlight.js
I'm using Laravel, When I run npm run dev, it shows this:

```<code>ERROR in ./resources/assets/vendor/libs/highlight/highlight.js 4:0-42
Module not found: Error: Package path ./lib/index is not exported from package /home/wwwroot/myproject/node_modules/highlight.js (see exports field in /home/wwwroot/myproject/node_modules/highlight.js/package.json)
</code>```

I checked /home/wwwroot/myproject/node_modules/highlight.js and there is ./lib/index.js
I've changed these in myproject before running npm run dev with root, but nothing changed:

chmod 775 myproject -R

chown www:www -R myproject

Body:
I'm using Laravel, When I run npm run dev, it shows this:

ERROR in ./resources/assets/vendor/libs/highlight/highlight.js 4:0-42
Module not found: Error: Package path ./lib/index is not exported from package /home/wwwroot/myproject/node_modules/highlight.js (see exports field in /home/wwwroot/myproject/node_modules/highlight.js/package.json)

I checked /home/wwwroot/myproject/node_modules/highlight.js and there is ./lib/index.js
I've changed these in myproject before running npm run dev with root, but nothing changed:

chmod 775 myproject -R

chown www:www -R myproject


问:
Core Data crashes while attempting to read external data
I have an iOS app that stores images in Core Data using External Storage. From time to time I get crash reports with the following error (in this particular instance it's running on a M1 Mac via Catalyst):

```<code>Unable to open file with path /Users/user/Library/Group Containers/group.myapp/.myapp_SUPPORT/_EXTERNAL_DATA/61681DBF-B1A4-4325-9104-E21A1218F046 (92)
</code>```

The relevant stack trace bit looks like this:

```<code>0  CoreFoundation +0xfc408  __exceptionPreprocess
1  libobjc.A.dylib +0x1aea4 objc_exception_throw
2  CoreData +0x12cda0       +[_PFRoutines readExternalReferenceDataFromFile:]
3  CoreData +0xe9db8        -[_PFExternalReferenceData _attemptToMapData:]
4  CoreData +0xd7894        -[_PFExternalReferenceData _retrieveExternalData]
5  Foundation +0x46f2f8     specialized static Data._unconditionallyBridgeFromObjectiveC(_:)
6  MyApp +0x15eb80          Image.thumbnailImage.getter (Image.swift:25:22)
</code>```

All I'm doing in Image.swift:25:22 is declaring a variable with the contents of the image:

```<code>let data = self.thumbnail // 'thumbnail' is my Binary Data attribute
</code>```

I've tried to reproduce this crash on my machine by intentionally deleting, corrupting and changing permissions on external storage files but that doesn't work.

Does anyone have the slightest idea of what's going on, or how to prevent or fix this?

Body:
I have an iOS app that stores images in Core Data using External Storage. From time to time I get crash reports with the following error (in this particular instance it's running on a M1 Mac via Catalyst):

Unable to open file with path /Users/user/Library/Group Containers/group.myapp/.myapp_SUPPORT/_EXTERNAL_DATA/61681DBF-B1A4-4325-9104-E21A1218F046 (92)

The relevant stack trace bit looks like this:

0  CoreFoundation +0xfc408  __exceptionPreprocess
1  libobjc.A.dylib +0x1aea4 objc_exception_throw
2  CoreData +0x12cda0       +[_PFRoutines readExternalReferenceDataFromFile:]
3  CoreData +0xe9db8        -[_PFExternalReferenceData _attemptToMapData:]
4  CoreData +0xd7894        -[_PFExternalReferenceData _retrieveExternalData]
5  Foundation +0x46f2f8     specialized static Data._unconditionallyBridgeFromObjectiveC(_:)
6  MyApp +0x15eb80          Image.thumbnailImage.getter (Image.swift:25:22)

All I'm doing in Image.swift:25:22 is declaring a variable with the contents of the image:

let data = self.thumbnail // 'thumbnail' is my Binary Data attribute

I've tried to reproduce this crash on my machine by intentionally deleting, corrupting and changing permissions on external storage files but that doesn't work.

Does anyone have the slightest idea of what's going on, or how to prevent or fix this?


问:
How to connect to authenticated SMTP server using OpenSSL in C language
I want to connect to a SMTP server in an authenticated way using username and password.
How to create a connection to the SMTP server and send SMTP commands for sending mail using OpenSSL in C language?
Also for this communication is it mandatory that client should show a certificate?

I have tried connecting to the server using normal socket programming, but after sending EHLO command, AUTH LOGIN is not present in the capability list send by server. So not able to perform authentication using username and password.
So how to connect using OpenSSL so that authentication can be performed before sending SMTP commands?


问:
How to sort local video files for package video_player
I want to sort local files into different groups, such as video group, audio group, pdf group, here is my code:

```<code>  Widget mainContent({int index, CardContentController controller}) {
    return GetBuilder<CardContentController>(builder: (controller) {
      if (controller.contentList[index].contentUrl.contains('mp4')) //  <- here is my question
        { return buildMainContentWidget(index, videoWidget(index, controller),
            onTap: () {
          openFullscreen(index: index, controller: controller);

        });
      } else if (controller.contentList[index].contentUrl.contains('jpg') ||
          controller.contentList[index].contentUrl.contains('jpeg') ||
          controller.contentList[index].contentUrl.contains('png')) {
        return buildMainContentWidget(index, imageWidget(index, controller),
            onTap: () {

        });
      } else if (controller.contentList[index].contentUrl.contains('aac') ||
          controller.contentList[index].contentUrl.contains('wav') ||
          controller.contentList[index].contentUrl.contains('mp3') ||
          controller.contentList[index].contentUrl.contains('ogg')) {
        return buildMainContentWidget(index, audioWidget(index, controller),
            onTap: () {

        });
      }
      return Container(
        height: Get.height * 0.5,
        width: Get.width,
        color: Colors.green,
        child: Center(
          child: Text(
            'Wrong document.'.tr,
            style: mediumTextStyle(textColor: Colors.red),
          ),
        ),
      );
    });
  }
</code>```

I checked doc from package video_player,

```<code>Supported Formats
On iOS, the backing player is AVPlayer. The supported formats vary depending on the version of iOS, AVURLAsset class has audiovisualTypes that you can query for supported av formats.
On Android, the backing player is ExoPlayer, please refer here for list of supported formats.
On Web, available formats depend on your users' browsers (vendor and version). Check package:video_player_web for more specific information.
</code>```

So for android and ios there will be different supported formats which are much more than 'mp4', could you plz help me complete my code to support all video formats based on OS, thank you!

Body:
I want to sort local files into different groups, such as video group, audio group, pdf group, here is my code:

  Widget mainContent({int index, CardContentController controller}) {
    return GetBuilder<CardContentController>(builder: (controller) {
      if (controller.contentList[index].contentUrl.contains('mp4')) //  <- here is my question
        { return buildMainContentWidget(index, videoWidget(index, controller),
            onTap: () {
          openFullscreen(index: index, controller: controller);

        });
      } else if (controller.contentList[index].contentUrl.contains('jpg') ||
          controller.contentList[index].contentUrl.contains('jpeg') ||
          controller.contentList[index].contentUrl.contains('png')) {
        return buildMainContentWidget(index, imageWidget(index, controller),
            onTap: () {

        });
      } else if (controller.contentList[index].contentUrl.contains('aac') ||
          controller.contentList[index].contentUrl.contains('wav') ||
          controller.contentList[index].contentUrl.contains('mp3') ||
          controller.contentList[index].contentUrl.contains('ogg')) {
        return buildMainContentWidget(index, audioWidget(index, controller),
            onTap: () {

        });
      }
      return Container(
        height: Get.height * 0.5,
        width: Get.width,
        color: Colors.green,
        child: Center(
          child: Text(
            'Wrong document.'.tr,
            style: mediumTextStyle(textColor: Colors.red),
          ),
        ),
      );
    });
  }

I checked doc from package video_player,

Supported Formats
On iOS, the backing player is AVPlayer. The supported formats vary depending on the version of iOS, AVURLAsset class has audiovisualTypes that you can query for supported av formats.
On Android, the backing player is ExoPlayer, please refer here for list of supported formats.
On Web, available formats depend on your users' browsers (vendor and version). Check package:video_player_web for more specific information.

So for android and ios there will be different supported formats which are much more than 'mp4', could you plz help me complete my code to support all video formats based on OS, thank you!


问:
Is it safe to assume that all AVX platforms support all levels of SSE?
I am working on a piece of code that needs SIMD vectorization, and I need to make a set of macros to decide which vector types and intrinsics to use (i.e. MYLIB_HAS_SSE, MYLIB_HAS_AVX, etc.).

On GCC and CLang this is fairly straightforward, I just need to check for the corresponding pre-defined macros such as __SSE__ or __SSE4_1__. MSVC on the other hand does not define any such macros other than __AVX__ and __AVX2__ to my knowledge, and support for SSE and SSE2 must be checked via the _M_IX86_FP macro. _M_IX86_FP however, does not seem to give any information beyond SSE2, so if I want to check for SSE3 and beyond I am out of luck. As such, I need to "emulate" the missing macros in some other way.

Is it safe to assume that if MSVC has the __AVX__ macro defined (i.e. the target supports AVX), then the target CPU also supports all levels of SSE up to SSE4.2? Is there any other way to check for SSE support on x86 targets (other than runtime cpuid)?

Also if anyone knows, is there some convenient table of x86 architectures and their corresponding feature levels?


问:
How to initialise connection pool with "n" connections in Redis python library using redis.ConnectionPool
In the Redis Python library, the redis.ConnectionPool class is used to create and manage a pool of connections to a Redis server. A connection pool is an object that maintains a set of idle connections that can be used to send commands to the Redis server. When a new connection is needed, the connection pool creates a new connection and adds it to the pool. When a connection is no longer needed, it is returned to the pool to be reused later.

I want to perform a load test using locust, and exclude time for creating a new connection.
What is clean way to initialize with (say 100) connections?


问:
Stack depth limit exceeded in Postgres when I cast
```<code>INSERT INTO table2 (column1)
SELECT cast(column1 AS INTEGER)
FROM table1
LIMIT 100;
</code>```

I want to do a cast with data from a table to another, but when I try to do this it appears this mistake:

ERROR:  stack depth limit exceeded
HINT:  Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack depth limit is adequate.
CONTEXT:  SQL function "toint" during inlining
SQL function "toint" during startup
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1

What can I do to solve this problem?

Body:
INSERT INTO table2 (column1)
SELECT cast(column1 AS INTEGER)
FROM table1
LIMIT 100;

I want to do a cast with data from a table to another, but when I try to do this it appears this mistake:

ERROR:  stack depth limit exceeded
HINT:  Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack depth limit is adequate.
CONTEXT:  SQL function "toint" during inlining
SQL function "toint" during startup
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1
SQL function "toint" statement 1

What can I do to solve this problem?


问:
Why did $invalid_variation_count change in WooCommerce?
Just changed to WooCommerce 7.2.2. Wc-admin-function.php used to have a query around line 500 that read:

```<code>$invalid_variation_count = $wpdb->get_var(
        "
        SELECT count(post_id) FROM {$wpdb->postmeta}
        WHERE post_id in (" . implode( ',', array_map( 'absint', $variation_ids ) ) . ")
        AND ( meta_key='_subscription_sign_up_fee' OR meta_key='_price' )
        AND meta_value >= 0
        AND meta_value != ''
        "
    );
</code>```

Now, line 508 reads meta_value > 0 and this breaks the functionality of my shop because variation-products with a price of zero are considered invalid. It leads to a warning in admin (which confuses the shop managers) and potentially prevents free products. There isn't a hook, filter or anything in sight that allows me change the query. I have come up with two possible workarounds, neither of them acceptable (making a change to the core of WC or entering prices of 0.001 which get rounded to 0.00 on the frontend).

Two questions:

Does anybody know why the smart people behind WooCommerce made this did change?

Is there a fix without  resorting to changing the core of
WooCommerce?

Body:
Just changed to WooCommerce 7.2.2. Wc-admin-function.php used to have a query around line 500 that read:

$invalid_variation_count = $wpdb->get_var(
        "
        SELECT count(post_id) FROM {$wpdb->postmeta}
        WHERE post_id in (" . implode( ',', array_map( 'absint', $variation_ids ) ) . ")
        AND ( meta_key='_subscription_sign_up_fee' OR meta_key='_price' )
        AND meta_value >= 0
        AND meta_value != ''
        "
    );

Now, line 508 reads meta_value > 0 and this breaks the functionality of my shop because variation-products with a price of zero are considered invalid. It leads to a warning in admin (which confuses the shop managers) and potentially prevents free products. There isn't a hook, filter or anything in sight that allows me change the query. I have come up with two possible workarounds, neither of them acceptable (making a change to the core of WC or entering prices of 0.001 which get rounded to 0.00 on the frontend).

Two questions:

Does anybody know why the smart people behind WooCommerce made this did change?

Is there a fix without  resorting to changing the core of
WooCommerce?


问:
Extract knowledge from a given dataset
I have two issues:
1- How to extract knowledge for example predicats from a given dataset (i.e public dataset that are used to train neural network s)
2- how to input this knowledge in a neural network (i.e. the neural network receives the knowledge e g. Predicats with the features of the dataset in the input layer)
Any ideas ?
Thank you in advance.

I m trying to extract knowledge (predicats) from a dataset and then training the neural network by the features of the dataset and those extracted predicats.

Title: Extract knowledge from a given dataset


问:
Pivotitems(Cell reference)
I recently started using Macros in my workbooks, and I ran into a problem with my record.
I recorded a macro that performs the following actions:

go to my Summary sheet (called "PIVOT.EXM"), expend the first Cell in the second column on my pivot table.

copy the data from there

paste my copied data to my cus.1 sheet

return to my PIVOT.EXM sheet, close the expansion of my first cell and expend the second cell and then repeat all the actions from above.

My problem is that I want to set pivotitems dynamically, in my code its recognized as value and I want it will be as my cell location.

example for my code (2 first cells):

```<code> Range("A5").Select
    ActiveSheet.PivotTables("PivotTable1").PivotFields("cus_number").PivotItems("1") _
        .ShowDetail = True
    Range("D5:E7").Select
    Selection.Copy
    Sheets("CUS.1").Select
    Range("B3").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("PIVOT.EXM").Select
    Range("A5").Select
    Application.CutCopyMode = False
    ActiveSheet.PivotTables("PivotTable1").PivotFields("cus_number").PivotItems("1") _
        .ShowDetail = False
    Range("A6").Select
    ActiveSheet.PivotTables("PivotTable1").PivotFields("cus_number").PivotItems("2") _
        .ShowDetail = True
    Range("D6:E8").Select
    Selection.Copy
    Sheets("CUS.2").Select
    Range("B3").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("PIVOT.EXM").Select
    Range("A6").Select
    Application.CutCopyMode = False
    ActiveSheet.PivotTables("PivotTable1").PivotFields("cus_number").PivotItems("2") _
        .ShowDetail = False
</code>```

I want that the cell location will be written in pivotitems("") instead of the value 1

Thank you very much!

I tried to write the Cell location inside the brackets with quotation marks and without.

Title: Pivotitems(Cell reference)

Body:
I recently started using Macros in my workbooks, and I ran into a problem with my record.
I recorded a macro that performs the following actions:

go to my Summary sheet (called "PIVOT.EXM"), expend the first Cell in the second column on my pivot table.

copy the data from there

paste my copied data to my cus.1 sheet

return to my PIVOT.EXM sheet, close the expansion of my first cell and expend the second cell and then repeat all the actions from above.

My problem is that I want to set pivotitems dynamically, in my code its recognized as value and I want it will be as my cell location.

example for my code (2 first cells):

 Range("A5").Select
    ActiveSheet.PivotTables("PivotTable1").PivotFields("cus_number").PivotItems("1") _
        .ShowDetail = True
    Range("D5:E7").Select
    Selection.Copy
    Sheets("CUS.1").Select
    Range("B3").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("PIVOT.EXM").Select
    Range("A5").Select
    Application.CutCopyMode = False
    ActiveSheet.PivotTables("PivotTable1").PivotFields("cus_number").PivotItems("1") _
        .ShowDetail = False
    Range("A6").Select
    ActiveSheet.PivotTables("PivotTable1").PivotFields("cus_number").PivotItems("2") _
        .ShowDetail = True
    Range("D6:E8").Select
    Selection.Copy
    Sheets("CUS.2").Select
    Range("B3").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Sheets("PIVOT.EXM").Select
    Range("A6").Select
    Application.CutCopyMode = False
    ActiveSheet.PivotTables("PivotTable1").PivotFields("cus_number").PivotItems("2") _
        .ShowDetail = False

I want that the cell location will be written in pivotitems("") instead of the value 1

Thank you very much!

I tried to write the Cell location inside the brackets with quotation marks and without.


问:
SmartEdit : custom footer layout not editable all time
We created a custom footer layout which contains many slots :

The new footer is editable and working as expected on Staging environement, the contract added for all slots inside footer and we have possibility to edit, remove ... componenets.

On production, the footer is unstable, sometimes the contract is added only to the OOTB slot (FooterSlot), the blue overlay is missing for all other slots (custom Slots)

Note sur but I think the same issue happen for the custom Header.

Same Data (slots, componenets...) exists in boths environement (Staging & Production)

Additional Informations :

Spartacus shematics : 4.3.1

SAP commerce cloud 2005

SSR enabled

Any ideas why the FooterSlot is editable always while custom slots are not ediatble all time ?

Expected behavior :
all slots inside the custom footer are editable all time


问:
RazorEngine unable to find view in WPF application
Problem

When using RazorViewEngine.GetView((executingFilePath: viewPath, viewPath, isMainPage: false) in a WPF application, it can't find the view no matter what path I use.

Setup

WPF

.NET Core 3.1

What I have tried

When I do this in a console application using .NET Core 3.1, it works fine - it finds the view using the path ~/Views/Templates/MyTemplate.cshtml

This doesn't work when using same approach in a WPF application that targets .NET Core 3.1.

The MyTemplate.cshtml file lives inside Views/Templates in the root of the project.

I tried using paths like "~/bin/Debug/netcoreapp3.1/Views /MyTemplate.cshtml" and a bunch of other combinations but still it doesn't work.

I tried using the console application as a library and reference it from the WPF application but when I do that I get the same error, I moved all the code from the console application to the WPF project to avoid any cross project reference issues but still it doesn't work.

I looked here Razor engine cant find view but  no luck.

The main difference is that in the WPF application I register the MvcCore services in App.xaml.cs and in the console app I do it on demand e.g: return provider.GetRequiredService<RazorViewToStringRenderer>(); but this should not be an issue.

Code

```<code>public App()
{
      var serviceCollection = new ServiceCollection();
      ConfigureServices(serviceCollection);
      ServiceProvider = serviceCollection.BuildServiceProvider();
}

private void OnStartup(object sender, StartupEventArgs e)
{
      var mainWindow = ServiceProvider.GetRequiredService<MainWindow>();
      mainWindow.Show();
}

private void ConfigureServices(IServiceCollection services)
{
      var applicationEnvironment = PlatformServices.Default.Application;
      services.AddSingleton(applicationEnvironment);

      var environment = new HostingEnvironment();

      services.AddSingleton<IWebHostEnvironment>(environment);
      var diagnosticSource = new DiagnosticListener("Microsoft.AspNetCore");
      services.AddSingleton<DiagnosticListener>(diagnosticSource);
      services.AddSingleton<DiagnosticSource>(diagnosticSource);

      services.AddLogging();
      services.AddMvcCore();
      services.AddMvcCore().AddRazorPages();
      services.AddMvcCore().AddRazorViewEngine();
      services.AddMvcCore().AddViews();

      services.AddSingleton<RazorViewToStringRenderer>();
      services.AddSingleton<MainWindow>();
}

public class RazorViewToStringRenderer
{
      private IRazorViewEngine _viewEngine;
      private ITempDataProvider _tempDataProvider;
      private IServiceProvider _serviceProvider;

      public RazorViewToStringRenderer(
          IRazorViewEngine viewEngine,
          ITempDataProvider tempDataProvider,
          IServiceProvider serviceProvider)
      {
        _viewEngine = viewEngine;
        _tempDataProvider = tempDataProvider;
        _serviceProvider = serviceProvider;
      }

      public IView FindView(ActionContext actionContext, string viewName)
      {
         var templatePath= "~/Views/Templates/MyTemplate.cshtml"; //I use this variable for testing but is passed in viewName param.
         var getViewResult = _viewEngine.GetView(executingFilePath:templatePath, viewPath:templatePath, isMainPage: false);

         if (getViewResult.Success) //This is always false
         {
           return getViewResult.View;
         }
       .....
       }
}
</code>```

I'm thinking that I'm missing some configuration in WPF that is preventing the razor pages to be found.

Body:
Problem

When using RazorViewEngine.GetView((executingFilePath: viewPath, viewPath, isMainPage: false) in a WPF application, it can't find the view no matter what path I use.

Setup

WPF

.NET Core 3.1

What I have tried

When I do this in a console application using .NET Core 3.1, it works fine - it finds the view using the path ~/Views/Templates/MyTemplate.cshtml

This doesn't work when using same approach in a WPF application that targets .NET Core 3.1.

The MyTemplate.cshtml file lives inside Views/Templates in the root of the project.

I tried using paths like "~/bin/Debug/netcoreapp3.1/Views /MyTemplate.cshtml" and a bunch of other combinations but still it doesn't work.

I tried using the console application as a library and reference it from the WPF application but when I do that I get the same error, I moved all the code from the console application to the WPF project to avoid any cross project reference issues but still it doesn't work.

I looked here Razor engine cant find view but  no luck.

The main difference is that in the WPF application I register the MvcCore services in App.xaml.cs and in the console app I do it on demand e.g: return provider.GetRequiredService<RazorViewToStringRenderer>(); but this should not be an issue.

Code

public App()
{
      var serviceCollection = new ServiceCollection();
      ConfigureServices(serviceCollection);
      ServiceProvider = serviceCollection.BuildServiceProvider();
}

private void OnStartup(object sender, StartupEventArgs e)
{
      var mainWindow = ServiceProvider.GetRequiredService<MainWindow>();
      mainWindow.Show();
}

private void ConfigureServices(IServiceCollection services)
{
      var applicationEnvironment = PlatformServices.Default.Application;
      services.AddSingleton(applicationEnvironment);

      var environment = new HostingEnvironment();

      services.AddSingleton<IWebHostEnvironment>(environment);
      var diagnosticSource = new DiagnosticListener("Microsoft.AspNetCore");
      services.AddSingleton<DiagnosticListener>(diagnosticSource);
      services.AddSingleton<DiagnosticSource>(diagnosticSource);

      services.AddLogging();
      services.AddMvcCore();
      services.AddMvcCore().AddRazorPages();
      services.AddMvcCore().AddRazorViewEngine();
      services.AddMvcCore().AddViews();

      services.AddSingleton<RazorViewToStringRenderer>();
      services.AddSingleton<MainWindow>();
}

public class RazorViewToStringRenderer
{
      private IRazorViewEngine _viewEngine;
      private ITempDataProvider _tempDataProvider;
      private IServiceProvider _serviceProvider;

      public RazorViewToStringRenderer(
          IRazorViewEngine viewEngine,
          ITempDataProvider tempDataProvider,
          IServiceProvider serviceProvider)
      {
        _viewEngine = viewEngine;
        _tempDataProvider = tempDataProvider;
        _serviceProvider = serviceProvider;
      }

      public IView FindView(ActionContext actionContext, string viewName)
      {
         var templatePath= "~/Views/Templates/MyTemplate.cshtml"; //I use this variable for testing but is passed in viewName param.
         var getViewResult = _viewEngine.GetView(executingFilePath:templatePath, viewPath:templatePath, isMainPage: false);

         if (getViewResult.Success) //This is always false
         {
           return getViewResult.View;
         }
       .....
       }
}

I'm thinking that I'm missing some configuration in WPF that is preventing the razor pages to be found.


问:
separating Planar surface
I need to remove building points from my lidar data. I managed to remove some plane surface using the eigen values of the covariance matrix but this does not completly remove the building point. There are still some line or the edge line of the building point left. How can i remove them?

Title: separating Planar surface


问:
How to add additional JQuery & JS Script to Inertia root (app.blade.php) file
I'm working on a project where I need to convert an HTML (Bootstrap) template into a fully functional application. Inertia JS (Vue and Laravel) is the technology I'm working on. The thing is, there are some additional jQuery and JavaScript files (that were added through the script tag before the body tag closed) that were added to the HTML template.

Now I need to include those files in my application. Here is how I'm trying to achieve it (In my app.blade.php) file:

```<code>  @vite('resources/view/vendor/jquery/jquery.min.js')
  @vite('resources/view/vendor/bootstrap/js/bootstrap.bundle.min.js')
  @vite('resources/view/vendor/jquery/jquery.min.js')
  @vite('resources/view/vendor/magnific-popup/magnific-popup.js')
  @vite('resources/js/vendor/js/plugins/magnific-popup-init.js')
  @vite('resources/js/vendor/js/js/scripts.js')
</code>```

Here is the folder structure of my application:

In the console, I'm getting the following error:

Any lead on this would be highly appreciated.

Body:
I'm working on a project where I need to convert an HTML (Bootstrap) template into a fully functional application. Inertia JS (Vue and Laravel) is the technology I'm working on. The thing is, there are some additional jQuery and JavaScript files (that were added through the script tag before the body tag closed) that were added to the HTML template.

Now I need to include those files in my application. Here is how I'm trying to achieve it (In my app.blade.php) file:

  @vite('resources/view/vendor/jquery/jquery.min.js')
  @vite('resources/view/vendor/bootstrap/js/bootstrap.bundle.min.js')
  @vite('resources/view/vendor/jquery/jquery.min.js')
  @vite('resources/view/vendor/magnific-popup/magnific-popup.js')
  @vite('resources/js/vendor/js/plugins/magnific-popup-init.js')
  @vite('resources/js/vendor/js/js/scripts.js')

Here is the folder structure of my application:

In the console, I'm getting the following error:

Any lead on this would be highly appreciated.


问:
bottom container needs to come above keyboard when we click on any input field in react js
Here is my bottom container now I want that whenever the user clicks on an input field this container goes above the keyboard. I have the user scrollIntoView to do this but it shifted the entire page upwards. I want that only the container goes above the keyboard.  I want to do this on website.</p>
```<code>import React, {useRef} from 'react'

    function App() {
      const ref = useRef(false);
      return (
        <div style = {{position: 'fixed', left: '0px', bottom:'0px', backgroundColor: 'red', overflow:'auto', height:'50%'}} >
            <div>
           <div> Enter your name</div>
            <input
            type ='text'
            onChange ={()=>
              ref?.current?.scrollIntoView()

            }
            />
            <div style ={{position: 'fixed', left: '0px', bottom:'0px' , backgroundColor: 'green', height:'5%'}} ref={ref} >
              our Bottom container
              </div>

              </div>
        </div>
      );
    }

    export default App;
</code>```

Body:
Here is my bottom container now I want that whenever the user clicks on an input field this container goes above the keyboard. I have the user scrollIntoView to do this but it shifted the entire page upwards. I want that only the container goes above the keyboard.  I want to do this on website.

import React, {useRef} from 'react'

    function App() {
      const ref = useRef(false);
      return (

 Enter your name

            <input
            type ='text'
            onChange ={()=>
              ref?.current?.scrollIntoView()

            }
            />

              our Bottom container

      );
    }

    export default App;