问:
Secret Manager access issues
I'm trying to incorporate Secret Manager with my projects for security but running into issues setting it up. I currently have a service account in project-b where I downloaded the JSON credential keys and have been using that to access my BigQuery table in my backend code.

My current setup:

I have project-a that uses Cloud Run to host my code.

I have project-b that uses BigQuery to hold some data for me.

From project-a, I'm trying to access the BigQuery table in project-b just like I've been doing with the JSON keys.

I keep running into this error:

PermissionDenied: 403 Permission 'secretmanager.versions.access' denied for resource 'projects/project-b/secrets/stockdata-secret/versions/1' (or it may not exist).

I have assigned the Secret Manager Secret Accessor and Secret Manager Viewer roles to a couple of my accounts but it still doesn't seem to work.

The client_email from the keys is set to the top service account in the screenshot below:

Permissions for the secret

Here is my part of my back-end code:

```<code># Grabbing keys from Secret Manager, got this code from Google docs
def access_secret_version(project_id, secret_id, version_id):

    # Create the Secret Manager client.
    client = secretmanager.SecretManagerServiceClient()

    # Build the resource name of the secret version.
    name = f"projects/{project_id}/secrets/{secret_id}/versions/{version_id}"

    # Access the secret version.
    response = client.access_secret_version(request={"name": name})

    payload = response.payload.data.decode("UTF-8")
    return payload

---
# Routing to the page
@app.route('/projects/random-page')
def random_page():
    payload = access_secret_version("project-b", "stockdata-secret", "1")

    # Authenticating service account.
    os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = payload

    # old way, which worked
    google_cloud_service_account = "creds.json"
    os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = google_cloud_service_account
</code>```

Title: Secret Manager access issues

Body:
I'm trying to incorporate Secret Manager with my projects for security but running into issues setting it up. I currently have a service account in project-b where I downloaded the JSON credential keys and have been using that to access my BigQuery table in my backend code.

My current setup:

I have project-a that uses Cloud Run to host my code.

I have project-b that uses BigQuery to hold some data for me.

From project-a, I'm trying to access the BigQuery table in project-b just like I've been doing with the JSON keys.

I keep running into this error:

PermissionDenied: 403 Permission 'secretmanager.versions.access' denied for resource 'projects/project-b/secrets/stockdata-secret/versions/1' (or it may not exist).

I have assigned the Secret Manager Secret Accessor and Secret Manager Viewer roles to a couple of my accounts but it still doesn't seem to work.

The client_email from the keys is set to the top service account in the screenshot below:

Permissions for the secret

Here is my part of my back-end code:

# Grabbing keys from Secret Manager, got this code from Google docs
def access_secret_version(project_id, secret_id, version_id):

    # Create the Secret Manager client.
    client = secretmanager.SecretManagerServiceClient()

    # Build the resource name of the secret version.
    name = f"projects/{project_id}/secrets/{secret_id}/versions/{version_id}"

    # Access the secret version.
    response = client.access_secret_version(request={"name": name})

    payload = response.payload.data.decode("UTF-8")
    return payload

---
# Routing to the page
@app.route('/projects/random-page')
def random_page():
    payload = access_secret_version("project-b", "stockdata-secret", "1")

    # Authenticating service account.
    os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = payload

    # old way, which worked
    google_cloud_service_account = "creds.json"
    os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = google_cloud_service_account


来源: stackexchange

问:
Providing calendar data for the Calendar app
In the Android calendar app one can activate certain calendars, like holidays or birthdays. In the case of holidays I suppose the data comes from Google, in the case of birthdays the data comes from my contacts.

I would like my app to provide such calendar data. The data would be generated by my app, the Calendar app would simply display it. I would like my app to show up among the aforementioned list of calendars in the Calendar app, like holidays and birthdays, where the user may activate it and choose a color.

To make things clear: I don't want my app to access the Calendar app, but the other way around: the Calendar app would access the calendar data provided by my app.

Is this possible in the way I describe? What API do I have to implement?

If this is not possible this way, is there another way that comes close to what I'm describing?

Or is the only way to provide data to the Calendar to ask write permission for the Calendar and add events?

ContentLicense: CC BY-SA 4.0


问:
Uncaught (in promise) Error: RangeError (index): Index out of range: index should be less than 1: 1
Hey I am new here in Flutter. I have one app already build on Flutter and I need to create a web with existing one. The app is using Firebase so I am using firebase_core_web but when I run the app I got the below error in my Flutter Web Console.

```<code>errors.dart:266 Uncaught (in promise) Error: RangeError (index): Index out of range: index should be less than 1: 1
    at Object.throw_ [as throw] (errors.dart:266:49)
    at [dartx._get] (js_array.dart:581:7)
    at Object._checkAndCall (operations.dart:334:14)
    at Object.callMethod (operations.dart:398:10)
    at Object.dsend (operations.dart:402:5)
    at [_getTaskName] (dio_client.dart:345:53)
    at [_endProgress] (dio_client.dart:107:24)
    at dio_client.DioClient.new.getUri (dio_client.dart:101:7)
    at getUri.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at dio_client.DioClient.new.getUri (dio_client.dart:75:25)
    at laravel_provider.LaravelApiClient.new.getSettings (laravel_provider.dart:1319:38)
    at getSettings.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at laravel_provider.LaravelApiClient.new.getSettings (laravel_provider.dart:1316:30)
    at setting_repository.SettingRepository.new.get (setting_repository.dart:15:30)
    at settings_service.SettingsService.new.init (settings_service.dart:29:41)
    at init.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at settings_service.SettingsService.new.init (settings_service.dart:25:31)
    at main.dart:35:46
    at GetInstance.putAsync (get_instance.dart:62:32)
    at putAsync.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at GetInstance.putAsync (get_instance.dart:57:24)
    at Inst$124putAsync (extension_instance.dart:43:21)
    at Inst$124putAsync.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at Object.Inst$124putAsync [as Inst|putAsync] (extension_instance.dart:41:24)
    at initServices (main.dart:35:13)
    at initServices.next (<anonymous>)
    at async_patch.dart:45:50
    at _RootZone.runUnary (zone.dart:1653:54)
    at _FutureListener.thenAwait.handleValue (future_impl.dart:147:18)
    at handleValueCallback (future_impl.dart:766:44)
    at _Future._propagateToListeners (future_impl.dart:795:13)
    at [_completeWithValue] (future_impl.dart:566:5)
    at async._AsyncCallbackEntry.new.callback (future_impl.dart:639:7)
    at Object._microtaskLoop (schedule_microtask.dart:40:11)
    at _startMicrotaskLoop (schedule_microtask.dart:49:5)
    at async_patch.dart:166:15
</code>```

Can anyone help me with this that how can I solve this.

Thanks in Advance.

Body:
Hey I am new here in Flutter. I have one app already build on Flutter and I need to create a web with existing one. The app is using Firebase so I am using firebase_core_web but when I run the app I got the below error in my Flutter Web Console.

errors.dart:266 Uncaught (in promise) Error: RangeError (index): Index out of range: index should be less than 1: 1
    at Object.throw_ [as throw] (errors.dart:266:49)
    at [dartx._get] (js_array.dart:581:7)
    at Object._checkAndCall (operations.dart:334:14)
    at Object.callMethod (operations.dart:398:10)
    at Object.dsend (operations.dart:402:5)
    at [_getTaskName] (dio_client.dart:345:53)
    at [_endProgress] (dio_client.dart:107:24)
    at dio_client.DioClient.new.getUri (dio_client.dart:101:7)
    at getUri.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at dio_client.DioClient.new.getUri (dio_client.dart:75:25)
    at laravel_provider.LaravelApiClient.new.getSettings (laravel_provider.dart:1319:38)
    at getSettings.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at laravel_provider.LaravelApiClient.new.getSettings (laravel_provider.dart:1316:30)
    at setting_repository.SettingRepository.new.get (setting_repository.dart:15:30)
    at settings_service.SettingsService.new.init (settings_service.dart:29:41)
    at init.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at settings_service.SettingsService.new.init (settings_service.dart:25:31)
    at main.dart:35:46
    at GetInstance.putAsync (get_instance.dart:62:32)
    at putAsync.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at GetInstance.putAsync (get_instance.dart:57:24)
    at Inst$124putAsync (extension_instance.dart:43:21)
    at Inst$124putAsync.next (<anonymous>)
    at runBody (async_patch.dart:84:54)
    at Object._async [as async] (async_patch.dart:123:5)
    at Object.Inst$124putAsync [as Inst|putAsync] (extension_instance.dart:41:24)
    at initServices (main.dart:35:13)
    at initServices.next (<anonymous>)
    at async_patch.dart:45:50
    at _RootZone.runUnary (zone.dart:1653:54)
    at _FutureListener.thenAwait.handleValue (future_impl.dart:147:18)
    at handleValueCallback (future_impl.dart:766:44)
    at _Future._propagateToListeners (future_impl.dart:795:13)
    at [_completeWithValue] (future_impl.dart:566:5)
    at async._AsyncCallbackEntry.new.callback (future_impl.dart:639:7)
    at Object._microtaskLoop (schedule_microtask.dart:40:11)
    at _startMicrotaskLoop (schedule_microtask.dart:49:5)
    at async_patch.dart:166:15

Can anyone help me with this that how can I solve this.

Thanks in Advance.


问:
devtools::check failing to find package installed in renv user cache
I'm using renv for my private package (mdTools). devtools::install() works, but when I devtools::check(), it fails to find the DBI package, which is installed in my renv user cache.

devtools::check() error message

```<code>checking whether the package can be loaded ... ERROR
   Loading this package had a fatal error status code 1
  Loading log:
  Error: package or namespace load failed for 'mdTools' in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
   there is no package called 'DBI'
  Execution halted
</code>```

This was a previous similar problem not using renv:
devtools::install() works but devtools::check() does not, so it is possible that this is not a renv problem. The answer there was to use the system library which doesn't seem like what I want to do.

What I've tried none of which resolved the issue

renv::remove("DBI") and renv::install("DBI")

renv::deactivate() and renv::init()

renv::clean()

renv::hydrate()

renv::purge("DBI") and renv::install("DBI")

renv::repair("DBI")

