问:
Where can I get the colors for the built-in themes for SharePoint Online?
Please note this pertains to Sharepoint Online Themes only, not older versions or on-premises.

Specifically, my manager wants a dark theme and we want to use the "Dark Blue" theme as a base for it. I can pull the colors for custom themes, but the built-in themes do not seem to be accessible with SPO Powershell get-spotheme or other methods i can find. Since it is a publically available theme, I did not expect it to be too difficult to get the information.  I found this link https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-theming/sharepoint-site-theming-json-schema which is supposed to show the default theme colors, but when i create my own from it and add/apply, it is not even close to the current "Dark Blue" theme. The theme.spcolor and theme.sptheme file created on application i can get, but they use a different color and format.

RANT: Microsoft really does not make this user friendly, which seems like a poor oversight on their part since users often think things are better when they LOOK better. Even the Theme Generator found here appears to be broken (along with lots of old broken links) and you cannot scroll to view and confirm without using dev tools to edit page. https://fluentuipr.z22.web.core.windows.net/heads/master/theming-designer/index.html

Theme files pulled directly from site /_catalogs/Theme after applied and files created by SP show base slot colors but they are in an odd format starting with ff? I think i can take the ff off and that should be the  hex values but not entirely sure it will be accurate. Would prefer to get the actual theme as it currently exists like you would use for add-spotheme/get-spotheme - unsure it the additional colors are extrapolated colors from applying a theme or if i should/can include them in a theme i create for with add-spotheme. ANY ADVICE APPRECIATED

Theme.sptheme Dark Blue

```<code><?xml version="1.0" encoding="utf-8"?>
<s:theme xmlns:s="http://schemas.microsoft.com/sharepoint/"
  name="Dark Blue"
  colorPaletteUrl="theme.spcolor" />
</code>```

Theme.spcolor Dark Blue

```<code><?xml version="1.0" encoding="utf-8"?>
<s:colorPalette isInverted="true" previewSlot1="BackgroundOverlay" previewSlot2="BodyText" previewSlot3="AccentText" xmlns:s="http://schemas.microsoft.com/sharepoint/">
  <s:color name="themePrimary" value="ff3a96dd" />
  <s:color name="themeLighterAlt" value="ff020609" />
  <s:color name="themeLighter" value="ff091823" />
  <s:color name="themeLight" value="ff112d43" />
  <s:color name="themeTertiary" value="ff235a85" />
  <s:color name="themeSecondary" value="ff3385c3" />
  <s:color name="themeDarkAlt" value="ff4ba0e1" />
  <s:color name="themeDark" value="ff65aee6" />
  <s:color name="themeDarker" value="ff8ac2ec" />
  <s:color name="accent" value="ff3a96dd" />
  <s:color name="neutralLighterAlt" value="ff1d2b3c" />
  <s:color name="neutralLighter" value="ff223244" />
  <s:color name="neutralLight" value="ff2b3d51" />
  <s:color name="neutralQuaternaryAlt" value="ff324459" />
  <s:color name="neutralQuaternary" value="ff374a5f" />
  <s:color name="neutralTertiaryAlt" value="ff4f637a" />
  <s:color name="neutralTertiary" value="ffc8c8c8" />
  <s:color name="neutralSecondary" value="ffd0d0d0" />
  <s:color name="neutralPrimaryAlt" value="ffdadada" />
  <s:color name="neutralPrimary" value="ffffffff" />
  <s:color name="neutralDark" value="fff4f4f4" />
  <s:color name="black" value="fff8f8f8" />
  <s:color name="white" value="ff182534" />
  <s:color name="primaryBackground" value="ff182534" />
  <s:color name="primaryText" value="ffffffff" />
  <s:color name="HyperlinkActive" value="ff8ac2ec" />
  <s:color name="CommandLinksPressed" value="ff8ac2ec" />
  <s:color name="NavigationPressed" value="ff8ac2ec" />
  <s:color name="EmphasisHoverBorder" value="ff8ac2ec" />
  <s:color name="TopBarPressedText" value="ff8ac2ec" />
  <s:color name="HeaderNavigationPressedText" value="ff8ac2ec" />
  <s:color name="Hyperlinkfollowed" value="ff8ac2ec" />
  <s:color name="EmphasisHoverBackground" value="ff65aee6" />
  <s:color name="EmphasisBorder" value="ff65aee6" />
  <s:color name="AccentText" value="ff3a96dd" />
  <s:color name="CommandLinksHover" value="ff3a96dd" />
  <s:color name="RowAccent" value="ff3a96dd" />
  <s:color name="NavigationAccent" value="ff3a96dd" />
  <s:color name="NavigationHover" value="ff3a96dd" />
  <s:color name="EmphasisBackground" value="ff3a96dd" />
  <s:color name="HeaderNavigationHoverText" value="ff3a96dd" />
  <s:color name="HeaderNavigationSelectedText" value="ff3a96dd" />
  <s:color name="SuiteBarBackground" value="ff3a96dd" />
  <s:color name="Hyperlink" value="ff3a96dd" />
  <s:color name="ContentAccent1" value="ff3a96dd" />
  <s:color name="AccentLines" value="ff3385c3" />
  <s:color name="HeaderAccentLines" value="ff3385c3" />
  <s:color name="ButtonPressedBorder" value="ff3385c3" />
  <s:color name="SuiteBarHoverBackground" value="ff235a85" />
  <s:color name="StrongLines" value="ff112d43" />
  <s:color name="HeaderStrongLines" value="ff112d43" />
  <s:color name="SuiteBarHoverText" value="ff112d43" />
  <s:color name="ButtonPressedBackground" value="ff112d43" />
  <s:color name="ButtonHoverBorder" value="ff112d43" />
  <s:color name="ButtonHoverBackground" value="ff091823" />
  <s:color name="SelectionBackground" value="7f112d43" />
  <s:color name="HoverBackground" value="7f091823" />
  <s:color name="NavigationHoverBackground" value="7f091823" />
  <s:color name="PageBackground" value="ff182534" />
  <s:color name="EmphasisText" value="ff182534" />
  <s:color name="SuiteBarText" value="ff182534" />
  <s:color name="TileText" value="ff182534" />
  <s:color name="BackgroundOverlay" value="d8182534" />
  <s:color name="HeaderBackground" value="d8182534" />
  <s:color name="FooterBackground" value="d8182534" />
  <s:color name="DisabledBackground" value="ff1d2b3c" />
  <s:color name="HeaderDisabledBackground" value="ff1d2b3c" />
  <s:color name="ButtonBackground" value="ff1d2b3c" />
  <s:color name="ButtonDisabledBackground" value="ff1d2b3c" />
  <s:color name="SubtleEmphasisBackground" value="ff223244" />
  <s:color name="DialogBorder" value="ff223244" />
  <s:color name="NavigationSelectedBackground" value="c62b3d51" />
  <s:color name="TopBarBackground" value="c62b3d51" />
  <s:color name="DisabledLines" value="ff2b3d51" />
  <s:color name="HeaderDisabledLines" value="ff2b3d51" />
  <s:color name="ButtonDisabledBorder" value="ff2b3d51" />
  <s:color name="SuiteBarDisabledText" value="ff2b3d51" />
  <s:color name="SubtleLines" value="ff4f637a" />
  <s:color name="HeaderSubtleLines" value="ff4f637a" />
  <s:color name="ButtonGlyphDisabled" value="ff4f637a" />
  <s:color name="DisabledText" value="ffc8c8c8" />
  <s:color name="CommandLinksDisabled" value="ffc8c8c8" />
  <s:color name="HeaderDisableText" value="ffc8c8c8" />
  <s:color name="ButtonDisabledText" value="ffc8c8c8" />
  <s:color name="Lines" value="ffc8c8c8" />
  <s:color name="HeaderLines" value="ffc8c8c8" />
  <s:color name="ButtonBorder" value="ffc8c8c8" />
  <s:color name="CommandLinks" value="ffd0d0d0" />
  <s:color name="Navigation" value="ffd0d0d0" />
  <s:color name="SubtleEmphasisText" value="ffd0d0d0" />
  <s:color name="TopBarText" value="ffd0d0d0" />
  <s:color name="HeaderNavigationText" value="ffd0d0d0" />
  <s:color name="ButtonGlyph" value="ffd0d0d0" />
  <s:color name="BodyText" value="ffffffff" />
  <s:color name="WebPartHeading" value="ffffffff" />
  <s:color name="HeaderText" value="ffffffff" />
  <s:color name="ButtonText" value="ffffffff" />
  <s:color name="ButtonGlyphActive" value="ffffffff" />
  <s:color name="TopBarHoverText" value="ffffffff" />
  <s:color name="StrongBodyText" value="fff4f4f4" />
  <s:color name="SiteTitle" value="fff4f4f4" />
  <s:color name="CommandLinksSecondary" value="fff4f4f4" />
  <s:color name="SubtleEmphasisCommandLinks" value="fff4f4f4" />
  <s:color name="HeaderSiteTitle" value="fff4f4f4" />
  <s:color name="TileBackgroundOverlay" value="7ff8f8f8" />
  <s:color name="ContentAccent2" value="ff00485b" />
  <s:color name="ContentAccent3" value="ff288054" />
  <s:color name="ContentAccent4" value="ff767956" />
  <s:color name="ContentAccent5" value="ffed0033" />
  <s:color name="ContentAccent6" value="ff682a7a" />
</s:colorPalette>
</code>```

normal format for sp application via powershell is like the below:

