Add a 'viewsWelcome' to suggest creating a new F# project

@happypig375 wondered why we couldn't suggest creating an F# project on the following view:

This turns out to be pluggable in vscode, via the contributes.viewsWelcome extension point.  We should consider adding a suggestion here, something of the form:
{
  "contributes": {
    "viewsWelcome": [
      {
        "view": "explorer",
        "contents": "You can also open a folder containing an F# solution, or create a new F# project by clicking the button below.\n[Create F# Project](command:fsharp.NewProject)",
        "when": "workbenchState == empty" // TBD the appropriate condition here
      }
    ]
  }
}

This should be pretty simple since we already have the 'new project' command, we just need to wire it up.

uh, it's actually hard. we need a 'rootpath' to invoke the dotnet cli in, and programmatically setting that is more difficult than I imagined. even then, if we do set it, we probably need to re-trigger the initialization routines after the project is added, because it would mean the creation of a new workspace.


Improve documentation

Improve the documentation to provide 100% functionality coverage.

Good idea, PRs are welcome !

@joelwurtz I will try to do some work after I get a better understanding of it all. For now, could you provide an example how I can open container ports resulting in <IP_ADDRESS>:32775->80/tcp?

ExposedPorts will only indicate that you expose a port on the container but it does nothing at docker level (it is used when linking containers for env variable and host alias)
If this is what you want, i think the right way would be to do the following :
$containerConfig = new ContainerConfig();
$exposedPorts = new \ArrayObject();
$exposedPorts['80/tcp'] = new \stdClass();
$containerConfig->setExposedPorts($exposedPorts);

I don't have any informations on the object needed by the key as even the docker documentation tell us nothing (see https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/#create-a-container). Need to dig into the source code of docker to know what config / options are available...
However if you want to do host port mapping (and not only exposition inside container), you should use the setPortsBindings method on the HostConfig object for the container config
$containerConfig = new ContainerConfig();
$hostConfig = new HostConfig();
$mapPorts = new \ArrayObject();

$hostPortBinding = new PortBinding();
$hostPortBinding->setHostPort('32775');
$hostPortBinding->setHostIp('<IP_ADDRESS>');

$mapPorts['80/tcp'] = $hostPortBinding;
$hostConfig->setPortBindings($mapPorts);
$containerConfig->setHostConfig($hostConfig);

A good step for documentation would be first to add a description on each field in the swagger schema.

@joelwurtz Thank you for your help so far, I appreciate it.
I still encounter an exception; my resulting ContainerConfig object is as follows:
The stack trace doesn't mention a lot.
...
"trace": [
      {
        "file": "/con/data/http/root/vendor/php-http/plugins/src/ErrorPlugin.php",
        "line": 27,
        "function": "transformResponseToException",
        "class": "Http\Client\Plugin\ErrorPlugin",
        "type": "->",
        "args": [
          {},
          {}
        ]
      },
      {
        "file": "/con/data/http/root/vendor/php-http/promise/src/FulfilledPromise.php",
        "line": 35,
        "function": "Http\Client\Plugin\{closure}",
        "class": "Http\Client\Plugin\ErrorPlugin",
        "type": "->",
        "args": [
          {}
        ]
      },
      {
        "file": "/con/data/http/root/vendor/php-http/plugins/src/ErrorPlugin.php",
        "line": 28,
        "function": "then",
        "class": "Http\Promise\FulfilledPromise",
        "type": "->",
        "args": [
          {}
        ]
      },
      {
        "file": "/con/data/http/root/vendor/php-http/plugins/src/PluginClient.php",
        "line": 133,
        "function": "handleRequest",
        "class": "Http\Client\Plugin\ErrorPlugin",
        "type": "->",
        "args": [
          {},
          {},
          {}
        ]
      },
      {
        "file": "/con/data/http/root/vendor/php-http/plugins/src/PluginClient.php",
        "line": 147,
        "function": "Http\Client\Plugin\{closure}",
        "class": "Http\Client\Plugin\PluginClient",
        "type": "->",
        "args": [
          {}
        ]
      },
      {
        "file": "/con/data/http/root/vendor/php-http/plugins/src/PluginClient.php",
        "line": 87,
        "function": "Http\Client\Plugin\{closure}",
        "class": "Http\Client\Plugin\PluginClient",
        "type": "->",
        "args": [
          {}
        ]
      },
      {
        "file": "/con/data/http/root/vendor/docker-php/docker-php/src/DockerClient.php",
        "line": 41,
        "function": "sendRequest",
        "class": "Http\Client\Plugin\PluginClient",
        "type": "->",
        "args": [
          {}
        ]
      },
      {
        "file": "/con/data/http/root/vendor/docker-php/docker-php/generated/Resource/ContainerResource.php",
        "line": 76,
        "function": "sendRequest",
        "class": "Docker\DockerClient",
        "type": "->",
        "args": [
          {}
        ]
      },
...

Docker\API\Model\ContainerConfig Object
(
    [id:protected] =>
    [names:protected] =>
    [image:protected] => drsect0r/server/nginx:1.0
    [command:protected] =>
    [created:protected] =>
    [status:protected] =>
    [ports:protected] =>
    [labels:protected] =>
    [sizeRw:protected] =>
    [sizeRootFs:protected] =>
    [hostname:protected] =>
    [domainname:protected] =>
    [user:protected] =>
    [attachStdin:protected] =>
    [attachStdout:protected] =>
    [attachStderr:protected] =>
    [tty:protected] =>
    [openStdin:protected] =>
    [stdinOnce:protected] =>
    [env:protected] =>
    [cmd:protected] =>
    [entrypoint:protected] =>
    [mounts:protected] =>
    [workingDir:protected] =>
    [networkDisabled:protected] =>
    [macAddress:protected] =>
    [exposedPorts:protected] =>
    [networkSettings:protected] =>
    [hostConfig:protected] => Docker\API\Model\HostConfig Object
        (
            [binds:protected] =>
            [links:protected] => Array
                (
                    [0] => drsect0r.server.php-fpm.f529272d
                )

            [lxcConf:protected] =>
            [memory:protected] =>
            [memorySwap:protected] =>
            [cpuShares:protected] =>
            [cpuPeriod:protected] =>
            [cpusetCpus:protected] =>
            [cpusetMems:protected] =>
            [blkioWeight:protected] =>
            [blkioWeightDevice:protected] =>
            [blkioDeviceReadBps:protected] =>
            [blkioDeviceReadIOps:protected] =>
            [blkioDeviceWriteBps:protected] =>
            [blkioDeviceWriteIOps:protected] =>
            [memorySwappiness:protected] =>
            [oomKillDisable:protected] =>
            [portBindings:protected] => ArrayObject Object
                (
                    [storage:ArrayObject:private] => Array
                        (
                            [80/tcp] => Docker\API\Model\PortBinding Object
                                (
                                    [hostPort:protected] => 1004
                                    [hostIp:protected] => <IP_ADDRESS>
                                )

                        )

                )

            [publishAllPorts:protected] =>
            [privileged:protected] =>
            [readonlyRootfs:protected] =>
            [dns:protected] =>
            [dnsSearch:protected] =>
            [extraHosts:protected] =>
            [volumesFrom:protected] => Array
                (
                    [0] => drsect0r.data.files.f529272d
                )

            [capAdd:protected] =>
            [capDrop:protected] =>
            [restartPolicy:protected] =>
            [networkMode:protected] =>
            [devices:protected] =>
            [ulimits:protected] =>
            [securityOpt:protected] =>
            [logConfig:protected] =>
            [cgroupParent:protected] =>
        )

)

The exception should have a Reponse Object which contains the reason of the failure, can you show it ?
Also you can activate / view logs on your docker server to see the errors on the api

[2016-02-09 14:56:47] lumen.ERROR: Http\Client\Plugin\Exception\ServerErrorException: Internal Server Error in /con/data/http/root/vendor/php-http/plugins/src/ErrorPlugin.php:49
Stack trace:
#0 /con/data/http/root/vendor/php-http/plugins/src/ErrorPlugin.php(27): Http\Client\Plugin\ErrorPlugin->transformResponseToException(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /con/data/http/root/vendor/php-http/promise/src/FulfilledPromise.php(35): Http\Client\Plugin\ErrorPlugin->Http\Client\Plugin\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /con/data/http/root/vendor/php-http/plugins/src/ErrorPlugin.php(28): Http\Promise\FulfilledPromise->then(Object(Closure))
#3 /con/data/http/root/vendor/php-http/plugins/src/PluginClient.php(133): Http\Client\Plugin\ErrorPlugin->handleRequest(Object(GuzzleHttp\Psr7\Request), Object(Closure), Object(Closure))
#4 /con/data/http/root/vendor/php-http/plugins/src/PluginClient.php(147): Http\Client\Plugin\PluginClient->Http\Client\Plugin\{closure}(Object(GuzzleHttp\Psr7\Request))
#5 /con/data/http/root/vendor/php-http/plugins/src/PluginClient.php(87): Http\Client\Plugin\PluginClient->Http\Client\Plugin\{closure}(Object(GuzzleHttp\Psr7\Request))
#6 /con/data/http/root/vendor/docker-php/docker-php/src/DockerClient.php(41): Http\Client\Plugin\PluginClient->sendRequest(Object(GuzzleHttp\Psr7\Request))
#7 /con/data/http/root/vendor/docker-php/docker-php/generated/Resource/ContainerResource.php(76): Docker\DockerClient->sendRequest(Object(GuzzleHttp\Psr7\Request))
#8 /con/data/http/root/app/Http/Controllers/Docker/DeployerController.php(149): Docker\API\Resource\ContainerResource->create(Object(Docker\API\Model\ContainerConfig))
#9 [internal function]: App\Http\Controllers\Docker\DeployerController->index(Object(Illuminate\Http\Request))
#10 /con/data/http/root/vendor/illuminate/container/Container.php(507): call_user_func_array(Array, Array)
#11 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(577): Illuminate\Container\Container->call(Array, Array)
#12 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(543): Laravel\Lumen\Application->callControllerCallable(Array, Array)
#13 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(517): Laravel\Lumen\Application->callLumenController(Object(App\Http\Controllers\Docker\DeployerController), 'index', Array)
#14 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(485): Laravel\Lumen\Application->callControllerAction(Array)
#15 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(470): Laravel\Lumen\Application->callActionOnArrayBasedRoute(Array)
#16 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(372): Laravel\Lumen\Application->handleFoundRoute(Array)
#17 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}(Object(Illuminate\Http\Request))
#18 /con/data/http/root/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#19 /con/data/http/root/app/Http/Middleware/ProcessJsonMiddleware.php(30): Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#20 [internal function]: App\Http\Middleware\ProcessJsonMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /con/data/http/root/vendor/illuminate/pipeline/Pipeline.php(124): call_user_func_array(Array, Array)
#22 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 /con/data/http/root/vendor/laravel/lumen-framework/src/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#24 [internal function]: Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}(Object(Illuminate\Http\Request))
#25 /con/data/http/root/vendor/illuminate/pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#26 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(617): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#27 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(378): Laravel\Lumen\Application->sendThroughPipeline(Array, Object(Closure))
#28 /con/data/http/root/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php(323): Laravel\Lumen\Application->dispatch(NULL)
#29 /con/data/http/root/public/index.php(28): Laravel\Lumen\Application->run()
#30 {main}  ```

More the content of $exception->getReponse()->getBody()->getContents() :)

