Opportunity to consolidate?

Hey there, my employer Artsy is a new Braze customer and I need a gem to work with their API. I have some bandwidth during work hours to help improve things about the gem I use so I'm trying to figure out where to put that effort.
After some research, I see 4 different Braze client gems:
https://rubygems.org/gems/appboy => https://github.com/DynamoMTL/appboy
https://rubygems.org/gems/braze_ruby => https://github.com/justinboltz/braze_ruby
https://rubygems.org/gems/braze => https://gitlab.com/mtchavez/braze
https://rubygems.org/gems/braze_api => https://github.com/appearhere/braze_api
I was confused about how all these projects related to each other but I think there might be an opportunity to consolidate at least DynamoMTL/appboy and justinboltz/braze_ruby since the latter is a fork of the former. What do people think of this? What would it take to consolidate our efforts?
The other two seem unrelated but I'd certainly invite those peeps to participate in a single effort!
Going to ping a few contributors on both projects that might have strong feelings (feel free to add others I miss):
@FGoessler
@adayag :wave: :heart:
@hugobast
@joshnuss
@justinboltz
@morgoth
@tborlee
@wenga86

I love the idea @wenga86 is as far as I know the only active member on this repository so I'm bumping access to admin and defer to wenga86
Godspeed, love the initiative!

I'd be happy to consolidate or even hand over ownership to anyone that wants to run with the braze_ruby gem. I actually left the company that was using Braze a couple years ago, so most of the more recent work on the braze_ruby gem has been from other contributors anyway.

Thanks for transferring braze_ruby @justinboltz!! 🙌 ❤ 🏆

Bumping this one @hugobast - would love to get started on migrating users off the appboy gem!! ❤

Bumping this one @hugobast - would love to get started on migrating users off the appboy gem!! ❤

Oops sorry, said I would do it then didn't... doing it now

I had to transfer to myself first then sent a request to transfer to you @jonallured, please confirm when you get it. Thanks for the ping.

Woot, both repos have been moved! 👍 I think the only other thing I could use help on is being added to RubyGems.org for these two projects. That will allow me to publish versions. My plan is to push an appboy version with a deprecation warning and a nudge to switch to braze_ruby and then a final version that's gutted out with errors pointing one to the braze_ruby gem.
Then on braze_ruby I'll cut a version with Ruby 3 support. Thanks all!! ❤


fixed typo in configuring-superset.mdx

SUMMARY

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

[ ] Has associated issue:
[ ] Required feature flags:
[ ] Changes UI
[ ] Includes DB Migration (follow approval process in SIP-59)

[ ] Migration is atomic, supports rollback & is backwards-compatible
[ ] Confirm DB migration upgrade and downgrade tested
[ ] Runtime estimates and downtime expectations provided

[ ] Introduces new feature or API
[ ] Removes existing feature or API

Nice catch! Running CI so we can merge this :)


Prepare translation files for Weblate

While looking into Weblate, I noticed that it got stuck on a merge conflict. This fix should enable Weblate to refresh and update its translations again.
The cause of the problem is the indentation used in the translations comming from Transifex. Unlike Weblate, which adheres to our code style, Transifex uses a two-space indentation, causing conflicts on each line.
I don't know if that behaviour of Transifex could be changed. In the worst-case scenario, we may need to manually format the pulled translations before incorporating them into the project.

We're currently not using Weblate. Changed strings files will get overwritten the next time I'll pull translations from Transifex.
Once we make the switch to Weblate it's probably easier to remove what's currently there, import from the repository again, and then pull the reformatted files from Weblate.

You're right that we currently are not using Weblate yet, so I've put it in locked mode to prevent external contributions.
I wanted to mention that Weblate is already configured to follow all translation changes in the repository seamlessly. This means that once we make the switch to Weblate, it should be relatively straightforward to just continue with it.
The only remaining issue is the indentation conflicts with translations coming from Transifex. A simple reformat fixes that, and we should be capable of managing future translations without hassle.

Rebased on latest changes


Prepare for 0.6.0 release

I'll need to update the readme, I filed a bug for that: https://github.com/GoogleCloudPlatform/appengine-plugins-core/issues/615


cakeshop docker don't start while it works on other

Can not start the cakeshop docker ( the last version and 0.9.0 ) because the wallets do not unlocked.
"docker run -p 8080:8080 -v "$PWD/data":/opt/cakeshop/data     -e JAVA_OPTS="-Dspring.profiles.active=local"     jpmc/cakeshop"
I tried to delete wallet that were not unlocked but apparently it is still the last wallets that does not unlocked.
I do not understand why image docker does not work on this computer (ubuntu 16.04.03) only.
I0424 17:05:25.214766 core/blockchain.go:221] Fast block: #0 [d93b8da4…] TD=1024
I0424 17:05:25.215946 p2p/server.go:342] Starting Server
I0424 17:05:25.216223 p2p/server.go:610] Listening on [::]:30303
I0424 17:05:25.216243 eth/backend.go:473] Automatic pregeneration of ethash DAG ON (ethash dir: /opt/cakeshop/.ethash)
I0424 17:05:25.216960 eth/backend.go:480] checking DAG (ethash dir: /opt/cakeshop/.ethash)
I0424 17:05:25.220464 node/node.go:411] HTTP endpoint opened: http://<IP_ADDRESS>:8102
INFO 2018-04-24 17:05:25,417 [main] (GethHttpServiceImpl.java:535) Geth RPC endpoint is up
INFO 2018-04-24 17:05:25,564 [main] (GethHttpServiceImpl.java:496) Waiting up to 6000ms for 3 accounts to unlock
I0424 17:05:27.771006 cmd/geth/accountcmd.go:200] Unlocked account 2e219248f44546d966808cdd20cb6c36df6efa82
I0424 17:05:30.297468 cmd/geth/accountcmd.go:200] Unlocked account cd5b17da5ad176905c12fc85ce43ec287ab55363
ERROR 2018-04-24 17:05:31,564 [main] (GethHttpServiceImpl.java:568) Wallet did not unlock in a timely manner (2 of 3 accounts unlocked)
ERROR 2018-04-24 17:05:31,577 [main] (GethHttpServiceImpl.java:568) Ethereum failed to start
org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@435d8d56: startup date [Tue Apr 24 17:05:05 UTC 2018]; root of context hierarchy
One idea ?

Hi, looks like the wallet didn't get unlocked in timeout time. Please play around with application.properties file and geth.unlock.timeout=10000 and try again.


Misplaced exponents in multi-line math environment

Description
Using Typst 0.11.0 but first found this behaviour in 0.10.0
Exponents placed after a multi-line aligned expression in a math block appear at the end of the first line, rather than after the expression ends on the bottom line.
Minimal working example:
#lorem(20)
$ (&x \
   &+y)^(2) = 1 $