```<code>#DARK BLUE BUILT IN – wrong/old
$themeDB1 = @{
  “themePrimary: '#00bcf2',
  themeLighterAlt: '#00090c',
  themeLighter: '#001318',
  themeLight: '#002630',
  themeTertiary: '#005066',
  themeSecondary: '#00abda',
  themeDarkAlt: '#0ecbff',
  themeDark: '#44d6ff',
  themeDarker: '#6cdfff',
  neutralLighterAlt: '#2e3340',
  neutralLighter: '#353a49',
  neutralLight: '#404759',
  neutralQuaternaryAlt: '#474e62',
  neutralQuaternary: '#4c546a',
  neutralTertiaryAlt: '#646e8a',
  neutralTertiary: '#c8c8c8',
  neutralSecondaryAlt: '#d0d0d0',
  neutralSecondary: '#dadada',
  neutralPrimaryAlt: '#eaeaea',
  neutralPrimary: '#ffffff',
  neutralDark: '#f4f4f4',
  black: '#f8f8f8',
  white: '#262a35',
  primaryBackground: '#262a35',
  primaryText: '#ffffff',
  error: '#ff5f5f',
  accent: '#3a96dd'
}
Add-SPOTheme -Identity "FedPoint Dark Blue 1" -Palette $themeDB1 -IsInverted $true -Overwrite
#(from what i can tell -isinverted $true is for Dark background themes, but i have not had much luck `testing it as yet)
</code>```

attempted to pull themes, only able to pull custom themes.

attempted to pull files created on theme application, not in same format and some info may be extrapolated at time of theme application with colors using different values than expected.

attempted to use disclosed MS Theme colors listed, but color values do not match actual current values when applied as a test theme.

UPDATE

Changed format to PowerShell accepted format

Removed first two letters of each color and replaced with #

replaced "themePrimary"="#3a96dd” with bright blue "themePrimary"="#2489ed”;

Replaced "themeLight"="#112d43"; with navy "themeLight"="#00308f"; This allows it to be selected as header and section background, may be too busy for our needs, considering creating two Dark Mode themes instead

It is likely most things after black/white are not in use as they are not in the FLUENT theme generator, but not sure since microsoft does not seem to want to document SharePoint Online Themes well

NOTE: May want to simply remove any with alpha not equal to FF (opaque)

Code I ended up using is:

```<code>$themeDB2 = @{
"themePrimary"="#2489ed";
  "themeLighterAlt"="#020609";
  "themeLighter"="#091823";
  "themeLight"="#00308f";
  "themeTertiary"="#235a85";
  "themeSecondary"="#3385c3";
  "themeDarkAlt"="#4ba0e1";
  "themeDark"="#65aee6";
  "themeDarker"="#8ac2ec";
  "accent"="#2489ed";
  "neutralLighterAlt"="#1d2b3c";
  "neutralLighter"="#223244";
  "neutralLight"="#2b3d51";
  "neutralQuaternaryAlt"="#324459";
  "neutralQuaternary"="#374a5f";
  "neutralTertiaryAlt"="#4f637a";
  "neutralTertiary"="#c8c8c8";
  "neutralSecondary"="#d0d0d0";
  "neutralPrimaryAlt"="#dadada";
  "neutralPrimary"="#ffffff";
  "neutralDark"="#f4f4f4";
  "black"="#f8f8f8";
  "white"="#182534";
  "primaryBackground"="#182534";
  "primaryText"="#ffffff";
  "HyperlinkActive"="#8ac2ec";
  "CommandLinksPressed"="#8ac2ec";
  "NavigationPressed"="#8ac2ec";
  "EmphasisHoverBorder"="#8ac2ec";
  "TopBarPressedText"="#8ac2ec";
  "HeaderNavigationPressedText"="#8ac2ec";
  "Hyperlinkfollowed"="#8ac2ec";
  "EmphasisHoverBackground"="#65aee6";
  "EmphasisBorder"="#65aee6";
  "AccentText"="#2489ed";
  "CommandLinksHover"="#2489ed";
  "RowAccent"="#2489ed";
  "NavigationAccent"="#2489ed";
  "NavigationHover"="#2489ed";
  "EmphasisBackground"="#2489ed";
  "HeaderNavigationHoverText"="#2489ed";
  "HeaderNavigationSelectedText"="#2489ed";
  "SuiteBarBackground"="#2489ed";
  "Hyperlink"="#2489ed";
  "ContentAccent1"="#2489ed";
  "AccentLines"="#3385c3";
  "HeaderAccentLines"="#3385c3";
  "ButtonPressedBorder"="#3385c3";
  "SuiteBarHoverBackground"="#235a85";
  "StrongLines"="#112d43";
  "HeaderStrongLines"="#112d43";
  "SuiteBarHoverText"="#112d43";
  "ButtonPressedBackground"="#112d43";
  "ButtonHoverBorder"="#112d43";
  "ButtonHoverBackground"="#091823";
  "SelectionBackground"="#112d43";
  "HoverBackground"="#091823";
  "NavigationHoverBackground"="#091823";
  "PageBackground"="#182534";
  "EmphasisText"="#182534";
  "SuiteBarText"="#182534";
  "TileText"="#182534";
  "BackgroundOverlay"="#182534";
  "HeaderBackground"="#182534";
  "FooterBackground"="#182534";
  "DisabledBackground"="#1d2b3c";
  "HeaderDisabledBackground"="#1d2b3c";
  "ButtonBackground"="#1d2b3c";
  "ButtonDisabledBackground"="#1d2b3c";
  "SubtleEmphasisBackground"="#223244";
  "DialogBorder"="#223244";
  "NavigationSelectedBackground"="#2b3d51";
  "TopBarBackground"="#2b3d51";
  "DisabledLines"="#2b3d51";
  "HeaderDisabledLines"="#2b3d51";
  "ButtonDisabledBorder"="#2b3d51";
  "SuiteBarDisabledText"="#2b3d51";
  "SubtleLines"="#4f637a";
  "HeaderSubtleLines"="#4f637a";
  "ButtonGlyphDisabled"="#4f637a";
  "DisabledText"="#c8c8c8";
  "CommandLinksDisabled"="#c8c8c8";
  "HeaderDisableText"="#c8c8c8";
  "ButtonDisabledText"="#c8c8c8";
  "Lines"="#c8c8c8";
  "HeaderLines"="#c8c8c8";
  "ButtonBorder"="#c8c8c8";
  "CommandLinks"="#d0d0d0";
  "Navigation"="#d0d0d0";
  "SubtleEmphasisText"="#d0d0d0";
  "TopBarText"="#d0d0d0";
  "HeaderNavigationText"="#d0d0d0";
  "ButtonGlyph"="#d0d0d0";
  "BodyText"="#ffffff";
  "WebPartHeading"="#ffffff";
  "HeaderText"="#ffffff";
  "ButtonText"="#ffffff";
  "ButtonGlyphActive"="#ffffff";
  "TopBarHoverText"="#ffffff";
  "StrongBodyText"="#f4f4f4";
  "SiteTitle"="#f4f4f4";
  "CommandLinksSecondary"="#f4f4f4";
  "SubtleEmphasisCommandLinks"="#f4f4f4";
  "HeaderSiteTitle"="#f4f4f4";
  "TileBackgroundOverlay"="#f8f8f8";
  "ContentAccent2"="#00485b";
  "ContentAccent3"="#288054";
  "ContentAccent4"="#767956";
  "ContentAccent5"="#ed0033";
  "ContentAccent6"="#682a7a";
}
Add-SPOTheme -Identity "Dark Mode Blue 1" -Palette $themeDB2 -IsInverted $true -Overwrite
</code>```

Body:
Please note this pertains to Sharepoint Online Themes only, not older versions or on-premises.

Specifically, my manager wants a dark theme and we want to use the "Dark Blue" theme as a base for it. I can pull the colors for custom themes, but the built-in themes do not seem to be accessible with SPO Powershell get-spotheme or other methods i can find. Since it is a publically available theme, I did not expect it to be too difficult to get the information.  I found this link https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-theming/sharepoint-site-theming-json-schema which is supposed to show the default theme colors, but when i create my own from it and add/apply, it is not even close to the current "Dark Blue" theme. The theme.spcolor and theme.sptheme file created on application i can get, but they use a different color and format.

RANT: Microsoft really does not make this user friendly, which seems like a poor oversight on their part since users often think things are better when they LOOK better. Even the Theme Generator found here appears to be broken (along with lots of old broken links) and you cannot scroll to view and confirm without using dev tools to edit page. https://fluentuipr.z22.web.core.windows.net/heads/master/theming-designer/index.html

Theme files pulled directly from site /_catalogs/Theme after applied and files created by SP show base slot colors but they are in an odd format starting with ff? I think i can take the ff off and that should be the  hex values but not entirely sure it will be accurate. Would prefer to get the actual theme as it currently exists like you would use for add-spotheme/get-spotheme - unsure it the additional colors are extrapolated colors from applying a theme or if i should/can include them in a theme i create for with add-spotheme. ANY ADVICE APPRECIATED

Theme.sptheme Dark Blue

<?xml version="1.0" encoding="utf-8"?>
<s:theme xmlns:s="http://schemas.microsoft.com/sharepoint/"
  name="Dark Blue"
  colorPaletteUrl="theme.spcolor" />

Theme.spcolor Dark Blue

<?xml version="1.0" encoding="utf-8"?>
<s:colorPalette isInverted="true" previewSlot1="BackgroundOverlay" previewSlot2="BodyText" previewSlot3="AccentText" xmlns:s="http://schemas.microsoft.com/sharepoint/">
  <s:color name="themePrimary" value="ff3a96dd" />
  <s:color name="themeLighterAlt" value="ff020609" />
  <s:color name="themeLighter" value="ff091823" />
  <s:color name="themeLight" value="ff112d43" />
  <s:color name="themeTertiary" value="ff235a85" />
  <s:color name="themeSecondary" value="ff3385c3" />
  <s:color name="themeDarkAlt" value="ff4ba0e1" />
  <s:color name="themeDark" value="ff65aee6" />
  <s:color name="themeDarker" value="ff8ac2ec" />
  <s:color name="accent" value="ff3a96dd" />
  <s:color name="neutralLighterAlt" value="ff1d2b3c" />
  <s:color name="neutralLighter" value="ff223244" />
  <s:color name="neutralLight" value="ff2b3d51" />
  <s:color name="neutralQuaternaryAlt" value="ff324459" />
  <s:color name="neutralQuaternary" value="ff374a5f" />
  <s:color name="neutralTertiaryAlt" value="ff4f637a" />
  <s:color name="neutralTertiary" value="ffc8c8c8" />
  <s:color name="neutralSecondary" value="ffd0d0d0" />
  <s:color name="neutralPrimaryAlt" value="ffdadada" />
  <s:color name="neutralPrimary" value="ffffffff" />
  <s:color name="neutralDark" value="fff4f4f4" />
  <s:color name="black" value="fff8f8f8" />
  <s:color name="white" value="ff182534" />
  <s:color name="primaryBackground" value="ff182534" />
  <s:color name="primaryText" value="ffffffff" />
  <s:color name="HyperlinkActive" value="ff8ac2ec" />
  <s:color name="CommandLinksPressed" value="ff8ac2ec" />
  <s:color name="NavigationPressed" value="ff8ac2ec" />
  <s:color name="EmphasisHoverBorder" value="ff8ac2ec" />
  <s:color name="TopBarPressedText" value="ff8ac2ec" />
  <s:color name="HeaderNavigationPressedText" value="ff8ac2ec" />
  <s:color name="Hyperlinkfollowed" value="ff8ac2ec" />
  <s:color name="EmphasisHoverBackground" value="ff65aee6" />
  <s:color name="EmphasisBorder" value="ff65aee6" />
  <s:color name="AccentText" value="ff3a96dd" />
  <s:color name="CommandLinksHover" value="ff3a96dd" />
  <s:color name="RowAccent" value="ff3a96dd" />
  <s:color name="NavigationAccent" value="ff3a96dd" />
  <s:color name="NavigationHover" value="ff3a96dd" />
  <s:color name="EmphasisBackground" value="ff3a96dd" />
  <s:color name="HeaderNavigationHoverText" value="ff3a96dd" />
  <s:color name="HeaderNavigationSelectedText" value="ff3a96dd" />
  <s:color name="SuiteBarBackground" value="ff3a96dd" />
  <s:color name="Hyperlink" value="ff3a96dd" />
  <s:color name="ContentAccent1" value="ff3a96dd" />
  <s:color name="AccentLines" value="ff3385c3" />
  <s:color name="HeaderAccentLines" value="ff3385c3" />
  <s:color name="ButtonPressedBorder" value="ff3385c3" />
  <s:color name="SuiteBarHoverBackground" value="ff235a85" />
  <s:color name="StrongLines" value="ff112d43" />
  <s:color name="HeaderStrongLines" value="ff112d43" />
  <s:color name="SuiteBarHoverText" value="ff112d43" />
  <s:color name="ButtonPressedBackground" value="ff112d43" />
  <s:color name="ButtonHoverBorder" value="ff112d43" />
  <s:color name="ButtonHoverBackground" value="ff091823" />
  <s:color name="SelectionBackground" value="7f112d43" />
  <s:color name="HoverBackground" value="7f091823" />
  <s:color name="NavigationHoverBackground" value="7f091823" />
  <s:color name="PageBackground" value="ff182534" />
  <s:color name="EmphasisText" value="ff182534" />
  <s:color name="SuiteBarText" value="ff182534" />
  <s:color name="TileText" value="ff182534" />
  <s:color name="BackgroundOverlay" value="d8182534" />
  <s:color name="HeaderBackground" value="d8182534" />
  <s:color name="FooterBackground" value="d8182534" />
  <s:color name="DisabledBackground" value="ff1d2b3c" />
  <s:color name="HeaderDisabledBackground" value="ff1d2b3c" />
  <s:color name="ButtonBackground" value="ff1d2b3c" />
  <s:color name="ButtonDisabledBackground" value="ff1d2b3c" />
  <s:color name="SubtleEmphasisBackground" value="ff223244" />
  <s:color name="DialogBorder" value="ff223244" />
  <s:color name="NavigationSelectedBackground" value="c62b3d51" />
  <s:color name="TopBarBackground" value="c62b3d51" />
  <s:color name="DisabledLines" value="ff2b3d51" />
  <s:color name="HeaderDisabledLines" value="ff2b3d51" />
  <s:color name="ButtonDisabledBorder" value="ff2b3d51" />
  <s:color name="SuiteBarDisabledText" value="ff2b3d51" />
  <s:color name="SubtleLines" value="ff4f637a" />
  <s:color name="HeaderSubtleLines" value="ff4f637a" />
  <s:color name="ButtonGlyphDisabled" value="ff4f637a" />
  <s:color name="DisabledText" value="ffc8c8c8" />
  <s:color name="CommandLinksDisabled" value="ffc8c8c8" />
  <s:color name="HeaderDisableText" value="ffc8c8c8" />
  <s:color name="ButtonDisabledText" value="ffc8c8c8" />
  <s:color name="Lines" value="ffc8c8c8" />
  <s:color name="HeaderLines" value="ffc8c8c8" />
  <s:color name="ButtonBorder" value="ffc8c8c8" />
  <s:color name="CommandLinks" value="ffd0d0d0" />
  <s:color name="Navigation" value="ffd0d0d0" />
  <s:color name="SubtleEmphasisText" value="ffd0d0d0" />
  <s:color name="TopBarText" value="ffd0d0d0" />
  <s:color name="HeaderNavigationText" value="ffd0d0d0" />
  <s:color name="ButtonGlyph" value="ffd0d0d0" />
  <s:color name="BodyText" value="ffffffff" />
  <s:color name="WebPartHeading" value="ffffffff" />
  <s:color name="HeaderText" value="ffffffff" />
  <s:color name="ButtonText" value="ffffffff" />
  <s:color name="ButtonGlyphActive" value="ffffffff" />
  <s:color name="TopBarHoverText" value="ffffffff" />
  <s:color name="StrongBodyText" value="fff4f4f4" />
  <s:color name="SiteTitle" value="fff4f4f4" />
  <s:color name="CommandLinksSecondary" value="fff4f4f4" />
  <s:color name="SubtleEmphasisCommandLinks" value="fff4f4f4" />
  <s:color name="HeaderSiteTitle" value="fff4f4f4" />
  <s:color name="TileBackgroundOverlay" value="7ff8f8f8" />
  <s:color name="ContentAccent2" value="ff00485b" />
  <s:color name="ContentAccent3" value="ff288054" />
  <s:color name="ContentAccent4" value="ff767956" />
  <s:color name="ContentAccent5" value="ffed0033" />
  <s:color name="ContentAccent6" value="ff682a7a" />
</s:colorPalette>

normal format for sp application via powershell is like the below:

#DARK BLUE BUILT IN – wrong/old
$themeDB1 = @{
  “themePrimary: '#00bcf2',
  themeLighterAlt: '#00090c',
  themeLighter: '#001318',
  themeLight: '#002630',
  themeTertiary: '#005066',
  themeSecondary: '#00abda',
  themeDarkAlt: '#0ecbff',
  themeDark: '#44d6ff',
  themeDarker: '#6cdfff',
  neutralLighterAlt: '#2e3340',
  neutralLighter: '#353a49',
  neutralLight: '#404759',
  neutralQuaternaryAlt: '#474e62',
  neutralQuaternary: '#4c546a',
  neutralTertiaryAlt: '#646e8a',
  neutralTertiary: '#c8c8c8',
  neutralSecondaryAlt: '#d0d0d0',
  neutralSecondary: '#dadada',
  neutralPrimaryAlt: '#eaeaea',
  neutralPrimary: '#ffffff',
  neutralDark: '#f4f4f4',
  black: '#f8f8f8',
  white: '#262a35',
  primaryBackground: '#262a35',
  primaryText: '#ffffff',
  error: '#ff5f5f',
  accent: '#3a96dd'
}
Add-SPOTheme -Identity "FedPoint Dark Blue 1" -Palette $themeDB1 -IsInverted $true -Overwrite
#(from what i can tell -isinverted $true is for Dark background themes, but i have not had much luck `testing it as yet)

