Reply already submitted crash

🐛 Bug Report
In the sample app LastKnownLocationExampleWidget deny the permission close and reopen the app I get the following exception and the app crashes.
E/AndroidRuntime(12916): Process: com.baseflow.geolocator_example, PID: 12916
E/AndroidRuntime(12916): java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(12916): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139)
E/AndroidRuntime(12916): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:235)
E/AndroidRuntime(12916): 	at com.baseflow.geolocator.MethodCallHandlerImpl.lambda$onGetLastKnownPosition$2(MethodCallHandlerImpl.java:149)
E/AndroidRuntime(12916): 	at com.baseflow.geolocator.-$$Lambda$MethodCallHandlerImpl$tyxDngVVF7PcImb4PihgQ0FJ8po.onPositionChanged(Unknown Source:2)
E/AndroidRuntime(12916): 	at com.baseflow.geolocator.location.-$$Lambda$FyNSKWRJ6K8pfIKflyK9zilTOk0.onSuccess(Unknown Source:4)
E/AndroidRuntime(12916): 	at com.google.android.gms.tasks.zzn.run(Unknown Source:4)
E/AndroidRuntime(12916): 	at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime(12916): 	at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(12916): 	at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(12916): 	at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(12916): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(12916): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(12916): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Version: 6.0.0+3
Platform:

[ ] :iphone: iOS
[x] :robot: Android

@humazed thanks for the bug report. I kinda know where the error is coming from (and I can make it go away), but I cannot really reproduce it and according to the stack traces you send me this error should not happen in the first place.
So I am wondering if you can help me figure out what is causing this issue so I can solve it in the correct manner. So to give you some details, here is what I think is happening (based on the stack trace information and the steps you describe):
Step 1:

You start the example App using the debugger (for the first time) and it will ask you for permissions;
You deny permissions and the App shows you the message "User denied permission to access the device's location.";
At this point you stop debugging and the App will close.

So far all is good.
Step 2:

You start debugging the App again and the App will start;
At this point the App should detect that permissions were denied and should show a popup again asking for permission (this is what's happening to me), however for you the App crashes with the above stack trace.

The crash happens because the App somehow enters the Java onRequestPermissionResult(int requestCode, String[] permissions, int[] grantResults) without having showed the permission popup and the permissions and grantResults arrays are empty. In my previous update (6.0.0+3) I detect that these parameters are empty and try to send back that permissions are denied (see code snippet below):
    @Override
    public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        if (requestCode != PERMISSION_REQUEST_CODE || permissions.length == 0 || grantResults.length == 0) {
            if (this.resultCallback != null) {
                this.resultCallback.onResult(LocationPermission.denied);
            }
            return false;
        }

        ....
  }

As you would guess sending back the permission status in this situation will trigger the exception you listed above, because information has already been send on the channel. This is strange because from the way I understand the steps you take this would be a fresh channel and really should be the first time information is send back on the channel.
What is also strange is that the onRequestPermissionResults is being called with empty permissions and grantResults parameters.
Can you help me out to check the following:

Are these indeed the steps you took?
Did you modify anything on the example code?
Could you provide some information on the Android version and device you are using to run the example application?

Your help would be greatly appreciated.

Step 1:
run the app and deny permission.
Step 2:
Click the back button.
Step 3:
open the app and see the crash.
will send you a screen recording.

recording of the bug
https://drive.google.com/file/d/1dh2dIdiUWcOEysYX1Fh37kuCAc3-gTCl/view?usp=sharing
device:
pixel_2_XL_API_28 emulator

Hi,
I'm experiencing the same problem.
The steps to reproduce mine is simply: Allow location, then allow file and my apps crashed
D/AndroidRuntime(31159): Shutting down VM
E/AndroidRuntime(31159): FATAL EXCEPTION: main
E/AndroidRuntime(31159): Process: rest.clinimetric, PID: 31159
E/AndroidRuntime(31159): java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=35569, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {rest.clinimetric/rest.clinimetric.MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(31159): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
E/AndroidRuntime(31159): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
E/AndroidRuntime(31159): 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(31159): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(31159): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(31159): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime(31159): 	at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(31159): 	at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(31159): 	at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(31159): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(31159): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(31159): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(31159): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(31159): 	at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139)
E/AndroidRuntime(31159): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:235)
E/AndroidRuntime(31159): 	at com.baseflow.geolocator.MethodCallHandlerImpl.lambda$onRequestPermission$0(MethodCallHandlerImpl.java:133)
E/AndroidRuntime(31159): 	at com.baseflow.geolocator.-$$Lambda$MethodCallHandlerImpl$HgwoSKdIeyav7j8ZZJufnb77Lqo.onResult(Unknown Source:2)
E/AndroidRuntime(31159): 	at com.baseflow.geolocator.permission.PermissionManager.onRequestPermissionsResult(PermissionManager.java:103)
E/AndroidRuntime(31159): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:664)
E/AndroidRuntime(31159): 	at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:364)
E/AndroidRuntime(31159): 	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onRequestPermissionsResult(FlutterActivityAndFragmentDelegate.java:573)
E/AndroidRuntime(31159): 	at io.flutter.embedding.android.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:602)
E/AndroidRuntime(31159): 	at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8289)
E/AndroidRuntime(31159): 	at android.app.Activity.dispatchActivityResult(Activity.java:8139)
E/AndroidRuntime(31159): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime(31159): 	... 11 more
I/Process (31159): Sending signal. PID: 31159 SIG: 9
Lost connection to device.

Hi @humazed, thank you for providing the reproduction steps, I think I have figured out the real problem that is occurring. I believe the error is happening because the permissions are requested multiple times while the first call is still being handled, which triggers a warning on the Android activity "W/Activity(24060): Can request only one set of permissions at a time", and results in the onRequestPermissionsResult being called with the empty permissions and grantResults parameters. This can for example happen when we directly call the getLastKnownPosition from the Flutter build method which can be triggered multiple times. Or as an example, I can reproduce the problem consistently using the following example code:
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(title: 'Geolocator #396'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState
  extends State<MyHomePage>
  with WidgetsBindingObserver {

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
  }

  @override
  void didChangeDependencies() {
    getCurrentPosition(forceAndroidLocationManager: true).then((position) => print('Start: $position'));
    super.didChangeDependencies();
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    print(state);
    getCurrentPosition(forceAndroidLocationManager: true).then((position) => print('Resume: $position'));
  }

  @override
  Widget build(BuildContext context) {
   return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),// This trailing comma makes auto-formatting nicer for build methods.
    );
  }

  @override
  void dispose() {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
  }
}

The problem is that this only happens when you need to request for permissions. Remember that the getLastKnownPosition, getCurrentPosition and getPositionStream methods will automatically request permissions when applicable. The dilemma is that once you have already requested permission it is just fine to call the getLastKnownPosition (or one of the other position methods) multiple times. So I can handle this in three ways:

Add a check to the onRequestPermissionResults which ignores the call when the permissions and grantResults parameters are empty;
Make sure you can only call the getLastKnownPosition, getCurrentPosition and getPositionStream methods once if their is already an existing request running;
Remove the automatic permission resolution from the getLastKnownPosition, getCurrentPosition and getPositionStream methods and leave it up to the developers to handle permissions.

At the moment I am feeling the most for the first solution, since the others will have other disadvantages or are really introducing huge breaking changes. I will implement the first solution now to make sure we have a workable solution. But I am interested in how you would feel about the different options?

Hi @humazed, @NindoK, I have just released version 6.0.0+4 of the geolocator plugin which should solve this issue using the 1st option I described in the comment above.
Thanks to the information from @humazed I was able to reproduce the problem and confirm that this change should fix the issue. You might however still see the warning "W/Activity(24060): Can request only one set of permissions at a time" which you can ignore.
Let me know if this will solve the issue for you, in the meantime I will keep this issue open.

Thanks it fixed it!

Hi @NindoK, thank you for testing and confirming the problem is fixed. Will close the issue now.

I can also confirm it is fixed thank you
On Tue, Sep 8, 2020 at 7:49 PM Maurits van Beusekom <
<EMAIL_ADDRESS>wrote:

Closed #513 https://github.com/Baseflow/flutter-geolocator/issues/513.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Baseflow/flutter-geolocator/issues/513#event-3742130966,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACDNYJVA5E6SXFCN6LAIUITSEZVBHANCNFSM4QZMGFKQ
.

I am still experiencing this crash in 6.0.0+4, as the package clashes with a different permission handler's request. This makes sense according to the explanation here. Do you think it'd be possible to add a manual option to disable the automatic permission resolution of the methods?
Thank you!

Hi @xJon, could you maybe provide a stack trace or some logging that shows the problem that is occurring? Can you maybe provide some information on the other plugin you are using that you mentioned is clashing with the geolocator?
We have seen similar issues with other plugins that don't handle the Android onRequestPermissionResult call back correctly, I am thinking this might be the problem here but I would like to investigate and see if I can help out.