```<code>> renv::diagnostics()
Diagnostics Report [renv 0.16.0]
================================

# Session Info =======================
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base

other attached packages:
[1] mdTools_0.0.0.9000

loaded via a namespace (and not attached):
 [1] qpdf_1.3.0          xfun_0.36           tidyselect_1.2.0
 [4] janitor_2.1.0       purrr_1.0.0         rJava_1.0-6
 [7] snakecase_0.11.0    vctrs_0.5.1         generics_0.1.3
[10] htmltools_0.5.4     utf8_1.2.2          docxtractr_0.6.5
[13] blob_1.2.3          rlang_1.0.6         pillar_1.8.1
[16] glue_1.6.2          DBI_1.1.3           re2_0.1.2
[19] rappdirs_0.3.3      bit64_4.0.5         readxl_1.4.1
[22] rptTools_0.0.0.9000 uuid_1.1-0          lifecycle_1.0.3
[25] stringr_1.5.0       cellranger_1.1.0    zip_2.2.2
[28] AzureGraph_1.3.2    evaluate_0.19       knitr_1.41
[31] fastmap_1.1.0       tzdb_0.3.0          fansi_1.0.3
[34] xlsxjars_0.6.1      pdftools_3.3.2      Rcpp_1.0.9
[37] readr_2.1.3         openssl_2.0.5       renv_0.16.0
[40] xlsx_0.6.5          bit_4.0.5           digest_0.6.31
[43] hms_1.1.2           askpass_1.1         stringi_1.7.8
[46] openxlsx_4.2.5.1    keyring_1.3.1       dplyr_1.0.10
[49] rprojroot_2.0.3     here_1.0.1          cli_3.6.0
[52] odbc_1.3.3          tools_4.2.2         magrittr_2.0.3
[55] AzureAuth_1.3.3     tibble_3.1.8        pkgconfig_2.0.3
[58] ellipsis_0.3.2      data.table_1.14.6   xml2_1.3.3
[61] lubridate_1.9.0     timechange_0.1.1    rmarkdown_2.19
[64] assertthat_0.2.1    httr_1.4.4          Microsoft365R_2.3.4
[67] officer_0.5.1       rstudioapi_0.14     R6_2.5.1
[70] compiler_4.2.2

# Project ============================
Project path: "C:/RStudio_Projects/R_projects/mdTools"

# Status =============================
* The project is already synchronized with the lockfile.

# Packages ===========================
                 Library Source   Lockfile Source Path Dependency
AzureAuth          1.3.3   CRAN      1.3.3   CRAN  [1]   indirect
AzureGraph         1.3.2   CRAN      1.3.2   CRAN  [1]   indirect
DBI                1.1.3   CRAN      1.1.3   CRAN  [1]     direct
KernSmooth       2.23-20   CRAN       <NA>   <NA>  [2]       <NA>
MASS            7.3-58.1   CRAN       <NA>   <NA>  [2]       <NA>
Matrix             1.5-1   CRAN       <NA>   <NA>  [2]       <NA>
Microsoft365R      2.3.4   CRAN      2.3.4   CRAN  [1]     direct
R6                 2.5.1   CRAN      2.5.1   CRAN  [1]   indirect
Rcpp               1.0.9   CRAN      1.0.9   CRAN  [1]   indirect
askpass              1.1   CRAN        1.1   CRAN  [1]   indirect
assertthat         0.2.1   CRAN      0.2.1   CRAN  [1]   indirect
base64enc          0.1-3   CRAN      0.1-3   CRAN  [1]   indirect
bit                4.0.5   CRAN      4.0.5   CRAN  [1]   indirect
bit64              4.0.5   CRAN      4.0.5   CRAN  [1]   indirect
blob               1.2.3   CRAN      1.2.3   CRAN  [1]   indirect
boot              1.3-28   CRAN       <NA>   <NA>  [2]       <NA>
brew               1.0-8   CRAN       <NA>   <NA>  [1]   indirect
brio               1.1.3   CRAN       <NA>   <NA>  [1]   indirect
bslib              0.4.2   CRAN      0.4.2   CRAN  [1]   indirect
cachem             1.0.6   CRAN      1.0.6   CRAN  [1]   indirect
callr              3.7.3   CRAN       <NA>   <NA>  [1]   indirect
cellranger         1.1.0   CRAN      1.1.0   CRAN  [1]   indirect
class             7.3-20   CRAN       <NA>   <NA>  [2]       <NA>
cli                3.6.0   CRAN      3.6.0   CRAN  [1]   indirect
clipr              0.8.0   CRAN      0.8.0   CRAN  [1]   indirect
cluster            2.1.4   CRAN       <NA>   <NA>  [2]       <NA>
codetools         0.2-18   CRAN       <NA>   <NA>  [2]       <NA>
commonmark         1.8.1   CRAN       <NA>   <NA>  [1]   indirect
cpp11              0.4.3   CRAN      0.4.3   CRAN  [1]   indirect
crayon             1.5.2   CRAN      1.5.2   CRAN  [1]   indirect
credentials        1.3.2   CRAN       <NA>   <NA>  [1]   indirect
curl               4.3.3   CRAN      4.3.3   CRAN  [1]   indirect
data.table        1.14.6   CRAN     1.14.6   CRAN  [1]     direct
desc               1.4.2   CRAN       <NA>   <NA>  [1]   indirect
devtools           2.4.5   CRAN       <NA>   <NA>  [1]     direct
diffobj            0.3.5   CRAN       <NA>   <NA>  [1]   indirect
digest            0.6.31   CRAN     0.6.31   CRAN  [1]   indirect
docxtractr         0.6.5   CRAN      0.6.5   CRAN  [1]     direct
downlit            0.4.2   CRAN       <NA>   <NA>  [1]   indirect
dplyr             1.0.10   CRAN     1.0.10   CRAN  [1]   indirect
ellipsis           0.3.2   CRAN      0.3.2   CRAN  [1]   indirect
evaluate            0.19   CRAN       0.19   CRAN  [1]   indirect
fansi              1.0.3   CRAN      1.0.3   CRAN  [1]   indirect
fastmap            1.1.0   CRAN      1.1.0   CRAN  [1]   indirect
filelock           1.0.2   CRAN      1.0.2   CRAN  [1]   indirect
fontawesome        0.4.0   CRAN       <NA>   <NA>  [1]   indirect
foreign           0.8-83   CRAN       <NA>   <NA>  [2]       <NA>
fs                 1.5.2   CRAN      1.5.2   CRAN  [1]   indirect
generics           0.1.3   CRAN      0.1.3   CRAN  [1]   indirect
gert               1.9.2   CRAN       <NA>   <NA>  [1]   indirect
gh                 1.3.1   CRAN       <NA>   <NA>  [1]   indirect
gitcreds           0.1.2   CRAN       <NA>   <NA>  [1]   indirect
glue               1.6.2   CRAN      1.6.2   CRAN  [1]     direct
grDevices           <NA>   <NA>       <NA>   <NA>  [2]   indirect
graphics            <NA>   <NA>       <NA>   <NA>  [2]   indirect
here               1.0.1   CRAN      1.0.1   CRAN  [1]     direct
highr               0.10   CRAN       0.10   CRAN  [1]   indirect
hms                1.1.2   CRAN      1.1.2   CRAN  [1]   indirect
htmltools          0.5.4   CRAN      0.5.4   CRAN  [1]   indirect
htmlwidgets        1.6.1   CRAN       <NA>   <NA>  [1]   indirect
httpuv             1.6.7   CRAN       <NA>   <NA>  [1]   indirect
httr               1.4.4   CRAN      1.4.4   CRAN  [1]   indirect
ini                0.3.1   CRAN       <NA>   <NA>  [1]   indirect
janitor            2.1.0   CRAN      2.1.0   CRAN  [1]     direct
jose               1.2.0   CRAN      1.2.0   CRAN  [1]   indirect
jquerylib          0.1.4   CRAN      0.1.4   CRAN  [1]   indirect
jsonlite           1.8.4   CRAN      1.8.4   CRAN  [1]   indirect
keyring            1.3.1   CRAN      1.3.1   CRAN  [1]     direct
knitr               1.41   CRAN       1.41   CRAN  [1]     direct
later              1.3.0   CRAN       <NA>   <NA>  [1]   indirect
lattice          0.20-45   CRAN       <NA>   <NA>  [2]       <NA>
lifecycle          1.0.3   CRAN      1.0.3   CRAN  [1]   indirect
lubridate          1.9.0   CRAN      1.9.0   CRAN  [1]   indirect
magrittr           2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
mdTools             <NA>   <NA>       <NA>   <NA>  [1]     direct
memoise            2.0.1   CRAN      2.0.1   CRAN  [1]   indirect
methods             <NA>   <NA>       <NA>   <NA>  [2]   indirect
mgcv              1.8-41   CRAN       <NA>   <NA>  [2]       <NA>
mime                0.12   CRAN       0.12   CRAN  [1]   indirect
miniUI           0.1.1.1   CRAN       <NA>   <NA>  [1]   indirect
nlme             3.1-160   CRAN       <NA>   <NA>  [2]       <NA>
nnet              7.3-18   CRAN       <NA>   <NA>  [2]       <NA>
odbc               1.3.3   CRAN      1.3.3   CRAN  [1]     direct
officer            0.5.1   CRAN      0.5.1   CRAN  [1]     direct
openssl            2.0.5   CRAN      2.0.5   CRAN  [1]   indirect
openxlsx         4.2.5.1   CRAN    4.2.5.1   CRAN  [1]     direct
pdftools           3.3.2   CRAN      3.3.2   CRAN  [1]   indirect
pillar             1.8.1   CRAN      1.8.1   CRAN  [1]   indirect
pkgbuild           1.4.0   CRAN       <NA>   <NA>  [1]   indirect
pkgconfig          2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
pkgdown            2.0.7   CRAN       <NA>   <NA>  [1]   indirect
pkgload            1.3.2   CRAN       <NA>   <NA>  [1]   indirect
praise             1.0.0   CRAN       <NA>   <NA>  [1]   indirect
prettyunits        1.1.1   CRAN      1.1.1   CRAN  [1]   indirect
processx           3.8.0   CRAN       <NA>   <NA>  [1]   indirect
profvis            0.3.7   CRAN       <NA>   <NA>  [1]   indirect
progress           1.2.2   CRAN      1.2.2   CRAN  [1]   indirect
promises         1.2.0.1   CRAN       <NA>   <NA>  [1]   indirect
ps                 1.7.2   CRAN       <NA>   <NA>  [1]   indirect
purrr              1.0.0   CRAN      1.0.0   CRAN  [1]   indirect
qpdf               1.3.0   CRAN      1.3.0   CRAN  [1]   indirect
rJava              1.0-6   CRAN      1.0-6   CRAN  [1]   indirect
ragg               1.2.4   CRAN       <NA>   <NA>  [1]   indirect
rappdirs           0.3.3   CRAN      0.3.3   CRAN  [1]   indirect
rcmdcheck          1.4.0   CRAN       <NA>   <NA>  [1]   indirect
re2                0.1.2   CRAN      0.1.2   CRAN  [1]     direct
readr              2.1.3   CRAN      2.1.3   CRAN  [1]     direct
readxl             1.4.1   CRAN      1.4.1   CRAN  [1]     direct
rematch            1.0.1   CRAN      1.0.1   CRAN  [1]   indirect
rematch2           2.1.2   CRAN       <NA>   <NA>  [1]   indirect
remotes            2.4.2   CRAN       <NA>   <NA>  [1]   indirect
renv              0.16.0   CRAN     0.16.0   CRAN  [1]     direct
rlang              1.0.6   CRAN      1.0.6   CRAN  [1]   indirect
rmarkdown           2.19   CRAN       2.19   CRAN  [1]     direct
roxygen2           7.2.3   CRAN       <NA>   <NA>  [1]     direct
rpart             4.1.19   CRAN       <NA>   <NA>  [2]       <NA>
rprojroot          2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
rptTools      0.0.0.9000    Git 0.0.0.9000    Git  [1]     direct
rstudioapi          0.14   CRAN       <NA>   <NA>  [1]   indirect
rversions          2.1.2   CRAN       <NA>   <NA>  [1]   indirect
sass               0.4.4   CRAN      0.4.4   CRAN  [1]   indirect
sessioninfo        1.2.2   CRAN       <NA>   <NA>  [1]   indirect
shiny              1.7.4   CRAN       <NA>   <NA>  [1]   indirect
snakecase         0.11.0   CRAN     0.11.0   CRAN  [1]   indirect
sodium             1.2.1   CRAN      1.2.1   CRAN  [1]   indirect
sourcetools        0.1.7   CRAN       <NA>   <NA>  [1]   indirect
spatial           7.3-15   CRAN       <NA>   <NA>  [2]       <NA>
stats               <NA>   <NA>       <NA>   <NA>  [2]   indirect
stringi            1.7.8   CRAN      1.7.8   CRAN  [1]   indirect
stringr            1.5.0   CRAN      1.5.0   CRAN  [1]   indirect
survival           3.4-0   CRAN       <NA>   <NA>  [2]       <NA>
sys                3.4.1   CRAN      3.4.1   CRAN  [1]   indirect
systemfonts        1.0.4   CRAN       <NA>   <NA>  [1]   indirect
testthat           3.1.6   CRAN       <NA>   <NA>  [1]   indirect
textshaping        0.3.6   CRAN       <NA>   <NA>  [1]   indirect
tibble             3.1.8   CRAN      3.1.8   CRAN  [1]   indirect
tidyr              1.2.1   CRAN      1.2.1   CRAN  [1]   indirect
tidyselect         1.2.0   CRAN      1.2.0   CRAN  [1]   indirect
timechange         0.1.1   CRAN      0.1.1   CRAN  [1]   indirect
tinytex             0.43   CRAN       0.43   CRAN  [1]   indirect
tools               <NA>   <NA>       <NA>   <NA>  [2]   indirect
tzdb               0.3.0   CRAN      0.3.0   CRAN  [1]   indirect
urlchecker         1.0.1   CRAN       <NA>   <NA>  [1]   indirect
usethis            2.1.6   CRAN       <NA>   <NA>  [1]   indirect
utf8               1.2.2   CRAN      1.2.2   CRAN  [1]   indirect
utils               <NA>   <NA>       <NA>   <NA>  [2]     direct
uuid               1.1-0   CRAN      1.1-0   CRAN  [1]   indirect
vctrs              0.5.1   CRAN      0.5.1   CRAN  [1]   indirect
vroom              1.6.0   CRAN      1.6.0   CRAN  [1]   indirect
waldo              0.4.0   CRAN       <NA>   <NA>  [1]   indirect
whisker            0.4.1   CRAN       <NA>   <NA>  [1]   indirect
withr              2.5.0   CRAN      2.5.0   CRAN  [1]   indirect
xfun                0.36   CRAN       0.36   CRAN  [1]   indirect
xlsx               0.6.5   CRAN      0.6.5   CRAN  [1]     direct
xlsxjars           0.6.1   CRAN      0.6.1   CRAN  [1]   indirect
xml2               1.3.3   CRAN      1.3.3   CRAN  [1]   indirect
xopen              1.0.0   CRAN       <NA>   <NA>  [1]   indirect
xtable             1.8-4   CRAN       <NA>   <NA>  [1]   indirect
yaml               2.3.6   CRAN      2.3.6   CRAN  [1]   indirect
zip                2.2.2   CRAN      2.2.2   CRAN  [1]   indirect

[1]: C:/Users/dlucey/AppData/Local/R/cache/R/renv/library/mdTools-fbe1603d/R-4.2/x86_64-w64-mingw32
[2]: C:/Users/dlucey/AppData/Local/Temp/RtmpEXMKbd/renv-system-library

# ABI ================================
* ABI conflict checks are not yet implemented on Windows.

# User Profile =======================
[no user profile detected]

# Settings ===========================
List of 10
 $ bioconductor.version     : chr(0)
 $ external.libraries       : chr(0)
 $ ignored.packages         : chr(0)
 $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
 $ r.version                : chr(0)
 $ snapshot.type            : chr "implicit"
 $ use.cache                : logi TRUE
 $ vcs.ignore.cellar        : logi TRUE
 $ vcs.ignore.library       : logi TRUE
 $ vcs.ignore.local         : logi TRUE

# Options ============================
List of 9
 $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
 $ download.file.method                : chr "libcurl"
 $ download.file.extra                 : NULL
 $ install.packages.compile.from.source: chr "interactive"
 $ pkgType                             : chr "both"
 $ repos                               : Named chr "https://cran.rstudio.com"
  ..- attr(*, "names")= chr "CRAN"
 $ renv.consent                        : logi TRUE
 $ renv.project.path                   : chr "C:/RStudio_Projects/R_projects/mdTools"
 $ renv.verbose                        : logi TRUE

# Environment Variables ==============
HOME                        = C:/Users/dlucey/OneDrive - South Bronx Classical Charter School/Documents
LANG                        = <NA>
MAKE                        = <NA>
R_LIBS                      = <NA>
R_LIBS_SITE                 = C:/PROGRA~1/R/R-42~1.2/site-library
R_LIBS_USER                 = C:/Users/dlucey/AppData/Local/R/cache/R/renv/library/mdTools-fbe1603d/R-4.2/x86_64-w64-mingw32;C:/Users/dlucey/AppData/Local/Temp/RtmpEXMKbd/renv-system-library
RENV_DEFAULT_R_ENVIRON      = <NA>
RENV_DEFAULT_R_ENVIRON_USER = <NA>
RENV_DEFAULT_R_LIBS         = <NA>
RENV_DEFAULT_R_LIBS_SITE    = C:/PROGRA~1/R/R-42~1.2/site-library
RENV_DEFAULT_R_LIBS_USER    = C:\Users\dlucey\AppData\Local/R/win-library/4.2
RENV_DEFAULT_R_PROFILE      = <NA>
RENV_DEFAULT_R_PROFILE_USER = <NA>
RENV_PROJECT                = C:/RStudio_Projects/R_projects/mdTools

# PATH ===============================
- C:\RBuildTools\rtools42/x86_64-w64-mingw32.static.posix/bin
- C:\RBuildTools\rtools42/usr/bin
- C:\Program Files\R\R-4.2.2\bin\x64
- C:\Program Files (x86)\Common Files\Oracle\Java\javapath
- C:\WINDOWS\system32
- C:\WINDOWS
- C:\WINDOWS\System32\Wbem
- C:\WINDOWS\System32\WindowsPowerShell\v1.0\
- C:\WINDOWS\System32\OpenSSH\
- C:\Program Files\Intel\WiFi\bin\
- C:\Program Files\Common Files\Intel\WirelessCommon\
- C:\Program Files\Docker\Docker\resources\bin
- C:\Program Files\Microsoft SQL Server\150\Tools\Binn\
- C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
- C:\Program Files\dotnet\
- C:\ProgramData\chocolatey\bin
- C:\Program Files\Git\cmd
- C:\Users\dlucey\AppData\Local\Microsoft\WindowsApps
-
- C:\Program Files\RStudio\resources\app\bin\rpostback
- C:\Program Files\RStudio\resources\app\bin\postback
- C:/Program Files/RStudio/resources/app/bin/quarto/bin

# Cache ==============================
There are a total of 294 package(s) installed in the renv cache.
Cache path: "C:/Users/dlucey/AppData/Local/R/cache/R/renv/cache/v5/R-4.2/x86_64-w64-mingw32"`\
</code>```

renv user cache (EDITED)

```<code>> renv:::renv_cache_list(packages = "DBI")
[1] "C:\\Users\\dlucey\\AppData\\Local/R/cache/R/renv/cache/v5/R-4.2/x86_64-w64-mingw32/DBI/1.1.3/b2866e62bab9378c3cc9476a1954226b/DBI"
</code>```

System user library (EDITED)

I've read that renv uses symlinks to my main user library where DBI is also installed:

```<code>> list.files("C:/Users/dlucey/AppData/Local/R/win-library/4.2")
    [46] "DBI"               "dbplyr"            "deldir"
