问:
dateformatter not showing right time
I have 2 y-axes and would like to plot time in the second y-axis according to 24 hrs format. below is the code but in the graph, the times come as 00:00:00. Only the second y-axis plot needs to be checked. the bar chart is plotted correctly with the corresponding score.

```<code>import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
from matplotlib.dates import DateFormatter

rc('mathtext', default='regular')

# Creating dataset
x = Trend1['Date']
SleepDisturbance = Trend1['DisturbancesCount']
Movements = Trend1['AverageMovementCount']
Duration = Trend1['DurationInNumbers']

# Creating figure
#fig = plt.figure()
w=0.5
fig, ax = plt.subplots(figsize=(20,10))

# Plotting dataset_2
#ax = fig.add_subplot(111)
ax.bar(x, SleepDisturbance, label='Sleep Disturbance')
ax.bar(x, Movements, label='Average Movment')

# Creating Twin axes for dataset_1
ax2 = ax.twinx()
ax2.plot(x, Duration, '-r', label='Sleep duration')

# Adding title
plt.title('Sleep Disturbnace and Avergae movment vs. Sleep Duration',
          fontweight="bold")

# Adding legend
ax.legend(loc='upper left', fontsize=20)
ax2.legend(loc='upper right', fontsize=20)

# adding grid
ax.grid()

# Adding labels
ax.set_xlabel("Date",fontsize=18, fontweight='bold')
ax.set_ylabel("Counts", fontsize=18, fontweight='bold')
ax2.set_ylabel("Sleep Duration", fontsize=18, fontweight='bold')

# Setting Y limits
#ax2.set_ylim(0, 35, ymin=None, ymax=None)

ax.set_ylim(0, 15)

hh_mm_ss = DateFormatter('%H:%M:%S')
#ax2.xaxis.set_major_formatter(hh_mm_ss)
ax2.yaxis.set_major_formatter(hh_mm_ss)

# Show plot
plt.savefig('SleepDisturbance and Average Movement vs. Sleep Duration.png',bbox_inches='tight')
plt.show()
</code>```

Below is the output graph

Title: dateformatter not showing right time

Body:
I have 2 y-axes and would like to plot time in the second y-axis according to 24 hrs format. below is the code but in the graph, the times come as 00:00:00. Only the second y-axis plot needs to be checked. the bar chart is plotted correctly with the corresponding score.

import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
from matplotlib.dates import DateFormatter

rc('mathtext', default='regular')

# Creating dataset
x = Trend1['Date']
SleepDisturbance = Trend1['DisturbancesCount']
Movements = Trend1['AverageMovementCount']
Duration = Trend1['DurationInNumbers']

# Creating figure
#fig = plt.figure()
w=0.5
fig, ax = plt.subplots(figsize=(20,10))

# Plotting dataset_2
#ax = fig.add_subplot(111)
ax.bar(x, SleepDisturbance, label='Sleep Disturbance')
ax.bar(x, Movements, label='Average Movment')

# Creating Twin axes for dataset_1
ax2 = ax.twinx()
ax2.plot(x, Duration, '-r', label='Sleep duration')

# Adding title
plt.title('Sleep Disturbnace and Avergae movment vs. Sleep Duration',
          fontweight="bold")

# Adding legend
ax.legend(loc='upper left', fontsize=20)
ax2.legend(loc='upper right', fontsize=20)

# adding grid
ax.grid()

# Adding labels
ax.set_xlabel("Date",fontsize=18, fontweight='bold')
ax.set_ylabel("Counts", fontsize=18, fontweight='bold')
ax2.set_ylabel("Sleep Duration", fontsize=18, fontweight='bold')

# Setting Y limits
#ax2.set_ylim(0, 35, ymin=None, ymax=None)

ax.set_ylim(0, 15)

hh_mm_ss = DateFormatter('%H:%M:%S')
#ax2.xaxis.set_major_formatter(hh_mm_ss)
ax2.yaxis.set_major_formatter(hh_mm_ss)

# Show plot
plt.savefig('SleepDisturbance and Average Movement vs. Sleep Duration.png',bbox_inches='tight')
plt.show()

Below is the output graph


来源: stackexchange

问:
Subclass EarlyStopper in scikit-optimize
I can't figure out how to subclass EarlyStopper to use it as callback in scikit-optimize (gp_minimize). Based on the documentation. How should I think when subclassinging?

Documentation: https://scikit-optimize.github.io/stable/modules/generated/skopt.callbacks.EarlyStopper.html#skopt.callbacks.EarlyStopper

This article provides an example:
https://medium.com/sitechassethealthcenter/gaussian-process-to-optimize-hyperparameters-of-an-algorithm-5b4810277527

```<code>from skopt.callbacks import EarlyStopper
class StoppingCriterion(EarlyStopper):
  def __init__(self, delta=0.05, n_best=10):
    super(EarlyStopper, self).__init__()
    self.delta = delta
    self.n_best = n_best
def _criterion(self, result):
  if len(result.func_vals) >= self.n_best:
    func_vals = np.sort(result.func_vals)
    worst = func_vals[self.n_best - 1]
    best = func_vals[0]
    return abs((best - worst)/worst) < self.delta
else:
    return None

</code>```

However, the above throws back an error.

I've also tried this:

```<code>class MyEarlyStopper(EarlyStopper):
    def __init__(self, patience=15, relative_improvement=0.01):
        super().__init__(patience=patience, relative_improvement=relative_improvement)
        self.best_loss = float("inf")

    def __call__(self, result):
        current_loss = result.fun  # current loss value
        if current_loss < self.best_loss * (1 - self.relative_improvement):
            # update the best loss and reset the patience counter
            self.best_loss = current_loss
            self.counter = 0
        else:
            # increment the patience counter
            self.counter += 1
        return self.counter >= self.patience

</code>```

This returns:

```<code>TypeError: object.__init__() takes exactly one argument (the instance to initialize)
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I can't figure out how to subclass EarlyStopper to use it as callback in scikit-optimize (gp_minimize). Based on the documentation. How should I think when subclassinging?

Documentation: https://scikit-optimize.github.io/stable/modules/generated/skopt.callbacks.EarlyStopper.html#skopt.callbacks.EarlyStopper

This article provides an example:
https://medium.com/sitechassethealthcenter/gaussian-process-to-optimize-hyperparameters-of-an-algorithm-5b4810277527

from skopt.callbacks import EarlyStopper
class StoppingCriterion(EarlyStopper):
  def __init__(self, delta=0.05, n_best=10):
    super(EarlyStopper, self).__init__()
    self.delta = delta
    self.n_best = n_best
def _criterion(self, result):
  if len(result.func_vals) >= self.n_best:
    func_vals = np.sort(result.func_vals)
    worst = func_vals[self.n_best - 1]
    best = func_vals[0]
    return abs((best - worst)/worst) < self.delta
else:
    return None

However, the above throws back an error.

I've also tried this:

class MyEarlyStopper(EarlyStopper):
    def __init__(self, patience=15, relative_improvement=0.01):
        super().__init__(patience=patience, relative_improvement=relative_improvement)
        self.best_loss = float("inf")

    def __call__(self, result):
        current_loss = result.fun  # current loss value
        if current_loss < self.best_loss * (1 - self.relative_improvement):
            # update the best loss and reset the patience counter
            self.best_loss = current_loss
            self.counter = 0
        else:
            # increment the patience counter
            self.counter += 1
        return self.counter >= self.patience

This returns:

TypeError: object.__init__() takes exactly one argument (the instance to initialize)


问:
Rsyslog with nas
Sure, here is an explanation of your problem:

My rsyslog configuration is not working. I am trying to use it to log messages from the system, but it is not capturing any of the messages. I have checked the configuration file and it seems to be set up correctly, but I am not sure what the issue could be. Any help or suggestions on how to troubleshoot this problem would be greatly appreciated.

```<code># Template
#template ( name="LongTagForwardFormat"
#           type="string"
#          string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%$.suffix%%msg:::sp-if-no-1st-sp%%msg%")

