问:
Reinstalling the Mobile Version Of Google Chrome In Order To Get My Website Running Propperly
I've been having some trouble getting the website I've built to run properly on the mobile version of Google Chrome. I'm having an issue where it keeps crashing and I am unable to navigate to any other pages on the website after viewing just a few pages.

I thought I'd solved this issue by getting rid of some unnecessary code and by reinstalling Google Chrome on my iPhone. However, when I go back and check the website again after leaving it for a day or so, the problem of the website crashing after viewing a few pages reoccurs. If I delete and reinstall (the mobile version of) Google Chrome the problem is once again solved.

Is my issue something that has to do with Google Chrome? Is there a bit of code that's affecting my website? On some pages, I have quite a lot of content. Would lazy loading images help to solve this issue? Any knowledge that you could share with me would be very much appreciated.

```<code><!DOCTYPE html>
<html lang="ja">

<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0;" charset="utf-8">

<title>MORIKOBOSHI・</title>

</head>

<body>

<div class="page-wrap">

<div class="cp_cont">
<input id="cp_toggle03" type="checkbox">
<div class="cp_mobilebar">
<label for="cp_toggle03" class="cp_menuicon">
<span></span>
</label>
</div>
<label id="h-menu_black" class="cp_toggle03" for="cp_menuicon"></label>
<div id="body" class="noscroll"></div>

<header class="cp_offcm03">

<nav>
<ul style="text-align: center; margin-left: 210px; overflow: hidden; padding-bottom: 10px; font-size: 15px;">

<li style="border-bottom: 1px solid lightgray;"><a href="#">ホーム</a></li>
<li style="border-bottom: 1px solid lightgray;"><a href="#">ブログ</a></li>
<li style="border-bottom: 1px solid lightgray;"><a href="#">このサイトについて</a></li>
<li style="border-bottom: 1px solid lightgray;"><a href="#">参考文献</a></li>

<div class="searchbar">

<form id="frmSearch" class="search2" method="get" action="default.html" style=" padding-right: 10px; padding-top: 20px; text-align: center; position: inline;">
<input class="search2" id="txtSearch" type="text" placeholder="Googleカスタム検索" name="serach_bar" size="31" maxlength="255" value="" style="top: 185px; width: 180px; height: 26px;">
<input class="search1" type="submit" name="submition" value="検索" style="padding-left: 5px; top: 153px; height: 25px; width: 36px; display: inline-flex; justify-content: center; font-size: 10.5px;">
<input class="search2" type="hidden" name="sitesearch" value="default.html">
    </form>
    </div>

<script type = "text/javascript"> document.getElementById('frmSearch').onsubmit = function() {
    window.location = 'http://www.google.com/search?q=site:morikoboshi.com' + document.getElementById('txtSearch').value;
    return false;
} </script>

<script>
document.getElementById('cp_toggle03').onchange = function() {
    if (document.getElementById('cp_toggle03').checked) {
        document.body.style.overflow = "hidden";
    } else {
        document.body.style.overflow = "";
    }
}
</script>

</ul>
</nav>
</header>

<div class="setsumei">
<br><h1 style="text-align: center; font-size: 40px;">◯◯◯◯</h1>
<br><p style="text-align: justify; font-size: 16px;"></p>

 <p style="text-align: center; font-size: 13px;">著者：◯◯◯◯</p>
 <p style="text-align: center; font-size: 13px;">撮影日：◯◯◯◯年◯◯月◯◯日</p>

 <br><br><p style="text-align: justify; font-size: 16px;">

    #
 </p>

</div>

<br><br><div class="image">

 <a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

 <br><br><a href="#"><img src="#" alt="#" width="90%"></a>

</div>
</div>

<br><br><footer class="site-footer" style="font-size: 12px;">MORIKOBOSHI© | <a href="#">English</a></footer>

</div>

<style>

.body{background-color: white;
      font-family: sans-serif;}

 .searchbar{float: right;}

 .image{text-align: center;}

 .setsumei{margin-left: 20px;
           margin-right: 20px;}

 .footer{width: 100%;
           height: 40px;
           text-align: center;
           border-top: 1px solid black;
           position: absolute;
           bottom: 0;
           padding: 10px;}

 .page-wrap {
  min-height: 100%;
  /* equal to footer height */
  margin-bottom: -40px;
}

 .page-wrap:after {
  content: "";
  display: block;
  }

 .site-footer, .page-wrap:after {
  /* .push must be the same height as footer */
  height: 20px;
}

 .site-footer {
  text-align: center;
  border-top: 1px solid black;
  padding: 10px;
}

 *, *:before, *:after {
    padding-left: 0;
    margin: 0;
    box-sizing: border-box;

}

 ol, ul {
    list-style: none;
}

 a {
    text-decoration: none;
    color: black;
}

 .cp_cont {
    height: auto;
}

/* menu */
 .cp_offcm03 {
    position: relative;
    z-index: 5000;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    width: 100%;
    height: auto;
    padding-top: 0;
    -webkit-transition: transform 0.3s ease-in;
            transition: transform 0.3s ease-in;
    text-align: center;
    color: black;
    background-color: white;
}
 .cp_offcm03 nav,
 .cp_offcm03 ul {
    height: 100%;
}

 .cp_offcm03 li {
    display: inline-block;
    margin-right: -6px;
}

 .cp_offcm03 a {
    display: block;
    padding: 15px 45px;
    margin-bottom: -5px;
    -webkit-transition: background-color .3s ease-in;
            transition: background-color .3s ease-in;
}

 .cp_offcm03 a:hover {
    background-color: lightgray;
}

/* menu toggle */
 #cp_toggle03 {
    display: none;
}

 #cp_toggle03:checked ~ .cp_offcm03 {
    -webkit-transform: translateX(0);
                    transform: translateX(0);
}

 #cp_toggle03:checked ~ .cp_container {
    -webkit-transform: translateX(0);
                    transform: translateX(0);
}

 .cp_mobilebar {
    display: none;

}

/* content */
 .cp_container {
    position: relative;
    top: 0;
    padding: 35px auto;
    -webkit-transition: transform .3s ease-in;
            transition: transform .3s ease-in;
}

 .cp_content {
    margin: 0 auto;
    padding: 20px;
    height: 65vh;
    text-align: center;

}

@media (max-width: 1130px)and (min-width: 280px) {
/* menu */
 .cp_offcm03 {
        position: fixed;
        left: -250px;
        overflow-y: hidden;
        width: 250px;
        height: 100%;
        padding-top: 40px;
        color: black;
        background-color: white;
        z-index: 1000;
    }

 .cp_offcm03 nav {
        background: white;
        border-right: 0.5px solid lightgray;
        margin-left: -210px;
    }

 .cp_offcm03 li {
        display: block;
        margin-right: 0;}

 .cp_offcm03 a {
        padding: 20px;

    }

/* menu toggle */
 .cp_mobilebar {
        display: block;
        z-index: 2000;
        position: relative;
        top: 0;
        left: 0;
        padding: 0 25px;
        width: 100%;
        height: 40px;
        background-color: white;
        border-bottom: .05px solid lightgray;

    }

 .cp_menuicon {
        display: block;
        position: relative;
        width: 25px;
        height: 100%;
        cursor: pointer;
        -webkit-transition: transform .3s ease-in;
                transition: transform .3s ease-in;
    }
 .cp_menuicon > span {
        display: block;
        position: absolute;
        top: 55%;
        margin-top: -0.3em;
        width: 100%;
        height: 0.2em;
        border-radius: 1px;
        background-color: black;
        -webkit-transition: transform .3s ease;
                transition: transform .3s ease;
    }
 .cp_menuicon > span:before,
 .cp_menuicon > span:after {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        border-radius: 1px;
        background-color: black;
        -webkit-transition: transform .3s ease-in;
                transition: transform .3s ease-in;
    }

 .cp_menuicon > span:before {
        -webkit-transform: translateY(-0.6em);
                transform: translateY(-0.6em);
    }

 .cp_menuicon > span:after {
        -webkit-transform: translateY(0.6em);
                transform: translateY(0.6em);
    }

 #cp_toggle03:checked + .cp_mobilebar .cp_menuicon {
        -webkit-transform: rotate(45deg);
                transform: rotate(45deg);
    }

 #cp_toggle03:checked + .cp_mobilebar span:before,
 #cp_toggle03:checked + .cp_mobilebar span:after {
        -webkit-transform: rotate(90deg);
                transform: rotate(90deg);
    }

 #cp_toggle03:checked ~ .cp_offcm03 {
        -webkit-transform: translateX(100%);
                transform: translateX(100%);
    }

 #cp_toggle03:checked ~ .cp_container {
        -webkit-transform: translateX(250px);
                transform: translateX(250px);
    }

 input:checked ~ #h-menu_black {
    display: block;/*カバーを表示*/
    opacity: .6;
}

 #h-menu_black {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0;
    transition: .7s ease-in-out;
}

/* content */
 .cp_container {
        top: 60px;
        height: 92vh;
        text-align: center;
    }

 .noscroll{
        overflow: hidden;
        position: fixed;
    }

</style>

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

Body:
I've been having some trouble getting the website I've built to run properly on the mobile version of Google Chrome. I'm having an issue where it keeps crashing and I am unable to navigate to any other pages on the website after viewing just a few pages.

I thought I'd solved this issue by getting rid of some unnecessary code and by reinstalling Google Chrome on my iPhone. However, when I go back and check the website again after leaving it for a day or so, the problem of the website crashing after viewing a few pages reoccurs. If I delete and reinstall (the mobile version of) Google Chrome the problem is once again solved.

Is my issue something that has to do with Google Chrome? Is there a bit of code that's affecting my website? On some pages, I have quite a lot of content. Would lazy loading images help to solve this issue? Any knowledge that you could share with me would be very much appreciated.

<!DOCTYPE html>

<meta name="viewport" content="width=device-width, initial-scale=1.0;" charset="utf-8">

<title>MORIKOBOSHI・</title>

<input id="cp_toggle03" type="checkbox">

ホーム

ブログ

このサイトについて

参考文献

<form id="frmSearch" class="search2" method="get" action="default.html" style=" padding-right: 10px; padding-top: 20px; text-align: center; position: inline;">
<input class="search2" id="txtSearch" type="text" placeholder="Googleカスタム検索" name="serach_bar" size="31" maxlength="255" value="" style="top: 185px; width: 180px; height: 26px;">
<input class="search1" type="submit" name="submition" value="検索" style="padding-left: 5px; top: 153px; height: 25px; width: 36px; display: inline-flex; justify-content: center; font-size: 10.5px;">
<input class="search2" type="hidden" name="sitesearch" value="default.html">
    </form>

◯◯◯◯

著者：◯◯◯◯

撮影日：◯◯◯◯年◯◯月◯◯日

    #

MORIKOBOSHI© | English


来源: stackexchange

问:
Show folder tree when using 4 terminal mode
How can I show the folder tree (through SFTP) of the selected terminal when I am in 4 terminal mode?

As of now, I can see the folder tree only when in single terminal mode. But having it showing the content based on the active terminal would be very helpful for me.

ContentLicense: CC BY-SA 4.0


问:
How to show element of a legend once if it was added to a plot in a cycle?
Trying to visualize a grid using matplotlib and adding vertical lines in a cycle.

```<code>for element in new_gr_4:
    axs.axvline(
        x=element,
        color = 'black',
        linestyle = 'dashed',
        linewidth = 1.0,
        alpha=0.5,
        label='new_grid 4 (weighted)'
        )