```

```

Body:
I'm using renv for my private package (mdTools). devtools::install() works, but when I devtools::check(), it fails to find the DBI package, which is installed in my renv user cache.

devtools::check() error message

checking whether the package can be loaded ... ERROR
   Loading this package had a fatal error status code 1
  Loading log:
  Error: package or namespace load failed for 'mdTools' in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
   there is no package called 'DBI'
  Execution halted

This was a previous similar problem not using renv:
devtools::install() works but devtools::check() does not, so it is possible that this is not a renv problem. The answer there was to use the system library which doesn't seem like what I want to do.

What I've tried none of which resolved the issue

renv::remove("DBI") and renv::install("DBI")

renv::deactivate() and renv::init()

renv::clean()

renv::hydrate()

renv::purge("DBI") and renv::install("DBI")

renv::repair("DBI")

> renv::diagnostics()
Diagnostics Report [renv 0.16.0]
================================

# Session Info =======================
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base

other attached packages:
[1] mdTools_0.0.0.9000

loaded via a namespace (and not attached):
 [1] qpdf_1.3.0          xfun_0.36           tidyselect_1.2.0
 [4] janitor_2.1.0       purrr_1.0.0         rJava_1.0-6
 [7] snakecase_0.11.0    vctrs_0.5.1         generics_0.1.3
[10] htmltools_0.5.4     utf8_1.2.2          docxtractr_0.6.5
[13] blob_1.2.3          rlang_1.0.6         pillar_1.8.1
[16] glue_1.6.2          DBI_1.1.3           re2_0.1.2
[19] rappdirs_0.3.3      bit64_4.0.5         readxl_1.4.1
[22] rptTools_0.0.0.9000 uuid_1.1-0          lifecycle_1.0.3
[25] stringr_1.5.0       cellranger_1.1.0    zip_2.2.2
[28] AzureGraph_1.3.2    evaluate_0.19       knitr_1.41
[31] fastmap_1.1.0       tzdb_0.3.0          fansi_1.0.3
[34] xlsxjars_0.6.1      pdftools_3.3.2      Rcpp_1.0.9
[37] readr_2.1.3         openssl_2.0.5       renv_0.16.0
[40] xlsx_0.6.5          bit_4.0.5           digest_0.6.31
[43] hms_1.1.2           askpass_1.1         stringi_1.7.8
[46] openxlsx_4.2.5.1    keyring_1.3.1       dplyr_1.0.10
[49] rprojroot_2.0.3     here_1.0.1          cli_3.6.0
[52] odbc_1.3.3          tools_4.2.2         magrittr_2.0.3
[55] AzureAuth_1.3.3     tibble_3.1.8        pkgconfig_2.0.3
[58] ellipsis_0.3.2      data.table_1.14.6   xml2_1.3.3
[61] lubridate_1.9.0     timechange_0.1.1    rmarkdown_2.19
[64] assertthat_0.2.1    httr_1.4.4          Microsoft365R_2.3.4
[67] officer_0.5.1       rstudioapi_0.14     R6_2.5.1
[70] compiler_4.2.2

# Project ============================
Project path: "C:/RStudio_Projects/R_projects/mdTools"

# Status =============================
* The project is already synchronized with the lockfile.

# Packages ===========================
                 Library Source   Lockfile Source Path Dependency