#lorem(20)

Calling typst compile main.typ on the previous code leads to the following being rendered:

The exponent 2 should, I think, be placed after "+y)" on the second line. I ran into this first on a much more complex expression but it appears to happen for many different examples.
Adding/removing parentheses around the exponent 2 doesn't change the output.
Placing an ampersand before the exponent, like &+y)&^(2) = 1 $,  seems to place the two correctly. This seems to be an easy workaround, but (imho) doesn't seem like an obvious thing to try. It was pointed out to me on this reddit post.
Adding the extra ampersand gives the following:
.
I couldn't see any similar issues raised here so apologies if this is a duplicate/mistake on my end. I don't have discord or I would have posted this there first. Apologies in advance if I don't respond too quickly, still have to finish my dissertation :)
Reproduction URL
No response
Operating system
macOS
Typst version

[X] I am using the latest version of Typst

I think this is related to how typst treats the parenthesis. It is thinking that (x \+y) as a single object before it adds the superscript 2 to it, resulting in an 2 on the first line, which really is on the whole block. If you insert an & before the superscription, it is adding 2 to the invisible align anchor and therefore appears in the second line.
I don't know for now which way to go but I suspect evaluating the line break before parenthesis may be the way to go. I can investigate further and potentially fire a PR if the problem is this easy. @laurmaedje


bip vs. reference implementation mismatch

Hi,
Not sure where should I put this but I seem to find a mismatch in reference implementation and the contents of bip
In reference implementation you have following test case:
def test_xprv_to_entropy():
    e = bipentropy.BIPEntropy()
    test = e.bip32_xprv_to_entropy("m/83696968'/0'/0'", XPRV)
    expected = 'efecfbccffea313214232d29e71563d941229afb4338c21f9517c41aaa0d16f00b83d2a09ef747e7a64e8e2bd5a14869e693da66ce94ac2da570ab7ee48618f7'
    assert test.hex() == expected

where the value of expected is derived entropy i.e. result of hmac-sha512 on derived key
however in bip DERIVED ENTROPY=6bea85e51a05e6dbaf2ccee05097758213807997ba936589cef01c8f19c0079f395a0cd045efa3438677f3ef9ad34c9a68506626c5a17e51ed5e177852ee7fdc
what is DERIVED_ENTROPY?? I thought it is expected value form test, but as you can see they do not match

Another mistake in XPRV section where PATH is incorrect:
currently: m/83696968'/39'/0'
should be: m/83696968'/3'/0'

there is already a PR fixing above mentioned


Add verifier_size

