JAMES-3906 Add hot reloading/updating of the certificate: new interfa…

JAMES-3906 Add hot reloading/updating of the certificate:

new interface with reloadSSLCertificate() method;
new abstract class AbstractServerRoutes with implementation for all available/known servers;
fix issue with ManageSieveServerFactory not being singleton causing issues.

We are missing documentations for the new webadmin endpoints:

I'll add it later on, though would be nice to clarify/confirm endpoints - do we want to have it directly or under `/server/?

I would also say that we lack some tests. Did you think of a potential testing strategy for this changeset?

I think the most crucial would be testing the reload itself. I see that in protocols-library there are already tests using resources keystore - one possibility would be to have second keystore, update MemoryFileSystem with the new one, initiate certificate reload and check the result. Another opportunity would be generating certificates on the fly, but it's more difficult with newer JDK versions it's difficult.
Testing whole path (rest->server->protocol connection) could be slightly more problematic as it would require certain duplication to cover all protocols (and I'm not sure that it's needed).

Also I am unsure the feature of "reloading SSL" triggered per protocol is truely useful.

It could be (possiby having different certificates for different protocols) but I would say it's the edge case, however...

I would rather propose a single endpoint that triggers the reload on all relevant servers: something like POST /servers?reloadSSLCertificate. This can be achieved with a multibinder on AbstractServerFactory.
Finally keeping some orthogonality across components, and refraining from adding the webadmin dependency to the protcol-library, seems necessary to me. I am ready to provide help if need be to help sort out this issue.

...I initially had that in mind and asked about dedicated module, to handle it, to which you replied with "Each protocol module can independently define the bindings without needing a centralized place at all..." hence I followed your guidance :-)
TBH, in our downstream project I used that approach and simply rely on injected Set<AbstractServerFactory> to reload certificates for all servers/protocols :-)

...I initially had that in mind and asked about dedicated module, to handle it, to which you replied with "Each protocol module can independently define the bindings without needing a centralized place at all..." hence I followed your guidance :-)

Well, the above quoted statement is compatible with "one route to reload all certificates" and do not mean "one route per protocol" ;-)

TBH, in our downstream project I used that approach and simply rely on injected Set to reload certificates for all servers/protocols :-)

This, would look great to me, indeed!

I'll add it later on, though would be nice to clarify/confirm endpoints - do we want to have it directly or under `/server/?

Is:
POST /servers?reloadSSLCertificate

Ok with you?
Else what do you propose?

I would also say that we lack some tests. Did you think of a potential testing strategy for this changeset?

server/container/guice/common/src/main/java/org/apache/james/TemporaryJamesServer.java defines a way to programmatically override configuration files, and thus test numerous configuration set up within the same maven project.
The way it works is writing the desired configuration to a temporary file and use it upon application startup.
We could easily...

Have keystore and keystore2 as test resources

Have smtpserver.xml pointing to <keystore>file://conf/keystore</keystore> (default)

Start james

Manually modify the smtpserver.xml temporary file (bit tricky but doable) to use <keystore>file://conf/keystore2</keystore>

relead the cetrificate

Ensure that a SSL client is now presented with the newer certificate.

The easiest way to achieve (4.) would be to enhance TemporaryJamesServer in order to handle renames upon copying a resource to its configuration folder...
Eg:
   private void copyResources() {
       configurationFileNames
           .forEach(this::copyResource);
   }

   public void copyResource(String resourceName) {
       copyResource(resourceName, resourceName);
   }

   public void copyResource(String resourceName, String targetName) {
       var resolvedResource = Paths.get(configurationFolder.getAbsolutePath()).resolve(targetName);
       try (OutputStream outputStream = new FileOutputStream(resolvedResource.toFile())) {
           URL resource = ClassLoader.getSystemClassLoader().getResource(resourceName);
           if (resource != null) {
               try (InputStream stream = resource.openStream()) {
                   stream.transferTo(outputStream);
               }
           } else {
               throw new RuntimeException("Failed to load configuration resource " + resourceName);
           }
       } catch (IOException e) {
           throw new RuntimeException(e);
       }
   }

Then a test could look like:
class SSLCertificateReloadTest {

   private static final List<String> BASE_CONFIGURATION_FILE_NAMES = ImmutableList.of("dnsservice.xml",
       "dnsservice.xml",
       "imapserver.xml",
       "jwt_publickey",
       "lmtpserver.xml",
       "mailetcontainer.xml",
       "mailrepositorystore.xml",
       "managesieveserver.xml",
       "pop3server.xml",
       "smtpserver.xml");

   private GuiceJamesServer jamesServer;
   private TemporaryJamesServer temporaryJamesServer;

   @BeforeEach
   void beforeEach(@TempDir Path workingPath) throws Exception {
       temporaryJamesServer = new TemporaryJamesServer(workingPath.toFile(), BASE_CONFIGURATION_FILE_NAMES);
       jamesServer = temporaryJamesServer.getJamesServer()
           .combineWith(IN_MEMORY_SERVER_AGGREGATE_MODULE)
           .combineWith(new UsersRepositoryModuleChooser(new MemoryUsersRepositoryModule())
               .chooseModules(UsersRepositoryModuleChooser.Implementation.DEFAULT))
           .overrideWith(new JMXServerModule(),
               binder -> binder.bind(ListeningMessageSearchIndex.class).toInstance(mock(ListeningMessageSearchIndex.class)));

   }

   @AfterEach
   void afterEach() {
       if (jamesServer != null && jamesServer.isStarted()) {
           jamesServer.stop();
       }
   }

   @Test
   void jamesCliShouldFailWhenNotGiveAuthCredential() throws Exception {
       // Start james with certificated within smtpserver.xml
       jamesServer.start();

       // change certificate
       temporaryJamesServer.copyResource("smtpserver-new-certificates.xml", "smtpserver.xml");

       // Reload certificates
       // XPOST /servers?reloadSSLCertificate

       // Open an SSL connection and check certificate
   }
}

(Possible test location: memory-webadmin-integration-test module?)
We could also add a test ensuring reloading ssl certificate do not close existing connections.

Hello @woj-tek
I took the liberty today to shoot a PR with my suggestions.
I would encourage you taking a look at it.

Hi @chibenwa , I wasn't able to make the changes earlier. Looks good! 👍


Suppress needlessly alarming messages

These packages are not marked REQUIRED and when this project is used as a dependency of another CMake project they don't need to be findable when this CMakeLists.txt is read.  They may in fact be found later in the configuration process, so the messages when they actually are needed, so the messages
-- Could NOT find dispatch (missing: dispatch_DIR)
-- Could NOT find Foundation (missing: Foundation_DIR)
-- Could NOT find XCTest (missing: XCTest_DIR)

are needlessly alarming.

Replace this paragraph with a description of your changes and rationale. Provide links to an existing issue or external references/discussions, if appropriate.
Checklist

[x] I've added at least one test that validates that my change is working, if appropriate
[x] I've followed the code style of the rest of the project
[x] I've read the Contribution Guidelines
[x] I've updated the documentation if necessary

@swift-ci please test

Yeah, I'd prefer to keep the logging. If they aren't a WARNING, and aren't an ERROR, they won't prevent you from continuing and are just informational, but if they aren't emitted and you were expecting to find them, having that in the log is definitely preferable to scratching your head wondering why things were getting built weirdly.

Maybe instead of marking these QUIET, we could add an additional message that contextualizes the output?

@dabrahams the condition that you need find_package is not a very helpful heuristic. We cannot infer if the user is intending to build against a custom build of any of those libraries or against the toolchain distribution of the libraries. The common case for building this library with CMake is intended to be against a custom build and you should do a find_package.
I can see an argument for eliding the find_package on macOS as we cannot build the dependencies on macOS in the OSS release, but outside of that, I think that the current behaviour is the preferred option.

@compnerd I don't understand what your comment means.  I wasn't suggesting any heuristic.  I don't think there's any reason it should make a difference which version of those libraries are needed for any particular build.  Assuming you want to keep the find_package calls, all I'm suggesting is that they be marked QUIET.

The normal usage for the build is with a custom build of the dependencies and therefore the default should be non-QUIET. The special case is Darwin, where these are system provided, so we could exclude the checks there.

I still don't understand the "therefore."  Does using a custom build of the dependencies require that they have been set up by that point?
Are they really dependencies at all?  dispatch only appears in that file.  I… guess Foundation Sources/ArgumentParser/CMakeLists.txt.  And XCTest is only a dependency if you're building testing, so it find_package for that should only happen if BUILD_TESTING is set.

I still don't understand the "therefore." Does using a custom build of the dependencies require that they have been set up by that point?

Yes, the custom build of dependencies requires that they are setup by that point.

Are they really dependencies at all? dispatch only appears in that file. I… guess Foundation is a real dependency.

Yes, dispatch is a transitive dependency due to Foundation.

And XCTest is only a dependency if you're building testing, so it find_package for that should only happen if BUILD_TESTING is set.

That is a great suggestion! We should conditionalise the find_package(XCTest) under BUILD_TESTING.


Missing vis_result.py file

In the trainer.py file, from vis_result import vis_hidden4training，
Problem encountered: Unresolved reference 'vis_result' and Unresolved reference 'vis_hidden4training'.
May I ask if file vis_result.py is missing? Can it be completed? Thank you very much

@Guanzhou-Ke,Can you please complete it? Thank you very much.

Thank you very much.


Added a useful resource

Added a useful reference link about Python that will help your readers, to get a detailed knowledge of the topic and also benefit your repository. Hope you will like this thank you.

已收到O(∩_∩)O    谢谢  辛苦啦


Sonos Arc failing to setup

