问:
Unity CIL Linker presents a log4net assembly error when building for Android
I'm unsure of what's causing the following errors when building for Android in Unity.

Android build error

Building C:\Users\LIMEFRIENDS\Documents\GitHub\21cube\Library\Bee\artifacts\unitylinker_xy1a.traceevents failed with output:
C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe --search-directory=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed --out=Library/Bee/artifacts/Android/ManagedStripped --include-link-xml=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed\TypesInScenes.xml --include-link-xml=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed\SerializedTypes.xml --include-link-xml=C:\Users\LIMEFRIENDS\Documents\GitHub\21cube\Assets\FacebookSDK\link.xml --include-link-xml=C:/Program Files/Unity/Hub/Editor/2021.3.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/AndroidNativeLink.xml --include-directory=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed --profiler-report --profiler-output-file=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/Bee/artifacts/unitylinker_xy1a.traceevents --dotnetprofile=unityaot-linux --dotnetruntime=Il2Cpp --platform=Android --use-editor-options --enable-engine-module-stripping --engine-modules-asset-file=C:/Program Files/Unity/Hub/Editor/2021.3.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/modules.asset --editor-data-file=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/EditorToUnityLinkerData.json --include-unity-root-assembly=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll --include-unity-root-assembly=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll --include-unity-root-assembly=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll --include-unity-root-assembly=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/Facebook.Unity.Settings.dll --print-command-line --enable-analytics
Fatal error in Unity CIL Linker
Mono.Linker.LinkerFatalErrorException: D:\JenkinsWorkspaces\trebuchet-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Internal\Util\Logger.Log4net.cs(71,13): error IL1005: Amazon.Runtime.Internal.Util.InternalLog4netLogger.loadStatics(): Error processing method 'Amazon.Runtime.Internal.Util.InternalLog4netLogger.loadStatics()' in assembly 'AWSSDK.Core.dll'
 ---> System.InvalidOperationException: No action for the assembly log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a defined
   at Mono.Linker.AnnotationStore.GetAction(AssemblyDefinition assembly)
   at Mono.Linker.Steps.MarkStep.IsFullyPreserved(TypeDefinition type)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
   at Mono.Linker.Steps.MarkStep.MarkTypeVisibleToReflection(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
   at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.<>c__DisplayClass20_4.<HandleCall>b__7()
   at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(MethodBody callingMethodBody, MethodReference calledMethod, Instruction operation, ValueNodeList methodParams, ValueNode& methodReturnValue)
   at Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(MethodBody callingMethodBody, Instruction operation, Stack`1 currentStack)
   at Mono.Linker.Dataflow.MethodBodyScanner.Scan(MethodBody methodBody)
   at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.ScanAndProcessReturnValue(MethodBody methodBody)
   at Unity.Linker.Steps.UnityMarkStep.MarkReflectionLikeDependencies(MethodBody body, Boolean requiresReflectionMethodBodyScanner)
   at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
   at Unity.Linker.Steps.UnityMarkStep.MarkMethodBody(MethodBody body)
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
   at Unity.Linker.Steps.UnityMarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   --- End of inner exception stack trace ---
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
   at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at Unity.Linker.UnityDriver.UnityRun(Boolean noProfilerAllowed, ILogger customLogger)
   at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger, Boolean noProfilerAllowed)
   at Unity.Linker.UnityDriver.RunDriver()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
```
<h1>Build error number 1</h1>
<pre class="lang-cs prettyprint-override"><code>C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\il2cpp\build\deploy\il2cpp.exe --convert-to-cpp --data-folder=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/Bee/artifacts/Android/il2cppOutput/data --generatedcppdir=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/Bee/artifacts/Android/il2cppOutput/cpp --additional-cpp=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/PackageCache/com.unity.ads@3.7.5/Plugins/iOS/UnityAdsShowListener.h --additional-cpp=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/PackageCache/com.unity.ads@3.7.5/Plugins/iOS/UnityAdsInitializationListener.h --additional-cpp=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/PackageCache/com.unity.ads@3.7.5/Plugins/iOS/UnityAdsLoadListener.h --enable-analytics --emit-null-checks --enable-array-bounds-check --dotnetprofile=unityaot-linux --profiler-report --profiler-output-file=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/Bee/artifacts/il2cpp_conv_yrc1.traceevents --print-command-line
Error: il2cpp.InvalidCommandLineArgumentsException: One or more assemblies must be specified using either --directory or --assembly
   at il2cpp.Conversion.ContextDataFactory.CreateConversionDataFromOptions(Il2CppCommandLineArguments il2CppCommandLineArguments)
   at il2cpp.Conversion.ConversionDriver.Run(Il2CppCommandLineArguments il2CppCommandLineArguments)
   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
</code>```

Build error number 2

Check the path in Korean >> only English or num
Asset reimport all >> X

Body:
I'm unsure of what's causing the following errors when building for Android in Unity.

Android build error

Building C:\Users\LIMEFRIENDS\Documents\GitHub\21cube\Library\Bee\artifacts\unitylinker_xy1a.traceevents failed with output:
C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe --search-directory=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed --out=Library/Bee/artifacts/Android/ManagedStripped --include-link-xml=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed\TypesInScenes.xml --include-link-xml=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed\SerializedTypes.xml --include-link-xml=C:\Users\LIMEFRIENDS\Documents\GitHub\21cube\Assets\FacebookSDK\link.xml --include-link-xml=C:/Program Files/Unity/Hub/Editor/2021.3.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/AndroidNativeLink.xml --include-directory=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed --profiler-report --profiler-output-file=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/Bee/artifacts/unitylinker_xy1a.traceevents --dotnetprofile=unityaot-linux --dotnetruntime=Il2Cpp --platform=Android --use-editor-options --enable-engine-module-stripping --engine-modules-asset-file=C:/Program Files/Unity/Hub/Editor/2021.3.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/modules.asset --editor-data-file=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/EditorToUnityLinkerData.json --include-unity-root-assembly=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/Assembly-CSharp-firstpass.dll --include-unity-root-assembly=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll --include-unity-root-assembly=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll --include-unity-root-assembly=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Temp/StagingArea/Data/Managed/Facebook.Unity.Settings.dll --print-command-line --enable-analytics
Fatal error in Unity CIL Linker
Mono.Linker.LinkerFatalErrorException: D:\JenkinsWorkspaces\trebuchet-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Internal\Util\Logger.Log4net.cs(71,13): error IL1005: Amazon.Runtime.Internal.Util.InternalLog4netLogger.loadStatics(): Error processing method 'Amazon.Runtime.Internal.Util.InternalLog4netLogger.loadStatics()' in assembly 'AWSSDK.Core.dll'
 ---> System.InvalidOperationException: No action for the assembly log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a defined
   at Mono.Linker.AnnotationStore.GetAction(AssemblyDefinition assembly)
   at Mono.Linker.Steps.MarkStep.IsFullyPreserved(TypeDefinition type)
   at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
   at Mono.Linker.Steps.MarkStep.MarkTypeVisibleToReflection(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
   at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.<>c__DisplayClass20_4.<HandleCall>b__7()
   at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(MethodBody callingMethodBody, MethodReference calledMethod, Instruction operation, ValueNodeList methodParams, ValueNode& methodReturnValue)
   at Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(MethodBody callingMethodBody, Instruction operation, Stack`1 currentStack)
   at Mono.Linker.Dataflow.MethodBodyScanner.Scan(MethodBody methodBody)
   at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.ScanAndProcessReturnValue(MethodBody methodBody)
   at Unity.Linker.Steps.UnityMarkStep.MarkReflectionLikeDependencies(MethodBody body, Boolean requiresReflectionMethodBodyScanner)
   at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
   at Unity.Linker.Steps.UnityMarkStep.MarkMethodBody(MethodBody body)
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
   at Unity.Linker.Steps.UnityMarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   --- End of inner exception stack trace ---
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
   at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at Unity.Linker.UnityDriver.UnityRun(Boolean noProfilerAllowed, ILogger customLogger)
   at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger, Boolean noProfilerAllowed)
   at Unity.Linker.UnityDriver.RunDriver()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Build error number 1

C:\Program Files\Unity\Hub\Editor\2021.3.14f1\Editor\Data\il2cpp\build\deploy\il2cpp.exe --convert-to-cpp --data-folder=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/Bee/artifacts/Android/il2cppOutput/data --generatedcppdir=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/Bee/artifacts/Android/il2cppOutput/cpp --additional-cpp=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/PackageCache/com.unity.ads@3.7.5/Plugins/iOS/UnityAdsShowListener.h --additional-cpp=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/PackageCache/com.unity.ads@3.7.5/Plugins/iOS/UnityAdsInitializationListener.h --additional-cpp=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/PackageCache/com.unity.ads@3.7.5/Plugins/iOS/UnityAdsLoadListener.h --enable-analytics --emit-null-checks --enable-array-bounds-check --dotnetprofile=unityaot-linux --profiler-report --profiler-output-file=C:/Users/LIMEFRIENDS/Documents/GitHub/21cube/Library/Bee/artifacts/il2cpp_conv_yrc1.traceevents --print-command-line
Error: il2cpp.InvalidCommandLineArgumentsException: One or more assemblies must be specified using either --directory or --assembly
   at il2cpp.Conversion.ContextDataFactory.CreateConversionDataFromOptions(Il2CppCommandLineArguments il2CppCommandLineArguments)
   at il2cpp.Conversion.ConversionDriver.Run(Il2CppCommandLineArguments il2CppCommandLineArguments)
   at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLineArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Build error number 2

