Fix code coverage for xSQLServerDatabase

Fix code coverage for xSQLServerDatabase

[ ] Change details added to Unreleased section of CHANGELOG.md?
[x] Added/updated documentation, comment-based help and descriptions in .schema.mof files where appropriate?
[x] Examples appropriately updated?
[x] New/changed code adheres to Style Guidelines?
[ ] Unit and (optional) Integration tests created/updated where possible?

This change is

Codecov Report

Merging #397 into dev will increase coverage by <1%.
The diff coverage is 92%.

@@         Coverage Diff          @@
##            dev   #397    +/-   ##
====================================
+ Coverage    68%    68%   +<1%
====================================
  Files        31     31
  Lines      3170   3171     +1
====================================
+ Hits       2167   2182    +15
+ Misses     1003    989    -14

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 a0d6162...0ba080a. Read the comment docs.

@johlju Hi, I try to increase code coverage for xSQLServerDatabase resource and fix a bug with Test-TargetResource (Test for Absent always true...)
Anyway, pester failed for get-* but works with test-*, maybe another eye can see what I don't see. I become to be blind with all these pester 😞

Awesome! Thanks for increasing code coverage! I will look and see what could be wrong. Always good with more eyes :)

The reason if fails is because for some reason it calls the Connect-SQL in the xSQLServerHelper module, and not the Mock. Why it does not call the mock I don't know yet. Investigating.

Reviewed 7 of 8 files at r1.
Review status: 7 of 8 files reviewed at latest revision, 20 unresolved discussions, some commit checks failed.

README.md, line 288 at r1 (raw file):

#### Parameters

* **[String] SQLServer** _(Key)_: The host name of the SQL Server to be configured. Default value is *env:COMPUTERNAME*.

Remove default value.

README.md, line 289 at r1 (raw file):

* **[String] SQLServer** _(Key)_: The host name of the SQL Server to be configured. Default value is *env:COMPUTERNAME*.
* **[String] SQLInstance** _(Key)_: The name of the SQL instance to be configured. Default value is *MSSQLSERVER*.

Remove default value.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 42 at r1 (raw file):

        [ValidateNotNullOrEmpty()]
        [System.String]
        $SQLServer = $env:COMPUTERNAME,

This was mandatory previously, so just lets remove the default value here.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 47 at r1 (raw file):

        [ValidateNotNullOrEmpty()]
        [System.String]
        $SQLInstanceName = 'MSSQLSERVER'

Please remove default value and if it is present in README, etc, remove it there too. :)

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 56 at r1 (raw file):

        Write-Verbose -Message 'Getting SQL Databases'
        # Check database exists
        $getSqlDatabase = $sqlServerObject.Databases[$Name]

You could rename $getSqlDatabase to $sqlDatabaseObject

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 116 at r1 (raw file):

        [ValidateNotNullOrEmpty()]
        [System.String]
        $SQLServer = $env:COMPUTERNAME,

This was mandatory previously, so just lets remove the default value here.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 121 at r1 (raw file):

        [ValidateNotNullOrEmpty()]
        [System.String]
        $SQLInstanceName = 'MSSQLSERVER'

Please remove default value and if it is present in README, etc, remove it there too. :)

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 128 at r1 (raw file):

    if ($sqlServerObject)
    {
        if ($Ensure -eq "Present")

Single quotes

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 132 at r1 (raw file):

            try
            {
                $newDatabase = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Database -ArgumentList $sqlServerObject,$Name

Rename $newDatabase to $sqlDatabaseObjectToCreate

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 152 at r1 (raw file):

            try
            {
                $getDatabase = $sqlServerObject.Databases[$Name]

Rename $getDatabase to $sqlDatabaseObjectToDrop

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 208 at r1 (raw file):

        [ValidateNotNullOrEmpty()]
        [System.String]
        $SQLServer = $env:COMPUTERNAME,

This was mandatory previously, so just lets remove the default value here.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 213 at r1 (raw file):

        [ValidateNotNullOrEmpty()]
        [System.String]
        $SQLInstanceName = 'MSSQLSERVER'

Please remove default value and if it is present in README, etc, remove it there too. :)

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 218 at r1 (raw file):

    Write-Verbose -Message "Checking if database named $Name is present or absent"

    $currentValues = Get-TargetResource @PSBoundParameters

Rename $currentValues to $getTargetResourceResult

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 231 at r1 (raw file):

            }
        }
        'Present'

Add a blank line before this one.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 65 at r1 (raw file):

                                    Add-Member -MemberType NoteProperty -Name 'Name' -Value $mockSqlDatabaseName -PassThru |
                                    Add-Member -MemberType ScriptMethod -Name Create -Value {
                                        if ( $this.Databases[$mockSqlDatabaseName] -ne $mockExpectedCreateForAlterMethod )

You are referencing $this.Databases. The propery Databases does not exist in this object. New-Object is the start of the object, and only properties added after can be references (which is inside the same object). The property Databases is part of the previous parent object.
So $this.Databases[@mockSqlDatabaseName] shoud be replaced with $this.Name. Name is a property in this object.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 68 at r1 (raw file):

                                        {
                                            throw "Called mocked Create() method without adding the right database. Expected '{0}'. But was '{1}'." `
                                                  -f $mockExpectedCreateForAlterMethod, $this.Databases[$mockSqlDatabaseName]

Replace $this.Databases[@mockSqlDatabaseName] with $this.Name.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 76 at r1 (raw file):

                                    } -PassThru |
                                    Add-Member -MemberType ScriptMethod -Name Drop -Value {
                                        if ( $this.Databases[$mockSqlDatabaseName] -ne $mockExpectedDropForAlterMethod )

Replace $this.Databases[@mockSqlDatabaseName] with $this.Name.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 79 at r1 (raw file):

                                        {
                                            throw "Called mocked Drop() method without dropping the right database. Expected '{0}'. But was '{1}'." `
                                                  -f $mockExpectedDropForAlterMethod, $this.Databases[$mockSqlDatabaseName]

Replace $this.Databases[@mockSqlDatabaseName] with $this.Name.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 105 at r1 (raw file):

                }

                $result = Get-TargetResource @testParameters

BeforeEach is run before each It-block. So the Mock is not present at this time when you call Get-TargetResource.
Move the call to Get-TargetResource inside each It-block to solve this.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 291 at r1 (raw file):

                }

                It 'Shoud throw the correct error when Drop() method was called with invalid operation' {

Typo 'Should'

Comments from Reviewable

When I went thru the code to find the errors in the tests I couldn't help to review it at the same time. :) See the review comments how to solve the problems with the tests.
BUT, I did change the test to verify my findings and then Set-TargetResource is still failing, but I think those errors are because you are not finished with the test?
Let me know if you need further help :)

Reviewed 4 of 4 files at r2.
Review status: all files reviewed at latest revision, 20 unresolved discussions.

README.md, line 288 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Remove default value.

Done.

README.md, line 289 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Remove default value.

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 42 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
This was mandatory previously, so just lets remove the default value here.

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 47 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Please remove default value and if it is present in README, etc, remove it there too. :)

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 56 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
You could rename $getSqlDatabase to $sqlDatabaseObject

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 116 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
This was mandatory previously, so just lets remove the default value here.

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 121 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Please remove default value and if it is present in README, etc, remove it there too. :)

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 128 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Single quotes

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 132 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Rename $newDatabase to $sqlDatabaseObjectToCreate

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 152 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Rename $getDatabase to $sqlDatabaseObjectToDrop

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 208 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
This was mandatory previously, so just lets remove the default value here.

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 213 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Please remove default value and if it is present in README, etc, remove it there too. :)

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 218 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Rename $currentValues to $getTargetResourceResult

Done.

DSCResources/MSFT_xSQLServerDatabase/MSFT_xSQLServerDatabase.psm1, line 231 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Add a blank line before this one.

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 65 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
You are referencing $this.Databases. The propery Databases does not exist in this object. New-Object is the start of the object, and only properties added after can be references (which is inside the same object). The property Databases is part of the previous parent object.
So $this.Databases[@mockSqlDatabaseName] shoud be replaced with $this.Name. Name is a property in this object.

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 68 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Replace $this.Databases[@mockSqlDatabaseName] with $this.Name.

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 76 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Replace $this.Databases[@mockSqlDatabaseName] with $this.Name.

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 79 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Replace $this.Databases[@mockSqlDatabaseName] with $this.Name.

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 105 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
BeforeEach is run before each It-block. So the Mock is not present at this time when you call Get-TargetResource.
Move the call to Get-TargetResource inside each It-block to solve this.

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 291 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Typo 'Should'

Done.

Comments from Reviewable

@johlju Wich is the best way to mock this:
$sqlDatabaseObjectToCreate = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Database -ArgumentList $sqlServerObject,$Name

@luigilink This was a tricky one. I think this could work. I have not tested it.
By using the mocked class here. https://github.com/PowerShell/xSQLServer/blob/dev/Tests/Unit/Stubs/SMO.cs#L431
You are already using the mock since you loading SMO.cs. But to get this test as far as possible we have to add the expected variable to the SMO.cs.
Only way I see is to add a global variable.
Here in the Globals class https://github.com/PowerShell/xSQLServer/blob/dev/Tests/Unit/Stubs/SMO.cs#L62
Add the following
// Static property that is used to set the expected database name that should be expected when calling, for example, Create(), Drop() or Alter().
public static string MockExpectedDatabaseName = null;

The for the Create() and Drop() methods here: https://github.com/PowerShell/xSQLServer/blob/dev/Tests/Unit/Stubs/SMO.cs#L445
Something like this
if( Globals.MockExpectedDatabaseName != this.Name ) {
    string errorMessage = "Expected to get DatabaseName == '" + Globals.MockExpectedDatabaseName + "'. But got '" + this.Name + "'";
    throw new System.ArgumentException(errorMessage, "Name");
}

