问:
Extracting parameters from SSRS ExecutionLog3 view with a sql
I am trying to parse the parameters column from the ReportServer ExecutionLog3 view to be able to check the correct execution of reports in a data driven subscription.

This is what I have found so far:

DECLARE @t TABLE (
  c_parameters VARCHAR(1000)
) INSERT @t
values
('login=res%5Cel&Album=293&RecordingDate=11%2F03%2F2012%2000%3A00%3A00&ReleaseDate=11%2F12%2F2013%2000%3A00%3A00&ArtistId=404&AlbumName=MidnightDreamscapes'),
('login=res%5Cel&RecordingDate=12%2F05%2F2007%2000%3A00%3A00&ReleaseDate=10%2F15%2F2008%2000%3A00%3A00&Album=580&AlbumName=EtherealHorizons'),
('login=res%5Cel&Album=403&RecordingDate=1%2F01%2F2009%2000%3A00%3A00&ReleaseDate=9%2F18%2F2015%2000%3A00%3A00&SurroundAvailable=1&AlbumName=ElectricOceans'),
('login=res%5Cel&Album=676&RecordingDate=8%2F09%2F2011%2000%3A00%3A00&ReleaseDate=12%2F25%2F2012%2000%3A00%3A00&AlbumName=CosmicEchoes')

SELECT
      cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[1]', 'varchar(200)') as param_1
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[2]', 'varchar(200)') as param_2
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[3]', 'varchar(200)') as param_3
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[4]', 'varchar(200)') as param_4
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[5]', 'varchar(200)') as param_5
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[6]', 'varchar(200)') as param_6

  FROM @t
```
<p>which give the following results:</p>
```+─────────────────+──────────────────────────────────────────────+──────────────────────────────────────────────+────────────────────────────────────────────+─────────────────────────────+────────────────────────────────+
| param_1         | param_2                                      | param_3                                      | param_4                                    | param_5                     | param_6                        |
+─────────────────+──────────────────────────────────────────────+──────────────────────────────────────────────+────────────────────────────────────────────+─────────────────────────────+────────────────────────────────+
| login=res%5Cel  | Album=293                                    | RecordingDate=11%2F03%2F2012%2000%3A00%3A00  | ReleaseDate=11%2F12%2F2013%2000%3A00%3A00  | ArtistId=404                | AlbumName=MidnightDreamscapes  |
| login=res%5Cel  | RecordingDate=12%2F05%2F2007%2000%3A00%3A00  | ReleaseDate=10%2F15%2F2008%2000%3A00%3A00    | Album=580                                  | AlbumName=EtherealHorizons  | NULL                           |
| login=res%5Cel  | Album=403                                    | RecordingDate=1%2F01%2F2009%2000%3A00%3A00   | ReleaseDate=9%2F18%2F2015%2000%3A00%3A00   | AtmosAvailable=1            | AlbumName=ElectricOceans       |
| login=res%5Cel  | Album=676                                    | RecordingDate=8%2F09%2F2011%2000%3A00%3A00   | ReleaseDate=12%2F25%2F2012%2000%3A00%3A00  | AlbumName=CosmicEchoes      | NULL                           |
+─────────────────+──────────────────────────────────────────────+──────────────────────────────────────────────+────────────────────────────────────────────+─────────────────────────────+────────────────────────────────+
```
<p>I am trying to select the following values in a distinct column:</p>
<ul>
<li><p>for every record:</p>
<ul>
<li>Album, RecordingDate, ReleaseDate, AlbumName, Album</li>
</ul>
</li>
<li><p>for the records with a 6th parameter:</p>
<ul>
<li>name of the parameter :
<ul>
<li>ArtistId for first record</li>
<li>AtmosAvailable for third record</li>
</ul>
</li>
<li>value of the parameter :
<ul>
<li>404 for fist record</li>
<li>1 for third record</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>so that it gives the following result:</p>
```+────────────────────────────────+────────────────────────────────+────────+──────────────────────+────────────────────+─────────────+
| RecordingDate                  | ReleaseDate                    | Album  | AlbumName            | ParamName          | ParamValue  |
+────────────────────────────────+────────────────────────────────+────────+──────────────────────+────────────────────+─────────────+
| 11%2F03%2F2012%2000%3A00%3A00  | 11%2F12%2F2013%2000%3A00%3A00  | 293    | MidnightDreamscapes  | ArtistId           | 404         |
| 12%2F05%2F2007%2000%3A00%3A00  | 10%2F15%2F2008%2000%3A00%3A00  | 580    | EtherealHorizons     | NULL               | NULL        |
| 1%2F01%2F2009%2000%3A00%3A00   | 9%2F18%2F2015%2000%3A00%3A00   | 403    | ElectricOceans       | SurroundAvailable  | 1           |
| 8%2F09%2F2011%2000%3A00%3A00   | 12%2F25%2F2012%2000%3A00%3A00  | 676    | CosmicEchoes         | NULL               | NULL        |
+────────────────────────────────+────────────────────────────────+────────+──────────────────────+────────────────────+─────────────+
```

Is there some SQL magic that can do this ?

Body:
I am trying to parse the parameters column from the ReportServer ExecutionLog3 view to be able to check the correct execution of reports in a data driven subscription.

This is what I have found so far:

DECLARE @t TABLE (
  c_parameters VARCHAR(1000)
) INSERT @t
values
('login=res%5Cel&Album=293&RecordingDate=11%2F03%2F2012%2000%3A00%3A00&ReleaseDate=11%2F12%2F2013%2000%3A00%3A00&ArtistId=404&AlbumName=MidnightDreamscapes'),
('login=res%5Cel&RecordingDate=12%2F05%2F2007%2000%3A00%3A00&ReleaseDate=10%2F15%2F2008%2000%3A00%3A00&Album=580&AlbumName=EtherealHorizons'),
('login=res%5Cel&Album=403&RecordingDate=1%2F01%2F2009%2000%3A00%3A00&ReleaseDate=9%2F18%2F2015%2000%3A00%3A00&SurroundAvailable=1&AlbumName=ElectricOceans'),
('login=res%5Cel&Album=676&RecordingDate=8%2F09%2F2011%2000%3A00%3A00&ReleaseDate=12%2F25%2F2012%2000%3A00%3A00&AlbumName=CosmicEchoes')

SELECT
      cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[1]', 'varchar(200)') as param_1
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[2]', 'varchar(200)') as param_2
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[3]', 'varchar(200)') as param_3
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[4]', 'varchar(200)') as param_4
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[5]', 'varchar(200)') as param_5
      ,cast(concat('<x>', REPLACE(Cast(c_Parameters as varchar(900)), '&', '</x><x>'), '</x>') as xml).value('/x[6]', 'varchar(200)') as param_6

  FROM @t

which give the following results:

+─────────────────+──────────────────────────────────────────────+──────────────────────────────────────────────+────────────────────────────────────────────+─────────────────────────────+────────────────────────────────+
| param_1         | param_2                                      | param_3                                      | param_4                                    | param_5                     | param_6                        |
+─────────────────+──────────────────────────────────────────────+──────────────────────────────────────────────+────────────────────────────────────────────+─────────────────────────────+────────────────────────────────+
| login=res%5Cel  | Album=293                                    | RecordingDate=11%2F03%2F2012%2000%3A00%3A00  | ReleaseDate=11%2F12%2F2013%2000%3A00%3A00  | ArtistId=404                | AlbumName=MidnightDreamscapes  |
| login=res%5Cel  | RecordingDate=12%2F05%2F2007%2000%3A00%3A00  | ReleaseDate=10%2F15%2F2008%2000%3A00%3A00    | Album=580                                  | AlbumName=EtherealHorizons  | NULL                           |
| login=res%5Cel  | Album=403                                    | RecordingDate=1%2F01%2F2009%2000%3A00%3A00   | ReleaseDate=9%2F18%2F2015%2000%3A00%3A00   | AtmosAvailable=1            | AlbumName=ElectricOceans       |
| login=res%5Cel  | Album=676                                    | RecordingDate=8%2F09%2F2011%2000%3A00%3A00   | ReleaseDate=12%2F25%2F2012%2000%3A00%3A00  | AlbumName=CosmicEchoes      | NULL                           |
+─────────────────+──────────────────────────────────────────────+──────────────────────────────────────────────+────────────────────────────────────────────+─────────────────────────────+────────────────────────────────+

I am trying to select the following values in a distinct column:

for every record:

Album, RecordingDate, ReleaseDate, AlbumName, Album

for the records with a 6th parameter:

name of the parameter :

ArtistId for first record

AtmosAvailable for third record

value of the parameter :

404 for fist record

1 for third record

so that it gives the following result:

+────────────────────────────────+────────────────────────────────+────────+──────────────────────+────────────────────+─────────────+
| RecordingDate                  | ReleaseDate                    | Album  | AlbumName            | ParamName          | ParamValue  |
+────────────────────────────────+────────────────────────────────+────────+──────────────────────+────────────────────+─────────────+
| 11%2F03%2F2012%2000%3A00%3A00  | 11%2F12%2F2013%2000%3A00%3A00  | 293    | MidnightDreamscapes  | ArtistId           | 404         |
| 12%2F05%2F2007%2000%3A00%3A00  | 10%2F15%2F2008%2000%3A00%3A00  | 580    | EtherealHorizons     | NULL               | NULL        |
| 1%2F01%2F2009%2000%3A00%3A00   | 9%2F18%2F2015%2000%3A00%3A00   | 403    | ElectricOceans       | SurroundAvailable  | 1           |
| 8%2F09%2F2011%2000%3A00%3A00   | 12%2F25%2F2012%2000%3A00%3A00  | 676    | CosmicEchoes         | NULL               | NULL        |
+────────────────────────────────+────────────────────────────────+────────+──────────────────────+────────────────────+─────────────+

Is there some SQL magic that can do this ?


来源: stackexchange

问:
Matplotlib Widgets - Multicursor inside a function
I am testing matplotlib's multicursor, and I've found out that this function does not work inside a function. For instance, in the following code, it works:

```<code>fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True)

x = np.linspace(-np.pi, np.pi, 256, endpoint=True)
y = np.sin(x)
z = np.cos(x)

ax1.plot(x, y, label="sin function")
ax2.plot(x, z, label="cos function")

multi = MultiCursor(fig.canvas, [ax1, ax2], color='g', lw=2,
                        horizOn=False, vertOn=True)

plt.show()
</code>```

While inside a function it does not work:

```<code>def test():
    fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True)

    x = np.linspace(-np.pi, np.pi, 256, endpoint=True)
    y = np.sin(x)
    z = np.cos(x)

    ax1.plot(x, y, label="sin function")
    ax2.plot(x, z, label="cos function")

    multi = MultiCursor(fig.canvas, [ax1, ax2], color='g', lw=2,
                        horizOn=False, vertOn=True)

    plt.show()
    return fig
fig=test()
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I am testing matplotlib's multicursor, and I've found out that this function does not work inside a function. For instance, in the following code, it works:

fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True)

x = np.linspace(-np.pi, np.pi, 256, endpoint=True)
y = np.sin(x)
z = np.cos(x)

ax1.plot(x, y, label="sin function")
ax2.plot(x, z, label="cos function")

multi = MultiCursor(fig.canvas, [ax1, ax2], color='g', lw=2,
                        horizOn=False, vertOn=True)

plt.show()

While inside a function it does not work:

def test():
    fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True)

    x = np.linspace(-np.pi, np.pi, 256, endpoint=True)
    y = np.sin(x)
    z = np.cos(x)

    ax1.plot(x, y, label="sin function")
    ax2.plot(x, z, label="cos function")

    multi = MultiCursor(fig.canvas, [ax1, ax2], color='g', lw=2,
                        horizOn=False, vertOn=True)

    plt.show()
    return fig
fig=test()