It looks good and is ready to merge (I don't have write access and cannot do that).


Recaptcha v3 not working

I've attempted to configure recaptcha v3 support after getting v2 working but I end up with the form redirecting to my staticman instance with a success message.
Here's the v3 code, which is live on my site: https://github.com/datapolitical/contrast/
the relevant files are assets/js/main.js and _includes/comments.html and comment.html and comment_form.html.
I've included more details in the comment below.
Any help is greatly appreciated.

Okay I figured it out. The site key that's live on my website needed to match the request I was submitting. But now the code I have is submitting properly but not interfacing with the existing main.js file. The only thing I've changed is switching the button code to this:
    <button class="button g-recaptcha" id="comment-form-submit"
        data-sitekey="{{ site.reCaptcha.siteKey }}"
        data-callback='onSubmit'
        data-action='submit'>
      Submit
    </button>

</form>

<script>
  function onSubmit(token) {
    document.getElementById("new-comment").submit();
  }
</script>

I don't know node.js yet, but it seems to me that only reCATPCHA v2 is supported.  If you want reCAPTCHA v3, you may adjust your API instance's controllers/process.js with reference to https://github.com/eduardoboucas/staticman/pull/383/files#diff-80c0fcb3f3c0e1789216e765ac223f0e327b2175d4c4cabb7d3423ced3081131 so as to get this feature.

Thanks! This is a huge help! One question: Given i deployed to Heroku by clicking the button, what’s the right way to make the change? I’ve never modified code on heroku before.
Do I just clone the repo and then change the code and then push it to heroku?
It’s a shame that PR wasn’t adopted so that V3 would be an option.

Thanks! This is a huge help! One question: Given i deployed to Heroku by clicking the button, what’s the right way to make the change? I’ve never modified code on heroku before.

You may want to refer to Heroku's docs for the deploy button.  I remember something like https://git.heroku.com/....  You may try finding the right Git URL on Heroku for your app through the online dashboard.
It seems that using the implicit template in README and  suitable app.json suffices.
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

Given that you've clicked the button through this repo (like I did), you might want to change the key repository in app.json to your fork if you tweak this node.js app.
The code editing is carried out locally, then push to GitHub and Heroku.  It's possible to link up the two, and I encourage you to find the relevant docs through Heroku's online dashboard.
:exclamation: I've never tried the above procedures.  However, you're invited to leave a feedback, so that future testers (including me) can benefit from your experience. :smiling_imp:

It’s a shame that PR wasn’t adopted so that V3 would be an option.

@alexwaibel has his reasons for closing a PR mixed with too many changes.  As a maintainer for a Hugo theme, I sympathize with his decision.  I've worked on that to fix bugs introduced by the owner's updates for a week.  I've asked #413 for this feature.


W 12006339 v25 dwfunction chk duke

Writer's Quality Checklist
Before merging your PR, did you:

[ ] Run spell checker
[ ] Run link checker to check for broken xrefs
[ ] Check for orphan files
[ ] Perform a local build and do a final visual check of your content, including checking for:

Broken images
Dead links
Correct rendering of partials if they are used in your content
Formatting issues, such as:

Misnumbered ordered lists (steps) or incorrectly nested unordered lists
Messed up tables
Proper indentation
Correct header levels

[ ] Receive final review and signoff from:

Technical SME
Product Manager
Editor or peer reviewer
Reporter, if this content is in response to a reported issue (internal or external feedback)

[ ] If applicable, verify that the software actually got released

replaced and updated by https://github.com/mulesoft/docs-dataweave/pull/226/files


Disc not exposed to container in Unraid

Hello,
I am newbie and I need some help with MakeMKV. The container doesn't seem to have access to the drive in unraid. I tried to check the logs or run the command lsscsi -g but it only shows one device /dev/sr0. I tried running the logs but it doesn't give me any information. Any help would be greatly appreciative.
Thanks
/tmp # lsscsi -g
[0:0:0:0]    disk    JetFlash Transcend 16GB   1100  -          -
[1:0:0:0]    disk    ATA      ST16000NE000-2RW EN02  -          -
[1:0:1:0]    disk    ATA      ST10000NE0008-2P EN02  -          -
[1:0:2:0]    disk    ATA      ST10000NE0008-2J EN01  -          -
[1:0:3:0]    disk    ATA      ST10000NE0008-2J EN01  -          -
[1:0:4:0]    disk    ATA      Samsung SSD 870  1B6Q  -          -
[1:0:5:0]    disk    ATA      ST10000NE0008-2P EN02  -          -
[1:0:6:0]    disk    ATA      ST16000NE000-2RW EN02  -          -
[1:0:7:0]    disk    ATA      CT2000BX500SSD1  030   -          -
[1:0:8:0]    disk    ATA      CT2000BX500SSD1  030   -          -
[6:0:0:0]    cd/dvd  PIONEER  BD-RW  BDRUD03AS 1.00  /dev/sr0   -
[N:0:5:1]    disk    Samsung SSD 980 1TB__1                     -          -
[N:1:5:1]    disk    Samsung SSD 980 1TB__1                     -          -
Container logs...
text  error  warn  system  array  login
Xlib:  extension "DPMS" missing on display ":0".
16/07/2022 08:01:16 X display is not capable of DPMS.
16/07/2022 08:01:16 --------------------------------------------------------
16/07/2022 08:01:16
16/07/2022 08:01:16 Default visual ID: 0x21
16/07/2022 08:01:16 Read initial data from X display into framebuffer.
16/07/2022 08:01:16 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/5120
16/07/2022 08:01:16
16/07/2022 08:01:16 X display :0 is 32bpp depth=24 true color
16/07/2022 08:01:16
16/07/2022 08:01:16 Listening for VNC connections on TCP port 5900
16/07/2022 08:01:16
16/07/2022 08:01:16 Xinerama is present and active (e.g. multi-head).
16/07/2022 08:01:16 Xinerama: number of sub-screens: 1
16/07/2022 08:01:16 Xinerama: no blackouts needed (only one sub-screen)
16/07/2022 08:01:16
16/07/2022 08:01:16 fb read rate: 2828 MB/sec
16/07/2022 08:01:16 fast read: reset -wait  ms to: 10
16/07/2022 08:01:16 fast read: reset -defer ms to: 10
16/07/2022 08:01:16 The X server says there are 10 mouse buttons.
16/07/2022 08:01:16 screen setup finished.
16/07/2022 08:01:16
The VNC desktop is:      d09f0e945105:0
PORT=5900

Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?
The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:
x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching
16/07/2022 08:01:18 Got connection from client <IP_ADDRESS>
16/07/2022 08:01:18   other clients:
16/07/2022 08:01:18 Got 'ws' WebSockets handshake
16/07/2022 08:01:18 Got protocol: binary
16/07/2022 08:01:18   - webSocketsHandshake: using binary/raw encoding
16/07/2022 08:01:18   - WebSockets client version hybi-13
16/07/2022 08:01:18 Disabled X server key autorepeat.
16/07/2022 08:01:18   to force back on run: 'xset r on' (3 times)
16/07/2022 08:01:18 incr accepted_client=1 for <IP_ADDRESS>:34258  sock=10
16/07/2022 08:01:18 Client Protocol Version 3.8
16/07/2022 08:01:18 Protocol version sent 3.8, using 3.8
16/07/2022 08:01:18 rfbProcessClientSecurityType: executing handler for type 1
16/07/2022 08:01:18 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
16/07/2022 08:01:18 Pixel format for client <IP_ADDRESS>:
16/07/2022 08:01:18   32 bpp, depth 24, little endian
16/07/2022 08:01:18   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
16/07/2022 08:01:18 no translation needed
16/07/2022 08:01:18 Enabling NewFBSize protocol extension for client <IP_ADDRESS>
16/07/2022 08:01:18 Enabling full-color cursor updates for client <IP_ADDRESS>
16/07/2022 08:01:18 Using image quality level 6 for client <IP_ADDRESS>
16/07/2022 08:01:18 Using JPEG subsampling 0, Q79 for client <IP_ADDRESS>
16/07/2022 08:01:18 Using compression level 9 for client <IP_ADDRESS>
16/07/2022 08:01:18 Enabling LastRect protocol extension for client <IP_ADDRESS>
16/07/2022 08:01:18 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0xFFFFFECC)
16/07/2022 08:01:18 Using tight encoding for client <IP_ADDRESS>
16/07/2022 08:01:19 client_set_net: <IP_ADDRESS>  0.0000
16/07/2022 08:01:19 created   xdamage object: 0x40002c
16/07/2022 08:01:20 copy_tiles: allocating first_line at size 41
16/07/2022 08:01:23 client 1 network rate 3475.1 KB/sec (70948.5 eff KB/sec)
16/07/2022 08:01:23 client 1 latency:  4.2 ms
16/07/2022 08:01:23 dt1: 0.0068, dt2: 0.0114 dt3: 0.0042 bytes: 55894
16/07/2022 08:01:23 link_rate: LR_LAN - 4 ms, 3475 KB/s
16/07/2022 08:01:28 created selwin: 0x40002d
16/07/2022 08:01:28 called initialize_xfixes()
16/07/2022 08:03:16 got closure, reason 1001
16/07/2022 08:03:16 rfbProcessClientNormalMessage: read: Connection reset by peer
16/07/2022 08:03:16 client_count: 0
16/07/2022 08:03:16 Restored X server key autorepeat to: 1
16/07/2022 08:03:16 Client <IP_ADDRESS> gone
16/07/2022 08:03:16 Statistics             events    Transmit/ RawEquiv ( saved)
16/07/2022 08:03:16  ServerCutText       :      1 |         8/        8 (  0.0%)
16/07/2022 08:03:16  FramebufferUpdate   :     25 |         0/        0 (  0.0%)
16/07/2022 08:03:16  LastRect            :      6 |        72/       72 (  0.0%)
16/07/2022 08:03:16  tight               :    197 |    130755/  8451132 ( 98.5%)
16/07/2022 08:03:16  RichCursor          :      1 |      1374/     1374 (  0.0%)
16/07/2022 08:03:16  TOTALS              :    230 |    132209/  8452586 ( 98.4%)
16/07/2022 08:03:16 Statistics             events    Received/ RawEquiv ( saved)
16/07/2022 08:03:16  PointerEvent        :    686 |      4116/     4116 (  0.0%)
16/07/2022 08:03:16  FramebufferUpdate   :     26 |       260/      260 (  0.0%)
16/07/2022 08:03:16  SetEncodings        :      1 |        56/       56 (  0.0%)
16/07/2022 08:03:16  SetPixelFormat      :      1 |        20/       20 (  0.0%)
16/07/2022 08:03:16  TOTALS              :    714 |      4452/     4452 (  0.0%)
16/07/2022 08:03:19 destroyed xdamage object: 0x40002c
Thank you

