Add support for GCP IP Address

Pricing details: https://cloud.google.com/vpc/network-pricing#ipaddress
Terraform resource: google_compute_address
It might help to study the infracost/internal/providers/terraform/aws/eip.go file before adding this.

The pricing depends on whether the IP is assigned to an instance or not but the assignment is done in vm's resource:
resource "google_compute_address" "static" {
  name = "ipv4-address"
}

resource "google_compute_instance" "instance_with_ip" {
  name         = "vm-instance"
  machine_type = "f1-micro"
  zone         = "us-central1-a"

  network_interface {
    network = "default"
    access_config {
      nat_ip = google_compute_address.static.address
    }
  }
}

As far as I know, there's no easy way to get this info in our current structure. Any thoughts?

@sinabakh you're right, we've discussed having a reverse-lookup but only the AWS/GCP EIPs need it so far, so we didn't think it was important to do yet. Please check the logic in infracost/internal/providers/terraform/aws/eip.go as I think we can do the similar thing here, i.e. go with the estimation on a best-effort basis, and note that I called the component name IP address (if unused) in that file to make it clear.


[Storage] Prepare for blob/queue patch release

API change check
API changes are not detected in this pull request.


multi component (autopilot and gimbal)

that was a bug of the firmware of the gimbal. Gremsy has fixed it.


List.scan/mapi2/map3 algorithm improvements

I updated the unit tests for mapi2 and map3 to deal with lists of different sizes and did some various code cleanups by removing semicolons and unnecessary parenthesis.
Got the benchmarks via BenchmarkDotNet (here's my script). One thing that was strange is that for map3, and 10000 the median time is significantly slower. I'm not sure why this is. Maybe its a caching issue for my cpu.
   Method |   count |              Median |             StdDev |  Gen 0 |  Gen 1 |  Gen 2 | Bytes Allocated/Op |

------------- |-------- |-------------------- |------------------- |------- |------- |------- |------------------- |
scan |      10 |         304.5794 ns |         23.1709 ns |   0.03 |      - |      - |             350.03 |
map3Original |      10 |         341.7830 ns |         16.8830 ns |   0.04 |      - |      - |             484.78 |
scan |     100 |       2,101.3446 ns |        146.0541 ns |   0.20 |      - |      - |           2,575.35 |
map3Original |     100 |       2,619.7562 ns |        166.3117 ns |   0.33 |      - |      - |           4,318.09 |
scan |   10000 |     307,643.1233 ns |     15,477.0630 ns |   9.08 |   5.39 |      - |         299,334.00 |
map3Original |   10000 |     388,304.6069 ns |     17,862.5471 ns |  11.94 |   6.81 |      - |         372,673.40 |
scan | 1000000 | 209,831,043.4375 ns |  6,353,605.4655 ns | 414.61 | 327.88 | 148.69 |      19,587,572.91 |
map3Original | 1000000 | 315,592,189.5875 ns | 10,503,938.3686 ns | 558.84 | 467.34 | 215.47 |      27,217,987.13 |
    Method |   count |              Median |             StdDev |  Gen 0 |  Gen 1 |  Gen 2 | Bytes Allocated/Op |

-------------- |-------- |-------------------- |------------------- |------- |------- |------- |------------------- |
mapi2 |      10 |         469.7160 ns |         26.0642 ns |   0.04 |      - |      - |             536.93 |
mapi2Original |      10 |         530.8673 ns |         26.6073 ns |   0.05 |      - |      - |             648.88 |
mapi2 |     100 |       3,592.7509 ns |        171.6177 ns |   0.33 |      - |      - |           4,281.19 |
mapi2Original |     100 |       4,060.6522 ns |        151.7855 ns |   0.35 |      - |      - |           4,575.95 |
mapi2 |   10000 |     500,717.5401 ns |     22,130.9440 ns |  10.33 |   8.93 |      - |         452,556.13 |
mapi2Original |   10000 |     622,561.0294 ns |     35,048.0503 ns |  11.93 |  11.49 |      - |         554,726.80 |
mapi2 | 1000000 | 326,453,111.0025 ns | 12,013,955.8763 ns | 525.00 | 449.00 | 133.00 |      26,085,124.39 |
mapi2Original | 1000000 | 402,292,171.8100 ns |  9,277,239.0437 ns | 732.97 | 607.10 | 169.44 |      35,716,127.78 |
   Method |   count |              Median |             StdDev |    Gen 0 |  Gen 1 |  Gen 2 | Bytes Allocated/Op |

------------- |-------- |-------------------- |------------------- |--------- |------- |------- |------------------- |
map3 |      10 |         613.4993 ns |         32.6481 ns |     0.06 |      - |      - |             746.24 |
map3Original |      10 |         714.7689 ns |         45.0829 ns |     0.07 |      - |      - |             805.37 |
map3 |     100 |       4,568.9905 ns |        225.8320 ns |     0.46 |      - |      - |           5,560.82 |
map3Original |     100 |       5,278.0294 ns |        279.9612 ns |     0.61 |      - |      - |           7,363.74 |
map3 |   10000 |     682,773.1369 ns |     27,336.4413 ns |    12.59 |  12.05 |      - |         548,461.39 |
map3Original |   10000 |     644,494.0281 ns |     31,484.0954 ns |    30.53 |   9.28 |      - |         657,631.84 |
map3 | 1000000 | 501,848,898.9538 ns | 12,512,666.7946 ns |   777.00 | 692.00 | 171.00 |      36,030,283.15 |
map3Original | 1000000 | 592,864,013.6563 ns | 15,369,761.5252 ns | 1,058.00 | 906.00 | 200.00 |      47,469,251.94 |

Hi @liboz, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by Microsoft and real humans are currently evaluating your PR.
TTYL, MSBOT;

The code looks good!  I wouldn't worry about that map3 difference - the code looks sound and consistent, and I think that difference seems like a measurement artifact.

LGTM

Thank you for this contribution.


Prevent Markdown notes view controller from being invoked when creating new note

Solution: https://github.com/yoha/Notes/commit/bb3543f1d58dd80d6c7786a85ef1cac60cd01e13


Fix should_run method from Evolve Worker.

Short Description: Fixed should run method in Evolve Worker
Fixes:

Logic is not messed up anymore

Won't this pop a lucky egg every tick? I doubt that is the behavior people would want or expect.

Implemented changes after your feedback, guys.

@theadriann I don't know if any code from this made it in but evolving and lucky egg use seems fixed in latest DEV git pull
d39170553bbeffac4781ab49198bfa2f21b97c8e

Evolve Worker has changed a lot and this may not be relevant any more. This also has lots of merge conflicts at this point. If this fixes still need to get in, please open a new PR.


[FEATURE] Transforms should handle bucket script

Is your feature request related to a problem?
I want to have some computation done inside OpenSearch in a continuous manner, using transforms.
My use-case is very similar to the one described foe ElasticSearch in this blog post: https://xeraa.net/blog/2021_elasticsearch-transforms-duration-status-updates/
The query without transform produces the expected result, but I want this result updated and stored inside OpenSearch each minute.
When trying to declare the transform with a bucket script aggregation, I get an error message corresponding to https://github.com/opensearch-project/index-management/issues/671
What solution would you like?
OpenSearch Index Transforms handle bucket scripts aggregations https://opensearch.org/docs/latest/aggregations/pipeline-agg/#bucket_script-bucket_selector
I can then port the use-case in https://xeraa.net/blog/2021_elasticsearch-transforms-duration-status-updates/ to OpenSearch
What alternatives have you considered?
We can externally query OpenSearch each minute and update the target index with the retrieved result. This requires an external component, and superfluous network exchanges, data extraction from OpenSearch, and data storage in OpenSearch, all realized without any support for optimizing the data scope to handle. It is a crude brute-force workaround that will put down our OpenSearch storage.
Do you have any additional context?
If necessary guidance is provided, considering I can code in Java, I could envision doing the work, if it not too broad for a single person.

[Catch All Triage - 1, 2, 3, 4]


feat : Logout Button

Implemented Logout Button Functionality.

@SharmaNishchay why are you trying to copy my request?

@SharmaNishchay why are you trying to copy my request?

I want to clarify that my request doesn't replicate yours. Upon closer examination, you'll notice that your request focuses on adjustments to the profileFragment, whereas mine pertains to enhancements within the profile_userInfo_Adapter.


unable to get access code

this is my code to fetch the code.
$linkedin = new LinkedIn(env('LINKEDIN_KEY'), env('LINKEDID_SECRET'));
$linkedin->getAccessToken();
i changed getAccessTokenFromCode() in order to debug so when it throws the exception it returns $e and here is what i get.
LinkedInApiException {#309 ▼
#result: array:2 []
#message: "missing required parameters, includes an invalid parameter value, parameter more than once. : client_secret"
#code: 400
#file: "*/vendor/happyr/linkedin-api-client/src/Http/GuzzleRequest.php"
#line: 38
-trace: array:53 []
}
any ideas on how to debug or fix this issue? is it this code or guzzle?

I think there is problem with your code..
See the examples in the readme.

i got it.  ID10T mistake.  that error can also be that the key or secret are missing/invalid.  i misspelled the LINKEDIN_SECRET. sorry about that, at least when that error comes up someone will know to check their app credentials.
thanks for taking the time to respond.


Error creating a new project and publishing (LUIS)

Describe the bug
When trying to publish the project from composer I get the following error:
Provision partially completed
Provisioning completed 3 items before encountering a problem. {"name":"CREATE_LUIS_AUTHORING_RESOURCE_ERROR","message":"Error - The subscription does not have QuotaId/Feature required by SKU 'F0' from kind 'LUIS.Authoring' or contains blocked QuotaId/Feature.","stack":"Error\n at new CustomizeError (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:276418:25)\n at createCustomizeError (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:276423:10)\n at AzureResourceMananger.deployLuisAuthoringResource (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:277226:13)"}. See provision.testev6.log in your bot folder
LOG:
{
"profileName": "testev6",
"jobId": "bd5af691-74fb-4bee-90b0-02ade1e5a540",
"projectId": "39513.61535147306",
"time": "2024-09-02T11:22:01.555Z",
"log": [
"Creating Azure resources...",
"Checking the Existence of the Resource Group ...",
"Use the Resource Group: BRI_TEST at francecentral",
"> Creating App Registration ...",
"Start to add password for App, Id : 6d300de1-7cce-4ddc-a7f8-3XXXX,
"> Create App Registration Success! ID: 6d300de1-7cce-4ddc-a7f8-3cf2c42a4f6f",
"Deploying Web App Resource ...",
"Deploying Bot Resource ...",
"Deploying Luis Authoring Resource ...",
"{"stack":"Error: The subscription does not have QuotaId/Feature required by SKU 'F0' from kind 'LUIS.Authoring' or contains blocked QuotaId/Feature.\n    at new RestError2 (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:180915:26)\n    at /Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:181850:27\n    at async AzureResourceMananger.deployLuisAuthoringResource (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:277202:28)\n    at async BotProjectProvision.create (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:278113:46)\n    at async AzurePublisher.asyncProvision (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:278539:34)","message":"The subscription does not have QuotaId/Feature required by SKU 'F0' from kind 'LUIS.Authoring' or contains blocked QuotaId/Feature.","code":"SpecialFeatureOrQuotaIdRequired","statusCode":400,"request":{"body":"{\"kind\":\"LUIS.Authoring\",\"location\":\"westeurope\",\"sku\":{\"name\":\"F0\"}}"},"response":{"body":"{\"error\":{\"code\":\"SpecialFeatureOrQuotaIdRequired\",\"message\":\"The subscription does not have QuotaId/Feature required by SKU 'F0' from kind 'LUIS.Authoring' or contains blocked QuotaId/Feature.\"}}"},"body":{}}",
"{"name":"CREATE_LUIS_AUTHORING_RESOURCE_ERROR","message":"Error - The subscription does not have QuotaId/Feature required by SKU 'F0' from kind 'LUIS.Authoring' or contains blocked QuotaId/Feature.","stack":"Error\n    at new CustomizeError (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:276418:25)\n    at createCustomizeError (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:276423:10)\n    at AzureResourceMananger.deployLuisAuthoringResource (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:277226:13)"}",
"Provisioning completed 3 items before encountering a problem. {"name":"CREATE_LUIS_AUTHORING_RESOURCE_ERROR","message":"Error - The subscription does not have QuotaId/Feature required by SKU 'F0' from kind 'LUIS.Authoring' or contains blocked QuotaId/Feature.","stack":"Error\n    at new CustomizeError (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:276418:25)\n    at createCustomizeError (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:276423:10)\n    at AzureResourceMananger.deployLuisAuthoringResource (/Applications/Bot Framework Composer.app/Contents/Resources/app.asar.unpacked/extensions/azurePublish/dist/extension.js:277226:13)"}. See provision.testev6.log in your bot folder"
]
}
When trying to create the resource in the Azure portal, it does not allow me, indicating that the name is not available no matter how much I change it.
Version

