问:
Functions which invoke @Composable functions must be marked with the @Composable annotation in WebView
I have a custom Compose Function for WebView, in Which I want to show the Custom progress bar while loading the page but it gives this error.

```<code>Functions which invoke @Composable functions must be marked with the @Composable annotation
</code>```

This is my Composable.

```<code>package com.example.devdocs

import android.graphics.Bitmap
import android.view.ViewGroup
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.viewinterop.AndroidView

@Composable
fun webView(
    url: String = "www.google.com"
) {
    var backEnabled by remember { mutableStateOf(false) }
    var webView: WebView? = null
    AndroidView(
        factory = { context ->
            WebView(context).apply {
                settings.javaScriptEnabled = true
                settings.userAgentString
                settings.domStorageEnabled
                settings.setSupportZoom(true)
                settings.builtInZoomControls = true
                settings.displayZoomControls = false
                layoutParams = ViewGroup.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.MATCH_PARENT
                )
                webViewClient = object : WebViewClient() {
                    override fun onPageStarted(view: WebView, url: String?, favicon: Bitmap?) {
                        backEnabled = view.canGoBack()
                        LoadingAnimation(
                            modifier = Modifier
                                .fillMaxWidth(),
                            isVisible = true
                        )
                    }

                    override fun onPageFinished(view: WebView?, url: String?) {
                        super.onPageFinished(view, url)
                        LoadingAnimation(
                            modifier = Modifier
                                .fillMaxWidth(),
                            isVisible = false
                        )
                    }
                }
                webChromeClient = WebChromeClient()
                loadUrl(url)
                webView = this
            }

        }, update = {
            webView = it
        })
    BackHandler(enabled = backEnabled) {
        webView?.goBack()
    }
}

</code>```

"LoadingAnimation" is a custom animation class that shows the animation.
Here is Animation Class Source Code.

```<code>package com.example.devdocs

import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.delay

@Composable
fun LoadingAnimation(
    modifier: Modifier = Modifier,
    circleSize: Dp = 25.dp,
    circleColor: Color = MaterialTheme.colorScheme.primary,
    spaceBetween: Dp = 10.dp,
    travelDistance: Dp = 20.dp,
    isVisible: Boolean = true
) {
    if (isVisible) {
        val circles = listOf(
            remember { Animatable(initialValue = 0f) },
            remember { Animatable(initialValue = 0f) },
            remember { Animatable(initialValue = 0f) }
        )

        circles.forEachIndexed { index, animatable ->
            LaunchedEffect(key1 = animatable) {
                delay(index * 100L)
                animatable.animateTo(
                    targetValue = 1f,
                    animationSpec = infiniteRepeatable(
                        animation = keyframes {
                            durationMillis = 1200
                            0.0f at 0 with LinearOutSlowInEasing
                            1.0f at 300 with LinearOutSlowInEasing
                            0.0f at 600 with LinearOutSlowInEasing
                            0.0f at 1200 with LinearOutSlowInEasing
                        },
                        repeatMode = RepeatMode.Restart
                    )
                )
            }
        }

        val circleValues = circles.map { it.value }
        val distance = with(LocalDensity.current) { travelDistance.toPx() }

        Row(
            modifier = modifier,
            horizontalArrangement = Arrangement.spacedBy(spaceBetween)
        ) {
            circleValues.forEach { value ->
                Box(
                    modifier = Modifier
                        .size(circleSize)
                        .graphicsLayer {
                            translationY = -value * distance
                        }
                        .background(
                            color = circleColor,
                            shape = CircleShape
                        )
                )
            }
        }
    }
}
</code>```

How can I solve this? Thanks.

Body:
I have a custom Compose Function for WebView, in Which I want to show the Custom progress bar while loading the page but it gives this error.

Functions which invoke @Composable functions must be marked with the @Composable annotation

This is my Composable.

package com.example.devdocs

import android.graphics.Bitmap
import android.view.ViewGroup
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.viewinterop.AndroidView

@Composable
fun webView(
    url: String = "www.google.com"
) {
    var backEnabled by remember { mutableStateOf(false) }
    var webView: WebView? = null
    AndroidView(
        factory = { context ->
            WebView(context).apply {
                settings.javaScriptEnabled = true
                settings.userAgentString
                settings.domStorageEnabled
                settings.setSupportZoom(true)
                settings.builtInZoomControls = true
                settings.displayZoomControls = false
                layoutParams = ViewGroup.LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.MATCH_PARENT
                )
                webViewClient = object : WebViewClient() {
                    override fun onPageStarted(view: WebView, url: String?, favicon: Bitmap?) {
                        backEnabled = view.canGoBack()
                        LoadingAnimation(
                            modifier = Modifier
                                .fillMaxWidth(),
                            isVisible = true
                        )
                    }

                    override fun onPageFinished(view: WebView?, url: String?) {
                        super.onPageFinished(view, url)
                        LoadingAnimation(
                            modifier = Modifier
                                .fillMaxWidth(),
                            isVisible = false
                        )
                    }
                }
                webChromeClient = WebChromeClient()
                loadUrl(url)
                webView = this
            }

        }, update = {
            webView = it
        })
    BackHandler(enabled = backEnabled) {
        webView?.goBack()
    }
}

"LoadingAnimation" is a custom animation class that shows the animation.
Here is Animation Class Source Code.

package com.example.devdocs

import androidx.compose.animation.core.*
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.delay

@Composable
fun LoadingAnimation(
    modifier: Modifier = Modifier,
    circleSize: Dp = 25.dp,
    circleColor: Color = MaterialTheme.colorScheme.primary,
    spaceBetween: Dp = 10.dp,
    travelDistance: Dp = 20.dp,
    isVisible: Boolean = true
) {
    if (isVisible) {
        val circles = listOf(
            remember { Animatable(initialValue = 0f) },
            remember { Animatable(initialValue = 0f) },
            remember { Animatable(initialValue = 0f) }
        )

        circles.forEachIndexed { index, animatable ->
            LaunchedEffect(key1 = animatable) {
                delay(index * 100L)
                animatable.animateTo(
                    targetValue = 1f,
                    animationSpec = infiniteRepeatable(
                        animation = keyframes {
                            durationMillis = 1200
                            0.0f at 0 with LinearOutSlowInEasing
                            1.0f at 300 with LinearOutSlowInEasing
                            0.0f at 600 with LinearOutSlowInEasing
                            0.0f at 1200 with LinearOutSlowInEasing
                        },
                        repeatMode = RepeatMode.Restart
                    )
                )
            }
        }

        val circleValues = circles.map { it.value }
        val distance = with(LocalDensity.current) { travelDistance.toPx() }

        Row(
            modifier = modifier,
            horizontalArrangement = Arrangement.spacedBy(spaceBetween)
        ) {
            circleValues.forEach { value ->
                Box(
                    modifier = Modifier
                        .size(circleSize)
                        .graphicsLayer {
                            translationY = -value * distance
                        }
                        .background(
                            color = circleColor,
                            shape = CircleShape
                        )
                )
            }
        }
    }
}

How can I solve this? Thanks.


来源: stackexchange

问:
not able to view the JSON format of the data after submitting the form
i am working on angular project where i have to fill the username and password
after submitting the code i have routed to swagger URL but i am not able to get the JSON format data

my form

```<code><!-- HTML code for the login form -->
<form  #form="ngForm" id="login-form" (ngSubmit)="addUsers()">
  <label for="username">Username:</label><br>
  <input type="text" id="username" name="username" [(ngModel)]="addUser.userName"><br>
  <label for="password">Password:</label><br>
  <input type="password" id="password" name="password" [(ngModel)]="addUser.userPassword"><br><br>
  <input type="submit" value="Submit">
</form>

</code>```

my typescript

```<code>addUsers(){
  this.userService.addUser(this.addUser)
.subscribe({
  next:()=>
  this.router.navigateByUrl("https://localhost:7068/Users")
})
</code>```

even i added service too check this out
My service

```<code>addUser(adduser:User):Observable<User>{
  adduser.userName
  adduser.userPassword
  return this.http.post<User>(this.baseApiUrl+"/Users",adduser)
}
</code>```

