问:
how to resolve "Py4JJavaError" error facing with pyspark
I tried to run show() method over data frame then after i started getting this error

```<code>Py4JJavaError: An error occurred while calling o152.showString.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 7.0 failed 1 times, most recent failure: Lost task 0.0 in stage 7.0 (TID 10) (host.docker.internal executor driver): org.apache.spark.SparkException: Python worker failed to connect back.
    at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:189)
    at org.apache.spark.api.python.PythonWorkerFactory.create(PythonWorkerFactory.scala:109)
    at org.apache.spark.SparkEnv.createPythonWorker(SparkEnv.scala:124)
    at org.apache.spark.api.python.BasePythonRunner.compute(PythonRunner.scala:164)
    at org.apache.spark.api.python.PythonRDD.compute(PythonRDD.scala:65)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
    at org.apache.spark.scheduler.Task.run(Task.scala:136)
    at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:548)
    at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1504)
    at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)
Caused by: java.net.SocketTimeoutException: Accept timed out
    at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
    at java.net.DualStackPlainSocketImpl.socketAccept(DualStackPlainSocketImpl.java:131)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:535)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:189)
    at java.net.ServerSocket.implAccept(ServerSocket.java:545)
    at java.net.ServerSocket.accept(ServerSocket.java:513)
    at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:176)
    ... 29 more

Driver stacktrace:
    at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:2672)
    at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:2608)
    at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:2607)
    at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
    at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
    at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:2607)
    at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1(DAGScheduler.scala:1182)
    at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1$adapted(DAGScheduler.scala:1182)
    at scala.Option.foreach(Option.scala:407)
    at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:1182)
    at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:2860)
    at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2802)
    at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2791)
    at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:49)
    at org.apache.spark.scheduler.DAGScheduler.runJob(DAGScheduler.scala:952)
    at org.apache.spark.SparkContext.runJob(SparkContext.scala:2228)
    at org.apache.spark.SparkContext.runJob(SparkContext.scala:2249)
    at org.apache.spark.SparkContext.runJob(SparkContext.scala:2268)
    at org.apache.spark.sql.execution.SparkPlan.executeTake(SparkPlan.scala:506)
    at org.apache.spark.sql.execution.SparkPlan.executeTake(SparkPlan.scala:459)
    at org.apache.spark.sql.execution.CollectLimitExec.executeCollect(limit.scala:48)
    at org.apache.spark.sql.Dataset.collectFromPlan(Dataset.scala:3868)
    at org.apache.spark.sql.Dataset.$anonfun$head$1(Dataset.scala:2863)
    at org.apache.spark.sql.Dataset.$anonfun$withAction$2(Dataset.scala:3858)
    at org.apache.spark.sql.execution.QueryExecution$.withInternalError(QueryExecution.scala:510)
    at org.apache.spark.sql.Dataset.$anonfun$withAction$1(Dataset.scala:3856)
    at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$6(SQLExecution.scala:109)
    at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:169)
    at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:95)
    at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:779)
    at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:64)
    at org.apache.spark.sql.Dataset.withAction(Dataset.scala:3856)
    at org.apache.spark.sql.Dataset.head(Dataset.scala:2863)
    at org.apache.spark.sql.Dataset.take(Dataset.scala:3084)
    at org.apache.spark.sql.Dataset.getRows(Dataset.scala:288)
    at org.apache.spark.sql.Dataset.showString(Dataset.scala:327)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
    at py4j.Gateway.invoke(Gateway.java:282)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)
    at py4j.ClientServerConnection.run(ClientServerConnection.java:106)
    at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.spark.SparkException: Python worker failed to connect back.
    at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:189)
    at org.apache.spark.api.python.PythonWorkerFactory.create(PythonWorkerFactory.scala:109)
    at org.apache.spark.SparkEnv.createPythonWorker(SparkEnv.scala:124)
    at org.apache.spark.api.python.BasePythonRunner.compute(PythonRunner.scala:164)
    at org.apache.spark.api.python.PythonRDD.compute(PythonRDD.scala:65)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
    at org.apache.spark.scheduler.Task.run(Task.scala:136)
    at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:548)
    at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1504)
    at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    ... 1 more
Caused by: java.net.SocketTimeoutException: Accept timed out
    at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
    at java.net.DualStackPlainSocketImpl.socketAccept(DualStackPlainSocketImpl.java:131)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:535)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:189)
    at java.net.ServerSocket.implAccept(ServerSocket.java:545)
    at java.net.ServerSocket.accept(ServerSocket.java:513)
    at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:176)
    ... 29 more

</code>```

I have installed a updated version of pyspark then after I started getting error Py4JJavaError
can anyone help me with this error
normally what is root cause of this error
i tried to resolve it with few available references but didn't succeeded

Body:
I tried to run show() method over data frame then after i started getting this error

Py4JJavaError: An error occurred while calling o152.showString.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 7.0 failed 1 times, most recent failure: Lost task 0.0 in stage 7.0 (TID 10) (host.docker.internal executor driver): org.apache.spark.SparkException: Python worker failed to connect back.
    at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:189)
    at org.apache.spark.api.python.PythonWorkerFactory.create(PythonWorkerFactory.scala:109)
    at org.apache.spark.SparkEnv.createPythonWorker(SparkEnv.scala:124)
    at org.apache.spark.api.python.BasePythonRunner.compute(PythonRunner.scala:164)
    at org.apache.spark.api.python.PythonRDD.compute(PythonRDD.scala:65)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
    at org.apache.spark.scheduler.Task.run(Task.scala:136)
    at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:548)
    at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1504)
    at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)
Caused by: java.net.SocketTimeoutException: Accept timed out
    at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
    at java.net.DualStackPlainSocketImpl.socketAccept(DualStackPlainSocketImpl.java:131)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:535)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:189)
    at java.net.ServerSocket.implAccept(ServerSocket.java:545)
    at java.net.ServerSocket.accept(ServerSocket.java:513)
    at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:176)
    ... 29 more

Driver stacktrace:
    at org.apache.spark.scheduler.DAGScheduler.failJobAndIndependentStages(DAGScheduler.scala:2672)
    at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2(DAGScheduler.scala:2608)
    at org.apache.spark.scheduler.DAGScheduler.$anonfun$abortStage$2$adapted(DAGScheduler.scala:2607)
    at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
    at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
    at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:2607)
    at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1(DAGScheduler.scala:1182)
    at org.apache.spark.scheduler.DAGScheduler.$anonfun$handleTaskSetFailed$1$adapted(DAGScheduler.scala:1182)
    at scala.Option.foreach(Option.scala:407)
    at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:1182)
    at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:2860)
    at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2802)
    at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:2791)
    at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:49)
    at org.apache.spark.scheduler.DAGScheduler.runJob(DAGScheduler.scala:952)
    at org.apache.spark.SparkContext.runJob(SparkContext.scala:2228)
    at org.apache.spark.SparkContext.runJob(SparkContext.scala:2249)
    at org.apache.spark.SparkContext.runJob(SparkContext.scala:2268)
    at org.apache.spark.sql.execution.SparkPlan.executeTake(SparkPlan.scala:506)
    at org.apache.spark.sql.execution.SparkPlan.executeTake(SparkPlan.scala:459)
    at org.apache.spark.sql.execution.CollectLimitExec.executeCollect(limit.scala:48)
    at org.apache.spark.sql.Dataset.collectFromPlan(Dataset.scala:3868)
    at org.apache.spark.sql.Dataset.$anonfun$head$1(Dataset.scala:2863)
    at org.apache.spark.sql.Dataset.$anonfun$withAction$2(Dataset.scala:3858)
    at org.apache.spark.sql.execution.QueryExecution$.withInternalError(QueryExecution.scala:510)
    at org.apache.spark.sql.Dataset.$anonfun$withAction$1(Dataset.scala:3856)
    at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$6(SQLExecution.scala:109)
    at org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:169)
    at org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:95)
    at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:779)
    at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:64)
    at org.apache.spark.sql.Dataset.withAction(Dataset.scala:3856)
    at org.apache.spark.sql.Dataset.head(Dataset.scala:2863)
    at org.apache.spark.sql.Dataset.take(Dataset.scala:3084)
    at org.apache.spark.sql.Dataset.getRows(Dataset.scala:288)
    at org.apache.spark.sql.Dataset.showString(Dataset.scala:327)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
    at py4j.Gateway.invoke(Gateway.java:282)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)
    at py4j.ClientServerConnection.run(ClientServerConnection.java:106)
    at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.spark.SparkException: Python worker failed to connect back.
    at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:189)
    at org.apache.spark.api.python.PythonWorkerFactory.create(PythonWorkerFactory.scala:109)
    at org.apache.spark.SparkEnv.createPythonWorker(SparkEnv.scala:124)
    at org.apache.spark.api.python.BasePythonRunner.compute(PythonRunner.scala:164)
    at org.apache.spark.api.python.PythonRDD.compute(PythonRDD.scala:65)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
    at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
    at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
    at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
    at org.apache.spark.scheduler.Task.run(Task.scala:136)
    at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:548)
    at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1504)
    at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    ... 1 more
