Speedup by direct allocation in focus loss

The below lines with torch.ones and torch.zeros in the focus loss are allocating massive arrays on the home device and then transferring them to the gpu using .cuda. This is inefficient especially in cases where DataParallel is over larger numbers of gpu's as the main process will have to move the data to each gpu individually.

            # compute the loss for classification
            targets = torch.ones(classification.shape) * -1

            if torch.cuda.is_available():
                targets = targets.cuda()

             alpha_factor = torch.ones(targets.shape) * alpha

            if torch.cuda.is_available():
                alpha_factor = alpha_factor.cuda()

            zeros = torch.zeros(cls_loss.shape)
            if torch.cuda.is_available():
                  zeros = zeros.cuda()

Instead the data should be allocated directly on the gpu using e.g. ones_like (below) to copy all traits of the original array including their device. My tests with the below show an approximately 4x training speedup from this change alone when tested on 6 GPU's using DataParallel (though I am also using a custom parallel dataloader so your performance may vary)
targets = torch.ones_like(classification) * -1
alpha_factor = torch.ones_like(targets) * alpha
zeros = torch.zeros_like(cls_loss))

This change should also speedup training even on 1 gpu as the code will have fewer giant arrays to move around. Also I assume this problem is a feature of whatever everyone seems to be deriving their focus_loss from as I have seen this problem near identically in several different codes. It also makes the logic easier as you don't need to check if the cuda is available since it will just put the array wherever the original arrays are located.

@rmcavoy good recommendation. You might want to submit a PR directly.


Very long titles in order field in page form are breaking layout

Describe the Bug

If we create a page with an extremely long title, this breaks the page form due to an expansion of the order field.
Expected Behavior

Long titles shouldn't affect the whole layout due to shortening of the displayed title.
Actual Behavior

The order box gets expanded to match the long title and breaks the layout
Additional Information

This issue should have been fixed by #1527. The fix at least works for me locally:

Could you verify that the problem still exists after performing git pull and clearing the browser cache?

@david-venhoff yes indeed, this has been fixed by #1527, thanks! :pray:


[Takeout] If already on Github Repo the "Claim Access" button returns 500 error

This file:
apps/site/protected/_utils/github.ts
The fetch in inviteCollaboratorToRepo will throw an error if you're already invited.
Ideally we check this up front so it doesn't show Get Access but rather shows "You're in!"

Fixed on https://github.com/tamagui/tamagui/commit/703a772127d35d7550e57f8b7e4084a8e3360b5d


oAuth?

Is it possible to do this through oauth and not have to ask email and pass?
Thanks

This issue was moved to gmailgem/gmail#15


Requests

Thank you for the excellent node.
However, it's unfortunate that saving to the node causes the working data in Photopea to be lost.
For example, it would be great if we could keep the layers and other states, run the generation, continue working from where we left off, and then generate again.
I feel that ComfyUI's weakness is that iterative tasks like inpainting are very difficult to perform.

@za-wa-n-go
I don't think this'll help with photopea, but there's a script for Krita to incorporate image generation from comfy running in the background instead of editing the image within the comfyui itself. It solves the issue about retaining layers and such while working on something.
https://github.com/Acly/krita-ai-diffusion[https://github.com/Acly/krita-ai-diffusion](url)


Bug with popular catalog with languages besides en-US

When installing the addon for any language besides en-US (even en-GB or other English varieties) there's a bug with the "TMDB - Popular" category: the subcategory "Top" won't display anything, only when selecting a specific genre.
Now that it's possible to place addons above Cinemeta, I wanted to make TMDB the main catalog, but this bug makes the Discover tab empty unless you manually change the categories every single time (which is very annoying on Android TV).
It would also be nice to change which category shows first, so instead of popular movies appearing first, move another category like "Trending" or "By Language" to the top of the dropdown.
Thank you for all your effort.

The bug happened because TMDB changed the way it searches the API, it has already been fixed, but there is a Beamup Server cache, it takes 24 to 48 hours for the caches to expire


Create login feature

Description

Implemented login feature and related security features

uses Redis as session storage

Improve error logging
refactor different modules into different routes

This is a big PR so it can be kinda tricky to test. Let me know if you run into any trouble and/or to hop on a call to walk through it together
Testing

before testing, run npm install
you also have to install redis (see this link)
if you want to see the state of the session storage throughout testing, open a new terminal and type redis-cli.

the following are useful commands:

keys *: gets all sessions stored in memory at that moment
get <session_id>: retrieve a particular session
flushall: empties the session storage

Flow #1:

try calling an endpoint that would typically require the user to be logged in
- should get back 401 error, saying the user isn't authenticated
call GET /csrf-token (this is the token to use whenever you make state-changing requests within this session)
call POST /login, using a x-csrf-token header with value from the previous step
user should now be authenticated (logged in)
try calling an endpoint that would typically require the user to be logged in
- this time, the API call should be successful
try calling DELETE /users/:user_id (create a test user to delete if you want)
- if you are logged in to an admin account, the user should be deleted
- otherwise, you should get back 403 error, saying the user isn't authorized to access this resource

Flow #2:

call GET /csrf-token
call POST /login, using a x-csrf-token header with value from the previous step
call POST /logout, again using the CSRF token from step 1
should be successfully logged out
in Redis, the login session should be destroyed

   flow 2 is perfect. All functionalities worked as intended.

How about flow 1? Did everything go as expected?

 before logged in
 after logged in , endpoint works
trying to delete self
ok now im trying to delete this user
it says cannot delete  i logged in to this one and it should be admin
last bullet point for flow 1 does not work as expected, unless i made a mistake

I should handle the self-deleting thing, good catch.
Also the delete user feature seems to be working for me? maybe we can go through this flow together later

lgtm 83d406e29f0c41bbba8b2e7a7f7f02350c57c83a


A cleaner way to distinguish single-file and multi-file manifests

I'd like a flag in the format which declares easily (at the top-level object) which version of the format a file is using. Today, to make a determination, I've got hacky code which looks for the first entry in an object and probes it for type and weight properties.
Some options to consider:

A "file" object at the top-level which describes the contents?
JSON Schema definitions for the whole shebang
A single property to declare "single file" vs. "multi-file" and documentation which declares which one is the default
Have the http2-push-manifest tool ALWAYS generate multi-file manifests with a single "default" (or other sigil, perhaps *) property so that tools don't have to decide which to support

/cc @ebidel

I don't have good insight into which format people are using more, the single vs. the multi-file format. I use the single format on some projects, where I read the manifest per handler. That's really simple. But I think other setups (e.g. static serving hosts) would be more inclined to use the multi-format. I'm up for making changes.
Either of your last two look good. Ditching the difference and always generating the same format (multi-file) might be the way to go.
Might leave this open for a bit to let others chime in before we deprecate anything.

The multi-file format is what you'd want to use to avoid over-push but maintain a single manifest file (e.g. from the Polymer build scripts); else you need to generate one manifest per entry-file (assuming they differ at all). It gets complicated quickly as some SPAs will want MOST pages to load one set of files (simple apps) but will eventually need to send a different bundle for a different "page type" (which might also cover a large number of routes). I'm trying to avoid changing this format to accommodate those cases but the current situation pushes complexity into tools (who will inevitably diverge on the meaning of what the word "is" is).


Update check fails

A couple of days ago the update check stopped working - it just produces an error message, saying that an error has occurred.
I don't know what is causing it, but if you are checking for new versions on GitHub, please note that GitHub recently disabled support for insecure HTTPS protocols, like TLS 1.0. Maybe this is what is causing the problem.

I am getting same message Updates not working

Github's announcement
TLS error:
TLSv1 Record Layer: Alert (Level: Fatal, Description: Protocol Version)
    Content Type: Alert (21)
    Version: TLS 1.0 (0x0301)
    Length: 2
    Alert Message
        Level: Fatal (2)
        Description: Protocol Version (70)

Thanks for the reports, I'll look into this deeper as we don't specify the protocol (other than it be secure https) being used for update checks.

Just confirming i'm also getting the update error

@jimradford, the problem might be in the HTTPS library you use for the requests. Unfortunately, I don't know C#, so I can't help, but check if there is an update for that library and what parameters you are using.

Really shouldn't be, its the built in .NET libraries. I'll try and throw
it on a Debugger this afternoon and see specifically what the problem
is. It should be pretty simple actually. The bummer will be the update
checker is broken so people will have to manually check until they
download a new version.
Jim
--
Jim Radford<EMAIL_ADDRESS>http://www.jimradford.com
On 2018-02-27 10:13, Vesselin Bontchev wrote:

@jimradford [1], the problem might be in the HTTPS library you use for the requests. Unfortunately, I don't know C#, so I can't help, but check if there is an update for that library and what parameters you are using.
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [2], or mute the thread [3].

Links:
[1] https://github.com/jimradford
[2]
https://github.com/jimradford/superputty/issues/689#issuecomment-368973178
[3]
https://github.com/notifications/unsubscribe-auth/AHmb24ImvqJlX4lwZpy5J2eWcKcYnEBIks5tZEW0gaJpZM4SRK_n

As I said, I don't really know C#, so I can't be very helpful about how to fix it. Maybe the WebRequest class uses insecure methods by default, or something. Try putting
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

at the beginning of the MakeRequest method.

I recommend disabling the update check (Tools -> Options -> Advanced -> Uncheck Automatically check for updates) since the functionality is broken
or edit the config file SuperPuTTY.settings:
setting name="AutoUpdateCheck" serializeAs="String">
        <value>True</value>

to

setting name="AutoUpdateCheck" serializeAs="String">
        <value>False</value>

since its now broken functionality. We'll get an update out soon that addresses the issue.

Ok, so I did some additional checking and the problem may have been caused by Github changing their support for older ssl protocols and requiring all connections to use tls 1.2.
Currently SuperPutty is set to use the .NET framework 3.5, this version of the framework does not support TLS 1.2 without installing a patch. Even if that patch were installed it would still require code changes to support the change. See this article for additional information: https://support.microsoft.com/en-us/help/3154518/support-for-tls-system-default-versions-included-in-the-net-framework
I don't think that solution is viable, it creates more work for the end user of the application and some might not be that technical.
Option 2 would be to update the application to support the .NET 4.5 framework which does support tls1.2, code changes and a release will still be required but really that only means downloading and installing a new version of SuperPuTTY.

