SqlAGDatabase: Fix impersonate permission test

Pull Request (PR) description
When adding a database to an AG using SqlAGDatabase and the MatchDatabaseOwner switch, it checks for an IMPERSONATE ANY LOGIN permission.
That permission doesn't exist until SQL 2014. There are two other alternatives that exist on SQL Server 2012 (and also exist in higher versions):

CONTROL SERVER (also granted as part of the sysadmin server role) permission
IMPERSONATE  permission

This PR adds checks for the two additional permissions if the IMPERSONATE ANY LOGIN permission doesn't exist. It also fixes code coverage for New-TerminatingError as I noticed that wasn't right.
I raised this previously but the PR became too out of date to maintain. To address some of the comments of the time:
Re: SqlServerDscHelper.psm1 about $testLoginEffectPermissionsParams

Could we actually call the existing helper function Get-SqlInstanceMajorVersion to know what the major version is and only call this if the version is 2014 or newer?"

The query that tests the permissions works fine even on lower versions so no change is necessary.

We should not be using $ServerObject.InstanceName?

It's copy-paste of what was there previously.
ServiceName is not the service name. For default instances it's MSSQLSERVER where InstanceName is blank. For non-default instances both are the same.
Invoke-Query depends on InstanceName being MSSQLSERVER instead of blank so it has to stay as-is.

Curious. Did the MatchDatabaseOwner parameter even work before since it never referenced the actual owner of the databases?

It would work in limited circumstances such as SQL 2014 and above, with IMPERSONATE ANY LOGIN permission (and possibly even more).
The reason I say "and possibly more" is that the RESTORE FULL is done under the impersonated account but then RESTORE LOG wasn't. This causes the process to fail even with the IMPERSONATE ANY LOGIN unless it has yet another another high level permission. This has all been fixed.
Re: Tests/Unit/SqlServerDSCHelper.Tests.ps1 about mocking

If we instead mock the call to Test-LoginEffectivePermissions then we should be able to use a ParameterFilter on two different Assert-MockCalled to filter out that we actually call 'Impersonate..' and 'COntrol...' once each.
I think mocking Test-LoginEffectivePermissions would also simplify this test, and give better control testing this helper function?

Test-LoginEffectivePermissions only gets called once, it then executes Invoke-Query one or more times to determine if the permissions are present; which is why that is mocked instead.
If I didn't do this and just mocked Test-LoginEffectivePermissions then nothing would change and my code wouldn't be covered by the test, and so PR would have reduced code coverage.
Re: Other comments about style and updating documentation.
I believe these are all done.
Further testing
I built a separate test rig to confirm this all works correctly on an actual instance. I ran it on my 5-node lab which can be built with my OftenOn PowerShell module and the script executed in a PowerShell admin console on CHWK01 to reproduce.
This separate test is pretty huge and in this gist so as not to clutter up the PR but the final bit which is captured in the gif is easy enough to understand..

Confirms SqlAGDatabase works on 2012
Confirms SqlAGDatabase fails on 2012 when MatchDatabaseOwner is used
Confirms SqlAGDatabase gets restored on 2012 with the correct owner when MatchDatabaseOwner is used

It's checking the return bool from Invoke-DscResource and also who the owner is on the databases.

This Pull Request (PR) fixes the following issues

Fixes #1237

Task list

[X] Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
Entry should say what was changed, and how that affects users (if applicable).
[X] Resource documentation added/updated in README.md.
[X] Resource parameter descriptions added/updated in README.md, schema.mof
and comment-based help.
[X] Comment-based help added/updated.
[X] Localization strings added/updated in all localization files as appropriate.
[ ] Examples appropriately added/updated.
[X] Unit tests added/updated. See DSC Resource Testing Guidelines.
[ ] Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
[X] New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is

Codecov Report

Merging #1295 into dev will decrease coverage by 1%.
The diff coverage is 96%.

@@         Coverage Diff          @@
##            dev   #1295   +/-   ##
====================================
- Coverage    97%     96%   -2%
====================================
  Files        35      35
  Lines      4374    4411   +37
====================================
- Hits       4269    4255   -14
- Misses      105     156   +51

I can run the tests locally without issue and seemingly the code works with my separate test outside of the framework.
I haven't been able to find any remaining reason for the AppVeyor SqlAGDatabase tests to fail. I'll need some pointers on debugging it.

Can you please look at the failing tests
https://ci.appveyor.com/project/PowerShell/sqlserverdsc/builds/22691108/job/674q6197a3wkr9a7?fullLog=true#L615