问:
I have a datefield field in mysql and how do I know if it is null
using djangoenter image description here

I want to create an if else block and make this data in mysql so that if it is empty, the button will not appear, but if it is not empty button will appear, I tried this, but it counts as full.


问:
How to make an Object creation decoupled from its signature
I am working on a project and I am currently struggling with a problem. My Angular application depends on a specific object that I initialize in one of my classes. In my case, this object can have different attributes/fields depending on the configurations of the project. The configurations CAN change during runtime, so therefore the object can be different in each configuration. The problem is, that I do not want to couple the object creation to one specific configuration. I want to be able to set this dynamically.

The object itself:

```<code>port interface Stages {
  Installation: string;
  Migration: string;

  [key: string]: any;
}
</code>```

The object I want to instantiate:

```<code>Stages: {
  Installation: 'false',
  Migration: 'false',
  ...
}
</code>```

How can I decouple the instantiation of the object so that my implementation does not care which attribute or field is changed into false?

Body:
I am working on a project and I am currently struggling with a problem. My Angular application depends on a specific object that I initialize in one of my classes. In my case, this object can have different attributes/fields depending on the configurations of the project. The configurations CAN change during runtime, so therefore the object can be different in each configuration. The problem is, that I do not want to couple the object creation to one specific configuration. I want to be able to set this dynamically.

The object itself:

port interface Stages {
  Installation: string;
  Migration: string;

  [key: string]: any;
}

The object I want to instantiate:

Stages: {
  Installation: 'false',
  Migration: 'false',
  ...
}

How can I decouple the instantiation of the object so that my implementation does not care which attribute or field is changed into false?


问:
how to delete a row from seuqlize table after time
I am working on an app using NodeJS
and i am using sequelize too
i created a table called users and in the users table there is a column stands for active or not lets say i want to delete users who didn't activate their accounts and who have created their accounts 1 hour ago
how do i do that</p>


问:
Send byte array with FeignClient over HTTP to RestController - Receives ObjectId instead of content
Using a FeignClient, I want to send a Base64 encoded byte array over http to a Rest API.

FeignClient:

```<code>interface FeignClient {
    @RequestLine("GET /hello?b={b}") CompletableFuture<ResponseEntity> hello(@Param("b") byte[] b);
}

FeignClient feignClient = AsyncFeign.builder()
        .decoder(new GsonDecoder())
        .target(FeignClient.class, "http://localhost:8080");

byte[] base64Encoded = ....

feignClient.hello(base64Encoded).get());

</code>```

RestController

```<code>@Async
@GetMapping(value = "/hello")
public CompletableFuture<ResponseEntity> hello(@RequestParam("b") byte[] b){

    String base64Endcode = new String(b) //< -- the problem is here

    return ....
}
</code>```

Problem: Calling new String(b) in the RestController yields rather the object id [B@.... than the acutal content.

My first thought (as in How to serialize a byte array to send as the body of an HTTP POST?) was to serialize the byte array. As mentioned there, this is not required. What am I doing wrong?

A possible solution would be to use newString(base64Encoded) (instead of base64Encoded on the client side) and use String valueDecoded = new String(Base64.decodeBase64(graphStr)); on the server side. But does this make sense at all?

Maybe I need to configure a proper encoder within the FeignClient? Do I need streams?

Disclaimer: This question might be duplicate of How to serialize a byte array to send as the body of an HTTP POST?. However, I didn't solve my problem.

Body:
Using a FeignClient, I want to send a Base64 encoded byte array over http to a Rest API.

FeignClient:

interface FeignClient {
    @RequestLine("GET /hello?b={b}") CompletableFuture<ResponseEntity> hello(@Param("b") byte[] b);
}

FeignClient feignClient = AsyncFeign.builder()
        .decoder(new GsonDecoder())
        .target(FeignClient.class, "http://localhost:8080");

byte[] base64Encoded = ....

feignClient.hello(base64Encoded).get());

RestController

@Async
@GetMapping(value = "/hello")
public CompletableFuture<ResponseEntity> hello(@RequestParam("b") byte[] b){

    String base64Endcode = new String(b) //< -- the problem is here

    return ....
}

Problem: Calling new String(b) in the RestController yields rather the object id [B@.... than the acutal content.

My first thought (as in How to serialize a byte array to send as the body of an HTTP POST?) was to serialize the byte array. As mentioned there, this is not required. What am I doing wrong?

A possible solution would be to use newString(base64Encoded) (instead of base64Encoded on the client side) and use String valueDecoded = new String(Base64.decodeBase64(graphStr)); on the server side. But does this make sense at all?

Maybe I need to configure a proper encoder within the FeignClient? Do I need streams?

Disclaimer: This question might be duplicate of How to serialize a byte array to send as the body of an HTTP POST?. However, I didn't solve my problem.


问:
How do I dynamically assign a port in nginx?
I want http://example.com/test/4000(or some other number) to proxy_pass to
http://localhost:4000/ (i have to remove the "test")

Is this possible, and how do I do this?

```<code>
    location ~* /mlops/([0-9]+) { # ex > http://localhost/mlops/3433 (portnumber)
        rewrite ^/mlops(.*)$ /$1?$args break;
        proxy_pass http://host.docker.internal:$1;
    }
</code>```

but if i write like this, nginx server receive the url like this
"http://host.docker.internal:/3433"

Body:
I want http://example.com/test/4000(or some other number) to proxy_pass to
http://localhost:4000/ (i have to remove the "test")

Is this possible, and how do I do this?

    location ~* /mlops/([0-9]+) { # ex > http://localhost/mlops/3433 (portnumber)
        rewrite ^/mlops(.*)$ /$1?$args break;
        proxy_pass http://host.docker.internal:$1;
    }

but if i write like this, nginx server receive the url like this
"http://host.docker.internal:/3433"


问:
checkpoint file is not getting saved in tf.keras
```<code>if not os.path.exists("asr-checkpoint"):
    os.makedirs("asr-checkpoint")

checkpoint_path = '/content/asr-checkpoint/bnasr-{epoch:02d}-{val_loss:0.6f}'
cp_callback = tf.keras.callbacks.ModelCheckpoint(
    filepath=checkpoint_path,
    monitor='val_loss',
    mode='min',
    # save_freq='epoch',
    save_best_only=True,
    verbose=1
)

print("tf.executing_eagerly():", tf.executing_eagerly())

# optimizer = keras.optimizers.Adam(lr=0.0001)
# model.compile(optimizer=optimizer, loss=loss_fn)

history = model.fit(
    ds,
    validation_data=val_ds,
    callbacks=[display_cb],
    initial_epoch=0,
    epochs=1
)
</code>```

enter image description here

Tried to save the checkpoint file after some epochs and its not getting saved in the given directory, but the epochs are running perfectly and result is also okay in the training process

Body:
if not os.path.exists("asr-checkpoint"):
    os.makedirs("asr-checkpoint")

checkpoint_path = '/content/asr-checkpoint/bnasr-{epoch:02d}-{val_loss:0.6f}'
cp_callback = tf.keras.callbacks.ModelCheckpoint(
    filepath=checkpoint_path,
    monitor='val_loss',
    mode='min',
    # save_freq='epoch',
    save_best_only=True,
    verbose=1
)

print("tf.executing_eagerly():", tf.executing_eagerly())

# optimizer = keras.optimizers.Adam(lr=0.0001)
# model.compile(optimizer=optimizer, loss=loss_fn)

history = model.fit(
    ds,
    validation_data=val_ds,
    callbacks=[display_cb],
    initial_epoch=0,
    epochs=1
)

enter image description here

Tried to save the checkpoint file after some epochs and its not getting saved in the given directory, but the epochs are running perfectly and result is also okay in the training process


问:
AttributeError: GeoAxesSubplot.set() got an unexpected keyword argument 'gridspec_kw'
I have a plot consisting of 5 subplots and I want to shift the axis on each(from the right towards the left) to align with the straight edge. spatial plots

I have attempted to use "gridspec_kw" in "matplotlib" to accomplish this but i keep getting the error "AttributeError: GeoAxesSubplot.set() got an unexpected keyword argument 'gridspec_kw". I am not sure what I am missing here.
Here's a part of my code

```<code>f= plt.figure(figsize=(12,9), dpi=300,tight_layout=False)
inter = np.linspace(-5,5, num=11, endpoint=True)
lat = f222['xlat']
lon = f222['xlon']
ax1 = f.add_subplot(331, projection=ccrs.PlateCarree(),gridspec_kw={'width_ratio':[2,1]})
pr = plt.contourf(lon, lat, f222.tmp.mean('time'),inter, transform=ccrs.PlateCarree(),cmap='RdGy_r',extend = 'both')
ax1.coastlines(resolution='50m',color='black')
x_lons  = np.arange(-20,20,10)
y_lats  = np.arange(5,25,5)
ax1.tick_params(labelsize=7)
lon_formatter = LongitudeFormatter(zero_direction_label=True,number_format='.0f')
lat_formatter = LatitudeFormatter()
ax1.xaxis.set_major_formatter(lon_formatter)
ax1.yaxis.set_major_formatter(lat_formatter)
tick_fs = 16
ax1.set_xticks(x_lons, minor=False, crs=ccrs.PlateCarree())
ax1.set_yticks(y_lats, minor=False, crs=ccrs.PlateCarree())
ax1.text(-23., 5.5, r'(a)', fontsize=7,fontweight="bold")
ax1.text(-15., 25, r'CRU - Grell', fontsize=10,fontweight="bold")
ax1.add_feature(cf.BORDERS, lw = 0.5)
ax1.add_feature(cf.COASTLINE, lw = 0.5)
ax1.coastlines(resolution='50m',color='black', lw = 0.5)

</code>```

I am using matplotlib version 3.6.2. and I am relatively new to python.

Body:
I have a plot consisting of 5 subplots and I want to shift the axis on each(from the right towards the left) to align with the straight edge. spatial plots

I have attempted to use "gridspec_kw" in "matplotlib" to accomplish this but i keep getting the error "AttributeError: GeoAxesSubplot.set() got an unexpected keyword argument 'gridspec_kw". I am not sure what I am missing here.
Here's a part of my code

f= plt.figure(figsize=(12,9), dpi=300,tight_layout=False)
inter = np.linspace(-5,5, num=11, endpoint=True)
lat = f222['xlat']
lon = f222['xlon']
ax1 = f.add_subplot(331, projection=ccrs.PlateCarree(),gridspec_kw={'width_ratio':[2,1]})
pr = plt.contourf(lon, lat, f222.tmp.mean('time'),inter, transform=ccrs.PlateCarree(),cmap='RdGy_r',extend = 'both')
ax1.coastlines(resolution='50m',color='black')
x_lons  = np.arange(-20,20,10)
y_lats  = np.arange(5,25,5)
ax1.tick_params(labelsize=7)
lon_formatter = LongitudeFormatter(zero_direction_label=True,number_format='.0f')
lat_formatter = LatitudeFormatter()
ax1.xaxis.set_major_formatter(lon_formatter)
ax1.yaxis.set_major_formatter(lat_formatter)
tick_fs = 16
ax1.set_xticks(x_lons, minor=False, crs=ccrs.PlateCarree())
ax1.set_yticks(y_lats, minor=False, crs=ccrs.PlateCarree())
ax1.text(-23., 5.5, r'(a)', fontsize=7,fontweight="bold")
ax1.text(-15., 25, r'CRU - Grell', fontsize=10,fontweight="bold")
ax1.add_feature(cf.BORDERS, lw = 0.5)
ax1.add_feature(cf.COASTLINE, lw = 0.5)
ax1.coastlines(resolution='50m',color='black', lw = 0.5)

I am using matplotlib version 3.6.2. and I am relatively new to python.


问:
Affirm list of events. Where to find
Affirm in the docs shows an example of firing an event:

```<code>affirm.events.on('learnMore:close',function(){console.log('fired')});
</code>```

where I can find the full list of the events ?

Title: Affirm list of events. Where to find

Body:
Affirm in the docs shows an example of firing an event:

affirm.events.on('learnMore:close',function(){console.log('fired')});

where I can find the full list of the events ?


问:
FFMPEG Scrambling Video Stream
I have created an FFMPEG Pipeline to stream video frames to an RTSP server. The frames are RGB frames with 3 dimensions. My pipeline command is as follows:

```<code>openPipeLine = _popen("ffmpeg -f rawvideo -r 30 -video_size 720x1280 -pixel_format bgr24 -i pipe: -vcodec libx264 -crf 24 -pix_fmt yuv420p -f rtsp rtsp://localHost:8554/mystream", "w");
</code>```

I then use the fwrite function as follows:

```<code>fwrite(processedFrame.data, 1, 720 * 1280, openPipeLine);
</code>```

The output that I get on the server is shown in the second attached image below. The original frame is shown in the first attached image below. The basic colors are correct but it seems to be scrambled. original frame.
server output.
Are there any parameters such as codec or pixel format. that I should be changing?

Title: FFMPEG Scrambling Video Stream

Body:
I have created an FFMPEG Pipeline to stream video frames to an RTSP server. The frames are RGB frames with 3 dimensions. My pipeline command is as follows:

openPipeLine = _popen("ffmpeg -f rawvideo -r 30 -video_size 720x1280 -pixel_format bgr24 -i pipe: -vcodec libx264 -crf 24 -pix_fmt yuv420p -f rtsp rtsp://localHost:8554/mystream", "w");

I then use the fwrite function as follows:

fwrite(processedFrame.data, 1, 720 * 1280, openPipeLine);

The output that I get on the server is shown in the second attached image below. The original frame is shown in the first attached image below. The basic colors are correct but it seems to be scrambled. original frame.
server output.
Are there any parameters such as codec or pixel format. that I should be changing?


问:
`npm ls ansi-regex@3.0.0` weirdness; two project pulling different versions?
I have 2 projects; both use React CRA. In each I see react-scripts@3.4.4 depends on ansi-regex via react-scripts@3.4.4 but the pull in different version?

I want to make project2 depend on ansi-regex@3.0.1 like in project1 because 3.0.0 is flagged as a security risk.

I tried

```<code>npm cache clean --force
rm -rf node_modules
npm update
npm i
</code>```

but project2 still refers to ansi-regex@3.0.0 ?

```<code>npm ls ansi-regex@3.0.1
project1-ui@0.0.1 // SNIP
└─┬ react-scripts@3.4.4
  └─┬ jest-watch-typeahead@0.4.2
    └─┬ jest-watcher@24.9.0
      └─┬ string-length@2.0.0
        └─┬ strip-ansi@4.0.0
          └── ansi-regex@3.0.1
</code>```

In the other project I see

```<code>➜ npm ls ansi-regex@3.0.1
project2-ui@0.2.0 // SNIP
└── (empty)

➜  npm ls ansi-regex@3.0.0
project2-ui@0.2.0 // SNIP
└─┬ react-scripts@3.4.4
  └─┬ jest-watch-typeahead@0.4.2
    └─┬ jest-watcher@24.9.0
      └─┬ string-length@2.0.0
        └─┬ strip-ansi@4.0.0
          └── ansi-regex@3.0.0
</code>```

Body:
I have 2 projects; both use React CRA. In each I see react-scripts@3.4.4 depends on ansi-regex via react-scripts@3.4.4 but the pull in different version?

I want to make project2 depend on ansi-regex@3.0.1 like in project1 because 3.0.0 is flagged as a security risk.

I tried

npm cache clean --force
rm -rf node_modules
npm update
npm i

but project2 still refers to ansi-regex@3.0.0 ?

npm ls ansi-regex@3.0.1
project1-ui@0.0.1 // SNIP
└─┬ react-scripts@3.4.4
  └─┬ jest-watch-typeahead@0.4.2
    └─┬ jest-watcher@24.9.0
      └─┬ string-length@2.0.0
        └─┬ strip-ansi@4.0.0
          └── ansi-regex@3.0.1

In the other project I see

➜ npm ls ansi-regex@3.0.1
project2-ui@0.2.0 // SNIP
└── (empty)

➜  npm ls ansi-regex@3.0.0
project2-ui@0.2.0 // SNIP
└─┬ react-scripts@3.4.4
  └─┬ jest-watch-typeahead@0.4.2
    └─┬ jest-watcher@24.9.0
      └─┬ string-length@2.0.0
        └─┬ strip-ansi@4.0.0
          └── ansi-regex@3.0.0


问:
Haskell - concatenate two double linked circular lists?
So I need to implement doubly linked circular lists in Haskell using the data type:

type Wheel a = ([a], [a])

It is set up in such a way that, a pair ([y1,..,yn],[z1,..,zm]) represents a circular lists with elements [y1,..,yn,zm,..,z1]; the element to the right of z1 is y1, the element to the left of y1 is z1. The head element is y1

All operations need to have amortized complexity O(1).

I have implemented most of the operations with amortized complexity O(1), such as moving the head of list (anti-)clockwise, inserting an element and extracting an element, but I cannot figure out how to implement concatenation without reversing at least 1 list.

My current implementation is below:

```<code>concatW :: Wheel a -> Wheel a -> Wheel a
concatW ([], _) (f, s) = (f, s)
concatW (f, s) ([], _) = (f, s)
concatW (f, s) (f',s') = (f, s' ++ (reverse f') ++ s)
</code>```

Is it possible to do in amortized O(1)?

Body:
So I need to implement doubly linked circular lists in Haskell using the data type:

type Wheel a = ([a], [a])

It is set up in such a way that, a pair ([y1,..,yn],[z1,..,zm]) represents a circular lists with elements [y1,..,yn,zm,..,z1]; the element to the right of z1 is y1, the element to the left of y1 is z1. The head element is y1

All operations need to have amortized complexity O(1).

I have implemented most of the operations with amortized complexity O(1), such as moving the head of list (anti-)clockwise, inserting an element and extracting an element, but I cannot figure out how to implement concatenation without reversing at least 1 list.

My current implementation is below:

concatW :: Wheel a -> Wheel a -> Wheel a
concatW ([], _) (f, s) = (f, s)
concatW (f, s) ([], _) = (f, s)
concatW (f, s) (f',s') = (f, s' ++ (reverse f') ++ s)