</code>```

If I am trying to show a legend for a plot - I have a lot of elements in a legend with the same visualization parameters (because I have added them in a cycle multiple times).

Is it possible to add a label on a legend for a group, only once?

Or how to add add a separate label on a legend for provided visualization parameters?

Body:
Trying to visualize a grid using matplotlib and adding vertical lines in a cycle.

for element in new_gr_4:
    axs.axvline(
        x=element,
        color = 'black',
        linestyle = 'dashed',
        linewidth = 1.0,
        alpha=0.5,
        label='new_grid 4 (weighted)'
        )

If I am trying to show a legend for a plot - I have a lot of elements in a legend with the same visualization parameters (because I have added them in a cycle multiple times).

Is it possible to add a label on a legend for a group, only once?

Or how to add add a separate label on a legend for provided visualization parameters?


问:
Decrypt keystore/truststore files with the password
I am trying to deploy a kafka-ui application.

The logs indicate that:

```<code>Caused by: java.io.IOException: keystore password was incorrect
    at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(Unknown Source)
    at java.base/sun.security.util.KeyStoreDelegator.engineLoad(Unknown Source)
    at java.base/java.security.KeyStore.load(Unknown Source)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory$FileBasedStore.load(DefaultSslEngineFactory.java:372)
    ... 42 common frames omitted
Caused by: java.security.UnrecoverableKeyException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
    ... 46 common frames omitted
</code>```

I am pretty sure I have set the correct password, so my question is (assuming I have access to all necessary files) how can I run a decryption of the keystore/clientstore files?

Body:
I am trying to deploy a kafka-ui application.

The logs indicate that:

Caused by: java.io.IOException: keystore password was incorrect
    at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(Unknown Source)
    at java.base/sun.security.util.KeyStoreDelegator.engineLoad(Unknown Source)
    at java.base/java.security.KeyStore.load(Unknown Source)
    at org.apache.kafka.common.security.ssl.DefaultSslEngineFactory$FileBasedStore.load(DefaultSslEngineFactory.java:372)
    ... 42 common frames omitted
Caused by: java.security.UnrecoverableKeyException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
    ... 46 common frames omitted

I am pretty sure I have set the correct password, so my question is (assuming I have access to all necessary files) how can I run a decryption of the keystore/clientstore files?


问:
Eliminating weird first column from .csv and calculating the mean
I've made a code that filters some information from a bigger .csv file and write a new smaller .csv file where you group it by the 'Step' and 'Destination Junction' column. The others columns should be taken to calculate the data's mean of each Destination on each Step.

```<code>dataFrame= pd.read_csv("Grid.csv")

data1 = dataFrame[dataFrame['Type'].str.contains('light')]

data2 = data1.groupby(['Step','Destination'], as_index=False)['Vehicles', 'Occupancy', 'Travel Time', 'Speed'].mean()

data2.to_csv(r'C:\Users\user\filter\filteredGrid.csv')
</code>```

The problem is:
On the left side of the first column, there is a ',' header with number below

My question is: How to get rid of it and if what .mean() is calculating, because I'm not sure if i calculated the mean correctly.

I tried to use .iloc() on the first column, but it has deleted the Step column instead.

Body:
I've made a code that filters some information from a bigger .csv file and write a new smaller .csv file where you group it by the 'Step' and 'Destination Junction' column. The others columns should be taken to calculate the data's mean of each Destination on each Step.

dataFrame= pd.read_csv("Grid.csv")

data1 = dataFrame[dataFrame['Type'].str.contains('light')]

data2 = data1.groupby(['Step','Destination'], as_index=False)['Vehicles', 'Occupancy', 'Travel Time', 'Speed'].mean()

data2.to_csv(r'C:\Users\user\filter\filteredGrid.csv')

The problem is:
On the left side of the first column, there is a ',' header with number below

My question is: How to get rid of it and if what .mean() is calculating, because I'm not sure if i calculated the mean correctly.

I tried to use .iloc() on the first column, but it has deleted the Step column instead.


问:
Connection speed or QOS indicator for NICE InContact?
We have multiple remote agents who are using NICE InContact for WFM. They are having issues with call refusals we believe, due to inconsistent upstream bandwidth. Does NICE InContact have a tool to test connectivity from the client to their platform like SalesForce (SFDCinstance\speedtest.jsp)? Thanks in advance.</p>


问:
The difference between asynchronous and normal tasks while using EFCore
I have figured out a problem which I was solving. I solved it anyway but I want to know the reason why this problem occured beginning.

I want to delete an entity named "OtpAuthenticator" or "EmailAuthenticator" which belongs to an User with the property of UserId of that spesific User.

When I try to debug the DeleteAsync method it throws an error like ' "user" threw an exception null-propert'.

```<code>public async Task<Unit> Handle(ResetVertificationTypeCommand request, CancellationToken cancellationToken)
        {
            User? user = await _userRepository.GetAsync(x => x.Id == request.UserId);
            _authBusinessRules.UserMustBeExistWhenRequested(user);

            if(user.AuthenticatorType != AuthenticatorType.None) _authService.ResetVertificationType(user);

            return Unit.Value;
        }
</code>```

AuthService

```<code>public async Task ResetVertificationType(User user)
    {
        if(user.AuthenticatorType == AuthenticatorType.Email)
        {
            DeleteEmailAuthenticator(user);
        }else if(user.AuthenticatorType == AuthenticatorType.Otp)
        {
            await DeleteOtpAuthenticator(user);
        }

        user.AuthenticatorType = AuthenticatorType.None;
        await _userRepository.UpdateAsync(user);

    }
    private async Task DeleteOtpAuthenticator(User user)
    {
        OtpAuthenticator otpAuthenticator = await _otpAuthenticatorRepository.GetAsync(x=> x.UserId == user.Id);
        await _otpAuthenticatorRepository.DeleteAsync(otpAuthenticator);
    }
    private async void DeleteEmailAuthenticator(User user)
    {
        EmailAuthenticator emailAuthenticator = await _emailAuthenticatorRepository.GetAsync(x=> x.UserId == user.Id);
        await _emailAuthenticatorRepository.DeleteAsync(emailAuthenticator);
    }
</code>```

And I tried, and deleted awaits and asyncs at the end the deleting happened. This is the last code which is working. Deleting the authenticator and changes the User.AuthenticatorType.

```<code>public async Task<Unit> Handle(ResetVertificationTypeCommand request, CancellationToken cancellationToken)
        {
            User? user = await _userRepository.GetAsync(x => x.Id == request.UserId);
            _authBusinessRules.UserMustBeExistWhenRequested(user);

            if(user.AuthenticatorType != AuthenticatorType.None) _authService.ResetVertificationType(user);

            return Unit.Value;
        }
</code>```

AuthService

```<code>public void ResetVertificationType(User user)
    {
        if(user.AuthenticatorType == AuthenticatorType.Email)
        {
            DeleteEmailAuthenticator(user);
        }else if(user.AuthenticatorType == AuthenticatorType.Otp)
        {
            DeleteOtpAuthenticator(user);
        }

        user.AuthenticatorType = AuthenticatorType.None;
        _userRepository.UpdateAsync(user);
        return;

    }
    private void DeleteOtpAuthenticator(User user)
    {
        OtpAuthenticator? otpAuthenticator = _otpAuthenticatorRepository.Get(x=> x.UserId == 1);
        _otpAuthenticatorRepository.Delete(otpAuthenticator);
    }
    private void DeleteEmailAuthenticator(User user)
    {
        EmailAuthenticator? emailAuthenticator = _emailAuthenticatorRepository.Get(x=> x.UserId == user.Id);
        _emailAuthenticatorRepository.Delete(emailAuthenticator);
    }
</code>```

I just don't understand the what happened. You can be sure that all the services and their dependency injections are ok.

Body:
I have figured out a problem which I was solving. I solved it anyway but I want to know the reason why this problem occured beginning.

I want to delete an entity named "OtpAuthenticator" or "EmailAuthenticator" which belongs to an User with the property of UserId of that spesific User.

When I try to debug the DeleteAsync method it throws an error like ' "user" threw an exception null-propert'.

public async Task<Unit> Handle(ResetVertificationTypeCommand request, CancellationToken cancellationToken)
        {
            User? user = await _userRepository.GetAsync(x => x.Id == request.UserId);
            _authBusinessRules.UserMustBeExistWhenRequested(user);

            if(user.AuthenticatorType != AuthenticatorType.None) _authService.ResetVertificationType(user);

            return Unit.Value;
        }

AuthService

public async Task ResetVertificationType(User user)
    {
        if(user.AuthenticatorType == AuthenticatorType.Email)
        {
            DeleteEmailAuthenticator(user);
        }else if(user.AuthenticatorType == AuthenticatorType.Otp)
        {
            await DeleteOtpAuthenticator(user);
        }

        user.AuthenticatorType = AuthenticatorType.None;
        await _userRepository.UpdateAsync(user);

    }
    private async Task DeleteOtpAuthenticator(User user)
    {
        OtpAuthenticator otpAuthenticator = await _otpAuthenticatorRepository.GetAsync(x=> x.UserId == user.Id);
        await _otpAuthenticatorRepository.DeleteAsync(otpAuthenticator);
    }
    private async void DeleteEmailAuthenticator(User user)
    {
        EmailAuthenticator emailAuthenticator = await _emailAuthenticatorRepository.GetAsync(x=> x.UserId == user.Id);
        await _emailAuthenticatorRepository.DeleteAsync(emailAuthenticator);
    }

And I tried, and deleted awaits and asyncs at the end the deleting happened. This is the last code which is working. Deleting the authenticator and changes the User.AuthenticatorType.

public async Task<Unit> Handle(ResetVertificationTypeCommand request, CancellationToken cancellationToken)
        {
            User? user = await _userRepository.GetAsync(x => x.Id == request.UserId);
            _authBusinessRules.UserMustBeExistWhenRequested(user);

            if(user.AuthenticatorType != AuthenticatorType.None) _authService.ResetVertificationType(user);

            return Unit.Value;
        }

AuthService

public void ResetVertificationType(User user)
    {
        if(user.AuthenticatorType == AuthenticatorType.Email)
        {
            DeleteEmailAuthenticator(user);
        }else if(user.AuthenticatorType == AuthenticatorType.Otp)
        {
            DeleteOtpAuthenticator(user);
        }

        user.AuthenticatorType = AuthenticatorType.None;
        _userRepository.UpdateAsync(user);
        return;

    }
    private void DeleteOtpAuthenticator(User user)
    {
        OtpAuthenticator? otpAuthenticator = _otpAuthenticatorRepository.Get(x=> x.UserId == 1);
        _otpAuthenticatorRepository.Delete(otpAuthenticator);
    }
    private void DeleteEmailAuthenticator(User user)
    {
        EmailAuthenticator? emailAuthenticator = _emailAuthenticatorRepository.Get(x=> x.UserId == user.Id);
        _emailAuthenticatorRepository.Delete(emailAuthenticator);
    }

I just don't understand the what happened. You can be sure that all the services and their dependency injections are ok.


问:
How to retrieve tweet details using on_response in tweepy StreamingClient?
I am trying to retrieve twitter data in real time using StreamingClient. However, I cannot seem to figure out how to retrieve user data and tweet data simultaneously. From what I understand, the user fields are present inside the includes data object of the response object. I am able to retrieve that inside the on_response(self, rsponse) function. But for retrieving properties like created_at of the tweet, I can't figure out how.

```<code>def on_response(self, response):
    for user in response.includes["users"]:
            self.user_dict[user.id] = {
                "username": user.username,
                "followers": user.public_metrics["followers_count"],
                "tweets": user.public_metrics["tweet_count"],
                "description": user.description,
                "location": user.location,
            }

    author_info = self.user_dict[tweet.author_id]
    self.result.append(
        {
            "author_id": tweet.author_id,
            "username": author_info["username"],
            "author_followers": author_info["followers"],
            "author_tweets": author_info["tweets"],
            "author_description": author_info["description"],
            "author_location": author_info["location"],
            "text": tweet.text,
            "created_at": tweet.created_at,
            "retweets": tweet.public_metrics["retweet_count"],
            "replies": tweet.public_metrics["reply_count"],
            "likes": tweet.public_metrics["like_count"],
            "quote_count": tweet.public_metrics["quote_count"],
        }
    )