attempted to pull themes, only able to pull custom themes.

attempted to pull files created on theme application, not in same format and some info may be extrapolated at time of theme application with colors using different values than expected.

attempted to use disclosed MS Theme colors listed, but color values do not match actual current values when applied as a test theme.

UPDATE

Changed format to PowerShell accepted format

Removed first two letters of each color and replaced with #

replaced "themePrimary"="#3a96dd” with bright blue "themePrimary"="#2489ed”;

Replaced "themeLight"="#112d43"; with navy "themeLight"="#00308f"; This allows it to be selected as header and section background, may be too busy for our needs, considering creating two Dark Mode themes instead

It is likely most things after black/white are not in use as they are not in the FLUENT theme generator, but not sure since microsoft does not seem to want to document SharePoint Online Themes well

NOTE: May want to simply remove any with alpha not equal to FF (opaque)

Code I ended up using is:

$themeDB2 = @{
"themePrimary"="#2489ed";
  "themeLighterAlt"="#020609";
  "themeLighter"="#091823";
  "themeLight"="#00308f";
  "themeTertiary"="#235a85";
  "themeSecondary"="#3385c3";
  "themeDarkAlt"="#4ba0e1";
  "themeDark"="#65aee6";
  "themeDarker"="#8ac2ec";
  "accent"="#2489ed";
  "neutralLighterAlt"="#1d2b3c";
  "neutralLighter"="#223244";
  "neutralLight"="#2b3d51";
  "neutralQuaternaryAlt"="#324459";
  "neutralQuaternary"="#374a5f";
  "neutralTertiaryAlt"="#4f637a";
  "neutralTertiary"="#c8c8c8";
  "neutralSecondary"="#d0d0d0";
  "neutralPrimaryAlt"="#dadada";
  "neutralPrimary"="#ffffff";
  "neutralDark"="#f4f4f4";
  "black"="#f8f8f8";
  "white"="#182534";
  "primaryBackground"="#182534";
  "primaryText"="#ffffff";
  "HyperlinkActive"="#8ac2ec";
  "CommandLinksPressed"="#8ac2ec";
  "NavigationPressed"="#8ac2ec";
  "EmphasisHoverBorder"="#8ac2ec";
  "TopBarPressedText"="#8ac2ec";
  "HeaderNavigationPressedText"="#8ac2ec";
  "Hyperlinkfollowed"="#8ac2ec";
  "EmphasisHoverBackground"="#65aee6";
  "EmphasisBorder"="#65aee6";
  "AccentText"="#2489ed";
  "CommandLinksHover"="#2489ed";
  "RowAccent"="#2489ed";
  "NavigationAccent"="#2489ed";
  "NavigationHover"="#2489ed";
  "EmphasisBackground"="#2489ed";
  "HeaderNavigationHoverText"="#2489ed";
  "HeaderNavigationSelectedText"="#2489ed";
  "SuiteBarBackground"="#2489ed";
  "Hyperlink"="#2489ed";
  "ContentAccent1"="#2489ed";
  "AccentLines"="#3385c3";
  "HeaderAccentLines"="#3385c3";
  "ButtonPressedBorder"="#3385c3";
  "SuiteBarHoverBackground"="#235a85";
  "StrongLines"="#112d43";
  "HeaderStrongLines"="#112d43";
  "SuiteBarHoverText"="#112d43";
  "ButtonPressedBackground"="#112d43";
  "ButtonHoverBorder"="#112d43";
  "ButtonHoverBackground"="#091823";
  "SelectionBackground"="#112d43";
  "HoverBackground"="#091823";
  "NavigationHoverBackground"="#091823";
  "PageBackground"="#182534";
  "EmphasisText"="#182534";
  "SuiteBarText"="#182534";
  "TileText"="#182534";
  "BackgroundOverlay"="#182534";
  "HeaderBackground"="#182534";
  "FooterBackground"="#182534";
  "DisabledBackground"="#1d2b3c";
  "HeaderDisabledBackground"="#1d2b3c";
  "ButtonBackground"="#1d2b3c";
  "ButtonDisabledBackground"="#1d2b3c";
  "SubtleEmphasisBackground"="#223244";
  "DialogBorder"="#223244";
  "NavigationSelectedBackground"="#2b3d51";
  "TopBarBackground"="#2b3d51";
  "DisabledLines"="#2b3d51";
  "HeaderDisabledLines"="#2b3d51";
  "ButtonDisabledBorder"="#2b3d51";
  "SuiteBarDisabledText"="#2b3d51";
  "SubtleLines"="#4f637a";
  "HeaderSubtleLines"="#4f637a";
  "ButtonGlyphDisabled"="#4f637a";
  "DisabledText"="#c8c8c8";
  "CommandLinksDisabled"="#c8c8c8";
  "HeaderDisableText"="#c8c8c8";
  "ButtonDisabledText"="#c8c8c8";
  "Lines"="#c8c8c8";
  "HeaderLines"="#c8c8c8";
  "ButtonBorder"="#c8c8c8";
  "CommandLinks"="#d0d0d0";
  "Navigation"="#d0d0d0";
  "SubtleEmphasisText"="#d0d0d0";
  "TopBarText"="#d0d0d0";
  "HeaderNavigationText"="#d0d0d0";
  "ButtonGlyph"="#d0d0d0";
  "BodyText"="#ffffff";
  "WebPartHeading"="#ffffff";
  "HeaderText"="#ffffff";
  "ButtonText"="#ffffff";
  "ButtonGlyphActive"="#ffffff";
  "TopBarHoverText"="#ffffff";
  "StrongBodyText"="#f4f4f4";
  "SiteTitle"="#f4f4f4";
  "CommandLinksSecondary"="#f4f4f4";
  "SubtleEmphasisCommandLinks"="#f4f4f4";
  "HeaderSiteTitle"="#f4f4f4";
  "TileBackgroundOverlay"="#f8f8f8";
  "ContentAccent2"="#00485b";
  "ContentAccent3"="#288054";
  "ContentAccent4"="#767956";
  "ContentAccent5"="#ed0033";
  "ContentAccent6"="#682a7a";
}
Add-SPOTheme -Identity "Dark Mode Blue 1" -Palette $themeDB2 -IsInverted $true -Overwrite


来源: stackexchange

问:
In GCP how do you configure DNS peering between VPCs in different organizations?
I would like to configure DNS peering to allow my SaaS application to provide DNS records for a customer. The GCP documentation states that one of the use cases for a peering zone is for:

"a SaaS provider can give a SaaS customer access to DNS records it manages"

The issue I am facing is that, by default, a peering zone can only be associated with a project within the same organization. I would like to have the customer in Organization A create a peering zone that points to the DNS records in my SaaS Organization B. How do I configure this peering? Is there a way to grant this access through IAM policies?

I have been reading the GCP docs related to DNS peering and IAM and have been unable to find out how to make cross-organization DNS peering work.

ContentLicense: CC BY-SA 4.0