Check the path in Korean >> only English or num
Asset reimport all >> X


来源: stackexchange

问:
How Do I Uncheck A Checkbox When Navigating Backwards Or Forwards Between A Web Page?
I have a responsive hamburger menu made with a checkbox that works without any issues. What I'd like to be able to do is uncheck the checkbox when going backward or forward (navigating between pages). I would like it so that when I use the backward or forward button on a web browser the box is unchecked and the menu disappears.

This is the Javascript that I've tried but have not been able to get working properly:

    var perfEntries = performance.getEntriesByType("navigation");
      if (perfEntries[0].type === "back_forward"){
        $('checkbox').removeAttribute('checked');
      }
```
<p>If anyone knows of a way to uncheck a checkbox and have it so a hamburger menu doesn't appear when navigating between web pages I'd appreciate you sharing your knowledge. Thank you.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var perfEntries = performance.getEntriesByType("navigation");
if (perfEntries[0].type === "back_forward") {

  $('checkbox').removeAttribute('checked');
}</code>```

.body {
  background-color: white;
  font-family: sans-serif;
}

.searchbar {
  float: right;
}

.image {
  text-align: center;
}

.setsumei {
  margin-left: 20px;
  margin-right: 20px;
}

.footer {
  width: 100%;
  height: 40px;
  text-align: center;
  border-top: 1px solid black;
  position: absolute;
  bottom: 0;
  padding: 10px;
}

.page-wrap {
  min-height: 100%;
  margin-bottom: -40px;
}

.page-wrap:after {
  content: "";
  display: block;
}

.site-footer,
.page-wrap:after {
  height: 20px;
}

.site-footer {
  text-align: center;
  border-top: 1px solid black;
  padding: 10px;
}

@media (max-width: 1130px)and (min-width: 280px) {
  .responsive-image-container {
    display: flex;
    flex-direction: column;
    text-align: center;
  }
  img {
    width: 85%;
  }
}

*,
*:before,
*:after {
  padding-left: 0;
  margin: 0;
  box-sizing: border-box;
}

ol,
ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: black;
}

.cp_cont {
  height: auto;
}

/* menu */

.cp_offcm03 {
  position: relative;
  z-index: 5000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  width: 100%;
  height: auto;
  padding-top: 0;
  -webkit-transition: transform 0.3s ease-in;
  transition: transform 0.3s ease-in;
  text-align: center;
  color: black;
  background-color: white;
}

.cp_offcm03 nav,
.cp_offcm03 ul {
  height: 100%;
}

.cp_offcm03 li {
  display: inline-block;
  margin-right: -6px;
}

.cp_offcm03 a {
  display: block;
  padding: 15px 45px;
  margin-bottom: -5px;
  -webkit-transition: background-color .3s ease-in;
  transition: background-color .3s ease-in;
}

.cp_offcm03 a:hover {
  background-color: lightgray;
}

/* menu toggle */

#cp_toggle03 {
  display: none;
}

#cp_toggle03:checked~.cp_offcm03 {
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

#cp_toggle03:checked~.cp_container {
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

.cp_mobilebar {
  display: none;
}

/* content */

.cp_container {
  position: relative;
  top: 0;
  padding: 35px auto;
  -webkit-transition: transform .3s ease-in;
  transition: transform .3s ease-in;
}

.cp_content {
  margin: 0 auto;
  padding: 20px;
  height: 65vh;
  text-align: center;
}

@media (max-width: 1130px)and (min-width: 280px) {
  /* menu */
  .cp_offcm03 {
    position: fixed;
    left: -250px;
    overflow-y: hidden;
    width: 250px;
    height: 100%;
    padding-top: 40px;
    color: black;
    background-color: white;
    z-index: 1000;
  }
  .cp_offcm03 nav {
    background: white;
    border-right: 0.5px solid lightgray;
    margin-left: -210px;
  }
  .cp_offcm03 li {
    display: block;
    margin-right: 0;
  }
  .cp_offcm03 a {
    padding: 20px;
  }
  /* menu toggle */
  .cp_mobilebar {
    display: block;
    z-index: 2000;
    position: relative;
    top: 0;
    left: 0;
    padding: 0 25px;
    width: 100%;
    height: 40px;
    background-color: white;
    border-bottom: .05px solid lightgray;
  }
  .cp_menuicon {
    display: block;
    position: relative;
    width: 25px;
    height: 100%;
    cursor: pointer;
    -webkit-transition: transform .3s ease-in;
    transition: transform .3s ease-in;
  }
  .cp_menuicon>span {
    display: block;
    position: absolute;
    top: 55%;
    margin-top: -0.3em;
    width: 100%;
    height: 0.2em;
    border-radius: 1px;
    background-color: black;
    -webkit-transition: transform .3s ease;
    transition: transform .3s ease;
  }
  .cp_menuicon>span:before,
  .cp_menuicon>span:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 1px;
    background-color: black;
    -webkit-transition: transform .3s ease-in;
    transition: transform .3s ease-in;
  }
  .cp_menuicon>span:before {
    -webkit-transform: translateY(-0.6em);
    transform: translateY(-0.6em);
  }
  .cp_menuicon>span:after {
    -webkit-transform: translateY(0.6em);
    transform: translateY(0.6em);
  }
  #cp_toggle03:checked+.cp_mobilebar .cp_menuicon {
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
  }
  #cp_toggle03:checked+.cp_mobilebar span:before,
  #cp_toggle03:checked+.cp_mobilebar span:after {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
  }
  #cp_toggle03:checked~.cp_offcm03 {
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
  }
  #cp_toggle03:checked~.cp_container {
    -webkit-transform: translateX(250px);
    transform: translateX(250px);
  }
  input:checked~#h-menu_black {
    display: block;
    opacity: .6;
  }
  #h-menu_black {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0;
    transition: .7s ease-in-out;
  }
  /* content */
  .cp_container {
    top: 60px;
    height: 92vh;
    text-align: center;
  }
  .noscroll {
    overflow: hidden;
    position: fixed;
  }
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="cp_cont">
  <input id="cp_toggle03" type="checkbox">
  <div class="cp_mobilebar">
    <label for="cp_toggle03" class="cp_menuicon">
    <span></span>
    </label>
  </div>
  <label id="h-menu_black" class="cp_toggle03" for="cp_menuicon"></label>
  <div id="body" class="noscroll"></div>

  <header class="cp_offcm03">
    <nav>
      <ul style="text-align: center; margin-left: 210px; overflow: hidden; padding-bottom: 10px; font-size: 15px;">
        <li style="border-bottom: 1px solid lightgray;">ホーム</li>
        <li style="border-bottom: 1px solid lightgray;">ブログ</li>
        <li style="border-bottom: 1px solid lightgray;">このサイトについて</li>
        <li style="border-bottom: 1px solid lightgray;">参考文献</li></code>```

ContentLicense: CC BY-SA 4.0

Body:
I have a responsive hamburger menu made with a checkbox that works without any issues. What I'd like to be able to do is uncheck the checkbox when going backward or forward (navigating between pages). I would like it so that when I use the backward or forward button on a web browser the box is unchecked and the menu disappears.

This is the Javascript that I've tried but have not been able to get working properly:

    var perfEntries = performance.getEntriesByType("navigation");
      if (perfEntries[0].type === "back_forward"){
        $('checkbox').removeAttribute('checked');
      }

If anyone knows of a way to uncheck a checkbox and have it so a hamburger menu doesn't appear when navigating between web pages I'd appreciate you sharing your knowledge. Thank you.

var perfEntries = performance.getEntriesByType("navigation");
if (perfEntries[0].type === "back_forward") {

  $('checkbox').removeAttribute('checked');
}

.body {
  background-color: white;
  font-family: sans-serif;
}

.searchbar {
  float: right;
}

.image {
  text-align: center;
}

.setsumei {
  margin-left: 20px;
  margin-right: 20px;
}

.footer {
  width: 100%;
  height: 40px;
  text-align: center;
  border-top: 1px solid black;
  position: absolute;
  bottom: 0;
  padding: 10px;
}

.page-wrap {
  min-height: 100%;
  margin-bottom: -40px;
}

.page-wrap:after {
  content: "";
  display: block;
}

.site-footer,
.page-wrap:after {
  height: 20px;
}

.site-footer {
  text-align: center;
  border-top: 1px solid black;
  padding: 10px;
}

@media (max-width: 1130px)and (min-width: 280px) {
  .responsive-image-container {
    display: flex;
    flex-direction: column;
    text-align: center;
  }
  img {
    width: 85%;
  }
}

*,
*:before,
*:after {
  padding-left: 0;
  margin: 0;
  box-sizing: border-box;
}

ol,
ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: black;
}

.cp_cont {
  height: auto;
}

/* menu */

.cp_offcm03 {
  position: relative;
  z-index: 5000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  width: 100%;
  height: auto;
  padding-top: 0;
  -webkit-transition: transform 0.3s ease-in;
  transition: transform 0.3s ease-in;
  text-align: center;
  color: black;
  background-color: white;
}

.cp_offcm03 nav,
.cp_offcm03 ul {
  height: 100%;
}

.cp_offcm03 li {
  display: inline-block;
  margin-right: -6px;
}

.cp_offcm03 a {
  display: block;
  padding: 15px 45px;
  margin-bottom: -5px;
  -webkit-transition: background-color .3s ease-in;
  transition: background-color .3s ease-in;
}

.cp_offcm03 a:hover {
  background-color: lightgray;
}

/* menu toggle */

#cp_toggle03 {
  display: none;
}

#cp_toggle03:checked~.cp_offcm03 {
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

#cp_toggle03:checked~.cp_container {
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

.cp_mobilebar {
  display: none;
}

/* content */

.cp_container {
  position: relative;
  top: 0;
  padding: 35px auto;
  -webkit-transition: transform .3s ease-in;
  transition: transform .3s ease-in;
}

.cp_content {
  margin: 0 auto;
  padding: 20px;
  height: 65vh;
  text-align: center;
}

@media (max-width: 1130px)and (min-width: 280px) {
  /* menu */
  .cp_offcm03 {
    position: fixed;
    left: -250px;
    overflow-y: hidden;
    width: 250px;
    height: 100%;
    padding-top: 40px;
    color: black;
    background-color: white;
    z-index: 1000;
  }
  .cp_offcm03 nav {
    background: white;
    border-right: 0.5px solid lightgray;
    margin-left: -210px;
  }
  .cp_offcm03 li {
    display: block;
    margin-right: 0;
  }
  .cp_offcm03 a {
    padding: 20px;
  }
  /* menu toggle */
  .cp_mobilebar {
    display: block;
    z-index: 2000;
    position: relative;
    top: 0;
    left: 0;
    padding: 0 25px;
    width: 100%;
    height: 40px;
    background-color: white;
    border-bottom: .05px solid lightgray;
  }
  .cp_menuicon {
    display: block;
    position: relative;
    width: 25px;
    height: 100%;
    cursor: pointer;
    -webkit-transition: transform .3s ease-in;
    transition: transform .3s ease-in;
  }
  .cp_menuicon>span {
    display: block;
    position: absolute;
    top: 55%;
    margin-top: -0.3em;
    width: 100%;
    height: 0.2em;
    border-radius: 1px;
    background-color: black;
    -webkit-transition: transform .3s ease;
    transition: transform .3s ease;
  }
  .cp_menuicon>span:before,
  .cp_menuicon>span:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 1px;
    background-color: black;
    -webkit-transition: transform .3s ease-in;
    transition: transform .3s ease-in;
  }
  .cp_menuicon>span:before {
    -webkit-transform: translateY(-0.6em);
    transform: translateY(-0.6em);
  }
  .cp_menuicon>span:after {
    -webkit-transform: translateY(0.6em);
    transform: translateY(0.6em);
  }
  #cp_toggle03:checked+.cp_mobilebar .cp_menuicon {
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
  }
  #cp_toggle03:checked+.cp_mobilebar span:before,
  #cp_toggle03:checked+.cp_mobilebar span:after {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
  }
  #cp_toggle03:checked~.cp_offcm03 {
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
  }
  #cp_toggle03:checked~.cp_container {
    -webkit-transform: translateX(250px);
    transform: translateX(250px);
  }
  input:checked~#h-menu_black {
    display: block;
    opacity: .6;
  }
  #h-menu_black {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0;
    transition: .7s ease-in-out;
  }
  /* content */
  .cp_container {
    top: 60px;
    height: 92vh;
    text-align: center;
  }
  .noscroll {
    overflow: hidden;
    position: fixed;
  }
}

  <input id="cp_toggle03" type="checkbox">

ホーム

ブログ

このサイトについて

参考文献


问:
Could not extract response: no suitable HttpMessageConverter found for response type
We are implementing microservice architecture.

I have deployed eureka server in external tomcat server i.e tomcat9 as context path "barpp-serviceregistry"

When i am connecting from the client, we are getting the following error

```<code>2022-12-22 08:18:55.863  INFO 1460 --- [freshExecutor-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:9090/barapp-serviceregistry/}, exception=Could not extract response: no suitable HttpMessageConverter found for response type [class org.springframework.cloud.netflix.eureka.http.EurekaApplications] and content type [text/html;charset=utf-8] stacktrace=org.springframework.web.client.UnknownContentTypeException: Could not extract response: no suitable HttpMessageConverter found for response type [class org.springframework.cloud.netflix.eureka.http.EurekaApplications] and content type [text/html;charset=utf-8]
    at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:126)
    at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:1037)
    at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:1020)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:778)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:602)
    at org.springframework.cloud.netflix.eureka.http.RestTemplateEurekaHttpClient.getApplicationsInternal(RestTemplateEurekaHttpClient.java:145)
    at org.springframework.cloud.netflix.eureka.http.RestTemplateEurekaHttpClient.getApplications(RestTemplateEurekaHttpClient.java:135)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
    at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:121)
    at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:80)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
    at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:120)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
    at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
    at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1101)
    at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:1014)
    at com.netflix.discovery.DiscoveryClient.refreshRegistry(DiscoveryClient.java:1531)
    at com.netflix.discovery.DiscoveryClient$CacheRefreshThread.run(DiscoveryClient.java:1498)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