i even tried to route using new component too but i failed please help me out

THANKS IN ADVANCE

ContentLicense: CC BY-SA 4.0

Body:
i am working on angular project where i have to fill the username and password
after submitting the code i have routed to swagger URL but i am not able to get the JSON format data

my form

<form  #form="ngForm" id="login-form" (ngSubmit)="addUsers()">
  Username:

  <input type="text" id="username" name="username" [(ngModel)]="addUser.userName">

  Password:

  <input type="password" id="password" name="password" [(ngModel)]="addUser.userPassword">

  <input type="submit" value="Submit">
</form>

my typescript

addUsers(){
  this.userService.addUser(this.addUser)
.subscribe({
  next:()=>
  this.router.navigateByUrl("https://localhost:7068/Users")
})

even i added service too check this out
My service

addUser(adduser:User):Observable<User>{
  adduser.userName
  adduser.userPassword
  return this.http.post<User>(this.baseApiUrl+"/Users",adduser)
}

i even tried to route using new component too but i failed please help me out

THANKS IN ADVANCE


问:
XSLT Counter increment
My current input has multiple report id field values

```<code><?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_sender xmlns:ns0="http://sortbykey_xslt.com">
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
    </Root>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
    </Root>
    <Root>
        <ReportID>2</ReportID>
        <ReportName>test2</ReportName>
        <Amount>92</Amount>
        <Referance>bing</Referance>
    </Root>
        <Root>
        <ReportID>1</ReportID>
        <ReportName>test4</ReportName>
        <Amount>199</Amount>
        <Referance>wikipedia</Referance>
    </Root>
        <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
    </Root>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
    </Root>
</ns0:MT_sender>
</code>```

XSLT Code

Current XSLT code unable to notice any change in report id value

```<code><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
        <ns0:MT_sender xmlns:ns0="http://sortbykey_xslt.com">
            <xsl:apply-templates select="//Root">
                <xsl:sort select="ReportID"/>
            </xsl:apply-templates>
        </ns0:MT_sender>
    </xsl:template>
    <xsl:template match="Root">
     <Counter><xsl:value-of select="position()"/></Counter>
        <xsl:copy-of select="."/>
    </xsl:template>
</xsl:stylesheet>
</code>```

Output

Here counter field value is populating outside Root node which needs to be inside root node

```<code><?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_sender xmlns:ns0="http://sortbykey_xslt.com">
    <Counter>1</Counter>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
    </Root>
    <Counter>2</Counter>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test4</ReportName>
        <Amount>199</Amount>
        <Referance>wikipedia</Referance>
    </Root>
    <Counter>3</Counter>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
    </Root>
    <Counter>4</Counter>
    <Root>
        <ReportID>2</ReportID>
        <ReportName>test2</ReportName>
        <Amount>92</Amount>
        <Referance>bing</Referance>
    </Root>
    <Counter>5</Counter>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
    </Root>
    <Counter>6</Counter>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
    </Root>
</ns0:MT_sender>
</code>```

Expected Output

Expected output needs to recognise change in report id value and reset counter to 1 whenever there is a change in report id value and counter should be inside root node context as expected output xml below:

```<code><?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_sender xmlns:ns0="http://sortbykey_xslt.com">
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
        <Counter>1</Counter>
    </Root>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test4</ReportName>
        <Amount>199</Amount>
        <Referance>wikipedia</Referance>
            <Counter>2</Counter>
    </Root>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
            <Counter>3</Counter>
    </Root>
    <Root>
        <ReportID>2</ReportID>
        <ReportName>test2</ReportName>
        <Amount>92</Amount>
        <Referance>bing</Referance>
        <Counter>1</Counter>
    </Root>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
        <Counter>1</Counter>
    </Root>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
        <Counter>2</Counter>
    </Root>
</ns0:MT_sender>
</code>```

Counter needs to reset to 1 after every change in report ID field value.

Title: XSLT Counter increment

Body:
My current input has multiple report id field values

<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_sender xmlns:ns0="http://sortbykey_xslt.com">
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
    </Root>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
    </Root>
    <Root>
        <ReportID>2</ReportID>
        <ReportName>test2</ReportName>
        <Amount>92</Amount>
        <Referance>bing</Referance>
    </Root>
        <Root>
        <ReportID>1</ReportID>
        <ReportName>test4</ReportName>
        <Amount>199</Amount>
        <Referance>wikipedia</Referance>
    </Root>
        <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
    </Root>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
    </Root>
</ns0:MT_sender>

XSLT Code

Current XSLT code unable to notice any change in report id value

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
        <ns0:MT_sender xmlns:ns0="http://sortbykey_xslt.com">
            <xsl:apply-templates select="//Root">
                <xsl:sort select="ReportID"/>
            </xsl:apply-templates>
        </ns0:MT_sender>
    </xsl:template>
    <xsl:template match="Root">
     <Counter><xsl:value-of select="position()"/></Counter>
        <xsl:copy-of select="."/>
    </xsl:template>
</xsl:stylesheet>

Output

Here counter field value is populating outside Root node which needs to be inside root node

<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_sender xmlns:ns0="http://sortbykey_xslt.com">
    <Counter>1</Counter>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
    </Root>
    <Counter>2</Counter>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test4</ReportName>
        <Amount>199</Amount>
        <Referance>wikipedia</Referance>
    </Root>
    <Counter>3</Counter>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
    </Root>
    <Counter>4</Counter>
    <Root>
        <ReportID>2</ReportID>
        <ReportName>test2</ReportName>
        <Amount>92</Amount>
        <Referance>bing</Referance>
    </Root>
    <Counter>5</Counter>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
    </Root>
    <Counter>6</Counter>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
    </Root>
</ns0:MT_sender>

Expected Output

Expected output needs to recognise change in report id value and reset counter to 1 whenever there is a change in report id value and counter should be inside root node context as expected output xml below:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_sender xmlns:ns0="http://sortbykey_xslt.com">
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
        <Counter>1</Counter>
    </Root>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test4</ReportName>
        <Amount>199</Amount>
        <Referance>wikipedia</Referance>
            <Counter>2</Counter>
    </Root>
    <Root>
        <ReportID>1</ReportID>
        <ReportName>test1</ReportName>
        <Amount>99</Amount>
        <Referance>google</Referance>
            <Counter>3</Counter>
    </Root>
    <Root>
        <ReportID>2</ReportID>
        <ReportName>test2</ReportName>
        <Amount>92</Amount>
        <Referance>bing</Referance>
        <Counter>1</Counter>
    </Root>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
        <Counter>1</Counter>
    </Root>
    <Root>
        <ReportID>3</ReportID>
        <ReportName>test3</ReportName>
        <Amount>90</Amount>
        <Referance>yahoo</Referance>
        <Counter>2</Counter>
    </Root>
</ns0:MT_sender>

Counter needs to reset to 1 after every change in report ID field value.


问:
How to populate List<> from selected row in a Datagrid
I can add individual values from the detected row to a LIST<> one at a time as follows

var currentRowIndex = myGrid.Items.IndexOf(myGrid.CurrentItem);
int inNum = currentRowIndex;
TextBlock x0 = myGrid.Columns[0].GetCellContent(myGrid.Items[inNum]) as TextBlock;
Global.vpItems.Add(x0.Text);

Since I have about 150 values, this is not efficient at all. Is there a way to directly populate the List (aka vpItems)
Any help is greatly appreciated


问:
How to set DefaultUserName and DefaultPassword in registry using a batch script and run it before user logs in?
I want to set DefaultUserName and DefaultPassword in registry using a batch script and run it before user logs in.

Already tried using task scheduler it modifies the registry but still unable to auto-login.


问:
How to use multi select and setState in flutter?
I want to take multiple values from a dropdown field so i use multi select but i also use setState throughout the app. The thing is that values selected on seState get lost and thats a problem because i cant put more filters on my filtering in the list. I also tried Notifier but not much changed, actually nothing. it also needed setState.

I already tried Notifier so that i dont need to use setState but either i didnt use it properly or it doesnt fit my code , i cant find something else to use instead of multi select and cant seem to use multiselect without setState


问:
Keycloak upgrade from 11.0.2 to 16.1.0
What is the mariadb supported version for keyclaok16.1.0.?

I have mariadb10.6.5 and keycloak11.0.2. I want to upgrade keycloak from 11.0.2 to any higher version. keycloak 16.10 is working fine with mariadb10.6.5 but when I restore my maridb backup, keycloak is faling.

```<code>keycloak | 06:56:13,814 DEBUG [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-5) could not clear warnings: java.sql.SQLException: IJ031070: Transaction cannot proceed: STATUS_ROLLEDBACK keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:272) keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransactionActive(WrappedConnection.java:2005) keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:2020) keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:1994) keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.clearWarnings(WrappedConnection.java:1153) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.handleAndClearWarnings(SqlExceptionHelper.java:299) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logAndClearWarnings(SqlExceptionHelper.java:269) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.releaseConnection(LogicalConnectionManagedImpl.java:194) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.afterTransaction(LogicalConnectionManagedImpl.java:162) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.afterTransaction(JdbcCoordinatorImpl.java:274) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.afterTransactionCompletion(JdbcCoordinatorImpl.java:452) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.afterCompletion(JtaTransactionCoordinatorImpl.java:381) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorNonTrackingImpl.doAfterCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:60) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorTrackingImpl.afterCompletion(SynchronizationCallbackCoordinatorTrackingImpl.java:72) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization.afterCompletion(RegisteredSynchronization.java:44) keycloak | at org.wildfly.transaction.client@2.0.0.Final//org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:223) keycloak | at org.wildfly.transaction.client@2.0.0.Final//org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization.afterCompletion(AbstractTransaction.java:306) keycloak | at org.jboss.jts//com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:96) keycloak | at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:545) keycloak | at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:472) keycloak | at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:127) keycloak | at org.jboss.jts//com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:186) keycloak | at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1377) keycloak | at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:145) keycloak | at org.jboss.jts.integration//com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:139) keycloak | at org.wildfly.transaction.client@2.0.0.Final//org.wildfly.transaction.client.LocalTransaction.rollbackAndDissociate(LocalTransaction.java:118) keycloak | at org.wildfly.transaction.client@2.0.0.Final//org.wildfly.transaction.client.ContextTransactionManager.rollback(ContextTransactionManager.java:83) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.transaction.JtaTransactionWrapper.rollback(JtaTransactionWrapper.java:102) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.services.DefaultKeycloakTransactionManager.rollback(DefaultKeycloakTransactionManager.java:182) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.services.DefaultKeycloakTransactionManager.rollback(DefaultKeycloakTransactionManager.java:176) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.services.filters.AbstractRequestFilter.close(AbstractRequestFilter.java:62) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.services.filters.AbstractRequestFilter.filter(AbstractRequestFilter.java:49) keycloak | at org.keycloak.keycloak-wildfly-extensions@16.1.0//org.keycloak.provider.wildfly.WildFlyRequestFilter.doFilter(WildFlyRequestFilter.java:39) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) keycloak | at org.wildfly.security.elytron-web.undertow-server@1.10.1.Final//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.lambda$handleRequest$1(ElytronRunAsHandler.java:68) keycloak | at org.wildfly.security.elytron-base@1.18.1.Final//org.wildfly.security.auth.server.FlexibleIdentityAssociation.runAsFunctionEx(FlexibleIdentityAssociation.java:103) keycloak | at org.wildfly.security.elytron-base@1.18.1.Final//org.wildfly.security.auth.server.Scoped.runAsFunctionEx(Scoped.java:161) keycloak | at org.wildfly.security.elytron-base@1.18.1.Final//org.wildfly.security.auth.server.Scoped.runAs(Scoped.java:73) keycloak | at org.wildfly.security.elytron-web.undertow-server@1.10.1.Final//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.handleRequest(ElytronRunAsHandler.java:67) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) keycloak | at org.wildfly.security.elytron-web.undertow-server-servlet@1.10.1.Final//org.wildfly.elytron.web.undertow.server.servlet.CleanUpHandler.handleRequest(CleanUpHandler.java:38) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852) keycloak | at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) keycloak | at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990) keycloak | at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) keycloak | at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) keycloak | at org.jboss.xnio@3.8.5.Final//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1280) keycloak | at java.base/java.lang.Thread.run(Thread.java:829) keycloak | keycloak | 06:56:13,814 DEBUG [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (default task-5) java.sql.Connection#endRequest has been invoked keycloak | 06:56:13,814 DEBUG [org.jbo
</code>```

I'm using mariadb with keycloak. I want to restore maridb bcakup.

Title: Keycloak upgrade from 11.0.2 to 16.1.0

Body:
What is the mariadb supported version for keyclaok16.1.0.?

I have mariadb10.6.5 and keycloak11.0.2. I want to upgrade keycloak from 11.0.2 to any higher version. keycloak 16.10 is working fine with mariadb10.6.5 but when I restore my maridb backup, keycloak is faling.

keycloak | 06:56:13,814 DEBUG [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-5) could not clear warnings: java.sql.SQLException: IJ031070: Transaction cannot proceed: STATUS_ROLLEDBACK keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:272) keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransactionActive(WrappedConnection.java:2005) keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:2020) keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:1994) keycloak | at org.jboss.ironjacamar.jdbcadapters@1.5.3.Final//org.jboss.jca.adapters.jdbc.WrappedConnection.clearWarnings(WrappedConnection.java:1153) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.handleAndClearWarnings(SqlExceptionHelper.java:299) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logAndClearWarnings(SqlExceptionHelper.java:269) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.releaseConnection(LogicalConnectionManagedImpl.java:194) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.afterTransaction(LogicalConnectionManagedImpl.java:162) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.afterTransaction(JdbcCoordinatorImpl.java:274) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.afterTransactionCompletion(JdbcCoordinatorImpl.java:452) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl.afterCompletion(JtaTransactionCoordinatorImpl.java:381) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorNonTrackingImpl.doAfterCompletion(SynchronizationCallbackCoordinatorNonTrackingImpl.java:60) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.transaction.backend.jta.internal.synchronization.SynchronizationCallbackCoordinatorTrackingImpl.afterCompletion(SynchronizationCallbackCoordinatorTrackingImpl.java:72) keycloak | at org.hibernate@5.3.24.Final//org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization.afterCompletion(RegisteredSynchronization.java:44) keycloak | at org.wildfly.transaction.client@2.0.0.Final//org.wildfly.transaction.client.AbstractTransaction.performConsumer(AbstractTransaction.java:223) keycloak | at org.wildfly.transaction.client@2.0.0.Final//org.wildfly.transaction.client.AbstractTransaction$AssociatingSynchronization.afterCompletion(AbstractTransaction.java:306) keycloak | at org.jboss.jts//com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:96) keycloak | at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:545) keycloak | at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:472) keycloak | at org.jboss.jts//com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:127) keycloak | at org.jboss.jts//com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:186) keycloak | at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1377) keycloak | at org.jboss.jts//com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:145) keycloak | at org.jboss.jts.integration//com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:139) keycloak | at org.wildfly.transaction.client@2.0.0.Final//org.wildfly.transaction.client.LocalTransaction.rollbackAndDissociate(LocalTransaction.java:118) keycloak | at org.wildfly.transaction.client@2.0.0.Final//org.wildfly.transaction.client.ContextTransactionManager.rollback(ContextTransactionManager.java:83) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.transaction.JtaTransactionWrapper.rollback(JtaTransactionWrapper.java:102) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.services.DefaultKeycloakTransactionManager.rollback(DefaultKeycloakTransactionManager.java:182) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.services.DefaultKeycloakTransactionManager.rollback(DefaultKeycloakTransactionManager.java:176) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.services.filters.AbstractRequestFilter.close(AbstractRequestFilter.java:62) keycloak | at org.keycloak.keycloak-services@16.1.0//org.keycloak.services.filters.AbstractRequestFilter.filter(AbstractRequestFilter.java:49) keycloak | at org.keycloak.keycloak-wildfly-extensions@16.1.0//org.keycloak.provider.wildfly.WildFlyRequestFilter.doFilter(WildFlyRequestFilter.java:39) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) keycloak | at org.wildfly.security.elytron-web.undertow-server@1.10.1.Final//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.lambda$handleRequest$1(ElytronRunAsHandler.java:68) keycloak | at org.wildfly.security.elytron-base@1.18.1.Final//org.wildfly.security.auth.server.FlexibleIdentityAssociation.runAsFunctionEx(FlexibleIdentityAssociation.java:103) keycloak | at org.wildfly.security.elytron-base@1.18.1.Final//org.wildfly.security.auth.server.Scoped.runAsFunctionEx(Scoped.java:161) keycloak | at org.wildfly.security.elytron-base@1.18.1.Final//org.wildfly.security.auth.server.Scoped.runAs(Scoped.java:73) keycloak | at org.wildfly.security.elytron-web.undertow-server@1.10.1.Final//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.handleRequest(ElytronRunAsHandler.java:67) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) keycloak | at org.wildfly.security.elytron-web.undertow-server-servlet@1.10.1.Final//org.wildfly.elytron.web.undertow.server.servlet.CleanUpHandler.handleRequest(CleanUpHandler.java:38) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544) keycloak | at org.wildfly.extension.undertow@26.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1544) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79) keycloak | at io.undertow.servlet@2.2.14.Final//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) keycloak | at io.undertow.core@2.2.14.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852) keycloak | at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) keycloak | at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990) keycloak | at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) keycloak | at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) keycloak | at org.jboss.xnio@3.8.5.Final//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1280) keycloak | at java.base/java.lang.Thread.run(Thread.java:829) keycloak | keycloak | 06:56:13,814 DEBUG [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (default task-5) java.sql.Connection#endRequest has been invoked keycloak | 06:56:13,814 DEBUG [org.jbo