问:
How to change player's displayname?
I'm making a client-side mod and need to change the display name (name that hovers over the player's head) For reference: I need to change the names of other players (that do not use the mod), NOT my name that other players see.

I've already looked through all related classes on the net. Minecraft. client. But haven't found anything that renders the display name.

If anyone has any idea about that class, tell me, please. I've spent three days looking for it with no results.

Title: How to change player's displayname?


问:
java.sql.SQLSyntaxErrorException Unidentified Syntax Error
I've been staring at the issue for the past 2 hours with no avial. There apparently is an error with my sql query but I can't seem to find the issue.

Thanks in advance.

MySQL version:
8.0.31

Java:
openjdk version "17.0.5" 2022-10-18

The sql query i'm running:

```<code>INSERT INTO users (name, age, comment, dob, email, addres) VALUES ('Jane', '48', 'coOUtqEHqY',  2015-05-145 07:47:09, '5Xi1Jdd5LrgMkU8xMv5@outlook.com', 'Suite 638 58920 Loree Path, Port Georgettechester, IL 06836');
</code>```

Error:

```<code>java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '07:47:09, '5Xi1Jdd5LrgMkU8xMv5@outlook.com', 'Suite 638 58920 Loree Path, Port G' at line 1
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1334)
        at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2084)
        at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245)
        at com.dbautomation.database.DBConnection.insertSQL(DBConnection.java:56)
        at com.dbautomation.database.DBActions.insertCols(DBActions.java:53)
        at com.dbautomation.App.main(App.java:61)
</code>```

SQL query for the table:

```<code> create table users (
user_id int not null auto_increment,
name varchar(100) not null, age int,
comment varchar(255), dob DATE,
email varchar(255),
addres varchar(255),
primary key (user_id));
</code>```

Table Description:

I've tried putting the date col value surrounded in single quotes but I get the error of:

```<code>MysqlDataTruncation: Data truncation: Incorrect date value: ' 2008-06-160 11:09:11' for column 'dob' at row 1
</code>```

I'm aware that address is misspelled, but that is the correct column name.

Body:
I've been staring at the issue for the past 2 hours with no avial. There apparently is an error with my sql query but I can't seem to find the issue.

Thanks in advance.

MySQL version:
8.0.31

Java:
openjdk version "17.0.5" 2022-10-18

The sql query i'm running:

INSERT INTO users (name, age, comment, dob, email, addres) VALUES ('Jane', '48', 'coOUtqEHqY',  2015-05-145 07:47:09, '5Xi1Jdd5LrgMkU8xMv5@outlook.com', 'Suite 638 58920 Loree Path, Port Georgettechester, IL 06836');

Error:

java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '07:47:09, '5Xi1Jdd5LrgMkU8xMv5@outlook.com', 'Suite 638 58920 Loree Path, Port G' at line 1
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1334)
        at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2084)
        at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245)
        at com.dbautomation.database.DBConnection.insertSQL(DBConnection.java:56)
        at com.dbautomation.database.DBActions.insertCols(DBActions.java:53)
        at com.dbautomation.App.main(App.java:61)

SQL query for the table:

 create table users (
user_id int not null auto_increment,
name varchar(100) not null, age int,
comment varchar(255), dob DATE,
email varchar(255),
addres varchar(255),
primary key (user_id));

Table Description:

I've tried putting the date col value surrounded in single quotes but I get the error of:

MysqlDataTruncation: Data truncation: Incorrect date value: ' 2008-06-160 11:09:11' for column 'dob' at row 1

I'm aware that address is misspelled, but that is the correct column name.


问:
How to get mpfr package on Spyder (python 3.9) win64
I need bigfloat package to work for my program. When I downloaded and put it into the correct folder, the console now says this when I try to start the program:

ModuleNotFoundError: No module named 'mpfr'

I tried downloading this module, however, I cannot get Spyder to see it, and the INSTALL file, which is in the folders I downloaded, only specifies a way to install mpfr on Linux.

I also tried to install this module through the Spyder kernel component, and this simply said:

pip install mpfr
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement mpfr (from versions: none)
ERROR: No matching distribution found for mpfr

When I attempted to download mpfr from conda forge, it said everything was done, and threw no errors, this however did not solve my problem.

I also found that mpfr needs GNU to work, but I found that only in .lz file and the internet tells me that cannot be unzipped on windows. I however did not encounter any errors regarding this, as I did not get that far. May be irrelevant.

I use Spyder 5.3.3 with Anaconda3.
I have Windows 11 Home.


问:
Flutter api calls oauth_signature HMAC-SHA1 generation
I am trying to make an API call to my server everything works properly on postman but I can't seem to get it going on Flutter

```<code>                      String oauthConsumer ='oauth_consumer_key=[MyKey]';
                      String oauthNonce =
                          'oauth_nonce=${Random().nextInt(4294967296).toString()}';
                      String oauthCallback =
                          'oauth_callback=[MyCallback address]';
                      String oauthVersion = 'oauth_version=1.0';
                      String oauthTime =
                          'oauth_timestamp=${(DateTime.now().millisecondsSinceEpoch ~/ 1000).toString()}';
                      String oauthMethod = 'oauth_signature_method=HMAC-SHA1';

                      var oauthList = [
                        oauthCallback,
                        oauthConsumer,
                        oauthNonce,
                        oauthMethod,
                        oauthTime,
                        oauthVersion
                      ];
                      oauthList.sort();
                      String oauthSig = //[I need a method to create this properly]

                      var request = http.Request('POST', Uri.parse([My URL]));
                      http.StreamedResponse response = await request.send();

                      if (response.statusCode == 200) {
                        print(await response.stream.bytesToString());
                      }

</code>```

Like I mention postman does return the token and the token secret but trying on Flutter returns the Authentication Required  error

Picture of the Postman request body

On the Authorization tab just filled in the Consumer Key and the Consumer Secret the headers where left untouched and default like this:

Body:
I am trying to make an API call to my server everything works properly on postman but I can't seem to get it going on Flutter

                      String oauthConsumer ='oauth_consumer_key=[MyKey]';
                      String oauthNonce =
                          'oauth_nonce=${Random().nextInt(4294967296).toString()}';
                      String oauthCallback =
                          'oauth_callback=[MyCallback address]';
                      String oauthVersion = 'oauth_version=1.0';
                      String oauthTime =
                          'oauth_timestamp=${(DateTime.now().millisecondsSinceEpoch ~/ 1000).toString()}';
                      String oauthMethod = 'oauth_signature_method=HMAC-SHA1';

                      var oauthList = [
                        oauthCallback,
                        oauthConsumer,
                        oauthNonce,
                        oauthMethod,
                        oauthTime,
                        oauthVersion
                      ];
                      oauthList.sort();
                      String oauthSig = //[I need a method to create this properly]

                      var request = http.Request('POST', Uri.parse([My URL]));
                      http.StreamedResponse response = await request.send();

                      if (response.statusCode == 200) {
                        print(await response.stream.bytesToString());
                      }

Like I mention postman does return the token and the token secret but trying on Flutter returns the Authentication Required  error

Picture of the Postman request body

On the Authorization tab just filled in the Consumer Key and the Consumer Secret the headers where left untouched and default like this:


问:
Use multiple SpeechRecognition() constructors to listen in multiple languages at the same time
I've setup a test script that successfully transcribes what I am saying, both in english and german if I set the lang property beforehand.

However, I want it to automatically recognize which language I am speaking. Since SpeechRecognition does not support this, my idea was to just use multiple constructors at the same time, each with their own lang property and then just use the transcription with the highest confidence score.

However, this does not seem to work, as chrome does not transcribe anything if i start both constructors at once. In fact, I have to close chrome alltogether before it will start working again.

Any ideas? Here is the full code, if I uncomment the commented lines it will not work.

```<code>function listenEN(){

navigator.webkitGetUserMedia(
    { audio: true },
    () => {},
    () => {},
)

let triggerPhrase = "Computer"
triggerPhrase = triggerPhrase ? triggerPhrase.toLowerCase() : "Alexa"

let voices = window.speechSynthesis.getVoices()
const voiceEN = voices.find((voice) => voice.name === 'Google US English')
const voiceDE = voices.find((voice) => voice.name === 'Google DE German')

async function notifyStartListening() {
    const utterance = new SpeechSynthesisUtterance("beep!");
    utterance.rate = 2;
    utterance.pitch = 1.5;
    utterance.voice = voiceEN;
    speechSynthesis.speak(utterance);
}

const recognitionEN = new webkitSpeechRecognition()
recognitionEN.lang = 'en-US'
recognitionEN.continuous = true

const recognitionDE = new webkitSpeechRecognition()
recognitionDE.lang = 'de-DE'
recognitionDE.continuous = true

try {
    let isActive = false

    function startListening() {
        notifyStartListening();
        isActive = true
    }

    recognitionEN.addEventListener('result', async () => {
        recognitionEN.lang = 'en-US'
        const transcriptEN = event.results[event.results?.length - 1][0].transcript
        console.log(transcriptEN)
        if (isActive) {
            let instruction = transcriptEN
            if (transcriptEN.trimStart().startsWith(triggerPhrase)) {
                instruction = transcriptEN.trimStart().substring(triggerPhrase.length)
            }
            isActive = false
            return
        }

        const trimmed = transcriptEN.trimStart().trimEnd().toLowerCase()
        if (trimmed.startsWith(triggerPhrase)) {
            const instructionEN = trimmed.substring(triggerPhrase.length)
            if (instructionEN && instructionEN?.length > 2) {
                let confidenceEN = document.createElement('p')
                confidenceEN.innerHTML = event.results[event.results?.length - 1][0].confidence
                document.body.appendChild(confidenceEN);
                } else {
                startListening()
            }
        }
    })

    recognitionDE.addEventListener('result', async () => {
        recognitionDE.lang = 'de-DE'
        const transcriptDE = event.results[event.results?.length - 1][0].transcript
        console.log(transcriptDE)
        if (isActive) {
            let instruction = transcriptDE
            if (transcriptDE.trimStart().startsWith(triggerPhrase)) {
                instruction = transcriptDE.trimStart().substring(triggerPhrase.length)
            }
            isActive = false
            return
        }

        const trimmed = transcriptDE.trimStart().trimEnd().toLowerCase()
        if (trimmed.startsWith(triggerPhrase)) {
            const instructionDE = trimmed.substring(triggerPhrase.length)
            if (instructionDE && instructionDE?.length > 2) {
                let confidenceDE = document.createElement('p')
                confidenceDE.innerHTML = event.results[event.results?.length - 1][0].confidence
                document.body.appendChild(confidenceDE);
                } else {
                startListening()
            }
        }
    })

    recognitionEN.addEventListener('error', (event) => {
        console.log(event)
    })

    recognitionEN.onend = function () {
        recognitionEN.start()
    }

    recognitionEN.start()

    /*recognitionDE.addEventListener('error', (event) => {
        console.log(event)
    })

    recognitionDE.onend = function () {
        recognitionDE.start()
    }

    recognitionDE.start()   */

} catch (e) {
    console.error(e)
}
</code>```

}

Body:
I've setup a test script that successfully transcribes what I am saying, both in english and german if I set the lang property beforehand.

However, I want it to automatically recognize which language I am speaking. Since SpeechRecognition does not support this, my idea was to just use multiple constructors at the same time, each with their own lang property and then just use the transcription with the highest confidence score.

However, this does not seem to work, as chrome does not transcribe anything if i start both constructors at once. In fact, I have to close chrome alltogether before it will start working again.

Any ideas? Here is the full code, if I uncomment the commented lines it will not work.

