问:
Multiple spark session in one job submit on Kubernetes
can we use multiple starts and stop spark sessions in Kubernetes in one submit a job?

like: if I submit one job using this

```<code>bin/spark-submit \
    --master k8s://https://<k8s-apiserver-host>:<k8s-apiserver-port> \
    --deploy-mode cluster \
    --name spark-pi \
    --class org.apache.spark.examples.SparkPi \
    --conf spark.executor.instances=5 \
    --conf spark.kubernetes.container.image=<spark-image> \
    local:///path/to/examples.jar
</code>```

In my python code, can I starts and stop spark sessions?

examples:

```<code># start spark session
session = SparkSession \
        .builder \
        .appName(appname) \
        .getOrCreate()

## Doing some operations using spark
session.stop()

## some python code.

# start spark session
session = SparkSession \
        .builder \
        .appName(appname) \
        .getOrCreate()

## Doing some operations using spark
session.stop()
</code>```

is it possible or not?

Body:
can we use multiple starts and stop spark sessions in Kubernetes in one submit a job?

like: if I submit one job using this

bin/spark-submit \
    --master k8s://https://<k8s-apiserver-host>:<k8s-apiserver-port> \
    --deploy-mode cluster \
    --name spark-pi \
    --class org.apache.spark.examples.SparkPi \
    --conf spark.executor.instances=5 \
    --conf spark.kubernetes.container.image=<spark-image> \
    local:///path/to/examples.jar

In my python code, can I starts and stop spark sessions?

examples:

# start spark session
session = SparkSession \
        .builder \
        .appName(appname) \
        .getOrCreate()

## Doing some operations using spark
session.stop()

## some python code.

# start spark session
session = SparkSession \
        .builder \
        .appName(appname) \
        .getOrCreate()

## Doing some operations using spark
session.stop()

is it possible or not?


来源: stackexchange

问:
VMWare (anti) detection EXCEPTION_PRIV_INSTRUCTION?
Is it possible to avoid VMWare detection against the following method?

I found this code is used really often:

```<code>            push    edx
            push    ecx
            push    ebx

            mov     eax, 'VMXh'
            mov     ebx, 0          // anything but 'VMXh'
            mov     ecx, 10         // get VMWare version
            mov     edx, 'VX'       // port number
            in      eax, dx         // read port
            cmp     ebx, 'VMXh'     // is it a reply from VMWare?
            je      lblInVMWare

            xor     ecx, ecx        // not in VMWare - clear return value

        lblInVMWare:
            mov     [nVersion], ecx // vmware product type
            pop     ebx
            pop     ecx
            pop     edx
</code>```

There is a description how it works:
https://www.codeproject.com/Articles/9823/Detect-if-your-program-is-running-inside-a-Virtual