Thanks for the reply. I tried to fetch the logs and for some reason I got this message:
root@Prime:~# docker logs MakeMVK
Error: No such container: MakeMVK

Sorry, I made a typo in my answer for the name of the container.  It's docker logs MakeMKV.

Oh..I should've caught that too. No worries..
After running the command docker logs MakeMKV, I was able to see that the container didn't have access to /dev/sr0, /dev/sg10. After entering the these two devices in extra parameters, it seems to be working fine. The container is able to see the drive. Thank you so much for your help.

You are welcome !


Validation on build_provider

So on build_provider() it is possible to analyze and validate all registered services whether they are correct or not.
The build_provider() returns Result<ServiceProvider, Error>.
Validation rules on build_provider():

Singletons and Transient cannot be dependent on Scoped.
Dependency loop.
Service cannot be instantiated (no constructor or constructor contains unregistered types).
Ambiguous traits (has multiple implementations but required as single).
Ownership issues ???
...

Some additional validation is definitely something I'm behind. It certainly makes sense to put that behind build_provider. That is something for a v2. Once the approach for how validation can/will be done, then it can be evaluated whether it should be behind build_provider as an Error (but I think it's reasonable to assume that will be the case).
1.
If a Singleton depends on a Scoped, it effectively causes the Scoped to become a Singleton. This is arguably wrong, but I started with the caveat emptor approach. build_provider definitely doesn't need to panic. Returning some type of validation (e.g. Error) would make sense.
If a Transient depends on a Scoped, I don't think that is a problem because in the current design, it's not possible for a Transient to depend on a Scoped at any other level than itself. In other words, a Transient in the root can only depend on a Scoped that is also at the root (which is effectively a Singleton). A Transient in a nested scope can only depend on a Scoped at the same level. A Scoped should be able to live longer than a Transient. The inverse is also still valid. If a Scoped depends on a Transient, then it is effectively promoted to Scoped because it will live as long as Scoped. Even if it's not what we would do, that should be allowed.
The approach of separating ServiceCollection and ServiceProvider where ServiceProvider is immutable solves a number of these problems. It's not possible to re-register things in some bizarre combination. You could create a new ServiceCollection that closes of some other existing ServiceProvider, but that is a very bad idea and I'd argue "you're doing it completely wrong.". 😆
2.
A circular dependency loop is definitely a possibility - unfortunately. Validating or being able to detect this is worth trying to support.
3.
The exact behavior can vary, but in most cases this will be handled via ServiceProvider.get_required::<T>() which will panic with an error message that will indicate, to the best of Rust's ability, the type that could not be resolved (see this test). Every object is constructed via a ServiceFactory callback function. A constructor function isn't required for things to work, you only need to define a closure which knows how to create the object.
The behavior is slightly different when you use the inject feature with the code generation macro. In this scenario, the macro has to know the call site to use for construction. Since Rust doesn't support method overloading, this makes establishing a convention straight forward. The macro will look for a function called new. It doesn't even need to be pub since the macro will implement Injectable for the struct itself (which is allowed to call a private function). If you don't like or can't use that convention, then you can decorate the desired activator function with #[inject] which will tell the macro which call site to use. #[inject] supersedes new if both are defined.  If neither of these are satisfied or there is more than one function decorated with #[inject] the macro panics, which results in a compile-time error.
4.
I'm not sure I 100% follow this one. A trait can only be implemented by a struct exactly once. You can naturally have multiple, different structs implement the same trait. I think you may be asking, "What happens if multiple registrations are performed, but I only expect one?". Currently, this has the same behavior as replace, which will use the last registration, when a single instance is requested.
I think it may  have to work this way because it is technically valid for both call sites to exist together:
trait Foo;

struct Bar {
  foo: Rc<dyn Foo>
}

impl Bar {
  fn new(foo: Rc<dyn Foo>) -> Self {
    Self { foo }
  }
}

struct Bar2 {
  foos: Vec<Rc<dyn Foo>>
}

impl Bar2 {
  fn new(foos: Vec<Rc<dyn Foo>>) -> Self {
    Self { foos }
  }
}

In this scenario, Bar gets the last registered service for dyn Foo, but Bar2 gets all registered dyn Foo services.
5.
So far I haven't been able to discover any serious ownership issues. This was one of the first challenges in making anything work. Ultimately, everything is some form of Rc. A Transient is always created new from ServiceProvider and is never owned by it. This means it is dropped as soon as the caller is done with with. A Singleton is created once by ServiceProvider and an incremented count is returned via Rc.clone(). This is almost the same behavior for Scoped. The difference between Scoped and Singleton is that Scoped are recreated in the ServiceProvider in each new scope. When that ServiceProvider is dropped, everything else is dropped/decremented. Naturally, this can cause a memory leak, but not in some special way that ServiceProvider introduces. Typically, at the point where ServiceProvider is being dropped, everything else in the same scope (root or otherwise) is also being dropped.

2.0.1 has now be released, which includes support for validation. The build_provider() now returns Result<ServiceProvider, ValidationError>.
Mapping to the rules above:

A singleton cannot have a scoped service dependency (transient is an odd case, but allowed)
Circular dependencies are not allowed
A required, unregistered type is not allowed
a. An optional, unregistered type is allowed
b. There are no constructors and you always have to map a factory function to create types
Ambiguous traits are not an issue
There are no ownership issues:
a. A references are read-only and Rc, Arc, or ServiceRef (which is an convenient alias)
b. Collections of the same service type are projected into a Vec per injection call site

I believe that covers all the scenarios. Feel free to share other scenarios if you have them.

I believe all the validation scenarios are now covered in some form or another. Thanks for the suggestions. If you have more, keep them coming.


Fix issues created by types refactor

After a type refactor some issues were introduced into development environment. This issues prevented from submitting a transaction and lead to an app crash when loading a safe for the first time.
Changes were removed from development and we created a new branch in order to debug and fix this two issues before adding this refactor again

Tried different type of tx in dev, making sure it works now and doesn't crash the site

Send funds
Send collectibles
Apps tx (compound, sablier)
Tx Rejection

Tried with MM extension, MM via WalletConnect, Trezor, Ledger.
Didn't had any issues. It looks good to me


Cookies deleted after browser closes?

Awesome app for the Gear2. Is it deleting cookies after the browser closes? If so, could the cookies continue to exist after the app closes?

Hello,
I think it seems to be tizen platform issue.
So I sent an inquiry about this issue to platform team.
When I give a comment from platform, I'll apply for it.
Thank you.