I'm using mariadb with keycloak. I want to restore maridb bcakup.


问:
How can I group by a date(timestamp_field ) in QueryDSL 5.0.0
How can I write a queryDSL query for the following MySQL query:

```<code>SELECT
    u.id as user_id,
    count(*) as total_completed
    date(o.created_at) date
FROM
    users u
LEFT JOIN orders o ON o.user_id = u.id
WHERE o.status='COMPLETED'
GROUP BY date(o.created), u.id
</code>```

I am mainly interested in implementing the date(timestamp_field) so that I can use it for aggregating over entire dates.

This is my OrderEntity:

```<code>...
@Table(name = "orders")
public class OrderEntity extends BaseEntity {

    @Id
    @Column(nullable = false)
    private String id;
    private Instant createdAt;
    ...
}
</code>```

This is in QOrderEntity

```<code>    public final DateTimePath<java.time.Instant> createdAt = createDateTime("createdAt", java.time.Instant.class);
</code>```

Basically, how can I truncate/type cast the SQL Timestamp field to DATE in the SELECT query. It needs to be done on the WHERE clause, GROUP BY clause, and SELECT clause

I tried this link here: QueryDSL - select rows with date from timestamp column

You can either use between or a custom expression if you use Querydsl SQL
Something like this

DateExpression<Date> converted = DateTemplate.create(Date.class, "convert(date, {0})",

The API doesn't have create() method, maybe it was removed.

Body:
How can I write a queryDSL query for the following MySQL query:

SELECT
    u.id as user_id,
    count(*) as total_completed
    date(o.created_at) date
FROM
    users u
LEFT JOIN orders o ON o.user_id = u.id
WHERE o.status='COMPLETED'
GROUP BY date(o.created), u.id

I am mainly interested in implementing the date(timestamp_field) so that I can use it for aggregating over entire dates.

This is my OrderEntity:

...
@Table(name = "orders")
public class OrderEntity extends BaseEntity {

    @Id
    @Column(nullable = false)
    private String id;
    private Instant createdAt;
    ...
}

This is in QOrderEntity

    public final DateTimePath<java.time.Instant> createdAt = createDateTime("createdAt", java.time.Instant.class);

Basically, how can I truncate/type cast the SQL Timestamp field to DATE in the SELECT query. It needs to be done on the WHERE clause, GROUP BY clause, and SELECT clause

I tried this link here: QueryDSL - select rows with date from timestamp column

You can either use between or a custom expression if you use Querydsl SQL
Something like this

DateExpression<Date> converted = DateTemplate.create(Date.class, "convert(date, {0})",

The API doesn't have create() method, maybe it was removed.


问:
Method inside a class printed without prompt
So I am following a tutorial and have the following code:

```<code>import random

class Coin:
    def __init__(self, rare = False, clean = True, heads = True, **kwargs):

        for key, value in kwargs.items():
            setattr(self,key,value)

        self.heads = heads
        self.is_rare = rare
        self.is_clean = clean

        if self.is_rare:
            self.value = self.original_value * 1.25
        else:
            self.value = self.original_value

        if self.is_clean:
            self.colour = self.clean_colour
        else:
            self.colour = self = self.rusty_colour

    def rust(self):
        self.colour = self.rusty_colour

    def clean(self):
        self.colour = "self.clean_colour"

    def __del__(self):
        print("Coin Spent!")

    def flip(self):
        heads_options = [True, False]
        choice = random.choice(heads_options)
        self.heads = choice

class Pound(Coin):
    def __init__(self):
        data = {
            "original_value": 1.00,
            "clean_colour": "gold",
            "rusty_colour":"greenish",
            "num_edges": 1,
            "diameter": 22.5,
            "thickness": 3.15,
            "mass": 9.5
        }
        super().__init__(**data)

one_pound_coin = Pound()
print(one_pound_coin.colour)
one_pound_coin.rust()
print(one_pound_coin.colour)
</code>```

Upon running that code in PyCharm, it shows the following output:

```<code>gold
greenish
Coin Spent!
</code>```

The 'gold' and 'greenish' are direct results of the last 4 lines of code, that's all as intended. I am puzzled as to why it states 'Coin Spent!' however, as I am not using the 'del' method (I believe) it should only print('Coin Spent!) when I am using del one_pound_coin for example. Now even if all I use for a driver code is simply 'one_pound_coin = Pound()' it prints 'Coin Spent!'.

Getting started with Python and coding in general. Thanks for the help in advance! I am specifically interested in understanding why the code is running the way it is.

Body:
So I am following a tutorial and have the following code:

import random

class Coin:
    def __init__(self, rare = False, clean = True, heads = True, **kwargs):

        for key, value in kwargs.items():
            setattr(self,key,value)

        self.heads = heads
        self.is_rare = rare
        self.is_clean = clean

        if self.is_rare:
            self.value = self.original_value * 1.25
        else:
            self.value = self.original_value

        if self.is_clean:
            self.colour = self.clean_colour
        else:
            self.colour = self = self.rusty_colour

    def rust(self):
        self.colour = self.rusty_colour

    def clean(self):
        self.colour = "self.clean_colour"

    def __del__(self):
        print("Coin Spent!")

    def flip(self):
        heads_options = [True, False]
        choice = random.choice(heads_options)
        self.heads = choice

class Pound(Coin):
    def __init__(self):
        data = {
            "original_value": 1.00,
            "clean_colour": "gold",
            "rusty_colour":"greenish",
            "num_edges": 1,
            "diameter": 22.5,
            "thickness": 3.15,
            "mass": 9.5
        }
        super().__init__(**data)

one_pound_coin = Pound()
print(one_pound_coin.colour)
one_pound_coin.rust()
print(one_pound_coin.colour)

Upon running that code in PyCharm, it shows the following output:

gold
greenish
Coin Spent!

The 'gold' and 'greenish' are direct results of the last 4 lines of code, that's all as intended. I am puzzled as to why it states 'Coin Spent!' however, as I am not using the 'del' method (I believe) it should only print('Coin Spent!) when I am using del one_pound_coin for example. Now even if all I use for a driver code is simply 'one_pound_coin = Pound()' it prints 'Coin Spent!'.