function listenEN(){

navigator.webkitGetUserMedia(
    { audio: true },
    () => {},
    () => {},
)

let triggerPhrase = "Computer"
triggerPhrase = triggerPhrase ? triggerPhrase.toLowerCase() : "Alexa"

let voices = window.speechSynthesis.getVoices()
const voiceEN = voices.find((voice) => voice.name === 'Google US English')
const voiceDE = voices.find((voice) => voice.name === 'Google DE German')

async function notifyStartListening() {
    const utterance = new SpeechSynthesisUtterance("beep!");
    utterance.rate = 2;
    utterance.pitch = 1.5;
    utterance.voice = voiceEN;
    speechSynthesis.speak(utterance);
}

const recognitionEN = new webkitSpeechRecognition()
recognitionEN.lang = 'en-US'
recognitionEN.continuous = true

const recognitionDE = new webkitSpeechRecognition()
recognitionDE.lang = 'de-DE'
recognitionDE.continuous = true

try {
    let isActive = false

    function startListening() {
        notifyStartListening();
        isActive = true
    }

    recognitionEN.addEventListener('result', async () => {
        recognitionEN.lang = 'en-US'
        const transcriptEN = event.results[event.results?.length - 1][0].transcript
        console.log(transcriptEN)
        if (isActive) {
            let instruction = transcriptEN
            if (transcriptEN.trimStart().startsWith(triggerPhrase)) {
                instruction = transcriptEN.trimStart().substring(triggerPhrase.length)
            }
            isActive = false
            return
        }

        const trimmed = transcriptEN.trimStart().trimEnd().toLowerCase()
        if (trimmed.startsWith(triggerPhrase)) {
            const instructionEN = trimmed.substring(triggerPhrase.length)
            if (instructionEN && instructionEN?.length > 2) {
                let confidenceEN = document.createElement('p')
                confidenceEN.innerHTML = event.results[event.results?.length - 1][0].confidence
                document.body.appendChild(confidenceEN);
                } else {
                startListening()
            }
        }
    })

    recognitionDE.addEventListener('result', async () => {
        recognitionDE.lang = 'de-DE'
        const transcriptDE = event.results[event.results?.length - 1][0].transcript
        console.log(transcriptDE)
        if (isActive) {
            let instruction = transcriptDE
            if (transcriptDE.trimStart().startsWith(triggerPhrase)) {
                instruction = transcriptDE.trimStart().substring(triggerPhrase.length)
            }
            isActive = false
            return
        }

        const trimmed = transcriptDE.trimStart().trimEnd().toLowerCase()
        if (trimmed.startsWith(triggerPhrase)) {
            const instructionDE = trimmed.substring(triggerPhrase.length)
            if (instructionDE && instructionDE?.length > 2) {
                let confidenceDE = document.createElement('p')
                confidenceDE.innerHTML = event.results[event.results?.length - 1][0].confidence
                document.body.appendChild(confidenceDE);
                } else {
                startListening()
            }
        }
    })

    recognitionEN.addEventListener('error', (event) => {
        console.log(event)
    })

    recognitionEN.onend = function () {
        recognitionEN.start()
    }

    recognitionEN.start()

    /*recognitionDE.addEventListener('error', (event) => {
        console.log(event)
    })

    recognitionDE.onend = function () {
        recognitionDE.start()
    }

    recognitionDE.start()   */

} catch (e) {
    console.error(e)
}

}


问:
How to know if type conversion is safe?
I have type A and B as template parameters and I want to check if type B can be safely converted to type A. AFAIK int to double conversion is safe but not the reverse. So how to find out if the conversion is safe and there will be no data loss? For now I want to know for the integraltype only.</p>

Title: How to know if type conversion is safe?


问:
openssl: ca key too small but key size is 4096
I am getting a weird error when try to upload a zip to an external API. The error is "ca key too small".

I have already verified and my p12(key + certificate) is generated with SHA256 signature and the key size is 4096 bytes.
In order to verify this, I added my p12 file to OSX keychain.
I checked the certificate it says Signature Algorithm as SHA-256 with RSA Encryption and Public key size as 4.096 bits. I checked the private key it says RSA, 4096-bit. I already tried generating a new p12 key pair but the issue persists.

I am facing this issue when deploying a zipped package through bitbucket pipelines. We recently switched our node version from 14.XX to 16.XX and because of this we started facing this issue.

Upon deeper investigation it seems that the "openssl.cnf" packaged as part of node 16.XX docker image has SECLEVEL specified with value 2. If I downgrade the node version to 14.XX and inspect the "openssl.cnf", it is missing the SECLEVEL entry altogether. So, for node image 16.XX, if I modify the SECLEVEL to 1 by manipulating the "openssl.cnf" everything works fine.

```<code># node 16.XX docker image /etc/ssl/openssl.cnf
[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT:@SECLEVEL=2
</code>```

I am also able to replicate the same issue locally by add the SECLEVEL in my local "openssl.cnf" file and then making the API call to the server. Below is the stripped down version of the nodejs code.

I do not want to use this hack of downgrading the SECLEVEL as I would like to understand what exactly the issue is. As per my understanding, my key size(4096) is not small.

```<code>var fs = require('fs');
var request = require('request');

var endpoint = 'SOME_ENDPOINT";
var instance = "SOME_INSTANCE"
var file = './test.zip';
const options = {
    pfx: '/path/to/certificate.p12',
    passphrase: 'SOME_PASSPHRASE',
}
var token = 'SOME_TOKEN';
var opts = {
    baseUrl: 'https://' + instance,
    uri: endpoint,
    auth: {
        bearer: ( token ? token : null )
    },
    strictSSL: true,
    method: 'PUT'
};

if (options && options.pfx && fs.existsSync(options.pfx)) {
    var stat = fs.statSync(options.pfx);
    if (stat.isFile()) {
        opts.agentOptions = {
            pfx: fs.readFileSync(options.pfx),
            passphrase: options.passphrase // as passphrase is optional, it can be undefined here
        };
    }
}

var req = request(opts, function(err) {
    console.log(err);
});
fs.createReadStream(file).pipe(req);
</code>```

Body:
I am getting a weird error when try to upload a zip to an external API. The error is "ca key too small".

I have already verified and my p12(key + certificate) is generated with SHA256 signature and the key size is 4096 bytes.
In order to verify this, I added my p12 file to OSX keychain.
I checked the certificate it says Signature Algorithm as SHA-256 with RSA Encryption and Public key size as 4.096 bits. I checked the private key it says RSA, 4096-bit. I already tried generating a new p12 key pair but the issue persists.

I am facing this issue when deploying a zipped package through bitbucket pipelines. We recently switched our node version from 14.XX to 16.XX and because of this we started facing this issue.

Upon deeper investigation it seems that the "openssl.cnf" packaged as part of node 16.XX docker image has SECLEVEL specified with value 2. If I downgrade the node version to 14.XX and inspect the "openssl.cnf", it is missing the SECLEVEL entry altogether. So, for node image 16.XX, if I modify the SECLEVEL to 1 by manipulating the "openssl.cnf" everything works fine.

# node 16.XX docker image /etc/ssl/openssl.cnf
[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT:@SECLEVEL=2

I am also able to replicate the same issue locally by add the SECLEVEL in my local "openssl.cnf" file and then making the API call to the server. Below is the stripped down version of the nodejs code.

I do not want to use this hack of downgrading the SECLEVEL as I would like to understand what exactly the issue is. As per my understanding, my key size(4096) is not small.

var fs = require('fs');
var request = require('request');

var endpoint = 'SOME_ENDPOINT";
var instance = "SOME_INSTANCE"
var file = './test.zip';
const options = {
    pfx: '/path/to/certificate.p12',
    passphrase: 'SOME_PASSPHRASE',
}
var token = 'SOME_TOKEN';
var opts = {
    baseUrl: 'https://' + instance,
    uri: endpoint,
    auth: {
        bearer: ( token ? token : null )
    },
    strictSSL: true,
    method: 'PUT'
};

if (options && options.pfx && fs.existsSync(options.pfx)) {
    var stat = fs.statSync(options.pfx);
    if (stat.isFile()) {
        opts.agentOptions = {
            pfx: fs.readFileSync(options.pfx),
            passphrase: options.passphrase // as passphrase is optional, it can be undefined here
        };
    }
}

var req = request(opts, function(err) {
    console.log(err);
});
fs.createReadStream(file).pipe(req);


问:
I recently uninstalled python 3.10, and installed python 3.11 but my PowerShell does not detect it
I used the command Python -V in my powershell (I use a Windows PC), but it gave me this error message: Python Not Found. I have python installed on my computerPython 3.11, and I added it to Path. With my other IDEs, such as intellij, it detects python and works perfectly.

I suspect that there is an error with my python 3.11, but even after uninstalling python and re-installing it, my system still cannot find python.

All answers are appreciated, Thank You


问:
How to implements an interface in a JSON
I go to the DB and get the 'percent_values' of the 'topics' and average them all, and the JSON that returns me is below, with the 'sector_name' and the average value. But if there is no 'percent_value' of a topic then the sector is not returned. I want to return the sector with mean = 0. How can I do this?

They gave me a tip to use an Interface of the topics and a const with the values of the topics already equal to 0, I created it but I don't know how exactly to implement it... How could I be doing this?

JSONs

```<code>// JSON that returns to me
{
  "Sector1": 4,
  "Sector2": 24,
  "Sector3": 2.5,
  "Sector4": 9.5,
  "Sector6": 74,
  "Total": 19
}

// JSON that I want
{
  "Sector1": 4,
  "Sector2": 24,
  "Sector3": 2.5,
  "Sector4": 9.5,
  "Sector5": 0,
  "Sector6": 74,
  "Total": 19
}
</code>```

interface and cons

```<code>export interface ISectorTopics {
    'Sector1': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null,
        'topic4': number | null,
        'topic5': number | null
    },
    'Sector2': {
        'topic1': number | null,
        'topic2': number | null
    },
    'Sector3': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null,
        'topic4': number | null
    },
    'Sector4': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null,
        'topic4': number | null
    },
    'Sector5': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null
    },
    'Sector6': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null
    }
};

export const sectorTopicsDefaultValues : ISectorTopics = {
    'Sector1': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0,
        'topic4': 0,
        'topic5': 0
    },
    'Sector2': {
        'topic1': 0,
        'topic2': 0
    },
    'Sector3': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0,
        'topic4': 0
    },
    'Sector4': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0,
        'topic4': 0
    },
    'Sector5': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0
    },
    'Sector6': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0
    }
}
</code>```

Service

```<code>@Injectable()
export class MyService {
  constructor(private dataSource: DataSource) {}

  myRepository = this.dataSource.getRepository(data);

  async getAll(year: number, month: number) {
    let datas;
    await this.myRepository
      .find({
        relations: {
          topic: {
            sector: true
          }
        },
        select: {
          month_reference: true,
          year_reference: true,
          percent_data: true,
          topic: {
            topic_name: true,
            sector: {
              sector_name: true
            }
          }
        },
        where: {
          month_reference: month,
          year_reference: year
        }
      })
      .then((response) => datas = response);

      const dataObj = {}
      const sectors = {};

      datas.forEach((data) => {
        if (!sectors[data.topic.sector.sector_name]) {
          sectors[data.topic.sector.sector_name] = [];
        }
        if (data.month_reference == month && data.year_reference == year) {
          let value;

          data.percent_value ? value = data.percent_value : 0;

          sectors[data.topic.sector.sector_name].push({
            topic_name: data.topic.topic_name,
            percent_value: value,
          });
        };
      });

      // Calculate the Total Average data per Sector
      const sectorEntries = Object.entries(sectors);

      sectorEntries.forEach(([sectorName, sectorArray]) => {
        const sum = (<any>sectorArray).reduce((accumulator, currentdata) => {
          return accumulator + currentdata.percent_values;
        }, 0);

        const sectorAverage = sum / (<any>sectorArray).length;

        sectorAverage ? dataObj[sectorName] = sectorAverage : dataObj[sectorName] = 0;
      })

      // Calculate the Total Average data
      const averageSectordatas = Object.values(dataObj);
      const averageSum = averageSectordatas.reduce((accumulator, currentdata) => {
        return (+<any>accumulator) + (+<any>currentdata);
      }, 0);

      const averageTotal = (+<any>averageSum) / averageSectordatas.length;

      averageTotal ? dataObj["Total"] = +averageTotal.toFixed(2) : dataObj["averageTotal"] = 0;

      return data;
  }
}
</code>```

Body:
I go to the DB and get the 'percent_values' of the 'topics' and average them all, and the JSON that returns me is below, with the 'sector_name' and the average value. But if there is no 'percent_value' of a topic then the sector is not returned. I want to return the sector with mean = 0. How can I do this?

They gave me a tip to use an Interface of the topics and a const with the values of the topics already equal to 0, I created it but I don't know how exactly to implement it... How could I be doing this?

JSONs

// JSON that returns to me
{
  "Sector1": 4,
  "Sector2": 24,
  "Sector3": 2.5,
  "Sector4": 9.5,
  "Sector6": 74,
  "Total": 19
}

// JSON that I want
{
  "Sector1": 4,
  "Sector2": 24,
  "Sector3": 2.5,
  "Sector4": 9.5,
  "Sector5": 0,
  "Sector6": 74,
  "Total": 19
}

interface and cons

export interface ISectorTopics {
    'Sector1': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null,
        'topic4': number | null,
        'topic5': number | null
    },
    'Sector2': {
        'topic1': number | null,
        'topic2': number | null
    },
    'Sector3': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null,
        'topic4': number | null
    },
    'Sector4': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null,
        'topic4': number | null
    },
    'Sector5': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null
    },
    'Sector6': {
        'topic1': number | null,
        'topic2': number | null,
        'topic3': number | null
    }
};