Caused by: java.net.SocketTimeoutException: Accept timed out
    at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
    at java.net.DualStackPlainSocketImpl.socketAccept(DualStackPlainSocketImpl.java:131)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:535)
    at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:189)
    at java.net.ServerSocket.implAccept(ServerSocket.java:545)
    at java.net.ServerSocket.accept(ServerSocket.java:513)
    at org.apache.spark.api.python.PythonWorkerFactory.createSimpleWorker(PythonWorkerFactory.scala:176)
    ... 29 more

I have installed a updated version of pyspark then after I started getting error Py4JJavaError
can anyone help me with this error
normally what is root cause of this error
i tried to resolve it with few available references but didn't succeeded


来源: stackexchange

问:
Maximum list length of the BigQuery ArrayQueryParameter values parameter
I am trying to query BigQuery through the Python API Client Library using query parameters, specifically an ArrayQueryParameter.

```<code>from google.cloud import bigquery

client = bigquery.Client()

query = """
    SELECT
        *
    FROM
        `bigquery-public-data.geo_us_boundaries.cbsa`
    WHERE
        name IN UNNEST(@metros)
"""

# Problematic list length
LIST_LENGTH = 300000

# Example values list
values = ["Los Angeles-Long Beach-Anaheim, CA" for i in range(LIST_LENGTH)]

# Generate BigQuery job config
job_config = bigquery.QueryJobConfig(
    priority=bigquery.QueryPriority.BATCH,
    query_parameters=[
        bigquery.ArrayQueryParameter("metros", array_type="STRING", values=values),
    ]
)

# Generate BigQuery query job
query_job = client.query(
    query,
    job_config=job_config,
)

# Obtain results
results = query_job.result()
for row in results:
    print(row)
</code>```

When the list length in the ArrayQueryParameter "values" parameter is 300000 or longer (approximately), the query does not finish and if I inspect the BigQuery logs I am getting the following error log:
HTTPSConnectionPool(host='bigquery.googleapis.com', port=443): Max retries exceeded with url: /bigquery/v2/projects/{...}/jobs?prettyPrint=false (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2396)'))) 2.05274303188268
But with the length of the list being 200000 or lower, there is no problem and the query results are returned.

From this log I interpret that I am exceeding the maximum list length of this "values" parameter, but don't find this to be included in BigQuery documentation...

Which is the maximum list length of the BigQuery ArrayQueryParameter "values" parameter? Is there any workaround to be able to perform a query with a 300000 or longer list length?

Thank you in advance!

ContentLicense: CC BY-SA 4.0

Body:
I am trying to query BigQuery through the Python API Client Library using query parameters, specifically an ArrayQueryParameter.

from google.cloud import bigquery

client = bigquery.Client()

query = """
    SELECT
        *
    FROM
        `bigquery-public-data.geo_us_boundaries.cbsa`
    WHERE
        name IN UNNEST(@metros)
"""

# Problematic list length
LIST_LENGTH = 300000

# Example values list
values = ["Los Angeles-Long Beach-Anaheim, CA" for i in range(LIST_LENGTH)]

# Generate BigQuery job config
job_config = bigquery.QueryJobConfig(
    priority=bigquery.QueryPriority.BATCH,
    query_parameters=[
        bigquery.ArrayQueryParameter("metros", array_type="STRING", values=values),
    ]
)

# Generate BigQuery query job
query_job = client.query(
    query,
    job_config=job_config,
)

# Obtain results
results = query_job.result()
for row in results:
    print(row)

When the list length in the ArrayQueryParameter "values" parameter is 300000 or longer (approximately), the query does not finish and if I inspect the BigQuery logs I am getting the following error log:
HTTPSConnectionPool(host='bigquery.googleapis.com', port=443): Max retries exceeded with url: /bigquery/v2/projects/{...}/jobs?prettyPrint=false (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2396)'))) 2.05274303188268
But with the length of the list being 200000 or lower, there is no problem and the query results are returned.

From this log I interpret that I am exceeding the maximum list length of this "values" parameter, but don't find this to be included in BigQuery documentation...

Which is the maximum list length of the BigQuery ArrayQueryParameter "values" parameter? Is there any workaround to be able to perform a query with a 300000 or longer list length?

Thank you in advance!


问:
Why is adding 'form-control' bootstrap class in Django form not working?
I am creating a login page without an inbuilt model form. I am using FormAPI of Django and followed all the steps to add a class attribute to the input fields of my form. But it still looks like a basic form without bootstrap.

forms.py:

```<code>#Login Form

class LoginForm(forms.Form):
    username=forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
    password=forms.CharField(widget=forms.PasswordInput(attrs={'class':'form-control'}))
</code>```

Base template file to be inherited:

```<code><!doctype html>
{% load static %}
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="{% static 'account/images/logo.ico' type='image/x-icon' %}">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
    <link rel="stylesheet" href="{% static 'account/css/style.css' %}">
    <title>{% block title %}{% endblock title %}</title>
  </head>
  <body class="forbody">
    <div class="container trp" style="margin-top: 2%; display: inline-block;">
        <div class="row">
            <div class="col-md-4">
                <img src="{% static 'account/images/Logo.png' %}" alt="Logo" style="height: 60%; width: auto;">
            </div>
        </div>
    </div>
    <div class="container" style="width: 40%; margin-top: 10%;">
        <div class="container" style="width: auto; margin-top: 8%;">
            <div class="container" style="background-color: #696969; height: auto; width: auto; margin-top: 8%;">
                <div class="row">
                    <div class="col-lg-6" style="padding-top: 25px; padding-bottom: 20px; padding-left: 20px;">
                        <form action="" method="post" novalidate>
                            {% csrf_token %}
                            {% block formcontent %} {% endblock formcontent %}
                <div class="row text-center">
                    <div class="col-lg-12">
                        {% block loginbtn %} {% endblock loginbtn %}
                    </div>
                </div>
                <div class="row text-center">
                    <div class="col-lg-12" style="padding-top: 10px; padding-bottom: 12px;">
                        {% block outerlink %} {% endblock outerlink %}
                        {% block messages %} {% endblock messages %}
                    </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
  </body>
</html>
</code>```

Actual login template:

```<code>{% extends 'account/forms_base.html' %}
{% block title %}Log-in{% endblock title %}
{% block formcontent %}
    {% if form.non_field_errors %}
        {% for error in form.non_field_errors %}
            {{error}}
        {% endfor %}
    {% endif %}
    {% for fm in form %}
        {{fm.label_tag}} {{fm}} {{fm.error|striptags}} <br><br>
    {% endfor %}
{% endblock formcontent %}
{% block loginbtn %}
    <input class="submitbtn" type="submit" value="Login">
{% endblock loginbtn %}
{% block outerlink %}
    <small style="margin-top: 5px;">To register <a href="{% url 'signup' %}" class="signuptag">Click Here</a></small>
{% endblock outerlink %}
{% block messages %}
    {% if messages %}
        {% for message in messages %}
            <span {% if message.tags %} class="{{message.tags}}" {% endif %}>{{message}}</span>
        {% endfor %}
    {% endif %}
{% endblock messages %}
</code>```

Where am I going wrong here? When I view the source page on the browser, the class attribute does not show at all!

Body:
I am creating a login page without an inbuilt model form. I am using FormAPI of Django and followed all the steps to add a class attribute to the input fields of my form. But it still looks like a basic form without bootstrap.

forms.py:

#Login Form

class LoginForm(forms.Form):
    username=forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
    password=forms.CharField(widget=forms.PasswordInput(attrs={'class':'form-control'}))

Base template file to be inherited:

<!doctype html>
{% load static %}

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="{% static 'account/images/logo.ico' type='image/x-icon' %}">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
    <link rel="stylesheet" href="{% static 'account/css/style.css' %}">
    <title>{% block title %}{% endblock title %}</title>

                        <form action="" method="post" novalidate>
                            {% csrf_token %}
                            {% block formcontent %} {% endblock formcontent %}

                        {% block loginbtn %} {% endblock loginbtn %}

                        {% block outerlink %} {% endblock outerlink %}
                        {% block messages %} {% endblock messages %}
                    </form>

Actual login template:

{% extends 'account/forms_base.html' %}
{% block title %}Log-in{% endblock title %}
{% block formcontent %}
    {% if form.non_field_errors %}
        {% for error in form.non_field_errors %}
            {{error}}
        {% endfor %}
    {% endif %}
    {% for fm in form %}
        {{fm.label_tag}} {{fm}} {{fm.error|striptags}}

    {% endfor %}
{% endblock formcontent %}
{% block loginbtn %}
    <input class="submitbtn" type="submit" value="Login">
{% endblock loginbtn %}
{% block outerlink %}
    To register Click Here
{% endblock outerlink %}
{% block messages %}
    {% if messages %}
        {% for message in messages %}
            {{message}}
        {% endfor %}
    {% endif %}
{% endblock messages %}

Where am I going wrong here? When I view the source page on the browser, the class attribute does not show at all!


问:
How to format a downloadable file in angular?
I'm trying to create a .ped file with my Angular project, I need a proper (table like) format for the data that I'm getting from the api. I actually need to create a table from that data, download that in a .ped file, and create a pedigree from another external tool.
Right now, the file I download is just written in one line like a string.
This is how I'm creating/downloading the file:
html:

```<code><a [href]="fileUrl" download={{familyId}}.ped> DOWNLOAD</a>
</code>```

.ts file:

```<code>const data = 'MY DATA HERE';
const blob = new Blob([data], { type: 'application/octet-stream' });
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(blob));
</code>```

as you can see, the variable 'data' is printed into the file. How do I format my api data into a table like shape in this variable? Just like a normal .ped file look like!

Body:
I'm trying to create a .ped file with my Angular project, I need a proper (table like) format for the data that I'm getting from the api. I actually need to create a table from that data, download that in a .ped file, and create a pedigree from another external tool.
Right now, the file I download is just written in one line like a string.
This is how I'm creating/downloading the file:
html:

 DOWNLOAD

.ts file:

const data = 'MY DATA HERE';
const blob = new Blob([data], { type: 'application/octet-stream' });
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(blob));

as you can see, the variable 'data' is printed into the file. How do I format my api data into a table like shape in this variable? Just like a normal .ped file look like!


问:
dotnet build not working inside the container
Since container is not building with the full project I commented docker file as bellow . then I executed manually dotnet build command inside container. it failed like below. But when I build the container from outside from the visual studio it is building fine.

```<code>  Determining projects to restore...
  All projects are up-to-date for restore.
  myapp -> /app/build/myapp.dll
  myapp -> /app/build/myapp.Views.dll
  /bin/sh: 2: /tmp/tmped91456469694a38bc5ed8e7d4b423b1.exec.cmd: docker: not found
/root/.nuget/packages/microsoft.visualstudio.azure.containers.tools.targets/1.11.1/build/Container.targets(97,5): error : Docker is not installed or is not in the current PATH. [/src/myapp/myapp.csproj]

Build FAILED.

/root/.nuget/packages/microsoft.visualstudio.azure.containers.tools.targets/1.11.1/build/Container.targets(97,5): error : Docker is not installed or is not in the current PATH. [/src/myapp/myapp.csproj]
    0 Warning(s)
    1 Error(s)
</code>```

Here is the my Dockerfile

```<code>#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src

RUN apt-get update && \
    apt-get install -y wget && \
    apt-get install -y gnupg2 && \
    wget -qO- https://deb.nodesource.com/setup_16.x | bash - && \
    apt-get install -y build-essential nodejs

COPY ["myapp/myapp.csproj", "myapp/"]
COPY ["myapp/NuGet.Config", "myapp/"]
RUN dotnet restore "myapp/myapp.csproj" --configfile myapp/NuGet.Config
COPY . .
WORKDIR "/src/myapp"
#RUN dotnet build "myapp.csproj" -c Release -o /app/build

#FROM build AS publish
#RUN dotnet publish "myapp.csproj" -c Release -o /app/publish

#FROM base AS final
#WORKDIR /app
#COPY --from=publish /app/publish .
#ENTRYPOINT ["dotnet", "myapp.dll"]
ENTRYPOINT ["tail", "-f", "/dev/null"]
</code>```

Body:
Since container is not building with the full project I commented docker file as bellow . then I executed manually dotnet build command inside container. it failed like below. But when I build the container from outside from the visual studio it is building fine.

  Determining projects to restore...
  All projects are up-to-date for restore.
  myapp -> /app/build/myapp.dll
  myapp -> /app/build/myapp.Views.dll
  /bin/sh: 2: /tmp/tmped91456469694a38bc5ed8e7d4b423b1.exec.cmd: docker: not found
/root/.nuget/packages/microsoft.visualstudio.azure.containers.tools.targets/1.11.1/build/Container.targets(97,5): error : Docker is not installed or is not in the current PATH. [/src/myapp/myapp.csproj]

Build FAILED.

/root/.nuget/packages/microsoft.visualstudio.azure.containers.tools.targets/1.11.1/build/Container.targets(97,5): error : Docker is not installed or is not in the current PATH. [/src/myapp/myapp.csproj]
    0 Warning(s)
    1 Error(s)

Here is the my Dockerfile

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src

RUN apt-get update && \
    apt-get install -y wget && \
    apt-get install -y gnupg2 && \
    wget -qO- https://deb.nodesource.com/setup_16.x | bash - && \
    apt-get install -y build-essential nodejs

COPY ["myapp/myapp.csproj", "myapp/"]
COPY ["myapp/NuGet.Config", "myapp/"]
RUN dotnet restore "myapp/myapp.csproj" --configfile myapp/NuGet.Config
COPY . .
WORKDIR "/src/myapp"
#RUN dotnet build "myapp.csproj" -c Release -o /app/build

#FROM build AS publish
#RUN dotnet publish "myapp.csproj" -c Release -o /app/publish

#FROM base AS final
#WORKDIR /app
#COPY --from=publish /app/publish .
#ENTRYPOINT ["dotnet", "myapp.dll"]
ENTRYPOINT ["tail", "-f", "/dev/null"]


问:
GitHub Action nginx reverse proxy vue.js and Node.js server
I would like to create a CI/CD pipeline with GitHub Action to create a nginx reverse proxy server for my vue.js frontend and for my NestJS server.

What I have done so far:

When I push or pull a request on the main branch, I run the tests.

If the tests pass, build the frontend and backend.

What I want to do now:

Create a docker image of the nginx reverse proxy server for my frontend and backend and push it to the docker registry.

name: CI/CD Pipeline - Runs All tests and if all pass, builds the frontend and backend and deploys and configures the nginx proxy server to serve the frontend and backend.
# 1) on push or pull request to main branch
# 2) run frontend and backend tests
# 3) if tests pass, build the frontend and backend and save the build artifacts (./WEB/dist and ./BACKEND/dist)
# 4) if build succeeds, create a docker image of the nginx proxy server and push it to the docker registry
# 5) if tests fail or build fails, do nothing

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  backend-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          cache: 'npm'
          cache-dependency-path: 'BACKEND/package-lock.json'

      - name: Execute Backend Unit tests
        run: |
          npm ci
          npm run test
        working-directory: ./BACKEND

  frontend-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          cache: 'npm'
          cache-dependency-path: 'WEB/package-lock.json'

      - name: Execute Frontend Unit tests
        run: |
          npm ci
          npm run test
        working-directory: ./WEB

  build-frontend:
    runs-on: ubuntu-latest
    needs: [backend-tests, frontend-tests]
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          cache: 'npm'
          cache-dependency-path: 'WEB/package-lock.json'

      - name: Build Frontend
        run: |
          npm ci
          npm run build
        working-directory: ./WEB
      - name: Save Frontend Build Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: frontend-build-artifacts
          path: ./WEB/dist

  build-backend:
    runs-on: ubuntu-latest
    needs: [backend-tests, frontend-tests]
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          cache: 'npm'
          cache-dependency-path: 'BACKEND/package-lock.json'

      - name: Build Backend
        run: |
          npm ci
          npm run build
        working-directory: ./BACKEND
      - name: Save Backend Build Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: backend-build-artifacts
          path: ./BACKEND/dist
