Cast from int32 to float32 changes the value.

Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
2.13.0
Custom code
Yes
OS platform and distribution
No response
Mobile device
No response
Python version
No response
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
Here what I see is that the bug actually happens b/c as we are doing the conversion from int32 to float32 the value changes, as there is a rounding error that occurs when casting an integer to a floating-point type as float32 is not the high precision floating point type like float64, and the bug will also remain the same if we change them even to int64 from int32.
Standalone code to reproduce the issue
> The code is below
>> tf.cast(tf.constant(52479845, tf.int64), tf.float32)
<tf.Tensor: shape=(), dtype=float32, numpy=52479844.0>
>> tf.cast(tf.constant(52479843, tf.int64), tf.float32)
<tf.Tensor: shape=(), dtype=float32, numpy=52479843.0>

Relevant log output
### Relevant log output

_No response_

Hi @SuryanarayanaY can I contribute to this issue

This is the standard limitation of floating point precision.
In IEEE 754 single precision (float), there are 23 bits allocated for the mantissa, allowing for approximately 7 decimal digits of precision.
Due to this finite precision, not all real numbers can be represented exactly in the floating-point format. This limitation leads to rounding errors or inaccuracies in calculations, especially when dealing with numbers that require more precision than what can be represented within the given number of bits.
For more detail, visit https://en.wikipedia.org/wiki/IEEE_754


CCD-4050: Fix Jenkins pipeline warnings

JIRA link
https://tools.hmcts.net/jira/browse/CCD-4050
Change description
Fix Jenkins pipeline warnings regarding Groovy after() statements.
Does this PR introduce a breaking change?
[ ] Yes
[x] No

PIPELINE: https://build.platform.hmcts.net/job/HMCTS_a_to_c/job/ccd-message-publisher/view/change-requests/job/PR-229/


Adding support for registering Bugsnag's JS to page

What about something like this when adding Javascript?

Updated with changes to support extending in AppAsset instead of requiring init() override.

Updated once more so you only have to depend on the asset and it will work.

Updated with most recent changes.

Updated once again with latest requested changes.  We now will send data-releasestage, data-appversion, user id, and notifyReleaseStages in the registerJavascript() function

Updated with latest change requests.


Invalid rules

INVALID RULES
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "51cto.com###top_banner,#top_banner .ban2{height: 26px;}.top_bg,.top_bg .wrap{height: 76px;}"
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "blog.163.com##.wrapperbg{height: 151px;}"
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "bokon.net##.DivMainLeft{width: 990px;}"
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "book.qidian.com##.crumbs-nav.top-op {margin: 16px auto 20px;}"
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "chinanews.com##.enter_top {    width: 100%;    height: 154px;    background: #fff;}"
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "eeyy.com##.ad-top{margin-top: 10px;}"
Error: "Unknown pseudo class: [class="eprand"],[class="leftside epdown"],.yin,.huadong{height:1px;}" in the rule: "epinv.com##[class="eprand"],[class="leftside epdown"],.yin,.huadong{height:1px;}"
Error: "Unknown pseudo class: body.custom-background{background-image:url('');}" in the rule: "gaoqing.la##body.custom-background{background-image:url('');}"
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "hiapk.com##.header{height: 100px;}"
Error: "Unknown pseudo class: .col-lg-8.col-md-8{width:1190px;}" in the rule: "thegreatdaily.com/cat##.col-lg-8.col-md-8{width:1190px;}"
Error: "Unknown pseudo class: #plat_recom_carousel,.head_banner{height:75px;}" in the rule: "tieba.baidu.com###plat_recom_carousel,.head_banner{height:75px;}"
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "wise99.com###top_menu01{height: 130px;}"
Error: "Invalid cosmetic rule, wrong brackets" in the rule: "yxdown.com###topsearch{top: 100px;}"
Error: "Unknown modifier: scipt" in the rule: "||1122dk.com/js/$scipt"
Error: "Element hiding rule shouldn't start with "||"" in the rule: "||56.com##.xiu_mm,#appBanner"
Error: "Element hiding rule shouldn't start with "||"" in the rule: "||avgle.##[style*="width: 300px; height: 250px;"],.pblf-banner,[id^="divExoLayerWrapper"],center"
Error: "Element hiding rule shouldn't start with "||"" in the rule: "||jav##[id^="divExoLayerWrapper"],[id^="playertopads"],[class*="ui-widget"],[height="60"],.textwidget"
Error: "Element hiding rule shouldn't start with "||"" in the rule: "||tv.sohu.com##[width="640"][height="100"],.adv"
Selector is not valid: 'A.jumpWrap,DIV.left-game,DIV.right-game,DIV.games-op-wrap,DIV.right-op-wrap mb10,#j-top^Box' -- Error: unable to select by '#j-top^Box' — '#j-top^Box' is not a valid selector in rule: book.qidian.com##A.jumpWrap,DIV.left-game,DIV.right-game,DIV.games-op-wrap,DIV.right-op-wrap mb10,#j-top^Box
Selector is not valid: '#__^HFa,DIV.box top_box' -- Error: unable to select by '#__^HFa' — '#__^HFa' is not a valid selector in rule: www.tyzrcs.com###__^HFa,DIV.box top_box
Error: "Unknown modifier: m@res:block/null.mp4" in the rule: "||ott.cibntv.net/youku/*.mp4*&ctype=$m@res:block/null.mp4"
Selector is not valid: 'DIV.panel_bottom,LI.tl_shadow tl_shadow_new ^' -- Error: unable to select by 'LI.tl_shadow tl_shadow_new^' — 'LI.tl_shadow tl_shadow_new^' is not a valid selector in rule: tieba.baidu.com##DIV.panel_bottom,LI.tl_shadow tl_shadow_new ^
Error: "Rule has spaces, seems to be an host rule" in the rule: "||com/ads *_350_330.$image"
Error: "Rule has spaces, seems to be an host rule" in the rule: "oScript6205.type = 'text/javascript';"
Error: "Rule has spaces, seems to be an host rule" in the rule: "oHead6205.appendChild( oScript6205);"
Error: "Element hiding rule shouldn't start with "||"" in the rule: "||pipipan.com##A[class='btn btn-yellow btn-block']"
Error: "Element hiding rule shouldn't start with "||"" in the rule: "||pipipan.com##DIV[class='alert alert-block ']"
Error: "Element hiding rule shouldn't start with "||"" in the rule: "||pipipan.com##IMG[style='width: 100%; margin: 5px 0;']"
Error: "Rule has spaces, seems to be an host rule" in the rule: "s.parentNode.insertBefore(hm, s);"
Error: "Rule has spaces, seems to be an host rule" in the rule: "r1eadS= null;"

your Extensions not match the  rule.txt
I use AdGuard


Update sbt-pgp to 2.0.1

Updates com.jsuereth:sbt-pgp from 2.0.0 to 2.0.1.
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "com.jsuereth", artifactId = "sbt-pgp" } ]

labels: semver-patch

Codecov Report

Merging #31 into master will not change coverage.
The diff coverage is n/a.

@@         Coverage Diff          @@
##           master   #31   +/-   ##
====================================
  Coverage       0%    0%
====================================
  Files           1     1
  Lines          66    66
====================================
  Misses         66    66

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4c75db...594381f. Read the comment docs.


[Package Issue]: Google.Chrome.EXE, how to run it using CLI

Please confirm these before moving forward

[x] I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
[x] I have not been informed if the issue is resolved in a preview version of the winget client.

Category of the issue
Installation issue.
Brief description of your issue
Want to run "Google.Chrome.EXE" using Powershell/CMD, but not work, maybe cause haven't add it to path environment variable.
Steps to reproduce
Want run it in Powershell/CMD, shell prompt not work.
Actual behavior
Shell prompt not work, and error message is:
chrome.exe : The term 'chrome.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ chrome.exe
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (chrome.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Expected behavior
Shell prompt work.
Environment
PS C:\> winget --info
Windows Package Manager v1.9.25180
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19044.5131
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.24.25180.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                D:\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Enabled
DefaultProxy                              Disabled

Screenshots and Logs

The EXE from the package identifier Google.Chrome.EXE doesn't mean it is a portable package. Instead it runs the EXE-based installer provided by Google, and whether Chrome would be added to PATH depends on that installer, which is not in this package.

The EXE from the package identifier Google.Chrome.EXE doesn't mean it is a portable package. Instead it runs the EXE-based installer provided by Google, and whether Chrome would be added to PATH depends on that installer, which is not in this package.

Hello thanks for your reply : )
And I have another question for the package for Google.GoogleUpdater.
I just found a article to introduce difference between"Google.Chrome"and"Google.Chrome.EXE" from pckgr's blog site, it suggest user who using Google.Chrome.EXE also install Google.GoogleUpdater, I do that.
But when I run winget list to list packages, I haven't see the Google.GoogleUpdater package.
Does it a expected behavior?


How to specify preferredregion /currentRegion when using Azure.Data.Tables sdk with Cosmos db tables

Library name and version
Azure.Data.Tables 12.5.0
Query/Question
We recently migrated from Azure.Cosmos.Table to Azure.Data.Tables. After migrating we are seeing an increase in latency for database calls. We are assuming that this is happening because services in different regions are hitting only the write region and not read regions. We have a single write and multiple read regions. Previously with Azure.Cosmos.Table sdk , we were specifying the currentRegion property as below
  _tableClient = storageAccount.CreateCloudTableClient(new TableClientConfiguration             {                 CosmosExecutorConfiguration = new CosmosExecutorConfiguration                 {                     CurrentRegion = config.ApplicationRegion                 }             });
CurrentRegion property has the location of the service and all the database calls are routed to cosmos db regions(read/write) based on proximity.
Is there a way we can specify the same with Azure.Data.Tables. sdk?
Environment
OS: Debian 10
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.25 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.25 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Thank you for your feedback.  Tagging and routing to the team member best able to assist.