export const sectorTopicsDefaultValues : ISectorTopics = {
    'Sector1': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0,
        'topic4': 0,
        'topic5': 0
    },
    'Sector2': {
        'topic1': 0,
        'topic2': 0
    },
    'Sector3': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0,
        'topic4': 0
    },
    'Sector4': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0,
        'topic4': 0
    },
    'Sector5': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0
    },
    'Sector6': {
        'topic1': 0,
        'topic2': 0,
        'topic3': 0
    }
}

Service

@Injectable()
export class MyService {
  constructor(private dataSource: DataSource) {}

  myRepository = this.dataSource.getRepository(data);

  async getAll(year: number, month: number) {
    let datas;
    await this.myRepository
      .find({
        relations: {
          topic: {
            sector: true
          }
        },
        select: {
          month_reference: true,
          year_reference: true,
          percent_data: true,
          topic: {
            topic_name: true,
            sector: {
              sector_name: true
            }
          }
        },
        where: {
          month_reference: month,
          year_reference: year
        }
      })
      .then((response) => datas = response);

      const dataObj = {}
      const sectors = {};

      datas.forEach((data) => {
        if (!sectors[data.topic.sector.sector_name]) {
          sectors[data.topic.sector.sector_name] = [];
        }
        if (data.month_reference == month && data.year_reference == year) {
          let value;

          data.percent_value ? value = data.percent_value : 0;

          sectors[data.topic.sector.sector_name].push({
            topic_name: data.topic.topic_name,
            percent_value: value,
          });
        };
      });

      // Calculate the Total Average data per Sector
      const sectorEntries = Object.entries(sectors);

      sectorEntries.forEach(([sectorName, sectorArray]) => {
        const sum = (<any>sectorArray).reduce((accumulator, currentdata) => {
          return accumulator + currentdata.percent_values;
        }, 0);

        const sectorAverage = sum / (<any>sectorArray).length;

        sectorAverage ? dataObj[sectorName] = sectorAverage : dataObj[sectorName] = 0;
      })

      // Calculate the Total Average data
      const averageSectordatas = Object.values(dataObj);
      const averageSum = averageSectordatas.reduce((accumulator, currentdata) => {
        return (+<any>accumulator) + (+<any>currentdata);
      }, 0);

      const averageTotal = (+<any>averageSum) / averageSectordatas.length;

      averageTotal ? dataObj["Total"] = +averageTotal.toFixed(2) : dataObj["averageTotal"] = 0;

      return data;
  }
}


问:
dns_get_record problems
I am setting up a dns lookup form using dns_get_record.

I set it up to check the A Record and MX Records and NS records of the domain that is input. However, I would like it to also to get the full TTL of a record?

also is it possible to query direct to the named service on port 53 (UDP)?

ContentLicense: CC BY-SA 3.0

Title: dns_get_record problems


问:
I can't set python timeout
I am writing a simple program with the requests library, using pyqt5, I am multiprocessing with Qthread and I have a function; As you know, the requests timeout timing does not work for me. I want it to give a tiout error at the time I set in the function I have given below. My goal is to make the thread complete its task and switch to a new process with the code I return. I tried a few methods and failed, I tried to use gevent, please help me. I can't find a solution.

```<code>import gevent
import gevent.monkey
gevent.monkey.patch_all(subprocess=True)
import requests
from PyQt5 import QtCore, QtTest

def wControl(urls):
    try:
        with gevent.Timeout(20):
            headers = {
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36'}
            sUrl = urls
            r = requests.get(sUrl, headers=headers,verify=False, timeout=20)
            if r.status_code == 200:
                return sUrl
            else:
                return "2"
    except gevent.timeout.Timeout as e:
        print ("timeout: {}").format(e.message)
        return "2"
</code>```

Title: I can't set python timeout

Body:
I am writing a simple program with the requests library, using pyqt5, I am multiprocessing with Qthread and I have a function; As you know, the requests timeout timing does not work for me. I want it to give a tiout error at the time I set in the function I have given below. My goal is to make the thread complete its task and switch to a new process with the code I return. I tried a few methods and failed, I tried to use gevent, please help me. I can't find a solution.

import gevent
import gevent.monkey
gevent.monkey.patch_all(subprocess=True)
import requests
from PyQt5 import QtCore, QtTest