```

I tried to do it with this action:

But I don't know how to create a docker image of reverse nginx proxy server and push it to docker registry with this action.

Thanks in advance for your help.

Body:
I would like to create a CI/CD pipeline with GitHub Action to create a nginx reverse proxy server for my vue.js frontend and for my NestJS server.

What I have done so far:

When I push or pull a request on the main branch, I run the tests.

If the tests pass, build the frontend and backend.

What I want to do now:

Create a docker image of the nginx reverse proxy server for my frontend and backend and push it to the docker registry.

name: CI/CD Pipeline - Runs All tests and if all pass, builds the frontend and backend and deploys and configures the nginx proxy server to serve the frontend and backend.
# 1) on push or pull request to main branch
# 2) run frontend and backend tests
# 3) if tests pass, build the frontend and backend and save the build artifacts (./WEB/dist and ./BACKEND/dist)
# 4) if build succeeds, create a docker image of the nginx proxy server and push it to the docker registry
# 5) if tests fail or build fails, do nothing

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  backend-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          cache: 'npm'
          cache-dependency-path: 'BACKEND/package-lock.json'

      - name: Execute Backend Unit tests
        run: |
          npm ci
          npm run test
        working-directory: ./BACKEND

  frontend-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          cache: 'npm'
          cache-dependency-path: 'WEB/package-lock.json'

      - name: Execute Frontend Unit tests
        run: |
          npm ci
          npm run test
        working-directory: ./WEB

  build-frontend:
    runs-on: ubuntu-latest
    needs: [backend-tests, frontend-tests]
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          cache: 'npm'
          cache-dependency-path: 'WEB/package-lock.json'

      - name: Build Frontend
        run: |
          npm ci
          npm run build
        working-directory: ./WEB
      - name: Save Frontend Build Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: frontend-build-artifacts
          path: ./WEB/dist

  build-backend:
    runs-on: ubuntu-latest
    needs: [backend-tests, frontend-tests]
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          cache: 'npm'
          cache-dependency-path: 'BACKEND/package-lock.json'

      - name: Build Backend
        run: |
          npm ci
          npm run build
        working-directory: ./BACKEND
      - name: Save Backend Build Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: backend-build-artifacts
          path: ./BACKEND/dist

I tried to do it with this action:

But I don't know how to create a docker image of reverse nginx proxy server and push it to docker registry with this action.

Thanks in advance for your help.


问:
Latitude, Longitude in SSAS
How can I create data type Latitude and Longitude in SSAS?
I want Latitude, Longitude in live connection power BI, but in live connection, I can't change varchar to geography (Latitude, Longitude)!

I want Latitude, Longitude in live connection power BI, but in live connection, I can't change varchar to geography (Latitude, Longitude)!

Title: Latitude, Longitude in SSAS


问:
How to use GraphQL and NestJS to parse node related data to dynamic tree structure?
For this departments JSON data

{
    "departments": [
        {
            "id": 1,
            "name": "department 1",
            "parent_id": ""
        },
        {
            "id": 2,
            "name": "department 2",
            "parent_id": "1"
        },
        {
            "id": 3,
            "name": "department 3",
            "parent_id": "1"
        },
        {
            "id": 4,
            "name": "department 4",
            "parent_id": "2"
        }
    ]
}
```
<p>Now want to get it and parse to a multiple children GraphQL structure with NestJS.</p>
<pre class="lang-json prettyprint-override"><code>{
    "id": 1,
    "name": "department 1",
    "children": [
        {
            "id": 2,
            "name": "department 2",
            "children": [
                {
                    "id": 4,
                    "name": "department 4"
                }
            ]
        },
        {
            "id": 3,
            "name": "department 3"
        }
    ]
}
</code>```

Since the department relations are very large, the children node is also dynamically. How to create an @ObjectType and parse the origin JSON data to the new tree mode?

Body:
For this departments JSON data

{
    "departments": [
        {
            "id": 1,
            "name": "department 1",
            "parent_id": ""
        },
        {
            "id": 2,
            "name": "department 2",
            "parent_id": "1"
        },
        {
            "id": 3,
            "name": "department 3",
            "parent_id": "1"
        },
        {
            "id": 4,
            "name": "department 4",
            "parent_id": "2"
        }
    ]
}

Now want to get it and parse to a multiple children GraphQL structure with NestJS.

{
    "id": 1,
    "name": "department 1",
    "children": [
        {
            "id": 2,
            "name": "department 2",
            "children": [
                {
                    "id": 4,
                    "name": "department 4"
                }
            ]
        },
        {
            "id": 3,
            "name": "department 3"
        }
    ]
}

Since the department relations are very large, the children node is also dynamically. How to create an @ObjectType and parse the origin JSON data to the new tree mode?


问:
Is there way to run same job for multiple nodes in jenkins through parameter input?
I am new to Jenkins and Groovy. I would like to run a job on multiple nodes by selecting them using drop-down list (parameter input using node plugin). However even though I select mutluple nodes during runtime, the job is run only for the first node in list. The sample pipeline is below.

```<code>pipeline {
    agent {
      node {
         label node
      }

    }

    environment {
        SERV = "${params.Service_start}"

  }
    stages {

        stage('Start Service') {
            when {
                expression {
                    params.CONFIRM_RUN
                }
            }
            steps {
                dir('service-start') {
                    bat "net start \"${env.SERV}\" /y"
                }
            }
        }

    }
    post {
        always {
            cleanWs ()
        }
    }
}
</code>```

Any leads to this will be highly appreciated.

Tried to use node plugin to select multiple nodes in drop-down.

Body:
I am new to Jenkins and Groovy. I would like to run a job on multiple nodes by selecting them using drop-down list (parameter input using node plugin). However even though I select mutluple nodes during runtime, the job is run only for the first node in list. The sample pipeline is below.

pipeline {
    agent {
      node {
         label node
      }

    }

    environment {
        SERV = "${params.Service_start}"

  }
    stages {

        stage('Start Service') {
            when {
                expression {
                    params.CONFIRM_RUN
                }
            }
            steps {
                dir('service-start') {
                    bat "net start \"${env.SERV}\" /y"
                }
            }
        }

    }
    post {
        always {
            cleanWs ()
        }
    }
}

Any leads to this will be highly appreciated.

Tried to use node plugin to select multiple nodes in drop-down.


问:
Submitting spark jobs from VSCode to Azure Synapse stop working
Extension 'Spark & Hive Tools' to submit job from Visual Studio Code stop working for me and my colleagues from yesterday.
https://marketplace.visualstudio.com/items?itemName=mshdinsight.azure-hdinsight&ssr=false#overview
it is very strange that it started to show on market only few installs.

From Visual Studio Code we used context meny to Synapse: PySpark batch and now dissaperead.
Any ideas? What was changed from MS side?


问:
create Proxy server using c#
I want to create a proxy server, but I'm having trouble communicating with ssl
I've tried a lot and failed sites that support http don't work it's just preparing the connection it works (google)

```<code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Threading;
using System.Diagnostics;
using System.Net.Sockets;
using System.IO;
using System.Net.Http.Headers;
using System.Runtime.Remoting.Messaging;
using RestSharp;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Data;
using System.Security.Policy;
using System.Security.Authentication;
using System.Runtime.ConstrainedExecution;

namespace Proxy
{
    internal class Program
    {
        public static HttpListener listener;

        static void Main(string[] args)
        {
            var ip = IPAddress.Parse("127.0.0.1");
            Start(ip, 2020);
        }

        public static void Start(IPAddress ip, int port)
        {
            try
            {
                serverCertificate = X509Certificate.CreateFromCertFile("C:\\Users\\AK\\Desktop\\FiddlerRoot.cer");
                TcpListener listener = new TcpListener(ip, port);
                listener.Start(100);

                while (true)
                {

                    Socket client = listener.AcceptSocket();
                    IPEndPoint rep = (IPEndPoint)client.RemoteEndPoint;
                    Thread thread = new Thread(ThreadHandleClient);
                    thread.Start(client);
                }
                listener.Stop();
            }
            catch (Exception ex)
            {
                Console.WriteLine("START: " + ex.Message);
            }
        }
        public static void ThreadHandleClient(object o)
        {
            try
            {

                Socket client = (Socket)o;
                Console.WriteLine("===================================================================================");
                Console.WriteLine("=========================Request=========================================");
                Console.WriteLine("===================================================================================");
                NetworkStream ns = new NetworkStream(client);

                byte[] buffer = new byte[2048];
                int rec = 0;
                string data = "";
                do
                {
                    rec = ns.Read(buffer, 0, buffer.Length);
                    data += Encoding.ASCII.GetString(buffer, 0, rec);
                } while (rec == buffer.Length);
                Console.WriteLine(data);
                Console.WriteLine("===================================================================================");
                Console.WriteLine("=========================URL=========================================");
                Console.WriteLine("===================================================================================");
                string line = data.Replace("\r\n", "\n").Split(new string[] { "\n" }, StringSplitOptions.None)[0];
                string UrlString = line.Split(new string[] { " " }, StringSplitOptions.None)[1];

                var url = UrlString.EndsWith(":443") ? "https://" + UrlString.Replace(":443", "") : UrlString.Replace(":80", "");
                Uri uri = new Uri(url);
                Console.WriteLine(url);
                Console.WriteLine("===================================================================================");
                Console.WriteLine("=========================Response=========================================");
                Console.WriteLine("===================================================================================");
                if (uri.Scheme == "https")
                {
                    Https(client, uri.Host, data);
                }
                else
                {
                    Http(client, uri.Host, data);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error occured: " + ex.Message);

            }
        }
        public static bool ValidateServerCertificate(object sender, X509Certificate certificate,X509Chain chain, SslPolicyErrors sslPolicyErrors)
        {

            return true;

        }

        private static void Https( Socket clients,string Url,string datas)
        {
            TcpClient client = new TcpClient(Url, 443);

            SslStream sw = new SslStream(client.GetStream());

            sw.AuthenticateAsClient(Url);
            string[] headers = datas.Split('\n');

            foreach (string header in headers)
            {
                byte[] data = Encoding.UTF8.GetBytes(header + "\n\n");
                sw.Write(data);
            }
            TcpClient el = new TcpClient();
            el.Client = clients;
            SslStream Send = new SslStream(el.GetStream(), true);
          var  cert = new X509Certificate2(sw.RemoteCertificate);

            Send.AuthenticateAsServer(cert, true,true);
            byte[] buffer = new byte[2048];
            StringBuilder messageData = new StringBuilder();
            int bytes = -1;
            do
            {
                bytes = sw.Read(buffer, 0, buffer.Length);

                Decoder decoder = Encoding.UTF8.GetDecoder();
                char[] chars = new char[decoder.GetCharCount(buffer, 0, bytes)];
                Send.Write(buffer,0, bytes);
                decoder.GetChars(buffer, 0, bytes, chars, 0);
                messageData.Append(chars);

                if (messageData.ToString().IndexOf("<EOF>") != -1)
                {
                    break;
                }
            } while (bytes != 0);
            client.Close();

            Console.WriteLine(messageData.ToString());

            Console.WriteLine("===================================================================================");
            // This is where you read and send data

        }

        private static void Http(Socket clients, string Url, string datas)
        {
            IPHostEntry hostEntry;

            hostEntry = Dns.GetHostEntry(Url);
            EndPoint hostep = new IPEndPoint(hostEntry.AddressList[0], 80);
            Socket sock = new Socket(hostEntry.AddressList[0].AddressFamily, SocketType.Stream, ProtocolType.Tcp);
            datas = datas.Replace("http://"+Url, "");
            sock.Connect(hostep);
            string[] headers=datas.Split('\n');
            foreach (string header in headers)
            {
                byte[] data = Encoding.UTF8.GetBytes(header+"\n\n");
                sock.Send(data, 0, data.Length, SocketFlags.None);
            }
            byte[] bytes = new byte[2020];
            int Rs = 0;
            StringBuilder builder = new StringBuilder();
            do
            {
                Rs=sock.Receive(bytes);
                clients.Send(bytes, Rs, (SocketFlags)0);
                builder.Append(Encoding.UTF8.GetString(bytes,0,Rs));

            } while (Rs !=0);
            Console.WriteLine(builder.ToString());
            Console.WriteLine("===================================================================================");
        }
    }
    public class Certificate
    {

