Gh 93 function interfaces

Codecov Report

Merging #790 into develop-0.7.0 will decrease coverage by 2%.
The diff coverage is 48.37%.

@@                 Coverage Diff                 @@
##             develop-0.7.0     #790      +/-   ##
===================================================
- Coverage            58.56%   56.56%   -2.01%
+ Complexity            2697     2476     -221
===================================================
  Files                  432      467      +35
  Lines                12498    11814     -684
  Branches              1427     1329      -98
===================================================
- Hits                  7320     6683     -637
+ Misses                4603     4568      -35
+ Partials               575      563      -12

Impacted Files
Coverage Δ
Complexity Δ

.../java/uk/gov/gchq/gaffer/data/element/Element.java
76.47% <ø> (+1.47%)
17 <0> (-1)
:arrow_down:

...a/uk/gov/gchq/gaffer/data/element/id/EntityId.java
0% <ø> (ø)
0 <0> (ø)
:arrow_down:

...va/uk/gov/gchq/gaffer/store/ValidatedElements.java
75% <ø> (ø)
4 <0> (ø)
:arrow_down:

.../uk/gov/gchq/gaffer/operation/data/EntitySeed.java
68.75% <ø> (ø)
8 <0> (ø)
:arrow_down:

...va/uk/gov/gchq/gaffer/operation/data/EdgeSeed.java
92.5% <ø> (ø)
15 <0> (ø)
:arrow_down:

...er/operation/data/generator/EntityIdExtractor.java
81.25% <ø> (+11.25%)
6 <0> (-1)
:arrow_down:

...ain/java/uk/gov/gchq/gaffer/data/element/Edge.java
88.31% <ø> (ø)
24 <0> (ø)
:arrow_down:

...ava/uk/gov/gchq/gaffer/data/element/id/EdgeId.java
0% <ø> (ø)
0 <0> (ø)
:arrow_down:

...n/java/uk/gov/gchq/gaffer/data/element/Entity.java
87.5% <ø> (ø)
16 <0> (ø)
:arrow_down:

...v/gchq/gaffer/data/TransformOneToManyIterable.java
80% <ø> (+3.63%)
7 <0> (+1)
:arrow_up:

... and 209 more

Continue to review full report at Codecov.

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


In GitHub Wiki section, GitHub Pages link is problen

Description

Go to https://github.com/svg-net/SVG/wiki page
Link on GItHub Pages link (http://vvvv.github.io/SVG/)
404 message from GitHub Pages!

Thanks - corrected! This has been forgotten after the move to the organization.


Performance updates for outlines and vllm integration

What behavior of the library made you think about the improvement?
I'm working on ways to increase the throughput for batched requests for vllm when using outlines. Currently, batched operations throughput is highly constrained due to the recreation of tensors from the allowed_tokens list on every iteration. This is found to be due to the following factors:

Conversion of the larger python lists to tensors is slow and can lead to cpu contention, using numpy arrays as an intermediary step does alleviate some of this slowdown.
FSM states_to_token_maps are extracted as a collection of keys and then converted into a list. See: https://github.com/outlines-dev/outlines/blob/main/outlines/fsm/guide.py#L176 This in turn is converted to a tensor on every pass.

I'm looking for more efficient ways to be able to cache the generated tensors to avoid the intermediate steps on every iteration.
Currently the calculated state value for the state machine does not equate to a unique set of tokens that can be cached.
Additionally, because the keys are further wrapped in a list, its impossible to use reference equality on the returned data to determine if the returned allowed_token_ids in fact represents a previously cached result.
I'm currently resorting to using hash over these collections to determine this and hence this improvement consideration.
How would you like it to behave?
Can we make it easier to determine when the FSM is returning a previously generated result maybe as part of the new Instruction concept?
Should we store this information directly to a provided tensor or provide ways to override behaviours to stream tokens to the desired destination in a more memory, cpu & gpu efficient fashion?

Some further context here: https://github.com/vllm-project/vllm/issues/3567


fix: pass rpc pararms to the user's rpc instead of .take()

What kind of change does this PR introduce? (check at least one)

[X] Bugfix
[ ] Feature
[ ] Code style update
[ ] Refactor
[ ] Documentation
[ ] Build-related changes
[ ] Other, please describe:

Does this PR introduce a breaking change? (check one)

[ ] Yes. Issue #___
[X] No

The PR fulfills these requirements:

[X] When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
[ ] A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.

If adding a new feature, the PR's description includes:

[ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Not sure if this needs a changefile


Disable editing dup/inactive camps in admin

Rescue camps should only be editable for admin if its status is active

@biswaz working on it


fix travis by forcing precise

Maybe we don't even need to be doing all this hacking to get R working, and Precise is now un-maintained, but can't think of the quick solution just now.


eye-tracker error fixed

When I try to run eye-tracker.py with python 3 I got the following error message:
File "eye_tracker.py", line 189, in <module>
    eyeball_pos_left = contouring(thresh[:, 0:mid], mid, img, end_points_left)
TypeError: slice indices must be integers or None or have an __index__ method

Therefore I've converted the type of mid to integer. Now it works smoothly!
Thanks for the tutorial and for the code!

@Reka-Berci-Hajnovics Did you run into the following error when you run "python eye_tracker.py":
Traceback (most recent call last):
File "eye_tracker.py", line 154, in
landmark_model = get_landmark_model()
File "/Users/mnchen/dev/ML/gaze_demo/Proctoring-AI/face_landmarks.py", line 30, in get_landmark_model
model = keras.models.load_model(saved_model)
File "/Users/mnchen/dev/ML/gaze_demo/gaze_demo/lib/python3.6/site-packages/tensorflow/python/keras/saving/save.py", line 212, in load_model
return saved_model_load.load(filepath, compile, options)
File "/Users/mnchen/dev/ML/gaze_demo/gaze_demo/lib/python3.6/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 130, in load
_read_legacy_metadata(object_graph_def, metadata)
File "/Users/mnchen/dev/ML/gaze_demo/gaze_demo/lib/python3.6/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 179, in _read_legacy_metadata
node_paths = _generate_object_paths(object_graph_def)
File "/Users/mnchen/dev/ML/gaze_demo/gaze_demo/lib/python3.6/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 204, in _generate_object_paths
for reference in object_graph_def.nodes[current_node].children:
IndexError: list index (0) out of range

Anything wrong with the saved_model checked into the master?

Hi @mchen07 ,
Sorry, but I haven't run into that problem. I added only a simple type conversion from float to int.

@mchen07 pls have a look at #34


Update ReadMe

@fire I moved your description to the wiki instead, I want to keep things short on the ReadMe

@GuilhermeGSousa
Thnx for making the CI/CD working again.
I am trying to catch up how to setup the example project to follow your latest progress.
I know you are going to get there. Just to appreciate your progress and contributions.

The demo project repo needs the same cleanup that this repo is getting, I'll do that once I'm on holidays next week.


test: update k8s to 1.8.14, 1.10.4 and 1.11.0-beta.2

Signed-off-by: André Martins<EMAIL_ADDRESS>

This change is

test-me-please

add to issues: nodeRegistration.criSocket: Invalid value: "unix:///var/run/docker.sock": path is not absolute https://jenkins.cilium.io/job/Cilium-PR-Ginkgo-Tests-K8s/346/execution/node/76/log/?consoleFull

test-me-please

test-me-please

test-me-please

test-me-please

test-me-please

test-me-please

https://jenkins.cilium.io/job/Cilium-PR-Ginkgo-Tests-K8s/363/ was unable to contact apt.kubernetes.io

test-me-please

test-me-please

test-me-please

test-me-please

test-missed-k8s

test-missed-k8s

test-missed-k8s

test-missed-k8s

test-missed-k8s

test-me-please

test-me-please

test-me-please

flake #4615

test-me-please

test-me-please

test-missed-k8s


request()->data does not parse the client data for PUT requests

Flight does not seem to parse the client's post data for PUT requests.
<?php
  // (1) POST
  Flight::route('POST /', function($id) {
    var_dump(Flight::request()->data);
  });
  // (2) PUT
  Flight::route('PUT /', function($id) {
    var_dump(Flight::request()->data);
  });
?>

Then,
$ curl -d 'some=data' http://localhost:8080/ # (1) POST
object(flight\util\Collection)#15 (1) {
  ["data":"flight\util\Collection":private]=>
  array(1) {
    ["some"]=>
    string(4) "data"
  }
}

$ curl -X PUT -d 'some=data' http://localhost:8080/ # (2) POST
object(flight\util\Collection)#15 (1) {
  ["data":"flight\util\Collection":private]=>
  array(0) {
  }
}

I wonder if this is an intended behavior.

That's because PUT data can be anything, not necessarily key value data, so we wouldn't know how to parse it. The request's data property comes from PHP's $_POST variable. If you want to get PUT content you'll have to do Flight::request()->getBody().


home_page.png

Summary
Closes #

Test Plan

It appears this commit only added the background image to the working files, try to continue working on this to get the full home page rendered.


✨ Let dashboard update and archive on staging servers

Currently, updating and archiving is only allowed when working locally. But this means that, if you are working on staging (especially with the new workflow) you can't archive from staging.
This PR lets the dashboard user update and archive steps from local or staging environments (but not from production).
NOTE: I haven't tested it, so I'm not sure if ENV == "production" is the right condition (but I suppose it should be).

Thanks @Marigold, I want the dashboard to be visible in production, but not updating and archiving.


Refactor Vagrant::Helper module. Add spec coverage

Refactor Vagrant::Helpers and add test coverage
Cookbook no longer fails during compile phase if https://dl.bintray.com is
unavailable. You can override node['vagrant']['url'] and
node['vagrant']['checksum'] if you need to download Vagrant from a different
location.

Fixes #37

Will look into this later this week.

Next week ;)

@jtimberman any chance you can merge this week or early next?

@johndkraft, @oifland, can you review?


[🐛 BUG]: RR doesn't respect logs.output.

No duplicates 🥲.

[x] I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?
I have following config:

logs:
    mode: ${RR_LOGS}
    output: /app/tests/Codeception/_output/stderr.log
    err_output: /app/tests/Codeception/_output/stderr.log

After starting road runner I see the output in the console, rather than in the file.
Version (rr --version)
2.7.5
2.11.0-beta.1
Relevant log output
After starting road runner I see the output in the console, rather than in the file.

Hey @Warxcell 👋🏻 .
For the file logger, we have a separate configuration: https://github.com/roadrunner-server/roadrunner/blob/master/.rr.yaml#L115