And in the tests you add this before calling the method to test (and add the correct expected database name).
[Microsoft.SqlServer.Management.Smo.Globals]::MockExpectedDatabaseName = 'AdventureWorks'

Just a heads up. Remember when doing changes to SMO.cs, make sure you start a clean PowerShell.exe for each test run. If SMO is already loaded, it will not reload.
I normally do the following when in PowerShell
PS > powershell
Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS > Invoke-Pester *sql*database
.... Tests are run
PS > exit

And then do the above again after changing SMO.cs. 😄

There is also the alternative to not push for 100% coverage but instead loose some code coverage to simplify testing.
It would be possible to add a helper function (still in this resource psm1 file) with just that line in your comment that returns the database object . And add the parameters needed to call the Database class.
Then you just mock that helper function.
Remember that the helper function in this case should have as little code as possible to limit the loss of code coverage.
If a resource has 95% of code coverage that is still OK. Sometimes it is not possible to mock every aspect. Or to mock every aspect make it very complex.

Reviewed 1 of 1 files at r3.
Review status: all files reviewed at latest revision, 20 unresolved discussions.

Comments from Reviewable

@johlju I fixed all failed pester. And code coverage is 100% 😺

Reviewed 1 of 1 files at r4.
Review status: all files reviewed at latest revision, 20 unresolved discussions.

Comments from Reviewable

@luigilink Awesome work! 👍

@luigilink Impressive work my friend! Your solution was way better than mine! :smile:
Just minor comments.

Reviewed 3 of 4 files at r2, 1 of 1 files at r3, 1 of 1 files at r4.
Review status: all files reviewed at latest revision, 11 unresolved discussions, all commit checks successful.

CHANGELOG.md, line 32 at r4 (raw file):

  - BREAKING CHANGE: The mandatory parameter now include SQLInstanceName. The DynamicAlloc parameter is no longer mandatory
- Changes to xSQLServerDatabase
  - Fix Test-TargetResource function that checks only Ensure parameter

Question:
First! Great improvement to the Test-TargetResource logic!
But it actually still only verify the Ensure parameter, so this text seems wrong. You did improve the method with the output of verbose messages, so maybe change this text to something like:

When the system is not in desired state the Test-TargetResource will now output verbose messages saying so.

Or do you mean that the resource had an actually bug when trying to remove a database with 'Absent' (looking at the issue)? If so then we need to change the message to something saying so. :)

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 42 at r4 (raw file):

$mockExpectedCreateForAlterMethod

Please change to $mockExpectedDatabaseNameToCreate

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 43 at r4 (raw file):

$mockExpectedDropForAlterMethod

Please change to $mockExpectedDatabaseNameToDrop

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 91 at r4 (raw file):

                                throw 'Mock Create Method was called with invalid operation.'
                            }
                            if ( $this.Name -ne $mockExpectedCreateForAlterMethod )

Add a blank line before this one.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 239 at r4 (raw file):

            $mockSqlDatabaseName = 'Contoso'

Minor: It would be easier to review if you added $mockExpectedDatabaseNameToCreate = 'Contoso' here as well. Less scrolling :)

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 241 at r4 (raw file):

            Context 'When the system is not in the desired state and Ensure is set to Present' {
                It 'Should Not Throw when Ensure parameter is set to Present' {

This should say 'Should not throw when creating the database'

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 263 at r4 (raw file):

            $mockSqlDatabaseName = 'Sales'

Minor: It would be easier to review if you added $mockExpectedDatabaseNameToDrop = 'Sales' here as well. Less scrolling. :)

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 265 at r4 (raw file):

            Context 'When the system is not in the desired state and Ensure is set to Absent' {
                It 'Should Not Throw when Ensure parameter is set to Present' {

This should say 'Should not throw when dropping the database'

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 282 at r4 (raw file):

            $mockInvalidOperationForCreateMethod = $true

            Context 'When the system is not in the desired state and Ensure is set to Present' {

Could you move these It-blocks to the Context-block with the same text as this one? (First one in this describe block)
Will that work?

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 289 at r4 (raw file):

                }

                It 'Shoud throw the correct error when Create() method was called with invalid operation' {

Typo 'Should'

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 328 at r4 (raw file):

                }
            }
            Assert-VerifiableMocks

Add blank line before this one.

Comments from Reviewable

Reviewed 2 of 2 files at r5.
Review status: all files reviewed at latest revision, 11 unresolved discussions.

CHANGELOG.md, line 32 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Question:
First! Great improvement to the Test-TargetResource logic!
But it actually still only verify the Ensure parameter, so this text seems wrong. You did improve the method with the output of verbose messages, so maybe change this text to something like:

When the system is not in desired state the Test-TargetResource will now output verbose messages saying so.

Or do you mean that the resource had an actually bug when trying to remove a database with 'Absent' (looking at the issue)? If so then we need to change the message to something saying so. :)

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 42 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…

$mockExpectedCreateForAlterMethod

Please change to $mockExpectedDatabaseNameToCreate

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 43 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…

$mockExpectedDropForAlterMethod

Please change to $mockExpectedDatabaseNameToDrop

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 91 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Add a blank line before this one.

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 239 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Minor: It would be easier to review if you added $mockExpectedDatabaseNameToCreate = 'Contoso' here as well. Less scrolling :)

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 241 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
This should say 'Should not throw when creating the database'

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 263 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Minor: It would be easier to review if you added $mockExpectedDatabaseNameToDrop = 'Sales' here as well. Less scrolling. :)

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 265 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
This should say 'Should not throw when dropping the database'

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 282 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Could you move these It-blocks to the Context-block with the same text as this one? (First one in this describe block)
Will that work?

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 289 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Typo 'Should'

Done.

Tests/Unit/MSFT_xSQLServerDatabase.Tests.ps1, line 328 at r4 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Add blank line before this one.

Done.

Comments from Reviewable

@johlju "Waiting for author" tag can be removed

Reviewed 2 of 2 files at r5.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.

Comments from Reviewable


Hello, can I use the GPU to run the code? Can you give me suggestion?

thanks,i want to use MKL,but i use AMD 2700x,so can i  use nvidia cuda to accelerate it.

Hi @sykxiaoqiang , sorry we don't support directly either mkl or gpu. These are sometimes implicitely used under the hood for numpy and scipy, which we use.
You could try to take a look at cupy which maintains a similar api to numpy and allows to offload computations to the GPU. You would need to change some import within the library though.
Which part exactly do you want to make faster ?

@fakufaku thanks for your work,i meet a new problem，when i run figure_doa_experiment.py,it will report an error:
Using ipyparallel processing.
Waiting for connection file: ~/.ipython/profile_default/security/ipcontroller-client.json
Traceback (most recent call last):
File "figure_doa_experiment.py", line 302, in
c = ip.Client()
File "/home/syk/anaconda2/lib/python2.7/site-packages/ipyparallel/client/client.py", line 413, in init
raise IOError(msg)
IOError: Connection file '~/.ipython/profile_default/security/ipcontroller-client.json' not found.
You have attempted to connect to an IPython Cluster but no Controller could be found.
Please double-check your configuration and ensure that a cluster is running.
Can you tell me how to solve this problem?
thank u very much

@fakufaku thanks for your work. I found the code to run slow because I didn't load ipython in ubuntu and now I solved this problem.

Great to hear you could solve it!

Great to hear you could solve it!


[Medication request] Get Dispenses by medication request

As a Doctor
I want to see Dispenses on "my" medication requests
So that i can better serve my patients

#1160


Increase the number of real time signals.  Two is not enough.

Summary
Refer to issue #8869 for details and rational.
Convert sigset_t to an array type so that more than 32 signals can be supported.
Why not use a uin64_t?

Using a uin32_t is more flexible if we decide to increase the number of signals beyond 64.
64-bit accesses are not atomic, at least not on 32-bit ARMv7-M and similar
Keeping the base type as uint32_t does not introduce additional overhead due to padding to achieve 64-bit alignment of uint64_t
Some architectures still supported by NuttX do not support uint64_t types,

Increased the number of signals to 64. This matches Linux. This will support all signals defined by Linux and also 32 real time signals (also like Linux).  This effort is primarily:

Modify the low-level sigset_t manipulation functions (like sigaddset, sigemptset), and
Modifying logic the avoids these set manipulation functions and does things  inline with internal knowledge of the underlying sigset_t data structures.

Impact
Impact due to implementation bugs is a possibility.  I would think that each individual changes is low risk, but there are many changes.  Good review and testing will be needed
NOTE:  This PR will not pass CI because it depends on correspond changes to ostest in apps.  Those changes are provided in https://github.com/apache/nuttx-apps/pull/1682
Testing
The only test that we have for signals is apps/testing/ostest.  The sim:ostest configuration will be used for most testing..

Status Update:  Every builds correctly.  Beginning testing.

I think that all of your comments have been addressed.  The changes have been pushed, re-built, and re-tested.  Should be ready to merge (with apps 1682)

I have still been thinking about use of uint64_t vs. the array of uint32_t's.  On 64-bit platforms, the uint64_t would clearly be the best choice.  But the options are more-or-less a toss-up for 32-bit platforms and the uint64_t is impossible on some other platforms.  Perhaps we should revisit this in the future?  But let's get this one out of the way first.

Two main things that I see a blocker from merging:

Take POSIX values from the spec

#define _POSIX_RTSIG_MAX 8
#define _POSIX_SIGQUEUE_MAX 32
...
#define RTSIG_MAX 32

Fix #else /* __INCLUDE_SIGNAL_H */ path in signal.h by added definition of _SIGSET_NELEM

Two main things that I see a blocker from merging:
1. Take POSIX values from the spec

#define _POSIX_RTSIG_MAX 8
#define _POSIX_SIGQUEUE_MAX 32
...
#define RTSIG_MAX 32