        public static X509Certificate2 GetCertificate()
        {

            return new X509Certificate2(Properties.Resources.FiddlerRoot);
        }

    }
}

</code>```

I've tried a lot and failed sites that support http don't work, it's just preparing the connection it works (google).

Title: create Proxy server using c#

Body:
I want to create a proxy server, but I'm having trouble communicating with ssl
I've tried a lot and failed sites that support http don't work it's just preparing the connection it works (google)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Threading;
using System.Diagnostics;
using System.Net.Sockets;
using System.IO;
using System.Net.Http.Headers;
using System.Runtime.Remoting.Messaging;
using RestSharp;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Data;
using System.Security.Policy;
using System.Security.Authentication;
using System.Runtime.ConstrainedExecution;

namespace Proxy
{
    internal class Program
    {
        public static HttpListener listener;

        static void Main(string[] args)
        {
            var ip = IPAddress.Parse("127.0.0.1");
            Start(ip, 2020);
        }

        public static void Start(IPAddress ip, int port)
        {
            try
            {
                serverCertificate = X509Certificate.CreateFromCertFile("C:\\Users\\AK\\Desktop\\FiddlerRoot.cer");
                TcpListener listener = new TcpListener(ip, port);
                listener.Start(100);

                while (true)
                {

                    Socket client = listener.AcceptSocket();
                    IPEndPoint rep = (IPEndPoint)client.RemoteEndPoint;
                    Thread thread = new Thread(ThreadHandleClient);
                    thread.Start(client);
                }
                listener.Stop();
            }
            catch (Exception ex)
            {
                Console.WriteLine("START: " + ex.Message);
            }
        }
        public static void ThreadHandleClient(object o)
        {
            try
            {

                Socket client = (Socket)o;
                Console.WriteLine("===================================================================================");
                Console.WriteLine("=========================Request=========================================");
                Console.WriteLine("===================================================================================");
                NetworkStream ns = new NetworkStream(client);

                byte[] buffer = new byte[2048];
                int rec = 0;
                string data = "";
                do
                {
                    rec = ns.Read(buffer, 0, buffer.Length);
                    data += Encoding.ASCII.GetString(buffer, 0, rec);
                } while (rec == buffer.Length);
                Console.WriteLine(data);
                Console.WriteLine("===================================================================================");
                Console.WriteLine("=========================URL=========================================");
                Console.WriteLine("===================================================================================");
                string line = data.Replace("\r\n", "\n").Split(new string[] { "\n" }, StringSplitOptions.None)[0];
                string UrlString = line.Split(new string[] { " " }, StringSplitOptions.None)[1];

                var url = UrlString.EndsWith(":443") ? "https://" + UrlString.Replace(":443", "") : UrlString.Replace(":80", "");
                Uri uri = new Uri(url);
                Console.WriteLine(url);
                Console.WriteLine("===================================================================================");
                Console.WriteLine("=========================Response=========================================");
                Console.WriteLine("===================================================================================");
                if (uri.Scheme == "https")
                {
                    Https(client, uri.Host, data);
                }
                else
                {
                    Http(client, uri.Host, data);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error occured: " + ex.Message);

            }
        }
        public static bool ValidateServerCertificate(object sender, X509Certificate certificate,X509Chain chain, SslPolicyErrors sslPolicyErrors)
        {

            return true;

        }

        private static void Https( Socket clients,string Url,string datas)
        {
            TcpClient client = new TcpClient(Url, 443);

            SslStream sw = new SslStream(client.GetStream());

            sw.AuthenticateAsClient(Url);
            string[] headers = datas.Split('\n');

            foreach (string header in headers)
            {
                byte[] data = Encoding.UTF8.GetBytes(header + "\n\n");
                sw.Write(data);
            }
            TcpClient el = new TcpClient();
            el.Client = clients;
            SslStream Send = new SslStream(el.GetStream(), true);
          var  cert = new X509Certificate2(sw.RemoteCertificate);

            Send.AuthenticateAsServer(cert, true,true);
            byte[] buffer = new byte[2048];
            StringBuilder messageData = new StringBuilder();
            int bytes = -1;
            do
            {
                bytes = sw.Read(buffer, 0, buffer.Length);

                Decoder decoder = Encoding.UTF8.GetDecoder();
                char[] chars = new char[decoder.GetCharCount(buffer, 0, bytes)];
                Send.Write(buffer,0, bytes);
                decoder.GetChars(buffer, 0, bytes, chars, 0);
                messageData.Append(chars);

                if (messageData.ToString().IndexOf("<EOF>") != -1)
                {
                    break;
                }
            } while (bytes != 0);
            client.Close();

            Console.WriteLine(messageData.ToString());

            Console.WriteLine("===================================================================================");
            // This is where you read and send data

        }

        private static void Http(Socket clients, string Url, string datas)
        {
            IPHostEntry hostEntry;

            hostEntry = Dns.GetHostEntry(Url);
            EndPoint hostep = new IPEndPoint(hostEntry.AddressList[0], 80);
            Socket sock = new Socket(hostEntry.AddressList[0].AddressFamily, SocketType.Stream, ProtocolType.Tcp);
            datas = datas.Replace("http://"+Url, "");
            sock.Connect(hostep);
            string[] headers=datas.Split('\n');
            foreach (string header in headers)
            {
                byte[] data = Encoding.UTF8.GetBytes(header+"\n\n");
                sock.Send(data, 0, data.Length, SocketFlags.None);
            }
            byte[] bytes = new byte[2020];
            int Rs = 0;
            StringBuilder builder = new StringBuilder();
            do
            {
                Rs=sock.Receive(bytes);
                clients.Send(bytes, Rs, (SocketFlags)0);
                builder.Append(Encoding.UTF8.GetString(bytes,0,Rs));

            } while (Rs !=0);
            Console.WriteLine(builder.ToString());
            Console.WriteLine("===================================================================================");
        }
    }
    public class Certificate
    {

        public static X509Certificate2 GetCertificate()
        {

            return new X509Certificate2(Properties.Resources.FiddlerRoot);
        }

    }
}

I've tried a lot and failed sites that support http don't work, it's just preparing the connection it works (google).


问:
How to add FlatLaf Libraries to Java Swing project Apache Netbeans IDE 16?
I want to use the code provided inside the FlatLaf library to create a Java Swing GUI for a school project, but I don't know how to add the FlatLaf libraries to my NetBeans IDE 16. I followed the instructions, but nothing worked.
There is an answer, but it's outdated (Netbeans 12). I don't know how to do it for the latest versions.

I went to Tools > Libraries > Absolute Layout > Add JAR/Folder   and added the Folder that contains the JAR.
the JAR file is inside a folder. I named it FlatLaf in the documents.
Then I created a folder named FlatLaf inside my project folder that contains the JAR file, and added
FlatLightLaf.setup(); inside the main method of the Jframe file.
But, it didn't work.


问:
ld error: section not found for address
I am on Mac OS X 10.6.5 with XCode 3.2.4 and trying to compile/port a code base which compiles successfully on 10.5.  A file contains hand-coded assembly code for exception handling.  The compile stops with a ld error saying section not found for address 0x...  What does this error message mean?

I am new to Mac OS X programming, but my search through the web and docs hasn't turned up much.  A related question would be what to look for in trying to fix it.  Thanks.

I'll include some original code and explain what I tried.

```<code>    .text

.align 1, 0x90
.globl _privateSnippetExecutorGeneral
_privateSnippetExecutorGeneral:
LFBg:
    movl    %esp,%ecx
    pushl   %ebp              # proper stack frame needed for exception handling
LCFIg0:
    movl    %esp,%ebp
LCFIg1:
    subl    $0x8,%esp         # padding + 32bit returnValue
    pushl   %esp              # 32bit &returnValue
    pushl   %ecx              # 32bit pCallStack
    pushl   %edx              # 32bit nVtableOffset
    pushl   %eax              # 32bit nFunctionIndex
    call    L_cpp_vtable_call$stub
    movl    16(%esp),%eax     # 32bit returnValue
    leave
    ret
LFEg:
    .long   .-_privateSnippetExecutorGeneral
</code>```

There are 6 of the above assembly code blocks, virtually identical.  I changed some 32-bit instructions to 64-bit counterparts and adjusted some stack manipulations.  The call to L_cpp_vtable_call$stub is typical of the dynamic loader for 32-bit i386 operations.  I've read docs from x86_64 and Apple but haven't seen a clear code sample of what it should be.

...

```<code>    .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
EH_frame1:
    .set L$set$frame1,LECIE1-LSCIE1
    .long   L$set$frame1      # length
LSCIE1:
    .long   0                 # CIE_ID
    .byte   1                 # version
    .ascii  "zPR\0"           # augmentation
    .byte   1                 # code_alignment_factor (.uleb128 1)
    .byte   0x7c              # data_alignment_factor (.sleb128 -4)
    .byte   8                 # return_address_register
    .byte   0x6               # augmentation size 7:
    .byte   0x9b              #  ???
    .long   L___gxx_personality_v0$non_lazy_ptr-.
    .byte   0x10
                              # initial_instructions:
    .byte   0x0C              #  DW_CFA_def_cfa %esp, 4
    .byte   5
    .byte   4
    .byte   0x88              #  DW_CFA_offset ret, 1
    .byte   1
    .align 2
LECIE1:
</code>```

Above is the CIE section.  The gxx_personality_v0 line also follows the typical dynamic loader code example for setting up the default exception handling routine.  I compiled a hello world program to see what gcc spits out, and I changed it to

.long   ___gxx_personality_v0+4@GOTPCREL

...

```<code>    .globl _privateSnippetExecutorGeneral.eh
_privateSnippetExecutorGeneral.eh:
LSFDEg:
    .set L$set$g1,LEFDEg-LASFDEg
    .long   L$set$g1          # length
LASFDEg:
    .long   LASFDEg-EH_frame1 # CIE_pointer
    .long   LFBg-.            # initial_location
    .long   LFEg-LFBg         # address_range
    .byte   0                 # augmentation size 0
                              # instructions:
    .byte   0x04              #  DW_CFA_advance_loc4
    .long   LCFIg0-LFBg
    .byte   0x0E              #  DW_CFA_def_cfa_offset 8
    .byte   8
    .byte   0x84              #  DW_CFA_offset %ebp, 2
    .byte   2
    .byte   0x04              #  DW_CFA_advance_loc4
    .long   LCFIg1-LCFIg0
    .byte   0x0D              #  DW_CFA_def_cfa_register %ebp
    .byte   4
    .align 2
LEFDEg:
</code>```

Then there are 6 FDE sections (as above) corresponding to the assembly blocks.  I did not modify them.

...

```<code>    .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
L_cpp_vtable_call$stub:
    .indirect_symbol _cpp_vtable_call
    hlt ; hlt ; hlt ; hlt ; hlt
    .section __IMPORT,__pointers,non_lazy_symbol_pointers
L___gxx_personality_v0$non_lazy_ptr:
    .indirect_symbol ___gxx_personality_v0
    .long 0
    .constructor
    .destructor
    .align 1
    .subsections_via_symbols
</code>```

Finally the stub sections.  I haven't found too many docs, but my understanding is these sections are invalid for x86_64.  The calling convention for dynamic loading no longer requires stubs but uses the Global Offset Table (GOT).  So I commented out these sections.  Are there things I should/not be doing?  Any docs you can point me to?

ContentLicense: CC BY-SA 3.0

Title: ld error: section not found for address

Body:
I am on Mac OS X 10.6.5 with XCode 3.2.4 and trying to compile/port a code base which compiles successfully on 10.5.  A file contains hand-coded assembly code for exception handling.  The compile stops with a ld error saying section not found for address 0x...  What does this error message mean?

I am new to Mac OS X programming, but my search through the web and docs hasn't turned up much.  A related question would be what to look for in trying to fix it.  Thanks.

I'll include some original code and explain what I tried.

    .text

.align 1, 0x90
.globl _privateSnippetExecutorGeneral
_privateSnippetExecutorGeneral:
LFBg:
    movl    %esp,%ecx
    pushl   %ebp              # proper stack frame needed for exception handling
LCFIg0:
    movl    %esp,%ebp
LCFIg1:
    subl    $0x8,%esp         # padding + 32bit returnValue
    pushl   %esp              # 32bit &returnValue
    pushl   %ecx              # 32bit pCallStack
    pushl   %edx              # 32bit nVtableOffset
    pushl   %eax              # 32bit nFunctionIndex
    call    L_cpp_vtable_call$stub
    movl    16(%esp),%eax     # 32bit returnValue
    leave
    ret
LFEg:
    .long   .-_privateSnippetExecutorGeneral

There are 6 of the above assembly code blocks, virtually identical.  I changed some 32-bit instructions to 64-bit counterparts and adjusted some stack manipulations.  The call to L_cpp_vtable_call$stub is typical of the dynamic loader for 32-bit i386 operations.  I've read docs from x86_64 and Apple but haven't seen a clear code sample of what it should be.

...

    .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
EH_frame1:
    .set L$set$frame1,LECIE1-LSCIE1
    .long   L$set$frame1      # length
LSCIE1:
    .long   0                 # CIE_ID
    .byte   1                 # version
    .ascii  "zPR\0"           # augmentation
    .byte   1                 # code_alignment_factor (.uleb128 1)
    .byte   0x7c              # data_alignment_factor (.sleb128 -4)
    .byte   8                 # return_address_register
    .byte   0x6               # augmentation size 7:
    .byte   0x9b              #  ???
    .long   L___gxx_personality_v0$non_lazy_ptr-.
    .byte   0x10
                              # initial_instructions:
    .byte   0x0C              #  DW_CFA_def_cfa %esp, 4
    .byte   5
    .byte   4
    .byte   0x88              #  DW_CFA_offset ret, 1
    .byte   1
    .align 2
LECIE1:

Above is the CIE section.  The gxx_personality_v0 line also follows the typical dynamic loader code example for setting up the default exception handling routine.  I compiled a hello world program to see what gcc spits out, and I changed it to

.long   ___gxx_personality_v0+4@GOTPCREL

...

    .globl _privateSnippetExecutorGeneral.eh
_privateSnippetExecutorGeneral.eh:
LSFDEg:
    .set L$set$g1,LEFDEg-LASFDEg
    .long   L$set$g1          # length
LASFDEg:
    .long   LASFDEg-EH_frame1 # CIE_pointer
    .long   LFBg-.            # initial_location
    .long   LFEg-LFBg         # address_range
    .byte   0                 # augmentation size 0
                              # instructions:
    .byte   0x04              #  DW_CFA_advance_loc4
    .long   LCFIg0-LFBg
    .byte   0x0E              #  DW_CFA_def_cfa_offset 8
    .byte   8
    .byte   0x84              #  DW_CFA_offset %ebp, 2
    .byte   2
    .byte   0x04              #  DW_CFA_advance_loc4
    .long   LCFIg1-LCFIg0
    .byte   0x0D              #  DW_CFA_def_cfa_register %ebp
    .byte   4
    .align 2
LEFDEg:

Then there are 6 FDE sections (as above) corresponding to the assembly blocks.  I did not modify them.

...

    .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
L_cpp_vtable_call$stub:
    .indirect_symbol _cpp_vtable_call
    hlt ; hlt ; hlt ; hlt ; hlt
    .section __IMPORT,__pointers,non_lazy_symbol_pointers
L___gxx_personality_v0$non_lazy_ptr:
    .indirect_symbol ___gxx_personality_v0
    .long 0
    .constructor
    .destructor
    .align 1
    .subsections_via_symbols

Finally the stub sections.  I haven't found too many docs, but my understanding is these sections are invalid for x86_64.  The calling convention for dynamic loading no longer requires stubs but uses the Global Offset Table (GOT).  So I commented out these sections.  Are there things I should/not be doing?  Any docs you can point me to?


问:
free(): double free detected in tcache 2 Aborted (core dumped)
```<code>#include <fstream>
#include <string_view>
#include <unordered_map>
#include "nlohmann/json.hpp"
using json = nlohmann::json;

class Strategy {
private:
    int mActionNum;
    double mNormSum;
    double* mRegretSum;
    double* mStrategy;
    double* mStrategySum;
    double* mAverageStrategy;

public:
    Strategy (const int actionNum): mActionNum {actionNum} {
        mRegretSum = new double[actionNum];
        mStrategy = new double[actionNum];
        mStrategySum = new double[actionNum];
        mAverageStrategy = new double[actionNum];

        for (int a = 0; a < actionNum; ++a) {
            mRegretSum[a] = 0.0;
            mStrategy[a] = 1.0 / (double) actionNum;
            mStrategySum[a] = 0.0;
            mAverageStrategy[a] = 0.0;
        }
    }