def wControl(urls):
    try:
        with gevent.Timeout(20):
            headers = {
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36'}
            sUrl = urls
            r = requests.get(sUrl, headers=headers,verify=False, timeout=20)
            if r.status_code == 200:
                return sUrl
            else:
                return "2"
    except gevent.timeout.Timeout as e:
        print ("timeout: {}").format(e.message)
        return "2"


问:
Java11 Migration : Powermock error while instantiating the test cases
I am attaching error log here. It is causing compilation failure in a maven project. Seems that tests are not running after all saying that no tests were found. What I have done during migration is excluding all powermock-api-mockito dependencies and included powermock-api-mockito2 (since java11 migration is being done).</p>
```<code>Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.powermock.modules.testng.internal.TestClassInstanceFactory.create(TestClassInstanceFactory.java:48)
    ... 24 more
Caused by: java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
    at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:74)
    at com.sun.proxy.$Proxy32.isTypeMockable(Unknown Source)
    at org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java:29)
    at org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)
    at org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:241)
    at org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java:229)
    at org.mockito.internal.MockitoCore.mock(MockitoCore.java:62)
    at org.mockito.Mockito.mock(Mockito.java:1908)
    at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMethodInvocationControl(DefaultMockCreator.java:108)
    at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.doCreateMock(DefaultMockCreator.java:61)
    at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMock(DefaultMockCreator.java:53)
    at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.mock(DefaultMockCreator.java:40)
    at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:126)
    ... 29 more
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in java.lang.CompoundEnumeration@e146f93
    at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:54)
    at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:57)
    at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:44)
    at org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:22)
    at org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:19)
    at org.mockito.internal.util.MockUtil.<clinit>(MockUtil.java:24)
    ... 41 more
Caused by: java.lang.ClassCastException: Cannot cast org.powermock.api.mockito.mockmaker.PowerMockMaker to org.mockito.plugins.MockMaker
    at java.base/java.lang.Class.cast(Class.java:3605)
    at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:50)
    ... 46 more`

What I have done during migration is excluded all powermock-api-mockito dependencies and included powermock-api-mockito2 (since java11 migration is being done).
I was expecting the tests to run, but they are not even being initiated.
</code>```

Body:
I am attaching error log here. It is causing compilation failure in a maven project. Seems that tests are not running after all saying that no tests were found. What I have done during migration is excluding all powermock-api-mockito dependencies and included powermock-api-mockito2 (since java11 migration is being done).

Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.powermock.modules.testng.internal.TestClassInstanceFactory.create(TestClassInstanceFactory.java:48)
    ... 24 more
Caused by: java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
    at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:74)
    at com.sun.proxy.$Proxy32.isTypeMockable(Unknown Source)
    at org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java:29)
    at org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)
    at org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:241)
    at org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java:229)
    at org.mockito.internal.MockitoCore.mock(MockitoCore.java:62)
    at org.mockito.Mockito.mock(Mockito.java:1908)
    at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMethodInvocationControl(DefaultMockCreator.java:108)
    at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.doCreateMock(DefaultMockCreator.java:61)
    at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMock(DefaultMockCreator.java:53)
    at org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.mock(DefaultMockCreator.java:40)
    at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:126)
    ... 29 more
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in java.lang.CompoundEnumeration@e146f93
    at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:54)
    at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:57)
    at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:44)
    at org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:22)
    at org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:19)
    at org.mockito.internal.util.MockUtil.<clinit>(MockUtil.java:24)
    ... 41 more
Caused by: java.lang.ClassCastException: Cannot cast org.powermock.api.mockito.mockmaker.PowerMockMaker to org.mockito.plugins.MockMaker
    at java.base/java.lang.Class.cast(Class.java:3605)
    at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:50)
    ... 46 more`

What I have done during migration is excluded all powermock-api-mockito dependencies and included powermock-api-mockito2 (since java11 migration is being done).
I was expecting the tests to run, but they are not even being initiated.


问:
Can't install Opencv on raspberry pi 4
I'm using the raspberry pi 4 on visual studio code and whenever I enter the command pip install opencv-python in the terminal, after 40 mins I get the error message

```<code> FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-armv7l-3.9/cmake-install/python/cv2/config-3.py'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects
</code>```

I have found a post on the same problem but the suggestion was to upgrade pip and try reinstalling opencv but that hasn't worked either. I'm using python 3.9.2 as an interpreter

Edit:
When I use the command pip3 install --no-use-pep517 opencv-python I get the error:

```<code>error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-zwr61c7o/opencv-python_1867909748974f69a8333e238206f9df/setup.py", line 10, in <module>
          import skbuild
      ModuleNotFoundError: No module named 'skbuild'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
</code>```

Title: Can't install Opencv on raspberry pi 4

Body:
I'm using the raspberry pi 4 on visual studio code and whenever I enter the command pip install opencv-python in the terminal, after 40 mins I get the error message

 FileNotFoundError: [Errno 2] No such file or directory: '_skbuild/linux-armv7l-3.9/cmake-install/python/cv2/config-3.py'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects

I have found a post on the same problem but the suggestion was to upgrade pip and try reinstalling opencv but that hasn't worked either. I'm using python 3.9.2 as an interpreter

Edit:
When I use the command pip3 install --no-use-pep517 opencv-python I get the error:

error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-zwr61c7o/opencv-python_1867909748974f69a8333e238206f9df/setup.py", line 10, in <module>
          import skbuild
      ModuleNotFoundError: No module named 'skbuild'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.


问:
Metabase not recognizing some tables in a dataset from Google BigQuery
I have a Google BigQuery database connected in Metabase with 2 datasets (data models in Metabase). When I try to see the tables schema, however, some of them are not shown in the tables list, despite the fact that all tables have the same permissions and I'm using the same service account since the database was connected.

I tried to check the INFORMATION_SCHEMA for all tables to find if there's something different in them, but didn't find any differences. I made a test by creating a view from one of the tables and Metabase was able to find the view, but not the table.

Any ideas of what is causing this strange behaviour? I'm using Metabase 0.43.0 (self-hosted). This happens in the frontend and in the admin panel


问:
What do the colors and letter case of properties in the Chrome DevTools console indicate?
Background

The Chrome DevTools docs have some information on what properties of different colors indicate.

This does not seem to apply to ECMAScript object properties printed to the console.

As an example, console.dir(window) in Chrome DevTools' console will show the global object's properties. Chrome seems to categorize the properties into four categories here:

Uppercase properties

Lowercase properties

Bold properties

Light-color properties

Screenshots

Here are two screenshots for ease of reference:

Both bold and light-color properties come in lowercase and uppercase, so all combinations of the four formats are used.

Question

What does each of these four formats indicate, and is the behavior specified somewhere?


问:
Cross Compile zlib and openssl from docker linux container to armv7 error libz.so: file not recognized: file format not recognized
I have been trying for weeks to cross compile zlib, openssl, and openssh. Last attempt resulted in an error in cross compiling openssl:

/usr/local/zlib/lib/libz.so: file not recognized: file format not recognized

Here is the last attempt I made:

```<code># installing zlib
wget $WGET_URL/zlib-1.2.13.tar.gz -O /tmp/zlib.tar.gz -q && \
mkdir /tmp/zlib && \
tar -xvf /tmp/zlib.tar.gz -C /tmp/zlib && \
rm -rf zlib.tar.gz && \
cd /tmp/zlib/*/ && \
CHOST=arm && \
CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc && \
AR=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar && \
RANLIB=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib && \
./configure --prefix=/usr/local/zlib && \
make clean && \
make install && \
cd /tmp && \
rm -r -f /tmp/zlib && \
# installing openssl
wget $WGET_URL/openssl-3.0.7.tar.gz -O /tmp/openssl.tar.gz -q && \
mkdir /tmp/openssl && \
tar -xvf /tmp/openssl.tar.gz -C /tmp/openssl && \
rm -rf openssl.tar.gz && \
cd /tmp/openssl/*/ && \
./config linux-generic32 -DL_ENDIAN --prefix=/usr/local/openssl
--with-zlib-include=/usr/local/zlib/include
    --with-zlib-    lib=/usr/local/zlib/lib shared zlib && \
    make CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
LD=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
MAKEDEPPROG=arm-linux-gnueabihf-gcc PROCESSOR=ARM && \
    make install CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
    LD=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
MAKEDEPPROG=arm-linux-gnueabihf-gcc PROCESSOR=ARM
</code>```

Here is the output of "file /usr/local/zlib/lib/libz.so"

/usr/local/zlib/lib/libz.so: symbolic link to libz.so.1.2.13

Finally did get zlib and openssl to compile although I'm sure there is more work to be done to get the application to do what I want..

```<code># installing zlib
wget $WGET_URL/zlib-1.2.13.tar.gz -O /tmp/zlib.tar.gz -
q && \
mkdir /tmp/zlib && \
tar -xvf /tmp/zlib.tar.gz -C /tmp/zlib && \
rm -rf zlib.tar.gz && \
cd /tmp/zlib/*/ && \
CROSS_PREFIX=/usr/arm-linux-gnueabihf/bin/arm-linux-
gnueabihf- && \
./configure --prefix=/usr/arm/zlib && \
make clean && \
    make  && \
make install && \
cd /tmp && \
rm -r -f /tmp/zlib && \

# installing openssl
wget $WGET_URL/openssl-1.0.1c.tar.gz -O /tmp/openssl.tar.gz -q && \
mkdir /tmp/openssl && \
tar -xvf /tmp/openssl.tar.gz -C /tmp/openssl && \
rm -rf openssl.tar.gz && \
cd /tmp/openssl/*/ && \
./Configure linux-generic32 shared  -DL_ENDIAN --prefix=/usr/arm/openssl
--openssldir=/usr/arm/openssl && \
make CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
RANLIB=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ranlib
LD=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ld
MAKEDEPPROG=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-gcc PROCESSOR=ARM && \
make install_sw CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
RANLIB=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ranlib
LD=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ld
MAKEDEPPROG=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-gcc PROCESSOR=ARM && \
cd /tmp && \
rm -r -f /tmp/openssl

enter code here
</code>```

Body:
I have been trying for weeks to cross compile zlib, openssl, and openssh. Last attempt resulted in an error in cross compiling openssl:

/usr/local/zlib/lib/libz.so: file not recognized: file format not recognized

Here is the last attempt I made:

# installing zlib
wget $WGET_URL/zlib-1.2.13.tar.gz -O /tmp/zlib.tar.gz -q && \
mkdir /tmp/zlib && \
tar -xvf /tmp/zlib.tar.gz -C /tmp/zlib && \
rm -rf zlib.tar.gz && \
cd /tmp/zlib/*/ && \
CHOST=arm && \
CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc && \
AR=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar && \
RANLIB=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ranlib && \
./configure --prefix=/usr/local/zlib && \
make clean && \
make install && \
cd /tmp && \
rm -r -f /tmp/zlib && \
# installing openssl
wget $WGET_URL/openssl-3.0.7.tar.gz -O /tmp/openssl.tar.gz -q && \
mkdir /tmp/openssl && \
tar -xvf /tmp/openssl.tar.gz -C /tmp/openssl && \
rm -rf openssl.tar.gz && \
cd /tmp/openssl/*/ && \
./config linux-generic32 -DL_ENDIAN --prefix=/usr/local/openssl
--with-zlib-include=/usr/local/zlib/include
    --with-zlib-    lib=/usr/local/zlib/lib shared zlib && \
    make CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
LD=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
MAKEDEPPROG=arm-linux-gnueabihf-gcc PROCESSOR=ARM && \
    make install CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
    LD=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
MAKEDEPPROG=arm-linux-gnueabihf-gcc PROCESSOR=ARM

Here is the output of "file /usr/local/zlib/lib/libz.so"

/usr/local/zlib/lib/libz.so: symbolic link to libz.so.1.2.13

Finally did get zlib and openssl to compile although I'm sure there is more work to be done to get the application to do what I want..

# installing zlib
wget $WGET_URL/zlib-1.2.13.tar.gz -O /tmp/zlib.tar.gz -
q && \
mkdir /tmp/zlib && \
tar -xvf /tmp/zlib.tar.gz -C /tmp/zlib && \
rm -rf zlib.tar.gz && \
cd /tmp/zlib/*/ && \
CROSS_PREFIX=/usr/arm-linux-gnueabihf/bin/arm-linux-
gnueabihf- && \
./configure --prefix=/usr/arm/zlib && \
make clean && \
    make  && \
make install && \
cd /tmp && \
rm -r -f /tmp/zlib && \

# installing openssl
wget $WGET_URL/openssl-1.0.1c.tar.gz -O /tmp/openssl.tar.gz -q && \
mkdir /tmp/openssl && \
tar -xvf /tmp/openssl.tar.gz -C /tmp/openssl && \
rm -rf openssl.tar.gz && \
cd /tmp/openssl/*/ && \
./Configure linux-generic32 shared  -DL_ENDIAN --prefix=/usr/arm/openssl
--openssldir=/usr/arm/openssl && \
make CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
RANLIB=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ranlib
LD=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ld
MAKEDEPPROG=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-gcc PROCESSOR=ARM && \
make install_sw CC=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
RANLIB=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ranlib
LD=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-ld
MAKEDEPPROG=/usr/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc-gcc PROCESSOR=ARM && \
cd /tmp && \
rm -r -f /tmp/openssl

enter code here


问:
change ion-modal bottom property
I have the following modal

```<code><ion-modal [isOpen]="isModalOpen"  [backdropDismiss]="false">
  <ng-template>

    <ion-content class="ion-padding-start">

      <ion-list>
        <ion-item (click)="Orders(1)">
          <ion-icon name="reorder-four-outline"></ion-icon>
          <ion-label class="ion-padding-start">
                all
          </ion-label>
        </ion-item>

         <ion-item (click)="Orders(2)">
          <ion-icon name="download-outline"></ion-icon>
            <ion-label class="ion-padding-start">
              new orders
            </ion-label>
          </ion-item>

           <ion-item (click)="Orders(3)">
            <ion-icon name="checkmark-outline"></ion-icon>
              <ion-label class="ion-padding-start">
                accepted orders
              </ion-label>
           </ion-item>
      </ion-list>
    </ion-content>
  </ng-template>
</ion-modal>
</code>```

this modal appears when clicking on tab1, so I want it in the bottom left corner of the screen. I succeeded with that with the top property, but that’s not what I want, I want to use the bottom property to exclude tabs' height. the bottom property doesn’t take any effect

```<code>ion-modal {
  position:absolute;
  width: 60% !important;
  height: 350px !important;
  top: calc(50% - (60px)); /*60 is tabs height but with top property it will change in different screens
i want it to be bottom: 60px; */
  right:calc(100% - 65%);
    --border-radius: 16px;
    --box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  }
</code>```

try with the top property but this is not the right way to do it

Title: change ion-modal bottom property

Body:
I have the following modal

<ion-modal [isOpen]="isModalOpen"  [backdropDismiss]="false">
  <ng-template>

    <ion-content class="ion-padding-start">

      <ion-list>
        <ion-item (click)="Orders(1)">
          <ion-icon name="reorder-four-outline"></ion-icon>
          <ion-label class="ion-padding-start">
                all
          </ion-label>
        </ion-item>

         <ion-item (click)="Orders(2)">
          <ion-icon name="download-outline"></ion-icon>
            <ion-label class="ion-padding-start">
              new orders
            </ion-label>
          </ion-item>

           <ion-item (click)="Orders(3)">
            <ion-icon name="checkmark-outline"></ion-icon>
              <ion-label class="ion-padding-start">
                accepted orders
              </ion-label>
           </ion-item>
      </ion-list>
    </ion-content>
  </ng-template>
</ion-modal>

this modal appears when clicking on tab1, so I want it in the bottom left corner of the screen. I succeeded with that with the top property, but that’s not what I want, I want to use the bottom property to exclude tabs' height. the bottom property doesn’t take any effect

ion-modal {
  position:absolute;
  width: 60% !important;
  height: 350px !important;
  top: calc(50% - (60px)); /*60 is tabs height but with top property it will change in different screens
i want it to be bottom: 60px; */
  right:calc(100% - 65%);
    --border-radius: 16px;
    --box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  }

try with the top property but this is not the right way to do it


问:
İnstagram following box not loaded fully via selenium
I try to get my follower's usernames from instagram but I think all my followers does not appear, when I scroll down slowly all my followers appear. Can you help me to solve this problem? When i add

```<code>WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, './/div[@class="_ab8y  _ab94 _ab97 _ab9f _ab9k _ab9p _abcm"]')))
</code>```

I got timeout error. Also did I add the right class? I'm not sure also I'll add html code. Please help me this makes me mad !

```<code>followers_panel = driver.find_element_by_xpath('/html/body/div[2]/div/div/div/div[2]/div/div/div[1]/div/div[2]/div/div/div/div/div[2]/div/div/div[2]')
last_ht, ht = 0, 1
while last_ht != ht:
    last_ht = ht
    WebDriverWait(driver, 50).until(EC.presence_of_element_located((By.XPATH, './/div[@class="_ab8y  _ab94 _ab97 _ab9f _ab9k _ab9p _abcm"]')))
    # scroll down and retrun the height of scroll
    ht = driver.execute_script("""
    arguments[0].scrollTo(0, arguments[0].scrollHeight);
    return arguments[0].scrollHeight; """, followers_panel)

list_of_followers = []
# there must be 54 followers but not all of them are loaded so i is not accurate if it is not loaded thats what i figure out.
i=1
while i<54:
     list_of_followers.append(driver.find_element_by_xpath(f'/html/body/div[2]/div/div/div/div[2]/div/div/div[1]/div/div[2]/div/div/div/div/div[2]/div/div/div[2]/div/div/div[{i}]/div[2]/div[1]/div/div/div/a/span/div').text)
     i+=1
</code>```

html code for a follower (the lowest class which includes username as text:

```<code><div class=" _ab8y  _ab94 _ab97 _ab9f _ab9k _ab9p _abcm">jackgrealish98</div>
</code>```

Body:
I try to get my follower's usernames from instagram but I think all my followers does not appear, when I scroll down slowly all my followers appear. Can you help me to solve this problem? When i add

WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, './/div[@class="_ab8y  _ab94 _ab97 _ab9f _ab9k _ab9p _abcm"]')))