I got a reply from tizen platform team.
Keeping cookies is not supported on Tizen 2.3.2. But it will be supported on Tizen 3.0.
So I will fix it after Tizen 3.0 is released.
Thank you.

Awesome. Thanks for following up
On Oct 15, 2016 12:13 AM, "fin10"<EMAIL_ADDRESS>wrote:

I got a reply from tizen platform team.
Keeping cookies is not supported on Tizen 2.3.2. But it will be supported
on Tizen 3.0.
So I will fix it after Tizen 3.0 is released.
Thank you.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fin10/GearBrowser/issues/1#issuecomment-253963647,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQOOa4y-jqFaKohbpLsLe5hZ6hAvSCK-ks5q0GDugaJpZM4KR4SK
.

--
DISCLAIMER: http://www.cityoflewisville.com/index.aspx?page=905

I haven't tested trying localstorage instead of cookies. I'll try to test
whether that option is available
On Oct 15, 2016 9:53 AM, "Jason Kirkland"<EMAIL_ADDRESS>wrote:

Awesome. Thanks for following up
On Oct 15, 2016 12:13 AM, "fin10"<EMAIL_ADDRESS>wrote:

I got a reply from tizen platform team.
Keeping cookies is not supported on Tizen 2.3.2. But it will be supported
on Tizen 3.0.
So I will fix it after Tizen 3.0 is released.
Thank you.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/fin10/GearBrowser/issues/1#issuecomment-253963647,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQOOa4y-jqFaKohbpLsLe5hZ6hAvSCK-ks5q0GDugaJpZM4KR4SK
.

--
DISCLAIMER: http://www.cityoflewisville.com/index.aspx?page=905


AuthZ: Combine should ignore null policies

Fixes https://github.com/aspnet/Security/issues/1764 and https://github.com/aspnet/Mvc/issues/7809
cc @Tratcher @ajcvickers
I'll file a separate PR that adds a test for this scenario in MVC that depends on this PR to pass

We've decided to leave this behavior alone, since we will fix the MVC issue that was resulting in trying to combine null policies


Does tantivy support Phonetic Matching or any plan to support it

i Apache lucene even does not have this feature but. if tantivy supported this of the box it would be optimal and would be beyond what the lucene could do
in a bank we use lucene to find duplicate customer by name and fuzzy query does not help here
https://lucene.apache.org/solr/guide/6_6/phonetic-matching.html

Closing.


Can't install extension

error message saying "the applescript included cannot be open with Unicode text encoding" and I have no clue what I can do. Help needed.

You must save your AppleScript as an .applescript text file.
.scpt file will not load.

On 2 Apr 2018, at 13:00, Canor<EMAIL_ADDRESS>wrote:
error message saying "the applescript included cannot be open with Unicode text encoding" and I have no clue what I can do. Help needed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Oh so .applescript wasn't the deprecated name for applescript extension. I thought applescript changed its extension name from .applescript to .scpt something. Thanks for the help!

That's right, they are different file formats.


Fix to leave an access log when the response is sent

Motivation:
In certain circumstances, such as HttpRequest is not properly subscribed and request timeout happens,
the access log is not recorded when the response is sent.
It's recorded later when the original response is completed.
Modification:

Call RequestLogBuilder.endRequest() also when the response is sent.

Result:

You can see the access log right away when the response is sent.

Thanks for reviewing!

Thanks for reviewing!


WIP: Improvements for Markers & Paths

This marks the beginning of some changes to the PathingService and other supporting classes needed for the Markers & Paths module.
To reduce the amount of abstraction on abstraction on abstraction on abstraction, we'll be pulling the pathing specific details out of the core codebase and into the Markers & Paths module.  This should reduce complexity, allow for faster interactive changes to the Markers & Paths module, and allow for a simplification to entities needed in the core codebase to help facilitate multiple worlds which have their own transforms (such as World and MiniMap).
This change does break the Markers & Paths module (as will many upcoming changes to the pathing service).  These first several changes are primarily to help with the addition of several new attributes (Festival, Profession, Specialization, Race, and potentially IsCommander).

I think I'm going to pull all of this into the Markers & Paths module first and then delete the pathing service instead of trying to do both at the same time.


Fixing Hydrology model to work with LayerStructure

This is a WIP PR to adapt the hydrology model and tests to use the revised LayerStructure.
@vgro - I haven't merged in #441 yet, so this was pushed without verify and there are a bunch of mypy complaints. My thinking here was that I wanted you to see just the changes I've made to get a feel for them, before they get a bit hidden when the LayerStructure implementation changes come in.
When I run these changes locally with the changes in #441, nearly all the test pass, but test_hydrology_model/test_setup fails and so does test_hydrology_tools.py::test_setup_hydrology_input_current_timestep
Fixes #444 (issue)
Type of change

[ ] New feature (non-breaking change which adds functionality)
[ ] Optimization (back-end change that speeds up the code)
[ ] Bug fix (non-breaking change which fixes an issue)

Key checklist

[ ] Make sure you've run the pre-commit checks: $ pre-commit run -a
[ ] All tests pass: $ poetry run pytest

Further checks

[ ] Code is commented, particularly in hard-to-understand areas
[ ] Tests added that prove fix is effective or that feature works