</code>```

What I want is for tweet to hold the tweet_fields. How do I do that?

I have passed the necessary parameters in the stream.filter() method.

```<code>stream.filter(
    tweet_fields=["created_at", "geo", "public_metrics", "text"],
    user_fields=["username", "public_metrics", "description", "location"],
    expansions="author_id",
)
</code>```

I do not understand how to proceed further.

Body:
I am trying to retrieve twitter data in real time using StreamingClient. However, I cannot seem to figure out how to retrieve user data and tweet data simultaneously. From what I understand, the user fields are present inside the includes data object of the response object. I am able to retrieve that inside the on_response(self, rsponse) function. But for retrieving properties like created_at of the tweet, I can't figure out how.

def on_response(self, response):
    for user in response.includes["users"]:
            self.user_dict[user.id] = {
                "username": user.username,
                "followers": user.public_metrics["followers_count"],
                "tweets": user.public_metrics["tweet_count"],
                "description": user.description,
                "location": user.location,
            }

    author_info = self.user_dict[tweet.author_id]
    self.result.append(
        {
            "author_id": tweet.author_id,
            "username": author_info["username"],
            "author_followers": author_info["followers"],
            "author_tweets": author_info["tweets"],
            "author_description": author_info["description"],
            "author_location": author_info["location"],
            "text": tweet.text,
            "created_at": tweet.created_at,
            "retweets": tweet.public_metrics["retweet_count"],
            "replies": tweet.public_metrics["reply_count"],
            "likes": tweet.public_metrics["like_count"],
            "quote_count": tweet.public_metrics["quote_count"],
        }
    )

What I want is for tweet to hold the tweet_fields. How do I do that?

I have passed the necessary parameters in the stream.filter() method.

stream.filter(
    tweet_fields=["created_at", "geo", "public_metrics", "text"],
    user_fields=["username", "public_metrics", "description", "location"],
    expansions="author_id",
)

I do not understand how to proceed further.


问:
In postgres, how can I grant default privileges [SELECT,INSERT,UPDATE,DELETE] to a role for all newly created views?
Whenever a user creates a new view, only that user has access to the view, and he needs to run an ALTER statement to set the read_write role as the owner of the view, in order for the rest of the members of that role to be able to recreate the view (among other things).

I want members of the read_write role to have access, by default, to all new views. In this feasible?

The postgres database has a read_write role and a bunch of individual users. All users have the read_write role (set to inherit), which has SELECT,INSERT,UPDATE,DELETE privs on ALL tables in schema public.

I've run this SQL below already. Therefore, wenever a new table is created, members of the read_write role have default access to them.

```<code>ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO read_write_as;
</code>```

Body:
Whenever a user creates a new view, only that user has access to the view, and he needs to run an ALTER statement to set the read_write role as the owner of the view, in order for the rest of the members of that role to be able to recreate the view (among other things).

I want members of the read_write role to have access, by default, to all new views. In this feasible?

The postgres database has a read_write role and a bunch of individual users. All users have the read_write role (set to inherit), which has SELECT,INSERT,UPDATE,DELETE privs on ALL tables in schema public.

I've run this SQL below already. Therefore, wenever a new table is created, members of the read_write role have default access to them.

ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO read_write_as;


问:
openCV and pytesseract does not correctly read a simple black text within white background
I'm having trouble reading the text correctly within this image:

using cv2 and pytesseract. The code I have is here:

```<code>import pytesseract
import cv2

image = cv2.imread(path, cv2.IMREAD_GRAYSCALE)
(h, w) = image.shape[:2]
img = cv2.resize(image, (w*2, h*2))
thresh = cv2.threshold(img, 180, 255, cv2.THRESH_BINARY)[1]

cv2.imshow('image',image)
cv2.imshow('thresh',thresh)
cv2.waitKey(0)

#convert image to string
data = pytesseract.image_to_string(thresh, lang='eng', config=r'--oem 3 --psm 6')
print(data)
</code>```

The current code outputs incorrect text. It shows 44 instead of 4A.

```<code>| @- JobNumber: 44015100
H i» Relative Thickness: 0.21488
</code>```

Body:
I'm having trouble reading the text correctly within this image:

using cv2 and pytesseract. The code I have is here:

import pytesseract
import cv2

image = cv2.imread(path, cv2.IMREAD_GRAYSCALE)
(h, w) = image.shape[:2]
img = cv2.resize(image, (w*2, h*2))
thresh = cv2.threshold(img, 180, 255, cv2.THRESH_BINARY)[1]

cv2.imshow('image',image)
cv2.imshow('thresh',thresh)
cv2.waitKey(0)

#convert image to string
data = pytesseract.image_to_string(thresh, lang='eng', config=r'--oem 3 --psm 6')
print(data)

The current code outputs incorrect text. It shows 44 instead of 4A.

| @- JobNumber: 44015100
H i» Relative Thickness: 0.21488


问:
Dll exporting a class with a variadic template
I have been looking around for a while now but haven't found anything useful on my issue. I have a variadic template class for managing events. The class is fully contained in it's own header. Now the issue with this class is that it is used in a library that is dynamically linked.

Here is the relevant code:

// Definitions.h
#ifdef _ARTEMIS_EXPORT // _ARTEMIS_EXPORT is defined when compiling the library.
#define ARTEMIS_API __declspec(dllexport)
#else
#define ARTEMIS_API __declspec(dllimport)
#endif // _ARTEMIS_EXPORT

#define MAX_INVOKE 64
```
<pre class="lang-cpp prettyprint-override"><code>// Event.h

#pragma once
#include <memory.h>

#include "Definitions.h"

template<typename FN>
class ARTEMIS_API Event {};

template<typename... A>
class ARTEMIS_API Event<void(*)(A...)> {
public:
    typedef void(*LPFUNCTION)(A...);

private:
    LPFUNCTION lpszFunctions[MAX_INVOKE];

public:
    inline Event() { memset(lpszFunctions, 0x00, sizeof(lpszFunctions)); }

    inline void Invoke(A... params) const { // LNK2019
        for (INT i = 0; i < MAX_INVOKE; i++)
            if (lpszFunctions[i])
                lpszFunctions[i](params...);
    }

    inline void operator+=(_In_ LPFUNCTION lpFunction) { // LNK2019
        for (INT i = 0; i < MAX_INVOKE; i++) {
            if (!lpszFunctions[i]) {
                lpszFunctions[i] = lpFunction;
                break;
            }
        }
    }

    inline void operator-=(_In_ LPFUNCTION lpFunction) { // LNK2019
        for (INT i = 0; i < MAX_INVOKE; i++) {
            if (lpszFunctions[i] == lpFunction) {
                lpszFunctions[i] = nullptr;
                break;
            }
        }
    }
};

</code>```

When using this library, it outputs linker warnings (but does compile and seems to work fine) whenever I do not declare the class as dllexport, but when I declare the class as dllexport and then try and dllimport it in a different project, the linker throws LNK2019 errors for the member methods and operators contained in the class. My question is if there is any way to dllexport the class without these linker errors occuring? For context, the rest of this library compiles and links just fine, it is this one class that is causing me trouble.

Body:
I have been looking around for a while now but haven't found anything useful on my issue. I have a variadic template class for managing events. The class is fully contained in it's own header. Now the issue with this class is that it is used in a library that is dynamically linked.

Here is the relevant code:

// Definitions.h
#ifdef _ARTEMIS_EXPORT // _ARTEMIS_EXPORT is defined when compiling the library.
#define ARTEMIS_API __declspec(dllexport)
#else
#define ARTEMIS_API __declspec(dllimport)
#endif // _ARTEMIS_EXPORT

#define MAX_INVOKE 64

// Event.h

#pragma once
#include <memory.h>

#include "Definitions.h"

template<typename FN>
class ARTEMIS_API Event {};

template<typename... A>
class ARTEMIS_API Event<void(*)(A...)> {
public:
    typedef void(*LPFUNCTION)(A...);

private:
    LPFUNCTION lpszFunctions[MAX_INVOKE];

public:
    inline Event() { memset(lpszFunctions, 0x00, sizeof(lpszFunctions)); }

    inline void Invoke(A... params) const { // LNK2019
        for (INT i = 0; i < MAX_INVOKE; i++)
            if (lpszFunctions[i])
                lpszFunctions[i](params...);
    }

    inline void operator+=(_In_ LPFUNCTION lpFunction) { // LNK2019
        for (INT i = 0; i < MAX_INVOKE; i++) {
            if (!lpszFunctions[i]) {
                lpszFunctions[i] = lpFunction;
                break;
            }
        }
    }

    inline void operator-=(_In_ LPFUNCTION lpFunction) { // LNK2019
        for (INT i = 0; i < MAX_INVOKE; i++) {
            if (lpszFunctions[i] == lpFunction) {
                lpszFunctions[i] = nullptr;
                break;
            }
        }
    }
};

When using this library, it outputs linker warnings (but does compile and seems to work fine) whenever I do not declare the class as dllexport, but when I declare the class as dllexport and then try and dllimport it in a different project, the linker throws LNK2019 errors for the member methods and operators contained in the class. My question is if there is any way to dllexport the class without these linker errors occuring? For context, the rest of this library compiles and links just fine, it is this one class that is causing me trouble.


问:
How can be reach related entities while using generic repository in .net? how can i get category name in getproduct method?
When I use the GetProducts method, I want the name of the category to come directly, not the id.
Can I provide this using generic repository.if so how.Thanks in advance for helping.

My Product Entity

```<code>public class Product:BaseEntity
    {

        public  string ProductName  { get; set; }
        public string Description { get; set; }
        public string Img1 { get; set; }
        public string Img2 { get; set; }
        public string Img3 { get; set; }
        public decimal Price { get; set; }
        public int Stock { get; set; }
        //related ent
        public Category Category{ get; set; }
        public int CategoryId { get; set; }

    }
</code>```

my IGenericrepository

```<code>namespace Core.Interfaces
{
    public interface IGenericRepository<T> where T: BaseEntity
    {
        Task<T> GetByIdAsync(int id);
        Task<IReadOnlyList<T>> ListAllAsync();
        Task<T> FindBy(Expression<Func<T, bool>> predicate);
        Task<bool> SaveChangesAsync();
        void Add(T entity);
        void Update(T entity);
        void Delete(T entity);

    }
}
</code>```

my genericrepository

```<code> public async Task<T> FindBy(Expression<Func<T, bool>> predicate)
        {
            return await _context.Set<T>().FirstOrDefaultAsync(predicate);
        }
</code>```

my  GetProduct() method is here

```<code> [HttpGet]
        public async Task<ActionResult<List<Product>>>  GetProducts(){
            var products=await _productsrepo.ListAllAsync();
            return Ok(products);
        }