And if there is nothing it should be on the docker side

You beat me to it! cannot unmarshal object into Go value of type []nat.PortBinding

@joelwurtz Maybe this is related: https://github.com/ErlNETS/nkdocker/issues/4?

Hum, yes this code
$hostPortBinding = new PortBinding();
$hostPortBinding->setHostPort('32775');
$hostPortBinding->setHostIp('<IP_ADDRESS>');

$mapPorts['80/tcp'] = $hostPortBinding;

Should be transformed to
$hostPortBinding = new PortBinding();
$hostPortBinding->setHostPort('32775');
$hostPortBinding->setHostIp('<IP_ADDRESS>');

$mapPorts['80/tcp'] = [$hostPortBinding];

But there is certainly an error this lib, will do an update tonight

@joelwurtz Thanks!, that did it! :+1:

Closing this as this issue is rather old.


Enhancement |  Refactor common.tfvars account vars

What?

Follow the current naming convention for AWS Organizations (use management instead of root)

Remove old variable blocks. Example:

variable "xxxx_account_id" {
  type        = string
  description = "Account: Xxxx"
}

Update variables in all layers. Example:

# Before:
  trusted_role_arns = [
    "arn:aws:iam::${var.root_account_id}:root"
  ]

# Now:
  trusted_role_arns = [
    "arn:aws:iam::${var.accounts.management.id}:root"
  ]

Update common.tfvars.example

Why?
Improve code readability and flexibility

Hi @exequielrafaela. I made the requested change. I also performed some smoke tests in modules that use these variables without errors 🚀 .

Hi @exequielrafaela. I made the requested change. I also performed some smoke tests in modules that use these variables without errors 🚀 .

@eze-godoy that's great! PR approved 🚀


ARROW-1528: [GLib] Resolve recursive include dependency

Before:

arrow-glib/field.h depends on arrow-glib/data-type.h
arrow-glib/data-type.h depends on arrow-glib/field.h

After:

arrow-glib/field.h depends on arrow-glib/basic-data-type.h
arrow-glib/basic-data-type.h doesn't depend on arrow-glib/field.h
arrow-glib/composite-data-type.h depends on
arrow-glib/basic-data-type.h and
arrow-glib/composite-data-type.h

Oh... I'm checking now.
And I'm also workin on failure on macOS at https://github.com/kou/arrow/tree/glib-travis-macos .

ah ok, I'll wait for you and enjoy some coffee, then. thanks @kou! =)

Ignore me, I'm just checking JIRA replication :)

JIRA should work now, please ignore me :)

One last test :3

bah

blu blu blu

hmm

It works again.
Failure on macOS is handled on #1529.


formats all files using rustfmt

Thanks, would you like to add a fmt ci? like https://github.com/tokio-rs/tokio/blob/master/.github/workflows/ci.yml#L174

Thanks, would you like to add a fmt ci? like https://github.com/tokio-rs/tokio/blob/master/.github/workflows/ci.yml#L174

done

Thank you!


Tags don't seem to work

In the tag column for https://www.opencre.org/cre/268-088 is DOS, but it doesn't show.
Also I don't see tags for XSS and Injection.
There is a topic for injection and it links to a top 10 entry, but injection does not link to any CREs.
Has the tag column not been imported? It basically is the same as the "other cre" column.
Also note that some tag cells have two entries, separated by commas

tags exist in the database and get returned, they haven't been implemented in the frontend as the frontend doesn't have a search by tag functionality yet. I'll add them but they will only be plain text for now, not hyperlinks.
But they prove the point that we have tagged documents and they can easily be searched by tag when we implement the functionality


Generic error is thrown when trying to create a wallet with a security code from an invitation

A generic error is thrown when trying to create a wallet with a security code from an invitation. I do receive the email with the same security code that is also in the inviteResponse.InvitationId. I have tried with the same provider wallet and also with a new provider wallet.
To Reproduce
Steps to reproduce the behavior:

Expected behavior
The wallet should be created for the user that has been invited without an error.
SDK (or CLI) you are using

SDK: .NET
Version: 1.0.1
OS: Windows

@Franklin89 we are working on adding more descriptive error types to the SDKs for errors that occur at the SDK level. That error sounds like a potential bug with the underlying service ( @tmarkovski thoughts? ) which you shouldn't have seen. Part of showing those errors in the EAP program is it helps us to identify bugs that are coming from a lower level than the SDK layer. Would you prefer that all Grpc errors are wrapped in a general TrinsicSDKError exception?

If the exceptions are wrapped in an SDK error the important thing will be to keep the stack trace. This would make it simple for both sides. For the developer to implement a specific catch statement, searching the logs for the SDK errors and if the stack trace is intact it is easy to find the original error inside of the SDK.


Query about CIDRs

I am working on implementing redis labs terraform module for managing our subscriptions. I have some queries regarding CIDRs for a subscription. Terraform resource rediscloud_subscription can take a single CIDR for a subscription. This is the case even if I try creating a subscription from the UI. Also confirmed this with redis support, that each subscription is a cluster with single CIDR. Fair enough.
I am importing existing subscriptions in the terraform state. Which is when I found out that one of our subscriptions, has 3 CIDRs. How do I import in this case? Is this something legacy and cannot be imported ?
For reference, cloud_provider block from imported resource in terraform state.
cloud_provider {
        cloud_account_id = "1"
        provider         = "AWS"

        region {
            multiple_availability_zones  = true
            networks                     = [
                {
                    networking_deployment_cidr = "<IP_ADDRESS>/26"
                    networking_subnet_id       = "subnet-***************"
                    networking_vpc_id          = ""
                },
                {
                    networking_deployment_cidr = "<IP_ADDRESS>/26"
                    networking_subnet_id       = "subnet-****************"
                    networking_vpc_id          = ""
                },
                {
                    networking_deployment_cidr = "<IP_ADDRESS>/26"
                    networking_subnet_id       = "subnet-***************"
                    networking_vpc_id          = ""
                },
            ]
            preferred_availability_zones = [
                "eu-central-1a",
                "eu-central-1b",
                "eu-central-1c",
            ]
            region                       = "<aws-region-1>"
        }
    }

Any help would be great.
thanks

Figured this out.
The master CIDR would be /24, in this case <IP_ADDRESS>/24 (default one). Passing this as argument resolved my issue.


fqdn

Hi,
is there a way to get the fqdn instead of only the hostname?
regards
celevra

Hi, @celevra, some questions

what OS you are running
what exactly would you expect
can you give a specific example

Regards

Hi,
i'm running osx, windows and linux
i except that i get through os() not only os.hostname (server), but also the fqdn (server.domain.com)
equivalent to hostname -f on linux and osx and echo %COMPUTERNAME%.%USERDNSDOMAIN% on Windows
regards