We have talked about this before.  Linux uses 32, I am following Linux.  There are various pages in the OpenGroup.org documents that have different values for RTSIG_MAX:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
{_POSIX_RTSIG_MAX}
    The number of realtime signal numbers reserved for application use.
    Value: 8

https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html

{RTSIG_MAX}
The current limit was chosen so that the set of POSIX.1 signal numbers can fit within a 32-bit field. It is recognized that most existing implementations define many more signals than are specified in POSIX.1 and, in fact, many implementations have already exceeded 32 signals (including the "null signal"). Support of {_POSIX_RTSIG_MAX} additional signals may push some implementations over the single 32-bit word line, but is unlikely to push any implementations that are already over that line beyond the 64 signal line.

Also on OpenGroup.org are conformance statements.  I think these are forms from POSIX complience tests of various operations systems.  They show various sizes, 8, 16, 64.
I think this should be 32, but if you insist on an artifical, unnecessary limit of 8, I will make that change.  Please let me know if you want me to do that.  I suppose SIGRTMAX should be equal to SIGRTMIN + 7?

2. Fix `#else /* __INCLUDE_SIGNAL_H */` path in `signal.h` by added definition of `_SIGSET_NELEM`

I have already removed this per my other comment.

Could you please double check? I just tried on Linux and got _POSIX_RTSIG_MAX of 8 and RTSIG_MAX of 32.

I think this should be 32, but if you insist on an artifical, unnecessary limit of 8, I will make that change. Please let me know if you want me to do that. I suppose SIGRTMAX should be equal to SIGRTMIN + 7?

No. As SIGRTMAX should be SIGRTMIN  + RTSIG_MAX so SIGRTMIN + 32

Also I'm missing reason of why _POSIX_SIGQUEUE_MAX was changed from 32 to 64

Could you please double check? I just tried on Linux and got _POSIX_RTSIG_MAX of 8 and RTSIG_MAX of 32.

That is fine with me.  I will change it to match Linux.
NOTE:  None of these values are used by NuttX so they are really don't care values.  SIGRTMAX and SIGRTMIN are the only ones that matter.

one of these values are used by NuttX so they are really don't care values. SIGRTMAX and SIGRTMIN are the only ones that matter.

Yes. I know. I just want to bee as close to POSIX specs as possible even for not used values.

Also I'm missing reason of why _POSIX_SIGQUEUE_MAX was changed from 32 to 64

This is another don't care value.  And indefinite number of signals can be queue.  It is just set to the total number of symbols. It is actually set to 63?  But there is really no limit, multiple instances of the same signal can be queued.  There is no value that says unlimited.
What would you like it to be.  It is just a number to provide to the application for whatever purpose.

What would you like it to be. It is just a number to provide to the application for whatever purpose.

I see the value 32 is specified in https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html

_POSIX_SIGQUEUE_MAX
The number of queued signals that a process may send and have pending at the receiver(s) at any time. Value: 32

Let's use that so that we are 100% compliant and we cannot argue about it.

LGTM! Adding const to xor API is optional

I really dislike those _GNU_SOURCE interface because they omit const from read-only parameters.   But it is important to be bug-for-bug compatible with specifications.
nxsig_xorset() does not have to follow that pattern, however, since it is non-standard.
So, Done!  I made the change.

@patacongo do you see reasonable keeping #define __SIGSET_T_DEFINED 1? I think similar defines are common practice. I'm not sure that I know any example that can rely on it, so it is a more theoretical question.

@patacongo do you see reasonable keeping #define __SIGSET_T_DEFINED 1? I think similar defines are common practice. I'm not sure that I know any example that can rely on it, so it is a more theoretical question.

I responded to this, but it disappeared.
I don't think we should add that definition.  I do see similar kinds of definitions in Glibc and Linux header files but I assume that they are solving some kind of recursive or multiple inclusion problem.  We don't have that problem.
Clearly we don't have any problem like that with signal.h.  Apparently we did in the past, be we don't now.
As a policy, we don't add these kinds of definitions unless needed.  Unless they actually do something.  There are quite a few such definitions, however.  See pthread.h, architecture specific types.h, and stdint.h for examples:

Each arch types.h says which standard base types are available; stdint.h uses these to determine which standard types to define.  That is a different kind of usage, however.
The *_T_DEFINED definitions in pthread being used exactly as they were in pthread.h.  Perhaps we can remove them too?

Aesthetically, I don't like it much either.  It clutters the code and makes it more difficult to read.
I can't think of any reason why we would need to do this.  A better thing to do that guard against multiple definition of every data type would be simply to design better code that does not need such guards.

Yes. My experience is similar, but more not about circular dependencies, but more about usage of those headers from the toolchain, but with the ability to override some parts of it. In one project we extended time_t to 64 bits and reimplemented time APIs while time.h from toolchain was used "as a base class", but included by the custom time header that had __TIME_T_DEFINED in prior to including time.h

@xiaoxiang781216 I have pushed all of your changes and re-built the code without error and retested using ostest,  It is all looking good.

rebased, re-built, and re-tested.

@patacongo it look like that the last rebase lose your last change, I mark these places as unresolve again.

Thanks for the merge guys.  You made me work really hard to get this one.  Thanks for all of your feedback.

@patacongo seems like some configs are impacted more that others. I see
ld.lld: error: section '.data' will not fit in region 'flash': overflowed by 32 bytes
ld.lld: error: section '.data' will not fit in region 'flash': overflowed by 80 bytes
ld.lld: error: section '.data' will not fit in region 'flash': overflowed by 92 bytes
ld.lld: error: section '.data' will not fit in region 'flash': overflowed by 92 bytes

for some configs. Maybe we will need to revert this until we find a solution.


Use raw tracepoints for net_dev_queue and netif_receive_skb

What does this PR do?
This PR adds support to use raw_tracepoints for net_dev_queue and netif_receive_skb probes.

Motivation
The recursion protection for kprobes and tracepoints is fairly heavy handed. It works by disallowing eBPF programs to nest on the same CPU, using a per-cpu variable bpf_prog_active.
For the two probes in question this is problematic because they run from within IRQ context, which means they can nest on to another eBPF program running from within a user context. This causes these probes to be skipped in such cases. Depending on the number of eBPF programs attached and the load on a system these misses can be very high.
Raw tracepoints on the other hand have more precise nesting control. An eBPF program attached to a raw tracepoint is skipped only if it is nesting a running instance of the same program. Converting these probes to use raw tracepoints instead can therefore completely eliminate misses due to nesting, since these only run from a single context.

Additional Notes
Statistics on misses of kprobes and raw tracepoints are exposed via recursion counts. These stats were added from kernel versions 6.7+.
To observe these misses happening, we can use KMT to run a fedora 40 VM (running kernel 6.8), run system-probe, generate load, and then use the eBPF check to get recursion counts for all attached programs.

Possible Drawbacks / Trade-offs
This change will cause regression in CPU usage for system-probe because, avoiding misses on netif_receive_skb results in more frequent flushes to happen. The flushes use perf_event_output which can increase CPU usage.
This may be mitigated by upcoming work allowing us to use the perf buffer to directly perform batching.

Describe how to test/QA your changes

/trigger-ci --variable RUN_ALL_BUILDS=true --variable RUN_KITCHEN_TESTS=true --variable RUN_E2E_TESTS=on --variable RUN_UNIT_TESTS=on --variable RUN_KMT_TESTS=on


PositionalParameterUsed method uses unsafe method to exclude ForEach-Object and Where-Object

Right now the PositionalParameterUsed method in Helper.cs automatically ignores any command that has a parameter set with the name ScriptBlockSet.  This is done to ensure that warnings about unnamed positional parameters are not raised for ForEach-Object or Where-Object.  This is not a safe way to exclude these cmdlets, because other cmdlets or advanced functions could be created with the same parameter set name (especially if someone uses these as an example to follow).  Instead, this should identify the ForEach-Object/Where-Object cmdlets by name.

This fix has been submitted through #246. Let us know if you have any concerns regarding this rule. Thanks!


Use std::error_code instead of boost::system::error_code for most cod…

…e. boost::system::error_code implicitly converts to std::error_code, and is designed to be passed by value

Codecov Report

Merging #525 into master will decrease coverage by <.01%.
The diff coverage is 90.9%.

@@            Coverage Diff             @@
##           master     #525      +/-   ##
==========================================
- Coverage   84.74%   84.74%   -0.01%
==========================================
  Files          41       41
  Lines        6326     6324       -2
==========================================
- Hits         5361     5359       -2
  Misses        965      965

Updated to use MQTT_NS::error_code instead.

Huh, not sure why I can't re-open this.
@redboltz do you want me to make a new one?


Mark PYSEC-2022-15 as withdrawn

Closes #58
Signed-off-by: Weston Steimel<EMAIL_ADDRESS>

Not sure if this is exactly the format we want yet (or if this breaks the analyzer). I haven't had a chance to run it locally yet, but will get around to it eventually.  In the meantime feel free to make any suggestions.

We should consider this blocked on https://github.com/google/osv/issues/290, right?

We should consider this blocked on google/osv#290, right?

Yep, it is blocked on that. Will get to it either today or next week!


Unable to install XHProf extension

The latest phpbrew build is unable to install XHProf extension.
$ phpbrew --version
phpbrew - 1.11.7
cliframework core: 1.5.12

This is what the output looks like:
$ phpbrew ext install xhprof beta
===> Downloading from http://pecl.php.net/get/xhprof-0.9.4.tgz
===> xhprof-0.9.4.tgz downloaded.
===> Extracting xhprof-0.9.4.tgz...
===> Phpizing...
File config.m4 not found, checking config0.m4