Hi @dileepyavan  - There is currently no way to set this through the API. @sakash279  Could you comment about whether there is a way to set this via the REST API?

There is no way to set these properties via REST API at this point. A workaround to reduce latencies, and read from local regions is to use the regional endpoints by appending the "-regionname" eg. "-eastus" to your account name in the endpoint url. Please realize that in the event of an outage you will have to manually update such endpoints to a different region, and cosmosdb won't be able to do it automatically.
@PaulCheng and I are tracking this work to expose this via rest API, but do not have an ETA at the moment.

Azure.Cosmos.Table SDK works in 2 modes : Direct and Rest mode. The ability to set CurrentRegion is possible in Direct mode. If the user is configured to using Rest mode, the settings for CurrentRegion was set using Direct mode client, and the normal CRUD requests use Rest mode.
Azure.Data.Tables SDK does not rely on a direct mode (as a matter of fact, it doesn't have one), and only uses the REST mode to make requests to the CosmosDB service. This is by design.
Hence the question on setting this via REST API is necessary for the azure.data.tables SDK to be able to expose such a property to the customers.

duplicate of #30943


Storage SDK: Resume upload session after closing/opening the app?

On the Android side of your SDK, you have a uploadsession URI thing which we can save and resume later even when we are closing the app and resuming a day later!
We don't seem to be finding this feature on the iOS side. So, I wonder if this feature is supposed to be added to the iOS SDK in future or not? If yes, could I ask if you have a timeframe for it?
You know, building an app on both platforms using Firebase SDK will be very confusing if the iOS side is functioning differently compared to the Android side.

Long story short is that it's more important on Android (since things like screen rotations cause an activity change, while on iOS they don't), so we implemented it first there. Long term, we plan on having fully backgrounded resumable uploads, so even if the phone dies, the upload can be resumed automatically if desired.
Agreed that it's confusing to have features on one platform and not the other though, so we're planning to resolve it.

Any updates about this?

@johnpaulmanoza nothing new unfortunately, we're spending the majority of our time on performance improvements and globalizing the service vs new client features. Happy to notify people and get feedback from you when we move back to client feature work.

Maybe now any updates on this?

We've got https://github.com/firebase/firebase-ios-sdk/issues/147 tracking this. Please add any comments/API suggestions there. Pull requests are also always welcome :)


Feature: Added support for choosing threads when creating archives

Resolved / Related Issues
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Closes #15926

Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

Opened Files ...
...

@Josh65-2201 before putting more work into this feature, can you confirm if it's working as expected?

It is

Excellent! Do you have any feedback on the design?

Nope, look good and how I would expect it.


Declare dependency on nipype 0.14 and get with conda on travis

Codecov Report

Merging #162 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master   #162   +/-   ##
=====================================
  Coverage     100%   100%
=====================================
  Files          10     10
  Lines        2114   2114
=====================================
  Hits         2114   2114

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be49c2b...3b0123b. Read the comment docs.


kvstore test with built-in docker invoke

Please compare to #748
This is example code how we could expand our testing framework with Rust-native test prerequisites built into build.rs.
Prerequisite:

docker daemon installed and running

Benefits:

No additional dependencies
Runs natively with cargo test if the endpoint is already running
Runs natively with cargo test --features docker if the endpoint has to be set up
Nice message during build notifying what docker image is going to be run

Disadvantages:

The shiplift library used to manage docker is out-of-date and had to be pointed to master.

The docker image cannot be shut down automatically at the end of the test run. docker stop kvstore-test has to be run or Tendermint will keep running in the background.

[ ] Referenced an issue explaining the need for the change

[ ] Updated all relevant documentation in docs

[ ] Updated all code comments where relevant

[ ] Wrote tests

[ ] Updated CHANGELOG.md

Codecov Report

Merging #747 (5ce35d8) into master (4225d7f) will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master    #747   +/-   ##
======================================
  Coverage    43.2%   43.2%
======================================
  Files         203     203
  Lines       13118   13118
  Branches     3456    3456
======================================
  Hits         5673    5673
  Misses       7087    7087
  Partials      358     358

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4225d7f...5ce35d8. Read the comment docs.

We are dropping this idea in favour of #748 .


[CI][easy] tune sccache

Motivation
Like conventional CPU cache design, larger cache size reduces miss. However, in our CI setup, when the sccache size reaches certain point, scale appears to tip - the hit (time spent in searching and returning) could outweigh the miss (time spent compiling as is).
Test Plan
Testing in CI.

@sausagee should we merge this?

I am not convinced by the gains so far.  Want to do one more iteration.

After @metajack's v2 feature resolver landed, the cache size required also dropped nearly half from >4G to ~2G. Further optimization looks like diminishing return.
https://app.circleci.com/pipelines/github/libra/libra/24831/workflows/b7826b3d-929a-4371-8b08-aa16462b239f/jobs/159581


Static IP for Ingress outside of the node resource group

There is new documentation at https://docs.microsoft.com/en-us/azure/aks/static-ip#use-a-static-ip-address-outside-of-the-node-resource-group how to do this for LoadBalancer. What would be the equivalent for Ingress?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 12009c1f-282d-2632-fac0-64b09c432833
Version Independent ID: 6052d3d4-d295-9340-b16d-4c200e34cd73
Content: Create an HTTP ingress controller with a static IP address in Azure Kubernetes Service (AKS)
Content Source: articles/aks/ingress-static-ip.md
Service: container-service
GitHub Login: @iainfoulds
Microsoft Alias: iainfou

hello @cfoisy-osisoft
could you please elaborate on what you mean with ingress, if its the ingress controller have you considered the following option?
https://docs.microsoft.com/en-us/azure/aks/ingress-static-ip
please let me know your comments
Best

hey @DiegoRamirez-MSFT, thanks for the quick reply
That's correct, I mean the ingress controller
You're referring to the page I used for my current cluster with a static IP within the node resource group, e.g.
az network public-ip create --resource-group MC_myResourceGroup_myAKSCluster_eastus --name myAKSPublicIP --allocation-method static

Now my specific question is what should be done with ingress controller if the static IP is from another resource group?
For example LoadBalancer needs:

SP permission delegation
Service annotation

hi @cfoisy-osisoft
is the question how to use an IP that currently resides on a separate resource group?
best

Yes, exactly.

hi @cfoisy-osisoft
my recommendation would be to move the IP Address into the same resource group and this will simplify the process for you, you can follow the next procedure to move the IP address across resource groups
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-move-resources
please let me know if this helps

Hi @cfoisy-osisoft
Below solution how to deploy IP which is in other RG than AKS resources:
https://www.techdiction.com/2018/07/06/deploy-a-kubernetes-service-on-azure-with-ip-address-that-is-in-a-different-resource-group-to-the-cluster/

Thanks @wlodekb. But why is that not documented in the correct place (read: here!)?


Questions about irregular time-series data

Autoformer is an amazing work, and i studied much from your paper and your code.
I have a dataset, irregular, the periodicity of my dataset is not obvious compared to datasets you choosen in your paper, such as ETT.
I run Autoformer in my dataset, the qualitative results seem ok, but the qualitative (visualization) results are not good. Like the issue #35.
Therefore, do you have any suggestions about the irregular time-series dataset without obvious periodicity ?

(1) About irregular time series.
In my understanding, "irregular" means time series with different intervals between adjacent time points. In this context, I think Neural ODE or Decay RNN may be useful.
(2) About Time series without obvious periodicity.
We provide a case study in the Appendix for the Exchange dataset. The deep decomposition architecture is designed for this type of data. Maybe you can tune the hyper-parameter in moving average for better resutls.

Thanks for your response. I think your response is very helpful.


Feature Request - Squad File Converter

Hi, thank you so much for making this tool. Would it be possible to code a tool that can convert FIFA 23 to FIFA 22 squad files? Thank you!

I'm not planning to make anything like that, sorry.


Gulliver fails to fetch Icon from terra.com.br

Gulliver is failing to fetch the icon and displaying a broken image:
https://www.terra.com.br/manifest-br.json

I am also seeing few 403 because of cloudflare captchas. We need to investigate that too.

FWIW, tried a few requests for this URL via benchmarking tools (from different IPs) and got 200 OK back 100% of the time. So this might be a difficult one to debug/workaround…

Thank you @ithinkihaveacat
I will open a bug for the cloudflare captchas if I see the issue again and find steps to reproduce it.

The Terra once is fixed in the PR.


Wire Frames

Defines all the needed pages and controls on each page. Shows links that ages lead to


fix error message in Slurm Adaptor

The not supported version error does not tell where the option "xenon.adaptors.slurm.ignore.version" should be specified.

Fixed


Setup NPM publishing from Github actions

Feature Description
Add github action to automatically publish github releases to NPM registry.
Is your feature request related to a problem?
At the moment syft.js can only be installed from github directly, which is slow because all bundling occurs on the user's machine
What alternatives have you considered?
Publishing manually - might be error prone.
Additional Context
Same thing should be done for threepio and syft-proto javascript libraries, so it's better to have solution that will fit all 3 libraries.

We’re not going to deploy this way anymore.


Is it Legit Aim?

I am using this aim settings. Is it legit ?? (1920x1080 screen)
Or please suggest aim settings for legit.
		"Aimlock" : false,
		"Auto scope" : false,
		"Auto shot" : false,
		"Between shots" : true,
		"Bone" : 0,
		"Enabled" : true,
		"Fov" : 0.10999999940395355,
		"Friendly fire" : false,
		"Ignore flash" : false,
		"Ignore smoke" : false,
		"Key" : 0,
		"Key mode" : 0,
		"Killshot" : false,
		"Max aim inaccuracy" : 1.0,
		"Max shot inaccuracy" : 1.0,
		"Min damage" : 1,
		"On key" : false,
		"Scoped only" : true,
		"Silent" : false,
		"Smooth" : 3.190000057220459,
		"Visible only" : true

Hey!
Try out my configs :)
One has only backtrack & chams
and second has really good aimbot settings and everything :))
I played with this two in prime for 3 months now and no ban.
https://anonfile.com/VbjdD7u5o1/vik_rar