@celevra very clear. Will add this feature.

wow, first thank you for your fast answers and second thank you for the fast commitment to implement my request, and third thank you for all your work, its a great library!

@celevra Done ... version 4.31.0 just released. Can you test it on your side? You should find fqdn now also in the osInfo() object

tooked me 8 month, sorry
i get %USERDNSDOMAIN% as fqdn, seems like the variable is not resolved properly
evtl it is in single ticks?

this one seems to function
https://github.com/niftylettuce/get-fqdn/blob/master/src/index.js
it gets the fqdn with os.hostname and a lookup, i don't get it completly but it seems to work on windows


Rename createExternalLoadBalancer

Observed in #4585.
createExternalLoadBalancer is imperative, which doesn't fit with our declarative API. The name shouldn't contain a verb. How about just external or public?

given that I hope to revamp this who facet of the API eventually, I am reluctant to make this less obvious.  I could live with "public" to match "publicIPs", if you care enough to squeeze this in.

We also need to make our terminology consistent. In some places, we use "external" and in others we use "public".

Potentially subsumed by #7447

Replaced by Type in the v1 API.


userInfos for sub-relationships

Goals
ℹ What do you want to achieve?
Get userInfo for all levels and sub-levels of relationships to play with in transformers
BMO version: 1.0
Xcode version: 10.3
iOS/OSX version: iOS12
Dependency manager + version: Carthage

@Frizlab let's merge that with a warning ?


Federation -  Handle aliased entity key in query

Example Schema
Book Service
type Query {
            bookById(id: ID): Book
        }

        type Book {
            id: ID
            name: String
            pageCount: Int
            author: Author
        }

        type Author @key(fields: "id") {
            id: String
        }

Author Service
        type Query {
            authorByid(id: ID!): Author
        }

        type Author @extends @key(fields: "id") {
            id: String @external
            firstName: String!
            lastName: String!
        }

Example Query:
query  {
                bookById(id: "12345") {
                    id
                    name
                    pageCount
                    author {
                        authorId: id
                        authorName: firstName
                    }
                }
            }

This issue is closed as already implemented by @CNAChino .

implemented in this PR: https://github.com/graph-quilt/graphql-orchestrator-java/pull/166


Functional Test Job for Sysdig.

Ticket will be worked up by Manuel Sysdig.

Basic workflow:

Generate security events (Falco Event generator container image + write below binary dir)
Basic golang app + Sysdig CLI to retrieve the events collected from the SaaS backend (req: api-token, region)


Past events shouldnt have an 'rsvp now' button

✅ By submitting this issue, I have verified the following

[x] Checked to see if the issue has already been discussed before 🤔
[x] If proposing new content to be added, made sure enough details were provided 🔍

https://github.com/techqueria/website/pull/91


Improve coordinates to correctly handle all cases as in astropy

See http://docs.astropy.org/en/stable/coordinates/index.html#reference-api

Cleaning up obsolete issues in 2023.


Setting PATH on fish shell

$ rbenv init
# Load rbenv automatically by appending
# the following to ~/.config/fish/config.fish:

status --is-interactive; and . (rbenv init -|psub)

So I put this in my ~/.config/fish/config.fish. Which does this every time:
setenv PATH '/home/username/.rbenv/shims' $PATH

Which let to a path with multiple shims entries. Before setting the path the script should check if the shims entry is aready in there like this:
not contains "$HOME/.rbenv/shims" $PATH; and setenv PATH "$HOME/.rbenv/shims" $PATH

That's a good suggestion, but we had PATH de-duping a long time ago, and people complained against it. Namely, their nested shell environments (such as through tmux) would become all messed up after they re-ordered other PATH entries, shifting rbenv's shims directory to a lower precedence, and basically sabotaging rbenv. See https://github.com/rbenv/rbenv/pull/901#issuecomment-220004280 for more context.

Meh.. Not very satisfying for me. Keeping a badly working function because some peoples workflow is broken seems not right to me. Maybe they should just do their path modifications correctly? In the end you're just repeating there mistakes.
I think I will make a small function that cleans up my path when I start fish. I'll post it here when I come to it. Then I'm independent from your approach.

In the end you're just repeating there mistakes.

Sure, but because their environments are messed up, they perceive rbenv as being broken, open issues here, and waste hours of my time each week. That's why I opted for being less clever (always a good idea in software!) when it comes to adding shims to PATH. In the end, I shift responsibility for PATH de-duping down to the user, instead of handling it from rbenv. I think that's a good compromise.
Please post your de-duping function here if you come up with one!

~/.config/fish/config.fish:
# rbenv
status --is-interactive; and . (rbenv init -|psub)
fix_path

~/.config/fish/functions/fix_path.fish:
function fix_path --description "Removes duplicate entries from $PATH"
  set -l NEWPATH
  for p in $PATH
    if not contains $NEWPATH $p
      set NEWPATH $NEWPATH $p
    end
  end
  set PATH $NEWPATH
end

Converts a a b a c d to a b c d.
rbenv always tries to stay at the first entry in $PATH which it still does but without the duplicates. Same functionality, but much cleaner.
I still think this should be made by rbenv itself, instead of just adding itself upfront it could look for itself and remove all entries before adding itself to the front. This would make a clean PATH and shouldn't mess with users environments. At least I don't see a corner case where this could fail. Because you only manipulate the rbenv entries.

Thanks for sharing!

I still think this should be made by rbenv itself, instead of just adding itself upfront it could look for itself and remove all entries before adding itself to the front.

That's not a bad idea, and is certainly much better than just checking whether shims exists in PATH and avoiding prepending a new entry (which is what we've done before and which backfired). However, since there's nothing compelling that we gain by doing this, and because I would have to maintain implementations of this across multiple shell syntaxes, I'd rather opt to have things stay like they are now.

@XenGi Hi.
Thanks for sharing your solution for "rbenv".
I try to use your config.fish code, but not work for me.

You're screenshot tells you the answer. The . command is not supported anymore. I changed it to source like the error suggested.

@mislav Is keeping this as it is still the current way to go for rbenv or would you be willing to look at a pull request, that would implement the shim reordering for all three shells?

Just revisited this issue again for bash and similar shells. After a long and interesting journey through shell land I came up with this:
export PATH=$(echo $PATH | tr ':' '\n' | tac | uniq -u | tac | paste -s -d':')

Another solution would be to use awk:
echo $PATH | awk -v RS='[:\n]' '!seen[$0]++'

Hi having problem with my path not sure how to fix it
shaf@5h4f1:/mnt/c/Users/Shaf0/desktop/rubykoans/koans$ ruby path_to_enlightenment.rb /usr/lib/ruby/vendor_ruby/rbnacl/libsodium/version.rb:5: warning: Insecure world writable dir /home/shaf/.rbenv/shims in PATH, mode 040777


Update to work with the meal planner?

I love your wrapper and it is extremely useful, but I was wondering if you would ever be interested in adding new user requests. I can't seem to figure out how to work with the meal plan endpoints and your wrapper was the crutch I needed here lol.

Hey @Braden50 could you elaborate on what your exact problem is and what you need?

Hey David,
Thanks for your reply! Currently I am working on making a personalized
automated meal planner. I am using the wrapper here:
https://pypi.org/project/spoonacular/ (which seems to be John Miller's
version), but this wrapper hasn't been updated in a bit, and is missing all
of the user-specific endpoints (not sure if these are new features or not).
I am new to REST API, but I am trying to fill in the gaps here to help me
with my app by updating the wrapper accordingly.
The problem I am running into is that I can't seem to get any of the user
requests to work, Like even the connect_user endpoint is not working for
me. My code below is returning a 405 error message and any attempt to
change or reach the meal planner returns a 401 error response
con_url = 'https://api.spoonacular.com/users/connect'
args = {
'apiKey': SECRET_KEY,
'username': USERNAME,
}
us_hash = requests.get(con_url, args)
print(us_hash.text)
It's quite possible that I just have no idea what I'm doing. In the
meantime, I've been refining my knowledge of RESTful APIs and might end up
finding out how to fix the errors that way. The work you've done on the
wrapper is amazingly helpful though, and I wanna acknowledge how
inexperienced users like me really appreciate these kinds of things.
Thank you for your time,
Braden Michelson
On Thu, Aug 20, 2020 at 12:05 AM David Urbansky<EMAIL_ADDRESS>wrote:

Hey @Braden50 https://github.com/Braden50 could you elaborate on what
your exact problem is and what you need?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/johnwmillr/SpoonacularAPI/issues/8#issuecomment-677382748,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APDPSWUPQZFMXFL2PEG3OE3SBTDLRANCNFSM4QFVFH7Q
.

@Braden50 yes so to clarify, I'm working on the actual API and @johnwmillr created this super useful wrapper. The meal planning endpoints are indeed new and we would have to see whether John would update wrapper.
I'm not really fluent in python so I can't be of much help. However, the 405 error leads me to believe you are not sending the correct request type, i.e. POST instead of GET or vice versa. The connect user for example should be a POST request and you write requests.get ... maybe there is something like requests.post?