I don't know why those tests are failing. I had this problem locally until I fixed the TypeName in ConnectionContext (which is part of the change).
I wonder if AppVeyor is somehow stale. I'll try closing and re-opening the PR to trigger another rebuild.

Any idea how I can investigate this further? I can't reproduce the failure locally.

You can debug in the appveyor build worker if you can’t reproduce it locally. See the AppVeyor documentation
https://www.appveyor.com/docs/how-to/rdp-to-build-worker/

My update is that I still have yet to work out why this is happening or reproduce it locally. As a guess I believe it's related to the funny business in #239 and #774.

I found the cause of the test failures. The Pester mock parameter filters fail because the Linux line endings on the build machine don't match the rest of PowerShell. It was never an issue before because each line of the existing code ended in a wildcard. By adding a line without a wildcard the mock would be skipped and try to connect to an actual server.
Anyway this is ready for review once the latest build passes.

@codykonior Can you double check the tests I commented on? It looks like the are the same? Otherwise it is all good now! 😄

@codykonior Awesome work on this! This one is merged now. 😄


MobSpawnGroupHelper.toMinecraftClass() is making worlds take a lot longer to load, optimization suggestion inside

In a current setup I have, it's taking about 40 seconds to load a world in singleplayer, got impatient and had a peek with visualvm to see where the majority of the work is happening.
Found 2 cases where the string replace work in MobSpawnGroupHelper.toMinecraftClass is REALLY adding up.
I'm sure theres lots of higher level optimizations that could be done but I can't be certain where and how without more analysis. At a minimum I would suggest you process the entries of EntityList.getEntityNameList() and store your own version of it to lookup, and then use that to compare against in MobSpawnGroupHelper.toMinecraftClass instead of the string replace work every time.
Here are the 2 cases in visualvm where it is used, adding up to about 20 seconds of a 43 second world load:

Hey @Corosauce, that's very helpful, thanks! What kind of world were you using for these tests, was it using a lot of configs with a lot of mob spawning settings?

Have added a cache in v7_DEV_r23 so each name is only queried once, will be in the v7 release. Performance optimisation is one of the last big things I'm doing for the v7 release for Forge, so if you have any more recommendations, please let me know :). Thanks again!

I didnt setup the server myself but have been helping with it randomly, I believe its Biome Bundle via OTG, here is the modlist: https://gist.github.com/Corosauce/74431be080c93fdf1adab7bdcadbe62f
Speedy followup, nice!
I was debugging the client trying to find some performance issues a week or 2 ago and might have spotted some things, but I wasnt sure if they were worthy of posting, but I might as well, ill open another issue for client related possible problems.


Failing to load on macOS, Cura 1.4

What happened
Installing the script doesn't do anything - it errors at line 274 because macOS doesn't support subprocess.STARTUPINFO
What did you expect to happen
The script works
How to reproduce
Install the script on Cura 1.4, macOS 13.0.1
Additional information
No response

Seemingly fixed!


Segmentation fault in keras.backend.temporal_padding

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
TensorFlow installed from (source or binary): binary
TensorFlow version (use command below): v2.2.0-rc4-8-g2b96f3662b 2.2.0
Python version: 3.7.6
Bazel version (if compiling from source): N/A
GCC/Compiler version (if compiling from source): N/A
CUDA/cuDNN version: N/A
GPU model and memory: N/A

Describe the current behavior
Segfault occurs when passing the tuple of large values for padding.
Describe the expected behavior
No segfault.
Standalone code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/Jupyter/any notebook.
import tensorflow as tf

x = [[[3, 2, 3],
        [1, 3, 4]],

       [[3, 1, 2],
        [3, 2, 4]],

       [[4, 4, 2],
        [1, 1, 1]]]
padding =<PHONE_NUMBER>,<PHONE_NUMBER>)

tf.keras.backend.temporal_padding(x, padding)

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.
Segmentation fault (core dumped)

Was able to reproduce the issue with TF v2.2 and TF-nightly. Please find the gist of it here. Thanks!

Was able to reproduce the issue  using TF 2.5 and colab crashes as expected. Please find the gist here.Thanks!

@mjkim720 It is working as expected when the padding is within a range. However, when passing large padding as in your example, padding =<PHONE_NUMBER>,<PHONE_NUMBER>), segfault occurs as it couldn't allocate such a high memory.
Please note that temporal_padding pads zeros at the start and end of dim 1.
For example, if the input tensor is of shape (3, 2, 3), passing a padding of (2,2) results in a tensor of shape (3, 6, 3). In your case, the resulting tensor is of shape (3,2640991303,3) which requires huge memory. Thanks!