</code>```

Body:
When I use the GetProducts method, I want the name of the category to come directly, not the id.
Can I provide this using generic repository.if so how.Thanks in advance for helping.

My Product Entity

public class Product:BaseEntity
    {

        public  string ProductName  { get; set; }
        public string Description { get; set; }
        public string Img1 { get; set; }
        public string Img2 { get; set; }
        public string Img3 { get; set; }
        public decimal Price { get; set; }
        public int Stock { get; set; }
        //related ent
        public Category Category{ get; set; }
        public int CategoryId { get; set; }

    }

my IGenericrepository

namespace Core.Interfaces
{
    public interface IGenericRepository<T> where T: BaseEntity
    {
        Task<T> GetByIdAsync(int id);
        Task<IReadOnlyList<T>> ListAllAsync();
        Task<T> FindBy(Expression<Func<T, bool>> predicate);
        Task<bool> SaveChangesAsync();
        void Add(T entity);
        void Update(T entity);
        void Delete(T entity);

    }
}

my genericrepository

 public async Task<T> FindBy(Expression<Func<T, bool>> predicate)
        {
            return await _context.Set<T>().FirstOrDefaultAsync(predicate);
        }

my  GetProduct() method is here

 [HttpGet]
        public async Task<ActionResult<List<Product>>>  GetProducts(){
            var products=await _productsrepo.ListAllAsync();
            return Ok(products);
        }


问:
Getting error 25 (ENOTTY) when calling BLOPEN on a file descriptor for a PTS slave device
We are trying to convert from a physical HP9000, HP-UX 10.20 system, to an HP SRP container.  We have noticed that when we telnet to the physical HP9000 system we connect as a TTY device, but when we connect the container we connect as a PTS pseudo-terminal.  Some of the programs that we run within the system are now complaining that this is not a TTY device (ENOTTY error 25).

I have written a test C program to try to isolate which call is causing the issue, and it seems to be the "BLOPEN" command to open a block mode file descriptor.

```<code>#include <stdio.h>
#include <sys/fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <termio.h>
#include <signal.h>
#include <stropts.h>

int main()
{       int fdm;
        int fds;
        char *slavename;

        int j_bfd;
        FILE *pf_stream;

        unsigned short i_c_lflagsav;
        unsigned short i_c_oflagsav;
        struct termio s_termio;

        if ((fdm = open("/dev/ptmx",O_RDWR)) == -1){
          printf("Error getting file descriptor %d\n", errno);
          return -1;
        }
        printf("Opened /dev/ptmx\n");

        printf("before grantpt\n");
        grantpt(fdm);
        printf("after grantpt\n");
        printf("before unlockpt\n");
        unlockpt(fdm);
        printf("after unlockpt\n");

        slavename = ptsname(fdm);

        printf("Slavename\n");
        printf("%s\n",slavename);

        if ((fds = open(slavename,O_RDWR)) == -1){
          printf("Error opening slavename\n");
          return -1;
        }

        ioctl(fds, I_PUSH, "ptem");       /* push ptem */
        ioctl(fds, I_PUSH, "ldterm");    /* push ldterm */

        /* no echo.  */
        printf("before no echo\n");
        if (ioctl(fds,TCGETA,&s_termio) == -1) {
          printf("No echo error\n");
          return(-1);
        }

        i_c_lflagsav = s_termio.c_lflag;
        i_c_oflagsav = s_termio.c_oflag;

        printf("Before no tabs\n");
        if ((s_termio.c_oflag & TAB3) != 0) {

         /* set the output mode flag for no altering of tabs */
         s_termio.c_oflag &= ~TAB3;

         /* set new value */
         if (ioctl(fds,TCSETA,&s_termio) == -1) {
            printf("Error\n");
            /* try to reset driver to the way it was before we changed it */
            s_termio.c_oflag = i_c_oflagsav;
            /* set old value */
            ioctl(fds,TCSETA,&s_termio);
            return(-1);
         }
        }

        /*  get a block mode file descriptor from blopen */
        printf("Before block mode open\n");
        if ((j_bfd=blopen(fds,O_RDWR)) < 0 ) {
                printf("Error %d during blopen\n", errno);

        /* if we changed tab handling then try to reset the driver back. */
        printf("Before reset\n");
        if (((s_termio.c_oflag & TAB3) != 0))
         ioctl(fds,TCSETA,&s_termio);

        printf("Error getting block mode file descriptor %d\n", j_bfd);

        return(-1);
        }

        return 0;
}
</code>```

The output of the program is

Opened /dev/ptmx

before grantpt

after grantpt

before unlockpt

after unlockpt

Slavename

/dev/pts/0 (I always get /dev/pts/0, even if I run this from multiple terminals? I would've thought I'd get /dev/pts/1, /dev/pts/2, on subsequent terminals?)

before no echo

Before no tabs

Before block mode open

Error 25 during blopen

Before reset

Error getting block mode file descriptor -1

So my question is, does anyone know what causes BLOPEN to generate an error 25?  How does it determine if it's a TTY device or not?

Body:
We are trying to convert from a physical HP9000, HP-UX 10.20 system, to an HP SRP container.  We have noticed that when we telnet to the physical HP9000 system we connect as a TTY device, but when we connect the container we connect as a PTS pseudo-terminal.  Some of the programs that we run within the system are now complaining that this is not a TTY device (ENOTTY error 25).

I have written a test C program to try to isolate which call is causing the issue, and it seems to be the "BLOPEN" command to open a block mode file descriptor.

#include <stdio.h>
#include <sys/fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <termio.h>
#include <signal.h>
#include <stropts.h>

int main()
{       int fdm;
        int fds;
        char *slavename;

        int j_bfd;
        FILE *pf_stream;

        unsigned short i_c_lflagsav;
        unsigned short i_c_oflagsav;
        struct termio s_termio;

        if ((fdm = open("/dev/ptmx",O_RDWR)) == -1){
          printf("Error getting file descriptor %d\n", errno);
          return -1;
        }
        printf("Opened /dev/ptmx\n");

        printf("before grantpt\n");
        grantpt(fdm);
        printf("after grantpt\n");
        printf("before unlockpt\n");
        unlockpt(fdm);
        printf("after unlockpt\n");

        slavename = ptsname(fdm);

        printf("Slavename\n");
        printf("%s\n",slavename);

        if ((fds = open(slavename,O_RDWR)) == -1){
          printf("Error opening slavename\n");
          return -1;
        }

        ioctl(fds, I_PUSH, "ptem");       /* push ptem */
        ioctl(fds, I_PUSH, "ldterm");    /* push ldterm */

        /* no echo.  */
        printf("before no echo\n");
        if (ioctl(fds,TCGETA,&s_termio) == -1) {
          printf("No echo error\n");
          return(-1);
        }

        i_c_lflagsav = s_termio.c_lflag;
        i_c_oflagsav = s_termio.c_oflag;

        printf("Before no tabs\n");
        if ((s_termio.c_oflag & TAB3) != 0) {

         /* set the output mode flag for no altering of tabs */
         s_termio.c_oflag &= ~TAB3;

         /* set new value */
         if (ioctl(fds,TCSETA,&s_termio) == -1) {
            printf("Error\n");
            /* try to reset driver to the way it was before we changed it */
            s_termio.c_oflag = i_c_oflagsav;
            /* set old value */
            ioctl(fds,TCSETA,&s_termio);
            return(-1);
         }
        }

        /*  get a block mode file descriptor from blopen */
        printf("Before block mode open\n");
        if ((j_bfd=blopen(fds,O_RDWR)) < 0 ) {
                printf("Error %d during blopen\n", errno);

        /* if we changed tab handling then try to reset the driver back. */
        printf("Before reset\n");
        if (((s_termio.c_oflag & TAB3) != 0))
         ioctl(fds,TCSETA,&s_termio);

        printf("Error getting block mode file descriptor %d\n", j_bfd);

        return(-1);
        }

        return 0;
}

The output of the program is

Opened /dev/ptmx

before grantpt

after grantpt

before unlockpt

after unlockpt

Slavename

/dev/pts/0 (I always get /dev/pts/0, even if I run this from multiple terminals? I would've thought I'd get /dev/pts/1, /dev/pts/2, on subsequent terminals?)

before no echo

Before no tabs

Before block mode open

Error 25 during blopen

Before reset

Error getting block mode file descriptor -1

So my question is, does anyone know what causes BLOPEN to generate an error 25?  How does it determine if it's a TTY device or not?


问:
Datadog lambda extension
I am trying to set up datadog with my aws lambda function written in java. I have set up two lambda layers which are :

arn:aws:lambda:<AWS_REGION>:464622532012:layer:dd-trace-java:7

and

arn:aws:lambda:<AWS_REGION>:464622532012:layer:Datadog-Extension:34

I recieve logger logs in datadog, however, I have an uncaught error, and I see its stacktrace in cloudwatch logs, but not in datadog. I want to send these to datadog too, what can I do ?

Title: Datadog lambda extension


问:
Change SQL Server 2017 collation back
If we wanted to put back the collation for our SQL instance (server collation, not individual database) could we just restore backups of master and MSDB from when the old collation setting was in effect?</p>

Title: Change SQL Server 2017 collation back


问:
IW8ISO8859P8 to utf-8 conversion
My perl script reads values extracted from Oracle DB based on IW8ISO8859P8 codepage into a string. I have also an input file (saved as UTF-8) from which I read also a string.
I am trying to compare both string. printing first string gives me gibberish e.g òøáä -îåñáåú whereas the other string gives me the hebrew letter e.g הסבות. How can I encode the first string to give me the right Hebrew string ?
Thanks
Shimon

I tried using the format $string1 = Encode (uft-8, $string1) but it did not help

Title: IW8ISO8859P8 to utf-8 conversion


问:
Add special character to ckeditor5 in Drupal 9
The CKEditor 5 documentation shows the easy way how to add special characters to CKEditor 5 (https://ckeditor.com/docs/ckeditor5/latest/features/special-characters.html):

```<code>import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters';
import SpecialCharactersEssentials from '@ckeditor/ckeditor5-special-characters/src/specialcharactersessentials';

function SpecialCharactersEmoji( editor ) {
    editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji', [
        { title: 'smiley face', character: '' },
        { title: 'rocket', character: '' },
        { title: 'wind blowing face', character: '' },
        { title: 'floppy disk', character: '' },
        { title: 'heart', character: '❤' }
    ] );
}

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        plugins: [
            SpecialCharacters, SpecialCharactersEssentials, SpecialCharactersEmoji,

            // Other plugins...
        ],
        toolbar: [ 'specialCharacters', ... ],
    } )
    .then( ... )
    .catch( ... );
</code>```

But I have not found how to change it in Drupal 9. Does any special hook exist for it?

I have tried to create a new module based on starter template (https://git.drupalcode.org/project/ckeditor5_dev/-/tree/1.0.x/ckeditor5_plugin_starter_template):

chars.info.yml

```<code>name: Characters
type: module
description: "Provides CKEditor plugin."
package: CKEditor 5
core_version_requirement: ^9.2 | ^10.0
dependencies:
  - drupal:ckeditor5
</code>```

chars.ckeditor5.yml

```<code>chars_chars:
  ckeditor5:
    plugins:
      - chars.Chars
  drupal:
    label: Characters
    library: chars/chars
    elements: false