Browser

[ ] Electron distribution
[ ] Chrome
[ ] Safari
[ ] Firefox
[ ] Edge

OS

[x] macOS
[ x] Windows
[ ] Ubuntu

To Reproduce
Steps to reproduce the behavior:

Create new project in composer 2.1.2
Publish

Expected behavior
Que se cree el recurso y que publique mi código del bot en el App Services.
Screenshots

When I try to create the resource manually to apply the subsequent configuration, it doesn't work for me. I've tried with Luis (old) and with Azure AI service for Language.

This is due to LUIS being depreciated. Do not use Composer to provision LUIS or other language resources at this time. I'm not sure the option will be removed, but I will check into that.
You will need to provision CLU or CQA resources outside of Composer and then utilize them in the dialogs.

Thanks,
By creating the resources by hand in Azure and publishing them outside of composer I can work normally.
I think I should update composer to use the new Azure resources and not Lus.
Regards


fix: switch to namespaced function stdlib::ensure_packages

The function ensure_packages is deprecated.
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, deprecation. ensure_packages. This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/forge/ca_cert/manifests/init.pp", 79]
...

I think that @kenyon is right - can you update the metadata.json file and I'll be happy to merge this.
Thanks for the work on this and finding the issue.

Since this now forcefully requires stdlib 9.x because of the stdlib:: namespacing, this should also be reflected in the supported Puppet versions for this module. stdlib 9.0 requires puppet 7.x or PE2021 and newer, but the module lists puppet 6 and PE 2016 as being supported.  I am still on 2019 for the time being and ca_cert 2.4 works.


"Run Script..." and "Run Previous Script..." action disabled

User reports the actions are disabled in 4.0 stable

Resolved in builds >= 4.1.4914

Fixed in 4.0.4958-stable


Release v1.1.1

I've run a test job in https://hyp3-test-api.asf.alaska.edu and confirmed that the plugin is now working as expected.


Improve the description of Config.home_path