AzureAuth          1.3.3   CRAN      1.3.3   CRAN  [1]   indirect
AzureGraph         1.3.2   CRAN      1.3.2   CRAN  [1]   indirect
DBI                1.1.3   CRAN      1.1.3   CRAN  [1]     direct
KernSmooth       2.23-20   CRAN       <NA>   <NA>  [2]       <NA>
MASS            7.3-58.1   CRAN       <NA>   <NA>  [2]       <NA>
Matrix             1.5-1   CRAN       <NA>   <NA>  [2]       <NA>
Microsoft365R      2.3.4   CRAN      2.3.4   CRAN  [1]     direct
R6                 2.5.1   CRAN      2.5.1   CRAN  [1]   indirect
Rcpp               1.0.9   CRAN      1.0.9   CRAN  [1]   indirect
askpass              1.1   CRAN        1.1   CRAN  [1]   indirect
assertthat         0.2.1   CRAN      0.2.1   CRAN  [1]   indirect
base64enc          0.1-3   CRAN      0.1-3   CRAN  [1]   indirect
bit                4.0.5   CRAN      4.0.5   CRAN  [1]   indirect
bit64              4.0.5   CRAN      4.0.5   CRAN  [1]   indirect
blob               1.2.3   CRAN      1.2.3   CRAN  [1]   indirect
boot              1.3-28   CRAN       <NA>   <NA>  [2]       <NA>
brew               1.0-8   CRAN       <NA>   <NA>  [1]   indirect
brio               1.1.3   CRAN       <NA>   <NA>  [1]   indirect
bslib              0.4.2   CRAN      0.4.2   CRAN  [1]   indirect
cachem             1.0.6   CRAN      1.0.6   CRAN  [1]   indirect
callr              3.7.3   CRAN       <NA>   <NA>  [1]   indirect
cellranger         1.1.0   CRAN      1.1.0   CRAN  [1]   indirect
class             7.3-20   CRAN       <NA>   <NA>  [2]       <NA>
cli                3.6.0   CRAN      3.6.0   CRAN  [1]   indirect
clipr              0.8.0   CRAN      0.8.0   CRAN  [1]   indirect
cluster            2.1.4   CRAN       <NA>   <NA>  [2]       <NA>
codetools         0.2-18   CRAN       <NA>   <NA>  [2]       <NA>
commonmark         1.8.1   CRAN       <NA>   <NA>  [1]   indirect
cpp11              0.4.3   CRAN      0.4.3   CRAN  [1]   indirect
crayon             1.5.2   CRAN      1.5.2   CRAN  [1]   indirect
credentials        1.3.2   CRAN       <NA>   <NA>  [1]   indirect
curl               4.3.3   CRAN      4.3.3   CRAN  [1]   indirect
data.table        1.14.6   CRAN     1.14.6   CRAN  [1]     direct
desc               1.4.2   CRAN       <NA>   <NA>  [1]   indirect
devtools           2.4.5   CRAN       <NA>   <NA>  [1]     direct
diffobj            0.3.5   CRAN       <NA>   <NA>  [1]   indirect
digest            0.6.31   CRAN     0.6.31   CRAN  [1]   indirect
docxtractr         0.6.5   CRAN      0.6.5   CRAN  [1]     direct
downlit            0.4.2   CRAN       <NA>   <NA>  [1]   indirect
dplyr             1.0.10   CRAN     1.0.10   CRAN  [1]   indirect
ellipsis           0.3.2   CRAN      0.3.2   CRAN  [1]   indirect
evaluate            0.19   CRAN       0.19   CRAN  [1]   indirect
fansi              1.0.3   CRAN      1.0.3   CRAN  [1]   indirect
fastmap            1.1.0   CRAN      1.1.0   CRAN  [1]   indirect
filelock           1.0.2   CRAN      1.0.2   CRAN  [1]   indirect
fontawesome        0.4.0   CRAN       <NA>   <NA>  [1]   indirect
foreign           0.8-83   CRAN       <NA>   <NA>  [2]       <NA>
fs                 1.5.2   CRAN      1.5.2   CRAN  [1]   indirect
generics           0.1.3   CRAN      0.1.3   CRAN  [1]   indirect
gert               1.9.2   CRAN       <NA>   <NA>  [1]   indirect
gh                 1.3.1   CRAN       <NA>   <NA>  [1]   indirect
gitcreds           0.1.2   CRAN       <NA>   <NA>  [1]   indirect
glue               1.6.2   CRAN      1.6.2   CRAN  [1]     direct
grDevices           <NA>   <NA>       <NA>   <NA>  [2]   indirect
graphics            <NA>   <NA>       <NA>   <NA>  [2]   indirect
here               1.0.1   CRAN      1.0.1   CRAN  [1]     direct
highr               0.10   CRAN       0.10   CRAN  [1]   indirect
hms                1.1.2   CRAN      1.1.2   CRAN  [1]   indirect
htmltools          0.5.4   CRAN      0.5.4   CRAN  [1]   indirect
htmlwidgets        1.6.1   CRAN       <NA>   <NA>  [1]   indirect
httpuv             1.6.7   CRAN       <NA>   <NA>  [1]   indirect
httr               1.4.4   CRAN      1.4.4   CRAN  [1]   indirect
ini                0.3.1   CRAN       <NA>   <NA>  [1]   indirect
janitor            2.1.0   CRAN      2.1.0   CRAN  [1]     direct
jose               1.2.0   CRAN      1.2.0   CRAN  [1]   indirect
jquerylib          0.1.4   CRAN      0.1.4   CRAN  [1]   indirect
jsonlite           1.8.4   CRAN      1.8.4   CRAN  [1]   indirect
keyring            1.3.1   CRAN      1.3.1   CRAN  [1]     direct
knitr               1.41   CRAN       1.41   CRAN  [1]     direct
later              1.3.0   CRAN       <NA>   <NA>  [1]   indirect
lattice          0.20-45   CRAN       <NA>   <NA>  [2]       <NA>
lifecycle          1.0.3   CRAN      1.0.3   CRAN  [1]   indirect
lubridate          1.9.0   CRAN      1.9.0   CRAN  [1]   indirect
magrittr           2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
mdTools             <NA>   <NA>       <NA>   <NA>  [1]     direct
memoise            2.0.1   CRAN      2.0.1   CRAN  [1]   indirect
methods             <NA>   <NA>       <NA>   <NA>  [2]   indirect
mgcv              1.8-41   CRAN       <NA>   <NA>  [2]       <NA>
mime                0.12   CRAN       0.12   CRAN  [1]   indirect
miniUI           0.1.1.1   CRAN       <NA>   <NA>  [1]   indirect
nlme             3.1-160   CRAN       <NA>   <NA>  [2]       <NA>
nnet              7.3-18   CRAN       <NA>   <NA>  [2]       <NA>
odbc               1.3.3   CRAN      1.3.3   CRAN  [1]     direct
officer            0.5.1   CRAN      0.5.1   CRAN  [1]     direct
openssl            2.0.5   CRAN      2.0.5   CRAN  [1]   indirect
openxlsx         4.2.5.1   CRAN    4.2.5.1   CRAN  [1]     direct
pdftools           3.3.2   CRAN      3.3.2   CRAN  [1]   indirect
pillar             1.8.1   CRAN      1.8.1   CRAN  [1]   indirect
pkgbuild           1.4.0   CRAN       <NA>   <NA>  [1]   indirect
pkgconfig          2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
pkgdown            2.0.7   CRAN       <NA>   <NA>  [1]   indirect
pkgload            1.3.2   CRAN       <NA>   <NA>  [1]   indirect
praise             1.0.0   CRAN       <NA>   <NA>  [1]   indirect
prettyunits        1.1.1   CRAN      1.1.1   CRAN  [1]   indirect
processx           3.8.0   CRAN       <NA>   <NA>  [1]   indirect
profvis            0.3.7   CRAN       <NA>   <NA>  [1]   indirect
progress           1.2.2   CRAN      1.2.2   CRAN  [1]   indirect
promises         1.2.0.1   CRAN       <NA>   <NA>  [1]   indirect
ps                 1.7.2   CRAN       <NA>   <NA>  [1]   indirect
purrr              1.0.0   CRAN      1.0.0   CRAN  [1]   indirect
qpdf               1.3.0   CRAN      1.3.0   CRAN  [1]   indirect
rJava              1.0-6   CRAN      1.0-6   CRAN  [1]   indirect
ragg               1.2.4   CRAN       <NA>   <NA>  [1]   indirect
rappdirs           0.3.3   CRAN      0.3.3   CRAN  [1]   indirect
rcmdcheck          1.4.0   CRAN       <NA>   <NA>  [1]   indirect
re2                0.1.2   CRAN      0.1.2   CRAN  [1]     direct
readr              2.1.3   CRAN      2.1.3   CRAN  [1]     direct
readxl             1.4.1   CRAN      1.4.1   CRAN  [1]     direct
rematch            1.0.1   CRAN      1.0.1   CRAN  [1]   indirect
rematch2           2.1.2   CRAN       <NA>   <NA>  [1]   indirect
remotes            2.4.2   CRAN       <NA>   <NA>  [1]   indirect
renv              0.16.0   CRAN     0.16.0   CRAN  [1]     direct
rlang              1.0.6   CRAN      1.0.6   CRAN  [1]   indirect
rmarkdown           2.19   CRAN       2.19   CRAN  [1]     direct
roxygen2           7.2.3   CRAN       <NA>   <NA>  [1]     direct
rpart             4.1.19   CRAN       <NA>   <NA>  [2]       <NA>
rprojroot          2.0.3   CRAN      2.0.3   CRAN  [1]   indirect
rptTools      0.0.0.9000    Git 0.0.0.9000    Git  [1]     direct
rstudioapi          0.14   CRAN       <NA>   <NA>  [1]   indirect
rversions          2.1.2   CRAN       <NA>   <NA>  [1]   indirect
sass               0.4.4   CRAN      0.4.4   CRAN  [1]   indirect
sessioninfo        1.2.2   CRAN       <NA>   <NA>  [1]   indirect
shiny              1.7.4   CRAN       <NA>   <NA>  [1]   indirect
snakecase         0.11.0   CRAN     0.11.0   CRAN  [1]   indirect
sodium             1.2.1   CRAN      1.2.1   CRAN  [1]   indirect
sourcetools        0.1.7   CRAN       <NA>   <NA>  [1]   indirect
spatial           7.3-15   CRAN       <NA>   <NA>  [2]       <NA>
stats               <NA>   <NA>       <NA>   <NA>  [2]   indirect
stringi            1.7.8   CRAN      1.7.8   CRAN  [1]   indirect
stringr            1.5.0   CRAN      1.5.0   CRAN  [1]   indirect
survival           3.4-0   CRAN       <NA>   <NA>  [2]       <NA>
sys                3.4.1   CRAN      3.4.1   CRAN  [1]   indirect
systemfonts        1.0.4   CRAN       <NA>   <NA>  [1]   indirect
testthat           3.1.6   CRAN       <NA>   <NA>  [1]   indirect
textshaping        0.3.6   CRAN       <NA>   <NA>  [1]   indirect
tibble             3.1.8   CRAN      3.1.8   CRAN  [1]   indirect
tidyr              1.2.1   CRAN      1.2.1   CRAN  [1]   indirect
tidyselect         1.2.0   CRAN      1.2.0   CRAN  [1]   indirect
timechange         0.1.1   CRAN      0.1.1   CRAN  [1]   indirect
tinytex             0.43   CRAN       0.43   CRAN  [1]   indirect
tools               <NA>   <NA>       <NA>   <NA>  [2]   indirect
tzdb               0.3.0   CRAN      0.3.0   CRAN  [1]   indirect
urlchecker         1.0.1   CRAN       <NA>   <NA>  [1]   indirect
usethis            2.1.6   CRAN       <NA>   <NA>  [1]   indirect
utf8               1.2.2   CRAN      1.2.2   CRAN  [1]   indirect
utils               <NA>   <NA>       <NA>   <NA>  [2]     direct
uuid               1.1-0   CRAN      1.1-0   CRAN  [1]   indirect
vctrs              0.5.1   CRAN      0.5.1   CRAN  [1]   indirect
vroom              1.6.0   CRAN      1.6.0   CRAN  [1]   indirect
waldo              0.4.0   CRAN       <NA>   <NA>  [1]   indirect
whisker            0.4.1   CRAN       <NA>   <NA>  [1]   indirect
withr              2.5.0   CRAN      2.5.0   CRAN  [1]   indirect
xfun                0.36   CRAN       0.36   CRAN  [1]   indirect
xlsx               0.6.5   CRAN      0.6.5   CRAN  [1]     direct
xlsxjars           0.6.1   CRAN      0.6.1   CRAN  [1]   indirect
xml2               1.3.3   CRAN      1.3.3   CRAN  [1]   indirect
xopen              1.0.0   CRAN       <NA>   <NA>  [1]   indirect
xtable             1.8-4   CRAN       <NA>   <NA>  [1]   indirect
yaml               2.3.6   CRAN      2.3.6   CRAN  [1]   indirect
zip                2.2.2   CRAN      2.2.2   CRAN  [1]   indirect

[1]: C:/Users/dlucey/AppData/Local/R/cache/R/renv/library/mdTools-fbe1603d/R-4.2/x86_64-w64-mingw32
[2]: C:/Users/dlucey/AppData/Local/Temp/RtmpEXMKbd/renv-system-library

# ABI ================================
* ABI conflict checks are not yet implemented on Windows.

# User Profile =======================
[no user profile detected]

# Settings ===========================
List of 10
 $ bioconductor.version     : chr(0)
 $ external.libraries       : chr(0)
 $ ignored.packages         : chr(0)
 $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
 $ r.version                : chr(0)
 $ snapshot.type            : chr "implicit"
 $ use.cache                : logi TRUE
 $ vcs.ignore.cellar        : logi TRUE
 $ vcs.ignore.library       : logi TRUE
 $ vcs.ignore.local         : logi TRUE

# Options ============================
List of 9
 $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
 $ download.file.method                : chr "libcurl"
 $ download.file.extra                 : NULL
 $ install.packages.compile.from.source: chr "interactive"
 $ pkgType                             : chr "both"
 $ repos                               : Named chr "https://cran.rstudio.com"
  ..- attr(*, "names")= chr "CRAN"
 $ renv.consent                        : logi TRUE
 $ renv.project.path                   : chr "C:/RStudio_Projects/R_projects/mdTools"
 $ renv.verbose                        : logi TRUE

# Environment Variables ==============
HOME                        = C:/Users/dlucey/OneDrive - South Bronx Classical Charter School/Documents
LANG                        = <NA>
MAKE                        = <NA>
R_LIBS                      = <NA>
R_LIBS_SITE                 = C:/PROGRA~1/R/R-42~1.2/site-library
R_LIBS_USER                 = C:/Users/dlucey/AppData/Local/R/cache/R/renv/library/mdTools-fbe1603d/R-4.2/x86_64-w64-mingw32;C:/Users/dlucey/AppData/Local/Temp/RtmpEXMKbd/renv-system-library
RENV_DEFAULT_R_ENVIRON      = <NA>
RENV_DEFAULT_R_ENVIRON_USER = <NA>
RENV_DEFAULT_R_LIBS         = <NA>
RENV_DEFAULT_R_LIBS_SITE    = C:/PROGRA~1/R/R-42~1.2/site-library
RENV_DEFAULT_R_LIBS_USER    = C:\Users\dlucey\AppData\Local/R/win-library/4.2
RENV_DEFAULT_R_PROFILE      = <NA>
RENV_DEFAULT_R_PROFILE_USER = <NA>
RENV_PROJECT                = C:/RStudio_Projects/R_projects/mdTools

# PATH ===============================
- C:\RBuildTools\rtools42/x86_64-w64-mingw32.static.posix/bin
- C:\RBuildTools\rtools42/usr/bin
- C:\Program Files\R\R-4.2.2\bin\x64
- C:\Program Files (x86)\Common Files\Oracle\Java\javapath
- C:\WINDOWS\system32
- C:\WINDOWS
- C:\WINDOWS\System32\Wbem
- C:\WINDOWS\System32\WindowsPowerShell\v1.0\
- C:\WINDOWS\System32\OpenSSH\
- C:\Program Files\Intel\WiFi\bin\
- C:\Program Files\Common Files\Intel\WirelessCommon\
- C:\Program Files\Docker\Docker\resources\bin
- C:\Program Files\Microsoft SQL Server\150\Tools\Binn\
- C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
- C:\Program Files\dotnet\
- C:\ProgramData\chocolatey\bin
- C:\Program Files\Git\cmd
- C:\Users\dlucey\AppData\Local\Microsoft\WindowsApps
-
- C:\Program Files\RStudio\resources\app\bin\rpostback
- C:\Program Files\RStudio\resources\app\bin\postback
- C:/Program Files/RStudio/resources/app/bin/quarto/bin