    ~Strategy() {
        delete[] mRegretSum;
        delete[] mStrategy;
        delete[] mStrategySum;
        delete[] mAverageStrategy;
    }

    const double* get(const double weight) {
        mNormSum = 0.0;

        for (int a = 0; a < mActionNum; ++a) {
            mStrategy[a] = mRegretSum[a] > 0 ? mRegretSum[a] : 0;
            mNormSum += mStrategy[a];
        }

        for (int a = 0; a < mActionNum; ++a) {
            if (mNormSum > 0) {
                mStrategy[a] /= mNormSum;
            } else {
                mStrategy[a] = 1 / mNormSum;
            }

            mStrategySum[a] += weight * mStrategy[a];
        }

        return mStrategy;
    }

    const double* get_avg() {
        mNormSum = 0.0;

        for (int a = 0; a < mActionNum; ++a) {
            mNormSum += mStrategySum[a];
        }

        for (int a = 0; a < mActionNum; ++a) {
            if (mNormSum > 0) {
                mAverageStrategy[a] = mStrategySum[a] / mNormSum;
            } else {
                mAverageStrategy[a] = 1.0 / (double) mActionNum;
            }
        }

        return mAverageStrategy;
    }
};

int main () {
    std::ifstream f("/home/tomas/Dropbox/strategy.json");
    json data = json::parse(f);

    std::unordered_map<std::string_view, Strategy> strategies;
    std::string info_set {};

    for (auto& e : data) {
        info_set = e["cluster"].get<std::string>()
                    + ',' + e["history"].get<std::string>();

        Strategy strat { static_cast<int>(e["regret_sum"].size()) };
        strategies.insert({info_set, strat});
    }
    return 0;
}
</code>```

I suppose that the problem is because the instance of the class is destroyed each every cycle, am I correct?

So I tried also something like this:

```<code>Strategy createOutOfScope(int size) {
    Strategy strat { size };
    return strat;
}

int main () {
    std::ifstream f("/home/tomas/Dropbox/strategy.json");
    json data = json::parse(f);

    std::unordered_map<std::string_view, Strategy> strategies;
    std::string info_set {};

    for (auto& e : data) {
        info_set = e["cluster"].get<std::string>()
                    + ',' + e["history"].get<std::string>();

        strategies.insert({info_set, createOutOfScope(static_cast<int>(e["regret_sum"].size()))});
    }
    return 0;
}
</code>```

But of course, I haven't solved it. Can someone explain me how I can save a object in a unordered_map type, and generally how I can create and save an instance of object created out of scope.
Thank you very much.

Body:
#include <fstream>
#include <string_view>
#include <unordered_map>
#include "nlohmann/json.hpp"
using json = nlohmann::json;

class Strategy {
private:
    int mActionNum;
    double mNormSum;
    double* mRegretSum;
    double* mStrategy;
    double* mStrategySum;
    double* mAverageStrategy;

public:
    Strategy (const int actionNum): mActionNum {actionNum} {
        mRegretSum = new double[actionNum];
        mStrategy = new double[actionNum];
        mStrategySum = new double[actionNum];
        mAverageStrategy = new double[actionNum];

        for (int a = 0; a < actionNum; ++a) {
            mRegretSum[a] = 0.0;
            mStrategy[a] = 1.0 / (double) actionNum;
            mStrategySum[a] = 0.0;
            mAverageStrategy[a] = 0.0;
        }
    }

    ~Strategy() {
        delete[] mRegretSum;
        delete[] mStrategy;
        delete[] mStrategySum;
        delete[] mAverageStrategy;
    }

    const double* get(const double weight) {
        mNormSum = 0.0;

        for (int a = 0; a < mActionNum; ++a) {
            mStrategy[a] = mRegretSum[a] > 0 ? mRegretSum[a] : 0;
            mNormSum += mStrategy[a];
        }

        for (int a = 0; a < mActionNum; ++a) {
            if (mNormSum > 0) {
                mStrategy[a] /= mNormSum;
            } else {
                mStrategy[a] = 1 / mNormSum;
            }

            mStrategySum[a] += weight * mStrategy[a];
        }

        return mStrategy;
    }

    const double* get_avg() {
        mNormSum = 0.0;

        for (int a = 0; a < mActionNum; ++a) {
            mNormSum += mStrategySum[a];
        }

        for (int a = 0; a < mActionNum; ++a) {
            if (mNormSum > 0) {
                mAverageStrategy[a] = mStrategySum[a] / mNormSum;
            } else {
                mAverageStrategy[a] = 1.0 / (double) mActionNum;
            }
        }

        return mAverageStrategy;
    }
};

int main () {
    std::ifstream f("/home/tomas/Dropbox/strategy.json");
    json data = json::parse(f);

    std::unordered_map<std::string_view, Strategy> strategies;
    std::string info_set {};

    for (auto& e : data) {
        info_set = e["cluster"].get<std::string>()
                    + ',' + e["history"].get<std::string>();

        Strategy strat { static_cast<int>(e["regret_sum"].size()) };
        strategies.insert({info_set, strat});
    }
    return 0;
}

I suppose that the problem is because the instance of the class is destroyed each every cycle, am I correct?

So I tried also something like this:

Strategy createOutOfScope(int size) {
    Strategy strat { size };
    return strat;
}

int main () {
    std::ifstream f("/home/tomas/Dropbox/strategy.json");
    json data = json::parse(f);

    std::unordered_map<std::string_view, Strategy> strategies;
    std::string info_set {};

    for (auto& e : data) {
        info_set = e["cluster"].get<std::string>()
                    + ',' + e["history"].get<std::string>();

        strategies.insert({info_set, createOutOfScope(static_cast<int>(e["regret_sum"].size()))});
    }
    return 0;
}

But of course, I haven't solved it. Can someone explain me how I can save a object in a unordered_map type, and generally how I can create and save an instance of object created out of scope.
Thank you very much.


问:
How to get more than just your homepage to yield in a google search
I'm working on my SEO in my javascript app and haven't been able to get my site hierarchy to yield in a google search. If you search for my app you only see the homepage and some additional text from the site but if you search for Snowflake, for ex, it's structured like below:

My app

```<code>My app | my apps slogan
</code>```

Snowflake

```<code>Snowflake
  Careers
  Key Concepts & Architecture
  Cloud Data Platform
  About the Company
</code>```

How I get other pages from my site to show below the homepage on a google search?

Body:
I'm working on my SEO in my javascript app and haven't been able to get my site hierarchy to yield in a google search. If you search for my app you only see the homepage and some additional text from the site but if you search for Snowflake, for ex, it's structured like below:

My app

My app | my apps slogan

Snowflake

Snowflake
  Careers
  Key Concepts & Architecture
  Cloud Data Platform
  About the Company

How I get other pages from my site to show below the homepage on a google search?


问:
Alternate to $each on vuelidate
I want to validate a form that consists of a parent component and a child component. The user can dynamically add another child component on click of a button. I am unable to check the invalid state of the the child components and therefore also the invalid state of the parent component.

Previously, this was not an issue since Vuelidate had $each function.

Title: Alternate to $each on vuelidate


问:
Change default datagbase in django constance
I have a django app with multiple databases and i have begun to use django-constance to use 'live' settings in mi project.

I have seen in documentation, it seems possible change the default database to save the settings models. But it's always save the model in default. Is it really possible?

If you have multiple databases you can set what databases will be used
with CONSTANCE_DBS

CONSTANCE_DBS = “default”

```<code>DATABASES = {"default": {},
             "config": {}}
CONSTANCE_DBS = "config"
</code>```

Body:
I have a django app with multiple databases and i have begun to use django-constance to use 'live' settings in mi project.

I have seen in documentation, it seems possible change the default database to save the settings models. But it's always save the model in default. Is it really possible?

If you have multiple databases you can set what databases will be used
with CONSTANCE_DBS

CONSTANCE_DBS = “default”

DATABASES = {"default": {},
             "config": {}}
CONSTANCE_DBS = "config"


问:
Caused by: java.io.IOException: error=2, No such file or directory error in Colab Hadoop
I'm Hadoop in Colab and I have two documents that I've made in Pycharm, one with the mapper and another one with the reducer part.

This is the code:

```<code>!apt-get install -y openjdk-11-jdk-headless -qq > /dev/null

!wget https://downloads.apache.org/hadoop/common/hadoop-3.3.3/hadoop-3.3.3.tar.gz

!tar -xzf hadoop-3.3.3.tar.gz
!mv hadoop-3.3.3/ /usr/local/

import os
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-11-openjdk-amd64"
os.environ["HADOOP_HOME"] = "/usr/local/hadoop-3.3.3"
os.environ["PATH"] += os.pathsep + "/usr/local/hadoop-3.3.3/bin"

!chmod u+x ./mapperModaGastoPorPersona.py
!chmod u+x ./reducerModaGastoPorPersona.py

!hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-3.3.3.jar -file ./mapperModaGastoPorPersona.py -mapper ./mapperModaGastoPorPersona.py -file ./reducerModaGastoPorPersona.py -reducer ./reducerModaGastoPorPersona.py -input Datos_actividad_1.txt -output ./salidaModaGastoPersona1
</code>```

And the result in the last part is this:

```<code>2022-12-14 12:18:36,116 ERROR streaming.PipeMapRed: configuration exception
java.io.IOException: Cannot run program "/content/./reducerModaGastoPorPersona.py": error=2, No such file or directory
    (...)
Caused by: java.io.IOException: error=2, No such file or directory
    (...)
2022-12-14 12:18:36,119 INFO mapred.LocalJobRunner: reduce task executor complete.
2022-12-14 12:18:36,122 WARN mapred.LocalJobRunner: job_local520054471_0001
java.lang.Exception: java.lang.RuntimeException: Error in configuring object
    at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:492)
    at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:559)