I poked around and it seems it's not the user's home directory but Cargo
home (which may or may not be in user's home).

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.

@bors: r+
Thanks!

:pushpin: Commit daa053c933f9bbdf0a4991584613f534f221f897 has been approved by alexcrichton

:hourglass: Testing commit daa053c933f9bbdf0a4991584613f534f221f897 with merge 3b142db791ac023a8e8e856c1b18c1ea9367a81a...

:sunny: Test successful - checks-azure
Approved by: alexcrichton
Pushing 3b142db791ac023a8e8e856c1b18c1ea9367a81a to master...


avoid recursive checkout to avoid extra components we do not need

This helps with component governance as well as resources (disk & network)

We're green, yay :shipit:


BuildDescription: Set output path for bc files

Updates swift build with an -experimental-lto-mode option which can
be set to either "full" or "thin" enabling the use of llvm LTO for
both swift and c targets. Updates BuildParameters with a matching
linkTimeOptimizationMode and updates SwiftTargetBuildDescription to
use the proper file extension for bitcode objects as well as place
them in the proper output location.

@swift-ci please smoke test

@swift-ci please smoke test windows

+1 to that question, it's unclear what happens when both of these paths are used at once by different tools.

You both are right, I'm talking to artem about this now and will hopefully find a better solution...

The only time an issue can arise is if you pass -emit-bitcode to swiftc which will result in an assertion like:
SwiftDriverExecution/MultiJobExecutor.swift:207: Fatal error: multiple producers for output /<redacted>/.build/arm64-apple-macosx/release/Minified.build/Minified.swift.o: Embedding bitcode for Minified Minified.swift.o & Compiling Minified Minified.swift
[1]    70503 trace trap   --driver-mode=swiftc -module-name Minified -incremental -emit-dependencies

The only time an issue can arise is if you pass -emit-bitcode to swiftc

I'm not sure if the assertion error message is helpful enough. In what cases can that happen? Would it make sense to just write to a file with a different extension?

@swift-ci please smoke test

@swift-ci please smoke test windows

@swift-ci please smoke test

@swift-ci please smoke test windows

@swift-ci please smoke test windows

@swift-ci please smoke test windows

@swift-ci please smoke test windows

@tomerd I wonder if we need to mention this in CHANGELOG.md, or do we avoid from mentioning experimental options and features there?

good point, we can add and make sure its mentioned as experimental


Feature Request: could you add QR code scan feature?

Describe the solution you'd like
Could you add QR code scan feature like firefox?

that would be great


Update rpc-websockets to ^5.1.1

The current rpc-websockets dependency has a transitive dependency on debug:2.2.0 which is linked to CVE-2017-16137

Thanks @tdalbo92 for such a useful information.
We'll create a PR.


testing: Some of the tests in gl-testing are flaky

Some tests, particularly when running in parallel, are resulting in error calling remote method: status: Unknown, message: "transport error". They do so randomly but with a relatively high failure rate.
I think the issue might be TLS related:

CA cert mismatch
Server cert mismatch
Client cert mismatch
A random left-over scheduler from a previous run may still be listening on the same port

This issue is here to track our findings.

FYI - if vlsd2 starts prior to it's CLN node it emits the following:
[2023-06-06 00:16:13.812 vlsd2/vlsd2 ^[[32mINFO^[[0m] vlsd2 git_desc=v0.9.0-rc.1-3-g5fcaf95 starting
[2023-06-06 00:16:13.827 vlsd2/vls_proxy::grpc::signer ^[[32mINFO^[[0m] signer starting on testnet connecting to http://<IP_ADDRESS>:17701/
[2023-06-06 00:16:13.846 vlsd2/vls_proxy::grpc::signer ^[[33mWARN^[[0m] transport error connecting to signer, will retry
[2023-06-06 00:16:14.847 vlsd2/vls_proxy::grpc::signer ^[[33mWARN^[[0m] transport error connecting to signer, will retry
[2023-06-06 00:16:15.849 vlsd2/vls_proxy::grpc::signer ^[[33mWARN^[[0m] transport error connecting to signer, will retry
[2023-06-06 00:16:16.852 vlsd2/vls_proxy::grpc::signer ^[[33mWARN^[[0m] transport error connecting to signer, will retry
[2023-06-06 00:16:17.866 vlsd2/vls_proxy::grpc::signer ^[[32mINFO^[[0m] ping result hello
[2023-06-06 00:16:18.219 vlsd2/vls_proxy::grpc::signer ^[[32mINFO^[[0m] loaded seed

Not sure if the signer is indicated here, but the message is a match ...

The problem turned out to be a regression in grpcio which was corrupting TLS streams, so we blocklisted that version and are stable again.


Another way to implement multiple selection

Hi,
I don't like Select2. Just like you - I began to write my own implementation of <select> replacement script. I gave up because I felt like I'm starting to getting lost with it - I've never had written proper JS library - so my script currently likes to position dropdown wrong (should be easy to fix) and has no support for <optgroup> (harder to fix). I've tried many such scripts, but none of them managed to get one thing "right" for me - the multiple selections. Look what I've done:
https://www.dropbox.com/s/o2eqyf9no7kiy4m/2015-08-04_09-19-17.mp4?dl=0 (175KB, no worries about big DL)
I'd like to request something like that.
I select one element - it looks just like a single dropdown. I select two or more (I can just click-click-click and dropdown stays open) - it just shows "Multiple selection [count]". My script had (AFAIR I removed it for some reason) also an option to show selected items separated by comma. It's not a big deal to change this anyway and I'll be happy with any of this.
Do you think you'll be able to implement such thing? What do you think about this idea?
Oh, and if you for some reason want to see my library I can publish it. I was planning to do this when I think I'm happy with the results, but currently I am not.

no thoughts?

Seems you posted this just a few days before my wedding when I had other things on my mind :) Then I forgot about it, sorry!
But currently I don't really have a use case for this myself, so I don't think I'll implement this myself in Selectivity.
If you're interested in implementing this in your own InputType module for Selectivity I think I would be interested though, so if you want to do that, please re-open this ticket.
Cheers!


🚀 [Feature Request] - Create Toggle ( mentor/user - as login)

Is your feature request related to a problem ? Please describe. ✍

Just a example.
Describe briefly how you would implement this enhancement.
Provided a example

Additional context or screenshots
Additional context
Are you contributing for a program?
GSSoC2023
Code of Conduct

[X] I have read and agree to the Contributing Guidelines of this project.

@crocmons , I just provided this as an example.

Can I create like a sliding way with one side user & another side mentor for the login page only? @anmode  -

sure it would be good!! Just the thing is theme should be applied.

Hi, I have to plan things.. could you please provide the date upto which you can create PR for it. please

@crocmons ?

Ah, @anmode I can't do that right now as I need to submit other projects this week.. So, yeah, you can assign this problem to any other one..

Ah, @anmode I can't do that right now as I need to submit other projects this week.. So, yeah, you can assign this problem to any other one..

Oh ok @crocmons. Please ping in this issue when you get free. I see if nobody takes over you can work. thanks

I would like to work on this issue @anmode

Ok

This Issue still pending :)


[OneExplorer] Change element type to Node from OneNode

This commit builds child nodes on demand.
It includes

Change OneTreeDataProvider into type of TreeDataProvider instead of

OneNode is a TreeItem, which is a representation node
Node is an 'element', which is a core data structure
TreeDataProvider is designed to have 'element' to be 'unseen materials' and 'TreeItem' to be 'shown nodes, which is collapsible'.
To make our OneExplorer to build children only when expanding the 'TreeItem', we need to make it as a proper TreeDataProvider.

Introduce getChildren() function which builds children on demand.
Do not create 'hidden' extra nodes

Change didHideExtra as static, accordingly

Change getTree() not to build the whole tree but to obtain the root

Move workspaceRoot-checking code inside this

Change getChildren() and getTreeItem()

Implant toOneNode() code into getTreeItem()
Simplify getChildren() which only returns its child.

ONE-vscode-DCO-1.0-Signed-off-by: dayo09<EMAIL_ADDRESS>
From #1247
Waiting for #1249

Command Functionality Checker

[x] Refresh
[x] CreateCfg
[x] OpenAsText
[x] Delete
[x] RevealInExplorer
[x] RunCfg
- [ ] OpenContainingFolder

(I am currently on ssh-remote env, so I cannot test OpenContainingFolder, but you can see that the change is so obvious, or please check out the command for me :-D)

Please let us know when update is finished and ready to review. :-)

@hyunsik-yoon The updates are finished already :-D This PR is ready as is.

I was asking because during my review, I realized more code was committed.
I will start review. Thanks.

Ah. there was some misunderstanding. Sorry.
Thanks for notifying us. :-)


Last index is... ^1???

Every programming child knows - array elements start from index 0.
If you "reverse" your view and stay at the end of array, your first element is... right - at index 0! So what is that clown who decide that "^1" is a good index for the last element???
"^" is the sign: count elements from end, not from start. Nothing more. If you cannot understand it, never introduce such features!

This was discussed and debated in the C# language design meetings for months. There are valid arguments for ^0 and ^1 being the last element. The samples in this article explain the reason for the chosen behavior.
Closing as product question, and answered.

I see no any correspondence between "arr.Length" and "^" symbol. ESPECIALLY when you use it with indexes: "arr.Length5" - sorry WHAT is that? (it's long form of your "^5")
Adequate people look at "^" sign as "count from other side of array". So I stay at the last element and using "^0" I "shift" on 0 elements and take one.
a[0] - first element. a[^0] - last element. Logical as 2x2=4. What mind you had when accepting those "^1"?

Adequate people look at "^" sign as "count from other side of array". S

That's correct.  ^ is the 'other side' of the array.  So if you index into the other side, you index out of bounds as would be expected.
We considered both approaches, and took a look at what code what doing in many different repos that could benefit from ranges/indices.  It turned out for the  vast majority of them, this indexing approach turned out to be better (versus one where ^0 was the last element).
Based on the empirical data and uniformity of the design here, we went with this.  All the alternatives were discussed in depth, but had issues that made them less good overall than the one that was picked.
I hope that helps! :)


Can't open backpack storage when wearing it

The button registers the event as UseOrAttack, and the code checks for Use.
You can open the backpack normally when on your hands

Shouldn't this use a modifier key? e.g. shift + click. Ideally an input profile system for rebinds to avoid hardcoding shift would be nice.

We already have input profiles like that. Using a modifier key click is kind of hard because most of them are already reserved:

Shift click is examine.
Control click is throw.
We need a key for pulling (ctrl click in most code bases?)
I would like to have an alt button similar to SS13 alt click too.

Maybe middle click?


Some cosmetic, error and portability fixes

Hello. Thanks for your PR! I will review it and merge it soon.


I can't import #include "kiss_fft.h" in my native-lib.c

I follow all steps and import as "compile project(":jnifft-debug")" but can't import '#include "kissfft.h"'. Any solution?

How about:
compile project(":jnifft-release")

I generated the release version and imported it as 'compile project (': jnifft-release ')'

however the error continues.

I see that you are trying to create a JNI wrapper.
However, jnifft IS a wrapper around the C library and creates a JAVA class. If you want to write your own wrapper then use the orignal kiss fft and do it by yourself. No need to use this code here.
Check out for example FFTTest how to use the wrapper:
``       kissFastFourierTransformer = new KISSFastFourierTransformer();
    final int testsize = 64;
    double[] indata = new double[testsize];
    for (int i = 0; i < testsize; i++) indata[i] = Math.random() - 0.5;
    Complex[] outdata1 = kissFastFourierTransformer.transform(indata);

``

I understand, in this case all I have to do is import the 'kiss_fft.' Libraries so:

and create my own wrapper, right ?.

Yes

Thanks for helping! :D


(Generalized) Linear Mixed Model Tutorial

Hello,
I am relatively new to Turing.jl and Bayesian in general. I was wondering how I could go about implementing an LMM/GLMM model with a random intercept/slope, I couldn't find the tutorial for this in the documentation here: https://turing.ml/dev/tutorials/
I know there is some Stan stuff out there but I have never used that either so its been a bit difficult to translate. Turing.jl is actually the first time I am trying a Probabilistic Programming Language. The syntax I have seen so far is really nice, but nothing for multilevel models. Since multilevel models are a big use case for Bayesian, it would be nice to have a tutorial on them. Then users could refer to that for their use cases.
Thanks!

Thanks for the inquiry.
Linear mixed models in a Bayesian setting are simply hierarchical models. In a Frequentist setting, an LMM with random intercept requires specifying a distribution not only for the error terms, but random intercepts as well. In addition, other model parameters, e.g. a global intercept, are assumed to be fixed effects. The implication is that an LMM, which usually has both fixed and random effects, requires special considerations for estimating the effects; whereas In a model with only fixed effects, you can estimate parameters using optimization algorithms, like gradient descent. (Or in the case of linear regression, the best linear unbiased estimator is available in closed form.)
In a Bayesian setting, you would specify such a hierarchical model like this (in Turing):
using Turing
using Distributions
import Random

@model hierarchical_model_with_random_intercept(y, X, z) = begin
  # number of unique groups
  num_random_intercepts = length(unique(z))

  # number of predictors
  num_predictors = size(X, 2)

  ### Priors. May need to be chosen for particular application. ###

  # Prior for standard deviation for errors.
  sigma ~ LogNormal()

  # Prior for coefficients for predictors.
  beta ~ filldist(Normal(), num_predictors)

  # Prior for intercept.
  intercept ~ Normal()

  # Prior for variance of random intercepts. Usually requires thoughtful specification.
  s2 ~ InverseGamma(3, 2)
  s = sqrt(s2)

  # Prior for random intercepts.
  random_intercepts ~ filldist(Normal(0, s), num_random_intercepts)

  # likelihood.
  y .~ Normal.(intercept .+ X * beta + random_intercepts[z], sigma)
end

# Generate data.
Random.seed!(0)
N = 200
X = randn(N, 3)
z = [fill(1, 50); fill(2, 50); fill(3, 50); fill(4, 50)]
beta = [-2, 0, 2]
intercept = 1
random_intercepts = [-1, 1, -1, 1]
sigma = .5
y = intercept .+ X * beta + random_intercepts[z] + randn(N) * .1

# Sample via NUTS.
chain = sample(hierarchical_model_with_random_intercept(y, X, z), NUTS(), 2000)

# Print the posterior mean of model parameters.
mean(chain)

# Mean
#             parameters      mean
#                 Symbol   Float64
#
#                beta[1]   -1.9875
#                beta[2]   -0.0015
#                beta[3]    1.9902
#              intercept    0.7918
#   random_intercepts[1]   -0.7694
#   random_intercepts[2]    1.2085
#   random_intercepts[3]   -0.7999
#   random_intercepts[4]    1.2024
#                     s2    1.1104
#                  sigma    0.0997
#

A generalized LMM would replace the Gaussian likelihood with something else (e.g. Bernoulli, Binomial, Poisson, etc.) for when the response does not have support on the entire real line.

Thanks for the inquiry.
Linear mixed models in a Bayesian setting are simply hierarchical models. In a Frequentist setting, an LMM with random intercept requires specifying a distribution not only for the error terms, but random intercepts as well. In addition, other model parameters, e.g. a global intercept, are assumed to be fixed effects. The implication is that an LMM, which usually has both fixed and random effects, requires special considerations for estimating the effects; whereas In a model with only fixed effects, you can estimate parameters using optimization algorithms, like gradient descent. (Or in the case of linear regression, the best linear unbiased estimator is available in closed form.)
In a Bayesian setting, you would specify such a hierarchical model like this (in Turing):
using Turing
using Distributions
import Random

@model hierarchical_model_with_random_intercept(y, X, z) = begin
  # number of unique groups
  num_random_intercepts = length(unique(z))

  # number of predictors
  num_predictors = size(X, 2)

  ### Priors. May need to be chosen for particular application. ###

  # Prior for standard deviation for errors.
  sigma ~ LogNormal()

  # Prior for coefficients for predictors.
  beta ~ filldist(Normal(), num_predictors)

  # Prior for intercept.
  intercept ~ Normal()

  # Prior for variance of random intercepts. Usually requires thoughtful specification.
  s2 ~ InverseGamma(3, 2)
  s = sqrt(s2)

  # Prior for random intercepts.
  random_intercepts ~ filldist(Normal(0, s), num_random_intercepts)

  # likelihood.
  y .~ Normal.(intercept .+ X * beta + random_intercepts[z], sigma)
end

# Generate data.
Random.seed!(0)
N = 200
X = randn(N, 3)
z = [fill(1, 50); fill(2, 50); fill(3, 50); fill(4, 50)]
beta = [-2, 0, 2]
intercept = 1
random_intercepts = [-1, 1, -1, 1]
sigma = .5
y = intercept .+ X * beta + random_intercepts[z] + randn(N) * .1

# Sample via NUTS.
chain = sample(hierarchical_model_with_random_intercept(y, X, z), NUTS(), 2000)

# Print the posterior mean of model parameters.
mean(chain)

# Mean
#             parameters      mean
#                 Symbol   Float64
#
#                beta[1]   -1.9875
#                beta[2]   -0.0015
#                beta[3]    1.9902
#              intercept    0.7918
#   random_intercepts[1]   -0.7694
#   random_intercepts[2]    1.2085
#   random_intercepts[3]   -0.7999
#   random_intercepts[4]    1.2024
#                     s2    1.1104
#                  sigma    0.0997
#

A generalized LMM would replace the Gaussian likelihood with something else (e.g. Bernoulli, Binomial, Poisson, etc.) for when the response does not have support on the entire real line.

Thanks! This helps a lot. I am having a bit of trouble extending it to the random slope case, mainly since its hard to debug dimensions. I modified the above by adding this to the end. But I get an error about Dimension Mismatch
  #Prior for var of random slope
  s2_slope ~ InverseGamma(3,2)
  s_slope = sqrt(s2_slope)

  #Prior for random slopes

  random_slopes ~ filldist(Normal(0,s_slope),num_random_intercepts)

  # likelihood.
  y .~ Normal.(intercept .+ (X * (beta .+ random_slopes[z])) + random_intercepts[z], sigma)
end

Units wise, I need to add it to the beta before left multiplication with X, but I guess the issue is that beta is p x 1 and I need to have random_slopes[z] be p x 1 as well, which means the original random_slopes should be a vector of vectors I think but I don't know how to write that.

Thanks! This helps a lot. I am having a bit of trouble extending it to the random slope case, mainly since its hard to debug dimensions. I modified the above by adding this to the end. But I get an error about Dimension Mismatch
  #Prior for var of random slope
  s2_slope ~ InverseGamma(3,2)
  s_slope = sqrt(s2_slope)

  #Prior for random slopes

  random_slopes ~ filldist(Normal(0,s_slope),num_random_intercepts)

  # likelihood.
  y .~ Normal.(intercept .+ (X * (beta .+ random_slopes[z])) + random_intercepts[z], sigma)
end

Units wise, I need to add it to the beta before left multiplication with X, but I guess the issue is that beta is p x 1 and I need to have random_slopes[z] be p x 1 as well, which means the original random_slopes should be a vector of vectors I think but I don't know how to write that.

Let me write this model a different way.
y = X β + Z u + ϵ
where

y and ϵ are vectors of length N (number of observations), with y being the response, and epsilon being the errors.
X is a (known) design matrix of dimensions N x K, with K being the number of predictors (including a global intercept if desired).
beta are coefficients of length K
Z is a (known) design matrix for the "random effects (including slopes and intercepts)", of dimension N x J
u is a vector of "random effects (slopes and intercepts)" of dimension J

If you want a random-intercept-only model, then Z would be a matrix of ones and zeros. If there are only 3 groups and N=12, with the first 4 observations being in the first group, the next 4 being in the second group, and the last 4 being in the third group, then Z would be

1
0
0

1
0
0

1
0
0

1
0
0

0
1
0

0
1
0

0
1
0

0
1
0

0
0
1

0
0
1

0
0
1

0
0
1

If you want random slopes and intercepts, and you only have one covariate (so K=2, with first column being 1's and second column being the values of the predictors) then Z could be

1
0
0
x1,1
0
0

1
0
0
x1,2
0
0

1
0
0
x1,3
0
0

1
0
0
x1,4
0
0

0
1
0
0
x2,1
0

0
1
0
0
x2,2
0

0
1
0
0
x2,3
0

0
1
0
0
x2,4
0

0
0
1
0
0
x3,1

0
0
1
0
0
x3,2

0
0
1
0
0
x3,3

0
0
1
0
0
x3,4

where xi,j is the j-th measurement of the predictor for group i.
Note that if you include a global intercept, X should contain (exactly) one column of ones.
Does that make sense?

Let me write this model a different way.
y = X β + Z u + ϵ
where

y and ϵ are vectors of length N (number of observations), with y being the response, and epsilon being the errors.
X is a (known) design matrix of dimensions N x K, with K being the number of predictors (including a global intercept if desired).
beta are coefficients of length K
Z is a (known) design matrix for the "random effects (including slopes and intercepts)", of dimension N x J
u is a vector of "random effects (slopes and intercepts)" of dimension J

If you want a random-intercept-only model, then Z would be a matrix of ones and zeros. If there are only 3 groups and N=12, with the first 4 observations being in the first group, the next 4 being in the second group, and the last 4 being in the third group, then Z would be

1
0
0

1
0
0

1
0
0

1
0
0

0
1
0

0
1
0

0
1
0

0
1
0

0
0
1

0
0
1

0
0
1

0
0
1

If you want random slopes and intercepts, and you only have one covariate (so K=2, with first column being 1's and second column being the values of the predictors) then Z could be

1
0
0
x1,1
0
0

1
0
0
x1,2
0
0

1
0
0
x1,3
0
0

1
0
0
x1,4
0
0

0
1
0
0
x2,1
0

0
1
0
0
x2,2
0

0
1
0
0
x2,3
0

0
1
0
0
x2,4
0

0
0
1
0
0
x3,1

0
0
1
0
0
x3,2

0
0
1
0
0
x3,3

0
0
1
0
0
x3,4

where xi,j is the j-th measurement of the predictor for group i.
Note that if you include a global intercept, X should contain (exactly) one column of ones.
Does that make sense?

Thanks so much! I'm sure this will also help a lot of others looking to do Bayesian Multilevel Models, and the syntax here looks intuitive. This matrix representation helps since it is easier to generalize. I just checked on my data (which is just a simple 1D case of Y vs X but 4 groups for the REs).
Just one more thing is in my case, I want the fixed effects intercept and slope to have different prior values. I tried this:
beta .~ Normal.([0.5,100],[0.2,20])

but it didn't seem to work. However, when I did:
beta0 ~ Normal(0.5,0.2)
beta1 ~ Normal(100,20)
beta = vcat(beta0,beta1)

It worked. So I wonder, is there a way to broadcast the Normal prior here all in 1 go when you want a different prior for each coefficient? Or do you have to manually specify like this even if its from the same distribution?

Thanks so much! I'm sure this will also help a lot of others looking to do Bayesian Multilevel Models, and the syntax here looks intuitive. This matrix representation helps since it is easier to generalize. I just checked on my data (which is just a simple 1D case of Y vs X but 4 groups for the REs).
Just one more thing is in my case, I want the fixed effects intercept and slope to have different prior values. I tried this:
beta .~ Normal.([0.5,100],[0.2,20])

but it didn't seem to work. However, when I did:
beta0 ~ Normal(0.5,0.2)
beta1 ~ Normal(100,20)
beta = vcat(beta0,beta1)

It worked. So I wonder, is there a way to broadcast the Normal prior here all in 1 go when you want a different prior for each coefficient? Or do you have to manually specify like this even if its from the same distribution?

Just one more thing is in my case, I want the fixed effects intercept and slope to have different prior values. I tried this:
beta .~ Normal.([0.5,100],[0.2,20])
but it didn't seem to work.

Try this:
beta ~ arraydist(Normal.([0.5, 100], [0.2, 20]))

The documentation on Turing is constantly changing, so I'm going to quote a bit from the current doc:

Avoiding loops can be done using filldist(dist, N) and arraydist(dists). filldist(dist, N) creates a multivariate distribution that is composed of N identical and independent copies of the univariate distribution dist if dist is univariate, or it creates a matrix-variate distribution composed of N identical and independent copies of the multivariate distribution dist if dist is multivariate. filldist(dist, N, M) can also be used to create a matrix-variate distribution from a univariate distribution dist. arraydist(dists) is similar to filldist but it takes an array of distributions dists as input. Writing a custom distribution with a custom adjoint is another option to avoid loops.

From: https://turing.ml/dev/docs/using-turing/performancetips

Just one more thing is in my case, I want the fixed effects intercept and slope to have different prior values. I tried this:
beta .~ Normal.([0.5,100],[0.2,20])
but it didn't seem to work.

Try this:
beta ~ arraydist(Normal.([0.5, 100], [0.2, 20]))

The documentation on Turing is constantly changing, so I'm going to quote a bit from the current doc:

Avoiding loops can be done using filldist(dist, N) and arraydist(dists). filldist(dist, N) creates a multivariate distribution that is composed of N identical and independent copies of the univariate distribution dist if dist is univariate, or it creates a matrix-variate distribution composed of N identical and independent copies of the multivariate distribution dist if dist is multivariate. filldist(dist, N, M) can also be used to create a matrix-variate distribution from a univariate distribution dist. arraydist(dists) is similar to filldist but it takes an array of distributions dists as input. Writing a custom distribution with a custom adjoint is another option to avoid loops.

From: https://turing.ml/dev/docs/using-turing/performancetips

Thanks, using arraydist seems to work. Experimenting with something a bit more advanced now--I  noticed that in the above model you specified the Random Effects all have the same variance (and presumably the random intercept/slope are independent of each other). What I mean is for example the frequentist LMM in R lme4 using VarCorr() you get the variance of the RE intercept, RE slope, and their covariance.
How do I get those variance components here, I assume it would involve using a Covariance matrix prior. I tried:
I = 1/40 .* Matrix(LinearAlgebra.I(num_predictors_Z))
  Σ ~ Wishart(num_predictors_Z+5,I)
  # Prior for group effects.
  #u ~ filldist(Normal(0, s), num_predictors_Z)
  u ~ MultivariateNormal(fill(0,num_predictors_Z),Σ)
  # likelihood.
  y .~ Normal.(X * beta + Z * u, sigma)

Basically I am trying to use a Wishart as the prior for the random effect covariance matrix (since I think it generates Positive Semidefinite matrices?) with 1/40* identity scale (I got the 1/40 from 1/n here https://en.wikipedia.org/wiki/Wishart_distribution#Use_in_Bayesian_statistics) . The covariance matrix should have num_predictors_Z dimensions for each of the random intercept coefficients and slope I think?
I get the error PosDefException: matrix is not Hermitian. Cholesky factorization failed
But I thought the Wishart distribution generates Positive Definite matrices so this shouldn't be an issue? Am I doing something wrong? How can I get variance components?

Thanks, using arraydist seems to work. Experimenting with something a bit more advanced now--I  noticed that in the above model you specified the Random Effects all have the same variance (and presumably the random intercept/slope are independent of each other). What I mean is for example the frequentist LMM in R lme4 using VarCorr() you get the variance of the RE intercept, RE slope, and their covariance.
How do I get those variance components here, I assume it would involve using a Covariance matrix prior. I tried:
I = 1/40 .* Matrix(LinearAlgebra.I(num_predictors_Z))
  Σ ~ Wishart(num_predictors_Z+5,I)
  # Prior for group effects.
  #u ~ filldist(Normal(0, s), num_predictors_Z)
  u ~ MultivariateNormal(fill(0,num_predictors_Z),Σ)
  # likelihood.
  y .~ Normal.(X * beta + Z * u, sigma)

Basically I am trying to use a Wishart as the prior for the random effect covariance matrix (since I think it generates Positive Semidefinite matrices?) with 1/40* identity scale (I got the 1/40 from 1/n here https://en.wikipedia.org/wiki/Wishart_distribution#Use_in_Bayesian_statistics) . The covariance matrix should have num_predictors_Z dimensions for each of the random intercept coefficients and slope I think?
I get the error PosDefException: matrix is not Hermitian. Cholesky factorization failed
But I thought the Wishart distribution generates Positive Definite matrices so this shouldn't be an issue? Am I doing something wrong? How can I get variance components?

Can you try enforcing symmetry with
using LinearAlgebra
MultivariateNormal(fill(0,num_predictors_Z), Symmetric(Σ))

Can you try enforcing symmetry with
using LinearAlgebra
MultivariateNormal(fill(0,num_predictors_Z), Symmetric(Σ))

I get the same error, it seems to be occurring (based on the Atom IDE red highlighting) in the step before that where Σ is defined. So not sure if its numerical issues (which Symmetric() should theoretically prevent to my knowledge) or something else with the syntax

I get the same error, it seems to be occurring (based on the Atom IDE red highlighting) in the step before that where Σ is defined. So not sure if its numerical issues (which Symmetric() should theoretically prevent to my knowledge) or something else with the syntax

I'm not very experienced with multilevel / mixed effects models. But specifying a covariance for the u vector can be tricky and people tend to put structure into it. See this for example:
https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/198-30.pdf
My guess would be that adding small values (e.g. 1e-4) to the diagonal might help with the positive definiteness.
If that doesn't work, could you provide a minimal example to reproduce the errors?

I'm not very experienced with multilevel / mixed effects models. But specifying a covariance for the u vector can be tricky and people tend to put structure into it. See this for example:
https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/198-30.pdf
My guess would be that adding small values (e.g. 1e-4) to the diagonal might help with the positive definiteness.
If that doesn't work, could you provide a minimal example to reproduce the errors?

I'll have to think about the Wishart prior specifications.

I'll have to think about the Wishart prior specifications.

The Stan documentation is a good resource on multilevel models. They argue in favour of an LKJ prior over the Wishart. Using the LKJ doesn't solve the numerical precision problem, though.

The Stan documentation is a good resource on multilevel models. They argue in favour of an LKJ prior over the Wishart. Using the LKJ doesn't solve the numerical precision problem, though.

Thanks for providing examples of multilevel models. I have been trying to scale up your example to a more common amount of data. Unfortunately, it is running very slow and the progress meter is not displaying a estimated time. Its not clear to me whether memoization is applicable in this case. Do you have any recommendations?
using Turing, ReverseDiff
using Distributions
import Random

Turing.setadbackend(:reversediff)

@model multilevel_with_random_intercept(y, X, z) = begin
  # number of unique groups
  num_random_intercepts = length(unique(z))

  # number of predictors
  num_predictors = size(X, 2)

  ### NOTE: Carefully chosen priors should be used for a particular application. ###

  # Prior for standard deviation for errors.
  sigma ~ LogNormal()

  # Prior for coefficients for predictors.
  beta ~ filldist(Normal(), num_predictors)

  # Prior for intercept.
  intercept ~ Normal()

  # Prior for variance of random intercepts. Usually requires thoughtful specification.
  s2 ~ InverseGamma(3, 2)
  s = sqrt(s2)

  # Prior for random intercepts.
  random_intercepts ~ filldist(Normal(0, s), num_random_intercepts)

  # likelihood.
  y .~ Normal.(intercept .+ X * beta + random_intercepts[z], sigma)
end

# Generate data.
Random.seed!(0)
N = 30
n = 50
X = randn(N*n, 3)
z = repeat(1:N, inner=n)
beta = [-2, 0, 2]
intercept = 1
random_intercepts = rand(Normal(0,1), N)
sigma = .1
y = intercept .+ X * beta + random_intercepts[z] + randn(N*n) * sigma

# Sample via NUTS.
chain = sample(multilevel_with_random_intercept(y, X, z), NUTS(), 2000, progress=true)

# Print the posterior mean of model parameters.
mean(chain)

Thanks for providing examples of multilevel models. I have been trying to scale up your example to a more common amount of data. Unfortunately, it is running very slow and the progress meter is not displaying a estimated time. Its not clear to me whether memoization is applicable in this case. Do you have any recommendations?
using Turing, ReverseDiff
using Distributions
import Random

Turing.setadbackend(:reversediff)

@model multilevel_with_random_intercept(y, X, z) = begin
  # number of unique groups
  num_random_intercepts = length(unique(z))

  # number of predictors
  num_predictors = size(X, 2)

  ### NOTE: Carefully chosen priors should be used for a particular application. ###

  # Prior for standard deviation for errors.
  sigma ~ LogNormal()

  # Prior for coefficients for predictors.
  beta ~ filldist(Normal(), num_predictors)

  # Prior for intercept.
  intercept ~ Normal()

  # Prior for variance of random intercepts. Usually requires thoughtful specification.
  s2 ~ InverseGamma(3, 2)
  s = sqrt(s2)

  # Prior for random intercepts.
  random_intercepts ~ filldist(Normal(0, s), num_random_intercepts)

  # likelihood.
  y .~ Normal.(intercept .+ X * beta + random_intercepts[z], sigma)
end

# Generate data.
Random.seed!(0)
N = 30
n = 50
X = randn(N*n, 3)
z = repeat(1:N, inner=n)
beta = [-2, 0, 2]
intercept = 1
random_intercepts = rand(Normal(0,1), N)
sigma = .1
y = intercept .+ X * beta + random_intercepts[z] + randn(N*n) * sigma

# Sample via NUTS.
chain = sample(multilevel_with_random_intercept(y, X, z), NUTS(), 2000, progress=true)

# Print the posterior mean of model parameters.
mean(chain)

My guess is that NUTS is using a large tree depth.
Could you try replacing NUTS() with NUTS(nadapt=200, target_accept_ratio=0.8, max_depth=5)? This will probably make the sampler run faster, but I cannot speak to the quality of the samples in advance.

Thanks for getting back to me. I added NUTS(200, .8;max_depth=5) to the code above. It was much faster, but the effective sample size was around 6 for the random intercepts. It was low in the previous version as well. In addition, I tried to increase nadapt to 1000, but the results were similar. If you don't have any more ideas, I might do a comparison with Stan and submit a new issue.

Try a combination of gradually increasing the max_depth and lowering the target_accept_ratio. For target_accept_ratio, I wouldn't go below 0.65. For max_depth, the default is 10, IIRC. That's why you got the speed up. The defaults might be different for STAN.

The hyperprior for the intercept SDs are way too low
# Prior for variance of random intercepts. Usually requires thoughtful specification.
  s2 ~ InverseGamma(3, 2)
  s = sqrt(s2)

try this:
s ~ Truncated(Cauchy(0, 2), 0, Inf)
random_intercepts ~ filldist(Normal(0, s), num_random_intercepts)

and NUTS(0.65, num_warmup) -- NUTS with acceptance ratio of 0.65 (In my tests I didn't need to touch on max_depth and I set num_warmup = 1_000)

My go-to varying intercept model looks like this:
# Model
@model varying_intercept(X, idx, y) = begin
    n_gr = length(unique(idx))
    predictors = size(X, 2)

    # priors
    μ ~ Normal(mean(y), 2.5 * std(y))       # population-level intercept
    σ ~ Exponential(1 / std(y))             # residual SD
    # Coefficients Student-t(ν = 3)
    β ~ filldist(TDist(3), size(X, 2))
    # Prior for variance of random intercepts. Usually requires thoughtful specification.
    σᵢ ~ Truncated(Cauchy(0, 2), 0, Inf)
    # s = sqrt(s2)
    μᵢ ~ filldist(Normal(0, σᵢ), n_gr)      # group-level intercepts

    # likelihood
    ŷ = μ .+ X * β .+ μᵢ[idx]
    y ~ MvNormal(ŷ, σ)
end

Usually it should be more efficient to fix n_gr by making it an argument of the model (possibly with default value length(unique(idx))). Currently, it is recomputed every time you sample from the model or compute (the gradient of) the log pdf. Alternatively, maybe you could use an array type such as CategoricalArray that already encodes the (number of) levels.

Are CategoricalArrays supported by Turing? I am just trying to do that in a Bernoulli Model
sing Turing, RDatasets
# We need a logistic function, which is provided by StatsFuns.
using StatsFuns:logistic

default = RDatasets.dataset("ISLR", "Default")

X = Matrix(select(default, [:Student, :Balance, :Income]))
y = default[:, :Default]

# original formula: default ~ student + balance + income, family

@model logreg(X, y) = begin
	d = size(X, 2)
	μ ~ Normal(0, 2.5 * std(y))
	β ~ filldist(TDist(3), d)
	v = logistic.(μ .+ X * β)
	y .~ Bernoulli.(v)
end

model = logreg(X, y)

chn = sample(model, NUTS(1_000, 0.65), MCMCThreads(), 2_000, 4)

The problem is that :Student and :Default are CategoricalArrays and I get an error
ERROR: LoadError: TaskFailedException:
MethodError: no method matching /(::CategoricalValue{String,UInt8}, ::Int64)

y is an array of strings but Bernoulli only supports Reals. This is different from the example above with idx: idx is not an observation of a probability distribution. However, you have to ensure that the elements of idx can be used for indexing, i.e., are Ints.

@devmotion you are right! Thanks!
Going from 26s to 25s (1s improvement but that's something)
the model now is:
# Model
@model varying_intercept(X, idx, y; n_gr = length(unique(idx))) = begin
    predictors = size(X, 2)

    # priors
    μ ~ Normal(mean(y), 2.5 * std(y))       # population-level intercept
    σ ~ Exponential(1 / std(y))             # residual SD
    # Coefficients Student-t(ν = 3)
    β ~ filldist(TDist(3), size(X, 2))
    # Prior for variance of random intercepts. Usually requires thoughtful specification.
    σᵢ ~ Truncated(Cauchy(0, 2), 0, Inf)
    # s = sqrt(s2)
    μᵢ ~ filldist(Normal(0, σᵢ), n_gr)      # group-level intercepts

    # likelihood
    ŷ = μ .+ X * β .+ μᵢ[idx]
    y ~ MvNormal(ŷ, σ)
end

Also, while we are at it. Could you guys help me out? I'm trying to implement a multivariate varying-slope model that uses a cholesky decomposition. But I keep getting bad ESS and Rhat:
using Turing, RDatasets
using Random:seed!
using Statistics: mean, std
using LinearAlgebra: cholesky

seed!(1)

mtcars = RDatasets.dataset("datasets", "mtcars")

# Data prep
y = mtcars[:, :MPG]
idx = mtcars[:, :Cyl] # vector of group indeces
idx = map(idx) do i
    i == 4 ? 1 :
    i == 6 ? 2 :
    i == 8 ? 3 : missing
end
X = Matrix(select(mtcars, [:HP, :WT])) # the model matrix

# Model
@model varying_intercept_multi(X, idx, y; n_gr=length(unique(idx)), predictors=size(X, 2),
                               L=cholesky(cor(X)).L, mu =transpose(mean(X, dims=1))) = begin
    # priors
    μ ~ Normal(mean(y), 2.5 * std(y))                         # population-level intercept
    # Prior for variance of random intercepts. Usually requires thoughtful specification.
    σᵢ ~ Truncated(Cauchy(0, 2), 0, Inf)
    μᵢ ~ filldist(Normal(0, σᵢ), n_gr)                        # group-level intercepts
    # Non-Centered Parameterization
    β_raw ~ filldist(Normal(), predictors)                    # NCP hyperprior for slopes
    σⱼ ~ filldist(Truncated(Cauchy(0, 5), 0, Inf), predictors) # SD hyperprior for slopes
    α ~ filldist(Normal(), predictors)                        # mean hyperprior for slopes
    β = mus + σⱼ .* (L * α)
    σ ~ Exponential(1 / std(y))                               # residual SD

    # likelihood
    ŷ = vec(μ .+ X * β .+ μᵢ[idx])
    y ~ MvNormal(ŷ, σ)

    # generated quantities
    return β
end

mus is not defined, is it? BTW be careful with the default arguments - their values won't be updated when X changes.

Sorry my bad yes it is defined it was a mistake while copying and pasting. mu =transpose(mean(X, dims=1) is now mus =transpose(mean(X, dims=1)

If it helps, I have some code in this issue  that you can adapt.
I'm trying to work which backends are better in which circumstances. Using reverse ad can save a lot of time with bigger models.

By default Turing runs on forward diff?

Yeah, that's correct.

Please also see https://github.com/TuringLang/TuringGLM.jl


[BUG] tbl is nil in TooltipUtil.SurfaceArgs

Description
Intermittent crash when depositing reagents to my bank.
It appears to happen here: https://github.com/tomrus88/BlizzardInterfaceCode/blob/master/Interface/SharedXML/Tooltip/TooltipUtil.lua#L8
I'll add some debug prints to the addon to see if I can narrow down which table is nil.
I haven't yet seen it fail with only AdiBags loaded but I did test it that way. It's intermittent so I'll try to find it myself. I'm guessing another addon is leaving the tooltip with text in an unexpected format.
Addon Version
v1.6.2
World of Warcraft Flavor
Retail (Dragonflight)
Tested with only AdiBags_Bound

[X] Yes
[ ] No

Lua Error
Message: Interface/SharedXML/Tooltip/TooltipUtil.lua:8: attempt to index local 'tbl' (a nil value)
Time: Sat Mar 18 07:17:58 2023
Count: 52
Stack: Interface/SharedXML/Tooltip/TooltipUtil.lua:8: attempt to index local 'tbl' (a nil value)
[string "=(tail call)"]: ?
[string "@Interface/AddOns/AdiBags/core/Filters.lua"]:146: in function Filter' [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:849: in function FilterSlot'
[string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:883: in function DispatchItem' [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1052: in function RedispatchAllItems'
[string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1211: in function <Interface/AddOns/AdiBags/widgets/ContainerFrame.lua:1194>
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:19: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15>
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:54: in function SendMessage' [string "@Interface/AddOns/AdiBags/core/Core.lua"]:476: in function ?'
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:109: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:109>
[string "=[C]"]: ?
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:19: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15>
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:54: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:49>
[string "=(tail call)"]: ?
Locals:
Reproduction Steps
Hit the "D" button to transfer reagents to one's bank.
Screenshots
No response

Thanks for the report, I'll see if I can reproduce locally as well. Haven't seen this yet, but I don't really use that button. Intermittent bugs are the most annoying to debug 😅

My initial patch tests for the null table before invoking SurfaceArgs, prints a message, and returns nil. Alas, I was too busy playing to notice any message if it occurred, but I didn't see any more crashes after that.
I don't think the Deposit button is the only cause, as I noticed when alt-tabbing back into the game to post the bug report that I was standing at a vendor, so I think it also happened when vendoring junk, perhaps when I opened my bags. I'll remove the "return nil" to force a crash so I'll notice it when it happens again.
Candidate add-ons that might be triggering the issue are Altoholic and Auctioneer, both of which patch the tooltip with information.

I haven't seen it happen yet, my debug logs are never showing nil tables. The only addon you've mentioned that is an outlier here is Auctioneer. I run Altoholic as well, and so far, I haven't got any errors on that front.

I just hearthed to Oribos and had it happen on zoning in. Scanner is nil for all bags, but not all slots. I don't see a pattern in which slots are failing. I don't think it's empty or junk slots. But I'm only logging the failed bank/slot index and it's hard to know which item is which in the bag view, so I'll add some more logging.

This happened for me again today right after I hearthed to Valdrakken. I had DISABLED AdiBags Bound v1.6.3 a few days ago so currently I have installed:
AdiBags v1.10.7
AdiBags - Dragonflight (includes Crafting) v2.2.5
AdiBags - Low Level (Dragonflight Compatible) v1.0.1
AdiBags - Primordial Stones v1.0
411x SharedXML/Tooltip/TooltipUtil.lua:8: attempt to index local 'tbl' (a nil value)
[string "=(tail call)"]: ?
[string "@AdiBags/core/Filters.lua"]:146: in function Filter' [string "@AdiBags/widgets/ContainerFrame.lua"]:849: in function FilterSlot'
[string "@AdiBags/widgets/ContainerFrame.lua"]:883: in function DispatchItem' [string "@AdiBags/widgets/ContainerFrame.lua"]:1052: in function RedispatchAllItems'
[string "@AdiBags/widgets/ContainerFrame.lua"]:1211: in function <AdiBags/widgets/ContainerFrame.lua:1194>
[string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:119: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:19: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15>
[string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:54: in function SendMessage' [string "@AdiBags/core/Core.lua"]:476: in function ?'
[string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:109: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:109>
[string "=[C]"]: ?
[string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:19: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15>
[string "@AdiBags/libs/CallbackHandler-1.0-8/CallbackHandler-1.0.lua"]:54: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:49>
[string "=(tail call)"]: ?

Twice now I've had this happen when hitting the D button to transfer to my reagent bank, and my logging showed it was all the occupied slots in bag 5, which I believe is the reagent bag. So perhaps GetContainerItemLink intermittently fails in that situation. I know that some reagents can be soulbound so that's certainly not an ideal situation for this addon.

I can add a nil check before calling this util function and see if that stems the errors.

I do wonder why that function is failing just for the reagent bag, and intermittently. Blizzard bug? (That wouldn't surprise me.)

Bit of an update here: the 10.1 release changed the tooltips API again, and this time around we no longer need to call TooltipUtil.SurfaceArgs()

The C_TooltipInfo APIs now return data with all data and line arguments surfaced, removing the need to call TooltipUtil.SurfaceArgs().

This bug should no longer happen. If nothing else, due to the fact that I no longer call that function in this addon :)

I'd be fine with closing it, then. Thanks for letting me know. (Also, I didn't know addons could use icons for the addon list. I just added one to mine. Thanks!)


Create modal.html

Thanks for the patch.
Could you add a small test? A minimal layout could be created with the output asserted something like this.
https://github.com/django-crispy-forms/crispy-bootstrap5/blob/94f0ca5adbe528b7ea43ab8238e4adc849ae84a3/tests/test_layout_objects.py#L366

Do you have time to keep working on this?

Superseded by #151


review the copy for sponsor tiers

@lnug/contributors please can we take a look

relates to https://github.com/lnug/lnug.github.io/pull/44

thanks @jkbits1 for your review and PR, much apreciated


[Feature Request] Double tap to zoom

It would be great to have the comic zoom when double tapped. I have One handed use in mind.

Good idea, thanks!

🥇


Added bar_cmd_modifier

That's mostly taken from cmd_bindsym.
I understand the code but you might wanna double check this.

Looks good, minor style issue is all.


Enhancement: Display multi-line long text for dataview table

hello kepano
mini is an awesome theme, I've been using it for a long time
Recently I've improved my note-taking method and will often use dataview to capture long text
I found that the mini theme simplifies the styles in the dataview table:

Remove unordered list
Remove the forced line break

I can understand the simplification of the mini, but it can be very confusing for the presentation of long texts
like this:

There are two solutions I can think of (only just for someone,)

Can I use css snippet to open the unordered list of the dataview table and force line breaks?
like this:

Can the width of the DataViewtable be pulled to the widest in real-time preview mode, and can the unordered list style be added at the same time?
like this:

This could affect my entire workflow
Looking forward to your reply
@kepano
good luck

You can turn off trimming Dataview columns in Minimal Theme Settings

You can turn off trimming Dataview columns in Minimal Theme Settings

Yes, I opened it, and I just replaced the new v5.2 with the mini to support the Live preview mode "table-max", this problem has been solved.
thank you very much~
Another small question is, if I want to display the Unordered Lists style in the dataview-table, what should I do? Can you give me a hint?


Merge win32 metadata fix for CoInitializeSecurity

Just a reminder to merge a fix for https://github.com/microsoft/win32metadata/issues/837 before publishing the next update.

This was fixed with the recent metadata update.


Question: Exposing more of dart_api.h in dart_api_dl.h

Would exposing functions to CRU Dart objects from native in dart_api_dl.h, ie. functions like Dart_NewExternalUTF16String, etc. be something the SDK team would be okay with exposing?

Dart_NewExternalUTF16String seems okay.
We should consider if we want to also add equivalent operations on the dart:ffi side similar to asTypedData so that pointers could be quickly converted to external strings.
/cc @dcharkes

@nielsenko What is the list of functions you would like to expose?
Would you be able to draft a PR along the lines of https://dart-review.googlesource.com/c/sdk/+/269742.

We should consider if we want to also add equivalent operations on the dart:ffi side similar to asTypedData so that pointers could be quickly converted to external strings.

This is tracked in:

https://github.com/dart-lang/sdk/issues/39787

@dcharkes Yes we would be prepared to do the "work" ourself. Also this is not someting we need short term. The use of these are pending a rewrite of our binding layer, that we have not committed to finally yet. I'm just investigating the possibilities.
The list of functions as best I can tell at present would be:
DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value);
DART_EXPORT Dart_Handle Dart_IntegerToInt64(Dart_Handle integer, int64_t* value);
DART_EXPORT Dart_Handle Dart_NewDouble(double value);
DART_EXPORT Dart_Handle Dart_DoubleValue(Dart_Handle double_obj, double* value);
DART_EXPORT Dart_Handle Dart_NewBoolean(bool value);
DART_EXPORT Dart_Handle Dart_BooleanValue(Dart_Handle boolean_obj, bool* value);
DART_EXPORT Dart_Handle Dart_NewStringFromUTF8(const uint8_t* utf8_array, ntptr_t length);

Dart_NewExternalUTF16String(const uint16_t* utf16_array,
                            intptr_t length,
                            void* peer,
                            intptr_t external_allocation_size,
                            Dart_HandleFinalizer callback);

DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str,
                                          uint8_t** utf8_array,
                                          intptr_t* length);

DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data);

Dart_New(Dart_Handle type,
         Dart_Handle constructor_name,
         int number_of_arguments,
         Dart_Handle* arguments);

As an aside, it would be cool if the vm supported utf8 intrinsically, so that there would be a
Dart_NewExternalUTF8String(const uint8_t* utf8_array,
                            intptr_t length,
                            void* peer,
                            intptr_t external_allocation_size,
                            Dart_HandleFinalizer callback);

but that we would not attempt ourselves, and I guess that is a bit of a stretch to ask for.

DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value);
DART_EXPORT Dart_Handle Dart_IntegerToInt64(Dart_Handle integer, int64_t* value);
DART_EXPORT Dart_Handle Dart_NewDouble(double value);
DART_EXPORT Dart_Handle Dart_DoubleValue(Dart_Handle double_obj, double* value);
DART_EXPORT Dart_Handle Dart_NewBoolean(bool value);
DART_EXPORT Dart_Handle Dart_BooleanValue(Dart_Handle boolean_obj, bool* value);

These ones are a bit problematic because these operations are definitely more efficient when performed by the FFI trampoline itself, e.g doing Dart_NewDouble would create and return a box  - while the bridge has a chance to keep the value unboxed etc.
Do you have a design doc of some sort for the rewrite?

No design doc yet.
I see your point. Lets drop the ones that ffi can avoid boxing, ie. int, bool, and double. We do pay for boxing anyway on the Dart side today, but that would definitely be something we would like to avoid as part of a rewrite.


Simplify Idempotence Capability

Soundtrack of this PR: Idris Muhammed - Could Heaven Ever Be Like This
Motivation
The requirements for Transaction Idempotence have changed, and now only require a Seed to be passed down into the Transaction Builder.
In this PR

Add RngSeed type so consumers can pass in a seed to the Transaction Builder
Remove RNG seedability for txo selection
Update unit tests
Add new comparison utils for testing if TxOuts are idempotent (same txOutPublicKey)

will merge when CI passes

putting the merge on hold, until I finish discussing with Bernie.

good for now.

The requirements for Transaction Idempotence have changed, and now only require a Seed to be passed down into the Transaction Builder.

Add RngSeed type so consumers can pass in a seed to the Transaction Builder
Remove RNG seedability for txo selection
Update unit tests
Add new comparison utils for testing if TxOuts are idempotent (same txOutPublicKey)


Target: Implement as_root parameter for push/pull in base class

The AndroidTarget implementation is actually generic, so just move it
into the parent class so that LinuxTarget gets it too.

Oops didn't mean to submit this yet, will reopen once tested!


[Bug/issue]Extracted skeletons stretched out of the mesh

Hello,
I'm running lab4d on a given penguin video and trained another model from scratch for Fish category with around 50 video clips. However, the extracted skeletons don't fit within the meshes, but stretching out. Screenshot of the meshes and skeletons are shown below. I tried with the cat video and its skeleton looks correct. I wonder what might causing such issue and do you have any suggestions on resolving that?

Hi, there are two losses that enforces the skeleton to align with the shape: (1) gauss_skin_consistency_loss and (2) gauss_mask_loss. (1) forces the gaussians defined by the skeleton to match the NeRF density, and (2) forces the rendered gaussian silhouette to match the NeRF silhouette.
Therefore you may want to check the rendered gaussian silhouette in the tensorborad images tab, and see if that looks reasonable.
Besides, did you pass a fish skeleton when using --fg_motion skel-xx? If the quadruped skeleton is being used, it would be difficult to get the alignment working due to the different morphology. In such cases, --fg_motion bob is more suitable since it uses a bag of bones at the same level of hierarchy.

Thank you very much, I will check if I could increase the weight of those loss and retrain the model to get a better result.
Actually, I also see some cases that the skeleton might not align with the rendered mesh's limb e.g. the squirrel skeleton's left arm doesn't match with the mesh's left arm, this is using the provided preprocessed data and checkpoints. Do you have related loss to control that?

For fish case, I do use my own fish skeleton to run the model with 50 videos 70 frames each. Do you think that's enough of the data to make the skeleton align with the shape?

Hi, the results you showed look reasonable. These misalignment are expected.
PPR branch typically has better alignment than the main branch, due to a use of more powerful gauss_skin_consistency_loss, which computes the optimal transport between bone gaussians to the canonical mesh, and forces them to align.

I see, will check the PPR. Thank you very much!


Verify that osnadmin client allow you to have any orderer node join/unjoin any channel

Hello, in case the number of channel is increased I see that from v2.3+ I can increase the orderer nodes and use them in the new channels. Is this supported by the operator?

This is how the network works in the getting started, using the channel participation API.
When creating a channel:
https://kfsoftware.github.io/hlf-operator/docs/getting-started#create-a-channel
This step is used to join the orderer to the channel:
kubectl hlf ordnode join --block=demo.block --name=ordservice --namespace=default --identity=admin-tls-ordservice.yaml

Perfect, so in case I need to generate a new channel (to join my already available orgs) I can create a new orderer node and join it to the new channel. In this way I can balance the load to the different ordering nodes. Correct?

Yes, with a small catch, if you want to add the orderer to the consensus, you'll need to add the orderer to the consenters field in the channel.
You can find some leads here: https://github.com/kfsoftware/meetup-k8s-hlf#add-them-as-consenters

Hello, After, deploying my one channel network with one orderer node (i.e ordnode-1) I am using

export ORG_ORD_ORD1_USER=ord1_orgOrd_id
export ORG_ORD_ORD1_PASS=ord1_orgOrd_pass

kubectl hlf ca register --name=ordererorg-ca --user=$ORG_ORD_ORD1_USER --secret=$ORG_ORD_ORD1_PASS --type=orderer --enroll-id=$ORG_ORD_CA_BOOTSTRAP_IDENTITY --enroll-secret=$ORG_ORD_CA_BOOTSTRAP_PASS --mspid=OrdererMSP
kubectl hlf ordnode create --image=$ORDERER_IMAGE --version=$ORDERER_VERSION  --storage-class=standard --enroll-id=$ORG_ORD_ORD1_USER --mspid=OrdererMSP --enroll-pw=$ORG_ORD_ORD1_PASS --capacity=2Gi --name=ordnode-2 --ca-name=ordererorg-ca.default --output > resources/orderer/orderer2.yaml
kubectl apply -f ./resources/orderer/orderer2.yaml
kubectl wait --timeout=180s --for=condition=Running fabricorderernodes.hlf.kungfusoftware.es --all
kubectl hlf ordnode join --block=ch1.block --name=ordnode-2 --namespace=default --identity=admin-tls-ordservice.yaml
sleep 10
kubectl hlf inspect --output ordservice.yaml -o OrdererMSP -o Org1MSP -o Org2MSP -o Org3MSP
kubectl hlf utils adduser --userPath=admin-ordservice.yaml --config=ordservice.yaml --username=$ORG_ORD_ADMIN_USER --mspid=OrdererMSP
sleep 30
kubectl hlf channel consenter add --config=ordservice.yaml --orderers=ordnode-2.default --user=$ORG_ORD_ADMIN_USER --channel=ch1 --mspid=OrdererMSP --output=add_orderers_consenter.pb
sleep 30
kubectl hlf channel update --channel=ch1 -f add_orderers_consenter.pb --config=ordservice.yaml --user=$ORG_ORD_ADMIN_USER --mspid=OrdererMSP

To deploy a new orderer node and add him as consenter. After that I am trying to invoke the
kubectl hlf chaincode invoke --config=org1.yaml --user=$ORG1_ADMIN_USER --peer=org1-peer0.default --chaincode=fabcar --channel=ch1 --fcn=initLedger -a '[]'
which works perfect. So for testing I delete my kind cluster and I create a new one where I deploy again the same network with the second orderer too. After everything is ok I delete the deployment of the first orderer node (ie ordnode-1) in order to simulate the case where this node is dead (kubectl delete -n default deployment ordnode-2) and I am expecting the ordnode-2 to be used, however I am getting the following error
Error: CreateAndSendTransaction failed: SendTransaction failed: calling orderer '<IP_ADDRESS>:32729' failed: Orderer Server Status Code: (503) SERVICE_UNAVAILABLE. Description: no Raft leader
when I run
kubectl hlf chaincode invoke --config=org1.yaml --user=$ORG1_ADMIN_USER --peer=org1-peer0.default --chaincode=fabcar --channel=ch1 --fcn=initLedger -a '[]'
I believe that in someway I have to inform the org1.yaml file to be informed for the second orderer node.
Also, when my network relies to  majority consensus?

Edit: I found that I have to call:
kubectl hlf inspect --output org1_new.yaml -o Org1MSP -o Org2MSP -o Org3MSP -o OrdererMSP
kubectl hlf utils adduser --userPath=admin-org1.yaml --config=org1.yaml --username=$ORG1_ADMIN_USER --mspid=Org1MSP

to update the org1.yaml (i.e org1_new.yaml) and then the invoke of transaction worked.  So my only question is the last one. In case I have 3 orderer nodes how to set the  majority consensus (i.e one can be dead)

Hmm. Maybe this behavior is due to Raft characteristics. Specifically, 3 orderers can reach consensus even if one does not agree. But, that does not allow for continued operation if one of those nodes is interrupted and is not responding.

Closing the issue as it seems there's a solution


NIFI-2254: Fixing URI when reloading/updating component

Addressing accessing URI on the wrong object.

+1
Code passes contrib check, verified the problem and that the PR fixes the problem. Will merge it in


Create simlepage

In this example,i created a page . we have a basic landing page with a background image, a title, some text, and a call-to-action button. You can customize the content, styles, and background image URL to match your needs.

please add a link in your project that links to the home page of the repo and add your information to the cards in the repo index.html


callback_load on background image

callback_load seems not to work on background images. I can see, when it's set with callback_set, but I have never seen the 'loaded' class to appear for the element

That’s because it’s not possible to implement, since background images don’t fire a loaded event.

Hey @dooker,
that wasn't THAT impossible to implement, and things changed on version 15.
I found a way to manage background images's load/error event, so now background images are now getting the loaded or error class and calling callback_loaded and callback_error.
Take a look at the changelog and to the upgrading guide if you're interested.
Have a nice day.

Awesome, thanks, will give it a try


feat: add flag to skip env var fetching

🎉 Thanks for submitting a pull request! 🎉
Summary
Introduce internal option --offline-env to disable using any env vars fetched from the API.
This offers better support for the case of receiving all env vars externally (via devbot).
ref CRE-1078

For us to review and ship your PR efficiently, please perform the following steps:

[ ] Open a bug/issue before writing your code 🧑💻. This ensures we can discuss the changes and get feedback from everyone that should be involved.
[ ] Read the contribution guidelines 📖. This ensures your code follows our style guide and
passes our tests.
[ ] Update or add tests (if any source code was changed or added) 🧪
[ ] Update or add documentation (if features were changed or added) 📝
[ ] Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

why cannot we use the existing --offline flag for it?

We still want to fetch the site config (for the dev command and target port). I could provide that from bitballoon as well in the future and then we can use --offline (and remove --offline-env)

We still want to fetch the site config (for the dev command and target port). I could provide that from bitballoon as well in the future (CRE-1431) and then we can use --offline (and remove --offline-env)

As this is public API on the CLI we should provide that probably first to be able to leverage the --offline flag.

I'm using hideHelp(true) to keep things internal (like we do for other parameters). Makes it easier to do this not all together..


Adopt regex to speed up generation

The strange thing about passports is that it generates something strange and then in a loop tries to check if the result of generation is ok or not.
For instance,  in net.datafaker.passportnumbers.ChPassportNumber#getValidCh it tries to generates something with regex [A-Z][0-9A-Z][0-9]{7} and then checks result against E\\d\\d{7} and G\\d{8}. It is much faster to generate based on expected data.
Update fix concurrent issue at https://github.com/datafaker-net/datafaker/runs/7640952734?check_suite_focus=true

Codecov Report

Merging #273 (4d5c2a3) into master (f6e1238) will decrease coverage by 0.36%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #273      +/-   ##
============================================
- Coverage     94.63%   94.26%   -0.37%
+ Complexity     1891     1882       -9
============================================
  Files           195      195
  Lines          3819     3819
  Branches        391      391
============================================
- Hits           3614     3600      -14
- Misses          104      109       +5
- Partials        101      110       +9

Impacted Files
Coverage Δ

...et/datafaker/passportnumbers/AmPassportNumber.java
60.00% <100.00%> (-20.00%)
:arrow_down:

...et/datafaker/passportnumbers/ChPassportNumber.java
68.18% <100.00%> (-13.64%)
:arrow_down:

src/main/java/net/datafaker/Code.java
95.40% <0.00%> (-2.30%)
:arrow_down:

...rc/main/java/net/datafaker/service/FakeValues.java
79.78% <0.00%> (-2.13%)
:arrow_down:

.../java/net/datafaker/service/FakeValuesService.java
87.32% <0.00%> (-0.61%)
:arrow_down:

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Hi @snuyanzin , I got rid of all that code here :
https://github.com/datafaker-net/datafaker/commit/c0291fb1facb8fc1ddebe591c286eff4d1f22bbd

@bodiam
ok, great.
However the funny thing is that the initial commit leads to test concurrent issue...

@snuyanzin  I saw that indeed, but I didn't look into a solution for that yet. Seems it's still failing?

At least now it seems more stable


TransferClient.h in AWS SDK C++

Ubuntu 14.04
AWS S3 SDK for C++
I have just cloned aws sdk for c++ but there is no aws-cpp-sdk-transfer/include/aws/transfer/TransferClient.h Source File
I have Short example of uploading and downloading files from S3 using the AWS C++ SDK , So How Can I find that source files in SDK?
Example :
#include <aws/core/Aws.h> 			// Needed for InitAPI, SDKOptions, Logging, and ShutdownAPI
#include <aws/transfer/TransferClient.h> 	// Needed for the TransferClient
#include <aws/transfer/UploadFileRequest.h> 	// Needed to get the status of UploadFile
#include <aws/transfer/DownloadFileRequest.h> 	// Needed to get the status of DownloadFile
#include
using namespace Aws::Transfer;
/*

Example of how to download and upload using the Transfer Client
*/
int main(){
// Initialize the API
Aws::SDKOptions options;
options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info;
Aws::InitAPI(options);
// Create a Transfer Client Configuration
TransferClientConfiguration tcc;
// Create the transfer client giving
TransferClient tc(std::make_sharedAws::S3::S3Client(), tcc);
const Aws::String bucket_name 	= "ni-file-server-backup";
const Aws::String content_type 	= "";
const Aws::String file_name 	= "main.cpp";
const Aws::String key_name 	= "main.cpp";
// Upload main.cpp to S3, the two false parameters at the end are optional (createbucket and doConsistencyChecks)
auto uploadRequest = tc.UploadFile(file_name, bucket_name, key_name, content_type, false, false);
// Wait until the upload is finished
uploadRequest->WaitUntilDone();
// Check for success
if(!uploadRequest->CompletedSuccessfully()){
std::cerr << uploadRequest->GetFailure();
}
const Aws::String download_file_name = "s3.cpp";
// Download the file from S3 and save it to disk
auto downloadRequest = tc.DownloadFile(download_file_name, bucket_name, key_name);
// Wait until the download is complete
downloadRequest->WaitUntilDone();
// Check for a successful download
if(!downloadRequest->CompletedSuccessfully()){
std::cerr << downloadRequest->GetFailure();
}
// Shutdown the API before the program ends
Aws::ShutdownAPI(options);
return 0;
}

Hi, C++ SDK doesn't have TransferClient.h, it only hasTransferHandle and TransferManager
auto transferManager = TransferManager::Create(transferManagerConfig);
auto uploadHandle = transferManager->UploadFile(fileName, bucketName, keyName, contentType, Aws::Map<Aws::String, Aws::String>());
uploadHandle->WaitUntilFinished();

You can follow some examples in our transfer integration test.
https://github.com/aws/aws-sdk-cpp/blob/master/aws-cpp-sdk-transfer-tests/TransferTests.cpp


Fairseq-train Hangs in a loop of validation and saving checkpoint while using truncated_bptt task

I want to train transformer XL using truncated BPTT task. But, the training gets stuck between validation and saving checkpoint.
I noticed that it occurs when I stop training and resumes it. The next validation hangs as mentioned, i.e. if I stop training at 49100 updates, and resumes, it hangs on validation of 56000. If I don't stop it, it continues normally.
Since I use Slurm cluster, I have to set time limit for training, and it should stop before finish training.
Thanks in advance.
##Environment:
Red Hat Enterprise 7.7
Slurm cluster
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
Git clone https://github.com/pytorch/fairseq
Cd fairseq/
Pip install -e .
Pip install transformers
##How to reproduce :
38 src=en
39 ARCH=transformer_xl
40 DATAPATH=data-bin
41 NUM_LAYERS=16
42 SAVEDIR=checkpoints_64
43
44 srun --export=ALL
45 $(which fairseq-train) $DATAPATH
46   --user-dir ~/fairseq/examples/truncated_bptt
47     --ddp-backend no_c10d
48       --task truncated_bptt_lm --tokens-per-sample 150
49  --distributed-port 12350
50   -a $ARCH --optimizer adam --lr 0.00025 --min-lr 0.0
51     --n-layer $NUM_LAYERS --d-model 410 --n-head  10
52       --d-head 41 --d-inner 2300   --mem-len 256
53   --save-dir $SAVEDIR
54   --dropout 0.1 --clip-norm 0.25  --lr-scheduler cosine --weight-decay 0.0001
55   --max-update 15000000 --warmup-updates 0
56   --update-freq 1   --max-epoch 25
57  --batch-size 32   --num-workers 8  --memory-efficient-fp16  --fp16-scale-tolerance=0.25  --min-loss-scale=0.001
58 --skip-invalid-size-inputs-valid-test
59 --save-interval-updates 7000 --keep-interval-updates 10 --keep-best-checkpoints 10
60  | tee -a $SAVEDIR/training.log
##OUTPUT:
This is a subset of the output:
2021-06-09 11:02:40 | INFO | fairseq.trainer | NOTE: gradient overflow detected, ignoring gradient, setting loss scale to: 256.0
2021-06-09 11:02:40 | INFO | fairseq_cli.train | begin validation on "valid" subset
2021-06-09 11:03:24 | INFO | valid | epoch 001 | valid on 'valid' subset | loss 1.764 | ppl 3.4 | wps 77178.7 | wpb 9600 | bsz 64 | num_updates 105000 | best_loss 1.763
2021-06-09 11:03:24 | INFO | fairseq.checkpoint_utils | Preparing to save checkpoint for epoch 1 @ 105000 updates
2021-06-09 11:03:24 | INFO | fairseq.trainer | Saving checkpoint to checkpoints_64/checkpoint_1_105000.pt
2021-06-09 11:03:26 | INFO | fairseq.trainer | Finished saving checkpoint to checkpoints_64/checkpoint_1_105000.pt
2021-06-09 11:03:35 | INFO | fairseq.checkpoint_utils | Saved checkpoint checkpoints_64/checkpoint_1_105000.pt (epoch 1 @ 105000 updates, score 1.764) (writing took 10.877134052105248 seconds)
2021-06-09 11:03:36 | INFO | fairseq.trainer | NOTE: gradient overflow detected, ignoring gradient, setting loss scale to: 256.0
2021-06-09 11:03:36 | INFO | fairseq_cli.train | begin validation on "valid" subset
2021-06-09 11:04:19 | INFO | valid | epoch 001 | valid on 'valid' subset | loss 1.763 | ppl 3.39 | wps 83393 | wpb 9600 | bsz 64 | num_updates 105000 | best_loss 1.763
2021-06-09 11:04:19 | INFO | fairseq.checkpoint_utils | Preparing to save checkpoint for epoch 1 @ 105000 updates
2021-06-09 11:04:19 | INFO | fairseq.trainer | Saving checkpoint to checkpoints_64/checkpoint_1_105000.pt
2021-06-09 11:04:21 | INFO | fairseq.trainer | Finished saving checkpoint to checkpoints_64/checkpoint_1_105000.pt
2021-06-09 11:04:36 | INFO | fairseq.checkpoint_utils | Saved checkpoint checkpoints_64/checkpoint_1_105000.pt (epoch 1 @ 105000 updates, score 1.763) (writing took 16.193258486222476 seconds)
2021-06-09 11:04:36 | INFO | fairseq.trainer | NOTE: gradient overflow detected, ignoring gradient, setting loss scale to: 256.0
2021-06-09 11:04:36 | INFO | fairseq_cli.train | begin validation on "valid" subset
2021-06-09 11:05:19 | INFO | valid | epoch 001 | valid on 'valid' subset | loss 1.763 | ppl 3.4 | wps 82632 | wpb 9600 | bsz 64 | num_updates 105000 | best_loss 1.763
2021-06-09 11:05:19 | INFO | fairseq.checkpoint_utils | Preparing to save checkpoint for epoch 1 @ 105000 updates
2021-06-09 11:05:19 | INFO | fairseq.trainer | Saving checkpoint to checkpoints_64/checkpoint_1_105000.pt
2021-06-09 11:05:21 | INFO | fairseq.trainer | Finished saving checkpoint to checkpoints_64/checkpoint_1_105000.pt
2021-06-09 11:05:36 | INFO | fairseq.checkpoint_utils | Saved checkpoint checkpoints_64/checkpoint_1_105000.pt (epoch 1 @ 105000 updates, score 1.763) (writing took 16.407197644002736 seconds)
2021-06-09 11:05:36 | INFO | fairseq.trainer | NOTE: gradient overflow detected, ignoring gradient, setting loss scale to: 256.0
2021-06-09 11:05:36 | INFO | fairseq_cli.train | begin validation on "valid" subset
2021-06-09 11:06:20 | INFO | valid | epoch 001 | valid on 'valid' subset | loss 1.763 | ppl 3.4 | wps 74971.5 | wpb 9600 | bsz 64 | num_updates 105000 | best_loss 1.763
2021-06-09 11:06:20 | INFO | fairseq.checkpoint_utils | Preparing to save checkpoint for epoch 1 @ 105000 updates
2021-06-09 11:06:20 | INFO | fairseq.trainer | Saving checkpoint to checkpoints_64/checkpoint_1_105000.pt
2021-06-09 11:06:21 | INFO | fairseq.trainer | Finished saving checkpoint to checkpoints_64/checkpoint_1_105000.pt
2021-06-09 11:06:35 | INFO | fairseq.checkpoint_utils | Saved checkpoint checkpoints_64/checkpoint_1_105000.pt (epoch 1 @ 105000 updates, score 1.763) (writing took 15.376382765825838 seconds)
2021-06-09 11:06:35 | INFO | fairseq.trainer | NOTE: gradient overflow detected, ignoring gradient, setting loss scale to: 256.0
2021-06-09 11:06:35 | INFO | fairseq_cli.train | begin validation on "valid" subset
This warning appears in the error file, though I think it has no relation:
~/fairseq/fairseq/utils.py:368: UserWarning: amp_C fused kernels unavailable, disabling multi_tensor_l2norm; you may get better performance by installing NVIDIA's apex library

I had the same problem


[BUG] permisson enforce, parse params error with interface{}

{
    "status": "error",
    "msg": "json: cannot unmarshal object into Go value of type []interface {}",
    "sub": "",
    "name": "",
    "data": null,
    "data2": null
}

https://github.com/casdoor/casdoor/blob/73b9d73f6492539d2bc73121b039c887e428378b/object/permission_enforcer.go#LL223C23-L223C23

@shiningstarts what's your request body? Is it an array in JSON?

@shiningstarts We have a breaking change for /api/enforce API in this commit I think so.

It seems that the args of enforce change from {"id":"example-org/example-permission", "v0":"example-org/example-user", "v1":"example-resource", "v2":"example-action"} to ["example-org/example-user","example-resource","example-action"].
Additional parameters permissionId and modelId are relocated in url params.
Btw, current return of enforce is confusing. It returns an array of boolean which seems to be the result of merely the enforcement test of every policy in a model. The client can not distinguish from an array of boolean whether an action should be permitted.
The meanful result should be a boolean value rather than a bunch of it.

It seems that the args of enforce change from {"id":"example-org/example-permission", "v0":"example-org/example-user", "v1":"example-resource", "v2":"example-action"} to ["example-org/example-user","example-resource","example-action"]. Additional parameters permissionId and modelId are relocated in url params.
Btw, current return of enforce is confusing. It returns an array of boolean which seems to be the result of merely the enforcement test of every policy in the model. The client can not use an array of boolean to determin whether an action should be permitted. The meanful result should be a boolean value rather than a bunch of it.

It seems that, it runs ok with exposed casbin apis(https://casdoor.org/docs/permission/exposed-casbin-apis) before v1.3.
I wonder why is enforce-api not backward compatible, upgrading SDK for all access parties requires a lot of work, and is not smooth.

@shiningstarts We have a breaking change for /api/enforce API in this commit I think so.

It seems that.

@shiningstarts sorry for making this inconvenience. You can stay on using a Casdoor version before this commit: https://github.com/casdoor/casdoor/commit/776a682fae5a9f8f749f2dcf2080cd470c585ae0
Closed here


adding in code

Description
[Describe what this change achieves]
Issues Resolved
[List any existing issues this PR resolves]
Contribution Check List

[ ] All tests pass.
[ ] New functionality includes testing.
[ ] New functionality has been documented in the README if applicable
[ ] New functionality has been documented in CHANGELOG.MD

          3 Errors

:no_entry_sign:
Please add a changelog

:no_entry_sign:
A README.md is required for new templates

:no_entry_sign:
Please add labels to this Pull Request

          1 Warning

:warning:
Should this include readme changes

  Generated by :no_entry_sign: Danger

https://governance.rightscale.com/org/6/projects/7954/policy-incidents/5cc74eb7dd20d600713bbbf9

https://governance.rightscale.com/org/6/projects/7954/policy-incidents/5cc898821a0f81007190442b


🔧 docker-compose: replacing the incorrect image

@DasSkelett you need to approve the changes as well.
Meanwhile @twink0r you may want to update your GPG configuration as your commits are marked as unverified.

@GoliathLabs Thanks! GPG Key is updated!


AWS COGS data pull handler

Please ensure your pull request adheres to the following guidelines:

[ ] make sure to link the related issues in this description
[ ] when merging / squashing, make sure the fixed issue references are visible in the commits, for easy compilation of release notes

Related Issues
Thanks for contributing!

Resubmitting the PR again


It does not encrypt multiline properties values

Please add a possibility to encrypt multiline yaml values to be able to store RSA private keys.

Hi! Sorry for a long delay. The new version of plugin just released 1.3.3 that supports multiline properties
Update plugin and check the doc how to use it.


Combobox input is being focused for a brief moment upon opening iOS Safari

Description
When I make use of <Combobox> on iOS Safari, and try to open the menu by pressing on Combobox.Trigger, it puts focus on Combobox.Input for a split of a second and loses focus.
This implies 2 glitchy UI issues:

Focus state of the input flickers for a brief moment
Native keyboard tries to open and closes within the same moment, which causes layout changes in the browser UI.

Link to Reproduction (or Detailed Explanation)

Steps to Reproduce

Add <Combobox/> to your application (with no styling)
Open your application on iOS Safari.

Ark UI Version
1.2.1
Framework

[X] React
[ ] Solid
[ ] Vue

Browser
iOS Safari 16.5.2
Additional Information
No response

@jimmy-qian
Thanks for taking your time to create this issue. Do you have a screencast or sth - since I don't have a way to check this in iOS

Hey @cschroeter, here it is!
https://github.com/chakra-ui/ark/assets/102806545/90363b55-49c9-4634-ad55-b7d673d544cc
As you can notice the reported bug by the default blue outline for Safari focus state, and the Safari navigation section being raised slightly every time it's I click on open.

This should be fixed in the upcoming 3.0 release. Please re-open if the issue persist.