# Cache ==============================
There are a total of 294 package(s) installed in the renv cache.
Cache path: "C:/Users/dlucey/AppData/Local/R/cache/R/renv/cache/v5/R-4.2/x86_64-w64-mingw32"`\

renv user cache (EDITED)

> renv:::renv_cache_list(packages = "DBI")
[1] "C:\\Users\\dlucey\\AppData\\Local/R/cache/R/renv/cache/v5/R-4.2/x86_64-w64-mingw32/DBI/1.1.3/b2866e62bab9378c3cc9476a1954226b/DBI"

System user library (EDITED)

I've read that renv uses symlinks to my main user library where DBI is also installed:

> list.files("C:/Users/dlucey/AppData/Local/R/win-library/4.2")
    [46] "DBI"               "dbplyr"            "deldir"
```


问:
Using wildcards inside columns in SQLAlchemy
I'm trying to make selects in SQLAlchemy based on wildcards defined inside my column on a table in PostgreSQL.

Here's the "permissions" table:

```<code> select * from permissions;

    id | method |   path
   ----+--------+----------
     1 | GET    | /path1
     3 | GET    | /path2
     4 | POST   | /path2
     2 | POST   | /path1/%
    (4 rows)
</code>```

You can see that I have a wildcard defined in the last row of this table, so if I have any string that starts with "/path1/", this row will get correctly retrieved by the SELECT.

For example, if I have "/path1/example" as my string, I can make the following command:

```<code>select * from permissions where '/path1/example' like path;

 id | method |   path
----+--------+----------
  2 | POST   | /path1/%
(1 row)
</code>```

How can I replicate this in SQLAlchemy?

Body:
I'm trying to make selects in SQLAlchemy based on wildcards defined inside my column on a table in PostgreSQL.

Here's the "permissions" table:

 select * from permissions;

    id | method |   path
   ----+--------+----------
     1 | GET    | /path1
     3 | GET    | /path2
     4 | POST   | /path2
     2 | POST   | /path1/%
    (4 rows)

You can see that I have a wildcard defined in the last row of this table, so if I have any string that starts with "/path1/", this row will get correctly retrieved by the SELECT.

For example, if I have "/path1/example" as my string, I can make the following command:

select * from permissions where '/path1/example' like path;

 id | method |   path
----+--------+----------
  2 | POST   | /path1/%
(1 row)

How can I replicate this in SQLAlchemy?


问:
Overlay SVG path on top of image with object-fit cover
I am trying to overlay an SVG path on top of an image: https://gsap-svg-motion-path.webflow.io/

The image should take up full browser height (100vh) and have object-fit cover. I'm having trouble positioning the SVG path and maintaining responsiveness.

FYI I'm building it in Webflow, so the  lives inside another div with class html-embed.

Any help would be much appreciated. Thank you so much.


问:
npm version patch -f -m "bump the version and commit my changes"
I was hoping that there is a npm version command, which is:

bumping the version (patch/minor/major)

commits my new code and package.json with a text.

pushes the changes to the repo.

Like this:
npm version patch -f -m "bump the version and commit my changes"

Anyone know how to do that?


问:
Preserving parameter type info when calling a plv8 function in postgres
I am trying to get plv8 3.x working in Postgres v14.  I am trying to preserve the type information when calling a plv8 function, but everything ends up being just "object".  This is affecting my ability to do equality comparisons between two instances of the object.

```<code>do $$
begin
    CREATE TYPE t2 AS (
        arrival_date date,
        departure_date date
    );

    CREATE OR REPLACE FUNCTION foo1(t t2)
        RETURNS void
    AS
    $t1$
    begin
        raise notice 'foo1';
        raise notice '%', pg_typeof(t);
        raise notice '%', pg_typeof(t.arrival_date);
        raise notice '%', (t.arrival_date = t.departure_date);
    end
    $t1$ LANGUAGE plpgsql;

    CREATE OR REPLACE FUNCTION foo2(t t2)
        RETURNS void
    AS
    $t2$
        plv8.elog(NOTICE, 'foo2');
        plv8.elog(NOTICE, typeof t);
        plv8.elog(NOTICE, typeof t.arrival_date);
        plv8.elog(NOTICE, t.arrival_date == t.departure_date);
    $t2$ LANGUAGE plv8;

    CREATE OR REPLACE FUNCTION foo3(t anyelement)
        RETURNS void
    AS
    $t2$
        plv8.elog(NOTICE, 'foo3');
        plv8.elog(NOTICE, typeof t);
        plv8.elog(NOTICE, typeof t.arrival_date);
        plv8.elog(NOTICE, t.arrival_date == t.departure_date);
    $t2$ LANGUAGE plv8;

    -------------------------

    raise notice 'starting';
    perform foo1(row('2023-01-01'::date, '2023-01-01'::date)::t2);
    perform foo2(row('2023-01-01'::date, '2023-01-01'::date)::t2);
    perform foo3(row('2023-01-01'::date, '2023-01-01'::date)::t2);
    raise notice 'finishing';
end
$$ LANGUAGE plpgsql;
</code>```

The first, foo1, is a simple plsql function as a baseline so I can see that type is preserved under normal circumstances.  The second and third are a plv8 where the IN type is strongly typed and polymorphic (respectively).  Neither are preserving the types and as you can see, my equality is not working. (below is my output)

```<code>NOTICE:  starting
NOTICE:  foo1
NOTICE:  t2
NOTICE:  date
NOTICE:  t
NOTICE:  foo2
NOTICE:  object
NOTICE:  object
NOTICE:  false
NOTICE:  foo3
NOTICE:  object
NOTICE:  object
NOTICE:  false
NOTICE:  finishing
</code>```

Is there any way to preserve the type information in a plv8 function call?

I know I could turn everything into a string and compare, but that's extra processing that I would rather not do for every field I compare.

Body:
I am trying to get plv8 3.x working in Postgres v14.  I am trying to preserve the type information when calling a plv8 function, but everything ends up being just "object".  This is affecting my ability to do equality comparisons between two instances of the object.

do $$
begin
    CREATE TYPE t2 AS (
        arrival_date date,
        departure_date date
    );

    CREATE OR REPLACE FUNCTION foo1(t t2)
        RETURNS void
    AS
    $t1$
    begin
        raise notice 'foo1';
        raise notice '%', pg_typeof(t);
        raise notice '%', pg_typeof(t.arrival_date);
        raise notice '%', (t.arrival_date = t.departure_date);
    end
    $t1$ LANGUAGE plpgsql;

    CREATE OR REPLACE FUNCTION foo2(t t2)
        RETURNS void
    AS
    $t2$
        plv8.elog(NOTICE, 'foo2');
        plv8.elog(NOTICE, typeof t);
        plv8.elog(NOTICE, typeof t.arrival_date);
        plv8.elog(NOTICE, t.arrival_date == t.departure_date);
    $t2$ LANGUAGE plv8;

    CREATE OR REPLACE FUNCTION foo3(t anyelement)
        RETURNS void
    AS
    $t2$
        plv8.elog(NOTICE, 'foo3');
        plv8.elog(NOTICE, typeof t);
        plv8.elog(NOTICE, typeof t.arrival_date);
        plv8.elog(NOTICE, t.arrival_date == t.departure_date);
    $t2$ LANGUAGE plv8;

    -------------------------

    raise notice 'starting';
    perform foo1(row('2023-01-01'::date, '2023-01-01'::date)::t2);
    perform foo2(row('2023-01-01'::date, '2023-01-01'::date)::t2);
    perform foo3(row('2023-01-01'::date, '2023-01-01'::date)::t2);
    raise notice 'finishing';
end
$$ LANGUAGE plpgsql;

The first, foo1, is a simple plsql function as a baseline so I can see that type is preserved under normal circumstances.  The second and third are a plv8 where the IN type is strongly typed and polymorphic (respectively).  Neither are preserving the types and as you can see, my equality is not working. (below is my output)

NOTICE:  starting
NOTICE:  foo1
NOTICE:  t2
NOTICE:  date
NOTICE:  t
NOTICE:  foo2
NOTICE:  object
NOTICE:  object
NOTICE:  false
NOTICE:  foo3
NOTICE:  object
NOTICE:  object
NOTICE:  false
NOTICE:  finishing

Is there any way to preserve the type information in a plv8 function call?

I know I could turn everything into a string and compare, but that's extra processing that I would rather not do for every field I compare.


问:
How to make sure alerts trigger in certain order in pine script strategies?
Using alerts that trigger with the same condition or on the same bar close seem to trigger in a random order each time. How can I specify that each alert has a specific order that alerts are triggered in?

Example image of how alerts with same condition trigger in different order (30sec timeframe). First it alerts in order: 1. "Long" 2. "Cancel Short, but on the next bar they trigger 1. "Cancel short" 2. "Long". This seems completely random.
Alert order

Here is just a simplified script to test it on:
(The real script also uses alert.freq_once_per_bar_close)

```<code>//@version=5
strategy("My strategy", overlay=true, margin_long=100, margin_short=100)

ema1 = ta.ema(close,14)
plot(ema1)

if close > ema1 and close[1] < ema1
    strategy.entry("My Long Entry Id", strategy.long)
    alert("Long", alert.freq_once_per_bar_close)
    alert("Cancel short", alert.freq_once_per_bar_close)

if close < ema1 and close[1] > ema1
    strategy.entry("My Short Entry Id", strategy.short)
    alert("Short", alert.freq_once_per_bar_close)
    alert("Cancel long", alert.freq_once_per_bar_close)
</code>```

You would expect the alert to go off always in the same order based on the order they appear in the script. This is not the case. Changing the alert placement inside the script has no affect on alert trigger order.

Body:
Using alerts that trigger with the same condition or on the same bar close seem to trigger in a random order each time. How can I specify that each alert has a specific order that alerts are triggered in?

Example image of how alerts with same condition trigger in different order (30sec timeframe). First it alerts in order: 1. "Long" 2. "Cancel Short, but on the next bar they trigger 1. "Cancel short" 2. "Long". This seems completely random.
Alert order

Here is just a simplified script to test it on:
(The real script also uses alert.freq_once_per_bar_close)

//@version=5
strategy("My strategy", overlay=true, margin_long=100, margin_short=100)

ema1 = ta.ema(close,14)
plot(ema1)

if close > ema1 and close[1] < ema1
    strategy.entry("My Long Entry Id", strategy.long)
    alert("Long", alert.freq_once_per_bar_close)
    alert("Cancel short", alert.freq_once_per_bar_close)

if close < ema1 and close[1] > ema1
    strategy.entry("My Short Entry Id", strategy.short)
    alert("Short", alert.freq_once_per_bar_close)
    alert("Cancel long", alert.freq_once_per_bar_close)

You would expect the alert to go off always in the same order based on the order they appear in the script. This is not the case. Changing the alert placement inside the script has no affect on alert trigger order.


问:
Why can't I access variables through the DS segment register?
I wrote the following real-mode 8086 assembly program that's supposed to fill the whole screen with asterisks but it's not working properly - it seems that the position variable cannot be accessed from the callback function. What's weird for me is that it works if I move all the variables from the data section to the code section. What am I doing wrong here?

.386
ASSUME ds:data, cs:code, ss:stack

VEC8_OFFSET  = 8 * 4
VRAM_SEGMENT = 0B8000h / 010h
VRAM_SIZE    = 4000
IVT_BEGIN    = 0

data SEGMENT
    position     dw 0
    default_vec8 dd (?)
data ENDS

code SEGMENT use16 para public 'code'
callback PROC
    push fs
    push bx

    mov bx, VRAM_SEGMENT
    mov fs, bx

    mov bx, ds:position

    mov BYTE PTR fs:[bx], '*'
    mov BYTE PTR fs:[bx+1], 11100001b

    add bx, 2
    if_overflow:
        cmp bx, VRAM_SIZE
        jne end_if1
        mov bx, 0
    end_if1:
    mov ds:position, bx

    pop bx
    pop fs

    jmp DWORD PTR ds:default_vec8
callback ENDP

main PROC
; Initialize text mode
    mov al, 0
    mov ah, 5
    int 10

; ES: Interrupt Vector Table segment
    mov ax, IVT_BEGIN
    mov es, ax

; Saving the 8th vector
    mov eax, es:[VEC8_OFFSET]
    mov ds:default_vec8, eax

; Installing the callback function
    mov ax, SEG callback
    mov bx, OFFSET callback
    cli
    mov es:[VEC8_OFFSET], bx
    mov es:[VEC8_OFFSET + 2], ax
    sti

; Await input
    await:
        if_key_pressed:
            mov ah, 1
            int 16h
            jz end_if2
        if_pressed_x:
            mov ah, 0
            int 16h
            cmp al, 'x'
            je end_await
        end_if2:

        jmp await
    end_await:

    mov eax, ds:default_vec8
    cli
    mov es:[VEC8_OFFSET], eax
    sti