@vgro With the last commit,  all of the Hydrology tests now pass. You can see the specific alterations here (since your changes and excluding the merge up of the base branch #421):
https://github.com/ImperialCollegeLondon/virtual_ecosystem/compare/0abf176...444-fixing-hydrology-for-421
Main things:

The test of which variables are returned in test_setup_hydrology_input_current_timestep was not working as expected. I've updated the test so it checks the returned and expected variable names match, but had to edit the expected list. Are those correct?

In hydrology_tools.setup_hydrology_input_current_timestep, the new code was returning 2D arrays for the surface layers, which was inconsistent with some of the other surface layer variables. The example I found was in the section below where the two variables being averaged had different dimensions - the river_discharge_rate entries were (n_cells,) but the aerodynamic_resistance_surface entries came via wind_speed and the surface variables and were (1, n_cells).

https://github.com/ImperialCollegeLondon/virtual_ecosystem/blob/15268a5c8aaa66b36135602dcf6c7a47aeeaed1a/virtual_ecosystem/models/hydrology/hydrology_model.py#L660-L665

I've explicitly reshaped HydrologyModel.soil_layer_thickness to be (n_soil_layers, n_cells) - I think all of the use cases needed it to be at least rotated to a vertical array and it seemed sensible just to make it explicitly 2D and broadcast to cells. One outcome of that is that I've simplified the calculation of soil_moisture to only handle float values for init_soil_moisture - at present the model __init__ can only take a float value here from config, so that seemed sane. We may want to make initial_soil_moisture a data variable at some point, and then things change.

Problems!
The the test values in test_hydrology_model.py::test_setup have changed. I've substituted the reported values into the tests to check the testing mechanics all work but don't have insight into why these values have changed.
I've kept the old values as comments from comparison, if you can review these values and see where I've wrecked it, that would be great. Then we're done with this branch, I think!

@vgro With the last commit, all of the Hydrology tests now pass. You can see the specific alterations here (since your changes and excluding the merge up of the base branch #421):
0abf176...444-fixing-hydrology-for-421
Main things:
* The test of which variables are returned in `test_setup_hydrology_input_current_timestep` was not working as expected. I've updated the test so it checks the returned and expected variable names match, but had to edit the expected list. Are those correct?

* In `hydrology_tools.setup_hydrology_input_current_timestep`, the new code was returning 2D arrays for the surface layers, which was inconsistent with some of the other surface layer variables. The example I found was in the section below where the two variables being averaged had different dimensions - the `river_discharge_rate` entries were `(n_cells,)` but the `aerodynamic_resistance_surface` entries came via `wind_speed` and the surface variables and were `(1, n_cells)`. I've now squeezed these variables so they are `(n_cells,)`.

https://github.com/ImperialCollegeLondon/virtual_ecosystem/blob/15268a5c8aaa66b36135602dcf6c7a47aeeaed1a/virtual_ecosystem/models/hydrology/hydrology_model.py#L660-L665
* I've explicitly reshaped `HydrologyModel.soil_layer_thickness_mm` to be `(n_soil_layers, n_cells)` - I think all of the use cases needed it to be at least rotated to a vertical array and it seemed sensible just to make it explicitly 2D and broadcast to cells. One outcome of that is that I've simplified the calculation of `soil_moisture` to only handle float values for `init_soil_moisture` - at present the model `__init__` can only take a float value here from config, so that seemed sane. We may want to make `initial_soil_moisture` a data variable at some point, and then things change.

~Problems!~
~The the test values in test_hydrology_model.py::test_setup have changed. I've substituted the reported values into the tests to check the testing mechanics all work but don't have insight into why these values have changed.~
~I've kept the old values as comments from comparison, if you can review these values and see where I've wrecked it, that would be great. Then we're done with this branch, I think!~
The 'problem' is that the fixture_core_components.layer_structure.soil_layers is [-0.25, -1. ] is inconsistent with the depths set in dummy_climate_data at [-0.5, -1.0]. If I match those up, it works with the original values with minor tweaks for the new 4th cell.

LGTM, few minor points, then you can merge it:

the variable names are not all correct, it should be soil_moisture not soil_moisture_mm, see inline comment. The layer related variables can be deleted.

The 2D arrays for surface values are meant to be 1D and I'm happy with the squeeze option if that is the best way to deal with it.

The idea behind arrays for initial_soil_moisture was that different grid cells might have different initial values, for example if we put in an external dataset. But this is not happening anytime soon, and like you said the it's not setup, so limiting this to float is fine.

New returned values in test_hydrology_model.py::test_setup are correct, you can delete the values in comments.

Jeepers - had the base for the merge set to develop and nearly bypassed protections to merge it into that.
Right. Anyway,  all the tests for the hydrology model now pass locally, so this branch has done its job of fixing this up for #421 and I'll merge it down.


chore: screenshots in docker

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 79.67%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
6679

Relevant Lines:
7652

💛  - Coveralls


Quasi-random numbers

Related to avoiding rectangular grids (see #33) one of the ingredients would be to have Sobol-Antonov-Saleev quasi-random numbers which have good space-filling properties as noted by @gpetruc. There is a particularly nice feature of this algorithm because it can start anywhere in the sequence (Numerical Recipes, Sec7.7):

Note that we have not provided the routine sobseq with a means of starting the sequence at a point other than the beginning, but this feature would be easy to add. Once the initialisation of the direction numbers iv has been done, the jth point can be obtained directly by XORing together those direction numbers corresponding to nonzero bits in the Gray code of j, as described above.

After discussing with Lorenzo, this is something that the ROOT team was already planning to get on the ground and they'll let us know when it is ready for testing.

FWIW, I just realised (because of a different application) that [ROOT now has quasi-random numbers].


dsub with a shared VPC

Now that we can use dsub with a VPC (related issue #111), can we use dsub with a shared VPC?

Hi Joe,
Can you explain more about the use-case? What is it that you are trying to accomplish.
Is there something that you have tested that fails?
Thanks.

Sure can.  We’ve recently moved to a infrastructure where we have a hosting GCloud project that has a VPC with a VPN tunnel to our organization.  We then share this VPC out to other projects, this way we don’t have to setup a VPN tunnel with every new project and it can be centrally managed.   While it’s true that our dsub VMs almost never would need to access back to our organizations network so you would think we could just use a project only VPC for dsub.  However due to reasons beyond our control (security requirements/central management/etc) we’re asked to use a specific shared subnet in a shared VPC for these types of jobs.
From what little I understand, shared network/subnets are listed and specified differently than how you would for a norma project’s VPCs, as you have to specify the host project e.g. to create a instance:
gcloud compute instances create [INSTANCE_NAME]
--project [SERVICE_PROJECT_ID]
--subnet projects/[HOST_PROJECT_ID]/regions/[REGION]/subnetworks/[SUBNET]
--zone [ZONE]
From: Matt Bookman<EMAIL_ADDRESS>Sent: Thursday, November 29, 2018 12:44 PM
To: DataBiosphere/dsub<EMAIL_ADDRESS>Cc: Slagel, Joseph L<EMAIL_ADDRESS>Author<EMAIL_ADDRESS>Subject: Re: [DataBiosphere/dsub] dsub with a shared VPC (#137)
Hi Joe,
Can you explain more about the use-case? What is it that you are trying to accomplish.
Is there something that you have tested that fails?
Thanks.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_DataBiosphere_dsub_issues_137-23issuecomment-2D442986217&d=DwMCaQ&c=KoC5GYBOIefzxGAm2j6cjFf-Gz7ANghQIP9aFG9DuBs&r=wItZQv9607iYGyuIVq_Pk3Qr-Yy3oS1MW_vcxPgKYrE&m=DdWniaCxDsvhU3peB8hiwluK_iBMG25Rja5b6OQv0HE&s=7L_-zqv9nljiyfxHpp7lHXdQz25MUYr_So5LVBtv8Ks&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AKBQyDxC7Q-5FI-2Dpro67UVYdtmPTPnX3rpks5u0EcLgaJpZM4Y6c1b&d=DwMCaQ&c=KoC5GYBOIefzxGAm2j6cjFf-Gz7ANghQIP9aFG9DuBs&r=wItZQv9607iYGyuIVq_Pk3Qr-Yy3oS1MW_vcxPgKYrE&m=DdWniaCxDsvhU3peB8hiwluK_iBMG25Rja5b6OQv0HE&s=022nZhzgvqqdUvKdhO3ZPVrLA5cDKU2JttRkzSzTrsU&e=.

This message is intended for the sole use of the addressee, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the addressee you are hereby notified that you may not use, copy, disclose, or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete this message.

Thanks for the details.
Have you manually created an instance in the target project?
If that is successful, have you tried passing the full projects/[HOST_PROJECT_ID]/regions/[REGION]/subnetworks/[SUBNET] to dsub with the --subnetwork flag? If so, what happened?

Working on it.  I tried the long subnetwork flag and it didn’t work but I want to confirm I can create a instance via the command line and long flag first and then I’ll try again.
From: Matt Bookman<EMAIL_ADDRESS>Sent: Thursday, November 29, 2018 1:50 PM
To: DataBiosphere/dsub<EMAIL_ADDRESS>Cc: Slagel, Joseph L<EMAIL_ADDRESS>Author<EMAIL_ADDRESS>Subject: Re: [DataBiosphere/dsub] dsub with a shared VPC (#137)
Thanks for the details.
Have you manually created an instance in the target project?
If that is successful, have you tried passing the full projects/[HOST_PROJECT_ID]/regions/[REGION]/subnetworks/[SUBNET] to dsub with the --subnetwork flag? If so, what happened?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_DataBiosphere_dsub_issues_137-23issuecomment-2D443006216&d=DwMFaQ&c=KoC5GYBOIefzxGAm2j6cjFf-Gz7ANghQIP9aFG9DuBs&r=wItZQv9607iYGyuIVq_Pk3Qr-Yy3oS1MW_vcxPgKYrE&m=oGTIl6Wvyi7KA5c0IJhWqnJ1FmkH8b1yXasPMz3aLHg&s=B5k_NVX0EiPjDpt0VS-O4wSzCV0_iaw4VKR2RxT0bnA&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AKBQyHaUnnZii27IhwzpWJFR2piqFL0Tks5u0FaOgaJpZM4Y6c1b&d=DwMFaQ&c=KoC5GYBOIefzxGAm2j6cjFf-Gz7ANghQIP9aFG9DuBs&r=wItZQv9607iYGyuIVq_Pk3Qr-Yy3oS1MW_vcxPgKYrE&m=oGTIl6Wvyi7KA5c0IJhWqnJ1FmkH8b1yXasPMz3aLHg&s=SWYWZroZHZOvV2vuQqJZLFbtnDNP7p292p1xQoGxGjk&e=.

This message is intended for the sole use of the addressee, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the addressee you are hereby notified that you may not use, copy, disclose, or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete this message.

Ok, so I confirmed that the full projects/[HOST_PROJECT_ID]/regions/[REGION]/subnetworks/[SUBNET] works for Google Genomics, but doesn't seem to work with dsub version: 0.2.3.  You get back a job id suggesting the job started but then no VMs start up and dstat doesn't show anything is running.
Can you get the operation id with:
dstat ... --full | grep internal-id

and then pass the internal-id value to:
gcloud alpha genomics operations describe <id>

and I'd be curious if then events section of
dstat ... --full

reflects what the underlying operation indicates is occurring.

Sure thing.  But when I run dstat I get:
2018-12-05 17:44:07.054968: Exception HttpError: <HttpError 503 when requesting https://genomics.googleapis.com/v2alpha1/projects/XXXXX/operations?filter=%28labels.%22user-id%22+%3D+%22joe%22%29+AND+%28labels.%22job-id%22+%3D+%22echo--joe--181205-174312-38%22%29&alt=json&pageSize=128 returned "The service is currently unavailable.">
Retrying...

However listing the operations revealed the problem (which was on my part):
gcloud alpha genomics operations list

"Execution failed: creating instance: inserting instance: Invalid value\
    \ for field 'resource.networkInterfaces[0].network': 'projects/XXXXX/regions/us-east1/YYYYY'.\
    \ The URL is malformed."

Fixing the network/subnetwork as follows I'm happy to report works:
    --network projects/XXXXX/global/networks/YYYYY  \
    --subnetwork projects/XXXXX/regions/us-east1/subnetworks/ZZZZZZ

However the dstat command is still reporting the service as unavailable.

Hi Joe,
Does the dstat error persist?
Are you able to run dstat for other tasks? Other projects?
I'll file a bug with the Pipelines API if operations.list is returning a 503 for a specific request.
dstat is presently working for me.
Thanks,
-Matt

Thanks for discovering, Joe, that dsub works with a shared VPC.
Going to close this. The remaining issue that you are running into is a Pipelines API issue that the Cloud Health team is working to fix.


Added an additional argument move_forward_only to prohibit backward l…

This PR is the resolution for #330 .
If you set:
move_forward_only:=true
TB3 goes from the wheel base side only (no backward locomotion).

Great! Thank you for your contribution! :)


Add water quality data to site model and use it to power site filter

fix https://github.com/aqualinkorg/aqualink-app/issues/1026
/claim #1026
Add waterQuality to site model that would include list of water quality metrics.
The logics to determine water quality metrics is from https://github.com/aqualinkorg/aqualink-app/blob/56dbb9c8a3115699ab74c97bf53e1962a67cf82e/packages/website/src/common/SiteDetails/index.tsx#L157-L174
which looks at LatestData entity (and forecast data, omitted by now) and check if they have hui source or enough sonde metrics.
If this is the correct direction, I can work on a follow up to remove the checks in frontend and consolidate to the backend, so we have single source of truth. This also avoid multiple data fetching to get water quality data

I think it might be due to GitHub protections around variables for external contributors... It's super annoying. Let me add you to the repo if that's ok with you?

I think PR has to be opened in this repo (not in forks) for API CI to pass, like https://github.com/aqualinkorg/aqualink-app/pull/1075. I'll recrease this PR


Usage parsing and generation should match docopt

 Issue by epage
Tuesday Oct 26, 2021 at 20:53 GMT
Originally opened as https://github.com/clap-rs/clap/issues/2951

Affected Version of clap
3.0.0-beta.4
Expected Behavior Summary
App:from parses according to http://docopt.org/
App::render_usage generates output that matches http://docopt.org/
Actual Behavior Summary
At least with "required", we are using <> instead of ()
See https://github.com/clap-rs/clap/discussions/2947
Notes

Can we do develop this behind a feature flag?

Avoid this having to be done in a breaking-change-specific branch, pushing towards large, big releases
Allow people to opt-in to it early and start collecting feedback

Should we stablize the usage generation separate from usage parsing?   Its not a breaking change but having them match probably helps the person using App::from
Can we support parsing both grammars at once?  This would let us stablize parsing and give people room to transition

 Comment by pksunkara
Tuesday Oct 26, 2021 at 21:04 GMT

What does docopt generate?
How do we differ from it?
Why do we think docopt is correct in those instances?

 Comment by epage
Tuesday Oct 26, 2021 at 21:16 GMT

What does docopt generate?

DocOpt is a convention for describing usage syntax, especially for creating arg parsers off of it.

How do we differ from it?

As mentioned in the Issue, we at least differ in syntax for required (<> vs ()).  I've not exhaustively looked at where else we might differ, I see that as part of resolving this issue.  I have a tiny hope that there is some kind of conformance suite ("tiny" because I see that being difficult).

Why do we think docopt is correct in those instances?

I believe @kbknapp said that the goal of App::from was to have an API similar to the docopt crate.  That crate, while unmaintained, was an implementation of docopt.   So by extension, clap is already meaning to support http://docopt.org/
The other benefit is the closer we are to a common syntax, the more likely people will be able to translate existing knowledge when programming in Rust which makes them more successful faster and are less reliant on how perfect / complete our documentation is.
If we decide docopt support isn't important, or if usage and parser can diverge, I'm fine with that.  I'm more so just describing how I see the situation.  Personally, I'll never use the docopt parser and the usage generation is good enough.

 Comment by kbknapp
Tuesday Oct 26, 2021 at 21:37 GMT

I could be wrong and misremembering, but I thought I remembered @BurntSushi mentioning once that there either wasn't a real spec, or it wasn't clear?
One the main issues and why I never fully pursued this further was docopt I believe relies on "whole document" information to infer some settings for arguments and goes through great lengths to make good guesses. clap's "usage parsing" is much more strict, but also tried to encode things that docopt has no concept of.
Ultimately, this was something I felt could be better handled by a crate wrapping clap, than clap itself. Like our derive and generating crates, I wouldn't mind them being part of this org, but a true docopt implementation is too much for clap proper.

 Comment by pksunkara
Tuesday Oct 26, 2021 at 21:46 GMT

So, there are two things here.

Is docopt the convention? Is there a spec for this or can we interpolate it by examining how existing non-docopt based tools behave?
Usage parser in clap.

For the second item, I think we are all aligned that it can be a separate crate. I personally don't mind either but it might be difficult because we would want to implement impl From<&str> for Arg in that crate and rust doesn't allow it IIRC. Anyway, that can be a separate discussion later on.
Let's focus this issue on the first item.
I personally think docopt is not the convention and <> actually conveys that it is required better than ().

I've not exhaustively looked at where else we might differ, I see that as part of resolving this issue.

I asked the question for future so that we can actually do that when we work on this.

 Comment by kbknapp
Tuesday Oct 26, 2021 at 22:59 GMT

it might be difficult because we would want to implement impl From<&str> for Arg in that crate and rust doesn't allow it IIRC

Correct. For that exact method we'd have to create and expose some kind of IntoArg trait. However, there is nothing preventing a crate from doing this without traits and just a bare function fn docopt_to_clap(&str) -> App. Is that optimal? No, not exactly. But at least for the experimentation phase and such it's perfectly fine.

 Comment by 0x7FFFFFFFFFFFFFFF
Wednesday Oct 27, 2021 at 00:31 GMT

I personally think docopt is not the convention and <> actually conveys that it is required better than ().

What do you think of {}?

 Comment by kbknapp
Wednesday Oct 27, 2021 at 00:58 GMT

What do you think of {}?

The only specification I've seen only says, (paraphrasing) "square brackets [] mean an argument is optional. Lack of square brackets mean the argument is required in that synopsis."
I've anecdotally seen <> or no brackets convey meaning the argument is required in 99% of all circumstances. I'd argue against anything beyond either of those options. And the no-brackets version sometimes has parsing difficulties when writing a general parser. The reason clap originally used <> (beyond it being a decently common convention) is it helps disambiguate positional arguments from subcommands.

 Comment by epage
Wednesday Oct 27, 2021 at 02:24 GMT

Ultimately, this was something I felt could be better handled by a crate wrapping clap, than clap itself. Like our derive and generating crates, I wouldn't mind them being part of this org, but a true docopt implementation is too much for clap proper.

I only had in mind getting ours more inline with docopt.  Are you suggesting we split our existing usage parser into its own crate or if someone wanted a to go full docopt?

 Comment by BurntSushi
Wednesday Oct 27, 2021 at 12:37 GMT

It's been a long time since I've even thought about docopt, but IIRC, docopt.org is pretty much the only thing that exists for a spec. I remember following that and the test cases for the reference implementation.
IMO, this is a great piece of "fat" that could be trimmed from Clap.
It's also worth noting that the docopt project itself (not just the docopt Rust library) has been effectively unmaintained for many years.

 Comment by epage
Friday Oct 29, 2021 at 16:38 GMT

IMO, this is a great piece of "fat" that could be trimmed from Clap.

What are thoughts on deprecating the usage parser for 3.0, like we did the macro API?

We'd want to revert the API changes since that is unnecessary churn.

 Comment by pksunkara
Friday Oct 29, 2021 at 16:41 GMT

I have seen quite a high number of people use it. Every alternate issue that we get seems to use it. Maybe we can mark it as deprecated (without reverting changes) but offer it as a side crate later?

 Comment by epage
Friday Oct 29, 2021 at 16:52 GMT

Thanks for the input on its usage.
If we do anything but plan to keep it as-is long term, we should revert the 3.0 API changes to reduce churn for those using it.

 Comment by pksunkara
Friday Oct 29, 2021 at 16:57 GMT

After 3.0, maybe we can do some metric collection and then decide on it?

 Comment by epage
Friday Oct 29, 2021 at 17:00 GMT

The only easy form of metric collection is crates..io.  This is why I've been curious about the idea of breaking out each API into a distinct crate so we actually know what people use.  Not saying its a great idea, it optimizes for one case but pessimizes for others.

 Comment by pksunkara
Friday Oct 29, 2021 at 17:06 GMT

Agree, We can definitely explore in that direction after 3.0

 Comment by epage
Friday Oct 29, 2021 at 17:13 GMT

If we are looking to radically change the API after 3.0, should we revert the API changes we did make?

It leads to extra churn for the users
The 3.0 API is a lot harder to search for because its implicit (implemented in From and the API accepts impl Into)

 Comment by epage
Tuesday Nov 09, 2021 at 01:19 GMT

As an alternative, what if we expose a subset of clap_app!, as clap_arg!, to provide compile-time usage parsing as a replacement for runtime usage parsing?