It seems the problem is that config.m4 is located not in the root directory of extension. The extension can be installed manually:
$ cd ~/.phpbrew/build/php-5.5.7/ext/xhprof-0.9.4/extension
$ phpize
$ ./configure
$ make
$ make install

@c9s
I tried to do that and I got this:
                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
15 warnings and 20 errors generated```


Cannot import clippings from manually imported books

Hey! First of all, I love your plugin and really appreaciate you've created it.
So the issue I faced with is when I wanna import clippings from a book which was not saved in an official kindle store book, e.g. from a book bundle, or simply I uploaded a manually transformed book (from pdf to epub), the plugin not able to process it. It throws an error:
Uncaught TypeError: Cannot read properties of undefined (reading 'split')
    at Clippings.createFileClippings (plugin:kindle-csv-converter:186:39)
    at eval (plugin:kindle-csv-converter:143:14)
    at HTMLButtonElement.<anonymous> (app.js:1:1464673)

The problem is, that in such case, many times there is no page information and the clipping is saved in the following format:
Perfect Software And Other Illusions About Testing (Weinberg, Gerald)
- Your Highlight at location 219-219 | Added on Saturday, 5 March 2022 11:48:35

Testing gathers information about a product; it does not fix things it finds that are wrong.

on the contrary when the page info is available then it saves like this:
Code That Fits in Your Head (Attila Molnár's Library) (Mark Seemann)
- Your Highlight on page 347 | location 5073-5074 | Added on Thursday, 5 May 2022 06:37:20

A deterministic method without side effects is referentially transparent. It’s also known as a pure function.

It can be resolved to modify the part where you extract the location info

I browsed your code a bit more and found another potential place where the location extraction might go wrong. The place where you define the location in modal_read.ts you assume it will contain a page info, something like: "Your Highlight on page 347" however it in the following format "Your Highlight at location 219-219".
Would be better to match against location \d{1,}-\d{1,}

Hello, I was able to solve the problem by making some changes to these lines. I will keep an eye on that because it might need language support in the future.


Link to full documentation is broken

Hi!
http://jakevdp.github.io/pdvega/ gives error 404
How can I get docs?

Thanks! It's been moved to http://altair-viz.github.io/pdvega/

Fixed in 7476a8a26b2ddf88272839af3549b678e3fa4e62


kitty-themes: init at 2022-01-01

Motivation for this change
Closes https://github.com/NixOS/nixpkgs/issues/153504
Add kitty-themes to the Nix store. Once there, I can use them with home-manager
Things done
This is very basic; copy all the *.conf theme files to Nix store from GitHub
$ find /nix/store/hgjpx52xag0zvcd75w5r78as9qr4ys3z-kitty-themes-2021-01-04
/nix/store/hgjpx52xag0zvcd75w5r78as9qr4ys3z-kitty-themes-2021-01-04
/nix/store/hgjpx52xag0zvcd75w5r78as9qr4ys3z-kitty-themes-2021-01-04/3024_Day.conf
/nix/store/hgjpx52xag0zvcd75w5r78as9qr4ys3z-kitty-themes-2021-01-04/3024_Night.conf
/nix/store/hgjpx52xag0zvcd75w5r78as9qr4ys3z-kitty-themes-2021-01-04/AdventureTime.conf
/nix/store/hgjpx52xag0zvcd75w5r78as9qr4ys3z-kitty-themes-2021-01-04/Afterglow.conf
...

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
22.05 Release Notes (or backporting 21.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

@Luflosi Thank you for your feedback. I've made the changes requested. Add myself to maintainers and ran the check script
❯ ./maintainers/scripts/check-maintainer-github-handles.sh
Academic tradition requires you to cite works you base your article on.
If you use programs that use GNU Parallel to process data for an article in a
scientific publication, please cite:

  Tange, O. (2021, December 22). GNU Parallel 20211222 ('Støjberg').
  Zenodo. https://doi.org/10.5281/zenodo.5797028

This helps funding further development; AND IT WON'T COST YOU A CENT.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.

More about funding GNU Parallel and the citation notice:
https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice

To silence this citation notice: run 'parallel --citation' once.

OK!				NelsonJeppesen

@Luflosi that's a very good point. I've updated to your suggestion
Thank you for the help learning nixpkgs

Oh, wait, I just found another thing. The version should be unstable-2022-01-01 instead of 2022-01-01 because it's a commit and not a real released version.

Oh, wait, I just found another thing. The version should be unstable-2022-01-01 instead of 2022-01-01 because it's a commit and not a real released version.

Roger - updated commit, version and pr

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/prs-ready-for-review/3032/713

Bumped version to last commit on the 3rd; added theme manifest

Thank you @SuperSandro2000 for the review and feedback
I believe I had resolved the issues you have identified


Issues Connection PowerBI Output to Stream Analytics -- Again

I am getting this error "The token provided for 'XXXXX' has either expired or is invalid. Please re-authorize or update the token and try again." My Azure IoT application was working perfectly yesterday, and nothing has been changed. Today my Stream Analytics job PowerBI output is broken. No matter what I do I always get the same error. I have done everything to try to fix it, this is what I have done so far:

Renewed the Authorization
Deleted and recreated the output
Deleted and recreated the Stream Analytics job
Deleted and recreated the PowerBI Workspace
Created a new Stream Analytics job using different Azure and PowerBI account

The same issue was reported in https://github.com/MicrosoftDocs/azure-docs/issues/42020 one year go.
I can see this message in my Stream Analytics job:
Active: At 01:19 AM, Sunday, 22 November 2020 UTC, the Azure monitoring system received the following information regarding your resource AndroidStreamAnalyticsJob: We are sorry, your job is unavailable. We're working to automatically recover your job and to determine the source of the problem.
Is the Azure Stream Analytics service experiencing an outage or something like that? I do not see anything in my Azure health report, though
Still, my IoT application is broken. Is anyone else experiencing the same issue?
Thanks.

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

ID: 42957838-3203-c9b8-a640-1e7cc99219c2
Version Independent ID: cebee8b8-8d8a-7309-f2b9-93f500d3448a
Content: Power BI dashboard integration with Azure Stream Analytics
Content Source: articles/stream-analytics/stream-analytics-power-bi-dashboard.md
Service: stream-analytics
GitHub Login: @JSeb225
Microsoft Alias: jeanb

@javierlarota Thanks for your feedback! We will investigate and update as appropriate.

@javierlarota, Thanks for bringing this to our attention. Currently, I’m working with the product team and get back to you when I have more information.
Stay tuned!

i have the same issue The token provided for 'myalias' has either expired or is invalid. Please re-authorize or update the token and try again.

Same issue here. I'm using MFA, and the same account for both PowerBI and Azure. Though I have several subscriptions attached to the account. Refreshing or even deleting and recreating the job does not fix the issue.

Hi, thanks for reporting this, we are investigating on this issue.

Update on this: the team is still working on this. It seems to affect only new datasets. In the meantime, can you use Managed Identity as a workaround? This way, the token doesn't need to be updated every 90 days.

It is working now. I was able to start my stream analytics jobs successfully. Thank you for your support on this.

@javierlarota  We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.


Getting an ArgumentError missing keywords on Ruby 2.7.3

Describe the bug
After updating dry-container from 0.8.0 to 0.10.0, I'm getting an ArgumentError missing keywords in mixin.rb
dry-container-0.10.0/lib/dry/container/mixin.rb:221:in `key?': wrong number of arguments (given 2, expected 1) (ArgumentError)

My environment

Ruby version: 2.7.3
Rails version: 7.x
OS: Mojave 12.4

Please demonstrate a reproducible case, otherwise, I think this is an issue in your code. Keep in mind, 0.10 can have breaking changes compared to 0.8.

My bad, because when i'm trying use next code:
require 'dry/schema'

Dry::Schema.load_extensions(:hints)

.....

it cause for dry-container here is error

Unfortunately, it's not enough to understand what went wrong. Can you provide a bull backtrace or a sample code that's failing? So that I can reproduce it on my side.

#92  is this relivent to this ?

Dunno but this one should be closed for lack of info 😅


Create About Language Section

Add an ABOUT.md file in the path specified in exercism/x-common#110 to show a new section in the language track: About.

Closed by #115


adding statusbar widgets with registerWidget broken in 2023.1, works in 2022..3

Steps to reproduce:

in plugins view, add plugin -> groovy examples -> toolbar-widget, and run it.

Expected (2022.3):

Fibonacci widget appears in the status bar.

Actual (2023.1):

widget doesn't show up.

Error log:
2023-04-18 14:16:15,761 [  38168]   WARN - #c.i.o.w.i.s.w.StatusBarWidgetsManager - Factory is not registered as com.intellij.statusBarWidgetFactory extension: FibonacciWidget

I suspect the platform change that breaks this is:
https://github.com/JetBrains/intellij-community/commit/71fed7b32d4ee02a59a81401abb73bab07ca18b6#diff-c404cd73f263d833129358683844c48e6232050e4ece46a3665a5b3c2ce421fe

The deprecated method that uses frame.statusBar.addWidget however seems to work.


templates_auto_reload workaround

When jinja was already set up (by having some template filters for
example), modify the jinja_env to it will take the modification into
account.
Otherwise this decorator doesn't do anything in that case
Workaround for #2755, this does not fix the config dict not being taken into account
Link to any relevant issues or pull requests.

I have no idea how to fix this correctly, my best guess would be to modify add_template_filter to reference functions in a specific dict until create_jinja_environment is called

@davidism I can't see the necessary for this use case.

Thanks for working on this. While this fix is technically fine, I'm going to close it as I don't want to keep creating the impression that modifying config after some setup has already run is a good idea. The solution here is to adjust your code so that all configuration loads before setup.


Design Overview (discussion)

Migrated from 'https://github.ibm.com/BPA/qiskit-nature'.
Creator<EMAIL_ADDRESS>Let's use this issue for general discussions which do not fit into a specific issue (yet).
To get this started, here is the updated overview of qiskit_nature.