Thank you, @ddsky! I'm a bit busy at the moment but would love to add in the meal planning endpoints when I have time. @Braden50, if you make any progress with them, feel free to open a PR.

Lmao yeah maybe that's it @ddsky. I made the switch and am now running into a 404 error, but I'll keep trying. It also seems that they might be currently upgrading their infrastructure. I'll let you guys know if I end up updating the wrapper entirely.


Corrected shown default for MaxValidationDepth.

Fixes #15822.
I mentioned in my previous PR for this topic that I thought the value here might be wrong. I've checked it in the source and in a sample project for both 2.2 (with different compat versions) and 3.0 to confirm it should be changed.
cc @Rick-Anderson

@serpent5  thanks!


Async API issues

Describe the bug
It's not exactly a bug, but rather a technical debt I'm asking to discuss.
Hope I'm not missing something obvious...
To Reproduce
Modern network libraries are asynchronous, but CoreRemoting channel API is synchronous.
Expected behavior
Network protocol implementations provide SendAsync, ListenAsync and DisposeAsync methods rather than Send, Listen and Dispose. Establishing the connection requires network roundtrip which can take time. Sending data packets can be time-consuming for large payloads. Disposing of the channel may involve sending data to remote machine to signal the end of session. And so on. Performing these time-consuming operations on a main application thread should be avoided.
Additional notes
If channel API is refactored to be asynchronous, it's still can be used for legacy synchronous libraries.
For instance, void methods can return Task.CompletedTask, and so on.
I'm proposing something like this:
public interface IClientChannel : IDisposableAsync
{
	Task Init(IRemotingClient client);

	Task Connect();

	Task Disconnect();

	Task<bool> IsConnected { get; } // not sure about this :)

	IRawMessageTransport RawMessageTransport { get; }

	event Action Disconnected;
}

public interface IServerChannel : IDisposableAsync
{
	Task Init(IRemotingServer server);

	Task StartListening();

	Task StopListening();

	Task<bool> IsListening { get; } // not sure again
}

public interface IRawMessageTransport
{
	Task<bool> SendMessage(byte[] rawMessage);

	event Action<byte[]> ReceiveMessage;

	event Action<string, Exception> ErrorOccured;

	NetworkException LastException { get; set; }
}

I would like to add that the synchronization primitives CountdownEvent, ManualResetEvent and others should be replaced with their asynchronous counterparts. Otherwise, the thread pool will be exhausted at high load. If we using asyn/await and tasks, then primitives should be awaitable.

Agreed! 👍

Maybe include CancellationToken in some of the methods, even?

Maybe include CancellationToken in some of the methods, even?

Not sure about the cancellation tokens here for the following reasons:

Cancellation is a nice feature for the end-users (i.e. start reading a file → cancel reading), but the channel API user here is CoreRemoting framework. Its own operations are much shorter than remote method invocation, i.e.: send message → instantiate component → invoke server method → wait for results → receive message. A user is more likely to cancel the invoke/wait for results part than send/receive message part of the process.

Support for cancellable APIs is harder than it seems. Third party channel developer's life isn't quite easy by itself, even without cancellation tokens. For example, cancelling SendMessage operation is the same as sending an incomplete part of a message. So the server-side channel can't assume it will receive complete messages all the time. An incomplete message cannot be deserialized to decide how to dispatch it, and so on. More things that can break will make the channel code less robust and more tricky to design.

That's my concern anyways :)

@yallie please pay attention to this commit fedfd5d094cd154584f933cb8bea56012eda655c. Not all things need to be run asynchronously. When client session is closed from the server side by request of client, this request may completely terminate or fall with an exception. In this commit, we are just trying to achieve predictable behavior - RPC that requests the closure of the session ends normally.

@yallie please pay attention to this commit fedfd5d. Not all things need to be run asynchronously.

Yes, that's for sure.
Asynchronously doesn't mean unpredictably 💯
It just means that the code shouldn't block the current thread waiting for the sync.


Project structure and DSL design

Right now, there is just a pact module with all functions of the ffi (mostly mock server) required for basic consumer tests.
I wanted to propose this structure:

Keep a single module for all ffi interop. This can be the current module pact_ffi_nif (although I would prefer renaming it to pactffi_nif or pactffi_interop - the latter is similar to what PactNet uses).
This module would have the ffi functions exported with no Erlang-side wrapping. Function names in this module don't need the erl_pactffi prefix.

The next layer can be ease-of-use modules that expose functions for different scenarios. Like pact_mock_server for setting up mocks for consumer tests, pact_logger for logging, pact_verifier for provider verification, etc.

There can further be some modules specific to CT or Eunit test frameworks that make it easier to work with them using functions or macros.

Functions in (2) and (3) would be used by end-users of the library and would constitute the DSL of this library.

Some possible DSL examples using influxdb library for Erlang to write and test a consumer test for InfluxDB. This uses the CT framework:
A streamlined version of the current implementation:
-module(influxdb_SUITE).
-include_lib("common_test/include/ct.hrl").

-export([all/0, init_per_suite/1, end_per_suite/1, influx_write/1]).

all() ->
    [influx_write].

init_per_suite(Config) ->
    PactRef = pact:v4(<<"myapp">>, <<"influxdb">>, http),
    [{pactref, PactRef} | Config].

end_per_suite(Config) ->
    PactRef = ?config(pactref, Config),
    pact:cleanup_pact(PactRef).