</code>```

the same code we run as standalone application, it works fine. Is there any configuration required while deploying to external tomcat, what am I missing here?

the following are the properties configuration

Eureka server

```<code>spring:
  application:
    name: barapp-serviceregistry
#server:
#  port: ${port:8761}
eureka:
  client:
    register-with-eureka: false
    fetch-registry: false
    serviceUrl:
      defaultZone: http://localhost:9090/barpp-serviceregistry/
</code>```

Eureka client

```<code>eureka:
  client:
    service-url:
      defaultZone: http://localhost:9090/barapp-serviceregistry/
</code>```

Please help on it

checked with different blogs and tried with different options like adding the headers

Body:
We are implementing microservice architecture.

I have deployed eureka server in external tomcat server i.e tomcat9 as context path "barpp-serviceregistry"

When i am connecting from the client, we are getting the following error

2022-12-22 08:18:55.863  INFO 1460 --- [freshExecutor-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:9090/barapp-serviceregistry/}, exception=Could not extract response: no suitable HttpMessageConverter found for response type [class org.springframework.cloud.netflix.eureka.http.EurekaApplications] and content type [text/html;charset=utf-8] stacktrace=org.springframework.web.client.UnknownContentTypeException: Could not extract response: no suitable HttpMessageConverter found for response type [class org.springframework.cloud.netflix.eureka.http.EurekaApplications] and content type [text/html;charset=utf-8]
    at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:126)
    at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:1037)
    at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:1020)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:778)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:602)
    at org.springframework.cloud.netflix.eureka.http.RestTemplateEurekaHttpClient.getApplicationsInternal(RestTemplateEurekaHttpClient.java:145)
    at org.springframework.cloud.netflix.eureka.http.RestTemplateEurekaHttpClient.getApplications(RestTemplateEurekaHttpClient.java:135)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
    at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:121)
    at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:80)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
    at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:120)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
    at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
    at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
    at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1101)
    at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:1014)
    at com.netflix.discovery.DiscoveryClient.refreshRegistry(DiscoveryClient.java:1531)
    at com.netflix.discovery.DiscoveryClient$CacheRefreshThread.run(DiscoveryClient.java:1498)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

the same code we run as standalone application, it works fine. Is there any configuration required while deploying to external tomcat, what am I missing here?

the following are the properties configuration

Eureka server

spring:
  application:
    name: barapp-serviceregistry
#server:
#  port: ${port:8761}
eureka:
  client:
    register-with-eureka: false
    fetch-registry: false
    serviceUrl:
      defaultZone: http://localhost:9090/barpp-serviceregistry/

Eureka client

eureka:
  client:
    service-url:
      defaultZone: http://localhost:9090/barapp-serviceregistry/

Please help on it

checked with different blogs and tried with different options like adding the headers


问:
How to properly format data for plotly treemap chart
I'm trying to create my own treemap chart to show what folders are taking up the most space with plotly. Something about how my data is formatted is incorrect and I'm struggling to see the issue.

Here is my code to calculate the directory size and create the data needed for the treemap chart:

```<code>import os
from pathlib import Path
import plotly.express as px

directory = '/Users/userid/Documents'

def calculate_size(folder):
    result = []
    for root, dirs, files in os.walk(folder):
        size = sum(os.path.getsize(os.path.join(root, name)) for name in files)

        result.append({
            'parent': str(Path(root).parent.name),
            'name': str(Path(root).name),
            'size': size
        })

    return result

result = calculate_size(directory)

df = pd.DataFrame(result)

# Fix root directory parent and name
df['parent'] = df['parent'].replace('userid', '')
df['parent'] = df['parent'].replace('Documents', '')
df['name'] = df['name'].replace('Documents', '')