</code>```

chars.libraries.yml

```<code>chars:
  js:
    js/build/chars.js: { preprocess: false, minified: true }
  dependencies:
    - core/ckeditor5
</code>```

ckeditor5_plugins/chars/src/chars.js

```<code>import { Plugin } from 'ckeditor5/src/core';
import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters';

export default class Chars extends Plugin {
  init() {
    const editor = this.editor;
    editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji', [
      { title: 'smiley face', character: '' },
      { title: 'rocket', character: '' },
      { title: 'wind blowing face', character: '' },
      { title: 'floppy disk', character: '' },
      { title: 'heart', character: '❤' }
    ] );
  }

  static get pluginName() {
    return 'Chars';
  }

  static get requires() {
    return [SpecialCharacters];
  }
}
</code>```

This code was built by yarn run build and insert to js/build/folder. When CKEditor is loaded the console throws: CKEditorError: plugincollection-plugin-not-found {"plugin":null}

Body:
The CKEditor 5 documentation shows the easy way how to add special characters to CKEditor 5 (https://ckeditor.com/docs/ckeditor5/latest/features/special-characters.html):

import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters';
import SpecialCharactersEssentials from '@ckeditor/ckeditor5-special-characters/src/specialcharactersessentials';

function SpecialCharactersEmoji( editor ) {
    editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji', [
        { title: 'smiley face', character: '' },
        { title: 'rocket', character: '' },
        { title: 'wind blowing face', character: '' },
        { title: 'floppy disk', character: '' },
        { title: 'heart', character: '❤' }
    ] );
}

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        plugins: [
            SpecialCharacters, SpecialCharactersEssentials, SpecialCharactersEmoji,

            // Other plugins...
        ],
        toolbar: [ 'specialCharacters', ... ],
    } )
    .then( ... )
    .catch( ... );

But I have not found how to change it in Drupal 9. Does any special hook exist for it?

I have tried to create a new module based on starter template (https://git.drupalcode.org/project/ckeditor5_dev/-/tree/1.0.x/ckeditor5_plugin_starter_template):

chars.info.yml

name: Characters
type: module
description: "Provides CKEditor plugin."
package: CKEditor 5
core_version_requirement: ^9.2 | ^10.0
dependencies:
  - drupal:ckeditor5

chars.ckeditor5.yml

chars_chars:
  ckeditor5:
    plugins:
      - chars.Chars
  drupal:
    label: Characters
    library: chars/chars
    elements: false

chars.libraries.yml

chars:
  js:
    js/build/chars.js: { preprocess: false, minified: true }
  dependencies:
    - core/ckeditor5

ckeditor5_plugins/chars/src/chars.js

import { Plugin } from 'ckeditor5/src/core';
import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters';

export default class Chars extends Plugin {
  init() {
    const editor = this.editor;
    editor.plugins.get( 'SpecialCharacters' ).addItems( 'Emoji', [
      { title: 'smiley face', character: '' },
      { title: 'rocket', character: '' },
      { title: 'wind blowing face', character: '' },
      { title: 'floppy disk', character: '' },
      { title: 'heart', character: '❤' }
    ] );
  }

  static get pluginName() {
    return 'Chars';
  }

  static get requires() {
    return [SpecialCharacters];
  }
}

This code was built by yarn run build and insert to js/build/folder. When CKEditor is loaded the console throws: CKEditorError: plugincollection-plugin-not-found {"plugin":null}


问:
Dockerfile: Copy command on windows container fails with "Access Denied"
I am trying to run a web application implemented with php, js, html together with Selenium to test functionality. I am using a python script together with pytest to run the selenium tests against the web application. The web application is already dockerized with a windows/servercore:ltsc2019 base image and the xampp application. If the dockerfile is build for the first time it succeeds. But if some changes are done and the container has to be rebuilded i get the following error:

```<code>Status: failed to copy files: failed to copy directory: chtimes \\?\Volume{06ac6f98-32bd-4e73-b16b-f982f49c7bd6}\xampp\htdocs\img: Access denied
</code>```

on this Dockerfile step:

```<code>Step 2/7 : COPY . C:\\xampp\\htdocs
</code>```

I am using the already dockerized web application (including docker-compose) and an existing gitlab pipeline. After adding selenium and python services to docker-compose I found out that they are only available on linux containers so I switched the docker engine to experimental to make use of the mixed mode. And that was working just fine for my pc at work (I tested it there). But then I used the same docker-compose file on my home pc and I got the error from above. Also on the gitlab-runner that runs the pipeline the same error occured after modifying the pipeline slightly (Added point 2-4).

Run web application container

```<code>docker-compose -f ./docker/stage/docker-compose-staging.yml --compatibility up --build -d
</code>```

Switch daemon to linux container with powershell script

```<code>./docker-e2e-tests/SwitchDaemon.ps1
</code>```

Run the test containers (Selenium, python)

```<code>docker-compose -f ./docker-e2e-tests/docker-compose.yml --compatibility up --build -d
</code>```

Switch daemon back to windows container with powershell script

```<code>./docker-e2e-tests/SwitchDaemon.ps1
</code>```

Same result here. First time it was fine. Second time I tried to COPY the changes into the container (step 1) I got the same error as above. And now the worst problem is, that the pipeline is not running anymore at all. I am even getting the same error now if I remove step 2-4.

Body:
I am trying to run a web application implemented with php, js, html together with Selenium to test functionality. I am using a python script together with pytest to run the selenium tests against the web application. The web application is already dockerized with a windows/servercore:ltsc2019 base image and the xampp application. If the dockerfile is build for the first time it succeeds. But if some changes are done and the container has to be rebuilded i get the following error:

Status: failed to copy files: failed to copy directory: chtimes \\?\Volume{06ac6f98-32bd-4e73-b16b-f982f49c7bd6}\xampp\htdocs\img: Access denied

on this Dockerfile step:

Step 2/7 : COPY . C:\\xampp\\htdocs

I am using the already dockerized web application (including docker-compose) and an existing gitlab pipeline. After adding selenium and python services to docker-compose I found out that they are only available on linux containers so I switched the docker engine to experimental to make use of the mixed mode. And that was working just fine for my pc at work (I tested it there). But then I used the same docker-compose file on my home pc and I got the error from above. Also on the gitlab-runner that runs the pipeline the same error occured after modifying the pipeline slightly (Added point 2-4).

Run web application container

docker-compose -f ./docker/stage/docker-compose-staging.yml --compatibility up --build -d

Switch daemon to linux container with powershell script

./docker-e2e-tests/SwitchDaemon.ps1

Run the test containers (Selenium, python)

docker-compose -f ./docker-e2e-tests/docker-compose.yml --compatibility up --build -d

Switch daemon back to windows container with powershell script

./docker-e2e-tests/SwitchDaemon.ps1

Same result here. First time it was fine. Second time I tried to COPY the changes into the container (step 1) I got the same error as above. And now the worst problem is, that the pipeline is not running anymore at all. I am even getting the same error now if I remove step 2-4.


问:
How do I calculate weighted median instead of weighted mean for single-arm meta-analysis?
I am trying to calculate weighted median instead of weighted mean for meta-analysis.
I used to use metamean but unfortunately no metamedian if the data was skewed.
I saw this but it is irrelevant in case of meta-analysis.

Here is my prior code.

```<code>library(meta)
data(Fleiss1993cont)
# Meta-analysis of weighted mean from each study in a single arm meta-analysis
m1 <- metamean(n.psyc, mean.psyc, sd.psyc,   data = Fleiss1993cont, studlab = study); forest(m1)
</code>```

Body:
I am trying to calculate weighted median instead of weighted mean for meta-analysis.
I used to use metamean but unfortunately no metamedian if the data was skewed.
I saw this but it is irrelevant in case of meta-analysis.

Here is my prior code.

library(meta)
data(Fleiss1993cont)
# Meta-analysis of weighted mean from each study in a single arm meta-analysis
m1 <- metamean(n.psyc, mean.psyc, sd.psyc,   data = Fleiss1993cont, studlab = study); forest(m1)


问:
How do I convert a Windows UNC path to a mapped drive letter path with Python?
I've seen the reverse of this question asked a lot but can't find info on this one.

A set of subprocesses I'm running in a script want Windows drive-letter paths (M:\Some\Path\file.txt instead of \\my.subnet\someplace\Some\Path\file.txt), but the UNC path is presented as an earlier input (which I don't have control over).

I am familiar with the pathlib.Path.drive function, which gives me \\my.subnet\subnet, but how would I get from that to the drive letter?


问:
How to Fix CA2100: SQL security vulnerability In Legacy code when SQL query is coming to function from outside of it?
While working on legacy code, I ran into Specific scenario and made a dummy example to show the issue to ask for any suggestions. I get following error:
`

```<code>Program.cs(37,1) : warning  : CA2100 : Microsoft.Security : The query string passed to 'OleDbCommand.CommandText.set(string)' in 'Program.Read(OleDbConnection, string)' could contain the following variables 'sqlQuery'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.
</code>```

My Code is:

```<code>    class Program
        {
        static void Main ()
            {
            string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Newfolder\database1.mdb";

            using (OleDbConnection connection = new OleDbConnection(connectionString))
                {
                try
                    {
                    connection.Open();
                    string strsql = "SELECT * FROM Table1";
                    Read(connection,strsql);
                    }
                catch(Exception ex)
                    {
                    Console.WriteLine(ex.Message);
                    }
                }
            }

        static void Read (OleDbConnection connection,string sqlQuery)
            {
            OleDbCommand command = new OleDbCommand();
            command.Connection = connection;
            command.CommandText = sqlQuery;

            OleDbDataReader reader = command.ExecuteReader();

            while (reader.Read())
                {
                Console.WriteLine(reader["PName"]);
                }
            }
        }
</code>```

Now I cannot go with the solution to suppress warning. There are several complicated situations from which i get these warnings, this is just a dummy simple example to show workflow.
So although the query being executed is safe, but since it comes outside of the function, it asks me to changed it to parametrized query.
As in Read() function, although my input paramter sqlQuery is not from user, but it will come from outside as an input parameter and I cannot move sqlQuery code within the Read() function, it will always come from outside based on which certain decisions are made.
So what can I do to make this redundant warning disapper?

My dummy Access databse snapshot is this:

I have tried going through Microsoft official documentation on it, but i was not able to come up with solution