I think Google disabled only TLS 1.0, which is insecure. TLS 1.1 should still be supported. I don't know if .NET 3.5 supports it, though.

.NET 3.5 does not support TLS 1.2, .NET 4.0 does with a code change (tls
version is not in the Enum so it has to be cast), .NET 4.5 and newer do.

Yes, I got it that .NET 3.5 does not support TLS 1.2 while .NET 4.5 does. I was wondering whether .NET 3.5 supports TLS 1.1 (not 1.2); I think that GitHub disabled only TLS 1.0, so TLS 1.1 will probably still work. But, yes, probably the best solution is to rewrite the program to use .NET 4.5 and TLS 1.2.

@bontchev If you wouldn't mind, can you grab and test a nightly build from here: https://ci.appveyor.com/api/buildjobs/rk8xja6427vy6y33/artifacts/SuperPuttyInstaller%2Fbin%2FDebug%2FSuperPuttySetup.msi and confirm it works. This is a version with the update checker fixed but requiring .NET 4.5. iirc tls 1.1 is not supported in .NET 3.5 either.

The update check w/the nightly worked for me (Win10 fall creators update), thanks.

I cannot confirm. After installing the package, my executable hasn't changed - it is still version <IP_ADDRESS> and still an error occurs when it tries to check for updates. My environment is Windows 7 Pro, 64-bit
I could try to uninstall the old version first - but will I lose my settings and saved sites?

Hi,
You should be able to safely uninstall the old version and install the
test version. Or you can grab just the exe and replace the installed one
with it.

@bontchev My executable is also claiming to be <IP_ADDRESS>, so the version number apparently wasn't updated. Maybe the installer failed for some reason? Did you have SuperPutty open during the install? Have you rebooted since the install? (FYI I uninstalled the old version first; I didn't take note if the settings were preserved, but the saved sites definitely were.)
The SHA-1 of the new executable is a76e18e2c2feb9cfd8757eaf57dda2966d15017e, does yours match?

@jimradford, how can I "grab just the exe"?
@gurnec, No, the program wasn't running when I tried to update, of course. The installer didn't fail, in the sense that there was no error - but my executable definitely wasn't updated. Its compile date is old (2015), and the SHA1 is a76e18e2c2feb9cfd8757eaf57dda2966d15017e.

You can grab it from the CI build server artifacts output:
https://ci.appveyor.com/project/jimradford/superputty/branch/master/artifacts

OK, if I replace the executable from there, the update check works correctly (no errors).

@bontchev  it will be included when we do another release. For now people can grab the EXE from the CI Server or reinstall with the installer from the CI server.
Thanks for the effort testing this.
Jim

Hi Kevin,
Nothing related to passing command parameters to putty was touched to
fix the update checker, however it may have changed depending on which
version you were using before you updated. That area of the application
code hasn't changed in many years, so I would be surprised if it was a
change we did.
I do however recommend using key authentication instead of the less
secure passing passwords in plaintext (-pw) method for authentication.
Jim
On 2018-04-07 11:22, kevinmarchant wrote:

Hi Jim,
I just installed the CI server version (did an uninstall and reinstall to make sure the revised version was installed).
I'm no longer getting the update check error (yeah!), but
On some of my Putty configs to automate login I pass the password using "-pw pw_in_clear" in Extra PuTTy arguments. This doesn't seem to be working in the revised version - it's passing the username, but stopping to prompt for the password. Is it failing to append Extra PuTty arguments?
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [1], or mute the thread [2].

Links:
[1]
https://github.com/jimradford/superputty/issues/689#issuecomment-379489298
[2]
https://github.com/notifications/unsubscribe-auth/AHmb2wmWCxivHau2AOZgYUvVBn2c3-75ks5tmQQCgaJpZM4SRK_n