I got timeout error. Also did I add the right class? I'm not sure also I'll add html code. Please help me this makes me mad !

followers_panel = driver.find_element_by_xpath('/html/body/div[2]/div/div/div/div[2]/div/div/div[1]/div/div[2]/div/div/div/div/div[2]/div/div/div[2]')
last_ht, ht = 0, 1
while last_ht != ht:
    last_ht = ht
    WebDriverWait(driver, 50).until(EC.presence_of_element_located((By.XPATH, './/div[@class="_ab8y  _ab94 _ab97 _ab9f _ab9k _ab9p _abcm"]')))
    # scroll down and retrun the height of scroll
    ht = driver.execute_script("""
    arguments[0].scrollTo(0, arguments[0].scrollHeight);
    return arguments[0].scrollHeight; """, followers_panel)

list_of_followers = []
# there must be 54 followers but not all of them are loaded so i is not accurate if it is not loaded thats what i figure out.
i=1
while i<54:
     list_of_followers.append(driver.find_element_by_xpath(f'/html/body/div[2]/div/div/div/div[2]/div/div/div[1]/div/div[2]/div/div/div/div/div[2]/div/div/div[2]/div/div/div[{i}]/div[2]/div[1]/div/div/div/a/span/div').text)
     i+=1

html code for a follower (the lowest class which includes username as text:

jackgrealish98


问:
If an NumPy array is a vector, why is the addition of a single number possible?
In math you cant add a single number to a Vector scalar+vector!=, only multiply scalar+vector=vector. As far as I learned arrays are one dimensional vector, shouldn't it be impossible to add a single number to it then?

```<code>> x = np.array([1,2,3])
> x+=1
x=[2,3,4]
</code>```

Shouldn't this be impossible?

Body:
In math you cant add a single number to a Vector scalar+vector!=, only multiply scalar+vector=vector. As far as I learned arrays are one dimensional vector, shouldn't it be impossible to add a single number to it then?

> x = np.array([1,2,3])
> x+=1
x=[2,3,4]

Shouldn't this be impossible?


问:
Templated struct factory with member metadata
I'm trying to process structures which are contained in a file mapping. One of the challenges I'm facing is that some structures have pointers which need a function to get the correct value. It's important that the layout and size of the structure stay the same, and I'm using c++20.

My current solution is as follows.
I have a private data structure, and store the member offsets in a public subclass. The template factory method uses this array of offsets to fix up any pointers.

struct _Data {
    uint32_t flags;
    uint64_t ptr1;
    uint64_t ptr2;
};

struct Data : public {
    constexpr static std::size_t PTRS[] = {
        offsetof(_Data, ptr1),
        offsetof(_Data, ptr2)
    };
};

template <class T> T GetStructure(uint64_t addr) {
    // Converts the "virtual address" to a pointer in the file mapping
    T temp = *(T *)context.translateAddr(addr);

    for (auto offset : T::PTRS) {
        uint64_t *member = (uint8_t *)temp + offset;
        *member = context.getPointer(addr + offset);
    }
    return temp;
}
```

I found a similar question here dealing with serialization, which also stores metadata about members in a list.

My main gripe with my solution is how I need to split a definition into two structures. It would be great if I could contain everything within its own definition.

Other solutions I thought were,

Somehow "mark" a member in a way the factory method can detect.

Using a function to return a vector of offsets. This would solve the two definitions problem, but I'm concerned about the performance of constantly calling a function and return a vector.

Using a constexpr function to return a std::array. Faster than returning a vector for sure, but probably slower than a constexpr list like the one shown above.

I can make a separate templated function which returns a a vector of offsets given the structure, but this seems to combine worst of both worlds.

Body:
I'm trying to process structures which are contained in a file mapping. One of the challenges I'm facing is that some structures have pointers which need a function to get the correct value. It's important that the layout and size of the structure stay the same, and I'm using c++20.

My current solution is as follows.
I have a private data structure, and store the member offsets in a public subclass. The template factory method uses this array of offsets to fix up any pointers.

struct _Data {
    uint32_t flags;
    uint64_t ptr1;
    uint64_t ptr2;
};

struct Data : public {
    constexpr static std::size_t PTRS[] = {
        offsetof(_Data, ptr1),
        offsetof(_Data, ptr2)
    };
};

template <class T> T GetStructure(uint64_t addr) {
    // Converts the "virtual address" to a pointer in the file mapping
    T temp = *(T *)context.translateAddr(addr);

    for (auto offset : T::PTRS) {
        uint64_t *member = (uint8_t *)temp + offset;
        *member = context.getPointer(addr + offset);
    }
    return temp;
}

I found a similar question here dealing with serialization, which also stores metadata about members in a list.

My main gripe with my solution is how I need to split a definition into two structures. It would be great if I could contain everything within its own definition.

Other solutions I thought were,

Somehow "mark" a member in a way the factory method can detect.

Using a function to return a vector of offsets. This would solve the two definitions problem, but I'm concerned about the performance of constantly calling a function and return a vector.

Using a constexpr function to return a std::array. Faster than returning a vector for sure, but probably slower than a constexpr list like the one shown above.

I can make a separate templated function which returns a a vector of offsets given the structure, but this seems to combine worst of both worlds.


问:
Tkinter Label not showing text
I am learning how to use tkinter. When I try doing an hello world example, text does not appear. A small window pops up empty.

My basic code goes like this:

```<code>from tkinter import *
root = Tk()
label = Label(root, text="Hello World!")
label.pack()
root.mainloop()
</code>```

Title: Tkinter Label not showing text

Body:
I am learning how to use tkinter. When I try doing an hello world example, text does not appear. A small window pops up empty.

My basic code goes like this:

from tkinter import *
root = Tk()
label = Label(root, text="Hello World!")
label.pack()
root.mainloop()


问:
In Jenkins declarative pipeline how to get all parameter values
I am having a jenkinsfile where I have defined "CascadeChoiceParameter" parameter and this parameter will return values like "ABC","PQR" and "WRQ". Now, I want to show all this parameter values and store it as a list.

So, I know in extended choice parameter we can import below plugins and write a code to get all jenkins parameter values as shown below.

```<code>import hudson.model.*
import org.jenkinsci.plugins.workflow.job.*
import com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition

def param = getParam(JOB_NAME, "Services")
                    def all_param_values =  param.getValue().replaceAll("\\s","").tokenize(',').tail()
                    def service_name = ("${SERVICE_NAME}".replace('Services:', '')).toString().tokenize(',[]')
</code>```

So, in my case to get all jenkins parameter values for "CascadeChoiceParameter" parameter I have imported below plugins and written below code:-

```<code>import hudson.model.*
import org.jenkinsci.plugins.workflow.job.*
import org.biouno.unochoice.CascadeChoiceParameter

@NonCPS
def getJob(name) {
    def hi = Hudson.instance
    return hi.getItemByFullName(name, Job)
}

@NonCPS
def getParam(String jobName, String paramName) {
    def job = getJob(jobName)
    def prop = job.getProperty(ParametersDefinitionProperty.class)
    for (param in prop.getParameterDefinitions()) {
        if (param.name == paramName) {
            return param
        }
    }
    return null
}

def param = getParam(JOB_NAME, "Test")
def all_param_values =  param.getValue().replaceAll("\\s","").tokenize(',').tail()
def Test_name = ("${TEST_NAME}".replace('Test:', '')).toString().tokenize(',[]')
</code>```

But, while running jenkins job I am getting below error.

```<code>hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.biouno.unochoice.CascadeChoiceParameter.getValue() is applicable for argument types: () values: []
</code>```

Can anyone assist?

Body:
I am having a jenkinsfile where I have defined "CascadeChoiceParameter" parameter and this parameter will return values like "ABC","PQR" and "WRQ". Now, I want to show all this parameter values and store it as a list.

So, I know in extended choice parameter we can import below plugins and write a code to get all jenkins parameter values as shown below.

import hudson.model.*
import org.jenkinsci.plugins.workflow.job.*
import com.cwctravel.hudson.plugins.extended_choice_parameter.ExtendedChoiceParameterDefinition

def param = getParam(JOB_NAME, "Services")
                    def all_param_values =  param.getValue().replaceAll("\\s","").tokenize(',').tail()
                    def service_name = ("${SERVICE_NAME}".replace('Services:', '')).toString().tokenize(',[]')

So, in my case to get all jenkins parameter values for "CascadeChoiceParameter" parameter I have imported below plugins and written below code:-

import hudson.model.*
import org.jenkinsci.plugins.workflow.job.*
import org.biouno.unochoice.CascadeChoiceParameter

@NonCPS
def getJob(name) {
    def hi = Hudson.instance
    return hi.getItemByFullName(name, Job)
}

@NonCPS
def getParam(String jobName, String paramName) {
    def job = getJob(jobName)
    def prop = job.getProperty(ParametersDefinitionProperty.class)
    for (param in prop.getParameterDefinitions()) {
        if (param.name == paramName) {
            return param
        }
    }
    return null
}

def param = getParam(JOB_NAME, "Test")
def all_param_values =  param.getValue().replaceAll("\\s","").tokenize(',').tail()
def Test_name = ("${TEST_NAME}".replace('Test:', '')).toString().tokenize(',[]')

But, while running jenkins job I am getting below error.

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.biouno.unochoice.CascadeChoiceParameter.getValue() is applicable for argument types: () values: []

Can anyone assist?


问:
Sorting coordinates of a shape's outline
So let's say I have the points of this shape's outline:

Now, these points aren't sorted. What I want to do is turning [B, E, H, M, P, ...] into [A, B, C, D, E, ...].

I tried to find the top-left point (A) and then go from it on and on. I faled in cases like this one:

I don't want to use libraries like OpenCV, but write the algorithm myself. Any help?