Hi @mvanbeusekom, yes this is my log:
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=109, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.gather/com.gather.MainActivity}: java.lang.IllegalStateException: Reply already submitted
        at android.app.ActivityThread.deliverResults(ActivityThread.java:3699)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
        at android.app.ActivityThread.-wrap16(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
     Caused by: java.lang.IllegalStateException: Reply already submitted
        at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139)
        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:240)
        at com.baseflow.geolocator.MethodCallHandlerImpl.lambda$onGetLastKnownPosition$3(MethodCallHandlerImpl.java:150)
        at com.baseflow.geolocator.-$$Lambda$MethodCallHandlerImpl$OCefduhIkqAV59oMDlIQqmk7z8g.onError(lambda)
        at com.baseflow.geolocator.location.GeolocationManager.lambda$handlePermissions$2(GeolocationManager.java:128)
        at com.baseflow.geolocator.location.-$$Lambda$GeolocationManager$boCQNh-1HzLRO8yyNdeq6cg70Yc.onResult(lambda)
        at com.baseflow.geolocator.permission.PermissionManager.onRequestPermissionsResult(PermissionManager.java:161)
        at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:664)
        at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:364)
        at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onRequestPermissionsResult(FlutterActivityAndFragmentDelegate.java:573)
        at io.flutter.embedding.android.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:602)
        at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:6553)
        at android.app.Activity.dispatchActivityResult(Activity.java:6432)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
        at android.app.ActivityThread.-wrap16(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

I made sure I am using the latest version of the package.
The other package I am using is permission_handler.
It is odd though, as I am unable to reproduce this issue continuously; I re-added now the code which seemed to cause the issue, and I don't experience the crash.
I would also like to point out that having a feature to disable the automatic permission resolution would be useful for apps which prefer to request certain permissions when first loading / on the splash screen.

There should be no need to disable the automatic permission resolution since the geolocator will first check if permissions have been granted / disabled before taking any action and request permission. Meaning if you already took care of handling permissions the geolocator would simply skip the permission resolution.
Could it be that you were running an older version of the geolocator plugin and re-adding the code made sure you updated to the latest version of the geolocator? Maybe you ran the flutter pub upgrade in between?

I could've swore I ran flutter pub upgrade beforehand too, but maybe I didn't. I will update you if the issue arises again.
I don't fully understand what you mean with the automatic permission resolution, as currently if the user denies my first request when the app launches (using the permission_handler package), they will receive another request when getCurrentPosition() runs and another one when getLastKnownPosition() runs (assuming they deny all of them).

@xJon What he means is that if a user has "always allowed" permissions or "denied (dont ask me again)" permission, the plugin will not make a request to Android to display the  permissions dialog.
The reason you user gets a request is probably because the allowed or denied their permission temporarily (or "just this once").

@ianendboss I see. Thank you for the explanation!


add conda forge feedstock

@Chrillebon I will list you as author for the dtumathtools feedstock for conda. Then we are at least two persons!
Hope you don't mind, but it is vital for the conda-forge community that you agree!

Sounds great! Let me know if any further action is needed from my side before the package can be added to conda.

Everything should be fine, you shouldn't be required to do anything. :)
I'll let you know if anything is required.

Completed.

Find the feedstock here


feat: workflow to point a test at a live network

Initial merge to be able to run against branches via the UI.

test comment

{  "start_time": "1731702408",  "stop_time": null,  "status": "running",  "result": null}

{"start_time":"1731702980","stop_time":null,"status":"running","result":null}


Add r-base version to fix Binder

Workaround for https://github.com/jupyterhub/repo2docker/issues/1140

@meeseeksdev please backport to 3.x


DF Chat Enhancements: Module Credits

Conflicting Module(s)

Module Credits

Describe the conflict
"TypeError: An error occurred while rendering ModuleCreditsDialog 140: marked is not a function
[Detected 1 package: module-credits]"
Part of the functionality of Module Credits gets broken, like clicking the button for Info and Changes in the "Manage Modules" window (which is changed by Module Credits).
Expected behavior
No errors of Module Credits, which seems to work once DF Chat Enhancements is disabled.

Resolved in version <IP_ADDRESS> (I don't fully understand ES Modules, but if I understand them correctly, this should no longer cause a conflict.) We can discuss how to better support this common library going forward if you like. But at least for now this should be resolved with the latest release of Module Credits


Use namespace import syntax to support newer bundlers

The old import printj from 'printj' syntax was causing an error in in a personal project where I was using Vite v4.3.9. Making this change to the import syntax and rebuilding this project solved the issue for me. This should continue to work with other build systems as well, as this syntax is widely supported, while the old syntax might break in newer build systems.

For anyone else coming here that just wants a solution, importing the cjs file worked for me:
import * as lua from 'lua-in-js/dist/lua-in-js.cjs.js'

Resolved by https://github.com/teoxoy/lua-in-js/pull/9.


googlemaps latlng

📚 What are you trying to do?
i use ScriptGoogleMaps component and i want to use LatLng object for set marker in google maps .
i tried to pass this object to options.center and query but its not working.
Am I using it wrong ?
🔍 What have you tried?
No response
ℹ Additional context
No response

Hello,
I'm also confused how to set query correctly in that component.

hi
i tried to use this component like this but its not working , am i using it wrong?

Using object syntax didn't work. I use string for query (Town or quarter).

Please refer to the new markers prop in this PR https://github.com/nuxt/scripts/pull/191, should be stable as of 0.7.1


Implement the possibility to override the value of any properties tha…

Since I need this feature, I decided to continue this idea : https://github.com/JohnSundell/Wrap/issues/23.
So this PR Implement the possibility to override the value of any properties that contains nil values
Here is an example of use and output :
struct SimpleTrip {
    let name: String
    let numberOfDays: Int?
    let numberOfSpots: Int?
    let updatedDate: Date?
    let endDate: Date?
}

extension SimpleTrip: WrapCustomizable {
    func keyForWrapping(propertyName: String) -> String? {
        if propertyName == "updatedDate" {
            return "newUpdatedDate"
        } else if propertyName == "endDate" {
            return "newEndDate"
        }

        return propertyName
    }

    func fallbackValueForProperty(named propertyName: String) -> Any? {
        if propertyName == "updatedDate" {
            return Optional<Any?>(nil)
        } else if propertyName == "numberOfSpots" {
            return 0
        } else if propertyName == "endDate" {
            return Date()
        }

        return nil
    }
}

let value = SimpleTrip(name: "Name1", numberOfDays: nil, numberOfSpots: nil, updatedDate: nil, endDate: nil)

let dictionary: WrappedDictionary = try Wrap(value)

Output of dictionary:
["name": "Name1", "newUpdatedDate": nil, "numberOfSpots": 0, "newEndDate": 2017-09-08 14:53:50 +0000]

Ooops !
It seems it's a duplicate of https://github.com/JohnSundell/Wrap/pull/36.
But it also seems that it's not up to date.
What do we do @JohnSundell  ?

It seems that my changes worked on a playground but not in the real project, strange..
I'll use the #36 for now.


checking pid file of nginx doesn't always reflect its state

apparently checking against the pid file isn't enough and at some situations it won't be even cleanup correctly, needs to be hardend with checks against nginx ports as well

As ports are defined in config, checking for them is not the best solution IMHO.
Maybe we could harden this PID file check by checking for the PID itself (if it's already a running process).

Nginx works ok now


e2e testing support volcano gang-scheduler

add e2e test of volcano gang-schedule

put patching gang-scheduler-name before installing gang-scheduler-plugin
split version of volcano.sh/apis without relationship of k8s

What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):
Fixes #1736
Checklist:

[ ] Docs included if any changes are user facing

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
14 unchanged lines in 3 files lost coverage.
Overall coverage decreased (-0.03%) to 33.72%

Files with Coverage Reduction
New Missed Lines
%

pkg/controller.v1/mpi/mpijob_controller.go
2
76.84%

pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go
3
53.35%

pkg/controller.v1/pytorch/pytorchjob_controller.go
9
58.19%

Totals

Change from base Build<PHONE_NUMBER>:
-0.03%

Covered Lines:
3317

Relevant Lines:
9837

💛  - Coveralls

@lowang-bh Is this PR working in progress?

Need to fix the failed CI.

/hold

MR #1828 go first, plz.

Please rebase as well. #1828  is merged

Please rebase as well. #1828 is merged

Done

/hold cancel
@lowang-bh Can you check failed test?
https://github.com/kubeflow/training-operator/actions/runs/5286272660/jobs/9565543144?pr=1831

https://github.com/kubeflow/training-operator/actions/runs/5286272660/jobs/9565543144?pr=1831

I need to fetch volcano webhook controller log when CI failed.

Can you reproduce on your local?

Succeeded after retry. Seems to be a flaky test?

Details

I see. @lowang-bh Can you create an issue to keep tracking the flaky test?

@lowang-bh Can you create an issue to keep tracking the flaky test?

done.

Thanks @lowang-bh
/approve


[Cognitive Service Anomaly Detector] Rename Directory name from Preview to Stable

MSFT employees can try out our new experience at OpenAPI Hub  - one location for using our validation tools and finding your workflow.

Changelog
Please ensure to add changelog with this PR by answering the following questions.

What's the purpose of the update?

[ ] new service onboarding
[ ] new API version
[ ] update existing version for new feature
[ ] update existing version to fix swagger quality issue in s360
[ ] Other, please clarify

When you are targeting to deploy new service/feature to public regions? Please provide date, or month to public if date is not available yet.
When you expect to publish swagger? Please provide date, or month to public if date is not available yet.
If it's an update to existing version,  please select SDKs of specific language and CLIs that require refresh after swagger is published.

[ ] SDK of .NET (need service team to ensure code readiness)
[ ] SDK of Python
[ ] SDK of Java
[ ] SDK of Js
[ ] SDK of Go
[ ] PowerShell
[ ] CLI
[ ] Terraform
[ ] No, no need to refresh for updates in this PR

Contribution checklist:

[ ] I commit to follow the Breaking Change Policy of “no breaking changes
[ ] I have reviewed the documentation for the workflow.
[ ] Validation tools were run on swagger spec(s) and errors have all been fixed in this PR. How to fix?

If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist

[ ] Ensure to check this box if one of the following scenarios meet updates in the PR, so that label “WaitForARMFeedback” will be added automatically to involve ARM API Review. Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs, all “removals” and “adding a new property” no more require ARM API review.

Adding new API(s)
Adding a new API version
Adding a new service

[ ] Please ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

[ ] If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist
If there are following updates in the PR, ensure to request an approval from API Review Board as defined in the Breaking Change Policy.

[ ] Removing API(s) in stable version
[ ] Removing properties in stable version
[ ] Removing API version(s) in stable version
[ ] Updating API in stable version with Breaking Change Validation errors
[ ] Updating API(s) in preview over 1 year

Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.
Please follow the link to find more details on PR review process.

@nitinme Can you please have a look at this?

@conhua and @yangyuan can you please have a look at this to get this unstuck?

Closing, since there is conflict and being this is just rename, it will be faster to re-do a fresh PR than to try to fix this one.

Closing, since there is conflict and being this is just rename, it will be faster to re-do a fresh PR than to try to fix this one.


[fix]: migration to zellij 0.38 (https://github.com/imsnif/monocle/issues/5)

Fix for https://github.com/imsnif/monocle/issues/5
This should make the plugin work in zellij 0.38 again  :-)
Since I have only been using zellij since version 0.38, I don't know what the default behavior was :-)
If anything else needs to be done, feel free to guide me in the right direction or take over yourself.
Enjoy your remaining holidays and thank you very much for the work on zellij.

I have an MR for this already (#6), but I would future-proof this by using the constructors new_to_plugin and new_to_worker for PluginMessages rather than constructing them directly

Ah I didn't saw your PR sorry :-).
I'am still exploring Rust so thank you for the informations, you solutions makes much more sense :-).
I'll close the PR


Python wheel server

This PR adds a linux version of BlindAI and a Python wheel to execute this server. A simulation mode support was added as well to the client.
The Python wheel was mainly made to facilitate the test of BlindAI, allowing to run a local copy of the server in a Google Colab/Jupyter Notebook environment. Considering that the python wheel will not run BlindAI in an SGX environment, the simulation mode is necessary to test this version of the server.
Running the server is very simple, once the wheel is installed:
import blindai_preview_server

srv = blindai_preview_server.start() # start the server
blindai_preview_server.stop(srv) # stop the server

This PR includes the necessary CI steps to build automatically the wheel and the server when a new tag is available.

Closing since #16 is merged.


Remove dictionaries as a separate tab

The more I think about it, I feel that dictionaries confuse the issue. What if we just eliminate dictionaries from ADEPT entirely. Users can still achieve the same effect of requesting a dictionary by just having a SAVED SET with a bunch of terms.

Also, probably test-sets and saved sets should probably be managed together. Maybe there should just be a SETS pane...

Ignore this


venv installation not working (ERROR: No such file or directory)

When installing spec-cleaner in a virtual env, it's not working:
virtualenv test
$ source test/bin/activate
$ pip install spec-cleaner
$ echo Name: foobar > foobar.spec
$ spec-cleaner foobar.spec
ERROR: No such file or directory

The problem is that spec-cleaner tries to find excludes-bracketing.txt and is looking in the wrong directory for that.

Check https://pythonhosted.org/setuptools/pkg_resources.html#resourcemanager-api


Replace cfunits by cftime and cf_xarray

This removes cfunits and udunits as dependencies and replaces them in the code with cftime (new dependency) and cf_xarray.
Hi! I am not a user of roocs_utils, but I do use clisops and am a maintainer of xclim. Currently, our xclim builds are broken because of the new dependency of clisops to roocs_utils, but it all goes down to  cfunits and its dependency on udunits, which is not installable through pip.
I saw that the use of cfunits in the package was quite limited and could be easily replaced by calls to cf_xarray.  To cover all cases, I needed to use cftime which I added to the requirements. But this shouldn't be a problem as it was already implicitly needed.
The changes were easy to do, so I went directly to this PR instead of opening an issue first, sorry about that. If this removal of cfunits is not wanted, feel free to close this PR, we will find another solution to our build problems in xclim.

@ellesmith88, please can review the PR and use it to run the clisops and daops tests to ensure we don't have any hidden issues. Thanks

@aulemahal This looks fine for me, thank you for looking into it. One thing I was wondering about is that when I've installed clisops through pip I've also had to separately install spatialindex as otherwise rtree raises an error. I don't know if you've seen this as well as I suspect this would also break your xclim builds?
When I've tried different versions of rtree, the issue only occurs with versions >0.9.1, so pinning this would resolve the problem for now. I was just wondering if you'd come across it?

Nice! Thanks.
Indeed we also have (had) a problem with libspatialindex and rtree. The solution was the same as is implemented in clisops : pull the ubuntu packages in the CI builds.
However I checked quickly and there is only create_mask that needs rtree (and thus subset_shape with vectorize=False). But, we have create_mask_vectorize  as introduced in Ouranosinc/xclim#414, which doesn't need rtree and is quite faster (up to 10x in my small tests).  So, removing the non-vectorized version should free us of rtree as dependency!
I'm not sure why we didn't do that earlier, @Zeitsperre? I guess we just forgot...
(There is a small error in create_mask_vectorize  that makes it produce sligthly different results than the non-vectorized version. When geometries overlap, _vectorize writes the index of the last geometry instead of the first, as stated in the doc. A simple reversal of the loop should fix that.)


Add editorconfig

Editor configuration, see https://editorconfig.org/
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false

ummm all of that is not set in prettier?


Add element to Cylindrical_Perspective

The definition for Vector_Projection_Z_Axis says:
The Vector_Projection_Z_Axis class specifies a
        unit vector defining the Z axis for a given projection. For
        Orthographic, Orthorectified, and Vertical projections, this
        vector defines the projection axis for the mosaic. All points
        along a line parallel to this axis are projected to the same
        spot in the projection plane. For the Cylindrical-Perspective
        projections, this defines the new axis of the circle around
        which the synthetic camera orbits (i.e. the normal to the
        circle), after the cameras have been rotated to correct for
        rover tilt. CAMERA_ROTATION_AXIS_VECTOR contains the axis before
        rotation; the difference in these two indicate the rotation
        amount.

Note the reference to CAMERA_ROTATION_AXIS_VECTOR - that is a ODL/VICAR keyword, not a PDS4 one.  And it's one that is currently missing from Cylindrical_Perspective.
So let's add a new class:
Vector_Projection_Z_Axis_Initial
The Vector_Projection_Z_Axis_Initial class specifies the initial unit vector defining
the Z axis for a given projection.  For Cylindrical-Perspective projections, this
defines the original axis of the circle around which the synthetic camera orbits,
before the cameras have been rotated to correct for rover tilt.
Vector_Projection_Z_Axis contains the axis after rotation; the difference in these
two indicate the rotation amount.

Then, fix the definition for VPZA to refer to VPZAI instead of the ODL/VICAR keyword.

Added to CART v<IP_ADDRESS>, built with PDS IM 1.D.0.0 (<IP_ADDRESS>)


Added accadis university

Official website: https://www.accadis.com/
Course: https://www.accadis.com/live/Business-IT-Consulting/ba-itc.aspx
Student portal: https://www.accadis.net/
Student email address pattern<EMAIL_ADDRESS>

@Koani Pull request merged. Thank you.


Rework status codes

This PR illustrates the change I am proposing in #197.  Some work is still needed to polish this up but I think the key features are there -- enough to illustrate the proposal.
Key elements:

the http library now validates and processes the target property of the @statusCode decorator.  The property value must be a numeric or string literal or union of numeric or string literals which are three digit codes starting with 1-5.
the openapi library implements a new decorator @default (might want a different name) to specify that the decorated model should be the "default" response of an operation.

I did not implement decorators for "2XX", "4XX", or "5XX" response codes, but these would be very similar to the @default decorator.

@default (might want a different name)

Maybe @defaultResponse?

This looks good to me. I presume there will be fallout in the closed repo if we merge this, right? Would you be able to prep the reaction ahead of time so we can review that? Last time we moved around @statusCode's in standard lib, the flow to closed repo was blocked for a while. You should be able to make parallel changes following https://github.com/Azure/cadl-azure/blob/main/CONTRIBUTING.md#making-a-cross-cutting-change-across-both-repos

I've addressed @timotheeguerin 's comments, changed the decorator name to @defaultResponse, and rebased onto the current main.
I did not change the @error decorator name since I think we are still deciding if that should move to the Azure library.
I'll try to have the changed ready in cadl-autorest by tomorrow at the latest.

@markcowl I addressed your comments.  Would you mind taking one more look for I merge?


Pagespeed Not optimising part of website images.

Hello everyone!
I have nginx 1.16 with pagespeed <IP_ADDRESS>-0. the issue is that pagepseed able to optimise images in main page but not other pages. with no error or suspicious logs.
where any images exist under media/catalog/product/cache are not being optimized.

I wonder, is there any specific configuration for the path that won’t be optimized?

Nothing rather than the configurations mentioned in the main issue.

Can you add this line?:
pagespeed EnableFilters responsive_images;

Hopefully ngx_pagespeed will emit comments in html mentioning why it backs out of optimization.

pagespeed EnableFilters responsive_images;

It is already there in pagepseed.conf, nothing in html mentioned.

Can you add this line?:
pagespeed EnableFilters responsive_images;

Hopefully ngx_pagespeed will emit comments in html mentioning why it backs out of optimization.

It is already there, the comments I get are:
<!--Resource headers are preventing rewriting of https://www.example.com/media/catalog/product/cache/0/small_image/300x/95/9/5/9558-1.jpg-->

<!--ResponsiveImageFilter: Not adding srcset because image does not have dimensions (or a src URL).-->

Hi @Mazizieh
you stated:
"...Resource headers are preventing rewriting of..."
Maybe the cause is:
proxy_ignore_headers Cache-Control;
cause this set the Cache-Control to the time set in
proxy_cache_valid [code ...] time;
You don´t have this enabled in your config so maybe cache-contorl is 0 or is not set, so pagespeed don´t fecht it.

Hi @Mazizieh
you stated:
"...Resource headers are preventing rewriting of..."
Maybe the cause is:
proxy_ignore_headers Cache-Control;
cause this set the Cache-Control to the time set in
proxy_cache_valid [code ...] time;
You don´t have this enabled in your config so maybe cache-contorl is 0 or is not set, so pagespeed don´t fecht it.

unfortunately, this is not what cause the issue, neither adding proxy_cache_valid nor disabling proxy_ignore_headers solve the issue.

Hi
But the error message you have posted is related to headers

Hi
But the error message you have posted is related to headers

Here is all header details for one of the non optimized assets:
Request URL: https://www.example.com/media/catalog/product/cache/0/small_image/300x/9df78eab33525d/E/D/ED5885-10.jpg
Request Method: GET
Status Code: 200 OK
Remote Address: X.X.X.X:443
Referrer Policy: no-referrer-when-downgrade
Cache-Control: max-age=2592000
Content-Length: 20144
Content-Type: image/jpeg
Date: Tue, 16 Jul 2019 10:55:43 GMT
ETag: W/"5d1d573a-aff92"
Expires: Thu, 15 Aug 2019 10:55:43 GMT
Last-Modified: Thu, 04 Jul 2019 01:32:42 GMT
nnCoection: close
Server: nginx
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Accept: image/webp,image/apng,image/*,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Cookie: lang=en; frontend=p85e7phliu7g9vppdvdo9g54l5; _delighted_fst=1563107504455:{}; _gcl_au=1.1.1093713283.1563107505; __tawkuuid=e::shop.example.ae::bUuPtpau/D2XvbD3+w1kNoTUzNJBDUPN+TvnCz6O2JVQqEjXnSD4vmND53vu7fJi::2; _fbp=fb.1.1563107505426.1309377612; _ga=GA1.3.1080968892.1563107506; _gid=GA1.3.306633941.1563107506; cto_lwid=f32d220d-e7dc-42f1-b675-0a3515469bb0; _scid=493ad801-c2a7-4000-9b04-7641d6def009; _sctr=1|1563051600000; _delighted_lst=1563107508059:{%22token%22:%22SsYTjxsB5mMoCGZiVolmpIW6%22}; seasonal=true; __insp_wid=1702379826; __insp_nv=true; __insp_targlpu=aHR0cHM6Ly9zaG9wLmFkaWRhcy5hZS9lbi93b21lbg%3D%3D; __insp_targlpt=YWRpZGFzIE9ubGluZSBTaG9wcGluZyB8IFNwb3J0cyBDb2xsZWN0aW9uIHwgYWRpZGFzIFVBRQ%3D%3D; __insp_norec_sess=true; __insp_slim=1563256660769; TawkConnectionTime=0; _abvisitor=ovDCW7y45k462BVsyQAw9nROeFzCyQz4AsQe167h%3B1563274541
Host: www.example.com
Pragma: no-cache
Referer: https://www.example.com/en/women?p=2
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Cache-Control: max-age=2592000
Cache-Control: no-cache

You had 2 cache-control headers and I think the last is the one that are valid, so you had a Cache-Control: no-cache header and then pagespeed don´t rewrite these image.

Cache-Control: max-age=2592000
Cache-Control: no-cache

You had 2 cache-control headers and I think the last is the one that are valid, so you had a Cache-Control: no-cache header and then pagespeed don´t rewrite these image.

However, I have same thing for optimized images like below:
Request URL: https://www.example.com/media/banner/banner.jpg.pagespeed.ic.5oGh.webp
Request Method: GET
Status Code: 200 OK
Remote Address: x.x.x.x:443
Referrer Policy: no-referrer-when-downgrade
Cache-Control: max-age=31536000
Content-Length: 3870
Content-Type: image/webp
Date: Sun, 21 Jul 2019 05:28:51 GMT
ETag: W/"0"
Expires: Mon, 20 Jul 2020 05:28:51 GMT
Last-Modified: Sun, 21 Jul 2019 05:28:51 GMT
Link: <https://www.example.com/media/banner/banner.jpg>; rel="canonical"
nnCoection: close
Server: nginx
X-Original-Content-Length: 4569
X-Page-Speed: <IP_ADDRESS>-0
Accept: image/webp,image/apng,image/*,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Cookie: _delighted_fst=1563107504455:{}; _gcl_au=1.1.1093713283.1563107505; __tawkuuid=e::www.example.com::bUuPtpau/D2XvbD3+w1kNoTUzNJBDUPN+TvnCz6O2JVQqEjXnSD4vmND53vu7fJi::2; _fbp=fb.1.1563107505426.1309377612; _ga=GA1.3.1080968892.1563107506; cto_lwid=f32d220d-e7dc-42f1-b675-0a3515469bb0; _scid=493ad801-c2a7-4000-9b04-7641d6def009; _delighted_lst=1563107508059:{%22token%22:%22SsYTjxsB5mMoCGZiVolmpIW6%22}; lang=en; frontend=gf874v5qkeoj2u3kqpj2gsqi04; seasonal=true; _gid=GA1.3.1305134949.1563620784; waitingroom=klYEg-TdSVB-8T2tL-ELD1r; __insp_wid=1702379826; __insp_nv=true; __insp_targlpu=aHR0cHM6Ly9zaG9wLmFkaWRhcy5hZS9lbi9tZW4%3D; __insp_targlpt=YWRpZGFzIE9ubGluZSBTaG9wcGluZyB8IFNwb3J0cyBDb2xsZWN0aW9uIHwgYWRpZGFzIFVBRQ%3D%3D; __insp_norec_sess=true; _sctr=1|1563656400000; _abvisitor=plpYPgBAgQAilWaT0WYUhsv51w4T3VDwjYBOfULB%3B1563693020; __insp_slim=1563693203809; TawkConnectionTime=0; _dc_gtm_UA-63988148-1=1; criteo_write_test=ChUIBBINbXlHb29nbGVSdGJJZBgBIAE; _gat_UA-63988148-1=1
Host: www.example.com
Pragma: no-cache
Referer: https://www.example.com/en/page1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

So, I don't think actually this is the problem, since this showing caching for both request and response from both user and server ends.

Ah! I see.... you have posted both, the send and the receive headers.
From:
Accept: image/webp,image/apng,image/,/*;q=0.8
until the last line are the headers that your browser send to the server, these headers don´t matter for the issue.
Well,  the non optimized headers don´t have any clue that tell pagespeed is working on it. You can see that optimized image have a caracterisc Etag (W/"0") and have the pagespeed header (X-Page-Speed: <IP_ADDRESS>-0), so this make me think that the images non optimized don´t have pagespeed enabled, I can´t see where you have the pagespeed on, if you set it on the http block then is enabled for all the sites you have configured, if have in only in 1 site then only work on that site and if you have it on a location, then it work only for that location.
In other hand, you have configured:
pagespeed LoadFromFile "https://example.com/media/" "/home/example/www/media/";
pagespeed LoadFromFile "https://example.com/js/" "/home/example/www/js/";
pagespeed LoadFromFile "https://example.com/skin/" "/home/example/www/skin/";

why you don´t change this with:
pagespeed LoadFromFile "https://example.com/" "/home/example/www/";
and then include and exclude file patterns:
pagespeed LoadFromFileRuleMatch disallow .*;
pagespeed LoadFromFileRuleMatch allow \.(ico|pdf|swf|eot|woff|woff2|ttf|otf|css|js|jpeg|jpg|png|gif|svg|svgz|mpg|mpeg|mp3|m4a|m4v|mp4|ogg|wmv|mov|mng|3gpp|3gp|webp|webm|flv|avi|asx|asf)(\?.*)?$;

The 1st rule disables all the files the the second enabes only the files w/ these extensions.


feat: upgrade to ESM

I triggered the workflow and it kind of passed (no docker build or install issues) but some substr error from getCommitHashes one 1/3 tests. 1/3 tests didn't run and i have no idea why but it should be fine because i originally only wanted to test 1/3 to ensure the docker image built and ran properly. These errors probably stem from my manually triggering the workflow using my branch.

As part of this, or maybe a later PR, I would suggest adding no-unresolved rule to ESLint, like in js-ceramic:

https://github.com/ceramicnetwork/js-ceramic/blob/develop/packages/3id-did-resolver/.eslintrc.json#L9
https://github.com/ceramicnetwork/js-ceramic/pull/2357

As part of this, or maybe a later PR, I would suggest adding no-unresolved rule to ESLint, like in js-ceramic:

https://github.com/ceramicnetwork/js-ceramic/blob/develop/packages/3id-did-resolver/.eslintrc.json#L9
chore: Check .js extension when linting ceramicnetwork/js-ceramic#2357

Will do this in another PR so it doesn't make this PR polluted


How's the training result?

Thank you for sharing your codes!
Is there any other config that can reproduce the paper result, since I stuck at best valid iou 0.47 when I tried to train it on on Cityscapes using DeepLabV3+(default config)?
Thanks again and appreciate your help!

@AnjieZheng
I didn't train any model on Cityscapes, so I don't have the training result.
But I confirmed that this code can make the significant result because I won 2nd prize on this conptetition (https://signate.jp/competitions/143) using DeepLabV3+.
When I trained the model on the dataset, I used pretrained model on cityscapes.
This is very important because BatchSize=2 makes batch normalization training unstable.
So, If you want to train DeepLabV3+ on Cityscapes from initial weights, I recommend you to increase the batchsize by using multi-gpu or lowering image resolution.

@AnjieZheng
I didn't train any model on Cityscapes, so I don't have the training result.
But I confirmed that this code can make the significant result because I won 2nd prize on this conptetition (https://signate.jp/competitions/143) using DeepLabV3+.
When I trained the model on the dataset, I used pretrained model on cityscapes.
This is very important because BatchSize=2 makes batch normalization training unstable.
So, If you want to train DeepLabV3+ on Cityscapes from initial weights, I recommend you to increase the batchsize by using multi-gpu or lowering image resolution.

Did you use freeze_bn function (freeze the batch normalization) to train your network for the competition? What was your batch size and image size?
Thanks


Fix typo "Azure Cosmos DB" in docs files

Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:

[x] The pull request does not introduce [breaking changes]
[ ] CHANGELOG is updated for new features, bug fixes or other significant changes.
[x] I have read the contribution guidelines.

General Guidelines and Best Practices

[x] Title of the pull request is clear and informative.
[x] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

[ ] Pull request includes test coverage for the included changes.

Related issue #35190

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

thanks @rinatmini for fixing these. There are few here as well, pls take a look at those too, thanks!
https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/azure-spring-data-cosmos/README.md
FYI - This is also owned by us (spring data cosmos connector).


controller: allow RBACSyncConfig to bind to ClusterRole

Issue:
https://github.com/cruise-automation/rbacsync/issues/12
Context:
There are valid use cases for binding a namespaced user or group to a cluster
role. This change removes the validation that was preventing this. See the k8s
documentation on this.
https://kubernetes.io/docs/reference/access-authn-authz/rbac
Testing:
The previous test for binding invalid roles was modified to have a purely made up
role type name. A new test was added for testing binding a cluster role.

Can you take a look through the docs and make sure they are accurate after this change.  For instance:

For namespace-scoped RBACSyncConfig, the behavior is nearly identical except for the following:

RBACSyncConfig must be defined with a namespace.
RBACSyncConfig can only reference Roles.
All RoleBindings created as a result of the RBACSyncConfig will be in the same namespace.

Code/Test LGTM
Please update the readme. Also double check against the RBAC docs and make sure we are using the same language to describe this scenario.

I gave the RBAC docs a re-read.
I updated the README.md to get rid of the point about only being able to reference a role from a RBACSyncConfig. I added an extra paragraph in the README.md about the meaning of referencing a ClusterRole from a RBACSyncConfig. This paragraph is almost identical to what is in the RBAC docs.
Also updated that comment in the controller role ref type check to be more descriptive.

I squashed. Ready for merge.


Update company-data.md

changed the business unit isn't used to the default team isn't used as the terminology was incorrect

:white_check_mark: Organization membership check passed
Requester is not a member of the MicrosoftDocs organization.


Decode method for arbitrary Javascript objects

Right now, it is only possible to decode JSON strings using Decoder.decodeJSON(). An additional general public decode() method on Decoder that takes a Javascript object of type any would be useful. In my use case, another library returns a Javascript object that I would like to decode.

This won't be too hard, but I want to make sure we get the name right. I'm not sure if the word decode is the best this function. Would validate or verify make more sense? My thinking is that we are not really changing the input, we're simply adding types and making sure that the object conforms to those types.
On the other hand, Decoder.validate does make as much sense as Decoder.decode in general, and decode would be pretty easy to understand if you saw the type signature.
My contenders:

Decoder.decode
Decoder.decodeJS
Decoder.decodeAny
Decoder.verify
Decoder.validate

Cool. I went with decodeAny. I'm going to push out a new release (as soon as I remember how to publish npm packages 😊)

Just pushed v0.1.0 to here and npm with this feature

Great :+1:

fwiw, the docs for the new decodeAny are incorrect: if you use things like the map function, it doesn't just verify your data and return it unmodified, it can also transform it. I use this to great effect in my decoders.

@radix Good point. I'll try to fix that up tomorrow. A PR would also be welcome if you have a good way of wording it 😄


Fix wording in note

@vijayma

Can you review this PR?
IMPORTANT: When this content is ready to merge, you must add #sign-off in a comment or the approval may get overlooked.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

Looks like someone else updated the same text at the same time and completed the PR before this one. I think it still makes sense to merge this one as it closer to the original wording and the wording in the rest of the page, which uses "you" everywhere.

#sign-off


HOW TO SEE OUTPUT AFTER DIRECT DOWNSTREAM TESTING

~/Endo-FM/TransUNet$ python train.py --test
Namespace(base_lr=0.0001, batch_size=1, dataset='Synapse', deterministic=1, exp='TU_Synapse224', img_size=224, is_pretrain=True, list_dir='./lists/lists_Synapse', max_epochs=150, max_iterations=30000, n_gpu=1, n_skip=3, num_classes=2, pretrained_model_weights='cvc.pth', root_path='../data/pretrain/CVC-ClinicVideoDB/', seed=9041, test=True, vit_name='R50-ViT-B_16', vit_patches_size=16)
The length of train set is: 20
The length of test set is: 9
Test Dice: 76.6, HD95: 7.0

Hi, thanks for your interest!
May you elaborate more on your question, about what ouput?

I used the CVC segmentation model for direct downstream testing. I ran the code you gave me without any errors. I pasted the code and output in the previous comment, but i don't know  the output is stored or not . There is no clear information about the output directory. Can you please explain how to locate the output directory?
~/Endo-FM/TransUNet$ python train.py --test
Namespace(base_lr=0.0001, batch_size=1, dataset='Synapse', deterministic=1, exp='TU_Synapse224', img_size=224, is_pretrain=True, list_dir='./lists/lists_Synapse', max_epochs=150, max_iterations=30000, n_gpu=1, n_skip=3, num_classes=2, pretrained_model_weights='cvc.pth', root_path='../data/pretrain/CVC-ClinicVideoDB/', seed=9041, test=True, vit_name='R50-ViT-B_16', vit_patches_size=16)
The length of train set is: 20
The length of test set is: 9
Test Dice: 76.6, HD95: 7.0

Could you please provide a step-by-step process with code examples for my query? I would like to test it with a video file. My aim is to obtain the same output as the one demonstrated in your GitHub account. Please let me know if there are any additional steps I need to follow beyond the ones mentioned in your GitHub documentation.

Hi, here is a sample for getting predictions:
def inference(model, val_loader, device):
    model.eval()
    savedir = 'saved/stadapter'
    os.makedirs(savedir, exist_ok=True)

    with torch.no_grad():
        for batch in tqdm(val_loader):
            img, label = batch['image'].to(device).squeeze(0), batch['label'].to(device).squeeze(0)
            video_info = batch['video_info']
            start_idx = int(video_info[1][0])
            end_idx = start_idx + int(video_info[2][0])

            output = model(img)
            prediction = torch.argmax(output, dim=1).cpu().numpy() * 255

            for i in range(start_idx, end_idx):
                image_name = f'{i}.tif'
                cv2.imwrite(os.path.join(savedir, image_name), prediction[i - start_idx])

if args.inference:
    model.eval()
    model.load_state_dict(torch.load(args.pretrained_model_weights, map_location='cpu'))
    inference(model, testloader, 'cuda')
    exit(0)

You can just integrate this after this test args:
https://github.com/med-air/Endo-FM/blob/c0979d2d235a61f85daf171a73a34f47683a67d9/TransUNet/trainer.py#L121-L126

HI, thanks for all you great work!!!
I used CVC database for directing downstream test, and I also want to check out outputs in a folder. I modified the code in the "def eval()"section in trainer.py:
def eval(model, val_loader, device, classes, output_folder):
    all_dice = []
    all_hd95 = []
    model.eval()
    with torch.no_grad():
        for i, batch in enumerate(val_loader):
            img, label = batch['image'].to(device).squeeze(0), batch['label'].to(device).squeeze(0)
            output = model(img)
            save_output_images(output, output_folder, i)
            dice, hd95 = eval_dice(output, label, classes=classes)
            all_dice.append(dice.item())
            all_hd95.append(hd95.item())
    return np.mean(np.array(all_dice)), np.mean(np.array(all_hd95))

def save_output_images(output, output_folder, batch_idx):
    os.makedirs(output_folder, exist_ok=True)
    for i, img_tensor in enumerate(output):
        img_pil = TF.to_pil_image(img_tensor.cpu())
        img_pil.save(os.path.join(output_folder, f'output_batch_{batch_idx}_img_{i}.png'))

if args.test:
    model.eval()
    model.load_state_dict(torch.load(args.pretrained_model_weights, map_location='cpu'))
    test_dice, test_hd95 = eval(model, testloader, 'cuda', classes=2, output_folder='/root/test0806/Endo-FM/TransUNet/saved/endofm/')
    print('Test Dice: %.1f, HD95: %.1f' % (test_dice * 100., test_hd95))
    exit(0)

then I got strange outputs like these:

then I changed some pics and modified file suffix, still unresolved.

Hi, @Jiangmiemiea
Thanks for your interest! The original output from the model is not the predicted segmentation result, you should first do this to obtain the predicted mask (* 255 is used to recover the image to [0, 255]):
prediction = torch.argmax(output, dim=1).cpu().numpy() * 255

您好，感谢您的关注！模型的原始输出不是预测的分割结果，您应该首先这样做以获得预测的掩码（用于将图像恢复到 [0， 255]）：* 255
prediction = torch.argmax(output, dim=1).cpu().numpy() * 255

Thanks! Problem solved. :)


Fix npm URL in README

The npm URL in the README was pointing to https://www.npmjs.com/package/node-crc which is broken. Pointing to https://www.npmjs.com/package/crc works.

Thanks!


⚠ Bofrost.at has degraded performance

In ce28b31, Bofrost.at (https://www.bofrost.at) experienced degraded performance:

HTTP code: 200
Response time: 2329 ms

Resolved: Bofrost.at performance has improved in 1e28b12 after 21 minutes.


retryTo leads to stale process on failure

I'm sorry @kobenguyent, but we must have missed a regression with the last fix here https://github.com/codeceptjs/CodeceptJS/issues/4110
It works fine as long as assertions are a success, but as soon as there is a failure – even outside the retryTo block – the test never terminates.
Simple test code:
Feature('foo');

Scenario('test issue', async ({ I }) => {
    I.amOnPage('http://example.org')
    I.waitForVisible('.nothing', 1); // should fail here but it won't terminate
    await retryTo( (tryNum) => {
        I.see(".doesNotMatter");
    }, 10);
});

EDIT: Adding an irregular await before the failing assertion await I.waitForVisible('.nothing', 1) will let the promise chain resolve.

The issue still persists (see test case). Unfortunately, retryTo can not be used currently. FYI @DavertMik

@kobenguyent after investigation, we have found that the issue is not about retryTo but occurs when a promise reject.
This is enough to stale the process
Scenario('Rejected promise stale the process', async ({ I }) => {
  await new Promise((resolve, reject) => setTimeout(reject, 500));
})

We investigate how to solve this


Update GPTResponder.py

Delete this request straight away - you've just posted your private OpenAI API key to GitHub. Anyone could copy your key and use all of the credits on your account doing this. NEVER upload API keys to GitHub, or anywhere for that matter!!

Thank you for the update
On Thu, Feb 22, 2024 at 6:10 AM Tom Aldridge @.***>
wrote:

Delete this request straight away - you've just posted your private OpenAI
API key to GitHub. Anyone could copy your key and use all of the credits on
your account doing this. NEVER upload API keys to GitHub, or anywhere for
that matter!!
—
Reply to this email directly, view it on GitHub
https://github.com/SevaSk/ecoute/pull/166#issuecomment-1959221296, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/A4A4DMM7HWG7VHJTASGCMPDYU4RS5AVCNFSM6AAAAABCOXGS56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGIZDCMRZGY
.
You are receiving this because you authored the thread.Message ID:
@.***>

Pls do you know how to make the scouts work it never worked with the API to
provide reply to questions asked..
Can you assist.? The installation worked but the devote does not reply to
questions.
Kindly revert
On Thu, Feb 22, 2024 at 8:32 AM Eme Onuoha @.***> wrote:

Thank you for the update
On Thu, Feb 22, 2024 at 6:10 AM Tom Aldridge @.***>
wrote:

Delete this request straight away - you've just posted your private
OpenAI API key to GitHub. Anyone could copy your key and use all of the
credits on your account doing this. NEVER upload API keys to GitHub, or
anywhere for that matter!!
—
Reply to this email directly, view it on GitHub
https://github.com/SevaSk/ecoute/pull/166#issuecomment-1959221296, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/A4A4DMM7HWG7VHJTASGCMPDYU4RS5AVCNFSM6AAAAABCOXGS56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGIZDCMRZGY
.
You are receiving this because you authored the thread.Message ID:
@.***>

Please delete this entire request - your API key is still visible in the commit. Once you’ve deleted this pull request, please open a new issue and document exactly why this doesn’t work for you - I.e. error messages, crashes, what you’ve tried to fix etc.

It's not working because Whisper got is false..
How do I turn it on?

Whisper GPT

Delete this pull request and raise a new issue. I won’t help you til you delete this entire post because you still have you API key posted. On 22 Feb 2024, at 15:05, Emerald-devops @.***> wrote:
Whisper GPT
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Pls how do I delete the pull request?

pls how do i delete it.
Kindly guide me
what step should i take
On Thu, Feb 22, 2024 at 8:39 AM Tom Aldridge @.***>
wrote:

Please delete this entire request - your API key is still visible in the
commit. Once you’ve deleted this pull request, please open a new issue and
document exactly why this doesn’t work for you - I.e. error messages,
crashes, what you’ve tried to fix etc.
—
Reply to this email directly, view it on GitHub
https://github.com/SevaSk/ecoute/pull/166#issuecomment-1959472471, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/A4A4DMKLSVT3OS64RH36I5TYU5DAHAVCNFSM6AAAAABCOXGS56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGQ3TENBXGE
.
You are receiving this because you authored the thread.Message ID:
@.***>

https://support.github.com/requestOn 22 Feb 2024, at 15:26, Emerald-devops @.***> wrote:
pls how do i delete it.
Kindly guide me
what step should i take
On Thu, Feb 22, 2024 at 8:39 AM Tom Aldridge @.***>
wrote:

Please delete this entire request - your API key is still visible in the

commit. Once you’ve deleted this pull request, please open a new issue and

document exactly why this doesn’t work for you - I.e. error messages,

crashes, what you’ve tried to fix etc.

—

Reply to this email directly, view it on GitHub

https://github.com/SevaSk/ecoute/pull/166#issuecomment-1959472471, or

unsubscribe

https://github.com/notifications/unsubscribe-auth/A4A4DMKLSVT3OS64RH36I5TYU5DAHAVCNFSM6AAAAABCOXGS56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGQ3TENBXGE

.

You are receiving this because you authored the thread.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>


iOS - Package using UiWebView

My app is currently running on rn 0.62, and i'm using the latest version of this library.
I've been getting this warning recently when submitting it to the appstore:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

I tracked down where this object is currently used, by doing a simple grep over my node_modules, and got this:

node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:@interface RCTWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:  UIWebView *_webView;
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:    _webView = [[UIWebView alloc] initWithFrame:self.bounds];
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:#pragma mark - UIWebViewDelegate methods
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: navigationType:(UIWebViewNavigationType)navigationType
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeLinkClicked): @"click",
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeFormSubmitted): @"formsubmit",
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeBackForward): @"backforward",
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeReload): @"reload",
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeFormResubmitted): @"formresubmit",
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeOther): @"other",
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (void)webView:(__unused UIWebView *)webView didFailLoadWithError:(NSError *)error
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      // Error code 102 "Frame load interrupted" is raised by the UIWebView if
node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (void)webViewDidFinishLoad:(UIWebView *)webView
node_modules/react-native-twitter-signin/ios/dependencies/TwitterKit.framework/Headers/TWTRTweet.h: *  Suitable for loading in a UIWebView, WKWebView or passing to Safari:
Binary file node_modules/react-native-twitter-signin/ios/dependencies/TwitterKit.framework/TwitterKit matches

So,it seems like this soon-to-be-deprecated object is being used in multiple files.
Any ideas on how to solve this, anyone facing the same issue around here?. Am I missing something? :octocat:
Any help or hints are most welcome! :smile:

Yes, I got faced the same problem a few days ago.
First:
rm -rf node_modules/react-native-twitter-signin/ios/dependencies
Second:
Go to node_modules/react-native-twitter-signin/ios/react-native-twitter-signin.podspec
And edit pod 'TwitterKit', '~> 3.3.0 to pod 'TwitterKit5'
Run pod update and this should solve your issue

I have the same issue, but edit pod 'TwitterKit', '~> 3.3.0 to pod 'TwitterKit5' don't help me.
I have The 'Pods-sdc' target has frameworks with conflicting names: twitterkit.framework. now

Try pod deintegrate remove pod TwitterKit5 from your podfile
Clean Xcode and pod install

The above is solved ?
Please give me some solution .

Yes, I got faced the same problem a few days ago.
First:
rm -rf node_modules/react-native-twitter-signin/ios/dependencies
Second:
Go to node_modules/react-native-twitter-signin/ios/react-native-twitter-signin.podspec
And edit pod 'TwitterKit', '~> 3.3.0 to pod 'TwitterKit5'
Run pod update and this should solve your issue
Simlar issue: #151

This fixed my issue, Thank you :)

Actually it was not in ios/react-native-twitter-signin.podspec. It was directly in the path of node_modules/react-native-twitter-signin/react-native-twitter-signin.podspec
Go to this path: => node_modules/react-native-twitter-signin/react-native-twitter-signin.podspec
s.dependency "TwitterKit", "~> 3.3"
Change to this
s.dependency "TwitterKit5"
go to terminal : cd ios/pod install
You will see twitterkit will be upgrade 3.3 something to 5.2.0.   This is build will upload to testflight it will working for me

I fixed this apple rejection issue by removing 4 files from react-native-twitter-signin in node_modules.
//Sample output of grep -r UIWebView node_modules/*
// node_modules/react-native-fbsdk/src/FBShareDialog.js:   * Displays the dialog in a UIWebView within the app.
// node_modules/react-native-gesture-handler/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
// node_modules/react-native-gesture-handler/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
// node_modules/react-native-reanimated/node_modules/fbjs/lib/UserAgent.js.flow:   * - UIWebView
// node_modules/react-native-reanimated/node_modules/fbjs/lib/UserAgent.js:   * - UIWebView
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:@interface RCTWebView () <UIWebViewDelegate, RCTAutoInsetsProtocol>
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:  UIWebView *_webView;
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:    _webView = [[UIWebView alloc] initWithFrame:self.bounds];
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:#pragma mark - UIWebViewDelegate methods
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m: navigationType:(UIWebViewNavigationType)navigationType
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeLinkClicked): @"click",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeFormSubmitted): @"formsubmit",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeBackForward): @"backforward",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeReload): @"reload",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeFormResubmitted): @"formresubmit",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      @(UIWebViewNavigationTypeOther): @"other",
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (void)webView:(__unused UIWebView *)webView didFailLoadWithError:(NSError *)error
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:      // Error code 102 "Frame load interrupted" is raised by the UIWebView if
REM // node_modules/react-native-twitter-signin/node_modules/react-native/React/Views/RCTWebView.m:- (void)webViewDidFinishLoad:(UIWebView *)webView

So I went to /<PROJ DIR>/node_modules/react-native-twitter-signin/node_modules/react-native/React/Views and ran rm RCTWebView* in the terminal


Roundhouse dotnet tool does not run

What You Are Seeing?
Using the Roundhouse .Net Core tool with DotNetCoreTool does not work as it says No executable found matching command "dotnet-roundhouse. This is probably as the Roundhouse .Net Core tool is installed as rh and the alias that is created in the cake folder is rh.ex.
What is Expected?
The tool should run correctly.
What version of Cake are you using?
0.32.1
Are you running on a 32 or 64 bit system?
64
What environment are you running on?  Windows? Linux? Mac?
Windows
Are you running on a CI Server?  If so, which one?
No
How Did You Get This To Happen? (Steps to Reproduce)

Create a new cake project.
Add #module nuget:?package=Cake.DotNetTool.Module
Run build.ps1 --bootstrap
Add #tool dotnet:?package=dotnet-roundhouse
Run DotNetCoreTool("roundhouse"); from any cake task.

@Roemer I have just created a PR that should address this for you.

@Roemer hmm, I had made an assumption based on the name of the package.  Having just attempted the installation of this global tool, I can see that this PR isn't going to work as it currently stands.

@Roemer actually, this should already work for you....
Try the following:

There should be no need to run DotNetCoreTool("roundhouse");

@Roemer I have updated the PR to include only the shims that are created as part of the dotnet tool installation, i.e. rh.exe and rh.
As I mentioned though, for you, on Windows, this should already work today:

@gep13 Hmm yes it works now. I think I first tried to use the nuget package (tool nuget:?package=roundhouse) which did not work for  me because there was a bug in the executable so I tried using the .net core tool (which worked). For some reason I had to add ToolPath = Context.Tools.Resolve("rh.exe") to RoundhouseSettings but now it seems to work correctly. Probably because I now have deinstalled the nuget tool and only installed the .Net Core tool.


Modify front-end deployment manual deployment instructions

Modify front-end deployment manual deployment instructions

i think we should not display the apache download url in the document before release process completed.
@lgcareer @dailidong

As a part of publish process, if not display, developer can't see what to check

we also reminder 1.2.0 is upcoming version in our official website

we also reminder 1.2.0 is upcoming version in our official website

that's ok.


[esdoc-ecmascript-proposal-plugin] Optional catch binding not supported

"esdoc": "^1.1.0",
"esdoc-ecmascript-proposal-plugin": "^1.0.0",
"esdoc-standard-plugin": "^1.0.0"

I get the following error :
warning: could not parse the following code
When the parser encounter an optional catch binding:
try {
  const fileStats = await promises.stat(file);
  if (!fileStats.isFile()) return false;
  return Finder.isWindows ? this._checkFileExtension(file) : this._checkFilePermissions(fileStats);
}

catch { // <= optional catch binding
  return false;
}

In the generated documentation, the whole file is skipped.

I close this issue because we have just exceeded one year of seniority 😴

I'm having this issue as well, it's failing my build process. Can we reopen this and get this fixed please?

@fab1o Sure... but I think @h13i32maru has moved on: he doesn't seem to maintain this project anymore.

@cedx I started it but I think I'm missing something cos npm test is not passing, could you take a look? https://github.com/esdoc/esdoc-plugins/pull/101


Character / string classification

As in: contains invalid characters for any user id, contains characters only valid for a historical user id, is valid as a non-historical user id.

Done in 93f7535.


Prevent empty find result

Hello
I've got a little problem when my directory is empty. In this case xargs execute optimizer script with empty result and raise an error.
Should be solve with --no-run-if-empty argument

Hello @camlafit,
issue has been fixed.
Thanks for the report


fix typo in example secret filename

Change Summary
This change fixes a minor but potentially confusing typo in the "Secret Support" section of the settings documentation: previously, the example secret filename, db_password, did not match/correspond with the example Settings model's database_password field.
Related issue number

Checklist

[ ] Unit tests for the changes exist
[ ] Tests pass on CI and coverage remains at 100%
[ ] Documentation reflects the changes where applicable
[ ] changes/<pull request or issue id>-<github username>.md file added describing change
(see changes/README.md for details)

👍 thanks so much.


Proposal: examples

Feature useful mainly for libraries. "How to use" examples could be embedded in source code, like the tests.
EXAMPLE "func1, func2, func3" /// this is example relevant to 3 functions
{
  /// Typical use of ...
  ...
}

Notes:

The compiler would verify example code compiles. It won't run it.
One who writes library documentation may copy relevant examples, or some tool can do this automatically.
Examples are different to tests, they show expected and desired use patterns, not corner cases and tricky use. Example may call functionality not desirable in a test (e.g. long sleep, delete all files, interaction with the user, GUI), without need for mocking.
Uppercased keyword EXAMPLE would attract attention of those who don't have time to grok details.

There may be module level examples, representing functionality of the whole source file:
MODULE_EXAMPLE
{
  /// Higher level example showing how to use the module
  ...
}

Good style guidelines may recommend placing examples just after relevant function (before tests) and module examples at the end of the file.

What about:
//!EXAMPLE
comptime {
    if (false) {
        ...
    }
}

test "EXAMPLE" {
    if (false) {
        ...
    }
}

Anyway I think this proposal is for lazy programmers, not for people who really want to write good docs.

@iology: examples get copy pasted. With indentation due to if (false) this would be less convenient.

Yes, and my example does syntax check, but without checking the existence of referenced files.
Would you want to compile the examples every time the library is compiled? Or just zig example <src>?
Why not put them in a separate example directory and import the library normally? So that people know they don't omit any includes and imports.

@iology: yes, examples would be compiled every time library is compiled. I expect them to be rather short.
Examples somewhere in a subdirectory are practically abandoned - out of sight, out of mind. If they are in source code there's some chance they will be kept up to date.  Subdirectory and more files add unwanted complexity into a system. (Embedded tests and examples enlarge source code, but one is not exposed to this until he opens that source.)
Example blocks may support the @import thing inside.
The goal is that lazy programmer copies the example, certain that it compiles/works, has good style and nothing important is missing. Then he can play with it further.

I had envisioned us doing example blocks simply as part of the documentation. Pretty much as rust does, and just incorporating them to run under the zig test.
Is there any reason to prefer this explicit keyword? The fact that examples only differ from the current testing approach semantically seems like it could be slightly annoying. We will envitably have some way to document functions/modules anyway, and it seems appropriate to place them there instead.
Here is an example of what it looks like if you aren't familiar with rust.
https://github.com/BurntSushi/byteorder/blob/master/src/io.rs

@tiehuis:
It is unusual and not advantageous to have code inside comments.

Developers are conditioned to ignore comments, leaving such code to the rot.
Editing gets harder with these ///.
The code is not trivially copyable (from the source).
Indentation levels may increase significantly.  (My pet nuisance.)
Proper syntax highlighting would require really advanced editor.

It's a hack.

EXAMPLE
{
    ...
}

looks natural and lacks problems listed above.

I do not recommend automatically run examples - they are not restricted as tests are, may e.g. show GUI. If they are not invoked they would not need mocking support (if this feature gets implemented).

Explicit EXAMPLE keyword is something I'd personally prefer. I am browsing Zig's  stdlib sources and looking all the time if there's a test hinting how to use this or that. Having EXAMPLE yelling at me would help.

Tests and examples have very different purpose. Test do (should do) crazy things, push the limits, ensure high coverage etc. Examples should be Platonic ideals transformed into code.
There should be as much testing as circumstances permit.  Duplication and wordiness is not a big deal, even could be desirable. OTOH examples should be succinct and of good style.

I think I am missing something here.   If you want the examples to be maintained, then they need to be run, not just compiled.

I do not recommend automatically run examples - they are not restricted as tests are, may e.g. show GUI. If they are not invoked they would not need mocking support (if this feature gets implemented).

What if you could chose which tests to run?   Would that be sufficient?

@PavelVozenilek
I think an important question to consider is whether users are expected read the source code to understand the api/usage or whether they should be reading some generated documentation.
Unfrotunately the stdlib source needs to be read directly for usage at this stage, since there is no documentation otherwise. If there was proper API documentation, how would you expect the examples would be provided there? Is the need for highly visible examples as important then?
Just want to make sure we are focusing on the way that users are expected to consume this information.
@kyle-github
I don't think running examples is actually too important as the behavior should itself be covered by tests as part of the code ideally. Some cases may benefit though (i.e. using assert to show expected behavior to the user and running just for confirmation).

@kyle-github:  I expect examples to be read, thought about and used. People will report the problems. This should do the maintenance.

What if you could chose which tests to run? Would that be sufficient?

You'd also need to distinguish between ordinary tests (ugly, full of asserts) and example tests (nice) which are extracted by the tooling.
That now gives 3 variants (ordinary test, example which is always executed, non-runnable example).
For people who prefer to read source code examples should be visually distinctive, to catch attention.
Example also should provide hint on their place in generated documentation, something not always obvious. That's the EXAMPLE func1, func2, func3 { ... } part (here asking to be shown at three locations).

My opinion is that test and (non-runnable) EXAMPLE is the optimal solution. Other options could be added if need arises.

@tiehuis: some people read the documentation, others go to the code. My proposal cares for both.
I expect that library documentation will be generated, not hand written. Extracted examples then could make the most important and visually dominating part of the documentation.
I personally prefer documentation in form of nice short examples, which could be read linearly like a book (unlike javadoc). Example is what programmers can do well. When they produce long text it is almost always horror.
Current form of Zig documentation project is really promising. No attempt to write novels, small code snippets instead.

Hypothetical generated documentation should avoid at all cost trap of pedantic formalism, like:
/// @FunctionDescription: adds two numbers
/// @Par1: first number to add
/// @Par2: second number to add
/// @Return: sum
fn add(x : u32, y : u32) -> u32
{
  return x + y;
}

I have seen things like this.

@PavelVozenilek

Examples somewhere in a subdirectory are practically abandoned - out of sight, out of mind. If they are in source code there's some chance they will be kept up to date. Subdirectory and more files add unwanted complexity into a system.

Isn't the user also copying the code to their project directory? Adding addtional library search paths should not be a big deal, given that Zig want to provide a better make.

yes, examples would be compiled every time library is compiled.

It is also the developers' duty to make sure the provided examples can be compiled (and run if so desired). So they can add a build job alongside the tests. They'd better run the tests before compiling the examples. This feature sounds like the examples are more important than the tests.
// For now I just put aside the convenience of linking the source code to the examples. Docgen concerns are quite complicated and in a higher level.

@iology: I personally dislike when there's a library and it contains not just the source but also many other files and subdirectories, often with unclear purpose.

Adding addtional library search paths
add a build job alongside the tests

These two steps would make me look for alternative.
My ideal are those "single header" C/C++ libraries. Anything beyond is (often, not always) useless complexity for complexity.

They'd better run the tests before compiling the examples

Even this is not really needed as explicit step. My testing framework runs the tests (from recently modified sources) automatically, whenever the application starts. It is like a miracle: edit, then press F5 (run with recompile) - no extra step diverting attention away, and it can be done literally within second.

Back to the examples. If they are embedded it has following advantages:

No extra files/directories. The library could ideally fit in one file.
Examples are near the relevant code. I find a function, scroll a bit down and see how it can be used. If I need more I scroll further down for the tests.
Documentation generator may not need any manual configuration. Generating documentation could even get automatic and invisible.

There's one disadvantage: if tests and examples are embedded in source code its size can grow a lot. Beyond 5 - 10k lines it becomes annoying to use scrollbar and minimaps are useless.
I experimented (in C) with test subdirectories and inlined files but eventually settled to "one file with everything", with consistent internal structure: first a function, then its tests, then another function and so on.  Such structure is also easy to modify.

Heh, I found I proposed this functionality two years ago in #128.

I just read essay ( http://akkartik.name/about ) by Kartik Agaram, out-of-the-box thinker about programming languages.
Among ideas to better understand someone else's code he proposes:

Instead of describing your architecture, point newcomers at core tests that they can instrument or step through in a debugger. That allows them to focus first on the concrete series of operations desired in a situation rather than how those operations happen to be organized in code.

This feels quite a lot as proposed examples here. Ordinary tests will be dozens of a dime, easy to create and forget. Examples could be what newcomer should explore, and the special syntax would guide them to go there.


Request ZFS/LUKS passwords via Plymouth

Plymouth currently starts after FDE passphrases have been entered, which is not very useful on modern systems, where booting takes less than 10 seconds. This PR contains a few (partially untested, but works for plymouth + ZFS for me) commits that move Plymouth to earlier in the boot process, and then handle passwords via the bootsplash.
To be done:

[ ] Test with more obscure LUKS setups (the luksroot test worked, but that doesn't guarantee yubikey / GPG card do, and I'm not entirely sure how to test those in a VM.)
[ ] Clean up some of the commits
[ ] Figure out if cryptsetup-askpass was actually used

If anyone wants to help with testing this out, that'd be highly appreciated!
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

Tested and works with luks, but this breaks scaling in plymouth during boot for me. Prior to enabling this, regardless of whether I used hidpi console fonts, plymouth would always scale "correctly", during boot and shutdown. Now it only does so during shutdown.
Setting DeviceScale (previously completely unset) in /etc/plymouth/plymouthd.conf affects shutdown scaling but not boot scaling, so this could just be a plymouth bug.

@maxeaubrey Interesting. There's no direct reason this'd cause a scaling issue, unless you use console.earlySetup, I think.. Any other details on your config?

Here's my system configuration: https://github.com/maxeaubrey/systems
console.earlySetup is enabled, but I just checked and with it disabled I still get no scaling in plymouth during boot, whether DeviceScale is set or not.

Meh. I suspect the issue might be that it's no longer using the DRM backend but instead the plain framebuffer backend. (Maybe because the DRM driver doesn't exist yet?) I'm not entirely sure how to verify this (does plymouth without this patch the backlight once / re-sync the display before showing up, I guess?), I could add a config flag that allows you to set DeviceScale though, if that'd help.

oh dang, didn't notice @eadwu had a patchset (#84158) making  (tho it's mostly aiming at the flicker-free part). Might look at the differences and merge those in..

Hi, what's the status of this pr?

@jtojnar @puckipedia Is there any progress on this issue? I'd be happy to try myself, but I'd have to invest quite some time, so I wanted to ask first...

@ymarkus it has been recently discussed on IRC: https://logs.nix.samueldr.com/nixos-dev/2021-02-22#1613999739-1614013629;

Ok thanks, so I guess @puckipedia will rebase this PR on that one when it gets merged? If you need any help or someone to test it out, feel free to ping me!

Is systemd-ask-password a better way to do this? See also #74842.

@andersk probably, but there's a bit of a gridlock going on between all the systemd initrd changes. It'd be nice to have plymouth password prompts for the time being, and do the proper thing when the systemd-related issues are resolved.
Let's not shave yaks ;)

Should integrate with https://github.com/NixOS/nixpkgs/pull/164943

@puckipedia I've merged the latest nixos-unstable branch into plymouth-fixes: https://github.com/ners/nixpkgs/commit/4620d130bf9566b6a7606f04bf38498a7600695f
Feel free to grab that commit to resolve the merge conflicts.
I've tested out the branch with https://github.com/NixOS/nixpkgs/pull/164943 enabled, but haven't managed to get a Plymouth prompt to show up.

I've plymouth prompts on a LUKS initrd setup for a while now. What's the status of this PR, what's missing from here in the main branch? Could this be rebased?


Fix download paths

Fixes #5

Thank you very much for the PR and the declared issue.
Sadly there was also a bug in the CI due to a breaking change in one of the actions used and I was really late at seeing your PR I fixed both of them in the same PR #7
Thanks again for reporting the issue and proposing a fix. Please accept my apologies for being late and I hope you'll understand that I had to craft another PR so that everything is fixed in a single PR