Getting started with Python and coding in general. Thanks for the help in advance! I am specifically interested in understanding why the code is running the way it is.


问:
SwiftUI app - Login persistence code changes - navigation link not working after userDefault code change
In our current swiftUI app, if user closes the app they will be asked to login again - we are trying to change this behaviour by using userDefaults.
Without userDefaults code changes below LoginView directs to the home screen after login/registration using the Navigation link.

Issue:
We made below code changes to the View and LoginViewModel and when login / register button is pressed the LoginView is not taking to the home screen. It just shows the login/signup page with the login successful or registration successful message.

I have debugged in Xcode and loginOrSignUpSuccessful variable value is set to true after login button press.

Why is navigationlink not directing to MainLandingTabView Screen after login or registration?

Code Changes made to the LoginViewModel
Variable  & View Code Snippet

@Published var loginOrSignUpSuccessful = UserDefaults.standard.bool(forKey: "loginOrSignUpSuccessful")

{     didSet{ UserDefaults.standard.set(self.loginOrSignUpSuccessful, forKey:"loginOrSignUpSuccessful") } }

self.loginOrSignUpSuccessful = true
UserDefaults.standard.set(true, forKey: "loginOrSignUpSuccessful")
```
<p><strong>View Code Snippet:</strong></p>
<pre class="lang-swift prettyprint-override"><code>struct SignUpLogin: View {

private var showMainLandingTabViewLink: some View

{

NavigationLink(destination: MainLandingTabView().environmentObject(signupLoginViewModelStateObject).navigationBarBackButtonHidden(true), isActive: $signupLoginViewModelStateObject.loginOrSignUpSuccessful, label: {EmptyView()})

}

 var body: some View

{

 NavigationView {

ZStack(alignment: .leading) { // all the email & password, button fields.

  }

.background(showMainLandingTabViewLink)
}
.environmentObject(signupLoginViewModelStateObject)     .navigationBarHidden(true)

 // Used to hide the back buttom if coming from NavigationView

}
</code>```