Body:
While working on legacy code, I ran into Specific scenario and made a dummy example to show the issue to ask for any suggestions. I get following error:
`

Program.cs(37,1) : warning  : CA2100 : Microsoft.Security : The query string passed to 'OleDbCommand.CommandText.set(string)' in 'Program.Read(OleDbConnection, string)' could contain the following variables 'sqlQuery'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.

My Code is:

    class Program
        {
        static void Main ()
            {
            string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Newfolder\database1.mdb";

            using (OleDbConnection connection = new OleDbConnection(connectionString))
                {
                try
                    {
                    connection.Open();
                    string strsql = "SELECT * FROM Table1";
                    Read(connection,strsql);
                    }
                catch(Exception ex)
                    {
                    Console.WriteLine(ex.Message);
                    }
                }
            }

        static void Read (OleDbConnection connection,string sqlQuery)
            {
            OleDbCommand command = new OleDbCommand();
            command.Connection = connection;
            command.CommandText = sqlQuery;

            OleDbDataReader reader = command.ExecuteReader();

            while (reader.Read())
                {
                Console.WriteLine(reader["PName"]);
                }
            }
        }

Now I cannot go with the solution to suppress warning. There are several complicated situations from which i get these warnings, this is just a dummy simple example to show workflow.
So although the query being executed is safe, but since it comes outside of the function, it asks me to changed it to parametrized query.
As in Read() function, although my input paramter sqlQuery is not from user, but it will come from outside as an input parameter and I cannot move sqlQuery code within the Read() function, it will always come from outside based on which certain decisions are made.
So what can I do to make this redundant warning disapper?

My dummy Access databse snapshot is this:

I have tried going through Microsoft official documentation on it, but i was not able to come up with solution


问:
How to add attributes with dynamic values on Grid.js?
I need to add dynamics(conditionals) values to an attribute on GridJs table, but i haven't found a way to do it on render time.

I have a column named "Type" and, for a distinct "Type" i have to fill the background color.
Suppose I have 3 types: INFO(blue), WARNING(yellow), ERROR(red).

I've been trying to do it with formatter: property, but it only paints the nested html element.

The goal is to paint the whole cell, not only the background div.

My JS code:

```<code>var eventGrid = new gridjs.Grid({
        columns: [
            { name: "ID", width: '2%' },
            { name: "DateTimeString", width: '11%' },
            { name: "Username", width: '8%' },
            { name: "Professional ID", width: '2%' },
            { name: "Bio ID", width: '2%' },
            { name: "Type", width: '8%', attributes: {'data-field' : 'HERE THE DYNAMIC ATTRIBUTE VALUE'} formatter: (cell, row, attributes) => setCellColor(cell, row, attributes) },
            { name: "Navigation Type", width: '8%' },
            { name: "Message", width: '8%' },
            { name: "Exception Message" }],
        server: {
            url: '/EventsLogs/Details',
            then: data => data.map(event => [
                event.eventLogId,
                event.eventLogDateTimeString,
                event.username,
                event.professionalId,
                event.bioId,
                event.eventLogTypeName,
                event.navigationTypeName,
                event.message,
                event.exceptionMessage])
        }
    }).render(document.getElementById("eventsLogs-table"));
</code>```

And the formatter function does the following:

```<code>function setCellColor(cell, row, att){
        switch(cell) {
            case 'INFO':
                    cell = `<div style='background-color: #3393FF; width:100%; color:white;'>${cell}</div>`;
            break;
            case 'WARNING':
                    cell = `<div style='background-color: #FFCE33; color:white;'>${cell}</div>`;
            break;
            case 'ERROR':
                    cell = `<div style='background-color: #FC1235; color:white;'>${cell}</div>`;
            break;
        }
        return gridjs.html(cell);
    }
</code>```

Result:

As you can see everything is working fine but not as expected.
The expected result is to paint the whole cell.

Inspecting the HTML there is a span element as parent and then the td element. That's why I'm trying as a workaround a do it by an attribute.

Thanks!

Body:
I need to add dynamics(conditionals) values to an attribute on GridJs table, but i haven't found a way to do it on render time.

I have a column named "Type" and, for a distinct "Type" i have to fill the background color.
Suppose I have 3 types: INFO(blue), WARNING(yellow), ERROR(red).

I've been trying to do it with formatter: property, but it only paints the nested html element.

The goal is to paint the whole cell, not only the background div.

My JS code:

var eventGrid = new gridjs.Grid({
        columns: [
            { name: "ID", width: '2%' },
            { name: "DateTimeString", width: '11%' },
            { name: "Username", width: '8%' },
            { name: "Professional ID", width: '2%' },
            { name: "Bio ID", width: '2%' },
            { name: "Type", width: '8%', attributes: {'data-field' : 'HERE THE DYNAMIC ATTRIBUTE VALUE'} formatter: (cell, row, attributes) => setCellColor(cell, row, attributes) },
            { name: "Navigation Type", width: '8%' },
            { name: "Message", width: '8%' },
            { name: "Exception Message" }],
        server: {
            url: '/EventsLogs/Details',
            then: data => data.map(event => [
                event.eventLogId,
                event.eventLogDateTimeString,
                event.username,
                event.professionalId,
                event.bioId,
                event.eventLogTypeName,
                event.navigationTypeName,
                event.message,
                event.exceptionMessage])
        }
    }).render(document.getElementById("eventsLogs-table"));

And the formatter function does the following:

function setCellColor(cell, row, att){
        switch(cell) {
            case 'INFO':
                    cell = `<div style='background-color: #3393FF; width:100%; color:white;'>${cell}</div>`;
            break;
            case 'WARNING':
                    cell = `<div style='background-color: #FFCE33; color:white;'>${cell}</div>`;
            break;
            case 'ERROR':
                    cell = `<div style='background-color: #FC1235; color:white;'>${cell}</div>`;
            break;
        }
        return gridjs.html(cell);
    }

Result:

As you can see everything is working fine but not as expected.
The expected result is to paint the whole cell.

Inspecting the HTML there is a span element as parent and then the td element. That's why I'm trying as a workaround a do it by an attribute.

Thanks!


问:
ORA-00979: not a GROUP BY expression | CriteriaQuery Group By only works when certain column is present
The 'group By' only works when psuDetailRoot.get(CREATION_TM) is there (which should NOT be the case). I can add more columns to the query and it works.

CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<Tuple> query = cb.createQuery(Tuple.class);
Root<PsuDetail> psuDetailRoot = query.from(PsuDetail.class);

query.multiselect(psuDetailRoot.get(PSU_TYPE_TXT),
                        psuDetailRoot.get(CREATION_TIME),
                        cb.function("trunc", String.class, psuDetailRoot.get(CREATION_TIME)),
                        cb.function("to_char", String.class, psuDetailRoot.get(CREATION_TIME),                        cb.literal("Dy")),
                        cb.count(psuDetailRoot.get(PSU_TYPE_TXT)))

                .where(cb.between(psuDetailRoot.get(CREATION_TIME), requestReportDto.getFromDate().toLocalDateTime(),
                        requestReportDto.getTillDate().toLocalDateTime()))

                .groupBy(cb.function("trunc", String.class, psuDetailRoot.get(CREATION_TIME)),
                        cb.function("to_char", String.class, psuDetailRoot.get(CREATION_TIME), cb.literal("Dy")),
                        psuDetailRoot.get(PSU_TYPE_TXT),
                        psuDetailRoot.get(CREATION_TIME));
```
<p>Query from console:</p>
<pre class="lang-sql prettyprint-override"><code>select
        psudetail0_.psu_type_txt as col_0_0_,
        psudetail0_.creation_tm as col_1_0_,
        trunc(psudetail0_.creation_tm) as col_2_0_,
        to_char(psudetail0_.creation_tm,
        ?) as col_3_0_,
        count(psudetail0_.psu_type_txt) as col_4_0_
    from
        psu_detail psudetail0_
    where
        psudetail0_.creation_tm between ? and ?
    group by
        trunc(psudetail0_.creation_tm) ,
        to_char(psudetail0_.creation_tm,
        ?) ,
        psudetail0_.psu_type_txt ,
        psudetail0_.creation_tm
</code>```

If I remove psuDetailRoot.get(CREATION_TM), it no longer works. Says 'ORA-00979: not a GROUP BY expression'.

query.multiselect(psuDetailRoot.get(PSU_TYPE_TXT),
                        cb.function("trunc", String.class, psuDetailRoot.get(CREATION_TIME)),
                        cb.function("to_char", String.class, psuDetailRoot.get(CREATION_TIME), cb.literal("Dy")),
                        cb.count(psuDetailRoot.get(PSU_TYPE_TXT)))

                .where(cb.between(psuDetailRoot.get(CREATION_TIME), requestReportDto.getFromDate().toLocalDateTime(),
                        requestReportDto.getTillDate().toLocalDateTime()))

                .groupBy(cb.function("trunc", String.class, psuDetailRoot.get(CREATION_TIME)),
                        cb.function("to_char", String.class, psuDetailRoot.get(CREATION_TIME), cb.literal("Dy")),
                        psuDetailRoot.get(PSU_TYPE_TXT));
```
<p>Query from console:</p>
<pre class="lang-sql prettyprint-override"><code>select
        psudetail0_.psu_type_txt as col_0_0_,
        trunc(psudetail0_.creation_tm) as col_1_0_,
        to_char(psudetail0_.creation_tm,
        ?) as col_2_0_,
        count(psudetail0_.psu_type_txt) as col_3_0_
    from
        psu_detail psudetail0_
    where
        psudetail0_.creation_tm between ? and ?
    group by
        trunc(psudetail0_.creation_tm) ,
        to_char(psudetail0_.creation_tm,
        ?) ,
        psudetail0_.psu_type_txt
