问:
Pandas Dataframe.rolling.apply() can only deal with single column, how to rolling for multiple columns?
I am working on financial problems, which asks me to generate a rolling window for several variables. But Dataframe.rolling.apply() can only deal with single column. I want to do something for all the columns in the dataframe, in a period. How can I realize that? For example:

```<code>       windcode       date     volume  ...  adjlow  adjclose   open
0     600973.SH 2015-12-25   78848.45  ...   62.71     64.78  16.23
1     002067.SZ 2015-12-25  374530.03  ...   24.40     24.50   9.30
2     002070.SZ 2015-12-25  698758.94  ...  114.30    114.44  24.92
3     600525.SH 2015-12-25  115307.14  ...  195.48    198.17  19.17
4     600535.SH 2015-12-25   60979.13  ...  315.03    323.05  41.50
        ...        ...        ...  ...     ...       ...    ...
7686  603617.SH 2020-06-09   17001.44  ...   21.37     21.45  10.73
7687  300656.SZ 2020-06-09   12851.04  ...   37.06     37.29  20.65
7688  603882.SH 2020-06-09   28640.03  ...   76.86     78.27  77.29
7689  002826.SZ 2020-06-09   29508.46  ...   11.03     11.26  10.99
7690  603136.SH 2020-06-09   27286.28  ...   35.26     37.66  23.60

</code>```

windcode is the id of stocks and volume .. open are some features of the stock. I want to run a rolling-window regression on:

volume ~ 1 + adjlow + adjclose + open

(no sense but just for example)

For each panel contains all stocks and in 20 days, I run the regression. How can I realize it?
I know I can use loop, but I want some built-in functions.

I tried numpy_ext.rolling_apply(), but it need me to enter arrays one by one. Actually I have thousands of features needed to be used, so I don't know how to input these arguments by hand.

I want something like dataframe.groupby.apply(), which enables me to straightly operate the group.

Body:
I am working on financial problems, which asks me to generate a rolling window for several variables. But Dataframe.rolling.apply() can only deal with single column. I want to do something for all the columns in the dataframe, in a period. How can I realize that? For example:

       windcode       date     volume  ...  adjlow  adjclose   open
0     600973.SH 2015-12-25   78848.45  ...   62.71     64.78  16.23
1     002067.SZ 2015-12-25  374530.03  ...   24.40     24.50   9.30
2     002070.SZ 2015-12-25  698758.94  ...  114.30    114.44  24.92
3     600525.SH 2015-12-25  115307.14  ...  195.48    198.17  19.17
4     600535.SH 2015-12-25   60979.13  ...  315.03    323.05  41.50
        ...        ...        ...  ...     ...       ...    ...
7686  603617.SH 2020-06-09   17001.44  ...   21.37     21.45  10.73
7687  300656.SZ 2020-06-09   12851.04  ...   37.06     37.29  20.65
7688  603882.SH 2020-06-09   28640.03  ...   76.86     78.27  77.29
7689  002826.SZ 2020-06-09   29508.46  ...   11.03     11.26  10.99
7690  603136.SH 2020-06-09   27286.28  ...   35.26     37.66  23.60

windcode is the id of stocks and volume .. open are some features of the stock. I want to run a rolling-window regression on:

volume ~ 1 + adjlow + adjclose + open

(no sense but just for example)

For each panel contains all stocks and in 20 days, I run the regression. How can I realize it?
I know I can use loop, but I want some built-in functions.

I tried numpy_ext.rolling_apply(), but it need me to enter arrays one by one. Actually I have thousands of features needed to be used, so I don't know how to input these arguments by hand.

I want something like dataframe.groupby.apply(), which enables me to straightly operate the group.


来源: stackexchange

问:
Process Instance Migration with boundary events
I am going through the Risks and limitations of Version Migration topic in the Camunda guide at the following link:

docs.camunda.org
User Guide | camunda BPM docs
documentation of the camunda BPM platform

I tried to test out the first point which says:

** If the new version introduces a new (message / signal / timer) boundary event attached to an activity, process instances which are waiting at this activity cannot be migrated (since the activity is a scope in the new version and not a scope in the old version).*

To test this , I created a simple process with a user task and created few instances:

Then I added a timer boundary event with this task and migrated instances from previous process to the updated process using REST API:

But contrary to this concept, I was able to migrate the process instance successfully and the timer triggered with no issue.

Is the given concept in the guide still valid or this is no longer valid ?

Thanks

ContentLicense: CC BY-SA 4.0


问:
How to get dimensions of a card inside a scatterplane kivy
I want to get the exact dimensions of a card in a scatterplane. if I try to see the size of the card, it does not change. I want the dimensions so that I can use a texture on it to display an image

I tried scaling down the scatterplane itself etc. but It gives me somewhat close results but not quite the exact. it says one pixel when it is actually 5-6 pixels


问:
How to Force an Exception into Crashes rather than Errors in AppCenter using Crashes.TrackError or any other method
In my mobile UWP/iOS app I log but ignore a number of exceptions.  I am expecting these exceptions but still want to monitor them without losing the full details of the exception (call stack for example).  This means I must use the Crashes.TrackError method rather than the Analytics.TrackEvent method.

However, this causes the ignored exceptions to get mixed in with the unexpected exceptions when I view them in AppCenter under Diagnostics, Issues, Errors.  I'd like to split out unexpected exceptions to the Diagnostics, Issues, Crashes category.

Is there anyway to force an exception reported to AppCenter into the Crashes category?

As an alternative, is there any way to set the status of an error reported to AppCenter to Ignored?