fig = px.treemap(
    df,
    path=['parent', 'name'],
    values='size',
)
fig.update_traces(root_color="lightgrey")
fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))
fig.show()
</code>```

My treemap chart is at the end of this post. The problems with the treemap chart include:

The name of the directory I provide to calculate_size() (Documents) does not show up in the grey area. Commenting out the section that "fixes" the root directory parent and name columns duplicates data on the treemap, which is why I included those few lines.

Certain folders show up twice, or don't show the subfolders. For example, "Signs & Printing" shows up in a darker blue and teal color. The darker blue folder doesn't show any subfolders, even when I click on it, but the teal color folder shows the subfolders.

The "MLB Stadium Scrapbook" actually has two subfolders, but only shows one. The two folders are noticeably different in size, but I would have expected a small sliver to show that there are multiple folders.

```<code>    parent  name    size
4   MLB Stadium Scrapbook   Fenway 2016 410890
5   MLB Stadium Scrapbook   Nationals Park 2016 105987397
</code>```

Body:
I'm trying to create my own treemap chart to show what folders are taking up the most space with plotly. Something about how my data is formatted is incorrect and I'm struggling to see the issue.

Here is my code to calculate the directory size and create the data needed for the treemap chart:

import os
from pathlib import Path
import plotly.express as px

directory = '/Users/userid/Documents'

def calculate_size(folder):
    result = []
    for root, dirs, files in os.walk(folder):
        size = sum(os.path.getsize(os.path.join(root, name)) for name in files)

        result.append({
            'parent': str(Path(root).parent.name),
            'name': str(Path(root).name),
            'size': size
        })

    return result

result = calculate_size(directory)

df = pd.DataFrame(result)

# Fix root directory parent and name
df['parent'] = df['parent'].replace('userid', '')
df['parent'] = df['parent'].replace('Documents', '')
df['name'] = df['name'].replace('Documents', '')

fig = px.treemap(
    df,
    path=['parent', 'name'],
    values='size',
)
fig.update_traces(root_color="lightgrey")
fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))
fig.show()

My treemap chart is at the end of this post. The problems with the treemap chart include:

The name of the directory I provide to calculate_size() (Documents) does not show up in the grey area. Commenting out the section that "fixes" the root directory parent and name columns duplicates data on the treemap, which is why I included those few lines.

Certain folders show up twice, or don't show the subfolders. For example, "Signs & Printing" shows up in a darker blue and teal color. The darker blue folder doesn't show any subfolders, even when I click on it, but the teal color folder shows the subfolders.

The "MLB Stadium Scrapbook" actually has two subfolders, but only shows one. The two folders are noticeably different in size, but I would have expected a small sliver to show that there are multiple folders.

    parent  name    size
4   MLB Stadium Scrapbook   Fenway 2016 410890
5   MLB Stadium Scrapbook   Nationals Park 2016 105987397


问:
How to take a second command from a previous command with a python virtual assistant
I have a python virtuall assistant named Anna. She can listen for commands, but what I want is to have a secondary command after you ask her the first command. For example, tell her you want to go to stack overflow. Then she can ask you if you want to go to your profile or not. How can you make it so if you say "Yes" she will. and if you say "No" she won't?

Here is my code:

```<code>import speech_recognition as sr
import pyttsx3
import time as tme

tts = pyttsx3.init()

voices = tts.getProperty('voices')
tts.setProperty('voice', voices[1].id)

def takeCommand():

    r = sr.Recognizer()

    with sr.Microphone() as source:
        r.adjust_for_ambient_noise(source)
        print('Listening...')

        r.pause_threshold = 0.5
        audio = r.listen(source)

        try:
            print("Recognizing")

            Query = r.recognize_google(audio, language='en-us')
            print("the command is printed=", Query)

        except Exception as e:
            print(e)
            print("Say that again")
            return "None"
        if "Anna" in Query:
            return Query
        else:
            return "None"

def Take_query():

    while(True):

        query = takeCommand().lower()
        if "Hello" in query:
            tts.say('Hello')
            tts.runAndWait()
            continue

        elif "how are you" in query:
            tme.sleep(.5)
            tts.say('I am good')
            tts.runAndWait()
            continue

if __name__ == '__main__':
    Take_query()
</code>```

Thank you!

Body:
I have a python virtuall assistant named Anna. She can listen for commands, but what I want is to have a secondary command after you ask her the first command. For example, tell her you want to go to stack overflow. Then she can ask you if you want to go to your profile or not. How can you make it so if you say "Yes" she will. and if you say "No" she won't?

Here is my code:

import speech_recognition as sr
import pyttsx3
import time as tme

tts = pyttsx3.init()

voices = tts.getProperty('voices')
tts.setProperty('voice', voices[1].id)

def takeCommand():

    r = sr.Recognizer()

    with sr.Microphone() as source:
        r.adjust_for_ambient_noise(source)
        print('Listening...')

        r.pause_threshold = 0.5
        audio = r.listen(source)

        try:
            print("Recognizing")

            Query = r.recognize_google(audio, language='en-us')
            print("the command is printed=", Query)

        except Exception as e:
            print(e)
            print("Say that again")
            return "None"
        if "Anna" in Query:
            return Query
        else:
            return "None"

def Take_query():

    while(True):

        query = takeCommand().lower()
        if "Hello" in query:
            tts.say('Hello')
            tts.runAndWait()
            continue

        elif "how are you" in query:
            tme.sleep(.5)
            tts.say('I am good')
            tts.runAndWait()
            continue

if __name__ == '__main__':
    Take_query()

Thank you!


问:
AKS creation with Terraform in Azure taking too much time
I want to deploy some AKS in Azure using Terraform but it is taking too much time to create more than 1 hour and the terraform job never finish. In the portal the AKS stay in Creating status. I'm deploying the AKS in the EastUS2 region

The vm size that I used are not too big so I don't know understand what could be the problem

This is my main file:

main.tf

```<code># Configure the Microsoft Azure Provider.
terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">= 2.26"
    }

    kubernetes = {
      source  = "hashicorp/kubernetes"
      version = ">= 1.24.6"
    }

    azapi = {
      source = "azure/azapi"
      version = ">=1.1.0"
    }
  }

  required_version = ">= 0.14.9"
}

provider "azurerm" {
  features {}
}

provider "kubernetes" {
  host                   = module.aks.host
  username               = module.aks.username
  password               = module.aks.password
  client_certificate     = module.aks.client_certificate
  client_key             = base64decode(module.aks.client_key)
  cluster_ca_certificate = base64decode(module.aks.cluster_ca_certificate)
}

provider "azapi" {
  # subscription_id = data.azurerm_client_config.current.subscription_id
  # tentat_id = data.azurerm_client_config.current.tenant_id
}

data "azurerm_client_config" "current" {}

module "ResourceGroup" {
  source = "./ResourceGroup"
}

module "Networks" {
  source = "./Networks"
  resource_group_name = module.ResourceGroup.rg_name_out
  location = module.ResourceGroup.rg_location_out
}
module "acr" {
  source                       = "./ACR"
  resource_group_name          = module.ResourceGroup.rg_name_out
  location                     = module.ResourceGroup.rg_location_out

  name                         = var.acr_name
  sku                          = var.acr_sku
  admin_enabled                = var.acr_admin_enabled
  georeplication_locations     = var.acr_georeplication_locations
  soft_delete_policy_status    = var.acr_soft_delete_policy_status
  soft_delete_policy_days      = var.acr_soft_delete_policy_days
  identity_name                = var.acr_identity_name

  tags                         = var.tags
  # depends_on                  = [module.StorageAccount]
}

module "aks" {
  source                                   = "./AKS"
  location                                 = module.ResourceGroup.rg_location_out
  resource_group_name                      = module.ResourceGroup.rg_name_out
  acr_id                                   = module.acr.id

  name                                     = var.aks_cluster_name
  kubernetes_version                       = var.aks_kubernetes_version
  dns_prefix                               = lower(var.aks_cluster_name)
  private_cluster_enabled                  = var.aks_private_cluster_enabled
  automatic_channel_upgrade                = var.aks_automatic_channel_upgrade
  sku_tier                                 = var.aks_sku_tier
  identity_name                            = var.aks_identity_name
  api_server_authorized_ip_ranges          = [] #module.Networks.subnet_address_bastion
  azure_policy_enabled                     = var.aks_azure_policy_enabled
  http_application_routing_enabled         = var.aks_http_application_routing_enabled

  network_profile                          = var.aks_network_profile
  aci_connector_linux                      = var.aks_aci_connector_linux

  azure_ad_rbac_managed                    = var.aks_azure_ad_rbac_managed
  tenant_id                                = data.azurerm_client_config.current.tenant_id
  admin_group_object_ids                   = var.aks_admin_group_object_ids
  azure_rbac_enabled                       = var.aks_azure_rbac_enabled
  admin_username                           = var.aks_admin_username
  ssh_public_key                           = var.aks_ssh_public_key

  tags                                     = var.tags
  depends_on                               = [module.Networks, module.acr]