Is it possible to do in amortized O(1)?


问:
How to create Text File from fragment using toggle button
I am creating an app for office purpose and I want to store the latitude and longitude into a file.
So for the user i have implemented "Navigation Drawer Activity" in the navigation drawer activity home fragment is present in that home fragment I have a toggle button which act as "Check-In" and "Check-Out" Button.
If the user press the check-out toggle button there should be a text file create in device or in firebase database which contain the latitude and longitude.

The problem is I cant able to create text file in fragment.
please give me some solution.

I am expecting to create a file in fragment or in firebase database.


问:
Create dynamic static grid layer for editable gridstack grid
I am trying to create dashboard edit mode grid with gridstack javscript library.

Here is what I am trying to accomplish which is similar to this Databox platform. This is what it looks like when you edit any of the dashboard to view/edit it in grid mode.

So when I drag the blue border handle and scale the div(or even move with cursor hand) then the around grid(which is background layer with absolute position in reality) is automatically adjusted to match the corresponding div. Like this.

Even if there are multiple widgets there, resizing is working everything perfectly fine.
e.g. if there was any sibling widget then resizing this widget would also resize the sibling widget but can not go beyong 1 * 1 grid which is smallest size there.

Even after resizing both widgets, the background static grid boxes (with yellow border) fills the remaining vacant space similar to what is the concept of dense packing algorithm in css grid.
They are removed when widget is grown and added when it is shrinked.

As it seems super complicated to achieve this, is there any default feature like this with grid-stack library?


问:
Spring Reactive MongoDB and caching
My situation is:

```<code>class Obj {
  final List<?> section1;
  final List<?> section2;
}

private final ReactiveRepo repository;
private final AsyncLoadingCache<UUID, Obj> cache;

...
cache = Caffeine.newBuilder()
        .expireAfterAccess(Duration.ofMinutes(15))
        .<UUID, Obj>removalListener((uniqueId, obj, cause) -> {
          if (Obj!= null) {
            repository.save(obj)
                .timeout(Duration.ofSeconds(30))
                .subscribe();
          }
        })
        .buildAsync((uniqueId, executor) ->
            repository.findById(uniqueId)
                .switchIfEmpty(
                    Mono.just(
                        ...
                    ))
                .toFuture()
        );
</code>```

So, when REST API requests smth, I use the values from the cache and synchronized(required section). However, what is the probability that changes may occur with #save and my object will be saved incorrectly? How can I prevent this?

Does the ReactiveMongoRepository#save method make a separate copy of the object?

Are there ways to do better caching in a reactive programming environment?

Title: Spring Reactive MongoDB and caching

Body:
My situation is:

class Obj {
  final List<?> section1;
  final List<?> section2;
}

private final ReactiveRepo repository;
private final AsyncLoadingCache<UUID, Obj> cache;

...
cache = Caffeine.newBuilder()
        .expireAfterAccess(Duration.ofMinutes(15))
        .<UUID, Obj>removalListener((uniqueId, obj, cause) -> {
          if (Obj!= null) {
            repository.save(obj)
                .timeout(Duration.ofSeconds(30))
                .subscribe();
          }
        })
        .buildAsync((uniqueId, executor) ->
            repository.findById(uniqueId)
                .switchIfEmpty(
                    Mono.just(
                        ...
                    ))
                .toFuture()
        );

So, when REST API requests smth, I use the values from the cache and synchronized(required section). However, what is the probability that changes may occur with #save and my object will be saved incorrectly? How can I prevent this?

Does the ReactiveMongoRepository#save method make a separate copy of the object?

Are there ways to do better caching in a reactive programming environment?


问:
shrink a sticky div while scrolling down
hey i have in my site a stick div to create a new post
i want this div to animated shrink to a little box the will stick to the header while user scrolls down
and when im pressing on it or scrolling up this div will be visable again
any one can help me how to do this</p>
```<code> <form
      onSubmit={(e) => {
        handleSubmit(e);
      }}
      className={` top-[106px] z-10 bg-main px-3 pt-2 rounded-lg border border-gray-300`}
    >
      {titlePost()}
      {isPostActive && (
        <div className="flex flex-col py-2 ">
          <CommunitySelect community={community} setCommunity={setCommunity} />
          {textArea()}
          {imageBoxOpen && (
            <DropzoneComponent
              setImages={setImages}
              maxImagesLength={maxImageLength}
            />
          )}
          {createPostButton()}
        </div>
      )}
    </form>```
</code>```

Body:
hey i have in my site a stick div to create a new post
i want this div to animated shrink to a little box the will stick to the header while user scrolls down
and when im pressing on it or scrolling up this div will be visable again
any one can help me how to do this

 <form
      onSubmit={(e) => {
        handleSubmit(e);
      }}
      className={` top-[106px] z-10 bg-main px-3 pt-2 rounded-lg border border-gray-300`}
    >
      {titlePost()}
      {isPostActive && (

          <CommunitySelect community={community} setCommunity={setCommunity} />
          {textArea()}
          {imageBoxOpen && (
            <DropzoneComponent
              setImages={setImages}
              maxImagesLength={maxImageLength}
            />
          )}
          {createPostButton()}

      )}
    </form>```


问:
The session is always in the starting state when there is a problem when livy executes the spark submit
I deliberately wrote an incorrect jar package path, and then an error occurred that the session was always in the starting state