Hey @Warxcell 👋🏻 . For the file logger, we have a separate configuration: https://github.com/roadrunner-server/roadrunner/blob/master/.rr.yaml#L115

Not according docs: :man_shrugging:
https://roadrunner.dev/docs/beep-beep-logging

Nice catch; I guess we missed this 👍🏻
Could you please try to use a file_logger configuration above?

Nice catch; I guess we missed this 👍🏻 Could you please try to use a file_logger configuration above?

That would be hard to configure thru ENV variables. I will try standard redirect command > file :)

My pleasure ⚡
I'll reopen this issue to have a reference to fix our docs if you wouldn't mind.

docs updated: https://github.com/spiral/roadrunner-docs/commit/5ffca23bfdff3a23cd308a335516c22b5eabab84


Kindly provide access to com.arthenica:mobile-ffmpeg

Hello,
Thanks for this wonderful library which i am using in one of my apps and it works perfectly.
Currently, i would love to do some other tasks with ffmpeg and i see that your library already imports this library. com.arthenica:mobile-ffmpeg.
How do i have access to com.arthenica:mobile-ffmpeg as i ndont want to import it again to prevent my apkk size from becoming too big.
i tried this, import com.arthenica.mobileffmpeg.FFmpeg, it doesnt work

Hello @oluwabajio , you can use executeFFprobe(String command) and executeFFmpeg(String command) to run your own command.

Thank you so much for this, it works.

Hello, Also i want to ask.
Does executeFFmpeg(String command) provide callback to notify me when ffmpeg has finished executing the command

@oluwabajio No, currently this method doesn't provide a callback but your idea sounds good. I'll add this feature tomorrow!

Ok, thanks. I look forward to that.

Hello @oluwabajio , now you can get full access to ffmpeg functional with new AudioTool version 1.2. You should also add ffmpeg dependency to your project implementation 'com.arthenica:mobile-ffmpeg-full:4.3.1.LTS'


[Keyboard Navigation - Power Toys - Fancy Zones > Launch Zone Editor]: Focus gets lost after activating 'Launch Zones Editor' button.

[Power Toys Utility-Launch Zones Editor]
User Impact:
If a user navigates sequentially from one element to another, forced focus changes can confuse the keyboard dependent user. User will face difficulty in interacting with desired element.
Test Environment:
OS Version: 20221.1000
App Name: Power Toy Preview
App Version: v0.23.0
Screen Reader: Narrator
Reproe Steps:

Open Power Toys Settings App.
Navigate to 'Fancy Zones' menu item and activate it. 'Fancy Zone' pane will open.
Navigate to 'Launch Zone Editor' button and activate it. 'Choose your layout for this desktop' window will open.
Observe the issue.

Note:

Same issue is repro after activating Edit Selected layout button. Please refer the attachment, "59_MAS3.2.1_Focus_not_land_choose_layout_fancy_pane.wmv".
This issue is repro for all the dialog which opens thorughout the app.

Actual Result:
Focus gets lost after activating 'Launch Zones Editor' button.
Expected Result:
Focus should not get lost after activating 'Launch Zones Editor' button. Focus should land on first interactive element of the 'Choose your layout for this desktop' window which opens after activating 'Launch Zones Editor' button.
MAS Reference:
https://microsoft.sharepoint.com/teams/msenable/_layouts/15/WopiFrame.aspx?sourcedoc={a4bbd37d-ee11-485e-b5c8-0539f0ac94b2}&cid=1fa2e1bd-4f2b-4da7-ba32-1b5727eb74ae
59_MAS3.2.1_Focus_not_land_choose_layout_fancy_pane.zip
59_UIA.zip
59_MAS3.2.1_Focus_not_land_choose_layout_fancy_window.zip

Shipped with 0.27 release. https://github.com/microsoft/PowerToys/releases/tag/v0.27.0

This issue is still repro on v0.76.2
https://github.com/microsoft/PowerToys/assets/87321414/e6927bd6-8482-4bcd-a753-ddc56a9dcbad


SOQL Language Mode

Whenever I save .soql files, the Language Mode automatically changes to Apex. Unfortunately, the Apex language mode doesn't check for any syntax errors.
So our only option is to develop in SQL, then switch to SOQL so VSCode isn't reporting problems when using things like "NEXT_N_DAYS".
Ideally, either the Apex Language Mode would check for syntax errors, or a separate SOQL language mode would be provided for this purpose.

We have created the initial SOQL language server that is mapped to .soql files.  We still have work to do to flesh it out and enable it for SOQL embedded in Apex.  It will be added the extension pack over time, but for now it's a standalone extension.  Check it out and let us know if you have feedback!  https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-soql


a way to import modules from the project root in pdm_build.py

Is your feature/enhancement proposal related to a problem? Please describe.
i want my pdm_build.py to be able to import from other modules in my project, but this doesn't seem to be possible.
# ./foo.py
foo = 1

# ./pdm_build.py
from foo import foo

but when running pdm install, the foo module seems inaccessible from pdm_build.py:
ModuleNotFoundError: No module named 'foo'

Describe the solution you'd like
a way to make other modules in my project accessible from pdm_build.py

Move backend-related issues to the correct repo

i think the reason this wasn't working for me was because i needed to include that module in source-includes:
[tool.pdm.build]
source-includes = ["foo"]

i think the reason this wasn't working for me was because i needed to include that module in source-includes:

Probably not, use includes instead. Read this section for the difference.


REPL Start/Reload doesn't load current file

This happened after I updated to VSCode (current version 1.10.2), extension version 0.6.1
The :l command isn't sent to the console until after I exit Idris.

Hi @bascott, I can't reproduce your issue, I also work with VSCode 1.10.2 but I can kindly load current file with this command, can you give more detailed description about your issue, IIRC, you use Windows right? Maybe it is OS sensitive issue?

BTW, what do you mean by until after I exit Idris?  Thanks in advance 😄

@zjhmale Yes, I'm on Windows 10. Basically, when I use the command to start the REPL, it starts up in the command line, and then nothing happens. Then I type in :q in the REPL and get an error message:
`The term ":l" is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

:l
~~

CategoryInfo          : ObjectNotFound: (:l:String) [], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException`

So my assumption was that the Extension opens up Idris on the command line then sends the load command (:l) to the REPL using the path to the current file, but the load command doesn't get sent unless I quit the REPL using :q.

Hi @bascott  seems things goes differently between OSX and Windows, the start repl code is here, can you add a windows sensitive patch to that function? Cause I have no windows machine by my hand now 😅 Thanks in advance!

@be5invis Will you also get the same issue here?

@zjhmale I've noticed that they changed the default terminal in Windows for VSCode 1.9.1 from cmd.exe to PowerShell. When I switched back to cmd.exe, it's working fine, so it seems to be a bug on the VSCode side when using the PowerShell terminal.

@bascott Thanks!


Using external values when resolving

Hi
While trying this out I ran into an issue that I've been unable to solve.
Most of our services needs to know the identity of the current user.
In our current DI setup we get this from ambient data when resolving (HttpContext.Current to be specific). I've never liked that much, but I'm not sure there's any way around that in old Asp.Net.
I've been trying to solve that issue with Pure.DI and have come up with 4(5) solutions, but none are to my satisfaction and one doesn't compile. So I'm writing now in the hope of some guidance or ideally pointers to some obvious solution that I've missed.
I'll detail the five solutions here:
Two of the solutions are partially implemented in my fork of this project, but neither have been finished. There's quite a lot of work to do yet and since I'm not really interested in maintaining my own fork, I'm not going to continue the work unless there is some chance of getting the changes merged.
The first api change introduces IConfiguration BindAtResolve<T>(); to IConfiguration. The idea is that T will be added as an argument to the Resolve methods generated and those arguments being used to resolve types of T. I've yet to figure out if adding a new property for these in ResolverMetadata or adding them to ResolverMetadata.Bindings and adding a new binder or something else is the right way to do this.
This change is backwards-compatible and should work well with DependsOn.
The other api change adds generic argument TContextArgs to Setup and adds TContextArgs Args {get;} to IContext. This change requires IConfiguration, IBinding etc. to become generic on TContextArgs. An non-generic overload Setup() => Setup<Unit>() is provided to avoid breaking changes.
The generated Resolve methods will take TContextArgs as first argument unless it is Unit and that argument will then be available in the ctx argument in To<> methods.
This change will not play nice with DependsOn unless TContextArg is the same for all dependencies.
When I started work on this I hadn't understood that ctx mostly (only) acts as a placeholder and isn't actually available at runtime, so it's possible that it's never going to work.
Three of the solutions are using the project as-is and are reproduced in the following:
using System;
using Pure.DI;

namespace AppStart.Pure_DI;

public struct Identity {
    public int UserId;
    // More fields
}

public interface IIdentityService {
    Identity Identity { get; }
}

public class IdentityService: IIdentityService {
    public IdentityService(Identity identity) {
        Identity=identity;
    }

    public Identity Identity { get; }
}

internal class SomeService {
    public SomeService(IIdentityService identityService) {
        IdentityService=identityService;
    }

    public IIdentityService IdentityService { get; }
}

public static class Test {
    public static void Run() {
        Run(new Identity { UserId = 42 });
    }

    public static void Run(Identity ident) {
        // This fails at compile-time. See details in bindings
        SomeService s1 = ComposerX.Resolve<Func<Identity, WithIdentityResolver>>()(ident).Resolve<SomeService>();

        // This fails at run-time. See details in bindings
        SomeService s2 = ComposerX.Resolve<Func<Identity, GenericCompositionRootWithIdentity<SomeService>>>()(ident).Value;

        SomeService s3 = ComposerX.Resolve<Func<Identity, SpecializedCompositionRootWithIdentity>>()(ident).SomeService;
    }
}

class WithIdentityResolver {
    public WithIdentityResolver(IContext resolverContext) {
        ResolverContext=resolverContext;
    }

    public IContext ResolverContext { get; }

    public T Resolve<T>() {
        return ResolverContext.Resolve<T>();
    }
}

internal class GenericCompositionRootWithIdentity<T> {
    public GenericCompositionRootWithIdentity(T value) {
        Value=value;
    }

    public T Value { get; }
}

internal class SpecializedCompositionRootWithIdentity {
    public SpecializedCompositionRootWithIdentity(SomeService someService) {
        SomeService=someService;
    }

    public SomeService SomeService { get; }
}

static partial class ComposerX {

    class CachedService<TService> {
        public TService Service { get; set; }
    }