; Exit the program
    mov al, 0
    mov ah, 4Ch
    int 21h
main ENDP

code ENDS

stack SEGMENT stack
    db 128 dup (?)
stack ENDS

END main
```


问:
Defer ALL Quasar initialisation so that it starts ONLY after a promise is fulfilled?
I am using the Quasar environment, and WASM/emscripten for some core functions called from everywhere in my app, including in many initializations.

Unfortunately, WASM is asynchronously compiled, and nothing in my app works before this environment is ready.

This is what I would like to do:

```<code>initialize_WASM().then(()=>start_and_run_Quasar());
</code>```

Is there a way to do that (boot files, hooks, index.html ...)?

Thanks!

Michel

Body:
I am using the Quasar environment, and WASM/emscripten for some core functions called from everywhere in my app, including in many initializations.

Unfortunately, WASM is asynchronously compiled, and nothing in my app works before this environment is ready.

This is what I would like to do:

initialize_WASM().then(()=>start_and_run_Quasar());

Is there a way to do that (boot files, hooks, index.html ...)?

Thanks!

Michel


问:
Mediastyle notification not proper seen when screen is lock
How can I fix this in mediastylenotifications?

I want to do that


问:
How can I cast an array stored as string in MySQL table to integer array in PostgreSQL
I'm trying to import a MySQL table to a new PostgresSQL(14) table, using DBeaver. Seems like JSON values and int arrays are all stored as string.

One of the columns has values like "[1,2,3,4,...]"

So far this is what I'm looking at.

Source Type
Target Type

bigint
numeric

timestamp
timestamp

varchar (100)
text

varchar(255)
text

varchar (100)
text

timestamp
timestamp

timestamp
timestamp

timestamp
timestamp

varchar (255)
text

varchar (24)
text

varchar(255)
text

varchar (50)
text

varchar (150)
text

bigint
bigint

tinyint
bool

tinyint
bool

longtext (65535)
int4range?

varchar (20)
text

varchar (50)
text

varchar (50)
text

text(65535)
text

longtext(65535)
text

tinyint
int4

int
numeric

varchar (150)
text

bigint
numeric

varchar (10)
text

longtext (65535)
jsonb

Another thing is when I try interger[] as type. DBeaver throws this error;
Can't find specified data type by name: 'integer[]'

int4range is can be seen in the datatype list, but I'm not sure if that is what I think.

I figured out there is a transform section which I can write an expression, but I'm not sure what kind of expression can be written here, I couldn't find anything about it.

I've found a resource mentioning JEXL but not sure what that is. How this can be achieved? With or without DBeaver?

PS. Instead of using varchar(n), I'll be using constraints for text types.

Same table above, just for the reference;


问:
Hide weights that are used in a custom reactable weighted average aggregation
I am trying to hide the weights used in this reactable weighted average aggregation.

The table rolls up correctly without the show = FALSE parameter:
reactable1

However, it does not when show = FALSE is present:
reactable2

It only appears to correctly aggregate at the lowest grouping 'group_sub_sub'.

Attempt at a reproducible example:

```<code>library(reactable)

x <- data.frame(
  group = sample(c("a","b","c"), 200, replace = T),
  group_sub = sample(1:3, 200, replace = T),
  group_sub_sub = sample(c("x","y","z"), 200, replace = T),
  weight_to_hide = runif(200, 1000, 20000),
  return = runif(200, 0, 0.25)
  )

weighted_mean <-
  function(weight) {
    JS(
      paste0(
        "function(values, rows) {
          var numerator = 0
          var denominator = 0
          rows.forEach(function(row, index) {
            numerator += row['", weight, "'] * values[index]
            denominator += row['", weight, "']
          })

          return (numerator / denominator || 0)

        }"
      )
    )
  }

reactable(
  x,
  groupBy = c("group",
              "group_sub",
              "group_sub_sub"),
  columns = list(
    return = colDef(
      aggregate = weighted_mean(weight = "weight_to_hide"),
      format = colFormat(percent = TRUE, digits = 2)
    ),
    weight_to_hide = colDef(
      aggregate = "sum",
      show = FALSE,
      format = colFormat(currency = "USD", separators = T)
    )
  )
)

</code>```

Edit: The above was an attempt in Rstudio on Windows 11 locally. I have found the above code to work as expected when ran on a server version of Rstudio (ubuntu). Does anyone know why this is the case?

Working example on ubuntu server version

Body:
I am trying to hide the weights used in this reactable weighted average aggregation.

The table rolls up correctly without the show = FALSE parameter:
reactable1

However, it does not when show = FALSE is present:
reactable2

It only appears to correctly aggregate at the lowest grouping 'group_sub_sub'.

Attempt at a reproducible example:

library(reactable)

x <- data.frame(
  group = sample(c("a","b","c"), 200, replace = T),
  group_sub = sample(1:3, 200, replace = T),
  group_sub_sub = sample(c("x","y","z"), 200, replace = T),
  weight_to_hide = runif(200, 1000, 20000),
  return = runif(200, 0, 0.25)
  )

weighted_mean <-
  function(weight) {
    JS(
      paste0(
        "function(values, rows) {
          var numerator = 0
          var denominator = 0
          rows.forEach(function(row, index) {
            numerator += row['", weight, "'] * values[index]
            denominator += row['", weight, "']
          })

          return (numerator / denominator || 0)

        }"
      )
    )
  }

reactable(
  x,
  groupBy = c("group",
              "group_sub",
              "group_sub_sub"),
  columns = list(
    return = colDef(
      aggregate = weighted_mean(weight = "weight_to_hide"),
      format = colFormat(percent = TRUE, digits = 2)
    ),
    weight_to_hide = colDef(
      aggregate = "sum",
      show = FALSE,
      format = colFormat(currency = "USD", separators = T)
    )
  )
)

Edit: The above was an attempt in Rstudio on Windows 11 locally. I have found the above code to work as expected when ran on a server version of Rstudio (ubuntu). Does anyone know why this is the case?

Working example on ubuntu server version


问:
print document to physical printer
I don't know if I'm overlooking it or not finding it, but is there a way to print
a text, word, or pdf document to a physical printer?

In python, it is done this way:

```<code>os.startfile("myPDF.pdf","print")
</code>```

Is there anything similar in R or do I need to keep using lpr.exe in system2()?

Title: print document to physical printer

Body:
I don't know if I'm overlooking it or not finding it, but is there a way to print
a text, word, or pdf document to a physical printer?

In python, it is done this way:

os.startfile("myPDF.pdf","print")

Is there anything similar in R or do I need to keep using lpr.exe in system2()?


问:
Python namespace-subpackage naming convention
According to PEP 8 – Style Guide for Python Code, Python packages should also have short, all-lowercase names, although the use of underscores is discouraged. But Packaging namespace packages suggests mynamespace_subpackage_a as an alternative to namespace packages. Why they do not follow their own conventions? Is it OK to use underscores in this situation? Any example of packages that use underscores in their name?


问:
Error Code: 3143. Invalid JSON path expression. The error is around character position 3
I'm getting the hang of SQL but am struggling with JSON data handling. I just can't get it to work. I'm getting the subject error when trying to run a very basic query, so I'm missing something fundamental.

I've read through many tutorials and this post but I think I need an example using the data I'm working with.

Error

```<code>Error Code: 3143. Invalid JSON path expression. The error is around character position 3.
</code>```

Example JSON Data

```<code>{"1": {"name": "Part Source", "type": "Drop-Down List", "value": "Manufactured"}, "28": {"name": "Status", "type": "Drop-Down List", "value": "Current"}}
{"1": {"name": "Part Source", "type": "Drop-Down List", "value": "Manufactured"}, "28": {"name": "Status", "type": "Drop-Down List", "value": "Current"}}
{"1": {"name": "Part Source", "type": "Drop-Down List", "value": "Manufactured"}, "28": {"name": "Status", "type": "Drop-Down List", "value": "Current"}}
</code>```

The data resides in a table named part in a column named customFields.

I've tried many things but to start simple, below is my attempt to extract the name from the first nested key pair. This yields the above error.

```<code>SELECT customFields->>'$.1.name'

FROM part;
</code>```

I also tried with this the positional [0] and [1] after $.1.name with the same result.

Body:
I'm getting the hang of SQL but am struggling with JSON data handling. I just can't get it to work. I'm getting the subject error when trying to run a very basic query, so I'm missing something fundamental.

I've read through many tutorials and this post but I think I need an example using the data I'm working with.

Error

Error Code: 3143. Invalid JSON path expression. The error is around character position 3.

Example JSON Data

{"1": {"name": "Part Source", "type": "Drop-Down List", "value": "Manufactured"}, "28": {"name": "Status", "type": "Drop-Down List", "value": "Current"}}
{"1": {"name": "Part Source", "type": "Drop-Down List", "value": "Manufactured"}, "28": {"name": "Status", "type": "Drop-Down List", "value": "Current"}}
{"1": {"name": "Part Source", "type": "Drop-Down List", "value": "Manufactured"}, "28": {"name": "Status", "type": "Drop-Down List", "value": "Current"}}

The data resides in a table named part in a column named customFields.

I've tried many things but to start simple, below is my attempt to extract the name from the first nested key pair. This yields the above error.

SELECT customFields->>'$.1.name'

FROM part;

I also tried with this the positional [0] and [1] after $.1.name with the same result.


问:
how can i get a URL with parameters with express?
i´m trying to use a GET method using express with typescript.

```<code>import express from 'express';

export const updateModelRoute = express.Router()