To be brief, that 'magic'/special port (in eax, dx // read port) gives something and that's impossible to run on a real computer because of the exception (privileged instruction)

According to this article I tried to use a few parameters in my VMX file:

```<code>monitor_control.disable_directexec = true"
monitor_control.disable_chksimd = "true"
monitor_control.disable_ntreloc = "true"
monitor_control.disable_selfmod = "true"
monitor_control.disable_reloc = "true"
monitor_control.disable_btinout = "true"
monitor_control.disable_brmemspace = "true"
monitor_control.disable_btpriv = "true"
monitor_control.disable_btseg = "true"
isolation.tools.getPtrLocation.disable = "true"
isolation.tools.setPtrLocation.disable = "true"
isolation.tools.setVersion.disable = "true"
isolation.tools.getVersion.disable = "true"
</code>```

and removed VMWare Tools but failed

(I use x32dbg to see what's going on - the code works successfully on VM and doesn't give me any exceptions)

ContentLicense: CC BY-SA 4.0

Body:
Is it possible to avoid VMWare detection against the following method?

I found this code is used really often:

            push    edx
            push    ecx
            push    ebx

            mov     eax, 'VMXh'
            mov     ebx, 0          // anything but 'VMXh'
            mov     ecx, 10         // get VMWare version
            mov     edx, 'VX'       // port number
            in      eax, dx         // read port
            cmp     ebx, 'VMXh'     // is it a reply from VMWare?
            je      lblInVMWare

            xor     ecx, ecx        // not in VMWare - clear return value

        lblInVMWare:
            mov     [nVersion], ecx // vmware product type
            pop     ebx
            pop     ecx
            pop     edx

There is a description how it works:
https://www.codeproject.com/Articles/9823/Detect-if-your-program-is-running-inside-a-Virtual

To be brief, that 'magic'/special port (in eax, dx // read port) gives something and that's impossible to run on a real computer because of the exception (privileged instruction)

According to this article I tried to use a few parameters in my VMX file:

monitor_control.disable_directexec = true"
monitor_control.disable_chksimd = "true"
monitor_control.disable_ntreloc = "true"
monitor_control.disable_selfmod = "true"
monitor_control.disable_reloc = "true"
monitor_control.disable_btinout = "true"
monitor_control.disable_brmemspace = "true"
monitor_control.disable_btpriv = "true"
monitor_control.disable_btseg = "true"
isolation.tools.getPtrLocation.disable = "true"
isolation.tools.setPtrLocation.disable = "true"
isolation.tools.setVersion.disable = "true"
isolation.tools.getVersion.disable = "true"

and removed VMWare Tools but failed

(I use x32dbg to see what's going on - the code works successfully on VM and doesn't give me any exceptions)


问:
How can i solve react native PhaseScriptExecution error
Currently, I'm trying to run the iOS simulator with React Native, but the following error continues to occur.

```<code>error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ***.xcworkspace.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ***.xcworkspace -configuration DebugDev -scheme ***Dev -destination id=***

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

...

** BUILD FAILED **

The following build commands failed:
        PhaseScriptExecution [CP]\ Copy\ XCFrameworks /Users/***/Library/Developer/Xcode/DerivedData/***-anoalvrwljcacmebrbezdhvomyhd/Build/Intermediates.noindex/Pods.build/DebugDev-iphonesimulator/AirBridge.build/Script-46EB2E00015FD0.sh (in target 'AirBridge' from project 'Pods')
(1 failure)
</code>```

I think (in target 'AirBridge' from project 'Pods') is the main cause of the error, so how can I solve this?

Body:
Currently, I'm trying to run the iOS simulator with React Native, but the following error continues to occur.

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ***.xcworkspace.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ***.xcworkspace -configuration DebugDev -scheme ***Dev -destination id=***

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

...

** BUILD FAILED **

The following build commands failed:
        PhaseScriptExecution [CP]\ Copy\ XCFrameworks /Users/***/Library/Developer/Xcode/DerivedData/***-anoalvrwljcacmebrbezdhvomyhd/Build/Intermediates.noindex/Pods.build/DebugDev-iphonesimulator/AirBridge.build/Script-46EB2E00015FD0.sh (in target 'AirBridge' from project 'Pods')
(1 failure)

I think (in target 'AirBridge' from project 'Pods') is the main cause of the error, so how can I solve this?


问:
Update Nifi CSD jar files
I need help on Nifi Installation

I have nifi csd jar files in opt/cloudera/csd folder

owner and group is cloudera-scm

Now I have a requirement of deleting this existing csd jar files and putting new version of nifi csd jar files in the same folder opt/cloudera/csd folder

I have tried delete commands but I am not able to delete this existing nifi csd jar files.

Please help if you have come across same scenario

Tried linux delete commands

Title: Update Nifi CSD jar files


问:
Migrate from --deploy-url to base href in angular
I have an angular project that in embedded inside a CMS,  What this means is that the actual files for the app reside in the folder www.MyApp.com/Modules/App/dist/ but the app is served from www.MyApp.com/app

I have the build script use --deploy-url /Modules/App/dist and I use a small gulp script to update any hard coded assets in the index.html file.

but that is now being depricated.
I tried removing that cli option and updating my angular.json build options to use:

```<code>"baseHref": "/Modules/App/dist/",
</code>```

as well as adding the following to my providers in app.module

```<code> { provide: APP_BASE_HREF, useValue: 'https://www.MyApp.com/app' },
</code>```

as was suggested by this comment on github

But the app does not load at all with that and if I set the base href to '/' it looks for all the assets and scripts in the www.MyApp.com/dist folder.

I am also using a HashLocationStrategy because the app is not served form the root of the website which ends with www.MyApp.com/app#/dashboard where dashboard is the root router option

```<code>export const routes: Routes = [

  /* Lazy Load Modules */
    /* Main route */
  {
    path: 'dashboard',
    loadChildren: () => import('app/modules/dashboard/dashboard.module').then(m => m.DashboardModule)
  },

   ... all other routes

  /* Default Route - Should be defined right above wildcard route or second last*/
  { path: '', redirectTo: '/dashboard/main', pathMatch: 'full' },

];
</code>```

I need help to move away from the deploy-url cli option in our build process.  How should I set the base href options for this.

(Side note, I am open to using a different LocationStrategy if needed)

Body:
I have an angular project that in embedded inside a CMS,  What this means is that the actual files for the app reside in the folder www.MyApp.com/Modules/App/dist/ but the app is served from www.MyApp.com/app

I have the build script use --deploy-url /Modules/App/dist and I use a small gulp script to update any hard coded assets in the index.html file.

but that is now being depricated.
I tried removing that cli option and updating my angular.json build options to use:

"baseHref": "/Modules/App/dist/",

as well as adding the following to my providers in app.module

 { provide: APP_BASE_HREF, useValue: 'https://www.MyApp.com/app' },

as was suggested by this comment on github

But the app does not load at all with that and if I set the base href to '/' it looks for all the assets and scripts in the www.MyApp.com/dist folder.

I am also using a HashLocationStrategy because the app is not served form the root of the website which ends with www.MyApp.com/app#/dashboard where dashboard is the root router option

export const routes: Routes = [

  /* Lazy Load Modules */
    /* Main route */
  {
    path: 'dashboard',
    loadChildren: () => import('app/modules/dashboard/dashboard.module').then(m => m.DashboardModule)
  },

   ... all other routes

  /* Default Route - Should be defined right above wildcard route or second last*/
  { path: '', redirectTo: '/dashboard/main', pathMatch: 'full' },

];

I need help to move away from the deploy-url cli option in our build process.  How should I set the base href options for this.

(Side note, I am open to using a different LocationStrategy if needed)


问:
Mp3 player with Esp32 using SD Card and MAX98357A module
I am working on a project, and I want to play some music notes out from an SD card to an I2S amplifier(MAX98357A) using ESP32. But I did not find anything useful. Just what I want to do is I have twelve(12) buttons and I want each button press to play a music like if I press button one then one music play and when it finishes the other one doesn't play by itself. Yes, and when I play one and then play another, the first one stops and the second one starts playing. Do I have to use pin interrupts for this?

Can someone tell me about the proper libraries for it?


问:
Is there a way to replace TomcatWebSocketServletWebServerCustomizer? Spring 1.x
I'm inquiring about the need to proceed with the development of Spring boot 1.X version, but one part is blocked.
I use Embedded Tomcat, so I have to register with @Bean for ErrorReportValue.
I'm working on moving 400 Bad Request to Custom Error page, but I found a way.
However, they are classes that can be applied from Spring 2.X or higher, so they are not applied to Spring 1.4 version.
The replaceable code was similar but failed. What are some ways to get that function to 1.4 as well?

If you look at the code below, there are codes available from Spring 2.X and above. "TomcatWebSocketServletWebServerCustomizer" and "TomcatServletWebServerFactory" .
Because of these two codes, it is not possible to proceed in version 1.X. It would be nice to upgrade the version, but it will be difficult due to the circumstances.
Among the replaceable codes, "TomcatWebSocketContainerCustomizer" and "Tomcat EmbeddedServletContainerFactory" were available, but were not compatible with "StandardHost".
Help me.
Thank you.

```<code>@Bean
public TomcatWebSocketServletWebServerCustomizer errorValveCustomizer() {
    return new TomcatWebSocketServletWebServerCustomizer() {
        @Override
        public void customize(TomcatServletWebServerFactory factory) {
            factory.addContextCustomizers((context) -> {
                Container parent = context.getParent();
                if (parent instanceof StandardHost) {
                    ((StandardHost) parent).setErrorReportValveClass("com.java.lmh.errors.CustomError");
                }
            });
        }

        @Override
        public int getOrder() {
            return 100; // needs to be AFTER the one configured with TomcatWebServerFactoryCustomizer
        }
    };
}
</code>```

}

Body:
I'm inquiring about the need to proceed with the development of Spring boot 1.X version, but one part is blocked.
I use Embedded Tomcat, so I have to register with @Bean for ErrorReportValue.
I'm working on moving 400 Bad Request to Custom Error page, but I found a way.
However, they are classes that can be applied from Spring 2.X or higher, so they are not applied to Spring 1.4 version.
The replaceable code was similar but failed. What are some ways to get that function to 1.4 as well?

If you look at the code below, there are codes available from Spring 2.X and above. "TomcatWebSocketServletWebServerCustomizer" and "TomcatServletWebServerFactory" .
Because of these two codes, it is not possible to proceed in version 1.X. It would be nice to upgrade the version, but it will be difficult due to the circumstances.
Among the replaceable codes, "TomcatWebSocketContainerCustomizer" and "Tomcat EmbeddedServletContainerFactory" were available, but were not compatible with "StandardHost".
Help me.
Thank you.

@Bean
public TomcatWebSocketServletWebServerCustomizer errorValveCustomizer() {
    return new TomcatWebSocketServletWebServerCustomizer() {
        @Override
        public void customize(TomcatServletWebServerFactory factory) {
            factory.addContextCustomizers((context) -> {
                Container parent = context.getParent();
                if (parent instanceof StandardHost) {
                    ((StandardHost) parent).setErrorReportValveClass("com.java.lmh.errors.CustomError");
                }
            });
        }

        @Override
        public int getOrder() {
            return 100; // needs to be AFTER the one configured with TomcatWebServerFactoryCustomizer
        }
    };
}

}


问:
Steam API - UpdateAuthSessionWithMobileConfirmation
There was a question about an undocumented method in the steam api, which serves to confirm authorization in the client (https://steamapi.xpaw.me/#IAuthenticationService/UpdateAuthSessionWithMobileConfirmation). With the help of Charles proxy, I saw a discrepancy with the documentation, instead of post parameters in the request, access_token is passed in the get parameter. When you try to retry the request, a 500 error is returned. The question is, how to implement the execution of this API method and what is needed for this? Is it possible to use another undocumented method to confirm authorization - UpdateAuthSessionWithSteamGuardCode and where can I get the parameters for its implementation? if anyone has an example of the implementation of these methods in python?

I tried to make a test request in python, but in response I received a 401 error, although according to the documentation I passed the necessary parameter

```<code>import requests

url = "https://api.steampowered.com/IAuthenticationService/UpdateAuthSessionWithMobileConfirmation/v1/"

data = {
    'key': 'my steam web api key from [https://steamcommunity.com/dev/apikey]'
}

req = requests.post(url,data)

print(req.status_code) # 401

</code>```

maybe there are convenient libraries for python where these methods are implemented?

Body:
There was a question about an undocumented method in the steam api, which serves to confirm authorization in the client (https://steamapi.xpaw.me/#IAuthenticationService/UpdateAuthSessionWithMobileConfirmation). With the help of Charles proxy, I saw a discrepancy with the documentation, instead of post parameters in the request, access_token is passed in the get parameter. When you try to retry the request, a 500 error is returned. The question is, how to implement the execution of this API method and what is needed for this? Is it possible to use another undocumented method to confirm authorization - UpdateAuthSessionWithSteamGuardCode and where can I get the parameters for its implementation? if anyone has an example of the implementation of these methods in python?

I tried to make a test request in python, but in response I received a 401 error, although according to the documentation I passed the necessary parameter

import requests

url = "https://api.steampowered.com/IAuthenticationService/UpdateAuthSessionWithMobileConfirmation/v1/"

data = {
    'key': 'my steam web api key from [https://steamcommunity.com/dev/apikey]'
}

req = requests.post(url,data)

print(req.status_code) # 401

maybe there are convenient libraries for python where these methods are implemented?


问:
Overlapping issue used semantic ui react
I am using sidebar from semantic ui react when click Home then routing to next component but issue is the components coming behind the sidebar I want beside of sidebar and i didn't  want to use css (left margin ).
Code is here:
Sidebar.jsx

```<code>import React from 'react'
import {  Menu, Sidebar } from 'semantic-ui-react'
import { Link } from 'react-router-dom'

const SidebarExampleVisible = () => {

return(

    <Sidebar
      as={Menu}
      vertical
      visible
      width='thin'
    >
      <Menu.Item as='a'>
      <Link to='/components/Home'>Home</Link>
      </Menu.Item>
      <Menu.Item as='a'>
        Games
      </Menu.Item>
      <Menu.Item as='a'>
      About
      </Menu.Item>
    </Sidebar>

)
}

export default SidebarExampleVisible
</code>```

Home.jsx

```<code>import React from 'react'
import { Tab } from 'semantic-ui-react'

const panes = [
  {
    menuItem: 'Tab 1',
    render: () => <Tab.Pane attached={false}>Tab 1 Content</Tab.Pane>,
  },
  {
    menuItem: 'Tab 2',
    render: () => <Tab.Pane attached={false}>Tab 2 Content</Tab.Pane>,
  },
  {
    menuItem: 'Tab 3',
    render: () => <Tab.Pane attached={false}>Tab 3 Content</Tab.Pane>,
  },
]

const TabExamplePointing = () => <Tab menu={{ pointing: true }} panes={panes} />

export default TabExamplePointing
</code>```

SandBox link: https://codesandbox.io/s/optimistic-boyd-pecgne?file=/src/Sidebar/Sidebar.jsx:0-460

In sandbox when click home menu then tab will open but tab coming behind the sidebar but i want beside of sidebar

Body:
I am using sidebar from semantic ui react when click Home then routing to next component but issue is the components coming behind the sidebar I want beside of sidebar and i didn't  want to use css (left margin ).
Code is here:
Sidebar.jsx

import React from 'react'
import {  Menu, Sidebar } from 'semantic-ui-react'
import { Link } from 'react-router-dom'

const SidebarExampleVisible = () => {

return(

    <Sidebar
      as={Menu}
      vertical
      visible
      width='thin'
    >
      <Menu.Item as='a'>
      <Link to='/components/Home'>Home</Link>
      </Menu.Item>
      <Menu.Item as='a'>
        Games
      </Menu.Item>
      <Menu.Item as='a'>
      About
      </Menu.Item>
    </Sidebar>

)
}

export default SidebarExampleVisible

Home.jsx

import React from 'react'
import { Tab } from 'semantic-ui-react'

const panes = [
  {
    menuItem: 'Tab 1',
    render: () => <Tab.Pane attached={false}>Tab 1 Content</Tab.Pane>,
  },
  {
    menuItem: 'Tab 2',
    render: () => <Tab.Pane attached={false}>Tab 2 Content</Tab.Pane>,
  },
  {
    menuItem: 'Tab 3',
    render: () => <Tab.Pane attached={false}>Tab 3 Content</Tab.Pane>,
  },
]

const TabExamplePointing = () => <Tab menu={{ pointing: true }} panes={panes} />

export default TabExamplePointing

SandBox link: https://codesandbox.io/s/optimistic-boyd-pecgne?file=/src/Sidebar/Sidebar.jsx:0-460

In sandbox when click home menu then tab will open but tab coming behind the sidebar but i want beside of sidebar


问:
How to handle Routing of web component injected in react application
I have an angular application with routing which is converted as web component. I have injected this to a react application which is getting rendered properly. The issue happens with the conflict of routing between the shell app (React) and the web-component (Angular).
The below scenario is happening.

These are the react routes

```<code>http://localhost:8000/react-route1
http://localhost:8000/react-route2
</code>```

These are the angular routes

```<code>/angular-route1
/angular-route2
</code>```

When the web-component is injected to the react app, the link inside the webcomponent takes the application to http://localhost:8000/angular-route1 which does not exists.

How can this issue be handled where the angular route and react route can be segregated.

Body:
I have an angular application with routing which is converted as web component. I have injected this to a react application which is getting rendered properly. The issue happens with the conflict of routing between the shell app (React) and the web-component (Angular).
The below scenario is happening.

These are the react routes

http://localhost:8000/react-route1
http://localhost:8000/react-route2

These are the angular routes

/angular-route1
/angular-route2

When the web-component is injected to the react app, the link inside the webcomponent takes the application to http://localhost:8000/angular-route1 which does not exists.

How can this issue be handled where the angular route and react route can be segregated.


问:
Uncaught TypeError: Cannot set properties of null (setting 'strokeStyle')
My javascript code is not running

```<code>var button = document.createElement("button");
button.innerHTML="Enquiry";
let x=document.getElementsByTagName("div")[1];
x.appendChild(button);

var a=document.getElementsByTagName("canvas")[0];
a.setAttribute('id','canvas');
undefined
var sc=document.createElement('script');
undefined
sc.innerHTML=`function init() {
var canvas = document.getElementById("canvas");
if (canvas.getContext) {
var ctx = canvas.getContext('2d');
ctx.strokeStyle = "green";
ctx.strokeRect(50,50,100,100);
}
}`;

document.head.append(sc);
undefined
button.addEventListener("click",function(){
    init();
});
</code>```

I am getting stuck in a problem, doesn't Know why I am getting this error every time Uncaught TypeError: Cannot set properties of null (setting 'strokeStyle').

I want to get a rectangle on the function but getting this error, Don't know how to resolve it.

Body:
My javascript code is not running

var button = document.createElement("button");
button.innerHTML="Enquiry";
let x=document.getElementsByTagName("div")[1];
x.appendChild(button);

var a=document.getElementsByTagName("canvas")[0];
a.setAttribute('id','canvas');
undefined
var sc=document.createElement('script');
undefined
sc.innerHTML=`function init() {
var canvas = document.getElementById("canvas");
if (canvas.getContext) {
var ctx = canvas.getContext('2d');
ctx.strokeStyle = "green";
ctx.strokeRect(50,50,100,100);
}
}`;

document.head.append(sc);
undefined
button.addEventListener("click",function(){
    init();
});

I am getting stuck in a problem, doesn't Know why I am getting this error every time Uncaught TypeError: Cannot set properties of null (setting 'strokeStyle').

I want to get a rectangle on the function but getting this error, Don't know how to resolve it.


问:
Format imported table
I've been attempting to import a table of events from the following website:  https://scpgajt.bluegolf.com/bluegolf/scpgajt23/schedule/index.htm?type=2&display=champ (and others similar in structure).

I am attempting to reproduce the example website table on a Google Sheet where I would later add a check-box column and then select the events I need (which would copy the selection to another sheet for personalized planning).

So far, I have been able to use copied/pasted Apps Script coding found on Stack Overflow (see my Example Sheet HERE) and this =ImportTableHTML(A1,1) formula on the sheet to pull the table from the site into the sheet.

This Apps Script method has finally produced a complete list of events, however, the results are horribly formatted incorrectly (see Example Sheet 1 - Scrape Import / Raw). The result I am looking for should format close to the the original columns and rows as the original table, or filter and distribute the pulled data into certain specified cells (see Example Sheet 2 - Model Result).

This is the farthest I have been able to get, thanks to the scripts found on Stack Overflow, combining scripts posted in Replacing =ImportHTML with URLFetchApp) and Creating a UrlFetchApp script to replace the Google Sheet importHTML function.

Unfortunately, now I cannot figure out the options in the script to affect formatting / distributing of the results into the proper cells.

Is it possible to reproduce the table in my example sheet with proper or modifiable formatting?

The site I am attempting to capture table data from

The resulting import using =ImportTableHTML(A1,1)

The way the imported data should be parsed and distributed

App Script Code I am currently using:

```<code>    function importTableHTML(url,n){
      var html = '<table' + UrlFetchApp.fetch(url, {muteHttpExceptions: true}).getContentText().replace(/(\r\n|\n|\r|\t|  )/gm,"").match(/(?<=\<table).*(?=\<\/table)/g) + '</table>';
      var trs = [...html.matchAll(/<tr[\s\S\w]+?<\/tr>/g)];
      var data = [];
      for (var i=0;i<trs.length;i++){
        var tds = [...trs[i][0].matchAll(/<(td|th)[\s\S\w]+?<\/(td|th)>/g)];
        var prov = [];
        for (var j=0;j<tds.length;j++){
          donnee=tds[j][0].match(/(?<=\>).*(?=\<\/)/g)[0];
          prov.push(stripTags(donnee));
        }
        data.push(prov);
      }
      return(data);
    }
    function stripTags(body) {
      var regex = /(<([^>]+)>)/ig;
      return body.replace(regex,"");
    }
</code>```

Title: Format imported table

Body:
I've been attempting to import a table of events from the following website:  https://scpgajt.bluegolf.com/bluegolf/scpgajt23/schedule/index.htm?type=2&display=champ (and others similar in structure).

I am attempting to reproduce the example website table on a Google Sheet where I would later add a check-box column and then select the events I need (which would copy the selection to another sheet for personalized planning).

So far, I have been able to use copied/pasted Apps Script coding found on Stack Overflow (see my Example Sheet HERE) and this =ImportTableHTML(A1,1) formula on the sheet to pull the table from the site into the sheet.

This Apps Script method has finally produced a complete list of events, however, the results are horribly formatted incorrectly (see Example Sheet 1 - Scrape Import / Raw). The result I am looking for should format close to the the original columns and rows as the original table, or filter and distribute the pulled data into certain specified cells (see Example Sheet 2 - Model Result).

This is the farthest I have been able to get, thanks to the scripts found on Stack Overflow, combining scripts posted in Replacing =ImportHTML with URLFetchApp) and Creating a UrlFetchApp script to replace the Google Sheet importHTML function.

Unfortunately, now I cannot figure out the options in the script to affect formatting / distributing of the results into the proper cells.

Is it possible to reproduce the table in my example sheet with proper or modifiable formatting?

The site I am attempting to capture table data from

The resulting import using =ImportTableHTML(A1,1)

The way the imported data should be parsed and distributed

App Script Code I am currently using:

    function importTableHTML(url,n){
      var html = '<table' + UrlFetchApp.fetch(url, {muteHttpExceptions: true}).getContentText().replace(/(\r\n|\n|\r|\t|  )/gm,"").match(/(?<=\<table).*(?=\<\/table)/g) + '
';
      var trs = [...html.matchAll(/<tr[\s\S\w]+?<\/tr>/g)];
      var data = [];
      for (var i=0;i<trs.length;i++){
        var tds = [...trs[i][0].matchAll(/<(td|th)[\s\S\w]+?<\/(td|th)>/g)];
        var prov = [];
        for (var j=0;j<tds.length;j++){
          donnee=tds[j][0].match(/(?<=\>).*(?=\<\/)/g)[0];
          prov.push(stripTags(donnee));
        }
        data.push(prov);
      }
      return(data);
    }
    function stripTags(body) {
      var regex = /(<([^>]+)>)/ig;
      return body.replace(regex,"");
    }


问:
What is the cause of the error readthedocs install "Can't find any collection named tasks"
According to the guide in the link, I am trying to install Readthedocs with docker. However, the "inv docker.build" mentioned in the doc gives an error like this

https://dev.readthedocs.io/en/latest/install.html

inv docker.build
"Can't find any collection named 'tasks'!"

What is the cause of this error? I need to install according to the document in the link. My environment is redhat 9.0 docker-engine installed python 3.11 pip 22.3.3.1 I need help to overcome this problem. why does this command give such an error?


问:
Django UnitTesting: 'AnonymousUser' object has no attribute
I have the following code:

```<code>class CampaignModelTests(TestCase):

    # https://docs.djangoproject.com/en/4.1/topics/testing/advanced/

    def setUp(self):
        # create some test campaigns
        shop = Shop.objects.create(name='Test Shop')
        self.factory = RequestFactory()
        self.user = User.objects.create(shop_username='testuser', shop=shop)
        self.merchant = User.objects.create(username='merchant', password='merchant123', is_merchant=True, shop=shop)
        self.campaign = Campaign.objects.create(name='Test Campaign', shop=shop)

    def test_campaign_creation(self):
        request = self.factory.get(reverse('create-campaign'), {
            'name': 'Test Campaign -1',
            'shop': Shop(name='Test Shop').sid
        })
        request.user = self.merchant
        print('request.user: ', request.user.is_merchant)
        response = CampaignCreate.as_view()(request)
        self.assertEqual(response.status_code, 200)
</code>```

And I am getting the following error:

```<code>return request.user.is_merchant or request.user.is_superuser
AttributeError: 'AnonymousUser' object has no attribute 'is_merchant'
</code>```

I have tried using self.client as well but still the same error.

```<code>self.client.force_login(self.merchant)

# send a request to the view
response = self.client.post(reverse('create-campaign'), {
     'name': 'Test Campaign -1',
     'shop': Shop(name='Test Shop').sid
})
self.assertEqual(response.status_code, 200)
</code>```

Body:
I have the following code:

class CampaignModelTests(TestCase):

    # https://docs.djangoproject.com/en/4.1/topics/testing/advanced/

    def setUp(self):
        # create some test campaigns
        shop = Shop.objects.create(name='Test Shop')
        self.factory = RequestFactory()
        self.user = User.objects.create(shop_username='testuser', shop=shop)
        self.merchant = User.objects.create(username='merchant', password='merchant123', is_merchant=True, shop=shop)
        self.campaign = Campaign.objects.create(name='Test Campaign', shop=shop)

    def test_campaign_creation(self):
        request = self.factory.get(reverse('create-campaign'), {
            'name': 'Test Campaign -1',
            'shop': Shop(name='Test Shop').sid
        })
        request.user = self.merchant
        print('request.user: ', request.user.is_merchant)
        response = CampaignCreate.as_view()(request)
        self.assertEqual(response.status_code, 200)

And I am getting the following error:

return request.user.is_merchant or request.user.is_superuser
AttributeError: 'AnonymousUser' object has no attribute 'is_merchant'

I have tried using self.client as well but still the same error.

self.client.force_login(self.merchant)

# send a request to the view
response = self.client.post(reverse('create-campaign'), {
     'name': 'Test Campaign -1',
     'shop': Shop(name='Test Shop').sid
})
self.assertEqual(response.status_code, 200)


问:
How to combine multiple rows together based one column sharing a common value
I have a dataframe in python and would like to combine multiple rows together into 1 row to which share a common value in a column.  Here is the dataframe:

```<code>df=pd.DataFrame({'drug1' : {0 : 'ZPE', 1 : 'HPE'},
             'plate_id' : {0 : '1', 1 : '1'},
             'response' : {0 : '14240', 1 : '147'},
             'cell_line_name' : {0 : 'H2009', 1 : 'H2009'},
             'cell_number_at_time0 ': {0 : '1000', 1 : '1000'},
             'response_stdev' : {0 : '1228', 1 : '23'}
             })
print(df)
      Index drug1 plate_id response cell_line_name cell_number_at_time0  response_stdev
         0   ZPE        1    14240          H2009                  1000           1228
         1   HPE        1      147          H2009                  1000             23
</code>```

I would now like to combine the two rows based on plate_id and create a new columns named
ZPE_response
HPE_response
ZPE_response_stdev
HPE_response.

I will have multiple plates within the dataframe.  I tried using pandas melt, pandas wide_to_long, and pivot but nothing works.

```<code>stats_table_stdev=stats_table.pivot_table(columns='drug1', index=['plate_id', 'cell_line_name', 'cell_number_at_time0'], values='response_stdev')
stats_table_stdev.rename(columns={'HPE':'HPE_std'}, inplace=True)
stats_table_stdev.rename(columns={'ZPE':'ZPE_std'}, inplace=True)
stats_table_export=pd.merge(left=stats_table_mean, right=stats_table_stdev, left_on=('plate_id', 'cell_line_name', 'cell_number_at_time0'), right_on=('plate_id', 'cell_line_name','cell_number_at_time0'))`
</code>```

Body:
I have a dataframe in python and would like to combine multiple rows together into 1 row to which share a common value in a column.  Here is the dataframe:

df=pd.DataFrame({'drug1' : {0 : 'ZPE', 1 : 'HPE'},
             'plate_id' : {0 : '1', 1 : '1'},
             'response' : {0 : '14240', 1 : '147'},
             'cell_line_name' : {0 : 'H2009', 1 : 'H2009'},
             'cell_number_at_time0 ': {0 : '1000', 1 : '1000'},
             'response_stdev' : {0 : '1228', 1 : '23'}
             })
print(df)
      Index drug1 plate_id response cell_line_name cell_number_at_time0  response_stdev
         0   ZPE        1    14240          H2009                  1000           1228
         1   HPE        1      147          H2009                  1000             23

I would now like to combine the two rows based on plate_id and create a new columns named
ZPE_response
HPE_response
ZPE_response_stdev
HPE_response.

I will have multiple plates within the dataframe.  I tried using pandas melt, pandas wide_to_long, and pivot but nothing works.

stats_table_stdev=stats_table.pivot_table(columns='drug1', index=['plate_id', 'cell_line_name', 'cell_number_at_time0'], values='response_stdev')
stats_table_stdev.rename(columns={'HPE':'HPE_std'}, inplace=True)
stats_table_stdev.rename(columns={'ZPE':'ZPE_std'}, inplace=True)
stats_table_export=pd.merge(left=stats_table_mean, right=stats_table_stdev, left_on=('plate_id', 'cell_line_name', 'cell_number_at_time0'), right_on=('plate_id', 'cell_line_name','cell_number_at_time0'))`


问:
Is there any binding to declare a variable characters length in Django?
I am going to declare variable or function name around 50 characters strings.

Is it okay to declare in this way in Django? Or it may arise any error in future?

```<code>budgeted_cost_sheet_fabric_summary_obj_kg_consumption = 1.123
</code>```

or

```<code>def budgeted_cost_sheet_fabric_summary_obj_kg_consumption_update(id):
    OBJ.update(an_attribute=data)
</code>```

Body:
I am going to declare variable or function name around 50 characters strings.

Is it okay to declare in this way in Django? Or it may arise any error in future?

budgeted_cost_sheet_fabric_summary_obj_kg_consumption = 1.123

or

def budgeted_cost_sheet_fabric_summary_obj_kg_consumption_update(id):
    OBJ.update(an_attribute=data)


问:
How to make api function dynamically in Reactjs
I am working with Reactjs/Nextjs and i am fetching data from "comments.js"
in this file right now data is statically displaying,Here is my current data

```<code>export const books = [
  {
    id: 1,
    title: "Things fall apart",
  },
  {
    id: 2,
    title: "Fairy tails",
  },
  ...
]
</code>```

I want to know that how can i convert this "static" data to "dynamic"(from server or database/mysql) ?

Body:
I am working with Reactjs/Nextjs and i am fetching data from "comments.js"
in this file right now data is statically displaying,Here is my current data

export const books = [
  {
    id: 1,
    title: "Things fall apart",
  },
  {
    id: 2,
    title: "Fairy tails",
  },
  ...
]

I want to know that how can i convert this "static" data to "dynamic"(from server or database/mysql) ?


问:
How to work with an image before saving it in my model?
I have a model where a field exists:

```<code>image=models.ImageField(upload_to='products/')
</code>```

models.py

```<code>class Product(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    name = models.CharField(max_length=200)
    code_number = models.IntegerField(verbose_name='Bar Code')
    image = models.ImageField(upload_to='products/')
    purchase_price = models.DecimalField(max_digits=10, decimal_places=2)
    sale_price= models.DecimalField(max_digits=10, decimal_places=2)
    tax = models.ManyToManyField(Tax, blank=True, related_name="tax")
    pro_quantity =models.DecimalField(max_digits=10, decimal_places=2, default=0)
    description = models.TextField()
    branch = models.ForeignKey(Branch, on_delete=models.CASCADE, related_name="branchesp", blank=True, null=True)
    created_date = models.DateTimeField(
            default=timezone.now)
    published_date = models.DateTimeField(
            blank=True, null=True)

    def publish(self):
        self.published_date = timezone.now()
        self.save()

    def __str__(self):
        return self.name
</code>```

views.py

```<code>class ProductCreate(View):
    form_class = ProductForm
    template_name = 'pos/product_form.html'

    def get(self, request, *args, **kwargs):
        form = self.form_class()
        return render(request, self.template_name, {'form': form})

    def post(self, request, *args, **kwargs):
        form = self.form_class(request.POST, request.FILES)
        form.instance.user = self.request.user
        if form.is_valid():
            # Procesa la imagen subida
            image_content = request.FILES['image'].read()
            image = resize_image_with_aspect(image_content, 800, 600)
            image_file = tempfile.NamedTemporaryFile(mode='wb', suffix='.webp')
            image.save(image_file, format="webp", optimize=True, quality=85)
            image_file = open(image_file.name, 'rb')
            form.instance.image = image_file.read()
            image_file = BytesIO(form.instance.image)
            image_file.seek(0)
            form.instance.image = File(image_file)
            product = form.save(commit=False)
            product.save()
            image_file.close()
            return redirect('inventory')
        else:
            print(form.errors)

        return redirect('inventory')
</code>```

utils.py

```<code>import io
from PIL import Image

def resize_image_with_aspect(image_content, width, height):
    image = Image.open(io.BytesIO(image_content))
    original_width, original_height = image.size
    ratio = original_width / original_height
    if width > height:
        height = int(width / ratio)manteniendo el ratio
    else:
        width = int(height * ratio)
    image = image.resize((width, height), Image.ANTIALIAS)
    return image
</code>```

Now, it seems to work fine but the image doesn't save.  What could I be doing wrong?

I want to optimize, resize, and change to webp any type of image that is uploaded through the form and only save the already-converted image in /media/products and the database

Body:
I have a model where a field exists:

image=models.ImageField(upload_to='products/')

models.py

class Product(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    name = models.CharField(max_length=200)
    code_number = models.IntegerField(verbose_name='Bar Code')
    image = models.ImageField(upload_to='products/')
    purchase_price = models.DecimalField(max_digits=10, decimal_places=2)
    sale_price= models.DecimalField(max_digits=10, decimal_places=2)
    tax = models.ManyToManyField(Tax, blank=True, related_name="tax")
    pro_quantity =models.DecimalField(max_digits=10, decimal_places=2, default=0)
    description = models.TextField()
    branch = models.ForeignKey(Branch, on_delete=models.CASCADE, related_name="branchesp", blank=True, null=True)
    created_date = models.DateTimeField(
            default=timezone.now)
    published_date = models.DateTimeField(
            blank=True, null=True)

    def publish(self):
        self.published_date = timezone.now()
        self.save()

    def __str__(self):
        return self.name

views.py

class ProductCreate(View):
    form_class = ProductForm
    template_name = 'pos/product_form.html'

    def get(self, request, *args, **kwargs):
        form = self.form_class()
        return render(request, self.template_name, {'form': form})

    def post(self, request, *args, **kwargs):
        form = self.form_class(request.POST, request.FILES)
        form.instance.user = self.request.user
        if form.is_valid():
            # Procesa la imagen subida
            image_content = request.FILES['image'].read()
            image = resize_image_with_aspect(image_content, 800, 600)
            image_file = tempfile.NamedTemporaryFile(mode='wb', suffix='.webp')
            image.save(image_file, format="webp", optimize=True, quality=85)
            image_file = open(image_file.name, 'rb')
            form.instance.image = image_file.read()
            image_file = BytesIO(form.instance.image)
            image_file.seek(0)
            form.instance.image = File(image_file)
            product = form.save(commit=False)
            product.save()
            image_file.close()
            return redirect('inventory')
        else:
            print(form.errors)

        return redirect('inventory')

utils.py

import io
from PIL import Image

def resize_image_with_aspect(image_content, width, height):
    image = Image.open(io.BytesIO(image_content))
    original_width, original_height = image.size
    ratio = original_width / original_height
    if width > height:
        height = int(width / ratio)manteniendo el ratio
    else:
        width = int(height * ratio)
    image = image.resize((width, height), Image.ANTIALIAS)
    return image

Now, it seems to work fine but the image doesn't save.  What could I be doing wrong?

I want to optimize, resize, and change to webp any type of image that is uploaded through the form and only save the already-converted image in /media/products and the database


问:
Terraform : Error decoding JSON: json: cannot unmarshal array into Go struct field KeyValuePair.Environment.Value of type string
I copied this resource block from terraform code.When I trigger the pipeline I'm getting error and couldn't solve it.</p>
```<code>locals {
        fedramp_source_types = ["activeDirectory", "azureActiveDirectory"]
        allowed_source_types = ["activeDirectory", "azureActiveDirectory", "googleDirectory"]
          }

module "service_definition" {
...
 env = [
 {
      name = "ALLOWED_SOURCE_TYPES",
      value = "${split(",", module.env_helper.is_legacy ? join(",", local.allowed_source_types) : join(",", local.fedramp_source_types))}"
    }]
}
</code>```

Body:
I copied this resource block from terraform code.When I trigger the pipeline I'm getting error and couldn't solve it.

locals {
        fedramp_source_types = ["activeDirectory", "azureActiveDirectory"]
        allowed_source_types = ["activeDirectory", "azureActiveDirectory", "googleDirectory"]
          }

module "service_definition" {
...
 env = [
 {
      name = "ALLOWED_SOURCE_TYPES",
      value = "${split(",", module.env_helper.is_legacy ? join(",", local.allowed_source_types) : join(",", local.fedramp_source_types))}"
    }]
}


问:
recycle bin $I file header 0xff
I was curious about the $I file while creating the 'Recycle Bin' viewer for a university project.

I understand that the first four digits of the $I file represent operating system information.

When I looked up my file, almost all the files were 0x02.

However, the header of one file is 0xff.
What does this 0xff mean?

And if possible, I would also like to know the appropriate operating system list for the information in each header.

I apologize for my poor English.

I use window 11

in python

```<code>with open('C:/$Recycle.Bin/S-1-5-21-....-XXXX/$I24JSBG.pdf', mode='rb') as file:
    binaryData = file.read()

print(binaryData[28:].decode(encoding='utf-16', errors='strict')[:-1])
</code>```

The other file outputs '02 00 00 00', but for this file outputs 'ff 00 00 00'.

Title: recycle bin $I file header 0xff

Body:
I was curious about the $I file while creating the 'Recycle Bin' viewer for a university project.

I understand that the first four digits of the $I file represent operating system information.

When I looked up my file, almost all the files were 0x02.

However, the header of one file is 0xff.
What does this 0xff mean?

And if possible, I would also like to know the appropriate operating system list for the information in each header.

I apologize for my poor English.

I use window 11

in python

with open('C:/$Recycle.Bin/S-1-5-21-....-XXXX/$I24JSBG.pdf', mode='rb') as file:
    binaryData = file.read()

print(binaryData[28:].decode(encoding='utf-16', errors='strict')[:-1])

The other file outputs '02 00 00 00', but for this file outputs 'ff 00 00 00'.


问:
Type 'void | Response<any, Record<string, any>>' is not assignable to type 'IUser'. Type 'void' is not assignable to type 'IUser'
This is the create function that serves a post request like { "email": "u@u.com", "password" : "12345", "admin" : true } and should save the request inside the mysql database:

```<code>  static async create(req: Request , res : Response , next : NextFunction): Promise<IUser> {
    const user = await pool.query<IUser & RowDataPacket[]>(
      "INSERT INTO users (email, password, admin) VALUES(?,?,?)",
      [req.body.email, req.body.password, req.body.admin])
      .then(user => res.send(user))
      .catch(err => {console.log(err); next();});
    return user;
  }
</code>```

But the problem is that it gives me the following error at the return user line:

```<code>Type 'void | Response<any, Record<string, any>>' is not assignable to type 'IUser'.
  Type 'void' is not assignable to type 'IUser'.
</code>```

Other related files:

```<code>const pool =  mysql.createPool(
  {
  host : (process.env.DB_HOST),
  user : (process.env.DB_USER),
  password: (process.env.DB_PASSWORD ),
  database: (process.env.DB_NAME ),
  waitForConnections: true,
  connectionLimit: 10,
  queueLimit: 0
  }).promise();
</code>```

And:

```<code>export interface IUser extends RowDataPacket {
  id?: number
  email: string
  password: string
  admin: boolean
  created_at: Date
}
</code>```

Body:
This is the create function that serves a post request like { "email": "u@u.com", "password" : "12345", "admin" : true } and should save the request inside the mysql database:

  static async create(req: Request , res : Response , next : NextFunction): Promise<IUser> {
    const user = await pool.query<IUser & RowDataPacket[]>(
      "INSERT INTO users (email, password, admin) VALUES(?,?,?)",
      [req.body.email, req.body.password, req.body.admin])
      .then(user => res.send(user))
      .catch(err => {console.log(err); next();});
    return user;
  }

But the problem is that it gives me the following error at the return user line:

Type 'void | Response<any, Record<string, any>>' is not assignable to type 'IUser'.
  Type 'void' is not assignable to type 'IUser'.

Other related files:

const pool =  mysql.createPool(
  {
  host : (process.env.DB_HOST),
  user : (process.env.DB_USER),
  password: (process.env.DB_PASSWORD ),
  database: (process.env.DB_NAME ),
  waitForConnections: true,
  connectionLimit: 10,
  queueLimit: 0
  }).promise();

And:

export interface IUser extends RowDataPacket {
  id?: number
  email: string
  password: string
  admin: boolean
  created_at: Date
}


问:
How to fix Android Studio AVD flickering?
I am trying to run the Android 12 emulator with default settings on ArchLinux. The emulator starts without any issues, but when I click on the screen, it starts flickering.

I have tried using both floating and docked modes, as well as running the emulator outside of Android Studio, but I continue to experience the same issue.

Specs:

OS: Arch Linux

WindowManager: i3-gaps

Compositor: ibhagwan-picom

CPU: Ryzen 5700x

GPU: RX 6700 XT


问:
How to Corelate server side logging to InstanceID from client in Blazor Wasm Hosted Project
I am using the following to send Log from my Blazor Client to Blazor Server Hosted .NET 7.

```<code>Log.Logger = new LoggerConfiguration()
     .MinimumLevel.ControlledBy(dynamicLogLevel)
     *.Enrich.WithProperty("InstanceId", Guid.NewGuid().ToString("n"))*
     .Enrich.WithProperty("Source", "BlazorWebAssembly")
     .Enrich.WithProperty("AppName", "GetInLineV6")
     .WriteTo.BrowserConsole()
     .WriteTo.BrowserHttp($"{builder.HostEnvironment.BaseAddress}ingest", controlLevelSwitch: dynamicLogLevel.SQLServerRemoteLog) //Need to do additional setup on Server side to recieve this log
     .Enrich.FromLogContext()
     .CreateLogger();
</code>```

I can see that InstanceId is correctly logged for all the Log generated in the Blazor Client;
but if that Blazor Client Make an HTTP Call to Blazor Server, for any log generated on Blazor Server, the InstanceId is empty.

How can i correlate the Code that is run on server by client to the same InstanceId ?

Body:
I am using the following to send Log from my Blazor Client to Blazor Server Hosted .NET 7.

Log.Logger = new LoggerConfiguration()
     .MinimumLevel.ControlledBy(dynamicLogLevel)
     *.Enrich.WithProperty("InstanceId", Guid.NewGuid().ToString("n"))*
     .Enrich.WithProperty("Source", "BlazorWebAssembly")
     .Enrich.WithProperty("AppName", "GetInLineV6")
     .WriteTo.BrowserConsole()
     .WriteTo.BrowserHttp($"{builder.HostEnvironment.BaseAddress}ingest", controlLevelSwitch: dynamicLogLevel.SQLServerRemoteLog) //Need to do additional setup on Server side to recieve this log
     .Enrich.FromLogContext()
     .CreateLogger();

I can see that InstanceId is correctly logged for all the Log generated in the Blazor Client;
but if that Blazor Client Make an HTTP Call to Blazor Server, for any log generated on Blazor Server, the InstanceId is empty.

How can i correlate the Code that is run on server by client to the same InstanceId ?


问:
How to listen for seek or playing position changes in exoplayer android kotlin?
I am try to implement a video editor like feature which includes adding sticker or image on top of the video preview in my app. I want to show the sticker or image on top of the view preview for my sometime. For example, If I have to show a sticker from position 2 second to 6 second, how can I do this in exoplayer?

I know we can use PlayerMessage in exoplayer to do some action at a specific position of the video but in my case, that won't work effectively I think. What's the good way to implement my requirement?


问:
Extract data from Chrome website without using Selenium Driver in Excel VBA
I was trying to download a file from a website that is password protected, I have a username and password. Once logged in I need to download a specific file which is in my excel file.

URL : https://drive.internxt.com/login

I saw we could achieve using Selenium, but we can't install any application in our office. Is that possible without a Selenium driver?

My Code using Selenium :

```<code>Sub test2()
Dim driver As New WebDriver
Dim rowc, cc, columnC As Integer
rowc = 2
Application.ScreenUpdating = False
driver.Start "chrome"
driver. Get "http://demo.guru99.com/test/web-table-element.php"
For Each th In
driver.FindElementByClass("dataTable").FindElementByTag("thead").FindElementsByTag("tr")
cc = 1
For Each t In th.FindElementsByTag("th")
Sheet2.Cells(1, cc).Value = t.Text
cc = cc + 1
Next t
Next th
</code>```

Body:
I was trying to download a file from a website that is password protected, I have a username and password. Once logged in I need to download a specific file which is in my excel file.

URL : https://drive.internxt.com/login

I saw we could achieve using Selenium, but we can't install any application in our office. Is that possible without a Selenium driver?

My Code using Selenium :

Sub test2()
Dim driver As New WebDriver
Dim rowc, cc, columnC As Integer
rowc = 2
Application.ScreenUpdating = False
driver.Start "chrome"
driver. Get "http://demo.guru99.com/test/web-table-element.php"
For Each th In
driver.FindElementByClass("dataTable").FindElementByTag("thead").FindElementsByTag("tr")
cc = 1
For Each t In th.FindElementsByTag("th")
Sheet2.Cells(1, cc).Value = t.Text
cc = cc + 1
Next t
Next th


问:
Trying to run 0xmonaco's default package on mac (m1 chip) it wouldnt pass
this seems to be very basic but I just can't figure out after trying different ways: I tried to forge build and then forge test the "0xMonaco challenge’s zip" file from https://0xmonaco.ctf.paradigm.xyz/howtoplay but it just wouldn't pass while throwing this error:

```<code>[⠊] Compiling...
[⠒] Compiling 13 files with 0.8.13
[⠘] Solc 0.8.13 finished in 1.61s
Compiler run successful

Running 1 test for test/Monaco.t.sol:MonacoTest
[FAIL. Reason: The path "logs/<filename>.csv" is not allowed to be accessed for write operations.] testGames() (gas: 1201982)
Test result: FAILED. 0 passed; 1 failed; finished in 3.98ms

Failing tests:
Encountered 1 failing test in test/Monaco.t.sol:MonacoTest
[FAIL. Reason: The path "logs/<filename>.csv" is not allowed to be accessed for write operations.] testGames() (gas: 1201982)

Encountered a total of 1 failing tests, 0 tests succeeded
</code>```

Any ideas? Or anyone ran into this?

Tried setting the folder permission setting to read and write

Tried chmod 777 logs/<filename>.csv (actually none of the files in the logs folder matches the no-permission file name, so i had to manually change them accordingly. But, also, this didnt work.

Body:
this seems to be very basic but I just can't figure out after trying different ways: I tried to forge build and then forge test the "0xMonaco challenge’s zip" file from https://0xmonaco.ctf.paradigm.xyz/howtoplay but it just wouldn't pass while throwing this error:

[⠊] Compiling...
[⠒] Compiling 13 files with 0.8.13
[⠘] Solc 0.8.13 finished in 1.61s
Compiler run successful

Running 1 test for test/Monaco.t.sol:MonacoTest
[FAIL. Reason: The path "logs/<filename>.csv" is not allowed to be accessed for write operations.] testGames() (gas: 1201982)
Test result: FAILED. 0 passed; 1 failed; finished in 3.98ms

Failing tests:
Encountered 1 failing test in test/Monaco.t.sol:MonacoTest
[FAIL. Reason: The path "logs/<filename>.csv" is not allowed to be accessed for write operations.] testGames() (gas: 1201982)

Encountered a total of 1 failing tests, 0 tests succeeded

Any ideas? Or anyone ran into this?

Tried setting the folder permission setting to read and write

Tried chmod 777 logs/<filename>.csv (actually none of the files in the logs folder matches the no-permission file name, so i had to manually change them accordingly. But, also, this didnt work.


问:
Using w3.js - w3.hide / w3.show with HTML tables
I am working with W3.CSS and W3.JS to create an expandable / collapsible HTML table.  The w3.hide() function works fine to hide targeted rows, but when I use the w3.show() function against the same targeted rows, when the rows are displayed, the whole row is contained in the first  tag.

Without going into lots of detail on the code behind this, I wanted to see if anyone has successfully created a table like this using W3.CSS and W3.JS and could share example code of it working?

Despite lots of googling for a solution, I cannot find any examples of W3.CSS and W3.JS being used in this way.


问:
Python Gunicorn with Gevent workers very slow than pure flask for time.localtime
I have a controller that's very slow when running in Gunicorn/Gevent (21sec) over pure Flask (5s)

Upon profiling there are 300K calls to Python's built-in method time.localtime. Here's a simplified controller that also shows this behavior

```<code>import time
def my_time():
    time.localtime()

@app.route('/my_test', methods=['GET'])
def my_test():
    """
    Test endpoint
    """
    for i in range(326457):
        my_time()
    return 'OK'

</code>```

Profile output from running pure Flask

```<code>   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   326457    0.204    0.000    0.387    0.000 __init__.py:23(my_time)
   326457    0.183    0.000    0.183    0.000 {built-in method time.localtime}
   326457    0.010    0.000    0.010    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        0    0.000             0.000          profile:0(profiler)
</code>```

Profile output w/ Gevent/Gunicorn.
Gunicorn server settings gunicorn --workers=2 --threads=5 --timeout=300 --graceful-timeout=300 --worker-connections=100 --worker-class=gevent -b :8080 main:app

```<code>   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   326457    0.226    0.000   15.784    0.000 __init__.py:23(my_time)
   326457   15.557    0.000   15.557    0.000 {built-in method time.localtime}
   326457    0.016    0.000    0.016    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        0    0.000             0.000          profile:0(profiler)

</code>```

What's causing time.localtime to take over 15s with Gunicorn/Gevent?

Versions

```<code>Python 3.6
gevent==22.10.2
gunicorn==20.1.0
</code>```

Body:
I have a controller that's very slow when running in Gunicorn/Gevent (21sec) over pure Flask (5s)

Upon profiling there are 300K calls to Python's built-in method time.localtime. Here's a simplified controller that also shows this behavior

import time
def my_time():
    time.localtime()

@app.route('/my_test', methods=['GET'])
def my_test():
    """
    Test endpoint
    """
    for i in range(326457):
        my_time()
    return 'OK'

Profile output from running pure Flask

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   326457    0.204    0.000    0.387    0.000 __init__.py:23(my_time)
   326457    0.183    0.000    0.183    0.000 {built-in method time.localtime}
   326457    0.010    0.000    0.010    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        0    0.000             0.000          profile:0(profiler)

Profile output w/ Gevent/Gunicorn.
Gunicorn server settings gunicorn --workers=2 --threads=5 --timeout=300 --graceful-timeout=300 --worker-connections=100 --worker-class=gevent -b :8080 main:app

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
   326457    0.226    0.000   15.784    0.000 __init__.py:23(my_time)
   326457   15.557    0.000   15.557    0.000 {built-in method time.localtime}
   326457    0.016    0.000    0.016    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        0    0.000             0.000          profile:0(profiler)

What's causing time.localtime to take over 15s with Gunicorn/Gevent?

Versions

Python 3.6
gevent==22.10.2
gunicorn==20.1.0


问:
another sub menu appearing on the header (wordpress - elementor)
okay so i dunno if sub menu is the correct word but dunno what to call it.
here is the menu for example
menu in the editor
here is the same exact menu but on the website
menu on the website

it kinda happened around the time i got a ssl license (free from the provider) . it also changed a lot of the settings and other stuff like adding random things to the website or changing already published pages.

i changed the theme . tried to make another header and adding it as html shortcode and removing the ssl licensee and adding it back. nothing work (or i did something wrong and didn't notice)


问:
How to find root dependency of restored nuget package?
I can see some restored packages in the packages folder of the project but they seem to be indirect dependencies as they can not be seen in .csproj or package.config files. I wanted to know the root dependency of these packages they are causing some alerts regarding vulnerabilities. Is there a way to find it?

Tried checking in project.assets.json, .csproj, package.config files. Was expecting to see the restored package somewhere in these.


问:
Multiple Join and Max with Max Value in LINQ
I have this SQL code who works:

```<code>select Remarks,a.NoMachine,Color,Status
from TestGoogleChart a inner join tblMachine b on a.NoMachine = b.Machine_Code
where a.Id = (select max(id) from TestGoogleChart c where c.NoMachine = a.NoMachine)
order by Remarks asc
</code>```

These query can be executed in SQL Server.

I want to covert that query into LINQ.
Please anybody help me out from this problem.

Thank you very much.

Regards.
Satya

Body:
I have this SQL code who works:

select Remarks,a.NoMachine,Color,Status
from TestGoogleChart a inner join tblMachine b on a.NoMachine = b.Machine_Code
where a.Id = (select max(id) from TestGoogleChart c where c.NoMachine = a.NoMachine)
order by Remarks asc

These query can be executed in SQL Server.

I want to covert that query into LINQ.
Please anybody help me out from this problem.

Thank you very much.

Regards.
Satya