Thanks Jim, I had upgraded from <IP_ADDRESS>.  I reverted to the old <IP_ADDRESS> build, and set autoupdate off in the .settings file to avoid the warning .  Behaviour is back to where I wanted it with -pw xxxx being honoured after installing un-fixed version.
I agree with the security point, but I only use it in that way for a couple of NAS boxes at home so couldn’t be bothered with certificate-based.
Not sure why “-pw” it works with <IP_ADDRESS> and not <IP_ADDRESS> (with update fix) for an SSH connection over default port 22.
Anyway, thanks for the reply – useful program !
Kevin
From: Jim Radford<EMAIL_ADDRESS>Sent: 07 April 2018 20:05
To: jimradford/superputty<EMAIL_ADDRESS>Cc: kevinmarchant<EMAIL_ADDRESS>Comment<EMAIL_ADDRESS>Subject: Re: [jimradford/superputty] Update check fails (#689)
Hi Kevin,
Nothing related to passing command parameters to putty was touched to
fix the update checker, however it may have changed depending on which
version you were using before you updated. That area of the application
code hasn't changed in many years, so I would be surprised if it was a
change we did.
I do however recommend using key authentication instead of the less
secure passing passwords in plaintext (-pw) method for authentication.
Jim
On 2018-04-07 11:22, kevinmarchant wrote:

Hi Jim,
I just installed the CI server version (did an uninstall and reinstall to make sure the revised version was installed).
I'm no longer getting the update check error (yeah!), but
On some of my Putty configs to automate login I pass the password using "-pw pw_in_clear" in Extra PuTTy arguments. This doesn't seem to be working in the revised version - it's passing the username, but stopping to prompt for the password. Is it failing to append Extra PuTty arguments?
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [1], or mute the thread [2].

Links:
[1]
https://github.com/jimradford/superputty/issues/689#issuecomment-379489298
[2]
https://github.com/notifications/unsubscribe-auth/AHmb2wmWCxivHau2AOZgYUvVBn2c3-75ks5tmQQCgaJpZM4SRK_n
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/jimradford/superputty/issues/689#issuecomment-379491786 , or mute the thread https://github.com/notifications/unsubscribe-auth/APSrRTt80MbYzvTlpnaMrmaTBDkTBQXrks5tmQ3egaJpZM4SRK_n .  https://github.com/notifications/beacon/APSrRRQQRoJtswHuOBKD-XdOjX5lRuNKks5tmQ3egaJpZM4SRK_n.gif

Kevin,
I also found this and it seems that the security setting to check plain text password was not previously not enforced.
Check that the setting is selected under Option --> Gui tab --> Security --> Allow plain text passwords on putty command line.
Pieter.


Internal Server Error when publishing a data source size is > 64 MB

Describe the bug
When a Tableau extract(.tdsx) file published to Tableau server which are greater than 64 MB, then the REST API call returns "500 Internal Server Error".  The same works very well with TSC version 0.25.
Versions
Details of your environment, including:

Tableau Server version (or note if using Tableau Online) - 2022.3
Python version - 3.7.0
TSC library version - 0.29/0.30

To Reproduce

Keep a Tableau extract with a size of greater than 64 MB. In my case it was 74 MB
Use TCS version 0.29/0.30 to make a REST API call to publish to a server either new ds or overwrite
Read the response which will of 500 Internal Server Error

Results
500 Internal Server Error
nothing much
NOTE: Be careful not to post user names, passwords, auth tokens or any other private or sensitive information.

We have observed the same issue after upgrading to TSC version 0.29 with datasources.publish when the hyper file is larger than 64MB. We are using Tableau Server 2023.1.8 and python 3.11. In case it is useful, we pulled the following details from the Tableau Server logs:
last_exception_class=com.tableausoftware.domain.exception.FileUploadException
last_exception_message=errors.upload.concurrent_write
first_exception_class=com.tableausoftware.domain.exception.FileUploadException
first_exception_message=errors.upload.concurrent_write
last_exception_stacktrace=com.tableausoftware.domain.fileupload.appenders.ExclusiveFileLock.<init>(com.tableausoftware.domain.exception.FileUploadException)sun.nio.ch.FileLockTable.checkList(java.nio.channels.OverlappingFileLockException)
first_exception_location=File Upload Append Failure
last_exception_location=File Upload Append Failure
first_exception_stacktrace=com.tableausoftware.domain.fileupload.appenders.ExclusiveFileLock.<init>(com.tableausoftware.domain.exception.FileUploadException)sun.nio.ch.FileLockTable.checkList(java.nio.channels.OverlappingFileLockException)


License cleanup part 2

@emilianbold another set of cleanups for licenses/build issues. The individual commits hold
more information. The core info:

maven-indexer was released as 6.0.0 and already contains the patch, so it can be dropped and we can switch to the maven artifact. The notice file was missing
BIndex contains MIT licensed code and so needs an enhanced license and also notice info, which was extracted.

As before If not vetoed, I would cherry-pick this directly into release90 after review for master.

I pushed three more commits into this branch (only new commits):

the spring jars indeed hold a notice, this is now present
testng indeed contains MIT licensed jquery and jcommander holds a NOTICE file (if you dig in the repository, in the distribution it is missing)
winp might be discussable. Instead of patching winp, I switched to a maintained version (https://github.com/kohsuke/winp). The libraries code today is very similar to the state after patching (modulo a few years of fixes), so I think this is save. The API is stable (checked with ``japi-compliance-checker`). Part of the winp problem was, that the license integration code is not prepared for files showing up at build time (winp was build from source) and not coming from the normal download route.

testng indeed contains MIT licensed jquery and jcommander holds a NOTICE file (if you dig in the repository, in the distribution it is missing)

It feels like we are somehow going above and beyond our duty if we not only inspect the 3rd party release but look into the repository, etc.

winp might be discussable. Instead of patching winp, I switched to a maintained version (https://github.com/kohsuke/winp). The libraries code today is very similar to the state after patching (modulo a few years of fixes), so I think this is save. The API is stable (checked with ``japi-compliance-checker`).

It would be nice to have this a separate PR.


NIFI-6014 Added DetectDuplicateRecords.

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.

I didn't know this one already existed. Please see the implementation attached to this other JIRA ticket. It is slightly more flexible because it allows for the use of multiple user-defined properties as record paths in addition to the option to choose duplicate detection algorithm:
https://issues.apache.org/jira/browse/NIFI-6047


Update GitHub Actions

azure/webapps-deploy@v2 is missing the images parameter, it seems to work without it, but the VS Code GitHub Actions extension shows an error about this.
References

https://github.com/Azure/webapps-deploy

Turns out it's for deploying an image, not really needed


very minor text edits

Need to fix
-example button
-manifest button

Need to fix
-example button
-manifest button

Both fixed in PR #1003


[ClangImporter] Prefer available enum elements over unavailable ones

(still need to write this up, but wanted to kick off tests)

@swift-ci Please test


Is it possible to change private visibility to protected?

When I launch functional tests I don't need exception trace log output because Its huge. I want to see only an exception type, code, message, file and line. So I decided to override the formatExceptionFragment method (remove 4 strings forming trace output) of PlainTextErrorRenderer. But the method is private and called from the __invoke method. And so I cant override formatExceptionFragment in child class - to do it - I should also copy __invoke to child class. But then there is no point in inheritance either - you get a separate class, almost identical to PlainTextErrorRenderer, except for 4 lines.
It seems redundant to me to copy almost all the code from PlainTextErrorRenderer just to remove the 4 lines of code responsible for the trace output. Is it possible to change private visibility to protected of the formatExceptionFragment method?

I would be open to making those methods protected for extensibility. I don't have a strong opinion on that @solventt

I think these methods should not be set to protected, otherwise we have to deal with unexpected breaking changes later on.
A custom error handler would be a better approach (as mentioned by zelding).

@odan considering Slim 4 is in a pretty stable place right now changing the method modifier to protected wouldn't be the end of the world. If we were at the beginning of a release cycle I may have a different opinion on that. I don't foresee us having to introduce breaking changes to those renderers. While not impossible that we eventually break things, letting users extend these renderers at their own risk would be fine with me.

@zelding Of course I did. I wrote above that now I have almost a copy of existing PlainTextErrorRenderer. I only suggested it.

@odan considering Slim 4 is in a pretty stable place right now changing the method modifier to protected wouldn't be the end of the world. If we were at the beginning of a release cycle I may have a different opinion on that. I don't foresee us having to introduce breaking changes to those renderers. While not impossible that we eventually break things, letting users extend these renderers at their own risk would be fine with me.

I totally agree with @odan , if you think in keep this project up to date,  then don't let users extend your code.
If someone wants to change the behavior,  then implementing the interface and inject the new one.
And if he want to reuse some code that exists,  then he can just decorate the class and inject.
I faced this problem on other OSS projects and we need to keep an code that must be compatible with 2 ways. Then IMHO don't do this.

@zelding Of course I did. I wrote above that now I have almost a copy of existing PlainTextErrorRenderer. I only suggested it.

Did you try to decorate this render?
YourPlainTextErrorRender implement RenderInterface
construct(PlainTextErrorRender $render)
Public function medthodA()
/// your change

This class is easy enough to replace, that I'm also happy with leaving that method private.


books image is not loading add new book to read

in Contributed Books menu image is not loading ig , its expired...Add new book Images link to contribute book section.. add new to book to db . Can you assign me and also add on Hacktoberfest? I can add more books in this

@REHAN-18 someone already assigned


Outdated underlying modules updation

One of our application is using react-excel-render. But the Veracode static code analysis shows the<EMAIL_ADDRESS>and<EMAIL_ADDRESS>are susceptible to ReDOS vulnerability. Also<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>is required.
Please help us by updating the underlying packages or suggest us an alternate way to mitigate this. At least, let me know when you are planning to update these libraries, if you are planning on such action. Help much much appreciated. Thank you.

Hi Yashwanth,
I'm pretty preoccupied with other projects currently, and won't be able to
undertake issues vis-a-vis the React Excel Renderer.
Feel free to fork the project and experiment yourself 😉
Thans & Regards,
Ashish Deshpande
On Thu, 6 Aug, 2020, 11:44 pm Yashwanth Eturi<EMAIL_ADDRESS>wrote:

One of our application is using react-excel-render. But the Veracode
static code analysis shows the<EMAIL_ADDRESS>and<EMAIL_ADDRESS>are
susceptible to ReDOS vulnerability. Also<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>is required.
Please help us by updating the underlying packages or suggest us an
alternate way to mitigate this. At least, let me know when you are planning
to update these libraries, if you are planning on such action. Help much
much appreciated. Thank you.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/ashishd751/react-excel-renderer/issues/19, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ACAIS6MEWZVZXSHZV4LIQPLR7LXJVANCNFSM4PW3BD7Q
.

Hello Ashish,
There are some PRs auto raised by Github bot that bumps the versions of the underlying dependencies of this library. Can you please spend a few minutes and approve their merge? They would fix security vulnerabilities it has.

Sure, will take a look as soon as possible.
Regards,
Ashish Deshpande
On Fri, 5 Nov, 2021, 4:38 pm Yashwanth Eturi, @.***>
wrote:

Hello Ashish,
There are some PRs auto raised by Github bot that bumps the versions of
the underlying dependencies of this library. Can you please spend a few
minutes and approve their merge? They would fix security vulnerabilities it
has.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ashishd751/react-excel-renderer/issues/19#issuecomment-961805636,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACAIS6LALHXOO7ECOFMFXSLUKO3JDANCNFSM4PW3BD7Q
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.


Tabs in titlebar

Please add possibilty  to for example add the tabs in to title bar (titlebar extended just like uwp)

@ParkhutRoman AFAIK that is still broken for WinUI3.

For example if we dont need title bar background color, like all new WinUi windows, we can add to our own ResourceDictionary edited WindowChromeStyle
((1.0.0-preview2\lib\net5.0-windows10.0.18362.0)  difference only in added Canvas.ZIndex and removed TitleBarMinMaxCloseContainer.Background)
<Style x:Key="WindowChromeStyle" TargetType="ContentControl">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="ContentControl">
					<Grid x:Name="LayoutRoot">
						<Grid
							x:Name="TitleBarMinMaxCloseContainer"
							HorizontalAlignment="Right"
							VerticalAlignment="Top"
							Canvas.ZIndex="1"
							Visibility="{Binding CaptionVisibility, RelativeSource={RelativeSource TemplatedParent}}">
							<Grid
								x:Name="MinMaxCloseContainer"
								HorizontalAlignment="Right"
								VerticalAlignment="Top"
								ColumnDefinitions="Auto,Auto,Auto">
								<Button
									x:Name="MinimizeButton"
									Grid.Column="0"
									AutomationProperties.AutomationId="_MinimizeButton"
									AutomationProperties.Name="Minimize"
									Content="M 0 0 H 10"
									Style="{StaticResource WindowCaptionButton}" />

								<Button
									x:Name="MaximizeButton"
									Grid.Column="1"
									AutomationProperties.AutomationId="_MaximizeButton"
									AutomationProperties.Name="Maximize"
									Content="M 1.516 -0.001 L 7.451 0.009 C 8.751 0.019 9 1 8.981 1.477 L 9.002 7.558 M 9.002 7.547 C 8.929 8.669 8 9 7.43 9.015 L 1.464 9.005 C 0.374 8.973 0 8 -0.004 7.484 L -0.004 1.477 C 0 1 0.415 0.009 1.527 -0.001"
									Style="{StaticResource WindowCaptionButton}" />
								<Button
									x:Name="CloseButton"
									Grid.Column="2"
									AutomationProperties.AutomationId="_CloseButton"
									AutomationProperties.Name="Close"
									Content="M 0 0 L 10 10 M 10 0 L 0 10"
									Style="{StaticResource WindowCaptionButton}">
									<Button.Resources>
										<ResourceDictionary>
											<ResourceDictionary.ThemeDictionaries>
												<ResourceDictionary x:Key="Light">
													<StaticResource x:Key="WindowCaptionButtonBackgroundPointerOver" ResourceKey="CloseButtonBackgroundPointerOver" />
													<StaticResource x:Key="WindowCaptionButtonBackgroundPressed" ResourceKey="CloseButtonBackgroundPressed" />
													<StaticResource x:Key="WindowCaptionButtonStrokePointerOver" ResourceKey="CloseButtonStrokePointerOver" />
													<StaticResource x:Key="WindowCaptionButtonStrokePressed" ResourceKey="CloseButtonStrokePressed" />
												</ResourceDictionary>
												<ResourceDictionary x:Key="Dark">
													<StaticResource x:Key="WindowCaptionButtonBackgroundPointerOver" ResourceKey="CloseButtonBackgroundPointerOver" />
													<StaticResource x:Key="WindowCaptionButtonBackgroundPressed" ResourceKey="CloseButtonBackgroundPressed" />
													<StaticResource x:Key="WindowCaptionButtonStrokePointerOver" ResourceKey="CloseButtonStrokePointerOver" />
													<StaticResource x:Key="WindowCaptionButtonStrokePressed" ResourceKey="CloseButtonStrokePressed" />
												</ResourceDictionary>
												<ResourceDictionary x:Key="HighContrast">
													<StaticResource x:Key="WindowCaptionButtonBackgroundPointerOver" ResourceKey="CloseButtonBackgroundPointerOver" />
													<StaticResource x:Key="WindowCaptionButtonBackgroundPressed" ResourceKey="CloseButtonBackgroundPressed" />
													<StaticResource x:Key="WindowCaptionButtonStrokePointerOver" ResourceKey="CloseButtonStrokePointerOver" />
													<StaticResource x:Key="WindowCaptionButtonStrokePressed" ResourceKey="CloseButtonStrokePressed" />
												</ResourceDictionary>
											</ResourceDictionary.ThemeDictionaries>
										</ResourceDictionary>
									</Button.Resources>
								</Button>
							</Grid>
						</Grid>
						<ContentPresenter
							x:Name="ClientAreaPresenter"
							Canvas.ZIndex="0"
							Content="{TemplateBinding Content}"
							ContentTemplate="{TemplateBinding ContentTemplate}"
							ContentTransitions="{TemplateBinding ContentTransitions}"
							Foreground="{TemplateBinding Foreground}" />
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal">
									<VisualState.Setters>

										<Setter Target="MinimizeButton.Foreground" Value="{ThemeResource WindowCaptionForeground}" />
										<Setter Target="MinimizeButton.Background" Value="{ThemeResource WindowCaptionButtonBackground}" />
										<Setter Target="MaximizeButton.Foreground" Value="{ThemeResource WindowCaptionForeground}" />
										<Setter Target="MaximizeButton.Background" Value="{ThemeResource WindowCaptionButtonBackground}" />
										<Setter Target="CloseButton.Foreground" Value="{ThemeResource WindowCaptionForeground}" />
										<Setter Target="CloseButton.Background" Value="{ThemeResource WindowCaptionButtonBackground}" />
									</VisualState.Setters>
								</VisualState>
								<VisualState x:Name="WindowInactive">
									<VisualState.Setters>

										<Setter Target="MinimizeButton.Foreground" Value="{ThemeResource WindowCaptionForegroundDisabled}" />
										<Setter Target="MinimizeButton.Background" Value="{ThemeResource WindowCaptionButtonBackground}" />
										<Setter Target="MaximizeButton.Foreground" Value="{ThemeResource WindowCaptionForegroundDisabled}" />
										<Setter Target="MaximizeButton.Background" Value="{ThemeResource WindowCaptionButtonBackground}" />
										<Setter Target="CloseButton.Foreground" Value="{ThemeResource WindowCaptionForegroundDisabled}" />
										<Setter Target="CloseButton.Background" Value="{ThemeResource WindowCaptionButtonBackground}" />
									</VisualState.Setters>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

And in page
<Page ...>
...
    <Grid>
        <Border
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Background="{ThemeResource SystemChromeMediumColor}"
            Canvas.ZIndex="0"
            IsHitTestVisible="False" />

        <winui:NavigationView
            x:Name="navigationView"
            Padding="32"
            HorizontalContentAlignment="Stretch"
            VerticalContentAlignment="Stretch"
            IsSettingsVisible="True"
            IsTitleBarAutoPaddingEnabled="True"
            PaneDisplayMode="Left" >

            <winui:NavigationView.ContentOverlay>
                <Grid
                    x:Name="appTitleBar"
                    Height="44"
                    Margin="46,0,0,0"
                    Padding="0"
                    VerticalAlignment="Top"
                    Canvas.ZIndex="3"
                    IsHitTestVisible="False">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Image
                        x:Name="AppFontIcon"
                        Width="16"
                        Height="16"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Center"
                        Source="/Images/Square44x44Logo.png" />
                    <TextBlock
                        x:Name="AppTitle"
                        Grid.Column="1"
                        Margin="12,0,0,0"
                        VerticalAlignment="Center"
                        Style="{StaticResource CaptionTextBlockStyle}"
                        Text="..." />
                </Grid>
            </winui:NavigationView.ContentOverlay>
...
            <Grid
                x:Name="grid"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                Canvas.ZIndex="0">

                <Frame x:Name="shellFrame" />

            </Grid>
        </winui:NavigationView>
    </Grid>
</Page>

Dont forget  ExtendsContentIntoTitleBar = true  and  SetTitleBar();

And if app have ThemeSelector, and you need get rid of wrong colors in WindowCaptionButtons, we can duct tape WindowChromeStyle befor we get normal api.
<Grid x:Name="LayoutRoot" RequestedTheme="{Binding ElementName=ClientAreaPresenter, Path=Content.RequestedTheme}">
var window = App.ActivationService.GetWindow() as MainWindow;//
           window.DispatcherQueue.TryEnqueue(() =>
           {
               if (window.Content is FrameworkElement frameworkElement)
               {
                   frameworkElement.RequestedTheme = Theme;
                   if (window.Content is ShellPage page)
                   {
                       window.ExtendsContentIntoTitleBar = true;
                       window.SetTitleBar(page.AppTitleBar);
                   }
               }
           });

@martibravo Thank you for sharing this! Does your solution work in WinAppSDK 1.0? Are your interactive elements actually clickable in their whole height? When I use AppWindow.TitleBar.ExtendsContentIntoTitleBar = true together with SetDragRectangles(), the DragRectangle(s) are getting successfully set but a non-draggable TitleBar region (~22px high) still remains. Within this region, nothing is clickable. If your example really works, please provide a code snippet. Her is mine:
<Grid>
  <TabView>
	  <TabView.TabStripFooter>
		  <Grid x:Name="CustomDragRegion" Background="Red" IsHitTestVisible="False" SizeChanged="CustomDragRegion_SizeChanged" />
	  </TabView.TabStripFooter>
	  <TabView.TabItems>
		  <TabViewItem Header="TabItem1">
			  <TextBlock Text="Item 1" />
		  </TabViewItem>
		  <TabViewItem Header="TabItem2"></TabViewItem>
		  <TabViewItem Header="TabItem3"></TabViewItem>
		  <TabViewItem Header="TabItem4"></TabViewItem>
	  </TabView.TabItems>
  </TabView>
  <ToggleButton VerticalAlignment="Top" IsChecked="False" Content="This Button cannot be clicked beause it is overlapped by a ~22px high invisible title bar" ></ToggleButton>
</Grid>

public sealed partial class MainWindow : Window
	{
		public AppWindow AW { get; set; }
		public bool IsCustomizationSupported { get; set; } = false;

		private AppWindow GetAppWindowForCurrentWindow()
		{
			IntPtr hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
			WindowId myWndId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd);
			return AppWindow.GetFromWindowId(myWndId);
		}

		public MainWindow()
		{
			this.InitializeComponent();

			IsCustomizationSupported = AppWindowTitleBar.IsCustomizationSupported();

			if (IsCustomizationSupported)
			{
				AW = GetAppWindowForCurrentWindow();
				AW.TitleBar.ExtendsContentIntoTitleBar = true;
				AW.Title = "App title goes here";
			}
		}

		private void CustomDragRegion_SizeChanged(object sender, SizeChangedEventArgs e)
		{
			if (IsCustomizationSupported && AW != null)
			{
				int x = AW.Size.Width - (int)e.NewSize.Width;
				int y = 0;
				int width = (int)e.NewSize.Width;
				int height = (int)e.NewSize.Height;

				AW.TitleBar.SetDragRectangles(new RectInt32[] { new RectInt32(x, y, width, height) });
			}
		}
	}

Neither the TabViewItems nor the ToggleButton are clickable. So I guess AppWindow.TitleBar.ExtendsContentIntoTitleBar is just as broken as Window.ExtendsContentIntoTitleBar?

Now that WindowsAppSDK v1.0 stable has been released I decided to look into using AppWindow stuff again. All sorts of crashes using it. I need to repro on my other computer (Win11) but I wonder if its because IsCustomizationSupported is always returning false here. And it's doing that because the docs say:

In the current release, title bars can be customized only on Windows 11. Use this property to determine whether the title bar can be customized.

If so that is a little annoying that we have to do things very differently in Win10 vs Win11.

I finally found the issue in my code: it is actually a bug. Setting the Rectangle too early, when the UI is not yet fully constructed, will hard-code the non-draggable and non-interactive "titlebar ghost" that I described. The draggable Rectangle will get updated on every CustomDragRegion_SizeChanged event but the "ghost" will stay forever. Adding the event handler at a later stage, e.g. when the TabView got initialized, does the trick:
<TabView Loaded="TabView_Loaded" TabCloseRequested="TabView_TabCloseRequested">

private void TabView_Loaded(object sender, RoutedEventArgs e)
{
	CustomDragRegion.SizeChanged += CustomDragRegion_SizeChanged;
}

private void TabView_TabCloseRequested(TabView sender, TabViewTabCloseRequestedEventArgs args)
{
	sender.TabItems.Remove(args.Item);
}

Then, changes to the Window size and and closing tabs will properly recalculate the draggable region and the interactive elements stay clickable.

@beeradmoore You are right about the 3 possibilities. I think number 2 is the way to go. I summarized everything I learned about AppWindowTitlebar and Window.SetTitleBar() into this example: https://github.com/WelterDevelopment/WinUI3TitleBar. Here, The UI in W10 looks roughly the same as in W11, where in W11 you have the new features (namely Snap Layouts and the custom drag rectangles).

Follow-Up (sorry for the spam but it's quite important to know):
TitleBar.SetDragRectangles() seems to use raw pixels instead of view pixels. Why this is the case is beyond me; I just figured this out by accident because I use 125% scaling at my laptop and I wondered why my DragRectangles are shifted and distorted.
So if you want your app to support the system's dpi scale factor (e.g. 125%) you need to calculate the view pixels yourself with XamlRoot.RasterizationScale (whis is e.g. 1.25):
private void CustomDragRegion_SizeChanged(object sender, SizeChangedEventArgs e)
{
  int width = (int)(RootGrid.XamlRoot.RasterizationScale * e.NewSize.Width);
  int height = (int)(RootGrid.XamlRoot.RasterizationScale * e.NewSize.Height);
  int x = (int)(RootGrid.XamlRoot.RasterizationScale * InteractiveElement.ActualWidth);
  int y = 0;

  AW.TitleBar.SetDragRectangles(new RectInt32[] { new RectInt32(x, y, width, height) });
}

Dragging the app to a second display with another scale factor (e.g. 100%) will conveniently also trigger your SizeChanged event(s), so the DragRectangle(s) are properly set according to the new XamlRoot.RasterizationScale (1.00).

For unpackaged apps the AppWindow.GetFromWindowId(windowId) throws the following exception after re-running the application:
System.Reflection.TargetInvocationException: „Exception has been thrown by the target of an invocation.”

SEHException: External component has thrown an exception

I found in another thread that the following must be added to the app.manifest file under <assembly>
	<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
		<application>
			<!-- Windows 10 and Windows 11 -->
			<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
		</application>
	</compatibility>

After adding this and recompiling the project it starts working again

Even with @WelterDevelopment's trick I'm unable to get rid of the ghost rectangles. They continue to accumulate as my app rescales when the DPI changes or the drag rectangles are replaced. The only way I could get this working is by calling AppWindowTitleBar.ResetToDefault, which does get rid of every single rectangle but causes severe visual glitches due to AppWindowTitleBar.ExtendsContentIntoTitleBar being set to false for a split second there.

I finally found the issue in my code: it is actually a bug. Setting the Rectangle too early, when the UI is not yet fully constructed, will hard-code the non-draggable and non-interactive "titlebar ghost" that I described. The draggable Rectangle will get updated on every CustomDragRegion_SizeChanged event but the "ghost" will stay forever. Adding the event handler at a later stage, e.g. when the TabView got initialized, does the trick:
<TabView Loaded="TabView_Loaded" TabCloseRequested="TabView_TabCloseRequested">

private void TabView_Loaded(object sender, RoutedEventArgs e)
{
	CustomDragRegion.SizeChanged += CustomDragRegion_SizeChanged;
}

private void TabView_TabCloseRequested(TabView sender, TabViewTabCloseRequestedEventArgs args)
{
	sender.TabItems.Remove(args.Item);
}

Then, changes to the Window size and and closing tabs will properly recalculate the draggable region and the interactive elements stay clickable.

Can you supply the code for the windows app sdk tabs in titlebar where the buttons work

Here is a c# version of the code
using Microsoft.UI.Windowing;
using Microsoft.UI.Windowing.Interop;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using Windows.Foundation;
using Windows.Foundation.Metadata;
using Windows.UI;

public struct MainWindow : MainWindowT<MainWindow>
{
    public MainWindow()
    {
        InitializeComponent();
        GetAppWindow();

        if (!AppWindowTitleBar.IsCustomizationSupported())
        {
            // Why? Because I don't care
            throw new Exception("Unsupported OS version.");
        }

        titleBar = appWindow.TitleBar;
        titleBar.ExtendsContentIntoTitleBar = true;
        IReference<Color> btnColor = Colors.Transparent;
        // Make the background transparent so it matches my custom title bar
        titleBar.BackgroundColor = btnColor;
        titleBar.ButtonBackgroundColor = btnColor;
        titleBar.InactiveBackgroundColor = btnColor;
        titleBar.ButtonInactiveBackgroundColor = btnColor;

        // Application theme
        rootElement = Content as FrameworkElement;
        if (rootElement != null)
        {
            // Initial state
            OnThemeChanged(rootElement, null);

            themeChangedRevoker = rootElement.RegisterPropertyChangedCallback(FrameworkElement.ActualThemeProperty, OnThemeChanged);
        }
    }

    private void GetAppWindow()
    {
        // There is no way to do it in WinUI, need to play with handlers.
        IWindowNative windowNative = this.As<IWindowNative>();
        if (windowNative == null)
        {
            throw new NotSupportedException("IWindowNative not supported.");
        }

        IntPtr handler = windowNative.WindowHandle;
        windowId = GetWindowIdFromWindow(handler);
        appWindow = AppWindow.GetFromWindowId(windowId);
    }

    private double GetScaleAdjustment()
    {
        DisplayArea displayArea = DisplayArea.GetFromWindowId(windowId, DisplayAreaFallback.Primary);
        IntPtr hMonitor = GetMonitorFromDisplayId(displayArea.DisplayId);
        // Get DPI
        uint dpiX, dpiY;
        GetDpiForMonitor(hMonitor, MONITOR_DPI_TYPE.MDT_Default, out dpiX, out dpiY);
        // Magic numbers from Microsoft. Have no idea what is going on.
        uint scaleFactorPercent = (dpiX * 100 + 48) / 96;
        return scaleFactorPercent / 100.0;
    }

    private IReference<Color> GetColor(string brushName)
    {
        return Application.Current.Resources[brushName] is SolidColorBrush brush ? brush.Color : null;
    }

    public void OnTitleBarLoaded(object sender, RoutedEventArgs args)
    {
        titleBarSizeChangedRevoker = CustomDragRegion.SizeChanged += OnTitleBarSizeChanged;
    }

    public void OnTitleBarSizeChanged(object sender, SizeChangedEventArgs args)
    {
        Size newSize = args.NewSize;
        double scale = GetScaleAdjustment();

        int x = (int)((appWindow.Size.Width - newSize.Width) * scale);
        int y = 0;
        int width = (int)(newSize.Width * scale);
        int height = (int)(newSize.Height * scale);

        titleBar.SetDragRectangles(new Rect(x, y, width, height));
    }

    public void OnThemeChanged(DependencyObject sender, DependencyProperty dp)
    {
        // Update caption buttons
        titleBar.ButtonForegroundColor = GetColor("TextFillColorPrimaryBrush");
        titleBar.ButtonHoverBackgroundColor = GetColor("SubtleFillColorSecondaryBrush");
        titleBar.ButtonPressedBackgroundColor = GetColor("SubtleFillColorTertiaryBrush");
    }

    private HWND handler;
    private WindowId windowId;
    private AppWindow

@jarno9981
My answer is probably too late, but it could help anyone else who is still fighting with it.
I got things working using the answers in this thread and a bit of ChatGPT magic. The SetTitleBar() approach didn't work for me: the controls on my custom title bar were not responding to mouse events. AppWindow, however, works just fine. I also managed to fix the incorrect background colours of the caption buttons.
I used C++/WinRT in my project. It will add some variety to this thread. It is not that hard to rewrite the code in C# anyway. Also, I used Windows 11 SDK 10.0.22621.0 and WindowsAppSDK 1.2.230217.4. If my solution does not work for you, try to update these components.
So here is what I've done:
XAML layout:
<Grid>
    <TabView x:Name="TitleBar"
             Loaded="OnTitleBarLoaded">
        <TabView.TabStripFooter>
            <Grid x:Name="CustomDragRegion"
                  IsHitTestVisible="False" />
        </TabView.TabStripFooter>
        <TabView.TabItems>
            <TabViewItem Header="TabItem1"
                         IsClosable="False">
                <TextBlock Text="Item 1"></TextBlock>
            </TabViewItem>
            <TabViewItem Header="TabItem2">
                <Button x:Name="myButton">Click Me</Button>
            </TabViewItem>
            <TabViewItem Header="TabItem3"></TabViewItem>
            <TabViewItem Header="TabItem4"></TabViewItem>
        </TabView.TabItems>
    </TabView>
</Grid>

I used the layout provided by @WelterDevelopment. Remember to set the Loaded event here to get rid of the "ghost" title bar that blocks your controls.
Header file:
struct MainWindow : MainWindowT<MainWindow>
{
    MainWindow();

private:
    void GetAppWindow();
    double GetScaleAdjustment();
    Windows::Foundation::IReference<Windows::UI::Color> GetColor(winrt::hstring const& brushName);

public: // Events
    void OnThemeChanged(Microsoft::UI::Xaml::FrameworkElement const& sender, Windows::Foundation::IInspectable const&);
    void OnTitleBarLoaded(Windows::Foundation::IInspectable const&, Microsoft::UI::Xaml::RoutedEventArgs const&);
    void OnTitleBarSizeChanged(Windows::Foundation::IInspectable const&, Microsoft::UI::Xaml::SizeChangedEventArgs const& args);

private:
    HWND handler{ 0 };
    Microsoft::UI::WindowId windowId{ 0 };
    Microsoft::UI::Windowing::AppWindow appWindow{ nullptr };
    Microsoft::UI::Windowing::AppWindowTitleBar titleBar{ nullptr };
    Microsoft::UI::Xaml::FrameworkElement rootElement{ nullptr };
    // Event revokers
    Microsoft::UI::Xaml::FrameworkElement::ActualThemeChanged_revoker themeChangedRevoker;
    Microsoft::UI::Xaml::Controls::Grid::Loaded_revoker titleBarLoadedRevoker;
    Microsoft::UI::Xaml::Controls::Grid::SizeChanged_revoker titleBarSizeChangedRevoker;
};

Source file:
MainWindow::MainWindow()
{
    InitializeComponent();
    GetAppWindow();

    if (!AppWindowTitleBar::IsCustomizationSupported())
    {
        // Why? Because I don't care
        throw std::runtime_error("Unsupported OS version.");
    }

    titleBar = appWindow.TitleBar();
    titleBar.ExtendsContentIntoTitleBar(true);
    IReference<Windows::UI::Color> btnColor(Colors::Transparent());
    // Make the background transparent so it matches my custom title bar
    titleBar.BackgroundColor(btnColor);
    titleBar.ButtonBackgroundColor(btnColor);
    titleBar.InactiveBackgroundColor(btnColor);
    titleBar.ButtonInactiveBackgroundColor(btnColor);

    // Application theme
    rootElement = this->Content().try_as<FrameworkElement>();
    if (rootElement)
    {
        // Initial state
        OnThemeChanged(rootElement, { nullptr });

        themeChangedRevoker = rootElement.ActualThemeChanged(auto_revoke, { this, &MainWindow::OnThemeChanged });
    }
}

void MainWindow::GetAppWindow()
{
    // There is no way to do it in WinUI, need to play with handlers.
    auto windowNative{ this->try_as<IWindowNative>() };
    check_bool(windowNative);
    windowNative->get_WindowHandle(&handler);
    windowId = GetWindowIdFromWindow(handler);
    appWindow = AppWindow::GetFromWindowId(windowId);
}

double MainWindow::GetScaleAdjustment()
{
    DisplayArea displayArea = DisplayArea::GetFromWindowId(windowId, DisplayAreaFallback::Primary);
    HMONITOR hMonitor = GetMonitorFromDisplayId(displayArea.DisplayId());
    // Get DPI
    UINT dpiX, dpiY;
    check_hresult(GetDpiForMonitor(hMonitor, MDT_DEFAULT, &dpiX, &dpiY));
    // Magic numbers from Microsoft. Have no idea what is going on.
    UINT scaleFactorPercent = (dpiX * 100 + 48) / 96;
    return scaleFactorPercent / 100.;
}

IReference<Windows::UI::Color> MainWindow::GetColor(winrt::hstring const& brushName)
{
    return Application::Current().Resources().Lookup(box_value(brushName)).as<SolidColorBrush>().Color();
}

void MainWindow::OnTitleBarLoaded(IInspectable const&, RoutedEventArgs const&)
{
    titleBarSizeChangedRevoker = CustomDragRegion().SizeChanged(auto_revoke, { this, &MainWindow::OnTitleBarSizeChanged });
}

void MainWindow::OnTitleBarSizeChanged(IInspectable const&, SizeChangedEventArgs const& args)
{
    Size newSize = args.NewSize();
    auto scale = GetScaleAdjustment();

    int x = (appWindow.Size().Width - newSize.Width) * scale;
    int y = 0;
    int width  = newSize.Width  * scale;
    int height = newSize.Height * scale;

    titleBar.SetDragRectangles({ { x, y, width, height } });
}

void MainWindow::OnThemeChanged(Microsoft::UI::Xaml::FrameworkElement const& sender, Windows::Foundation::IInspectable const&)
{
    // Update caption buttons
    titleBar.ButtonForegroundColor(GetColor(L"TextFillColorPrimaryBrush"));
    titleBar.ButtonHoverBackgroundColor(GetColor(L"SubtleFillColorSecondaryBrush"));
    titleBar.ButtonPressedBackgroundColor(GetColor(L"SubtleFillColorTertiaryBrush"));
}

The code is pretty much self-explanatory, so I don't know what to add here. I change the title bar drag region when the size of the footer changes and change the caption button colours when the theme changes. The neat part was getting colour resources in C++ because there is no documentation for C++/WinRT in WinUI 3.
Keep in mind that SetDragRectangles() expects physical pixels, so you should make it DPI-aware. I also did not set the TabView::Closed event because it revokes when my window destroys anyway. Maybe I should've, but... Well, whatever.
Hope it will help someone.

Which package did you use nuget

Which package did you use nuget

I used a "Blank App, Packaged (WinUI 3 in Desktop)" project template in Visual Studio. It comes with some NuGet packages. Here is what I have:

Microsoft.Windows.CppWinRT 2.0.230225.1
Microsoft.Windows.ImplementationLibrary 1.0.230202.1
Microsoft.Windows.SDK.BuildTools 10.0.22621.755
Microsoft.WindowsAppSDK 1.2.230217.4

Also, you can clone my solution, and check it yourself: https://github.com/Krakenus00/KrakenRenderer.

@Krakenus00 can you provide c# example

@Krakenus00 can you provide c# example

Sorry, I don't have C# templates installed. I currently don't plan to mess with C# WinUI. The C++/WinRT code is very similar to C#. I actually wrote this all using C# examples.
Here are the main differences:

In C#, you have only one .cs file with both definitions and implementation, while in C++, it is .h for definitions and .cpp for implementation.
In C#, you access sub-namespaces using . operator, and in C++ it is ::.
In C#, you don't need revokers to work with events. Simply write Event += myFunction; to subscribe, or -= to unsubscribe.
WinRT's IInspectable is basically C#'s object.
Retrieving the AppWindow is a bit different, use the following code as a reference:
Source: https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/windowing/windowing-overview

// MainWindow.xaml.cs
private void myButton_Click(object sender, RoutedEventArgs e)
{
    // Retrieve the window handle (HWND) of the current (XAML) WinUI 3 window.
    var hWnd =
        WinRT.Interop.WindowNative.GetWindowHandle(this);

    // Retrieve the WindowId that corresponds to hWnd.
    Microsoft.UI.WindowId windowId =
        Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd);

    // Lastly, retrieve the AppWindow for the current (XAML) WinUI 3 window.
    Microsoft.UI.Windowing.AppWindow appWindow =
        Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);

    if (appWindow != null)
    {
        // You now have an AppWindow object, and you can call its methods to manipulate the window.
        // As an example, let's change the title text of the window.
        appWindow.Title = "Title text updated via AppWindow!";
    }
}

To get DPI, you need to use system API, so it is a bit tricky in C#. Here is a code provided by Microsoft:
Source: https://learn.microsoft.com/en-us/windows/apps/develop/title-bar?tabs=wasdk#interactive-content.

[DllImport("Shcore.dll", SetLastError = true)]
internal static extern int GetDpiForMonitor(IntPtr hmonitor, Monitor_DPI_Type dpiType, out uint dpiX, out uint dpiY);

internal enum Monitor_DPI_Type : int
{
    MDT_Effective_DPI = 0,
    MDT_Angular_DPI = 1,
    MDT_Raw_DPI = 2,
    MDT_Default = MDT_Effective_DPI
}

private double GetScaleAdjustment()
{
    IntPtr hWnd = WindowNative.GetWindowHandle(this);
    WindowId wndId = Win32Interop.GetWindowIdFromWindow(hWnd);
    DisplayArea displayArea = DisplayArea.GetFromWindowId(wndId, DisplayAreaFallback.Primary);
    IntPtr hMonitor = Win32Interop.GetMonitorFromDisplayId(displayArea.DisplayId);

    // Get DPI.
    int result = GetDpiForMonitor(hMonitor, Monitor_DPI_Type.MDT_Default, out uint dpiX, out uint _);
    if (result != 0)
    {
        throw new Exception("Could not get DPI for monitor.");
    }

    uint scaleFactorPercent = (uint)(((long)dpiX * 100 + (96 >> 1)) / 96);
    return scaleFactorPercent / 100.0;
}

@Krakenus00 can you provide c# example

I tried to create a c# example everything worked fine.
Just that there is no place to drag windows.

there is no place to drag windows.

You need to call SetDragRectangles() to create draggable regions. In the code provided, I use TabView's footer as a draggable region.

there is no place to drag windows.

You need to call SetDragRectangles() to create draggable regions. In the code provided, I use TabView's footer as a draggable region.

I didn't pay attention to this. Tnx

@Krakenus00  i forget to add these Microsoft.Windows.CppWinRT 2.0.230225.1 / Microsoft.Windows.ImplementationLibrary 1.0.230202.1

@jarno9981
@Krakenus00
i fixed issue with help of ChatGPT😁
this is a c# example that is working fine with draggable
OnTitleBarSizeChanged codes is a little confusing and can be written better
private AppWindow appWindow;
        private AppWindowTitleBar titleBar;
        public MainWindow()
        {
            this.InitializeComponent();

            var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);

            WindowId windowId = Win32Interop.GetWindowIdFromWindow(hWnd);

            appWindow = AppWindow.GetFromWindowId(windowId);

            if (!AppWindowTitleBar.IsCustomizationSupported())
            {
                // Why? Because I don't care
                throw new Exception("Unsupported OS version.");
            }

            titleBar = appWindow.TitleBar;
            titleBar.ExtendsContentIntoTitleBar = true;
            var btnColor = Colors.Transparent;
            titleBar.BackgroundColor = btnColor;
            titleBar.ButtonBackgroundColor = btnColor;
            titleBar.InactiveBackgroundColor = btnColor;
            titleBar.ButtonInactiveBackgroundColor = btnColor;
        }

        public void OnTitleBarLoaded(object sender, RoutedEventArgs args)
        {
            CustomDragRegion.SizeChanged += OnTitleBarSizeChanged;
        }
        public void OnTitleBarSizeChanged(object sender, SizeChangedEventArgs args)
        {
           double scaleAdjustment = GetScaleAdjustment();

            CustomDragRegion.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
            var customDragRegionPosition = CustomDragRegion.TransformToVisual(null).TransformPoint(new Point(0, 0));

            List<Windows.Graphics.RectInt32> dragRectsList = new();

            Windows.Graphics.RectInt32 dragRectL;
            dragRectL.X = (int)(customDragRegionPosition.X * scaleAdjustment);
            dragRectL.Y = (int)(customDragRegionPosition.Y * scaleAdjustment);
            dragRectL.Height = (int)((CustomDragRegion.ActualHeight - customDragRegionPosition.Y) * scaleAdjustment);
            dragRectL.Width = (int)((CustomDragRegion.ActualWidth / 2) * scaleAdjustment);
            dragRectsList.Add(dragRectL);

            Windows.Graphics.RectInt32 dragRectR;
            dragRectR.X = (int)((customDragRegionPosition.X + CustomDragRegion.ActualWidth / 2) * scaleAdjustment);
            dragRectR.Y = (int)(customDragRegionPosition.Y * scaleAdjustment);
            dragRectR.Height = (int)((CustomDragRegion.ActualHeight - customDragRegionPosition.Y) * scaleAdjustment);
            dragRectR.Width = (int)((CustomDragRegion.ActualWidth / 2) * scaleAdjustment);
            dragRectsList.Add(dragRectR);

            Windows.Graphics.RectInt32[] dragRects = dragRectsList.ToArray();

            appWindow.TitleBar.SetDragRectangles(dragRects);
        }

        [DllImport("Shcore.dll", SetLastError = true)]
        internal static extern int GetDpiForMonitor(IntPtr hmonitor, Monitor_DPI_Type dpiType, out uint dpiX, out uint dpiY);

        internal enum Monitor_DPI_Type : int
        {
            MDT_Effective_DPI = 0,
            MDT_Angular_DPI = 1,
            MDT_Raw_DPI = 2,
            MDT_Default = MDT_Effective_DPI
        }

        private double GetScaleAdjustment()
        {
            IntPtr hWnd = WindowNative.GetWindowHandle(this);
            WindowId wndId = Win32Interop.GetWindowIdFromWindow(hWnd);
            DisplayArea displayArea = DisplayArea.GetFromWindowId(wndId, DisplayAreaFallback.Primary);
            IntPtr hMonitor = Win32Interop.GetMonitorFromDisplayId(displayArea.DisplayId);

            // Get DPI.
            int result = GetDpiForMonitor(hMonitor, Monitor_DPI_Type.MDT_Default, out uint dpiX, out uint _);
            if (result != 0)
            {
                throw new Exception("Could not get DPI for monitor.");
            }

            uint scaleFactorPercent = (uint)(((long)dpiX * 100 + (96 >> 1)) / 96);
            return scaleFactorPercent / 100.0;
        }

@ghost1372 does clicking tab buttons work to

@ghost1372 does clicking tab buttons work to

Yes

@ghost1372 does clicking tab buttons work to

Yes

The example works super


Clean up of the env yaml file

It seems that the env yaml file is just auto generated? leaving many package that is not used to be installed. Can they authors check what packages are really needed because the current yaml file also triggers multiple errors regarding the version of packages to be installed. (auto-generated version limits are being too tight)

Sorry for the inconvenience, I recommend installing key dependencies such as pytorch, diffusers, accelerate, xformers, etc. according to our README file.
I will update a new, more concise yaml file over time.

Sorry for the inconvenience, I recommend installing key dependencies such as pytorch, diffusers, accelerate, xformers, etc. according to our README file. I will update a new, more concise yaml file over time.

Hi, thanks for replying. Another question as I want to replicate your training: many toutube videos being used in the dataset is no longer public, making them not ready for downloading. Can the authors release that portion of data, or maybe this is restricted due to some regulations?


Falco webserver with SSL error: null context when constructing CivetServer

Describe the bug
Falco SSL webserver start up error msg
Runtime error: Could not create embedded webserver: null context when constructing CivetServer. Possible problem binding to port. Exiting.
This message only appears when setting enable_ssl to true and provide an ssl certificate with key.  Webserver will start properly when ssl is disabled.
How to reproduce it
Using latest helm chart with the following values set
ssl_enabled=true
certs.server.crt=./falco-cert/server.crt
certs.server.key=./falco-cert/server.key
Falco secret is created with server.pem and mounted on falco container
Expected behaviour
Falco webserver is able to start properly when ssl enabled
Environment

Falco version: 0.29.1
System info:  k8s: 1.19.14
Cloud provider or hardware configuration:
OS:
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Kernel:
Linux ip-10-1-3-37 5.8.0-1038-aws #40~20.04.1-Ubuntu SMP Thu Jun 17 13:25:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Installation method:
Kubernetes helm chart installation

Additional context
Falco will start and run properly without ssl enabled.
This is not a port issue.  I've verified that the port is not in use but for troubleshooting purposes I tried 3 other non-standard unique port numbers.
I've also tried four different certificates including a sample provided on the CivietServer github repo, self-signed, self-signed with a RootCA, and published CA created cert.
I'm seeing the same problem with ssl enabled webserver on pervious versions of falco versions (0.29.0, 0.28.1).

Hi!
Sorry for the late reply; a quick search discovered: https://github.com/falcosecurity/falco/issues/860.
Can you have a look at it? Specially this comment: https://github.com/falcosecurity/falco/issues/860#issuecomment-575087263.
If the fix works for you, i guess that issue is still valid.

The issue may be depending on the OS, but it is still present and related to libssl version, on Ubuntu 18.04 and the latest falco
falco --version
# Falco version: 0.30.0
# Driver version: 3aa7a83bf7b9e6229a3824e3fd1f4452d1e95cb4

In this case it looks like falco finds a libcrypto.so
strace falco > falco.txt 2>&1
cat falco.txt
...
stat("/usr/lib/x86_64-linux-gnu/x86_64", 0x7ffde0c7b070) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libcrypto.so", O_RDONLY|O_CLOEXEC) = 7
read(7, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\200\7\0\0\0\0\0"..., 832) = 832
fstat(7, {st_mode=S_IFREG|0644, st_size=2917216, ...}) = 0
mmap(NULL, 5025632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 7, 0) = 0x7fc2ccb2f000
mprotect(0x7fc2ccdca000, 2093056, PROT_NONE) = 0
mmap(0x7fc2ccfc9000, 188416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 7, 0x29a000) = 0x7fc2ccfc9000
mmap(0x7fc2ccff7000, 12128, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fc2ccff7000
close(7)                                = 0
mprotect(0x7fc2ccfc9000, 180224, PROT_READ) = 0
munmap(0x7fc2d9e1a000, 34386)           = 0
fstat(1, {st_mode=S_IFREG|0644, st_size=3644817, ...}) = 0
uname({sysname="Linux", nodename="cp", ...}) = 0
close(3)                                = 0
sendto(4, "<11>Nov  6 19:55:30 falco: Runti"..., 166, MSG_NOSIGNAL, NULL, 0) = 166
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
write(2, "Sat Nov  6 19:55:30 2021: Runtim"..., 166Sat Nov  6 19:55:30 2021: Runtime error: Could not create embedded webserver: null context when constructing CivetServer. Possible problem binding to port.. Exiting.
) = 166
...

but it does not like the libcrypto.so version
cd /usr/lib/x86_64-linux-gnu
ls -al libcrypto.so
# lrwxrwxrwx 1 root root 16 Nov  6 20:19 libcrypto.so -> libcrypto.so.1.1
dpkg -S /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
# libssl1.1:amd64: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1

falco
Sat Nov  6 20:19:35 2021: Falco version 0.30.0 (driver version 3aa7a83bf7b9e6229a3824e3fd1f4452d1e95cb4)
Sat Nov  6 20:19:35 2021: Falco initialized with configuration file /etc/falco/falco.yaml
Sat Nov  6 20:19:35 2021: Loading rules from file /etc/falco/falco_rules.yaml:
Sat Nov  6 20:19:36 2021: Loading rules from file /etc/falco/falco_rules.local.yaml:
Sat Nov  6 20:19:36 2021: Loading rules from file /etc/falco/k8s_audit_rules.yaml:
Sat Nov  6 20:19:36 2021: Starting internal webserver, listening on port 8765 (SSL)
truncating vsnprintf buffer: [,]
truncating vsnprintf buffer: [,]
Sat Nov  6 20:19:36 2021: Runtime error: Could not create embedded webserver: null context when constructing CivetServer. Possible problem binding to port.. Exiting.

Switching back to the older libssl seems to help
cd /usr/lib/x86_64-linux-gnu
rm -f libcrypto.so
ln -s libcrypto.so.1.0.0 libcrypto.so
rm -f libssl.so
ln -s libssl.so.1.0.0 libssl.so  # otherwise Segmentation fault (core dumped)
dpkg -S /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
# libssl1.0.0:amd64: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0

falco
Sat Nov  6 20:29:10 2021: Falco version 0.30.0 (driver version 3aa7a83bf7b9e6229a3824e3fd1f4452d1e95cb4)
Sat Nov  6 20:29:10 2021: Falco initialized with configuration file /etc/falco/falco.yaml
Sat Nov  6 20:29:10 2021: Loading rules from file /etc/falco/falco_rules.yaml:
Sat Nov  6 20:29:10 2021: Loading rules from file /etc/falco/falco_rules.local.yaml:
Sat Nov  6 20:29:11 2021: Loading rules from file /etc/falco/k8s_audit_rules.yaml:
Sat Nov  6 20:29:11 2021: Starting internal webserver, listening on port 8765 (SSL)
20:29:11.422473000: Notice Privileged container started (user=<NA> user_loginuid=0 command=container:22cd012620b6 k8s_POD_calico-node-989s9_kube-system_651b6470-5d3d-47f4-86c2-6db10c71d81a_0 (id=22cd012620b6) image=k8s.gcr.io/pause:3.4.1)
20:29:11.572843000: Notice Privileged container started (user=<NA> user_loginuid=0 command=container:7e401d53807e k8s_POD_kube-proxy-6dmgn_kube-system_34ef93fa-d617-45a5-9f46-d287800b21e3_0 (id=7e401d53807e) image=k8s.gcr.io/pause:3.4.1)
...


pip install cupy-wheel - "not a valid wheel filename"

Description
When I try to pip install cupy-wheel I get the error cupy_wheel<...>.whl is not a valid wheel filename.
To Reproduce
pip install cupy-wheel

OS: Windows 10
Python: 3.8.9
pip: 23.1.2
CUDA: CUDA 11.7
Installation
None
Environment
Unable to install using cupy-wheel. Can install using pip install cupy-cuda11x.
Additional Information
No response

Hi @yonting, thanks for reporting - confirmed on my end. This is due to that pip 23.1 has changed it's behavior.
https://pip.pypa.io/en/stable/news/#v23-1

Remove setup.py install fallback when building a wheel failed for projects without pyproject.toml.

I'll try fixing the issue.

We've published a hot-fix release. Thanks again for reporting this one!


bookinfo service not able to communicate using short DNS names, while FQDN works.

Not sure if this is an issue or not, but the behavior is pretty weird, and should be somehow related to the setup. My bookinfo services not able to communicate to each other (stuck on envoy?) using short DNS names and able to do it using FQDN.
And it seems like non-DNS issue, since curl didn't return "Could not resolve host error".
Describe the bug
kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl productpage:9080/productpagecommand returns nothing
while kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- curl productpage.default.svc.cluster.local:9080/productpage | grep -o "<title>.*</title>" returns  <title>Simple Bookstore App</title>
Expected behavior
<title>Simple Bookstore App</title> should be returned
Steps to reproduce the bug
Install first cluster: https://preliminary.istio.io/docs/setup/kubernetes/install/multicluster/gateways/
Then, install bookinfo on it:
https://preliminary.istio.io/docs/examples/bookinfo/
Version
Istio 1.1
Kubernetes 1.11 and 1.12
Installation
https://preliminary.istio.io/docs/setup/kubernetes/install/multicluster/gateways/
Environment
GKE

Can you try
kubectl exec -it $(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}') -c ratings -- cat /etc/resolv.conf

For me, I get
search default.svc.cluster.local svc.cluster.local cluster.local
nameserver <IP_ADDRESS>
options ndots:5

The way name resolution works in Linux is that the system first tries to resolve.  If that fails, it tries each of the SEARCH choices as suffixes.  There is a limit of six search suffixes.

nameserver <IP_ADDRESS>
search default.svc.cluster.local svc.cluster.local cluster.local us-central1-a.c.blue-green-234712.internal c.blue-green-234712.internal google.internal
options ndots:5

Little bit more requests:
$ kubectl exec  $SLEEP_POD -n foo -c sleep -- curl -I productpage.default:9080/productpage
HTTP/1.1 404 Not Found
$ kubectl exec  $SLEEP_POD -n foo -c sleep -- curl -I productpage.default.svc.cluster.local:9080
HTTP/1.1 200 OK
$ kubectl exec  $SLEEP_POD -n foo -c sleep -- curl -I productpage:9080 | grep HTTP
curl: (6) Could not resolve host: productpage

OK.  It is different with multicluster.
This may be a duplicate of https://github.com/istio/istio/issues/12324
Are the sleep pod and productpage on the same pod?

They are in different pods and namespaces and it looks like your reference to the issue is the answer for my question.
What I need to change exactly (as temp solution) to make it work and check if it helps?

@olegchorny if the pods are in different namespaces the short name should include the namespace.
See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#what-things-get-dns-names:

Assume a Service named foo in the Kubernetes namespace bar. A Pod running in namespace bar can look up this service by simply doing a DNS query for foo. A Pod running in namespace quux can look up this service by doing a DNS query for foo.bar.

This may still fail due to #12324 and not having the short name (w/ns) in the host name config.

@elevran
yep, in my example I've provided three different cases with different outputs, let me copy them:
This case is not expected:
$ kubectl exec  $SLEEP_POD -n foo -c sleep -- curl -I **productpage.default**:9080/productpage
HTTP/1.1 **404 Not Found**

These two expected:
$ kubectl exec  $SLEEP_POD -n foo -c sleep -- curl -I **productpage.default.svc.cluster.local**:9080
HTTP/1.1 **200 OK**
$ kubectl exec  $SLEEP_POD -n foo -c sleep -- curl -I **productpage:9080** | grep HTTP
curl: (6) **Could not resolve host: productpage**

I missed the example with the NS. Can you please do a DNS lookup on the sleep pod to confirm you're getting the same correct IP address in all cases. If so, I'd suggest marking this as duplicate of #12324.
I'd suspect a fix will be in 1.1.1 shortly after the release.

@elevran
kubectl exec --context=$CTX_CLUSTER1 $SLEEP_POD -n foo -c sleep -- nslookup productpage.default.svc.cluster.local
Name:      productpage.default.svc.cluster.local
Address 1: <IP_ADDRESS> productpage.default.svc.cluster.local

kubectl exec --context=$CTX_CLUSTER1 $SLEEP_POD -n foo -c sleep -- nslookup productpage.default
Name:      productpage.default
Address 1: <IP_ADDRESS> productpage.default.svc.cluster.local

kubectl get svc
NAME          TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
details       ClusterIP   <IP_ADDRESS>    <none>        9080/TCP   10m
kubernetes    ClusterIP   <IP_ADDRESS>     <none>        443/TCP    16m
productpage   ClusterIP   <IP_ADDRESS>    <none>        9080/TCP   10m
ratings       ClusterIP   <IP_ADDRESS>   <none>        9080/TCP   10m
reviews       ClusterIP   <IP_ADDRESS>    <none>        9080/TCP   10m

Could this be a duplicate of https://github.com/istio/istio/issues/12324 ?

Seems to be.

Hi All,
I've made the fresh install using the release 1.1 bits and can't reproduce the issue.
I think I did the deployment using the bits from master branch, but not from release-1.1 branch, and something is not merged to master (yet).
I'm closing the issue. many thanks!


Adding SQL Server ODBC driver

resolve #95

Thanks for the PR. We need to think if we are allowed to distribute it in the docker image provided the license of the odbc driver.


Add ghactions docker job; revert Dockerfile fix to test

Codecov Report

Merging #1055 into master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #1055   +/-   ##
=========================================
  Coverage     99.43%   99.43%
  Complexity     2298     2298
=========================================
  Files           349      349
  Lines          6327     6327
  Branches        365      365
=========================================
  Hits           6291     6291
  Misses            5        5
  Partials         31       31

Flag
Coverage Δ
Complexity Δ

#unittests
?
?

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 25fd1bf...6736878. Read the comment docs.


Stay within mobile app when connecting to bank

Hi this is a request for help rather than an issue. I hope it is ok to ask here as I did not know where best to ask. I'm developing a mobile app with Vue.js and using the Dropin initialisation script at https://pay.gocardless.com/billing/static/dropin/v2/initialise.js.
Everything is working great, I am able to generate the billing request flow, open the modal, and create an instant payment. The problem is though that during the flow, I confirm my bank, and am presented with a "continue to your bank" link. This takes me out of the modal, and out of the app, and opens up a tab in the default browser on the mobile device. After I have logged in to the bank, and made the payment, I then have to close the browser tab and go back to the app, which is a pretty poor user experience all in all.
I feel like I am missing something because this page says that the Dropin allows users to complete the flow without leaving the site, but I am finding this is not the case at all. In fact I'm failing to see the point of the Dropin if you are forced to leave it to log in to your bank?
The only way I can see round it is to launch the billing request flow using an In App browser, in order to not get taken into a completely different app, but if I do this, then I will no longer be using the Dropin.
Please advise ..

Here's an update for anyone with an interest in using GoCardless with Vue.js. I was unable to get the Drop-in to work satisfactorily. It did actually work, but the problem that I had with it was when the user is redirected to the bank, they are taken out of the mobile app and into the default browser for the mobile device. The checkout completes ok but it is an unsatisfactory user experience because they have to close the tab in the browser, then navigate go back to the app, which I think a lot of people would find confusing and or irritating.
After a lot of trial and effort I have got it working really nicely with Cordova Inappbrowser though. This works because nicely because the browser does not have tabs, so when you are directed to the bank during a billing request flow you remain in the same window in the app. Upon completion you are prompted to close the tab, and upon doing so you are taken straight back to the place you were in the app before launching the browser.
I had difficulties updating the app on the status of the payment creation during the flow, until I figured out that I could use the "loadstart" event listener that is provided by the browser to watch the page urls during the flow and use the value of the "outcome" parameter to inform the app.
The result is a pretty streamlined and user friendly checkout experience, although there are a lot of steps involved in the billing request flow, compared with a standard credit / debit card payment.


Disable automatic creation of monitoring CRDs on new clusters.

What kind of request is this (question/bug/enhancement/feature request):
enhancement
A customer would like to use their own/our library prometheus charts, but the following CRDs are conflicting with the charts, making them not work.
alertmanagers.monitoring.coreos.com
podmonitors.monitoring.coreos.com
prometheuses.monitoring.coreos.com
prometheusrules.monitoring.coreos.com
servicemonitors.monitoring.coreos.com
It would be beneficial to create these CRDs only as needed when features are enabled by the user instead of when the cluster is created.

This feels much more like a bug than an enhancement.  If a cluster creator does not enable the built-in monitoring, it feels like it's wrong to install these CRDs.
This causes custom Prometheus-operator installs to require removing the existing CRDs we didn't ask for in order to replace them with the appropriate versions for our release.
Why this is a problem for me:
I'm currently working on a workflow for kube cluster provisioning and bootstrapping using terraform and terragrunt to eventually be triggered by some pretty CI gui.  These CRDs existing are the only thing stopping this workflow from being 100% automated without something gross like a local-exec or a one-off "go kubectl delete these things" step.

For anybody who finds this in a search, for the specific use case of using terraform and the helm provider, I came up with this workaround which seems to do what I'm looking for.  I'd prefer not needing to use a local-exec, but am ok with it as a short term workaround.  The local.host and local.token variables are extracted from the kubeconfig generated by the rancher2_cluster resource (I put that in vault in that module).  I make no warranties about this working for your things:
  triggers = {
    cluster_id = data.rancher2_cluster.custom_cluster.id
  }
  provisioner "local-exec" {
    command = "kubectl -s=$HOST --token=$TOKEN --insecure-skip-tls-verify delete crds alertmanagers.monitoring.coreos.com podmonitors.monitoring.coreos.com prometheuses.monitoring.coreos.com prometheusrules.monitoring.coreos.com servicemonitors.monitoring.coreos.com || true"
    environment = {
      HOST  = local.host
      TOKEN = local.token
    }
  }
}```

@doug-ba while I hear your concerns that it would be ideal if Rancher create[d] these CRDs only as needed when features are enabled by the user instead of when the cluster is created, a workaround for this constraint that is currently being used by Monitoring V2 (which installs a different set of CRDs than are currently installed by the Rancher cluster) is to use our rancher-monitoring-crd Helm chart.
You can find the logic for how we configured something very similar to your script in https://github.com/rancher/charts/tree/release-v2.5/charts/rancher-monitoring/rancher-monitoring-crd/14.5.100, and I think you should be able to fork this chart and replace the contents of the crd-manifest directory with the versions of the CRDs you actually want installed on the cluster.
This would provide a Helm-based workaround for your current issue that will "assume ownership" of CRDs within the cluster; therefore, if you replace the contents of crd-manifest and redeploy, the new CRDs will be used. If you delete the CRD chart, the CRDs in the cluster should also be deleted.

Does anyone know how to handle this issue or is it resolved?


[SPARK-21947][SS] Check and report error when monotonically_increasing_id is used in streaming query

What changes were proposed in this pull request?
monotonically_increasing_id doesn't work in Structured Streaming. We should throw an exception if a streaming query uses it.
How was this patch tested?
Added test.

Test build #82142 has started for PR 19336 at commit 1a0c400.

Test build #82142 has finished for PR 19336 at commit 1a0c400.

This patch fails PySpark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/82142/
Test FAILed.

retest this please.

Test build #82143 has started for PR 19336 at commit 1a0c400.

Test build #82143 has finished for PR 19336 at commit 1a0c400.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/82143/
Test PASSed.

cc @zsxwing for review. Thanks.

Test build #82269 has started for PR 19336 at commit a4a50c5.

Test build #82270 has started for PR 19336 at commit 00bc6fb.

Test build #82269 has finished for PR 19336 at commit a4a50c5.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/82269/
Test PASSed.

Merged build finished. Test PASSed.

Test build #82270 has finished for PR 19336 at commit 00bc6fb.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/82270/
Test PASSed.

ping @zsxwing Can you take a look? Thanks.

Test build #82492 has started for PR 19336 at commit d5a9357.

Test build #82492 has finished for PR 19336 at commit d5a9357.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/82492/
Test PASSed.

LGTM. Merging to master.

Thanks @zsxwing @dongjoon-hyun