问:
FATAL: password authentication failed for user "postgres" (macOS, postgresql 15.1, pgAdmin 4)
After installing PSQL 15.1 (https://www.postgresql.org/download/), I try to connect to the server, enter the password that I set during installation. But I am getting this error [connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "postgres"]
enter image description here

Any idea how can I fix this? Thanks!


问:
Using Colima I am getting `error: Metrics API not available` when running `kubectl top nodes` on Mac
I am using Colima version 0.4.6 on Mac 12.6.1 I am trying to create a test Ubuntu pod for training purposes found here How can I keep a container running on Kubernetes? . After creating that pod and running kubectl get pods that pod is hanging in the pending state. After running kubectl top nodes I am getting the error error: Metrics API not available
Any help on this or points of direction would be appreciated.

I am hoping that I am able to get pods up and running so I can launch a little test environment.
Please let me know if more info is needed.


问:
A clickable accordion side menu in Javascript
Most of the side menus in javascript, which are in a tree format or what are called as accordion menu, when the parent node is clicked, a panel opens. The node click acts like a toggle. What I want is a menu like dtree, where a plus icon can be used as toggle and the actual node text can have a URL.

Does anyone know of such a menu or is it possible to create one?

Thanks in advance.

I tried the bootstrap menus, but I cannot use a URL on the toggle menu node


问:
Script cannot get calculate with element assigned to const
I'm trying to modify a cart of a shopify store. It's using a bundle application, which overwrites the prices in the cart, hence I'm trying to get those overwrited prices and calculate with those, in order to be able to display how much the customers are saving with the discount. My code is like this:

```<code><script>
          const original_price_for_product_range = document.getElementsByClassName("revy-line-item-price__old");
          const a = original_price_for_product_range[0].outerText;
          const c = a.replace("€","");
          const d = c.replace(",",".");
          const old_price_for_product = +d;

          const discounted_price_for_product_range = document.getElementsByClassName("revy-line-item-price__new");
          const b = discounted_price_for_product_range[0].outerText;
          const f = b.replace("€","");
          const g = f.replace(",",".");
          const new_price_for_product = +g
</script>
</code>```

Basically I'm getting the old and new price by their class name and then getting the first element out of that array and converting it to a number, I can calculate with. (outer text to get the first price, then removing the € and then replacing , with . so I can convert the text to a number, which I can do calculations with).

My problem is that after getting the elements by their class name, ALL following process just WON'T run, getting "Uncaught ReferenceError: a is not defined at <anonymous>:1:1" errors.

I was expecting the code to get the array first element and convert it to number given the script's code, but it's not working. Can anyone help out with this?

Body:
I'm trying to modify a cart of a shopify store. It's using a bundle application, which overwrites the prices in the cart, hence I'm trying to get those overwrited prices and calculate with those, in order to be able to display how much the customers are saving with the discount. My code is like this:

Basically I'm getting the old and new price by their class name and then getting the first element out of that array and converting it to a number, I can calculate with. (outer text to get the first price, then removing the € and then replacing , with . so I can convert the text to a number, which I can do calculations with).

My problem is that after getting the elements by their class name, ALL following process just WON'T run, getting "Uncaught ReferenceError: a is not defined at <anonymous>:1:1" errors.

I was expecting the code to get the array first element and convert it to number given the script's code, but it's not working. Can anyone help out with this?


问:
Is there a way to get the git branch from code54's buildversion-plugin?
I am using the code54 buildversion-plugin.  I would like to add the branch name to my build name.  I have looked, but I cannot find a property from the plugin to give me the branch name.  Is there such a property?</p>


问:
How to calculate Moran's I and GWR when given duplicated factor data
I'm trying to do the statistical analysis by using the Moran's I, but it leads me into a serious problem.

Suppose the data look like:

y
indep1
indep2
coord_x
coord_y
District

y1
indep1 1
indep2 1
coord_x 1
coord_y 1
A

y2
indep1 2
indep2 2
coord_x 1
coord_y 1
A

y3
indep1 3
indep2 3
coord_x 1
coord_y 1
A

y4
indep1 4
indep2 4
coord_x 2
coord_y 2
B

y5
indep1 5
indep2 5
coord_x 2
coord_y 2
B

Note that the data is given as form of *.shp.

This dataframe has 2 unique districts, but total 5 rows of data. If we want to calculate the Moran's I, then the weighted matrix W is 2 by 2.

But If I run the code

```<code>ols <- lm(y~indep1+indep2, data=dataset)
</code>```

We cannot calculate the

```<code>lm.morantest(ols, w) #w:weighted matrix
# returns "different length"
</code>```

How can we solve that problem? IF the total number of data and the number of unique districts are different, then how can we check the spatial auto-correlation between the districts and how can we apply GWR(geographically weighted regression?) Any reference papers or your advises could be helpful.

Thank you for your help in advance.

I tried to calculate the moran's I by making the number our dependent variables same as the number of unique districts. It can be possible when aggregating the sum of dependent variables with respect to the districts.

```<code>library(reshape2)
y_agg <- dcast(shp@data, district~., value.var="dependent variable", sum)
y_agg <- y_agg$.
moran.test(y_agg, W)
</code>```

But I think it is not the right way to analyze the spatial regression since all the other independent variables are ignored. How can I solve that problem? Is there any way for solving that problem without making the aggregated independent variables of my data?

Thank you.

Body:
I'm trying to do the statistical analysis by using the Moran's I, but it leads me into a serious problem.

Suppose the data look like:

y
indep1
indep2
coord_x
coord_y
District

y1
indep1 1
indep2 1
coord_x 1
coord_y 1
A

y2
indep1 2
indep2 2
coord_x 1
coord_y 1
A

y3
indep1 3
indep2 3
coord_x 1
coord_y 1
A

y4
indep1 4
indep2 4
coord_x 2
coord_y 2
B

y5
indep1 5
indep2 5
coord_x 2
coord_y 2
B

Note that the data is given as form of *.shp.

This dataframe has 2 unique districts, but total 5 rows of data. If we want to calculate the Moran's I, then the weighted matrix W is 2 by 2.

But If I run the code

ols <- lm(y~indep1+indep2, data=dataset)

We cannot calculate the

lm.morantest(ols, w) #w:weighted matrix
# returns "different length"

How can we solve that problem? IF the total number of data and the number of unique districts are different, then how can we check the spatial auto-correlation between the districts and how can we apply GWR(geographically weighted regression?) Any reference papers or your advises could be helpful.

Thank you for your help in advance.

I tried to calculate the moran's I by making the number our dependent variables same as the number of unique districts. It can be possible when aggregating the sum of dependent variables with respect to the districts.

library(reshape2)
y_agg <- dcast(shp@data, district~., value.var="dependent variable", sum)
y_agg <- y_agg$.
moran.test(y_agg, W)

But I think it is not the right way to analyze the spatial regression since all the other independent variables are ignored. How can I solve that problem? Is there any way for solving that problem without making the aggregated independent variables of my data?

Thank you.


问:
DatasetType is not defined
I am trying to classify a medical images using straitified cross folding. The following line gives me hardtime :

preds_test, y_test = learn.get_preds(DatasetType.Valid)

as it give "Errortype: "DatasetType" is not defined"

could someone help me to solve this matter ?

I am expecting to safe the result and get the usual metrics

Title: DatasetType is not defined


问:
Tradingview strategy issues when calc_on_order_fills, calc_on_every_tick, and process_orders_on_close are true
I'm trying to figure out how to prevent the multiple entries that happen when
calc_on_order_fills= true, calc_on_every_tick= true, process_orders_on_close= true
and the target is hit in the same candle.

After the entry fill, and although I have barstate.isconfirmed for entering position (e.g. if long_Condition and barstate.isconfirmed) if the target or stop is hit in the same candle, the backtester records, 2nd, 3rd and ... attempts

I've used combinations of barstate.isconfirmed and barstate.isnew for entry conditions but there still is the same problem (see the image)
Does anyone have a solution to prevent this behavior?


问:
Reward Videos Ads loading time issue

Explanation:

The loading time of rewarded video ads is too high,is there any possible ways to minimize this loading time?

Here, author: loads the rewarded ads in separate page with progress bar, generally it takes more than 5 seconds to load reward video ads here.Is there any code adjustment techniques to change that time into 1 or 2 seconds.

Intialization of mobile ads

 MobileAds.initialize(this){}

Setting of rewardVideoAds

```<code>fun setRewardVideoAds(appCompatActivity: AppCompatActivity) {
        rewardedAdStatus = true
        loadRewardAds(appCompatActivity)
    }
</code>```

Loads Reward Ads

```<code>private fun loadRewardAds(appCompatActivity: AppCompatActivity) {
        if (mRewardedAd == null) {
            mIsLoading = true
            var adRequest = AdRequest.Builder().build()

            RewardedAd.load(appCompatActivity, ApiConstants.REWARDADS,
                adRequest, object : RewardedAdLoadCallback() {
                    override fun onAdFailedToLoad(@NonNull loadAdError: LoadAdError) {
                        mIsLoading = false
                        mRewardedAd = null

                        // Handle the error.
                        Log.d(TAG, loadAdError.toString())
                    }

                    override fun onAdLoaded(@NonNull rewardedAd: RewardedAd) {
                        mIsLoading = false
                        if (rewardedAdStatus.equals(true)) {
                            splashAdsView.hidProgressDialog()
                            mRewardedAd = rewardedAd
                            showRewardedVideo(appCompatActivity)
                        } else {
                            rewardedAdStatus = false
                        }
                    }
                })
        }
    }
</code>```

Show Rewards Ads

```<code>  private fun showRewardedVideo(appCompatActivity: AppCompatActivity) {
        if (mRewardedAd != null) {
            mRewardedAd?.fullScreenContentCallback =
                object : FullScreenContentCallback() {
                    override fun onAdDismissedFullScreenContent() {
                        Log.d(TAG, "Ad was dismissed.")

                        // Don't forget to set the ad reference to null so you
                        // don't show the ad a second time.
                        mRewardedAd = null
                        rewardedAdStatus = false
                        splashAdsModel.getDashboardView()

                    }

                    override fun onAdFailedToShowFullScreenContent(adError: AdError) {
                        Log.d(TAG, "Ad failed to show.")
                        // Don't forget to set the ad reference to null so you
                        // don't show the ad a second time.
                        mRewardedAd = null
                        splashAdsModel.getDashboardView()
                    }

                    override fun onAdShowedFullScreenContent() {
                        Log.d(TAG, "Ad showed fullscreen content.")
                        // Called when ad is dismissed.
                    }
                }

            mRewardedAd?.show(appCompatActivity, OnUserEarnedRewardListener() {
                fun onUserEarnedReward(rewardItem: RewardItem) {
                    var rewardAmount = rewardItem.amount
                    Log.d("TAG", "User earned the reward.")
                    splashAdsModel.getDashboardView()
                }
            }
            )
        }
    }
</code>```

Title: Reward Videos Ads loading time issue

Body:
Explanation:

The loading time of rewarded video ads is too high,is there any possible ways to minimize this loading time?

Here, author: loads the rewarded ads in separate page with progress bar, generally it takes more than 5 seconds to load reward video ads here.Is there any code adjustment techniques to change that time into 1 or 2 seconds.

Intialization of mobile ads

 MobileAds.initialize(this){}

Setting of rewardVideoAds

fun setRewardVideoAds(appCompatActivity: AppCompatActivity) {
        rewardedAdStatus = true
        loadRewardAds(appCompatActivity)
    }

Loads Reward Ads

private fun loadRewardAds(appCompatActivity: AppCompatActivity) {
        if (mRewardedAd == null) {
            mIsLoading = true
            var adRequest = AdRequest.Builder().build()

            RewardedAd.load(appCompatActivity, ApiConstants.REWARDADS,
                adRequest, object : RewardedAdLoadCallback() {
                    override fun onAdFailedToLoad(@NonNull loadAdError: LoadAdError) {
                        mIsLoading = false
                        mRewardedAd = null

                        // Handle the error.
                        Log.d(TAG, loadAdError.toString())
                    }

                    override fun onAdLoaded(@NonNull rewardedAd: RewardedAd) {
                        mIsLoading = false
                        if (rewardedAdStatus.equals(true)) {
                            splashAdsView.hidProgressDialog()
                            mRewardedAd = rewardedAd
                            showRewardedVideo(appCompatActivity)
                        } else {
                            rewardedAdStatus = false
                        }
                    }
                })
        }
    }

Show Rewards Ads

  private fun showRewardedVideo(appCompatActivity: AppCompatActivity) {
        if (mRewardedAd != null) {
            mRewardedAd?.fullScreenContentCallback =
                object : FullScreenContentCallback() {
                    override fun onAdDismissedFullScreenContent() {
                        Log.d(TAG, "Ad was dismissed.")

                        // Don't forget to set the ad reference to null so you
                        // don't show the ad a second time.
                        mRewardedAd = null
                        rewardedAdStatus = false
                        splashAdsModel.getDashboardView()

                    }

                    override fun onAdFailedToShowFullScreenContent(adError: AdError) {
                        Log.d(TAG, "Ad failed to show.")
                        // Don't forget to set the ad reference to null so you
                        // don't show the ad a second time.
                        mRewardedAd = null
                        splashAdsModel.getDashboardView()
                    }

                    override fun onAdShowedFullScreenContent() {
                        Log.d(TAG, "Ad showed fullscreen content.")
                        // Called when ad is dismissed.
                    }
                }

            mRewardedAd?.show(appCompatActivity, OnUserEarnedRewardListener() {
                fun onUserEarnedReward(rewardItem: RewardItem) {
                    var rewardAmount = rewardItem.amount
                    Log.d("TAG", "User earned the reward.")
                    splashAdsModel.getDashboardView()
                }
            }
            )
        }
    }


问:
measure distance between two atoms, in each state, in pymol
I'm using Pymol to measure the distance between two atoms of a nucleic acid. I have a pdb. file from molecular dynamics calculation. When I open that file in pymol I have multiple states of the molecule. I want to measure the distance between two specific atoms and for each state, and export the distances to a file. Then I can visualise the distribution in distance. Can anyone please suggest a method to do this using pymol.</p>


问:
How can I cache a local copy of Google's Maven Repo?
I'm trying to download a stable version of Google's Maven Repo (https://maven.google.com/web/index.html#) on my local machine.  This is part of a larger effort for offline Android Development.  The goal is to cache the repo's vast amount of dependencies (to include legacy versions for compatibility issues) so I can use Gradle build-scripts and use the required dependencies locally rather than having to rely on an active internet connection and need to reach remote repositories.

Without adding each individual dependency to my build.gradle(app) file, is there a way I can download the entire repo and have my build.gradle use it?

I've added common dependencies to my build.gradle(app) but still want to have the flexibility of adding more functionality later on (again, without internet access).


问:
python loc and conditions similar to SQL
So in SQL I can treat two conditions as "one" instead of two in the where statement

```<code>Where x=2 and (y>2 and z =10)
</code>```

My understanding that within python .loc is the approximate translation, I'm wondering how I can replicate this behavior.

```<code>scout.loc[scout['nflId'].isin(OLs.nflId)
                     & (~scout['gameId'].isin(brokenplays.gameId))
                     & (~scout['playId'].isin(brokenplays.playId))]
</code>```

I need gameId and playId to function as a singular condition as neither gameId or playId is distinct enough to function as a PK, but together they can function as a PK.

I've tried throwing different (), [], and even including them together in the scout[''] part and don't get the data I want or I get error statement.

Body:
So in SQL I can treat two conditions as "one" instead of two in the where statement

Where x=2 and (y>2 and z =10)

My understanding that within python .loc is the approximate translation, I'm wondering how I can replicate this behavior.

scout.loc[scout['nflId'].isin(OLs.nflId)
                     & (~scout['gameId'].isin(brokenplays.gameId))
                     & (~scout['playId'].isin(brokenplays.playId))]

I need gameId and playId to function as a singular condition as neither gameId or playId is distinct enough to function as a PK, but together they can function as a PK.

I've tried throwing different (), [], and even including them together in the scout[''] part and don't get the data I want or I get error statement.


问:
Modify/Iter columns and rows in many datasets
I have around 600 dataset with the same distribution, one for every status and month of the years (1950 - 2021).

I have this kind of dataset (examples):

```<code>pd.DataFrame({
    'Alabama' : ['Units: Degrees Fahrenheit', 'Base Period: 1901-2000', 'Missing: -99', 'Date', 195001, 195101, 195101, 195301, 195401, 195501, 195601, '...'],
    'Maximum Temperature':['NaN','NaN','NaN', 'Value', 68.4, 58.9, 63.0, 60.6, 58.7, 54.8, 53.5,'...'],
    'January':['NaN','NaN','NaN', 'January', 12.4, 12.4, 7.0, 4.6, 2.7, -1.2, -2.5, '...']
})
</code>```
```<code>pd.DataFrame({
    'Idaho' : ['Units: Degrees Fahrenheit', 'Base Period: 1901-2000', 'Missing: -99', 'Date', 195001, 195101, 195101, 195301, 195401, 195501, 195601, '...'],
    'Maximum Temperature':['NaN','NaN','NaN', 'Value', 52.4, 62.9, 40.0, 50.6, 42.7, 56.8, 53.5,'...'],
    'May':['NaN','NaN','NaN', 'May', 11.4, 11.4, 5.0, 5.6, 1.7, -0.2, -1.5, '...']
</code>```

Mi intention is create a iteration that it can modify all the datasets like this:

```<code>pd.DataFrame({
    'date' : [1950, 1951, 1951, 1953, 1954, 1955, 1956, '...'],
    'Maximum Temperature':[68.4, 58.9, 63.0, 60.6, 58.7, 54.8, 53.5,'...'],
    'month':['January', 'January', 'January', 'January', 'January', 'January', 'January', '...'],
    'state':['Alabama', 'Alabama', 'Alabama', 'Alabama', 'Alabama', 'Alabama', 'Alabama', '...']
})
</code>```

I know how I can read every dataset but I was trayin to create a interation to modiffy columns name and create the new one in all the datasets, but i can't achieve this goal, I hope someone here could help me!

Thaks you very much, it would help me a lot!!

Body:
I have around 600 dataset with the same distribution, one for every status and month of the years (1950 - 2021).

I have this kind of dataset (examples):

pd.DataFrame({
    'Alabama' : ['Units: Degrees Fahrenheit', 'Base Period: 1901-2000', 'Missing: -99', 'Date', 195001, 195101, 195101, 195301, 195401, 195501, 195601, '...'],
    'Maximum Temperature':['NaN','NaN','NaN', 'Value', 68.4, 58.9, 63.0, 60.6, 58.7, 54.8, 53.5,'...'],
    'January':['NaN','NaN','NaN', 'January', 12.4, 12.4, 7.0, 4.6, 2.7, -1.2, -2.5, '...']
})

pd.DataFrame({
    'Idaho' : ['Units: Degrees Fahrenheit', 'Base Period: 1901-2000', 'Missing: -99', 'Date', 195001, 195101, 195101, 195301, 195401, 195501, 195601, '...'],
    'Maximum Temperature':['NaN','NaN','NaN', 'Value', 52.4, 62.9, 40.0, 50.6, 42.7, 56.8, 53.5,'...'],
    'May':['NaN','NaN','NaN', 'May', 11.4, 11.4, 5.0, 5.6, 1.7, -0.2, -1.5, '...']

Mi intention is create a iteration that it can modify all the datasets like this:

pd.DataFrame({
    'date' : [1950, 1951, 1951, 1953, 1954, 1955, 1956, '...'],
    'Maximum Temperature':[68.4, 58.9, 63.0, 60.6, 58.7, 54.8, 53.5,'...'],
    'month':['January', 'January', 'January', 'January', 'January', 'January', 'January', '...'],
    'state':['Alabama', 'Alabama', 'Alabama', 'Alabama', 'Alabama', 'Alabama', 'Alabama', '...']
})

I know how I can read every dataset but I was trayin to create a interation to modiffy columns name and create the new one in all the datasets, but i can't achieve this goal, I hope someone here could help me!

Thaks you very much, it would help me a lot!!


问:
cmake target_sources() - all targets
In my project, I have a top-level CMakeLists.txt with several add_executable() calls, defining several targets, T1, T2, ..., Tn. I have m subdirectories, each with their own CMakeLists.txt, each consisting of n lines, like so:

```<code>target_sources(T1 ...)
target_sources(T2 ...)
...
target_sources(Tn ...)
</code>```

These lines are identical except for the target name.

Whenever I want to add a new executable, I have to add a new target_sources() line to m separate CMakeLists.txt files. Also, whenever a new source file gets added to one of those m subdirectories, I have to add an entry to each of the n lines in that CMakeLists.txt file. This is quite laborious.

Is there a better way to do this? I tried to look through the target_sources documentation, but couldn't find an obvious solution.

Title: cmake target_sources() - all targets

Body:
In my project, I have a top-level CMakeLists.txt with several add_executable() calls, defining several targets, T1, T2, ..., Tn. I have m subdirectories, each with their own CMakeLists.txt, each consisting of n lines, like so:

target_sources(T1 ...)
target_sources(T2 ...)
...
target_sources(Tn ...)

These lines are identical except for the target name.

Whenever I want to add a new executable, I have to add a new target_sources() line to m separate CMakeLists.txt files. Also, whenever a new source file gets added to one of those m subdirectories, I have to add an entry to each of the n lines in that CMakeLists.txt file. This is quite laborious.

Is there a better way to do this? I tried to look through the target_sources documentation, but couldn't find an obvious solution.


问:
I need to import a list of last and first names from contacts into google sheets
I'm pretty new at google app script, I've found the following script that will get me a list of contacts but it includes "other contacts" and I want to only grab the group "My Contacts" and list them last name and first name in two columns. I've been trying to figure that out but I'm at a loss.

```<code>function importFullName() {

  var contacts = ContactApp.getContactGroup('My Contacts').getContacts(), output = [];
  for(var i = 0, iLen = contacts.length; i < iLen; i++) {
    var fullname = contacts[i].getFullName();
    if(fullname) {
      output.push([fullname]);
    } else {
      continue;
    }
  }
  SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Contacts list").getRange(1, 1, output.length, 1).setValues(output);
}
</code>```

This script works if I use ContactsApp.getContacts(), but doesn't once I change to getContactsGroup it stops working

Body:
I'm pretty new at google app script, I've found the following script that will get me a list of contacts but it includes "other contacts" and I want to only grab the group "My Contacts" and list them last name and first name in two columns. I've been trying to figure that out but I'm at a loss.

function importFullName() {

  var contacts = ContactApp.getContactGroup('My Contacts').getContacts(), output = [];
  for(var i = 0, iLen = contacts.length; i < iLen; i++) {
    var fullname = contacts[i].getFullName();
    if(fullname) {
      output.push([fullname]);
    } else {
      continue;
    }
  }
  SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Contacts list").getRange(1, 1, output.length, 1).setValues(output);
}

This script works if I use ContactsApp.getContacts(), but doesn't once I change to getContactsGroup it stops working


问:
Parasails JavaScript not loading after Promise resolved
I'm trying to load in data from the database dynamically with javascript and this helper function.

The function fetches a URLs which is routed to actions that return the parameters and a message after completion (as a Promise). The message gets displayed to the end user.

parasails register Page:

```<code> methods: {
        loadData: async function(url) {
            let origin = window.location.origin
            url = new URL(origin + url);
            try{
                let res = await parasails.util.backendLoad(url)
                console.log(res)
                this.categories = res.categories
                this.showResponse = res.showResponse
            }catch(err){
                console.log("Error: " + err)
            }

        },
        destroyOne: async function(id) {
            url = "/api/v1/category/" + id + "/destroy"
            this.loadData(url);
        }
    }
</code>```

parasails utility:

```<code>parasails.registerUtility('backendLoad', async function backendLoad(url) {
    return new Promise((resolve)=>{
        fetch(url)
            .then((res)=>{
                if (res.ok)return res.json();
                throw new Error(res.status);})
            .then((data)=>{
                console.log(data);
                resolve(data);
            })
            .catch((err)=>{
                let resErr = []
                switch(err.message){
                    case "401":
                        console.log("an error has occured of type 401");
                        resErr= {showResponse: {type: 'alert-danger', message "Unauthorized"}};
                        resolve(resErr);
                    default:
                        console.log("an error has occured");
                        resErr= {showResponse: {type: 'alert-danger', message: "Unkownerror"}};
                        resolve(resErr);
                }
            })
    });
});
</code>```

EJS:

```<code><div id="indexCategory" v-cloak>
    <div class="container my-2">
        <div :class="'alert ' + showResponse.type" role="alert" v-if="showResponse">
                {{showResponse.message}}
        </div>
        <h1>Categories</h1>
        <hr/>
        <table class="table table-hover">
            <thead>
                <tr>
                    <th scope="col">Name</th>
                    <th scope="col"></th>
                </tr>
            </thead>
            <tbody>
                <tr scope="row" v-for="c in categories">
                    <td>
                        {{ c.name }}
                    </td>
                    <td>
                        <a class="btn btn-outline-secondary btn-sm" @click="destroyOne(c.id)">Delete</a>
                    </td>
                </tr>
            </tbody>
        </table>
        <a type="button" class="btn btn-primary mt-4" href="/category/new">Add</a>
        <a type="button" class="btn btn-primary mt-4" href="/dashboard">Back to dashboard</a>
    </div>
</div>
</code>```

The function loadData is called beforeMount and returns all categories as it should.

When destroyOne calls the loadData function this doesnt happen. Neither the categories nor the message get shown. The action returns the parameters as expected (as a Promise).

There are no console outputs either when calling with destroyOne.

What changes do I need to implement, so that the response from destroyOne gets shown?

Body:
I'm trying to load in data from the database dynamically with javascript and this helper function.

The function fetches a URLs which is routed to actions that return the parameters and a message after completion (as a Promise). The message gets displayed to the end user.

parasails register Page:

 methods: {
        loadData: async function(url) {
            let origin = window.location.origin
            url = new URL(origin + url);
            try{
                let res = await parasails.util.backendLoad(url)
                console.log(res)
                this.categories = res.categories
                this.showResponse = res.showResponse
            }catch(err){
                console.log("Error: " + err)
            }

        },
        destroyOne: async function(id) {
            url = "/api/v1/category/" + id + "/destroy"
            this.loadData(url);
        }
    }

parasails utility:

parasails.registerUtility('backendLoad', async function backendLoad(url) {
    return new Promise((resolve)=>{
        fetch(url)
            .then((res)=>{
                if (res.ok)return res.json();
                throw new Error(res.status);})
            .then((data)=>{
                console.log(data);
                resolve(data);
            })
            .catch((err)=>{
                let resErr = []
                switch(err.message){
                    case "401":
                        console.log("an error has occured of type 401");
                        resErr= {showResponse: {type: 'alert-danger', message "Unauthorized"}};
                        resolve(resErr);
                    default:
                        console.log("an error has occured");
                        resErr= {showResponse: {type: 'alert-danger', message: "Unkownerror"}};
                        resolve(resErr);
                }
            })
    });
});

EJS:

                {{showResponse.message}}

Categories

                    Name

                        {{ c.name }}

                        Delete

        Add
        Back to dashboard

The function loadData is called beforeMount and returns all categories as it should.

When destroyOne calls the loadData function this doesnt happen. Neither the categories nor the message get shown. The action returns the parameters as expected (as a Promise).

There are no console outputs either when calling with destroyOne.

What changes do I need to implement, so that the response from destroyOne gets shown?


问:
How to import or use js file configuration into any vue page in your nuxt app
I have a Nuxt project of listing booking.

I have done all my API calls and configuration in index.js in the store folder.  I would link to display the listing gotten from the API call on my listing.vue page.

How do I print my retrieved data or make my index.js accessible anywhere in the app?

package.json

{
  "name": "lisngbook",
  "version": "1.0.0",
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate"
  },
  "dependencies": {
    "@nuxtjs/axios": "^5.13.6",
    "core-js": "^3.9.1",
    "nuxt": "^2.15.3",
  },
  "devDependencies": {
    "@nuxtjs/moment": "^1.6.1"
  },
```


问:
How can I use custom navigation buttons in swiperjs with content that updates onClick?
I'm struggling with the docs for swiperjs. I'm trying to create custom navigation buttons that swipe content (or the slide) vertically and load the next slide of (prefetched) data from slice.items:

```<code><Swiper
      navigation={{
        prevEl: CarouselButton,
        nextEl: CarouselButton
      }}
      direction='vertical'
      modules={[Navigation]}
    >
      {slice?.items.map((item, index) =>
        <SwiperSlide key={item.unique_id} className='swiper-slide'>
          <div>
            <CustomNavButton>{item.answer_field_1}</CarouselButton>
            <CustomNavButton>{item.answer_field_2}</CarouselButton>
          </div>
        </SwiperSlide>)
      }
    </Swiper>
</code>```

Any ideas what swiper APIs I should be using to achieve a slide onClick?

Body:
I'm struggling with the docs for swiperjs. I'm trying to create custom navigation buttons that swipe content (or the slide) vertically and load the next slide of (prefetched) data from slice.items:

<Swiper
      navigation={{
        prevEl: CarouselButton,
        nextEl: CarouselButton
      }}
      direction='vertical'
      modules={[Navigation]}
    >
      {slice?.items.map((item, index) =>
        <SwiperSlide key={item.unique_id} className='swiper-slide'>

            <CustomNavButton>{item.answer_field_1}</CarouselButton>
            <CustomNavButton>{item.answer_field_2}</CarouselButton>

        </SwiperSlide>)
      }
    </Swiper>

Any ideas what swiper APIs I should be using to achieve a slide onClick?


问:
Vuejs Vetur(2349) - "This expression is not callable". I can't see what is wrong
I am currently struggling with a Vuejs component and a mixing. The main idea is to have a mixing that given a certain number, it formats the number as a price. Here is the code:

Component:

<template>

    {{ fullPrice }}
    {{ price.currency }}

</template>

```
<p>Mixin:</p>
```import Vue from 'vue'

const currencyMixin = Vue.extend({
  methods: {
    $_getThousands(i: string, j: number, thousands: string): string {
      return (j ? i.substr(0, j) + thousands : '')
    },

    $_getAfterThousands(i: string, j: number, thousands: string): string {
      return i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + thousands)
    },

    $_getDecimals(amount: number, i: string, decimalCount: number, decimal: string = ','): string {
      const aux = Math.abs(amount - parseInt(i)).toFixed(decimalCount).slice(2)
      return decimalCount ? decimal + aux : ''
    },

    formatCurrency(amount: number, decimalCount: number = 0, decimal: string = ',', thousands: string = '.'): string {
      const sign = '$ '
      const stringAmount: string = Math.abs(amount || 0).toFixed(decimalCount)
      const i: string = parseInt((stringAmount)).toString()
      const j: number = i.length > 3 ? i.length % 3 : 0

      return (
        sign +
        this.$_getThousands(i, j, thousands) +
        this.$_getAfterThousands(i, j, thousands) +
        this.$_getDecimals(amount, i, decimalCount, decimal)
      )
    },

  },
})

export default currencyMixin
```

Vue.js version is: 2.6.14

The code works but I am getting this message and I can't figure out what is the problem.

Body:
I am currently struggling with a Vuejs component and a mixing. The main idea is to have a mixing that given a certain number, it formats the number as a price. Here is the code:

Component:

<template>

    {{ fullPrice }}
    {{ price.currency }}

</template>

Mixin:

import Vue from 'vue'

const currencyMixin = Vue.extend({
  methods: {
    $_getThousands(i: string, j: number, thousands: string): string {
      return (j ? i.substr(0, j) + thousands : '')
    },

    $_getAfterThousands(i: string, j: number, thousands: string): string {
      return i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + thousands)
    },

    $_getDecimals(amount: number, i: string, decimalCount: number, decimal: string = ','): string {
      const aux = Math.abs(amount - parseInt(i)).toFixed(decimalCount).slice(2)
      return decimalCount ? decimal + aux : ''
    },

    formatCurrency(amount: number, decimalCount: number = 0, decimal: string = ',', thousands: string = '.'): string {
      const sign = '$ '
      const stringAmount: string = Math.abs(amount || 0).toFixed(decimalCount)
      const i: string = parseInt((stringAmount)).toString()
      const j: number = i.length > 3 ? i.length % 3 : 0

      return (
        sign +
        this.$_getThousands(i, j, thousands) +
        this.$_getAfterThousands(i, j, thousands) +
        this.$_getDecimals(amount, i, decimalCount, decimal)
      )
    },

  },
})

export default currencyMixin

Vue.js version is: 2.6.14

The code works but I am getting this message and I can't figure out what is the problem.


问:
Laravel group by month with shop sales total
I tried to build a Line chart where I have multiple shops and the monthly sales report will be shown with the shop name. I can achieve the monthly data or yearly data but how do I can get the groupBy Month sales total for each shop group array data as my desired line chart data? I share some of my code and screenshot. Please have a look and if you can help me. Thanks

shops table

sales table

my line chart expected data

I know I have to join sales and shops table and I can able to get the shops group data but how to get the shop group monthly sales total?

```<code>$sales = Sale::select(
            DB::raw('year(created_at) as year'),
            DB::raw('month(created_at) as month'),
            DB::raw('sum(total) as total'),
        )
            ->where(DB::raw('date(created_at)'), '>=', Carbon::now()->startOfYear())
            ->orderBy('month')
            ->groupBy('year','month')
            ->get()
            ->groupBy(['year', 'month']);
</code>```

Body:
I tried to build a Line chart where I have multiple shops and the monthly sales report will be shown with the shop name. I can achieve the monthly data or yearly data but how do I can get the groupBy Month sales total for each shop group array data as my desired line chart data? I share some of my code and screenshot. Please have a look and if you can help me. Thanks

shops table

sales table

my line chart expected data

I know I have to join sales and shops table and I can able to get the shops group data but how to get the shop group monthly sales total?

$sales = Sale::select(
            DB::raw('year(created_at) as year'),
            DB::raw('month(created_at) as month'),
            DB::raw('sum(total) as total'),
        )
            ->where(DB::raw('date(created_at)'), '>=', Carbon::now()->startOfYear())
            ->orderBy('month')
            ->groupBy('year','month')
            ->get()
            ->groupBy(['year', 'month']);


问:
Error [0x8015] (ESP_ERR_MBEDTLS_X509_CRT_PARSE_FAILED) esp32
good afternoon colleagues, please see if you can give me a light

example 1

```<code>void conect(void) {
    esp_mqtt_client_handle_t mqttClient;

    const char *certificate;
            certificate =
                "-----BEGIN CERTIFICATE-----\n"
                "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n"
                "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
                "d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n"
                "QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n"
                "MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n"
                "b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n"
                "9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n"
                "CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n"
                "nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n"
                "43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n"
                "T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n"
                "gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n"
                "BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n"
                "TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n"
                "DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n"
                "hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n"
                "06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n"
                "PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n"
                "YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
                "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
                "-----END CERTIFICATE-----\n"

    esp_mqtt_client_config_t mqttConfig = {};

    mqttConfig.uri = "mqtts://broker.emqx.io";
    mqttConfig.port = 8883;

    mqttConfig.cert_pem = certificate;

    mqttConfig.username = "";
    mqttConfig.password = "";
    mqttConfig.keepalive = 60;
    mqttConfig.client_id = "test";

    mqttClient = esp_mqtt_client_init(&mqttConfig);

    esp_mqtt_client_start(mqttClient);

}
</code>```

the code above works perfectly but when I change the certificate variable to std::string it gives an error
below is the change and the error

example 2

```<code>void conect(void) {
    esp_mqtt_client_handle_t mqttClient;

    std::string certificate;
            certificate =
                "-----BEGIN CERTIFICATE-----\n"
                "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n"
                "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
                "d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n"
                "QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n"
                "MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n"
                "b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n"
                "9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n"
                "CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n"
                "nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n"
                "43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n"
                "T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n"
                "gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n"
                "BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n"
                "TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n"
                "DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n"
                "hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n"
                "06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n"
                "PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n"
                "YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
                "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
                "-----END CERTIFICATE-----\n"

    esp_mqtt_client_config_t mqttConfig = {};

    mqttConfig.uri = "mqtts://broker.emqx.io";
    mqttConfig.port = 8883;

    mqttConfig.cert_pem = certificate.c_str();

    mqttConfig.username = "";
    mqttConfig.password = "";
    mqttConfig.keepalive = 60;
    mqttConfig.client_id = "test";

    mqttClient = esp_mqtt_client_init(&mqttConfig);

    esp_mqtt_client_start(mqttClient);

}
</code>```

when this certificate variable is set to std::string it gives an error:
E (5021) esp-tls-mbedtls: mbedtls_x509_crt_parse returned -0x2180
E (5021) esp-tls-mbedtls: Failed to set client configurations, returned [0x8015] (ESP_ERR_MBEDTLS_X509_CRT_PARSE_FAILED)
E (5031) esp-tls: create_ssl_handle failed
E (5031) esp-tls: Failed to open new connection
E (5041) TRANSPORT_BASE: Failed to open a new connection
E (5051) MQTT_CLIENT: Error transport connect

mqttConfig.cert_pem accepts const char * but converting a string variable gives the above error and if I create the variable as const char * it works as per example 1
can someone please guide me what could be going on

```<code>const char *p = certificate.c_str();
mqttConfig.cert_pem = p;
</code>```

Thank you very much

Body:
good afternoon colleagues, please see if you can give me a light

example 1

void conect(void) {
    esp_mqtt_client_handle_t mqttClient;

    const char *certificate;
            certificate =
                "-----BEGIN CERTIFICATE-----\n"
                "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n"
                "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
                "d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n"
                "QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n"
                "MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n"
                "b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n"
                "9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n"
                "CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n"
                "nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n"
                "43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n"
                "T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n"
                "gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n"
                "BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n"
                "TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n"
                "DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n"
                "hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n"
                "06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n"
                "PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n"
                "YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
                "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
                "-----END CERTIFICATE-----\n"

    esp_mqtt_client_config_t mqttConfig = {};

    mqttConfig.uri = "mqtts://broker.emqx.io";
    mqttConfig.port = 8883;

    mqttConfig.cert_pem = certificate;

    mqttConfig.username = "";
    mqttConfig.password = "";
    mqttConfig.keepalive = 60;
    mqttConfig.client_id = "test";

    mqttClient = esp_mqtt_client_init(&mqttConfig);

    esp_mqtt_client_start(mqttClient);

}

the code above works perfectly but when I change the certificate variable to std::string it gives an error
below is the change and the error

example 2

void conect(void) {
    esp_mqtt_client_handle_t mqttClient;

    std::string certificate;
            certificate =
                "-----BEGIN CERTIFICATE-----\n"
                "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n"
                "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n"
                "d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n"
                "QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n"
                "MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n"
                "b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n"
                "9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n"
                "CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n"
                "nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n"
                "43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n"
                "T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n"
                "gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n"
                "BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n"
                "TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n"
                "DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n"
                "hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n"
                "06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n"
                "PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n"
                "YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n"
                "CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n"
                "-----END CERTIFICATE-----\n"

    esp_mqtt_client_config_t mqttConfig = {};

    mqttConfig.uri = "mqtts://broker.emqx.io";
    mqttConfig.port = 8883;

    mqttConfig.cert_pem = certificate.c_str();

    mqttConfig.username = "";
    mqttConfig.password = "";
    mqttConfig.keepalive = 60;
    mqttConfig.client_id = "test";

    mqttClient = esp_mqtt_client_init(&mqttConfig);

    esp_mqtt_client_start(mqttClient);

}

when this certificate variable is set to std::string it gives an error:
E (5021) esp-tls-mbedtls: mbedtls_x509_crt_parse returned -0x2180
E (5021) esp-tls-mbedtls: Failed to set client configurations, returned [0x8015] (ESP_ERR_MBEDTLS_X509_CRT_PARSE_FAILED)
E (5031) esp-tls: create_ssl_handle failed
E (5031) esp-tls: Failed to open new connection
E (5041) TRANSPORT_BASE: Failed to open a new connection
E (5051) MQTT_CLIENT: Error transport connect

mqttConfig.cert_pem accepts const char * but converting a string variable gives the above error and if I create the variable as const char * it works as per example 1
can someone please guide me what could be going on

const char *p = certificate.c_str();
mqttConfig.cert_pem = p;

Thank you very much


问:
How to convert JSON file to DXF file using Python?
```<code>I have a json file with 88476 lines of code, this is the movement of the robot, I need to convert this to dxf format. Code start: "header": {
        "mapType": "2D Map",
        "mapName": "default_15.12",
        "minPos": {
            "x": -2.366,
            "y": -10.452
        },
        "maxPos": {
            "x": 27.773,
            "y": 3.69
</code>```

Please write the code that will convert all this. Recommend a library for this task.

I tried using the ezdxf library, but it didn't work for me

```<code>
</code>```

Body:
I have a json file with 88476 lines of code, this is the movement of the robot, I need to convert this to dxf format. Code start: "header": {
        "mapType": "2D Map",
        "mapName": "default_15.12",
        "minPos": {
            "x": -2.366,
            "y": -10.452
        },
        "maxPos": {
            "x": 27.773,
            "y": 3.69

Please write the code that will convert all this. Recommend a library for this task.

I tried using the ezdxf library, but it didn't work for me


问:
Unable to receive POST data using a class defined in a class library
I have two projects: one is a .NET Core class library, the other is a .NET Core minimal web API.

SomeClassLibrary.csproj

```<code>// SomeClass.cs
namespace SomeClassLibrary.Some.Arbitrary.Namespace
{
  public class SomeClass
  {
    public SomeClass() {}
    public SomeSubClass? subClassObject {get; set;}
  }
  public class SomeSubClass
  {
    public SomeSubClass() {}
    public string? id {get; set;}
  }
}

</code>```

SomeMinimalWebAPI.csproj

```<code>// Program.cs
using SomeClassLibrary.Some.Arbitrary.Namespace;

...

app.MapPost("/endpoint", ([FromBody] SomeClass someClassObject) =>
  {
    // do stuff with someClassObject
    return "OK";
  });

...

</code>```

If I POST from Postman, for example, with JSON like so:

```<code>{
  "subClassObject" :
  {
    "id" : "some value"
  }
}
</code>```

I get a 200 status code, but no OK in the response body as expected.

I have tested that using [FromBody] SomeClass someClassObject works just fine when referenced in the same solution, but referenced from a class library as I have demonstrated here makes it seem like MapPost is hanging for some reason. I get no error codes. And to reiterate, I get a 200 in Postman, but no OK in the response body. Further, if I configure the Postman POST request with invalid JSON, I do receive an error response telling Required parameter "SomeClass someClassObject" was not provided from body.

I can even new up a SomeClass object, including its nested SomeSubClass object, and use it in the code. But as soon as I try to pass it as a parameter to be deserialized FromBody, it hangs with zero indication as to what is happening.

Everything seems to be referenced correctly, as my using statements referencing SomeClassLibrary.Some.Arbitrary.Namespace grant me access to the controllers and models and stuff I have written in the class library. I have rebuilt, cleaned, unloaded, reloaded everything multiple times.

A datapoint that may or may not matter: my class library depends on Newtonsoft.Json to do work on serializing/deserializing my objects. I can't see why I would need to reference that in my web API since it's calling outside of itself to do all of that work, and it's not throwing any errors.

I am truly at a loss as to why I can't grab this object FromBody specifically when referencing its class from a class library. Any help would be greatly appreciated. And further clarification can of course be provided.

EDIT

For further clarification, I am noticing some extremely bizarre behavior depending on what JSON I feed the POST endpoint.

```<code>{
  "id" : "some value"
}
</code>```

returns OK in the response body.

but

```<code>{
  "subClassObject" :
  {
    "id" : "some value"
  }
}
</code>```

still returns nothing.

I cannot stress enough that using the second JSON shape DOES WORK in the project that references SomeClass within the same solution exactly as intended.

Body:
I have two projects: one is a .NET Core class library, the other is a .NET Core minimal web API.

SomeClassLibrary.csproj

// SomeClass.cs
namespace SomeClassLibrary.Some.Arbitrary.Namespace
{
  public class SomeClass
  {
    public SomeClass() {}
    public SomeSubClass? subClassObject {get; set;}
  }
  public class SomeSubClass
  {
    public SomeSubClass() {}
    public string? id {get; set;}
  }
}

SomeMinimalWebAPI.csproj

// Program.cs
using SomeClassLibrary.Some.Arbitrary.Namespace;

...

app.MapPost("/endpoint", ([FromBody] SomeClass someClassObject) =>
  {
    // do stuff with someClassObject
    return "OK";
  });

...

If I POST from Postman, for example, with JSON like so:

{
  "subClassObject" :
  {
    "id" : "some value"
  }
}

I get a 200 status code, but no OK in the response body as expected.

I have tested that using [FromBody] SomeClass someClassObject works just fine when referenced in the same solution, but referenced from a class library as I have demonstrated here makes it seem like MapPost is hanging for some reason. I get no error codes. And to reiterate, I get a 200 in Postman, but no OK in the response body. Further, if I configure the Postman POST request with invalid JSON, I do receive an error response telling Required parameter "SomeClass someClassObject" was not provided from body.

I can even new up a SomeClass object, including its nested SomeSubClass object, and use it in the code. But as soon as I try to pass it as a parameter to be deserialized FromBody, it hangs with zero indication as to what is happening.

Everything seems to be referenced correctly, as my using statements referencing SomeClassLibrary.Some.Arbitrary.Namespace grant me access to the controllers and models and stuff I have written in the class library. I have rebuilt, cleaned, unloaded, reloaded everything multiple times.

A datapoint that may or may not matter: my class library depends on Newtonsoft.Json to do work on serializing/deserializing my objects. I can't see why I would need to reference that in my web API since it's calling outside of itself to do all of that work, and it's not throwing any errors.

I am truly at a loss as to why I can't grab this object FromBody specifically when referencing its class from a class library. Any help would be greatly appreciated. And further clarification can of course be provided.

EDIT

For further clarification, I am noticing some extremely bizarre behavior depending on what JSON I feed the POST endpoint.

{
  "id" : "some value"
}

returns OK in the response body.

but

{
  "subClassObject" :
  {
    "id" : "some value"
  }
}

still returns nothing.

I cannot stress enough that using the second JSON shape DOES WORK in the project that references SomeClass within the same solution exactly as intended.


问:
How to include LogRecord attributes as part of logging information on GCP (in json format)?
I would like to send LogRecord attributes (like processName, threadName, exc_info etc) as part of logging information on GCP in json format. How to do that? I am using below python code to send logs to GCP (with jsonpayload)

(thanks @ianyoung code)

```<code>import logging
import google.cloud.logging
import json

client = google.cloud.logging.Client()
client.setup_logging()

logger = logging.getLogger('test')

data_dict = {"hello": "world"}
logging.info(json.dumps(data_dict))
</code>```

Body:
I would like to send LogRecord attributes (like processName, threadName, exc_info etc) as part of logging information on GCP in json format. How to do that? I am using below python code to send logs to GCP (with jsonpayload)

(thanks @ianyoung code)

import logging
import google.cloud.logging
import json

client = google.cloud.logging.Client()
client.setup_logging()

logger = logging.getLogger('test')

data_dict = {"hello": "world"}
logging.info(json.dumps(data_dict))


问:
relocation truncated to fit: R_X86_64_32S against `.data'
I am running Windows 11 on an x64 machine and trying to run this x64 assembly program I wrote:

```<code>section .data
    var db 1

section .text
    global _start

_start:
    inc BYTE [var]   ; Increment the variable var by 1

    ; Exit the program
    mov eax, 60       ; System call number for "exit"
    xor edi, edi      ; Exit status code (0 for success)
    syscall
</code>```

I expected it to increment var by 1, but I get this error:

```<code>main.o: in function `_start':
main.asm:(.text+0x3): relocation truncated to fit: R_X86_64_32S against `.data'
</code>```

I tried to change db to dw, I tried changing BYTE to WORD, and I tried to move var into eax and then use the add instruction, but none of that worked. I am using NASM and ld. Here is how I assembled and attempted to run my program:

```<code>nasm -f elf64 main.asm
ld main.o
</code>```

If I run ld --verbose:

```<code>GNU ld (GNU Binutils) 2.37
  Supported emulations:
   i386pep
   i386pe
using internal linker script:
==================================================
/* Default linker script, for normal executables */
/* Copyright (C) 2014-2021 Free Software Foundation, Inc.
   Copying and distribution of this script, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.  */
OUTPUT_FORMAT(pei-x86-64)
SEARCH_DIR("=/c/temp/gcc/dest/x86_64-w64-mingw32/lib"); SEARCH_DIR("=/c/temp/gcc/dest/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
SECTIONS
{
  /* Make the virtual address and file offset synced if the alignment is
     lower than the target page size. */
  . = SIZEOF_HEADERS;
  . = ALIGN(__section_alignment__);
  .text  __image_base__ + ( __section_alignment__ < 0x1000 ? . : __section_alignment__ ) :
  {
    KEEP (*(SORT_NONE(.init)))
    *(.text)
    *(SORT(.text$*))
     *(.text.*)
     *(.gnu.linkonce.t.*)
    *(.glue_7t)
    *(.glue_7)
    . = ALIGN(8);
       /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here,
          we do not PROVIDE them.  This is because the ctors.o startup
          code in libgcc defines them as common symbols, with the
          expectation that they will be overridden by the definitions
          here.  If we PROVIDE the symbols then they will not be
          overridden and global constructors will not be run.
          See PR 22762 for more details.

          This does mean that it is not possible for a user to define
          their own __CTOR_LIST__ and __DTOR_LIST__ symbols; if they do,
          the content from those variables are included but the symbols
          defined here silently take precedence.  If they truly need to
          be redefined, a custom linker script will have to be used.
          (The custom script can just be a copy of this script with the
          PROVIDE() qualifiers added).
          In particular this means that ld -Ur does not work, because
          the proper __CTOR_LIST__ set by ld -Ur is overridden by a
          bogus __CTOR_LIST__ set by the final link.  See PR 46.  */
       ___CTOR_LIST__ = .;
       __CTOR_LIST__ = .;
       LONG (-1); LONG (-1);
       KEEP (*(.ctors));
       KEEP (*(.ctor));
       KEEP (*(SORT_BY_NAME(.ctors.*)));
       LONG (0); LONG (0);
       /* See comment about __CTOR_LIST__ above.  The same reasoning
          applies here too.  */
       ___DTOR_LIST__ = .;
       __DTOR_LIST__ = .;
       LONG (-1); LONG (-1);
       KEEP (*(.dtors));
       KEEP (*(.dtor));
       KEEP (*(SORT_BY_NAME(.dtors.*)));
       LONG (0); LONG (0);
    KEEP (*(SORT_NONE(.fini)))
    /* ??? Why is .gcc_exc here?  */
     *(.gcc_exc)
    PROVIDE (etext = .);
     KEEP (*(.gcc_except_table))
  }
  /* The Cygwin32 library uses a section to avoid copying certain data
     on fork.  This used to be named ".data".  The linker used
     to include this between __data_start__ and __data_end__, but that
     breaks building the cygwin32 dll.  Instead, we name the section
     ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
  .data BLOCK(__section_alignment__) :
  {
    __data_start__ = . ;
    *(.data)
    *(.data2)
    *(SORT(.data$*))
    KEEP(*(.jcr))
    __data_end__ = . ;
    *(.data_cygwin_nocopy)
  }
  .rdata BLOCK(__section_alignment__) :
  {
    *(.rdata)
             *(SORT(.rdata$*))
    . = ALIGN(4);
    __rt_psrelocs_start = .;
    KEEP(*(.rdata_runtime_pseudo_reloc))
    __rt_psrelocs_end = .;
  }
  __rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;
  ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
  __RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
  ___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
  __RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
  .eh_frame BLOCK(__section_alignment__) :
  {
    KEEP (*(.eh_frame*))
  }
  .pdata BLOCK(__section_alignment__) :
  {
    KEEP(*(.pdata*))
  }
  .xdata BLOCK(__section_alignment__) :
  {
    KEEP(*(.xdata*))
  }
  .bss BLOCK(__section_alignment__) :
  {
    __bss_start__ = . ;
    *(.bss)
    *(COMMON)
    __bss_end__ = . ;
  }
  .edata BLOCK(__section_alignment__) :
  {
    *(.edata)
  }
  /DISCARD/ :
  {
    *(.debug$S)
    *(.debug$T)
    *(.debug$F)
    *(.drectve)
     *(.note.GNU-stack)
     *(.gnu.lto_*)
  }
  .idata BLOCK(__section_alignment__) :
  {
    /* This cannot currently be handled with grouped sections.
        See pep.em:sort_sections.  */
    KEEP (SORT(*)(.idata$2))
    KEEP (SORT(*)(.idata$3))
    /* These zeroes mark the end of the import list.  */
    LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
    KEEP (SORT(*)(.idata$4))
    __IAT_start__ = .;
    SORT(*)(.idata$5)
    __IAT_end__ = .;
    KEEP (SORT(*)(.idata$6))
    KEEP (SORT(*)(.idata$7))
  }
  .CRT BLOCK(__section_alignment__) :
  {
    ___crt_xc_start__ = . ;
    KEEP (*(SORT(.CRT$XC*)))  /* C initialization */
    ___crt_xc_end__ = . ;
    ___crt_xi_start__ = . ;
    KEEP (*(SORT(.CRT$XI*)))  /* C++ initialization */
    ___crt_xi_end__ = . ;
    ___crt_xl_start__ = . ;
    KEEP (*(SORT(.CRT$XL*)))  /* TLS callbacks */
    /* ___crt_xl_end__ is defined in the TLS Directory support code */
    ___crt_xp_start__ = . ;
    KEEP (*(SORT(.CRT$XP*)))  /* Pre-termination */
    ___crt_xp_end__ = . ;
    ___crt_xt_start__ = . ;
    KEEP (*(SORT(.CRT$XT*)))  /* Termination */
    ___crt_xt_end__ = . ;
  }
  /* Windows TLS expects .tls$AAA to be at the start and .tls$ZZZ to be
     at the end of the .tls section.  This is important because _tls_start MUST
     be at the beginning of the section to enable SECREL32 relocations with TLS
     data.  */
  .tls BLOCK(__section_alignment__) :
  {
    ___tls_start__ = . ;
    KEEP (*(.tls$AAA))
    KEEP (*(.tls))
    KEEP (*(.tls$))
    KEEP (*(SORT(.tls$*)))
    KEEP (*(.tls$ZZZ))
    ___tls_end__ = . ;
  }
  .endjunk BLOCK(__section_alignment__) :
  {
    /* end is deprecated, don't use it */
    PROVIDE (end = .);
    PROVIDE ( _end = .);
     __end__ = .;
  }
  .rsrc BLOCK(__section_alignment__) : SUBALIGN(4)
  {
    KEEP (*(.rsrc))
    KEEP (*(.rsrc$*))
  }
  .reloc BLOCK(__section_alignment__) :
  {
    *(.reloc)
  }
  .stab BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.stab)
  }
  .stabstr BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.stabstr)
  }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section.  Unlike other targets that fake this by putting the
     section VMA at 0, the PE format will not allow it.  */
  /* DWARF 1.1 and DWARF 2.  */
  .debug_aranges BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_aranges)
  }
  .zdebug_aranges BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_aranges)
  }
  .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_pubnames)
  }
  .zdebug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_pubnames)
  }
  /* DWARF 2.  */
  .debug_info BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_info .gnu.linkonce.wi.*)
  }
  .zdebug_info BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_info .zdebug.gnu.linkonce.wi.*)
  }
  .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_abbrev)
  }
  .zdebug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_abbrev)
  }
  .debug_line BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_line)
  }
  .zdebug_line BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_line)
  }
  .debug_frame BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_frame*)
  }
  .zdebug_frame BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_frame*)
  }
  .debug_str BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_str)
  }
  .zdebug_str BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_str)
  }
  .debug_loc BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_loc)
  }
  .zdebug_loc BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_loc)
  }
  .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_macinfo)
  }
  .zdebug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_macinfo)
  }
  /* SGI/MIPS DWARF 2 extensions.  */
  .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_weaknames)
  }
  .zdebug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_weaknames)
  }
  .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_funcnames)
  }
  .zdebug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_funcnames)
  }
  .debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_typenames)
  }
  .zdebug_typenames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_typenames)
  }
  .debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_varnames)
  }
  .zdebug_varnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_varnames)
  }
  /* DWARF 3.  */
  .debug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_pubtypes)
  }
  .zdebug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_pubtypes)
  }
  .debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_ranges)
  }
  .zdebug_ranges BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_ranges)
  }
  /* DWARF 4.  */
  .debug_types BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_types .gnu.linkonce.wt.*)
  }
  .zdebug_types BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_types .gnu.linkonce.wt.*)
  }
  /* DWARF 5.  */
  .debug_addr BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_addr)
  }
  .zdebug_addr BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_addr)
  }
  .debug_line_str BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_line_str)
  }
  .zdebug_line_str BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_line_str)
  }
  .debug_loclists BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_loclists)
  }
  .zdebug_loclists BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_loclists)
  }
  .debug_macro BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_macro)
  }
  .zdebug_macro BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_macro)
  }
  .debug_names BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_names)
  }
  .zdebug_names BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_names)
  }
  .debug_rnglists BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_rnglists)
  }
  .zdebug_rnglists BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_rnglists)
  }
  .debug_str_offsets BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_str_offsets)
  }
  .zdebug_str_offsets BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_str_offsets)
  }
  .debug_sup BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_sup)
  }
  /* For Go and Rust.  */
  .debug_gdb_scripts BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_gdb_scripts)
  }
  .zdebug_gdb_scripts BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_gdb_scripts)
  }
}