Caused by: java.lang.RuntimeException: Error in configuring object
    at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:115)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:81)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:139)
    at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:411)
    at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:393)
    at org.apache.hadoop.mapred.LocalJobRunner$Job$ReduceTaskRunnable.run(LocalJobRunner.java:347)
    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:829)
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
    ... 10 more
Caused by: java.lang.RuntimeException: configuration exception
    at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
    at org.apache.hadoop.streaming.PipeReducer.configure(PipeReducer.java:67)
    ... 15 more
Caused by: java.io.IOException: Cannot run program "/content/./reducerModaGastoPorPersona.py": error=2, No such file or directory
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
    at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
    ... 16 more
Caused by: java.io.IOException: error=2, No such file or directory
    at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
    ... 18 more
2022-12-14 12:18:36,777 INFO mapreduce.Job: Job job_local520054471_0001 failed with state FAILED due to: NA
2022-12-14 12:18:36,794 INFO mapreduce.Job: Counters: 30
    File System Counters
        FILE: Number of bytes read=4175
        FILE: Number of bytes written=644002
        FILE: Number of read operations=0
        FILE: Number of large read operations=0
        FILE: Number of write operations=0
    Map-Reduce Framework
        Map input records=102
        Map output records=102
        Map output bytes=869
        Map output materialized bytes=1079
        Input split bytes=87
        Combine input records=0
        Combine output records=0
        Reduce input groups=0
        Reduce shuffle bytes=1079
        Reduce input records=0
        Reduce output records=0
        Spilled Records=102
        Shuffled Maps =1
        Failed Shuffles=0
        Merged Map outputs=1
        GC time elapsed (ms)=0
        Total committed heap usage (bytes)=350224384
    Shuffle Errors
        BAD_ID=0
        CONNECTION=0
        IO_ERROR=0
        WRONG_LENGTH=0
        WRONG_MAP=0
        WRONG_REDUCE=0
    File Input Format Counters
        Bytes Read=969
    File Output Format Counters
        Bytes Written=0