updateModelRoute.get(´/updatemodel?host=edaserver.com&database=sampledata&user=asaf&password=asaf`,
(req,res) =\> {
const values = window.location.search;
console.log(values);})
</code>```

My server is running fine, but  the browser gives me the error constantly, Cannot GET /update/updatemodel

I´ve checked the route without the parameters, and it´s working fine. When i use the parameters, i get the error message. Any help ?

I´ve searched various methods to catch the parameters values, but i still can´t get the 200 ok. So everything i´ve done so far is useless.

Body:
i´m trying to use a GET method using express with typescript.

import express from 'express';

export const updateModelRoute = express.Router()

updateModelRoute.get(´/updatemodel?host=edaserver.com&database=sampledata&user=asaf&password=asaf`,
(req,res) =\> {
const values = window.location.search;
console.log(values);})

My server is running fine, but  the browser gives me the error constantly, Cannot GET /update/updatemodel

I´ve checked the route without the parameters, and it´s working fine. When i use the parameters, i get the error message. Any help ?

I´ve searched various methods to catch the parameters values, but i still can´t get the 200 ok. So everything i´ve done so far is useless.


问:
Snakemake cannot activate an existing conda environment
I understood from the Snakemake docs that the conda directive can take the name of an existing conda environment. However, I am faced with the error EnvironmentNameNotFound: Could not find conda environment. Why can Snakemake not find the existing conda environment? Please see my example below. I am using Miniconda3 and Snakemake v7.19.1, through Ubuntu 20.04 on WSL2.

My Snakefile contains:

```<code>rule test:
    output: temp("test.txt")
    conda: "test-env"
    shell: "touch {output}"
</code>```

The test-env environment was created as follows:

```<code>conda create -n test-env -y
</code>```

Running conda info --envs shows that test-env exists: test-env   /home/elh605/miniconda3/envs/test-env.

My snakemake command and the full output:

```<code>snakemake -j1 --use-conda

Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Job stats:
job      count    min threads    max threads
-----  -------  -------------  -------------
test         1              1              1
total        1              1              1

Select jobs to execute...

[Tue Jan 10 19:28:50 2023]
rule test:
    output: test.txt
    jobid: 0
    reason: Missing output files: test.txt
    resources: tmpdir=/tmp

Activating conda environment: test-env

EnvironmentNameNotFound: Could not find conda environment: test-env
You can list all discoverable environments with `conda info --envs`.

[Tue Jan 10 19:28:52 2023]
Finished job 0.
1 of 1 steps (100%) done
Removing temporary output test.txt.
Complete log: .snakemake/log/2023-01-10T192850.160679.snakemake.log
</code>```

I tried using the --conda-prefix option to point Snakemake to my base conda environment, however Snakemake still could not activate test-env. How can I tell Snakemake where to find test-env?

Body:
I understood from the Snakemake docs that the conda directive can take the name of an existing conda environment. However, I am faced with the error EnvironmentNameNotFound: Could not find conda environment. Why can Snakemake not find the existing conda environment? Please see my example below. I am using Miniconda3 and Snakemake v7.19.1, through Ubuntu 20.04 on WSL2.

My Snakefile contains:

rule test:
    output: temp("test.txt")
    conda: "test-env"
    shell: "touch {output}"

The test-env environment was created as follows:

conda create -n test-env -y

Running conda info --envs shows that test-env exists: test-env   /home/elh605/miniconda3/envs/test-env.

My snakemake command and the full output:

snakemake -j1 --use-conda

Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Job stats:
job      count    min threads    max threads
-----  -------  -------------  -------------
test         1              1              1
total        1              1              1

Select jobs to execute...

[Tue Jan 10 19:28:50 2023]
rule test:
    output: test.txt
    jobid: 0
    reason: Missing output files: test.txt
    resources: tmpdir=/tmp

Activating conda environment: test-env

EnvironmentNameNotFound: Could not find conda environment: test-env
You can list all discoverable environments with `conda info --envs`.

[Tue Jan 10 19:28:52 2023]
Finished job 0.
1 of 1 steps (100%) done
Removing temporary output test.txt.
Complete log: .snakemake/log/2023-01-10T192850.160679.snakemake.log

I tried using the --conda-prefix option to point Snakemake to my base conda environment, however Snakemake still could not activate test-env. How can I tell Snakemake where to find test-env?


问:
TypeError: Failed to convert elements of (None, -1, 3, 1) to Tensor. Consider casting elements to a supported type
I have a custom tensorflow layer which works fine by generating an output but it throws an error when used with the Keras functional API. Here is the code:

import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input

# --------- Custom Layer -------
def scaled_dot_product_attention(query, key, value, mask=None):
  key_dim = tf.cast(tf.shape(key)[-1], tf.float32)
  scaled_scores = tf.matmul(query, key, transpose_b=True) / np.sqrt(key_dim)

  if mask is not None:
    scaled_scores = tf.where(mask==0, -np.inf, scaled_scores)

  softmax = tf.keras.layers.Softmax()
  weights = softmax(scaled_scores)
  return tf.matmul(weights, value), weights

class MultiHeadSelfAttention(tf.keras.layers.Layer):
  def __init__(self, d_model, num_heads):
    super(MultiHeadSelfAttention, self).__init__()
    self.d_model = d_model
    self.num_heads = num_heads

    self.d_head = self.d_model // self.num_heads

    self.wq = tf.keras.layers.Dense(self.d_model)
    self.wk = tf.keras.layers.Dense(self.d_model)
    self.wv = tf.keras.layers.Dense(self.d_model)

    # Linear layer to generate the final output.
    self.dense = tf.keras.layers.Dense(self.d_model)

  def split_heads(self, x):
    batch_size = x.shape[0]

    split_inputs = tf.reshape(x, (batch_size, -1, self.num_heads, self.d_head))
    return tf.transpose(split_inputs, perm=[0, 2, 1, 3])

  def merge_heads(self, x):
    batch_size = x.shape[0]

    merged_inputs = tf.transpose(x, perm=[0, 2, 1, 3])
    return tf.reshape(merged_inputs, (batch_size, -1, self.d_model))

  def call(self, q, k, v, mask):
    qs = self.wq(q)
    ks = self.wk(k)
    vs = self.wv(v)

    qs = self.split_heads(qs)
    ks = self.split_heads(ks)
    vs = self.split_heads(vs)

    output, attn_weights = scaled_dot_product_attention(qs, ks, vs, mask)
    output = self.merge_heads(output)

    return self.dense(output)

# ----- Testing with simulated data -------
x = np.random.rand(1,2,3)
values_emb = MultiHeadSelfAttention(3, 3)(x,x,x, mask = None)
print(values_emb)
```
<p>This generates the following output:</p>
```tf.Tensor(
[[[ 0.50706375 -0.3537539  -0.23286441]
  [ 0.5081617  -0.3548487  -0.23382033]]], shape=(1, 2, 3), dtype=float32)
```
<p>But when I use it in the Keras functional API it doesn't work. Here is the code:</p>
<pre class="lang-py prettyprint-override"><code>x = Input(shape=(2,3))
values_emb = MultiHeadSelfAttention(3, 3)(x,x,x, mask = None)
model = Model(x, values_emb)
model.summary()
</code>```

This is the error:

```<code>TypeError: Failed to convert elements of (None, -1, 3, 1) to Tensor. Consider casting elements to a supported type.
</code>```

Does anyone know why this happens and how can I fix it?

Body:
I have a custom tensorflow layer which works fine by generating an output but it throws an error when used with the Keras functional API. Here is the code:

import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input

# --------- Custom Layer -------
def scaled_dot_product_attention(query, key, value, mask=None):
  key_dim = tf.cast(tf.shape(key)[-1], tf.float32)
  scaled_scores = tf.matmul(query, key, transpose_b=True) / np.sqrt(key_dim)

  if mask is not None:
    scaled_scores = tf.where(mask==0, -np.inf, scaled_scores)

  softmax = tf.keras.layers.Softmax()
  weights = softmax(scaled_scores)
  return tf.matmul(weights, value), weights

class MultiHeadSelfAttention(tf.keras.layers.Layer):
  def __init__(self, d_model, num_heads):
    super(MultiHeadSelfAttention, self).__init__()
    self.d_model = d_model
    self.num_heads = num_heads

    self.d_head = self.d_model // self.num_heads

    self.wq = tf.keras.layers.Dense(self.d_model)
    self.wk = tf.keras.layers.Dense(self.d_model)
    self.wv = tf.keras.layers.Dense(self.d_model)

    # Linear layer to generate the final output.
    self.dense = tf.keras.layers.Dense(self.d_model)

  def split_heads(self, x):
    batch_size = x.shape[0]

    split_inputs = tf.reshape(x, (batch_size, -1, self.num_heads, self.d_head))
    return tf.transpose(split_inputs, perm=[0, 2, 1, 3])

  def merge_heads(self, x):
    batch_size = x.shape[0]

    merged_inputs = tf.transpose(x, perm=[0, 2, 1, 3])
    return tf.reshape(merged_inputs, (batch_size, -1, self.d_model))

  def call(self, q, k, v, mask):
    qs = self.wq(q)
    ks = self.wk(k)
    vs = self.wv(v)

    qs = self.split_heads(qs)
    ks = self.split_heads(ks)
    vs = self.split_heads(vs)

    output, attn_weights = scaled_dot_product_attention(qs, ks, vs, mask)
    output = self.merge_heads(output)

    return self.dense(output)

# ----- Testing with simulated data -------
x = np.random.rand(1,2,3)
values_emb = MultiHeadSelfAttention(3, 3)(x,x,x, mask = None)
print(values_emb)

This generates the following output:

tf.Tensor(
[[[ 0.50706375 -0.3537539  -0.23286441]
  [ 0.5081617  -0.3548487  -0.23382033]]], shape=(1, 2, 3), dtype=float32)

But when I use it in the Keras functional API it doesn't work. Here is the code:

x = Input(shape=(2,3))
values_emb = MultiHeadSelfAttention(3, 3)(x,x,x, mask = None)
model = Model(x, values_emb)
model.summary()

This is the error:

TypeError: Failed to convert elements of (None, -1, 3, 1) to Tensor. Consider casting elements to a supported type.

Does anyone know why this happens and how can I fix it?


问:
ModuleNotFoundError: No module named 'models' on converting .pt to onnx
I am trying to convert my yolov5 model .pt file to onnx format.It shows this error

Traceback (most recent call last): File "onnx.py", line 10, in <module> model = torch.load(weights) File "/home/nawinrajkumar/TrafficFlow/Traffic-flow-kgx/venv/lib/python3.8/site-packages/torch/serialization.py", line 789, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/nawinrajkumar/TrafficFlow/Traffic-flow-kgx/venv/lib/python3.8/site-packages/torch/serialization.py", line 1131, in _load result = unpickler.load() File "/home/nawinrajkumar/TrafficFlow/Traffic-flow-kgx/venv/lib/python3.8/site-packages/torch/serialization.py", line 1124, in find_class return super().find_class(mod_name, name)

I used this code for the conversion of my model.

```<code>import torch
import torch.onnx
import sys

# Load your PyTorch model
weights = '/home/nawinrajkumar/TrafficFlow/Traffic-flow-kgx/yolov5s.pt'
model = torch.load(weights)

# Export the model to ONNX format
torch.onnx.export(model,
                  torch.randn(1, 3, 224, 224),
                  "model.onnx",
                  export_params=True)
</code>```

What should I do to convert my .pt model to .onnx format. I also tried the export.py on the yolov5 repository and it doesn't help too.

Body:
I am trying to convert my yolov5 model .pt file to onnx format.It shows this error

Traceback (most recent call last): File "onnx.py", line 10, in <module> model = torch.load(weights) File "/home/nawinrajkumar/TrafficFlow/Traffic-flow-kgx/venv/lib/python3.8/site-packages/torch/serialization.py", line 789, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/nawinrajkumar/TrafficFlow/Traffic-flow-kgx/venv/lib/python3.8/site-packages/torch/serialization.py", line 1131, in _load result = unpickler.load() File "/home/nawinrajkumar/TrafficFlow/Traffic-flow-kgx/venv/lib/python3.8/site-packages/torch/serialization.py", line 1124, in find_class return super().find_class(mod_name, name)

I used this code for the conversion of my model.

import torch
import torch.onnx
import sys

# Load your PyTorch model
weights = '/home/nawinrajkumar/TrafficFlow/Traffic-flow-kgx/yolov5s.pt'
model = torch.load(weights)

# Export the model to ONNX format
torch.onnx.export(model,
                  torch.randn(1, 3, 224, 224),
                  "model.onnx",
                  export_params=True)

What should I do to convert my .pt model to .onnx format. I also tried the export.py on the yolov5 repository and it doesn't help too.


问:
setInterval's interval always changes to 1 second (1000ms) after a few iterations
I am just trying to create a simple counter using setInterval. However, after 5 seconds, the interval slows down to about 1000ms. I'm sure I am just overlooking something silly, but for the life of me I cant see it.

var btn = document.getElementById("btn");
var num = document.getElementById('num');
btn.addEventListener("click", startCounter);

var interval;

function startCounter(){
  interval = setInterval(count, 100);
}

var idx = 0;

function count(){
  idx++;
  console.log(idx);
  num.textContent = idx;
  if(idx > 100) {
    clearInterval(interval);
    idx = 0;
  }
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><button id="btn">Click</button>
<div id="num" style="">0</div></code>```

Body:
I am just trying to create a simple counter using setInterval. However, after 5 seconds, the interval slows down to about 1000ms. I'm sure I am just overlooking something silly, but for the life of me I cant see it.

var btn = document.getElementById("btn");
var num = document.getElementById('num');
btn.addEventListener("click", startCounter);

var interval;

function startCounter(){
  interval = setInterval(count, 100);
}

var idx = 0;

function count(){
  idx++;
  console.log(idx);
  num.textContent = idx;
  if(idx > 100) {
    clearInterval(interval);
    idx = 0;
  }
}

<button id="btn">Click</button>

0


问:
Data is not loading when downloaded with gspread
I have a Python program that, among other things, download a Google Sheet using the official apis and gspread:

```<code>def download_gs_sheet(data_path_: str, filename: str, s_name: str, doc_id: str =__doc_id_horarios) -> None:
    """ Función para descargar hoja de cálculo desde Google Sheets

    :param data_path_: La ruta donde se guardará el archivo.
    :param filename: el nombre del archivo a guardar.
    :param s_name: La pestaña/hoja a descargar del documento.
    :param doc_id: El identificador del documento.
    """
    credential = os.path.join(os.path.dirname(__file__), 'credentials', "service_account.json")
    gc = gspread.service_account(credential)
    spreadsheet = gc.open_by_key(doc_id)
    worksheet = spreadsheet.worksheet(s_name)
    rows = worksheet.get_values()

    df = pd.DataFrame(rows)
    print(df)
    filename = os.path.join(data_path_, filename)
    df.to_excel(filename)
</code>```

The problem is that the data isn't loading correctly, and when the file is open, several "Loading" fields appear ("Cargando...", in Spanish):

I have no problem with the credentials or downloading other files, just this one.

The problematic document is a bit complex, even when viewed from the browser it takes several seconds to display the content correctly.

Any idea to solve this problem?

Thank you in advance.

```<code>type here
</code>```

I also tried with pydrive2 and the same problem arises.

Body:
I have a Python program that, among other things, download a Google Sheet using the official apis and gspread:

def download_gs_sheet(data_path_: str, filename: str, s_name: str, doc_id: str =__doc_id_horarios) -> None:
    """ Función para descargar hoja de cálculo desde Google Sheets

    :param data_path_: La ruta donde se guardará el archivo.
    :param filename: el nombre del archivo a guardar.
    :param s_name: La pestaña/hoja a descargar del documento.
    :param doc_id: El identificador del documento.
    """
    credential = os.path.join(os.path.dirname(__file__), 'credentials', "service_account.json")
    gc = gspread.service_account(credential)
    spreadsheet = gc.open_by_key(doc_id)
    worksheet = spreadsheet.worksheet(s_name)
    rows = worksheet.get_values()

    df = pd.DataFrame(rows)
    print(df)
    filename = os.path.join(data_path_, filename)
    df.to_excel(filename)

The problem is that the data isn't loading correctly, and when the file is open, several "Loading" fields appear ("Cargando...", in Spanish):

I have no problem with the credentials or downloading other files, just this one.

The problematic document is a bit complex, even when viewed from the browser it takes several seconds to display the content correctly.

Any idea to solve this problem?

Thank you in advance.

type here

I also tried with pydrive2 and the same problem arises.


问:
CFileDialog: dynamic modification of m_ofn?
C++/MFC, Windows 11. Visual Studio 2022 17.4.3.

I'm using CFileDialog to allow user to chose a file. By creating a new class derived from CFileDialog, I am being notified whenever the user changes directories (folders).

I implemented this so I could control the filter applied to the list of files in the directory. However, I have been unsuccessful in this. Even if I don't change m_ofn, I get an error.

Here is some sample code:

```<code>// Caller
#include "Browsing_test.h"
P brTest(true, NULL, NULL, 0, fileTypes);
brTest.BrowseTest();
</code>```
```<code>// Browsing_test.h
class P : CFileDialog
{
public:
    P(BOOL bOpenFileDialog,
        LPCTSTR lpszDefExt = NULL,
        LPCTSTR lpszFileName = NULL,
        DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
        LPCTSTR lpszFilter = NULL,
        CWnd *pParentWnd = NULL,
        DWORD dwSize = 0,
        BOOL bVistaStyle = TRUE) : CFileDialog(bOpenFileDialog,
            lpszDefExt,
            lpszFileName,
            dwFlags,
            lpszFilter,
            pParentWnd,
            dwSize,
            bVistaStyle) {};

    int BrowseTest(void);
</code>```
```<code>#include "stdafx.h"
#include "Browsing_test.h"

int P::BrowseTest(void)
{
    int resultDebug = (int)DoModal();
    return resultDebug;
}

void P::OnFolderChange()
{
    auto s = GetOFN();       // for modifying m_ofn member of the base class,
                             // but not used in this sample code
    // Add modificatons to m_ofn here
    ApplyOFNToShellDialog(); // Gets assert on updating flags
}
</code>```

Running this code gives an error in dlgfile.cpp (Microsoft code) at line:

```<code>hr = (static_cast<IFileDialog*>(m_pIFileDialog))->SetOptions(dwFlags);
</code>```

which returns hr = E_UNEXPECTED Catastrophic failure. The value of dwFlags was hex 40.

Body:
C++/MFC, Windows 11. Visual Studio 2022 17.4.3.

I'm using CFileDialog to allow user to chose a file. By creating a new class derived from CFileDialog, I am being notified whenever the user changes directories (folders).

I implemented this so I could control the filter applied to the list of files in the directory. However, I have been unsuccessful in this. Even if I don't change m_ofn, I get an error.

Here is some sample code:

// Caller
#include "Browsing_test.h"
P brTest(true, NULL, NULL, 0, fileTypes);
brTest.BrowseTest();

// Browsing_test.h
class P : CFileDialog
{
public:
    P(BOOL bOpenFileDialog,
        LPCTSTR lpszDefExt = NULL,
        LPCTSTR lpszFileName = NULL,
        DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
        LPCTSTR lpszFilter = NULL,
        CWnd *pParentWnd = NULL,
        DWORD dwSize = 0,
        BOOL bVistaStyle = TRUE) : CFileDialog(bOpenFileDialog,
            lpszDefExt,
            lpszFileName,
            dwFlags,
            lpszFilter,
            pParentWnd,
            dwSize,
            bVistaStyle) {};

    int BrowseTest(void);

#include "stdafx.h"
#include "Browsing_test.h"

int P::BrowseTest(void)
{
    int resultDebug = (int)DoModal();
    return resultDebug;
}

void P::OnFolderChange()
{
    auto s = GetOFN();       // for modifying m_ofn member of the base class,
                             // but not used in this sample code
    // Add modificatons to m_ofn here
    ApplyOFNToShellDialog(); // Gets assert on updating flags
}

Running this code gives an error in dlgfile.cpp (Microsoft code) at line:

hr = (static_cast<IFileDialog*>(m_pIFileDialog))->SetOptions(dwFlags);

which returns hr = E_UNEXPECTED Catastrophic failure. The value of dwFlags was hex 40.


问:
Cookies doesn't show up in my application ReactJS
Hello i'm trying to code auth for my app i'm using json web token the problem is when i send post request using postman i can see the cookie and access token in headers but in my application i can't see anything in my localstorage&cookies

Here is my code
authContext.js

```<code>import axios from "axios";
import { createContext, useEffect, useState } from "react";

export const AuthContext = createContext();

export const AuthContextProvider = ({ children }) => {

  const [currentUser, setCurrentUser] = useState(
    JSON.parse(localStorage.getItem("user")) || null
  );

  const login = async (inputs) => {
    const res = await axios.post("http://localhost:8800/api/auth/login", inputs, {
      withCredentials: true,
    });

    setCurrentUser(res.data)
  };

  useEffect(() => {
    localStorage.setItem("user", JSON.stringify(currentUser));
    console.log(currentUser);
  }, [currentUser]);

  return (
    <AuthContext.Provider value={{ currentUser, login }}>
      {children}
    </AuthContext.Provider>
  );
};

</code>```

in login.jsx

```<code>const [inputs, setInputs] = useState({
      username: "",
      password: "",
    });
    const [err, setErr] = useState(null);

    const navigate = useNavigate()

    const handleChange = (e) => {
      setInputs((prev) => ({ ...prev, [e.target.name]: e.target.value }));
    };

    const login  = useContext(AuthContext);

    const handleLogin = async (e) => {
      e.preventDefault();
      try {
        await login(inputs);
        navigate("/")
      } catch (err) {
        setErr(err.response.data);
      }
    };

    console.log(err);
    console.log(inputs);
</code>```

I'm trying to solve the problem because i'm trying to create a basic social app i need accessToken to display posts in my feed easily

Body:
Hello i'm trying to code auth for my app i'm using json web token the problem is when i send post request using postman i can see the cookie and access token in headers but in my application i can't see anything in my localstorage&cookies

Here is my code
authContext.js

import axios from "axios";
import { createContext, useEffect, useState } from "react";

export const AuthContext = createContext();

export const AuthContextProvider = ({ children }) => {

  const [currentUser, setCurrentUser] = useState(
    JSON.parse(localStorage.getItem("user")) || null
  );

  const login = async (inputs) => {
    const res = await axios.post("http://localhost:8800/api/auth/login", inputs, {
      withCredentials: true,
    });

    setCurrentUser(res.data)
  };

  useEffect(() => {
    localStorage.setItem("user", JSON.stringify(currentUser));
    console.log(currentUser);
  }, [currentUser]);

  return (
    <AuthContext.Provider value={{ currentUser, login }}>
      {children}
    </AuthContext.Provider>
  );
};

in login.jsx

const [inputs, setInputs] = useState({
      username: "",
      password: "",
    });
    const [err, setErr] = useState(null);

    const navigate = useNavigate()

    const handleChange = (e) => {
      setInputs((prev) => ({ ...prev, [e.target.name]: e.target.value }));
    };

    const login  = useContext(AuthContext);

    const handleLogin = async (e) => {
      e.preventDefault();
      try {
        await login(inputs);
        navigate("/")
      } catch (err) {
        setErr(err.response.data);
      }
    };

    console.log(err);
    console.log(inputs);

I'm trying to solve the problem because i'm trying to create a basic social app i need accessToken to display posts in my feed easily


问:
How to install libstdc++-static on RHEL-8?
I can't install libstdc++-static (or glibc-static for that matter).

When I do sudo yum install -y libstdc++-static

It returns with:

```<code>No package libstdc++-static available.
</code>```

I do have libstdc++-devel.ppc64le installed on the machine.

How can solve this?

Body:
I can't install libstdc++-static (or glibc-static for that matter).

When I do sudo yum install -y libstdc++-static

It returns with:

No package libstdc++-static available.

I do have libstdc++-devel.ppc64le installed on the machine.

How can solve this?


问:
AWS Policy fails to work for Cognito users -
I am able to allow cognito users full EC2 access but now want to limit EC2 access to those created by the cognito owner.  I've placed an EC2 key:value tag with the user's IdentityId.  I thought I could filter access with a custom AWS Policy however I get the following error when I attempt to get the list of nodes created by the cognito user:

UnauthorizedOperation: You are not authorized to perform this operation.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeInstances",
                "ec2:TerminateInstances",
                "ec2:StartInstances",
                "ec2:DescribeInstanceTypes",
                "ec2:StopInstances",
                "ec2:DescribeInstanceStatus"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "aws:ResourceTag/identity_id": "${cognito-identity.amazonaws.com:sub}"
                }
            }
        }
    ]
}
```

I've gone through the AWS documentation many times but I don't find a working example that fits my scenario.

Body:
I am able to allow cognito users full EC2 access but now want to limit EC2 access to those created by the cognito owner.  I've placed an EC2 key:value tag with the user's IdentityId.  I thought I could filter access with a custom AWS Policy however I get the following error when I attempt to get the list of nodes created by the cognito user:

UnauthorizedOperation: You are not authorized to perform this operation.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeInstances",
                "ec2:TerminateInstances",
                "ec2:StartInstances",
                "ec2:DescribeInstanceTypes",
                "ec2:StopInstances",
                "ec2:DescribeInstanceStatus"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "aws:ResourceTag/identity_id": "${cognito-identity.amazonaws.com:sub}"
                }
            }
        }
    ]
}

I've gone through the AWS documentation many times but I don't find a working example that fits my scenario.


问:
why my nuget package triggers dependency dll downgrade when install?
I have a nuget package that consumed by internal teams.
This is the dependency section in the nuspec file

```<code><dependencies>
  <dependency id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.9" />
  <dependency id="Newtonsoft.Json" version="12.0.2" />
  <dependency id="System.Runtime.Caching" version="4.5.0" />
  <dependency id="Polly" version="7.1.0" />