  default_node_pool                       = {
    name                    = "system"
    vm_size                 = "Standard_D2s_v3"
    node_count              = 1
    enable_auto_scaling     = true
    max_count               = 1
    min_count               = 1
    max_surge               = "50%"
    max_pods                = 36
    os_disk_size_gb         = 50
    os_disk_type            = "Managed"
    ultra_ssd_enabled       = true
    zones                   = ["1", "2","3"]
    node_labels             = { "workload" = "system" }
    node_taints             = [ "workload=system:NoSchedule" ]
    vnet_subnet_id          = module.Networks.subnet_id
    orchestrator_version    = var.aks_kubernetes_version
  }
  node_pools                             = [
    {
      name                    = "batch"
      mode                    = "User"
      vm_size                 = "Standard_D2s_v3"
      node_count              = 1
      enable_auto_scaling     = true
      max_count               = 1
      min_count               = 1
      max_surge               = "50%"
      max_pods                = 36
      os_disk_size_gb         = 50
      os_disk_type            = "Managed"
      ultra_ssd_enabled       = true
      zones                   = ["1", "2","3"]
      node_labels             = { "workload" = "batch" }
      node_taints             = [ "workload=batch:NoSchedule" ]
      vnet_subnet_id          = module.Networks.subnet_id
      orchestrator_version    = var.aks_kubernetes_version
    }
   ]
}
</code>```

Body:
I want to deploy some AKS in Azure using Terraform but it is taking too much time to create more than 1 hour and the terraform job never finish. In the portal the AKS stay in Creating status. I'm deploying the AKS in the EastUS2 region

The vm size that I used are not too big so I don't know understand what could be the problem

This is my main file:

main.tf

# Configure the Microsoft Azure Provider.
terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">= 2.26"
    }

    kubernetes = {
      source  = "hashicorp/kubernetes"
      version = ">= 1.24.6"
    }

    azapi = {
      source = "azure/azapi"
      version = ">=1.1.0"
    }
  }

  required_version = ">= 0.14.9"
}

provider "azurerm" {
  features {}
}

provider "kubernetes" {
  host                   = module.aks.host
  username               = module.aks.username
  password               = module.aks.password
  client_certificate     = module.aks.client_certificate
  client_key             = base64decode(module.aks.client_key)
  cluster_ca_certificate = base64decode(module.aks.cluster_ca_certificate)
}

provider "azapi" {
  # subscription_id = data.azurerm_client_config.current.subscription_id
  # tentat_id = data.azurerm_client_config.current.tenant_id
}

data "azurerm_client_config" "current" {}

module "ResourceGroup" {
  source = "./ResourceGroup"
}

module "Networks" {
  source = "./Networks"
  resource_group_name = module.ResourceGroup.rg_name_out
  location = module.ResourceGroup.rg_location_out
}
module "acr" {
  source                       = "./ACR"
  resource_group_name          = module.ResourceGroup.rg_name_out
  location                     = module.ResourceGroup.rg_location_out

  name                         = var.acr_name
  sku                          = var.acr_sku
  admin_enabled                = var.acr_admin_enabled
  georeplication_locations     = var.acr_georeplication_locations
  soft_delete_policy_status    = var.acr_soft_delete_policy_status
  soft_delete_policy_days      = var.acr_soft_delete_policy_days
  identity_name                = var.acr_identity_name

  tags                         = var.tags
  # depends_on                  = [module.StorageAccount]
}

module "aks" {
  source                                   = "./AKS"
  location                                 = module.ResourceGroup.rg_location_out
  resource_group_name                      = module.ResourceGroup.rg_name_out
  acr_id                                   = module.acr.id

  name                                     = var.aks_cluster_name
  kubernetes_version                       = var.aks_kubernetes_version
  dns_prefix                               = lower(var.aks_cluster_name)
  private_cluster_enabled                  = var.aks_private_cluster_enabled
  automatic_channel_upgrade                = var.aks_automatic_channel_upgrade
  sku_tier                                 = var.aks_sku_tier
  identity_name                            = var.aks_identity_name
  api_server_authorized_ip_ranges          = [] #module.Networks.subnet_address_bastion
  azure_policy_enabled                     = var.aks_azure_policy_enabled
  http_application_routing_enabled         = var.aks_http_application_routing_enabled

  network_profile                          = var.aks_network_profile
  aci_connector_linux                      = var.aks_aci_connector_linux

  azure_ad_rbac_managed                    = var.aks_azure_ad_rbac_managed
  tenant_id                                = data.azurerm_client_config.current.tenant_id
  admin_group_object_ids                   = var.aks_admin_group_object_ids
  azure_rbac_enabled                       = var.aks_azure_rbac_enabled
  admin_username                           = var.aks_admin_username
  ssh_public_key                           = var.aks_ssh_public_key

  tags                                     = var.tags
  depends_on                               = [module.Networks, module.acr]

  default_node_pool                       = {
    name                    = "system"
    vm_size                 = "Standard_D2s_v3"
    node_count              = 1
    enable_auto_scaling     = true
    max_count               = 1
    min_count               = 1
    max_surge               = "50%"
    max_pods                = 36
    os_disk_size_gb         = 50
    os_disk_type            = "Managed"
    ultra_ssd_enabled       = true
    zones                   = ["1", "2","3"]
    node_labels             = { "workload" = "system" }
    node_taints             = [ "workload=system:NoSchedule" ]
    vnet_subnet_id          = module.Networks.subnet_id
    orchestrator_version    = var.aks_kubernetes_version
  }
  node_pools                             = [
    {
      name                    = "batch"
      mode                    = "User"
      vm_size                 = "Standard_D2s_v3"
      node_count              = 1
      enable_auto_scaling     = true
      max_count               = 1
      min_count               = 1
      max_surge               = "50%"
      max_pods                = 36
      os_disk_size_gb         = 50
      os_disk_type            = "Managed"
      ultra_ssd_enabled       = true
      zones                   = ["1", "2","3"]
      node_labels             = { "workload" = "batch" }
      node_taints             = [ "workload=batch:NoSchedule" ]
      vnet_subnet_id          = module.Networks.subnet_id
      orchestrator_version    = var.aks_kubernetes_version
    }
   ]
}


问:
How to persist Mobx data on NextJS
Problem

After user login user details are saved in mobx state. but after page refresh those data are gone. I want to persist data on mobx state so the user data are stay on mobx state until user logout.

I tried mobx-persist-store but when I go to another page those data are gone again. How can I implement persistence store with or without mobx-persist-store in Next.js?

root-store-provider

import { createContext, FC, useContext } from "react";
import { RootStore } from "./root";

const RootStoreContext = createContext<RootStore>(new RootStore());

export const useStore = () => {
  const context = useContext(RootStoreContext);

  if (context === undefined) {
    throw new Error("useStore must be used within StoreProvider");
  }

  return context;
};

let rootStore: RootStore | undefined;

const initializeStore = (initialData?: RootStore) => {
  const _rootStore = rootStore ?? new RootStore();

  if (initialData) {
    _rootStore.hydrate(initialData);
  }

  if (typeof window === "undefined") return _rootStore;

  if (!rootStore) rootStore = _rootStore;

  return _rootStore;
};

interface Props {
  children: React.ReactNode;
  intialState?: RootStore;
}

export const RootStoreProvider: FC<Props> = ({ children, intialState }) => {
  const store = initializeStore(intialState);
  return (
    <RootStoreContext.Provider value={store}>
      {children}
    </RootStoreContext.Provider>
  );
};```
</div>
</div>
</p>
<p>rootStore</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import { UserStore } from "./user";
import { hydrateStore, makePersistable } from "mobx-persist-store";
import localforage from "localforage";

export class RootStore {
  user: UserStore;

  constructor() {
    this.user = new UserStore(this);

    makePersistable(
      this.user,
      {
        name: "RootStore",
        properties: ["details", "cart"],
        storage: typeof window !== "undefined" ? localforage : undefined,
      },
      { delay: 200, fireImmediately: false }
    );
  }

  async hydrate(data: RootStore): Promise<void> {
    await hydrateStore(data);
  }
}</code>```

Title: How to persist Mobx data on NextJS

Body:
Problem

After user login user details are saved in mobx state. but after page refresh those data are gone. I want to persist data on mobx state so the user data are stay on mobx state until user logout.

I tried mobx-persist-store but when I go to another page those data are gone again. How can I implement persistence store with or without mobx-persist-store in Next.js?

root-store-provider

import { createContext, FC, useContext } from "react";
import { RootStore } from "./root";

const RootStoreContext = createContext<RootStore>(new RootStore());

export const useStore = () => {
  const context = useContext(RootStoreContext);

  if (context === undefined) {
    throw new Error("useStore must be used within StoreProvider");
  }

  return context;
};

let rootStore: RootStore | undefined;

const initializeStore = (initialData?: RootStore) => {
  const _rootStore = rootStore ?? new RootStore();

  if (initialData) {
    _rootStore.hydrate(initialData);
  }

  if (typeof window === "undefined") return _rootStore;

  if (!rootStore) rootStore = _rootStore;

  return _rootStore;
};

interface Props {
  children: React.ReactNode;
  intialState?: RootStore;
}

export const RootStoreProvider: FC<Props> = ({ children, intialState }) => {
  const store = initializeStore(intialState);
  return (
    <RootStoreContext.Provider value={store}>
      {children}
    </RootStoreContext.Provider>
  );
};

rootStore

import { UserStore } from "./user";
import { hydrateStore, makePersistable } from "mobx-persist-store";
import localforage from "localforage";

export class RootStore {
  user: UserStore;

  constructor() {
    this.user = new UserStore(this);

    makePersistable(
      this.user,
      {
        name: "RootStore",
        properties: ["details", "cart"],
        storage: typeof window !== "undefined" ? localforage : undefined,
      },
      { delay: 200, fireImmediately: false }
    );
  }

  async hydrate(data: RootStore): Promise<void> {
    await hydrateStore(data);
  }
}


问:
Problem with python script that takes image to text
When running this script and trying to paste it, it doesn't work.

```<code>import pytesseract
import pyperclip
import PIL.Image

# Open the image file
image = PIL.Image.open('generate_word_picture.png')

# Extract the text from the image using pytesseract
text = pytesseract.image_to_string(image)