Provide dragged files as StorageFile when possible

Resolved / Related Issues
Items resolved / related issues by this PR.

Closes #6697

Details of Changes
Add details of changes here.

Provide dragged files as StorageFile when possible. Fixes dropping to some UWP apps, e.g Snip and Sketch.

Validation
How did you test these changes?

[x] Built and ran the app

@gave92 Do you test it with any app that didn't work with last Files release? I've tested with Email app and it doesn't work with this commit nor the last release.

I've tried with snip & sketch. Without this PR is not working, could you confirm? I'll take a look to the main app.

I've tried with snip & sketch. Doesn't work on main but it's working with this PR, could you confirm? I'll take a look to the Email app.

@gave92 Yep, I have your same result (last release not working but your PR does).


The quality of comparision_data.json seems not good

I'm exploring the comparision_data.json dataset and found that the completion_a is not always good than completion_b (often not).  According to the introduction of comparision_data.json, completion_a is ranked higher.
Is there anyone feels the same ?
Here is an example, which is the second instance in this dataset. I think completion_b is better than completion_a.
{
"user_input": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nWhat are the three primary colors?\n\n### Response:",
"completion_a": "The three primary colors are red, blue, and yellow.",
"completion_b": "The three primary colors are red, blue, and yellow. These colors are called primary because they cannot be created by mixing other colors and all other colors can be made by combining them in various proportions. In the additive color system, used for light, the primary colors are red, green, and blue (RGB)."
}

updated the comparion data. Please check it out.


Idea Dump: Redirect to rdrr.io

If books generated by bookdown have code chunks with R functions, they will link to rdrr.io. I don't know if OTTR-generated courses do this. If they do, we should redirect to another website that doesn't have ads because they are too distracting!

Notes

Found the manual for functions from the base package. Linking to base::mean is preferred over the rdrr site for base::mean


Acc Yaw and Pitch data is werid.

I using last version of config.
#Electrics Eagles conifg

encoding=utf-8

[pid-config]
# roll PID settings
p_pid_roll= 1.3
i_pid_roll= 0.04
d_pid_roll= 18.0
max_roll= 400

# Yaw PID settings
p_pid_yaw=4.0
i_pid_yaw=0.02
d_pid_yaw=0.0
max_yaw=400
# Pitch PID settings

p_pid_pitch=1.3
i_pid_pitch=0.04
d_pid_pitch = 18.0
max_pitch=400

[esc]
port="/dev/i2c-1"
reversed_direction=no

[imu]
port="/dev/i2c-3"
axis_assignment_gyro=yxz
reversed_axis_gyro=nnn
axis_assignment_acc=xyz
reversed_axis_acc=nnn

[auto-level]
autolevel="off"

# Software Alpha - Beta Filter
[filter]
conf_a=0.1
conf_b=0.1

[reciver]
port="/dev/ttySC0"
baudrate=115200

[batterycontroller]
port="/dev/i2c-4"
maximum_voltage_ch0=16.4
maximum_voltage_ch1=10.07
maximum_voltage_ch2=6.15
maximum_voltage_ch3=2.048

and I run software in debug mode :
pielectricseagles --test_imu