问:
Getting the LNK2001 and LNK2020 error while building a solution
We have a big project in Visual Studio written in both C++ and C# (with more than 8 projects involved). One of the projects is called Ramin_SC and inside this project there is a folder named common which contains some .h and .cpp and These files are called and used by Ramin_SC. I relocated this common folder to another directory outside of the solution directory (Let's say to another Drive). I modified the Additional include directory with a relative path and also changed all the possible configurations in the .vcxproj file of Ramin_SC. Now , when I build Ramin_SC , the new directory for the files is recognized by VS but I get LNK2001 AND LNK2020 errors. Before this relocation the build used to be successful without any errors. These are the erros :

LNK 2001 : Description : unresolved external symbol "wchar_t * errorfile_name" (?errorfile_name@@3PA_WA) . Project Ramin_SC . File SC_Interface.

LNK 2020 : Description : unresolved token (0A0004D2) "wchar_t * errorfile_name" (?errorfile_name@@3PA_WA). Project Ramin_SC . File SC_Interface.

In the Additional Library Directories of Linker I specified the path to the location of the common folder. Many people here mentioned that the problem is with a missing library or an incorrect directory. But I don't think that these are applicable in my case.


问:
Linking two MySQL tables containing pipe delimited characters were the only physical link is there relative location
I have two MYSQL tables Products and Prices. Both tables are populated via a webform that creates a pipe delimited value for the options that the end user has selected. This process and the initial output cannot be changed.

So if User1 selects 3 products, they will have a string with three products and two pipes. If User 2 selects 7 products they will have a string with 7 products and 6 pipes.

The separate prices table will then have corresponding pipe delimited values for the prices for each of the items selected by the user.

I am wanting to attribute the price to the product, but the only linking value is there location within a pipe delimited string whose length fluctuates based on the number of items selected.

Products Table

Account ID
Options

s001
Cat|Dog|Cow|Sheep

s002
Cat|Dog|Cow|Sheep

s003
Cat|Dog|Sheep

s004
Cat|Dog|Sheep

s005
Cat|Dog|Sheep

s006
Cat|Dog|Cow|Sheep

s007
Cat|Dog|Cow|Pig|Goat|Seagull|Sheep

s008
Duck

s009
Pig|Goat|Seagull|Sheep

s010
Cat|Dog|Cow|Sheep|Seal

Prices Table

Account   ID
optionsdiscounts

s001
-40.00|0.00|-40.00|0.00

s002
-40.00|0.00|-40.00|0.00

s003
-40.00|0.00|0.00

s004
-5.50|0.00|0.00

s005
-40.00|0.00|0.00

s006
-40.00|0.00|0.00

s007
-15.00|0.00|-15.00|-15.00|0.00|-15.00|0.00

s008
-13.85

s009
-33.71|0.00|-33.71|0.00

s010
-40.00|0.00|-40.00|0.00

So using the tables above I need to say that for:

s001, Cat is -40, and Cow is -40

s005, Sheep (Position 3) is 0.00

s006, sheep (Position 4) is 0.00

s008, Duck is -13.85

The location of each product can be in a different location for each account, as seen by the sheep product for S001,S005,S007 where it appears at positions 4, 3 and 7 respectively.

There are currently 13 individual 'animal' products that can be selected by the user and currently in the DB there are around 50 variations of product strings that exist.

There are currently around 2,500 rows of records that I am needing to report on with this criteria, but the DB table contains around 1.9 million records (the remaining records have a level of consistency that I can work with), it is the remaining 2,500 that have a odd format.

Using the substring_index in MySQL I can split the string based on the delimitator to then have a column for each of the individual data items:

Product

```<code>    case when 0<= LENGTH(options) - LENGTH(REPLACE(options, '|', '')) then
 SUBSTRING_INDEX(SUBSTRING_INDEX(options, '|', 1), '|', -1) ELSE null  end as op1
</code>```

Account ID
op1
op2
op3
op4

s001
Cat
Dog
Cow
Sheep

I can also carry out the same function on the Prices table to then provide each data item as a separate column.

The issue I am having is that I am unable to find away to attribute the price item to the description of the product item based on its location

I do have the option to use SSIS to carry out transformation on the data, I can also save the data to an SQL-server database if an option is available in that language.

Body:
I have two MYSQL tables Products and Prices. Both tables are populated via a webform that creates a pipe delimited value for the options that the end user has selected. This process and the initial output cannot be changed.

So if User1 selects 3 products, they will have a string with three products and two pipes. If User 2 selects 7 products they will have a string with 7 products and 6 pipes.

The separate prices table will then have corresponding pipe delimited values for the prices for each of the items selected by the user.

I am wanting to attribute the price to the product, but the only linking value is there location within a pipe delimited string whose length fluctuates based on the number of items selected.

Products Table

Account ID
Options

s001
Cat|Dog|Cow|Sheep

s002
Cat|Dog|Cow|Sheep

s003
Cat|Dog|Sheep

s004
Cat|Dog|Sheep

s005
Cat|Dog|Sheep

s006
Cat|Dog|Cow|Sheep

s007
Cat|Dog|Cow|Pig|Goat|Seagull|Sheep

s008
Duck

s009
Pig|Goat|Seagull|Sheep

s010
Cat|Dog|Cow|Sheep|Seal

Prices Table

Account   ID
optionsdiscounts

s001
-40.00|0.00|-40.00|0.00

s002
-40.00|0.00|-40.00|0.00

s003
-40.00|0.00|0.00

s004
-5.50|0.00|0.00

s005
-40.00|0.00|0.00

s006
-40.00|0.00|0.00

s007
-15.00|0.00|-15.00|-15.00|0.00|-15.00|0.00

s008
-13.85

s009
-33.71|0.00|-33.71|0.00

s010
-40.00|0.00|-40.00|0.00

So using the tables above I need to say that for:

s001, Cat is -40, and Cow is -40

s005, Sheep (Position 3) is 0.00

s006, sheep (Position 4) is 0.00

s008, Duck is -13.85

The location of each product can be in a different location for each account, as seen by the sheep product for S001,S005,S007 where it appears at positions 4, 3 and 7 respectively.

There are currently 13 individual 'animal' products that can be selected by the user and currently in the DB there are around 50 variations of product strings that exist.

There are currently around 2,500 rows of records that I am needing to report on with this criteria, but the DB table contains around 1.9 million records (the remaining records have a level of consistency that I can work with), it is the remaining 2,500 that have a odd format.

Using the substring_index in MySQL I can split the string based on the delimitator to then have a column for each of the individual data items:

Product

    case when 0<= LENGTH(options) - LENGTH(REPLACE(options, '|', '')) then
 SUBSTRING_INDEX(SUBSTRING_INDEX(options, '|', 1), '|', -1) ELSE null  end as op1

Account ID
op1
op2
op3
op4

s001
Cat
Dog
Cow
Sheep

I can also carry out the same function on the Prices table to then provide each data item as a separate column.

The issue I am having is that I am unable to find away to attribute the price item to the description of the product item based on its location

I do have the option to use SSIS to carry out transformation on the data, I can also save the data to an SQL-server database if an option is available in that language.


问:
STM32CubeIDE deleted all my projects inside workspace
Info:

STM32CubeIDE 1.4.0

OS: Windows

Description:

I have chosen working directory/workspace. E.g., C:\course_1\cubdeide_ws

STM32CubeIDE was closed

I have then renamed my course folder. E.g., C:\course_2\cubdeide_ws

I then opened STM32CubeIDE to do project (STM32-Projects)

I had encountered the following problem:

All projects inside folder/workspace C:\course_2\cubdeide_ws (renamed one) was deleted

I should only have C:\course_2\cubdeide_ws directory in my PC, but I also had C:\course_1\cubdeide_ws

In folder C:\course_2, I had my files from before, but there are no any projects inside C:\course_2\cubdeide_ws folder

In folder C:\course_1 I have a folder with path C:\course_1\cubdeide_ws, but even there, there is none of my projects

Problems:

All my STM32-Projects are gone/deleted (it's not even in Recycle Bin)

Why is STM32CubeIDE creating new folder (same as chosen workspace before)? Before renaming any folder in my PC, do I have to check whether the path is included as workspace by STM32CubeIDE?

I just renamed my folder.Why do STM32CubeIDE deletes projects and also created new folder as per the workspace selected before?


问:
Checking if a string is in a column from another table
I have two dataframes. Table A => is about location and Table B => is about sold products. I need to bring the location ID into the table B. The criteria is: if tableB[col1] is in tableA[col1] and tableB[col2] is in tableA[col2] and so on. Then, bring the location ID into table B.

I couldn't go foward on it.


问:
How to enable transitions for nested lists in Vue.js?
I have two nested lists, and I would like to have an animated transition when the lists change. However, I have not yet found a way how to enable transition for both lists.

This adds transitions to the inner list:

```<code><div v-for="foo in foos" :key="foo.id">
    <Foo :id="foo.id"/>
    <TransitionGroup name="card">
      <span class="card" v-for="bar in bars" :key="bar.id">
        <Bar :id="bar.id"/>
      </span>
    </TransitionGroup>
</div>
</code>```

And this adds transition to the outer list, but not inner list:

```<code><TransitionGroup name="card">
   <div v-for="foo in foos" :key="foo.id">
    <Foo :id="foo.id"/>
      <span class="card" v-for="bar in bars" :key="bar.id">
        <Bar :id="bar.id"/>
      </span>
   </div>
</TransitionGroup>
</code>```

Adding another TransitionGroup to surround the inner list didn't do the trick either. How can I enable transitions for both lists? Vue version is 2.

Body:
I have two nested lists, and I would like to have an animated transition when the lists change. However, I have not yet found a way how to enable transition for both lists.

This adds transitions to the inner list:

    <Foo :id="foo.id"/>
    <TransitionGroup name="card">

        <Bar :id="bar.id"/>

    </TransitionGroup>

And this adds transition to the outer list, but not inner list:

<TransitionGroup name="card">

    <Foo :id="foo.id"/>

        <Bar :id="bar.id"/>

</TransitionGroup>

Adding another TransitionGroup to surround the inner list didn't do the trick either. How can I enable transitions for both lists? Vue version is 2.


问:
Test Container Initialize Mongo Db With Insert Document
I am using testContanier for unit and integration tests.

I need to initialize mongo db with insert document. How can I initialize mongo db before spring boot is runnig ?

```<code>@BeforeAll
public static void startAndInitializeContainer(){
 final MongoDBContainer mongoDBContainer = new MongoDBContainer(DockerImageName.parse("mongo:4.0.10"))

mongoDBContainer.start();
}

</code>```

I have @PostConstruct annotation therefore I need to initialize mongodb under the @BeforeAll annotation.

Any help is appreciated.

Body:
I am using testContanier for unit and integration tests.

I need to initialize mongo db with insert document. How can I initialize mongo db before spring boot is runnig ?

@BeforeAll
public static void startAndInitializeContainer(){
 final MongoDBContainer mongoDBContainer = new MongoDBContainer(DockerImageName.parse("mongo:4.0.10"))

mongoDBContainer.start();
}

I have @PostConstruct annotation therefore I need to initialize mongodb under the @BeforeAll annotation.

Any help is appreciated.


问:
fftshift produces zero components
I am trying to implement a 2D Fourier transform in an image and my code is:

image = cv2.imread(str(img), cv2.COLOR_BGR2RGB)
image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
f = np.fft.fft2(image)
fshift = np.fft.fftshift(f)
magnitude_spectrum = 20*np.log(np.abs(fshift))
```

Then in magnitude_spectrum I can see that one component is -inf which means that it is 0 in fshift. Why does this happen ?

I tried to apply this with other images and it worked, but some other images produce 0. So is this only image-dependent ?

Title: fftshift produces zero components

Body:
I am trying to implement a 2D Fourier transform in an image and my code is:

image = cv2.imread(str(img), cv2.COLOR_BGR2RGB)
image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
f = np.fft.fft2(image)
fshift = np.fft.fftshift(f)
magnitude_spectrum = 20*np.log(np.abs(fshift))

Then in magnitude_spectrum I can see that one component is -inf which means that it is 0 in fshift. Why does this happen ?

I tried to apply this with other images and it worked, but some other images produce 0. So is this only image-dependent ?


问:
Impossible to connect to a mysql Cleardb database on Heroku
My last build failed with this error message:

```<code>       Executing script cache:clear [KO]
        [KO]
       Script cache:clear returned with error code 255
       !!
       !!  In ExceptionConverter.php line 117:
       !!
       !!    An exception occurred in the driver: SQLSTATE[HY000] [1226] User 'xxxxxxxx
       !!    xxxxx' has exceeded the 'max_user_connections' resource (current value: 15)
</code>```

And when I try to connect to my database via CLI,

mysql -u xxxxxxxxxx -pxxxxxxxx -h us-cdbr-east-xxx.cleardb.com

I am getting this error message:

ERROR 1040 (HY000): Too many connections

The problem is that the dashboard of the database says : No connections are currently established to the database. Therefore, I guess that a hidden process might be running.

Do you have an idea on how to fix this issue? I have already restarted all the dynos but it didn't have any effect. Is restarting the dynos and restarting the app the same? I also read that I should stop background workers, but I have no clue on how to do this...

Body:
My last build failed with this error message:

       Executing script cache:clear [KO]
        [KO]
       Script cache:clear returned with error code 255
       !!
       !!  In ExceptionConverter.php line 117:
       !!
       !!    An exception occurred in the driver: SQLSTATE[HY000] [1226] User 'xxxxxxxx
       !!    xxxxx' has exceeded the 'max_user_connections' resource (current value: 15)

And when I try to connect to my database via CLI,

mysql -u xxxxxxxxxx -pxxxxxxxx -h us-cdbr-east-xxx.cleardb.com

I am getting this error message:

ERROR 1040 (HY000): Too many connections

The problem is that the dashboard of the database says : No connections are currently established to the database. Therefore, I guess that a hidden process might be running.

Do you have an idea on how to fix this issue? I have already restarted all the dynos but it didn't have any effect. Is restarting the dynos and restarting the app the same? I also read that I should stop background workers, but I have no clue on how to do this...


问:
installing DCAP on sgx linux server
I am going to install DCAP On my linux server with Kernel : Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
when I run sudo ./sgx_linux_x64_driver_1.36.2.bin I get error :

```<code>'make' KDIR=/lib/modules/5.15.0-1023-azure/build....(bad exit status: 2)
ERROR (dkms apport): binary package for sgx: 1.36.2 not found
Error! Bad return status for module build on kernel: 5.15.0-1023-azure (x86_64)
Consult /var/lib/dkms/sgx/1.36.2/build/make.log for more information.
</code>```

Does any one knows the reason?

```<code>cat /var/lib/dkms/sgx/1.36.2/build/make.log
DKMS make.log for sgx-1.36.2 for kernel 5.15.0-1023-azure (x86_64)
Wed 14 Dec 2022 11:57:05 AM UTC
make -C /lib/modules/5.15.0-1023-azure/build M=/var/lib/dkms/sgx/1.36.2/build CFLAGS_MODULE="-I/var/lib/dkms/sgx/1.36.2/build -I/var/lib/dkms/sgx/1.36.2/build/include" modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-1023-azure'
  CC [M]  /var/lib/dkms/sgx/1.36.2/build/encl.o
  CC [M]  /var/lib/dkms/sgx/1.36.2/build/main.o
/var/lib/dkms/sgx/1.36.2/build/main.c: In function ‘sgx_init’:
/var/lib/dkms/sgx/1.36.2/build/main.c:792:9: note: #pragma message: kernel version may not be supported
  792 | #pragma message "kernel version may not be supported"
      |         ^~~~~~~
  CC [M]  /var/lib/dkms/sgx/1.36.2/build/driver.o
  CC [M]  /var/lib/dkms/sgx/1.36.2/build/ioctl.o
  LD [M]  /var/lib/dkms/sgx/1.36.2/build/intel_sgx.o
  MODPOST /var/lib/dkms/sgx/1.36.2/build/Module.symvers
ERROR: modpost: "kallsyms_lookup_name" [/var/lib/dkms/sgx/1.36.2/build/intel_sgx.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:134: /var/lib/dkms/sgx/1.36.2/build/Module.symvers] Error 1
make[2]: *** Deleting file '/var/lib/dkms/sgx/1.36.2/build/Module.symvers'
make[1]: *** [Makefile:1818: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-1023-azure'
make: *** [Makefile:22: default] Error 2
</code>```

Title: installing DCAP on sgx linux server

Body:
I am going to install DCAP On my linux server with Kernel : Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
when I run sudo ./sgx_linux_x64_driver_1.36.2.bin I get error :

'make' KDIR=/lib/modules/5.15.0-1023-azure/build....(bad exit status: 2)
ERROR (dkms apport): binary package for sgx: 1.36.2 not found
Error! Bad return status for module build on kernel: 5.15.0-1023-azure (x86_64)
Consult /var/lib/dkms/sgx/1.36.2/build/make.log for more information.

Does any one knows the reason?

cat /var/lib/dkms/sgx/1.36.2/build/make.log
DKMS make.log for sgx-1.36.2 for kernel 5.15.0-1023-azure (x86_64)
Wed 14 Dec 2022 11:57:05 AM UTC
make -C /lib/modules/5.15.0-1023-azure/build M=/var/lib/dkms/sgx/1.36.2/build CFLAGS_MODULE="-I/var/lib/dkms/sgx/1.36.2/build -I/var/lib/dkms/sgx/1.36.2/build/include" modules
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-1023-azure'
  CC [M]  /var/lib/dkms/sgx/1.36.2/build/encl.o
  CC [M]  /var/lib/dkms/sgx/1.36.2/build/main.o
/var/lib/dkms/sgx/1.36.2/build/main.c: In function ‘sgx_init’:
/var/lib/dkms/sgx/1.36.2/build/main.c:792:9: note: #pragma message: kernel version may not be supported
  792 | #pragma message "kernel version may not be supported"
      |         ^~~~~~~
  CC [M]  /var/lib/dkms/sgx/1.36.2/build/driver.o
  CC [M]  /var/lib/dkms/sgx/1.36.2/build/ioctl.o
  LD [M]  /var/lib/dkms/sgx/1.36.2/build/intel_sgx.o
  MODPOST /var/lib/dkms/sgx/1.36.2/build/Module.symvers
ERROR: modpost: "kallsyms_lookup_name" [/var/lib/dkms/sgx/1.36.2/build/intel_sgx.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:134: /var/lib/dkms/sgx/1.36.2/build/Module.symvers] Error 1
make[2]: *** Deleting file '/var/lib/dkms/sgx/1.36.2/build/Module.symvers'
make[1]: *** [Makefile:1818: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-1023-azure'
make: *** [Makefile:22: default] Error 2


问:
Excel VBA - ClearContents in a Range
I am struggling to find out what is the problem in my VBA macro.

I have an excel file that have few worksheets.

The sheet 3 include some data made by Format function from another sheet and numbers of rows in this sheet 3 may be various.

Under this data I add some additional data by another macro and coloring some cells in Filter Function area.

Before I refresh the data by Filter I need to clean the additional data in the bottom.

The following code suppose to clean the additional data and added colors in cells.

When I run it from Sheet3 it runs perfectly.

But if I run it from another sheet I am getting the error "Application-defined or Object-Defined error"

```<code>Attribute VB_Name = "Module1"
Option Explicit

Public Sub ClearData_Test()

'
'Clears all Colored cells and delete Temp values from "3.Comp_258_without_new" Worksheet
'

'Find the last non-blank cell in column A(1)
    Dim lRow As Long
    lRow = ThisWorkbook.Worksheets("3.Comp_258_without_new").Cells(Rows.Count, 1).End(xlUp).Row

'Find the last non-blank cell in row 4
    Dim lCol As Long
    lCol = ThisWorkbook.Worksheets("3.Comp_258_without_new").Cells(4, Columns.Count).End(xlToLeft).Column

'Clear All Colors and Temp Values
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim ClearColorRange As Range
    Dim ClearDataRange As Range

    Set wb = ThisWorkbook
    Set ws = wb.Worksheets("3.Comp_258_without_new")
    Set ClearColorRange = ws.Range(Cells(5, 1), Cells(600, lCol))
    Set ClearDataRange = ws.Range(Cells(lRow + 2, 1), Cells(lRow + lRow, lCol))

    'Worksheets("3.Comp_258_without_new").Range(Cells(5, 1), Cells(600, lCol)).Interior.Color = xlNone
    'Worksheets("3.Comp_258_without_new").Range(Cells(lRow + 2, 1), Cells(lRow + lRow, lCol)).ClearContents

    ClearColorRange.Interior.Color = xlNone
    ClearDataRange.ClearContents

End Sub

</code>```

Please, help me to understand what is wrong
and sorry for my bad English

Title: Excel VBA - ClearContents in a Range

Body:
I am struggling to find out what is the problem in my VBA macro.

I have an excel file that have few worksheets.

The sheet 3 include some data made by Format function from another sheet and numbers of rows in this sheet 3 may be various.

Under this data I add some additional data by another macro and coloring some cells in Filter Function area.

Before I refresh the data by Filter I need to clean the additional data in the bottom.

The following code suppose to clean the additional data and added colors in cells.

When I run it from Sheet3 it runs perfectly.

But if I run it from another sheet I am getting the error "Application-defined or Object-Defined error"

Attribute VB_Name = "Module1"
Option Explicit

Public Sub ClearData_Test()

'
'Clears all Colored cells and delete Temp values from "3.Comp_258_without_new" Worksheet
'

'Find the last non-blank cell in column A(1)
    Dim lRow As Long
    lRow = ThisWorkbook.Worksheets("3.Comp_258_without_new").Cells(Rows.Count, 1).End(xlUp).Row

'Find the last non-blank cell in row 4
    Dim lCol As Long
    lCol = ThisWorkbook.Worksheets("3.Comp_258_without_new").Cells(4, Columns.Count).End(xlToLeft).Column

'Clear All Colors and Temp Values
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim ClearColorRange As Range
    Dim ClearDataRange As Range

    Set wb = ThisWorkbook
    Set ws = wb.Worksheets("3.Comp_258_without_new")
    Set ClearColorRange = ws.Range(Cells(5, 1), Cells(600, lCol))
    Set ClearDataRange = ws.Range(Cells(lRow + 2, 1), Cells(lRow + lRow, lCol))

    'Worksheets("3.Comp_258_without_new").Range(Cells(5, 1), Cells(600, lCol)).Interior.Color = xlNone
    'Worksheets("3.Comp_258_without_new").Range(Cells(lRow + 2, 1), Cells(lRow + lRow, lCol)).ClearContents

    ClearColorRange.Interior.Color = xlNone
    ClearDataRange.ClearContents

End Sub

Please, help me to understand what is wrong
and sorry for my bad English


问:
Trouble exporting csv using Maatwebsite\Excel Laravel 9
I'm trying to export a csv file with Maatwebsite\Excel and Laravel 9.

As a response, I get my datas and headings in console > network , but no download occurs.

Here's my code :

Exports

```<code>namespace App\Exports;

use App\Models\Data;
use Illuminate\Support\Facades\Schema;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\FromCollection;

class DataExport implements FromCollection, WithHeadings
{
    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection()
    {
        return Data::all();
    }

    public function headings():array{
        return[
           Schema::getColumnListing('data')
        ];
    }
}
</code>```

And my controller (1st try) :

```<code>public function download_file_csv()
{
    Excel::store(new DataExport, 'dataTemplate.csv');
    Excel::download(new DataExport,'dataTemplate.csv',\Maatwebsite\Excel\Excel::CSV, [
        'Content-Type' => 'text/csv',
    ]);
}
</code>```

and 2nd try

```<code>public function download_file_csv()
{
    Excel::store(new DataExport, 'dataTemplate.csv');
    return Excel::download(new DataExport,'dataTemplate.csv');
}
</code>```

The file with datas and headings is properly stored in my public folder...

Thanks in advance,

Body:
I'm trying to export a csv file with Maatwebsite\Excel and Laravel 9.

As a response, I get my datas and headings in console > network , but no download occurs.

Here's my code :

Exports

namespace App\Exports;

use App\Models\Data;
use Illuminate\Support\Facades\Schema;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\FromCollection;

class DataExport implements FromCollection, WithHeadings
{
    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection()
    {
        return Data::all();
    }

    public function headings():array{
        return[
           Schema::getColumnListing('data')
        ];
    }
}

And my controller (1st try) :

public function download_file_csv()
{
    Excel::store(new DataExport, 'dataTemplate.csv');
    Excel::download(new DataExport,'dataTemplate.csv',\Maatwebsite\Excel\Excel::CSV, [
        'Content-Type' => 'text/csv',
    ]);
}

and 2nd try

public function download_file_csv()
{
    Excel::store(new DataExport, 'dataTemplate.csv');
    return Excel::download(new DataExport,'dataTemplate.csv');
}

The file with datas and headings is properly stored in my public folder...

Thanks in advance,


问:
read proto data file and write in json format in python
I have a proto file like employees.proto which contains list of employees in proto format, where each employee looks like :-

```<code>class Employee:
__id=0
__name=""
__gender=""
__city=""
__salary=0
</code>```

Now I want to read this file in python and convert this data to json.
Any sample code will be really appreciated.

Body:
I have a proto file like employees.proto which contains list of employees in proto format, where each employee looks like :-

class Employee:
__id=0
__name=""
__gender=""
__city=""
__salary=0

Now I want to read this file in python and convert this data to json.
Any sample code will be really appreciated.


问:
In Keycloak, can I specify kc_idp_hint for the built-in clients (e.g. security-admin-console)?
I have an application that includes Keycloak as the identity component. I want to redirect to the Keycloak security admin console for a particular realm from my application, which I am able to do, however I also want to specify a particular IdP to sign in.

For my OIDC apps that are protected by the same Keycloak realm, I am able to do this using the kc_idp_hint query param. However the built-in clients don't seem to respect this, so the following URL does not result in the IdP hint being propagated to the authorization URL:

```<code>https://<keycloak>/admin/<realm>/console?kc_idp_hint=<idp>
</code>```

Body:
I have an application that includes Keycloak as the identity component. I want to redirect to the Keycloak security admin console for a particular realm from my application, which I am able to do, however I also want to specify a particular IdP to sign in.

For my OIDC apps that are protected by the same Keycloak realm, I am able to do this using the kc_idp_hint query param. However the built-in clients don't seem to respect this, so the following URL does not result in the IdP hint being propagated to the authorization URL:

https://<keycloak>/admin/<realm>/console?kc_idp_hint=<idp>


问:
My image cannot upload on cloudinary with restApi in node.js?
I have a restApi of registerUser which creates the user but the issue is that when I target my Api  my avatar image cannot upload to the cloudinary so when its not upload to the cloudinary so no public_id and secure_url generate so beacause of this my backend generates an error

:typeerror::cannot convert the undefined or null to object.

I cant find any solution
here is my my Rest Api

```<code>const catchAsyncError = require("../middleware/catchAsyncError");
const ErrorHandler = require("../utils/errorhandler");
//const ErrorHandler = require("../middleware/error.js");
const User=require("../models/userModel");
const sendToken=require("../utils/Jwttoken");
const sendEmail=require("../utils/sendEmail")
const crypto=require('crypto')
const cloudinary=require("cloudinary").v2;

exports.registerUser = catchAsyncError(async (req, res, next) => {
  console.log("B1");
  console.log(req.body.avatar);
  let myCloud
   myCloud = await cloudinary.uploader.upload(req.body.avatar, {
    folder: avatars,
    width: 150,
    crop: "scale",

  });

  /*let myCloud= [];
 let PID;
 let PURL;
   if(req.body.avatar.length > 100){

     myCloud = await cloudinary.v2.uploader.upload(req.body.avatar,{
       folder:"avatars",
       width:750,
       crop:"scale",
     })
   }
   if(req.body.avatar.length > 100){
     PID = myCloud.public_id;
     PURL = myCloud.secure_url;
   }
   else{
     PID  = "HelloGuys"
     PURL  = req.body.avatar;
   }*/
  console.log("B2");
  const { name, email, password } = req.body;

  console.log(name);
  console.log(email);
  console.log(password);

  const user = await User.create({
    name,
    email,
    password,
    avatar:{
      public_id:myCloud.public_id,
      url:myCloud.secure_url
  }

  });
  console.log("B3");
  sendToken(user, 201, res);
});
</code>```

Body:
I have a restApi of registerUser which creates the user but the issue is that when I target my Api  my avatar image cannot upload to the cloudinary so when its not upload to the cloudinary so no public_id and secure_url generate so beacause of this my backend generates an error

:typeerror::cannot convert the undefined or null to object.

I cant find any solution
here is my my Rest Api

const catchAsyncError = require("../middleware/catchAsyncError");
const ErrorHandler = require("../utils/errorhandler");
//const ErrorHandler = require("../middleware/error.js");
const User=require("../models/userModel");
const sendToken=require("../utils/Jwttoken");
const sendEmail=require("../utils/sendEmail")
const crypto=require('crypto')
const cloudinary=require("cloudinary").v2;

exports.registerUser = catchAsyncError(async (req, res, next) => {
  console.log("B1");
  console.log(req.body.avatar);
  let myCloud
   myCloud = await cloudinary.uploader.upload(req.body.avatar, {
    folder: avatars,
    width: 150,
    crop: "scale",

  });

  /*let myCloud= [];
 let PID;
 let PURL;
   if(req.body.avatar.length > 100){

     myCloud = await cloudinary.v2.uploader.upload(req.body.avatar,{
       folder:"avatars",
       width:750,
       crop:"scale",
     })
   }
   if(req.body.avatar.length > 100){
     PID = myCloud.public_id;
     PURL = myCloud.secure_url;
   }
   else{
     PID  = "HelloGuys"
     PURL  = req.body.avatar;
   }*/
  console.log("B2");
  const { name, email, password } = req.body;

  console.log(name);
  console.log(email);
  console.log(password);

  const user = await User.create({
    name,
    email,
    password,
    avatar:{
      public_id:myCloud.public_id,
      url:myCloud.secure_url
  }

  });
  console.log("B3");
  sendToken(user, 201, res);
});


问:
Sparql and Pandas conversion in Wikidata

I have queried Wikidata [https://query.wikidata.org/] via sparqlwrapper in python.

It returns as an XML for some reason instead of CSV.
Result of query in python

I convert it to a Pandas DataFrame in python.

Question:

I am new to pandas, which method should I use to convert it into a format where every row is a wikidata entity, and every column is a possible feature? Also, is there a way to do it as fast as possible using numpy?

Need to convert from :
Image of SPARQL Query
to
(Image of optimal format)

Thank you.

Query used below:

```<code>    SELECT DISTINCT ?company ?companyLabel ?description ?wdLabel ?ps_Label

    {
    VALUES ?company {wd:Q396266 wd:Q3270129 wd:Q359194 wd:P3562 wd:Q119230}

    ?company ?p ?statement .
    ?statement ?ps ?ps_ .
    ?company schema:description ?description.

    ?wd wikibase:claim ?p.
    ?wd wikibase:statementProperty ?ps.
    OPTIONAL {
    ?statement ?pq ?pq_ .
    ?wdpq wikibase:qualifier ?pq .
    }
        FILTER ( lang(?description) = "en" )

    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .

    }
    } ORDER BY ?wd ?statement ?ps_
</code>```

Should I use pd.pivot_table or melt etc?

Body:
I have queried Wikidata [https://query.wikidata.org/] via sparqlwrapper in python.

It returns as an XML for some reason instead of CSV.
Result of query in python

I convert it to a Pandas DataFrame in python.

Question:

I am new to pandas, which method should I use to convert it into a format where every row is a wikidata entity, and every column is a possible feature? Also, is there a way to do it as fast as possible using numpy?

Need to convert from :
Image of SPARQL Query
to
(Image of optimal format)

Thank you.

Query used below:

    SELECT DISTINCT ?company ?companyLabel ?description ?wdLabel ?ps_Label

    {
    VALUES ?company {wd:Q396266 wd:Q3270129 wd:Q359194 wd:P3562 wd:Q119230}

    ?company ?p ?statement .
    ?statement ?ps ?ps_ .
    ?company schema:description ?description.

    ?wd wikibase:claim ?p.
    ?wd wikibase:statementProperty ?ps.
    OPTIONAL {
    ?statement ?pq ?pq_ .
    ?wdpq wikibase:qualifier ?pq .
    }
        FILTER ( lang(?description) = "en" )

    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .

    }
    } ORDER BY ?wd ?statement ?ps_

Should I use pd.pivot_table or melt etc?


问:
Flutter FCM - how track if a particular notification has been received
I'm trying to update status of a delivery message depending on the push notification status,

Here is the scenario

Receiver device hasn't received a notification (When receiver device is closed) -> Single grey tick

Receiver device has received a notification from firebase -> Double grey tick

Receiver device has received a notification and opened notification -> Double blue tick

Any idea how can I achieve this ?


问:
Couchbase Query to shard data in collections
I have millions of records in legacy couchbase bucket. Post migration to couchbase 7.0 it will be copied to _default scope and collection now If I need to shard it across collections. Say collections are per month and year what query should I write
which will take data from bucketname_default_default to respective collection for month i.e. collection named collection_month_year. I have createdDate in the document already.</p>


问:
React page is not rendering on props.history.push ,Using it with new react v18.2.0 and Old router v5.2
anyone know the fix , for this
In my project  i am using

"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.2.0",

new react version with old router, please help me out

Route

```<code><Route
path={
    '/' +
    Constants.USER_ADMIN_TYPE +
    '/show-details/:name/:showId'
}
render={(props) => (
    <Admin
        userType={Constants.USER_ADMIN_TYPE}
        comp={<ShowDetails {...props} />}
    />
)}
/>
</code>```

URL I AM SENDING USINSG history.push

```<code><td
onClick={() =>
    props.history.push(
        `/${localStorage.getItem(
            'role'
        )}/Show-details/${
            item.name
        }/${
            item.showId
        }`
    )
}
>
{id + 1}
</td>
</code>```

I have tried almost all the possible solution to make it workig , but couldn't found a solution till now.

I have set of shows, and onclicking on it only changing the url, not showing the rendered component.

I see on  tag href component is rendering the in new page , loaded succesfully .

but on props.history.push it is not renderign the component ,just changing the url

Body:
anyone know the fix , for this
In my project  i am using

"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.2.0",

new react version with old router, please help me out

Route

<Route
path={
    '/' +
    Constants.USER_ADMIN_TYPE +
    '/show-details/:name/:showId'
}
render={(props) => (
    <Admin
        userType={Constants.USER_ADMIN_TYPE}
        comp={<ShowDetails {...props} />}
    />
)}
/>

URL I AM SENDING USINSG history.push

    props.history.push(
        `/${localStorage.getItem(
            'role'
        )}/Show-details/${
            item.name
        }/${
            item.showId
        }`
    )
}
>
{id + 1}

I have tried almost all the possible solution to make it workig , but couldn't found a solution till now.

I have set of shows, and onclicking on it only changing the url, not showing the rendered component.

I see on  tag href component is rendering the in new page , loaded succesfully .

but on props.history.push it is not renderign the component ,just changing the url


问:
Can I use a result from recursion for the same recursion?
It's a hard question to paraphrase and a bit of an odd question really. I'm trying to implement a Binary Insertion Sort. I have an array 'a' which contains the values which need to be sorted. Once an individual number is in the right place (found out by the recursion) it returns the array with the sorted number in place and the rest of the array in disarray (haha). This is so that I can focus on the next number in the array to sort. The problem I'm having is that the new improved array isn't being used to call the recursion and each number is being sorted independently in the original completely unsorted array. Is it possible to use the array I've returned in the parameters to call the method with the updated array?

for (int i = 1; i < a.Length; i++)
{
    a = BinaryInsertSort(a, middle, LeftPointer, RightPointer, i);
}
```


问:
Docker Autobuild failing with "[Errno 28] No space left on device"
I am building a docker image which does some object detection on yolov7 and up until recently it has been working perfectly

Then one day I logged into docker hub just to check the status of a build of one of my images and I saw that my builds have all started failing.When I have a look at the logs this is what I get:
ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/tmp/pip-unpacked-wheel-r3egz0yp/torch/lib/libtorch_cuda_cpp.so' -> '/usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cuda_cpp.so'

I can build this exact image just fine locally but the autobuild just does not work.

Any suggestions?

Here is the build log: (I have removed the previous logs as there were no issues up to this point)

```<code>2022-12-14T08:38:58Z #14 [ 8/10] RUN pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
2022-12-14T08:38:59Z #14 1.429 Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113
2022-12-14T08:38:59Z #14 1.701 Collecting torch==1.11.0+cu113
2022-12-14T08:38:59Z #14 1.707 Downloading https://download.pytorch.org/whl/cu113/torch-1.11.0%2Bcu113-cp38-cp38-linux_x86_64.whl (1637.0 MB)
2022-12-14T08:40:08Z #14 70.63 Collecting torchvision==0.12.0+cu113
2022-12-14T08:40:08Z #14 70.65 Downloading https://download.pytorch.org/whl/cu113/torchvision-0.12.0%2Bcu113-cp38-cp38-linux_x86_64.whl (22.3 MB)
2022-12-14T08:40:10Z #14 72.18 Collecting torchaudio==0.11.0
2022-12-14T08:40:10Z #14 72.19 Downloading https://download.pytorch.org/whl/cu113/torchaudio-0.11.0%2Bcu113-cp38-cp38-linux_x86_64.whl (2.9 MB)
2022-12-14T08:40:10Z #14 72.38 Requirement already satisfied: typing-extensions in /usr/local/lib/python3.8/dist-packages (from torch==1.11.0+cu113) (3.10.0.2)
2022-12-14T08:40:10Z #14 72.39 Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from torchvision==0.12.0+cu113) (1.21.2)
2022-12-14T08:40:10Z #14 72.40 Requirement already satisfied: requests in /usr/local/lib/python3.8/dist-packages (from torchvision==0.12.0+cu113) (2.26.0)
2022-12-14T08:40:10Z #14 72.42 Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.8/dist-packages (from torchvision==0.12.0+cu113) (9.2.0)
2022-12-14T08:40:10Z #14 72.44 Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests->torchvision==0.12.0+cu113) (1.26.7)
2022-12-14T08:40:10Z #14 72.46 Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests->torchvision==0.12.0+cu113) (2021.10.8)
2022-12-14T08:40:10Z #14 72.46 Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in /usr/local/lib/python3.8/dist-packages (from requests->torchvision==0.12.0+cu113) (2.0.7)
2022-12-14T08:40:10Z #14 72.47 Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in /usr/local/lib/python3.8/dist-packages (from requests->torchvision==0.12.0+cu113) (3.3)
2022-12-14T08:40:12Z #14 73.91 Installing collected packages: torch, torchvision, torchaudio
2022-12-14T08:40:12Z #14 73.91 Attempting uninstall: torch
2022-12-14T08:40:12Z #14 73.91 Found existing installation: torch 1.13.0
2022-12-14T08:40:18Z #14 79.92 Uninstalling torch-1.13.0:
2022-12-14T08:40:50Z #14 112.3 Successfully uninstalled torch-1.13.0
2022-12-14T08:41:35Z #14 157.6 Rolling back uninstall of torch
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/bin/convert-caffe2-to-onnx
2022-12-14T08:41:35Z #14 157.6 from /tmp/pip-uninstall-21vj9ta9/convert-caffe2-to-onnx
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/bin/convert-onnx-to-caffe2
2022-12-14T08:41:35Z #14 157.6 from /tmp/pip-uninstall-21vj9ta9/convert-onnx-to-caffe2
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/bin/torchrun
2022-12-14T08:41:35Z #14 157.6 from /tmp/pip-uninstall-21vj9ta9/torchrun
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/functorch/
2022-12-14T08:41:35Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~unctorch
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torch-1.13.0.dist-info/
2022-12-14T08:41:35Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orch-1.13.0.dist-info
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torch/
2022-12-14T08:41:35Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orch
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torchgen/
2022-12-14T08:41:35Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orchgen
2022-12-14T08:41:36Z #14 158.1 ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/tmp/pip-unpacked-wheel-bkn_wblz/torch/lib/libtorch_cuda_cpp.so' -> '/usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cuda_cpp.so'
2022-12-14T08:41:36Z #14 158.1
2022-12-14T08:41:36Z #14 ERROR: executor failed running [/bin/sh -c pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113]: exit code: 1
2022-12-14T08:41:36Z ------
2022-12-14T08:41:36Z > [ 8/10] RUN pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113:
2022-12-14T08:41:36Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/functorch/
2022-12-14T08:41:36Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~unctorch
2022-12-14T08:41:36Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torch-1.13.0.dist-info/
2022-12-14T08:41:36Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orch-1.13.0.dist-info
2022-12-14T08:41:36Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torch/
2022-12-14T08:41:36Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orch
2022-12-14T08:41:36Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torchgen/
2022-12-14T08:41:36Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orchgen
2022-12-14T08:41:36Z #14 158.1 ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/tmp/pip-unpacked-wheel-bkn_wblz/torch/lib/libtorch_cuda_cpp.so' -> '/usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cuda_cpp.so'
2022-12-14T08:41:36Z #14 158.1
2022-12-14T08:41:36Z ------
2022-12-14T08:41:36Z ERROR: failed to solve: executor failed running [/bin/sh -c pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113]: exit code: 1
2022-12-14T08:41:36Z Build failed using Buildkit (1)
</code>```

Body:
I am building a docker image which does some object detection on yolov7 and up until recently it has been working perfectly

Then one day I logged into docker hub just to check the status of a build of one of my images and I saw that my builds have all started failing.When I have a look at the logs this is what I get:
ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/tmp/pip-unpacked-wheel-r3egz0yp/torch/lib/libtorch_cuda_cpp.so' -> '/usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cuda_cpp.so'

I can build this exact image just fine locally but the autobuild just does not work.

Any suggestions?

Here is the build log: (I have removed the previous logs as there were no issues up to this point)

2022-12-14T08:38:58Z #14 [ 8/10] RUN pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
2022-12-14T08:38:59Z #14 1.429 Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113
2022-12-14T08:38:59Z #14 1.701 Collecting torch==1.11.0+cu113
2022-12-14T08:38:59Z #14 1.707 Downloading https://download.pytorch.org/whl/cu113/torch-1.11.0%2Bcu113-cp38-cp38-linux_x86_64.whl (1637.0 MB)
2022-12-14T08:40:08Z #14 70.63 Collecting torchvision==0.12.0+cu113
2022-12-14T08:40:08Z #14 70.65 Downloading https://download.pytorch.org/whl/cu113/torchvision-0.12.0%2Bcu113-cp38-cp38-linux_x86_64.whl (22.3 MB)
2022-12-14T08:40:10Z #14 72.18 Collecting torchaudio==0.11.0
2022-12-14T08:40:10Z #14 72.19 Downloading https://download.pytorch.org/whl/cu113/torchaudio-0.11.0%2Bcu113-cp38-cp38-linux_x86_64.whl (2.9 MB)
2022-12-14T08:40:10Z #14 72.38 Requirement already satisfied: typing-extensions in /usr/local/lib/python3.8/dist-packages (from torch==1.11.0+cu113) (3.10.0.2)
2022-12-14T08:40:10Z #14 72.39 Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from torchvision==0.12.0+cu113) (1.21.2)
2022-12-14T08:40:10Z #14 72.40 Requirement already satisfied: requests in /usr/local/lib/python3.8/dist-packages (from torchvision==0.12.0+cu113) (2.26.0)
2022-12-14T08:40:10Z #14 72.42 Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.8/dist-packages (from torchvision==0.12.0+cu113) (9.2.0)
2022-12-14T08:40:10Z #14 72.44 Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests->torchvision==0.12.0+cu113) (1.26.7)
2022-12-14T08:40:10Z #14 72.46 Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests->torchvision==0.12.0+cu113) (2021.10.8)
2022-12-14T08:40:10Z #14 72.46 Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in /usr/local/lib/python3.8/dist-packages (from requests->torchvision==0.12.0+cu113) (2.0.7)
2022-12-14T08:40:10Z #14 72.47 Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in /usr/local/lib/python3.8/dist-packages (from requests->torchvision==0.12.0+cu113) (3.3)
2022-12-14T08:40:12Z #14 73.91 Installing collected packages: torch, torchvision, torchaudio
2022-12-14T08:40:12Z #14 73.91 Attempting uninstall: torch
2022-12-14T08:40:12Z #14 73.91 Found existing installation: torch 1.13.0
2022-12-14T08:40:18Z #14 79.92 Uninstalling torch-1.13.0:
2022-12-14T08:40:50Z #14 112.3 Successfully uninstalled torch-1.13.0
2022-12-14T08:41:35Z #14 157.6 Rolling back uninstall of torch
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/bin/convert-caffe2-to-onnx
2022-12-14T08:41:35Z #14 157.6 from /tmp/pip-uninstall-21vj9ta9/convert-caffe2-to-onnx
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/bin/convert-onnx-to-caffe2
2022-12-14T08:41:35Z #14 157.6 from /tmp/pip-uninstall-21vj9ta9/convert-onnx-to-caffe2
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/bin/torchrun
2022-12-14T08:41:35Z #14 157.6 from /tmp/pip-uninstall-21vj9ta9/torchrun
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/functorch/
2022-12-14T08:41:35Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~unctorch
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torch-1.13.0.dist-info/
2022-12-14T08:41:35Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orch-1.13.0.dist-info
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torch/
2022-12-14T08:41:35Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orch
2022-12-14T08:41:35Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torchgen/
2022-12-14T08:41:35Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orchgen
2022-12-14T08:41:36Z #14 158.1 ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/tmp/pip-unpacked-wheel-bkn_wblz/torch/lib/libtorch_cuda_cpp.so' -> '/usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cuda_cpp.so'
2022-12-14T08:41:36Z #14 158.1
2022-12-14T08:41:36Z #14 ERROR: executor failed running [/bin/sh -c pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113]: exit code: 1
2022-12-14T08:41:36Z ------
2022-12-14T08:41:36Z > [ 8/10] RUN pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113:
2022-12-14T08:41:36Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/functorch/
2022-12-14T08:41:36Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~unctorch
2022-12-14T08:41:36Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torch-1.13.0.dist-info/
2022-12-14T08:41:36Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orch-1.13.0.dist-info
2022-12-14T08:41:36Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torch/
2022-12-14T08:41:36Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orch
2022-12-14T08:41:36Z #14 157.6 Moving to /usr/local/lib/python3.8/dist-packages/torchgen/
2022-12-14T08:41:36Z #14 157.6 from /usr/local/lib/python3.8/dist-packages/~orchgen
2022-12-14T08:41:36Z #14 158.1 ERROR: Could not install packages due to an EnvironmentError: [Errno 28] No space left on device: '/tmp/pip-unpacked-wheel-bkn_wblz/torch/lib/libtorch_cuda_cpp.so' -> '/usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cuda_cpp.so'
2022-12-14T08:41:36Z #14 158.1
2022-12-14T08:41:36Z ------
2022-12-14T08:41:36Z ERROR: failed to solve: executor failed running [/bin/sh -c pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113]: exit code: 1
2022-12-14T08:41:36Z Build failed using Buildkit (1)


问:
Error when standardizing columns in PySpark dataframe
I have a PySpark dataframe, df, of which I want to standardize the two columns col3 and col4.

```<code># columns to standardize
standardize_columns = ['col3', 'col4']

# Merge columns into a vector column.
vector_assembler = VectorAssembler(inputCols=standardize_columns, outputCol="assembler_features")

# Transform vector assembler.
vector_assembler_df = vector_assembler.transform(df)

# Create StandardScaler instance
scaler = StandardScaler(inputCol="assembler_features", outputCol="standardized_features")

# Fit and transform
scaler = scaler.fit(df)
standardized_data = scaler.transform(vector_assembler_df)
</code>```

However, my code throws an error when applying the fit function in the second last line. It gives me the following error:

```<code>org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 101.0 failed 4 times, most recent failure: Lost task 0.3 in stage 101.0 (TID 422) (10.139.64.4 executor driver): org.apache.spark.SparkException: Failed to execute user defined function(VectorAssembler$$Lambda$6644/1923898471: (struct<col3:double,col4_double_VectorAssembler_33699542a9e3:double>) => struct<type:tinyint,size:int,indices:array<int>,values:array<double>>)
</code>```

I'm not sure what the error is about. Initially I thought it might have something to do with size, but PySpark should easily be able to handle a dataframe with 37575 rows and a total of 11 columns.

Body:
I have a PySpark dataframe, df, of which I want to standardize the two columns col3 and col4.

# columns to standardize
standardize_columns = ['col3', 'col4']

# Merge columns into a vector column.
vector_assembler = VectorAssembler(inputCols=standardize_columns, outputCol="assembler_features")

# Transform vector assembler.
vector_assembler_df = vector_assembler.transform(df)

# Create StandardScaler instance
scaler = StandardScaler(inputCol="assembler_features", outputCol="standardized_features")

# Fit and transform
scaler = scaler.fit(df)
standardized_data = scaler.transform(vector_assembler_df)

However, my code throws an error when applying the fit function in the second last line. It gives me the following error:

org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 101.0 failed 4 times, most recent failure: Lost task 0.3 in stage 101.0 (TID 422) (10.139.64.4 executor driver): org.apache.spark.SparkException: Failed to execute user defined function(VectorAssembler$$Lambda$6644/1923898471: (struct<col3:double,col4_double_VectorAssembler_33699542a9e3:double>) => struct<type:tinyint,size:int,indices:array<int>,values:array<double>>)

I'm not sure what the error is about. Initially I thought it might have something to do with size, but PySpark should easily be able to handle a dataframe with 37575 rows and a total of 11 columns.


问:
Laravel mix.copy and mix.copyDirectory files makes mix-manifest super-large
I have a problem with Laravel Mix. Every file touched by mix. copy and mix.copyDirectory gets included in the mix-manifest.json. Because I'm copying many images, the mix-manifest weighs over 1 MB. I want the mix-manifest not to have assets like images, so it only includes JS and CSS files. Is this possible? How to do it?</p>


问:
How to inherit an updated attribute in Python
I'm trying to define two clases, A and B, with B being the child, as in the following code

```<code>class A:

    def __init__(self, att_A=False):
        self.att_A = att_A

    def call_B(self):
        b = B()

class B(A):
    def __init__(self):
        super().__init__()
        print(f'{self.att_A=}')

a = A()
a.att_A = True

a.call_B()
</code>```

B does properly inherit the methods and attributes at the time of definition but I want it to also access the values of self.att_A even when they were updated after being initiated.
Is it possible to do that or is there any workaround, like forwarding the attribute as a method parameter?

I have tried deffining att_A as a class attribute but still B cannot access the updated value

Body:
I'm trying to define two clases, A and B, with B being the child, as in the following code

class A:

    def __init__(self, att_A=False):
        self.att_A = att_A

    def call_B(self):
        b = B()

class B(A):
    def __init__(self):
        super().__init__()
        print(f'{self.att_A=}')

a = A()
a.att_A = True

a.call_B()

B does properly inherit the methods and attributes at the time of definition but I want it to also access the values of self.att_A even when they were updated after being initiated.
Is it possible to do that or is there any workaround, like forwarding the attribute as a method parameter?

I have tried deffining att_A as a class attribute but still B cannot access the updated value


问:
killing multiple processes with electronjs nodejs
Hi I am trying to kill a process but I can not do it. I created a flask server with python and packed it with pyinstaller. When I start my electron app I start the process like this ( and it starts ok):

This is used under app.on('ready'...)

var kill = require('tree-kill');
let child;

function startExecutable() {
    let browseDirectory = process.cwd() + "/api/Tracker.exe"
    child = execFile(browseDirectory)
}
```
<p>This creates 2 processes:</p>
<p><img src="https://i.stack.imgur.com/AqTDR.png" alt="Task manager view" /></p>
<p>I am trying to kill the process on app.on('window-all-closed'...)</p>
<pre class="lang-js prettyprint-override"><code>function stopExecutable() {
    // console.log(child.pid)
    // child.kill('SIGKILL')
    // kill(child.pid, 'SIGTERM');
    kill(child.pid, 'SIGKILL');
}
</code>```

But this only kills PID 8868 and other one keeps running.

I tried using tree-kill, Kill-Process-By-Name packages.

I tried
using child.kill(), child.kill('SIGKILL').

I tried using
spawn(taskkill ['/F', '/IM', 'Tracker.exe', '/T'])

But When I run code the code below on command prompt. It kills all of them

```<code>taskkill /F /IM Tracker.exe /T
</code>```

They all kill only one of the processes. How Do I kill all processes with the same name?

Body:
Hi I am trying to kill a process but I can not do it. I created a flask server with python and packed it with pyinstaller. When I start my electron app I start the process like this ( and it starts ok):

This is used under app.on('ready'...)

var kill = require('tree-kill');
let child;

function startExecutable() {
    let browseDirectory = process.cwd() + "/api/Tracker.exe"
    child = execFile(browseDirectory)
}

This creates 2 processes:

I am trying to kill the process on app.on('window-all-closed'...)

function stopExecutable() {
    // console.log(child.pid)
    // child.kill('SIGKILL')
    // kill(child.pid, 'SIGTERM');
    kill(child.pid, 'SIGKILL');
}

But this only kills PID 8868 and other one keeps running.

I tried using tree-kill, Kill-Process-By-Name packages.

I tried
using child.kill(), child.kill('SIGKILL').

I tried using
spawn(taskkill ['/F', '/IM', 'Tracker.exe', '/T'])

But When I run code the code below on command prompt. It kills all of them

taskkill /F /IM Tracker.exe /T

They all kill only one of the processes. How Do I kill all processes with the same name?


问:
NodeJS Wiston uncaught exception
Using Node 19 and Wiston 3.8.2. Trying to understand the uncaughtExceptions and uncaughtRejections behavior.

Here is my logger.js file:

```<code>const winston = require('winston');

const logger = winston.createLogger({
  level: 'debug',
  format: winston.format.combine(
    winston.format.errors({ stack: true }),
    winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
    winston.format.colorize(),
    winston.format.splat(),
    winston.format.printf(({ timestamp, level, message }) => `${timestamp} - ${level}: ${message}`)
  ),
  transports: [
    new winston.transports.Console({
      handleExceptions: true,
      handleRejections: true
    })
  ],
  exitOnError: false,
});

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

And my app.js file.

```<code>const express = require('express');
const app = express();
const logger = require("logger");

app.get('/dummy', function(req, res, next) {
  res.send("ok")
  const test = require('test')
})

setTimeout(() => {
  throw new Error('OOOOOOPS');
}, 1500);

app.listen(3000);
logger.info('Server is listening on port 3000');

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

If we look at the throw new Error('OOOOOPS') that is working as expected. I see the Winston color, I see it some trace information.

However when I call the /dummy endpoint it seems it's not getting processed.

Example from the throw call.

```<code>2022-12-14 11:57:46 - error: uncaughtException: OOOOOOPS
Error: OOOOOOPS
    at Timeout._onTimeout (/home/...../app.js:xx:9)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)
</code>```

The /dummy endpoint just shows a "normal error".

Title: NodeJS Wiston uncaught exception

Body:
Using Node 19 and Wiston 3.8.2. Trying to understand the uncaughtExceptions and uncaughtRejections behavior.

Here is my logger.js file:

const winston = require('winston');

const logger = winston.createLogger({
  level: 'debug',
  format: winston.format.combine(
    winston.format.errors({ stack: true }),
    winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }),
    winston.format.colorize(),
    winston.format.splat(),
    winston.format.printf(({ timestamp, level, message }) => `${timestamp} - ${level}: ${message}`)
  ),
  transports: [
    new winston.transports.Console({
      handleExceptions: true,
      handleRejections: true
    })
  ],
  exitOnError: false,
});