# Copy the text to the clipboard
pyperclip.copy(text)
</code>```

This is the image:
Image

I have these installed:

-pip install pytesseract

-pip install pyperclip

-https://github.com/UB-Mannheim/tesseract/wiki

Body:
When running this script and trying to paste it, it doesn't work.

import pytesseract
import pyperclip
import PIL.Image

# Open the image file
image = PIL.Image.open('generate_word_picture.png')

# Extract the text from the image using pytesseract
text = pytesseract.image_to_string(image)

# Copy the text to the clipboard
pyperclip.copy(text)

This is the image:
Image

I have these installed:

-pip install pytesseract

-pip install pyperclip

-https://github.com/UB-Mannheim/tesseract/wiki


问:
get_ReportControlSession NullReferenceException
```<code>Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.Reporting.WebForms.ReportViewer.get_ReportControlSession() +13
   Microsoft.Reporting.WebForms.ReportViewerClientScript.SetViewerInfo(ReportViewer viewer, String reportAreaId, String promptAreaRowId, String docMapAreaId, String fixedTableId, String promptSplitterId, String docMapSplitterId, String docMapHeaderOverflowId, String directionCacheId, String browserModeCacheId) +1078
   Microsoft.Reporting.WebForms.ReportViewer.OnPreRender(EventArgs e) +2696
   System.Web.UI.Control.PreRenderRecursiveInternal() +90
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0
</code>```

Base on information in stack trace above, non of it is from my own code.

Everything in code behind happen in Page_Load and there is try catch but it didn't catch any error. so I guess it's pointless for me to post the c# code.

This project is using visual studio 2015.

I am wondering where is the error come from.

```<code><%@ Page Language="C#" AutoEventWireup="true" CodeFile="GRNCostReportWeekly.aspx.cs" Inherits="Report_GRNCostReportWeekly" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>GRN Cost Report Weekly</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div>
        <rsweb:reportviewer id="ReportViewer1" runat="server" font-names="Verdana" font-size="8pt" height="400px" width="400px">
            <LocalReport ReportPath="report\GRNCostReportWeekly.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet_fn_Get_GRN_Cost_Report_PNA" />
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource2" Name="DataSet_fn_Get_GRN_Cost_Report_NonPNA" />
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource3" Name="DataSet_fn_Get_GRN_Cost_Report_ALL" />
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource4" Name="DataSet_fn_Get_GRN_Cost_Report_Summary" />
                </DataSources>
            </LocalReport>
        </rsweb:reportviewer>

        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="DataSetTableAdapters.fn_Get_GRN_Cost_Report_PNATableAdapter" ConvertNullToDBNull="True">
            <SelectParameters>
                <asp:ControlParameter ControlID="hdSite" DefaultValue="" Name="Site" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hdPeriod" Name="Period" PropertyName="Value" Type="Int32" />
                <asp:ControlParameter ControlID="hdProdGroup" DefaultValue="" Name="ProdGroup" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="DataSetTableAdapters.fn_Get_GRN_Cost_Report_NonPNATableAdapter" ConvertNullToDBNull="True">
            <SelectParameters>
                <asp:ControlParameter ControlID="hdSite" DefaultValue="" Name="Site" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hdPeriod" Name="Period" PropertyName="Value" Type="Int32" />
                <asp:ControlParameter ControlID="hdProdGroup" DefaultValue="" Name="ProdGroup" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="DataSetTableAdapters.fn_Get_GRN_Cost_Report_ALLTableAdapter" ConvertNullToDBNull="True">
            <SelectParameters>
                <asp:ControlParameter ControlID="hdSite" DefaultValue="" Name="Site" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hdPeriod" Name="Period" PropertyName="Value" Type="Int32" />
                <asp:ControlParameter ControlID="hdProdGroup" DefaultValue="" Name="ProdGroup" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="DataSetTableAdapters.fn_Get_GRN_Cost_Report_SummaryTableAdapter" ConvertNullToDBNull="True">
            <SelectParameters>
                <asp:ControlParameter ControlID="hdSite" DefaultValue="" Name="Site" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hdPeriod" Name="Period" PropertyName="Value" Type="Int32" />
                <asp:ControlParameter ControlID="hdProdGroup" DefaultValue="" Name="ProdGroup" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>

        <br />
        <br />
        <asp:HiddenField ID="hdSite" runat="server" Visible="False" />
        <asp:HiddenField ID="hdPeriod" runat="server" Visible="False" />
        <asp:HiddenField ID="hdProdGroup" runat="server" Visible="False" />
        <br />
    </div>
    </form>
</body>
</html>
</code>```

Below is code from web.config related to report:

```<code><httpHandlers>
    <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<compilation debug="true" targetFramework="4.0">
    <assemblies>
        <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    </assemblies>
    <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </buildProviders>
</compilation>
<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
        <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </handlers>
</system.webServer>
</code>```

Body:
Server Error in '/' Application.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.Reporting.WebForms.ReportViewer.get_ReportControlSession() +13
   Microsoft.Reporting.WebForms.ReportViewerClientScript.SetViewerInfo(ReportViewer viewer, String reportAreaId, String promptAreaRowId, String docMapAreaId, String fixedTableId, String promptSplitterId, String docMapSplitterId, String docMapHeaderOverflowId, String directionCacheId, String browserModeCacheId) +1078
   Microsoft.Reporting.WebForms.ReportViewer.OnPreRender(EventArgs e) +2696
   System.Web.UI.Control.PreRenderRecursiveInternal() +90
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +163
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0

Base on information in stack trace above, non of it is from my own code.

Everything in code behind happen in Page_Load and there is try catch but it didn't catch any error. so I guess it's pointless for me to post the c# code.

This project is using visual studio 2015.

I am wondering where is the error come from.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GRNCostReportWeekly.aspx.cs" Inherits="Report_GRNCostReportWeekly" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>GRN Cost Report Weekly</title>

    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

        <rsweb:reportviewer id="ReportViewer1" runat="server" font-names="Verdana" font-size="8pt" height="400px" width="400px">
            <LocalReport ReportPath="report\GRNCostReportWeekly.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet_fn_Get_GRN_Cost_Report_PNA" />
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource2" Name="DataSet_fn_Get_GRN_Cost_Report_NonPNA" />
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource3" Name="DataSet_fn_Get_GRN_Cost_Report_ALL" />
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource4" Name="DataSet_fn_Get_GRN_Cost_Report_Summary" />
                </DataSources>
            </LocalReport>
        </rsweb:reportviewer>

        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="DataSetTableAdapters.fn_Get_GRN_Cost_Report_PNATableAdapter" ConvertNullToDBNull="True">
            <SelectParameters>
                <asp:ControlParameter ControlID="hdSite" DefaultValue="" Name="Site" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hdPeriod" Name="Period" PropertyName="Value" Type="Int32" />
                <asp:ControlParameter ControlID="hdProdGroup" DefaultValue="" Name="ProdGroup" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="DataSetTableAdapters.fn_Get_GRN_Cost_Report_NonPNATableAdapter" ConvertNullToDBNull="True">
            <SelectParameters>
                <asp:ControlParameter ControlID="hdSite" DefaultValue="" Name="Site" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hdPeriod" Name="Period" PropertyName="Value" Type="Int32" />
                <asp:ControlParameter ControlID="hdProdGroup" DefaultValue="" Name="ProdGroup" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="DataSetTableAdapters.fn_Get_GRN_Cost_Report_ALLTableAdapter" ConvertNullToDBNull="True">
            <SelectParameters>
                <asp:ControlParameter ControlID="hdSite" DefaultValue="" Name="Site" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hdPeriod" Name="Period" PropertyName="Value" Type="Int32" />
                <asp:ControlParameter ControlID="hdProdGroup" DefaultValue="" Name="ProdGroup" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="ObjectDataSource4" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetData" TypeName="DataSetTableAdapters.fn_Get_GRN_Cost_Report_SummaryTableAdapter" ConvertNullToDBNull="True">
            <SelectParameters>
                <asp:ControlParameter ControlID="hdSite" DefaultValue="" Name="Site" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hdPeriod" Name="Period" PropertyName="Value" Type="Int32" />
                <asp:ControlParameter ControlID="hdProdGroup" DefaultValue="" Name="ProdGroup" PropertyName="Value" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>

        <asp:HiddenField ID="hdSite" runat="server" Visible="False" />
        <asp:HiddenField ID="hdPeriod" runat="server" Visible="False" />
        <asp:HiddenField ID="hdProdGroup" runat="server" Visible="False" />

    </form>

Below is code from web.config related to report:

<httpHandlers>
    <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<compilation debug="true" targetFramework="4.0">
    <assemblies>
        <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    </assemblies>
    <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </buildProviders>
</compilation>
<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
        <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </handlers>
</system.webServer>


问:
pass a timestamp as a parameter in the query using the node js postgre library (pg)
I'm trying to make a request to the database using the pg library of node js, as you can see in the code below i try to pass a parameter to the query with the date and time, but for some reason it does not return any data, unlike when I execute the same query directly in pgAdmin.

here is my code:

```<code>let company_id = req.body.company_id;
let start_date = moment(req.body.startDate).format('YYYY-MM-DD 00:00:00');
let end_date = moment(req.body.endDate).format('YYYY-MM-DD 23:59:59');

let query = `
    SELECT count(v.vulnerabilidad_id)
    FROM vulnerabilidad AS v
    INNER JOIN escaneo AS e ON e.id = v.escaneo_id
WHERE
    e.cliente_id = $1
AND
    e.timestamp BETWEEN $2 AND $3;
`;