Body:
In our current swiftUI app, if user closes the app they will be asked to login again - we are trying to change this behaviour by using userDefaults.
Without userDefaults code changes below LoginView directs to the home screen after login/registration using the Navigation link.

Issue:
We made below code changes to the View and LoginViewModel and when login / register button is pressed the LoginView is not taking to the home screen. It just shows the login/signup page with the login successful or registration successful message.

I have debugged in Xcode and loginOrSignUpSuccessful variable value is set to true after login button press.

Why is navigationlink not directing to MainLandingTabView Screen after login or registration?

Code Changes made to the LoginViewModel
Variable  & View Code Snippet

@Published var loginOrSignUpSuccessful = UserDefaults.standard.bool(forKey: "loginOrSignUpSuccessful")

{     didSet{ UserDefaults.standard.set(self.loginOrSignUpSuccessful, forKey:"loginOrSignUpSuccessful") } }

self.loginOrSignUpSuccessful = true
UserDefaults.standard.set(true, forKey: "loginOrSignUpSuccessful")

View Code Snippet:

struct SignUpLogin: View {

private var showMainLandingTabViewLink: some View

{

NavigationLink(destination: MainLandingTabView().environmentObject(signupLoginViewModelStateObject).navigationBarBackButtonHidden(true), isActive: $signupLoginViewModelStateObject.loginOrSignUpSuccessful, label: {EmptyView()})

}