</code>```

Below is the field declaration along with actual entity

@Column(name = "CREATION_TM")
  private LocalDateTime creationTm;
```
```import java.time.LocalDateTime;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fedex.vips.psu.constants.PSUStatuses;
import com.fedex.vips.psu.dtos.PsuDto;
import lombok.Getter;
import lombok.Setter;

@Entity
@Table(name = "PSU_DETAIL")
@Getter
@Setter
public class PsuDetail {

  @Id
  @SequenceGenerator(sequenceName = "PSU_DETAIL_SEQ", name = "psuDetailSeq", allocationSize = 1)
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "psuDetailSeq")
  @Column(name = "PSU_ID")
  private Integer psuId;

  @Column(name = "VERSION_NBR")
  private Integer versionNbr;

  @Column(name = "PILOT_ID")
  private String pilotId;

  @Column(name = "PILOT_NM")
  private String pilotNm;

  @Column(name = "PSU_TYPE_TXT")
  private String psuTypeTxt;

  @Column(name = "PSU_STATUS_TXT")
  private String psuStatusTxt;

  @Column(name = "NEW_BID_STATUS_TXT")
  private String newBidStatusTxt;

  @Column(name = "PREFACE_TXT")
  private String prefaceTxt;

  @Column(name = "EFFECTIVE_START_DT")
  private LocalDateTime effectiveStartDt;

  @Column(name = "EFFECTIVE_END_DT")
  private LocalDateTime effectiveEndDt;

  @Column(name = "JURY_UPDATE_FLG")
  private Integer juryUpdateFlg;

  @Column(name = "JURY_REMOVE_FLG")
  private Integer juryRemoveFlg;

  @Lob
  @Column(name = "CC_EMAIL_ID_TXT", columnDefinition = "CLOB")
  private String ccEmailIdTxt;

  @Column(name = "COMMENT_TXT")
  private String commentTxt;

  @Lob
  @Column(name = "METADATA_DESC", columnDefinition = "CLOB")
  private String metadataDesc;

  @Column(name = "CREATOR_ID")
  private String creatorId;

  @Column(name = "CREATION_TM")
  private LocalDateTime creationTm;

  @Column(name = "CREATOR_NM")
  private String creatorNm;

  @Column(name = "CREATOR_DEPT_NM")
  private String creatorDeptNm;

  @Column(name = "MODIFIER_ID")
  private String modifierId;

  @Column(name = "MODIFIED_TM")
  private LocalDateTime modifiedTm;

  @Column(name = "MODIFIER_NM")
  private String modifierNm;

  @Column(name = "LST_REC_CD")
  private String lstRecCd;

  @Column(name = "LST_NO_TYPE_CD")
  private String lstNoTypeCd;

  @Column(name = "SPCL_STAT_CD")
  private String spclStatCd;

  @Column(name = "FOCUS_REF_ID")
  private String focusRefId;

  @Column(name = "CUR_BASE_TXT")
  private String curBaseTxt;

  @Column(name = "CUR_EQUIPMENT_TXT")
  private String curEquipmentTxt;

  @Column(name = "CUR_SEAT_TXT")
  private String curseatTxt;

  @Column(name = "CUR_CLS_TXT")
  private String curClsTxt;

  @Column(name = "CUR_SEC_TXT")
  private String curSecTxt;

  @Column(name = "CUR_AWARD_TYPE_TXT")
  private String curAwardTypeTxt;

  @Column(name = "CUR_REMARKS_TXT")
  private String curRemarksTxt;

  @Column(name = "CUR_BID_MONTH_TXT")
  private String curBidMonthTxt;

  @Column(name = "NEW_BASE_TXT")
  private String newBaseTxt;

  @Column(name = "NEW_EQUIPMENT_TXT")
  private String newEquipmentTxt;

  @Column(name = "NEW_SEAT_TXT")
  private String newSeatTxt;

  @Column(name = "NEW_CLS_TXT")
  private String newClsTxt;

  @Column(name = "NEW_SEC_TXT")
  private String newSecTxt;

  @Column(name = "NEW_AWARD_TYPE_TXT")
  private String newAwardTypeTxt;

  @Column(name = "NEW_REMARKS_TXT")
  private String newRemarksTxt;

  @Column(name = "NEW_BID_MONTH_TXT")
  private String newBidMonthTxt;

  // add 16 columns in psudetail and psudetailhist
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "psuDetail")
  @JsonIgnoreProperties(value = {"psuDetail"})
  private List<PsuConflictActivities> psuConflictActivitiesList;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "psuDetail")
  @JsonIgnoreProperties(value = {"psuDetail"})
  private List<PsuCrewPositionStatus> psuCrewPositionStatusList;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "psuDetail")
  @JsonIgnoreProperties(value = {"psuDetail"})
  private List<PsuDetailHist> psuDetailHistList;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "psuDetail")
  @JsonIgnoreProperties(value = {"psuDetail"})
  private List<PsuNewHire> psuNewHireList;

  @ManyToMany(fetch = FetchType.LAZY)
  @JoinTable(
      name = "PSU_NOTIFY_LIST",
      joinColumns = @JoinColumn(name = "PSU_ID", updatable = false, insertable = false),
      inverseJoinColumns = @JoinColumn(name = "DEPT_ID", updatable = false, insertable = false))
  private List<PsuDeptDetail> psuNotifyDeptDetailList;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(
      name = "PSU_TYPE_TXT",
      referencedColumnName = "PSU_TYPE_TXT",
      updatable = false,
      insertable = false)
  @JsonIgnoreProperties(value = {"psuDetailList"})
  private PsuTypes psuTypes;

  public PsuDetail() {}

  public PsuDetail(PsuDto psuDto) {
    this.psuId = psuDto.getPsuId();
    this.versionNbr = 1;
    this.pilotId = psuDto.getPilotId();
    this.pilotNm = psuDto.getPilotNm();
    this.psuTypeTxt = psuDto.getPsuTypeTxt();
    this.psuStatusTxt = PSUStatuses.OPEN;
    this.newBidStatusTxt = psuDto.getNewBidStatusTxt();
    this.prefaceTxt = psuDto.getPrefaceTxt();
    this.effectiveStartDt = psuDto.getEffectiveStartDt();
    this.effectiveEndDt = psuDto.getEffectiveEndDt();
    this.juryUpdateFlg = psuDto.getJuryUpdateFlg();
    this.juryRemoveFlg = psuDto.getJuryRemoveFlg();
    this.ccEmailIdTxt = psuDto.getCcEmailIdTxt();
    this.commentTxt = psuDto.getCommentTxt();
    this.metadataDesc = psuDto.getMetadataDesc();
    this.creatorId = psuDto.getCreatorId();
    this.creatorNm = psuDto.getCreatorNm();
    this.creatorDeptNm = psuDto.getCreatorDeptNm();
    this.modifierId = psuDto.getModifierId();
    this.modifierNm = psuDto.getModifierNm();
    this.focusRefId = psuDto.getFocusRefId();
    this.lstRecCd = psuDto.getLstRecCd();
    this.lstNoTypeCd = psuDto.getLstNoTypeCd();
    this.spclStatCd = psuDto.getSpclStatCd();
    this.curBaseTxt = psuDto.getCurBaseTxt();
    this.curEquipmentTxt = psuDto.getCurEquipmentTxt();
    this.curseatTxt = psuDto.getCurseatTxt();
    this.curClsTxt = psuDto.getCurClsTxt();
    this.curSecTxt = psuDto.getCurSecTxt();
    this.curAwardTypeTxt = psuDto.getCurAwardTypeTxt();
    this.curRemarksTxt = psuDto.getCurRemarksTxt();
    this.curBidMonthTxt = psuDto.getCurBidMonthTxt();
    this.newBaseTxt = psuDto.getNewBaseTxt();
    this.newEquipmentTxt = psuDto.getNewEquipmentTxt();
    this.newSeatTxt = psuDto.getNewSeatTxt();
    this.newClsTxt = psuDto.getNewClsTxt();
    this.newSecTxt = psuDto.getNewSecTxt();
    this.newAwardTypeTxt = psuDto.getNewAwardTypeTxt();
    this.newRemarksTxt = psuDto.getNewRemarksTxt();
    this.newBidMonthTxt = psuDto.getNewBidMonthTxt();
  }

  public void shallowCopyPsuDetails(PsuDto psuDto) {
    this.pilotId = psuDto.getPilotId();
    this.pilotNm = psuDto.getPilotNm();
    this.psuTypeTxt = psuDto.getPsuTypeTxt();
    this.psuStatusTxt = PSUStatuses.OPEN;
    this.newBidStatusTxt = psuDto.getNewBidStatusTxt();
    this.prefaceTxt = psuDto.getPrefaceTxt();
    this.effectiveStartDt = psuDto.getEffectiveStartDt();
    this.effectiveEndDt = psuDto.getEffectiveEndDt();
    this.juryUpdateFlg = psuDto.getJuryUpdateFlg();
    this.juryRemoveFlg = psuDto.getJuryRemoveFlg();
    this.ccEmailIdTxt = psuDto.getCcEmailIdTxt();
    this.commentTxt = psuDto.getCommentTxt();
    this.metadataDesc = psuDto.getMetadataDesc();
    this.modifierId = psuDto.getModifierId();
    this.modifierNm = psuDto.getModifierNm();
    this.focusRefId = psuDto.getFocusRefId();
    this.lstRecCd = psuDto.getLstRecCd();
    this.lstNoTypeCd = psuDto.getLstNoTypeCd();
    this.spclStatCd = psuDto.getSpclStatCd();
    this.curBaseTxt = psuDto.getCurBaseTxt();
    this.curEquipmentTxt = psuDto.getCurEquipmentTxt();
    this.curseatTxt = psuDto.getCurseatTxt();
    this.curClsTxt = psuDto.getCurClsTxt();
    this.curSecTxt = psuDto.getCurSecTxt();
    this.curAwardTypeTxt = psuDto.getCurAwardTypeTxt();
    this.curRemarksTxt = psuDto.getCurRemarksTxt();
    this.curBidMonthTxt = psuDto.getCurBidMonthTxt();
    this.newBaseTxt = psuDto.getNewBaseTxt();
    this.newEquipmentTxt = psuDto.getNewEquipmentTxt();
    this.newSeatTxt = psuDto.getNewSeatTxt();
    this.newClsTxt = psuDto.getNewClsTxt();
    this.newSecTxt = psuDto.getNewSecTxt();
    this.newAwardTypeTxt = psuDto.getNewAwardTypeTxt();
    this.newRemarksTxt = psuDto.getNewRemarksTxt();
    this.newBidMonthTxt = psuDto.getNewBidMonthTxt();
  }

}
```
<p>I thought maybe the following line</p>
```.where(cb.between(psuDetailRoot.get(CREATION_TIME), requestReportDto.getFromDate().toLocalDateTime(),
        requestReportDto.getTillDate().toLocalDateTime()))
```

was returning rows with CREATION_TM in timestamp format as it's a timestamp field in DB (Oracle) so that might be interfering with the group by where in I am grouping on truncated version of it i.e. only on the date part.

So, I tested this as well but it doesn't help. The behavior remains the same.

I spent the entire day googling this but I couldn't figure out the cause for this behavior. Hence, posting this here to seek help.

Thanks.

Body:
The 'group By' only works when psuDetailRoot.get(CREATION_TM) is there (which should NOT be the case). I can add more columns to the query and it works.

CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<Tuple> query = cb.createQuery(Tuple.class);
Root<PsuDetail> psuDetailRoot = query.from(PsuDetail.class);

query.multiselect(psuDetailRoot.get(PSU_TYPE_TXT),
                        psuDetailRoot.get(CREATION_TIME),
                        cb.function("trunc", String.class, psuDetailRoot.get(CREATION_TIME)),
                        cb.function("to_char", String.class, psuDetailRoot.get(CREATION_TIME),                        cb.literal("Dy")),
                        cb.count(psuDetailRoot.get(PSU_TYPE_TXT)))

                .where(cb.between(psuDetailRoot.get(CREATION_TIME), requestReportDto.getFromDate().toLocalDateTime(),
                        requestReportDto.getTillDate().toLocalDateTime()))

                .groupBy(cb.function("trunc", String.class, psuDetailRoot.get(CREATION_TIME)),
                        cb.function("to_char", String.class, psuDetailRoot.get(CREATION_TIME), cb.literal("Dy")),
                        psuDetailRoot.get(PSU_TYPE_TXT),
                        psuDetailRoot.get(CREATION_TIME));

Query from console:

select
        psudetail0_.psu_type_txt as col_0_0_,
        psudetail0_.creation_tm as col_1_0_,
        trunc(psudetail0_.creation_tm) as col_2_0_,
        to_char(psudetail0_.creation_tm,
        ?) as col_3_0_,
        count(psudetail0_.psu_type_txt) as col_4_0_
    from
        psu_detail psudetail0_
    where
        psudetail0_.creation_tm between ? and ?
    group by
        trunc(psudetail0_.creation_tm) ,
        to_char(psudetail0_.creation_tm,
        ?) ,
        psudetail0_.psu_type_txt ,
        psudetail0_.creation_tm

If I remove psuDetailRoot.get(CREATION_TM), it no longer works. Says 'ORA-00979: not a GROUP BY expression'.

query.multiselect(psuDetailRoot.get(PSU_TYPE_TXT),
                        cb.function("trunc", String.class, psuDetailRoot.get(CREATION_TIME)),
                        cb.function("to_char", String.class, psuDetailRoot.get(CREATION_TIME), cb.literal("Dy")),
                        cb.count(psuDetailRoot.get(PSU_TYPE_TXT)))

                .where(cb.between(psuDetailRoot.get(CREATION_TIME), requestReportDto.getFromDate().toLocalDateTime(),
                        requestReportDto.getTillDate().toLocalDateTime()))

                .groupBy(cb.function("trunc", String.class, psuDetailRoot.get(CREATION_TIME)),
                        cb.function("to_char", String.class, psuDetailRoot.get(CREATION_TIME), cb.literal("Dy")),
                        psuDetailRoot.get(PSU_TYPE_TXT));

Query from console:

select
        psudetail0_.psu_type_txt as col_0_0_,
        trunc(psudetail0_.creation_tm) as col_1_0_,
        to_char(psudetail0_.creation_tm,
        ?) as col_2_0_,
        count(psudetail0_.psu_type_txt) as col_3_0_
    from
        psu_detail psudetail0_
    where
        psudetail0_.creation_tm between ? and ?
    group by
        trunc(psudetail0_.creation_tm) ,
        to_char(psudetail0_.creation_tm,
        ?) ,
        psudetail0_.psu_type_txt