let parameters = [client_id, start_date, end_date];
let response = await pool.query(query, parameters);
</code>```

As I mentioned before, when formatting the date by adding the time the query stops working and return 0 rows, but if I only send the date without the time, this query does return data

pg version is 7.12.1

I expect too make a query from nodejs where I can pass the date with the time as a parameter

Body:
I'm trying to make a request to the database using the pg library of node js, as you can see in the code below i try to pass a parameter to the query with the date and time, but for some reason it does not return any data, unlike when I execute the same query directly in pgAdmin.

here is my code:

let company_id = req.body.company_id;
let start_date = moment(req.body.startDate).format('YYYY-MM-DD 00:00:00');
let end_date = moment(req.body.endDate).format('YYYY-MM-DD 23:59:59');

let query = `
    SELECT count(v.vulnerabilidad_id)
    FROM vulnerabilidad AS v
    INNER JOIN escaneo AS e ON e.id = v.escaneo_id
WHERE
    e.cliente_id = $1
AND
    e.timestamp BETWEEN $2 AND $3;
`;

let parameters = [client_id, start_date, end_date];
let response = await pool.query(query, parameters);

As I mentioned before, when formatting the date by adding the time the query stops working and return 0 rows, but if I only send the date without the time, this query does return data

pg version is 7.12.1

I expect too make a query from nodejs where I can pass the date with the time as a parameter


问:
Django REST - Deploying on Heroku problem
I am building an Ecommerce API with Django REST Framework but i am having difficulties to deploy to heroku.

Below, you can see the problem I had after commiting to git and doing git push heroku master. I am using Heroku Postgres as db add-on. Anybody knows the solution to the following?

```<code>[…]
remote: Verifying deploy… done.
remote: Running release command…
remote:
remote: Operations to perform:
remote: Apply all migrations: admin, auth, contenttypes, core, likes, sessions, store, tags
remote: Running migrations:
remote: Applying store.0007_alter_cart_id…Traceback (most recent call last):
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 89, in _execute
remote: return self.cursor.execute(sql, params)
remote: psycopg2.errors.CannotCoerce: cannot cast type bigint to uuid
remote: LINE 1: …LE “store_cart” ALTER COLUMN “id” TYPE uuid USING “id”::uuid
remote: ^
remote:
remote:
remote: The above exception was the direct cause of the following exception:
remote:
remote: Traceback (most recent call last):
remote: File “/app/manage.py”, line 22, in
remote: main()
remote: File “/app/manage.py”, line 18, in main
remote: execute_from_command_line(sys.argv)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/init.py”, line 446, in execute_from_command_line
remote: utility.execute()
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/init.py”, line 440, in execute
remote: self.fetch_command(subcommand).run_from_argv(self.argv)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py”, line 402, in run_from_argv
remote: self.execute(*args, **cmd_options)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py”, line 448, in execute
remote: output = self.handle(*args, **options)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py”, line 96, in wrapped
remote: res = handle_func(*args, **kwargs)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/commands/migrate.py”, line 349, in handle
remote: post_migrate_state = executor.migrate(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py”, line 135, in migrate
remote: state = self._migrate_all_forwards(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py”, line 167, in _migrate_all_forwards
remote: state = self.apply_migration(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py”, line 252, in apply_migration
remote: state = migration.apply(state, schema_editor)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/migration.py”, line 130, in apply
remote: operation.database_forwards(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/operations/fields.py”, line 235, in database_forwards
remote: schema_editor.alter_field(from_model, from_field, to_field)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/base/schema.py”, line 788, in alter_field
remote: self._alter_field(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/postgresql/schema.py”, line 246, in _alter_field
remote: super()._alter_field(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/base/schema.py”, line 1007, in _alter_field
remote: self.execute(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/base/schema.py”, line 199, in execute
remote: cursor.execute(sql, params)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 67, in execute
remote: return self._execute_with_wrappers(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 80, in _execute_with_wrappers
remote: return executor(sql, params, many, context)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 89, in _execute
remote: return self.cursor.execute(sql, params)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/utils.py”, line 91, in exit
remote: raise dj_exc_value.with_traceback(traceback) from exc_value
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 89, in _execute
remote: return self.cursor.execute(sql, params)
remote: django.db.utils.ProgrammingError: cannot cast type bigint to uuid
remote: LINE 1: …LE “store_cart” ALTER COLUMN “id” TYPE uuid USING “id”::uuid
remote: ^
remote:
remote: Waiting for release… failed.
</code>```

Also, here is the migration that is mentioned on the error above:

```<code>from django.db import migrations, models
import uuid

class Migration(migrations.Migration):

    dependencies = [
        ('store', '0006_auto_20210903_1318'),
    ]

    operations = [
        migrations.AlterField(
            model_name='cart',
            name='id',
            field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False),
        ),
    ]
</code>```

It comes from the following model (when I changed the id to uuid):

```<code>class Cart(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid4)
    created_at = models.DateTimeField(auto_now_add=True)
</code>```

Thanks in advance!

Body:
I am building an Ecommerce API with Django REST Framework but i am having difficulties to deploy to heroku.

Below, you can see the problem I had after commiting to git and doing git push heroku master. I am using Heroku Postgres as db add-on. Anybody knows the solution to the following?

[…]
remote: Verifying deploy… done.
remote: Running release command…
remote:
remote: Operations to perform:
remote: Apply all migrations: admin, auth, contenttypes, core, likes, sessions, store, tags
remote: Running migrations:
remote: Applying store.0007_alter_cart_id…Traceback (most recent call last):
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 89, in _execute
remote: return self.cursor.execute(sql, params)
remote: psycopg2.errors.CannotCoerce: cannot cast type bigint to uuid
remote: LINE 1: …LE “store_cart” ALTER COLUMN “id” TYPE uuid USING “id”::uuid
remote: ^
remote:
remote:
remote: The above exception was the direct cause of the following exception:
remote:
remote: Traceback (most recent call last):
remote: File “/app/manage.py”, line 22, in
remote: main()
remote: File “/app/manage.py”, line 18, in main
remote: execute_from_command_line(sys.argv)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/init.py”, line 446, in execute_from_command_line
remote: utility.execute()
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/init.py”, line 440, in execute
remote: self.fetch_command(subcommand).run_from_argv(self.argv)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py”, line 402, in run_from_argv
remote: self.execute(*args, **cmd_options)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py”, line 448, in execute
remote: output = self.handle(*args, **options)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py”, line 96, in wrapped
remote: res = handle_func(*args, **kwargs)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/core/management/commands/migrate.py”, line 349, in handle
remote: post_migrate_state = executor.migrate(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py”, line 135, in migrate
remote: state = self._migrate_all_forwards(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py”, line 167, in _migrate_all_forwards
remote: state = self.apply_migration(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py”, line 252, in apply_migration
remote: state = migration.apply(state, schema_editor)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/migration.py”, line 130, in apply
remote: operation.database_forwards(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/operations/fields.py”, line 235, in database_forwards
remote: schema_editor.alter_field(from_model, from_field, to_field)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/base/schema.py”, line 788, in alter_field
remote: self._alter_field(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/postgresql/schema.py”, line 246, in _alter_field
remote: super()._alter_field(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/base/schema.py”, line 1007, in _alter_field
remote: self.execute(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/base/schema.py”, line 199, in execute
remote: cursor.execute(sql, params)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 67, in execute
remote: return self._execute_with_wrappers(
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 80, in _execute_with_wrappers
remote: return executor(sql, params, many, context)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 89, in _execute
remote: return self.cursor.execute(sql, params)
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/utils.py”, line 91, in exit
remote: raise dj_exc_value.with_traceback(traceback) from exc_value
remote: File “/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py”, line 89, in _execute
remote: return self.cursor.execute(sql, params)
remote: django.db.utils.ProgrammingError: cannot cast type bigint to uuid
remote: LINE 1: …LE “store_cart” ALTER COLUMN “id” TYPE uuid USING “id”::uuid
remote: ^
remote:
remote: Waiting for release… failed.

Also, here is the migration that is mentioned on the error above:

from django.db import migrations, models
import uuid

class Migration(migrations.Migration):

    dependencies = [
        ('store', '0006_auto_20210903_1318'),
    ]

    operations = [
        migrations.AlterField(
            model_name='cart',
            name='id',
            field=models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False),
        ),
    ]

It comes from the following model (when I changed the id to uuid):

class Cart(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid4)
    created_at = models.DateTimeField(auto_now_add=True)

Thanks in advance!


问:
What would be a good strategy for calculating popularity of an item based on a rating (0-10 scale), vote count, view count and newness of the item
I have an SQL query to pull items out of my DB and I'm stuck at the ORDER BY stage.

The quantitative parameters I have stored in the db are:

rating - A score from 0-10 based on any number of votes (increments of 0.5)

ratingvotes - The number of people who have voted on this item to generate the rating score

views - The number of people who have viewed this item

lastupdated - unix timestamp of the last time the item was updated

Right now I made a simple algoritm to calculate the "popularity" of the item as follows:

```<code>$sqlsort = " ORDER BY ((rating*ratingvotes) / ratingvotes) * greatest(ratingvotes,10) DESC";
</code>```

This seems to work at a basic level of giving me the most popular items, but the results seem weighted heavily to items which have the highest number of votes, thus the list has remained very stale and unchanging.  It seems like the rich just keep getting richer and my result list hasnt changed in the last 6 months.  It also seems to unevenly poorly weight items with low number of votes but very high scores.

So, it seems my algorithm isn't that great at truly reflect an items popularity.  As an extra twist I wanted to weight it a little bit to account for items which were more recently updated to atleast break the staleness of my result list.

I've played with various random algorithms Ive made up in my head and each performs worse then the last, with the above algo performing the best, but as mentioned, its just very stale and unevenly gives power to items with alot of votes.

Any ideas how I could do better?

EDIT:
I'm trying this formula now which seems to perfom a little better:

```<code>$sqlsort = $groupby . " ORDER BY ((rating*ratingvotes) * (1.98/ratingvotes)) + (LOG(ratingvotes)*2) +  (lastupdated/50000000) DESC";
</code>```

Body:
I have an SQL query to pull items out of my DB and I'm stuck at the ORDER BY stage.

The quantitative parameters I have stored in the db are:

rating - A score from 0-10 based on any number of votes (increments of 0.5)

ratingvotes - The number of people who have voted on this item to generate the rating score

views - The number of people who have viewed this item

lastupdated - unix timestamp of the last time the item was updated

Right now I made a simple algoritm to calculate the "popularity" of the item as follows:

$sqlsort = " ORDER BY ((rating*ratingvotes) / ratingvotes) * greatest(ratingvotes,10) DESC";

This seems to work at a basic level of giving me the most popular items, but the results seem weighted heavily to items which have the highest number of votes, thus the list has remained very stale and unchanging.  It seems like the rich just keep getting richer and my result list hasnt changed in the last 6 months.  It also seems to unevenly poorly weight items with low number of votes but very high scores.

So, it seems my algorithm isn't that great at truly reflect an items popularity.  As an extra twist I wanted to weight it a little bit to account for items which were more recently updated to atleast break the staleness of my result list.

I've played with various random algorithms Ive made up in my head and each performs worse then the last, with the above algo performing the best, but as mentioned, its just very stale and unevenly gives power to items with alot of votes.

Any ideas how I could do better?

EDIT:
I'm trying this formula now which seems to perfom a little better:

$sqlsort = $groupby . " ORDER BY ((rating*ratingvotes) * (1.98/ratingvotes)) + (LOG(ratingvotes)*2) +  (lastupdated/50000000) DESC";


问:
How do I programmatically login as a specific user in Next-auth?
I have an e-mail authentication setup using Next-auth. There are 3 users in my DB(Test accounts). How can I programmatically login into a specific one without authenticating via email?

I wish to be logged in as a specific user in my NextJS app without having to click on a link in the mail.


问:
How to perform a x86 jmp far without using a 64 bit register?
I need to perform a x86 far jmp without using any 64 bit register in 64 bit mode.

I am using NASM and linux inline ASM.  So far, when trying to do a jmp 64bit value, the assembler complains.  I can't clobber any 64 bit registers before the jump.


问:
undefined reference to `libusb_xxx'
I'm using Ubuntu 22.04 and CLion to run this in C:

```<code>#include <stdio.h>
#include <sys/types.h>
#include <libusb-1.0/libusb.h>

static void print_devs(libusb_device **devs)
{
    libusb_device *dev;
    int i = 0;

    while ((dev = devs[i++]) != NULL) {
        struct libusb_device_descriptor desc;
        int r = libusb_get_device_descriptor(dev, &desc);
        if (r < 0) {
            fprintf(stderr, "failed to get device descriptor");
            return;
        }

        printf("%04x:%04x (bus %d, device %d)\n",
               desc.idVendor, desc.idProduct,
               libusb_get_bus_number(dev), libusb_get_device_address(dev));
    }
}

int main(void)
{
    printf("hello");
    libusb_device **devs;
    int r;
    ssize_t cnt;

    r = libusb_init(NULL);
    if (r < 0)
        return r;

    cnt = libusb_get_device_list(NULL, &devs);
    if (cnt < 0)
        return (int) cnt;

    print_devs(devs);
    libusb_free_device_list(devs, 1);

    libusb_exit(NULL);
    return 0;
}
</code>```

It's a test.c for libusb. However, with libus-dev and libusb-1.0.0-dev both downloaded, I kept got this error:

```<code>====================[ Build | usbTool | Debug-System ]==========================
/snap/clion/219/bin/cmake/linux/bin/cmake --build /home/wonster/CLionProjects/usb-tool/cmake-build-debug-system --target usbTool -- -j 6
[ 50%] Building C object CMakeFiles/usbTool.dir/test.c.o
[100%] Linking C executable usbTool
/usr/bin/ld: CMakeFiles/usbTool.dir/test.c.o: in function `print_devs':
/home/wonster/CLionProjects/usb-tool/test.c:12: undefined reference to `libusb_get_device_descriptor'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:20: undefined reference to `libusb_get_device_address'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:20: undefined reference to `libusb_get_bus_number'
/usr/bin/ld: CMakeFiles/usbTool.dir/test.c.o: in function `main':
/home/wonster/CLionProjects/usb-tool/test.c:31: undefined reference to `libusb_init'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:35: undefined reference to `libusb_get_device_list'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:40: undefined reference to `libusb_free_device_list'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:42: undefined reference to `libusb_exit'
collect2: error: ld returned 1 exit status
gmake[3]: *** [CMakeFiles/usbTool.dir/build.make:97: usbTool] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/usbTool.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/usbTool.dir/rule] Error 2
gmake: *** [Makefile:124: usbTool] Error 2
</code>```

I just don't know the reason and how to solve this. I've followed a lot of blogs on Internet but not helpful.

I'm guessing whether there's any wrong with the CMake file:

```<code>cmake_minimum_required(VERSION 3.22)
project(usbTool C)

set(CMAKE_C_STANDARD 99)
#声明头文件路径
#set(INC_DIR /opt/homebrew/Cellar/libusb/1.0.26/include/libusb-1.0)//绝对路径
set(INC_DIR ./include)
#声明链接库路径
#set(LINK_DIR /opt/homebrew/Cellar/libusb/1.0.26/lib)//绝对路径
set(LINK_DIR ./lib)

#引入头文件
include_directories(${INC_DIR})

#引入库文件
link_directories(${LINK_DIR})

add_executable(usbTool test.c)

#引入第三方库
target_link_libraries(usbTool libusb-1.0.a)
</code>```

And this is the project content:

Any help is remarkable! Thanks in advance!

Title: undefined reference to `libusb_xxx'

Body:
I'm using Ubuntu 22.04 and CLion to run this in C:

#include <stdio.h>
#include <sys/types.h>
#include <libusb-1.0/libusb.h>

static void print_devs(libusb_device **devs)
{
    libusb_device *dev;
    int i = 0;

    while ((dev = devs[i++]) != NULL) {
        struct libusb_device_descriptor desc;
        int r = libusb_get_device_descriptor(dev, &desc);
        if (r < 0) {
            fprintf(stderr, "failed to get device descriptor");
            return;
        }

        printf("%04x:%04x (bus %d, device %d)\n",
               desc.idVendor, desc.idProduct,
               libusb_get_bus_number(dev), libusb_get_device_address(dev));
    }
}

int main(void)
{
    printf("hello");
    libusb_device **devs;
    int r;
    ssize_t cnt;

    r = libusb_init(NULL);
    if (r < 0)
        return r;

    cnt = libusb_get_device_list(NULL, &devs);
    if (cnt < 0)
        return (int) cnt;

    print_devs(devs);
    libusb_free_device_list(devs, 1);

    libusb_exit(NULL);
    return 0;
}

It's a test.c for libusb. However, with libus-dev and libusb-1.0.0-dev both downloaded, I kept got this error:

====================[ Build | usbTool | Debug-System ]==========================
/snap/clion/219/bin/cmake/linux/bin/cmake --build /home/wonster/CLionProjects/usb-tool/cmake-build-debug-system --target usbTool -- -j 6
[ 50%] Building C object CMakeFiles/usbTool.dir/test.c.o
[100%] Linking C executable usbTool
/usr/bin/ld: CMakeFiles/usbTool.dir/test.c.o: in function `print_devs':
/home/wonster/CLionProjects/usb-tool/test.c:12: undefined reference to `libusb_get_device_descriptor'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:20: undefined reference to `libusb_get_device_address'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:20: undefined reference to `libusb_get_bus_number'
/usr/bin/ld: CMakeFiles/usbTool.dir/test.c.o: in function `main':
/home/wonster/CLionProjects/usb-tool/test.c:31: undefined reference to `libusb_init'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:35: undefined reference to `libusb_get_device_list'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:40: undefined reference to `libusb_free_device_list'
/usr/bin/ld: /home/wonster/CLionProjects/usb-tool/test.c:42: undefined reference to `libusb_exit'
collect2: error: ld returned 1 exit status
gmake[3]: *** [CMakeFiles/usbTool.dir/build.make:97: usbTool] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:83: CMakeFiles/usbTool.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/usbTool.dir/rule] Error 2
gmake: *** [Makefile:124: usbTool] Error 2

I just don't know the reason and how to solve this. I've followed a lot of blogs on Internet but not helpful.

I'm guessing whether there's any wrong with the CMake file:

cmake_minimum_required(VERSION 3.22)
project(usbTool C)

set(CMAKE_C_STANDARD 99)
#声明头文件路径
#set(INC_DIR /opt/homebrew/Cellar/libusb/1.0.26/include/libusb-1.0)//绝对路径
set(INC_DIR ./include)
#声明链接库路径
#set(LINK_DIR /opt/homebrew/Cellar/libusb/1.0.26/lib)//绝对路径
set(LINK_DIR ./lib)

#引入头文件
include_directories(${INC_DIR})

#引入库文件
link_directories(${LINK_DIR})

add_executable(usbTool test.c)

#引入第三方库
target_link_libraries(usbTool libusb-1.0.a)

And this is the project content:

Any help is remarkable! Thanks in advance!