问:
How to set Printer settings page size
My Photo Booth application uses code similar to the code below to automatically print.
It works great, however recently when I changed my Dye Sub printer to use 5 x 7 media instead of the usual 4 x 6, as soon as the print code starts, the ribbon error on the printer lights.

I am setting the paper size as shown below but to get the error to go away, I found that I need to set the paper size in the Printer settings:
PrintingSettings->Paper/Quality -> Advanced Options->Paper Output/paperSize

I am setting the paper size in the print document
Is there another setting I can set in code to set the printer page size?

I am setting the paper size as follows:

```<code>public static PrintDocument pd = new PrintDocument();
PrintController printController = new StandardPrintController();
pd.PrintController = printController;
//page sizes in hundredths of an inch
if (selectedLayout.LayoutPrintWidthPixels >0) PrintWidth = selectedLayout.LayoutPrintWidthPixels/300 * 100;
if (selectedLayout.LayoutPrintHeightPixels > 0) PrintHeight = selectedLayout.LayoutPrintHeightPixels/300 *100;
pd.PrinterSettings.DefaultPageSettings.PaperSize = new PaperSize("Custom", PrintWidth, PrintHeight);

</code>```

I am also having trouble understanding page sizes
For example, for 5 x 7 prints, I calculate the sizes as follows:
5 x 7 = 1500 x 2100 px   based on 300 dpi

700 x 500 in Milli Inches (pixel size / 300) X 100

But if I look at the page size in the printer properties while debugging,
the paper size shows 713 x 516 or  1548 x 2139  in pixels

Is that the actual page size or are they allowing some extra for margins or bleed?

When printing 4 x 6, I normally design my template based on 1844 x 1240 pixels (instead of 1800 x 1200)

//  milliinches=(pixels / 300) X 100

//  pixels   =   (milli inches /100)*300

Title: How to set Printer settings page size

Body:
My Photo Booth application uses code similar to the code below to automatically print.
It works great, however recently when I changed my Dye Sub printer to use 5 x 7 media instead of the usual 4 x 6, as soon as the print code starts, the ribbon error on the printer lights.

I am setting the paper size as shown below but to get the error to go away, I found that I need to set the paper size in the Printer settings:
PrintingSettings->Paper/Quality -> Advanced Options->Paper Output/paperSize

I am setting the paper size in the print document
Is there another setting I can set in code to set the printer page size?

I am setting the paper size as follows:

public static PrintDocument pd = new PrintDocument();
PrintController printController = new StandardPrintController();
pd.PrintController = printController;
//page sizes in hundredths of an inch
if (selectedLayout.LayoutPrintWidthPixels >0) PrintWidth = selectedLayout.LayoutPrintWidthPixels/300 * 100;
if (selectedLayout.LayoutPrintHeightPixels > 0) PrintHeight = selectedLayout.LayoutPrintHeightPixels/300 *100;
pd.PrinterSettings.DefaultPageSettings.PaperSize = new PaperSize("Custom", PrintWidth, PrintHeight);

I am also having trouble understanding page sizes
For example, for 5 x 7 prints, I calculate the sizes as follows:
5 x 7 = 1500 x 2100 px   based on 300 dpi

700 x 500 in Milli Inches (pixel size / 300) X 100

But if I look at the page size in the printer properties while debugging,
the paper size shows 713 x 516 or  1548 x 2139  in pixels

Is that the actual page size or are they allowing some extra for margins or bleed?

When printing 4 x 6, I normally design my template based on 1844 x 1240 pixels (instead of 1800 x 1200)

//  milliinches=(pixels / 300) X 100

//  pixels   =   (milli inches /100)*300


来源: stackexchange

问:
shinysurvey and reactive dependencies are not refreshing
HI i have this code GitHub - da-campos/Interfaz_Survey: Create surveys for a Institution in Spanish in the last question of the first page when you select the first option it throws you to the second page and the third page but when you return with previouse and return to the first page and select the last question second option the formularies is not refreshing and is loading the formulary of the third page of the first option as the second option i am tryign to edit the library but how... or give me a solution

https://discord.com/channels/676433858782298142/1054335427059912865
https://github.com/da-campos/Interfaz_Survey.git

I am trying to edit a opensoruce function of a library I expected to improve the code of the github owner of the library make the code work genarally

ContentLicense: CC BY-SA 4.0


问:
Android broadcast receiver doesnt work properly
I have an application on Android devices that listens for incoming calls (incoming call intent) through broadcast receivers and displays a popup on the screen when a call comes in, even when the application is completely closed. This works immediately on the emulator, but on some devices, the popup does not appear until 2-3 minutes after the call comes in or does not appear at all. The problem is that the broadcast receiver is unable to catch the intent. How can I solve this?

I couldn't make a try. because I couldn't find the root cause of the problem.


问:
why if my vector has real values it returns NaN in my bivariate analysis?
When I perform my function with real values to answer a specific question with a contingency table I get NaN.

I was expecting it to give me the real values that answer my question and the NaN result and I don't understand it because the vector values are real.


问:
Errors in PHP 7 - why set_error_handler() can't catch this type of error?

Fatal error: Uncaught TypeError...

Why is this an exception according to PHP if TypeError inherits from Error? Why can't set_error_handler() catch this type of error?

https://www.php.net/manual/en/class.typeerror.php

```<code>function myFunction(int $parameter)
{
    return $parameter;
}
function handler($errno, $errstr, $errfile, $errline)
{
    echo 'handler';
}
set_error_handler("handler");
myFunction('george');
</code>```

Body:
Fatal error: Uncaught TypeError...

Why is this an exception according to PHP if TypeError inherits from Error? Why can't set_error_handler() catch this type of error?

https://www.php.net/manual/en/class.typeerror.php

function myFunction(int $parameter)
{
    return $parameter;
}
function handler($errno, $errstr, $errfile, $errline)
{
    echo 'handler';
}
set_error_handler("handler");
myFunction('george');


问:
How to update internal data using use_data
I would like my script to access internal data that can be updated.  The data will be countries visited and the date.  Not a high frequency data set, so doesn't justify using a database.

These are the lines I tried:

```<code>country_vis <- bind_rows(country_vis, c(country = new_country, date = entry_date))
usethis::use_data(country_vis, internal = TRUE, overwrite = TRUE, version = 3)
</code>```

the bind_rows is fine, but the data is not updated.

Do I have to rebuild the package or reference an environment?

or,

Is this not a legitimate use of use_data? What would be the better way?

Body:
I would like my script to access internal data that can be updated.  The data will be countries visited and the date.  Not a high frequency data set, so doesn't justify using a database.

These are the lines I tried:

country_vis <- bind_rows(country_vis, c(country = new_country, date = entry_date))
usethis::use_data(country_vis, internal = TRUE, overwrite = TRUE, version = 3)

the bind_rows is fine, but the data is not updated.

Do I have to rebuild the package or reference an environment?

or,

Is this not a legitimate use of use_data? What would be the better way?


问:
Android Studio 2021.3.1 doesn't exit
Android Studio 2021.3.1 doesn't exit. I click close button and it crashes and gets stuck on the screen.  Windows can't close it. I can close with task manager or by rebooting.

How can I fix this?

```<code>java.util.MissingResourceException: Registry key vcs.annotations.preload is not defined
    at com.intellij.openapi.util.registry.Registry.getBundleValue(Registry.java:164)
    at com.intellij.openapi.util.registry.RegistryValue.resetToDefault(RegistryValue.java:294)
    at AnnotationsPreloaderEnabler$1.appClosing(AnnotationsPreloaderEnabler.java:21)
    at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:642)
    at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:620)
    at com.intellij.util.messages.impl.MessageBusImpl.deliverMessage(MessageBusImpl.java:417)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:390)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:372)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:33)
    at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.invoke(MessageBusImpl.java:179)
    at com.sun.proxy.$Proxy57.appClosing(Unknown Source)
    at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:574)
    at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:554)
    at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:543)
    at com.intellij.openapi.application.ex.ApplicationEx.exit(ApplicationEx.java:75)
    at com.intellij.ide.actions.ExitAction.actionPerformed(ExitAction.java:20)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:239)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:260)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:239)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$performAction$0(ActionMenuItem.java:277)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:236)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:67)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.performAction(ActionMenuItem.java:269)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:284)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$2(ActionMenuItem.java:111)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:111)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:541)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:571)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6654)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at java.desktop/java.awt.Component.processEvent(Component.java:6419)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
</code>```

Title: Android Studio 2021.3.1 doesn't exit

Body:
Android Studio 2021.3.1 doesn't exit. I click close button and it crashes and gets stuck on the screen.  Windows can't close it. I can close with task manager or by rebooting.

How can I fix this?

java.util.MissingResourceException: Registry key vcs.annotations.preload is not defined
    at com.intellij.openapi.util.registry.Registry.getBundleValue(Registry.java:164)
    at com.intellij.openapi.util.registry.RegistryValue.resetToDefault(RegistryValue.java:294)
    at AnnotationsPreloaderEnabler$1.appClosing(AnnotationsPreloaderEnabler.java:21)
    at com.intellij.util.messages.impl.MessageBusImpl.invokeMethod(MessageBusImpl.java:642)
    at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:620)
    at com.intellij.util.messages.impl.MessageBusImpl.deliverMessage(MessageBusImpl.java:417)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:390)
    at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:372)
    at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:33)
    at com.intellij.util.messages.impl.MessageBusImpl$MessagePublisher.invoke(MessageBusImpl.java:179)
    at com.sun.proxy.$Proxy57.appClosing(Unknown Source)
    at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:574)
    at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:554)
    at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:543)
    at com.intellij.openapi.application.ex.ApplicationEx.exit(ApplicationEx.java:75)
    at com.intellij.ide.actions.ExitAction.actionPerformed(ExitAction.java:20)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:239)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:260)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:239)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$performAction$0(ActionMenuItem.java:277)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:236)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:67)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.performAction(ActionMenuItem.java:269)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:284)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$2(ActionMenuItem.java:111)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:111)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:541)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:571)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6654)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at java.desktop/java.awt.Component.processEvent(Component.java:6419)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)