==================================================
</code>```

When I did ld main.o, I got that error above. Any help would be appreciated, thanks! P.S I already looked at similar problems on this site, and tried the solutions, but they didn't solve my issue.

Body:
I am running Windows 11 on an x64 machine and trying to run this x64 assembly program I wrote:

section .data
    var db 1

section .text
    global _start

_start:
    inc BYTE [var]   ; Increment the variable var by 1

    ; Exit the program
    mov eax, 60       ; System call number for "exit"
    xor edi, edi      ; Exit status code (0 for success)
    syscall

I expected it to increment var by 1, but I get this error:

main.o: in function `_start':
main.asm:(.text+0x3): relocation truncated to fit: R_X86_64_32S against `.data'

I tried to change db to dw, I tried changing BYTE to WORD, and I tried to move var into eax and then use the add instruction, but none of that worked. I am using NASM and ld. Here is how I assembled and attempted to run my program:

nasm -f elf64 main.asm
ld main.o

If I run ld --verbose:

GNU ld (GNU Binutils) 2.37
  Supported emulations:
   i386pep
   i386pe
using internal linker script:
==================================================
/* Default linker script, for normal executables */
/* Copyright (C) 2014-2021 Free Software Foundation, Inc.
   Copying and distribution of this script, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notice and this notice are preserved.  */
OUTPUT_FORMAT(pei-x86-64)
SEARCH_DIR("=/c/temp/gcc/dest/x86_64-w64-mingw32/lib"); SEARCH_DIR("=/c/temp/gcc/dest/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
SECTIONS
{
  /* Make the virtual address and file offset synced if the alignment is
     lower than the target page size. */
  . = SIZEOF_HEADERS;
  . = ALIGN(__section_alignment__);
  .text  __image_base__ + ( __section_alignment__ < 0x1000 ? . : __section_alignment__ ) :
  {
    KEEP (*(SORT_NONE(.init)))
    *(.text)
    *(SORT(.text$*))
     *(.text.*)
     *(.gnu.linkonce.t.*)
    *(.glue_7t)
    *(.glue_7)
    . = ALIGN(8);
       /* Note: we always define __CTOR_LIST__ and ___CTOR_LIST__ here,
          we do not PROVIDE them.  This is because the ctors.o startup
          code in libgcc defines them as common symbols, with the
          expectation that they will be overridden by the definitions
          here.  If we PROVIDE the symbols then they will not be
          overridden and global constructors will not be run.
          See PR 22762 for more details.

          This does mean that it is not possible for a user to define
          their own __CTOR_LIST__ and __DTOR_LIST__ symbols; if they do,
          the content from those variables are included but the symbols
          defined here silently take precedence.  If they truly need to
          be redefined, a custom linker script will have to be used.
          (The custom script can just be a copy of this script with the
          PROVIDE() qualifiers added).
          In particular this means that ld -Ur does not work, because
          the proper __CTOR_LIST__ set by ld -Ur is overridden by a
          bogus __CTOR_LIST__ set by the final link.  See PR 46.  */
       ___CTOR_LIST__ = .;
       __CTOR_LIST__ = .;
       LONG (-1); LONG (-1);
       KEEP (*(.ctors));
       KEEP (*(.ctor));
       KEEP (*(SORT_BY_NAME(.ctors.*)));
       LONG (0); LONG (0);
       /* See comment about __CTOR_LIST__ above.  The same reasoning
          applies here too.  */
       ___DTOR_LIST__ = .;
       __DTOR_LIST__ = .;
       LONG (-1); LONG (-1);
       KEEP (*(.dtors));
       KEEP (*(.dtor));
       KEEP (*(SORT_BY_NAME(.dtors.*)));
       LONG (0); LONG (0);
    KEEP (*(SORT_NONE(.fini)))
    /* ??? Why is .gcc_exc here?  */
     *(.gcc_exc)
    PROVIDE (etext = .);
     KEEP (*(.gcc_except_table))
  }
  /* The Cygwin32 library uses a section to avoid copying certain data
     on fork.  This used to be named ".data".  The linker used
     to include this between __data_start__ and __data_end__, but that
     breaks building the cygwin32 dll.  Instead, we name the section
     ".data_cygwin_nocopy" and explicitly include it after __data_end__. */
  .data BLOCK(__section_alignment__) :
  {
    __data_start__ = . ;
    *(.data)
    *(.data2)
    *(SORT(.data$*))
    KEEP(*(.jcr))
    __data_end__ = . ;
    *(.data_cygwin_nocopy)
  }
  .rdata BLOCK(__section_alignment__) :
  {
    *(.rdata)
             *(SORT(.rdata$*))
    . = ALIGN(4);
    __rt_psrelocs_start = .;
    KEEP(*(.rdata_runtime_pseudo_reloc))
    __rt_psrelocs_end = .;
  }
  __rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;
  ___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
  __RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
  ___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
  __RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
  .eh_frame BLOCK(__section_alignment__) :
  {
    KEEP (*(.eh_frame*))
  }
  .pdata BLOCK(__section_alignment__) :
  {
    KEEP(*(.pdata*))
  }
  .xdata BLOCK(__section_alignment__) :
  {
    KEEP(*(.xdata*))
  }
  .bss BLOCK(__section_alignment__) :
  {
    __bss_start__ = . ;
    *(.bss)
    *(COMMON)
    __bss_end__ = . ;
  }
  .edata BLOCK(__section_alignment__) :
  {
    *(.edata)
  }
  /DISCARD/ :
  {
    *(.debug$S)
    *(.debug$T)
    *(.debug$F)
    *(.drectve)
     *(.note.GNU-stack)
     *(.gnu.lto_*)
  }
  .idata BLOCK(__section_alignment__) :
  {
    /* This cannot currently be handled with grouped sections.
        See pep.em:sort_sections.  */
    KEEP (SORT(*)(.idata$2))
    KEEP (SORT(*)(.idata$3))
    /* These zeroes mark the end of the import list.  */
    LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
    KEEP (SORT(*)(.idata$4))
    __IAT_start__ = .;
    SORT(*)(.idata$5)
    __IAT_end__ = .;
    KEEP (SORT(*)(.idata$6))
    KEEP (SORT(*)(.idata$7))
  }
  .CRT BLOCK(__section_alignment__) :
  {
    ___crt_xc_start__ = . ;
    KEEP (*(SORT(.CRT$XC*)))  /* C initialization */
    ___crt_xc_end__ = . ;
    ___crt_xi_start__ = . ;
    KEEP (*(SORT(.CRT$XI*)))  /* C++ initialization */
    ___crt_xi_end__ = . ;
    ___crt_xl_start__ = . ;
    KEEP (*(SORT(.CRT$XL*)))  /* TLS callbacks */
    /* ___crt_xl_end__ is defined in the TLS Directory support code */
    ___crt_xp_start__ = . ;
    KEEP (*(SORT(.CRT$XP*)))  /* Pre-termination */
    ___crt_xp_end__ = . ;
    ___crt_xt_start__ = . ;
    KEEP (*(SORT(.CRT$XT*)))  /* Termination */
    ___crt_xt_end__ = . ;
  }
  /* Windows TLS expects .tls$AAA to be at the start and .tls$ZZZ to be
     at the end of the .tls section.  This is important because _tls_start MUST
     be at the beginning of the section to enable SECREL32 relocations with TLS
     data.  */
  .tls BLOCK(__section_alignment__) :
  {
    ___tls_start__ = . ;
    KEEP (*(.tls$AAA))
    KEEP (*(.tls))
    KEEP (*(.tls$))
    KEEP (*(SORT(.tls$*)))
    KEEP (*(.tls$ZZZ))
    ___tls_end__ = . ;
  }
  .endjunk BLOCK(__section_alignment__) :
  {
    /* end is deprecated, don't use it */
    PROVIDE (end = .);
    PROVIDE ( _end = .);
     __end__ = .;
  }
  .rsrc BLOCK(__section_alignment__) : SUBALIGN(4)
  {
    KEEP (*(.rsrc))
    KEEP (*(.rsrc$*))
  }
  .reloc BLOCK(__section_alignment__) :
  {
    *(.reloc)
  }
  .stab BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.stab)
  }
  .stabstr BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.stabstr)
  }
  /* DWARF debug sections.
     Symbols in the DWARF debugging sections are relative to the beginning
     of the section.  Unlike other targets that fake this by putting the
     section VMA at 0, the PE format will not allow it.  */
  /* DWARF 1.1 and DWARF 2.  */
  .debug_aranges BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_aranges)
  }
  .zdebug_aranges BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_aranges)
  }
  .debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_pubnames)
  }
  .zdebug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_pubnames)
  }
  /* DWARF 2.  */
  .debug_info BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_info .gnu.linkonce.wi.*)
  }
  .zdebug_info BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_info .zdebug.gnu.linkonce.wi.*)
  }
  .debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_abbrev)
  }
  .zdebug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_abbrev)
  }
  .debug_line BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_line)
  }
  .zdebug_line BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_line)
  }
  .debug_frame BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_frame*)
  }
  .zdebug_frame BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_frame*)
  }
  .debug_str BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_str)
  }
  .zdebug_str BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_str)
  }
  .debug_loc BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_loc)
  }
  .zdebug_loc BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_loc)
  }
  .debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_macinfo)
  }
  .zdebug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_macinfo)
  }
  /* SGI/MIPS DWARF 2 extensions.  */
  .debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_weaknames)
  }
  .zdebug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_weaknames)
  }
  .debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_funcnames)
  }
  .zdebug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_funcnames)
  }
  .debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_typenames)
  }
  .zdebug_typenames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_typenames)
  }
  .debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_varnames)
  }
  .zdebug_varnames BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_varnames)
  }
  /* DWARF 3.  */
  .debug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_pubtypes)
  }
  .zdebug_pubtypes BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_pubtypes)
  }
  .debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_ranges)
  }
  .zdebug_ranges BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_ranges)
  }
  /* DWARF 4.  */
  .debug_types BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_types .gnu.linkonce.wt.*)
  }
  .zdebug_types BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_types .gnu.linkonce.wt.*)
  }
  /* DWARF 5.  */
  .debug_addr BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_addr)
  }
  .zdebug_addr BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_addr)
  }
  .debug_line_str BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_line_str)
  }
  .zdebug_line_str BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_line_str)
  }
  .debug_loclists BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_loclists)
  }
  .zdebug_loclists BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_loclists)
  }
  .debug_macro BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_macro)
  }
  .zdebug_macro BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_macro)
  }
  .debug_names BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_names)
  }
  .zdebug_names BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_names)
  }
  .debug_rnglists BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_rnglists)
  }
  .zdebug_rnglists BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_rnglists)
  }
  .debug_str_offsets BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_str_offsets)
  }
  .zdebug_str_offsets BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_str_offsets)
  }
  .debug_sup BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_sup)
  }
  /* For Go and Rust.  */
  .debug_gdb_scripts BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.debug_gdb_scripts)
  }
  .zdebug_gdb_scripts BLOCK(__section_alignment__) (NOLOAD) :
  {
    *(.zdebug_gdb_scripts)
  }
}

==================================================

When I did ld main.o, I got that error above. Any help would be appreciated, thanks! P.S I already looked at similar problems on this site, and tried the solutions, but they didn't solve my issue.


问:
Delete rows dataframe basing on column values
I'm new with python, so I apologize in advance for syntax mistakes or inaccuracies.

I'm working with this dataframe:

```<code>data = [[1, 5, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 2, 4], [1, 1, 1, 1, 1, 1 ,1 , 1, 1, 1, 1, 1, 1, 1],
[1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3], [6, 6, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 6]]
data = np.transpose(data)
dfe_filtered_bp= pd.DataFrame(data, columns=['nt','bcol','IDb','IDp'])
print('sample dfe: ')
print(dfe_filtered_bp)
</code>```

I'm trying to delete some lines from the dataframe. I tried with this for loop:

```<code>timestep_size = 1

