text:
pytest example in testing.rst

There are a few confusing things concerning pytest in testing.rst:

it doesn't uses async/await unlike the rest of the docs but @asyncio.coroutine and yield from.

it says in the comment "# assuming you are using pytest-asyncio" but then it sets up its entirely independent loop fixture and uses loop.run_until_complete explicitly, instead of using pytest.mark.asyncio from pytest-asyncio

If people agree that these should be changed to async/await and pytest.mark.asyncio then I can create a pull request to update the example.

In addition the examples refer to a _create_example_app and in the pytest case, create_app, but they're not spelled out. But this would be useful for me to see for newbies like me.

When I try to naively update the example to use pytest-asyncio and change the fixtures to use event_loop from pytest-asyncio and also use @pytest.mark.asyncio, things fail for me with errors. So I think the docs should either explain you should not use pytest-asyncio or also include a pytest-asyncio example that works.

Agree that there is a confusion with the testing.rst file, however the test case coded is not oriented to the pytest-asyncio plugin.
Talking about the issue that you mentioned it is a well known issue that is like a pain in the ass, and already reported and in the roadmap for future versions of pytest-asyncio [1].
There is a workaround that can be modified and use it to avoid the issue of close the loop just after the execution of the tests. The following fixture will replace the event_loop used by py.test and will avoid the side effects of the premature close of the loop faking it as a lambda parameter yielding the responsibility to close the loop to the loop_context delivered by aiohttp.

@pytest.yield_fixture
def loop():
    with loop_context() as loop:
        yield loop

@pytest.yield_fixture
def event_loop(loop):
    loop._close = loop.close
    loop.close = lambda: None
    yield loop
    loop.close = loop._close

However will be nice if the guys from asyncio keep on eye on the pytest-asyncio project and once this issue will be fixed write back the test example using the pattern that uses pytest.mark.asyncio decorator having a less verbose code /cc @asvetlov
[1] https://github.com/pytest-dev/pytest-asyncio/issues/29

Yes, the test code isn't oriented to pytest-asyncio but it mentions you assume you use it in a comment, which is very misleading, as it's the opposite of what it actually does... I went with ignoring pytest-asyncio altogether myself. The documentation should be modified so it says you shouldn't be using pytest-asyncio if you use this pattern.

I think the issue can be closed.
Feel free to open another one if you discovered a new issue with testing doc.

authors: asvetlov faassen pfreixes

repo: KeepSafe/aiohttp


text:
Fix documentation after exception rename

https://github.com/KeepSafe/aiohttp/commit/0af33f90a7bcac11f82760a00e5499ab55027de2

Thanks!

source: gharchive/pull-request

authors: kxepal saghul

license_type: permissive

license_source: bigquery


text:
Unable to find type [SecretManagement.Keeper.Client].

I believe there is an issue with the windows powershell version (as opposed to PowerShell Core) of this module.  I am working with a fresh install of server 2019 and going through setup of the module.  This is what I am seeing:
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
PS C:\Windows\system32> Set-PSRepository psgallery -InstallationPolicy Trusted
PS C:\Windows\system32> Install-Module -Name Microsoft.PowerShell.SecretManagement
PS C:\Windows\system32> Install-Module -Name SecretManagement.Keeper -RequiredVersion 16.0.4
PS C:\Windows\system32> Install-Module -Name Microsoft.Powershell.SecretStore
PS C:\Windows\system32> Register-SecretVault -Name LocalStore -ModuleName Microsoft.Powershell.SecretStore
PS C:\Windows\system32> register-KeeperVault -Name Keeper -LocalVaultName LocalStore -OneTimeToken *******
Storing Keeper Vault config KeeperVault.Keeper in Microsoft.Powershell.SecretStore Vault named LocalStore
Unable to find type [SecretManagement.Keeper.Client].
At C:\Program Files\WindowsPowerShell\Modules\SecretManagement.Keeper\16.0.4\SecretManagement.Keeper.psm1:29 char:13