问:
Retaining unknown keys during JSON (de)serialization with Codable
I'm using Codable to convert between JSON and a Swift object. The process goes like this:

JSON -> Swift object

Modify the Swift object

Swift object -> JSON

The issue is that if the original JSON contains unknown keys, they are removed during the conversion to the Swift object and then back to JSON. Is there a way to retain these unknown keys during the conversion process?


问:
unable to start angular app due to unkwown error
I am getting the following error::

```<code>Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'.

14    { path: "auth", loadChildren: ()=> import("./auth/auth.module").then(m=>m.AuthModule)},
</code>```

this is the file that is giving me the issue:

```<code>const routes: Routes = [
  { path: "", component: PostListComponent },
  { path: "create", component: PostCreateComponent, canActivate: [AuthGuard] },
  { path: "edit/:postId", component: PostCreateComponent, canActivate: [AuthGuard] },
  // { path: "auth", loadChildren: "./auth/auth.module#AuthModule"}, // old line being replaced

   { path: "auth", loadChildren: ()=> import("./auth/auth.module").then(m=>m.AuthModule)},   // new line that replaced old line
  { path: "jobCreate", component: JobCreateComponent, canActivate: [AuthGuard]},

];
</code>```

I found this article online that had the same issue I had:: https://bobbyhadz.com/blog/typescript-dynamic-imports-only-supported-when-module
Angular 8 - Lazy loading modules : Error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'

I tried to modify the tsconfig.json file to the following::

```<code>{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "commonjs", //  set to esnext
 // "module": "esnext", // I tried this and it didnt work either
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}
</code>```

question:
how do i fix this?
I am not sure which node_module this is dependent on, but could I possible reverse to a earlier version to avoid this issue?

Body:
I am getting the following error::

Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'.

14    { path: "auth", loadChildren: ()=> import("./auth/auth.module").then(m=>m.AuthModule)},

this is the file that is giving me the issue:

const routes: Routes = [
  { path: "", component: PostListComponent },
  { path: "create", component: PostCreateComponent, canActivate: [AuthGuard] },
  { path: "edit/:postId", component: PostCreateComponent, canActivate: [AuthGuard] },
  // { path: "auth", loadChildren: "./auth/auth.module#AuthModule"}, // old line being replaced

   { path: "auth", loadChildren: ()=> import("./auth/auth.module").then(m=>m.AuthModule)},   // new line that replaced old line
  { path: "jobCreate", component: JobCreateComponent, canActivate: [AuthGuard]},

];

I found this article online that had the same issue I had:: https://bobbyhadz.com/blog/typescript-dynamic-imports-only-supported-when-module
Angular 8 - Lazy loading modules : Error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'

I tried to modify the tsconfig.json file to the following::

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "commonjs", //  set to esnext
 // "module": "esnext", // I tried this and it didnt work either
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

question:
how do i fix this?
I am not sure which node_module this is dependent on, but could I possible reverse to a earlier version to avoid this issue?


问:
Flutter error: Task :app:processDebugMainManifest FAILED
The error:

```<code>C:\Users\DELL\OneDrive\Bureaublad\taxi_app\android\app\src\main\AndroidManifest.xml:9:9-42 Error:
    Attribute application@name at AndroidManifest.xml:9:9-42 requires a placeholder substitution but no value for <applicationName> is provided.
C:\Users\DELL\OneDrive\Bureaublad\taxi_app\android\app\src\debug\AndroidManifest.xml Error:
        Validation failed, exiting
</code>```

AndroidManifest.xml:

```<code><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.praveeshramroop.athena">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<application
    android:name="${applicationName}"
    android:label="athena"
    android:icon="@mipmap/ic_launcher">

    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="NEVER EXPOSE THIS"/>

    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        <intent-filter>
            <action android:name="FLUTTER_NOTIFICATION_CLICK" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</code>```

This is the error, I'm getting and no idea how to solve it. There seems to be almost no post about this particular problem. Does anyone have a solution? If any further information required, do let me know.

Body:
The error:

C:\Users\DELL\OneDrive\Bureaublad\taxi_app\android\app\src\main\AndroidManifest.xml:9:9-42 Error:
    Attribute application@name at AndroidManifest.xml:9:9-42 requires a placeholder substitution but no value for <applicationName> is provided.
C:\Users\DELL\OneDrive\Bureaublad\taxi_app\android\app\src\debug\AndroidManifest.xml Error:
        Validation failed, exiting

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.praveeshramroop.athena">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<application
    android:name="${applicationName}"
    android:label="athena"
    android:icon="@mipmap/ic_launcher">

    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="NEVER EXPOSE THIS"/>

    <activity
        android:name=".MainActivity"
        android:exported="true"
        android:launchMode="singleTop"
        android:theme="@style/LaunchTheme"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
        android:hardwareAccelerated="true"
        android:windowSoftInputMode="adjustResize">

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        <intent-filter>
            <action android:name="FLUTTER_NOTIFICATION_CLICK" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>
<meta-data
android:name="flutterEmbedding"
android:value="2" />

This is the error, I'm getting and no idea how to solve it. There seems to be almost no post about this particular problem. Does anyone have a solution? If any further information required, do let me know.


问:
Why Firebase show negative crash free user for my app

I have an Android app which has Firebase Crashlytics enabled, I updated my app this morning (12 hours ago) and on Firebase app status is need investigation and crash free user are in negative number -9.06%. when i check Crashlytics it has only 3 crashes among 10% active users, this app has 600K users all together. On playstore it also has the same 3 crashes.

I checked on play store it looks all okay.

Firebase crashlytics image says only 5 events (crash there)

if i check crash reports of all version, there is no such things , almost 15,16 crashes altogether
screen shot


问:
multi-cursor functionality in VSCode is not working (Windows 10)
I dont use VSCode specifically because I've always had trouble getting the multi-click functionality to work correctly. Microsoft mentions here that there might be an NVIDIA setting that is disabling it which could be the case as I have an NVIDIA GPU. But I still would like to use VSCode.

Does anyone know how to fix this?


问:
AG Grid Not showing icons
I am trying to change the default checkbox in AG Grid to custom SVG I have made. The documentation says that AG Grid overrides browser checkboxes to show an icon but that is not the case in my project. I see the default browser provided checkboxes.(Tested in chrome and safari)

I've tried multiple themes too and still no icons.

I am using the AG Grid Svelte wrapper from here:
https://ag-grid-svelte.michael.kim/guide/overview/

Title: AG Grid Not showing icons


问:
Alert on top 10 postgres query by count
I have a datadog dashboard tracking the top 20 slow queries.
Imagine a scenario - a new deployment causes a query to pop up on the top 20 dashboard.
How can I get DD to alert me on this new query?
Recently we had an incident where a new query popped up and started consuming a lot of resources and causing a SEV1 incident. It would have helped immensely to be alerted earlier so we could take the right action.
We don't have the luxury of a performance-testing environment.
Would I have to write something custom ( which would compare snapshots from today and yesterday and if something shows up alert?)?</p>

Title: Alert on top 10 postgres query by count


问:
Stored procedure executed via task fails - Error mentions UDF instead of stored procedure
I am trying to call a stored procedure via a task, but keep on getting the error:

SQL compilation error:

Unknown user-defined function

STAGING_SILVER.MARKETING.SP_UPDATE_MSCV_SOURCE

I have granted usage of database / schema where the task and stored procedure live to the role calling the procedure but still same error.

The stored procedure is long but here is the beginning:

```<code>CREATE OR REPLACE PROCEDURE STAGING_SILVER.MARKETING.SP_UPDATE_MSCV_SOURCE()
RETURNS NUMBER(38,0)
LANGUAGE SQL
EXECUTE AS OWNER
AS 'declare

  rows_inserted integer     default 0;
  rows_updated  integer     default 0;
  status        integer     default 0;

begin.....
</code>```

And the task calling the stored procedure is defined as :

```<code>create or replace task STAGING_SILVER.MARKETING.UPDATE_MSCV_SOURCE
    warehouse=STAGING_FT_WH
    schedule='using cron 0 0 30 2 1 Pacific/Auckland'
    as call STAGING_SILVER.MARKETING.SP_UPDATE_MSCV_SOURCE();
</code>```

I am running out of things to try so posting the question here. I also find it weird that the error mentions a user defined function instead of a procedure... Any advice or direction would be much appreciated.

Body:
I am trying to call a stored procedure via a task, but keep on getting the error:

SQL compilation error:

Unknown user-defined function

STAGING_SILVER.MARKETING.SP_UPDATE_MSCV_SOURCE

I have granted usage of database / schema where the task and stored procedure live to the role calling the procedure but still same error.

The stored procedure is long but here is the beginning:

CREATE OR REPLACE PROCEDURE STAGING_SILVER.MARKETING.SP_UPDATE_MSCV_SOURCE()
RETURNS NUMBER(38,0)
LANGUAGE SQL
EXECUTE AS OWNER
AS 'declare

  rows_inserted integer     default 0;
  rows_updated  integer     default 0;
  status        integer     default 0;

begin.....

And the task calling the stored procedure is defined as :

create or replace task STAGING_SILVER.MARKETING.UPDATE_MSCV_SOURCE
    warehouse=STAGING_FT_WH
    schedule='using cron 0 0 30 2 1 Pacific/Auckland'
    as call STAGING_SILVER.MARKETING.SP_UPDATE_MSCV_SOURCE();

I am running out of things to try so posting the question here. I also find it weird that the error mentions a user defined function instead of a procedure... Any advice or direction would be much appreciated.


问:
Php header 301 redirect still let google to index content but now from my redirected domain
I've redirect my oldsite.tld site via PHP header like this.

```<code><?php
$url_sufix = "blabla";
header("Location: http://www.newsite.tld/".$url_sufix, true, 301);
exit;
</code>```

After 3 mo I still can find fresh indexed content on google for oldsite.tld, with content and url_sufix from newsite.tld
What am I doing wrong?

Body:
I've redirect my oldsite.tld site via PHP header like this.

<?php
$url_sufix = "blabla";
header("Location: http://www.newsite.tld/".$url_sufix, true, 301);
exit;

After 3 mo I still can find fresh indexed content on google for oldsite.tld, with content and url_sufix from newsite.tld
What am I doing wrong?


问:
Scraping an infinite scroll page using Cheerio Javascript
I'm trying to grab usernames on this page, and this code works well.

The current issue is there's infinite scrolling on the page, and I'd like to initiate a scroll inside the fetch data function so that i can grab all the usernames on the following pages.

I've seen some say either use puppeteer or figure out what request the page is making upon scroll and simulate that request...

The only problem is my HTTPS and HTML knowledge is very limited, as I'm a beginner in this world.

Any help is appreciated, especially with an explanation. Love to learn as much as possible, thanks.

```<code>const express = require("express");
const cheerio = require("cheerio");
const request = require("request-promise");
const pretty = require("pretty");
const { default: axios } = require("axios");
const app = express();
const port = process.env.port || 5000;

let usernames = [];
let leaderboard = {};

const url = "https://poshmark.com/category/Men-Jackets_&_Coats?sort_by=like_count&all_size=true&my_size=false";

const fetchData = async () => {

    try {
        let res = await axios.get(url);
        let $ = await cheerio.load(res.data);

        const itemArea = $(".tiles_container a.tile__creator span");

        itemArea.each(function (i, element) {
            //console.log('username: ', $(element).text());
            usernames.push($(element).text());
        });

    } catch (error) {
        console.log(error)
        return
    }

    initLeaderboard();
};

const initLeaderboard = async () => {
    usernames.forEach(function (username) {
        leaderboard[username] = 0
    });

    sortLeaderboard();
};

const sortLeaderboard = async () => {
    usernames.forEach(function (entry) {

        if (entry in leaderboard) {
            leaderboard[entry] +=1
        };
    });

    console.log(leaderboard);
};

const connectServer = async () => {

    app.get("/states", (req, res) => {
        res.send(states);

    });
    app.listen(port, () => ("Server Running"));
};

function main() {
    fetchData();
};

main();
</code>```

I've spent a lot of time googling the different ways to solve this. I've found no specific cheerio examples, and I don't feel like copying and pasting code. Would rather find a fix that I understand so I can implement it, and learn from it as well as fully understand the program I'm building.

Body:
I'm trying to grab usernames on this page, and this code works well.

The current issue is there's infinite scrolling on the page, and I'd like to initiate a scroll inside the fetch data function so that i can grab all the usernames on the following pages.

I've seen some say either use puppeteer or figure out what request the page is making upon scroll and simulate that request...

The only problem is my HTTPS and HTML knowledge is very limited, as I'm a beginner in this world.

Any help is appreciated, especially with an explanation. Love to learn as much as possible, thanks.

const express = require("express");
const cheerio = require("cheerio");
const request = require("request-promise");
const pretty = require("pretty");
const { default: axios } = require("axios");
const app = express();
const port = process.env.port || 5000;

let usernames = [];
let leaderboard = {};

const url = "https://poshmark.com/category/Men-Jackets_&_Coats?sort_by=like_count&all_size=true&my_size=false";

const fetchData = async () => {

    try {
        let res = await axios.get(url);
        let $ = await cheerio.load(res.data);

        const itemArea = $(".tiles_container a.tile__creator span");

        itemArea.each(function (i, element) {
            //console.log('username: ', $(element).text());
            usernames.push($(element).text());
        });

    } catch (error) {
        console.log(error)
        return
    }

    initLeaderboard();
};

const initLeaderboard = async () => {
    usernames.forEach(function (username) {
        leaderboard[username] = 0
    });

    sortLeaderboard();
};

const sortLeaderboard = async () => {
    usernames.forEach(function (entry) {

        if (entry in leaderboard) {
            leaderboard[entry] +=1
        };
    });

    console.log(leaderboard);
};

const connectServer = async () => {

    app.get("/states", (req, res) => {
        res.send(states);

    });
    app.listen(port, () => ("Server Running"));
};

function main() {
    fetchData();
};

main();

I've spent a lot of time googling the different ways to solve this. I've found no specific cheerio examples, and I don't feel like copying and pasting code. Would rather find a fix that I understand so I can implement it, and learn from it as well as fully understand the program I'm building.


问:
MoveFile not resetting creation time attribute of file in original location after being moved
I am trying to call MoveFile to move a file to a new directory. Then make a new file with same name in the location it was moved from. I want the creation time attribute of the new file to be set to whatever the time is at the time the new file is created. I expected this would be the normal behavior when using MoveFile. But for some reason it keeps setting the creation time to the creation time of the old file.

```<code>FILE* m_pFile;

::MoveFile(bstrRequestedFile, bstrTimestampLogFile);

m_pFile = ::_wfsopen(bstrRequestedFile, L"wt", _SH_DENYNO);
</code>```

When I step through the code slowly or add a sleep between the Move and open lines the creation time will be current when the file is opened. I'd like to avoid the sleep if possible. Also I have tried things like SetFileTime but was not working for me. The file is getting moved successfully and does not show in the original location until the open line.

Body:
I am trying to call MoveFile to move a file to a new directory. Then make a new file with same name in the location it was moved from. I want the creation time attribute of the new file to be set to whatever the time is at the time the new file is created. I expected this would be the normal behavior when using MoveFile. But for some reason it keeps setting the creation time to the creation time of the old file.

FILE* m_pFile;

::MoveFile(bstrRequestedFile, bstrTimestampLogFile);

m_pFile = ::_wfsopen(bstrRequestedFile, L"wt", _SH_DENYNO);

When I step through the code slowly or add a sleep between the Move and open lines the creation time will be current when the file is opened. I'd like to avoid the sleep if possible. Also I have tried things like SetFileTime but was not working for me. The file is getting moved successfully and does not show in the original location until the open line.


问:
React - Store data in localStorage after click on Icon
I'm trying to save data on localStorage if the user clicked on a like button and remove it if the user unclicked it. This is my code

```<code>const [menu, setMenu] = useState([]);
const [iconStates, setIconStates] = useState({});
...
...
...
{recipes.reduce(reduceRecipes, []).map((item, index) => (
          <Carousel.Item key={item._id}>
          <div className="d-flex justify-content-center">
            <Row>
            {item.map((item, index) => {
              return (
                <Col sm>
                <Card key={item._id} style={{ width: "18rem" }}>
                  <Card.Img variant="top" src={item.photo_location} />
                  <Card.Body>
                  <div className="title-container">
                    <Card.Title>
                    {item.name}
                    <RiHeart3Fill
                    className={
                      iconStates[item._id] ? 'heart active' : 'heart'
                    }
                    onClick={() => {
                        if (menu.includes(item)) {
                          setMenu(menu.filter(menuItem => menuItem._id !== item._id));
                        } else {
                          setMenu(menu.concat(item));
                        }
                        localStorage.setItem('menu', JSON.stringify(menu));
                        setIconStates({...iconStates, [item._id]: !iconStates[item._id]})
                    }}
                  />
</code>```

I Codesandbox version is here.

It doesn't work as it supposed to do now, when I click the icon on one item it doesn't get added until I click it again, and if I unclicked any item everything in the LocalStorage is deleted. can anyone elaborate on how to fix this?

Body:
I'm trying to save data on localStorage if the user clicked on a like button and remove it if the user unclicked it. This is my code