2022-12-14 12:18:36,801 ERROR streaming.StreamJob: Job not successful!
Streaming Command Failed!
</code>```

I've uploaded the documents "mapperModaGastoPorPersona.py", "reducerModaGastoPorPersona.py" and "Datos_actividad_1.txt" in Colab.

Body:
I'm Hadoop in Colab and I have two documents that I've made in Pycharm, one with the mapper and another one with the reducer part.

This is the code:

!apt-get install -y openjdk-11-jdk-headless -qq > /dev/null

!wget https://downloads.apache.org/hadoop/common/hadoop-3.3.3/hadoop-3.3.3.tar.gz

!tar -xzf hadoop-3.3.3.tar.gz
!mv hadoop-3.3.3/ /usr/local/

import os
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-11-openjdk-amd64"
os.environ["HADOOP_HOME"] = "/usr/local/hadoop-3.3.3"
os.environ["PATH"] += os.pathsep + "/usr/local/hadoop-3.3.3/bin"

!chmod u+x ./mapperModaGastoPorPersona.py
!chmod u+x ./reducerModaGastoPorPersona.py

!hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-3.3.3.jar -file ./mapperModaGastoPorPersona.py -mapper ./mapperModaGastoPorPersona.py -file ./reducerModaGastoPorPersona.py -reducer ./reducerModaGastoPorPersona.py -input Datos_actividad_1.txt -output ./salidaModaGastoPersona1

And the result in the last part is this:

2022-12-14 12:18:36,116 ERROR streaming.PipeMapRed: configuration exception
java.io.IOException: Cannot run program "/content/./reducerModaGastoPorPersona.py": error=2, No such file or directory
    (...)
Caused by: java.io.IOException: error=2, No such file or directory
    (...)
2022-12-14 12:18:36,119 INFO mapred.LocalJobRunner: reduce task executor complete.
2022-12-14 12:18:36,122 WARN mapred.LocalJobRunner: job_local520054471_0001
java.lang.Exception: java.lang.RuntimeException: Error in configuring object
    at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:492)
    at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:559)
Caused by: java.lang.RuntimeException: Error in configuring object
    at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:115)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:81)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:139)
    at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:411)
    at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:393)
    at org.apache.hadoop.mapred.LocalJobRunner$Job$ReduceTaskRunnable.run(LocalJobRunner.java:347)
    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:829)
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
    ... 10 more
Caused by: java.lang.RuntimeException: configuration exception
    at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
    at org.apache.hadoop.streaming.PipeReducer.configure(PipeReducer.java:67)
    ... 15 more
Caused by: java.io.IOException: Cannot run program "/content/./reducerModaGastoPorPersona.py": error=2, No such file or directory
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
    at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
    ... 16 more
Caused by: java.io.IOException: error=2, No such file or directory
    at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
    at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
    at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
    at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
    ... 18 more
2022-12-14 12:18:36,777 INFO mapreduce.Job: Job job_local520054471_0001 failed with state FAILED due to: NA
2022-12-14 12:18:36,794 INFO mapreduce.Job: Counters: 30
    File System Counters
        FILE: Number of bytes read=4175
        FILE: Number of bytes written=644002
        FILE: Number of read operations=0
        FILE: Number of large read operations=0
        FILE: Number of write operations=0
    Map-Reduce Framework
        Map input records=102
        Map output records=102
        Map output bytes=869
        Map output materialized bytes=1079
        Input split bytes=87
        Combine input records=0
        Combine output records=0
        Reduce input groups=0
        Reduce shuffle bytes=1079
        Reduce input records=0
        Reduce output records=0
        Spilled Records=102
        Shuffled Maps =1
        Failed Shuffles=0
        Merged Map outputs=1
        GC time elapsed (ms)=0
        Total committed heap usage (bytes)=350224384
    Shuffle Errors
        BAD_ID=0
        CONNECTION=0
        IO_ERROR=0
        WRONG_LENGTH=0
        WRONG_MAP=0
        WRONG_REDUCE=0
    File Input Format Counters
        Bytes Read=969
    File Output Format Counters
        Bytes Written=0
2022-12-14 12:18:36,801 ERROR streaming.StreamJob: Job not successful!
Streaming Command Failed!

I've uploaded the documents "mapperModaGastoPorPersona.py", "reducerModaGastoPorPersona.py" and "Datos_actividad_1.txt" in Colab.


问:
How to increase the linewidth of a plot in matplotlib
I have the following code to generate a plot in Matplotlib:

```<code>import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt

price_values = [[4.2],
    [4.1],
    [4],
    [3.8],
    [3.9],
    [4.2],
    [4.5],
    [4.8],
    [5.2],
    [5.2],
    [5.2],
    [5.6],
    [5.2],
    [5.1],
    [5.3],
    [6],
    [6.2],
    [6.3],
    [6.2],
    [6],
    [5.5] ,
    [5.2],
    [4.8],
    [4.6]]

sample = np.asarray(price_values).squeeze()
ecdf = sm.distributions.ECDF(sample)

x = np.linspace(min(sample), max(sample))
y = ecdf(x)
fig, ax = plt.subplots(figsize=(7,4));

ax.tick_params(axis='both', which='major', labelsize=14);
ax.margins(x=0)

ax.step(x, y);ax.set_xlabel("Price [Cent/kWh]", fontsize = 14, labelpad=8);
ax.set_ylabel("Cumulative frequency", fontsize = 14,labelpad=8);

plt.savefig('C:/Users/User1/Desktop/Diagramm_EDF.png', edgecolor='black', dpi=300, bbox_inches='tight')
plt.show()
</code>```

Do you know how I can increase the linewidth? I tried fig, ax = plt.subplots(figsize=(7,4), linewidth=20); but this did not work. I also tried. plt.plot(linewidth=20) but this also did not work

Body:
I have the following code to generate a plot in Matplotlib:

import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt

price_values = [[4.2],
    [4.1],
    [4],
    [3.8],
    [3.9],
    [4.2],
    [4.5],
    [4.8],
    [5.2],
    [5.2],
    [5.2],
    [5.6],
    [5.2],
    [5.1],
    [5.3],
    [6],
    [6.2],
    [6.3],
    [6.2],
    [6],
    [5.5] ,
    [5.2],
    [4.8],
    [4.6]]

sample = np.asarray(price_values).squeeze()
ecdf = sm.distributions.ECDF(sample)

x = np.linspace(min(sample), max(sample))
y = ecdf(x)
fig, ax = plt.subplots(figsize=(7,4));

ax.tick_params(axis='both', which='major', labelsize=14);
ax.margins(x=0)

ax.step(x, y);ax.set_xlabel("Price [Cent/kWh]", fontsize = 14, labelpad=8);
ax.set_ylabel("Cumulative frequency", fontsize = 14,labelpad=8);

plt.savefig('C:/Users/User1/Desktop/Diagramm_EDF.png', edgecolor='black', dpi=300, bbox_inches='tight')
plt.show()

Do you know how I can increase the linewidth? I tried fig, ax = plt.subplots(figsize=(7,4), linewidth=20); but this did not work. I also tried. plt.plot(linewidth=20) but this also did not work


问:
SPOTIFY API - get artist top tracks by country
I'm trying to search for the artist's top track within a certain country market, unfortunately, it seems like Spotify doesn't allow that (since my account country is already set and cannot be changed)

https://developer.spotify.com/documentation/web-api/reference/#/operations/get-an-artists-top-tracks
I'm using a param in the request with the country code -> ?country=BRbut the response received shows results accordingly to my country.
I'm aware of the fact that -> "If a valid user access token is specified in the request header, the country associated with the user account will take priority over this parameter"

Is there any way to bypass this?


问:
I am preparing a minimal UI based interface. I need to export the files but I can't export the pages I wrote later, why?
I don't get any error while exporting but this is the case

All the page I wrote allows it to export the components, but when I upload the out file to the server, I get a 404 error.