# Ruleset
ruleset(name="nas") {

    if ($fromhost-ip == 'x.x.x.x) then /test/syslog/admin/nas/nasperge.log
    & stop;

    if ($fromhost-ip == 'x.x.x.x') then /test/syslog/admin/nas/nastronote.log
    & stop;

# Règle "else" qui envoie tous les autres journaux vers le fichier purestorage.log
    if ($fromhost-ip != 'x.x.x.x' && $fromhost-ip != 'x.x.x.x') then /X.X.X.X/syslog/admin/nas/purestorage.log
    & stop;

#action(
#   type="omfile"
#   file="/test/syslog/admin/cloud/esx.log"
#)

#   if ($msg contains "verbose" || $syslogseverity-text == "info"
#       ) then {
#       stop
#   }
#   /test/syslog/admin/nas/nas.log
}

# Input`your text`
input(type="imudp"
    address="X.X.X.X"
    port="514"
    ruleset="nas"
)

#action(type="omfile" file="/test/syslog/server/web_farm/oscar-price.log")

</code>```

Title: Rsyslog with nas

Body:
Sure, here is an explanation of your problem:

My rsyslog configuration is not working. I am trying to use it to log messages from the system, but it is not capturing any of the messages. I have checked the configuration file and it seems to be set up correctly, but I am not sure what the issue could be. Any help or suggestions on how to troubleshoot this problem would be greatly appreciated.

# Template
#template ( name="LongTagForwardFormat"
#           type="string"
#          string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%$.suffix%%msg:::sp-if-no-1st-sp%%msg%")

# Ruleset
ruleset(name="nas") {

    if ($fromhost-ip == 'x.x.x.x) then /test/syslog/admin/nas/nasperge.log
    & stop;

    if ($fromhost-ip == 'x.x.x.x') then /test/syslog/admin/nas/nastronote.log
    & stop;

# Règle "else" qui envoie tous les autres journaux vers le fichier purestorage.log
    if ($fromhost-ip != 'x.x.x.x' && $fromhost-ip != 'x.x.x.x') then /X.X.X.X/syslog/admin/nas/purestorage.log
    & stop;

#action(
#   type="omfile"
#   file="/test/syslog/admin/cloud/esx.log"
#)

#   if ($msg contains "verbose" || $syslogseverity-text == "info"
#       ) then {
#       stop
#   }
#   /test/syslog/admin/nas/nas.log
}

# Input`your text`
input(type="imudp"
    address="X.X.X.X"
    port="514"
    ruleset="nas"
)

#action(type="omfile" file="/test/syslog/server/web_farm/oscar-price.log")


问:
All the records in is not getting fetched from BIM360 through Data Management API in Power Automate
We are fetching file name from the folders in BIM360 using power automate. We have an excel file in one drive and we want to update the date and version number for the file name mentioned in the excel file and this is based on the file that is uploaded in BIM360. The flow is we read the files in all folders and filter it based on the file name mentioned in the excel file. If the file mentioned in the excel file is present in bim360 then we extract the updated date and version number and then add it in respective columns in the excel file.

Only for few file names we are getting the updated date and version number. For some files it is not getting updated even when the file is present in the BIM360.

Let me know if any of you can help me in this. Will share more information if required.

Thank you

We tried changing the flow and condition but still it is not helping. No matter what we try all the file name from the bim360 is not getting fetched. Only few are being fetched properly.


问:
How can I select from sys.dm_tran_commit_table view as an application role user in SQL Server?
We use application roles in our application for accessing SQL Server.
We call sp_setapprole to set the app role before we do any other queries from the database.

We need to select from sys.dm_tran_commit_table view, for which we need to grant select permissions on this view to the app role.

Executing
GRANT SELECT ON [sys].[dm_tran_commit_table] TO [AriaEvents]
leads to the error

Permissions on server scoped catalog views or system stored procedures
or extended stored procedures can be granted only when the current
database is master.

However, as the application role is created in a specific database and not in master, the above cannot be executed in the master database.

How can we grant permissions to an application role to be able to select on [sys].[dm_tran_commit_table]?

Thanks

Tried to grant select permissions to the app role for [sys].[dm_tran_commit_table]

Tried to create another view in the dbo schema which does select * from [sys].[dm_tran_commit_table] and grant permissions to that view to the application role.

Permission grant succeeds, but the select does not work and no rows are returned.


问:
How to convert XML file into NodeJS array while keeping the same order as the original file?
I am trying to convert XML file into NodeJS object while keeping the same order as the original file.
I have tried using the library xml2js, but it produces an object (not an array), and merges the tags with the same name.

For example the following XML :

```<code><xml>
<a>...</a>
<b>...</b>
<a>...</a>
<c>...</c>
</xml>
</code>```

results, with xml2js, in something like :

```<code>{
a : [[Object], [Object]],
b : [[Object]],
c : [[Object]],
}
</code>```

'a' tags are merged, which I don't want.

What I want is something like :

```<code>[
{a : [Object]},
{b : [Object]},
{a : [Object]},
{c : [Object]}
]
</code>```

thus keeping the same order as the original XML file.
Do you have any idea how to achieve this ? Thanks ?

Body:
I am trying to convert XML file into NodeJS object while keeping the same order as the original file.
I have tried using the library xml2js, but it produces an object (not an array), and merges the tags with the same name.

For example the following XML :

<xml>
...
...
...
<c>...</c>
</xml>

results, with xml2js, in something like :

{
a : [[Object], [Object]],
b : [[Object]],
c : [[Object]],
}

'a' tags are merged, which I don't want.

What I want is something like :

[
{a : [Object]},
{b : [Object]},
{a : [Object]},
{c : [Object]}
]

thus keeping the same order as the original XML file.
Do you have any idea how to achieve this ? Thanks ?


问:
How to create a c# desktop app to intercept web notifications?
I would like to understand how to make a desktop application to interact with Chorme or firefox notifications.
in particular, I would like to know when a notification sends you to an address.

I followed this guide: "https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/notification-listener#requesting-access-to-the-listener"

i can see "title" and "bodyText"
but i can't see the action related to the notification.
thank you


问:
Netsuite - Suitetalk Creating Vendor Bill with Receipts linked to items
Currently I am using suitetalk 2020.1 called via c# code

In the UI if you have a purchase order with the selection on the MATCH BILL TO RECEIPT = true and you initialize and create a vendor bill, the corresponding items on the vendor bill will have the receipt linked to it (the billReceiptsList for the item in populated with the corresponding receipt.

If you delete that bill and then connect to your NetSuite account ( and do a vendor bill Initialize from the corresponding Initialize of a vendor bill for that same PO, it will return XML with that same billReceiptsList populated.

If you do a save of a vendor receipt (which also has that same bill receiptsList populated, the bill is successfully added but the receiptsList values that were passed in (the same ones that were created in the initialize of the vendor bill) do not show up on the vendor bill when it comes over via suiteTalk.

Included I will show the XML of the initialize result as well as the Add list for the vendor bill where you can see the receiptsList values populated and no error returned from the add list. The end result in Netsuite however does not have the Receipts populated. Does anyone know if there is something additional that might need done to link the receipt to the item line(s)

I have not included the code but know that the code would simply initialize that bill and fill in some various values as shown in the add requests xml

```<code><soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2020_1.platform.webservices.netsuite.com">
            <platformMsgs:nsId>WEBSERVICES_TSTDRV2473767_010320232025040423622525377_565de2</platformMsgs:nsId>
        </platformMsgs:documentInfo>
    </soapenv:Header>
    <soapenv:Body>
        <initializeResponse xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
            <readResponse>
                <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com"/>
                <record xsi:type="tranPurch:VendorBill" xmlns:tranPurch="urn:purchases_2020_1.transactions.webservices.netsuite.com">
                    <tranPurch:customForm internalId="153" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Z - Vendor Bill</platformCore:name>
                    </tranPurch:customForm>
                    <tranPurch:billAddressList internalId="244963" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Amazon</platformCore:name>
                    </tranPurch:billAddressList>
                    <tranPurch:account internalId="25" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>2000 Accounts Payable</platformCore:name>
                    </tranPurch:account>
                    <tranPurch:entity internalId="1552" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Amazon</platformCore:name>
                    </tranPurch:entity>
                    <tranPurch:subsidiary internalId="1" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Honeycomb Mfg.</platformCore:name>
                    </tranPurch:subsidiary>
                    <tranPurch:approvalStatus internalId="2" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Approved</platformCore:name>
                    </tranPurch:approvalStatus>
                    <tranPurch:postingPeriod internalId="156" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Jan 2010</platformCore:name>
                    </tranPurch:postingPeriod>
                    <tranPurch:tranDate>2023-01-03T00:00:00.000-08:00</tranPurch:tranDate>
                    <tranPurch:currencyName>USA</tranPurch:currencyName>
                    <tranPurch:exchangeRate>1.0</tranPurch:exchangeRate>
                    <tranPurch:dueDate>2023-01-03T00:00:00.000-08:00</tranPurch:dueDate>
                    <tranPurch:userTotal>284.0</tranPurch:userTotal>
                    <tranPurch:paymentHold>false</tranPurch:paymentHold>
                    <tranPurch:currency internalId="1" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>USA</platformCore:name>
                    </tranPurch:currency>
                    <tranPurch:itemList>
                        <tranPurch:item>
                            <tranPurch:item internalId="387" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                                <platformCore:name>ACC00001</platformCore:name>
                            </tranPurch:item>
                            <tranPurch:orderDoc>10830</tranPurch:orderDoc>
                            <tranPurch:orderLine>1</tranPurch:orderLine>
                            <tranPurch:quantity>4.0</tranPurch:quantity>
                            <tranPurch:description>400 Watt Power Supply</tranPurch:description>
                            <tranPurch:rate>71.00</tranPurch:rate>
                            <tranPurch:amount>284.0</tranPurch:amount>
                            <tranPurch:location internalId="2" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                                <platformCore:name>01: San Francisco</platformCore:name>
                            </tranPurch:location>
                            <tranPurch:billreceiptsList xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                                <platformCore:recordRef internalId="10831">
                                    <platformCore:name>REC00000230</platformCore:name>
                                </platformCore:recordRef>
                            </tranPurch:billreceiptsList>
                        </tranPurch:item>
                    </tranPurch:itemList>
                    <tranPurch:customFieldList xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:customField xsi:type="platformCore:BooleanCustomFieldRef" scriptId="custbody_powf_se_ok" internalId="223">
                            <platformCore:value>false</platformCore:value>
                        </platformCore:customField>
                        <platformCore:customField xsi:type="platformCore:BooleanCustomFieldRef" scriptId="custbody_pacejet_quoted" internalId="5043">
                            <platformCore:value>false</platformCore:value>
                        </platformCore:customField>
                        <platformCore:customField xsi:type="platformCore:SelectCustomFieldRef" scriptId="custbodyhj_tc_po_status" internalId="4637">
                            <platformCore:value typeId="483" internalId="1">
                                <platformCore:name>New</platformCore:name>
                            </platformCore:value>
                        </platformCore:customField>
                        <platformCore:customField xsi:type="platformCore:BooleanCustomFieldRef" scriptId="custbody_hj_devqa_checkbox" internalId="4567">
                            <platformCore:value>false</platformCore:value>
                        </platformCore:customField>
                        <platformCore:customField xsi:type="platformCore:BooleanCustomFieldRef" scriptId="custbody_powf_ctrl_ok" internalId="220">
                            <platformCore:value>false</platformCore:value>
                        </platformCore:customField>
                    </tranPurch:customFieldList>
                </record>
            </readResponse>
        </initializeResponse>
    </soapenv:Body>
</soapenv:Envelope>
</code>```

```<code><soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Header>
        <preferences xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
            <warningAsError>false</warningAsError>
            <ignoreReadOnlyFields>true</ignoreReadOnlyFields>
        </preferences>
        <tokenPassport xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
            <account xmlns="urn:core_2020_1.platform.webservices.netsuite.com">TSTDRV2473767</account>
            <consumerKey xmlns="urn:core_2020_1.platform.webservices.netsuite.com">****************************************************************</consumerKey>
            <token xmlns="urn:core_2020_1.platform.webservices.netsuite.com">****************************************************************</token>
            <nonce xmlns="urn:core_2020_1.platform.webservices.netsuite.com">5261272433702077534</nonce>
            <timestamp xmlns="urn:core_2020_1.platform.webservices.netsuite.com">1672767849</timestamp>
            <signature algorithm="HMAC_SHA256" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">********************************************</signature>
        </tokenPassport>
    </soap:Header>
    <soap:Body>
        <addList xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
            <record externalId="HJ_BILL__17" xsi:type="q1:VendorBill" xmlns:q1="urn:purchases_2020_1.transactions.webservices.netsuite.com">
                <q1:customForm internalId="153">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Z - Vendor Bill</name>
                </q1:customForm>
                <q1:billAddressList internalId="244963">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Amazon</name>
                </q1:billAddressList>
                <q1:account internalId="25">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">2000 Accounts Payable</name>
                </q1:account>
                <q1:entity internalId="1552"/>
                <q1:subsidiary internalId="1">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Honeycomb Mfg.</name>
                </q1:subsidiary>
                <q1:approvalStatus internalId="2">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Approved</name>
                </q1:approvalStatus>
                <q1:postingPeriod internalId="156">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Jan 2010</name>
                </q1:postingPeriod>
                <q1:tranDate>2022-12-28T00:00:00</q1:tranDate>
                <q1:currencyName>USA</q1:currencyName>
                <q1:exchangeRate>1</q1:exchangeRate>
                <q1:dueDate>2023-01-03T03:00:00-05:00</q1:dueDate>
                <q1:tranId>JCV1347</q1:tranId>
                <q1:paymentHold>false</q1:paymentHold>
                <q1:currency internalId="1">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">USA</name>
                </q1:currency>
                <q1:location internalId="2">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">01: San Francisco</name>
                </q1:location>
                <q1:expenseList replaceAll="false"/>
                <q1:itemList replaceAll="false">
                    <q1:item>
                        <q1:item type="inventoryItem" internalId="387">
                            <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">387</name>
                        </q1:item>
                        <q1:orderDoc>10830</q1:orderDoc>
                        <q1:orderLine>1</q1:orderLine>
                        <q1:quantity>4</q1:quantity>
                        <q1:rate>50</q1:rate>
                        <q1:amount>45</q1:amount>
                        <q1:location internalId="2">
                            <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">01: San Francisco</name>
                        </q1:location>
                        <q1:billreceiptsList>
                            <recordRef internalId="10831" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                                <name>REC00000230</name>
                            </recordRef>
                        </q1:billreceiptsList>
                    </q1:item>
                </q1:itemList>
                <q1:landedCostsList replaceAll="false"/>
                <q1:customFieldList>
                    <customField scriptId="custbody_powf_se_ok" internalId="223" xsi:type="BooleanCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value>false</value>
                    </customField>
                    <customField scriptId="custbody_pacejet_quoted" internalId="5043" xsi:type="BooleanCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value>false</value>
                    </customField>
                    <customField scriptId="custbodyhj_tc_po_status" internalId="4637" xsi:type="SelectCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value typeId="483" internalId="1">
                            <name>New</name>
                        </value>
                    </customField>
                    <customField scriptId="custbody_hj_devqa_checkbox" internalId="4567" xsi:type="BooleanCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value>false</value>
                    </customField>
                    <customField scriptId="custbody_powf_ctrl_ok" internalId="220" xsi:type="BooleanCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value>false</value>
                    </customField>
                </q1:customFieldList>
            </record>
        </addList>
    </soap:Body>
</soap:Envelope>
</code>```

Body:
Currently I am using suitetalk 2020.1 called via c# code

In the UI if you have a purchase order with the selection on the MATCH BILL TO RECEIPT = true and you initialize and create a vendor bill, the corresponding items on the vendor bill will have the receipt linked to it (the billReceiptsList for the item in populated with the corresponding receipt.

If you delete that bill and then connect to your NetSuite account ( and do a vendor bill Initialize from the corresponding Initialize of a vendor bill for that same PO, it will return XML with that same billReceiptsList populated.

If you do a save of a vendor receipt (which also has that same bill receiptsList populated, the bill is successfully added but the receiptsList values that were passed in (the same ones that were created in the initialize of the vendor bill) do not show up on the vendor bill when it comes over via suiteTalk.

Included I will show the XML of the initialize result as well as the Add list for the vendor bill where you can see the receiptsList values populated and no error returned from the add list. The end result in Netsuite however does not have the Receipts populated. Does anyone know if there is something additional that might need done to link the receipt to the item line(s)

I have not included the code but know that the code would simply initialize that bill and fill in some various values as shown in the add requests xml

<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2020_1.platform.webservices.netsuite.com">
            <platformMsgs:nsId>WEBSERVICES_TSTDRV2473767_010320232025040423622525377_565de2</platformMsgs:nsId>
        </platformMsgs:documentInfo>
    </soapenv:Header>
    <soapenv:Body>
        <initializeResponse xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
            <readResponse>
                <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com"/>
                <record xsi:type="tranPurch:VendorBill" xmlns:tranPurch="urn:purchases_2020_1.transactions.webservices.netsuite.com">
                    <tranPurch:customForm internalId="153" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Z - Vendor Bill</platformCore:name>
                    </tranPurch:customForm>
                    <tranPurch:billAddressList internalId="244963" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Amazon</platformCore:name>
                    </tranPurch:billAddressList>
                    <tranPurch:account internalId="25" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>2000 Accounts Payable</platformCore:name>
                    </tranPurch:account>
                    <tranPurch:entity internalId="1552" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Amazon</platformCore:name>
                    </tranPurch:entity>
                    <tranPurch:subsidiary internalId="1" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Honeycomb Mfg.</platformCore:name>
                    </tranPurch:subsidiary>
                    <tranPurch:approvalStatus internalId="2" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Approved</platformCore:name>
                    </tranPurch:approvalStatus>
                    <tranPurch:postingPeriod internalId="156" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>Jan 2010</platformCore:name>
                    </tranPurch:postingPeriod>
                    <tranPurch:tranDate>2023-01-03T00:00:00.000-08:00</tranPurch:tranDate>
                    <tranPurch:currencyName>USA</tranPurch:currencyName>
                    <tranPurch:exchangeRate>1.0</tranPurch:exchangeRate>
                    <tranPurch:dueDate>2023-01-03T00:00:00.000-08:00</tranPurch:dueDate>
                    <tranPurch:userTotal>284.0</tranPurch:userTotal>
                    <tranPurch:paymentHold>false</tranPurch:paymentHold>
                    <tranPurch:currency internalId="1" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:name>USA</platformCore:name>
                    </tranPurch:currency>
                    <tranPurch:itemList>
                        <tranPurch:item>
                            <tranPurch:item internalId="387" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                                <platformCore:name>ACC00001</platformCore:name>
                            </tranPurch:item>
                            <tranPurch:orderDoc>10830</tranPurch:orderDoc>
                            <tranPurch:orderLine>1</tranPurch:orderLine>
                            <tranPurch:quantity>4.0</tranPurch:quantity>
                            <tranPurch:description>400 Watt Power Supply</tranPurch:description>
                            <tranPurch:rate>71.00</tranPurch:rate>
                            <tranPurch:amount>284.0</tranPurch:amount>
                            <tranPurch:location internalId="2" xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                                <platformCore:name>01: San Francisco</platformCore:name>
                            </tranPurch:location>
                            <tranPurch:billreceiptsList xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                                <platformCore:recordRef internalId="10831">
                                    <platformCore:name>REC00000230</platformCore:name>
                                </platformCore:recordRef>
                            </tranPurch:billreceiptsList>
                        </tranPurch:item>
                    </tranPurch:itemList>
                    <tranPurch:customFieldList xmlns:platformCore="urn:core_2020_1.platform.webservices.netsuite.com">
                        <platformCore:customField xsi:type="platformCore:BooleanCustomFieldRef" scriptId="custbody_powf_se_ok" internalId="223">
                            <platformCore:value>false</platformCore:value>
                        </platformCore:customField>
                        <platformCore:customField xsi:type="platformCore:BooleanCustomFieldRef" scriptId="custbody_pacejet_quoted" internalId="5043">
                            <platformCore:value>false</platformCore:value>
                        </platformCore:customField>
                        <platformCore:customField xsi:type="platformCore:SelectCustomFieldRef" scriptId="custbodyhj_tc_po_status" internalId="4637">
                            <platformCore:value typeId="483" internalId="1">
                                <platformCore:name>New</platformCore:name>
                            </platformCore:value>
                        </platformCore:customField>
                        <platformCore:customField xsi:type="platformCore:BooleanCustomFieldRef" scriptId="custbody_hj_devqa_checkbox" internalId="4567">
                            <platformCore:value>false</platformCore:value>
                        </platformCore:customField>
                        <platformCore:customField xsi:type="platformCore:BooleanCustomFieldRef" scriptId="custbody_powf_ctrl_ok" internalId="220">
                            <platformCore:value>false</platformCore:value>
                        </platformCore:customField>
                    </tranPurch:customFieldList>
                </record>
            </readResponse>
        </initializeResponse>
    </soapenv:Body>
</soapenv:Envelope>

<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Header>
        <preferences xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
            <warningAsError>false</warningAsError>
            <ignoreReadOnlyFields>true</ignoreReadOnlyFields>
        </preferences>
        <tokenPassport xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
            <account xmlns="urn:core_2020_1.platform.webservices.netsuite.com">TSTDRV2473767</account>
            <consumerKey xmlns="urn:core_2020_1.platform.webservices.netsuite.com">****************************************************************</consumerKey>
            <token xmlns="urn:core_2020_1.platform.webservices.netsuite.com">****************************************************************</token>
            <nonce xmlns="urn:core_2020_1.platform.webservices.netsuite.com">5261272433702077534</nonce>
            <timestamp xmlns="urn:core_2020_1.platform.webservices.netsuite.com">1672767849</timestamp>
            <signature algorithm="HMAC_SHA256" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">********************************************</signature>
        </tokenPassport>
    </soap:Header>
    <soap:Body>
        <addList xmlns="urn:messages_2020_1.platform.webservices.netsuite.com">
            <record externalId="HJ_BILL__17" xsi:type="q1:VendorBill" xmlns:q1="urn:purchases_2020_1.transactions.webservices.netsuite.com">
                <q1:customForm internalId="153">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Z - Vendor Bill</name>
                </q1:customForm>
                <q1:billAddressList internalId="244963">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Amazon</name>
                </q1:billAddressList>
                <q1:account internalId="25">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">2000 Accounts Payable</name>
                </q1:account>
                <q1:entity internalId="1552"/>
                <q1:subsidiary internalId="1">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Honeycomb Mfg.</name>
                </q1:subsidiary>
                <q1:approvalStatus internalId="2">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Approved</name>
                </q1:approvalStatus>
                <q1:postingPeriod internalId="156">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">Jan 2010</name>
                </q1:postingPeriod>
                <q1:tranDate>2022-12-28T00:00:00</q1:tranDate>
                <q1:currencyName>USA</q1:currencyName>
                <q1:exchangeRate>1</q1:exchangeRate>
                <q1:dueDate>2023-01-03T03:00:00-05:00</q1:dueDate>
                <q1:tranId>JCV1347</q1:tranId>
                <q1:paymentHold>false</q1:paymentHold>
                <q1:currency internalId="1">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">USA</name>
                </q1:currency>
                <q1:location internalId="2">
                    <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">01: San Francisco</name>
                </q1:location>
                <q1:expenseList replaceAll="false"/>
                <q1:itemList replaceAll="false">
                    <q1:item>
                        <q1:item type="inventoryItem" internalId="387">
                            <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">387</name>
                        </q1:item>
                        <q1:orderDoc>10830</q1:orderDoc>
                        <q1:orderLine>1</q1:orderLine>
                        <q1:quantity>4</q1:quantity>
                        <q1:rate>50</q1:rate>
                        <q1:amount>45</q1:amount>
                        <q1:location internalId="2">
                            <name xmlns="urn:core_2020_1.platform.webservices.netsuite.com">01: San Francisco</name>
                        </q1:location>
                        <q1:billreceiptsList>
                            <recordRef internalId="10831" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                                <name>REC00000230</name>
                            </recordRef>
                        </q1:billreceiptsList>
                    </q1:item>
                </q1:itemList>
                <q1:landedCostsList replaceAll="false"/>
                <q1:customFieldList>
                    <customField scriptId="custbody_powf_se_ok" internalId="223" xsi:type="BooleanCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value>false</value>
                    </customField>
                    <customField scriptId="custbody_pacejet_quoted" internalId="5043" xsi:type="BooleanCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value>false</value>
                    </customField>
                    <customField scriptId="custbodyhj_tc_po_status" internalId="4637" xsi:type="SelectCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value typeId="483" internalId="1">
                            <name>New</name>
                        </value>
                    </customField>
                    <customField scriptId="custbody_hj_devqa_checkbox" internalId="4567" xsi:type="BooleanCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value>false</value>
                    </customField>
                    <customField scriptId="custbody_powf_ctrl_ok" internalId="220" xsi:type="BooleanCustomFieldRef" xmlns="urn:core_2020_1.platform.webservices.netsuite.com">
                        <value>false</value>
                    </customField>
                </q1:customFieldList>
            </record>
        </addList>
    </soap:Body>
</soap:Envelope>


问:
Lineare Regression with binary variable
Good day,

I hope you could help me.

My problem: I'm doing a linear regression with SPSS. Among other things, I am interested in gender differences. Since a distinction is only made between men and women, a binary variable is appropriate.

My main problem:
My results change if I define the binary variable differently.
If I set male = 1, female = 2, the values are different than if I set male = 0 and female = 1.
How can that be? And what is correct?

Thank you & stay healthy

The first is with male = 1, female = 2.
The second is with male = 0, female = 1.

Title: Lineare Regression with binary variable


问:
Adobe PDF macro to scrape data from Attachmate extra x-treme
I’ve found a wealth of information on scraping data from Attachmate extra x-treme with VBA using Microsoft products, but I’m trying to find out if that’s feasible from JavaScript.  I’ve got PDF forms that I’d like to self populate from an Attachmate session and not finding any resources to scrape from Attachmate with JavaScript.  Any recommendations welcome.</p>


问:
Animate Presence `exit` prop is not working with array elements
I'm new to Framer Motion. I have a trouble with it.

I have an array of titles. I'm trying to animate them one by one. First fades in then fades out. It can be doable with <AnimationPresence /> as far as I know. I did like that:

```<code>export default function Title() {

    const texts = [
        {text: "UNLEASH YOUR POWER", id: 1},
        {text: "SURRENDER TO YOUR FEELINGS", id: 2},
        {text: "RELEASE INNER BEAST", id: 3},
        {text: "EXPLORE PREDATOR SENSE", id: 4}
    ]

    const [list, updateList] = useState(texts)

    return <div className='title'>
        <AnimatePresence>
            {list.map((item, index, arr) => {
                updateList(arr.filter(jtem => jtem.text !== item.text))
                return <motion.span
                    key={item.id}
                    initial={{opacity: 0, scale: 0.5}}
                    animate={{opacity: 1, scale: 1}}
                    exit={{opacity: 0}}
                    transition={{
                        duration: 0.8,
                        delay: 0.5,
                        ease: [0, 0.71, 0.2, 1.01],
                        // repeat: Infinity
                    }}
                >
                    {item.text}
                </motion.span>
            })}
        </AnimatePresence>
    </div>
}
</code>```

But, it's not working as expected. They're all animating in same time and never fade out. How could it be tackled?

Body:
I'm new to Framer Motion. I have a trouble with it.

I have an array of titles. I'm trying to animate them one by one. First fades in then fades out. It can be doable with <AnimationPresence /> as far as I know. I did like that:

export default function Title() {

    const texts = [
        {text: "UNLEASH YOUR POWER", id: 1},
        {text: "SURRENDER TO YOUR FEELINGS", id: 2},
        {text: "RELEASE INNER BEAST", id: 3},
        {text: "EXPLORE PREDATOR SENSE", id: 4}
    ]

    const [list, updateList] = useState(texts)

    return

        <AnimatePresence>
            {list.map((item, index, arr) => {
                updateList(arr.filter(jtem => jtem.text !== item.text))
                return <motion.span
                    key={item.id}
                    initial={{opacity: 0, scale: 0.5}}
                    animate={{opacity: 1, scale: 1}}
                    exit={{opacity: 0}}
                    transition={{
                        duration: 0.8,
                        delay: 0.5,
                        ease: [0, 0.71, 0.2, 1.01],
                        // repeat: Infinity
                    }}
                >
                    {item.text}
                </motion.span>
            })}
        </AnimatePresence>

}

But, it's not working as expected. They're all animating in same time and never fade out. How could it be tackled?


问:
How to install a specific version of Redis using command in Ubuntu terminal?
Is there any way to specify the version while installing through the terminal? I specifically want Redis version 3.2.5 for a certain project.

I tried

```<code>sudo apt install redis
</code>```

but it does not give control over the version.

Body:
Is there any way to specify the version while installing through the terminal? I specifically want Redis version 3.2.5 for a certain project.

I tried

sudo apt install redis

but it does not give control over the version.


问:
Finding the geographic coordinates of the centre of a cluster in a stitched image
This is a problem in the domain of precision agriculture. Using a UAV, multiple images of the field are captured along with their geographic coordinates (lat, lon). Images have 80% overlap. Using GPS data and ORB feature matching, a map of the entire field is stitched. From the stitched image, clusters of weeds are extracted (say in the form a mask - using segmentation).

Now, comes the problem. How to find the geographic coordinates of the center of each of these clusters?

I haven't been able to get started with this problem. I understand that I can retrieve the center of the cluster in terms of image coordinates (x and y) but unable to understand how to retrieve the corresponding geographic coordinates. I am trying to do this in python.


问:
Email verification firebase React Native Expo Go
I have been building using firebase, expo and expo go. I want to redirect a user to the app once authentication is done. Is that possible using React Native expo?</p>


问:
How to find which queries are supported on a given query engine
I'm trying to find a way to know which queries are supported on a given query engine. For example, I know that some queries that work on Postgresql won't work on sqlite.

I'm now searching for queries that would work on Snowflake and not on DuckDB (or vice versa) and this makes me wonder: what to search for in the documentation.

With this general question, I'm looking for some hint (hitch hiking tips) to look in the documentation of a query engine to see what sql keyword argument won't work.

Thank you very much for your help and your input !


问:
Unable to load shared library 'libwkhtmltox' or one of its dependencies
I am using https://github.com/rdvojmoc/DinkToPdf  DinkToPDF library to convert a html to PDF.

Everything working fine in local environment.

But in the dev environment, it throws some errors when converting html to pdf.

System.AggregateException: One or more errors occurred. (Unable to load shared library 'libwkhtmltox' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibwkhtmltox: cannot open shared object file: No such file or directory) ---> System.DllNotFoundException: Unable to load shared library 'libwkhtmltox' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibwkhtmltox: cannot open shared object file: No such file or directory at DinkToPdf.WkHtmlToXBindings.wkhtmltopdf_init(Int32 useGraphics)

I had tried below solutions, but they did not work.

I added DinkToPdfCopyDependencies package but it works loclly but not works in dev env

<PackageReference Include="DinkToPdfCopyDependencies" Version="1.0.8" />

then I copied package manually and

```<code>       <None Update="libwkhtmltox.dll">
           <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
           <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       </None>
       <None Update="libwkhtmltox.dylib">
           <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
           <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       </None>
       <None Update="libwkhtmltox.so">
           <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
           <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       </None>
   </ItemGroup>
</Project>
</code>```

This also working in local environment, but when did not work in dev environment.

Anyone works with  DinkToPDF, please help me fix this issue.

OR

Does anyone know any libraries to covert html to pdf in .NET 6 (Free and It should has MIT license)

Please suggest something. I am struggling with more than two days.

Body:
I am using https://github.com/rdvojmoc/DinkToPdf  DinkToPDF library to convert a html to PDF.

Everything working fine in local environment.

But in the dev environment, it throws some errors when converting html to pdf.

System.AggregateException: One or more errors occurred. (Unable to load shared library 'libwkhtmltox' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibwkhtmltox: cannot open shared object file: No such file or directory) ---> System.DllNotFoundException: Unable to load shared library 'libwkhtmltox' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibwkhtmltox: cannot open shared object file: No such file or directory at DinkToPdf.WkHtmlToXBindings.wkhtmltopdf_init(Int32 useGraphics)

I had tried below solutions, but they did not work.

I added DinkToPdfCopyDependencies package but it works loclly but not works in dev env

<PackageReference Include="DinkToPdfCopyDependencies" Version="1.0.8" />

then I copied package manually and

       <None Update="libwkhtmltox.dll">
           <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
           <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       </None>
       <None Update="libwkhtmltox.dylib">
           <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
           <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       </None>
       <None Update="libwkhtmltox.so">
           <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
           <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
       </None>
   </ItemGroup>
</Project>

This also working in local environment, but when did not work in dev environment.

Anyone works with  DinkToPDF, please help me fix this issue.

OR

Does anyone know any libraries to covert html to pdf in .NET 6 (Free and It should has MIT license)

Please suggest something. I am struggling with more than two days.


问:
Solving ModuleNotFoundError on a System with Multiple Python Versions
I am experiencing an issue where I am getting a ModuleNotFoundError when running a script called ConverttoWIF.py. The error message is No module named 'base58'.

When using pip freeze, the output of pip freeze is as follows:

```<code>
altgraph==0.17.3
base58==2.1.1
click==8.1.3
colorama==0.4.6
dlib==19.24.0
face-recognition==1.3.0
face-recognition-models==0.3.0
future==0.18.2
numpy==1.24.1
opencv-python==4.7.0.68
pefile==2022.5.30
Pillow==9.4.0
pyinstaller==5.7.0
pyinstaller-hooks-contrib==2022.14
PyQt5==5.15.7
PyQt5-Qt5==5.15.2
PyQt5-sip==12.11.0
pywin32-ctypes==0.2.0
</code>```

As you can see, I have already installed all the necessary modules.

I have also modified the PATH environment variable to include the path to the module in C:\Users\Captain\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts.

The directory contains the following files:

```<code>Directory of C:\Users\Captain\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts

01/04/2023  02:20 PM    <DIR>          .
01/04/2023  02:20 PM    <DIR>          ..
01/03/2023  08:44 PM           108,466 base58.exe
01/02/2023  11:58 PM           108,468 f2py.exe
01/04/2023  02:20 PM           108,486 face_detection.exe
01/04/2023  02:20 PM           108,488 face_recognition.exe
01/04/2023  01:26 PM             1,091 futurize-script.py
01/04/2023  01:26 PM            74,752 futurize.exe
01/04/2023  01:26 PM             1,095 pasteurize-script.py
01/04/2023  01:26 PM            74,752 pasteurize.exe
01/04/2023  01:26 PM           108,490 pyi-archive_viewer.exe
01/04/2023  01:26 PM           108,485 pyi-bindepend.exe
01/04/2023  01:26 PM           108,488 pyi-grab_version.exe
01/04/2023  01:26 PM           108,484 pyi-makespec.exe
01/04/2023  01:26 PM           108,487 pyi-set_version.exe
01/04/2023  01:26 PM           108,501 pyinstaller.exe

</code>```

I also have multiple versions of Python installed on my system.

```<code>C:\Users\Captain>where python
C:\Users\Captain\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\Captain\AppData\Local\Programs\Python\Python311\python.exe
</code>```

As you can see, I have both Python 3.10.9 and Python 3.11. When I run python -V, it returns "Python 3.10.9", which means it is using the Python 3.10.9 version.

Could this be the cause of the issue with my script not being able to find the base58 module? If I delete the Python 3.10.9 version, will this solve the problem? I have installed Python several times, first time via Microsoft store, python.org and probably Visual Studio.

But what confused me the most is that, I still receive the ModuleNotFoundError with the message No module named 'base58' even though I have complied the script using PyInstaller, which is supposed to include all the necessary modules in the executable. This means that I shouldn't have to worry about missing modules when running the executable on a different machine. Can someone explain why I am still encountering this error?

I hope someone out there can help me with this issue. As I'm quite new to Python, it can be intimidating and overwhelming trying to troubleshoot problems on my own. If anyone has any suggestions or guidance on how to resolve this ModuleNotFoundError issue, I would be extremely grateful. Thank you for taking the time to read my post.

I installed the necessary modules and modified the PATH environment variable, expecting the script to run without any errors. However, I encountered the ModuleNotFoundError when trying to import the base58 module.

Body:
I am experiencing an issue where I am getting a ModuleNotFoundError when running a script called ConverttoWIF.py. The error message is No module named 'base58'.

When using pip freeze, the output of pip freeze is as follows:

altgraph==0.17.3
base58==2.1.1
click==8.1.3
colorama==0.4.6
dlib==19.24.0
face-recognition==1.3.0
face-recognition-models==0.3.0
future==0.18.2
numpy==1.24.1
opencv-python==4.7.0.68
pefile==2022.5.30
Pillow==9.4.0
pyinstaller==5.7.0
pyinstaller-hooks-contrib==2022.14
PyQt5==5.15.7
PyQt5-Qt5==5.15.2
PyQt5-sip==12.11.0
pywin32-ctypes==0.2.0

As you can see, I have already installed all the necessary modules.

I have also modified the PATH environment variable to include the path to the module in C:\Users\Captain\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts.

The directory contains the following files:

Directory of C:\Users\Captain\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts

01/04/2023  02:20 PM    <DIR>          .
01/04/2023  02:20 PM    <DIR>          ..
01/03/2023  08:44 PM           108,466 base58.exe
01/02/2023  11:58 PM           108,468 f2py.exe
01/04/2023  02:20 PM           108,486 face_detection.exe
01/04/2023  02:20 PM           108,488 face_recognition.exe
01/04/2023  01:26 PM             1,091 futurize-script.py
01/04/2023  01:26 PM            74,752 futurize.exe
01/04/2023  01:26 PM             1,095 pasteurize-script.py
01/04/2023  01:26 PM            74,752 pasteurize.exe
01/04/2023  01:26 PM           108,490 pyi-archive_viewer.exe
01/04/2023  01:26 PM           108,485 pyi-bindepend.exe
01/04/2023  01:26 PM           108,488 pyi-grab_version.exe
01/04/2023  01:26 PM           108,484 pyi-makespec.exe
01/04/2023  01:26 PM           108,487 pyi-set_version.exe
01/04/2023  01:26 PM           108,501 pyinstaller.exe

I also have multiple versions of Python installed on my system.

C:\Users\Captain>where python
C:\Users\Captain\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\Captain\AppData\Local\Programs\Python\Python311\python.exe

As you can see, I have both Python 3.10.9 and Python 3.11. When I run python -V, it returns "Python 3.10.9", which means it is using the Python 3.10.9 version.

Could this be the cause of the issue with my script not being able to find the base58 module? If I delete the Python 3.10.9 version, will this solve the problem? I have installed Python several times, first time via Microsoft store, python.org and probably Visual Studio.

But what confused me the most is that, I still receive the ModuleNotFoundError with the message No module named 'base58' even though I have complied the script using PyInstaller, which is supposed to include all the necessary modules in the executable. This means that I shouldn't have to worry about missing modules when running the executable on a different machine. Can someone explain why I am still encountering this error?

I hope someone out there can help me with this issue. As I'm quite new to Python, it can be intimidating and overwhelming trying to troubleshoot problems on my own. If anyone has any suggestions or guidance on how to resolve this ModuleNotFoundError issue, I would be extremely grateful. Thank you for taking the time to read my post.

I installed the necessary modules and modified the PATH environment variable, expecting the script to run without any errors. However, I encountered the ModuleNotFoundError when trying to import the base58 module.


问:
BERT encode() missing argument text
I'm trying to do a data augmentation with BERT with this code :

```<code># Sélectionnez la colonne que vous voulez utiliser pour générer de nouvelles phrases
column = df["Open_AI_Text"]

# Chargez le modèle BERT
model = transformers.BertModel.from_pretrained("bert-base-cased")

# Itérez sur chaque élément de la colonne et générez de nouvelles phrases en utilisant BERT
for text in column:
  input_ids = transformers.BertTokenizer.encode(text, return_tensors='pt', truncation=True)
  outputs = model(input_ids)
  generated_text = transformers.BertTokenizer.decode(outputs[0],
skip_special_tokens=True)
  print(generated_text)
</code>```

But I have an error

```<code>TypeError                                 Traceback (most recent call last)
<ipython-input-4-23d335e1f70a> in <module>
      7 # Itérez sur chaque élément de la colonne et générez de nouvelles phrases en utilisant BERT
      8 for text in column:
----> 9   input_ids = transformers.BertTokenizer.encode(text, return_tensors='pt', truncation=True)
     10   outputs = model(input_ids)
     11   generated_text = transformers.BertTokenizer.decode(outputs[0],

TypeError: encode() missing 1 required positional argument: 'text'
</code>```

'text' is my text contained in my column as written in my loop so I don't understand the error.

Title: BERT encode() missing argument text

Body:
I'm trying to do a data augmentation with BERT with this code :

# Sélectionnez la colonne que vous voulez utiliser pour générer de nouvelles phrases
column = df["Open_AI_Text"]

# Chargez le modèle BERT
model = transformers.BertModel.from_pretrained("bert-base-cased")

# Itérez sur chaque élément de la colonne et générez de nouvelles phrases en utilisant BERT
for text in column:
  input_ids = transformers.BertTokenizer.encode(text, return_tensors='pt', truncation=True)
  outputs = model(input_ids)
  generated_text = transformers.BertTokenizer.decode(outputs[0],
skip_special_tokens=True)
  print(generated_text)

But I have an error

TypeError                                 Traceback (most recent call last)
<ipython-input-4-23d335e1f70a> in <module>
      7 # Itérez sur chaque élément de la colonne et générez de nouvelles phrases en utilisant BERT
      8 for text in column:
----> 9   input_ids = transformers.BertTokenizer.encode(text, return_tensors='pt', truncation=True)
     10   outputs = model(input_ids)
     11   generated_text = transformers.BertTokenizer.decode(outputs[0],

TypeError: encode() missing 1 required positional argument: 'text'

'text' is my text contained in my column as written in my loop so I don't understand the error.


问:
Error appears when trying to run npm run watch
I am currently working on the backend development of a software made with Electron. So, I wanted to add the React JS library to facilitate the insertion of data from a python program and the refreshment of the window except that while testing this code that I found on this link : https://github.com/Jerga99/electron-react-boilerplate .I have an error when I run the npm run watch command and I can't figure out where it comes from?

Here is the error:

```<code>> electron-react-app@1.0.0 watch
> webpack --config webpack.common.js --watch

webpack is watching the files…

node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at context.callback (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:111:13    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\babel-loader\lib\index.js:44:71 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.0
</code>```

Regards,

Body:
I am currently working on the backend development of a software made with Electron. So, I wanted to add the React JS library to facilitate the insertion of data from a python program and the refreshment of the window except that while testing this code that I found on this link : https://github.com/Jerga99/electron-react-boilerplate .I have an error when I run the npm run watch command and I can't figure out where it comes from?

Here is the error:

> electron-react-app@1.0.0 watch
> webpack --config webpack.common.js --watch

webpack is watching the files…

node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at context.callback (C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\loader-runner\lib\LoaderRunner.js:111:13    at C:\Users\cantr\Desktop\Stage ingénieur KOMILFO SPORT\Sail Vision\electron-react-boilerplate-master\node_modules\babel-loader\lib\index.js:44:71 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.0

Regards,


问:
ValueError: Attempt to convert a value(...) with an unsupported type(...) to a Tensor
When I was trying to run my tf code, I faced with this problem. I don't have any idea how to solve it.

```<code>2023-01-04 16:23:03.212825: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:306] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2023-01-04 16:23:03.213341: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:272] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)
2023-01-04 16:23:03.217396: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:306] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2023-01-04 16:23:03.217415: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:272] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)
/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/summary/summary.py:832: UserWarning: Cannot activate TF2 compatibility support for TF1 summary ops: default summary writer not found.
  warnings.warn(
Traceback (most recent call last):
  File "/Users/bugrahan/Downloads/DeepLoc-master/deeplocv2.py", line 217, in <module>
    tf.compat.v1.app.run()
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/platform/app.py", line 36, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "/Users/bugrahan/Downloads/DeepLoc-master/deeplocv2.py", line 213, in main
    train()
  File "/Users/bugrahan/Downloads/DeepLoc-master/deeplocv2.py", line 110, in train
    tf.compat.v1.summary.scalar('learning_rate', learning_rate)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/summary/summary.py", line 135, in scalar
    val = _gen_logging_ops.scalar_summary(tags=tag, values=tensor, name=scope)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 679, in scalar_summary
    return scalar_summary_eager_fallback(
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 699, in scalar_summary_eager_fallback
    _attr_T, (values,) = _execute.args_to_matching_eager([values], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.int64, _dtypes.bfloat16, _dtypes.uint16, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ])
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/eager/execute.py", line 254, in args_to_matching_eager
    tensor = ops.convert_to_tensor(t, ctx=ctx)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/profiler/trace.py", line 183, in wrapped
    return func(*args, **kwargs)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 1636, in convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 343, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 267, in constant
    return _constant_impl(value, dtype, shape, name, verify_shape=False,
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 279, in _constant_impl
    return _constant_eager_impl(ctx, value, dtype, shape, verify_shape)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 304, in _constant_eager_impl
    t = convert_to_eager_tensor(value, ctx, dtype)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 102, in convert_to_eager_tensor
    return ops.EagerTensor(value, ctx.device_name, dtype)
ValueError: Attempt to convert a value (functools.partial(<tensorflow.python.keras.optimizer_v2.learning_rate_schedule.ExponentialDecay object at 0x287b24910>, <tf.Tensor: shape=(), dtype=int32, numpy=0>)) with an unsupported type (<class 'functools.partial'>) to a Tensor.
</code>```

This is the full code, I've tried to run:

```<code>MAX_STEPS = 10000
WORKERS = 6
SAVE_INTERVAL = 500

import argparse
parser = argparse.ArgumentParser(description='Train DeepLoc model on Chong et al., 2015 data')
parser.add_argument("-l","--logdir",action="store",dest="logdir",help="directory to save models",
                    default='./logs')
args = parser.parse_args()
print ('log dir:',args.logdir)

checkpoint_dir = args.logdir

def DeepLocModel(input_images,is_training):

    conv1 = nn_layers.conv_layer(input_images, 3, 3, 2, 64, 1, 'conv_1',is_training=is_training)
    conv2 = nn_layers.conv_layer(conv1, 3, 3, 64, 64, 1, 'conv_2', is_training=is_training)
    pool1 = nn_layers.pool2_layer(conv2, 'pool1')
    conv3 = nn_layers.conv_layer(pool1, 3, 3, 64, 128, 1, 'conv_3', is_training=is_training)
    conv4 = nn_layers.conv_layer(conv3, 3, 3, 128, 128, 1, 'conv_4', is_training=is_training)
    pool2 = nn_layers.pool2_layer(conv4, 'pool2')
    conv5 = nn_layers.conv_layer(pool2, 3, 3, 128, 256, 1, 'conv_5', is_training=is_training)
    conv6 = nn_layers.conv_layer(conv5, 3, 3, 256, 256, 1, 'conv_6', is_training=is_training)
    conv7 = nn_layers.conv_layer(conv6, 3, 3, 256, 256, 1, 'conv_7', is_training=is_training)
    conv8 = nn_layers.conv_layer(conv7, 3, 3, 256, 256, 1, 'conv_8', is_training=is_training)
    pool3 = nn_layers.pool2_layer(conv8, 'pool3')
    pool3_flat = tf.reshape(pool3, [-1, 8 * 8 * 256])
    fc_1 = nn_layers.nn_layer(pool3_flat, 8 * 8 * 256, 512, 'fc_1', act=tf.nn.relu, is_training=is_training)
    fc_2 = nn_layers.nn_layer(fc_1, 512, 512, 'fc_2', act=tf.nn.relu,is_training=is_training)
    logit = nn_layers.nn_layer(fc_2, 512, 19, 'final_layer', act=None, is_training=is_training)

    return logit

def loss(predicted_y,labeled_y):
    with tf.compat.v1.name_scope('cross_entropy'):
        diff = labeled_y * tf.math.log(tf.clip_by_value(predicted_y,1e-16,1.0))
        with tf.compat.v1.name_scope('total'):
            cross_entropy = -tf.reduce_mean(input_tensor=diff)
        tf.compat.v1.summary.scalar('cross entropy', cross_entropy)

    return cross_entropy

def loss_logits(logits,labeled_y):
    with tf.compat.v1.name_scope('cross_entropy'):
        logistic_losses = tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=tf.stop_gradient(labeled_y), name='sigmoid_cross_entropy')
        cross_entropy = tf.reduce_mean(input_tensor=logistic_losses)
        tf.compat.v1.summary.scalar('cross entropy', cross_entropy)

    return cross_entropy

def accuracy(predicted_y,labeled_y):
    with tf.compat.v1.name_scope('accuracy'):
        with tf.compat.v1.name_scope('correct_prediction'):
            correct_prediction = tf.equal(tf.argmax(input=predicted_y, axis=1), tf.argmax(input=labeled_y, axis=1))
        with tf.compat.v1.name_scope('accuracy'):
            accuracy = tf.reduce_mean(input_tensor=tf.cast(correct_prediction, tf.float32))
        tf.compat.v1.summary.scalar('accuracy', accuracy)

    return accuracy

def train():

    print('\n\n','training','\n\n')
    sess = tf.compat.v1.Session()

    dequeueSize = 100

    global_step = tf.Variable(0, trainable=False)
    starter_learning_rate = 0.1
    decay_step = 25
    decay_rate = 0.96
    learning_rate = tf.compat.v1.train.exponential_decay(starter_learning_rate, global_step*dequeueSize,
                                               decay_step * dequeueSize, decay_rate, staircase=True)
    tf.compat.v1.summary.scalar('learning_rate', learning_rate)

    ######################
    # DATASET PARAMETERS #
    ######################

    if os.path.exists('./datasets'):
        print ('\nusing full dataset\n')
        dataBaseDir = './datasets/'
    else:
        raise NameError('please download datasets using download_datasets.sh')

    trainHdf5 = dataBaseDir+'Chong_train_set.hdf5'
    validHdf5 = dataBaseDir+'Chong_valid_set.hdf5'

    cropSize = 60
    batchSize = 128
    stretchLow = 0.1 # stretch channels lower percentile
    stretchHigh = 99.9 # stretch channels upper percentile

    imSize = 64
    numClasses = 19
    numChan = 2
    data = dataClass.Data(trainHdf5,['data','Index'],batchSize)
    dataTest = dataClass.Data(validHdf5,['data','Index'],batchSize * 2) # larger batch size at test time

    ### define model
    is_training = tf.compat.v1.placeholder(tf.bool, [], name='is_training') # for batch norm
    input = tf.compat.v1.placeholder('float32', shape = [None,cropSize,cropSize,numChan], name='input')  # for batch norm
    labels = tf.compat.v1.placeholder('float32', shape = [None,numClasses], name='labels')  # for batch norm

    logits = DeepLocModel(input, is_training)
    predicted_y = tf.nn.softmax(logits, name='softmax')

    acc = accuracy(predicted_y,labels)
    cross_entropy = loss_logits(logits, labels)
    train_step = tf.compat.v1.train.AdamOptimizer(learning_rate).minimize(cross_entropy,global_step=global_step)

    saver = tf.compat.v1.train.Saver(tf.compat.v1.global_variables(),max_to_keep=100)

    # Merge all the summaries and write them out to /tmp/mnist_logs (by default)
    merged = tf.compat.v1.summary.merge_all()
    train_writer = tf.compat.v1.summary.FileWriter(checkpoint_dir + '/train',
                                          sess.graph)
    test_writer = tf.compat.v1.summary.FileWriter(checkpoint_dir + '/test',
                                          sess.graph)
    sess.run(tf.compat.v1.global_variables_initializer(),{is_training:True})

    # training loop

    for i in range(MAX_STEPS):

        if i % 50 == 0:  # Record execution stats

            batch = dataTest.getBatch()
            processedBatch=procIm.preProcessImages(batch['data'],
                                       imSize,cropSize,numChan,
                                       rescale=False,stretch=True,
                                       means=None,stds=None,
                                       stretchLow=stretchLow,stretchHigh=stretchHigh,
                                       jitter=True,randTransform=False)

            run_options = tf.compat.v1.RunOptions(trace_level=tf.compat.v1.RunOptions.FULL_TRACE)
            run_metadata = tf.compat.v1.RunMetadata()
            summary, cur_test_acc, cur_test_loss = sess.run([merged, acc, cross_entropy],

                      feed_dict={is_training: False,
                                 input: processedBatch,
                                 labels: batch['Index']},
                        options=run_options,
                        run_metadata=run_metadata)

            train_writer.add_run_metadata(run_metadata, 'step%03d' % i)
            test_writer.add_summary(summary, i)
            print('Adding run metadata for', i)
            print('Valid accuracy at step %s: %s, loss: %s' % (i, cur_test_acc,cur_test_loss))

        batch = data.getBatch()
        processedBatch=procIm.preProcessImages(batch['data'],
                                   imSize,cropSize,numChan,
                                   rescale=False,stretch=True,
                                   means=None,stds=None,
                                   stretchLow=stretchLow,stretchHigh=stretchHigh)

        summary, _ , cur_train_acc, cur_train_loss = sess.run([merged, train_step, acc, cross_entropy],
                                       feed_dict={is_training: True,
                                                  input: processedBatch,
                                                  labels: batch['Index']})
        train_writer.add_summary(summary, i)
        print('Train accuracy at step %s: %s, loss: %s' % (i, cur_train_acc,cur_train_loss))

        if i % SAVE_INTERVAL == 0:
            checkpoint_path = os.path.join(checkpoint_dir, 'model.ckpt')
            saver.save(sess, checkpoint_path, global_step=i)

    train_writer.close()
    test_writer.close()

def main(_):
    if tf.io.gfile.exists(checkpoint_dir):
        tf.io.gfile.rmtree(checkpoint_dir)
    tf.io.gfile.makedirs(checkpoint_dir)

    train()

if __name__ == '__main__':
    tf.compat.v1.app.run()
</code>```

This is the full code, I don't know what to change to fix the problem.

Body:
When I was trying to run my tf code, I faced with this problem. I don't have any idea how to solve it.

2023-01-04 16:23:03.212825: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:306] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2023-01-04 16:23:03.213341: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:272] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)
2023-01-04 16:23:03.217396: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:306] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2023-01-04 16:23:03.217415: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:272] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)
/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/summary/summary.py:832: UserWarning: Cannot activate TF2 compatibility support for TF1 summary ops: default summary writer not found.
  warnings.warn(
Traceback (most recent call last):
  File "/Users/bugrahan/Downloads/DeepLoc-master/deeplocv2.py", line 217, in <module>
    tf.compat.v1.app.run()
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/platform/app.py", line 36, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "/Users/bugrahan/Downloads/DeepLoc-master/deeplocv2.py", line 213, in main
    train()
  File "/Users/bugrahan/Downloads/DeepLoc-master/deeplocv2.py", line 110, in train
    tf.compat.v1.summary.scalar('learning_rate', learning_rate)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/summary/summary.py", line 135, in scalar
    val = _gen_logging_ops.scalar_summary(tags=tag, values=tensor, name=scope)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 679, in scalar_summary
    return scalar_summary_eager_fallback(
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 699, in scalar_summary_eager_fallback
    _attr_T, (values,) = _execute.args_to_matching_eager([values], ctx, [_dtypes.float32, _dtypes.float64, _dtypes.int32, _dtypes.uint8, _dtypes.int16, _dtypes.int8, _dtypes.int64, _dtypes.bfloat16, _dtypes.uint16, _dtypes.half, _dtypes.uint32, _dtypes.uint64, ])
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/eager/execute.py", line 254, in args_to_matching_eager
    tensor = ops.convert_to_tensor(t, ctx=ctx)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/profiler/trace.py", line 183, in wrapped
    return func(*args, **kwargs)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 1636, in convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 343, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 267, in constant
    return _constant_impl(value, dtype, shape, name, verify_shape=False,
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 279, in _constant_impl
    return _constant_eager_impl(ctx, value, dtype, shape, verify_shape)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 304, in _constant_eager_impl
    t = convert_to_eager_tensor(value, ctx, dtype)
  File "/Users/bugrahan/opt/anaconda3/envs/mlp/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 102, in convert_to_eager_tensor
    return ops.EagerTensor(value, ctx.device_name, dtype)
ValueError: Attempt to convert a value (functools.partial(<tensorflow.python.keras.optimizer_v2.learning_rate_schedule.ExponentialDecay object at 0x287b24910>, <tf.Tensor: shape=(), dtype=int32, numpy=0>)) with an unsupported type (<class 'functools.partial'>) to a Tensor.

This is the full code, I've tried to run:

MAX_STEPS = 10000
WORKERS = 6
SAVE_INTERVAL = 500

import argparse
parser = argparse.ArgumentParser(description='Train DeepLoc model on Chong et al., 2015 data')
parser.add_argument("-l","--logdir",action="store",dest="logdir",help="directory to save models",
                    default='./logs')
args = parser.parse_args()
print ('log dir:',args.logdir)

checkpoint_dir = args.logdir

def DeepLocModel(input_images,is_training):

    conv1 = nn_layers.conv_layer(input_images, 3, 3, 2, 64, 1, 'conv_1',is_training=is_training)
    conv2 = nn_layers.conv_layer(conv1, 3, 3, 64, 64, 1, 'conv_2', is_training=is_training)
    pool1 = nn_layers.pool2_layer(conv2, 'pool1')
    conv3 = nn_layers.conv_layer(pool1, 3, 3, 64, 128, 1, 'conv_3', is_training=is_training)
    conv4 = nn_layers.conv_layer(conv3, 3, 3, 128, 128, 1, 'conv_4', is_training=is_training)
    pool2 = nn_layers.pool2_layer(conv4, 'pool2')
    conv5 = nn_layers.conv_layer(pool2, 3, 3, 128, 256, 1, 'conv_5', is_training=is_training)
    conv6 = nn_layers.conv_layer(conv5, 3, 3, 256, 256, 1, 'conv_6', is_training=is_training)
    conv7 = nn_layers.conv_layer(conv6, 3, 3, 256, 256, 1, 'conv_7', is_training=is_training)
    conv8 = nn_layers.conv_layer(conv7, 3, 3, 256, 256, 1, 'conv_8', is_training=is_training)
    pool3 = nn_layers.pool2_layer(conv8, 'pool3')
    pool3_flat = tf.reshape(pool3, [-1, 8 * 8 * 256])
    fc_1 = nn_layers.nn_layer(pool3_flat, 8 * 8 * 256, 512, 'fc_1', act=tf.nn.relu, is_training=is_training)
    fc_2 = nn_layers.nn_layer(fc_1, 512, 512, 'fc_2', act=tf.nn.relu,is_training=is_training)
    logit = nn_layers.nn_layer(fc_2, 512, 19, 'final_layer', act=None, is_training=is_training)

    return logit

def loss(predicted_y,labeled_y):
    with tf.compat.v1.name_scope('cross_entropy'):
        diff = labeled_y * tf.math.log(tf.clip_by_value(predicted_y,1e-16,1.0))
        with tf.compat.v1.name_scope('total'):
            cross_entropy = -tf.reduce_mean(input_tensor=diff)
        tf.compat.v1.summary.scalar('cross entropy', cross_entropy)

    return cross_entropy

def loss_logits(logits,labeled_y):
    with tf.compat.v1.name_scope('cross_entropy'):
        logistic_losses = tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=tf.stop_gradient(labeled_y), name='sigmoid_cross_entropy')
        cross_entropy = tf.reduce_mean(input_tensor=logistic_losses)
        tf.compat.v1.summary.scalar('cross entropy', cross_entropy)

    return cross_entropy

def accuracy(predicted_y,labeled_y):
    with tf.compat.v1.name_scope('accuracy'):
        with tf.compat.v1.name_scope('correct_prediction'):
            correct_prediction = tf.equal(tf.argmax(input=predicted_y, axis=1), tf.argmax(input=labeled_y, axis=1))
        with tf.compat.v1.name_scope('accuracy'):
            accuracy = tf.reduce_mean(input_tensor=tf.cast(correct_prediction, tf.float32))
        tf.compat.v1.summary.scalar('accuracy', accuracy)

    return accuracy

def train():

    print('\n\n','training','\n\n')
    sess = tf.compat.v1.Session()

    dequeueSize = 100

    global_step = tf.Variable(0, trainable=False)
    starter_learning_rate = 0.1
    decay_step = 25
    decay_rate = 0.96
    learning_rate = tf.compat.v1.train.exponential_decay(starter_learning_rate, global_step*dequeueSize,
                                               decay_step * dequeueSize, decay_rate, staircase=True)
    tf.compat.v1.summary.scalar('learning_rate', learning_rate)

    ######################
    # DATASET PARAMETERS #
    ######################

    if os.path.exists('./datasets'):
        print ('\nusing full dataset\n')
        dataBaseDir = './datasets/'
    else:
        raise NameError('please download datasets using download_datasets.sh')

    trainHdf5 = dataBaseDir+'Chong_train_set.hdf5'
    validHdf5 = dataBaseDir+'Chong_valid_set.hdf5'

    cropSize = 60
    batchSize = 128
    stretchLow = 0.1 # stretch channels lower percentile
    stretchHigh = 99.9 # stretch channels upper percentile

    imSize = 64
    numClasses = 19
    numChan = 2
    data = dataClass.Data(trainHdf5,['data','Index'],batchSize)
    dataTest = dataClass.Data(validHdf5,['data','Index'],batchSize * 2) # larger batch size at test time

    ### define model
    is_training = tf.compat.v1.placeholder(tf.bool, [], name='is_training') # for batch norm
    input = tf.compat.v1.placeholder('float32', shape = [None,cropSize,cropSize,numChan], name='input')  # for batch norm
    labels = tf.compat.v1.placeholder('float32', shape = [None,numClasses], name='labels')  # for batch norm

    logits = DeepLocModel(input, is_training)
    predicted_y = tf.nn.softmax(logits, name='softmax')

    acc = accuracy(predicted_y,labels)
    cross_entropy = loss_logits(logits, labels)
    train_step = tf.compat.v1.train.AdamOptimizer(learning_rate).minimize(cross_entropy,global_step=global_step)

    saver = tf.compat.v1.train.Saver(tf.compat.v1.global_variables(),max_to_keep=100)

    # Merge all the summaries and write them out to /tmp/mnist_logs (by default)
    merged = tf.compat.v1.summary.merge_all()
    train_writer = tf.compat.v1.summary.FileWriter(checkpoint_dir + '/train',
                                          sess.graph)
    test_writer = tf.compat.v1.summary.FileWriter(checkpoint_dir + '/test',
                                          sess.graph)
    sess.run(tf.compat.v1.global_variables_initializer(),{is_training:True})

    # training loop

    for i in range(MAX_STEPS):

        if i % 50 == 0:  # Record execution stats

            batch = dataTest.getBatch()
            processedBatch=procIm.preProcessImages(batch['data'],
                                       imSize,cropSize,numChan,
                                       rescale=False,stretch=True,
                                       means=None,stds=None,
                                       stretchLow=stretchLow,stretchHigh=stretchHigh,
                                       jitter=True,randTransform=False)

            run_options = tf.compat.v1.RunOptions(trace_level=tf.compat.v1.RunOptions.FULL_TRACE)
            run_metadata = tf.compat.v1.RunMetadata()
            summary, cur_test_acc, cur_test_loss = sess.run([merged, acc, cross_entropy],

                      feed_dict={is_training: False,
                                 input: processedBatch,
                                 labels: batch['Index']},
                        options=run_options,
                        run_metadata=run_metadata)

            train_writer.add_run_metadata(run_metadata, 'step%03d' % i)
            test_writer.add_summary(summary, i)
            print('Adding run metadata for', i)
            print('Valid accuracy at step %s: %s, loss: %s' % (i, cur_test_acc,cur_test_loss))

        batch = data.getBatch()
        processedBatch=procIm.preProcessImages(batch['data'],
                                   imSize,cropSize,numChan,
                                   rescale=False,stretch=True,
                                   means=None,stds=None,
                                   stretchLow=stretchLow,stretchHigh=stretchHigh)

        summary, _ , cur_train_acc, cur_train_loss = sess.run([merged, train_step, acc, cross_entropy],
                                       feed_dict={is_training: True,
                                                  input: processedBatch,
                                                  labels: batch['Index']})
        train_writer.add_summary(summary, i)
        print('Train accuracy at step %s: %s, loss: %s' % (i, cur_train_acc,cur_train_loss))

        if i % SAVE_INTERVAL == 0:
            checkpoint_path = os.path.join(checkpoint_dir, 'model.ckpt')
            saver.save(sess, checkpoint_path, global_step=i)

    train_writer.close()
    test_writer.close()

def main(_):
    if tf.io.gfile.exists(checkpoint_dir):
        tf.io.gfile.rmtree(checkpoint_dir)
    tf.io.gfile.makedirs(checkpoint_dir)

    train()

if __name__ == '__main__':
    tf.compat.v1.app.run()

This is the full code, I don't know what to change to fix the problem.


问:
Adding a user to a site in SharePoint with Microsoft Graph
I am trying to use the Graph api to add a user to a site that I have created using Restful calls. I have managed to do this by calling their Restful endpoints but I would like to do this with the Graph api.
The way I do it now is by calling this endpoint:

```<code>/sites/{siteTitle}/_api/web/sitegroups/GetById({siteGroupId})/users
</code>```

With this body:

```<code>var itemPayLoad = new
{
    __metadata = new { type = "SP.User" },
    LoginName = loginName
};
</code>```

where the loginName variable is got from this endpoint:

```<code>/_api/Web/SiteUsers?$filter=Email eq '{emailOfUser}'
</code>```

The loginname is formed like so: 'few characters | membership | email address'.

I have tried to look at the groups endpoint for the Graph api but I am not seeing all the sites there. Does someone have any information for me as to how I can add a user that is already in the domain to a site that I have recently created with another user?

EDIT:
This website Microsoft Graph get Permissions does have a restful endpoint that I have tried calling with a specific site id but it just lists an empty response.

Body:
I am trying to use the Graph api to add a user to a site that I have created using Restful calls. I have managed to do this by calling their Restful endpoints but I would like to do this with the Graph api.
The way I do it now is by calling this endpoint:

/sites/{siteTitle}/_api/web/sitegroups/GetById({siteGroupId})/users

With this body:

var itemPayLoad = new
{
    __metadata = new { type = "SP.User" },
    LoginName = loginName
};

where the loginName variable is got from this endpoint:

/_api/Web/SiteUsers?$filter=Email eq '{emailOfUser}'

The loginname is formed like so: 'few characters | membership | email address'.

I have tried to look at the groups endpoint for the Graph api but I am not seeing all the sites there. Does someone have any information for me as to how I can add a user that is already in the domain to a site that I have recently created with another user?

EDIT:
This website Microsoft Graph get Permissions does have a restful endpoint that I have tried calling with a specific site id but it just lists an empty response.