module.exports = logger;

And my app.js file.

const express = require('express');
const app = express();
const logger = require("logger");

app.get('/dummy', function(req, res, next) {
  res.send("ok")
  const test = require('test')
})

setTimeout(() => {
  throw new Error('OOOOOOPS');
}, 1500);

app.listen(3000);
logger.info('Server is listening on port 3000');

module.exports = app;

If we look at the throw new Error('OOOOOPS') that is working as expected. I see the Winston color, I see it some trace information.

However when I call the /dummy endpoint it seems it's not getting processed.

Example from the throw call.

2022-12-14 11:57:46 - error: uncaughtException: OOOOOOPS
Error: OOOOOOPS
    at Timeout._onTimeout (/home/...../app.js:xx:9)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)

The /dummy endpoint just shows a "normal error".


问:
Update total price through jquery / php Woocommerce
i am trying to change the total price of a order instantly when a user checks the checkmark for signing up to the newsletter.

I have so far managed to make a jquery function that looks for on change and then logs every update.

But i cannot figure out (if its even possible), how to implement a new total price, which should go back up when checkmark is removed.

The code i have so far is

```<code>add_action('wp_footer', 'add_code');
function add_code(){
?>
<script>
jQuery(function($) {
    $(document.body).on("change", "#subscribe_to_newsletter", function () {
      var checked = $(this).prop("checked");

     if (checked) {
         var consoletext = '<?php echo "Virker" ?>';
         console.log(consoletext);
      } else {
        console.log("virker ikke");
      }

    });
  });
</script>

<?php }
</code>```

the page it is on is just a practice page so you can check it here:
https://tobiasbyg.offbeatmedia.dk/kasse/

Body:
i am trying to change the total price of a order instantly when a user checks the checkmark for signing up to the newsletter.

I have so far managed to make a jquery function that looks for on change and then logs every update.

But i cannot figure out (if its even possible), how to implement a new total price, which should go back up when checkmark is removed.

The code i have so far is

add_action('wp_footer', 'add_code');
function add_code(){
?>

<?php }

the page it is on is just a practice page so you can check it here:
https://tobiasbyg.offbeatmedia.dk/kasse/


问:
Line wrap at specific length in QScinitilla
Can we set a line length limit in QScinitilla editor so that after crossing this limit text will be moved to next line?

Scintilla's documentations  explains the line wrap at Window width and not after specific length.

Checked on Scintilla's documentations and I was expecting it will have a method to set the line limit.