 var body: some View

{

 NavigationView {

ZStack(alignment: .leading) { // all the email & password, button fields.

  }

.background(showMainLandingTabViewLink)
}
.environmentObject(signupLoginViewModelStateObject)     .navigationBarHidden(true)

 // Used to hide the back buttom if coming from NavigationView

}


问:
Creating React app stuck and not creating src and public folder
https://drive.google.com/file/d/18yybdLjkH3BKhrNZETeVmzQiUvaDcRqR/view?usp=sharing

See the above link for image for reference.

I have tried to Create React App but it is stuck. It is not creating src and public folder. I tried another system its working fine.

https://drive.google.com/file/d/1SLIBwp3krv2AG9pnNPO79HtKPv9XIsNR/view?usp=sharing

see the above link for image reference.

Sometimes Stick here not creating app


问:
Make Multiple Pages Of a chat website using html/Js
i cant make a page for a different room (like chat rooms and you can pick what room you are chatting in) but it wont work, this is a code from another person but everyone is asking him to add rooms to his chat app so i tried doing it but im stuck, (note: the code is unchanged and his code works perfectly fine) here is a link to his chat app: https://replit.com/@NigelIsCoding/chat?v=1 , thank you for help :)

my main.js code:

```<code>$(function() {
  var FADE_TIME = 150;
  var TYPING_TIMER_LENGTH = 400;
  var COLORS = [
    '#94a19f', '#000000', '#7a7777', '#3b3b3b',
    '#3c4544', '#7a7a7a', '#4f5251', '#575757',
    'grey', 'darkgrey', 'black', '#404040'
  ];

  var $window = $(window);
  var $usernameInput = $('.usernameInput');
  var $messages = $('.messages');
  var $inputMessage = $('.inputMessage');

  var $loginPage = $('.login.page');
  var $chatPage = $('.chat.page');

  var username;
  var connected = false;
  var typing = false;
  var lastTypingTime;
  var $currentInput = $usernameInput;

  var socket = io();

  function addParticipantsMessage(data) {
    var message = '';
    if (data.numUsers === 1) {
      message += "there's 1 participant";
    } else {
      message += "there are " + data.numUsers + " participants";
    }
    log(message);
  }

  function setUsername() {
    username = cleanInput($usernameInput.val().trim());
    if (username) {
      $loginPage.fadeOut();
      $chatPage.show();
      $loginPage.off('click');
      $currentInput = $inputMessage.focus();

      socket.emit('add user', username);
    }
  }

  function sendMessage() {
    var message = $inputMessage.val();
    message = cleanInput(message);
    if (message && connected) {
      $inputMessage.val('');
      addChatMessage({
        username: username,
        message: message
      });
      socket.emit('new message', message);
    }
  }

  function log(message, options) {
    var $el = $(
      message.match(/welcome/i) ? '<marquee scrollamount="50">' : '<li>'
    ).addClass('log').text(message);
    addMessageElement($el, options);
    $(document).ready(function() {

      var url1 = /(^|<|\s)(www\..+?\..+?)(\s|>|$)/g,
        url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g,

        linkThis = function() {
          var childNodes = this.childNodes,
            i = childNodes.length;
          while (i--) {
            var n = childNodes[i];
            if (n.nodeType == 3) {
              var html = $.trim(n.nodeValue);
              if (html) {
                html = html.replace(/&/g, '&')
                  .replace(/</g, '<')
                  .replace(/>/g, '>')
                  .replace(url1, '$1 <a href="http://$2" style="color: white" target="_blank">$2</a>$3')
                  .replace(url2, '$1 <a href="$2" style="color: white" target="_blank">$2</a>$5');
                $(n).after(html).remove();
              }
            }
            else if (n.nodeType == 1 && !/^(a|button|textarea)$/i.test(n.tagName)) {
              linkThis.call(n);
            }
          }
        };
      $.fn.link = function() {
        return this.each(linkThis);
      };

      $('body').link();
    });

  }

  function addChatMessage(data, options) {
    var $typingMessages = getTypingMessages(data);
    options = options || {};
    if ($typingMessages.length !== 0) {
      options.fade = false;
      $typingMessages.remove();
    }

    var $usernameDiv = $('<span class="username"/>')
      .text(data.username)
      .css('color', getUsernameColor(data.username));
    var $messageBodyDiv = $('<span class="messageBody">')
      .text(data.message);

    var typingClass = data.typing ? 'typing' : '';
    var $messageDiv = $('<li class="message"/>')
      .data('username', data.username)
      .addClass(typingClass)
      .append($usernameDiv, $messageBodyDiv);

    addMessageElement($messageDiv, options);
    $(document).ready(function() {

      var url1 = /(^|<|\s)(www\..+?\..+?)(\s|>|$)/g,
        url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g,

        linkThis = function() {
          var childNodes = this.childNodes,
            i = childNodes.length;
          while (i--) {
            var n = childNodes[i];
            if (n.nodeType == 3) {
              var html = $.trim(n.nodeValue);
              if (html) {
                html = html.replace(/&/g, '&')
                  .replace(/</g, '<')
                  .replace(/>/g, '>')
                  .replace(url1, '$1 <a href="http://$2" style="color: white" target="_blank"> $2</a>$3')
                  .replace(url2, '$1 <a href="$2" style="color: white" target="_blank"> $2</a>$5');
                $(n).after(html).remove();
              }
            }
            else if (n.nodeType == 1 && !/^(a|button|textarea)$/i.test(n.tagName)) {
              linkThis.call(n);
            }
          }
        };

      $.fn.link = function() {
        return this.each(linkThis);
      };

      $('body').link();
    });
  }

  function addChatTyping(data) {
    data.typing = true;
    data.message = 'is typing';
    addChatMessage(data);
  }

  function removeChatTyping(data) {
    getTypingMessages(data).fadeOut(function() {
      $(this).remove();
    });
  }
  function addMessageElement(el, options) {
    var $el = $(el);

    if (!options) {
      options = {};
    }
    if (typeof options.fade === 'undefined') {
      options.fade = true;
    }
    if (typeof options.prepend === 'undefined') {
      options.prepend = false;
    }

    if (options.fade) {
      $el.hide().fadeIn(FADE_TIME);
    }
    if (options.prepend) {
      $messages.prepend($el);
    } else {
      $messages.append($el);
    }
    $messages[0].scrollTop = $messages[0].scrollHeight;
  }

  function cleanInput(input) {
    return $('<div/>').text(input).html();
  }

  function updateTyping() {
    if (connected) {
      if (!typing) {
        typing = true;
        socket.emit('typing');
      }
      lastTypingTime = (new Date()).getTime();

      setTimeout(function() {
        var typingTimer = (new Date()).getTime();
        var timeDiff = typingTimer - lastTypingTime;
        if (timeDiff >= TYPING_TIMER_LENGTH && typing) {
          socket.emit('stop typing');
          typing = false;
        }
      }, TYPING_TIMER_LENGTH);
    }
  }

  function getTypingMessages(data) {
    return $('.typing.message').filter(function(i) {
      return $(this).data('username') === data.username;
    });
  }

  function getUsernameColor(username) {
    var hash = 7;
    for (var i = 0; i < username.length; i++) {
      hash = username.charCodeAt(i) + (hash << 5) - hash;
    }
    var index = Math.abs(hash % COLORS.length);
    return COLORS[index];
  }

  $window.keydown(function(event) {
    if (!(event.ctrlKey || event.metaKey || event.altKey)) {
      $currentInput.focus();
    }
    if (event.which === 13) {
      if (username) {
        sendMessage();
        socket.emit('stop typing');
        typing = false;
      } else {
        setUsername();
      }
    }
  });

  $inputMessage.on('input', function() {
    updateTyping();
  });

  $loginPage.click(function() {
    $currentInput.focus();
  });

  $inputMessage.click(function() {
    $inputMessage.focus();
  });

  socket.on('login', function(data) {
    connected = true;
    var message = "";
    log(message, {
      prepend: true
    });
    addParticipantsMessage(data);
  });

  socket.on('new message', function(data) {
    addChatMessage(data);
  });

  socket.on('user joined', function(data) {
    log(data.username + ' joined');
    addParticipantsMessage(data);
  });

  socket.on('user left', function(data) {
    log(data.username + ' left');
    addParticipantsMessage(data);
    removeChatTyping(data);
  });

  socket.on('typing', function(data) {
    addChatTyping(data);
  });

  socket.on('stop typing', function(data) {
    removeChatTyping(data);
  });

  socket.on('disconnect', function() {
    log('you have been disconnected');
  });

  socket.on('reconnect', function() {
    log('you have been reconnected');
    if (username) {
      socket.emit('add user', username);
    }
  });

  socket.on('reconnect_error', function() {
    log('attempt to reconnect has failed');
  });

});
</code>```

i tried this html code:

```<code>    !doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="theme-color" content="#3af">
  <meta name="viewport" content="target-densitydpi=device-dpi, initial-scale=1.0, user-scalable=no" />
  <meta name="description" content="A fully functioning public chat mobile friendly and supports links change the color to whatever you want even invert it if you want!">
  <title>Chat</title>
  <link href="icon.png" rel="icon" type="image/x-icon" />
</head>
<body>
  <ul class="pages">
    <meta name="theme-color" content="#3af">
    <li class="chat page">
      <div class="chatArea">
        <ul class="messages"></ul>
      </div>
      <input class="inputMessage" placeholder="Type here..."/>
    </li>
    <li class="login page">
      <div class="form">
        <h3 class="title" style="font-family: ubuntu">Enter Your Nickname:</h3>
        <input class="usernameInput" type="text" maxlength="10"/>
        <meta name="theme-color" content="#3af">
      </div>
    </li>
  </ul>
  <link rel="stylesheet" href="style.css">
  <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
  <script src="/socket.io/socket.io.js"></script>
  <script src="main.js"></script>
  <meta name="theme-color" content="#3af">
  </body>
</html>
</code>```

Body:
i cant make a page for a different room (like chat rooms and you can pick what room you are chatting in) but it wont work, this is a code from another person but everyone is asking him to add rooms to his chat app so i tried doing it but im stuck, (note: the code is unchanged and his code works perfectly fine) here is a link to his chat app: https://replit.com/@NigelIsCoding/chat?v=1 , thank you for help :)

my main.js code:

$(function() {
  var FADE_TIME = 150;
  var TYPING_TIMER_LENGTH = 400;
  var COLORS = [
    '#94a19f', '#000000', '#7a7777', '#3b3b3b',
    '#3c4544', '#7a7a7a', '#4f5251', '#575757',
    'grey', 'darkgrey', 'black', '#404040'
  ];

  var $window = $(window);
  var $usernameInput = $('.usernameInput');
  var $messages = $('.messages');
  var $inputMessage = $('.inputMessage');

  var $loginPage = $('.login.page');
  var $chatPage = $('.chat.page');

  var username;
  var connected = false;
  var typing = false;
  var lastTypingTime;
  var $currentInput = $usernameInput;

  var socket = io();

  function addParticipantsMessage(data) {
    var message = '';
    if (data.numUsers === 1) {
      message += "there's 1 participant";
    } else {
      message += "there are " + data.numUsers + " participants";
    }
    log(message);
  }

  function setUsername() {
    username = cleanInput($usernameInput.val().trim());
    if (username) {
      $loginPage.fadeOut();
      $chatPage.show();
      $loginPage.off('click');
      $currentInput = $inputMessage.focus();

      socket.emit('add user', username);
    }
  }

  function sendMessage() {
    var message = $inputMessage.val();
    message = cleanInput(message);
    if (message && connected) {
      $inputMessage.val('');
      addChatMessage({
        username: username,
        message: message
      });
      socket.emit('new message', message);
    }
  }

  function log(message, options) {
    var $el = $(
      message.match(/welcome/i) ? '<marquee scrollamount="50">' : '
'
    ).addClass('log').text(message);
    addMessageElement($el, options);
    $(document).ready(function() {

      var url1 = /(^|<|\s)(www\..+?\..+?)(\s|>|$)/g,
        url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g,

        linkThis = function() {
          var childNodes = this.childNodes,
            i = childNodes.length;
          while (i--) {
            var n = childNodes[i];
            if (n.nodeType == 3) {
              var html = $.trim(n.nodeValue);
              if (html) {
                html = html.replace(/&/g, '&')
                  .replace(/</g, '<')
                  .replace(/>/g, '>')
                  .replace(url1, '$1 $2$3')
                  .replace(url2, '$1 $2$5');
                $(n).after(html).remove();
              }
            }
            else if (n.nodeType == 1 && !/^(a|button|textarea)$/i.test(n.tagName)) {
              linkThis.call(n);
            }
          }
        };
      $.fn.link = function() {
        return this.each(linkThis);
      };

      $('body').link();
    });

  }

  function addChatMessage(data, options) {
    var $typingMessages = getTypingMessages(data);
    options = options || {};
    if ($typingMessages.length !== 0) {
      options.fade = false;
      $typingMessages.remove();
    }

    var $usernameDiv = $('')
      .text(data.username)
      .css('color', getUsernameColor(data.username));
    var $messageBodyDiv = $('')
      .text(data.message);

    var typingClass = data.typing ? 'typing' : '';
    var $messageDiv = $('
')
      .data('username', data.username)
      .addClass(typingClass)
      .append($usernameDiv, $messageBodyDiv);

    addMessageElement($messageDiv, options);
    $(document).ready(function() {

      var url1 = /(^|<|\s)(www\..+?\..+?)(\s|>|$)/g,
        url2 = /(^|<|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|>|$)/g,

        linkThis = function() {
          var childNodes = this.childNodes,
            i = childNodes.length;
          while (i--) {
            var n = childNodes[i];
            if (n.nodeType == 3) {
              var html = $.trim(n.nodeValue);
              if (html) {
                html = html.replace(/&/g, '&')
                  .replace(/</g, '<')
                  .replace(/>/g, '>')
                  .replace(url1, '$1  $2$3')
                  .replace(url2, '$1  $2$5');
                $(n).after(html).remove();
              }
            }
            else if (n.nodeType == 1 && !/^(a|button|textarea)$/i.test(n.tagName)) {
              linkThis.call(n);
            }
          }
        };

      $.fn.link = function() {
        return this.each(linkThis);
      };

      $('body').link();
    });
  }

  function addChatTyping(data) {
    data.typing = true;
    data.message = 'is typing';
    addChatMessage(data);
  }

  function removeChatTyping(data) {
    getTypingMessages(data).fadeOut(function() {
      $(this).remove();
    });
  }
  function addMessageElement(el, options) {
    var $el = $(el);

    if (!options) {
      options = {};
    }
    if (typeof options.fade === 'undefined') {
      options.fade = true;
    }
    if (typeof options.prepend === 'undefined') {
      options.prepend = false;
    }

    if (options.fade) {
      $el.hide().fadeIn(FADE_TIME);
    }
    if (options.prepend) {
      $messages.prepend($el);
    } else {
      $messages.append($el);
    }
    $messages[0].scrollTop = $messages[0].scrollHeight;
  }

  function cleanInput(input) {
    return $('
').text(input).html();
  }

  function updateTyping() {
    if (connected) {
      if (!typing) {
        typing = true;
        socket.emit('typing');
      }
      lastTypingTime = (new Date()).getTime();

      setTimeout(function() {
        var typingTimer = (new Date()).getTime();
        var timeDiff = typingTimer - lastTypingTime;
        if (timeDiff >= TYPING_TIMER_LENGTH && typing) {
          socket.emit('stop typing');
          typing = false;
        }
      }, TYPING_TIMER_LENGTH);
    }
  }

  function getTypingMessages(data) {
    return $('.typing.message').filter(function(i) {
      return $(this).data('username') === data.username;
    });
  }

  function getUsernameColor(username) {
    var hash = 7;
    for (var i = 0; i < username.length; i++) {
      hash = username.charCodeAt(i) + (hash << 5) - hash;
    }
    var index = Math.abs(hash % COLORS.length);
    return COLORS[index];
  }

  $window.keydown(function(event) {
    if (!(event.ctrlKey || event.metaKey || event.altKey)) {
      $currentInput.focus();
    }
    if (event.which === 13) {
      if (username) {
        sendMessage();
        socket.emit('stop typing');
        typing = false;
      } else {
        setUsername();
      }
    }
  });

  $inputMessage.on('input', function() {
    updateTyping();
  });

  $loginPage.click(function() {
    $currentInput.focus();
  });

  $inputMessage.click(function() {
    $inputMessage.focus();
  });

  socket.on('login', function(data) {
    connected = true;
    var message = "";
    log(message, {
      prepend: true
    });
    addParticipantsMessage(data);
  });

  socket.on('new message', function(data) {
    addChatMessage(data);
  });

  socket.on('user joined', function(data) {
    log(data.username + ' joined');
    addParticipantsMessage(data);
  });

  socket.on('user left', function(data) {
    log(data.username + ' left');
    addParticipantsMessage(data);
    removeChatTyping(data);
  });

  socket.on('typing', function(data) {
    addChatTyping(data);
  });

  socket.on('stop typing', function(data) {
    removeChatTyping(data);
  });

  socket.on('disconnect', function() {
    log('you have been disconnected');
  });

  socket.on('reconnect', function() {
    log('you have been reconnected');
    if (username) {
      socket.emit('add user', username);
    }
  });

  socket.on('reconnect_error', function() {
    log('attempt to reconnect has failed');
  });

});

i tried this html code:

    !doctype html>

  <meta charset="UTF-8">
  <meta name="theme-color" content="#3af">
  <meta name="viewport" content="target-densitydpi=device-dpi, initial-scale=1.0, user-scalable=no" />
  <meta name="description" content="A fully functioning public chat mobile friendly and supports links change the color to whatever you want even invert it if you want!">
  <title>Chat</title>
  <link href="icon.png" rel="icon" type="image/x-icon" />

    <meta name="theme-color" content="#3af">

      <input class="inputMessage" placeholder="Type here..."/>

Enter Your Nickname:

        <input class="usernameInput" type="text" maxlength="10"/>
        <meta name="theme-color" content="#3af">

  <link rel="stylesheet" href="style.css">

  <meta name="theme-color" content="#3af">


问:
Send email only when a row is edited or new
This code adds an edit URL to a column, then emails that code to the email collected....but it is sending emails for every row regardless of whether anything was edited or if it is a new row of data. Please assist.

function assignEditUrls() {
  var form = FormApp.openById('Form ID');
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Eval Input Form     responses');
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Eval Input Form     responses');
  var data = sheet.getDataRange().getValues();
  var urlCol = 154;
  var responses = form.getResponses();
  var timestamps = [], urls = [], resultUrls = [];
  for (var i = 0; i < responses.length; i++) {
    timestamps.push(responses[i].getTimestamp().setMilliseconds(0));
    urls.push(responses[i].getEditResponseUrl());
  }
  for (var j = 1; j < data.length; j++) {
    resultUrls.push([data[j][0] ? urls[timestamps.indexOf(data[j][0].setMilliseconds(0))] : '']);
  }
  sheet.getRange(2, urlCol, resultUrls.length).setValues(resultUrls);
  var emailCol = 1;
  for (var j = 1; j < data.length; j++) {
    var email = data[j][emailCol];
    // get edit URL for current row
    var editUrl = data[j][0] ? urls[timestamps.indexOf(data[j][0].setMilliseconds(0))] : '';
    if (editUrl) {
      GmailApp.sendEmail(
        email,
        "Eval Input Form - Edit URL Link",
        "Here is the link to edit the form submission - please forward this URL to the next person reviewing or editing the Eval Input Form: "
        + editUrl,
        { name: 'Eval Input Routing' }
      );
    }
  }
}
```
<p>I tried adding the code below, but that doesn't seem to help exclude unedited rows. Essentially, I only want emails to be sent out if any data in the row is edited or if it is a new row.  Thanks in advance.</p>
<pre class="lang-js prettyprint-override"><code>      // get email address for current row
      var email = data[currentRow][emailCol];
</code>```

Body:
This code adds an edit URL to a column, then emails that code to the email collected....but it is sending emails for every row regardless of whether anything was edited or if it is a new row of data. Please assist.

function assignEditUrls() {
  var form = FormApp.openById('Form ID');
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Eval Input Form     responses');
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Eval Input Form     responses');
  var data = sheet.getDataRange().getValues();
  var urlCol = 154;
  var responses = form.getResponses();
  var timestamps = [], urls = [], resultUrls = [];
  for (var i = 0; i < responses.length; i++) {
    timestamps.push(responses[i].getTimestamp().setMilliseconds(0));
    urls.push(responses[i].getEditResponseUrl());
  }
  for (var j = 1; j < data.length; j++) {
    resultUrls.push([data[j][0] ? urls[timestamps.indexOf(data[j][0].setMilliseconds(0))] : '']);
  }
  sheet.getRange(2, urlCol, resultUrls.length).setValues(resultUrls);
  var emailCol = 1;
  for (var j = 1; j < data.length; j++) {
    var email = data[j][emailCol];
    // get edit URL for current row
    var editUrl = data[j][0] ? urls[timestamps.indexOf(data[j][0].setMilliseconds(0))] : '';
    if (editUrl) {
      GmailApp.sendEmail(
        email,
        "Eval Input Form - Edit URL Link",
        "Here is the link to edit the form submission - please forward this URL to the next person reviewing or editing the Eval Input Form: "
        + editUrl,
        { name: 'Eval Input Routing' }
      );
    }
  }
}

I tried adding the code below, but that doesn't seem to help exclude unedited rows. Essentially, I only want emails to be sent out if any data in the row is edited or if it is a new row.  Thanks in advance.

      // get email address for current row
      var email = data[currentRow][emailCol];


问:
How to remove item from cart via ajax edd
I want to remove item from cart via ajax and I'm using Easy Digital Downloads plugin so is there any clue for that.

I already found below code but don't know how to use it as I made customizations to my custom theme by overriding templates.

```<code>function edd_ajax_remove_from_cart() {
  if ( ! isset( $_POST['nonce'] ) ) {
    edd_debug_log( __( 'Missing nonce when removing an item from the cart. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true );
  }

  if ( isset( $_POST['cart_item'] ) && isset( $_POST['nonce'] ) ) {

    $cart_item = absint( $_POST['cart_item'] );
    $nonce     = sanitize_text_field( $_POST['nonce'] );

    $nonce_verified = wp_verify_nonce( $nonce, 'edd-remove-cart-widget-item' );

    if ( false === $nonce_verified ) {
      $return = array( 'removed' => 0 );
    } else {
      edd_remove_from_cart( $cart_item );

      $return = array(
        'removed'       => 1,
        'subtotal'      => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ), ENT_COMPAT, 'UTF-8' ),
        'total'         => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ), ENT_COMPAT, 'UTF-8' ),
        'cart_quantity' => html_entity_decode( edd_get_cart_quantity() ),
      );

      if ( edd_use_taxes() ) {
        $cart_tax      = (float) edd_get_cart_tax();
        $return['tax'] = html_entity_decode( edd_currency_filter( edd_format_amount( $cart_tax ) ), ENT_COMPAT, 'UTF-8' );
      }
    }

    $return = apply_filters( 'edd_ajax_remove_from_cart_response', $return );

    echo json_encode( $return );

  }
  edd_die();
}
</code>```

Here is my Current delete item code inside overrided template inside edd_templates/checkout_cart.php file.

```<code><a class="edd_cart_remove_item_btn" href="<?php echo esc_url( wp_nonce_url( edd_remove_item_url( $key ), 'edd-remove-from-cart-' . sanitize_key( $key ), 'edd_remove_from_cart_nonce' ) ); ?>"></a>
</code>```

But it refresh cart page when I click on x(delete) in cart but I want to remove item using ajax any help will be appreciated.

Body:
I want to remove item from cart via ajax and I'm using Easy Digital Downloads plugin so is there any clue for that.

I already found below code but don't know how to use it as I made customizations to my custom theme by overriding templates.

function edd_ajax_remove_from_cart() {
  if ( ! isset( $_POST['nonce'] ) ) {
    edd_debug_log( __( 'Missing nonce when removing an item from the cart. Please read the following for more information: https://easydigitaldownloads.com/development/2018/07/05/important-update-to-ajax-requests-in-easy-digital-downloads-2-9-4', 'easy-digital-downloads' ), true );
  }

  if ( isset( $_POST['cart_item'] ) && isset( $_POST['nonce'] ) ) {

    $cart_item = absint( $_POST['cart_item'] );
    $nonce     = sanitize_text_field( $_POST['nonce'] );

    $nonce_verified = wp_verify_nonce( $nonce, 'edd-remove-cart-widget-item' );

    if ( false === $nonce_verified ) {
      $return = array( 'removed' => 0 );
    } else {
      edd_remove_from_cart( $cart_item );

      $return = array(
        'removed'       => 1,
        'subtotal'      => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ), ENT_COMPAT, 'UTF-8' ),
        'total'         => html_entity_decode( edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ), ENT_COMPAT, 'UTF-8' ),
        'cart_quantity' => html_entity_decode( edd_get_cart_quantity() ),
      );

      if ( edd_use_taxes() ) {
        $cart_tax      = (float) edd_get_cart_tax();
        $return['tax'] = html_entity_decode( edd_currency_filter( edd_format_amount( $cart_tax ) ), ENT_COMPAT, 'UTF-8' );
      }
    }

    $return = apply_filters( 'edd_ajax_remove_from_cart_response', $return );

    echo json_encode( $return );

  }
  edd_die();
}