rows_to_drop = []

for index_i, row_i in dfe_filtered_bp.iterrows():
    for index_j, row_j in dfe_filtered_bp.iterrows():
            if row_i['nt'] == row_j['nt'] + timestep_size & row_i['IDb'] == row_j['IDb'] & row_i['IDp'] == row_j['IDp']:
                rows_to_drop.append(row_j)
            else:
                pass
</code>```

basically, I want to store all the rows that must be deleted.
A row must be deleted if:

it has the same nt column value plus one of the previous line (row_i['nt'] == row_j['nt'] + timestep_size), AND

it has the same IDb and IDp column values of the previous line;
This is the expected output:

```<code>#   nt  bcol  IDb  IDp
#  1.0   1.0  1.0  6.0
#  5.0   1.0  1.0  6.0
#  1.0   1.0  2.0  4.0
#  1.0   1.0  2.0  5.0
#  2.0   1.0  3.0  6.0
#  4.0   1.0  3.0  6.0
</code>```

I have some problems with the code syntax.

In addition, I do not know how to delete all the rows contained in "rows_to_drop", from the "dfe_filtered_bp".

Can anyone help me? Thank you in advance

Body:
I'm new with python, so I apologize in advance for syntax mistakes or inaccuracies.

I'm working with this dataframe:

data = [[1, 5, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 2, 4], [1, 1, 1, 1, 1, 1 ,1 , 1, 1, 1, 1, 1, 1, 1],
[1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3], [6, 6, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 6]]
data = np.transpose(data)
dfe_filtered_bp= pd.DataFrame(data, columns=['nt','bcol','IDb','IDp'])
print('sample dfe: ')
print(dfe_filtered_bp)

I'm trying to delete some lines from the dataframe. I tried with this for loop:

timestep_size = 1

rows_to_drop = []

for index_i, row_i in dfe_filtered_bp.iterrows():
    for index_j, row_j in dfe_filtered_bp.iterrows():
            if row_i['nt'] == row_j['nt'] + timestep_size & row_i['IDb'] == row_j['IDb'] & row_i['IDp'] == row_j['IDp']:
                rows_to_drop.append(row_j)
            else:
                pass

basically, I want to store all the rows that must be deleted.
A row must be deleted if:

it has the same nt column value plus one of the previous line (row_i['nt'] == row_j['nt'] + timestep_size), AND

it has the same IDb and IDp column values of the previous line;
This is the expected output:

#   nt  bcol  IDb  IDp
#  1.0   1.0  1.0  6.0
#  5.0   1.0  1.0  6.0
#  1.0   1.0  2.0  4.0
#  1.0   1.0  2.0  5.0
#  2.0   1.0  3.0  6.0
#  4.0   1.0  3.0  6.0

I have some problems with the code syntax.

In addition, I do not know how to delete all the rows contained in "rows_to_drop", from the "dfe_filtered_bp".

Can anyone help me? Thank you in advance


问:
Toggle sprinting with touch controls
I have made the controls for an android port of an unity game, but i want the sprinting button to be toggeable, like you press it and it starts sprinting, you press it one more time and it stops sprinting.
Can you guys help me with toggling sprinting without coding? (Unity New Input System)

If theres no coding available, here is the PlayerController script for the game which idk if it can help.

Code

It's not my game, just an android port i made.

Title: Toggle sprinting with touch controls


问:
Rest Api xml (wsdl) returns httpUrlConnection.getInputStream()) is empty
I’m trying to implement a rest api that sends an xml post call and receives another xml response. But I get an error where httpUrlConnection.getInputStream()) is empty.

these is a service's method, in getMethodForValore, my httpUrlConnection.getInputStream()) is empty. And the code doesn't go on

```<code>public NodeList getEmailFromXML() throws IOException {
    String url = "https://sccimca4.rete.mic:2154/sap/bc/srt/sap-language=it
    HttpURLConnection httpUrlConnection = getURLConnection(url);
    httpUrlConnection.setRequestProperty("Accept-Charset", "UTF-8");
    Map<String, String> headers = new HashMap<>();
    headers.put("Content-Type", "text/xml");
    headers.put("Accept", "text/xml");

    setHeaders(httpUrlConnection, headers);
    httpUrlConnection.setRequestMethod("POST");
    httpUrlConnection.setDoOutput(true);

    String xml = my xml wsdl( is more then 1800 raws )
</code>```
```<code>   private NodeList getMethodForValore(HttpURLConnection httpUrlConnection, String xml) throws IOException {
    try {
        DataOutputStream wr = new DataOutputStream(httpUrlConnection.getOutputStream());
        System.out.println(httpUrlConnection.getOutputStream().toString());
        wr.writeBytes(xml);

        wr.flush();
        wr.close();
        BufferedReader in = new BufferedReader(new InputStreamReader(httpUrlConnection.getInputStream()));

        String inputLine;
        StringBuffer response = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();
        String finalvalue = response.toString();
        return ottieniValore(finalvalue);

        //return finalvalue;
    } catch (Exception ex) {
         ex.getMessage();
         return null;
    }
}

</code>```

My controller for the call

```<code>@PostMapping
@RequestMapping("/post")
NodeList post() throws IOException {
    return servService.getEmailFromXML();
}
</code>```
```<code></code>```

Body:
I’m trying to implement a rest api that sends an xml post call and receives another xml response. But I get an error where httpUrlConnection.getInputStream()) is empty.

these is a service's method, in getMethodForValore, my httpUrlConnection.getInputStream()) is empty. And the code doesn't go on

public NodeList getEmailFromXML() throws IOException {
    String url = "https://sccimca4.rete.mic:2154/sap/bc/srt/sap-language=it
    HttpURLConnection httpUrlConnection = getURLConnection(url);
    httpUrlConnection.setRequestProperty("Accept-Charset", "UTF-8");
    Map<String, String> headers = new HashMap<>();
    headers.put("Content-Type", "text/xml");
    headers.put("Accept", "text/xml");

    setHeaders(httpUrlConnection, headers);
    httpUrlConnection.setRequestMethod("POST");
    httpUrlConnection.setDoOutput(true);

    String xml = my xml wsdl( is more then 1800 raws )

   private NodeList getMethodForValore(HttpURLConnection httpUrlConnection, String xml) throws IOException {
    try {
        DataOutputStream wr = new DataOutputStream(httpUrlConnection.getOutputStream());
        System.out.println(httpUrlConnection.getOutputStream().toString());
        wr.writeBytes(xml);

        wr.flush();
        wr.close();
        BufferedReader in = new BufferedReader(new InputStreamReader(httpUrlConnection.getInputStream()));

        String inputLine;
        StringBuffer response = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            response.append(inputLine);
        }
        in.close();
        String finalvalue = response.toString();
        return ottieniValore(finalvalue);

        //return finalvalue;
    } catch (Exception ex) {
         ex.getMessage();
         return null;
    }
}

My controller for the call

@PostMapping
@RequestMapping("/post")
NodeList post() throws IOException {
    return servService.getEmailFromXML();
}