$result = [SecretManagement.Keeper.Client]::GetVaultConfig($OneTime ...

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : InvalidOperation: (SecretManagement.Keeper.Client:TypeName) [], RuntimeException
FullyQualifiedErrorId : TypeNotFound

PS C:\Windows\system32> get-host
Name             : ConsoleHost
Version          : 5.1.14393.4583
InstanceId       : ****
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Hello @ppibeauty
It appears that the Powershell is not able to locate SecretsManager.dll file. Can you confirm that you have a SecretsManager.dll on the same level as .psd1 files in the module where you installed SecretManagement.Keeper module.

you should see file structure like this:

https://www.powershellgallery.com/packages/SecretManagement.Keeper/16.2.1

Yes I can confirm the file layout is the same:

Can you try to remove all SecretManagement.Keeper modules and Reregister/Reset Secret Store, as you might have two versions installed or something in that nature.
Also, try to install latest Powershell, perhaps that will resolve the issue? Keep us posted.

Closing inactive thread.

Yes I can confirm the file layout is the same:
@.***
From: Maksim Ustinov @.>
Sent: Tuesday, April 19, 2022 2:55 PM
To: Keeper-Security/secrets-manager @.>
Cc: John Byler @.>; Mention @.>
Subject: Re: [Keeper-Security/secrets-manager] Unable to find type [SecretManagement.Keeper.Client]. (Issue #263)
You don't often get email from @.@.>. Learn why this is importanthttp://aka.ms/LearnAboutSenderIdentification
you should see file structure like this:
[image]https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F187306%2F164084969-948c812b-261a-4bf7-8e1c-d3ee1de5bfcf.png&data=05|01||8aa61ffc0aaa4a3d07cd08da223e7bb5|cc20bacf591e4ffa8259bd74e029866d|0|0|637859949029486302|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=KkM4cdyCuXZ77fX6JWnDZhnQM44AWG5tMPYT8F6J%2Buk%3D&reserved=0
https://www.powershellgallery.com/packages/SecretManagement.Keeper/16.2.1https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FSecretManagement.Keeper%2F16.2.1&data=05|01||8aa61ffc0aaa4a3d07cd08da223e7bb5|cc20bacf591e4ffa8259bd74e029866d|0|0|637859949029642523|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=Ev1%2F4VsTNSCQCQoIXFD2Y1Ue6Qy1huQc3Ztk1Vely9Y%3D&reserved=0

Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FKeeper-Security%2Fsecrets-manager%2Fissues%2F263%23issuecomment-1103052754&data=05|01||8aa61ffc0aaa4a3d07cd08da223e7bb5|cc20bacf591e4ffa8259bd74e029866d|0|0|637859949029642523|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=Ly5EckJofkiqMqGHtTvcijoRngcgzADKQ2pyKSvlFtU%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAP5IFG6D6MJRKTEZ2DRCP7DVF4FRDANCNFSM5TZUV3BQ&data=05|01||8aa61ffc0aaa4a3d07cd08da223e7bb5|cc20bacf591e4ffa8259bd74e029866d|0|0|637859949029642523|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|3000|||&sdata=7jIMJ4BslmnCgm4dbyDHiMl8iqGxtuHNul5vBuDONL0%3D&reserved=0.
You are receiving this because you were mentioned.Message ID: @.@.>>

source: gharchive/issue

authors: maksimu ppibeauty

repo: Keeper-Security/secrets-manager

license: MIT

license_source: github-api


text:
kegweb: number of known drinkers

The number of known drinkers is showing as zero on the keg detail and session detail kegweb pages.

Fixed in d7a81c0822e06b46717b006aa8449a63cbbf4a4f.

repo: Kegbot/kegbot


text:
Compensate for possibly-empty commit users

If a commit was made by an author whose email address isn't linked to a
github account, there is no author object in the commit.
There is, however, a commit object in the commit, which contains a
(different) author object with non-account-related metadata. Grab some
data from there instead.
This was found when NegativeMjark tried to use review.rocks, and it
turns out one of his commits from one of his PRs was not associated with
an account. He conveniently provided me with a har file which made
tracking this down pretty easy. I've added that example PR (its first
commit is lacking an author) to examples, as well as a script for
extracting github responses from har files, because I'm sure it will be
useful again.

LGTM

authors: Kegsay illicitonion

repo: Kegsay/github-pull-review


text:
Wrap content item insert/upsert

In order to create a content there is a lot of work needed - to create a content item model, create an item itself without any data, and create the item variant. The distinction between content item and content item variant does not have to be obvious for newcomers. And all of this takes many lines of code as can be seen from the example:
// Creates an instance of the Content Management client
ContentManagementClient client = new ContentManagementClient(options);

// Defines the content item to import
ContentItemCreateModel item = new ContentItemCreateModel()
{
    Name = "On Roasts",
    Type = ContentTypeIdentifier.ByCodename("article"),
    SitemapLocations = new[] { SitemapNodeIdentifier.ByCodename("articles") }
};

// Adds the content item to your project in Kentico Cloud
ContentItemModel response = await client.CreateContentItemAsync(item);

// Defines the content elements to update
ArticleModel stronglyTypedElements = new ArticleModel
{
    Title = "On Roasts",
    PostDate = new DateTime(2017, 7, 4),
    BodyCopy = @"

Light Roasts

Usually roasted for 6 - 8 minutes or simply until achieving a light brown color. This method
        is used for milder coffee  varieties and for coffee tasting. This type of roasting allows the natural
        characteristics of each coffee to show. The aroma of coffees produced from light roasts is usually
        more intense.The cup itself is more acidic and the concentration of caffeine is higher.

    ",
    RelatedArticles = new [] { ContentItemIdentifier.ByCodename("which_brewing_fits_you_") },
    UrlPattern = "on-roasts",
    Personas = new [] { TaxonomyTermIdentifier.ByCodename("barista") }
};

// Specifies the content item and the language variant
ContentItemIdentifier itemIdentifier = ContentItemIdentifier.ByCodename("on_roasts");
LanguageIdentifier languageIdentifier = LanguageIdentifier.ByCodename("en-US");
ContentItemVariantIdentifier identifier = new ContentItemVariantIdentifier(itemIdentifier, languageIdentifier);

// Upserts a language variant of your content item
ContentItemVariantModel<ArticleModel> response = await client.UpsertContentItemVariantAsync<ArticleModel>(identifier, stronglyTypedElements);

The suggestion would be to create a wrapper, so the content item variant can be created/updated using a single method.

@ChristopherJennings would you be interested in implementing this? (or someone from the consulting team?)

authors: lukasturek petrsvihlik

repo: Kentico/content-management-sdk-net


text:
Invalid ISO 8601 last_modified in ContentTypes response example

The example JSON on the Kentico API site shows a last_modified date as "1. 1. 0001 0:00:00", which fails ISO 8601 DateTime parsing.
Try to reproduce this with the actual API and add support if it's valid.  Otherwise reach out to Kentico to update docs.

Real API doesn't seem to produce this.

@aweigold shall we update the docu? Where exactly did you see it?

The example response here:
https://developer.kenticocloud.com/v1/reference#list-content-types

Submitted to our TWs, they'll fix it soon.
Btw - you can suggest edits to the documentation by clicking "Suggest edits" link at each chapter. Signing up is open for everyone.

I think we can close this issue now, right?

I'll close it... I knew I could submit it there, but was just not thinking of that... plus my initial reaction was that I was perhaps doing something wrong.  Thanks @petrsvihlik !

authors: aweigold petrsvihlik

repo: Kentico/delivery-sdk-java


text:
Unlabeled dataset went to size of 0 suddenly for customize symmetric noise ratio setting on cifar10 dataset

I try to set the symmetric noise ratio to 0.94 and use the 90sym setting in presets.json. After around 50 epochs, the unlabeled dataset of net2 go to size 0 while for net1 the unlabeled dataset size is around 43000. In contrast, during the last epoch before collapse, the unlabeled dataset size for net1 and net2 are both around 43000. Do you have any suggestions on why this happen how to solve this issue? Thanks!

Thanks for reaching out!
The reason that this fails is most likely because the noise ratio of 0.94 is simply too high. In my personal experience training dividemix using augdesc, it seems that the loss bimodality assumption is not met as the difficulty of the dataset increases. Therefore, the filtering becomes increasingly lopsided over time, until it eventually collapses. If you would like, I have committed additional tools to plot the loss distributions over time in the Aug-for-LNL-Extras repo, so you could try plotting the curves to see what exactly is causing the collapse!
Below is what the distribution for 80% noise looks like over time:

I'm very interested to see how such a high noise ratio performs as well, so if you do give it a go, please let me know!

Thanks! Will have a try.

authors: KentoNishi Xinyu-ustc

repo: KentoNishi/Augmentation-for-LNL


text:
Add Time = NaN warnings to LightCurve and TargetPixelFile

Resolves #252 by adding time = NaN warnings to TargetPixelFile and LightCurve initializers.

Codecov Report

Merging #293 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #293      +/-   ##
==========================================
+ Coverage   88.13%   88.14%   +0.01%
==========================================
  Files          26       26
  Lines        3674     3678       +4
==========================================
+ Hits         3238     3242       +4
  Misses        436      436

Impacted Files
Coverage Δ

lightkurve/lightcurve.py
92.87% <100%> (+0.03%)
:arrow_up:

lightkurve/targetpixelfile.py
89.96% <100%> (+0.03%)
: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 9b33ba0...e7e3df4. Read the comment docs.

@JoseALermaIII Thank you for working on this!
I removed the warning from targetpixelfile.py for now, because it is very common to have NaN time values in TPFs.  They are usually masked out via the self.quality_mask mechanism, so I'm thinking we don't need a warning there for now.  (Which is opposite to what I said in #252!)
The warning in the LightCurve constructor looks great.  I am going to merge this as soon as the tests pass.
Again, thank you for contributing!

@barentsen You're welcome!
It was fun learning about all the different aspects of light curves and the package itself enough to add the warning.
I hope to be able to help more in the future!

authors: JoseALermaIII barentsen codecov-io

repo: KeplerGO/lightkurve


text:
Missing include to fix unknown type 'uint32_t', uint64_t, etc.

Without this include, I'm getting a bunch of errors like:
/home/bart/meteo/models/microhh/external/kernel_launcher/include/kernel_launcher/utils.h:348:5: error: unknown type name 'uint32_t' [clang-diagnostic-error]
    uint32_t z;
    ^
/home/bart/meteo/models/microhh/external/kernel_launcher/include/kernel_launcher/utils.h:412:16: error: unknown type name 'uint64_t' [clang-diagnostic-error]
using hash_t = uint64_t;
               ^
/home/bart/meteo/models/microhh/external/kernel_launcher/include/kernel_launcher/utils.h:414:1: error: unknown type name 'hash_t' [clang-diagnostic-error]
hash_t hash_string(const char* buffer, size_t num_bytes);
^

Thanks! Seems like these are types are predefined in CUDA, but not by other compilers.

authors: julietbravo stijnh


text:
The URL keyboard type layout should be adjusted

The system keyboard should use a different layout for URL input:

The KeyboardKit URL keyboard was modeled after the Safari URL input keyboard. As I investigate this, it turns out that the native .URL keyboard type is not used for that mode, but that it instead uses the .webSearch keyboard type instead.

This will be available in the v8.7 branch later this week.

repo: KeyboardKit/KeyboardKit


text:
Remove redundant \lbrack and \rbrack

PR #1069 added macros for \lbrack and \rbrack. But KaTeX already supported \lbrack and \rbrack with code in delimiter.js. This PR removes the redundant macros.

Can you hold off on merging this until I can review? I'm a little worried about whether this works correctly with optional arguments.

OK, I can confirm this doesn't break anything.  For example:
\begin{array} ... \\ \lbrack 1ex \rbrack ... \end{array}

does not trigger an optional argument in LaTeX (because it uses \futurelet which doesn't do expansion).
I do wonder whether this is the right approach, though.  Why have multiple lines in delimiter.js and functions/delimsizing.js handling \lbrack and \rbrack when the macro would suffice?  That is, why not go the other way?

when the macro would suffice?

There's a lot of merit to that argument. There's also something to be said for having a list of all the delimiters in one place. I don't have strong feeling either ways. I chose the redundant code that came last chronologically.

OK, I found a more legitimate argument: in your branch, \lbrack and \rbrack don't work in text mode (because there are no delimiters in text mode), but they should.

Okay, I'll put the macro back and remove the redundancy in delimiter.js and delimsizing.js. Are there any other delimiter rearrangements needed?

I've now reverted the macros and removed redundant code from delimiter.js and delimsizing.js. Here's confirmation that [, ], \lbrack, and \rbrack still work, unsize, with \big, and with \left:

@edemaine @ronkok Too late, but we have \lbrack and \rbrack in symbols.js:
https://github.com/Khan/KaTeX/blob/1dc261298ed327f7451095fe5ccf4e3dcc3ec589/src/symbols.js#L619-L620

@ylemkimon Those two lines of code need to stay there, or else \left [ and \right ] will not work. (I tested that.) The code in delimsizing.js is pretty tightly bound to symbols.js.

@ronkok But with symbol definition, isn't macro definition redundant?

isn't macro definition redundant?

That was my belief at the start of this PR. But @edemaine has found a quirk involving text mode that makes the macros non-redundant. So the macros stay. I've removed as much code as I can without breaking something.

Oh, are there still symbol definitions for lbrack and rbrack? If so, those can go. Macros already take priority.

I guess we could have just added lbrack and rbrack as text symbols too...

No, the symbol definitions cannot go. If they are deleted, then \left and \right stop working for[, ], \lbrack, and \rbrack.
In delimsizing.js, the \left and \right functions each make a checkDelimiter(...) call, which goes through a long and winding path to verify type via those two lines of code.  The typing system doesn't understand that the call could be coming from a macro. It assumes that the call is coming from symbols.js.

we could have just added lbrack and rbrack as text symbols too...

That would have avoided the sort of confusion we're going through right now. Maybe it's still worth doing to avoid future confusion by others.

Looking at the code more, I guess it would be consistent with the other symbols. Sorry for the hassle.

authors: edemaine ronkok ylemkimon

repo: Khan/KaTeX

license: mit


text:
spirv-fuzz: Permute the order of types, variables and constants at module scope

The order in which types, variable and constants appear in a module could be permuted, as long as dependencies between instructions are preserved. For example, a variable declaration could not be swapped with the declaration of its type, but could be swapped with another variable declaration.
It would be worth looking at TransformationMoveBlockDown, and FuzzerPassPermuteBlocks, as inspiration for how to implement this; they work at the level of blocks in the module but the concept should be similar.

hello i am a beginner  and want to solve this issue . can you please guide me through this?

repo: KhronosGroup/SPIRV-Tools


text:
SPV_AMD_gpu_shader_half_float enables float16

Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/1375
Hardcoded float16 feature enabling if extension
SPV_AMD_gpu_shader_half_float is present.

Rebased and pushed onto master as 03b8a3fe


text:
Handle undef literal value in vector shuffle

Fixes #1731

Updated folding rules related to vector shuffle to account for the
undef literal value:
FoldVectorShuffleFeedingShuffle
FoldVectorShuffleFeedingExtract
FoldVectorShuffleWithConstants
These rules would commit memory violations due to treating the undef
literal value as an accessible composite component

Committed in https://github.com/KhronosGroup/SPIRV-Tools/commit/b49f76fd62f5840d848f8891c599ef91e6fa57bb


text:
Add --relax-float-ops and --convert-relaxed-to-half

The first pass applies the RelaxedPrecision decoration to all executable
instructions with float32 based type results. The second pass converts
all executable instructions with RelaxedPrecision result to the equivalent
float16 type, inserting converts where necessary.

I think I have addressed all concerns to this point.


text:
Spirv-fuzz: Improve TransformationAddBitInstructionSynonym to check integer signedness

This PR fixes #4170, by check the signedness of bitwise operands in transformation and fuzzer for avoiding Expected Base Type to be equal to Result Type.

@Vasniktel Could you please review this?


text:
Remove default arguments from lambda

Fixes compile failure due to pedantic warning:
error: default argument specified for lambda parameter [-Werror=pedantic]

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

authors: CLAassistant sudonatalie


text:
manifest: fix url, add introduction

The URL was pointing the validation layer sync object instead of the layer documentation.
Add an the 'introduction' field which is use by Vulkan Configurator to describ the layer to the Vulkan developers and within the layer HTML user documentation generated by Vulkan Configurator.

CI Vulkan-ExtensionLayer build # 17 running.

CI Vulkan-ExtensionLayer build # 17 passed.

authors: christophe-lunarg ci-tester-lunarg

repo: KhronosGroup/Vulkan-ExtensionLayer


text:
Update to Vulkan 1.0.49 header

New scripts, header files, new Vulkan.hpp including a workaround for getSurfaceCapabilities2KHR issues, parameter_validation, unique_objects and object_tracker layer support.

If you let my #1767 land first and rebase on that, then you'll have IDs for some of the UNDEFINED cases. I'll go through the new checks in this PR and note new IDs.

@tobine, I have a commit with these changes.  I would appreciate if you could verify the VUID for vkGetPhysicalDeviceSurfaceFormats2KHR's pSurfaceInfo->surface -- is it the same as the one for GetPhysicalDeviceSurfaceCapabilities2KHR's pSurfaceInfo->surface?

Had to fix an unexpected error in the LVTs -> InvalidImageLayouts was trying to match the part of the string from the spec, which changed in the header update.

authors: mark-lunarg tobine


text:
layers: Clean up semaphore state in core_validation

No need to have 3 semaphore states. Killed SemaphoreState struct and
updated all the code to just use the "signaled" bool.
Also minor clean-up of queueMap destroy code.

+1.  I've wanted to do this all week!

cherry-picked and pushed to master


text:
Adds surface compatibility detection to gpu selection logic

Description
My multi-gpu system would crash consistently because the default monitor and "first" gpu were not connected. This adds a check for surface compatibility to the gpu selection logic. The surface, which was already created, had to be passed in.
Fixes #289
Testing/checklist Notes:
I do not have a mac or android compiler handy. Builds on windows and ubuntu.
Two samples, synchronization_2 and fragment_shading_rate, did not work before for me or after this change, complaining of a missing extension.
I have no idea what the checklist item about adding regressions means. To me, regression is testing things that previously worked.
General Checklist:
Please ensure the following points are checked:

[X ] My code follows the coding style
[X ] I have reviewed file licenses
[X ] I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
[ X] I have commented any added functions (in line with Doxygen)
[X ] I have commented any code that could be hard to understand
[X ] My changes do not add any new compiler warnings
[X ] My changes do not add any new validation layer errors or warnings
[X ] I have used existing framework/helper functions where possible
[ see above ] My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions
[ see above ] My changes do not add any regressions
[ see above ] I have tested every sample to ensure everything runs correctly
[X ] This PR describes the scope and expected impact of the changes I am making

Sample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:
N/A

[ ] I have tested the sample on at least one compliant Vulkan implementation
[ ] If the sample is vendor-specific, I have tagged it appropriately
[ ] I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms
[ ] Any dependent assets have been merged and published in downstream modules
[ ] For new samples, I have added a paragraph with a summary to the appropriate chapter in the samples readme

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Sidney Kelley seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

Just a general idea, as this is related to samples crashing because the first gpu in the system doesn't support required extension: Wouldn't it be a better option to select the suitable gpu by finding the first gpu that supports the extensions required by the sample?

Just a general idea, as this is related to samples crashing because the first gpu in the system doesn't support required extension: Wouldn't it be a better option to select the suitable gpu by finding the first gpu that supports the extensions required by the sample?

Good thought. I do think the surface extension should probably be one of the things that are checked. In my case, however, both gpus support the requisite extensions (or at least, claim to), but the first gpu did not have a queue that supported the surface because the surface was on a monitor not connected to that gpu.

The current code LGTM - I need to look at how we score GPUs / could score in the future, so I will do an official review pass later
CI enabled, you should now be able to see which compilers or quality checks fail :)

Wow the windows build is picky on int type sizes. I am not seeing those up-cast errors at all, even as warnings. So now it has static_cast for the for loop.

authors: CLAassistant SaschaWillems TomAtkinsonArm memory-thrasher

repo: KhronosGroup/Vulkan-Samples


text:
Disabled week days?

Does this calendar support disabling days in a week?
For example monday, tuesday and those days in every week would not be selectable.

I have created a pull request containg this feature.
#224

I have created a pull request containg this feature.
#224


text:
第九题：修改嵌套层级很深对象的 key

有一个嵌套层次很深的对象，key 都是 a_b 形式 ，需要改成 ab 的形式，注意不能用递归。
const a = {
  a_y: {
    a_z: {
      y_x: 6
    },
    b_c: 1
  }
}
// {
//   ay: {
//     az: {
//       yx: 6
//     },
//     bc: 1
//   }
// }

去答题
新建了一个大厂真题每日打卡群，有意愿学习打卡的再进，群已达扫码上线，请加好友拉你进群。

CODING

m

LGTM

function dfs(data) {
  const obj = {};
  for (let i in  data) {
      let key = `${i.slice(0, 1)}${i.slice(2, 3)}`;
      if (data[i] instanceof Object) {
        obj[key] = dfs(data[i]);
      } else {
        obj[key] = data[i];
      }
  }
  return obj;
};
const a = {
  a_y: {
    a_z: {
      y_x: 6
    },
    b_c: 1
  }
}
console.log(dfs(a));
// { ay: { az: { yx: 6 }, bc: 1 } }

const a = {
    a_y: {
        a_z: {
            y_x: 6
        },
        b_c: 1
    }
}

const parseKey = (obj) => {
    try {
        const reg = /(\w+)_(\w+)/g
        return JSON.parse(JSON.stringify(obj).replace(reg, (match) => match.replace('_', '')))
    } catch (error) {
        return obj
    }
}

console.log(parseKey(a))

const a = {
    a_y: {
        a_z: {
            y_x: 6
        },
        b_c: 1
    }
}

const parseKey = (obj) => {
    try {
        const reg = /(\w+)_(\w+)/g
        return JSON.parse(JSON.stringify(obj).replace(reg, (match) => match.replace('_', '')))
    } catch (error) {
        return obj
    }
}

console.log(parseKey(a))

有bug
const a = {
    a_b: '1_1'
}

方法一：递归

缺点：对象层级很深的时候调用栈会很深，导致 stack overflow
此外，按照题目意思应该是修改原对象，频繁调用delete，对V8很不友好（涉及到隐藏类的转换）

function transformKeys(obj) {
    let keys = Object.keys(obj)
    keys.forEach(key => {
        if (typeof obj[key] === 'object' && obj[key] !== null) {
            transformKeys(obj[key])
        }
        const newKey = key.replace(/_/i, '')
        obj[newKey] = obj[key]
        delete obj[key]
    })
}

function stack(obj) {
    let arr = [obj];
    while ((ele = arr.pop())) {
        for (const key in ele) {
            if (Object.hasOwnProperty.call(ele, key)) {
                let o = ele[key];
                let k = key.replace(/_?/g, "");
                ele[k] = o;
                typeof ele[key] === "object" && arr.push(ele[k]);
                delete ele[key];
            }
        }
    }
    return obj;
}

function fn(obj) {
  try {
    return JSON.parse(JSON.stringify(obj).replace(/(\"\w)_(\w\"\:)/g, '$1$2'))
  } catch (error) {
    console.error(error)
  }
}

const a = {
  a_y: {
    a_z: {
      y_x: 6
    },
    b_c: 1
  },
  n_u: 4
}
const replaceName = (obj) => {
  let stack = Object.keys(obj).map(val => {
    return {
      key: val,
      parent: obj
    }
  })
  // console.log(stack)
  while(stack.length) {
    let current = stack.shift()
    let child = current.parent[current.key]
    // 有下一层放进数组
    if(typeof child === 'object') {
      stack = stack.concat(Object.keys(child).map(val => {
        return {
          key: val,
          parent: child
        }
      }))
    }
    // 处理当前节点替换
    let newKey = current.key.replace('_', '')
    current.parent[newKey] = child
    delete current.parent[current.key]
  }
  return obj
}

console.log(replaceName(a))

function changeKey(data){
   return  datastr = JSON.parse(JSON.stringify(data).replace(/_/g,''));
}
const a = {
    a_y: {
      a_z: {
        y_x: 6
      },
      b_c: 1
    }
  }
changeKey(a)

function bfs(data) {
  let q = Object.keys(data).map(key => ({
    key,
    value: data[key],
    parent: data
  }))
  while (q.length) {
    let curr = q.shift()
    let keys = Object.keys(curr.value)
    let newKey = curr.key.replace(/_(\w)/g, function(_, $1) {
      return $1.toUpperCase()
    })
    curr.parent[newKey] = curr.value
    delete curr.parent[curr.key]
    if (keys.length) {
      q.push(...keys.map(key => ({
        key,
        value: curr.value[key],
        parent: curr.parent[newKey]
      })))
    }
  }
  return data
}

function changeKey(data){
   return  JSON.parse(JSON.stringify(data).replace(/_/g,''));
}
const a = {
    a_y: {
      a_z: {
        y_x: 6
      },
      b_c: 1
    }
  }
changeKey(a)

const a = {
a_y: {
a_z: {
y_x: 6
},
b_c: 1
}
}
const reg = /(\w+)(\w+)/g;
console.log(JSON.parse(JSON.stringify(a).replace(reg, (match) => match.replace('', ''))))

const obj: any = {
  a_y: {
    a_z: {
      y_x: 6
    },
    b_c: 1
  }
}

const bfs = (root) => {
  const arr = [root];
  while(arr.length) {
    const current = arr.shift();
    for (let key of Object.keys(current)) {
      const changedKey = key.replace('_', '')
      current[changedKey] = current[key]
      delete current[key]
      arr.push(current[changedKey])
    }
  }
  console.log('result: ', root)
}

bfs(obj)

结果：

const a = {
    a_y: {
        a_z: {
            y_x: 6
        },
        b_c: 1
    }
}

function bgfObj(obj, fn) {
    let toString = Object.prototype.toString
    let queue = [obj]
    while (queue.length !== 0) {
        let temp = queue.shift()
        if ('Object]' === toString.call(temp).substring(8)) {
            queue.push(...Object.values(temp))
        }
        fn(temp)
    }
}
bgfObj(a, obj => {
    Object.keys(obj).forEach(key => {
        if (/_/.test(key)) {
            obj[key.replace('_', '')] = obj[key]  // 不考虑有多个 _
            delete obj[key]
        }
    })
})
console.log('bgfObj, a: ', JSON.stringify(a));

const a = {
  a_y: {
    a_z: {
      y_x: 6,
    },
    b_c: 1,
  },
};

function formatKey(list) {
  const stack = [];
  stack.push(list);
  while (stack.length) {
    let item = stack.pop();
    for (let i in item) {
      if (typeof item[i] == "object" && item[i] != null) {
        stack.push(item[i]);
      }
      let newKey = i.replace(/_/i, "");
      item[newKey] = item[i];
      delete item[i];
    }
  }
  return list;
}
console.log(formatKey(a));

const getNewObj = (obj)=>{
  if(typeof obj !== 'object'){
    return obj
  }
  let keys = Object.keys(obj)
  keys?.length && keys.forEach(item=>{
    let newkey = ''
    if(/_/.test(item)){
      newkey = item.replace(/[_]/g,'')
    } else {
      newkey = item
    }
    obj[newkey] = getNewObj(obj[item])
    delete obj[item]
  })
  return obj
}
console.log(getNewObj(a))

const fn = obj => {
    let arr = [obj]
    while(arr.length) {
        const current = arr.shift()
        for (let key in current) {
            if (current.hasOwnProperty(key)) {
                const currentKey = key.replace('_', '')
                current[currentKey] = current[key]
                delete current[key]
                arr.push(current[currentKey])
            }
        }
    }
    return obj
}
console.log(fn(a))

// 迭代
const changeKey = (obj) => {
  const stack = [obj];
  while (stack.length) {
    const cur = stack.pop();
    for (let key in cur) {
      const newKey = key.replace("_", "");
      cur[newKey] = cur[key];
      delete cur[key];
      if (typeof cur[newKey] === "object") {
        stack.push(cur[newKey]);
      }
    }
  }
};

// 非递归方法
function cloneAndFormat(obj) {
    var newObj = {};
    var arr = [
        {
            root: newObj,
            data: obj,
            key: "",
        },
    ];
    while (arr.length) {
        // 删除数组最后一项，返回删除的结果
        var cur = arr.pop();
        // 本次需要遍历的对象
        var data = cur.data;
        // 本次遍历的对象所属Key值，重新建立一个新的key来存放遍历对象的结果
        var curKey = cur.key;
        // 存储之前转换的结果
        var curRoot = cur.root;
        // 存储本次转换的结果
        var res = curRoot;
        // 为对应的Key值建立空对象Value
        if (curKey) {
            res = curRoot[curKey] = {};
        }
        for (var key in data) {
            var newKey = key.replace(/_/g, "");
            if (Object.prototype.toString.call(data[key]) === "[object Object]") {
                arr.push({
                    root: res,
                    data: data[key],
                    key: newKey,
                });
            } else {
                res[newKey] = data[key];
            }
        }
    }
    console.log(newObj)
    return newObj
}

cloneAndFormat(a)

// 输出 => 符合预期
// { ay: { bc: 1, az: { yx: 6, zd: 2 } } }

// 递归方法
function deepClone(obj) {
    var target = {};
    for (var key in obj) {
        var newKey = key.replace(/_/g, "");
        if (Object.prototype.toString.call(obj[key]) === "[object Object]") {
            target[newKey] = deepClone(obj[key]);
        } else {
            target[newKey] = obj[key];
        }
    }
    return target;
}
deepClone(a)
// 输出 => 符合预期
// { ay: { bc: 1, az: { yx: 6, zd: 2 } } }

// 有一个嵌套层次很深的对象，key 都是 a_b 形式 ，需要改成 ab 的形式，注意不能用递归。
const a = {
  a_y: {
    a_z: {
      y_x: 6,
    },
    b_c: 1
  },
};

// dfs 递归
function formatKeyDFS(item) {
  if (!item) return;
  for (let key in item) {
    console.log("key: ", key);
    if (typeof item[key] === "object" && item[key] !== null) {
      formatKeyDFS(item[key]);
    }
    let newKey = key.replace(/_/, "");
    item[newKey] = item[key];
    delete item[key];
  }
  return item;
}

// dfs 非递归
function formatKeyDFS2(obj) {
  let stack = [obj];
  while (stack.length) {
    let item = stack.pop();
    // 倒序遍历子节点
    let keys = Object.keys(item).reverse();
    for (let key of keys) {
      if (typeof item[key] === "object" && item[key] !== null) {
        stack.push(item[key]);
      }
      let newKey = key.replace(/_/, "");
      item[newKey] = item[key];
      delete item[key];
    }
  }
  return obj;
}

// bfs
function formatKeyBFS(obj) {
  let queue = [obj];
  while (queue.length) {
    let item = queue.shift();
    for (let key in item) {
      console.log("key: ", key);
      if (typeof item[key] === "object" && item[key] !== null) {
        queue.push(item[key]);
      }

      let newKey = key.replace(/_/, "");
      item[newKey] = item[key];
      delete item[key];
    }
  }
  return obj;
}

console.log(formatKeyDFS2(a));

{ ay: { bc: 1, az: { yx: 6 } } }

  const changeKey = (obj) => {
    let objValueKey = [obj];
    while (objValueKey.length) {
      objValueKey.forEach((item, index) => {
        objValueKey.splice(index, 1);
        for (let item2 in item) {
          if (Object.prototype.toString.call(item[item2]) === "[object Object]") {
            objValueKey.push(item[item2]);
          }
          item[item2.replace(/_/, "")] = item[item2];
          delete item[item2];
        }
      });
    }
    return obj;
  }

  const a = {
    a_y: {
      a_z: {
        y_x: 6
      },
      b_c: 1
    }
  };

  console.log(changeKey(a));

function chanKey(arr) {
    //当栈内元素为空时结束
    let sk = [arr]//遇到对象就进栈
    let sk1 = []//缓存执行对象
    while(sk.length){
        let last = sk.pop()//弹出栈顶一项
        Object.keys(last).forEach(el=>{
            let key = el.replace('_','')
            last[key] = last[el]
            delete last[el]
            sk1.push(last)
            if(typeof last[key] == 'object' ){
                sk.push(last[key])
            }
        })
    }
    return sk1[0]
}
console.log(chanKey(a));

let o = {
a_y: {
a_z: {
y_x: 6,
},
b_c: 1,
},
}
function formatObject(raw){
const q = []
q.push(raw)
for(const i of q) {
if(typeof i === 'object' && Object.keys(i).length > 0) {
for(const key of Object.keys(i)){
const newKey = key.replace('_', '')
i[newKey] = i[key]
q.push(i[newKey])
if (newKey !== key) {
delete i[key]
}
}
}
}
return raw
}
formatObject(o)

`
const transfer = param => {
return param.split('_').join('')
}
const chageKey = (pObj) => {
var obj = {};
for(var i in pObj) {
if(pObj.hasOwnProperty(i) && typeof pObj[i] === 'object') {
obj[${transfer(i)}] =  run(pObj[i])
} else if(pObj.hasOwnProperty(i)) {
obj[${transfer(i)}] = pObj[i]
}
}
return obj
}
`

function replaceNameBFS(obj) {
  let stack = [obj];

  while (stack.length) {
    let curObj = stack.pop();
    let keys = Object.keys(curObj);

    keys.forEach((key) => {
      let newKey = key.replace("_", "");
      curObj[newKey] = curObj[key];
      delete curObj[key];

      if (typeof curObj[newKey] === "object") {
        replaceNameBFS(curObj[newKey]);
      }
    });
  }
}
replaceNameBFS(a);

const a = {
  a_y: {
    a_z: {
      y_x: 6,
    },
    b_c: 1,
  },
};
// {
//   ay: {
//     az: {
//       yx: 6
//     },
//     bc: 1
//   }
// }

// 简单快捷，但是很不可靠的方法

function remove_(obj) {
  const string = JSON.stringify(obj).replace(/_/g,"")
  const json = JSON.parse(string)
  console.log(json);
  return string;
}

remove_(a)

const transformKey = (obj: {
    [key: string]: any
  }) => {
    const queue: {
      [key: string]: any
    }[] = [obj];

    while(queue.length) {
      const _current = queue.shift()!;
      Object.keys(_current).forEach((key) => {

        const _newKey = key.replace(/_/g, '');

        _current[_newKey] = _current[key];

        delete _current[key];

        if (typeof _current[_newKey] === 'object') {
          queue.push(_current[_newKey]);
        }
      })
    }

    return obj;
  }

前言
参考前面大佬的写法 实在是想不到 怎么不使用递归的方法实现

方法一

实际上是 利用数组的特性进行递归
遍历数组中的每个key 进行修改

const a = {
  a_y: {
    a_z: {
      y_x: 6
    },
    b_c: 1
  }
}

function bfs(target) {
    const list = [target];
    const reg = /\_/;
    while (list.length > 0) {
        const current = list.pop(); // 随意拿到一个当前的值
        for (let key of Object.keys(current)) {
            const afterKey = key.replace(reg, '');
            current[afterKey] = current[key];
            delete current[key]
            // 判断是否为对象
            if (Object.prototype.toString.call(current[afterKey]) === '[object Object]') {
                list.push(current[afterKey]); // 利用数组的特性递归 实际上也是递归的一种
            }
        }
    }
    console.log(target);
    return target
}

console.time()
bfs(a)
console.timeEnd()

function changeKey(obj){
  return {
     ay: {
       az: {
         yx: 6
       },
       bc: 1
     }
  }
}

思路：先将对象序列化，再按照题目要求修改 key，最后再将序列化后的字符串解析为对象
const a = {
  a_y: {
    a_z: {
      y_x: 6,
    },
    b_c: 1,
  },
}

function updateKey(obj) {
  return JSON.parse(JSON.stringify(obj).replace(/(\w)_(\w)/g, '$1$2'))
}

console.log(updateKey(a))

采用队列的方法处理树数据

左边节点出队
出队非叶节点，将子节点cancat进队列中
根据引用关系，改变出队节点父节点的key值，将出队节点children赋值给删除'_'的节点
while循环至队列为空

function flatSingle(obj) {
  return Object.keys(obj).map(k => ({ parent: obj, key: k, value: obj[k] }))
}

function flatFunc(obj) {
    let queue = flatSingle(obj, obj)
    while (queue.length) {
      const left = queue.shift();
      const key = left.key.replace(/_/g, '');
      if (Object.prototype.toString.call(left.value) === '[object Object]') {
        queue = queue.concat(flatSingle(left.value))
      }
      left.parent[key] = left.value;
      if (left.key.includes('_')) {
        delete left.parent[left.key];
      }
    }
    return obj;
}

const a = {
  a_y: {
    a_z: {
      y_x: 6
    },
    b_c: 1
  }
}
// {
//   ay: {
//     az: {
//       yx: 6
//     },
//     bc: 1
//   }
// }

function modifyKey(input) {
  const obj = JSON.stringify(input).replace(/_/g, '')
  return JSON.parse(obj)
}

console.log(modifyKey(a))

  const changeKey = (obj) => {
    let objValueKey = [obj];
    while (objValueKey.length) {
      objValueKey.forEach((item, index) => {
        objValueKey.splice(index, 1);
        for (let item2 in item) {
          if (Object.prototype.toString.call(item[item2]) === "[object Object]") {
            objValueKey.push(item[item2]);
          }
          item[item2.replace(/_/, "")] = item[item2];
          delete item[item2];
        }
      });
    }
    return obj;
  }

  const a = {
    a_y: {
      a_z: {
        y_x: 6
      },
      b_c: 1
    }
  };

  console.time('耗时');
  console.log(changeKey(a));
  console.timeEnd('耗时');

  const changeKey = (obj) => {
    let objValueKey = [obj];
    while (objValueKey.length) {
      objValueKey.forEach((item, index) => {
        objValueKey.splice(index, 1);
        for (let item2 in item) {
          if (Object.prototype.toString.call(item[item2]) === "[object Object]") {
            objValueKey.push(item[item2]);
          }
          item[item2.replace(/_/, "")] = item[item2];
          delete item[item2];
        }
      });
    }
    return obj;
  }

  const a = {
    a_y: {
      a_z: {
        y_x: 6
      },
      b_c: 1
    }
  };

  console.time('耗时');
  console.log(changeKey(a));
  console.timeEnd('耗时');

const transfer = function (obj) {
const arr = [obj];
while (arr.length) {
const item = arr.shift();
for (let i in item) {
if (Object.prototype.toString.call(item[i]) === "[object Object]") {
arr.push(item[i]);
}
item[i.replace(/_/, "")] = item[i];
delete item[i];
}
}
return obj;
};

const transfer = function (obj) {
const arr = [obj];
while (arr.length) {
const item = arr.shift();
for (let i in item) {
if (Object.prototype.toString.call(item[i]) === "[object Object]") {
arr.push(item[i]);
}
item[i.replace(/_/, "")] = item[i];
delete item[i];
}
}
return obj;
};

const transfer = function (obj) {   const arr = [obj];   while (arr.length) {     const item = arr.shift();     for (let i in item) {       if (Object.prototype.toString.call(item[i]) === "[object Object]") {         arr.push(item[i]);       }       item[i.replace(/_/, "")] = item[i];       delete item[i];     }   }   return obj; };

  const arr = [obj];
  while (arr.length) {
    const item = arr.shift();
    for (let i in item) {
      if (Object.prototype.toString.call(item[i]) === "[object Object]") {
        arr.push(item[i]);
      }
      item[i.replace(/_/, "")] = item[i];
      delete item[i];
    }
  }
  return obj;
};

const transfer = function (obj) {
  const arr = [obj];
  while (arr.length) {
    const item = arr.shift();
    for (let i in item) {
      if (Object.prototype.toString.call(item[i]) === "[object Object]") {
        arr.push(item[i]);
      }
      item[i.replace(/_/, "")] = item[i];
      delete item[i];
    }
  }
  return obj;
};

const changeKey = (obj) => {
  let stack = [obj]
  while (stack.length) {
    let cur = stack.pop()
    for (let key in cur) {
      let newKey = key.replace('_', '')
      cur[newKey] = cur[key]
      delete cur[key]
      if (cur[newKey] instanceof Object) {
        stack.push(cur[newKey])
      }
    }
  }
};

function adc(data) {
let arr = [data];
while (arr.length != 0) {
const target = arr.pop();
change(target); // 对对象里的数据进行名称转化
if (target instanceof Object) { // 如果是对象的话，继续将他的属性加进去
for (let i in target) {
arr.push(target[i]);
}
}
}
console.log(data);
return data;
};
const change = (data) => {
const key = Object.keys(data);
const reg = /_/g;
for (let i = 0; i < key.length; i++) {
let tempKey = key[i].replace(reg, '');
data[tempKey] = data[key[i]];
delete data[key[i]];
}
};
const a = {
a_y: {
a_z: {
y_x: 6,
z_j: 7,
},
b_c: 1
}
}
adc(a)

// 有一个嵌套层次很深的对象，key 都是 a_b 形式 ，需要改成 ab 的形式，注意不能用递归。

const a = {
  a_y: {
    a_z: {
      y_x: 6
    },
    b_c: 1
  }
}
// {
//   ay: {
//     az: {
//       yx: 6
//     },
//     bc: 1
//   }
// }

function changeObjectProperty(obj) {
    let reg = new RegExp(/("\w+)_(\w+":)/g);
    return JSON.parse(JSON.stringify(obj).replace(reg, '$1$2'))
}

console.log(changeObjectProperty(a));

function fn(obj) {
let stack = []
stack.push(obj)
while(stack.length) {
for (let i in stack[0]) {
let item = stack[0]
let name = i.replace(/_/,'')
item[name] = item[i]
delete item[i]
if (typeof item[name] === 'object' && item[name] !== null) {
stack.push(item[name])
}
}
stack.shift()
}
return obj
}

function updateKey(obj) {
  if (Object.prototype.toString.call(obj) === '[object Object]') {
     return JSON.parse(JSON.stringify(obj).replace(/_/g, ''));
  }
  return obj;
}

使用递归
function updateObj(obj) {
if (obj !== null && typeof obj === 'object') {
Object.keys(obj).forEach((key) => {
const key1 = key.replace(/_/g, '')
obj[key1] = obj[key]
delete obj[key]
return updateObj(obj[key1])
})
}
return obj
}

// 非递归实现
let changeObjName = function(obj) {
    let stack = [obj];
    while(stack.length) {
        let top = stack.pop();
        for(let key in top) {
            if(Object.prototype.toString.call(top) === '[object Object]') {
                stack.push(top[key])
            }
            top[key.split('_').join('')] = top[key];
            delete top[key];
        }
    }
    return obj;
}

//递归实现
let changeObjName = function(obj) {
    return Object.keys(obj).reduce((newObj, key)=> {
        let newKey = key.split('_').join('');
        newObj[newKey] = (obj && typeof obj[key] === 'object') ? changeObjName(obj[key]): obj[key];
        return newObj;
    }, {})
}

const a = {
        a_y: {
            a_z: {
                y_x: 6
            },
            b_c: 1
        }
    }
    function dfs(obj = {}) {
        const stack = []
        const list = []
        stack.push(obj)
        list.push(obj)
        while (stack.length) {
            const item = stack.pop()
            for (const key in item) {
                if (typeof item[key] === 'object') {
                    stack.push(item[key])
                    list.push(item[key])
                }
            }
        }
        return list
    }

    function transferKey(obj) {
        const list = dfs(obj)
        list.forEach(item => {
            for (const key in item) {
                const newKey = key.replace(/_/g, '')
                item[newKey] = item[key]
                delete item[key]
            }
        })
    }
    transferKey(a)
    console.log(a)

 const getNewKey = (obj) => {
    try {
        const reg = /(\w+)_(\w+)":/g
        return JSON.parse(JSON.stringify(obj).replace(reg, (match) => match.replace('_', '')))
    } catch (error) {
        return obj
    }
}
//这周六会重新再写一遍， 目前对 深度优先遍历和广度优先变量不熟

const transformObj= (obj) => {
let res = Object.keys(obj)  ;
  while (res.length) {
    let cur = res.pop()
    for (let key in cur) {
      let newKey = key.replace('_', '')
      cur[newKey] = cur[key]
      delete cur[key]
      if (cur[newKey] instanceof Object) {
        res.push(cur[newKey])
      }
    }
  }
};

马上补上，刚到家

function changeKey(obj) {
  let stack = [];
  let resList = [];
  stack.push({ obj });
  while (stack.length !== 0) {
    let cur = stack.pop();
    Object.keys(cur).forEach((key) => {
      if (typeof cur[key] === "object" && !Array.isArray(cur[key])) {
        resList.push(cur[key]);
        stack.push(cur[key]);
      }
    });
  }
  resList.forEach((item) => {
    Object.keys(item).forEach((key) => {
      let newKey = key.replace(/_/g, "");
      item[newKey] = item[key];
      delete item[key];
    });
  });
}

function modifyKey(obj){
            if(!(obj instanceof Object)){
                return obj;
            }
            let d = {};
            for(const key in obj){
                let k1 = key.replaceAll("_","");
                d[k1] = modifyKey(obj[key]);
            }
            return d;
        }

function modifyKey(obj){
            if(!(obj instanceof Object)){
                return obj;
            }
            let d = {};
            for(const key in obj){
                let k1 = key.replaceAll("_","");
                d[k1] = modifyKey(obj[key]);
            }
            return d;
        }

const changeKey = (obj, newObj) => {
    const keys=Object.keys(obj);
    for(let i = 0; i < keys.length;i++) {
        const key = keys[i];
        newObj[key.replace('_', '')] = obj[key];
        if(typeof obj[key] === 'object') {
            newObj[key.replace('_', '')] ={};
            changeKey(obj[key], newObj[key.replace('_', '')]);
        }

    }
    return newObj;
}
const a = {
    a_y: {
      a_z: {
        y_x: 6
      },
      b_c: 1
    }
  }
changeKey(a, {})

// 执行结果
![image](https://user-images.githubusercontent.com/18276045/111861208-72876c00-8987-11eb-9556-7c9ba5dfd45f.png)

function handler(obj) {
  function isObject(target) {
    if (Array.isArray(target)) return false;
    return target !== null && typeof target === "object";
  }
  function dfs(obj) {
    if (!isObject(obj)) return;
    Object.keys(obj).forEach((key) => {
      const newKey = key.replaceAll("_", "");
      obj[newKey] = obj[key];
      delete obj[key];
      dfs(obj[newKey]);
    });
  }
  dfs(obj);
  return obj;
}

function transformKey(object) {
  const array = [object]
  while (array.length) {
    const obj = array.pop()
    for (let key in obj) {
      if (Object.prototype.toString.call(obj[key]) === "[object, Object]") {
        array.push(obj[key])
      }
      obj[key.replace(/_/, "")] = obj[key]
      delete obj[key]
    }
  }
  return object
}

`// 修改嵌套层级很深的对象
const a = {
a_y: {
a_z: {
y_x: 6
},
b_c: 'asdas_c'
}
}
function resolve (obj) {
let objStr = JSON.stringify(obj)
let arr = objStr.match(/"\w_\w":/g).map(item => item.replace(//g,''))
for(let i of arr){
objStr = objStr.replace(/"\w\w":/, i)
}
return JSON.parse(objStr)
}
console.log(resolve(a))`javascript

// 正则要考虑到属性值是不是包含_
const a = {
  a_y: {
    a_z: {
      y_x: 6
    },
    b_c: 'asdas_c'
  }
}

function resolve (obj) {
  let objStr = JSON.stringify(obj)
  let arr = objStr.match(/"\w_\w":/g).map(item => item.replace(/_/g,''))
  for(let i of arr){
    objStr = objStr.replace(/"\w_\w":/, i)
  }
  return JSON.parse(objStr)
}

console.log(resolve(a))

const a  =  {
  a_y : {
    A_Z : {
      y_x : 6
    } ,
    b_c : 1
  }
};
const output = JSON.parse(JSON.stringify(a).split('_').join(''));

// bfs 广度优先遍历
function removeUnderScore(a) {
    const queue = [a];
    const obj = {};

    while(queue.length) {
        const item = queue.pop();

        for (let key in item) {
            const newKey = key.replace('_', '');
            item[newKey] = item[key];
            delete item[key];

            // 如果是对象，推入队列继续
            if (typeof item[newKey] === 'object') {
                queue.unshift(item[newKey]);
            }
        }
    }

    return a;
}

const a = removeUnderScore({
    a_y: {
      a_z: {
        y_x: 6
      },
      b_c: 1
    }
});

console.log(a);

function transfer(obj) {
  return JSON.parse(JSON.stringify(obj).replace(/"(\w)_(\w):"/g, '$1$2:'));
}

想了好长时间用了一个笨办法
const editDeepKey = (obj = {}) => {
    const result = {}; // 处理的结果
    const shed = []; // 栈信息
    let index = 0; // 当前栈索引

    // 推进第一级入栈
    Object.keys(obj).length && shed.push({
        obj: obj,
        keys: Object.keys(obj), // 第一级所有的key
        convert_key: '', // 转化之后的key
        index: 0, // 遍历索引
    });

    while (shed.length) {
        const current = shed[index];  // 当前内容栈
        let receive_data = result; // 接收对象
        const key = current.keys[current.index]; // 当前遍历原数据的key
        let convert_key = ''; // 转化之后的key值

        // 如果key不存在说明是上次上级遇到对象进行子级处理,回到上级之后之前是对象的key处于最后一个位置,后面无需在进行处理
        // 直接将该栈数据删除出栈即可
        if (!key) {
            shed.splice(index, 1); // 清空当前栈内存
            index--; // 减少栈索引

            // 继续下一轮循环
            continue;
        }

        convert_key = key.replace(/([a-zA-Z])_([a-zA-Z])/g, '$1$2'); // 当前遍历目标数据的key
        shed[index].convert_key = convert_key; // 赋值当前遍历目标数据的key

        // for循环确定最终的接收对象
        for (let i = 0; i < index; i++) {
            // 这里不用担心receive_data[shed[i].convert_key]不存在
            // 因为在上册检测到父级key对应的值是一个对象的时候就创建对应的对象

            // 直接等于该对象
            receive_data = receive_data[shed[i].convert_key];
        }

        if (Object.prototype.toString.call(current.obj[key]) === '[object Object]') {
            // 将当前键的值赋值为一个空对象 这里创建相关对象，涉及到上面for循环里面的直接赋值
            receive_data[convert_key] = {}; // 先创建对应键为对象

            // 压栈
            shed.push({
                obj: current.obj[key],
                keys: Object.keys(current.obj[key]), // 当前级所有的key
                convert_key: '', // 转化之后的key
                index: 0, // 遍历索引
            });

            // 增加栈索引
            index++;
            // 索引加1
            current.index++;

            // 继续下一轮循环
            continue;
        }

        // 非对象值
        // 索引加1
        current.index++;
        receive_data[convert_key] = current.obj[key]; // 赋值

        // 本次栈内容全部处理完成 出栈
        if (current.index === current.keys.length) {
            shed.splice(index, 1); // 清空当前栈内存
            index--; // 减少栈索引
        }
    }

    return result;
};

const a = {
    a_y: {
        a_z: {
            y_x: 6
        },
        b_c: 1
    }
};
console.time('time');
console.log(editDeepKey(a));
console.timeEnd('time');

authors: 1742284240 371311231 AbigaiL533 Adibhat108 BillScott1024 ByeLe Ecaknight GeekNoble KieSun Leexuetao QuXiaoMing ScarecrowG Shisanxianshen Sliect SunshineZJJ Turkyden XINXINP Xchen1995 XianHuiDeDiZhongHai Zhao-Null a11995910 adam-zhou cduyzh docterlei dorothyDing fantasticfbaby goldEli heguipingdd01 huang-ping huangzhuangjia l0ng09 learnRy liuy1994 makejun168 melodyVoid mengzhe510 mingyuesun muzishuiji mynamexiaohui nesxiaogu owlsignl pandaomeng pumpkin123 shengxinjing sunsmeil sy5 vandvassily xiaocongWang xiaofan-love xt1995726 yancongwen yanxiaolazy z253573760 zhuyfian1996

repo: KieSun/fucking-frontend


text:
How to change vote reward?

Hello,
i cant change the vote reward in the config. Players always claim 64 diamonds. Please help me. Thanks!

You can configure command rewards https://github.com/KingOfTurkey38/Voting38/blob/9c95c2e46eb561fbad7b4b476c7d09d4106578b2/resources/config.yml#L11

Ahhh yes thanks, look like i am blind xD . But can i change the rewards? That players becoms every day another reward?
Can I set players to always randomly get a different reward?

Unfortunately, that feature is not implemented. You can make your own plugin that'll do that

Ok thank you!


text:
Typo in README Fix

Typo Fixed. Automaically --> Automatically

Thanks!

authors: FootballCoder KingPixil

repo: KingPixil/wing


text:
🧪QA Testing

Complete The Item Below

[X] I have reviewed and tested all of the issues in the linked milestone.

Relevant Information
Fully test application. This is due to the depth of changes that were made to the rendering system.
Two new scenes were added to the VelaptorTesting application that is for testing the rendering of line primitives.
New Scenes:

Rendering Line Scene
Layered Line Rendering Scene

Testing Application:
VelaptorTesting-v1.0.0-preview.14.zip
QA Testing Dependencies
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct

All scenes operate as they should.

authors: CalvinWilkinson kselena

repo: KinsonDigital/Velaptor


text:
Can't import after running yarn build

After running yarn build, and trying to import vue-gallery-slideshow.min.js into my Vue project, I encountered this error:
"export 'default' (imported as 'VueGallerySlideshow') was not found in './vue-gallery-slideshow.min.js'

I noticed that the difference is that the original dist/js/vue-gallery-slideshow.js file had a require('vue-runtime-helpers'), but the output of my yarn build did not.
Does anybody know how to run it so that it can work by importing the dist file into another project?

Same issue here with npm.

authors: booleentech jumzijie

repo: KitchenStories/vue-gallery-slideshow


text:
network machines does not react when it should

https://github.com/user-attachments/assets/bfa2d2d2-f24d-45f0-ab81-05f90945da9c

How can I get fake printers up with fake data? Or do I just guess and push to a branch and have you run?

@paultag do you think machine-api will work with my Elegoo Neptune 2 so I can test this locally or nah

Eh, guess I can mock with some setIntervals, all good.

i wqas gunna add a settings field so yall; can ping ours over tailscale sorry its on my list i will get there

No problem, I should be able to recreate no problem with mock data :) I'll do it between my work with Frank on fixing PW tests in my other branch.

The Noop printer should "work" -- see the nada machine example in the readme

I fixed this in https://github.com/KittyCAD/modeling-app/pull/4311

authors: jessfraz lf94 paultag

repo: KittyCAD/modeling-app


text:
Tangential arc unavailable tooltip

Closes #4308.  Added a message to the Tangential Arc tooltip to inform the user why they cannot draw a tangential arc as the first path.
Here's what that looks like now:

Happy to tweak the message to make it clearer if needed.

Succeeded by https://github.com/KittyCAD/modeling-app/pull/4341


text:
Cargo Ships Incompatibility

Hello,
I get the error in the image below whenever a new chunk is loaded (so on startup of new map and in a previous map when exploring new chunks).
I have tested by having Seablock (v0.5.3), Seabloc Pack (v1.1.2) and Cargo ships (v0.0.59 and v0.0.60Seraph) (plus some other stuff that was shown to not affect this error) on together and creating a new map with default settings, the error appears immediately upon loading into the map.
I tested that it is a Seablock - CargoShip incompatibility by removing only Seablock, and keeping on Seablock Pack and starting a new world. That world did not have the error. Also removed Cargo Ships and that got rid of the error.
Having looked at the code for Cargo Ships and Seablock I think that somehow Seablock is removing crude-oil from data.raw["resources"] before Cargo Ships is loaded in the data stage thus making it so that in prototypes.entities.oil_rig the deep copy of crude-oil "works" but only returns an empty list which then throws the error later when it tries to call the list but its just an empty list. But I'm not good enough to pinpoint where in Seablock mapgen this is  occuring exactly. I've tried putting in exceptions specifically for crude-oil and deep_oil but those didn't work

The mod has a frequency setting for deep oil. Setting this to none seems to prevent the error occurring.
Fix:

Force deep oil frequency setting to None
Hide all settings related to deep oil
Hide oil rig item

authors: KiwiHawk zerostarm

repo: KiwiHawk/SeaBlock


text:
[date_component] validating a form with a mandatory date set to null filled it with today's date

To reproduce :
1- Open a form with a mandatory date
2- Don't filled the date and validate
3- The date's field is set to current date.

:+1:

This is due to a new behaviour of Custom components. See https://github.com/KleeGroup/focus-components/commit/12924d43f70c13b8077902eeaa27554deede17bb . So the date input should validate required props. @Bernardstanislas this need to written in a doc.

authors: JulienGard durandx pierr

repo: KleeGroup/focus-components


text:
fix source code links in README

Fixed a couple bad links in the read me.

@psamsotha Thanks! I appreciate the contribution.

authors: psamsotha vinodc

repo: Kloudless/kloudless-java


text:
Error while loading

I get this error when loading the game; I play on 1.16.4
Log file here: https://pastebin.com/PCW6huhH

What happens when you test with fewer mods? Specifically, test without Charm loaded, I see mention of that mod in the stacktrace.

What happens when you test with fewer mods? Specifically, test without Charm loaded, I see mention of that mod in the stacktrace.

I tried removing Charm and loaded, all the items seem to be in-game but I couldn't find any natural tea plants generating in the world, I've searched quite a bit! Note that I have 3 Biome altering mods installed; Traverse, BetterEndForge, Voyage.

I tried removing Charm and loaded, all the items seem to be in-game but I couldn't find any natural tea plants generating in the world, I've searched quite a bit! Note that I have 3 Biome altering mods installed; Traverse, BetterEndForge, Voyage.

That is a separate issue, if you want to look into that more open a new ticket, bit my assumption is you are just unlucky. The trees are a bit rare. They should appear in any type of forest biome.
Since Charm appeared to have caused your crash, open an issue on the Charm issue tracker and link it here

That is a separate issue, if you want to look into that more open a new ticket, bit my assumption is you are just unlucky. The trees are a bit rare. They should appear in any type of forest biome.
Since Charm appeared to have caused your crash, open an issue on the Charm issue tracker and link it here

Oh! The main Charm page is labled for Fabric now! The Forge version is "Charm Reforged". I installed the right one and it loaded. But IDK how to describe it, the rendering was kinda funky; it was grainy and noisy just for a few blocks around! Hope you understand it, IDK how to tell it!

Oh! The main Charm page is labled for Fabric now! The Forge version is "Charm Reforged". I installed the right one and it loaded. But IDK how to describe it, the rendering was kinda funky; it was grainy and noisy just for a few blocks around! Hope you understand it, IDK how to tell it!

Screenshot?

Screenshot?

I removed VanillaTweaks, and it's fixed now! Cuz I think Charm combined with VanillaTweaks creates issues like that. But still I don't find tea plants spawning in anywhere; I've searched plains, forests and other relevant biomes!

I removed VanillaTweaks, and it's fixed now! Cuz I think Charm combined with VanillaTweaks creates issues like that. But still I don't find tea plants spawning in anywhere; I've searched plains, forests and other relevant biomes!

And the weird rendering thing is back again! This time I took a screenshot of it! Zoom in closely and look, it's not that noticeable in an image but while playing the game it just is super evident; all that noisy grainy stuff in the view!

And the weird rendering thing is back again! This time I took a screenshot of it! Zoom in closely and look, it's not that noticeable in an image but while playing the game it just is super evident; all that noisy grainy stuff in the view!

You sure you are not talking about vanilla mipmapping? In any case, you have went far beyond the original issue.
I suggest you test without my mod to verify that this is actually related. If it happens with just my mod installed, open an new issue. Closing this one since the original issue was about a crash that no longer happens.

You sure you are not talking about vanilla mipmapping? In any case, you have went far beyond the original issue.
I suggest you test without my mod to verify that this is actually related. If it happens with just my mod installed, open an new issue. Closing this one since the original issue was about a crash that no longer happens.

authors: KnightMiner SamhitApple

repo: KnightMiner/SimplyTea


text:
Drug central ingest

Added ingest for Drug Central to address #5
Added a class (transform.py) and a few utilities to dry out future transforms

@justaddcoffee - I have been linking the issues that the PRs (fully or even partially address). Are you OK with that?

@justaddcoffee - I have been linking the issues that the PRs (fully or even partially address). Are you OK with that?

yes, please do - I should've done that myself

@callahantiff If this PR looks okay, I'll merge

@callahantiff If this PR looks okay, I'll merge

Yes, please looks great. Sorry, I should have merged it. Will do that immediately in future reviews.

thanks @callahantiff

authors: callahantiff justaddcoffee


text:
Allow the main randomiser to do set extraction

Should be a fairly simple tweak to the randomiser function? Just allow the user to select a .set file and, if the filepath that the randomiser function gets contains a .set as opposed to a .xml, then extract it before continuing.

Done as part of Commit https://github.com/Knuxfan24/SONIC-THE-HEDGEHOG-2006-Randomiser/commit/fb6156f7f514cdb6bce16eaf08a112b31eb6fdeb


text:
Add ios target for using library with Compose for iOS

Add ios target for using library with Compose for iOS. It is impossible to use these dependencies in project with Compose for iOS without this target:

koalaplot-core

Hi, I've added the ios() target and updated the GitHub actions to build on MacOS. However, there is a build error. Unfortunately, I don't have a Mac so I cannot troubleshoot the problem locally, and it took the runner almost 10 minutes to get to the point where a missing symbol was found.
If you have a Mac, could you help find the problem?
Link to the build log with the error

Hi again @gsteckman !
Also see this issue https://github.com/JetBrains/compose-multiplatform/issues/2342
Please try to add
kotlin.native.cacheKind=none
in your gradle.properties and try building project with ios() source set

I merged the PR from @jakepurple13 which includes the cacheKind property. But the builds are still failing due to undefined symbols during linking. There are a lot of warnings of mismatched versions for the simulator, which may be the root cause of the undefined symbols. The odd thing is in the latest commit I removed the iosSimulatorArm64() target, but it is still causing errors, see log for version 11 vs version 9.
When I left iosSomulatorArm64() in, it was version 15.2 vs version 9 - see log.
Any ideas where these version numbers are coming from? I tried searching and looked at some of the Kotlin multiplatform examples, but didn't see any ios specific version information in the build files.

Hello again @gsteckman. I'v created PR with fixes, which helped me to assemble all library artifacts and sucessfully use your library in compose multiplatform https://github.com/KoalaPlot/koalaplot-core/pull/16

Is there a way to get a snapshot build of the repo? JitPack doesn't seem to work anymore.

Is there a way to get a snapshot build of the repo? JitPack doesn't seem to work anymore.

Hi @zacharee.
I'm still waiting for @gsteckman to publish a new release with latest fixes.
For now i'm publishing Koalaplot artifacts to mavenLocal() with publishToMavenLocal gradle task and building my project this way.

Hi @zacharee, I published a 0.4.0-dev1 build with ios artifacts. Please let me know if they don't work ok for you. I don't own any Apple devices so can't test them. Thanks to @maltsev-gorskij for helping to get the ios build working.

I tried it, but it doesn't look like iOS artifacts got generated/uploaded. Gradle fails to sync because it can't find the ones for iOS.

I see them in search results at https://central.sonatype.com/search?q=koalaplot, and also can see the files at https://repo1.maven.org/maven2/io/github/koalaplot/.
What is the specific error you are getting?

I tried again and it's syncing now ¯\(ツ)/¯. I'll open a new issue if there are problems with functionality on iOS.

Hi @zacharee, I published a 0.4.0-dev1 build with ios artifacts. Please let me know if they don't work ok for you. I don't own any Apple devices so can't test them. Thanks to @maltsev-gorskij for helping to get the ios build working.

No problems. Glad to help ;)
P.S. Thanks for release!

Tried out the iOS support and works great....thanks!
https://twitter.com/joreilly/status/1699444224184201703?s=20

authors: VitalyPeryatin gsteckman joreilly maltsev-gorskij zacharee

repo: KoalaPlot/koalaplot-core


text:
AC Powered CC2530  + CC2591 router

hi Guys,
Just built my how AC Powered CC2530  + CC2591 following the tutorial below:
https://www.zigbee2mqtt.io/how_tos/how_to_create_a_cc2530_router.html
But when is very quiet i can hear a very light buzz coming from the box. Is this normal?
To be honest I'm not very confident connecting the HLK-PM03 to main power socket? is that safe? what can go wrong like catch fire or short circuit?
I've seen some guys building a breakout board around it with fuses and so, would this not be a more reliable/safe solution?
Thanks in advance!
Leandro

I'm definitely no electrician, but I consider the HLK-PM03 to be safe, already running my CC2530 router 1.5 years with this.

okay, good to know because in fact the reliability so far is much better

authors: Koenkk lealoureiro

repo: Koenkk/Z-Stack-firmware


text:
Overlay Error: sonarr_taglist is not a valid filter attribute

Version Number
2.0.2
What branch are you on?
master
Describe the Bug
When using sonarr_taglist as filter for overlays, I get an error that it is not a valid filter attribute
[2024-07-15 07:16:49,411] [overlays.py:598]           [ERROR]    | Overlay Error: sonarr_taglist is not a valid filter attribute
Relevant Collection/Overlay/Playlist Definition
templates:
  # TEXT CENTER
  TV_Top_TextCenter:
    sync_mode: sync
    builder_level: show
    overlay:
      name: text(<<text>>)
      horizontal_offset: <<horizontal_offset>>
      horizontal_align: <<horizontal_align>>
      vertical_offset: <<vertical_offset>>
      vertical_align: <<vertical_align>>
      font: config/files/fonts/Juventus-Fans-Bold.ttf
      font_size: 70
      font_color: <<color>>
      group: TV_Top_TextCenter
      weight: <<weight>>
      back_color: <<back_color>>
      back_width: 1920
      back_height: 90

overlays:
  complete_canceled:
    template:
    - name: TV_Top_TextCenter
      weight: 20
      text: "C O M P L E T E"
      color: "#FFFFFF"
      back_color: "#CF142B"
      horizontal_align: center
      vertical_align: bottom
      horizontal_offset: 0
      vertical_offset: 0
    plex_all: true
    filters:
      tmdb_status:
      - canceled
      sonarr_taglist: complete
  complete_ended:
    template:
    - name: TV_Top_TextCenter
      weight: 20
      text: "C O M P L E T E"
      color: "#FFFFFF"
      back_color: "#000000"
      horizontal_align: center
      vertical_align: bottom
      horizontal_offset: 0
      vertical_offset: 0
    plex_all: true
    filters:
      tmdb_status:
      - ended
      sonarr_taglist: complete

Logs
https://gist.github.com/Dragonsys/ba7dc6be78d3849abba100431838721e

The error is correct.  That is not a valid filter attribute.
Valid filter attributes are listed on this page:
https://kometa.wiki/en/latest/files/filters/

Ok, so then Sonarr/Radarr tags cannot be used as filters for overlays then?

They can't be used as filters in the way you are attempting, but you could use that builder to apply labels to things or put them into collections in Plex, and you could then filter the overlay definition on those things.

Right, but I'm trying to do it without creating another collection in plex. Maybe I can build a Trakt list instead

You don't have to create another collection.  Just tag the items using the builder with build_collection: false.
OR create a collection.

Oh, ok. So it will tag them with the collection tag, but not create the collection in Plex. Awesome, thank you! Let me try that out.

This is working perfectly, thank you for your help!
So this isn't actually a bug, but instead working as designed and I was just wrong in how I was trying to accomplish my goal. So this can be closed.

So this isn't actually a bug, but instead working as designed and I was just wrong in how I was trying to accomplish my goal. So this can be closed.

authors: Dragonsys chazlarson

repo: Kometa-Team/Kometa


text:
add header namesspace to prevent header errors

Description
Currently, if I try to just run the snippets produced by this charp -> httpclient.js target then I will get errors similar to
error CS0246: The type or namespace name 'ContentDispositionHeaderValue' could not be found

However, if I add the namespace using System.Net.Http.Headers; to the top then the snippet works as expected
This PR just adds that namespace to the top so that the snippet can run if just copied.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

authors: CLAassistant davismartin

repo: Kong/httpsnippet


text:
Color picker doesn't show when changing environment color

Describe the bug
For a sub-env for which I want to change the color the color picker just briefly flashes and disappears again.
To Reproduce
Steps to reproduce the behavior:

Go to Manage Evnrionments
Duplicate existing environment with a color
Click "Color" to change color
See color picker disappearing instantly

Expected behavior
Picker should remain visible
Desktop (please complete the following information):
Version: Insomnia Core 2020.4.1
Release date: 9/23/2020
OS: Linux x64 5.4.0-51-generic
Electron: 9.1.1
Node: 12.14.1
V8: 8.3.110.13-electron.0
Architecture: x64
node-libcurl: libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 libssh2/1.9.0 nghttp2/1.41.0
Additional context
Removing the sub-env color makes the picker show. Setting a color and then trying to change it produces bug again

Duplicate of #2647
A fix is waiting for a review it should be fixed soon ;)

Oh, yeah, ok. I did a search before posting but got misled by "MacOS" part ;)

Closing since it's a duplicate and there is a fix in progress 👍
Even though it's a duplicate, better late than never!

authors: jgiovaresco nijikokun tauinger-de

repo: Kong/insomnia


text:
https://support.insomnia.rest/article/116-cli-run-test

The "git-repo" link at https://support.insomnia.rest/article/116-cli-run-test is broken.
Old: https://github.com/Kong/insomnia/tree/develop/packages/insomnia-inso/src/db/fixtures/git-repo
New: https://github.com/Kong/insomnia/tree/develop/packages/insomnia-inso/src/db/fixtures/git-repo/

Thanks for the report! Fixed.

authors: Foorack reynolek


text:
Repro and fix for #5740 - handle git sync of empty repositories/no previous .insomnia folder

changelog(Fixes): Fixes an issue where cloning repositories that are empty or previously unused by insomnia didn't suggest users to create an empty insomnia project.
TODO

[x] reproduce issue in a smoke test
[ ] add a fix/workaround

Investigation
Seems that when we added routes for git we didn't re-include the previous code paths that handled the "empty repo" or "repo without previously a .insomnia cases.
const noDocumentFound = (gitRepo: GitRepository) => {
  return (dispatch: any) => {
    showAlert({
      title: `No ${strings.document.singular.toLowerCase()} found`,
      okLabel: 'Yes',
      addCancel: true,
      message: `No ${strings.document.singular.toLowerCase()} found in the repository for import. Would you like to create a new one?`,
      onConfirm: () => dispatch(createWorkspaceWithGitRepo(gitRepo)),
    });
  };
};

// (...)

// If no workspace exists, user should be prompted to create a document
if (!(await containsInsomniaWorkspaceDir(fsClient))) {
  dispatch(noDocumentFound(repoSettingsPatch));
  trackSegmentEvent(SegmentEvent.vcsSyncComplete, { ...vcsSegmentEventProperties('git', 'clone', 'no directory found'), providerName });
  return;
}

Closes #5740

Closing this one in favour of #5779


text:
Missing feature: Assuming an IAM role via AWS EKS pod identity

Looking at the options and code in this repo, there is support for retrieving short-lived credentials from EC2 Metadata service (and thus kube2iam, kiam, etc) but the newer Kubernetes method of using Web Identity files is not implemented yet.
Here's a technical overview of IAM pod identity: https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html
The fundamental difference with web identity is that a new environment variable points to a file on disk, which contains a JWT that can be submitted to the sts:AssumeRoleWithWebIdentity API, returning a 1-hr credential that can then be used just like normal instance metadata credentials. The file on disk gets rotated every ~12 hours by default so it does have to be re-read at some interval.
Obviously there's a bit of new complexity getting a usable credential this way, but it's more reliable and less hacky than solutions like kube2iam, so there's reason to add it.
I'll probably make my own attempt at this soon, so I'm filing this ticket now for awareness and to solicit input on the best place to implement this.

@danopia, did you make  any progress on this ?

Hello, I haven't actually started editing code on this plugin, as it's kinda more of a 'nice to have' value-add to kong in my situation.
I think the main concerns from me are getting the environment variables and reading the OS file that the variables point to. It looks like this feature would only work with additional nginx directives such as env AWS_REGION; env AWS_ROLE_ARN; env AWS_WEB_IDENTITY_TOKEN_FILE; and I'm not sure right now how to specify such a directive list to Kong via Kong's own environment variables.

@danopia I do not think that is the case. The environment variables are not accessible from the workers, but then again, you only need to read them once at system startup, so you should be able to collect them in the init phase. Like the other credential handlers do (they also rely on env variables).

see https://github.com/Kong/kong-plugin-aws-lambda/blob/master/kong/plugins/aws-lambda/iam-ecs-credentials.lua#L13

Hi all,
I'm working to develop the code to retrieve credentials in the EKS environment from AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE. I also add a configuration variable (config.aws_role_session_name) to assume another role than the role defined in AWS_ROLE_ARN.
I'm not sure if I will ever create a PR for the reasons below but it might help someone:

this is my first development in LUA and I am not sure of the quality of the code (even if lint pass)
I need to double-check the assume role with the configuration variable
I didn't test in a real environment with Kong

Branch: https://github.com/xdejonghe/kong-plugin-aws-lambda/tree/lambda/web-token-identity-and-refacto

@Tieske , eventually, I finished the development and made a PR Lambda/web token identity and refacto to review the code.
Here it is the changes:

refactored the code to pass the plugin configuration to the providers (required to get the region, aws_role_session_name, and aws_assume_role_arn)
implemented a new web token identity credentials provider for EKS. Either using service account role or a given role to assume (for cross account usage)

What I didn't tests:

read file from filesystem (event if it's developed)
deploy the plugin in AWS (ECS, EKS) and call a lambda

authors: MosAmokhtari Tieske danopia xdejonghe

repo: Kong/kong-plugin-aws-lambda


text:
[HELP] Got message: not found

Summary
Hi All, I tried to create a new service and route on Kong within the external endpoint
Note: I am using httpie
Steps To Reproduce

Create Service using this command: http :8001/services name=getAllAccountDetails url=http://external.com/api/prod/rest/getAllAccountDetails
Create Route within this command based on service id: http :8001/routes service:='{"id":"fec74959-161a-43f6-ad35-81c20308fda2"}' paths:='["/v1/prod/getAllAccountDetails"]' methods:='["GET","POST","PATCH","PUT"]'
Testing the API using POST method over Postman but return this:
{  "message": "Not found" }

Additional Details & Logs

Kong version ($ kong version)
Latest
Operating system
Ubuntu

@zkenstein
I tried that and it worked ok. What are you exactly doing at 3.?

Hi @bungle ,
On the point 3. I tried to testing the API call in POST method with endpoint http://konghost:8001/v1/prod/getAllAccountDetails with body raw data: { "AccountId":"65454154", "tenantID":"0" } and got the result
{
    "message": "Not found"
}

On the point 3. I tried to testing the API call in POST method with endpoint http://konghost:8001/v1/prod/getAllAccountDetails

@zkenstein, it looks like you are firing that request to admin port, not to the proxy port.

On the point 3. I tried to testing the API call in POST method with endpoint http://konghost:8001/v1/prod/getAllAccountDetails

@zkenstein, it looks like you are firing that request to admin port, not to the proxy port.

Thanks for mentioned the port, my mistake. and also it should enable strip path and now the api works properly. Thanks @bungle

authors: bungle zkenstein

repo: Kong/kong


text:
OAuth2 Plugin Resource Owner Password Credentials flow "invalid_client"

Summary
Using the latest Kong version 2.0.0, community version and the oauth plugin, I can't get a token using the grant_type=password, but using the exact same details with client_credentials I do get the token.
Steps To Reproduce

Follow the documentation set by step
Allow "enable_password_grant"
Call the service
Boom

Additional Details & Logs
oauth plugin configuration:
{
  "created_at": 1580999676,
  "config": {
    "refresh_token_ttl": 1209600,
    "enable_client_credentials": true,
    "mandatory_scope": false,
    "provision_key": "4jCX0Vrq0OGYOoOgBn1s030yiZIreEnR",
    "accept_http_if_already_terminated": true,
    "hide_credentials": false,
    "enable_implicit_grant": false,
    "global_credentials": true,
    "enable_authorization_code": false,
    "enable_password_grant": true,
    "scopes": [
      "read",
      "write"
    ],
    "anonymous": null,
    "token_expiration": 7200,
    "auth_header_name": "authorization"
  },
  "id": "4eb39a6d-af7c-471f-a7c3-323d27635b6b",
  "service": {
    "id": "2de30db8-886e-485d-bb33-d299112a6e42"
  },
  "enabled": true,
  "protocols": [
    "grpc",
    "grpcs",
    "http",
    "https"
  ],
  "name": "oauth2",
  "consumer": null,
  "route": null,
  "tags": null
}

The postman call (also sending the basic auth header)

The response is:
{
    "error_description": "Invalid client authentication",
    "error": "invalid_client"
}

Sending the exact same thing with grant_type=client_credential works.

Kong version 2.0.0

Found the issue - the consumer didnt have a redirect_uri defined. It's really important to document it or return a better error


text:
change worker_consistency to eventual

Summary
eventual seems to be the right and sane default and we should switch to it as soon as possible. We keep running into it with customers with larger deployments.

xref https://github.com/Kong/charts/issues/228

@hbagdi, I agree, I want to propose deprecation of that setting and get rid of it with 3.0 (which would make it the default and the only option).

I want to propose deprecation of that setting and get rid of it with 3.0 (which would make it the default and the only option).

+1 to that if that path is available

We're trying to set this in our KIC deployment using environmental variables on the container.  We've tried KONG_WORKER_CONSISTENCY and KONG_NGINX_WORKER_CONSISTENCY  but neither seems to work.

Please make sure you are setting it on the kong container of the pod and not the controller container.

I asked the same question.  We will validate, but I believe that we are putting them on the correct container.
To validate that the settings are in effect, we are logging into the proxy container and looking for worker_consistency in the /usr/local/kong/nginx-kong.conf.  Is that the correct way to validate?

Umm, no.
You won't see any difference in that file.
Set KONG_WORKER_CONSISTENCY=eventual as an environment variable and you should be good.
https://docs.konghq.com/gateway-oss/2.4.x/configuration/#worker_consistency

Ok, thanks.
Is there anyway way we can validate the the setting is changed?

/usr/local/kong/.kong_env should have that property set.

authors: bungle hbagdi scrudge


text:
feat(pdk) kong.node.get_hostname

In addition of adding the new function to the PDK, this PR replaces utils.get_hostname everywhere with the new PDK function.

Question about this one: should we memoize the hostname in the function? I don't think hostnames are the sort of thing that changes during the lifetime of a worker.


text:
Add new upstream fields

What this PR does / why we need it:
Adds new 3.x upstream fields to KongIngress.
Which issue this PR fixes:
Fix #2812
Special notes for your reviewer:
~Depends on a new deck release that includes https://github.com/Kong/deck/pull/735~ released in v1.14.0
PR Readiness Checklist:
Complete these before marking the PR as ready to review:

[ ] the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

Rebased to current main, which uses deck v1.14.0, and added changelog entry; should be all set.

repo: Kong/kubernetes-ingress-controller


text:
Fixed broken link to Enterprise documentation

This README had a broken link to the Enterprise installation description

What this PR does / why we need it:
Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #
Special notes for your reviewer:

@svenwal Thank you for taking the time to send these fixes!

authors: hbagdi svenwal


text:
Question: is vite required?

hey @KonnorRogers - love this!
Is Vite required? can it be used with JSBundling or Shakapacker or Importmap?
I am looking at implementing some rich text for my gem Hot Glue. I already implemented TinyMCE and was going to look at ActionText next, but now I want to give this a try.
-Jason

Negative. Vite is not required. It should work with JSBundling / Shakapacker. I haven't tested with importmaps, but it should work there as well.

authors: KonnorRogers jasonfb

repo: KonnorRogers/rhino-editor


text:
Export now shows "Web server exports must be hosted on an http / web server to be viewed correctly." on top of document

Describe the bug
Text of "Web server exports must be hosted on an http / web server to be viewed correctly." shown over document
Operating System
Windows 10
To Reproduce
Steps to reproduce the behavior:

Export a note to HTML using the plugin

It seems completely reasonable for the pages to have a message if being viewed on a platform where they are not intended to be viewed. So not a bug. However it seems reasonable to enable the message to be turned off with a case of user beware.

You need to change the export mode to HTML documents rather than web server export if you want to open documents locally. Web Server exports will not load most content when opened locally, there is no reason to use them to open files locally since you can just use the HTML Documents export mode.

@aubreyz The plugin did not do this before, so it is some operational change in the latest update. Since I only ever export to HTML for offline viewing, this breaks my use case. I at first thought it was an issue/bug in the HTML creation.
@KosmosisDire Thank you, I adjusted this setting and it seems to resolve the issue, exporting files in the original format.

authors: KosmosisDire SuschNL aubreyz

repo: KosmosisDire/obsidian-webpage-export


text:
java.lang.NoSuchMethodError: No virtual method getActivity() by toast("message")

Next error message shows while I call toast("Message") method in fragment
java.lang.NoSuchMethodError: No virtual method getActivity()Landroid/app/Activity; in class Landroid/support/v4/app/Fragment; or its super classes (declaration of 'android.support.v4.app.Fragment' appears in name-of-the-file-classes.dex)
Kotlin 1.1.0-rc-91
Anko v0.9.1
Android Studio 2.3 RC
According closed task #311 I used
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? = FragmentUi<Fragment>().createView(AnkoContext.create(activity, this)) }
but error still happens

getActivity().toast("Message")
I will used this when i call toast in fragment

Same here, this prevents me from using 0.9.1

Duplicate of #311.

authors: Nyest dEn13L julianostarek yanex

repo: Kotlin/anko


text:
Irreducible CFGs may cause performance issues if JIT doesn't like them

A suspension point inside a loop may create an irreducible control-flow graph, which may be not optimizable by JIT.

This is still a hypotetical issue. Will not fix, until real-life use-case of irreducable CFGs are file to YouTrack.

authors: abreslav elizarov

repo: Kotlin/kotlin-coroutines


text:
CIを作成してGitHub Actionsで実行するようにした

~#329 がマージされたらdraftじゃなくします~
issue #332
やったこと

test, linter, formatter(dry-run)を実行するCIのjobを作成
test終了時にDBとのコネクションを明示的に切るために、Repositoryのコンストラクタにnode-postgresのコネクションプールのクラスを注入するようにした。

https://node-postgres.com/features/pooling
コネクションプールを導入したことによって、トピック更新時のボットメッセージ等のDBへのレコードの挿入順が安定しなくなった(アプリケーションの挙動に影響が出ない程度に)ので、それに対応してテストを更新した。

参考リンク・補足など

あれ、コメントが消えてしまった

authors: TOMOFUMI-KONDO yuta-ike

repo: KoukiNAGATA/sushi-chat


text:
[BUG] Offline mode notification panel unreadable

When I was on offline mode, I saw that there was a new icon at the top right corner of the todoist app. I moved my cursor to the red triangle icon there to see what it said, but I wasn't able to read the text in the panel displayed while hovering with the cursor over the red triangle icon, because the panel was flickering at a rapid pace.
See screen recording here.
What's really strange is that while I was setting up SimpleScreenRecorder on my OS, which is a default screen recorder software on Linux Mint, and I put my cursor on the same triangle I was talking about before (while the focus was still on SimpleScreenRecorder with the todoist app in the background), the panel wasn't flickering anymore and I could actually read what was in there.
I'm on Linux Mint Cinnamon 19.
P.S. I advise you to download the video I shared, because it was jerky when I played it directly in the browser.

wow, what a nice bug!
Thanks for the report @tpondant, I'll try to reproduce it on my VM. I hope it will be easy to reproduce.

authors: KryDos tpondant

repo: KryDos/todoist-linux


text:
Staking token calls check slashing twice

Description:
The CheckSlashing message is sent twice upon stsei burn request.
Code Location:
krp-staking-contracts/contracts/basset_sei_token_stsei/src/handler.rs#L51-L62

fixed on commit id :
https://github.com/KryptoniteDAO/krp-staking-contracts/commit/e7c4805e391689cdd4595c5d9731e16f1959667d

repo: KryptoniteDAO/krp-staking-contracts


text:
Added Range based Query and Update operation using SegmentTree

🛠 Issue (864)
Segment Tree

Issue no #864
👨💻 Changes proposed
I have implemented segment tree that supports the following operations:

Building the segment tree from an input array.
Querying the sum over a given range [l, r] in the array.
Updating the value of a specific element in the array and propagating the changes through the segment tree.

The implementation can be accessed at the following:

C++/Trees/SegmentTree.cpp
C/Trees/SegmentTree.c
Java/Trees/SegmentTree.java
Python/Trees/SegmentTree.py

✔ Check List (Check all the applicable boxes)

[✔ ] My code follows the code style of this project.
[✔ ] This PR does not contain plagiarized content.
[ ✔] The title of my pull request is a short description of the requested changes.

📄 Note to reviewers
Any Suggestions would be appreciated.

📷 Screenshots

@Kumar-laxmi review this

repo: Kumar-laxmi/Algorithms


text:
Leaderboard search box doesn't find accounts starting with 0xf

Subject of the issue
Typing 0xf into the Leaderboard search box doesn't return any results even though 0xf59B2359a33D9777f381d5044DAF47F3e309f018 is a valid account which should appear
Your environment

L2
Chrome 105.0.5195.102

Expected behaviour
A list of accounts starting 0xf should appear
Actual behaviour
The list is empty, but at least one account should appear. The account can be accessed from the url https://kwenta.io/leaderboard/?trader=0xf59B2359a33D9777f381d5044DAF47F3e309f018
Steps to reproduce
Go to Leaderboard page and enter 0xf into the search box

Issue seems to be resolved. closing ticket.

authors: amphoria platschi

repo: Kwenta/kwenta


text:
cond is missing for dollar operator in Reference Card doesn't mention cond

Opened https://github.com/KxSystems/docs/pull/33 for this

Well spotted! However, Cond was removed from the list of operators a while ago because it is not a function, but a control structure, like do. Although it looks like a ternary operator and returns a result, It is not applied to arguments, but (like if) to a list of ≥3 expressions, only some of which are evaluated. It is not possible to project Cond.
So Cond is listed with the other control structures: do, if and while.

authors: StephenTaylor-Kx nabeel-ms

repo: KxSystems/docs


text:
A problem during RUN sample queries.

I build the sample cube 100%
but when I run query select part_dt, sum(price) as total_selled, count(distinct seller_id) as sellers from kylin_sales group by part_dt order by part_dt;
the web gives:
Error while executing SQL "select part_dt, sum(price) as total_selled, count(distinct seller_id) as sellers from kylin_sales group by part_dt order by part_dt LIMIT 50000": Error in coprocessor
kylin.log is here: http://pan.baidu.com/s/1sk9hREt
Any advice to it?

Hi there. Please post questions / issues to user@kylin.apache.org
Thanks.

请问：发出去的邮件能否有回复？

repo: KylinOLAP/Kylin


text:
Overlay starts, can be seen on screen and clicked but keyboard commands don't interact with it

Overlay shows on the screen when I start POE. It loads the tutorial slide "press F7" or something but I can't proceed. Tried other commands (eg. Alt+D) but realized that nothing I type on the keyboard is registered by Overlay.
Running the latest Steam client and just downloaded the latest Overlay.

Try ctrl+d. Alt+d seems to be problematic.


text:
Implements a User Page

[x] Closes #8 Implementing a User page, which shows the countdowns only created by him

Currently is not shareable and only shows the data of the signed-in user, at '/account'

[x] is now shareable with a link of the form '/user/:uid'