Here is my Current delete item code inside overrided template inside edd_templates/checkout_cart.php file.

<a class="edd_cart_remove_item_btn" href="<?php echo esc_url( wp_nonce_url( edd_remove_item_url( $key ), 'edd-remove-from-cart-' . sanitize_key( $key ), 'edd_remove_from_cart_nonce' ) ); ?>">

But it refresh cart page when I click on x(delete) in cart but I want to remove item using ajax any help will be appreciated.


问:
Unknown column '' in 'field list' ODBC Destination compononent in SSIS
I am getting attached error on ODBC component, that saying Unknown column in a Field list.

SSIS Error snapshot
MySQL Table Structure

However, I have tried deleting, adding new tables, and renaming fields. After trying for hours got a clue that the ODBC in SSIS is only getting three characters of a field that I have created in a table in MySQL. I am very grateful if you could help with this issue.

Many Thanks,
Malintha


问:
Does any one know how to connect multiple database with strapi V4?
I want to connect two different postgresSQL databases with strapi v4 , in  a strapi v3 it is possible that we can connect multiple databases but when I tried to connect multiple databases with the strapi v4 there is no specific documentation or information found on the internet.

If anyone has any idea about it please help me.


问:
What is the best way to handle boolean bounds with scipy's minimize function?
I am trying to find the minimum value of a function that takes float and bool values as input.