Creator<EMAIL_ADDRESS>And here is the updated overview UML:

As you can see, through the removal of SecondQuantizedSumOp we can now define all other interfaces dependent on SumOp. This allows the use of any SumOp implementation as a standalone object and the case of SecondQuantizedOperator (when required) can be used by the user with the .map() and .transform() methods which could look similar to this:
def map(self, fermionic_mapper=None, bosonic_mapper=None, spin_mapper=None):
    fermionic_pauli_sum_op = fermionic_mapper.map(self.fermionic)
    bosonic_pauli_sum_op = bosonic_mapper.map(self.bosonic)
    for spin, spin_sum_op in self.spin.items():
         spin_pauli_sum_ops[spin] = spin_mapper.map(spin_sum_op)
    # do whatever post-processing we need to do here...

def transform(self, fermionic_transformer=None, ...):
    # similar to above

Obviously, we can also specify other defaults than None in any of these cases.

Creator<EMAIL_ADDRESS>And here is the updated overview UML:

As you can see, through the removal of SecondQuantizedSumOp we can now define all other interfaces dependent on SumOp. This allows the use of any SumOp implementation as a standalone object and the case of SecondQuantizedOperator (when required) can be used by the user with the .map() and .transform() methods which could look similar to this:
def map(self, fermionic_mapper=None, bosonic_mapper=None, spin_mapper=None):
    fermionic_pauli_sum_op = fermionic_mapper.map(self.fermionic)
    bosonic_pauli_sum_op = bosonic_mapper.map(self.bosonic)
    for spin, spin_sum_op in self.spin.items():
         spin_pauli_sum_ops[spin] = spin_mapper.map(spin_sum_op)
    # do whatever post-processing we need to do here...

def transform(self, fermionic_transformer=None, ...):
    # similar to above

Obviously, we can also specify other defaults than None in any of these cases.


STM32F746 Discovery board support

Made an attempt at adding this myself but ended up making a lot of changes to default package directories which I'm unsure about. I can compile firmware successfully, but upload fails with scons error code 309 (guessing the tool-stlink binaries don't support the processor yet, but managed to get around this using ST's flashing tool and Em::block's STlinkGDB for debugging).
Changes:

To support the Cortex-M7 I updated the toolchain in .platformio/packages/toolchain-gccarmnoneeabi
Added new/changed files to .platformio/packages/framework-cmsis/cores/stm32 from stm32cubef7/Drivers/CMSIS/Include
Added directory .platformio/packages/framework-cmsis/variants/stm32f7 with contents from stm32cubef7/Drivers/CMSIS/Device/ST/STM32F7xx
Added linker script to .platformio/packages/ldscripts/stm32f746ng.ld from stm32cubef7/Projects/STM32746G-Discovery/Templates/SW4STM32/STM32746G_Discovery/STM32F746NGHx_FLASH.ld

And in the repository I added a board definition to platformio/boards/ststm32.json:
"disco_f746ng": {
    "build": {
        "core": "stm32",
        "extra_flags": "-DSTM32F746xx",
        "f_cpu": "216000000L",
        "ldscript": "stm32f746ng.ld",
        "cpu": "cortex-m7",
        "mcu": "stm32f746ngh6",
        "variant": "stm32f7"
    },
    "frameworks": ["cmsis"],
    "name": "ST STM32F7DISCOVERY",
    "platform": "ststm32",
    "upload": {
        "maximum_ram_size": 327680,
        "maximum_size": 1048576
    },
    "url": "http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1858/LN1902/PF260869",
    "vendor": "ST"
},

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28062393-stm32f746-discovery-board-support?utm_campaign=plugin&utm_content=tracker%2F2014790&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2014790&utm_medium=issues&utm_source=github).

To support the Cortex-M7 I updated the toolchain in .platformio/packages/toolchain-gccarmnoneeabi

Which toolchain have you used?

Version 4.9 update 3 from launchpad.

It looks that issue is fixed in PlatformIO 3.0. If it doesn't work, pelase open new issue here https://github.com/platformio/platform-ststm32/issues/new


Better fps experience

To make Sky Of Steel's first person combat better, SoS needs some small quality of live improvements to the HUD to make combat more fun and engaging.
These are small features that you find in all fps games.
What needs to be added:

Hitmarkers (something, usually an X shape, that appeares on your reticle when you hit a shot). We could have different hitmarkers for legshots, bodyshots, and headshots.
Damage Indicator (Circular indicator that appears on your HUD and points to the direction you where shot at from)

I would be happy to implement both these things.

Hitmarkers were planned for 0.1.4 but I just didn't have time (same thing with better recoil which is why the Thunderbolt current has recoil disabled). I intend to make the crosshair flash red before fading back to green via a shader. The complexity is in animating the color back to green so I wasn't able to get it in in time.
As for damage indicators I completely forgot about that entirely. If you'd like to make a PR for it that it would be awesome. (I'm currently on a church youth camp trip)

I'll start working on that!

I should also mention that the FPS combat is rather naive in some ways purposely (for modding purposes) and in other ways out of the necessity of time.

The damage indicators are now in and I'll close this as soon as I add hitmarkers which shouldn't be to difficult.


Highlight should reset colours

The colours used in the highlighting affect the rest of the status bar, which doesn't have specific colours set.
Without the plugin loaded:

With #{prefix_highlight} in the status:

My setting for the right status:
set -g status-right "#{prefix_highlight} %H:%M | %Y-%m-%d "

Hi @arunjit, thanks for reporting the issue.
The commit https://github.com/tmux-plugins/tmux-prefix-highlight/commit/448fc656a13383826249d1a8ea808da5c606d3c7 seems to fix the problem. Would you mind to update and test it again, please?

Yup! This works as expected now, thanks!


Set openshiftVersion value through a CLI flag

The oc version command gives the openshiftVersion value if the
logged-in user (role) has access to get values of clusteroperators
(a cluster scoped resource in the config.openshift.io API group).
A developer may not have these kinds of access to run the chart-verifier.
This solution introduces a command-line flag to set the value of
openshiftVersion.  The flag is --openshift-version (-V as a short
option).  If the user has access to get values of clusteroperators
resource, that value will get precedence over the CLI flag.
Fixes #111

[x] Update documentation

Closes #111


refactor button layouts for mobile, add padding so they are more clickable to mobile

Story details: https://app.clubhouse.io/augur/story/17604

give side bar button some padding
ui improvements for iphone 5/se: hide logged out notification icon cause it pushed login dropdown to side of screen, notification icon needs even padding around it, incr max width on the label

Coverage remained the same at 56.112% when pulling 8e8692ae2d0f55007965034427bccea29611065d on phoebemirman/ch17604/refactor-button-layouts-for-mobile-add-padding into 2d5bce70647513a10667502db6725bca924741ea on master.


Use /mnt/resources as resources path

https://github.com/jaxvanyang/buildpack-deps-ssh-agent/issues/11

Only change the outer path of Docker mount. Still use /resources inside containers.

Only change the outer path of Docker mount. Still use /resources inside containers.

/resources is not avaliable in built-in agent. So refactoring is required.


Generation of doc from xml comments does not work when the type of an argument is a nested class

When generating the doc of an endpoint from xml comments of the method, if the type of an argument of the method is a nested class, the documentation is not properly generated. Here is an example:
using System.Web.Http;

namespace Doc.Controllers
{
    public class DemoController : ApiController
    {
        /// <summary>
        /// My demo endpoint that does not work :-(
        /// </summary>
        public string Get(InternalClass argument)
        {
            return "hello";
        }

        public class InternalClass
        {
            public string Value { get; set; }
        }
    }
}

The problem is in ApplyActionXmlComments.TypeNameFor(...) method. When the type is a nested type, the type name returned does not match what is in the xml documentation. Because of that, the filter does not find the node in the xml documentation and the filter is skipped.

Swashbuckle 5.0.0 released! This issue should now be resolved. Please try it out when you get a chance.

I tried it and it works fine.
Thanks a lot for the super quick fix :-)


Add connection_string to Binding ConnectionDetails

Add connection_string ServiceBinding ConnectionDetails
A naive solution for #60
TODO:

[ ] Add tests

Absorbed by #63


Configuration manager CB should be mentioned instead of 2012 R2

WDATP Onboarding hasn't been introduced in 2012 R2 (released back in 2013). This was done only in ConfigMgr 1910 released in 2019/12

@Yupiter2005 Can you provide a link to the article that this problem stems from? Thank you.

@Yupiter2005 Please feel free to re-open this issue with a clarification about which article this issue stems from. Thank you.


Allow users to specify which plugins they want to build and publish while using Build Tooling for Integrations