</dependencies>
</code>```

When some teams installed my nuget package, they complained that some dlls were downgraded. For example:

and

Yes, the code does use newton. However, in my dependency section, I didn't hard code the exact version and from visual studio, it shows this and I think newton json version 13 should be bigger than 12.0.2?

Then for System.Memory, I didn't include that as a dependency, so how come its version got degraded?

Body:
I have a nuget package that consumed by internal teams.
This is the dependency section in the nuspec file

<dependencies>
  <dependency id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.9" />
  <dependency id="Newtonsoft.Json" version="12.0.2" />
  <dependency id="System.Runtime.Caching" version="4.5.0" />
  <dependency id="Polly" version="7.1.0" />
</dependencies>

When some teams installed my nuget package, they complained that some dlls were downgraded. For example:

and

Yes, the code does use newton. However, in my dependency section, I didn't hard code the exact version and from visual studio, it shows this and I think newton json version 13 should be bigger than 12.0.2?

Then for System.Memory, I didn't include that as a dependency, so how come its version got degraded?


问:
how to upload an image that I receive binary and upload it to aws s3
I receive an image in binary format, through axios, I wanted to know how I could send this binary in aws s3 and in return I receive a link ?

let AWS = require('aws-sdk'),
fs = require('fs');

AWS.config.update({ accessKeyId: 'key', secretAccessKey: 'secret' });

var base64data = new Buffer.from(data, 'binary').toString('base64');

s3.putObject({
Bucket: 'mybucketname',
Key: 'test.jpeg',
Body: base64data,
Expires: 30

})


问:
There seems to be a problem with Django Urls?
When ever I run python manage.py runserver, I get a message in the terminal "Not Found: /base/". I do not have this in my urls to start off with anyways so why am I seeing this? Below is what shows up when I run the server. And my url server is default to "http://127.0.0.1:8000/base/" instead of "http://127.0.0.1:8000".

Using the URLconf defined in cric_manager.urls, Django tried these URL patterns, in this order:

admin/
manager/
The current path, base/, didn’t match any of these.

I tried to restart the termnial, VSCODE, and the webpage, but nothing seems to be working. Its getting a little bit annoying.