    static ComposerX() =>
        // out=C:\tmp
        // verbosity=Diagnostic
        DI.Setup()
            .Default(Lifetime.PerResolve)
            .Bind<CachedService<TT>>().To<CachedService<TT>>()
            .Bind<Func<Identity, IdentityService>>().To(ctx => new Func<Identity, IdentityService>(ident =>
                ctx.Resolve<CachedService<IdentityService>>().Service = new(ident)
            ))
            .Bind<IIdentityService>().To(ctx => ctx.Resolve<CachedService<IdentityService>>().Service)
            .Bind<SomeService>().To<SomeService>()

            // Doesn't work because Funcs with generic return values can't be found
            // Cannot resolve an instance System.Func`2[AppStart.Pure_DI.Identity,AppStart.Pure_DI.GenericCompositionRootWithIdentity`1[AppStart.Pure_DI.SomeService]], consider adding it to the DI setup.
            .Bind<Func<Identity, GenericCompositionRootWithIdentity<TT>>>().To(ctx =>
                new Func<Identity, GenericCompositionRootWithIdentity<TT>>(ident => {
                    // This Func resolve ensures that IdentityService is cached for the current resolve
                    ctx.Resolve<Func<Identity, IdentityService>>()(ident);
                    return new(ctx.Resolve<TT>());
                }))

            // Doesn't work because resolves on ctx are rebound and ctx itself is not available in the rewritten Func
            //  error CS0103: The name 'ctx' does not exist in the current context
            //[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)768)]private static System.Func<AppStart.Pure_DI.Identity, AppStart.Pure_DI.WithIdentityResolver> GetPerResolveSystemFuncAppStartPure_DIIdentityAppStartPure_DIWithIdentityResolver(){if( _perResolveSystemFuncAppStartPure_DIIdentityAppStartPure_DIWithIdentityResolver==default(System.Func<AppStart.Pure_DI.Identity, AppStart.Pure_DI.WithIdentityResolver>)){ _perResolveSystemFuncAppStartPure_DIIdentityAppStartPure_DIWithIdentityResolver=                new Func<Identity,WithIdentityResolver>(ident => {
            //( GetPerResolveSystemFuncAppStartPure_DIIdentityAppStartPure_DIIdentityService())(ident);
            //                    return new(ctx);
            //            });
            .Bind<Func<Identity, WithIdentityResolver>>().To(ctx =>
                new Func<Identity, WithIdentityResolver>(ident => {
                    // This Func resolve ensures that IdentityService is cached for the current resolve
                    ctx.Resolve<Func<Identity, IdentityService>>()(ident);
                    return new WithIdentityResolver(ctx);
                }))

            // Does work but will cause binding bloat
            .Bind<Func<Identity, SpecializedCompositionRootWithIdentity>>().To(ctx =>
                new Func<Identity, SpecializedCompositionRootWithIdentity>(ident => {
                    // This Func resolve ensures that IdentityService is cached for the current resolve
                    ctx.Resolve<Func<Identity, IdentityService>>()(ident);
                    return new(ctx.Resolve<SomeService>());
                }))

            ;
}

I'm not really sure where to go from here, so any helpful would be appriciated.
Cheers,
John

Hi
Why you would not just separate logic to setup an identity from some data and to get this identity. Please see my example:
using System;
using Pure.DI;

namespace AppStart.Pure_DI;

public struct Identity {
    public int UserId;
    // More fields
}

public interface IIdentityService {
    Identity Identity { get; }
}

public interface IIdentityConfiguration {
    Identity Identity { set; }
}

// Uses interface segregation to separate the "IIdentityService" from the ability to configure it from some data "IIdentityConfiguration".
public class IdentityService: IIdentityService, IIdentityConfiguration {
    public IdentityService(Identity identity) {
        Identity=identity;
    }

    public Identity Identity { get; set; }
}

internal class SomeService {
    public SomeService(IIdentityService identityService) {
        IdentityService=identityService;
    }

    public IIdentityService IdentityService { get; }
}

public class Program {
    public static void Main() {
        ComposerX.Resolve<Program>().Run(new Identity { UserId = 42 });
    }

    private readonly IIdentityConfiguration _identityConfiguration;
    private readonly SomeService _someService;

    internal Program(IIdentityConfiguration identityConfiguration, SomeService someService)
    {
        _identityConfiguration = identityConfiguration;
        _someService = someService;
    }

    private void Run(Identity ident) {
        _identityConfiguration.Identity = ident;
        // Your logic
    }
}

static partial class ComposerX {
    static ComposerX() =>
        // out=C:\tmp
        // verbosity=Diagnostic
        DI.Setup()
            .Default(Lifetime.PerResolve)
            .Bind<IIdentityService>().Bind<IIdentityConfiguration>().To<IdentityService>()
            .Bind<SomeService>().To<SomeService>()
            .Bind<Program>().To<Program>();
}

Also please see this sample. It is not a problem to configure Pure DI to work with ASP.NET services.

Thanks for the response.
I should have included some motivation and justification, sorry about that.
What you show is what we do today. For asp controllers we do it during injection, using ambient data to get current user, and for background tasks we do it exactly as you describe.
The main problem with this approach is that it's not safe to do any work in constructors, for instance initialization of legacy components, because identity is not yet valid.
For this reason I'm trying to make it so that any service is initialized/usable when it is first seen in the constructor.
Ideally I wouldn't even need IIdentityService and IdentityService, but simply have Identity as a resolvable entity.
I hope that makes it clearer.
I understand that this is not conventional, it's just something I think would make things simpler and more robust.

Yes, thanks for details. May be this approach will be suitable:
using System;
using Pure.DI;

namespace AppStart.Pure_DI;

public struct Identity {
    public int UserId;
    // More fields
}

public interface IIdentityService {
    Identity Identity { get; }
}

// Uses interface segregation to separate the "IIdentityService" from the ability to configure it from some data "IIdentityConfiguration".
public class IdentityService: IIdentityService {
    public IdentityService(Identity identity) {
        Identity=identity;
    }

    public Identity Identity { get; set; }
}

internal class SomeService {
    public SomeService(IIdentityService identityService) {
        IdentityService=identityService;
    }

    public IIdentityService IdentityService { get; }
}

public class Program {
    public static void Main() {
        ComposerX.Resolve<Program>(new Identity { UserId = 42 }).Run();
    }

    private readonly SomeService _someService;

    internal Program(SomeService someService)
    {
        _someService = someService;
    }

    private void Run() {
        // Your logic
    }
}

static partial class ComposerX
{
    private static readonly ThreadLocal<Identity> Identity = new();

    static ComposerX() =>
        // out=C:\tmp
        // verbosity=Diagnostic
        DI.Setup()
            .Default(Lifetime.PerResolve)
            .Bind<IIdentityService>().To<IdentityService>()
            .Bind<SomeService>().To<SomeService>()
            .Bind<Program>().To<Program>()
            .Bind<Identity>().To(ctx => Identity.Value);

    public static T Resolve<T>(Identity identity)
    {
        Identity.Value = identity;
        return Resolve<T>();
    }
}

I did consider ThreadLocal, but dropped the idea again since it felt too much like what I was trying to avoid. In hindsight that was silly.
I ended up fool-proofing it a bit:
[Obsolete("Don't use InnerComposer directly, use Compose instead")]
static partial class InnerComposer {

    private static readonly ThreadLocal<Identity?> Identity = new();

    static InnerComposer() =>
        // out=C:\tmp
        // verbosity=Diagnostic
        DI.Setup()
            .Default(Lifetime.PerResolve)
            .Bind<Identity>().To(ctx => Identity.Value.Value)
            .Bind<IIdentityService>().To(ctx => new IdentityService(ctx.Resolve<Identity>()))
            .Bind<SomeService>().To<SomeService>()
            ;

    internal static T ResolveWithIdentity<T>(Identity identity) {
        Identity.Value = identity;
        T resolved = Resolve<T>();
        Identity.Value = default;
        return resolved;
    }
}

internal static class Composer {
#pragma warning disable CS0618 // Type or member is obsolete
    internal static T Resolve<T>(Identity ident) => InnerComposer.ResolveWithIdentity<T>(ident);
#pragma warning restore CS0618 // Type or member is obsolete
}

Clean and neat.
Thank you very much for help and guidance, it's much appriciated.
In closing I'll note that it's been illimunating to set up our dependency hierarchy in dependency order. This new DI setup much better represents the strata of the application, I'm quite pleased with it.

Looks good in my opinion. But one small thing:
.Bind<IIdentityService>().To(ctx => new IdentityService(ctx.Resolve<Identity>()))
May be it could be replaced something like:
.Bind<IIdentityService>().To<IdentityService>()
and
internal static T ResolveWithIdentity<T>(Identity identity) {
        Identity.Value = identity;
        T resolved = Resolve<T>();
        Identity.Value = default;
        return resolved;
    }

could be replaced:
internal static T ResolveWithIdentity<T>(Identity identity) {
        Identity.Value = identity;
        try {
            return Resolve<T>();
        }
        finally {
            Identity.Value = default;
        }
    }

But still, if you would suggest what an API might look like, which, in your opinion, solves problems, you will share, and I (or we together) will try to add it?
I have another library that solved similar issues like this.
A solution with a "dynamic state" which can be used later when injecting dependencies, works well only if we know the exact initial composition, then only for it can such a method be generated.
But in theory, one might think the user configures Composer as
static partial class InnerComposer<TState> { }
Then all the Resolve methods have one more parameter of type TState (or several), this does not look too clear in the implementation yet. Then we can use this state when resolving the object graph. What do you think?

I've spent some more time on this and I do have some proposals.
The first is regarding the issue discussed in this thread.
Even before adding the binding of Identity to ThreadLocal, I had started splitting things up and combining them with DependsOn.
It turns out that embedding the ambient data in the composer is not compatible with DependsOn as illustrated by the following:
using System.Threading;
using Pure.DI;

namespace AppStart.Pure_DI_Test_DependsOn_1;

struct Identity { }

record CommonService(Identity Identity) {}

record RootService(Identity Identity, CommonService CommonService) {}

internal static partial class CommonComposer1 {
    internal static readonly ThreadLocal<Identity?> AmbientIdentity = new();

    static CommonComposer1() =>
        DI.Setup()
        .Bind<Identity>().To(ctx => AmbientIdentity.Value!.Value)
        .Bind<CommonService>().To<CommonService>()
        ;

    // This works, but is a bit useless. We want to resolve from RootComposer
    internal static T ResolveWithIdentity<T>(Identity identity) {
        AmbientIdentity.Value = identity;
        return Resolve<T>();
    }
}