def function_to_optimize(a : float, b : float, c : bool) -> float:
    # do some calculation...
```
<p>How do I define the <code>bounds</code> parameter of the <code>scipy.optimize.minimize</code> regarding my <code>bool</code> variable <code>c</code>?</p>
<p>Say that the bounds for <code>a</code> and <code>b</code> are <code>(0,1)</code>. What I am doing currently is to modify <code>function_to_optimize</code> so that it takes 3 <code>float</code> parameters and doing the following:</p>
<pre class="lang-py prettyprint-override"><code>def new_function_to_optimize(a : float, b : float, c : float) -> float:
    c = False if c < 0 else True
    # do some calculation...
</code>```

Then, I apply the bounds as bounds = [(0,1), (0,1), (-1,1)]. This way, for variable c, when the optimizer tries a value below 0, then c is assigned the value False and True otherwise.

But I am not sure if this is the best way to do this and if maybe the algorithms behind minimize can do some further optimization if he is aware that the variables are of type bool. Should I instead define the bounds as (False, True)?

Body:
I am trying to find the minimum value of a function that takes float and bool values as input.

def function_to_optimize(a : float, b : float, c : bool) -> float:
    # do some calculation...

How do I define the bounds parameter of the scipy.optimize.minimize regarding my bool variable c?

Say that the bounds for a and b are (0,1). What I am doing currently is to modify function_to_optimize so that it takes 3 float parameters and doing the following:

def new_function_to_optimize(a : float, b : float, c : float) -> float:
    c = False if c < 0 else True
    # do some calculation...

Then, I apply the bounds as bounds = [(0,1), (0,1), (-1,1)]. This way, for variable c, when the optimizer tries a value below 0, then c is assigned the value False and True otherwise.

But I am not sure if this is the best way to do this and if maybe the algorithms behind minimize can do some further optimization if he is aware that the variables are of type bool. Should I instead define the bounds as (False, True)?