0.1 fov, might as well not use aimbot at all.
1.5-2 fov with 12 smooth on rifles is perfect and 2-2.5 fov with 8 smooth on pistols and aimlock on on both

0.1 fov, might as well not use aimbot at all.
1.5-2 fov with 12 smooth on rifles is perfect and 2-2.5 fov with 8 smooth on pistols and aimlock on on both

I will use this on prime. Is it legit at all right ?


Implements survey generator

I think we can close, we now have a Generator to do this functionality, and we should focus on evolution-generator if we want to improve something.


Create an action to encapsulate TF JSON processing.

There's a bunch we can to to refine/improve this leveraging: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

Example output (warnings):

I think this will help triaging things at a high-level and then drilling into the results.
Going to checkpoint this, but we should keep iterating to see if using ::error:: helps surface better ways for us to triage mega module failures over time.


chore(clerk-js): Only allow permission authorizations internally

Description
Internally we should not depend on roles. Since custom roles was introduced we have updated our internal clerk-js component to work with permissions only.
There are no references to <Protect role="..."/> in clerk-js.
This PR narrows the types in order to avoid confusion when protect is used inside clerk-js. Public APIs are not affected.

Checklist

[ ] npm test runs as expected.
[ ] npm run build runs as expected.
[ ] (If applicable) JSDoc comments have been added or updated for any package exports
[ ] (If applicable) Documentation has been updated

Type of change

[ ] 🐛 Bug fix
[ ] 🌟 New feature
[ ] 🔨 Breaking change
[ ] 📖 Refactoring / dependency upgrade / documentation
[ ] other:

@panteliselef Why did we remove the role? I think that we should either provide both role & permission or none since most of the time role is modeled as a group of permissions.

@dimkl i've updated the description, it should be clear why we can do this.


Lens can not find AWS command and not connecting on MacOS

I am unable to connect Lens to my K8S cluster, seem that once Lens starts it need the AWS CLI command and it can not find it although it is set in the env $PATH. I assume that once Lens start it parse the env variables and for some reason it can not parse the env variables. I pasted the output of running Lens from the terminal below:
Steps:

Open terminal window on my MacOS
Connect to my remote K8S cluster using Okta
Set the K8S cluster env
Verify that I can do kubctl get pod
Start Lens from the same shell