internal static partial class RootComposer1 {
    static RootComposer1() =>
        DI.Setup()
        .DependsOn(nameof(CommonComposer1))
        .Bind<RootService>().To<RootService>()
        ;

    // This doesn't work because CommonComposer isn't actually used.
    // Generated code for RootComposer below
    internal static T ResolveWithIdentity<T>(Identity identity) {
        CommonComposer1.AmbientIdentity.Value = identity;
        return Resolve<T>();
    }
}

internal static partial class RootComposer1 {
    // ---- 8< ------
    [System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)768)]
    // This doesn't compile. AmbientIdentity doesn't exist in RootCompoase
    internal static AppStart.Pure_DI_Test_DependsOn_1.Identity ResolveIdentity() { return AmbientIdentity.Value!.Value; }
    // ---- 8< ------
}

The fix is simple enough, and arguably cleaner. The ambient data is moved to a seperate class:
using Pure.DI;

namespace AppStart.Pure_DI_Test_DependsOn_2;

struct Identity { public int UserId; }

record CommonService(Identity Identity) { }

record RootService(Identity Identity, CommonService CommonService) { }

internal static partial class CommonAmbientData {
    internal static readonly ThreadLocal<Identity?> Identity = new();
}

internal static partial class CommonComposer2 {

    static CommonComposer2() =>
        DI.Setup()
        .Bind<Identity>().To(ctx => CommonAmbientData.Identity.Value!.Value)
        .Bind<CommonService>().To<CommonService>()
        ;
}

internal static partial class RootComposer2 {
    static RootComposer2() =>
        DI.Setup()
        .DependsOn(nameof(CommonComposer2))
        .Bind<RootService>().To<RootService>()
        ;

    internal static T ResolveWithIdentity<T>(Identity identity) {
        CommonAmbientData.Identity.Value = identity;
        return Resolve<T>();
    }
}

// Generated code
internal static partial class RootComposer2 {
    // ---- 8< ------
    [System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)768)]
    // It now correctly refers to CommonAmbientData.Identity
    internal static AppStart.Pure_DI_Test_DependsOn_2.Identity ResolveIdentity() { return CommonAmbientData.Identity.Value!.Value; }
    // ---- 8< ------
}

As I mentioned in the first message, I've already considered how to extend the api to support this scenario:
using System.Threading;
using Pure.DI;

namespace AppStart.Pure_DI_Test_DependsOn_3;

struct Identity { }
record CommonService(Identity Identity) { }
struct OtherData { }
record RootService(OtherData Data, CommonService CommonService) { }

internal static partial class CommonComposer3 {

    static CommonComposer3() =>
        DI.Setup()
        .ResolveToExternal<Identity>()
        .Bind<CommonService>().To<CommonService>()
        ;

    // The generated Resolve method would have the following signature:
    T Resolve<T>(Identity ext1);
}

internal static partial class RootComposer3 {
    static RootComposer3() =>
        DI.Setup()
        .ResolveToExternal<OtherData>()
        .DependsOn(nameof(CommonComposer3))
        .Bind<RootService>().To<RootService>()
        ;

    // The generated Resolve method would have the following signature:
    T Resolve<T>(Identity ext1, OtherData ext2);
}

I'm not sure making the composer class generic would suffice, because we want those explicit classes to be injected at resolve time.
I went with ResolveToExternal (the name could be anything) over BindToExternal or Bind<T>().ToExternal() to set it apart from the Bind/To combo.
Besides simpler code this api change also eliminates a foot-gun that I tried to get around with the InnerComposer/Composer thing from my last message, where I marked InnerComposer Obsolete to warn about calling Resolve without first setting the required ambient data.
That in turn led to two other nice-to-haves:
For composers whose only purpose is to be depended on, it should be possible to turn off code generation. When I started splitting up my dependencies into seperate composers I ended up with a chain of 5-6 composers where only the lowest would ever be used for resolving anything. One or two of the others could theoretically be used stand-alone, but for most of them it wouldn't make any sense.
The next thing is a different take on the same thing. If it was possible to make the generated resolve methods private, then I could add my own public Resolve methods and have more control.
I actually have one more wish, but it's a completely seperate thing from the current discussion:
Make it possible to resolve multiple types without introducing a composition root
I thought I'd made this work but it's tricky/impossible.
Maybe I should start a seperate question about that.

Thanks for the really great research. As for DependsOn - in fact, this method just copies the set of bindings from one composer to another as is. It doesn't take into account how factories are defined and compilation may not work.

As for ResolveToExternal - good idea and I was thinking something similar :) My method looked like WithArg(string name = ""). name is required, for example, when there are multiple arguments of the same type. According to a set of WithArg, a ResolveContext private class will be generated automatically with a list of all arguments (like for lambda call with context), and dependency resolution will occur taking into account all fields from the ResolveContext class and taking into account the name of the argument - it can be defined as a tag in order to determine which particular parameter will be used (with the same type for instance):
internal static partial class Composer
{
    private static void Setup() => DI.Setup()
        .WithArg<int>("timeout")
        .WithArg<int>("delay")
        .WithArg<string>()
        .Bind<Program>().As(Singleton).To<Program>()
        .Bind<IInput>().Bind<IOutput>().As(Singleton).To<ConsoleAdapter>();
}

class Program
{
    Program(IInput input, IOutput output, [Tag("delay")] int delay, string stringSetting)
    {
    }
}

class ConsoleAdapter: IInput, IOutput
{
    ConsoleAdapter([Tag("timeout")] int timeout)
    {
    }
}

Composer.Resolve<Program>(10, 20, "Abc")

In this case all resolve methods will have this set of arguments

I'm not sure I understand the idea:

The next thing is a different take on the same thing. If it was possible to make the generated resolve methods private, then I could add my own public Resolve methods and have more control.

Could you rephrase please?

Regarding to Make it possible to resolve multiple types without introducing a composition root yes I think it is good idea to create a new ticket and we will continue discussion there

The Arg<>(name) solution looks really nice, for all the reasons you mention.

Could you rephrase or add some details please?

Sure.
When I was messing around with the ambient stuff, I wanted to make sure that you couldn't call Resolve without first setting the ambient data, but the solution Shown here wasn't very nice.
If the generated Resolve method could be made private in the static class, then there'd be no need for all the Obsolete stuff:
// Generated by Pure.DI
internal static partial class Composer{
----- 8< ------

// I'd like to be able to make this private
[System.Runtime.CompilerServices.MethodImplAttribute((System.Runtime.CompilerServices.MethodImplOptions)768)]public static T Resolve<T>(){return (T)Resolver<T>.Resolve();}

----- 8< ------
}

// My implementation
internal static partial class Composer{
    internal static T ResolveWithIdentity<T>(Identity identity) {
        Identity.Value = identity;
        T resolved = Resolve<T>();
        Identity.Value = default;
        return resolved;
    }
}

With Resolve<T> being private, the only way to resolve anything is through ResolveWithIdentity, thus eliminating a potential source of confusion.
As for the "Make it possible to resolve multiple types without introducing a composition root" thing. I could create a new ticket and I wouldn't mind describing my use-case, but by now it'd just be for fun. The real world caught up with me and I had to finish the project I was working on using MeDI. So if you feel there is value in it, I'll go ahead with that.

@johnjuuljensen If you were to do this with MeDI, how would you go about doing it?

@MisinformedDNA Do what? Inject identity? If so: That's partially handled by asp.net core in a blackboxy way. I dump some claims into the ClaimsIdentity in my auth handler, and take a dependency on IHttpContextAccessor to read those claims when I resolve my IdentityService. It's honestly weird and unpleasant and I really hope that there's a better way I never found. I ended up doing it that way because the DI scope of any AuthenticationHandler<> is seperate from the DI scope of the Controller/handler method and the ClaimsIdentity seems to be the only thing that survives between the two scopes.

@johnjuuljensen What I was hinting at is that you might be asking for features that are beyond the scope of a DI container. So if you can demonstrate an existing container that can do what you want, then let's see that and talk about it can transfer over here. But if not, then I'm not sure the project should add features only one person is asking for.

I wanted to emphasize that Pure.DI is not a DI container, it is a code generator that creates code as if we were writing it without containers, but followed the pure DI approach - when we write by hand all the code for creating an object graph. In this case, we were able to pass in some parameters of the constructor the values we need not from the dependency graph. Could pass values from, for example, from some variables. Frankly, I don't often have such needs, but there are no restrictions on this in the pure DI approach I think.

@johnjuuljensen I've create issue #14 about access modifiers

#15 is about multiple types

Please try 1.1.54, the sample is here.

This is great.
Arg is a much better name ofcourse and obvious in hindsight :)
I also tested it with DependsOn and the args propagate nicely to the dependant Resolve methods. Very cool.


fix: Pasting Address with Newline Characters and Spaces Work

Description
I created a new method on the extension of String to filter out all the newline characters and spaces. I then utilized this method in the 2 places we reference the string placed on the UIPasteboard in order to clear out all the newline characters and spaces.
Motivation and Context
This is to address issue #225 .
How Has This Been Tested?
I pasted an example of a testnet bitcoin address and a testnet lightning node address into Atom and then added newlines and spaces at the beginning, middle and end of the address. I then copied those newly created addresses I created and clicked the Paste Address button in the app. When doing this the address was recognized without the newline characters and spaces.
Screenshots (if appropriate):
Types of changes

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[x] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes.
[x] All new and existing tests passed.

Codecov Report

Merging #300 into master will decrease coverage by <.01%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master     #300      +/-   ##
==========================================
- Coverage   11.18%   11.17%   -0.01%
==========================================
  Files         230      230
  Lines        9077     9079       +2
==========================================
  Hits         1015     1015
- Misses       8062     8064       +2

Impacted Files
Coverage Δ

Library/Scenes/ChannelList/ChannelViewModel.swift
0% <0%> (ø)
:arrow_up:

.../Scenes/ModalDetail/Request/RequestViewModel.swift
0% <0%> (ø)
:arrow_up:

...RCodeDetail/ViewModel/NodeURIQRCodeViewModel.swift
0% <0%> (ø)
:arrow_up:

...es/QRCodeScanner/QRCodeScannerViewController.swift
0% <0%> (ø)
:arrow_up:

Library/Extensions/String.swift
0% <0%> (ø)
:arrow_up:

...RCodeDetail/ViewModel/RequestQRCodeViewModel.swift
0% <0%> (ø)
:arrow_up:

...es/ChannelBackup/ChannelBackupViewController.swift
0% <0%> (ø)
:arrow_up:

...ConnectRemoteNode/ConnectRemoteNodeViewModel.swift
0% <0%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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

@ottosuess this one should be ready to go. Let me know if you have any other concerns.

🔥 sweet


Nested record surrealization

Simple example:
class Author
  include Surrealist
  json_schema { { name: String } }
end

class Book
  belongs_to :author
  include Surrealist
  json_schema { { name: String, author: Author } }
end

Book.first.surrealize #=> "{ name: 'Something', author: { name: 'Stephen King' } }"

Complicated Example:
class Question < ActiveRecord::Base
  has_many :answers

  include Surrealist

  json_schema { { name: String, answers: Object } }
end

class Answer < ActiveRecord::Base
  belongs_to :question

  include Surrealist

  json_schema { { name: String, question: Question } }
end

Question.first.build_schema # =>
{
  "name": "qizwuvec",
  "answers": [
    {
      "name": "wvpkeosi",
      "question": null
    },
    {
      "name": "lqmgtryu",
      "question": null
    }
  ]
}

Support nested and self referencing records. See specs for more examples.
TODO:

[x] Support nested collection assocations
[x] Some parameter testing
[x] Inline DOCS
[ ] README update

@nesaulov

Coverage increased (+0.006%) to 99.556% when pulling 21e6109cdd0c35c8f506a4a12d5665142bd01aa8 on AlessandroMinali:nested-record into 04005d5a1d89e7e3bebd9c2432902a5d0c9cebdc on nesaulov:master.

Coverage decreased (-46.2%) to 53.333% when pulling 385f1b7599e995498ebe1e747b44a641c327c005 on AlessandroMinali:nested-record into 04005d5a1d89e7e3bebd9c2432902a5d0c9cebdc on nesaulov:master.

Coverage decreased (-46.2%) to 53.333% when pulling 385f1b7599e995498ebe1e747b44a641c327c005 on AlessandroMinali:nested-record into 04005d5a1d89e7e3bebd9c2432902a5d0c9cebdc on nesaulov:master.

Coverage increased (+0.006%) to 99.556% when pulling 6ee1578d32e079e9726f5c24cc78da5df6a3aac6 on AlessandroMinali:nested-record into 04005d5a1d89e7e3bebd9c2432902a5d0c9cebdc on nesaulov:master.

Coverage decreased (-0.4%) to 99.18% when pulling a6e472a725034a1539b85f34b734d471acf4e7dc on AlessandroMinali:nested-record into 04005d5a1d89e7e3bebd9c2432902a5d0c9cebdc on nesaulov:master.

Coverage increased (+0.04%) to 99.59% when pulling abc938a0e64f9bd09d2e83cd9c6954171ab51755 on AlessandroMinali:nested-record into 04005d5a1d89e7e3bebd9c2432902a5d0c9cebdc on nesaulov:master.

Coverage increased (+0.04%) to 99.614% when pulling 91458a77449c97e123aa5e53ae5acf5917a5da43 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

Coverage increased (+0.04%) to 99.614% when pulling 5560db74a017597e7e7ac37af65bb959d9b049c9 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

Hey, @AlessandroMinali thank you! I didn't have time to look at this. I was also thinking about this kind of feature but for collections while I was covering code for #12. I will take a good look today or tomorrow.

This should work for nested collections, records with associations of
collections, etc. Should be examples in the specs.
There is a bit of nasty recursion going on that I'm not sure how to clean
up. Mainly the fact that is difficult to realize that the recursion is
happening/what it's doing, maybe need better naming and var names.
Regards,
Alessandro http://packmule.ca/about/
On Sat, Oct 21, 2017 at 8:18 AM, Nikita Esaulov<EMAIL_ADDRESS>wrote:

Hey, @AlessandroMinali https://github.com/alessandrominali thank you! I
didn't have time to look at this. I was also thinking about this kind of
feature but for collections while I was covering code for #12
https://github.com/nesaulov/surrealist/issues/12. I will take a good
look today or tomorrow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nesaulov/surrealist/pull/34#issuecomment-338389257,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD845HMO7nS-zfXNxpqXqILMQdG5-q9_ks5sueEFgaJpZM4P52Zy
.

@AlessandroMinali so I have taken a look and I have some questions here (some are placed as inline comments).
Most important thing is, I guess, this:
Answer.first.build_schema
=> {:name=>"ybjwcmze", :question=>{:name=>"absiejlf", :answers=>nil}}
# notice `answers: nil` part here