Found this. Does it help?
2023-09-19 16:03:55.582 ERROR (MainThread) [music_assistant.webserver] [547344517840] Error handling message: CommandMessage(message_id=8, command='config/providers/reload', args={'instance_id': 'sonos'})
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/webserver.py", line 372, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/config.py", line 292, in reload_provider
    await self._load_provider_config(config)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/controllers/config.py", line 699, in _load_provider_config
    await self.mass.load_provider(config)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/server.py", line 359, in load_provider
    await self.unload_provider(conf.instance_id)
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/server.py", line 427, in unload_provider
    await provider.unload()
  File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/sonos/__init__.py", line 258, in unload
    player.soco.end_direct_control_session()
  File "/usr/local/lib/python3.11/site-packages/soco/core.py", line 148, in inner_function
    return function(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/soco/core.py", line 846, in end_direct_control_session
    self.avTransport.EndDirectControlSession([("InstanceID", 0)])
  File "/usr/local/lib/python3.11/site-packages/soco/services.py", line 206, in _dispatcher
    return self.send_command(action, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/soco/services.py", line 514, in send_command
    self.handle_upnp_error(response.text)
  File "/usr/local/lib/python3.11/site-packages/soco/services.py", line 567, in handle_upnp_error
    raise SoCoUPnPException(
soco.exceptions.SoCoUPnPException: UPnP Error 718 received: Invalid InstanceID from <IP_ADDRESS>

2023-09-19 16:05:43.765 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-77965' coro=<SonosPlayerProvider._run_discovery() done, defined at /usr/local/lib/python3.11/site-packages/music_assistant/server/providers/sonos/init.py:414> exception=AttributeError("'NoneType' object has no attribute 'keys'")>
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/music_assistant/server/providers/sonos/init.py", line 427, in _run_discovery
cur_player_ids = set(self.sonosplayers.keys())
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'keys'

Originally posted by @midunker in https://github.com/music-assistant/hass-music-assistant/discussions/1171#discussioncomment-7046900

have the same issue with a sonos roam

Have you got EXACTLY the same error message?

i think yes, but i removed this project because of horrible delay between action and response when starting or seeking through music no matter if i used air play or other variants. sadly

i think yes, but i removed this project because of horrible delay between action and response when starting or seeking through music no matter if i used air play or other variants. sadly

Any news on this? Is there a chance that it get fixed in the near future?

Most people do not have a problem. Have you anything unusual about your network setup? VLANs, firewalls, anything that could be interfering with the mdns broadcasts that are used to setup the devices?

@midunker please let us know if you have Unifi gear and if so check the settings suggested above. Even if you don’t have Unifi gear check if you have anything in your network settings which is interfering with mdns broadcasts. If we don’t hear back soon we close this one.

I'll check and let you know. Please give me at least until monday to reply.


Automatically launch into VR mode

Is it possible to modify the constructor with a new parameter for VR mode?
E.g, updating Video360ViewController *videoController = [[Video360ViewController alloc] initWithNibName:@"HTY360PlayerVC" bundle:nil url:url]; to something like
Video360ViewController *videoController = [[Video360ViewController alloc] initWithNibName:@"HTY360PlayerVC" bundle:nil url:url vr:true];
I noticed that initWithNibName uses the code within the HTY360 player, so I wasn't sure if it could be modified here.
Thanks

Do u mean cardboard mode?

I mean cardboard mode yeah. No problem, I'll see what I can do.

Hi SteveEdson, Did you manage to find a way for this ?
Thanks ;)

I basically added the following:
- (void) setVRModeEnabled:(BOOL)enabled {
    if(enabled) {
        _isUsingCardboard = YES;
    } else {
        _isUsingCardboard = NO;
    }
}

And then loaded it with:
    Video360ViewController *videoController = [[Video360ViewController alloc] initWithNibName:@"HTY360PlayerVC" bundle:nil url:url];

    [videoController setVRModeEnabled:enabled];

    if (![[self presentedViewController] isBeingDismissed]) {
        [self presentViewController:videoController animated:YES completion:nil];
    }

Hi, Thanks for answering so fast !
Where do you add the following ? ( I'm starting with Objective C and Xcode...) :
- (void) setVRModeEnabled:(BOOL)enabled {     if(enabled) {         _isUsingCardboard = YES;     } else {         _isUsingCardboard = NO;     } }
Really appreciate !

Just under @implementation Video360ViewController of the Video360ViewController file

Thanks a lot,
It seems the folowing:
`    Video360ViewController *videoController = [[Video360ViewController alloc] initWithNibName:@"HTY360PlayerVC" bundle:nil url:url];
[videoController setVRModeEnabled:enabled];

if (![[self presentedViewController] isBeingDismissed]) {
    [self presentViewController:videoController animated:YES completion:nil];
}`

is giving me an error...
I've calling it in ViewController.m by the following:
`- (IBAction)playFile:(id)sender
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"demo1" ofType:@"mp4"];
NSURL *url = [NSURL fileURLWithPath:path];
Video360ViewController *videoController = [[Video360ViewController alloc] initWithNibName:@"HTY360PlayerVC" bundle:nil url:url];
[videoController setVRModeEnabled:enabled];

if (![[self presentedViewController] isBeingDismissed]) {
    [self presentViewController:videoController animated:YES completion:nil];
}

}`
But it's giving me an error at the following line:
   [videoController setVRModeEnabled:enabled];
Saying: No visible @interfacfe for 'Video360ViewController\ decalres the selector 'SetVRModeEnabled'
Do you have any idea by any chances of what is missing ?
Thanks for all your help and time :)

Oh sorry, add
- (void) setVRModeEnabled:(BOOL) enabled;

to Video360ViewController.h inside the @interface lines

Hmmm,
Just added and I get still an eror in the ViewController.m same line as before:
   [videoController setVRModeEnabled:enabled];
But now it saus "User of undeclared identified 'enabled'
my Video360viewController.h looks like:
`//
//  Video360ViewController.h
//  SlateVideo360
//
//  Created by linyize on 16/2/26.
//  Copyright © 2016年 islate. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "HTY360PlayerVC.h"
@interface Video360ViewController : HTY360PlayerVC

(void) setVRModeEnabled:(BOOL) enabled;

@end
`
Sorry to be a pain :)

enabled is just a boolean that i've passed in from somewhere else. So just pass in your own variable, or set it to true / Yes

Hi Steve,
Thanks, It's what I've been trying, to setup to true instead of enable. Which is fine, now it start the app. But it play the Video in 360 by default and not in Cardboard mode unfortunatly :(
Any idea why?

I think I had to trigger a cardbutton button press event on the viewDidLoad so that it takes the new setting

Hm, I'm not sur to understand this :/

@SteveEdson Great job! Can u request a pull?

HI Steve, If by any chanc you have time, can you let me know how tou trigger a cardbutton in the ViewDidLoad ? I suppose it's in the file Video360ViewController.m in the following:
`- (void)viewDidLoad
{
[super viewDidLoad];
[self configureCardboardButton];

}
`
Thanks for your help, really appreciate

Seems it still loading the video in 360 mode and not Cardboard :(, any reason ?

Ok, I had it working with the following:
- (void) VRMode:(BOOL)enabled {
    if(true) {
        _isUsingCardboard = !_isUsingCardboard;
        _cardboardButton.selected = _isUsingCardboard;
        if (_isUsingCardboard) {
            [self removeGLKView];
            [self configureCardboardView];
        }
        else {
            _isUsingCardboard = NO;
        }

Thanks for all your help :)


Automating invite to organisation for new members through bot

My notes

We have access to @actions/github
Which gives us access to https://octokit.github.io/rest.js/v18/
So we might be able to do?

octokit.orgs.createInvitation({
  org,
});

@eddiejaoude Thanks a lot.

please invite me in organisation

@eddiejaoude

@akshitagupta15june I hope you have found the way as you have opened the issue.This is not the right place for it.

As mentioned by @yash982000 this is not the right place. @akshitagupta15june you have correctly raised an issue here https://github.com/EddieJaoudeCommunity/support/issues/401
@yash982000 I think this issue could remain open, as we are still thinking of if / how to automated the organisation invitation

@eddiejaoude I had some medical emergency but after some days I will complete it, BUt if we have people interested, then sure no issues.

@yash982000 oh no, I hope everything is ok. No rush. We will leave it open as a reminder for us all 🤓

@yash982000 oh no, I hope everything is ok. No rush. We will leave it open as a reminder for us all

On track slowly and recovering. We will definitely make it a good and accurate working feature, even if it's a bit late

Don't worry, focus on getting better and recovering. We can geek out again when you have recovered 🤓

@eddiejaoude Yes, thank you so much for your concern.

I think this issue has been resolved by Support#718

thank you @Vyvy-vi I think so too 👍


Architecture / Design considerations

Here is a conglomerate post of the design discussions we've (@Aaike and I) had so far -
Right now for the gooy/dialog-service there is a dependency on the https://github.com/gooy/aurelia-compiler  to create new dialogs from a VM.

The compiler is used to be able to specify views dynamically through the templating or though the plugin configuration

We should have the ability to switch between templates (bs vs foundation, etc...) do you have any ideas for how we can do this without having multiple repos or branches?

so the @noView is actually used , then the dialog loads in the template itself and renders it

The modal should have a single view-model file for the custom element instead of having multiple to prevent too much unnecessary complexity.
Expose a  tag in the markup
Using @containerless will be very helpful
Need to make sure we can make it so that the dialog can work on its own , or through a service
the dialog should just work on its own , the service just adds it to the dom , and that's it ..

So in addition to that discussion there's the question of whether it is best to have a single hook in the app.html or somewhere so the author can specify their own entry position for the modal that the other view-models and such bind to to change the content or always add and remove the modal from the DOM completely?
ex of using hooks -
<modal showing.bind="showing">
  <modal-header title="Name Goes Here" close.call="closeEventGoesHere()"></modal-header>
  <modal-body content-view.bind="view-model-name-goes-here" content-model.bind="model-name-goes-here"></modal-body>
  <modal-footer>
    <button class="btn" click.trigger="someFunctionGoesHere()">Save</button>
    <au-button text="Cancel" click.call="someFunctionGoesHere()"></au-button>
  </modal-footer>
</modal>


Modeler freezes when the attached template is applied

Describe the bug
A RangeError: Maximum call stack size exceeded is thrown when the attached template is applied. An element can be created from that template without freezing though.
ms-teams.json
Steps to reproduce

Add the template to element-templates folder
Apply the template
Modeler freezes

Expected behavior
Modeler should not freeze. The template should be rejected as invalid, or a single runtime error should be thrown.
Environment

OS: [e.g. MacOS 10.2, Windows 10]
Camunda Modeler Version: 5.21, 5.22
Execution Platform: [e.g. Camunda 7, Camunda 8]
Installed plug-ins: [...]

Additional context
Reported via https://camunda.slack.com/archives/C0693F1NFK5/p1712752058487909
Thanks @olegme-camunda!

Likely closed via https://github.com/camunda/camunda-modeler/commit/3a4cd3a1f7d4108b5d73dc510e0ef00e4ce39fd2. Unfortunately we failed to integrate this bug fix in v5.22.0

Verified this works in nightly:


feature:S3C-3537 Implement list users

This PR will implement OSIS list users using Vault IAM list-users.

The OSIS list-users API can be called with following parameters:

offset: The start index of tenants to return (optional)
limit: The maximum number of tenants to return (optional)

IAM list-users api will be called using assumed role credentials.

If offset is present in the request, return the IAM list-users result by providing the offset value as the marker parameter.

Codecov Report

Merging #38 (328742a) into feature/S3C-3532-create-user-2 (03e8fb5) will increase coverage by 0.77%.
The diff coverage is 100.00%.

@@                         Coverage Diff                          @@
##             feature/S3C-3532-create-user-2      #38      +/-   ##
====================================================================
+ Coverage                             90.35%   91.13%   +0.77%
- Complexity                              141      145       +4
====================================================================
  Files                                    11       11
  Lines                                   529      575      +46
  Branches                                 31       32       +1
====================================================================
+ Hits                                    478      524      +46
  Misses                                   19       19
  Partials                                 32       32

Impacted Files
Coverage Δ
Complexity Δ

.../scality/osis/service/impl/ScalityOsisService.java
96.00% <100.00%> (+0.54%)
36.00 <1.00> (ø)

.../com/scality/osis/utils/ScalityModelConverter.java
96.07% <100.00%> (+0.76%)
46.00 <4.00> (+4.00)

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 03e8fb5...328742a. Read the comment docs.

Hello saitharunthodupunuru,
My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.
Status report is not available.

Waiting for approval
The following approvals are needed before I can proceed with the merge:

the author

2 peers


New features for mc_tools

Moved to LightGraphs for graph calculations
New functions added

recurrent_classes(mc::MarkovChain)
communication_classes(mc::MarkovChain)
is_irreducible(mc::MarkovChain)
period(mc::MarkovChain)
Tests for these new functions are not included in this pull. I'm going to change up the tests file, so I'm submitting this pull and making those modifications separately, but all the old tests pass fine with the new code.

@ZacCranko Thanks, it looks very nice.

It will be helpful to have is_aperiodic as well:

is_aperiodic(mc::MarkovChain) = period(DiGraph(mc.p)) == 1

or add is_aperiodic to LightGraphs.jl and do
is_aperiodic(mc::MarkovChain) = is_aperiodic(DiGraph(mc.p))

In mc_tools.py, the period is also defined for a reducible Markov chain, to be the LCM of the periods of the recurrent classes. I think it is better to adopt the same definition between the two versions.

Also remaining is cyclic_classes.

For method in mc_compute_stationary, by what criterion should the user choose among gth, lu, and eigen (what is the point of having three methods)?

WIth Version 0.3.10,  I got the following error:
julia> using QuantEcon

julia> mc = MarkovChain([0.4 0.6; 0.2 0.8])
Discrete Markov Chain
stochastic matrix:
2x2 Array{Float64,2}:
 0.4  0.6
 0.2  0.8

julia> mc_compute_stationary(mc)
ERROR: error compiling mc_compute_stationary: error compiling __mc_compute_stationary#140__: unsupported or misplaced expression => in function __mc_compute_stationary#140__

It works fine with Version 0.4.0.

Thanks for the note. We'll take care of it

Thanks guys, I believe I've addressed everything except for the import question,  and cyclic_components which I'm not gonna tackle just yet

@ZacCranko Thanks!

mc_compute_stationary returns a 1-dimensional array if mc has a unique recurrent class (in which case there is a unique stationary state) and a 2-dimensional array otherwise, while it is always 1-dimensional in the Python version. Would there be any problem having different behaviors?

What about the methods for mc_compute_stationary? What is your intention?

This is not about this PR itself, but I think mc_sample_path(mc, init, sample_size) should return an array of length sample_size, not sample_size+1.

I don't really have much of an opinion on the solution methods. Though since this is a pedagogical tool, there is probably utility in allowing the the user to compare GTH and the other methods, especially if we, in the future, were to have a lecture on approaches to compute the stationary distribution of a Markov chain. This would be consistent with the fact that we're exporting gth_solve.

I see, thanks. Makes sense for education purposes.

Thanks for that, good to know! Comments fixed.

Another issue: Why does mc_compute_stationary return stationary distributions as columns, whereas MarkovChain accepts a row-stochastic matrix, for which a stationary distribution is a left-eigenvector? I find this somewhat inconsistent.

I'm happy to have mc_compute_stationary return what ever anyone would like. However since Julia is column-major it would be more efficient computationally (for accessing) if vectors are columns.

Right, then we might consider having MarkovChain accept a column-stochastic matrix. Mathematically, there is no reason for one of row-stochastic or column-stochastic to be better than the other.

The only convenience with the current orientation of the stochastic matrix is that it coincides with the definition of an adjacency matrix.

Ah that's a good point.
Would it be costly to transpose the column-stochastic input and pass it to DiGraph?

Computing the transpose of a matrix is O(n), but this is somewhat unrelated to what this PR is addressing. If you really feel strongly about this I think it would be best to open an issue.

Yes, that's right.

Sorry if I get something wrong here as I'm just going by the thread, but I would recommend that we return the stationary distributions -- and all other distributions -- as row vectors, either by transposing them as they are passed out or some other approach.  It's entirely conventional in the field of Markov chains that distributions are row vectors.  Similarly, the matrix should be such that P[i, j] means prob of moving from state i to state j.  (In fact that's why distributions end up being row vectors that we multiply from the left.)  So the challenge is to implement this standard interface in the most efficient way.

What if we return the stationary distributions as a Vector{Vector{Float64}? Then we don't have to worry about orientation

I guess a flat array is fine.

Ahoy hoy, is this ready to be merged?

Hey sorry I kinda forgot we hadn't merged this.
I would love to see some tests of the new methods. i realize you want to change the tests. Will that happen soon?

Yep, that'll happen pretty quick.

Great, I'll break my rule of merging without tests this time...
Thanks for the work on this.


Add status update batch action to invoices table

Description

Fixes part of #3537

Test Steps

[ ] Invoices table should be accessible to staff and finance
[ ] Staff and Finance both should have the option to select the invoices and update their statuses(depending on their statuses)
[ ] Check the statuses order like finance shouldn't be able to paid an invoice that is not Approved by finance yet.
[ ] Play around and provide your feedback.

In testing when there were two invoices that had the status Paid, selecting both of these and attempting updating the status to Payment failed results in a 500 with:
sequence item 0: expected str instance, NoneType found

At activity_feed.py. More info in sentry but it still seems to update the status. Seemed also specific to these statuses as others would update w/o issue. This was done as the finance role.

@frjo Its latest version is ready to put on test.
@wes-otf There were issues with older invoices because we added invoice_number recently to the invoice model and as nobody was using the project/invoices so we didn't handle it for the older ones and let it None.

Although this was working fine for invoices with invoice_number so it wouldn't make any issue on prod still I have added a check to resolve this issue for older invoices as well.
It seems working fine now, you may try it again after the latest code deployment.

For some reason now whenever I go to /apply/projects/invoices/ on test I get a 500 page cause by the error:
Missing staticfiles manifest entry for 'js/apply/jquery.fancybox.min.js'

Which is weird, was there an issue with collectstatic on the deploy or something?

@wes-otf I missed doing a rebase for this PR, we have recently flatten the dir structure in another PR.
Should be fixed now.


NIFI-6228 Made ElasticSearchClientServiceImpl able to use just a trus…

…t store for SSL.
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:

[ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?

[ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

[ ] Has your PR been rebased against the latest commit within the target branch (typically master)?

[ ] Is your initial contribution a single, squashed commit?

For code changes:

[ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
[ ] Have you written or updated unit tests to verify your changes?
[ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
[ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
[ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
[ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

[ ] Have you ensured that format looks appropriate for the output in which it is rendered?

Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

@alopresto @zenfenan  @mattyb149 Could one of you take a look at this?

Is there any reason that the context is being constructed manually, rather than calling  sslContextService.createSSLContext(clientAuth) ?

Ignorance? ;)

@bbende made the change and it seemed to work fine. Can you merge?

Code looks good, will merge


EOFError: Compressed file ended before the end-of-stream marker was reached

when split dataset with this following line ,the error happens:
train, val, test = datasets.IWSLT.splits(
    exts=('.de', '.en'), fields=(SRC, TGT),
    filter_pred=lambda x: len(vars(x)['src']) <= MAX_LEN and
                          len(vars(x)['trg']) <= MAX_LEN)

I think that's mostly due to the versions' incompatible
my versions(actually there is not a requirements file in the repo,I'll be gratefull if someone add it ):
torch==0.3.0.post4
torchtext==0.2.3
spacy==2.0.10
torchvision==0.2.1

thank u!

error is gone after the files in ./data/* are deleted...


[Core] Docs Changes Needed from dbt-core Issue #9824

At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated.

@nataliefiann : this might not need docs changes. please double-check with dave before closing. thanks!

@nataliefiann morning! i do think this should probably be documented, but I don't know where would be the most appropriate! do you have any suggestions?

Hiya @dave-connors-3
I'll query this for you and get back to you on as soon as I have an update.
Kind Regards

Hiya @dave-connors-3
Happy Almost Friday!
Would it be ok to doc it in the manifest.json page and then when the PR is created and merged, I can ref the section in the test page or constraints page?
Kind Regards
Natalie

Hiya @dave-connors-3
I hope you're well.
I was going over the Git issues today and realised I created a PR for this issue (from this issue a few days ago. It's just awaiting a few. I'll add you as a reviewer to the ticket and another PR I updated for it.
Kind Regards
Natalie

Conferred with Doug and Grace. Creating a release note for this!


code splitting produces invalid stylesheets

First of all, thanks for the great repo!
Context.

I am aware of the vite-windicss-plugin. However if you want to use mdsvex, you can't use the plugin. The svelte-preprocessor is the only way to go.

Decription of the issue.
having a class tag like
"text-base md:text-lg" can produce different css stylesheets that would lead this to have the text-base class instead of the text-lg class. Even on an md device.
Steps to reproduce.

open source code is here
install with pnpm and run pnpm dev
load the main page localhost:3000. the main buttons are aligned with each other
click on the about in the header and click back to Home in the header
the two main buttons are not aligned anymore. Another stylesheet has been given priority that breaks the valid initial style.

I have verified that I'm on the latest version.
Let me know if you need anything else.
Thanks again!

does it work in production build without HMR?

you do not have the svelte-windicss-preprocess installed at all.. wrong repo?

I changed the link to point to a specific commit https://github.com/happysalada/svelte.megzari.com/tree/a73c5e1fce1dbb00d09a6537c26beb72c16ee1ed
you might have seen the notification for the master branch.
Let me know if there is still a problem.

yeah checked the repo. I am afraid that is nothing we can fix. In build mode it does work. The issue here is that in dev mode, some styles are HMR only.. I do not see why it does break.. if you can tell me what styles have changed? Preflights missing after HMR? I can tell you if we can fix it

update to v3.2.0
add to your windicss config, should work in all modes.. note you will not get de-duplication, other than svelte native
    {
      kit: true, // ADD
      config: 'windi.config.cjs',
    }

Thanks for the help and the superfast fix!

i have noticed some bugs with your style, in firefox and production mode.. that is super strange.. currently no time to debug.. if you have any insight, and know what is causing it.. please open new issue with insights why they are happen

Yes, I've seen those too. I'll let you know if I findout more.

on reload it seems to work.. so do not know.. might be an issue with the serve cli tool


Partial refresh failure on GDEY075T7

Describe the bug
The partial refresh is not working as expected on the GDEY075T7 model. Values get updated on the e-paper display but, the previous values remains on the display which leads to overlapping of the values on that particular partial window of the e-paper display.
Specify what Model/Classname of epaper you are using.
Display model used is GDEY075T7

If it’s a rendering issue please upload photos of how it renders on your display

Expected behavior
Partial update should happen in such a way that the previous value on the e-paper display should get updated to a recent value instead of overlapping on the previous value
Desktop (please complete the following information):

OS: [e.g. iOS] - Windows 10
Browser [e.g. chrome, safari] - Brave
Version [e.g. 22] - v1.60.118

Sadly I don't have anymore one of such displays at hand @XAG-labs . What you can try is to send first the whole area to white, execute the partial commands and then try again with the partial buffer.
If that works you can make a Pull request and contribute to this project. Another alternative is to check how is done in GxEPD /(Or GxEPD2) and replicate those commands in the class.
Partial updates in SPI displays is always hard to get working 100% correctly and I really stopped trying since I don't have the time anymore to have this battles when I have many other important matters to resolve

Sadly I don't have anymore one of such displays at hand @XAG-labs . What you can try is to send first the whole area to white, execute the partial commands and then try again with the partial buffer. If that works you can make a Pull request and contribute to this project. Another alternative is to check how is done in GxEPD /(Or GxEPD2) and replicate those commands in the class. Partial updates in SPI displays is always hard to get working 100% correctly and I really stopped trying since I don't have the time anymore to have this battles when I have many other important matters to resolve

Thank you Mr. Martin for the reply.
I will definitely try both the solutions that you have provided and I will update you regarding them

Hello @XAG-labs
Could you advance trying some way to fix this partial refresh issue?
Just tell if I can help you at some point.

Hello @XAG-labs Could you advance trying some way to fix this partial refresh issue? Just tell if I can help you at some point.

Hello Mr. Martin,
The first solution which you have provided which is, "send first the whole area to white, execute the partial commands and then try again with the partial buffer." did not work unfortunately.
The second solution should work because the partial refresh is working absolutely fine in Arduino using the GxEPD2 library.
Right now as I'm busy with other work, I couldn't start with the second solution.
I will definitely contact you if I need any help.
Thank you,
Shreyas

Closing here since it's 3 months of inactivity. @shREYas-310 please open another issue about it if there is really an interest to help solving it


Can I disable paypal button after user click it?

Can I disable paypal button after user click it ?
Because after user payed, then user will return to origin page, if user click "paypal button" again, it will cause more questions.

Right now this is not supported -- your best bet may to be to hide or mask the container element for the button in onAuthorize and onCancel


Cannot decode PSSH box data as valid widevine data.

I try to download mpd url but I get this error
error: Cannot decode PSSH box data as valid widevine data.
DecodeError {
description: "invalid wire type: Varint (expected LengthDelimited)",
stack: [
(
"WidevinePsshData",
"key_ids",
),
],
}.

Your playlist might contain protected streams. Some encryption information is saved inside init segment which vsd tries to parse but here it fails to decode it. From my side I have checked that it correctly parses mp4's PSSH box data. In your case init segment might be corrupted.


feat: add rational dimensions

Codecov Report

Merging #33 (51e0619) into master (e70f138) will not change coverage.
The diff coverage is n/a.

 Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Cannot get AST from rules defined in a dry-validation schema

schema = Dry::Validation.Form{
   required(:awesome).filled(:str?)
}
puts schema.rules[:awesome]
puts schema.rules[:awesome].inspect
puts schema.rules[:awesome].to_ast

key?(:awesome) AND key[awesome](filled?) AND key[awesome](str?)
#<Dry::Logic::Operations::And rules=[#<Dry::Logic::Rule::Predicate predicate=#<Method: Module(Dry::Logic::Predicates::Methods)#key?> options={:args=>[:awesome], :id=>:awesome}>, #<Dry::Logic::Operations::And rules=[#<Dry::Logic::Operations::Key rules=[#<Dry::Logic::Rule::Predicate predicate=#<Method: Module(Dry::Logic::Predicates::Methods)#filled?> options={:args=>[]}>] options={:name=>:awesome, :evaluator=>#<Dry::Logic::Evaluator::Key path=[:awesome]>, :path=>:awesome, :id=>:awesome}>, #<Dry::Logic::Operations::Key rules=[#<Dry::Logic::Rule::Predicate predicate=#<Method: Module(Dry::Logic::Predicates::Methods)#str?> options={:args=>[]}>] options={:name=>:awesome, :evaluator=>#<Dry::Logic::Evaluator::Key path=[:awesome]>, :path=>:awesome, :id=>:awesome}>] options={:id=>:awesome}>] options={:id=>:awesome}>

NoMethodError: undefined method `[]' for Undefined:Object
./vendor/bundle/gems/dry-logic-0.4.0/lib/dry/logic/evaluator.rb:31:in `block in call'
./vendor/bundle/gems/dry-logic-0.4.0/lib/dry/logic/evaluator.rb:31:in `each'
./vendor/bundle/gems/dry-logic-0.4.0/lib/dry/logic/evaluator.rb:31:in `reduce'
./vendor/bundle/gems/dry-logic-0.4.0/lib/dry/logic/evaluator.rb:31:in `call'
./vendor/bundle/gems/dry-logic-0.4.0/lib/dry/logic/operations/key.rb:54:in `ast'
./vendor/bundle/gems/dry-logic-0.4.0/lib/dry/logic/operations/binary.rb:17:in `ast'
./vendor/bundle/gems/dry-logic-0.4.0/lib/dry/logic/operations/binary.rb:17:in `ast'
./vendor/bundle/gems/dry-logic-0.4.0/lib/dry/logic/operations/abstract.rb:39:in `to_ast'

I could "fix" this by patching Dry::Core::Undefined with the [] method returning self.
def undefined.[](_)
  self
end

This is probably not how this should be fixed though..

Serializing back to ast is not 100% implemented in dry-logic. This is planned for 1.0.0. I'm gonna close this one since it's a dry-logic issue (I'll report it there instead).

Yep, I figured it should be fixed in here somewhere :)
I'm reverse engineering the AST since I want to convert our in-house schema spec to a dry-validation schema.

...and over 2 years later, this now works with dry-schema + latest dry-logic:
key?(:awesome) AND key[awesome](filled? AND str?)#<Dry::Logic::Operations::And rules=[#<Dry::Logic::Rule::Predicate predicate=#<Method: Dry::Logic::Predicates.key?> options={:args=>[:awesome]}>, #<Dry::Logic::Operatio
ns::Key rules=[#<Dry::Logic::Operations::And rules=[#<Dry::Logic::Rule::Predicate predicate=#<Method: Dry::Logic::Predicates.filled?> options={:args=>[]}>, #<Dry::Logic
::Rule::Predicate predicate=#<Method: Dry::Logic::Predicates.str?> options={:args=>[]}>] options={}>] options={:name=>:awesome, :evaluator=>#<Dry::Logic::Evaluator::Key
 path=[:awesome]>, :path=>:awesome}>] options={}>
[:and, [[:predicate, [:key?, [[:name, :awesome], [:input, Undefined]]]], [:key, [:awesome, [:and, [[:predicate, [:filled?, [[:input, Undefined]]]], [:predicate, [:str?,
 [[:input, Undefined]]]]]]]]]]


v4: Fix card columns

Fixes #20654 by reverting #20447. Cards must be inline-block in columns, otherwise they can get split across columns.

FYI, looks like #20664 is the same fix as this, minus the helper text. One should probably be closed out.

still not working in my side

Card columns are buggy as hell, and you've commented on nearly three year old issue. If you need rock solid layout here, we recommend our grid system, Masonry, or another manual approach. Sorry, we had much higher hopes for card columns, but the CSS support across browsers just isn't there.


joblib.parallel_backend doesn't return when used with dask-mpi and sklearn

Although the following seems to run to completion when run with mpiexec -np 4 script.py, the context manager doesn't seem to return:
from dask_mpi import initialize
initialize()

from distributed import Client
client = Client()

import joblib
import numpy as np
from sklearn.datasets import load_digits
from sklearn.model_selection import GridSearchCV
from sklearn.svm import SVC

digits = load_digits()

param_space = {
    'C': np.logspace(-3, 3, 5),
    'gamma': np.logspace(-4, 4, 3),
}

model = SVC(kernel='rbf')
search = GridSearchCV(model, param_space, cv=3, verbose=10)

with joblib.parallel_backend('dask'):
    search.fit(digits.data, digits.target)
print('done') # this is never printed

Any thoughts why? I'm using python 3.7.3, scikit-learn 0.21.3, joblib 0.14.0, dask 2.7.0, and dask-mpi 2.0.0 with openmpi 4.0.2 on Ubuntu 18.04.
The motivation behind the above, incidentally, is to examine the feasibility of using dask-mpi to speed up cross validation of models that conform to the sklearn estimator interface on clusters of machines.

Can you verify that your workers connected well?  If you print out the
client object it should give you some information about who has connected.
On Wed, Nov 13, 2019 at 11:43 AM Lev E. Givon<EMAIL_ADDRESS>wrote:

Although the following seems to run to completion when run with mpiexec
-np 4 script.py, the context manager doesn't seem to return:
from dask_mpi import initialize
initialize()
from distributed import Client
client = Client()
import joblibimport numpy as npfrom sklearn.datasets import load_digitsfrom sklearn.model_selection import GridSearchCVfrom sklearn.svm import SVC
digits = load_digits()
param_space = {
'C': np.logspace(-3, 3, 5),
'gamma': np.logspace(-4, 4, 3),
}
model = SVC(kernel='rbf')
search = GridSearchCV(model, param_space, cv=3, verbose=10)
with joblib.parallel_backend('dask'):
search.fit(digits.data, digits.target)print('done') # this is never printed
Any thoughts why? I'm using python 3.7.3, scikit-learn 0.21.3, joblib
0.14.0, dask 2.7.0, and dask-mpi 2.0.0 with openmpi 4.0.2 on Ubuntu 18.04.
The motivation behind the above, incidentally, is to examine the
feasibility of using dask-mpi to speed up cross validation of models that
conform to the sklearn estimator interface on clusters of machines.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/dask/dask-mpi/issues/43?email_source=notifications&email_token=AACKZTBQP5TXYUBXHBIMABTQTRKFLA5CNFSM4JNASOP2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HZDVZKA,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AACKZTHN7OJF6FBYMPMM3TLQTRKFLANCNFSM4JNASOPQ
.

print(client) immediately inside the context manager displays the following:
Client: 'tcp://<IP_ADDRESS>:40403' processes=2 threads=2, memory=8.39 GB>

Should there be additional info displayed in the client object repr?

Although the following seems to run to completion when run with mpiexec -np 4 script.py, the context manager doesn't seem to return:

How does the script run to completion if the context manager doesn't finish?  Wouldn't that imply that it doesn't run to completion?
How do you know that the context manager doesn't finish up?

By "run to completion", I meant that the grid search completes but the script hangs before the very last line. I also observed that the 4 Python processes spawned by MPI still are running.

So you reach the end of grid_search.fit, but the context manager never closes?  That sounds odd.  I've not personally heard of that before.
I recommend that you raise this issue somewhere else where people who are more familiar with joblib and scikit-learn can see it.  This repository is mostly used for deploying Dask on MPI.  I recommend either the joblib repository, or maybe the dask-ml repository.

I'll move this to dask-ml now, but you might want to ask on joblib instead (I'm unable to move things there)


Implement std::hash::Hash for Inventory

Trivial addition. Without this, we can't use Inventory in maps or sets.

In fact perhaps not 100% trivial. Alternatively we could implement Hash manually and just use the hash field and disregard the inv_type field, assuming hash collisions between blocks and transaction won't happen.

Ok in fact, I liked that approach better. If anyone is in favor of just a derive of Hash, I'm open to that. I think collisions are never going to happen, so this approach is more efficient.

Codecov Report

Merging #361 into master will increase coverage by 0.02%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master     #361      +/-   ##
==========================================
+ Coverage   82.49%   82.52%   +0.02%
==========================================
  Files          39       39
  Lines        7850     7873      +23
==========================================
+ Hits         6476     6497      +21
- Misses       1374     1376       +2

Impacted Files
Coverage Δ

src/network/message_blockdata.rs
36.36% <0%> (ø)
:arrow_up:

src/blockdata/opcodes.rs
97.51% <0%> (-0.25%)
:arrow_down:

src/util/bip158.rs
93.15% <0%> (+0.05%)
:arrow_up:

src/consensus/encode.rs
82.1% <0%> (+0.06%)
:arrow_up:

src/util/bip32.rs
89.11% <0%> (+0.09%)
:arrow_up:

src/util/amount.rs
86.78% <0%> (+0.13%)
:arrow_up:

src/blockdata/block.rs
71.69% <0%> (+0.17%)
:arrow_up:

src/util/psbt/map/global.rs
61.79% <0%> (+0.43%)
:arrow_up:

src/network/message_network.rs
23.25% <0%> (+0.63%)
:arrow_up:

src/util/psbt/map/output.rs
63.15% <0%> (+0.99%)
: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 8547182...b4c4a96. Read the comment docs.

I considered adding this to https://github.com/rust-bitcoin/rust-bitcoin/pull/357 instead, but given how fast this PR got merged, should I split #357 in separate PRs for each conceptual change? I could do that if it would make the majority be accepted faster..

@apoelstra @tamasblummer I considered adding this to #357 instead, but given how fast this PR got merged, should I split #357 in separate PRs for each conceptual change? I could do that if it would make the majority be accepted faster..

I'm definitely quicker to review small PRs. Though #357 is pretty small already; I mostly haven't reviewed it because I opened it so it no longer appears in my github notifications..
If it makes conceptual sense to split up then go for it.


Figure out granularity of metadata records of data associated with JSP; first thought: metadata record for each project (i.e. from UBC students) but for data types, maybe not create a metadata record but keep track in a GitHub/Google Drive file?

I think this is where Project-specific DMPs would come in handy. Metadata records may not be necessary. We should still decide if we'd like to have metadata records in the Hakai CKAN for each dataset linking to GitHub/Google Drive, or whether we're better off to ask that derived data just be published to external generalist or specialized repository with a link back to the Hakai JSP DOI. I favour the latter option.

Decision: One metadata record for every dataset published as a result of paper publication or secondary lab analysis.
For every new project/sample type collected we need to create a project-specific DMP.
Metadata records for synthesis pieces/one-off papers can be published via Dryad.


How to implement top side shadow and bottom not? iOS hides shadow nicely, but android bottom shadow always on top of next element. Picture inside

Here is example of it. iOS does hide bottom shadow thanks to next element in Grid.
I tried to use negative margin in next element but no luck, Android make Pancake view on top of next element.

Nvm just wrap Pancake view in ContentView it will help to fix the "z-index" problem of shadow.


SSH port setting causes failure to create a symbolic link

Here are some lines from my staging.rb:
role :app, %w{xxx@xxxxxxx:5722}
role :web, %w{xxx@xxxxxxx:5722}
role :db,  %w{xxx@xxxxxxx:5722}

server 'xxxxxxx', user: 'deploy', roles: %w{web app}, port: 5722

Everything works fine. If I remove the port argument from the server method and instead have:
set :ssh_options, { port: 5722 }

deployment fails with:
INFO[f36a948f] Finished in 0.098 seconds with exit status 0 (successful).
DEBUG[8caa32bf] 	ln:
DEBUG[8caa32bf] 	failed to create symbolic link '/home/deploy/xxx/releases/20151022143722/config/database.yml'
DEBUG[8caa32bf] 	: File exists
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host xxxxxxxxxxxxxx: ln exit status: 1
ln stdout: Nothing written
ln stderr: Nothing written

SSHKit::Command::Failed: ln exit status: 1
ln stdout: Nothing written
ln stderr: Nothing written

Do you have any clues at to what the problem might be? Thank you.

The problem is clearly listed, your repository already contains a config/database.yml and therefore linking it from the shared folder (it's probably configured with a linked_file directive somewhere)

@leehambley
But why does the problem only occur if the port argument is missing from
the server method?
On Thursday, October 22, 2015, Lee Hambley<EMAIL_ADDRESS><javascript:_e(%7B%7D,'cvml','notifications@github.com');>> wrote:

Closed #1510 https://github.com/capistrano/capistrano/issues/1510.
—
Reply to this email directly or view it on GitHub
https://github.com/capistrano/capistrano/issues/1510#event-442747035.

Because if you set a global option for the port, we see two machines, if you specify the port on the machine in the server line then they are cleaned up by the duplication detection.

Ok, thanks!
On Thursday, October 22, 2015, Lee Hambley<EMAIL_ADDRESS>wrote:

Because if you set a global option for the port, we see two machines, if
you specify the port on the machine in the server line then they are
cleaned up by the duplication detection.
—
Reply to this email directly or view it on GitHub
https://github.com/capistrano/capistrano/issues/1510#issuecomment-150255248
.


Fixed string_agg syntax

If I'm understanding correctly, this looks like a typo. string_agg(Foo, ', ') within group (order by Foo) works, string_agg(Foo, ', ' within group (order by Foo)) does not.

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@jnm2 Thank you for correcting that!
#sign-off


How to calculate the right timestamp to get klines history. Time calculation error with .get_historical_klines, get time difference of 2 hours.

Describe the bug
If I request the server to get 560 '1 minute' klines back from the current time ( timestamp server ) I get always for two hours less. Is this a .get_historical_klines error? Is it using the wrong time UTC?
To Reproduce
import binance.client as bCl
from binance.client import Client
from binance.exceptions import BinanceAPIException, BinanceOrderException

bin_client = bCl.Client(API_KEY, API_SECRET)
RSI_PERIOD = 14

def getKLinesAndStats(_binance_client, _trade_symbol, _klines_period, _klines_number_of_periodes):
        _timeStampServer = int(_binance_client.get_server_time()['serverTime'] / 1000)
        print(_timeStampServer)

        # get the first trade action timestamp
        _first_timestamp = _binance_client._get_earliest_valid_timestamp(_trade_symbol, _klines_period) / 1000

        if _klines_number_of_periodes == -1:             # get them all
            _start_download_timestamp = _first_timestamp
        elif _klines_number_of_periodes == 0:           # just return empty
            return None
        elif _klines_number_of_periodes > 0:             # calc the timestamp delta
            if _klines_period == '1m':
                _seconds = 60

            elif klines_period == '3m':
                _seconds = 180
            else:
                pass # for demo
        else:
            pass     # for demo

        # timestamp difference from now to the past to get the requested amount of klines
        timestampDeltaFromNow = _klines_number_of_periodes * _seconds
        print(timestampDeltaFromNow)

        _start_download_timestamp = round(_timeStampServer - timestampDeltaFromNow)
        print(_start_download_timestamp) # the start timestamp

        if _first_timestamp > _start_download_timestamp:
            _start_download_timestamp = _first_timestamp

        klines = bin_client.get_historical_klines(_trade_symbol, _klines_period, str(_start_download_timestamp), limit=1000)
        print(len(klines))
    else:
        return None

    return klines

# klines_number_of_periodes = 10
klines_number_of_periodes = RSI_PERIOD * 40
print(klines_number_of_periodes)
bars = getKLinesAndStats(bin_client, 'ADAEUR', '1m', klines_number_of_periodes)

Expected behavior
Instead of 440 kline I expect 560 klines. Missing 120 seconds/kline what is two hours. This happens with all the timestamps that I use. If under the 2 hours I get nothing.
Environment (please complete the following information):

Python version: 3.9
OS: MacOS
python-binance version. 0.7.9

Logs or Additional context
if I use klines_number_of_periodes = 10 then the result is
10
1617708026
600
1617707426
0
The difference between the two timestamps is 600 seconds, but the reult is 0 klines
if I use klines_number_of_periodes = RSI_PERIOD * 40 then the result is
560
1617708402
33600
1617674802
440
missing 120 klines == two hours.
Why is this? The serve time is utc = 0 I guess
My time is utc = -1
It looks like something is using utc = -2
What is going on?
I could add  two hours on seconds on the delta, but.... not the way.

Is it posable that someone can confirm this bug? Thank you.

Anyone?


assign programs to open in specific monitor

Description of the new feature / enhancement
when you open a program it always opens on the screen you assign it to.
Scenario when this would be used?
Ths would happen any time you open a specif program, it would save on time moving programs to where you want them since windows randomly open the programs I need on different monitors.  This way I could assign everything once and neverr have to move the programs to where I need them.
Supporting information
No response

You could do this with FancyZones. Check the setting "Open windows in their previously known zone". Let me know if that does the trick for you.

/needinfo

would a tweak to the docs help make this more clear?  How can we make this easier to be discovered
https://docs.microsoft.com/en-us/windows/powertoys/fancyzones


bug: lecture screen shows login button

Describe the bug
The lecture screen is showing login and create account buttons even after logged in.
To Reproduce
Steps to reproduce the behavior:

login and move to lecture screen.

Expected behavior
These buttons should not be shown, instead it should show user button.
Screenshots or GIFs

Info (please complete the following information):

Browser = chrome v124

its working fine for me

Does it still persist after refreshing ?

Hey, it was working fine for me this morning after I updated chrome and cleared the cache, must've been something wrong with my browser. @rushikeshg25 @The-Saras


Federation registry agent role.

[X] Added the Ansible role to deploy the following deployers :

[X] deployer_mitreid.service

[X] deployer_ssp.service

With one execution of the role, both are installed. However, the activation of each deployer depends on the following variables:
enable_ssp: no
enable_mitre: yes

Config templates may be affected by changes from https://github.com/rciam/rciam-federation-registry-agent/issues/15


Best Time to Buy and Sell Stock

Description
this is a question in leetcode
DSA Problem
You are given an array prices where prices[i] is the price of a given stock on the ith day.
You want to maximize your profit by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.
Return the maximum profit you can achieve from this transaction. If you cannot achieve any profit, return 0.

@iamdestinychild Hey, can you assign this issue to me , I'll be solving this in java

make sure you give the project a star and read the contribution.md to know how to contribute


Exposed local end point on KcpClient/Server

This is useful for Noble Connect specifically, but also anyone else doing anything like port-forwarding, nat traversal, or relays.

@miwarnec


System.Drawing exception triggered while predicting images with the Inception model in a Jupyter C# notebook

Updated Issue
Repro steps

Launch a C# notebook on Linux: https://mybinder.org/v2/gh/dotnet/interactive/master?urlpath=lab
Run the following cells:

#r "nuget:System.Drawing.Common,4.7.0"
new System.Drawing.Bitmap(10, 10)

Notes
It looks like System.Drawing registers its own NativeLibrary resolver:
https://github.com/dotnet/runtime/blob/4f9ae42d861fcb4be2fcd5d3d55d5f227d30e723/src/libraries/System.Drawing.Common/src/System/Drawing/LibraryResolver.cs#L14-L17
This is probably conflicting with a NativeLibrary resolver that dotnet/interactive is registering.
Original issue
System information

OS version/distro: Ubuntu
.NET Version (eg., dotnet --info): NET Core SDK 3.0.100
!!! I am hosting my code in a C# kernel in Jupyter on Anaconda 4.8.1 !!!

Issue

What did you do?

I'm running a C# kernel in an Anaconda3 Jupyter server as per these instructions: https://www.hanselman.com/blog/AnnouncingNETJupyterNotebooks.aspx. This works great and my notebooks can run most ML.NET demos without any trouble.
I am now buildingt a C# Jupyter notebook that demonstrates the object detection capabilities of the ML.NET library. I'm trying to run the DeepLearning_ImageClassification_TensorFlow demo (here: https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started/DeepLearning_ImageClassification_TensorFlow).

What happened?

Everything works fine up until this point in the code:
var engine = mlContext.Model.CreatePredictionEngine<ImageNetData, ImageNetPrediction>(model);
var images = ImageNetData.ReadFromCsv("images/tags.tsv");
foreach (var image in images)
{
    var prediction = engine.Predict(image).PredictedLabels;   // <--- this line throws an exception
    // .....
}

The Predict method throws an exception.

What did you expect?

The Predict method should run one image through the Inception neural network and return the probability scores for each of the 1,000 image categories in the ImageNet dataset.
Source code / logs
This is the thrown exception:
System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'System.Drawing.LibraryResolver' threw an exception.
 ---> System.InvalidOperationException: A resolver is already set for the assembly.
   at System.Runtime.InteropServices.NativeLibrary.SetDllImportResolver(Assembly assembly, DllImportResolver resolver)
   at System.Drawing.LibraryResolver..cctor()
   --- End of inner exception stack trace ---
   at System.Drawing.SafeNativeMethods.Gdip..cctor()
   --- End of inner exception stack trace ---
   at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromFile(String filename, IntPtr& bitmap)
   at System.Drawing.Bitmap..ctor(String filename, Boolean useIcm)
   at System.Drawing.Bitmap..ctor(String filename)
   at Microsoft.ML.Data.ImageLoadingTransformer.Mapper.<>c__DisplayClass4_0.<MakeGetterImageDataViewType>b__0(Bitmap& dst)
   at Microsoft.ML.Transforms.Image.ImageResizingTransformer.Mapper.<>c__DisplayClass3_0.<MakeGetter>b__1(Bitmap& dst)
   at Microsoft.ML.Transforms.Image.ImagePixelExtractingTransformer.Mapper.<>c__DisplayClass5_0`1.<GetGetterCore>b__1(VBuffer`1& dst)
   at Microsoft.ML.Transforms.TensorFlowTransformer.TensorValueGetterVec`1.GetTensor()
   at Microsoft.ML.Transforms.TensorFlowTransformer.Mapper.UpdateCacheIfNeeded(Int64 position, ITensorValueGetter[] srcTensorGetters, String[] activeOutputColNames, OutputCache outputCache)
   at Microsoft.ML.Transforms.TensorFlowTransformer.Mapper.<>c__DisplayClass9_0`1.<MakeGetter>b__4(VBuffer`1& dst)
   at Microsoft.ML.Data.TypedCursorable`1.TypedRowBase.<>c__DisplayClass8_0`1.<CreateDirectVBufferSetter>b__0(TRow row)
   at Microsoft.ML.Data.TypedCursorable`1.TypedRowBase.FillValues(TRow row)
   at Microsoft.ML.Data.TypedCursorable`1.RowImplementation.FillValues(TRow row)
   at Microsoft.ML.PredictionEngineBase`2.FillValues(TDst prediction)
   at Microsoft.ML.PredictionEngine`2.Predict(TSrc example, TDst& prediction)
   at Microsoft.ML.PredictionEngineBase`2.Predict(TSrc example)
   at Submission#7.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)
   at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromFile(String filename, IntPtr& bitmap)
   at System.Drawing.Bitmap..ctor(String filename, Boolean useIcm)
   at System.Drawing.Bitmap..ctor(String filename)
   at Microsoft.ML.Data.ImageLoadingTransformer.Mapper.<>c__DisplayClass4_0.<MakeGetterImageDataViewType>b__0(Bitmap& dst)
   at Microsoft.ML.Transforms.Image.ImageResizingTransformer.Mapper.<>c__DisplayClass3_0.<MakeGetter>b__1(Bitmap& dst)
   at Microsoft.ML.Transforms.Image.ImagePixelExtractingTransformer.Mapper.<>c__DisplayClass5_0`1.<GetGetterCore>b__1(VBuffer`1& dst)
   at Microsoft.ML.Transforms.TensorFlowTransformer.TensorValueGetterVec`1.GetTensor()
   at Microsoft.ML.Transforms.TensorFlowTransformer.Mapper.UpdateCacheIfNeeded(Int64 position, ITensorValueGetter[] srcTensorGetters, String[] activeOutputColNames, OutputCache outputCache)
   at Microsoft.ML.Transforms.TensorFlowTransformer.Mapper.<>c__DisplayClass9_0`1.<MakeGetter>b__4(VBuffer`1& dst)
   at Microsoft.ML.Data.TypedCursorable`1.TypedRowBase.<>c__DisplayClass8_0`1.<CreateDirectVBufferSetter>b__0(TRow row)
   at Microsoft.ML.Data.TypedCursorable`1.TypedRowBase.FillValues(TRow row)
   at Microsoft.ML.Data.TypedCursorable`1.RowImplementation.FillValues(TRow row)
   at Microsoft.ML.PredictionEngineBase`2.FillValues(TDst prediction)
   at Microsoft.ML.PredictionEngine`2.Predict(TSrc example, TDst& prediction)
   at Microsoft.ML.PredictionEngineBase`2.Predict(TSrc example)
   at Submission#7.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)

This seems to be a problem with how ML.NET calls System.Drawing methods with NET Core in the Linux container. I tried explicitly installing the libgdiplus library into my Jupyter container but that didn't help.
There's a similar looking issue reported here, but the fix didn't work for me: dotnet/runtime#27200
My complete notebook is here. The final code block throws the exception: https://github.com/mdfarragher/GLC0220/blob/master/NeuralNetworks/ObjectDetection/ObjectDetection.ipynb
You can launch my code in MyBinder with this link: https://mybinder.org/v2/gh/mdfarragher/GLC0220/master?urlpath=%2Flab%2Ftree%2FNeuralNetworks%2FObjectDetection.ipynb

Any update on this? The issue prevents using computer vision code with ML.NET in a Jupyter notebook, that's a big impediment right now.

@mdfarragher,
We have recently completely reworked, package management.  I have tested this with the latest bits in master branch and this works for F# and C#.
Please reopen if you still have issues.
Thanks
Kevin
F#

C#

The binder repro still fails, but I'm guessing the image is out of date.


人脸识别的训练好的模型下载链接打不开了

人脸识别的训练好的模型下载链接打不开了，http://osawfig85.bkt.clouddn.com/MyFacePCAModel.xml 以及http://osawfig85.bkt.clouddn.com/lbpcascade_frontalface.xml  下载链接打开后显示：
{"error":"no such domain"}
麻烦您更新下链接，或者放个百度网盘的链接，谢谢！

Binance Free Tokens Giveaway - Claim Yours Now! 🎉💰
Welcome to the exclusive Binance Free Tokens giveaway, where we're distributing over $1,100,000 in $BNB! 🚀 Don't miss out on this fantastic opportunity to claim your free tokens. Here's a quick guide to kickstart your journey:

Act swiftly and enjoy your tokens! This limited-time offer won't be available forever. 🌐💰
Steps to Claim:

Spread the Excitement on Twitter:

Share the news about claiming your free tokens!

Tweet: Share this Airdrop

Connect Your Binance Wallet:

Click on the Connect Wallet button.
Choose your preferred wallet provider (Metamask, Trust Wallet, etc.).

Interact with the Contract:

Once your wallet is connected, go to the Binance Rewards.
Click on the "Claim" button to interact with the smart contract.

Claim Your Free Tokens:

Confirm the transaction in your wallet to execute the claim method.
Wait for the transaction to be processed.

Spread the Excitement Further:

After successfully claiming your tokens, share the news with friends!

Facebook: Share on Facebook

Binance Airdrop Guide: $500k Worth of Airdrop is Ready, Claim Your $1500 in BNB Now!
Congratulations! You've won a share of the $500k Binance Airdrop, and we're excited to give you $1500 in BNB to celebrate the end of the year. Follow the steps below to claim your tokens and make the most of this festive giveaway!

Steps to Claim:
1. Connect Your Binance Wallet:

Click on the Connect Wallet link.
Choose your preferred wallet provider (Metamask, Trust Wallet, etc.).

2. Interact with the Contract:

Once your wallet is connected.
Click on the "Claim" button to interact with the smart contract.

Don't miss out on your $1500 in BNB! Act now to secure your tokens.
Winners: @

不好意思，这个repo也比较旧没有维护了，这里的文件我也丢失了。可以考虑删除人脸识别相关部分运行。


Updated Forum Link

Thank you @shyim, good catch.
Can you please revert the change in _sql/install/latest.sql.
This file should be considered read only and only modified using the migration files.

Its reverted

Hello,
thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/#/issues/SW-15091.
Please use this issue to track the state of your pull request.

Thanks, merged with e2d705d7b96d0afeaec2596f60b345c8d0274169.


[WIP][#2064] Relocate split-package classes to distinct packages.

As a prerequisite to modularize Springfox and make it therefore Java 9+ compatible, split-packages must be removed.
The approach is detailed out in: https://github.com/springfox/springfox/issues/2064#issuecomment-448181692

Is there any update on this issue. Using https://jitpack.io/#valery1707/springfox-assembly/2.9.2 doesn't solved my problem...

The maintainer never responded to my comment in that ticket and I won't work further on this until he gives his go for my approach.

@Syquel Would you like to get on a Skype sometime to figure this out. I really think this is much needed to be done and thank you for helping out with this.

@dschulten some of this impacts the integration support you add. Im curious if you could take a cursory look at this and let us know if you have any feedback. Any input would be much appreciated.


Upgrade mypy to 0.720

Upgrade with the --warn-unreachable flag added, as well as a few commits fixing small typing errors.

@timabbott I split the upgrade off from the warn-unreachable stuff. :)

Merged, after reordering to put the version upgrade at the end (and testing every commit passes mypy) so we don't have intermediate commits with broken mypy.  Thanks @whoodes!


Base URI is URL-encoded by Browser plugin

The browser plugin apparently re-encodes the base URI, which should be URL-encoded already and would break if it contained special characters.
Shouldn't this line
$fullPath = URLUtil::encodePath($this->server->getBaseUri() . $subPath);

be changed to this?
$fullPath = $this->server->getBaseUri() . URLUtil::encodePath($subPath);

Sounds about right


Added str_to_json as global method for templates

Description:
Added ability for templates to convert a json string to a python dict.
{% set json_str = '{"property1": "value1"}' %}
{% set json_data = str_to_json(json_str) %}
{{ json_data.property1 }}

I think this would be better named "json_to_dict"

that would make more sense. I will do that.

Home Assistant will already do this automatically most of the time, and the value will be available as value_json (code)
Also, json_to_dict doesn't make any sense as a JSON string does not have to be resulting in a dictionary. "hello" is valid JSON too. So, parse_json would be the correct term here.

@balloob Correct. But several people in gitter have mentioned being able to parse json out of attributes or something that may not just be 100% json in the state.
I see this as useful in more advanced templates when the states dict is used to get a entity that has json. Because this entity was not called directly by the service it wont already be loaded into value_json but they may still want to use it's values in their template. The first thing that comes to mind for me is Alexa intents.

If there is JSON in the attributes, it means that there was a JSON object received from Alexa which got deserialized but the attributes contained more serialized JSON? Which means that the original object contained double serialized data - that seems weird.

Maybe there wouldn't be json in an attribute. But I could definitely see having a mqtt sensor that has json in it. While the sensor can parse the json and only set what you want already. It may also be useful to have the full json for later use in a template.
It's just a thought. If none of this works for you we can kill the PR since I'm sure a large majority of cases will have some type of workaround.

The MQTT sensor is using the render_with_json method: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/sensor/mqtt.py#L63-L64
If you want to extract multiple values, it causes no extra bandwidth to subscribe to the same topic twice.

You're correct that would work to not require this change.
@dale3h did you have any use case for this? If not I may just close the PR for now.

The use case that I had was related to JSON in a MQTT payload.  Sending a notification that consists of multiple attributes in the payload as part of a single notification string (data_template).

@bthome but where is the MQTT JSON payload coming from? All MQTT platforms also expose the parsed json object.

@balloob NodeMCU produces multiple attributes and publishes to MQTT as a JSON output instead of multiple messages.

Okay, let's add a JSON parser.

@bah2830: @bthome is the one that was facing issues with it, so I am very thankful that he chimed in with his use case.
@balloob Thank you for approving this.

To be honest, I still don't see the full use case as getting a message over MQTT will always go through the MQTT platforms which will use the template render json method.

I do realize now that this is actually not the case for the MQTT automation. Just adding JSON parsing to the MQTT automation would probably avoid us having to add this escape hatch to the templates ?

So with https://github.com/home-assistant/home-assistant/pull/4703 in place, would there still be a use case for the json method @bthome  ?

I think the addition to allow the parse payload as JSON will satisfy my use case.  @balloob I appreciate you adding it to the default template.
Not sure if this satisfies all use cases that may return JSON from a component (e.g. script, command line, etc.) that would interrogate multiple values to use in further downstream actions.

I was just thinking the same in regards to future use cases. @balloob Is there any specific reason that you would not want a parse_json filter?

Actually I may of just come up with a possible use for this. It being talked about saving previous state to be used when a script or scene is ended to go back to previous settings.
I can hack this to work by using a mqtt notify to send a bunch of json with states and attributes I need from entities I"m about to change. Then a single sensor to get all that json back and be used in a template later.
Basically I can save the state, brightness, and color of 20 or more lights. Change them all. Then set them back later if I want with a single mqtt sensor instead of 20+ sensors for each one.

nvm.  I can easily just start the script by creating a new sensor with attributes of all the states I need to save. Use them later. Then delete it

@dale3h by adding parse_json to the available functions, I am afraid that people will not look further at the proper way of doing it. I am still not against adding it, however I do think that adding things should be driven by use cases and not for the sake of it being possible. Because a lot is possible 😉

Because every use case I have and have seen has a workaround I am going to close this PR for now. If a need for it arrises I can bring the branch back from the dead.


You can't run code on the Browser version (GitHub.dev)

I want the to have a run button and a working terminal on the Web version of Vscode GitHub.dev

https://docs.github.com/en/codespaces/the-githubdev-web-based-editor#continue-working-on-codespaces

This is as designed. When using github.dev's web-based editor you don't have any provisioned execution environment. If you need one and aren't prepared to set it up locally, use GitHub Codespaces.

This is tracked in https://github.com/microsoft/vscode/issues/135565 now


How to use the repo to convert some Python code?

Hello:
I have the following Python code to convert one RGB image to one YUV image, and use numpy to calculate an average of one column.
`import cv2
import numpy as np
img_rgb = cv2.imread('C:/Images/1.PNG')
img_yuv = cv2.cvtColor(img_rgb,cv2.COLOR_BGR2YUV)
averageV = np.average(img_yuv[:,:,2])
print(averageV);
`
The Python code works well. Now, I want to change it to use C# code, as I have many other C# programs will need this averageV value.
I have done the following:

I created one C# console project with Visual Studio 2019 (target .NET 5.0)
I installed necessary NUGET packages:
PM> Install-Package OpenCvSharp4 -Version <IP_ADDRESS>10817
PM> Install-Package NumSharp -Version 0.30.0
I have the following C# code:
`using NumSharp;
using OpenCvSharp;
using System;

namespace ConvertRGB2YUV
{
class Program
{
public const string Image1_File = @"C:\Images\1.PNG";
    static void Main(string[] args)
    {
        Mat img_rgb = Cv2.ImRead(Image1_File);
        Mat img_yuv = img_rgb.CvtColor(ColorConversionCodes.RGB2YUV);
        //var averageV = (img_yuv[:,:,2]);
        //averageV = np.average(img_yuv[:,:, 2])
    }
}

}`
I can run my code, and I can see the image: img_rgb and img_yuv.
But I have no idea on how to write the python corresponding statement:
averageV = np.average(img_yuv[:,:,2])
In NumSharp, the img_yuv[…] simply doesn’t exist.
In Python, the img_yuv is treated like an array of float numbers.
How I can do this in NumSharp?
Please advise,
Thanks,

C# doesn't support this kind of indices or slices. I guess you can explore the NumSharp.Slice class to reach your target.


Disallow numerical constants in enum or union

@Ankur19 FYI.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

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

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
1050

Relevant Lines:
1491

💛  - Coveralls


[Net48-sdk] Fix color contrast ratio of Tab separator

Editing Examiner Demo]: The color contrast ratio for 'Rich edit text' tab and 'Panel' tab separator and 'Document tree' tab and 'selection XML' tab separator is 1.818:1 which is <=3:1. https://github.com/microsoft/WPF-Samples/issues/463

/azp run


Thumbnail icon preview -> 3MF file support

Being able to preview 3MF files would be useful I feel, as they are widely used like STLs.

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

ID: a388e163-12c0-f8f9-c560-29e72ad78f40
Version Independent ID: 3ad933cb-9112-c3a2-f257-754c5613c5c2
Content: PowerToys File Explorer add-ons utility for Windows
Content Source: hub/powertoys/file-explorer.md
Product: dev-environment
Technology: powertoys
GitHub Login: @alvinashcraft
Microsoft Alias: aashcraft

This might be the wrong place, but I want to suggest that powertoys support 3mf file icon previews, not just STLs for 3d objects.

Hi @RandomGgames. Thanks for your suggestion. You can pursue this as a question or feedback about the product. If you visit the PowerToys repository, then you'll be able to create an issue to leave product questions/feedback. Cheers!


Refactor: firestore tasks collection model

Refactor: firestore tasks collection model
Include GitHub issue details in the Firestore task collection model

Can a task have multiple issues linked to it?
like let's say the task to create API /users
will be broken into

Write tests
Create new route
Create controller

Can a task have multiple issues linked to it?
like let's say the task to create API /users will be broken into

Write tests
Create new route
Create controller

No, as of now that is not possible - as we are creating tasks from issues and not the other way.
But yes, this can be a good future enhancement as well - to create a task and link it to an existing issue on GitHub.


Update gradle dependencies to address snyk vulnerabilities.

BACKEND PULL REQUEST
Related Issue

Resolves #5572.

Changes Proposed

Updates several packages in the backend, including the Spring Boot point version.
Updates webpack in the frontend.

Testing

A full smoke/regression test of the application should be completed.
This item has been provisionally verified in pentest.

Checklist for Primary Reviewer

[x] Any large-scale changes have been deployed to test, dev, or pentest and smoke tested
[ ] Changes comply with the SimpleReport Style Guide
[x] Changes with security implications have been approved by a security engineer (changes to  authentication, encryption, handling of PII, etc.)
[x] Any dependencies introduced have been vetted and discussed

Great callout, @zdeveloper! I completely missed that. Change made!


Implement CI pipeline

Implement CI.

Implementing a CD pipeline seems like more hassle than it's worth right now.


Added precision on the format, generation and breaking of NetNTLMv1

Hello,
I allow myself to propose some additions / clarifications concerning the format of NetNTLMv1 tokens, some technical details about their format, and the methods to break them (ShuckNT / Crack.Sh / KPA-attack, etc.).
Hope this can help :)!
Good day,

Merged, thank you :+1:


added Learn Section

fixes #108
@vanshchauhan21 please review this pr thanks!

@vanshchauhan21 Can you add level3 label

@vanshchauhan21 Can you add level3 label

Sorry' as per the guidelines I can't

@vanshchauhan21 Can you add level3 label

Sorry' as per the guidelines I can't

you forgot to add labels in https://github.com/vanshchauhan21/CryptoTracker/pull/191

but its a new page right? like #117


learn the ETA of the latest Version CLI

Hi Team,
Hope things are going well.
I would like to learn the ETA of the latest Version CLI.
Recently, Some customers meet similar issue in using Windows CLI to  export/import DNS zone
az network dns zone import -g eitb_dns -n eitb.eus --file eitb.eus.txt
az network private-dns zone export -g myresourcegroup -n contoso.com -f contoso.com.txt
They get same error message:
(NoRegisteredProviderFound) No registered resource provider found for location 'global' and API version '2023-07-01-preview' for type 'dnszones/recordsets'. The supported api-versions are '2015-05-04-preview, 2016-04-01, 2017-09-01, 2017-09-15-preview, 2017-10-01, 2018-03-01-preview, 2018-05-01'. The supported locations are ', global'.
Code: NoRegisteredProviderFound
Message: No registered resource provider found for location 'global' and API version '2023-07-01-preview' for type 'dnszones/recordsets'. The supported api-versions are '2015-05-04-preview, 2016-04-01, 2017-09-01, 2017-09-15-preview, 2017-10-01, 2018-03-01-preview, 2018-05-01'. The supported locations are ', global'.
I have found the possible workaround in this link and help customer resolve it by installing previous version windows CLI 2.24.0 and 2.49.0.
Listing DNS entries fails, expecting 2023-07-01-preview API version to be present. · Issue #26813 · Azure/azure-cli · GitHub
But they want to know the ETA of the latest version windows CLI to support '2023-07-01-preview' API, could you help in it?
Thank you very much for your reply!

Thank you for opening this issue, we will look into it.

/clibot unresolve

I would like to learn the ETA of the latest Version CLI.

@yonzhan Hi Team, hope things are going well. Do you have any suggestion in it?

/clibot unresolve
Hi team, hope things are going well. Do you have the ETA of the latest version?

Hi team, hope things are going well. Do you have the ETA of the latest version? Thanks for your reply

@Bonn-ws After DNS team fix it, the next release date could be found in https://github.com/Azure/azure-cli/milestone/132.

We are also experiencing this issue right now - what is the progress on this? Can we at least roll back the azure cli version on the hosted agents to version 2.49.0 until this issue is resolved?

We are also experiencing this issue right now - what is the progress on this? Can we at least roll back the azure cli version on the hosted agents to version 2.49.0 until this issue is resolved?

Will be resolved around 08/01 by 2.51.0.


SNOW-1341619: Always mention the specific missing feature in ErrorMessage.not_implemented.

Please answer these questions before submitting your pull requests. Thanks!

What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1341619

Fill out the following pre-review checklist:

[ ] I am adding a new automated test(s) to verify correctness of my new code
[ ] I am adding new logging messages
[ ] I am adding a new telemetry message
[ ] I am adding new credentials
[ ] I am adding a new dependency

Please describe how your code solves the related issue.
Use decorators that share most of their implementation to replace "This functionality is not yet available in Snowpark pandas API" with more informative errors. Remove the ability to call not_implemented() without a custom message.
Eventually we will expand these decorators so they can give useful messages for missing support for particular parameter values as well.

Please fix the failing tests. (Didn't notice them at first.)

Please fix the failing tests. (Didn't notice them at first.)

Those were failing on some deployments due to SNOW-1358681.


[youtube] Unable to use an app password to login

[x] I've verified and I assure that I'm running youtube-dl 2016.08.28
[x] At least skimmed through README and most notably FAQ and BUGS sections
[x] Searched the bugtracker for similar issues including closed ones
[x] Bug report (encountered problems with youtube-dl)
[x] Feature request (request for a new functionality)

[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['https://www.youtube.com/playlist?list=WL', '--verbose', '--username', 'PRIVATE', '--password', 'PRIVATE']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.08.28
[debug] Git HEAD: b8079a4
[debug] Python version 3.5.2 - Linux-4.7.2-1-ARCH-x86_64-with-arch-Arch-Linux
[debug] exe versions: ffmpeg 3.1.2, ffprobe 3.1.2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube:watchlater] Downloading login page
[youtube:watchlater] Logging in
ERROR: Unable to login: The email and password you entered don't match.
Traceback (most recent call last):
  File "/home/starsam80/.local/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 691, in extract_info
    ie_result = ie.extract(url)
  File "/home/starsam80/.local/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 346, in extract
    self.initialize()
  File "/home/starsam80/.local/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 340, in initialize
    self._real_initialize()
  File "/home/starsam80/.local/lib/python3.5/site-packages/youtube_dl/extractor/youtube.py", line 1847, in _real_initialize
    self._login()
  File "/home/starsam80/.local/lib/python3.5/site-packages/youtube_dl/extractor/youtube.py", line 113, in _login
    raise ExtractorError('Unable to login: %s' % error_msg, expected=True)
youtube_dl.utils.ExtractorError: Unable to login: The email and password you entered don't match.

I am unable to use an app password with youtube-dl. App passwords allow programs to use an account without requiring their actual password or a 2 factor auth code, but it seems this doesn't work with youtube-dl. You can see/create an app password here: https://security.google.com/settings/security/apppasswords

Whoops, I guess my search for "app password" didn't pick up "app passwd", so this is a duplicate. Sorry.


Fix uv.write to allow concurrent writes.

Libuv has an internal write queue and uv.shutdown API that allows for concurrent calls to uv.write to be performed.  It will do the actual writes one at a time.  Shutdown is a way to wait for all pending writes to finish.
But with the current bindings, we have singleton callback and request objects per method per handle meaning a single uv_stream_t instance can only have one uv.write() call at a time.
Recently a bug was fixed so that even serial calls can work, but more work is needed to make it fully take advantage of libuv's internal queue. (https://github.com/nucleus-js/seaduk/commit/ec3fa65a23743df729eb1206576c53c144b06442)

We'll somehow need to store the callback with the request object.  But we still need a way to keep the request rooted in the GC while it's in-flight.  Perhaps we can stick it to some global array?  We do know that all libuv requests will call a C callback when they are ready to be cleaned up.


errors after updating to<EMAIL_ADDRESS>and<EMAIL_ADDRESS>

Issue description
I just updated my project to angular 10.x and with it updated agm. Now i get this errors when compiling.
ERROR in node_modules/@agm/core/lib/services/google-maps-api-wrapper.d.ts:51:41 - error TS2314: Generic type 'MapHandlerMap<T>' requires 1 type argument(s).

51     subscribeToMapEvent<N extends keyof google.maps.MapHandlerMap>(eventName: N): Observable<google.maps.MapHandlerMap[N]>;
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@agm/core/lib/services/google-maps-api-wrapper.d.ts:51:94 - error TS2314: Generic type 'MapHandlerMap<T>' requires 1 type argument(s).

51     subscribeToMapEvent<N extends keyof google.maps.MapHandlerMap>(eventName: N): Observable<google.maps.MapHandlerMap[N]>;
                                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~

The App still builds and i can run it but i think this errors should not happen.
angular-google-maps, Angular, & any other relevant dependency versions
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>Can anyone tell me if i maybe did something wrong or if it is something with agm?

Duplicate of #1892


why ResNet-50

Thank you for your great job of this paper!
1.Why can RESNET-50 get the best effect in CNN backbone network？
2.In the backbone network without down sampling, the input is 224x224x3, and the output is 14x14x1536, right?

@kobiso

@kobiso hello?
:D


feat: replace unwrap by error handling 🔨 #165

Pull Request type

Please check the type of change your PR introduces:

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, renaming)
[ ] Refactoring (no functional changes, no API changes)
[ ] Build-related changes
[ ] Documentation content changes
[ ] Testing
[ ] Other (please describe):

What is the current behavior?
There are some unwrap() functions that are used in the code.
unwraps are dangerous to have within the runtime as a panic would simply crash the blockchain.
Moreover it would impact forkless upgrades in the future.
Issue Number: 165
What is the new behavior?
unwraps are replaced by error handling patterns with pallet custom errors.
Other information
This PR only focuses on a single type of errors, Pending::<T>::try_append(transaction.clone())

I'm new to rust, would this be a good solution ? I went for the most simple fixes there on a single type of errors

I'm new to rust, would this be a good solution ? I went for the most simple fixes there on a single type of errors. If this solution is OK, i'll add more commits to the PR

Yeah map_err is the way to go

Please make sure to run cargo fmt and cargo clippy -D warnings @0xEniotna

Sorry I don't have much time this week to work. I'm pushing what I have already. Will come back to it later.


Update contributors.txt

You guys asked to add ourselves, even if it's only a little contribution on podcastindex.social so here I am :)
keep up the good work!

Yes. Thanks!


Logging and metrics

Coverage increased (+0.07%) to 91.606% when pulling ccfa49060d00db84a84d615c4da1164f8e4cb7ce on mprimi:master into f013ee26f4bb06ccbc0d156725a8fa2eb191ca13 on Netflix:master.

Codecov is complaining about reduced coverage on 3 files that i didn't touch...


Add valid_until on vessel

Signed-off-by: Niels Thykier<EMAIL_ADDRESS>

No; it is an implementation detail and belongs in the projects themselves.


fix the link in FAQ

Let's close this for now, we can build a simple checksum tool using wallet core wasm package


Default action icon missing for active services

Rancher Version: master 6/16
Steps to Reproduce:

Add a LB, external service and service alias
Start all the services

Results: Default action icon in menu is missing

Expected: Action should be available.

Version - master 6/17
Verified fixed


Sending message using the SCTP Data channel between two users on two different tabs is not working

Objective: Test that it's possible to send a message using SCTP Data Channel between two Hosts
Steps followed:

On host A and B: Browse to peer2peer and negotiate a call
On host A click on create Data Channel and negotiate again
On host A: type a message in Data Channel field and click on send button

Expected Result:  Verify that Host B received the message in the ""Received on Data Channel"" field
Actual Result: There is no data exchanged between the two users and there is no error messages seen in the console.
More Info: Tried with both the M43-43.0.2357.65 (64-bit) on Desktop as well as on M44-44.0.2403.14(7077.11.0)dev on Parrot-freon.  Both of them shows the same behaviour.  It is reproducible.

Hmm strange, it works for me. Could you try again and take a screenshot?

Tried with the build 44.0.2403.28/7077.24.0 beta on Blaze and Link, works fine.

Please add a screenshot when you see the error (make sure the console is open as well)

Tried today again with the same device(Blaze) and the same build(44.0.2403.28/7077.24.0 beta), and it works fine as expected.  I was able to see the message on the user B from user A.  Since, i am not able to reproduce the issue i am closing this issue.