Is your feature request related to a problem? Please describe.
After PR #59 is merged, Build Tooling for Integrations will build and publish all plugins in the cmd/plugin directory. There is no way to select which plugins in the directory to build and publish.
Describe the solution you'd like
@sathyanarays wrote in a comment (https://github.com/vmware-tanzu/build-tooling-for-integrations/pull/59#discussion_r1141592764),

... in the docker build targets, we provide an option to select the components by setting some environment variables. If this is true, we need to maintain parity with other make targets, right?

It would be nice to be able to select which plugins are built and published.
Describe alternatives you've considered
I had considered allowing for a flag to be configured that Tanzu CLI Plugin Builder has available for the build command. Here is the help information on that flag:
 --match string              match a plugin name to build, supports globbing (default "*")

However, it does not meet the parity requirement @sathyanarays mentioned as it only allows for choosing plugins that match a string. I think having such an option would only be confusing to users. It would be better not to have the ability to choose rather than have an ability that behaves so differently than building controllers using Build Tooling for Integrations.
Additional context
Tanzu Plugin Builder is maintained at https://github.com/vmware-tanzu/tanzu-cli/tree/main/cmd/plugin/builder
Any changes to the --match or plugin selection ability will need to be done in that repository.

I'm closing this issue as I went ahead and made it so that users are able to specify which plugins they want to build: https://github.com/vmware-tanzu/build-tooling-for-integrations/pull/59


OpenConfig: Error when validating/committing

debian@khn-dev[/]# set devices device r* config interfaces interface test config name test
debian@khn-dev[/]# set devices device r* config interfaces interface test config type iana:ethernetCsmacd
Aug 23 11:13:44: Editing configuration: application invalid-value identityref: "iana:ethernetCsmacd": prefix "iana" has no associated namespace
debian@khn-dev[/]# set devices device r* config interfaces interface test config type ethernetCsmacd
debian@khn-dev[/]# vali
 local                 push                  |
debian@khn-dev[/]# validate p
 |
debian@khn-dev[/]# validate push
Transaction 11 failed Error Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 in state PUSH-VALIDATE of device r2
debian@khn-dev[/]#
debian@khn-dev[/]# commit
Transaction 12 failed Error Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 in state PUSH-VALIDATE of device r1

Getting the same error:
debian@khn-dev[/]# set devices device r* config interfaces interface test config name test
debian@khn-dev[/]# set devices device r* config interfaces interface test config type ethernetCsmacd
debian@khn-dev[/]# validate
debian@khn-dev[/]# validate push
Transaction 6 failed Error Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 in state PUSH-VALIDATE of device r1
debian@khn-dev[/]# commit push
Transaction 7 failed Error Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68 in state PUSH-VALIDATE of device r1
debian@khn-dev[/]#

There are some problems with the use of namespaces in the issue:
The type should have prefix: ianaift: as in:
set devices device openconfig1 config interfaces interface test config type ianaift:ethernetCsmacd
If you use expand it should only offer types with proper prefixes.
However, you can text in a type without prefix, as in: ethernetCsmacd
But then the local validation should fail:
olof@alarik[/]# validate local
Sep 27 10:58:32: Validate failed. Edit and try again or discard changes: application operation-failed Identityref validation failed, ethernetCsmacd not derived from interface-type in ietf-interfaces.yang:68
But if  yang-config is not VALIDATE, ie:
<yang-config>BIND</yang-config>
then local validation will not work, and the error will only bve detected at push as the issue request shows.
Therefore I guess that the target is (1) type is manually texted, (2) yang-config is set to BIND.
set devices device openconfig1 yan
BIND                  NONE                  VALIDATE

As you write, setting yang-config to VALIDATE works. Closing.


options[:no_proxy] has no value

When I tried to use the no_proxy option to bypass the proxy, it didn't delivered it correctly.
It doesn't appear in the initialize function in the client.rb
# Initializes a new Client object
    #
    # @param options [Hash]
    # @return [ZabbixApi::Client]
def initialize(options = {})

      @options = options
      if !ENV['http_proxy'].nil? && options[:no_proxy] != true
        @proxy_uri = URI.parse(ENV['http_proxy'])
        @proxy_host = @proxy_uri.host
        @proxy_port = @proxy_uri.port
        @proxy_user, @proxy_pass = @proxy_uri.userinfo.split(/:/) if @proxy_uri.userinfo
      end
      unless api_version =~ /(2\.4|3\.[02])\.\d+/
        raise ApiError.new("Zabbix API version: #{api_version} is not support by this version of zabbixapi")
      end
      @auth_hash = auth
    end

Have an example of the code you're using and the response?
no_proxy is the default so you shouldn't need to pass that param unless you're needing to deal with a proxy in front of Zabbix

Per Net::Http documentation
Net::HTTP will automatically create a proxy from the http_proxy environment variable if it is present. To disable use of http_proxy, pass nil for the proxy address.

so it seem that if condition
!ENV['http_proxy'].nil? && options[:no_proxy] != true

fails
you want
      if @proxy_uri
        http = Net::HTTP.Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pass).new(uri.host, uri.port)
      else
        http = Net::HTTP.new(uri.host, uri.port, nil)
      end


SourceMap support

TODO:

[x] figure out what sourcemaps actually look like between loaders (seem to be objects, but the end result might be stringified)
[x] serialize source-maps (we serialize them as JSON in case they're objects, otherwise we assume they're strings and write them down normally)
[x] cache source-maps

Can you guys try out #36 and provide some feedback?
I've tested with babel-loader and devtool: 'source-map' and the .js.map file that gets generated is identical between raw webpack and the happy webpack versions, but I do not personally use source-maps so I'm not sure what else there is to test.

Ok I will try

I tried #36 with devtool: 'inline-source-map' in webpack.conf. The result did not change, source-map is there but it's babel transpiled, not original ES6 source.
Without happypack
With happypack

@hanjukim I've just tried it again with a sample React app (and ES6 modules like you've screenshotted) and the source map seems to work fine using both source-map and inline-source-map as devtool values.
Is there any chance you haven't cleared happypack's cache? (try rm -r .happypack/ to do that)

@amireh Oh my bad. Cache might be a problem. I will try again.

@amireh After deleting .happypack cache directory, it is working!! I really appreciate your work.

Great! I have just published 2.1.0 which should contain SourceMap support. Feel free to open a ticket if you find any weirdness around it, but hopefully there'd be none of that.


[stable/sysdig] fix setting env

Is this a new chart
no
What this PR does / why we need it:
allows setting env vars without having to use ebpf
Which issue this PR fixes
fixes #21105
Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Variables are documented in the README.md
[x] Title of the PR starts with chart name (e.g. [stable/mychartname])

/assign @nestorsalceda could you please review? thanks.

@bcg62 lgtm, can you add a changelog entry line to get this merged pls?

@bencer @nestorsalceda CHANGELOG.md updated.
Thanks

thanks!
/lgtm
/approve


Undefined symbol tensorflow::functor::CSRSparseMatrixTranspose

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Arch Linux
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
TensorFlow installed from (source or binary): Source
TensorFlow version: 1.14 (github master aebcf430467918e646c2fb65372bdd9eeb320745)
Python version: 3.7.4
Installed using virtualenv? pip? conda?: pip
Bazel version (if compiling from source): 0.29
GCC/Compiler version (if compiling from source): 8.3.0
CUDA/cuDNN version: 10.1/7.6
GPU model and memory: GTX1070 8GB

Describe the problem
Build process completes without issue, installs without issue. However, after issuing python -c "import tensorflow" the following output is observed
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.7/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.7/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /usr/lib/python3.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so: undefined symbol: _ZN10tensorflow7functor24CSRSparseMatrixTransposeIN5Eigen9GpuDeviceESt7complexIfEEclEPNS_15OpKernelContextEbRKNS_15CSRSparseMatrixEPS9_

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/tensorflow/__init__.py", line 98, in <module>
    from tensorflow_core import *
  File "/usr/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 40, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/usr/lib/python3.7/site-packages/tensorflow/__init__.py", line 50, in __getattr__
    module = self._load()
  File "/usr/lib/python3.7/site-packages/tensorflow/__init__.py", line 44, in _load
    module = _importlib.import_module(self.__name__)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/lib/python3.7/site-packages/tensorflow_core/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/lib/python3.7/site-packages/tensorflow_core/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.7/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.7/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /usr/lib/python3.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so: undefined symbol: _ZN10tensorflow7functor24CSRSparseMatrixTransposeIN5Eigen9GpuDeviceESt7complexIfEEclEPNS_15OpKernelContextEbRKNS_15CSRSparseMatrixEPS9_

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

Provide the exact sequence of commands / steps that you executed before running into the problem
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
./bazel-bin/tensorflow/tools/pip_package/build_pip_package --nightly_flag /tmp/tensorflow_pkg
sudo -H pip install tensorflow_pkg/tf_nightly-1.14.0-cp37-cp37m-linux_x86_64.whl
python -c "import tensorflow"

Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
$ cat .tf_configure.bazelrc
build --action_env PYTHON_BIN_PATH="/usr/bin/python"
build --action_env PYTHON_LIB_PATH="/usr/lib/python3.7/site-packages"
build --python_path="/usr/bin/python"
build:xla --define with_xla_support=true
build --config=xla
build --config=tensorrt
build --action_env TF_CUDA_VERSION="10.1"
build --action_env TF_CUDNN_VERSION="7.6"
build --action_env TF_TENSORRT_VERSION="6.0.1"
build --action_env TF_NCCL_VERSION="2.4.8"
build --action_env TF_CUDA_PATHS="/opt/cuda,/usr"
build --action_env CUDA_TOOLKIT_PATH="/opt/cuda"
build --action_env TF_CUDA_COMPUTE_CAPABILITIES="6.1"
build --action_env GCC_HOST_COMPILER_PATH="/usr/bin/gcc-8"
build --config=cuda
build:opt --copt=-march=native
build:opt --copt=-Wno-sign-compare
build:opt --copt=-mtune=native
build:opt --copt=-O3
build:opt --copt=-fPIC
build:opt --copt=-DNDEBUG
build:opt --host_copt=-march=native
build:opt --define with_default_optimizations=true
build:v2 --define=tf_api_version=2
test --flaky_test_attempts=3
test --test_size_filters=small,medium
test --test_tag_filters=-benchmark-test,-no_oss,-oss_serial
test --build_tag_filters=-benchmark-test,-no_oss
test --test_tag_filters=-gpu
test --build_tag_filters=-gpu
build --action_env TF_CONFIGURE_IOS="0"

Missing symbol is
tensorflow::functor::CSRSparseMatrixTranspose<Eigen::GpuDevice, std::complex<float> >::operator()(tensorflow::OpKernelContext*, bool, tensorflow::CSRSparseMatrix const&, tensorflow::CSRSparseMatrix*)
$ cat /proc/cpuinfo | head -n5
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 23
model		: 8
model name	: AMD Ryzen 7 2700X Eight-Core Processor