The software for plotting graphs is used . (Electrics Eagles Telemetry app or SerialPlot
So I was tilt the drone forward as on video...
https://user-images.githubusercontent.com/20460747/151074856-fd95e347-1dda-43b0-89da-aae014804d97.mp4

https://user-images.githubusercontent.com/20460747/151075161-ca10e3dc-a2ae-4a85-919c-f3817b9fa1c2.mp4

Fix : https://nightly.link/Electrics-Eagles/PiElectricsEagles-dev/actions/artifacts/150716811.zip

https://nightly.link/Electrics-Eagles/PiElectricsEagles-dev/actions/artifacts/150745322.zip


Request for guidance

Please add some guidance about what we should do when we get "Query partially succeeded; results may be incomplete or incorrect." after running a workbook.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: eb2155a4-d8b2-a542-1aba-387183c3f2e3
Version Independent ID: 11565414-4093-d4cf-2665-1343b45a732a
Content: Azure Monitor workbooks for reports
Content Source: articles/active-directory/reports-monitoring/howto-use-azure-monitor-workbooks.md
Service: active-directory
Sub-service: report-monitor
GitHub Login: @MarkusVi
Microsoft Alias: markvi

@DeanGross
Thanks for your feedback! I've assigned this issue to the author who will investigate and update as appropriate.

I have updated the article.
#please-close


Support providing an alternative URL base for media paths

Individual builds of the site should not require uploading (accessing) the entire media repository in a sibling directory to other site files (i.e, as a subdirectory under the site root, whether symlinked or recursively copied/uploaded).
Therefore, when building the site, it should be possible to specify an alternate base for media files. For now we can just assume an external base follows the same directory structure as the typical media/ directory, i.e. no custom mapping function is needed (but in the future this could be implemented, if a desired CDN has its own URL schema).
If provided, we'll require(*) that the provided URL base is absolute, ex. https://media.hsmusic.wiki/. It may also specify a directory to act as the root path, ex. https://hsmusic.wiki/media/.
(*) Note: this is to make programming more simple—it's not necessary to code something which is relative or doesn't include the URL unless we specifically want to support uploading one exact build to multiple locations, which isn't a goal I'm tying this feature with right now. "Deploy to multiple locations" is kind of non-specific and less interesting to me than "create a fully-offline, single-download build", which is already covered by just copying the media folder into the output directory (within a zip archive).
(This is "dev friendliness" because - personally for me - it makes running a distinct preview site, with its own locale builds like es and not fudging "preview-en", easier lol.)

Possibly related to #11 but I need to figure out what the frick that issue was even talking about.

This'll be nice to have after #196 — running thumbnail generation an altogether different (local) server could prove useful for testing and development.


Adds GeographyPoint data type for lat/long data (incomplete)

I started working on #460, adding geolocation point support to Serverpod.
I got this partially implemented, but then ran into problems, and I had too many unanswered questions about how Serverpod is currently implemented, or how it would need to be changed to finish this PR. I don't have enough time to finish this, so I'll submit this here in the hopes somebody else will finish it (and I'll have to just use manual SQL queries for now, yet again!).
The questions I ran up against:

How should the toString method in _GeographyDistanceColumnExpression work, given this is not a simple case of an operator?
How do I make a FilterConstraint which takes two parameters, not just one value? (I need to be able to filter using "where distance from point X is less than Y km"), whereas FilterConstraint seems to only take one parameter)
How do I get orderBy to take a parameter? (I need "order by distance from point X", whereas the current orderBy API lets you specify just a column, and then ascending or descending, but not an additional parameter)

Considerations for use:

You have to index GeographyDistance columns using index type type: gist
You have to upgrade the Postgres Docker version to one that has the postgis extension, using:

  postgres:
    image: postgis/postgis:16-3.4

Really neat that you started looking into it and noted down additional questions you ran up against, great to get the exploration going.
This is a great feature I personally would love to add support for in Serverpod.
An additional question is if this should be part of the Serverpod main package or if it would it be possible to formulate it as a module? And if possible, would it make sense from a developer perspective to separate it?

It's such a common usecase, and (based on my attempt to implement this) will require deep enough changes to Serverpod, that I don't think it could be implemented as a module, assuming that it's supposed to work with the current Serverpod query API.
There is another column type I need too, which has very similar API needs -- the vector type, implemented by the pgvector Postgres extension, for querying vector data (the queries are basically the same, requiring distance from a query vector rather than distance from a query geodetic). Querying vector data for the nearest neighbors is massively useful in anything powered by machine learning these days.

Closing as solution is incomplete.
Will add a reference to this PR in the issue tracking the feature and once it is implemented, if this was used as inspiration, @lukehutch should be credited as a co-author.


[turborepo] Concurrency option not ignored when Parallel execution flag is set

What version of Turborepo are you using?
1.8.4 - 1.8.8
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Describe the Bug
According to the docs, the --concurrency option will be ignored if the --parallel flag is also passed.
Since turborepo v1.8.4, this is no longer the behavior. Setting the --parallel CLI flag does not disable the --concurrency setting when a task is persistent.
In a project with more than 10 packages, the following error message is presented for a task with the option "persistent": true:
ERROR  run failed: error preparing engine: Invalid persistent task configuration:
You have {N} persistent tasks but `turbo` is configured for concurrency of 10. Set --concurrency to at least {N+1}

Expected Behavior
Setting --parallel should override the --concurrency option.
This was the existing behavior in turborepo v1.8.3
To Reproduce
Execute a --parallel task in a workspace with >10 packages and "persistent": true in the task's settings
Reproduction Repo
No response

We also bumped into this issue after migrating turbo from v1.7 to 1.9

Looks like we weren't checking for --parallel before doing some validation. I'll see if we can fix that quickly: #5191


Link to external sources for vendor scripts

Fixes #94

Instead of doing this, I'd much rather pack the externals with the example.js. I'm working on a commit that should fix that, please stay tuned!

Fixed in 895f7b3748639c1b5dd55124dc56c1f7c2a85162


Add lexingtonma.txt

You should add your University/School website here for faster review

@TerryTran Updated -- thanks.


Full source code contained in release build

I'm new to electron, so I may be missing something, so please forgive me if this does not make any sense. I've check out v0.10.0, and I've found, that the release build which gets created by npm run package actually contains the whole repo directory including the source code in AppBundle->Contents->Resources->app. I feel like this can't really be intentional can it?

Could be mistaken, but I'm pretty sure that's just the way Electron is.

It could be removed. I'll add this to our release 0.11.0 release in #504

Thanks. @Slapbox: The sources actually used will be contained in the 'compiled' bundle.js and are therefore somewhat obfuscated. The source code does not need to be included and most people building a non-open-source app will probably not want it to be included.

Also, before I forget, a big thanks for maintaining this and giving me an easy start in to the electron world!


WindowsError: [Error 2] The system cannot find the file specified.

Robot Framework 3.0 (Python 2.7.11 on win32)
When "Click Image" is called, button OK is clicked, but framework logs WindowsError.
I suspect some logging issue....
------------------------------------------------------------------------------
Hit OK                                                                | FAIL |
WindowsError: [Error 2] The system cannot find the file specified.
------------------------------------------------------------------------------

file.robot
*** Settings ***
Library     ImageHorizonLibrary
*** Test Cases ***
Hit OK
    Wait For    ok
    Click Image ok

What Windows do you have?

It was issue ion Windows 7. I have new laptop.
It is fine on Windows 10. Can be closed as not reproduced.


Roboto Light cannot be embedded in PowerPoint 2016

I turned on font embedding in a presentation, but I got this message when saving.

Where did you download that copy of Roboto from?

@davelab6 I downloaded from Google Fonts and then also this repository.


German building parsing issue

Hi!
I was checking out libpostal, and saw something that could be improved.

My country is
Germany

Here's how I'm using libpostal
Have own instance.

Here's what I did
{ 	"query": "charles de gaulle str. geb. 5467" }

Here's what I got
[ 	{ 		"label": "road", 		"value": "charles de gaulle str." 	}, 	{ 		"label": "house_number", 		"value": "geb." 	}, 	{ 		"label": "postcode", 		"value": "5467" 	} ]

Here's what I was expecting
[ 	{ 		"label": "road", 		"value": "charles de gaulle str." 	}, 	{ 		"label": "unit", 		"value": "geb. 5467" 	} ]
like in
{ 	"query": "charles de gaulle str. bldg 5467" }
-->
[ 	{ 		"label": "road", 		"value": "charles de gaulle str." 	}, 	{ 		"label": "unit", 		"value": "bldg 5467" 	} ]
or
[ 	{ 		"label": "road", 		"value": "charles de gaulle str." 	}, 	{ 		"label": "house", 		"value": "geb. 5467" 	} ]
like in
{ 	"query": "Charles de Gaulle Str. 67 Geb. 5467" }
-->
[ 	{ 		"label": "road", 		"value": "charles de gaulle str." 	}, 	{ 		"label": "house_number", 		"value": "67" 	}, 	{ 		"label": "house", 		"value": "geb. 5467" 	} ]

For parsing issues, please answer "yes" or "no" to all that apply.

Does the input address exist in OpenStreetMap?
no

Do all the toponyms exist in OSM (city, state, region names, etc.)?
yes

If the address uses a rare/uncommon format, does changing the order of the fields yield the correct result?
yes
{   "query": "geb. 5467 charles de gaulle str." }
-->
[   {   	"label": "house",   	"value": "geb. 5467"   },   {   	"label": "road",   	"value": "charles de gaulle str."   } ]

If the address does not contain city, region, etc., does adding those fields to the input improve the result?
no (checked with Germany, Berlin, Bonn)

If the address contains apartment/floor/sub-building information or uncommon formatting, does removing that help? Is there any minimum form of the address that gets the right parse?
yes
{   "query": "charles de gaulle str." }
-->
[   {   	"label": "road",   	"value": "charles de gaulle str."   } ]

and
{ 	"query": "geb. 5467" }
-->
[ 	{ 		"label": "house", 		"value": "geb. 5467" 	} ]

Here's what I think could be improved
Don't know what to improve, but responses for splitted request are different than for full request in this case.

Added support for ged/gebäude for German addresses in #392. But even if the PR is accepted, it will take months to re-run the pipeline. For now I suggest you to manually find such cases and remove any occurrences of 'geb.' before sending calling libpostal. I did the same when had problems with Dutch postal code with and without space - 2331SK / 2331 SK.