Below is the field declaration along with actual entity

@Column(name = "CREATION_TM")
  private LocalDateTime creationTm;

import java.time.LocalDateTime;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fedex.vips.psu.constants.PSUStatuses;
import com.fedex.vips.psu.dtos.PsuDto;
import lombok.Getter;
import lombok.Setter;

@Entity
@Table(name = "PSU_DETAIL")
@Getter
@Setter
public class PsuDetail {

  @Id
  @SequenceGenerator(sequenceName = "PSU_DETAIL_SEQ", name = "psuDetailSeq", allocationSize = 1)
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "psuDetailSeq")
  @Column(name = "PSU_ID")
  private Integer psuId;

  @Column(name = "VERSION_NBR")
  private Integer versionNbr;

  @Column(name = "PILOT_ID")
  private String pilotId;

  @Column(name = "PILOT_NM")
  private String pilotNm;

  @Column(name = "PSU_TYPE_TXT")
  private String psuTypeTxt;

  @Column(name = "PSU_STATUS_TXT")
  private String psuStatusTxt;

  @Column(name = "NEW_BID_STATUS_TXT")
  private String newBidStatusTxt;

  @Column(name = "PREFACE_TXT")
  private String prefaceTxt;

  @Column(name = "EFFECTIVE_START_DT")
  private LocalDateTime effectiveStartDt;

  @Column(name = "EFFECTIVE_END_DT")
  private LocalDateTime effectiveEndDt;

  @Column(name = "JURY_UPDATE_FLG")
  private Integer juryUpdateFlg;

  @Column(name = "JURY_REMOVE_FLG")
  private Integer juryRemoveFlg;

  @Lob
  @Column(name = "CC_EMAIL_ID_TXT", columnDefinition = "CLOB")
  private String ccEmailIdTxt;

  @Column(name = "COMMENT_TXT")
  private String commentTxt;

  @Lob
  @Column(name = "METADATA_DESC", columnDefinition = "CLOB")
  private String metadataDesc;

  @Column(name = "CREATOR_ID")
  private String creatorId;

  @Column(name = "CREATION_TM")
  private LocalDateTime creationTm;

  @Column(name = "CREATOR_NM")
  private String creatorNm;

  @Column(name = "CREATOR_DEPT_NM")
  private String creatorDeptNm;

  @Column(name = "MODIFIER_ID")
  private String modifierId;

  @Column(name = "MODIFIED_TM")
  private LocalDateTime modifiedTm;

  @Column(name = "MODIFIER_NM")
  private String modifierNm;

  @Column(name = "LST_REC_CD")
  private String lstRecCd;

  @Column(name = "LST_NO_TYPE_CD")
  private String lstNoTypeCd;

  @Column(name = "SPCL_STAT_CD")
  private String spclStatCd;

  @Column(name = "FOCUS_REF_ID")
  private String focusRefId;

  @Column(name = "CUR_BASE_TXT")
  private String curBaseTxt;

  @Column(name = "CUR_EQUIPMENT_TXT")
  private String curEquipmentTxt;

  @Column(name = "CUR_SEAT_TXT")
  private String curseatTxt;

  @Column(name = "CUR_CLS_TXT")
  private String curClsTxt;

  @Column(name = "CUR_SEC_TXT")
  private String curSecTxt;

  @Column(name = "CUR_AWARD_TYPE_TXT")
  private String curAwardTypeTxt;

  @Column(name = "CUR_REMARKS_TXT")
  private String curRemarksTxt;

  @Column(name = "CUR_BID_MONTH_TXT")
  private String curBidMonthTxt;

  @Column(name = "NEW_BASE_TXT")
  private String newBaseTxt;

  @Column(name = "NEW_EQUIPMENT_TXT")
  private String newEquipmentTxt;

  @Column(name = "NEW_SEAT_TXT")
  private String newSeatTxt;

  @Column(name = "NEW_CLS_TXT")
  private String newClsTxt;

  @Column(name = "NEW_SEC_TXT")
  private String newSecTxt;

  @Column(name = "NEW_AWARD_TYPE_TXT")
  private String newAwardTypeTxt;

  @Column(name = "NEW_REMARKS_TXT")
  private String newRemarksTxt;

  @Column(name = "NEW_BID_MONTH_TXT")
  private String newBidMonthTxt;

  // add 16 columns in psudetail and psudetailhist
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "psuDetail")
  @JsonIgnoreProperties(value = {"psuDetail"})
  private List<PsuConflictActivities> psuConflictActivitiesList;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "psuDetail")
  @JsonIgnoreProperties(value = {"psuDetail"})
  private List<PsuCrewPositionStatus> psuCrewPositionStatusList;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "psuDetail")
  @JsonIgnoreProperties(value = {"psuDetail"})
  private List<PsuDetailHist> psuDetailHistList;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "psuDetail")
  @JsonIgnoreProperties(value = {"psuDetail"})
  private List<PsuNewHire> psuNewHireList;

  @ManyToMany(fetch = FetchType.LAZY)
  @JoinTable(
      name = "PSU_NOTIFY_LIST",
      joinColumns = @JoinColumn(name = "PSU_ID", updatable = false, insertable = false),
      inverseJoinColumns = @JoinColumn(name = "DEPT_ID", updatable = false, insertable = false))
  private List<PsuDeptDetail> psuNotifyDeptDetailList;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(
      name = "PSU_TYPE_TXT",
      referencedColumnName = "PSU_TYPE_TXT",
      updatable = false,
      insertable = false)
  @JsonIgnoreProperties(value = {"psuDetailList"})
  private PsuTypes psuTypes;

  public PsuDetail() {}

  public PsuDetail(PsuDto psuDto) {
    this.psuId = psuDto.getPsuId();
    this.versionNbr = 1;
    this.pilotId = psuDto.getPilotId();
    this.pilotNm = psuDto.getPilotNm();
    this.psuTypeTxt = psuDto.getPsuTypeTxt();
    this.psuStatusTxt = PSUStatuses.OPEN;
    this.newBidStatusTxt = psuDto.getNewBidStatusTxt();
    this.prefaceTxt = psuDto.getPrefaceTxt();
    this.effectiveStartDt = psuDto.getEffectiveStartDt();
    this.effectiveEndDt = psuDto.getEffectiveEndDt();
    this.juryUpdateFlg = psuDto.getJuryUpdateFlg();
    this.juryRemoveFlg = psuDto.getJuryRemoveFlg();
    this.ccEmailIdTxt = psuDto.getCcEmailIdTxt();
    this.commentTxt = psuDto.getCommentTxt();
    this.metadataDesc = psuDto.getMetadataDesc();
    this.creatorId = psuDto.getCreatorId();
    this.creatorNm = psuDto.getCreatorNm();
    this.creatorDeptNm = psuDto.getCreatorDeptNm();
    this.modifierId = psuDto.getModifierId();
    this.modifierNm = psuDto.getModifierNm();
    this.focusRefId = psuDto.getFocusRefId();
    this.lstRecCd = psuDto.getLstRecCd();
    this.lstNoTypeCd = psuDto.getLstNoTypeCd();
    this.spclStatCd = psuDto.getSpclStatCd();
    this.curBaseTxt = psuDto.getCurBaseTxt();
    this.curEquipmentTxt = psuDto.getCurEquipmentTxt();
    this.curseatTxt = psuDto.getCurseatTxt();
    this.curClsTxt = psuDto.getCurClsTxt();
    this.curSecTxt = psuDto.getCurSecTxt();
    this.curAwardTypeTxt = psuDto.getCurAwardTypeTxt();
    this.curRemarksTxt = psuDto.getCurRemarksTxt();
    this.curBidMonthTxt = psuDto.getCurBidMonthTxt();
    this.newBaseTxt = psuDto.getNewBaseTxt();
    this.newEquipmentTxt = psuDto.getNewEquipmentTxt();
    this.newSeatTxt = psuDto.getNewSeatTxt();
    this.newClsTxt = psuDto.getNewClsTxt();
    this.newSecTxt = psuDto.getNewSecTxt();
    this.newAwardTypeTxt = psuDto.getNewAwardTypeTxt();
    this.newRemarksTxt = psuDto.getNewRemarksTxt();
    this.newBidMonthTxt = psuDto.getNewBidMonthTxt();
  }

  public void shallowCopyPsuDetails(PsuDto psuDto) {
    this.pilotId = psuDto.getPilotId();
    this.pilotNm = psuDto.getPilotNm();
    this.psuTypeTxt = psuDto.getPsuTypeTxt();
    this.psuStatusTxt = PSUStatuses.OPEN;
    this.newBidStatusTxt = psuDto.getNewBidStatusTxt();
    this.prefaceTxt = psuDto.getPrefaceTxt();
    this.effectiveStartDt = psuDto.getEffectiveStartDt();
    this.effectiveEndDt = psuDto.getEffectiveEndDt();
    this.juryUpdateFlg = psuDto.getJuryUpdateFlg();
    this.juryRemoveFlg = psuDto.getJuryRemoveFlg();
    this.ccEmailIdTxt = psuDto.getCcEmailIdTxt();
    this.commentTxt = psuDto.getCommentTxt();
    this.metadataDesc = psuDto.getMetadataDesc();
    this.modifierId = psuDto.getModifierId();
    this.modifierNm = psuDto.getModifierNm();
    this.focusRefId = psuDto.getFocusRefId();
    this.lstRecCd = psuDto.getLstRecCd();
    this.lstNoTypeCd = psuDto.getLstNoTypeCd();
    this.spclStatCd = psuDto.getSpclStatCd();
    this.curBaseTxt = psuDto.getCurBaseTxt();
    this.curEquipmentTxt = psuDto.getCurEquipmentTxt();
    this.curseatTxt = psuDto.getCurseatTxt();
    this.curClsTxt = psuDto.getCurClsTxt();
    this.curSecTxt = psuDto.getCurSecTxt();
    this.curAwardTypeTxt = psuDto.getCurAwardTypeTxt();
    this.curRemarksTxt = psuDto.getCurRemarksTxt();
    this.curBidMonthTxt = psuDto.getCurBidMonthTxt();
    this.newBaseTxt = psuDto.getNewBaseTxt();
    this.newEquipmentTxt = psuDto.getNewEquipmentTxt();
    this.newSeatTxt = psuDto.getNewSeatTxt();
    this.newClsTxt = psuDto.getNewClsTxt();
    this.newSecTxt = psuDto.getNewSecTxt();
    this.newAwardTypeTxt = psuDto.getNewAwardTypeTxt();
    this.newRemarksTxt = psuDto.getNewRemarksTxt();
    this.newBidMonthTxt = psuDto.getNewBidMonthTxt();
  }

}

I thought maybe the following line

.where(cb.between(psuDetailRoot.get(CREATION_TIME), requestReportDto.getFromDate().toLocalDateTime(),
        requestReportDto.getTillDate().toLocalDateTime()))

was returning rows with CREATION_TM in timestamp format as it's a timestamp field in DB (Oracle) so that might be interfering with the group by where in I am grouping on truncated version of it i.e. only on the date part.

So, I tested this as well but it doesn't help. The behavior remains the same.

I spent the entire day googling this but I couldn't figure out the cause for this behavior. Hence, posting this here to seek help.

Thanks.