Try uninstalling cuda 10.1 and install cuda 10.0 and in addition to that make sure you add cuda, cudnn paths to your environment.
Please, go through below links and see if it helps you.
See #software_requirements
#TensorFlow website

@ravikyram cuda 10.1 isnt the issue (I have built tensorflow from source on other machine with cuda 10.1 without issue). Cuda and cuDNN are in the locations that the configure script found them. All software requirements are met.

Can you try building again with the current maximum supported bazel version, 0.26 (from configure.py)? If the Arch package is too new, you may be able to use Bazelisk: https://github.com/bazelbuild/bazelisk


typo: Double word "command"

@nschonni : Thanks for your contribution! The author, @MightyPen, has been notified to review your proposed change.

@nschonni A third doubled word - 'command'!  This is a day of Public PRs for me to remember.  Thanks again.
#sign-off


libreoffice: Fix pre_install script bug

Fix tiny logical bug in pre_install caused by https://github.com/ScoopInstaller/Scoop/pull/5116 which changed the config name from MSIEXTRACT_USE_LESSMSI to use_lessmsi

Closes #8920

[X] I have read the Contributing Guide.

You are right about the code suggestion, I tested it locally and it passed. But there are a few more issues I would like to add.

Regarding the https://github.com/ScoopInstaller/Extras/issues/8920 issue, I think the cause should be due to the update upstream of scoop, which causes get_config MSIEXTRACT_USE_LESSMSI $false to always return false, even though use_lessmsi has been set to true, and I think this is causing the problem. Maybe we should migrate all the MSIEXTRACT_USE_LESSMSI fields in the codebase to use_lessmsi?
specifying $default with get-config does not cause a new configuration to be created, it just changes the default value returned if the value is taken as null.

I have made some code changes, will you take another look?

I think this picture says something haha

Solve in #9493


courses dashboard doesn't show up

Description
Started an OpenMined course but can't seem to get to my Dashboard. The page keeps loading. Logged in via Github.
How to Reproduce

Go to https://courses.openmined.org/users/dashboard

Expected Behavior
Display of a Dashboard.
Screenshots

System Information

OS: macOS
OS Version: 11.5.1
Browser (if applicable): Firefox
Browser Version (if applicable): 90.0.2

Hi @symabbas , I am able to access the course with firefox version 94.0.2 (64-bit). Try upgrading and see if it works for you.

I am having the same issue here:
macOS Monterey 12.0.1
Browsers:
Safari 15.1
Chrome 96.0.4664.93
Firefox 95.0
The browser is stuck at the spinning wheel. Is there any step we can take to provide additional debugging information?


Add export private key button

There should also be an option to import a private key when creating a signing profile.

https://github.com/yzernik/squeaknode/pull/664
https://github.com/yzernik/squeaknode/pull/666

https://github.com/yzernik/squeaknode/pull/664
https://github.com/yzernik/squeaknode/pull/666


Extreme compression!

Taking this code out for a spin, because I use Python to generate JS code in one application, I loaded a random text file off my system into Python, it was 253990 characters, and ran compress, and got 41993 characters back.  It decompressed fine.  Yay!
But then I tried out  compressToUTF16, and got 8 characters back.  And there seems not to be a decompressFromUTF16!  But I sort of doubt that 8 characters could hold the original file...

Ah, the problem is in the "elif status == 2:" case, where output is assigned with   =   rather than +=

Here's a decompressFromUTF16... sorry, I haven't figured out Pull Requests, etc.
def decompressFromUTF16( self, string ):
    if not string:
         return ""
    output = ""
    status=0
    i = 0

    while i < len( string ):
        c = ord(string[i]) - 32
        i += 1

        if status == 0:
            status = 1
            current = c << 1
        elif status == 1:
            status = 2
            output += chr(current + (c >> 14))
            current = (c & 16383) << 2
        elif status == 2:
            status = 3
            output += chr(current + (c >> 13))
            current = (c & 8191) << 3
        elif status == 3:
            status = 4
            output += chr(current + (c >> 12))
            current = (c & 4095) << 4
        elif status == 4:
            status = 5
            output += chr(current + (c >> 11))
            current = (c & 2047) << 5
        elif status == 5:
            status = 6
            output += chr(current + (c >> 10))
            current = (c & 1023) << 6
        elif status == 6:
            status = 7
            output += chr(current + (c >> 9))
            current = (c & 511) << 7
        elif status == 7:
            status = 8
            output += chr(current + (c >> 8))
            current = (c & 255) << 8
        elif status == 8:
            status = 9
            output += chr(current + (c >> 7))
            current = (c & 127) << 9
        elif status == 9:
            status = 10
            output += chr(current + (c >> 6))
            current = (c & 63) << 10
        elif status == 10:
            status = 11
            output += chr(current + (c >> 5))
            current = (c & 31) << 11
        elif status == 11:
            status = 12
            output += chr(current + (c >> 4))
            current = (c & 15) << 12
        elif status == 12:
            status = 13
            output += chr(current + (c >> 3))
            current = (c & 7) << 13
        elif status == 13:
            status = 14
            output += chr(current + (c >> 2))
            current = (c & 3) << 14
        elif status == 14:
            status = 15
            output += chr(current + (c >> 1))
            current = (c & 1) << 15
        elif status == 15:
            status = 0
            output += chr(current + c)
            current = (c & 1) << 15

    return self.decompress(output);

thanks


Mobile swipe not working

Hey there,
This plugin is great! I can't seem to get the touch gestures to work on mobile though. I have the min.all.js file loaded along with hammer.js.
I'm not sure what the issue is. Thanks in advance for your help!
Page with issue: http://bethblineburydesign.com/about-philadelphia-beth-blinebury-design/beth-blinebury/

I've continued to test this and still no luck on mobile. I've tried older versions of both the tosus.js files with an older version of hammer.js. I even tried setting my jQuery version back and no luck.

Any ideas?

Hi, sorry for the late reply.
I'm not sure why, but after the lightbox opens, the page is redirected to the image itself. Are you running any other scripts that might cause this behavior?

Hey there! I had some outbound link tracking that was disabling the lightbox on all views. That has been removed. However, if you check on mobile, the lightbox continues to not swipe. I'm just not sure what's up with it - any help would be appreciated. Thanks!

Are you getting any errors in the console?
What is alerted if you put this js somewhere:
$(function() {
  alert( $.tosrus.support.touch );
});

I have the same issue as you,
hammerJS working well and "$.tosrus.support.touch" return true in my mobile but, however, swipe function just not working~
please look in to my page and give me some advice... Thanks!
http://<IP_ADDRESS>/0/tosrus/

I am not getting any errors. I'm not sure why it's not working but swipe on mobile is still not functional.

My guess is, HammerJS isn't yet loaded when the drag add-on initializes:
if ( typeof Hammer != 'function' ) {
    return;
}

In other words, HammerJS and Tosrus need to load synchronously.

thanks, it works.

Thanks, that did the trick!


Cannot add Tomcat server from default location

Windows 10, IntelliJ IDEA 2018.1.3 CE, Smart Tomcat 2.5, Tomcat 8.
Problem appears when Tomcat is located in default location in Windows:
C:\Program Files\Apache Software Foundation\Tomcat 8.0
When I try to add Tomcat Server in plugin settings then server name and version are not recognized.

But if I move Tomcat to C:\Tomcat8 folder then addition of the server works fine.
Probably there are some characters in folder path which create a problem.

Similar problem with #12.


Cannot overload public files

Gitea version (or commit ref): 1.1.2
Git version: 2.1.4
Operating system: Debian 8.8
Database (use [x]):

[ ] PostgreSQL
[x] MySQL
[ ] MSSQL
[ ] SQLite

Can you reproduce the bug at https://try.gitea.io:

[ ] Yes (provide example URL)
[x] No
[ ] Not relevant

Log gist:

Description
I got an issue to include custom assets, like my own favicon.png. I tried every combination in the file structure and also played around with the STATIC_ROOT_PATH. I also tried to overload templates or other Images. It is simply not working at all.
My structure:
/home/git/gitea/gitea (executable)
/home/git/gitea/custom/conf/app.ini (is used)
/home/git/gitea/public/img/favicon.png (not used at all)
I'm using an Apache proxy to the outside. But I tried also to directly connect via Port 3000 to the Webgui.
ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/

Ok. Classic fail - gitea was not up to date. Now it's working perfectly. Sorry about that...


UI Docker image doesn't update

Looks like the UI Docker image hasn't updated in a couple of weeks.

If I'm reading the page info correctly, seems as if it has latest been updated to this commit.

I have the impression that the line push: ${{ !env.IS_PR }} from the action is not working, and actually, it should also check matrix.docker.task to not push the base images. I'll look into it when I'm back on January 2nd.