The following is the terminal output of running Lens command:
./Lens
info: [IPC]: setup channel "cluster:activate"
info: [IPC]: setup channel "cluster:set-frame-id"
info: [IPC]: setup channel "cluster:refresh"
info: [IPC]: setup channel "cluster:disconnect"
info: [IPC]: setup channel "cluster:install-feature"
info: [IPC]: setup channel "cluster:uninstall-feature"
info: [IPC]: setup channel "cluster:upgrade-feature"
error: shellEnv: Error: Command failed: /bin/tcsh -ilc echo -n "SHELL_ENV_DELIMITER"; env; echo -n "SHELL_ENV_DELIMITER"; exit
Unknown option: `-lc'
Usage: tcsh [ -bcdefilmnqstvVxX ] [ argument ... ].
info: 🚀 Starting Lens from "/Users/atropper/Library/Application Support/Lens"
info: Checking for update
info: [STORE]: LOADED from /Users/atropper/Library/Application Support/Lens/config.json
info: [STORE]: LOADED from /Users/atropper/Library/Application Support/Lens/lens-cluster-store.json
info: [STORE]: LOADED from /Users/atropper/Library/Application Support/Lens/lens-workspace-store.json
info: [CLUSTER-MANAGER]: init cluster {"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":false,"ready":false,"online":false,"accessible":false,"disconnected":true}
info: [CLUSTER]: "arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster" init success {"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","context":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","apiUrl":"https://5ECFA7EDDB0FCCFD267719E7962AD91A.gr7.us-east-1.eks.amazonaws.com"}
info: LensProxy server has started at http://localhost:54226
/bin/sh: ioreg: command not found
info: [CLUSTER]: activate {"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":true,"ready":false,"online":false,"accessible":false,"disconnected":true}
info: [CLUSTER]: bind events {"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":true,"ready":false,"online":false,"accessible":false,"disconnected":true}
info: [CLUSTER]: reconnect {"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":true,"ready":false,"online":false,"accessible":false,"disconnected":true}
info: Update for version 3.6.9 is not available (latest version: 3.6.9, downgrade is disallowed).
info: [KUBE-AUTH]: out-channel "kube-auth:f359c09d-e1b8-4241-9792-c1c3f33ef62b" {"data":"Authentication proxy started\n","meta":{"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":true,"ready":false,"online":false,"accessible":false,"disconnected":true}}
/bin/sh: ioreg: command not found
info: [KUBE-AUTH]: out-channel "kube-auth:f359c09d-e1b8-4241-9792-c1c3f33ef62b" {"data":"2020/11/28 12:49:14 http: proxy error: getting credentials: exec: exec: "aws": executable file not found in $PATH\n","error":true,"meta":{"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":true,"ready":false,"online":false,"accessible":false,"disconnected":true}}
info: [KUBE-AUTH]: out-channel "kube-auth:f359c09d-e1b8-4241-9792-c1c3f33ef62b" {"data":"2020/11/28 12:49:14 http: proxy error: getting credentials: exec: exec: "aws": executable file not found in $PATH\n","error":true,"meta":{"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":true,"ready":false,"online":false,"accessible":false,"disconnected":false}}
error: Failed to connect cluster "arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster": StatusCodeError: 502 - undefined
info: Closing proxy server
info: [CLUSTER]: disconnect {"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":true,"ready":false,"online":false,"accessible":false,"disconnected":false}
info: [CLUSTER]: unbind events {"id":"f359c09d-e1b8-4241-9792-c1c3f33ef62b","name":"arn:aws:eks:us-east-1:733937772608:cluster/eyesightx-env-dev2-cluster","initialized":true,"ready":false,"online":false,"accessible":false,"disconnected":false}

Please could you test with absolute path to aws binary in kubeconfig. Is it working then?

duplicate of #2079
Could be a problem with how you modify the PATH env var is set. If you are running Lens not from the command line then your .bash_profile and .bashrc files are not run.


chore(deps): upgrade dev dependencies

Upgrades project dependencies. See details in workflow run.

Automatically created by projen via the "upgrade-dev-dependencies-2.x" workflow

⚪ Backport skipped
The pull request was not backported as there were no branches to backport to. If this is a mistake, please apply the desired version labels or run the backport tool manually.
Manual backport
To create the backport manually run:
backport --pr 2768

Questions ?
Please refer to the Backport tool documentation


2.0.0 Compat listed for 1.21.x but 1.21.4 does not work

Attached is the log of my game when I try loading in with the mod installed (2.0.0 release for Fabric)
latest.log

I just released a separate version that is compatible with 1.21.4


[hw,mbx,rtl] Support for asynchronous messages

This PR implements the asynchronous message support for the mailbox. The principle of this feature is to allow the host side to initiate a request by setting a special async_msg bit in the control register. This bit is mirrored to the system side, indicating that it should initiate a request. Setting this bit also generates a system interrupt (if enabled and supported). On the top-level interface, there is a strap telling the outside-implement capability header registers the asynchronous message support of the mailbox.
So the operation works as follows:

Ibex sets the sys_async_msg bit
Setting this bit generates an interrupt the SoC requester side.
SoC requester performs Async Message GET message to Ibex
Ibex responds with an Async Message REQUEST message
SoC requester responds with a Async Message RESPONSE message to Ibex
If Ibex has more async message requests it again performs an Async Message REQUEST message, if not it sends an Async Message DONE message  and clears the sys_async_msg bit

Thanks for the review.

In particular, what prevents the SoC side starting to write into the mailbox at the point that the Core tries to raise an Async message? Not least because the Core FW will have to write to the CONTROL register to raise the async message, and also set the OUTBOUND_OBJECT_SIZE to activate the Outbound mailbox logic and thus, after a delay, raise the SoC-side Ready interrupt.

Nothing. The Core side only performs the asynchronous assert of that status bit. The communication in terms of DOE messages is then performed synchronously initiated by the SOC side. When the core sets the async message bit and the SOC starts its own message, then first, the SOC message is responded to.

If this is covered by the specification, and Asynchronous messages are not truly asynchronous with respect to the regular Request/Response traffic, then okay, but I wonder if perhaps setting CONTROL.sys_async_msg needs to assert the 'busy' bit in SOC_STATUS to prevent the SoC code from starting to write into WDATA.

I don't think that is needed. The async message bit is just an advertisement that the SOC side needs to ask for the message, not a Core initiated start of a data transfer.

I don't think that is needed. The async message bit is just an advertisement that the SOC side needs to ask for the message, not a Core initiated start of a data transfer.
Fair enough, if the protocol is really nothing more than an asynchronous 'doorbell' interrupt to the SoC side, and then message passing is standard synchronous request-response to retrieve it, then fine. As previously discussed, we don't have access to the specification here.

Fair enough, if the protocol is really nothing more than an asynchronous 'doorbell' interrupt to the SoC side, and then message passing is standard synchronous request-response to retrieve it, then fine. As previously discussed, we don't have access to the specification here.

Exactly that. You may want to approve. As written in Slack, I maybe can organize access to that spec.

Thanks for looking to this. I gated the assignment in the SoC interface.

Fair enough, if the protocol is really nothing more than an asynchronous 'doorbell' interrupt to the SoC side, and then message passing is standard synchronous request-response to retrieve it, then fine. As previously discussed, we don't have access to the specification here.

Exactly that. You may want to approve. As written in Slack, I maybe can organize access to that spec.

Sadly, only PCI-SIG members get access to the spec. Others will have to read tutorials on how DOE works.


setup backend and database

create a backend folder and setup django their as well as all the things required to connect to databse

Don't create a folder for backend, keep the files in root directory itself.
Keeping backend files in a folder creates problem during production.

@garg3133 sir I have added basic django structure in somya branch.....u may see once , further I will merge

@somya51p Don't use names like Prog_club as project name, using bitbyte as project name is fine (all small letters and no underscores).
And in place of bitbyte app, you may use the home.

Also, don't push migrations, pychache and db files. You may copy .gitignore from here.

Done.....the two branches can be merged now.

Looks good! You may merge them now.


Runtime Check for infinite loop inside repetitions.

If a new iteration has not progressed then we are in an infinite loop...

Consider performance implications?

Hide under a flag ("Dev Mode") ?

The performance penitently seems negligible (1-2% in various benchmarks).
And the scenario this detects is very hard to debug in other ways so I believe it is best to keep this check
always enabled and not just under some flag.


Add PlayMode tests to the PR and CI pipelines.

As we add more playmode tests we want to make sure that other folks aren't breaking them inadvertently. Easiest way of doing this is to enable these tests as part of PR validation (and CI as well)

Hold off on reviewing this for now - Need to run this through the pipelines to see if they actually work or if playmode is weird for other reasons.

/azp run mrtk_pr

/azp run mrtk_ci

/azp run mrtk_docs

/azp run mrtk_pr

Looks like the build machines obviously don't have permissions setup to enable microphone stuff - could actually possibly use this opportunity to not error out on the microphone/dictation providers.
Please hold off looking at this until I have addressed that.

I'm going to close out this PR while I fix the other issue


Question about google plus implementation

Hello,
We are trying to add Google plus share and follow buttons on the page. I their instructions we have to add follow code in the head:

In our case HEAD is added in _Layout.cshtml which is not part of  angular application. The next part of implementation is to add follow code into the place where you want to render the controls:

We added them but they are in angular component which is added in angular application. So the elements are not displayed may be because the script in head is not completed yet. Can you help me for some solution to make it in working state using the best practice pattern?
Also I'm trying to use ngx-cookieconsent in the project but without success. Can you help me how to do it. In description I have to install two package:
npm install --save cookieconsent
npm install --save ngx-cookieconsent

The first package add one javascript file which have to be loaded before start using the components. It create object in global window object which is used by the module. I tried to add the script in webpack.config.vendor.js but the global object was not populated:
const treeShakableModules = [
    '@angular/animations',
    '@angular/common',
    '@angular/compiler',
    '@angular/core',
    '@angular/forms',
    '@angular/http',
    '@angular/platform-browser',
    '@angular/platform-browser-dynamic',
    '@angular/router',
    'ngx-bootstrap',
    'zone.js',
    ////Not working
    'ngx-cookieconsent',
    'cookieconsent/build/cookieconsent.min.js'

];
const nonTreeShakableModules = [
    // 'bootstrap',
    // 'bootstrap/dist/css/bootstrap.css',
    'core-js',
    // 'es6-promise',
    // 'es6-shim',
    'event-source-polyfill'//,
    //Not working
    'cookieconsent/build/cookieconsent.min.css'

    // 'jquery',
];

Sorry for my stupid questions but I didn't catch the pattern how can add external vendor's libraries which made some global object which have to be used late from angular application. It will be helpful if you add more detail instructions for that in your documentation.
Thank you very much for your support
GetTaxSolusions Ltd #

I would look to see if there is an Angular 4 Google+ npm module. Following the steps there would get you closer to what you want to do.

I didn't found component for Angular 4 Google+ npm module. And you?
And also why adding the script and CSS for cookieconsent is not working? Isn't the idea to load the CSS from nonTreeShakableModules array and javascript from treeShakableModules?
Thank you
GetTaxSolusions Ltd #


install: Use UResult

Related to uutils#2464
I didn't actually check whether the error messages match what GNUs install gives, I merely took the existing ones. I hope I got the idea right, otherwise I'm open for suggestions.

Amazing! Great work with the custom error type!

I didn't actually check whether the error messages match what GNUs install gives, I merely took the existing ones.

That's good enough for now :)
I have two suggestions:

Some of the variants of the custom error are essentially io::Errors, requiring manual conversion from that to the custom error. You could use UIoError instead. Most of the time, you take a function that returns io::Result, say fs::metadata() and use map_err_context to turn it into a UResult, which you can then return:

fn md(path: Path) -> UResult<Metadata> {
    fs::metadata(path).map_err_context(|| format!("could not get metadata for {}", path))
}

See the docs for more information: https://docs.rs/uucore/0.0.9/uucore/error/struct.UIoError.html (let me know if you have any questions about this, I'd also love feedback on improving the docs). This will also give error messages that are more in line with GNU.
2. There's an opportunity to remove the all_successful variables by using the show! method. Docs are admittedly lacking a bit in this department, but there's the end of the usage section and the docs for set_exit_code and touch uses this technique as well (in uumain).

Some of the variants of the custom error are essentially io::Errors, requiring manual conversion from that to the custom error. You could use UIoError instead. Most of the time, you take a function that returns io::Result, say fs::metadata() and use map_err_context to turn it into a UResult, which you can then return:

I saw that while attempting to understand how the UError type works. What I particularly like about the custom error types is that all error messages are in one place for me to edit if the need arises.
But right now I can't think of a way how to mangle the regular std::io::Error into the UIoError (in an elegant way) such that I can use the Display-trait implementation that's already there. Hm...
Is this something that could be solved with a macro? I haven't worked with macros yet, so I'm quite unaware of their potential.

There's an opportunity to remove the all_successful variables by using the show! method. Docs are admittedly lacking a bit in this department, but there's the end of the usage section and the docs for set_exit_code and touch uses this technique as well (in uumain).

Oh right, I read about set_exit_code and asked myself while implementing "When would you need that when you have custom error types?". That of course makes a lot of sense. I'll update the code!

The code now makes use of show! for noncritical errors that don't cause immediate program abortion.
I'll be honest: the sheer wealth of different errors is pretty overwhelming, so I didn't do any "manual" tests to see whether I broke some error outputs. I'm entirely relying on the tests for this...

What I particularly like about the custom error types is that all error messages are in one place for me to edit if the need arises.

I understand. However, I've noticed that most IO errors need some context, like "could not get metadata for ...", which describes the operation that is being done in that part of the code. So I think it makes sense to put those descriptions where they occur.
I wonder if there is some change we can make to the API to get the best of both worlds.

But right now I can't think of a way how to mangle the regular std::io::Error into the UIoError (in an elegant way) such that I can use the Display-trait implementation that's already there.

I wouldn't prefer this over UIoError, but we could take that Display impl and split it off into a separate function that takes an io::ErrorKind which you could then reuse.

I understand. However, I've noticed that most IO errors need some context, like "could not get metadata for ...", which describes the operation that is being done in that part of the code. So I think it makes sense to put those descriptions where they occur.

Good point. But if multiple utils fail to get Metadata, isn't that a candidate for a CommonError then? Maybe one could "attach" (perhaps by means of another attribute that's a Option<std::io::Error>) an IoError to custom errors? That would allow us to construct custom errors like before using custom contexts, with the content of the IoError appended, right?
As far as I could gather that's pretty much exactly what the current implementation of UIoError does anyways.

You could look at the code coverage results to see if there are any untested errors and add them to the tests if possible. It's not necessary for this PR, though.

Is there a way I can run the coverage tests locally? It feels pretty "wrong" to abuse the CI pipeline for this sort of thing, especially as it isn't blazingly fast.

But if multiple utils fail to get Metadata, isn't that a candidate for a CommonError then?

Yes, although some are really specific to some utils.

Maybe one could "attach" (perhaps by means of another attribute that's a Optionstd::io::Error) an IoError to custom errors?

You already can to some extent. In the Display impl for the UCustomError, you could take the io::Error you passed to it, apply context to it and display that. This doesn't solve the boilerplate in the rest of the code though (still requires manual matching on the error and the construction of the custom error).

As a sidenote, feel free to experiment with changing some of the error things in uucore (maybe in a separate PR?). I definitely do not consider it finished yet and welcome any suggestions :)

Is there a way I can run the coverage tests locally? It feels pretty "wrong" to abuse the CI pipeline for this sort of thing, especially as it isn't blazingly fast.

You could run the coverage tests on your fork

I've been thinking about this some more and I think going with something simple is the best solution. That would be to simply provide a function for printing the IO error messages. Something like:
// This doesn't exist right now, but we can easily break it out of the UIoError Display impl
use uucore::error::io_error_message;

enum UtilError {
    SomeIOErrorWrapper(PathBuf, io::Error),
    // other variants
}

impl Display for UtilError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            UtilError::SomeIOErrorWrapper(file, e) => {
                write!(f, "some desciption {}: {}", file.display(), io_error_message(e))
            }
            // other variants
        }
    }
}

// Usage:
fs::metadata(&path).map_err(|e| UtilError::SomeIOErrorWrapper(path.into_path_buf(), e))

Any if we use a macro... ? Is that something a rust macro could do? Something like uio_error!(e), which then converts the std::io::Error from my code to a UIoError with an enmpty context. Then the call to write! would use the Display impl from the UIoError, right?

This kinda does the trick:
#[macro_export]
macro_rules! to_uioerr {
    ( $arg:expr ) => {
        UIoError::new(
            $arg.kind(), String::from("")
        )
    };
}

but the Display impl always prepends a ": " to the actual error message, which is a bit irritating. This would turn the following error variant:
            IE::InstallFailed(from, to, e) => write!(
                f,
                "cannot install '{}' to '{}': {}",
                from.display(),
                to.display(),
                e
            ),

into:
            IE::InstallFailed(from, to, e) => write!(
                f,
                "cannot install '{}' to '{}'{}",
                from.display(),
                to.display(),
                to_uioerr!(e)
            ),

which looks weird, because in the format string we now have "'{}'{}". :-(
Using the function approach we could have the function return only the error string, and then make the Display impl prepend the ": " to that, if desired.

Or we add this to the error module:
impl From<&std::io::Error> for UIoError {
    fn from(e: &std::io::Error) -> Self {
        UIoError {
            context: String::from(""),
            inner: std::io::Error::new(e.kind(), ""),
        }
    }
}

which allows us to write this:
            IE::InstallFailed(from, to, e) => write!(
                f,
                "cannot install '{}' to '{}': {}",
                from.display(),
                to.display(),
                UIoError::from(e)
            ),

I'm fine with either of these: The separate function, the macro or the From impl. The separate function sounds most reasonable as this allows us to easily handle the omission of ": " when used like discussed here.
But if we add that, it sounds as if it deserves its own PR. @tertsdiepraam Do you want to take care of this?

Very nice to see so many ideas! That really helps with exploring all possibilities. I think the macro doesn't really provide anything over a function, while also being a little bit harder to understand (because macros just in general are a little bit more complicated in my opinion).
Making the context optional is definitely an interesting idea. I wonder if there are other applications for context-less UIoErrors. I don't really have a strong preference for this or the function right now.
For reference to the entire discussion, I feel it makes sense to explicitly state the current situation, which isn't too bad I think. I may not be very intuitive though:
IE::InstallFailed(from, to, e) => {
    e.map_err_context(|| format!(
        "cannot install '{}' to '{}'",
        from.display(),
        to.display()
    )).fmt(f)
},

That's a pretty syntax, I didn't know that was an option!
Just 2 remarks by rust about that:

fmt here is ambiguous, it could be Debug::fmt or Display::fmt
this call would consume (move) e as std::io::Error doesn't implement the Copy trait:error[E0507]: cannot move out of `*e` which is behind a shared reference
   --> src/uu/install/src/install.rs:115:18
    |
115 |                 &e.map_err_context(|| format!(
    |                  ^ move occurs because `*e` has type `std::io::Error`, which does not implement the `Copy` trait

Now I have quite a lot of options I must say. I'd go with your last suggestions, @tertsdiepraam, but I'm unsure what to do about that second error. :-/

Ah my bad, should've let the compiler check that code. Can you get around that error by cloning e?

Don't worry.
I have now tried this code:
            IE::InstallFailed(from, to, e) => Display::fmt(
                &e.clone().map_err_context(|| format!(
                    "cannot install '{}' to '{}'",
                    from.display(),
                    to.display()
                )), f
            ),

which gives me this pretty error message:
error[E0507]: cannot move out of a shared reference
   --> src/uu/install/src/install.rs:115:18
    |
115 |                 &e.clone().map_err_context(|| format!(
    |                  ^^^^^^^^^ move occurs because value has type `std::io::Error`, which does not implement the `Copy` trait

And I can't make any sense of it. I know I'm moving it, that's exactly the point of the whole thing.

The error is indeed extremely weird. I think it's due to io:Error not implementing clone. Here's what I think is going on: the clone call acts on the reference, which makes a new reference and therefore doesn't solve the issue. This is because clone is implemented for all references and not for std::io::Error. You can work around this by constructing the UIoError from the ErrorKind instead, because that implements Copy:
IE::InstallFailed(from, to, e) => Display::fmt(
    &UIoError::new(
        e.kind(),
        format!("cannot install '{}' to '{}'", from.display(), to.display()),
    ),
    f,
),

You're right, that does the trick!
I understand that you're not particularly fond of macros, but something like this:
#[macro_export]
macro_rules! uioerror(
    ($err:expr, $($args:tt)+) => ({
        UIoError::new(
            $err.kind(),
            format!($($args)+)
        )
    })
);

allows us to turn this:
            IE::InstallFailed(from, to, e) => Display::fmt(
                &UIoError::new(
                    e.kind(),
                    format!("cannot install '{}' to '{}'", from.display(), to.display()
                )), f
            ),

into this:
            IE::InstallFailed(from, to, e) => Display::fmt(
                &uioerror!(e, "cannot install '{}' to '{}'", from.display(), to.display()), f
            ),

I'm fine with either implementation, but I'd be curious to hear some more opinions by others that have faced a similar situation already. I'll leave the decision on which implementation to use up to you. :-)

I like that macro! I've already been thinking about adding something like that for USimpleError and UUsageError and it makes a lot of sense here.

The changes are in, feedback is welcome!
Looking at the macros submodule I might spend some time on documenting all the macros in there next... We'll see.

Looks great! I'm just wondering where that macro should live. (In fact having a macro module feels off to me.) I think that it makes sense for discoverability to put it in the error module. Do you agree? (if you don't just say so and I'll merge it like this :) )
Side note: I love the effort you put in documentation in all your PR's. Absolutely fantastic work there!

Bikeshed: Not sure if this is only me, but uioerror looks a bit unreadable to me :sweat_smile:. Maybe it can just be io_error?

@tertsdiepraam This is good to go from my side. What do you think?

Fascinating. The CI is failing on a line of code that seemingly doesn't exist...

Hmm yeah, I'm not sure what that's about. Rerunning the CI doesn't help. I did find this snippet:
    let specified_mode: Option<u32> = if matches.is_present(OPT_MODE) {
        let x = matches.value_of(OPT_MODE).ok_or(1)?;
        Some(mode::parse(x, considering_dir).map_err(|err| {
            show_error!("Invalid mode string: {}", err);
            1
        })?)
    } else {
        None
    };

Which returns Err(1) I think, maybe that's what it's complaining about? Or something similar with backup_control?

Maybe you could merge master into this just to make some change that will rerun the CI?

Rebased onto master, now I see it, too.
Hold on. That means that Git implicitly rebases my branch onto master when running the CI stuff. Is this intentional?!

That means that Git implicitly rebases my branch onto master when running the CI stuff. Is this intentional?

I think so. In practice we don't really care whether a specific PR succeeds in the tests, but rather whether master succeeds when the PR is merged, so this makes sense (although it may lead to confusing situations)

That of course makes a lot of sense. :)
It's sad that the coverage is broken... but from my side this is done now.

I pinged grcov author yesterday and i have a meeting with him later today ;) I will bother him about that! cc @marco-c

Can't we just use a newer rust version for coverage? Currently it's set to nightly-2020-08-01, maybe we can change this to the latest stable release?

@Funky185540 could you please rebase it? it will trigger the code coverage. (i fixed it)

Rebased onto current master.


[SPARK-16816] Modify java example which is also reflect in documentation exmaple

What changes were proposed in this pull request?
Modify java example which is also reflect in document.
How was this patch tested?
run test cases.

Can one of the admins verify this patch?

@srowen @rxin Hey guyss i make changes as you suggested but yeah it not exactly what you suggested, i change in example which is also reflect in documentation, so please review it and give give your comments i will change them if you guyss think its not look good.
Changes which i made

In currently spark 2.0 example for Json Dataset

In previous version example is as follows.

So i make 2.0 example also same as previous version while user do this he/she can also know how to create JavaSparkContext by this.

OK, it doesn't hurt. OK to merge if this seems to help your case.

@srowen Yeah i think its look better, complete the example like in earlier versions and also indirectly show how to works with java spark context.

Jenkins test this please

Test build #63127 has started for PR 14436 at commit 3461517.

Test build #63127 has finished for PR 14436 at commit 3461517.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/63127/
Test PASSed.

Merged to master


Simpler screencopy

This simplifies screencopy by copying pixels to shm in the commit callback rather than the pre-commit callback, so both dmabuf and shm buffers are handled in commit.
Because commit always happens after pre-commit, damage accumulation is also simplified because we no longer need to ascertain whether the damage callback or the frame-copy callback happened first.
Supersedes #2591

I haven't looked in detail yet, but

renderer: Add buffer argument to read_pixels

I think we can just bind_buffer, read_pixels, then bind_buffer(NULL) to avoid this change?

I haven't looked in detail yet, but

renderer: Add buffer argument to read_pixels

I think we can just bind_buffer, read_pixels, then bind_buffer(NULL) to avoid this change?

I haven't looked in detail yet, but

renderer: Add buffer argument to read_pixels

I think we can just bind_buffer, read_pixels, then bind_buffer(NULL) to avoid this change?

Hmm, yeah, you're most likely right. I wasn't thinking in terms of the "global picture"; just what would be needed to call read_pixels from pretty much anywhere at any time. This change should make it possible to skip scheduling a frame and waiting for the commit event when the user doesn't want to wait for damage or when there is already damage. But maybe that's not really a useful "optimisation".

I haven't looked in detail yet, but

renderer: Add buffer argument to read_pixels

I think we can just bind_buffer, read_pixels, then bind_buffer(NULL) to avoid this change?

Hmm, yeah, you're most likely right. I wasn't thinking in terms of the "global picture"; just what would be needed to call read_pixels from pretty much anywhere at any time. This change should make it possible to skip scheduling a frame and waiting for the commit event when the user doesn't want to wait for damage or when there is already damage. But maybe that's not really a useful "optimisation".

I tried using bind_buffer, but it failed on assert(wlr_egl_is_current(renderer->egl)). If we want to use these functions, we need to (at least) change them so that they set an egl context and they should probably also save/restore the old egl context.

I tried using bind_buffer, but it failed on assert(wlr_egl_is_current(renderer->egl)). If we want to use these functions, we need to (at least) change them so that they set an egl context and they should probably also save/restore the old egl context.

we need to (at least) change them so that they set an egl context

I think this would be a good change, and it's also needed to remove the EGL dependency from the backends. Would you mind opening a PR for this?

save/restore the old egl context

I think saving/restoring makes sense when we need to temporarily set the EGL context in a single function (like blit_dmabuf). However I'm a little worried about saving in one function call and restoring in another one. This could cause issues if the saved EGL objects become invalid, for instance.

we need to (at least) change them so that they set an egl context

I think this would be a good change, and it's also needed to remove the EGL dependency from the backends. Would you mind opening a PR for this?

save/restore the old egl context

I think saving/restoring makes sense when we need to temporarily set the EGL context in a single function (like blit_dmabuf). However I'm a little worried about saving in one function call and restoring in another one. This could cause issues if the saved EGL objects become invalid, for instance.

we need to (at least) change them so that they set an egl context

I think this would be a good change, and it's also needed to remove the EGL dependency from the backends. Would you mind opening a PR for this?

Yeah, I'll give it a go

we need to (at least) change them so that they set an egl context

I think this would be a good change, and it's also needed to remove the EGL dependency from the backends. Would you mind opening a PR for this?

Yeah, I'll give it a go

We are putting this on hold until #2505 is merged. Specifically https://github.com/swaywm/wlroots/pull/2505/commits/47f59dd3042891903f2682b9f3e3cc93afe07ef5.

We are putting this on hold until #2505 is merged. Specifically https://github.com/swaywm/wlroots/pull/2505/commits/47f59dd3042891903f2682b9f3e3cc93afe07ef5.

#2505 has been merged, I think now would be a good time to revisit this. https://github.com/swaywm/wlroots/pull/2955 adds wlr_output.front_buffer.

Ah, still one missing piece is the DRM backend, which still uses the old infrastructure. This will be fixed in https://github.com/swaywm/wlroots/pull/2903.

@any1, would you be willing to continue work on this?

@any1, would you be willing to continue work on this?

Yeah, sure.

We should now be able to listen to output commits exclusively, check for event->committed & WLR_OUTPUT_STATE_BUFFER, then grab output->front_buffer.

I believe I have adapted my previous changes to master now. It does seem to work with wayvnc on both the wayland and headless backends at least.

Ready to merge with that one last cleanup comment fixed


Migrate old travis to latest travis for specific repos

See https://docs.travis-ci.com/user/open-source-on-travis-ci-com/#existing-open-source-repositories-on-travis-ciorg
The following repositories cannot be migrated to travis-ci.com at this time because they are currently active on our legacy platform travis-ci.org. This feature will be available shortly. Please read our docs on open source migration to learn more.

[x] OnToma
[x] opentargets-py
[x] validator
[x] webapp

We need to migrate from old travis to latest travis for the repos above

This is related to opentargets/platform#198

All of these have been done now, so closing this ticket. Any future problems should be new issues.


how run test suite?

Can anyone tell me how to run the test suite? The py.test file is missing. Thanks.

you need install python test framework pytest:
pip2 install pytest


Latest release v7.0.2 throws Webpack Compilation Error

Describe the bug
Seems like latest release v7.0.2 does not work and it throws a Webpack Compilation Error. It complains about the Elvis operator ?. which is not readable by node, so I guess that the release bundle needs to be compiled into compatible code
To Reproduce

Install cypress-fail-fast: 7.0.2
Set up the code to use the plugin
Run any Cypress test

Expected behavior
Version 7.0.1 does not show this problem and works without problems when running the tests
Logs
Oops...we found an error preparing this test file:

  > src/support/index.ts

The error was:

Error: Webpack Compilation Error
/workspace/project/node_modules/cypress-fail-fast/src/helpers/cypress.js 2:25
Module parse failed: Unexpected token (2:25)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| function isHeaded(Cypress) {
>   return Cypress.browser?.isHeaded;
| }
|
 @ /workspace/project/node_modules/cypress-fail-fast/src/support.js 19:67-95
 @ /workspace/project/node_modules/cypress-fail-fast/index.js
 @ /workspace/project/libs/cypress-commands/src/lib/commands/index.ts
 @ /workspace/project/libs/cypress-commands/src/lib/index.ts
 @ /workspace/project/libs/cypress-commands/src/index.ts
 @ ./src/support/commands/index.ts
 @ ./src/support/index.ts
    at handle (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:212:23)
    at finalCallback (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:257:39)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:306:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:304:22
    at Compiler.emitRecords (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:499:39)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:298:10
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:485:14
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:482:27
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
    at done (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:154:20)
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:464:33
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:143:16
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:143:16
    at /Library/Caches/Cypress/12.15.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:61:14
    at FSReqCallback.oncomplete (node:fs:192:23)

This occurred while Cypress was compiling and bundling your test code. This is usually caused by:

- A missing file or dependency
- A syntax error in the file or one of its dependencies

Fix the error in your code and re-run your tests.

** Operating system, Node.js an npm versions, or browser version (please complete the following information):**

OS: macOS 13.4.1
Node.js: 16.16.0
npm: 8.11.0

Additional context
As for other versions, I'm using:

Cypress: 12.15.0
Typescript: 4.8.4

This seems to be related to this Cypress issue. I will release another fix version for reverting changes until the operator is supported by Cypress. Thanks for the notice!


Run performance against NIOWebsocket Base64

Codecov Report

Merging #2 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master       #2   +/-   ##
=======================================
  Coverage   97.67%   97.67%
=======================================
  Files           4        4
  Lines         258      258
=======================================
  Hits          252      252
  Misses          6        6

Flag
Coverage Δ

#base64
97.67% <ø> (ø)
:arrow_up:

#unittests
97.67% <ø> (ø)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55892e5...2a1172b. Read the comment docs.


Standardize overloads for methods with IO/returning String

The idiomatic Crystal way of converting a value to a String is to append it to an IO. The most notable it Object#to_s(io : IO) which writes a string representation to the IO. When an actual String is required, there is an overload Object#to_s() which calls the IO variant wrapped in String.build.
Other examples are Object#inspect, Base64#encode, Base64#decode or Enumerable#join which all adapt the same technique.
Since they provide the same functionality, both methods usually have the same signature except that one returns String and the other accepts an additional argument io : IO. That's the distinctive difference between them. It is obvious that the positioning of the other arguments should be the same to avoid any friction.
If the methods also accept other arguments, there is a question as to where the io argument should be placed. There are different styles throughout the standard lib:

Time#to_s(format : String, io : IO)
Int#to_s(base : Int, io : IO, upcase : Bool = false)
BigRational#to_s(io : IO, base = 10)

It doesn't make any sense to add io in between as it screws up argument order. At the end is better but it will cause issues when optional arguments are added to the signature (that's probably what happened with Int#to_s). I think it should be preferred to put io at the front of the other arguments. This clearly signals that this is the IO variant of the method. And additional arguments can simply be appended at the end in both variants. IMHO this is the most logical solution.
I propose to adapt "io in front" style throughout the standard library and encourage others to do the same. This way it would be simple to switch from a String method to the IO method by inserting io as first argument and you don't need to think about where to put it.

(@straight-shoota just a small note that I truly appreciate your work on Crystal, but maybe current effort should be focused somewhere else, maybe the language and the compiler... though of course it's hard because there's no clear direction on how to do that, or what language changes are needed to render Crystal a production language)

This is a proposal to use a predictable and consistent API throughout the stdlib. The stdlib is already pretty good in many places, but obviously it can still be improved - and not only by adding new features. The compiler and language need a lot of work, that's true. But it's already actually pretty usable.
I don't think this is bikeshedding. IMHO it is important to address this issue (and lots of 👍 on the proposal show others do as well) to avoid ending up with different ways the stdlib API's work regarding String/IO methods. I have stumbled over this a number of times, that's why I think it would be great to agree on unifying the overload styles.
It's totally fine if we agree on putting io last everywhere and change everything to that style. But I strongly favour to put it in front.
It is my understanding that adding an io to the signature is not just an optional argument that toggles some internal behaviour but it changes the very nature of the method: it writes to that IO instead of returning a String. This is very significant and I think it makes sense to put significant arguments first.
I've already explained the more practical argument that putting io at the end causes issues with the positioning of optional arguments (including splats).
Regarding the argument "join looks odd." I could answer that I find join(", ", io) looks odd. I'd rather have as join(io, ", ") and interpret as "do a join by taking this IO and write every output to it".
(Thanks for the appreciation. I'd be happy to work on other parts as well, but I believe that would require some initiative from the core team to decide how things should go.)

I guess standarizing the arguments order is good then, specially because everyone seems to agree.

Convention is better than configuration, but join(io, sep) is a huge NO for me.

@ysbaddaden Why NOt, especially when you agree on the topic of convention-over-configuration? There's 10 👍 for the time being, so please give at least some rationale behind your opinion on the matter.

Another alternative is to move the io as a named argument always, plus allow Object#to_s(io : IO). It will be a bit more verbose, but the io would be able to be at the end and would play nice with other optional named arguments.
Also, given that the idiom is kind of common, either use the given io or use a StringBuilder, maybe we could encapsulate that as a pattern. But the main issue is the api rather than the implementation.
I am ok with putting io at the beginning though. Not the nicest thing for join, but an acceptable compromise from my side.

When there is a choice between join(io, ", ") and join(", ", io: io) I would very much prefer the former.

Since I've been asked, I would have (leaving out types for clarity):

Enumerable#join(separator)
Enumerable#join(separator, io)

Time#to_s(format)
Time#to_s(format, io)

Int#to_s(base, *, upcase = false)
Int#to_s(base, io, *, upcase = false)

BigRational#to_s(*, base = 10)
BigRational#to_s(io, *, base = 10)

That is the following rationale:

always push io as the last argument;
rarely used optional arguments should be kwargs, improving readability;
io feels like an optional argument, correctly placed.

Said differently: think about each usage, improve the API, instead of blindly enforcing rules.

I couldn't find a proper example in the stdlib.

That settles it for me. This discussion is about stdlib. Libraries can use another pattern if it fits better. Again: blindly enforcing rules or patterns makes no sense; actual use cases and contexts are more important.

It looks like this hasn't come up again in two years, so it doesn't seem to be a huge pain point in practice. Given there's quite some disagreement here, I would say we keep status quo of seeing what feels best for each kind of method and close this.

Yeah, this hasn't seen much activity. I'm still convinced it would be a good thing. Even if it's not a huge pain point, it still causes friction. Different styles make it difficult to remember which one goes where.
According to the reactions on the OP and the comments, I actually don't see this as being very contested. As far as I understand, we all agree that standardizing would be benefitial.

It would be nice if IO would always go last. Then when doing:
"foo#{some_method(1, 2)}bar"

the compiler could check if there's an overload that matches some_method(1, 2, IO) and use that instead of doing io << some_method(1, 2) behind the hood.
Probably not very important, though.

The same could work when IO is always the first argument 😏

I don't mind any more, I think "IO at end" is more common and choosing between front or end is moot.

I'm fine with standardizing. I still prefer io as first argument because of the practical benefit. I've already mentioned this in https://github.com/crystal-lang/crystal/issues/5916#issuecomment-384680940. But I was incorrect about having no example in stdlib: Enumerable#join is actually a perfect example!
Currently, these two non-yielding overloads exists:
def join(separator = "")
end
def join(separator, io)
end

But we're actually missing an overload accepting an IO but using a default separator. With the current argument placement, it would be this:
def join(io : IO)
end

That makes three different overloads in total.
If IO argument comes first, it would only be two overloads in total:
def join(separator = "")
end
def join(io : IO, separator = "")
end

That argument expands to all methods accepting an io and optional positional arguments. That also includes splat arguments. When IO is supposed to always go last, it can't work with splats.

@straight-shoota I think that makes sense. The problem is that it's a big breaking change.
But if we want to do it (I'd like to do it), let's do it before 1.0 and also document it in the style guide.

The change actually isn't that big. IIRC besides join only a couple of encode and format methods would be affected. And we can easily add deprecation warnings.

Pull request is available at #9134
I decided to hold off on methods that take two arguments to transform from one to the other. That's class methods like Base64.encode(data, io : IO). The general idea is that the information flows from source (first argument) to sink (second argument). In instance methods like #join or #to_s source is the receiver, sink the first argument and all other arguments are just options to the process.
But when the source is specified in the argument, applying the IO-first scheme would be strange because source and sink  are in the wrong order. This is very obvious when the source is also an IO. Let's imagine we would consider adding a method to Base64 that reads directly from an IO, encodes the data and writes it to another IO. It should have the signature Base64.encode(from : IO, to : IO) not the other way around.

That's why I always put io as a last argument in the stdlib, because io is a sink.

Yes I would also much prefer io as last. Probably fewer changes and inconsistencies required for that.

@asterite Yes, but the sink makes most sense as first argument when the source is the receiver of a method call.
@oprypin I didn't do a proper count because the plain numbers don't mean much. But really I don't see how moving all IO arguments to last argument would lead to fewer changes.
IO as first argument is consistent, so I'm not sure what you mean with inconsistencies. The consistency argument would actually speak against IO last because it doesn't work with splats.
Also IO-first needs fewer overloads for optional positional arguments.

Also IO-first needs fewer overloads for optional positional arguments.

I see this as the only supporting argument. A very significant one, though.
Regarding inconsistencies:

I decided to hold off on methods that take two arguments to transform from one to the other.

I'm holding out hope for https://github.com/crystal-lang/crystal/issues/5916#issuecomment-612644776

Look at the consistency at the callsite: source.process(sink, args...) or process(source, sink, args...).
For automatic expansion in string interpolations, I don't think it matters where the io argument is placed, first or last. As long as it is standardized, it should work either way.

Well, yes, it doesn't matter first or last, if it's always the sink. If the first arg can sometimes be the source, we're kinda in trouble.

@straight-shoota What's an example where there are a source other than self, and a sink? Are these always class methods? Can you list them all?

@oprypin That doesn't matter, really. If the last argument is an IO it still doesn't mean it works the same way as an overload that returns String. Could just have a entirely different purpose. If there's only one argument, it is both first and last. Yet it could still be a source or something completely different.
I don't think this automatic interpolation can work anyway without an explicit indicator to enable it (for example an annotation, or a magic argument name).
@asterite I don't think there are currently many instance methods in stdlib that accept both a source and sink as arguments. There's at least Time::Format#format(time : Time, io : IO). It's hard to make a list because grepping only gets you so far. When there's no type restriction and no argument named  io, it won't show up easily.

:thinking: :thinking: :thinking:
It'd be possible to implement a search based on what is being passed to the method as part of normal usage.
I remember

I see no problem with using io as a first argument always. Is there a case where we have two ios other than copy.

There's FileUtils.cmp(stream1 : IO, stream2 : IO) for example.
But I really don't see how it helps us moving forward to know what methods currently exist. That can serve as a rough baseline for consideration, but new methods are being added all the time.

Just my opinion: I think Base64.encode(io, what) looks just fine. I think using the IO overload is more low-level, so it's fine if we want to have a convention where IO always comes first. It shouldn't affect a lot of users.

@asterite We also have the uncontested convention to place source IO first. If both source and sink are passed as arguments, both conventions contradict. So the convention should be that at callsite the sink follows the source.

Where is there source IO other than copy?

Another alternative could be to have an IO required named argument.

Lot's of methods read from an IO (.parse, .from_io, etc.) and the source IO is the first argument always.

Another alternative could be to have an IO required named argument.

How would that be any better than #9134? It's a breaking change to a lot of methods and results in unneccesarily verbose call syntax with no apparant benefit. Considere there are the hundreds of #to_s etc. that only have a single argument.
I don't understand why we're coming back to debating alternatives that as far as I'm concerned have been rejected before and have no apparent advantage over the current proposal. Apart from being a breaking change, there is no downside to that. And a breaking change of that size will be necessary for any standardization, and outweighs the current inconsitencies.
I'm convinced #9134 is the correct way to go forward.

But parse and from_io read from an IO. It's different. I was asking what methods we have that write to an IO where there would be a confusion if IO was the first argument.
And just to be clear, I think that PR is fine. I just don't understand why Base64 encode is an exception. I'd move io to the first position too there

We also have the uncontested convention to place source IO first.

Please, I'm against it, said it out loud, and proposed a better rationale instead of blindly enforcing a rule that will regularly make no sense. For example:
Enumerable#join(io, sep) # urgh
Base64.encode(io, what) # does it read from `io` ?!

Putting the io argument last leads to a better API.
Moving optional arguments to kwargs would improve the API even more.

@ysbaddaden My comment about undisputed convention was about source IO, not sink.
It seems you missed some of the recent discussion, otherwise I can't understand what you could possibly mean. Please show a single concrete example where the current proposal as of #9134 makes no sense. It follows the convention sink follows the source at callsite.
The Base64.encode example has been addressed in https://github.com/crystal-lang/crystal/issues/5916#issuecomment-616183833 and doesn't apply.

Putting the io argument last leads to a better API.

I disagree. Your suggestion would lead to the sequential order at callsite source.process(*required_options, sink, **optional_options). That makes no sense at all and is in no way better than my proposal.

Moving optional arguments to kwargs would improve the API even more.

Some optional arguments are completely fine as positional arguments. For example:

Enumerable#join(io : IO, separator = "")
String#ljust(io : IO, char = ' ')
Time#to_s(io : IO, format : Format)

They should not need to be named arguments because their purpose is quite clear from the context.


Factory reset without UART

Hello! I've got ODI DFP-34X-2C2 from the seller you recommended. Then I tried to use the stick with my Mikrotik RB5009. I got O5 and even an IP address very quickly, however Internet hadn't been working. I was trying to play around with different stick parameters with no success. But when I set parameter LAN_SDS_MODE to 3, I lost access to the stick. Now the stick is not accessible neither via WebGUI, nor by telnet. However, Mikrotik shows module presence.
Is there a way to reset the stick to factory defaults without bringing UART converter and soldering to stick internals?

The cheapest way is connecting the stick to a media converter (TP-Link MC220L, for 19 bucks.. gigabit only..  generic 2.5gbe one for something like 30 USD) and fix the SDS mode there.

Keep in mind you do not have to buy the 2.5gbps media converter in order to fix if you set LAN_SDS_MODE to 4
Somehow the ODI DFP-34X-2C2 can autonegodiate speed with Qualcomm/Realtek media converter even if you set LAN_SDS_MODE to 4, see this output with it connected to one:
# cat /proc/lan_sds/lan_sds_cfg
lan_sds_mode = 1(Fiber 1G)
# flash get LAN_SDS_MODE
LAN_SDS_MODE=4

so far ODI with RTL9601D can do SFP Auto Negotiate,
for other stick like V2801F, TWCGPON657 or RTL9601CI based will lock you out, safer way is to use 2.5Gb Media Converter, no need to take apart or soldering and UART
thankful with ODI approach with SFP Auto Nego

I have the same question, but a different problem:
I had updated the MAC address, but did not update a key.

I have the same question, but a different problem: I had updated the MAC address, but did not update a key.

for ODI, it should allow to access WebUI, but some SFP host require fiber to present,
Like RB5009, no need fiber to be plugged can access WebUI, my self, wrong MAC Key device wont allow to connect to OLT, but able to access via Telnet or WebUI
before tear down, try plug SFP Stick to SFP media converter

@zentavr SFP
most Realtek based SFP Mediaconvert should work
https://github.com/Anime4000/RTL960x/blob/main/Docs/2.5Gb.md#device-list
unless they change device revision or something, however, it should works

I have Mikrotik RB4011iGS+5HacQ2HnD, and I could ping/access the stick over SSH/Web only when have a fiber cable inside of it. So when there are issues with the signal/provider - I cannot even debug the problem at the stick side.

I see, I guess get an RB5009, it doesn't need fiber to plug to access Telnet/SSH/WebUI

Upgraded my RB4011iGS from 6.x to latest 7.8 RouterOS. Now I can see 2.5Gbps mode, but stick still wants a fiber to be plugged in.

the STICK doesnt WANT anything
the STICK is reporting RX_LOS when there is no incoming PON signal, and YOUR MIKROTIK is DISABLING the ethernet on that interface while RX_LOS is active (Loss of Signal) because it thinks there wont be any packets if there is no signal (which is true on simple transcievers without SoC)

I was able to reset without having UART.
So:

In one terminal I run ping <IP_ADDRESS> just to see when the stick comes online. Sometimes I can see 1 ping back, sometimes 4.
At the second terminal just in one line: while true ; do sshpass -p admin-password ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostKeyAlgorithms=+ssh-rsa -oCiphers=+3des-cbc -oConnectTimeout=1 -oConnectionAttempts=1<EMAIL_ADDRESS>-- flash_eraseall /dev/mtd3; if [ $? -eq 0 ]; then break; else sleep 1; fi; done. Yes, long-long line. If you want - you can create a bash script. I have MacOS Ventura 13.2.1. sshpass installed by brew.
Wait. I had waited maybe 15-20 minutes just to catch 4 pings. In such case it's enough time to make a wipe. When wipe happens - you'll see something like this in the terminal: Erasing 4 Kibyte @ 3b000 -- 98 % complete..
Maybe it enough, but I'd repeated the step above again.
Again, maybe it's ok just to re-plug the stick into the port/media converted. I made it in a long way... instead of that put another command and waited for 4 next pings: while true ; do sshpass -p admin-password ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostKeyAlgorithms=+ssh-rsa -oCiphers=+3des-cbc -oConnectTimeout=1 -oConnectionAttempts=1<EMAIL_ADDRESS>-- reboot; if [ $? -eq 0 ]; then break; else sleep 1; fi; done
Finally the stick appeared at <IP_ADDRESS> and I was able to log in.

Probably we can reset by curl request as well, but I had not tried that.
The process looks like this:
# Log In
curl -v -X POST http://<IP_ADDRESS>/boaform/admin/formLogin --data-raw 'challenge=&username=admin&password=admin&save=Login&submit-url=%2Fadmin%2Flogin.asp'
# Reset
curl -v --http0.9 -X POST http://<IP_ADDRESS>/boaform/formSaveConfig --data-raw 'reset=Reset&submit-url=%2Fsaveconf.asp'

How you can see - no tokens/etc are required to make a second request (WTF? Security???). It's likely web server just whitelists your IP and accepts all further admin request without authentication.

the only time i managed to "brick" my stick was by turning off "VLAN Aware Bridge" in the HGU webgui... after that it never responded to pings on the LAN IP again until i did the eraseall via uart.
For your method to work you must also know the LAN IP, and it must be working, which isnt the case when people want to factory reset.

@Anime4000 if you are OK - I can set up a pull request with the instructions which I'd mentioned here with the program method of how to reset the stick.

I believe the stick has tftp recover parameters, but unfortunately I wasn't able to make it work. it is supposedly programmed to ask tftp server at <IP_ADDRESS> for firmware, but it does not do so at least automatically. maybe there is a prompt for it at the serial console but I do not have it attached.

@crrodriguez in theory we can run firmware in qemu and test that.

@Anime4000 if you are OK - I can set up a pull request with the instructions which I'd mentioned here with the program method of how to reset the stick.

sure! no problem, improvement, documentation is very welcome

@Anime4000 here we go: #143


Handle toString radixes beyond 36

I would like to convert longs to base 64 numbers. Output should use the standard set of case sensitive characters {0-9, a-z, A-Z, +, /}

The maximum radix supported by toString in JS-space is 36 and to my understanding base64 is rather an encoding on the underlying bytes. The bytes can be obtained through Long#toBytes(le?) and successively encoded with base64, for example:
var myLong ....;
var bytes = myLong.toBytes();
var base64 = require("@protobufjs/base64");
var myString = base64.encode(bytes, 0, bytes.length);

But I don't want base64 encoded text, or bytes... I want the actual long number IN base 64.
Correct me if I'm wrong, but your example code turns this<PHONE_NUMBER>99852800, into this C9UOzbOKZAA=.
But I want to have the actual base 64 number as a result: vVDs2zimQA, which as I understand from here (put in<PHONE_NUMBER>99852800 to the decimal textbox) is the actual number in base 64.

Here's the thing... if this weren't a long number, I would just grab some base conversion library.
But I'm using long.js because of javascript limitations, so it would be nice if long.js could also overcome the limitation of the javascript max radix.
It would also be really nice if we could submit custom conversion strings like in that 'bases' lib I linked... Clever of Flickr to remove I, l and 0, O!

Why do you need this? You can implement it on your own without putting this in the long.js library. There is no standardized base 64 alphabet (even base64 standards don't agree on that), so I don't think this is useful to put in the library. I never used base 64 in the last 20 years, but it is just me.
Decoding from base 64 is trivial and easy, and can be done without library support.
Encoding as base 64 is also pretty easy, and can be done without divisions, just using shifts and ands.
By having it outside of the long.js lilbrary you can define your own alphabet you want to use.

@baryluk "is trivial and easy". The max integer javascript can do is 2^53-1.  That is why I need long.js to do this. I'm not sure what you are talking about.
I also described exactly "why".  Please read it again.

I don't think that this belongs in the core library since it's not just another radix but there's an algorithm attached to it not everyone needs, but an additional package implementing this seems good if someone is willing to create that? Could be as simple as long-base64 that modifies the base long package accordingly.

@poshest  This library provides you with 64-bit integers. As I said it is trivial and easy to do implement base 64 using this library on your own - it is just left-shifts and binary-or operations. It doesn't require integration into long.js library itself.
"short URLs". LOL. And where are you getting numbers from? If they are sequential, then you will never really see a difference in savings.
And even if they are non-sequential, the difference is minuscule:
852603981099852800
vVDs2zimQA  # "base 64"
6H72VXP8ESJK  # base 36
2 characters less. Not worth it, plus makes it easier to miss-type things.

Look, no problem guys. If you don't think it fits in this library, don't add it. It just seemed to me like a sensible feature, and since I was using long for other things, convenient too.
My issue was posted two years ago. Back then, I just implemented numbase instead. I'll close this for y'all.


[packager] breaking test and fix for combination of "browser" and "react-native" fields

copied over from my PR here: https://github.com/facebook/react-native/pull/5734

Lgtm, I’d like to merge this. Can you rebase, please?

@davidaurelio done


Why was onlyAHashChange triggered? Throw a 'split' JS error

Hello, my project used pushState and popState, But I don't understand why  throw a JS error:
main.js:formatted:11085 Uncaught (in promise) TypeError: Cannot read property 'split' of undefined
at e (main.js:formatted:11085)
at e (main.js:formatted:10887)
at p (main.js:formatted:8857)
at Generator.o [as _invoke] (main.js:formatted:8992)
at Generator.e.(anonymous function) [as next] (http://<IP_ADDRESS>:8080/webapp/flight/schedule/_next/5075ea13-9a7d-4968-b4a7-0dd703f1baf6/main.js:1:147322)
at r (main.js:formatted:1974)
at main.js:formatted:1988
at new Promise ()
at new t (main.js:formatted:532)
at e. (main.js:formatted:1971)

Tech
Version

next
5.1.0

node
V8.9.3

OS
10.12.6

browser
chrome 66.0.3359.117

Cannot read property 'split' of undefined
at e (main.js:formatted:11085)

Please follow the issue template and provide a way to reproduce.

For the record, we're encountering this exact same issue on the exact same line of code. If we manage to create a simple project that reproduces it I'll open a new issue.


Add valuesYaml to the catalog upgrade action

This is a rebase of https://github.com/rancher/rancher/pull/18151
Original PR comments below:
Problem:
Cannot update valuesYaml field for catalog app in the upgrade
Solution:
Add valuesYaml filed to the catalog upgrade action.
Issues:
#18111
Related PRs:
rancher/types#723

original was LGTMd


use fast_track deployment

i don't see yet that this this improve deployment speed. VMs still reboot the same amount of times as before.


Is FFmpeg HLS Segmenting start time available through PyAV?

When streaming over HLS, the absolute EXT-X-PROGRAM-DATE-TIME information is essential for real-time applications. However, I cannot find this information after av.open(hls_url). The start_time is set to 0. Is this HLS Segmenting start time available through PyAV?
Research
ffmpeg seems to recognizes this tag as follows:
‘program_date_time’
Generate EXT-X-PROGRAM-DATE-TIME tags.

As far as I can tell from grepping through the FFmpeg source, they don't expose arbitrary tags, so PyAV can't.
Maybe you can download the m3u8 and parse it yourself?


Support splitted words

for a query containing "searchengine", a document containing "search engine" will match but not one containing "search slow engine" for example.

Fixes #232


reproduce motion harmonization

I am Interested in the style transfer function of your work, and want to reproduce from motion "walk" to motion "walk happily" could you please tell me which motion and which pretrained model you used to achieve this? since it is not shown in the readme.md

Hello,
Thank you for your interest, here are the relevant files to reproduce the "Happy walk" style transfer example:

Happy walk motion used to pretrain the model- Happy Walk.bvh. Place the bvh file under dataset folder.
Pretrained model  and args.json file
The walk motion the style was applied to: Female_Tough_walk_long.bvh


Make sure to specify canonical URL for reset links.

What's this PR do?
This pull request applies a lil' security patch to ensure the password reset links can't be generated with a spoofed URL. See the related Laravel patch release for details.
I've set the APP_URL environment variable on QA, Thor, and Production.
How should this be reviewed?
🔒 👀
Checklist

[ ] Documentation added for changed endpoints.
[ ] Tests added for new features/bug fixes.
[ ] Post a message in #api if this includes something that causes a rebuild!

I've set the APP_URL environment variable on QA, Thor, and Production.
👍

 (2) Unplanned work: Apply patch for Laravel password reset security issue.


Parameter for the deploymentTemplate is securestring, not secureString

Bicep version
Bicep CLI version 0.13.1 (e3ac80d678)
Describe the bug
According to https://github.com/Azure/azure-resource-manager-schemas/blob/main/schemas/2019-04-01/deploymentTemplate.json, the template parameter for a secure string is securestring and not secureString.

@miqm a PR is already out: #9225


Config Key Changing doesnt work

If i change the Keys for example door open/close, it doesnt change anything after restart. Only the menue does work

should be fixed in the newest update