Answer.first.question.answers
=> [#<Answer:0x00007f9cf5d9e7b8 id: 1, name: "ybjwcmze", question_id: 1>,
 #<Answer:0x00007f9cf5d9e268 id: 4, name: "vsfbpgit", question_id: 1>,
 #<Answer:0x00007f9cf5d9ddb8 id: 8, name: "bikxtmyv", question_id: 1>,
 #<Answer:0x00007f9cf5d9d700 id: 9, name: "iproadhv", question_id: 1>]

I find this confusing. I think it happens because Answer.first.question.answers is an instance of Answer::ActiveRecord_Associations_CollectionProxy, and what we should do is to pass it to #surrealize_collection (actually, build_collection or something). Downside of monkey-patch refusal haha. On the other hand, if we serialize collection from here, we will get question: { answers: nil }. 🤔
JSON.parse(Surrealist.surrealize_collection(Answer.first.question.answers))
=> [{"name"=>"ybjwcmze", "question"=>{"name"=>"absiejlf", "answers"=>nil}},
 {"name"=>"vsfbpgit", "question"=>{"name"=>"absiejlf", "answers"=>nil}},
 {"name"=>"bikxtmyv", "question"=>{"name"=>"absiejlf", "answers"=>nil}},
 {"name"=>"iproadhv", "question"=>{"name"=>"absiejlf", "answers"=>nil}}]

Any thoughts on what can be the right decision here?
Also I unfortunately failed to parse what's going on in Builder right now, maybe it was just a tough day. Anyway there's too much going on there right now and it definitely needs refactoring, but maybe in scope of another issue.

anwser: nil is appearing intentionally in these cases. In that chain of surrealization we are already inside of anwser, if I process it again it begins an infinite self reference. I just display nil instead, following the convention of active model surrealizers(? I think)

Coverage decreased (-61.1%) to 38.462% when pulling f1c037af52c43ca3935e8dac49044384ecc9b4c1 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

Coverage decreased (-61.1%) to 38.462% when pulling f1c037af52c43ca3935e8dac49044384ecc9b4c1 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

Coverage decreased (-61.1%) to 38.462% when pulling f1c037af52c43ca3935e8dac49044384ecc9b4c1 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

Coverage decreased (-61.1%) to 38.462% when pulling c60bec5db53aa20b68ca842a1bd55fb623e68262 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

Coverage increased (+0.04%) to 99.614% when pulling ac53413e3291250bdc89edb73ef07141c783dee7 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

Coverage increased (+0.04%) to 99.614% when pulling ac53413e3291250bdc89edb73ef07141c783dee7 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

@AlessandroMinali I guess nil is okay here. There is one thing left: I think Builder should be refactored in scope of this PR, we need to separate some logic here. I propose a new class (ValueAssigner maybe), whose only responsibility will be assigning values. Because keeping an instance variable (@stack) in Builder can lead to unexpected consequences (especially because it can be accessed publicly). When having a separate class with single responsibility (and single public method) we can cover it with tests and be sure about it's steadiness. And I have found that important thing to keep in mind here is this behaviour:
AA = Class.new
BB = Class.new

stack = [AA, BB, AA, BB, AA]

stack.delete(AA)

stack # => [BB, BB]

So we need to make sure that classes won't be lost inside @stack.

I will begin to look at refactoring Builder.
The example you have given me doesn't really make sense. By definition @stack will never contain two entries that are equal.

Coverage increased (+0.04%) to 99.614% when pulling a73f3dd695f86d0882e10749da9dc32749ca65e9 on AlessandroMinali:nested-record into cf9cad5206aa55a3554fbb51666e82abf4704a4f on nesaulov:master.

https://github.com/nesaulov/surrealist/pull/34/commits/0886b8a3c9ee35c636b9cfe3943b0f5be478c1ac
@nesaulov I am able to delete almost all the code in Builder if we just use recursion...which is what each of those other methods were doing indirectly in a long winded way anyhow.
I think the only thing left to refactor is moving the assign value code out to another class like you mentioned before.

https://github.com/nesaulov/surrealist/pull/34/commits/dd4e2aa6ffd429f8a6321bf1a9a5ee5e88a487ae
@nesaulov creation of new class and finalizing clean up of Builder. I think this PR is at the point of just a review and merge. It's getting pretty hairy.

Wow, that's just wicked! I'm facepalming because of the initial implementation of Builder right now haha.
Yeah, separating concerns is the only thing left here. And maybe we can introduce another struct for transforming params here? There are just too many params here. Or maybe use **params


Create virtual IED does not consider multiple instances of a LNType within a function

Describe the bug
When the user assigns multiple instances of a same LNType (even though instance numbers/prefixes are different) to a Function element;
They are visualized just as normal with no problem like below;

Next, user creates a Virtual IED out of Functions which should turn out to LDs including those LNs within; (expected)

But at the end, it turns out to only last or first LN is included in the datamodel, and others are ignored.
Expected behavior
Expectation is all LNs are part of the datamodel of virtual IED, allocated under LD that is the name of Function element.
Sample SCL below:
DigSub 2 (5) (6).zip

Thanks for the report!

@DavoodSooran can you take a look at it?

I just tried it out myself and can confirm it is a bug!

@Sander3003
As Burak explained, I also added some additional explanations to help developers resolve this issue. In the substation plug-in, when a user assigns multiple instances of the same LNType to a Function element, it should be visualized as shown below:

After that, when the user creates a Virtual IED from the Functions, the LDs should include all the defined LNs.

However, the current issue is that only the last LN is included in the data model, while the others are ignored.

Expected behavior
As Burak mentioned, the expected result is that all LNs should be included in the data model of the virtual IED, allocated under the LD that corresponds to the name of the Function element. Below is the expected outcome after creating the virtual IED:

Notes for takeover
Done

Added lnInst consideration on element string creation (see packages/openscd/src/foundation.ts)

Next steps

Take a closer look at the manually adjusted tests. Were they generated automatically using `web/test-runner'? Does it make sense to customize them manually?

Hi Illia, thanks for taking this issue on!
I'm curious: What's the lnInst consideration? And: Can web/test-runner really automatically generate tests?


Web -  Bank account - Date doesn't give an error when entering wrong date till checkbox is checked

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Open website
Click on Settings > Workspaces > any workspace > Bank account > Connect manually
Reach 2nd step and Enter wrong date for date field and you see that Date doesn't give you an error when entering wrong date till checkbox is checked

Expected Result:
Date should give us an error immadiately when entering wrong date
Actual Result:
Date doesn't give an error when entering wrong date till checkbox is checked
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:

Which of our officially supported platforms is this issue occurring on?

[ ] Android / native
[ ] Android / Chrome
[ ] iOS / native
[ ] iOS / Safari
[x] MacOS / Chrome / Safari
[ ] MacOS / Desktop

Version Number: v1.3.52-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/115492554/c3fd8acf-e9e1-457c-8c60-cbb5437483e9
https://github.com/Expensify/App/assets/115492554/eef466ea-e47d-4500-aa7f-3fa0658c2098
Expensify/Expensify Issue URL:
Issue reported by: @mahmudjontoraqulov
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1691124796866249
View all open jobs on GitHub

I think this is not a bug!

I agree that we do not need to fix this - closing it.


No Longer Compatible With PS4 Bedrock Edition

After testing various projects using this framework, it appears that PS4's Bedrock Edition doesn't work properly any longer.
When using two editions of Bedrock (Win10 and PS4) I am able to complete the handshake and connect using the Win10 edition, however the PS4 edition consistently fails.
When the PS4 is trying to connect, the "Locating server" dialog completely freezes for a few seconds, as if it is processing something, but then it unfreezes and begins to just spin there until I cancel it.
I'm testing with various implementations of the Protocol framework ranging from Nukkit itself (various branches), Geyser, and even DragonProxy.
The closest I've been able to get to connecting is using the "master" branch of Nukkit, however it simply crashes the PS4 version.
To confirm I didn't have a network issue at play, I also tried the official Bedrock server software and confirmed that the PS4 can connect to it without issues.

I just logged in fine with Nukkit 2.0 (which uses this protocol library) on a PS4.

It looks like it may be my PS4 then. Just tried using another one on the same network and MS account, and that one works fine.
I apologize for wasting anyone's time on this.


Feature Concept: Type System

I don't normally branch/merge my own projects, let alone create pull requests.  This is really just a pull request to document my concept for adding a "type system" in libstephen.  I haven't decided whether to spend the significant effort required to implement it, so we'll see where this goes.
Motivation
C's type system is simple and easy to shut up -- two very nice qualities for when you want to be low-level, mashing bits around as you please.  Unfortunately, the direct consequence is that it doesn't offer you much for creating abstractions.  Since data structures are abstract objects that contain pretty much anything, abstractions are kinda the bread and butter of my work.
Currently, libstephen uses C's laissez faire attitude towards types.  My data structures are designed to work with the DATA union, which is capable of holding 64 bit integers, doubles, and pointers (obviously, the library is designed with 64-bit systems in mind, although 32 bit would compile and run).  This means that the data structures can hold any type, and are heterogeneous.  Unfortunately, the downside is that the data structures have no idea how to handle the items that they contain.  So when you go to print the contents of a list, you need to provide a function that can print whatever type of item you have in it.  When you go to sort the items, you need to provide a comparator.  When you want to put things in a hash table, you need to have a hash function.
These issues can't be hidden completely, since they're just part of the way data structures work.  But they could be grouped together into types.  Instead of providing a hash table with a hash function, you could just tell it that you're using strings, and it would use the string hash function.  Plus, then it would know how to compare items for equality.  Two birds, one stone.  The same would apply for all the other type-related behaviors.
In addition, there are several common operations (interfaces) that can be implemented by data structures.  The obvious example being array lists and linked lists both providing list operations.  My current solution is a large "list" struct containing a data pointer and a whole list of function pointers, or else a stripped-down iterator struct.  It would be much nicer if you could just invoke a "get" method on any object, and it would work if that object supported a list-like protocol.
Implementation Idea
I've been learning the Python C API, and I've found plenty of useful ideas in its design.  For one, they represent types with a "type object".  This contains all sorts of function pointers and metadata about a type.  Each object contains as its first member a pointer to a type object.
My implementation of this idea is LsType.  It contains information like the type name, a function to destroy (cleanup) an object's resources, a function to compare two objects, a function to hash, a to-string function, a print function, and an iterator function.  Finally, it contains LsVTable objects, which are arrays of function pointers.  Each LsVTable represents some sort of interface that the object could implement.
For example, take the "list" interface (which I called tp_seq in my code).  It would probably have the following functions:

Get index
Set index
Append
Prepend
Insert
Remove
Length
Maybe others from the smb_list struct.
Each data structure that wanted to implement a list interface would implement these functions, and then stick them in order into a LsVTable.  They would then put that LsVTable into their object's type object under tp_seq.  Then, when people used a function like LsSeq_Get(DATA obj, int index), it would simply work when their object was passed as the first argument.  This would be achieved by the following definition of LsSeq_Get():

#define SEQ_GET some-index-into-the-vtable
DATA LsSeq_Get(LsObject *obj, int index)
{
  LsType *type = obj->type;
  if (type->tp_seq == NULL) {
    fprintf(stderr, "calling LsSeq on unsupported type\n");
    return LSO(NULL);
  } else {
    return type->tp_seq[SEQ_GET](obj, index);
  }
}

There are a few hypothetical types in the code example, but the idea is clear: the function looks up the type as the first item in the structure, gets its tp_seq vtable, and calls the function stored at the index SEQ_GET.  It will work for any object that gives its type a tp_seq implementation.  Pretty neat, and most of the boilerplate code occurs for defining the interface and implementing it.  Using it is pretty darn seamless:
void do_something_with_stuff(LsObject *obj, /* etc */)
{
  DATA value;
  /* ... */
  value = LsSeq_Get(obj, 5);
  /* ... */
}

You can pass an array list, a linked list, or even some other type of sequence into the function and it will Just Work™.
Container types would take a type object, and be homogeneous.  That way, you could store things that aren't LsObject *, but are things like ints.
Pros
The benefits of this system are reasonably evident.  At the end of the day, anybody can implement an interface and give it to already written code, a feat which is not simple in C.
Cons
Unfortunately, there are a whole bunch of downsides to this approach.  First and foremost are the huge implementation costs.  I already have a decent "object system" that defines how object lifetimes work: you have init, create, destroy, and delete functions.  The cost of implementing a new type system on top of all that, and dealing with the refactoring fallout, is huge.  I don't know if I could do that.
The performance would be a bit of an issue too.  After all, every call to something as simple as LsSeq_Get() would involve dereferencing a type object pointer, a null check on the vtable, and a table lookup, just for getting the actual implementation function.  Say goodbye to memory locality (branch prediction would make the null check pretty reasonable).  While performance has never been libstephen's main goal (see: the number of memory allocations), I don't want to be needlessly inefficient.
One final nail in the coffin: libstephen is currently a very generic library.  One giant merit is that, no matter who wrote the code for a data type, chances are you can store it in a smb_ll or smb_al, with no modification to their code.  If I made a type system, I would be ensuring that my data structures are only useful when storing objects that were created with my type system in mind.  That's fine for my personal C programming, but really silly for general purpose development.

No longer even considering this possibility.  It would be a fun side project to work on outside of libstephen, but not appropriate to implement in the library now.


mix cpu and cpus fields on the server detail

instead of having a field called CPUs, mix it into the CPU and do e.g. 3x Intel blah blah

done


Requirements (pt2.txt) installation failed on Ubuntu 22.04

I tried to install requirements on Ubuntu 22.04 using pip in a conda environment with Python 3.11 to do inference on SV3D. I ran into the following issue (only relevant errors included):
error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml
--release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tokenizers

Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

There are also compilation warnings for tokenizers:
      warning: variable does not need to be mutable
         --> tokenizers-lib/src/models/unigram/model.rs:265:21
          |
      265 |                 let mut target_node = &mut best_path_ends_at[key_pos];
          |                     ----^^^^^^^^^^^
          |                     |
          |                     help: remove this `mut`
          |
          = note: `#[warn(unused_mut)]` on by default

      warning: variable does not need to be mutable
         --> tokenizers-lib/src/models/unigram/model.rs:282:21
          |
      282 |                 let mut target_node = &mut best_path_ends_at[starts_at + mblen];
          |                     ----^^^^^^^^^^^
          |                     |
          |                     help: remove this `mut`

      warning: variable does not need to be mutable
         --> tokenizers-lib/src/pre_tokenizers/byte_level.rs:200:59
          |
      200 |     encoding.process_tokens_with_offsets_mut(|(i, (token, mut offsets))| {
          |                                                           ----^^^^^^^
          |                                                           |
          |                                                           help: remove this `mut`

      error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
         --> tokenizers-lib/src/models/bpe/trainer.rs:526:47
          |
      522 |                     let w = &words[*i] as *const _ as *mut _;
          |                             -------------------------------- casting happend here
      ...
      526 |                         let word: &mut Word = &mut (*w);
          |                                               ^^^^^^^^^
          |
          = note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
          = note: `#[deny(invalid_reference_casting)]` on by default

      warning: `tokenizers` (lib) generated 3 warnings
      error: could not compile `tokenizers` (lib) due to 1 previous error; 3 warnings emitted

Could you share more specific setup instructions for SV3D?

Hi, I am having the same issue. Did you solve it?

Hi there, run into the same issue, but I used pyenv to change the Python version to 3.10.0 and it was still not working. May I know how any of you change the Python version to get it working? Thanks!
  warning: variable does not need to be mutable
     --> tokenizers-lib/src/models/unigram/model.rs:265:21
      |
  265 |                 let mut target_node = &mut best_path_ends_at[key_pos];
      |                     ----^^^^^^^^^^^
      |                     |
      |                     help: remove this `mut`
      |
      = note: `#[warn(unused_mut)]` on by default

  warning: variable does not need to be mutable
     --> tokenizers-lib/src/models/unigram/model.rs:282:21
      |
  282 |                 let mut target_node = &mut best_path_ends_at[starts_at + mblen];
      |                     ----^^^^^^^^^^^
      |                     |
      |                     help: remove this `mut`

  warning: variable does not need to be mutable
     --> tokenizers-lib/src/pre_tokenizers/byte_level.rs:200:59
      |
  200 |     encoding.process_tokens_with_offsets_mut(|(i, (token, mut offsets))| {
      |                                                           ----^^^^^^^
      |                                                           |
      |                                                           help: remove this `mut`

  error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
     --> tokenizers-lib/src/models/bpe/trainer.rs:526:47
      |
  522 |                     let w = &words[*i] as *const _ as *mut _;
      |                             -------------------------------- casting happend here
  ...
  526 |                         let word: &mut Word = &mut (*w);
      |                                               ^^^^^^^^^
      |
      = note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
      = note: `#[deny(invalid_reference_casting)]` on by default

  warning: `tokenizers` (lib) generated 3 warnings
  error: could not compile `tokenizers` (lib) due to previous error; 3 warnings emitted

...

----------------------------------------
  ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers which use PEP 517 and cannot be installed directly

(.pt2) xxx@xxx-MacBook-Pro generative-models % python --version
Python 3.10.0


The same view of bookmark and read icons for all resolutions

Bookmark and read icons of mobile view are much comfortable then of desktop.
So, I've made them the same for all views.

the icons are a little bit too big on desktop, no?

They are the same size as on mobile view and a bit less then mouse cursor size.
Previous icons were to small and it was hard to point the cursor on them.
Additionally, icons of a size not smaller than the size of the cursor is a usability best practice for desktop.

I find the icons a bit small on desktop too. The mobile ones have the right size IMO

@fguillot This PR is already a bit less then a year old. I periodically rebase it, but you doesn't merge it. Are you planning to include it into MIniflux or should I close this PR?

For mobile view I understand, but for a desktop is it really necessary?

Personally, on desktop I use mainly keyboard shortcuts. Anyone else have a opinion on this?

Well, before reading I prefer quickly scan unreads and mark as read items I definetly will not read and it's more comfortable to do this by mouse. So small icons make me difficult to point the cursor on them.


should not double encode blank node primaryKey

This is useful in the scenario of updating nested object properties.

hmm, no idea what should I do to pass the checks

@zuobaojing Thanks for your PR, and sorry for this late reply.
Actually I think there is no reason you want to have the blank node at top level or global scope, probably the lib should consider adding the restriction to totally forbid the user pass in the _: prefixed primaryKey.
As to the nested object properties, I believe the lib already recursively handle this by generating the blank node, as code here: Util.js#L91.
FYI:

README#Additional resources
README#Additional resources

Hi @lnshi
My PR was actually a workaround for the use case of updating a nested object or removing a key from a nested object. The workaround is not intend to be a final fix to issues of these two scenarios, but I didn't figure out a correct/prefect method to resolve the issue.
For example I have the following entity:
{
  "primaryKey": "primary-key",
  "name": "This is my name",
  " properties": {
    "key1": "value1",
    "key2": "value2"
  }
}

Update scenario
Since there are no update API in cayley, when I need to update the entity by changing value of properties.key1 to value111, I need to first remove the old triple and then insert a new triple. That is:

call client.delete API with body: { "primaryKey": "primary-key", "properties": {"key1": "value1"} } to remove the old quad
call client.write API with body: { "primaryKey": "primary-key", "properties": {"key1": "value111"} } to add the new quad

ISSUE: the triple primary-key properties<EMAIL_ADDRESS>would also be removed after performing the first step. User could not get key2 until the second step is performed.
Removal scenario
In the case of removing "key1": "value1", I need to:

call client.delete API with body: { "primaryKey": "primary-key", "properties": {"key1": "value1"} } to remove the old triple

call client.write API with body: { "primaryKey": "primary-key", "properties"<EMAIL_ADDRESS>to add back the triple, which should not be removed

My fix was to workaround the issue this way:
Update scenario

call client.delete API with body: { "primaryKey"<EMAIL_ADDRESS>"key1": "value1" } to remove the old quad
call client.write API with body: { "primaryKey"<EMAIL_ADDRESS>"key2": "value111" } to add the new quad

Removal scenario

call client.delete API with body: { "primaryKey"<EMAIL_ADDRESS>"key1": "value1" } to remove the old quad

Appreciate if you could point me to the right direction in case I missed anything.

Ah, partial update concern.
@zuobaojing Can you help to add the test case to prove that after you remove the { "primaryKey": "primary-key", "properties": {"key1": "value1"} }  then you cannot get key2 case first? Actually I doubt this a bit. If it is like that, then lets figure out the solution. Thanks.
@dennwc Any comments?

@lnshi sorry for late response, we decided not to use this lib earlier months ago, and I stopped working on the testing.
Since I have posted the detailed scenarios/repro steps up there, anyone who might be interested please go ahead and fix the issues :)


Loading a model from Python into C++ just for predictions.

Is there example code anywhere of training and saving a model in Python and then loading and using it in C++? I'm not sure of the best/fastest way to do this. Python can save boosters three different ways, save_model, model_to_string, and dump_model. I assume for the C api we would use save_model? I saw some other discussion about saving a model as if statements for C++, too.
If it matters, the predictions would be done one example at a time.

@IsaacLance
Here is the original cpp code for the predict task:
https://github.com/microsoft/LightGBM/blob/b310fb417e4078cc30b153a5ef8f60c06d9ca9cf/src/application/application.cpp#L240-L249
https://github.com/microsoft/LightGBM/blob/master/src/application/predictor.hpp
You can use LightGBM CLI version for prediction via saved from Python model:
https://lightgbm.readthedocs.io/en/latest/Parameters.html#task
#1866
You can load model and then call prediction function from C API:
https://lightgbm.readthedocs.io/en/latest/C-API.html
https://github.com/microsoft/LightGBM/blob/b310fb417e4078cc30b153a5ef8f60c06d9ca9cf/tests/c_api_test/test_.py#L241-L277
#1666
#666
You can use Treelite for model compilation:
https://github.com/dmlc/treelite
You can covert your model to if-else format:
https://lightgbm.readthedocs.io/en/latest/Parameters.html#convert_model
https://github.com/microsoft/LightGBM/blob/b310fb417e4078cc30b153a5ef8f60c06d9ca9cf/.ci/test.sh#L63-L65


Refactor symbolic strings

This PR replaces the occurrences of the symbolic strings like "__repr__" with the appropriate static string.
Closes #463

Hmm, I don't really see the benefits of this. Seems like just using the actual names is more clear...

Maybe the naming of the variables could be betters, but I think that having only one variable located in one specific place, instead of manipulating the strings all over the code base, should be more optimal for the future refactoring.

I don't think the usual "put in constant to ease future refactoring" argument makes sense here though - these values will never change.

For me this seems to make the code harder to read.

I will closing this one then. Should #463 be closed too?


Multi-Shot and Aimed Shot support

Same as with the Steady shot castbar support, having multi and aimed also work would be amazing!
Should be under the Enhancement label

Latest version has Multi-Shot working using the Blizzard cast bar. I realized this was actually in the original addon, but I hadn't fixed it yet in the port. This will mostly fix Aimed Shot too, but I can't test because I don't have it on my Karazhan hunter yet.
The timer is working but the bar doesn't say the spell name for now. Will continue to work on it.
If you're using a castbar other than the default Blizzard one, unfortunately this won't show up there. I use Quartz for example, and it looks like I would need to manually check for Quartz and update that castbar too. This would have to be done for every additional castbar addon.

Multi and Aimed are both working correctly now. Aimed Shot and Steady Shot actually do work with all castbars in TBC by default. Multi-shot is the only one that needs a custom castbar, and that is working as well. All of the shots correctly pause the Auto Shot timer if you cast them at inappropriate times. Aimed Shot interrupts your Auto Shot even if you're drawing, and also resets the swing timer completely  when it finishes.


ConfirmEmail and Password Reset always return invalid token on aspnetcore3 angular template

Here's my code in startup for initializing Identity
            services.AddIdentity<ApplicationUser, IdentityRole>()
                    .AddDefaultTokenProviders()
                    .AddEntityFrameworkStores<ApplicationDbContext>();

            services.AddIdentityServer(options =>
                    {
                        options.UserInteraction.LoginUrl = "/auth/login";
                        options.UserInteraction.LogoutUrl = "/auth/logout";
                    })
                    //.AddDeveloperSigningCredential()
                    .AddApiAuthorization<ApplicationUser, ApplicationDbContext>();

            services.AddAuthentication()
                    //   })
                    .AddIdentityServerJwt();

Here's the password reset generation code:
ForgotPassword.cshtml.cs

    public async Task<IActionResult> OnPostAsync()
    {
      if (ModelState.IsValid)
      {
        var user = await _userManager.FindByEmailAsync(Input.Email);
        if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
        {
          var code = await _userManager.GeneratePasswordResetTokenAsync(user);
          code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
          var callbackUrl = Url.Page(
              "/Account/ResetPassword",
              pageHandler: null,
              values: new { area = "Identity", code },
              protocol: Request.Scheme);

          await _emailSender.SendEmailAsync(
              Input.Email,
              "Reset Password",
              $"Please reset your password by clicking here.", "");

        }
        return RedirectToPage("./ForgotPasswordConfirmation");

      }

      return Page();
    }

ResetPassword.cshtml.cs

        public async Task<IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return Page();
            }

            var user = await _userManager.FindByEmailAsync(Input.Email);
            if (user == null)
            {
                // Don't reveal that the user does not exist
                return RedirectToPage("./ResetPasswordConfirmation");
            }

            var result = await _userManager.ResetPasswordAsync(user, Input.Code, Input.Password);
            if (result.Succeeded)
            {
                return RedirectToPage("./ResetPasswordConfirmation");
            }

            foreach (var error in result.Errors)
            {
                ModelState.AddModelError(string.Empty, error.Description);
            }
            return Page();
        }

Every time I test it with the URL attached to the email, I get InvalidToken.  This happens both with a development certificate locally and with a self-signed certificate in azure as well as a purchased certificate in azure.  Any help would be greatly appreciated since this is affecting real users

I figured out what my issue was, in case anyone stumbles upon this later.  In my startup.cs, I had
  services.Configure<RouteOptions>(options =>
            {
                options.LowercaseUrls = true;
                options.LowercaseQueryStrings = true;
            });
```,

which was causing the Reset Password generated URL to be lowercase, which was making the token invalid.  Removing that code fixed forgot password, although it is a bummer to not be able to force lowercase URLs for the rest of the app but leave that specific one


flask and tkinter for a dialog box (yes or no - start server)

Hi,
I would like to create a dialog box (tkinter) with an on/off button.
When the program starts, it starts the Flask server directly.
And with the button, you can stop or restart it.
But as soon as I run app.run, the dialog box does not work anymore.
I tried with 'threading.Thread' to start flask and tkinter, it works. But in this case I can't stop the flask server.
Can anyone give me a hint?
Thanks
Environment:

Python version: 3.9.6
Flask version: 2.0.1
Tkinter : 8.6

Please use Discussions or Discord/IRC channels for such questions.


change an IP address in docs and config for 9.4+

Addresses https://github.com/ThomDietrich/home-assistant-addons/issues/10

Wonderful. Thanks! 👏


[bug] @tamagui/config default config regressed in v1.5.0

const theme = useTheme()
theme.red <--- does not exist / throws ts error
theme.gray6  <--- does not exist / throws ts error

reprod:
https://github.com/matthewhausman/tamagui-default-config-regression
clone and look at /packages/app/features/home/screen.tsx

Just tested this out myself using the latest starter and I see them coming through, can you verify again sorry.

@natew No worries at all - I'm specifically talking about replacing @tamagui/config-base with @tamagui/config in my project's tamagui.config.js file in the ui directory
I just did a fresh install of the starter and even with the starter's tamagui.config.ts I'm unable to access theme.red for example

Uploading Screen Recording 2023-02-14 at 8.50.26 AM.mov…

https://user-images.githubusercontent.com/25216513/218759500-44e37045-1554-4b1c-b26b-bae15ebbd918.mov

in The above repo I sent - you will definitely not be able to access theme.red from the useTheme hook return val, but replacing @tamagui/config with the deprecated @tamagui/config-base will fix that issue

Figured it out! Sorry about that, fix going out.

Thank you! No worries :)

Check out 1.5.6 lmk if working

Looking good


Create Englisch Version

Checklist

[x] Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
[x] Make sure mvn -P integration-test clean verify runs for the whole project and, if you touched any code for a service in the services folder, ensure it can be run with spring-boot:run

Description

This is spam. Please close this PR.


Calc needs a way to tell what O/S platform it is running on

For instance, the proposed library function "uuid" (see #53) needs to know the platform in order to decide what O/S-specific command to run. Currently we have "versioninfo" to tell us the Calc version, but nothing similar for the platform we're running on. So, maybe:
osinfo -> { name: "windows", version: "10.1.0", ... }
where we could abstract out some of the Environment values to place here.

Another thought on this would be to simply make an uber-object named "info" with "version" and "os" sections:
info -> { version: { major: 1, minor: 2, ... }, os: { name: "windows", ... } }
So instead of "versioninfo" it would be "info.version" and "info.os" similarly.


Open in JOSM is broken after site update

If you try to open in JOSM in new site, the error message is showed (tried in Chrome and Microsoft Edge).
The script is tries to parse a response from RemoteControl as json:
https://github.com/hotosm/oam-browser/blob/dc4687ce9e9ac69486685e543e4f2e39e7a8dad3/src/components/results_item.js#L132
But RemoteControl return as response is simple "OK", so exception is raised and error is shown.

Tested and reproduced in both Chrome and Firefox. We'll need to dig into this some more and see where the issue is coming from.


Version 1.0 or 2.1?

Should this package start at version 1.0.0 or should the version somehow indicate that it's compatible with EF Core 2.1+

My inclination is to stay with our own versioning scheme. Quoting from the reasoning of the EF team a while back, this will leave us unbound from EF Core's release cadence (reference).

+2.1 👌
So we can follow the EF Core

Agree we should go with aligning to EF since this package will likely need to change with every new EF release.


Documentation updation for Azure Postgres setup

Signed-off-by: Shivendra Gangwar<EMAIL_ADDRESS>This PR contains Azure Postgres setup for On Prem Builder.
a.) Managed installation of Postgres
b.) Custom installation of Postgres on Azure vm.

Agreed @mwrock. How to set up Azure Postgres instance is beyond the scope and should be omitted from the documentation. The On-prem setup is working fine without any additional changes to work with Azure RDS. So, updating the comment should be sufficient.

Feel free to merge after squashing commits.


Plex only finds one single channel

In TVH I see all the channels and they work without issues.

@cadowyn  You have to give your channels a Number in TVHeadend, right now everyone you have has 0 probably.


fixed from .measure to .measureInWindow

Changed the function .measure to .measureInWindow
.measure shows incorrect values in android when the status bar is translucent which results in creation of a gap between Flatlist and the dropdown itself.
Without StatusBar Translucent  .measure method

With StatusBar Translucent  .measure method

With StatusBar Translucent  .measureInWindow method

no need of statusBarIsTranslucent prop


Select - option dont want click or select

Describe the bug
First time open select then i want to filter option then i choose option it still change value, after i reopen again the option not filter anymore but in input search there still have value, then i try to choose the option it can't be clicked, after i empty value of filter and i randomly choose option changeValue trigger but in select still have prev value not new one
To Reproduce
Steps to reproduce the behavior:

get data from api
open select component
the option showing
filter value from input search
select one of option
reopen again select component
bug nothing data filter
cannot select the option

Show your code
It will be easier for us to help you if you create a snippet using TE playground and include a link to it in your issue.
Desktop (please complete the following information):

OS: MacOS
Chrome

package.json :

"nuxt": "^2.15.8",
"tw-elements": "^1.0.0",
"vue": "^2.7.10"

this my html

this my hit api

this my script

Hi! Any chance to recreate the issue inside a snippet? https://tailwind-elements.com/snippets/ I cannot recreate the problem.
Did you check if that issue occurs on a new project?

Hi! Any chance to recreate the issue inside a snippet? https://tailwind-elements.com/snippets/ I cannot recreate the problem.
Did you check if that issue occurs on a new project?

Sorry for late reply, i already got the solution this issue if we initFE in 1 page or 1 html and i call many of select it just work in 1  select for the filter then the other not working
so i create Global Select Component and just call the component and it work


Provide automatic installation of PocketSphinx model files

I have assembled a PocketSphinx language model and provided a download here. This includes the PocketSphinx acoustic model. The Melissa users will be ready to go with PocketSphinx by using this download.

I have improved gen_lm_phrase_list.py to include the language mode download from the Sphinx Knowledge Base Tool. The program requires encode.py and streaminghttp.py from Poster. gen_lm_phrase_list.py and the Poster programs are integrated in the Melissa-Core version at my github.

Looks awesome now! Can't wait for all your integrations to be pushed to the primary repository @neilnelson.

Fixed by https://github.com/Melissa-AI/Melissa-Core/pull/49.


Add missing named arguments in ImageDataGenerator in examples

Usage of ImageDataGenerator in the example codes was not up to date with the latest version.
This PR adds missing named arguments of ImageDataGenerator and pass them with their default values.

We don't need to explicitly pass arguments that aren't used in this example, though (which is all those added here).

True, but just thought it would be better to explicitly state all the available options, because they are example codes. Plus they were already passing unused arguments with default values.


Centralized load balancers for TaskQueue and Datastore

Codacy is complaining about a method in TaskQueueServiceStub which comes from the SDK.

Build: https://ocd.appscale.com:8080/job/Daily Build/2869/

Build: https://ocd.appscale.com:8080/job/Daily Build/2877/

Build: https://ocd.appscale.com:8080/job/Daily Build/2879/

Build: https://ocd.appscale.com:8080/job/Daily Build/2888/

Build: https://ocd.appscale.com:8080/job/Daily Build/2890/

https://ocd.appscale.com:8080/job/Daily Build/2913/

Build: https://ocd.appscale.com:8080/job/Daily Build/2928/


fix: indentation in helm chart

SUMMARY
Fix indentation in helm chart
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

[ ] Has associated issue:
[ ] 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

@craig-rueda could you please review?


Need Series Gap Option

First of all, thank you for this project!
We need a way to give individual values their own color.  I'm looking to have all the points be different colors - not all the same color within a region.
I've made changes to the code... I plan a fork and a PR - but I'm not sure of the conditional, of when this would be applied. Currently I'm doing:
if(rel.data.length === 1 && rel.opts.chartColors)

Creating a new issue - the title does not make sense.


Remove keyword from manifest

We currently have six keywords but only five are allowed, remove the "bech32m" (we have "bech32" also).

Tagged and published!

:tada:


Xcode Simulator Problem

Hi
Running "git checkout LISTEN_MODE" as described results in an error message:
"error: pathspec 'LISTEN_MODE' did not match any file(s) known to git"
Thanks

Is this a simple fix or error on my part? Thanks.


How to get an OAuth token on a headless machine?

Hey there! I'm not sure if this is the right place to write about my issue, but I'm working on adding spotify integration to my SmartFrame infoboard using the Authorization code flow. The code works perfectly running on my desktop (ubuntu 20.04 LTS), but on my raspberry pi (zero w running dietpi) that is running the infoboard client, the code hangs when calling spotify.current_user_playing_track()
I've dug around and discovered that the problem is related to my raspberry pi being a headless machine, so there is no way for me to log into spotify via a web browser like how I did on my desktop, meaning spotipy is just hanging waiting for an OAuth token.
How would I get an OAuth token on my headless Raspberry PI? I've heard that I can host a web server on the pi but I've never hosted my own web server so I'm not sure where to start there. Would it be possible to copy/paste the OAuth token from my desktop to my rpi? I know that breaks like a million best practices but this is just for a personal project running on my home network and not for anything that's going to be publicly released.
Thanks for any and all help?
trimmed down code, appropriate try/catches and data collection are in my final code:
import spotipy

from spotipy.oauth2 import SpotifyOAuth

spotify_scope = "user-read-currently-playing"

spotify_user = #open a file and get my spotify username

spotify = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=spotify_scope, redirect_uri="http://<IP_ADDRESS>:9090",
cache_path=".spotifcache", client_id="MYID", client_secret="MYSECRET"))

current_track = spotify.current_user_playing_track() #This causes the code to hang

current_list =spotify.user_playlist(user=spotify_user, playlist_id=current_track["context"]["uri"], fields="name") #This never runs, trycatches are in place incase this returns nothing

To solve this we need to do https://github.com/plamere/spotipy/issues/560


CLOUDP-83921: Offer a suggestion when missing credentials

Proposed changes
Jira ticket: CLOUDP-83921
Checklist

[x] I have added tests that prove my fix is effective or that my feature works
[x] I have added any necessary documentation (if appropriate)
[x] I have run make fmt and formatted my code

Further comments
This PR tries to do something similar to how we offer usage on missing args
mongocli config get
Error: "mongocli config describe" requires 1 argument

Usage:  mongocli config describe <name> [flags]

If there are no credentials then we get something like
mongocli iam projects ls
Error: missing credentials

To set credentials, run: mongocli config

@melissamahoney-mongodb @andreaangiolillo RFAL