influx_write(Config) ->
    P = ?config(pactref, Config),
    ok = pact:upon_receiving(P, <<"a request to write to influxdb">>),
    ok = pact:with_request(P, <<"POST">>, <<"/write?db=mydb">>),
    ok = pact:with_header(P, <<"Content-Type">>, <<"application/octet-stream">>),
    ok = pact:with_body(P, <<"cpu_load_short,host=server01 value=0.64">>),
    ok = pact:will_respond_with(P, 204),
    {ok, Port} = pact_mock_server:start(P),

    InfluxConfig = influxdb_config:new(#{port => Port, database => <<"mydb">>}),
    ok = influxdb:write(InfluxConfig, [{<<"cpu_load_short">>, #{<<"host">> => <<"server01">>}, #{<<"value">> => 0.64}}]),
    pact:verify(P). %% Does cleanup as well

Note that this uses a single P object as reference in all functions. This can be achieved by starting a new gen_server for each Pact, returning the Pid as PactRef, and keeping track of the PactHandle, Interaction, and Port variables in the gen_server state. If we had a generic way to set up HTTPClient mocks in Erlang, even Port would not have to be returned.
Also note that pact:verify/1 would verify and do the cleanup, print the errors + raise an exception if verification fails.
Taking this further, we can probably make the interaction setup as a single function that takes a map as an argument:
influx_write(Config) ->
    P = ?config(pactref, Config),
    {ok, Port} = pact:interaction(P, #{
        upon_receiving => <<"a request to write to influxdb">>,
        with_request => #{
            method => <<"POST">>,
	    path => <<"/write?db=mydb">>,
	    headers => #{<<"Content-Type">> => <<"application/octet-stream">>},
	    body => <<"cpu_load_short,host=server01 value=0.64">>
	},
        will_respond_with => #{status => 204}}),

    InfluxConfig = influxdb_config:new(#{port => Port, database => <<"mydb">>}),
    ok = influxdb:write(InfluxConfig, [{<<"cpu_load_short">>, #{<<"host">> => <<"server01">>}, #{<<"value">> => 0.64}}]),
    pact:verify(P).

Taking it one more step further:
influx_write(Config) ->
    P = ?config(pactref, Config),
    pact:verify(P, #{
        upon_receiving => <<"a request to write to influxdb">>,
        with_request => #{
            method => <<"POST">>,
	    path => <<"/write?db=mydb">>,
	    headers => #{<<"Content-Type">> => <<"application/octet-stream">>},
	    body => <<"cpu_load_short,host=server01 value=0.64">>
	},
        will_respond_with => #{status => 204}},
        fun(Port) ->
	    InfluxConfig = influxdb_config:new(#{port => Port, database => <<"mydb">>}),
	    ok = influxdb:write(InfluxConfig, [{<<"cpu_load_short">>, #{<<"host">> => <<"server01">>}, #{<<"value">> => 0.64}}])
    	end
    ).

In the last example, the end-user will finally just use two functions: pact:v4/3 and pact:verify/3.
Additional things like logging levels etc can be optional arguments to either function or library-level config flags.

An example with a custom assert macro for eunit:
influx_write_test_() ->
    {setup,
    fun() -> pact:v4(<<"myapp">>, <<"influxdb">>, http) end,
    fun(PactRef) -> pact:cleanup_pact(PactRef) end,
    fun(PactRef) ->
        [?_assertPact(PactRef, #{
            upon_receiving => <<"a request to write to influxdb">>,
            with_request => #{
                method => <<"POST">>,
	        path => <<"/write?db=mydb">>,
	        headers => #{<<"Content-Type">> => <<"application/octet-stream">>},
	        body => <<"cpu_load_short,host=server01 value=0.64">>
	    },
            will_respond_with => #{status => 204}},
            fun(Port) ->
	        InfluxConfig = influxdb_config:new(#{port => Port, database => <<"mydb">>}),
	        ok = influxdb:write(InfluxConfig, [{<<"cpu_load_short">>, #{<<"host">> => <<"server01">>}, #{<<"value">> => 0.64}}])
    	    end)]
        end}.

This seems more complex to me, but maybe we can think of how to make it simpler.

Some possible DSL examples using influxdb library for Erlang to write and test a consumer test for InfluxDB. This uses the CT framework:
A streamlined version of the current implementation:
-module(influxdb_SUITE).
-include_lib("common_test/include/ct.hrl").

-export([all/0, init_per_suite/1, end_per_suite/1, influx_write/1]).

all() ->
    [influx_write].

init_per_suite(Config) ->
    PactRef = pact:v4(<<"myapp">>, <<"influxdb">>, http),
    [{pactref, PactRef} | Config].

end_per_suite(Config) ->
    PactRef = ?config(pactref, Config),
    pact:cleanup_pact(PactRef).

influx_write(Config) ->
    P = ?config(pactref, Config),
    ok = pact:upon_receiving(P, <<"a request to write to influxdb">>),
    ok = pact:with_request(P, <<"POST">>, <<"/write?db=mydb">>),
    ok = pact:with_header(P, <<"Content-Type">>, <<"application/octet-stream">>),
    ok = pact:with_body(P, <<"cpu_load_short,host=server01 value=0.64">>),
    ok = pact:will_respond_with(P, 204),
    {ok, Port} = pact_mock_server:start(P),

    InfluxConfig = influxdb_config:new(#{port => Port, database => <<"mydb">>}),
    ok = influxdb:write(InfluxConfig, [{<<"cpu_load_short">>, #{<<"host">> => <<"server01">>}, #{<<"value">> => 0.64}}]),
    pact:verify(P). %% Does cleanup as well

Note that this uses a single P object as reference in all functions. This can be achieved by starting a new gen_server for each Pact, returning the Pid as PactRef, and keeping track of the PactHandle, Interaction, and Port variables in the gen_server state. If we had a generic way to set up HTTPClient mocks in Erlang, even Port would not have to be returned. Also note that pact:verify/1 would verify and do the cleanup, print the errors + raise an exception if verification fails.
Taking this further, we can probably make the interaction setup as a single function that takes a map as an argument:
influx_write(Config) ->
    P = ?config(pactref, Config),
    {ok, Port} = pact:interaction(P, #{
        upon_receiving => <<"a request to write to influxdb">>,
        with_request => #{
            method => <<"POST">>,
	    path => <<"/write?db=mydb">>,
	    headers => #{<<"Content-Type">> => <<"application/octet-stream">>},
	    body => <<"cpu_load_short,host=server01 value=0.64">>
	},
        will_respond_with => #{status => 204}}),

    InfluxConfig = influxdb_config:new(#{port => Port, database => <<"mydb">>}),
    ok = influxdb:write(InfluxConfig, [{<<"cpu_load_short">>, #{<<"host">> => <<"server01">>}, #{<<"value">> => 0.64}}]),
    pact:verify(P).

Taking it one more step further:
influx_write(Config) ->
    P = ?config(pactref, Config),
    pact:verify(P, #{
        upon_receiving => <<"a request to write to influxdb">>,
        with_request => #{
            method => <<"POST">>,
	    path => <<"/write?db=mydb">>,
	    headers => #{<<"Content-Type">> => <<"application/octet-stream">>},
	    body => <<"cpu_load_short,host=server01 value=0.64">>
	},
        will_respond_with => #{status => 204}},
        fun(Port) ->
	    InfluxConfig = influxdb_config:new(#{port => Port, database => <<"mydb">>}),
	    ok = influxdb:write(InfluxConfig, [{<<"cpu_load_short">>, #{<<"host">> => <<"server01">>}, #{<<"value">> => 0.64}}])
    	end
    ).

In the last example, the end-user will finally just use two functions: pact:v4/3 and pact:verify/3.
Additional things like logging levels etc can be optional arguments to either function or library-level config flags. Also, a pact_match module can contain matcher functions that can be passed instead of hardcoded values in the examples above.

Don't you think we should separate verification with setup ? Other language's pact client also has pact setup and pact verify functions separate (For ex. pact python). The first map example you provided is exactly how other languages do.
`influx_write(Config) ->
P = ?config(pactref, Config),
{ok, Port} = pact:interaction(P, #{
upon_receiving => <<"a request to write to influxdb">>,
with_request => #{
method => <<"POST">>,
path => <<"/write?db=mydb">>,
headers => #{<<"Content-Type">> => <<"application/octet-stream">>},
body => <<"cpu_load_short,host=server01 value=0.64">>
},
will_respond_with => #{status => 204}}),
InfluxConfig = influxdb_config:new(#{port => Port, database => <<"mydb">>}),
ok = influxdb:write(InfluxConfig, [{<<"cpu_load_short">>, #{<<"host">> => <<"server01">>}, #{<<"value">> => 0.64}}]),
pact:verify(P).

`
^ I think we should go with this one. What do you think @srijan ?

Passing the interaction function to verify will enable us to do try/catch with it to enable extra logging if it fails. That example was based on PactNet implementation: https://github.com/pact-foundation/pact-net/blob/9a4aea964ed6d176adcc566bc138badff8aa47eb/src/PactNet/PactBuilder.cs#L77C25-L77C25


Remove signatures on any files, also signature.txt

signatures are no longer needed.

You can pick this up, to get to speed with the project. @mafiya69


3 to 4 converter: raise -> move_to_front

Godot version
4.0.beta4
System information
Linux
Issue description
Didn't see raise() -> move_to_front() convert entry in project_converter_3_to_4.cpp, probably need one?
Ref: Rename raise() to move_to_front() #60108
Steps to reproduce
As description, just wanna check if it's a missing.
Minimal reproduction project
No response

We would have to do more then just function rename since the function got moved to from node to canvas item, or is adding it to just the list of rename enough?

Just adding to the renames should be sufficient for most cases. While it's technically possible for users to have been using it on a Node that doesn't inherit CanvasItem, it's unlikely. If they do, they'll get an error, but they would anyway without performing the rename.


[RFC] Use a multiple dispatch library

This PR refactors some code using multiple dispatch. This is an experiment in applying multiple dispatch in
various situations. The experiments are mostly spread sparsely across the repo.
This PR requires the master branch of plum-dispatch. You can get this by cloning
plum-dispatch and doing, for example in a virtual env,  pip install -e ..
Advantages/Motivation

disentangles forests of  isinstance conditionals, making the logic more clear.
Remove type-checking boilerplate. A method error is thrown if no matching method exists. For example

        if not isinstance(scalar, (int, float, complex, ParameterExpression)):
            raise ValueError('Operators can only be scalar multiplied by float or complex, not '

Especially useful with mathematical operators. This is by far the heaviest use case in Julia. This is difficult in python because operators must be class methods that privilege one operand. A workaround is to use function calls rather than infix operators.

Or, one could have __mul__ and __rmul__ for several classes all call a function (not method) multiply which supports multiple dispatch.

MD with operators can greatly increase the composabilty of the classes. This works in Julia in concert with a parametric type system. It may also give some similar benefit in qiskit (a python project), but it would probably require larger scale design changes, or development.

types representing lists and tuples of homogeneous type simplify logic. An example (not in this PR) is
https://github.com/Qiskit/qiskit-terra/blob/10a1c907f3281b1f9b451c9c81d5f05b24101d9f/qiskit/opflow/gradients/circuit_gradients/lin_comb.py#L142-L144
is replaced by something like

def func(params: {tuple, plum.List(tuple)}):

Currently used mostly within classes in an asymmetric situation. I.e. with gradients the class is doing something to the argument. A bigger advantage is gained when you have an operation between two objects and it is not clear two which class the method should belong. (Explain why: it's not just that you don't have to make this decision; it affords more flexibility)

Multiple-dispatch libraries
Multiple dispatch or multimethods in languages such as Dylan and Common Lisp (as CLOS) is older than the Julia language.
However, much of the motivation and design choices of current Python implementations come from Julia.

multimethod It's stated goal is dispatch speed.

No matching method prints error giving missing signature (not non-matching signatures). plum does this as well.

plum-dispatch Probably the most feature-ful

Also exposes type conversion and promotion mechanisms modeled on Julia
Keyword-only args, separated by *, are supported. They do not enter into dispatch. This is similar to Julia
Supports @staticmethod, at least basic.
If no matching method is found at dispatch time, a NotFoundLookupError is raised. One could add a feature to plum to print closest matching methods, as Julia does.

multipledispatch

Cannot use default values for args. This should be a possible feature.
Lowest time overhead for dispatch in benchmarks (of multipledispatch, plum-dispatch, and fastcore)

fastcore

If there is no matching method, a method may still be called, and also called incorrectly. It would be better to throw some kind of MethodError.
Not as featureful as others
Small. A single file < 200 LOC.

Design issues

How to organize documentation. Doc system is not built to accommodate MD

Other considerations
Storing type-like information in various places
In qiskit, we sometimes distinguish "kinds" of objects by attributes; a flag or a string. Or by checking whether a method exists. This design complicates MD and makes it more difficult to apply broadly. I would be a good idea to move these things into the type system. The easiest way is to make another type rather than a use a flag. But, maybe there is also a way to use dispatch with a trait system.
Does a multiple-dispatch system turn Python into Julia? No. The blurred distinction between run time and compile time in Julia offers an advantage that is difficult to reproduce in Python (compilation itself is a big problem in Python). First, let's be more precise by what we mean by multiple dispatch.
Multiple dispatch vs. operator overloading
MD is distinguished from function overloading in that the former is dynamic while the latter is static. Dispatch in the former is done on the dynamic type, in the latter it is done on the statically, lexically, analyzed type. Consider the code

function func(a::Animal)
    make_noise(a)
end

where we have three abstract types with the relation Animal <: Thing, Machine <: Thing, and another type Dog <: Animal. We might have methods
make_noise(m::Machine) = "crash"
make_noise(a::Animal) = "cry"
make_noise(dog::Dog) = "bark"

What happens when I call func(dog) ? In an operator-overloading language I get "cry", the static, lexically, deterimined type of a. In a MD language, dispatch is on the actual type of the object; I get "bark".
Run-time compilation and inference
But, an important advantage is present in both static languages and Julia that is not available in Python and CLOS. In Julia, when func(dog) is first called, the types of all expressions in the body are inferred if possible and code is compiled specially for the inferred types. In particular, although this is "dynamic dispatch", the method make_noise is devirtualized, and inlined if advantageous. This strategy  may be pursued to any depth (there are algorithms to determine when it is advantageous not to specialize). One thereby obtains advantages of both static and dynamic languages.

No diagonal dispatch. Some (all?) MD libraries' docs claim they do no support diagonal dispatch. I think the issue more broadly is that they do not support proper parametric types, in particular type parameters in the parameter lists. plum claims it has a method to get around lack of diagonal dispatch (using Self). But, I don't the problem worked around by Self is stated correctly. It is that @dispatch can't recognize the type of a class inside the definition of the class, because is net yet recognized by python. Self is in some sense a way to defer referring to the class by name.

No universal, coherent type system.

In many cases, singledispatch is enough. How about using https://pypi.org/project/singledispatchmethod/?
This is standard from Python 3.8 and we can use it for Python 2.7-3.7 by installing the library.

Thanks @jlapeyre , this looks cool, and there are definitely some places where something like this could bring some clarity/readability improvements, specifically where we're expecting to be handling multiple different input types that require unique handling e.g.
https://github.com/Qiskit/qiskit-terra/pull/5985/files#diff-a84abe28fb4a52b1ee2989190156adf34e0f09cbcffc5b2663697843d8893bd3R236
I'm not as much of a fan of applying this broadly across the code base. For example
https://github.com/Qiskit/qiskit-terra/pull/5985/files#diff-f8bf228c13afac54d0487df4391520ab5b0efbe5649e447475d99dd04ce06c89R62 ,
obscuring the two isinstance checks, combined with the added metaclass structure and added decorators leaves the final code for me less readable and approachable.

I agree with @kdk. It looks like it could be very useful in some cases but using MD even in simple cases seems to add overhead and is, at least to me, less straightforward to read.
Is it an option to only use MD in cases where we have large isinstance code blocks but keep isinstance in simple case distinctions?

Thanks for the looking at this.
I should note first that I have since looked at multimethod, which might be a better choice: Dispatch is much faster than plum-dispatch. It has a longer history, and the currently released version is sufficient. It is small and pure python. There may be a feature or two that are missing, but it probably does what is necessary.

In many cases, singledispatch is enough.

The places where it is used most effectively, such as the gradients code, requires multiple dispatch. Also we often have an object that it passed another object of the same kind, say for some kind of reduction. In this case you want a method for which you can dispatch on a single non-self argument, that is of the same type as self. The single dispatch library can't do this. Multiple dispatch libraries can.

obscuring the two isinstance checks, combined with the added metaclass structure and added decorators leaves the final code for me less readable and approachable.

This makes sense. Even one decorator adds some noise. The metaclass structure is unfortunate. The multimethod library, which I mentioned above, does not require the metaclass stuff, and doesn't seem the worse for it. In any case. I think it makes sense to try multiple dispatch more narrowly, say in a single class, and where the benefits are most clear.

is, at least to me, less straightforward to read.

This is hard to answer. In part, of course, it's a matter of getting used to understanding the logic when presented this way, which is not difficult. This PR doesn't really touch the main benefit of multimethods, which is to loosen the constraints of class-based dispatch allowing easier composability.

This is not going to be merged. I'll close it. There may be some useful information for reference in this PR; that will still be available when it's closed.

This is not going to be merged. I'll close it. There may be some useful information for reference in this PR; that will still be available when it's closed.


The frame rate was only 30fps on Flutter's latest version of Windows 3.10.5, but I used the same code on version 3.10.2, which exceeded 60fps

Details
FLUTTER VERSION:3.10.5
Target Platform: WINDOWS
class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }
  @override
  void initState() {
    super.initState();
    Timer.periodic(const Duration(microseconds: 500), (timer) {
      setState(() {
        _counter++;
      });
    });
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.transparent,
      body: Center(
        child: Stack(
          children: <Widget>[
            Center(
              child: Transform.translate(
                offset: Offset(-_counter / 2000, -_counter / 2000),
                child: RepaintBoundary(
                  child: Container(
                    padding: const EdgeInsets.all(8.0),
                    color: Colors.deepOrange,
                    child: Text('$_counter'),
                  ),
                ),
              ),
            ),
            Positioned(
              left: _counter / 2000,
              top: _counter / 2000,
              child: Container(
                padding: const EdgeInsets.all(8.0),
                color: Colors.deepOrange,
                child: Text('$_counter'),
              ),
            ),
            Stack(
              children: [
                Text(
                  '$_counter',
                  style: Theme.of(context).textTheme.headlineMedium,
                ),
              ],
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

Mainly the following code：
Timer.periodic(const Duration(microseconds: 500), (timer) {
      setState(() {
        _counter++;
      });
});

3.10.5:

3.10.2:

Thanks for the report @wxjrkm520
Does it occur in --profile mode or in debug mode only ? Can you run flutter run --profile --trace-skia and provide us the trace file ?
Also, please run the same scenario on latest master as well to check whether the behavior persists or not.

There is no problem running on the mobile end, but running on PC Windows can cause such problems

I found that the problem lies in the raster thread, where the UI only takes 0.1-0.5ms, while the raster thread takes 16ms+

Hi @wxjrkm520
After observing this for longer, I noticed that the FPS changes over time:
60 -> 30 -> 60 -> 30 ....
(Verifying this on the latest stable version  3.10.5.
Do you notice the same result on both above Flutter versions?

Hi @wxjrkm520 After observing this for longer, I noticed that the FPS changes over time:
60 -> 30 -> 60 -> 30 ....
(Verifying this on the latest stable version 3.10.5.
Do you notice the same result on both above Flutter versions?

yes,same result!

Thanks for your response. I just checked this on the latest master and notice the issue doesn't seem to appear anymore. Could you please switch to master channel and confirm this?
flutter channel master
flutter upgrade

When I tested on my company's computer, this problem seemed to have been resolved.(in profile mode)
I found that if the frame count suddenly increases, the version of the master branch will slowly decrease the frame count!
And the time consumption of Raster threads is also very stable!
Excellent solution to this problem, thank you very much!!
I will test again on my personal computer after returning home, as this issue was discovered on my personal computer. Please wait for good news.

The problem has been perfectly solved, thank you


Make feature cards more responsive & consistent at some screen sizes

The card heights could become misaligned on some screen sizes. This is fixed. The cards are also responsive now.

Thanks!


Add separate config file for tests

File tmp/config_default.json was not deleted after test.

TESTED - OK


Allow any list of strings as actions allowed/denied

Allow any list of strings as actions allowed/denied in ResourceData model. This is to allow for new actions that may be added in the future and avoid having to update the enum here every time.
Prep release 0.0.22

Codecov Report

Merging #94 (301547a) into main (ce26f14) will not change coverage.
The diff coverage is 66.66%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main      #94   +/-   ##
=======================================
  Coverage   73.64%   73.64%
=======================================
  Files          11       11
  Lines        1434     1434
=======================================
  Hits         1056     1056
  Misses        378      378

Impacted Files
Coverage Δ

origami/_version.py
0.00% <0.00%> (ø)

origami/defs/access_levels.py
94.66% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

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


Support query! for cargo-free systems

Does your PR solve an issue?
Eagerly calling https://github.com/launchbadge/sqlx/blob/929af41745a9434ae83417dcf2571685cecca6f0/sqlx-macros-core/src/query/mod.rs#L80 results in build failure in Bazel builds.
Delete this text and add "fixes #(issue number)"

To provide additional context, I am attempting to get the following code to work.
# BUILD.bazel
rust_binary(
    name = "app",
    srcs = glob(["src/**/*.rs"]),
    aliases = aliases(),
    compile_data = [
        "@//:.sqlx",
    ],
    proc_macro_deps = all_crate_deps(
        proc_macro = True,
    ),
    rustc_env = {
        "SQLX_OFFLINE_DIR": ".",
    },
    visibility = ["//visibility:public"],
    deps = all_crate_deps(),
)

Thank you for confirming the resolution. As for your question about troubleshooting, I think I didn't do anything out of the ordinary. However, I did come across the error message "help: message: CARGO must be set: NotPresent." at https://github.com/kshramt/evidence_based_scheduling/actions/runs/7158836343/job/19491388204#step:5:207. I'm not entirely sure what made this error message visible in this instance.

@grim7reaper Did you consider the patch I put up in #2922 ? I think they will be ~functionally equivalent, and I expect this patch would work for us too.

Believe it or not, I patched sqlx to be able to build it in Nix and ended up independently with a 100% identical patch :sweat_smile: Just found this PR before opening my own.
Changing it from eagerly to lazy seems like such an obvious and good addition, fixed all my problems :+1:

Thank you for merging this! I just realised that 2 years ago I did the first implementation in #1415 - do we need some sort of test to prevent this reverting again in future?

Sorry if this is not the appropriate place to ask but I don't think there's many issues/threads with this many bazel and sqlx users so I'll shoot my shot.
What workflow do you use to update the offline dir? By default it only updates inside of the bazel sandbox so what I've done is just set SQLX_OFFLINE_DIR to /tmp but it's not very nice. Any advice?


OMF converter crashing

When trying to convert MUSIC.SYS16 program, there is a crash in version 1.8.0 and above.
It was working correctly up until version 1.7.5
MUSIC.zip

Looks like a bad interaction between the OMF converter and the address-map code that got rewritten in 1.8.  I'll dig into it today.

Should be fixed here: https://github.com/fadden/6502bench/releases/tag/v1.8.3-dev1
The project generated by v1.8.3-dev1 for MUSIC.SYS16 matches that generated by v1.7.5, except for the header comment (which includes the version number) and the address map.  The address map is functionally identical -- a series of "floating" regions -- but the serialization changed to allow for the new bells and whistles.  (If you load the v1.7.5-created project into v1.8.x and save it, you get the same result.)

Very well. It seems to work as expected now. Thank you.


Line breaks between list not keeping

The line space between two list not rendering as a two list.
var markdown = '*   one\n*   two\n*   three\n*   four  \n\n \n\n' +
'*   another1\n*   another2\n*   another3\n'

Expected result , see this in http://dillinger.io/

dfadsadddd

assdfasdas

sdfsdfs

dfsdf

dfadsadddd

assdfasdas

sdfsdfs

dfsdf

But showdown giving me one single list, and li with contains
 tag.

This is one of the (not so) edge cases in which the original markdown spec is omissive. This means each implementation out there parses this specific case differently differently. see comparison here
While showdown follows the original markdown spec as much as possible, dillinger seems to follow the Common mark spec (which is not markdown, but rather a variant!!!).
Regardless, internally we've debated this extensively, and couldn't come to an agreement. However, I think it's possible to add an option to treat consecutive lists separated by 3 or 4 linebreaks as separated lists.
Right now, you can work around this by adding a silent element in between the lists
 - a
 - b
 - c

 - bla
 - bli
 - blu

For instance, github does not separate lists like that:
1. a
1. b
1. c

1. d

a

b

c

d


⚠ Processors has degraded performance

In 97df974, Processors ($STATUS_URL) experienced degraded performance:

HTTP code: 200
Response time: 37 ms

Resolved: Processors performance has improved in 3b54bba.


Common Pb/204 overcount interfaces - proposal for new layouts

@sbodorkos @allenkennedy @cwmagee  this issue goes out to you three (and any others in the SHRIMP community who are lurking on this Github)
I am really excited about all these new developments on SQUID3!  I feel like if our IT folks confiscated our old Excel 2003 data reduction computer tomorrow we wouldn't be screwed!  Better than that, we'd be FINE.  Thanks so much to @sbodorkos and @ryanbarrett1515  for all their hard work.
With the primary functionality worked out, I have given some thought to the interface, and this particular github issue addresses how to simplify our interactions related to common Pb.  What I am proposing is that we group together the "204 count correction" actions with the "assign common Pb" actions. I have mocked up what this could look like - see the image below but have also attached it as a pdf.

I think that this layout sensibly and efficiently puts all the info related to common Pb corrections (which includes the 204 OVC issue) in one place.  The only thing that is "lost" is seeing all the the ages (6/38, 7/6, 204 corr, 207 corr, 208 corr etc) for all the individual analyses (you can still see the effect on the summary age of changing your common Pb comp or OVC choice).  I feel like this more concise view is worth it however, not having to use 2 menus to accomplish one thing.  If you want to see side by side comparison of the different individual ages/corrections you can do that in the report settings.  This just my opinion however, Let me know what you think....(no rush,  I know it is Christmas/summer holiday time in Oz. Just putting this out there for future consideration).
CommPb layout proposal.pdf

Hi @NicoleRayner - it looks and sounds good to me. I think we only segmented and sequenced the screens that way because that is how the 'Group Me' code is laid out in SQ2.50, but I think yours is a sensible idea.
But I still haven't been able to look at any of these screens 'live' - I haven't had access to a fully functioning Sq3 since v1.3.x about a month ago, and I know I have a lot of catching up to do.
Where do you think we should display the biweight Overcount204from20X values and their 95% confidence intervals, as calculated from the set of RM values? I have discussed this with @bowring a couple of times, and every time I end up suggesting something different... do you think they should appear on the RM Wtd Av screen, your remodelled screen depicted here, or in both places?

I think the biweight Overcount204from20X values and errors should be in this remodelled screen, I will have to think about where/how.  Maybe the dropdown item which are currently listed as "ovc from 207 and ovc from 208" could include these values?  Or insert an additional column that once a selection is made gets populated with the appropriate RM value/error?  We don't use OVC very often, so my workflow on this topic might not jive well with yours. Other suggestions welcome.
I think that we might want to come up with way of outputting a number of summary calculations for RM's so that might be an additional "Report" type.  The suggestions above aren't meant to take the place of that functionality.

version 1.5.0 will demo a solution for further discussion.


[FormControlLabel][material-ui] Child control aligned with multi-line…

Closes #39798
I have made changes that improve the positioning of the control component, i.e Checkbox, Radio or Switch. There are however some things that still need improvement. I tried to only use top alignment, however since there is padding around Checkbox and Radio I could not figure out a way to position them right next to the first line of the label without using margin.
Thus I wanted to ask if there is a good way to check if there has been a linebreak, and base the positioning when that occurs. I have instead made it so the box appears the same way for multi-line labels as it does for a single line label.
.
If any maintainer has any tips or suggestions they are very welcome :)

[x] I have followed (at least) the PR section of the contributing guide.

@mj12albert Do you have any input on the solution?

@mj12albert I fixed the prettier error, however test_static still seems to fail on "yarn prototypes". I haven't touched the API docs which I assume the error is based on, and when I run yarn prototypes locally I get "error Command "prototypes" not found.". Do you have any idea for what may cause it?

@mj12albert I made some good progress I think. With only changes in styling I have made a more concise solution, however I have not been able to apply the styling based on wether the label spans multiple lines or only one yet. I have attached two images to see which one you prefer. The first one has the control component centered on the first line, while the second one has the top of the control component aligned with the first line.

Hi @mj12albert , @PaulKristoffersson ,
In the project I'm developing, I'm being asked to solve exactly this problem - but I don't want to get into that if you're close to fixing it and committing it to the main branch, else whatever I do would probably be broken by your fix. Do you have any sort of ETA on this one?
Many thanks!

@PaulKristoffersson @mj12albert
Hi, do you think there's a chance of this being merged any time soon?
Thanks!

We have been waiting on the fix.
It appears just @mj12albert is required to review it.
When can we expect this to be merged and released?

@mj12albert @zanivan
Hi,
What's the best way of getting this moved forward? Is it actually going to get merged or is this a dead end - if so I need to come up with another solution.
Thanks.

Hey! Sorry for the late response.
We might be able to find a non-breaking change solution, but the current proposal is not it, as it causes the problems @zanivan mentioned.
This is a complex problem, though. Changing the item's alignment and/or the label's line-height won't be enough. I can't dig deep into it right now, but I imagine that if there's a solution, it would involve readjusting the FormControlLabel layout while maintaining the same look for a one-line label. If that's too hard to achieve or impossible, we'll have to wait for v7 for this.


Fix never decrypt CompositePropertySource

CompositePropertySource extends EnumerablePropertySource,
so never exec else if case

@JoneWeng Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@JoneWeng Thank you for signing the Contributor License Agreement!

it's similar :
class Parent {}
class Son extends Parent {}

void foo(Parent p){
   if(p instanceof Parent){

   } else if(p instanceof Son){
   	// never exec here
   }
}

changed:
 if(p instanceof Son){

 } else if(p instanceof Parent){

 }

A unit test, that fails before this change and succeeds after

Squashed and merged with some polish via b606806066a35a1d9deab4b56b56b4b92e50cf01


refine: bind to default VAO when finished drawing

Bind back to the default VAO when finished drawing, the purpose is to keep GL state management clean.

Not sure whether to raise this pr, but my goal is to make the backend as general as possible ☺

Thanks for your contribution but this is unnecessary. The goal of state tracking in the backend is precisely so this kind of cleanup isn't needed.


Edit View for Load Balancing Broken

Inside a Stack View, I click on "edit" on a Load Balancer Config. The Overlay opens, but is empty. I get a JavaScript Error in my Console:
intl.js:184 Uncaught TypeError: i.call is not a function

Useful
Info

Versions
Rancher v1.1.0-dev2 Cattle: v0.161.5 UI: v1.1.2

Access
Disabled

Orchestration
Cattle

Route
environment.index

Related to #4914 ?

You are correct that this is a duplicate of #4914.


Server-Management

Hello,
thanks for your work!
I suggest one thing: Add a "manage" section to the frontend where you can shutdown the server and see the health statistics.
Or at least: Allow a GET-Request for the shutdown url. Many people may not have curl installed locally.
Kind regards
Bastian

Thanks for supporting the tool.
The shutdown and health statistics are provided by default spring boot frame work. They can be hit via any restclient tool/plugin in browser apart from curl command line.


Extracting Signal to Noise data from Raw Files

Hi,
I have used the ThermoRawFileParser for some time now and I'm very happy with the Software!
Is there an option to include the signal to noise data in the mzML as defined in the mzML standard?
[Term]
id: MS:1000517
name: signal to noise array
def: "A data array of signal-to-noise values." [PSI:MS]
xref: binary-data-type:MS\:1000521 "32-bit float"
xref: binary-data-type:MS\:1000523 "64-bit float"

Best,
Georg

Hi @GeorgWa ,
great to hear that you can find good use for ThermoRawFileParser.
The S/N array are not extracted currently, but this feature, certainly, can be added in the future.

Thanks a lot for the fast reply!
Do you know of ressources which describe the Thermo Raw File Reader DLL or the .raw format which could be helpfull for implementing this feature?

Just a quick update. I forked the repository and was able to add the data raw noise data to the mzML output.
https://github.com/GeorgWa/ThermoRawFileParser/commit/10bba51029dbe8e71bc6c04bf244d012e57a2c84
If you are interested I can add this functionality with a pull request. Please let me know:

Do you have any tests which I should run before committing the changes?
Should I just increase the version number myself?
There was no unit associated with the accession for the noise field "MS:1002742". Therefore I left the unit fields empty:

accession = "MS:1002742",
name = "noise array",
cvRef = "MS",
unitCvRef = "",
unitAccession = "",
unitName = "",
value = ""

Is this something I should discuss with the HUPO-PSI team?
Cheers,
Georg

Do you suppose that the noise array should have the same units as the intensity array?

@GeorgWa Great, thank you for active participation. You are welcome to submit PR with the changes you have made, they will be merged into the next release with the other pending changes. Since there aren't any specific tests for signal-to-noise, you can just make sure the tests in ThermoRawFileParserTest solution work. The later requires setting up NUnit - it is sometimes a bit tricky, thus, it is up to you if you are willing to spend time for that. I will run the tests before the merge.
Noise, baseline, charge, and resolution data are only present, for FTMS scans and only for centroids, these properties (to the best of my knowledge) are pre-calculated on the instrument side and stored to a RAW file directly. For profile data and/or non-FTMS scans it is not possible to retrieve these through their library (again, to the best of my knowledge) - these only contain m/z and intensity data. There is, however, a general method GenerateNoiseTable for of Scan objects, that is according to docstring also only relevant for FT data (see below).
// Summary:
//     Generates a "noise and baseline table". This table is only relevant to FT format
//     data. For other data, an empty list is returned. This table is intended for use
//     when exporting processed (averaged, subtracted) scans to a raw file. If this
//     scan is the result of a calculation such as "average of subtract" it may be constructed
//     using an overload which includes a noise and baseline table. If so: that tale
//     is returned. Otherwise, a table is generated by extracting data from the scan.
//
// Returns:
//     The nose and baseline data

I am a bit puzzled what is the use of MS:1002743 - MS:1002745, i.e. how are these different from MS:1002742 - noise array.
I agree that noise and baseline should have the same dimensions as intensity, for example, detector counts; signal-to-noise, however, should be dimensionless, since it is a ratio.
Do you think it would be relevant to have an option to input signal-to-noise directly to mzML, rather than an additional noise array? It can be a substitute of intensity array, it does not seem to broke mzML specs (http://www.peptideatlas.org/tmp/mzML1.1.0.html), there should be at least 2 binaryArray for every spectrum, but no requirements as to which ones.
For example, an option like --snasintensity can swap the representation. What is your opinion?

Yes, Scan objects can contain two types of data streams CentroidStream and SegmentedScan, the first one has centroids - i.e. a set of (m/z, intensity, charge, noise, baseline) vectors; the second one has just (m/z, intensity) vectors. FT scans have both streams, while IT scans contain only SegmentedScan one. If a particular scan was acquired in Profile mode, the profile data end up in SegmentedScan. Preffered-arrays seem to catch one of the two data streams, depending on the scan type. When the mzML:spectrum object is constructed we read masses and intensities directly either from CentroidStream or SegmentedScan depending on the parameters and availability of the data for a particular scan.
If it is find for your needs that noise data is going to be always "centroided", i.e. will be present only at certain subset of m/z values even for profile scans, then the current implementation should work fine. I think, though, it is necessary to describe this peculiarity in the documentation (I can do it before making a release).
If I understand it correctly, MS:1002743 - MS:1002745 are exactly for "centroided" noise data, i.e. they indicate that length of m/z array and noise array are not guaranteed to match, while MS:1002742 is for the case when these two arrays have the same length. Does it make sense to set MS:1002743 for centroided scans, since it will be exact copy of MS:1000514, i.e. is it easier for the downstream processing to have them both?
Does not sampled noise baseline array  (MS:1002745) should also has_units MS:1000131 ! number of detector counts? I guess, that needs to be updated in PSI-MS CV though. @edeutsch

I wonder if we really know what the units of sampled noise baseline array are? Are they really detector counts? Or some other magical number that falls out of a Fourier transform that doesn't really have any units? I don't know.
But in any case, it is reasonable to add the same set of has_units to these terms that we have for others.
I will get it on the docket.

@edeutsch I'm also not sure about sampled noise baseline array. Should MS:1002742 noise array get the same unit as MS:1002744 sampled noise intensity array ?
@caetera
For our use case, having access to the non centroided noise would only be marginal better. As I have not found a way to access this data yet, I sticked to the CentroidStream noise data. Scan.GenerateNoiseTable() gave me the same centroided noise data. Sorry if I missunderstood your previous messages. If there is a way which is more reliable based on different scan type, I'm happy to implement it.
Its definetly an option to skip MS:1002743 for centroided scans. In this case one has to check if MS:1000127 centroid spectrum is present and access MS:1000514 instead of MS:1002743. I can change this behavior, so that MS:1002743 is only included as separate array if the SegmentedScan  data is written. but thats also something which has to be included in the documentation, as its not safe to access MS:1002743. For our use case, inlcuding all three arrays every time would be slightly easier, but I dont have any strong opinions about this. So let me know, what solution you prefer.

@edeutsch good, thank you. I believe baseline is a kind of zero-level intensity and thus should have the same dimension, but I am not 100% sure as well.
@GeorgWa I have asked Jim Shofstahl - the developer of RawFileReader in Thermo if it is possible to get the noise data for profile and low resolution scans. Let's see what will be his response.
I think then it is easier to have both MS:1000514 and MS:1002743 in the output - it will be redundant sometimes, but will make parsing easier afterwards.

Here is the reply of Jim:

With regards to the noise data and low resolution data, the reason that we don’t include it with those scans is the data doesn’t exists (at least what I was told years ago).  With regards to profile data,
I can’t remember the exact reason at the moment.  I would have to check with some of our firmware people on that question.

@caetera
Great, I will keep both MS:1000514 and MS:1002743  if the -N flag is set.
I will test it with our internal data and create a pull request when I'm ready.
Thanks for forwarding the answer from Jim! Id would be great if you can update me if you hear anything else about noise for profile data.

Hi @GeorgWa,
just wonder if you are ready with PR?

Hi @caetera,
please excuse my late reply.
I have updated the README.md to the new help output and created a pull request. #137

Hi @GeorgWa
thank you, I will check and merge it soon.

Merged after fixing sampled noise m/z array f969329c4385073830ee5b412d211b4100f6bd84 and thus closing the issue