const [menu, setMenu] = useState([]);
const [iconStates, setIconStates] = useState({});
...
...
...
{recipes.reduce(reduceRecipes, []).map((item, index) => (
          <Carousel.Item key={item._id}>

            <Row>
            {item.map((item, index) => {
              return (
                <Col sm>
                <Card key={item._id} style={{ width: "18rem" }}>
                  <Card.Img variant="top" src={item.photo_location} />
                  <Card.Body>

                    <Card.Title>
                    {item.name}
                    <RiHeart3Fill
                    className={
                      iconStates[item._id] ? 'heart active' : 'heart'
                    }
                    onClick={() => {
                        if (menu.includes(item)) {
                          setMenu(menu.filter(menuItem => menuItem._id !== item._id));
                        } else {
                          setMenu(menu.concat(item));
                        }
                        localStorage.setItem('menu', JSON.stringify(menu));
                        setIconStates({...iconStates, [item._id]: !iconStates[item._id]})
                    }}
                  />

I Codesandbox version is here.

It doesn't work as it supposed to do now, when I click the icon on one item it doesn't get added until I click it again, and if I unclicked any item everything in the LocalStorage is deleted. can anyone elaborate on how to fix this?


问:
Utf8JsonReader from a Stream
I'm trying to read a sequence of JSON objects from a network stream. This involves finding complete JSON objects and returning them one by one. As soon as a complete JSON object was received, I need to have it. Anything else that follows that JSON object is for the next object and must only be used when the next complete object was received.

I would have thought that the Utf8JsonReader class could do that but apparently it cannot accept a Stream of any kind. It even seems to be unwanted to have that possibility.

Now I'm wondering if it's possible at all to use .NET's shiny new JSON parser to read from a stream when I don't know when data arrives and how much of it. Do I need to split the JSON object messages manually or can the already existing reader just stop when it has something and continue when the next thing is available? I mean, if it can do that on a predefined array of bytes, it could surely also do it with some waiting in between until more data is available. That just doesn't seem to be exposed in the public API. Or did I miss something?

The JsonDocument.ParseAsync(Stream) method cannot be used because it would read the stream to the end. That doesn't make sense for a network stream that stays open for a long time and just reads some data from time to time.

Title: Utf8JsonReader from a Stream


问:
Uncaught SyntaxError: Identifier 'location' has already been declared (at app.js:1:1)
Not sure why I am getting this error. I double checked to see if I was repeating myself or if I potentially had other files open with the same name but that is not the case.</p>
```<code>let img = document.querySelector("img")
const button = document.querySelector("button")
let name = document.querySelector("#name")
let lastName = document.querySelector("#lastName")
let location = document.querySelector("#location")
let phone = document.querySelector("#phone")
let email = document.querySelector("#email")

const listOfNames = ["Chase", "Bob", "Kyle", "Jason", "Ryan", "Devin", "Josh", "Mark"]

const listOfLastNames = ["Hudson", "Booker", "Johnson", "Miller", "Jones", "Anderson", "Brown", "Smith"]

const listOfLocations = ["Arizona", "California", "Florida", "Colorado", "Washington", "Texas", "Georgia", "New York"]

const listOfPhoneNumbers = ["225-392-7634", "505-614-4307", "415-429-4932", "802-326-5981", "407-248-7518", "646-423-3519", "864-557-5057", "570-835-9163"]

const listOfEmail = ["layla81@yahoo.com", "colleen1@yahoo.com", "garrett.leffler@gmail.com", "harry_schumm58@gmail.com", "cary68@gmail.com", "amy_yost@yahoo.com", "nick81@hotmail.com", "nikita.towne@yahoo.com"]

button.addEventListener("click", function () {
    let randNum = Math.floor(Math.random() * 7)
    console.log(randNum)
})
</code>```

Body:
Not sure why I am getting this error. I double checked to see if I was repeating myself or if I potentially had other files open with the same name but that is not the case.

let img = document.querySelector("img")
const button = document.querySelector("button")
let name = document.querySelector("#name")
let lastName = document.querySelector("#lastName")
let location = document.querySelector("#location")
let phone = document.querySelector("#phone")
let email = document.querySelector("#email")

const listOfNames = ["Chase", "Bob", "Kyle", "Jason", "Ryan", "Devin", "Josh", "Mark"]

const listOfLastNames = ["Hudson", "Booker", "Johnson", "Miller", "Jones", "Anderson", "Brown", "Smith"]

const listOfLocations = ["Arizona", "California", "Florida", "Colorado", "Washington", "Texas", "Georgia", "New York"]

const listOfPhoneNumbers = ["225-392-7634", "505-614-4307", "415-429-4932", "802-326-5981", "407-248-7518", "646-423-3519", "864-557-5057", "570-835-9163"]

const listOfEmail = ["layla81@yahoo.com", "colleen1@yahoo.com", "garrett.leffler@gmail.com", "harry_schumm58@gmail.com", "cary68@gmail.com", "amy_yost@yahoo.com", "nick81@hotmail.com", "nikita.towne@yahoo.com"]

button.addEventListener("click", function () {
    let randNum = Math.floor(Math.random() * 7)
    console.log(randNum)
})


问:
How effective is this Xss Filter?
What I did here is join every single value of the request body in a single string and then loop through each character, in case a character isn't part of accepted values then I send an xss warning, otherwise next() is called.

```<code>function whiteListing(req, res, next) {
    const allowedValues = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@.,!?'
    let requestBodyValues = Array.from(Object.values(req.body).join(''))
    for (letter of requestBodyValues)
        if (!allowedValues.includes(letter)) return res.send('-xss warning page-')
    next()
}
</code>```

I am also using other libraries that escape html values but I am still curious about the practicality of this method. If there is a way for someone to bypass this method please tell me!

Title: How effective is this Xss Filter?

Body:
What I did here is join every single value of the request body in a single string and then loop through each character, in case a character isn't part of accepted values then I send an xss warning, otherwise next() is called.

function whiteListing(req, res, next) {
    const allowedValues = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@.,!?'
    let requestBodyValues = Array.from(Object.values(req.body).join(''))
    for (letter of requestBodyValues)
        if (!allowedValues.includes(letter)) return res.send('-xss warning page-')
    next()
}

I am also using other libraries that escape html values but I am still curious about the practicality of this method. If there is a way for someone to bypass this method please tell me!


问:
Using Atlasians Insight API to bring over AWS resources
I'm very new to this API. I've been able to figure out everything in this link up until step 3 ([api docs][1]). I have a sample payload of what we want to import, but I have no idea what the schema/mapping should be. The example provided [here][2], for a hard drive does not make sense to me at all. I've even tried sending the exact payload/mapping from that example and get hit with a 409 error. Any help would be great.

Example of what I want to bring in:

```<code>   {
  "ARN": "arn:aws:codedeploy:ca-central-1:030375219570:deploymentconfig:CodeDeployDefault.LambdaCanary10Percent10Minutes",
  "availabilityZone": "Not Applicable",
  "awsAccountId": "030375219570",
  "awsRegion": "ca-central-1",
  "configuration": {
    "computePlatform": "Lambda",
    "deploymentConfigId": "00000000-0000-0000-0000-000000000008",
    "deploymentConfigName": "CodeDeployDefault.LambdaCanary10Percent10Minutes",
    "trafficRoutingConfig": {
      "timeBasedCanary": {
        "canaryInterval": 10,
        "canaryPercentage": 10
      },
      "type": "TimeBasedCanary"
    }
  },
  "configurationItemCaptureTime": "2022-02-09T20:42:23.445Z",
  "configurationItemStatus": "ResourceDiscovered",
  "configurationItemVersion": "1.3",
  "configurationStateId": 1644439343445,
  "configurationStateMd5Hash": "",
  "relatedEvents": [],
  "relationships": [],
  "resourceId": "00000000-0000-0000-0000-000000000008",
  "resourceName": "CodeDeployDefault.LambdaCanary10Percent10Minutes",
  "resourceType": "AWS::CodeDeploy::DeploymentConfig",
  "supplementaryConfiguration": {},
  "tags": {}
  }
</code>```

If anyone knows how the mapping/schema would look for something like the above, I'm all ears.

thanks
[1]: https://developer.atlassian.com/cloud/assets/imports/workflow/
[2]: https://developer.atlassian.com/cloud/assets/imports/schema-and-mapping/?utm_source=%2Fcloud%2Finsight%2Fimports%2Fschema-and-mapping%2F&utm_medium=301#external-imports-schema-and-mapping

Body:
I'm very new to this API. I've been able to figure out everything in this link up until step 3 ([api docs][1]). I have a sample payload of what we want to import, but I have no idea what the schema/mapping should be. The example provided [here][2], for a hard drive does not make sense to me at all. I've even tried sending the exact payload/mapping from that example and get hit with a 409 error. Any help would be great.

Example of what I want to bring in:

   {
  "ARN": "arn:aws:codedeploy:ca-central-1:030375219570:deploymentconfig:CodeDeployDefault.LambdaCanary10Percent10Minutes",
  "availabilityZone": "Not Applicable",
  "awsAccountId": "030375219570",
  "awsRegion": "ca-central-1",
  "configuration": {
    "computePlatform": "Lambda",
    "deploymentConfigId": "00000000-0000-0000-0000-000000000008",
    "deploymentConfigName": "CodeDeployDefault.LambdaCanary10Percent10Minutes",
    "trafficRoutingConfig": {
      "timeBasedCanary": {
        "canaryInterval": 10,
        "canaryPercentage": 10
      },
      "type": "TimeBasedCanary"
    }
  },
  "configurationItemCaptureTime": "2022-02-09T20:42:23.445Z",
  "configurationItemStatus": "ResourceDiscovered",
  "configurationItemVersion": "1.3",
  "configurationStateId": 1644439343445,
  "configurationStateMd5Hash": "",
  "relatedEvents": [],
  "relationships": [],
  "resourceId": "00000000-0000-0000-0000-000000000008",
  "resourceName": "CodeDeployDefault.LambdaCanary10Percent10Minutes",
  "resourceType": "AWS::CodeDeploy::DeploymentConfig",
  "supplementaryConfiguration": {},
  "tags": {}
  }

If anyone knows how the mapping/schema would look for something like the above, I'm all ears.

thanks
[1]: https://developer.atlassian.com/cloud/assets/imports/workflow/
[2]: https://developer.atlassian.com/cloud/assets/imports/schema-and-mapping/?utm_source=%2Fcloud%2Finsight%2Fimports%2Fschema-and-mapping%2F&utm_medium=301#external-imports-schema-and-mapping


问:
ffmpeg Installation Error Through Homebrew
I was looking to download ffmpeg to convert some mp4/mp3 files in python but was met with an error I could not find the solution for elsewhere.

When attempting to install ffmpeg on terminal, I was met by this error.

fatal: Could not resolve HEAD to a revision Warning: No available formula with the name "ffmpeg". ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching for a previously deleted formula (in the last month)... Error: No previously deleted formula found. ==> Searching taps on GitHub... Error: No formulae found in taps.

I was expecting everything to work perfectly but obviously it hasn't. I looked into other users that had similar errors and went through what they did to solve their problems but was not able get anything to work out.


问:
How to get Playwright test result index.html on Jenkins
I have a freestyle project in Jenkins to run Playwright functional tests. During the build  execute shell step, I execute some Playwright functional tests. I have a setup locally that will give me the Playwright test report file playwright-report/index.html with this config:

```<code>// playwright.config.js
// @ts-check

/** @type {import('@playwright/test').PlaywrightTestConfig} */
const config = {
  reporter: [['html', {
    open: 'never',
    host: '0.0.0.0',
    port: 9223,
  }]],
};

module.exports = config;
</code>```

I am able to open and view this file locally but I am trying to figure out how to get this file on Jenkins Job. During the build running, I was able to verify that the file playwright-report/index.html does get created by printing out the directory withpwd, which returns root/run . So my root/run looks like this :

```<code>file-A.js
file-B.js
//...other folders
playwright-report
</code>```

And when I cd playwright-report, I do see index.html file. However, all of the files, folders under root/run get archived after build, except for my playwright-report folder.

My post-build archive artifacts set up is '**/.' so I expect Jenkins to archive everything. My understanding is archive artifacts step copies the selected artifacts in the %JENKINS_HOME%/jons/MY_JOB/builds... on the master server. And it will only archive files under my WORKSPACE. Is this correct ?

So I am not sure why only my playwright-report folder is deleted after the build and it is not archived. I tried to create a folder playwright-dupe during the build and then copy playwright-report to playwright-dupe during the build, but neither playwright-dupe nor  playwright-folder is archived.

So I think the directory root/run is different from the directory  WORKSPACE ? I can't find any documentation about copying a folder from root/run and put it in WORKSPACE.

Can someone help me please ? My goal is to figure out how to access that index.html file Playwright report generates on Jenkins with each Jenkin jobs to build functional tests. Thank you

My environment variables:

```<code>JENKINS_HOME:  var/lib/jenkins
pwd: /home/jenkins/agent
WORKSPACE: home/jenkins/agent/workspace/<project-name>
</code>```

So to sum up I tried:

Create a duplicate folder and copy the result playwright-report over during build step

Change archive set up todist/**, home/jenkins/agent/workspace/<project-name>/**/*.*, **/playwright-dupe

Body:
I have a freestyle project in Jenkins to run Playwright functional tests. During the build  execute shell step, I execute some Playwright functional tests. I have a setup locally that will give me the Playwright test report file playwright-report/index.html with this config:

// playwright.config.js
// @ts-check

/** @type {import('@playwright/test').PlaywrightTestConfig} */
const config = {
  reporter: [['html', {
    open: 'never',
    host: '0.0.0.0',
    port: 9223,
  }]],
};

module.exports = config;

I am able to open and view this file locally but I am trying to figure out how to get this file on Jenkins Job. During the build running, I was able to verify that the file playwright-report/index.html does get created by printing out the directory withpwd, which returns root/run . So my root/run looks like this :

file-A.js
file-B.js
//...other folders
playwright-report

And when I cd playwright-report, I do see index.html file. However, all of the files, folders under root/run get archived after build, except for my playwright-report folder.

My post-build archive artifacts set up is '**/.' so I expect Jenkins to archive everything. My understanding is archive artifacts step copies the selected artifacts in the %JENKINS_HOME%/jons/MY_JOB/builds... on the master server. And it will only archive files under my WORKSPACE. Is this correct ?

So I am not sure why only my playwright-report folder is deleted after the build and it is not archived. I tried to create a folder playwright-dupe during the build and then copy playwright-report to playwright-dupe during the build, but neither playwright-dupe nor  playwright-folder is archived.

So I think the directory root/run is different from the directory  WORKSPACE ? I can't find any documentation about copying a folder from root/run and put it in WORKSPACE.

Can someone help me please ? My goal is to figure out how to access that index.html file Playwright report generates on Jenkins with each Jenkin jobs to build functional tests. Thank you

My environment variables:

JENKINS_HOME:  var/lib/jenkins
pwd: /home/jenkins/agent
WORKSPACE: home/jenkins/agent/workspace/<project-name>

So to sum up I tried:

Create a duplicate folder and copy the result playwright-report over during build step

Change archive set up todist/**, home/jenkins/agent/workspace/<project-name>/**/*.*, **/playwright-dupe


问:
ImportError: DLL load failed while importing _path: The specified module could not be found. When importing matplotlib
I've searched around for solutions, and nothing I have seen can solve this error. I am making a python program to make a GUI of a flight software, and I am importing matplotlib. Here is the code (I am on Windows 11 Intel) I have reinstalled the package using pip, I have reinstalled python, and I only have 1 Version of Python on my computer, Python 11. I have restarted my computer, and restarted my IDE. Nothing has worked. My IDE is VSCODE.:

```<code>import tkinter as tk
from tkinter import ttk
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.figure import Figure
import random

class FlightSoftware(tk.Tk):
    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)

        # Set up the GUI
        tk.Tk.wm_title(self, "Flight Software")
        container = tk.Frame(self)
        container.pack(side="top", fill="both", expand=True)
        container.grid_rowconfigure(0, weight=1)
        container.grid_columnconfigure(0, weight=1)

        self.frames = {}
        for F in (StartPage, GraphPage):
            frame = F(container, self)
            self.frames[F] = frame
            frame.grid(row=0, column=0, sticky="nsew")
        self.show_frame(StartPage)

    def show_frame(self, cont):
        frame = self.frames[cont]
        frame.tkraise()

class StartPage(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        label = tk.Label(self, text="Flight Software", font=("Arial", 18))
        label.pack(pady=10, padx=10)

        launch_button = ttk.Button(self, text="Launch", command=lambda: controller.show_frame(GraphPage))
        launch_button.pack()

class GraphPage(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        label = tk.Label(self, text="Graphs", font=("Arial", 18))
        label.pack(pady=10, padx=10)

        # Set up the matplotlib figures
        self.fig1 = Figure(figsize=(5,5), dpi=100)
        self.subplot1 = self.fig1.add_subplot(111)
        self.fig2 = Figure(figsize=(5,5), dpi=100)
        self.subplot2 = self.fig2.add_subplot(111)
        self.fig3 = Figure(figsize=(5,5), dpi=100)
        self.subplot3 = self.fig3.add_subplot(111)

        # Set up the matplotlib graph widgets
        self.canvas1 = FigureCanvasTkAgg(self.fig1, self)
        self.canvas1.draw()
        self.canvas2 = FigureCanvasTkAgg(self.fig2, self)
        self.canvas2.draw()
        self.canvas3 = FigureCanvasTkAgg(self.fig3, self)
        self.canvas3.draw()
        self.toolbar = NavigationToolbar2Tk(self.canvas1, self)
        self.toolbar.update()

        # Set up the weather data label
        self.weather_label = tk.Label(self, text="Weather Data:")
        self.weather_label.pack()

        # Set up the abort button
        abort_button = ttk.Button(self, text="Abort", command=lambda: controller.show_frame(StartPage))
        abort_button.pack()

        # Set up the matplotlib graph layout
        self.canvas1.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
        self.canvas2.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
        self.canvas3.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH, expand=True)

        # Set up the update function for the matplotlib graphs and weather data
        self.ani = matplotlib.animation.FuncAnimation(self.fig1, self.update_graph1, interval=1000)
        self.ani = matplotlib.animation.FuncAnimation(self.fig2, self.update_graph2, interval=1000)
        self.ani = matplotlib.animation.FuncAnimation(self.fig3, self.update_graph3, interval=1000)
        self.update_weather()

    def update_graph1(self, i):
        x = list(range(i, i+10))
        y = [random.uniform(-1, 1) for _ in range(10)]
        self.subplot1.clear()
        self.subplot1.plot(x, y)

    def update_graph2(self, i):
        x = list(range(i, i+10))
        y = [random.uniform(-1, 1) for _ in range(10)]
        self.subplot2.clear()
        self.subplot2.plot(x, y)

    def update_graph3(self, i):
        x = list(range(i, i+10))
        y = [random.uniform(-1, 1) for _ in range(10)]
        self.subplot3.clear()
        self.subplot3.plot(x, y)

    def update_weather(self):
        weather_data = "Temperature: {} C, Humidity: {}%, Pressure: {} Pa".format(random.uniform(15, 30), random.uniform(50, 100), random.uniform(100000, 1000000))
        self.weather_label.config(text="Weather Data: {}".format(weather_data))
        self.after(1000, self.update_weather)

app = FlightSoftware()
app.mainloop()
</code>```

Here is the error:

```<code>Traceback (most recent call last):
  File "c:\Users\mcqui\OneDrive\Desktop\ChatGPT rocket animation attempt\main.py", line 3, in <module>
    import matplotlib
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\__init__.py", line 113, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\colors.py", line 56, in <module>
    from matplotlib import _api, _cm, cbook, scale
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\scale.py", line 22, in <module>
    from matplotlib.ticker import (
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\ticker.py", line 138, in <module>
    from matplotlib import transforms as mtransforms
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\transforms.py", line 49, in <module>
    from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.
</code>```

Body:
I've searched around for solutions, and nothing I have seen can solve this error. I am making a python program to make a GUI of a flight software, and I am importing matplotlib. Here is the code (I am on Windows 11 Intel) I have reinstalled the package using pip, I have reinstalled python, and I only have 1 Version of Python on my computer, Python 11. I have restarted my computer, and restarted my IDE. Nothing has worked. My IDE is VSCODE.:

import tkinter as tk
from tkinter import ttk
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.figure import Figure
import random

class FlightSoftware(tk.Tk):
    def __init__(self, *args, **kwargs):
        tk.Tk.__init__(self, *args, **kwargs)

        # Set up the GUI
        tk.Tk.wm_title(self, "Flight Software")
        container = tk.Frame(self)
        container.pack(side="top", fill="both", expand=True)
        container.grid_rowconfigure(0, weight=1)
        container.grid_columnconfigure(0, weight=1)

        self.frames = {}
        for F in (StartPage, GraphPage):
            frame = F(container, self)
            self.frames[F] = frame
            frame.grid(row=0, column=0, sticky="nsew")
        self.show_frame(StartPage)

    def show_frame(self, cont):
        frame = self.frames[cont]
        frame.tkraise()

class StartPage(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        label = tk.Label(self, text="Flight Software", font=("Arial", 18))
        label.pack(pady=10, padx=10)

        launch_button = ttk.Button(self, text="Launch", command=lambda: controller.show_frame(GraphPage))
        launch_button.pack()

class GraphPage(tk.Frame):
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        label = tk.Label(self, text="Graphs", font=("Arial", 18))
        label.pack(pady=10, padx=10)

        # Set up the matplotlib figures
        self.fig1 = Figure(figsize=(5,5), dpi=100)
        self.subplot1 = self.fig1.add_subplot(111)
        self.fig2 = Figure(figsize=(5,5), dpi=100)
        self.subplot2 = self.fig2.add_subplot(111)
        self.fig3 = Figure(figsize=(5,5), dpi=100)
        self.subplot3 = self.fig3.add_subplot(111)

        # Set up the matplotlib graph widgets
        self.canvas1 = FigureCanvasTkAgg(self.fig1, self)
        self.canvas1.draw()
        self.canvas2 = FigureCanvasTkAgg(self.fig2, self)
        self.canvas2.draw()
        self.canvas3 = FigureCanvasTkAgg(self.fig3, self)
        self.canvas3.draw()
        self.toolbar = NavigationToolbar2Tk(self.canvas1, self)
        self.toolbar.update()

        # Set up the weather data label
        self.weather_label = tk.Label(self, text="Weather Data:")
        self.weather_label.pack()

        # Set up the abort button
        abort_button = ttk.Button(self, text="Abort", command=lambda: controller.show_frame(StartPage))
        abort_button.pack()

        # Set up the matplotlib graph layout
        self.canvas1.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
        self.canvas2.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
        self.canvas3.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH, expand=True)

        # Set up the update function for the matplotlib graphs and weather data
        self.ani = matplotlib.animation.FuncAnimation(self.fig1, self.update_graph1, interval=1000)
        self.ani = matplotlib.animation.FuncAnimation(self.fig2, self.update_graph2, interval=1000)
        self.ani = matplotlib.animation.FuncAnimation(self.fig3, self.update_graph3, interval=1000)
        self.update_weather()

    def update_graph1(self, i):
        x = list(range(i, i+10))
        y = [random.uniform(-1, 1) for _ in range(10)]
        self.subplot1.clear()
        self.subplot1.plot(x, y)

    def update_graph2(self, i):
        x = list(range(i, i+10))
        y = [random.uniform(-1, 1) for _ in range(10)]
        self.subplot2.clear()
        self.subplot2.plot(x, y)

    def update_graph3(self, i):
        x = list(range(i, i+10))
        y = [random.uniform(-1, 1) for _ in range(10)]
        self.subplot3.clear()
        self.subplot3.plot(x, y)

    def update_weather(self):
        weather_data = "Temperature: {} C, Humidity: {}%, Pressure: {} Pa".format(random.uniform(15, 30), random.uniform(50, 100), random.uniform(100000, 1000000))
        self.weather_label.config(text="Weather Data: {}".format(weather_data))
        self.after(1000, self.update_weather)

app = FlightSoftware()
app.mainloop()

Here is the error:

Traceback (most recent call last):
  File "c:\Users\mcqui\OneDrive\Desktop\ChatGPT rocket animation attempt\main.py", line 3, in <module>
    import matplotlib
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\__init__.py", line 113, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\colors.py", line 56, in <module>
    from matplotlib import _api, _cm, cbook, scale
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\scale.py", line 22, in <module>
    from matplotlib.ticker import (
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\ticker.py", line 138, in <module>
    from matplotlib import transforms as mtransforms
  File "C:\Users\mcqui\AppData\Local\Programs\Python\Python311\Lib\site-packages\matplotlib\transforms.py", line 49, in <module>
    from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.


问:
Create and retrieve "multi-level" data in JSON
For a course exercise, a friend of mine has to dynamize a website with a JSON. The problem occurs when I try to search for data on several levels. Basically, Elles wants to allow to choose ornaments. There are handles or screw covers available, and there are two of each. The problem is that I can't properly structure my JSON to make this possible, or to retrieve the data.

```<code>{
        "id" : 4,
        "nom":"Cercueil Les Borgia",
        "description": "Ce cercueil demi-tombeau en chêne massif , vous propose de le personnaliser en s'inspirant des jardins les plus fleuris mais aussi les plus dangereux",
        "prix" : 800  ,
        "image" :"medias/chenemassif1.png" ,
        "motifs":
            [
                {
                    "natureMo":"Fleur",
                    "prixMo": "30",
                    "disponibiliteMo":true
                },
                {
                    "natureMo":"Vichy",
                    "prixMo": "30",
                    "disponibiliteMo":true
                }
            ],
        "couleurs":
            [
                {
                    "nomCo": "Vert clair",
                    "code": "#93C97F"
                },
                {
                    "nomCo": "Violet",
                    "code": "#64527A"
                }
            ],
        "ornements": [
                {
                    "types": [
                        {
                            "Poignées": [
                                {
                                    "style": "Romaine",
                                    "prixOr": 22,
                                    "disponibiliteOr":true
                                },
                                {
                                    "style":"Flamme Eco",
                                    "prixOr":22,
                                    "disponibiliteOr":true
                                }
                            ]
                        },
                        {
                            "Cache-vis" : [
                                {
                                    "style":"Roseau",
                                    "prixOr":18,
                                    "disponibiliteOr":true
                                },
                                {
                                    "style":"Hexagonale",
                                    "prixOr":18,
                                    "disponibiliteOr":false
                                }
                            ]
                        }
                    ]
                }
            ]
        }
</code>```

I've tried to put both ornament types in one type category, and use it, but that doesn't work either when I try to retrieve the data.

```<code>res += '<h3>Ornements</h3>';

        for(l=0; l<doc[i].ornements.length; l++){

            var ornementsNaCer = doc[i].ornements[l].types;

            res += '<h4>'+ ornementsNaCer +'</h4>';
</code>```

Body:
For a course exercise, a friend of mine has to dynamize a website with a JSON. The problem occurs when I try to search for data on several levels. Basically, Elles wants to allow to choose ornaments. There are handles or screw covers available, and there are two of each. The problem is that I can't properly structure my JSON to make this possible, or to retrieve the data.

{
        "id" : 4,
        "nom":"Cercueil Les Borgia",
        "description": "Ce cercueil demi-tombeau en chêne massif , vous propose de le personnaliser en s'inspirant des jardins les plus fleuris mais aussi les plus dangereux",
        "prix" : 800  ,
        "image" :"medias/chenemassif1.png" ,
        "motifs":
            [
                {
                    "natureMo":"Fleur",
                    "prixMo": "30",
                    "disponibiliteMo":true
                },
                {
                    "natureMo":"Vichy",
                    "prixMo": "30",
                    "disponibiliteMo":true
                }
            ],
        "couleurs":
            [
                {
                    "nomCo": "Vert clair",
                    "code": "#93C97F"
                },
                {
                    "nomCo": "Violet",
                    "code": "#64527A"
                }
            ],
        "ornements": [
                {
                    "types": [
                        {
                            "Poignées": [
                                {
                                    "style": "Romaine",
                                    "prixOr": 22,
                                    "disponibiliteOr":true
                                },
                                {
                                    "style":"Flamme Eco",
                                    "prixOr":22,
                                    "disponibiliteOr":true
                                }
                            ]
                        },
                        {
                            "Cache-vis" : [
                                {
                                    "style":"Roseau",
                                    "prixOr":18,
                                    "disponibiliteOr":true
                                },
                                {
                                    "style":"Hexagonale",
                                    "prixOr":18,
                                    "disponibiliteOr":false
                                }
                            ]
                        }
                    ]
                }
            ]
        }

I've tried to put both ornament types in one type category, and use it, but that doesn't work either when I try to retrieve the data.

res += '
Ornements
';

        for(l=0; l<doc[i].ornements.length; l++){

            var ornementsNaCer = doc[i].ornements[l].types;

            res += '
'+ ornementsNaCer +'
';


问:
My content changes size when zoom in and out
I don't know why but my content changes its size when I zoom in or out on my window (chrome). Does anyone know why? This is my code: Its at the very end of the css and html. If anyone knows what to do It would be greatly appreciated. I tried changing all my sizing from percentage to px but it does not help.

Demo:

.title {
  font-family: tahoma;
  text-align: center;
}

.numbersystem1 {
  font-family: tahoma;
  position: absolute;
  top: 85px;
  left: 600px;
}

.rectangle {
  width: 530px;
  height: 60px;
  border: 1px solid #000;
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.nvbr {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 87px;
  left: 631px;
}

.nvbrleft {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 165px;
  left: 640px;
}

.nvbrright1 {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 165px;
  left: 940px;
}

.nvbrright2 {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 165px;
  left: 1100px;
}

.nvbrright3 {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 165px;
  left: 1020px;
}

.img1 {
  position: absolute;
  left: 640px;
  top: 250px;
  height: 130px;
  width: 120px;
}

.img2 {
  position: absolute;
  left: 1040px;
  top: 250px;
  height: 130px;
  width: 120px;
}

.intro1 {
  font-family: tahoma;
  position: absolute;
  top: 355px;
  left: 600px;
}

.code1 {
  font-family: monospace;
  font-size: 14px;
  padding: 7px;
}

.introq {
  font-size: 17px;
  font-size: tahoma;
  list-style-position: inside;
  list-style-type: circle;
  position: absolute;
  left: 560px;
  top: 400px;
  height: 130px;
  width: 700px;
}

.code2 {
  font-family: monospace;
  font-size: 14px;
  padding: 7px;
}

#backroundcolourthing-home {
  background-color: rgb(255, 255, 255);
  padding: 10px;
  border: 0px solid green;
  width: auto;
  min-height: 600px;
  height: 1050px;
  margin: 0;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="articles.css">
</head>

<body>

  <div>
    <h1 class="title"> How to create an HTML website </h1>
  </div>
  <div class="point1">
    <div class="pointbar">
      <p class="numbersystem1"> 1.</p>
      <p class="nvbr"> Nav Bar</p>
      <div class="rectangle"></div>
      <p class="nvbrleft"> Yourwebsitename</p>
      <p class="nvbrright1"> Home</p>
      <p class="nvbrright2"> idea3</p>
      <p class="nvbrright3"> about</p>
    </div>

    <div id="backroundcolourthing-home"></div>

    <div>
      <div class="leftsectionintro">
        <img class="img1" src="img11.jpg" alt="Italian Trulli">
        <p class="intro1">Left Section</p>
        <p class="intro1-1">
          <ol class="introq">
            <li>Instead of the # put in your name</li>
            <div class="code1"> href="#" </div> <br>
            <li>Put name of the website afterwards</li>
            <div class="code1">>websitename</div>
          </ol>
          <p class="code2">

          </p>

        </p>
      </div>
      <div class="rightsectionintro">
        <img class="img2" src="img12.jpg" alt="Italian Trulli">
      </div>

    </div>
  </div></code>```

Body:
I don't know why but my content changes its size when I zoom in or out on my window (chrome). Does anyone know why? This is my code: Its at the very end of the css and html. If anyone knows what to do It would be greatly appreciated. I tried changing all my sizing from percentage to px but it does not help.

Demo:

.title {
  font-family: tahoma;
  text-align: center;
}

.numbersystem1 {
  font-family: tahoma;
  position: absolute;
  top: 85px;
  left: 600px;
}

.rectangle {
  width: 530px;
  height: 60px;
  border: 1px solid #000;
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.nvbr {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 87px;
  left: 631px;
}

.nvbrleft {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 165px;
  left: 640px;
}

.nvbrright1 {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 165px;
  left: 940px;
}

.nvbrright2 {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 165px;
  left: 1100px;
}

.nvbrright3 {
  font-family: tahoma;
  font-size: 15px;
  position: absolute;
  top: 165px;
  left: 1020px;
}

.img1 {
  position: absolute;
  left: 640px;
  top: 250px;
  height: 130px;
  width: 120px;
}

.img2 {
  position: absolute;
  left: 1040px;
  top: 250px;
  height: 130px;
  width: 120px;
}

.intro1 {
  font-family: tahoma;
  position: absolute;
  top: 355px;
  left: 600px;
}

.code1 {
  font-family: monospace;
  font-size: 14px;
  padding: 7px;
}

.introq {
  font-size: 17px;
  font-size: tahoma;
  list-style-position: inside;
  list-style-type: circle;
  position: absolute;
  left: 560px;
  top: 400px;
  height: 130px;
  width: 700px;
}

.code2 {
  font-family: monospace;
  font-size: 14px;
  padding: 7px;
}

#backroundcolourthing-home {
  background-color: rgb(255, 255, 255);
  padding: 10px;
  border: 0px solid green;
  width: auto;
  min-height: 600px;
  height: 1050px;
  margin: 0;
}

<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="articles.css">

 How to create an HTML website

 1.

 Nav Bar

 Yourwebsitename

 Home

 idea3

 about

Left Section

Instead of the # put in your name

 href="#"

Put name of the website afterwards

>websitename


问:
What can be preventing my tailwind css to set a width?
I am originally doing it and having my perfect result:

```<code><div id="card-link" class="md:shrink-0 md:basis-0 md:grow">
        <div id="card" class="flex flex-col border-2 border-gray-200 rounded-xl p-6 my-2 mx-2" style="height: 27rem">
        </div>
</div>

<style>

  #card-link {
    min-width: 320px;
    max-width: 400px;
  }

  @media only screen and (min-width: 768px) {
    #card-link {
      min-width: 384px;
    }
  }

</style>
</code>```

However, I need to refactor it to tailwind, but when I try the code below, it not works:

```<code><div id="card-link" class="md:shrink-0 md:basis-0 md:grow min-w-[320px] md:max-w-[400px] min-w-[380px]">
            <div id="card" class="flex flex-col border-2 border-gray-200 rounded-xl p-6 my-2 mx-2" style="height: 27rem">
            </div>
    </div>
</code>```

Body:
I am originally doing it and having my perfect result:

However, I need to refactor it to tailwind, but when I try the code below, it not works:


问:
Google Cloud Logging fails for one project but not others (using Serilog)
I'm using the Serilog sink for Google Cloud Logging. There are two GCP projects: Calvin and Hobbes. Calvin is a new GCP project, Hobbes is a existing GCP project. I am (trying to) write to both from a web api running locally. Hobbes has logs being written to it from existing GCP-deployed apps.

When I use the JSON creds file for the Calvin project, I can connect to Firestore databases in the Calvin project and I can log to Cloud Logging (visible in Calvin's Log Explorer view). To ensure logging works, I also write to a local file (and it does work).

If I then swap out the JSON creds file for the Hobbes project (and adjust the Serilog configuration's projectID value) then I can connect to Firestore databases in the Hobbes project but nothing gets logged to Hobbes' Cloud Logging. The local file does get logged to.

What am I missing? Do I need to adjust more than the JSON creds files and the project ID? Could the Hobbes project be configured to block logging from non-GCP sources?

I was expecting that by just swapping the credentials file and project ID, I should be able to switch between logging in one project, then the other.


问:
How to exclude Android resources for a particular resource qualifier
Suppose I have the following resources in my Android project:

res/values/strings.xml

res/values-land/strings.xml

I would like to exclude the resources defined for land qualifier from packaging into apk. Is there such a possibility?
And, no, I can not just remove the res/values-land/, as it's required for some flavors.

I tried several options, like using the sourceSets.main.res.filter.exclude or packagingOptions, but no success.


问:
Gulpfile.js error: Did you forget to signal async completion
I just recently made a gulfile.js by helping google, but I face a problem which says

```<code>The following tasks did not complete: default, serve, sass
Did you forget to signal async completion?
</code>```

Here is my gulpfile.js:

```<code>var gulp = require("gulp");
var browserSync = require("browser-sync").create();
var sass = require("gulp-sass");

// Compile sass into CSS & auto-inject into browsers
gulp.task("sass", function () {
  return gulp
    .src("ruby/assets/scss/*.scss")
    .pipe(sass())
    .pipe(gulp.dest("ruby/assets/css"))
    .pipe(browserSync.stream());
});

// Static Server + watching scss/html files
gulp.task(
  "serve",
  gulp.series("sass", function () {
    browserSync.init({
      server: "./ruby/",
    });

    gulp.watch("ruby/assets/scss/*.scss", gulp.series("sass"));
    gulp.watch("ruby/*.html").on("change", browserSync.reload);
  })
);

gulp.task("default", gulp.series("serve"));
</code>```

Here is my boilerplate:

I have no idea what the error is.

Body:
I just recently made a gulfile.js by helping google, but I face a problem which says

The following tasks did not complete: default, serve, sass
Did you forget to signal async completion?

Here is my gulpfile.js:

var gulp = require("gulp");
var browserSync = require("browser-sync").create();
var sass = require("gulp-sass");

// Compile sass into CSS & auto-inject into browsers
gulp.task("sass", function () {
  return gulp
    .src("ruby/assets/scss/*.scss")
    .pipe(sass())
    .pipe(gulp.dest("ruby/assets/css"))
    .pipe(browserSync.stream());
});

// Static Server + watching scss/html files
gulp.task(
  "serve",
  gulp.series("sass", function () {
    browserSync.init({
      server: "./ruby/",
    });

    gulp.watch("ruby/assets/scss/*.scss", gulp.series("sass"));
    gulp.watch("ruby/*.html").on("change", browserSync.reload);
  })
);

gulp.task("default", gulp.series("serve"));

Here is my boilerplate:

I have no idea what the error is.


问:
cv2.VideoCapture freeze framing when using a countdown timer with pressed key 's' for rock paper scissors project
I have defined two different functions, one for getting the prediction of the user using the Teachable Machine from Google and then a countdown function which is initiated by the 'S' key within the loop.

My issue is that when I click the 'S' key my Video Capture freeze frames and begins the countdown, when all I want it to be doing is allowing the user to ready themselves for creating one of three gestures.

The code is below:

```<code>def get_user_choice(self):
        user_choice = ''
        while True:
            ret, frame = cap.read()
            resized_frame = cv2.resize(frame, (224, 224), interpolation = cv2.INTER_AREA)
            image_np = np.array(resized_frame)
            normalized_image = (image_np.astype(np.float32) / 127.0) - 1 # Normalize the image
            data[0] = normalized_image
            prediction = model.predict(data, verbose=0)
            cv2.imshow('frame', frame)
            k = cv2.waitKey(1)
            if k == ord('s'):
                countdown()
                user_index = np.argmax(prediction[0])
                user_choice = user_options[user_index]
                print('You chose:', user_choice)
                return user_choice

def countdown():
    print('Get your answer ready!')
    prev = time.time() + 1
    TIMER = int(4)
    while TIMER >= 1:
        cur = time.time()
        if cur - prev >= 1:
            prev = cur
            TIMER = TIMER -1
            print(TIMER)

</code>```

It works almost perfectly apart from the countdown function which has created a freeze frame issue.

I've tried to mess around with the countdown function, and put the videocapture into the countdown function. Nothing seems to have worked for me so far, and thus is causing frustration.

Body:
I have defined two different functions, one for getting the prediction of the user using the Teachable Machine from Google and then a countdown function which is initiated by the 'S' key within the loop.

My issue is that when I click the 'S' key my Video Capture freeze frames and begins the countdown, when all I want it to be doing is allowing the user to ready themselves for creating one of three gestures.

The code is below:

def get_user_choice(self):
        user_choice = ''
        while True:
            ret, frame = cap.read()
            resized_frame = cv2.resize(frame, (224, 224), interpolation = cv2.INTER_AREA)
            image_np = np.array(resized_frame)
            normalized_image = (image_np.astype(np.float32) / 127.0) - 1 # Normalize the image
            data[0] = normalized_image
            prediction = model.predict(data, verbose=0)
            cv2.imshow('frame', frame)
            k = cv2.waitKey(1)
            if k == ord('s'):
                countdown()
                user_index = np.argmax(prediction[0])
                user_choice = user_options[user_index]
                print('You chose:', user_choice)
                return user_choice

def countdown():
    print('Get your answer ready!')
    prev = time.time() + 1
    TIMER = int(4)
    while TIMER >= 1:
        cur = time.time()
        if cur - prev >= 1:
            prev = cur
            TIMER = TIMER -1
            print(TIMER)

It works almost perfectly apart from the countdown function which has created a freeze frame issue.

I've tried to mess around with the countdown function, and put the videocapture into the countdown function. Nothing seems to have worked for me so far, and thus is causing frustration.


问:
Relative path in build/_app/immutable/start-1234.js
Just built my app with adapter-static successfully... and got my index.html along with _app and all the associated JS.  However when viewing my SPA on the web I'm getting bunch of Not Found errors in the console - aside: I'm deploying my site to SharePoint (corporate stuff, only option)

I tried changing my svelte.config.js settings with this

```<code>adapter: adapter({
            // default options are shown
            pages: 'build',
            assets: 'build',
            fallback: '200.html',
            base: './'
        })
</code>```

However it seems like this only applies to index.html and the auto-generated JS in build/_app/immutable/start-1234.js ignores it.

I've tried looking at start-1234.js but it's pretty obfuscated and don't know what to adjust.  Solutions highly appreciated.

Body:
Just built my app with adapter-static successfully... and got my index.html along with _app and all the associated JS.  However when viewing my SPA on the web I'm getting bunch of Not Found errors in the console - aside: I'm deploying my site to SharePoint (corporate stuff, only option)

I tried changing my svelte.config.js settings with this

adapter: adapter({
            // default options are shown
            pages: 'build',
            assets: 'build',
            fallback: '200.html',
            base: './'
        })

However it seems like this only applies to index.html and the auto-generated JS in build/_app/immutable/start-1234.js ignores it.

I've tried looking at start-1234.js but it's pretty obfuscated and don't know what to adjust.  Solutions highly appreciated.


问:
Error retrieving URL data after deploying application
I made an image generation application with the OpenAI API
that works very well in development mode but after deploying the app on Vercel (I saved my environment variables) I get this error.

```<code>main.js:23

 POST https://ia-image-generator.vercel.app/openia/generateimage 404
generatorImageRequest   @   main.js:23
onSubmit
</code>```

Here is my main file.js where the error seems to come from.

```<code>//: main.js file

function onSubmit(e) {
  e.preventDefault();

  document.querySelector(".msg").textContent = "";
  document.querySelector("#image").src = "";

  const prompt = document.querySelector("#prompt").value;
  const size = document.querySelector("#size").value;

  if (prompt == "") {
    alert("Please enter your image description");
    return;
  }

  //: function generate AI Image
  generatorImageRequest(prompt, size);
}

async function generatorImageRequest(prompt, size) {
  try {
    showLoader();

    const response = await fetch("/openia/generateimage", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        prompt,
        size,
      }),
    });

    if (!response.ok) {
      hideLoader();
      throw new Error("Image not generated");
    }

    const iaImage = data.data;

    document.querySelector("#image").src = iaImage;

    hideLoader();

  } catch (error) {
    document.querySelector(".msg").textContent = error;
  }
}

function showLoader() {
  document.querySelector(".loader-effect").classList.add("show");
  document.querySelector(".loader").classList.add("show");
}

function hideLoader() {
  document.querySelector(".loader-effect").classList.remove("show");
  document.querySelector(".loader").classList.remove("show");
}

document.querySelector("#image-form").addEventListener("submit", onSubmit);

</code>```

I assumed that the request for the starting url is modified following the deployment,
but I'm not sure at all.

Could someone tell me where the error could come from
and how I could correct it?

Thank you in advance

Body:
I made an image generation application with the OpenAI API
that works very well in development mode but after deploying the app on Vercel (I saved my environment variables) I get this error.

main.js:23

 POST https://ia-image-generator.vercel.app/openia/generateimage 404
generatorImageRequest   @   main.js:23
onSubmit

Here is my main file.js where the error seems to come from.

//: main.js file

function onSubmit(e) {
  e.preventDefault();

  document.querySelector(".msg").textContent = "";
  document.querySelector("#image").src = "";

  const prompt = document.querySelector("#prompt").value;
  const size = document.querySelector("#size").value;

  if (prompt == "") {
    alert("Please enter your image description");
    return;
  }

  //: function generate AI Image
  generatorImageRequest(prompt, size);
}

async function generatorImageRequest(prompt, size) {
  try {
    showLoader();

    const response = await fetch("/openia/generateimage", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        prompt,
        size,
      }),
    });

    if (!response.ok) {
      hideLoader();
      throw new Error("Image not generated");
    }

    const iaImage = data.data;

    document.querySelector("#image").src = iaImage;

    hideLoader();

  } catch (error) {
    document.querySelector(".msg").textContent = error;
  }
}

function showLoader() {
  document.querySelector(".loader-effect").classList.add("show");
  document.querySelector(".loader").classList.add("show");
}

function hideLoader() {
  document.querySelector(".loader-effect").classList.remove("show");
  document.querySelector(".loader").classList.remove("show");
}

document.querySelector("#image-form").addEventListener("submit", onSubmit);

I assumed that the request for the starting url is modified following the deployment,
but I'm not sure at all.

Could someone tell me where the error could come from
and how I could correct it?

Thank you in advance


问:
IDE Screen madness in both Android Studio and vscode with flutter
I am trying to get started learning flutter on windows 10 using either vscode or android studio.  I am using dual monitors which has caused me some problem.  However even with one disabled I'm still seeing the problem.

When the sdk is invoked one of my monitors blanks.  If it's from an ide project, one of the monitors goes into an infinite blanking/restoring mode which I cannot explain.

I have two videos showing what's happening.  Doctor/VSCode demo and Android Studio Demo.  The second video ends early but it basically was showing that the same thing happens when I reset the UI scaling to 100% on the main monitor.  I am not so good at video editing but these show what I'm trying to troubleshoot.

I am aware this may not be a flutter sdk issue per se, but I don't encounter it with other project types.

Any insight appreciated.  I'd like to learn flutter but this has me stumped.

what I tried tl/dnr: I tried creating flutter projects using vscode and android studio and it sent my primary monitor into an unrelenting reset mode until I closed the IDE.


问:
Forcing a base relative path in SharePoint
I'm trying to deploy a web app to a SharePoint folder; and have successfully dont so in the past with Flutter/Dart apps.

However I am trying a different framework now and can't get it to work.  Typically I simply rename my .html to .aspx and ensure all my paths in index.aspx start with ./ however with the framework I'm using it seems like some generated JS is struggling to find things.

Is there an option I can put in my index.aspx that will force a base relative directory across everything being served???