Would be great, as this is currently blocking the new UI deployment to our infra. (But I'm sure there could be ways to go around it.)


improve the gateways error message: Letsencrypt limit has been reached on all gateways.

Letsencrypt limit has been reached on all gateways. The resources you paid for will be re-used in your upcoming deployments.. Use the refresh button on the upper right to restart 3Bot creation

I got this message which actually has nothing to do with letsencrypt limit, it was caused by the csfarmer gateway being down

LetsIncrypt errors shouldn't be an issue as zerossl is now used instead. The final error should be because of misconfigured gateways or gateways not correctly functioning

LetsIncrypt errors shouldn't be an issue as zerossl is now used instead. The final error should be because of misconfigured gateways or gateways not correctly functioning

verified

verified


Attempt to make test_check_shapes__disable__speed[tf.function] less flaky

I'm not happy about doing this, but the TensorFlow compilation time seems to have much higher variance than the difference between with- / without check_shapes.

LGTM since I don't think this existing test is currently testing the speed anyway, but will still sporadically fail and break the build. We should make some valid speed tests soon to test that there isn't a performance regression from using shape checking, maybe make an issue to remind us?


Update all references for PHP7 to 8

semver:minor
@TisVictress  I tried to run the Ruby tests according to https://github.com/paketo-buildpacks/php-dist/blob/main/dependency/actions/compile/binary-builder/README.md however the instructions seem a little broken and I've never used Ruby and copying the commands I could see into the terminal just gave me exceptions I couldn't figure out. Can you please shed some light here?
Summary
Since PHP7 no longer seems to be supported tests should be updated with minimum support versions and all others references should be removed/updated.
Checklist

[x] I have viewed, signed, and submitted the Contributor License Agreement.
[ ] I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
[ n/a] I have added an integration test, if necessary.
[ n/a] I have reviewed the styleguide for guidance on my code quality.
[x ] I'm happy with the commit history on this PR (I have rebased/squashed as needed).

Hey! I'd recommend using the instructions here: https://github.com/paketo-buildpacks/php-dist/blob/main/dependency/actions/compile/README.md
The code inside of that binary-builder directory is famously hard to run locally. @TisVictress is actually working on refactoring that code in #502 already!

@oceanicpanda can we close out this PR?

yep, sorry have been mega busy of late, will try and get back to it


Pathogen doesn't work on Debian Jessie

Hello,
I'm on Debian :
$ uname -a
Linux debian-vm 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u5 (2015-10-09) x86_64 GNU/Linux
$ lsb_release -a
Distributor ID:	Debian
Description:	Debian GNU/Linux 8.2 (jessie)
Release:	8.2
Codename:	jessie

I work with vim 7.4.576
Here what I did to install pathogen :
mkdir ~/.vim/autoload
cd ~/.vim/autoload
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
mkdir ~/.vim/bundle
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git #install nerdtree to test
git clone https://github.com/Yggdroot/indentLine.git #install indentline to test again

And Modify the ~/.vimrc file :
execute pathogen#infect()

" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below.  If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.
set nocompatible

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on
colorscheme delek

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
" set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
"  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
if has("autocmd")
  filetype plugin indent on
endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd		" Show (partial) command in status line.
set showmatch		" Show matching brackets.
set ignorecase		" Do case insensitive matching
set smartcase		" Do smart case matching
set incsearch		" Incremental search
set autowrite		" Automatically save before commands like :next and :make
set hidden		" Hide buffers when they are abandoned
"set mouse=a		" Enable mouse usage (all modes)
set number
set tabstop=4
set shiftwidth=4
set expandtab

let g:indentLine_char = '|'
autocmd vimenter * NERDTree

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif

I tried to insert set nocompatible before the execute but didn't work
I tried call instead of execute.
I tried many things but nothing worked.
The command :set rtp? reply :
runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after

I don't have :help (and nothing else by the way) for the installed plugin.
They are not loaded.
With the same procedure nerdtree work on centos on Linux 2.6.32 and vim 7.2
Any ideas ?

Ok I found !
the line
runtime! debian.vim

In .vimrc refer to the file :
/usr/share/vim/vim74/debian.vim
which contains
" Debian system-wide default configuration Vim

set runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible	" Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start	" more powerful backspacing

" Now we set some defaults for the editor
set history=50		" keep 50 lines of command line history
set ruler		" show the cursor position all the time

" modelines have historically been a source of security/resource
" vulnerabilities -- disable by default, even when 'nocompatible' is set
set nomodeline

" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc

" We know xterm-debian is a color terminal
if &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
  set t_Co=16
  set t_Sf=[3%dm
  set t_Sb=[4%dm
endif

" Some Debian-specific things
if has("autocmd")
  " set mail filetype for reportbug's temp files
  augroup debian
    au BufRead reportbug-*		set ft=mail
  augroup END
endif

" Set paper size from /etc/papersize if available (Debian-specific)
if filereadable("/etc/papersize")
  let s:papersize = matchstr(readfile('/etc/papersize', '', 1), '\p*')
  if strlen(s:papersize)
    exe "set printoptions+=paper:" . s:papersize
  endif
endif

if has('gui_running')
  " Make shift-insert work like in Xterm
  map <S-Insert> <MiddleMouse>
  map! <S-Insert> <MiddleMouse>
endif

So the line
set runtimepath=~/...

redefine the vim runtimepath, and in my .vimrc I put the line
execute pathogen#infect()

On the top of the file before the line
runtime! debian.vim

So the runtimepath define by pathogen is erase.
There is two solutions :
Put the line
execute pathogen#infect()

just below the line
runtime! debian.vim

in the .vimrc file. Or comment the line
set runtimepath=~/...

in the /usr/share/vim/vim74/debian.vim file.

That file is already loaded by the system vimrc. You don't need it in your personal vimrc at all.


chore: Release python sdk-schema v0.2.0

Release protobuf changes introduced with https://github.com/serverless/console/pull/576

@medikoo ready for review 🙏


data_type in matvar_t has incorrect value

Consider a simple MAT file (attached) with a single variable with data type MATRIX (14) and array class INT8.
After calling Mat_VarReadInfo on this variable data_type is equal to 0 (MAT_T_UNKNOWN) and after reading data it is equal to 1 (MAT_T_INT8).
Why isn't it equal to MAT_T_MATRIX which, as you can check in a hex editor, is precisely the value stored in the file?
int8.mat.tar.gz

Duplicate of https://sourceforge.net/p/matio/discussion/609376/thread/1b6bb464/. Ok to close as wontfix?

In my opinion it's not a duplicate. The referenced issue focuses on the fact that Mat_ReadVarInfo doesn't read data_type whereas in this issue I show that even after data_type is populated it has incorrect value. So it seems that right now there is no way in matio to get the original data type of a variable (as stored in the file).
What is the purpose of data_type if not to store the raw value of the Data Type field of a data element? (as the values of enum matio_types suggest)?
I understand that for example for a MAT_T_COMPRESSED variable the actual data type after decompressing is different so maybe in that case Mat_ReadVarInfo could assign MAT_T_COMPRESSED to data_type and then Mat_ReadVar could overwrite this field with the actual data type?

I do not know actually as I neither designed or implemented it. One purpose is, that the desired data type and the actual data type can differ. Question is, if the desired data type is respected by the data class already.


Support deployment for AWS Elastic Beanstalk

What would you like to be added:
Why is this needed:

So excited whenever a new cloud provider is added to our roadmap.


v1.12.7 shows "Content block expected for the "note" directive; none found" with multiple lines of notes

Hello maintainers.
I have a function which has multiple lines of notes, like this:
def func(param1: str) -> None:
    """Do something.

    Args:
        param1: A parameter.

    Note:
        Some notes.
        Some more notes.
    """
    print("Do something")

Using v1.12.7, running sphinx-build throws an error and a warning like this:
ERROR: Content block expected for the "note" directive; none found.
WARNING: Explicit markup ends without a blank line; unexpected unindent.

Debugging with -vv option, logs show how the method is converted. Seems :rtype: is inserted in a wrong place.
.. py:function:: func(param1)
   :module: pykit.grpc

   Do something.

   :type param1: :py:class:`str`
   :param param1: A parameter.

   .. note::
   :rtype: :py:obj:`None`

      Some notes.
      Some more notes.

This code works fine with v1.12.1, but fails with v1.12.7.
A function with one line of notes works fine with both versions.
Is this an expected or unexpected behavior?

Is this an expected or unexpected behavior?

Unexpected. Thanks for the report!

This is another problem caused by docutils being inconsistent about adding line numbers to things. I added an upstream bug report:
https://sourceforge.net/p/docutils/bugs/465/
For now we can just patch it.

@hoodmane Thank you for the quick fix! Would it be possible to release a patch version (v1.12.8)?


Make the image zoomable, based on the images size.

Is your feature request related to a problem?
I have a full page image. the problem is, that you can not see much, without zooming in.
That is why I hoped this plugin would change that, but If I click the image to open it in the lightbox, it overflows the container and is not readable, and the container is not scrollable. It would be good, to have a zoom, that is calculated by the size of the image, like the one in chrome.

Overflow:

Describe the solution you'd like
If i open the image url in another tab and zoom with chrome I get this result, which is what I hoped this plugin could do:

Describe alternatives you've considered
Writing my own plugin.
Additional Context
No response

Thanks for your feedback :raised_hands:
Indeed, this plugin is closer to what is usually called, afaik, the "Medium zoom" effect rather than the one you are referring to and I think I'm leaning towards keeping it that way. I may re-visit this in the future based on the feedback I get and maybe provide more options for the user to choose from (I think the original behavior would not change).
Regarding the effect you are referring to, I guess PhotoSwipe would be closer to what you are looking for. If this is the case, I'm also linking some references for it with Astro: "Astro + PhotoSwipe" guide and an example repo of it.


Division bug?

This hangs with 100% CPU on my machine:
(read "1.0" :: Scientific) / (read "6.0" :: Scientific)

Have I stumbled on a bug in division, or parsing, or am I doing something wrong? It only happens with certain numbers. For example "4.0" instead of "6.0" works.

Never mind, this is what fromRationalRepetend is for right?

1/6 is a repeating decimal: 0.1(6). Since a Scientific stores the actual decimal digits representing an infinite number of them takes infinite time and space.
Indeed use fromRationalRepetend. Do note that this function consumes space linear in the number of digits in the resulting scientific. For 0.1(6) that's not a problem though since the repetition starts very early.
Can you tell a bit more about your use-case?


Temporary fix for refresh loop

Description

Types of changes

Checklist

[x] I have read the CONTRIBUTING doc
[x] I have checked that unit tests pass locally with my changes
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] I have added necessary documentation (if appropriate)

Further comments

PR Deployed at: https://comfort-dev.apps.silver.devops.gov.bc.ca/pr-165