Change the unix_time function to return libc::time_t instead of a hard-coded i64

Change the unix_time function to return libc::time_t instead of a hard-coded i64.
This PR attempts to fix the following error when compiling to the armv7 platform.
cargo build --target armv7-unknown-linux-gnueabihf
   Compiling str0m v0.5.1 (/home/magine/str0m)
error[E0308]: mismatched types
   --> src/crypto/ossl/cert.rs:50:42
    |
50  |         let before = Asn1Time::from_unix(unix_time() - 3600)?;
    |                      ------------------- ^^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
    |                      |
    |                      arguments to this function are incorrect
    |
note: associated function defined here
   --> /home/magine/.cargo/registry/src/index.crates.io-6f17d22bba15001f/openssl-0.10.59/src/asn1.rs:330:12
    |
330 |     pub fn from_unix(time: time_t) -> Result<Asn1Time, ErrorStack> {
    |            ^^^^^^^^^
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
    |
50  |         let before = Asn1Time::from_unix((unix_time() - 3600).try_into().unwrap())?;
    |                                          +                  +++++++++++++++++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `str0m` (lib) due to 1 previous error

Hi @Ma233! Welcome to str0m.
If I understand this correctly. This happens because the target platform is a 32-bit one?

@k0nserv @davibe thoughts on this?
Seems using libc::time_t is the only way to ensure compatibility for this call :/
I'm a bit reluctant to introduce a direct dep on libc (juggling more locked versions), but it might not be possible to avoid it.
https://docs.rs/libc/latest/src/libc/unix/linux_like/linux/gnu/b64/mod.rs.html#17-27

I was about to suggest what you did in #534 so it seems we are aligned. This will open us up to the y2k38 problem though. It's still 14 years away though, maybe by then all 32 bit targets are gone.

The heuristics for deciding whether a platform uses a 32- or 64-bit time_t appears to be more complicated than determining whether it's a 32-bit target. There could be 32 bit libc platforms out therer that still use a 64 bit time_t (or vice versa, but that seems more awkward).
I think the only way to ensure we get the right value is to expose libc like this. I don't like it, but it is what it is.

Alright. I think we should merge this.


Change Jack-O abbreviation to 'JC'

The abbreviation 'JA' is used for Jam on dustloop, with 'JC' being used for Jack-O even in GGST.
The abbreviations used in this website should probably follow the precedence set by dustloop.

Actually, it's probably just fine as is.


Error: The fulfiller does not have the balances needed to fulfill.

I'm trying to make a simple buy transaction in frontend:
hers is the code block:
` const res = await rarible.apis.order.getSellOrdersByItem({
itemId: 'ETHEREUM:0x79fcdef22feed20eddacbb2587640e45491b757f:964',
status: (['ACTIVE'] as [OrderStatus.OrderStatus.ACTIVE])
})
const tx = await rarible.order.buy({
  orderId: res.orders[0].id,
  amount: 1,
})

await tx.wait()`

It means is not enough funds on your wallet (on mainnet)

@ex1st0r thanks for the answer.


End-to-end tests don't clean up scans when run individually

If you run a single e2e test that produces a scan using the -testRegex flag (introduced in PR #227), you'll notice that the scan created by the test isn't cleaned up.
This causes issues when you try and run the same test twice.
Here's what I did to reproduce:
$ E2E_SKIP_CLEANUP_ON_ERROR=false E2E_GO_TEST_FLAGS="-v -testRegex TestScanProducesRemediations" make e2e

Which leaves the following scan after the test completes:
NAMESPACE                                       NAME                                                                     PHASE   RESULT
osdk-e2e-3ae56ab8-d508-4146-846d-bf28fc751e91   compliancescan.compliance.openshift.io/test-scan-produces-remediations   DONE    NON-COMPLIANT

Running the test test again fails because the test times out (the scan setting binding doesn't process).

Looking at the namespace, it appears the scan finalizer tripped:
- lastTransitionTime: "2023-02-23T19:53:57Z"
    message: 'Some content in the namespace has finalizers remaining: scan.finalizers.compliance.openshift.io
      in 1 resource instances, suite.finalizers.compliance.openshift.io in 1 resource
      instances'
    reason: SomeFinalizersRemain
    status: "True"
    type: NamespaceFinalizersRemaining
  phase: Terminating

Also noticed that if a test fails, the cluster role bindings are not cleaned up.
Is this intentional?

I know the tests do clean up the SSB, but I wonder if the tests are cleaning up the rest of the environment/CRDs before the scan and suite get deleted.

Added some debugging to the e2e suite that might help us track down what's going on.
https://github.com/ComplianceAsCode/compliance-operator/pull/246


Fix sentinel getClientFor cannot use index

In version 1.1.1
$client = new Predis\Client([
    'tcp://<IP_ADDRESS>:26379',
    'tcp://<IP_ADDRESS>:26380',
    'tcp://<IP_ADDRESS>:26381',
], [
    'replication' => 'sentinel',
    'service' => 'redis_service',
]);

$slave1 = $client->getClientFor(0);

Throw 'InvalidArgumentException' with message 'Invalid connection ID: 0.'

Hmm why would you want to get a connection by index in this context?


[Lake] Implemented some TabletManager interfaces

What type of PR is this：

[ ] bug
[X] feature
[ ] enhancement
[ ] refactor
[ ] others

Which issues of this PR fixes ：

Fixes #
Problem Summary(Required) ：

LGTM @wyb PTAL

run starrocks_be_unittest


Remove public facing support for legacy istio.io/api/routing/v1alpha1

Remove support for the legacy routing APIs: RouteRule, EgressRule,
IngressRule, and DestinationPolicy

Remove CRD registration
Remove webhook validation configuration and corresponding tests
Remove istioctl support and fix unit tests

There's still quite a bit of unused / deadcode in Pilot that still
uses the legacy config that needs to be deleted. This is almost
entirely in a few unit tests and validation code which isn't invoked
at runtime by Pilot.
There's also still quite a bit of sample yamls that need to be cleaned up
under samples/bookinfo.

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: ayj
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: costinm
Assign the PR to them by writing /assign @costinm in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

galley/OWNERS [ayj]
install/OWNERS
istioctl/OWNERS [ayj]
pilot/OWNERS [ayj]
tests/e2e/tests/galley/OWNERS [ayj]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ayj: PR needs rebase.

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ayj: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/istio-unit-tests.sh
1924cae11b11a4854f5b31f8767d75869ab2af88
link
/test istio-unit-tests

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ayj: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/istio-unit-tests.sh
1924cae11b11a4854f5b31f8767d75869ab2af88
link
/test istio-unit-tests

prow/istio-presubmit.sh
1924cae11b11a4854f5b31f8767d75869ab2af88
link
/test istio-presubmit

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.


Create diagrams

Description
A few diagrams will go a long way to show anyone the structural make-up of our project and provide clarity using standardised formats like class and component diagrams.

godspeed


JS example: fix "do work" loop

Originally posted by @blumamir in https://github.com/open-telemetry/opentelemetry.io/pull/1230#discussion_r838522784:

not related to this PR which fixes typos, but the line Math.floor(Math.random() * 40000000) will be re-evaluated again and again for each iteration which is probably not what was intended

Note that there are multiple instances of that code in the page.

I feel like we can just close this one. It's super low priority and just illustrative.


agentkeepalive on https?

It looks like agentkeepalive is not used on HTTPS requests - this might be a relic from the past, when there was not support for HTTPS clients in agentkeepalive.
https://github.com/mapbox/geojson-mapnikify/blob/d40a0b4844e654a623b1211da787071153952ee6/lib/get.js#L58-L59
This is just something I noticed when reviewing a recent PR, and therefore created this separate issue about it.
@DzmitryU @springmeyer

Fixed in #42


More reliable 'git fetch' for LocalCacheStrategy

Allows the git fetch to happen for builds where no branch was given
Somewhat related to https://github.com/square/kochiku/issues/153

:+1:


Scalenode terrain

Because the gradient approach is hard to deal with and slow in its implementation, have an alternative to use lerping instead.

I think the main thing missing is documentation, but plz @StraToN check this out. I wrote it in my typical deadline-induced panic so there might be problems I just don't see.
At least our player moves smoothly and it should perform at least twice as good as the gradient scalemap thing.

Force-pushed removal of debug print

I had developed a similar approach in my pre-Escoria demo, so I definitely agree with the principle. It simply misses documentation, other than that it's cool, thanks!

Thanks @StraToN ! I'm merging now with some documentation, so it doesn't get in the way of the next big thing :)


Use your model to genereate PET by MRI

I use your model ,train paired MRI-PET nii data, but  get an extremely bad output! I want to know why and how to deal with it.
training_log.csv

Hi, can you show some visual examples so we can see what is going on in the generated PET?

I have found some issue , because of the limit of my GPU memory, the img_size only can only set very small such as (64,64,4); or (24,24,24) and with batch_size only 2; Obviously, it will lead to the final image quality very bad;

Look!This is obviously 64 64 4 ,and it is blurry because the pixel resolution is too low.

Good to know. Don't forget the patch_size (not the img_size) is there for you to adjust, which can help to avoid GPU memory issue. Try using maybe the patch_size = (256,256,4) or something similar.

Hi !

I can not get the patch_size how to adjust? I can only see this relevant parameter!

Ah just commit a new version to the jupter notebook, in the second block:

The thing is

I auto pad or crop all images to a same size img_size, then random crop several patch of patch_size for training. In testing, the generated image will also automatically slide from top to bottom, form left to right through the whole image volume.

Hi  you only modify these two parts? patch_size and transform ?; I don't know how to fix it? By the way the input data of mine is 646464;

Traceback (most recent call last):
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 509, in
train(A_to_B_model, optimizer,train_loader1, train_loss_history)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 343, in train
for i, (x1,y1) in enumerate(data_loader1):
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 216, in getitem
img[i,:,:,:] = after_l['image']
ValueError: could not broadcast input array from shape (64,64,4) into shape (256,256,128)

Oh I think maybe the commit need some time? Try it again. I check the code should have no problem. Just put the 64x64x64 to img_size, and the patch_size you want to the patch_size (make it as large as your gpu can handle). Btw, PET with size of 64x64x64? Looks too low haha.

I don't know why can lead to this issue ? Yes, I get the data PET with size 646464 and in the past this MRI-PET data have get some paper output

can you send me screenshot for this part?

`    def len(self):
return len(self.data)
def __getitem__(self, idx):

    img_path, class_name = self.data[idx]
    label_path, class_name = self.label[idx]
    cao = {"image":img_path,'label':label_path}

    if not self.train_flag:
        affined_data_dict = self.test_transforms(cao)
        img_tensor = affined_data_dict['image'].to(torch.float)
        label_tensor = affined_data_dict['label'].to(torch.float)
    else:
        affined_data_dict = self.train_transforms(cao)
        img = np.zeros([patch_num, img_size[0], img_size[1], img_size[2]])
        label = np.zeros([patch_num, img_size[0], img_size[1], img_size[2]])
        for i,after_l in enumerate(affined_data_dict):
            img[i,:,:,:] = after_l['image']
            label[i,:,:,:] = after_l['label']
        img_tensor = torch.unsqueeze(torch.from_numpy(img.copy()), 1).to(torch.float)
        label_tensor = torch.unsqueeze(torch.from_numpy(label.copy()), 1).to(torch.float)

    return img_tensor,label_tensor`

and by the way the input data of mine is nii

Well you see my version and your version is different in the nii reader

Ok! I see it and fix it and now it run successfully  in training phase but in the evaluation phase:
Traceback (most recent call last):
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 517, in
average_loss,average_mae,average_psnr,average_ssim,average_ncc = evaluate(A_to_B_model,epoch,path,test_loader1,best_loss)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 429, in evaluate
sampled_images = inferer(condition,diffusion_sampling,model)
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/monai/inferers/inferer.py", line 202, in call
return sliding_window_inference(
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/monai/inferers/utils.py", line 185, in sliding_window_inference
seg_prob_out = predictor(window_data, *args, **kwargs)  # batched patch segmentation
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 406, in diffusion_sampling
sampled_images = diffusion.p_sample_loop(model,(condition.shape[0], 1,
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/GaussianDiffusion.py", line 533, in p_sample_loop
for sample in self.p_sample_loop_progressive(
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/GaussianDiffusion.py", line 586, in p_sample_loop_progressive
out = self.p_sample(
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/GaussianDiffusion.py", line 481, in p_sample
out = self.p_mean_variance(
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/respace.py", line 92, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/GaussianDiffusion.py", line 322, in p_mean_variance
model_output = model(x_input, self._scale_timesteps(t), **model_kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/respace.py", line 123, in call
return self.model(x, new_ts, **kwargs)
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/Diffusion_model_transformer.py", line 598, in forward
h = module(h, emb)
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/Diffusion_model_transformer.py", line 44, in forward
x = layer(x, emb)
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/Diffusion_model_transformer.py", line 251, in forward
return checkpoint(
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/util_network.py", line 138, in checkpoint
return func(*inputs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/Diffusion_model_transformer.py", line 274, in _forward
h = blk(h)
File "/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/nnFormer.py", line 350, in forward
assert L == S * H * W, "input feature has wrong size"
AssertionError: input feature has wrong size
I can deal with this issue!

I can figure out training phase is correct but the evalution phase is something wrong:
发生异常: AssertionError
input feature has wrong size
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/nnFormer.py", line 350, in forward
assert L == S * H * W, "input feature has wrong size"
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/Diffusion_model_transformer.py", line 274, in _forward
h = blk(h)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/util_network.py", line 138, in checkpoint
return func(*inputs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/Diffusion_model_transformer.py", line 251, in forward
return checkpoint(
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/Diffusion_model_transformer.py", line 44, in forward
x = layer(x, emb)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/network/Diffusion_model_transformer.py", line 598, in forward
h = module(h, emb)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/respace.py", line 123, in call
return self.model(x, new_ts, **kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/GaussianDiffusion.py", line 322, in p_mean_variance
model_output = model(x_input, self._scale_timesteps(t), **model_kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/respace.py", line 92, in p_mean_variance
return super().p_mean_variance(self._wrap_model(model), *args, **kwargs)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/GaussianDiffusion.py", line 481, in p_sample
out = self.p_mean_variance(
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/GaussianDiffusion.py", line 586, in p_sample_loop_progressive
out = self.p_sample(
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/diffusion/GaussianDiffusion.py", line 533, in p_sample_loop
for sample in self.p_sample_loop_progressive(
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 406, in diffusion_sampling
sampled_images = diffusion.p_sample_loop(model,(condition.shape[0], 1,
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 429, in evaluate
sampled_images = inferer(condition,diffusion_sampling,model)
File "/root/commonfiles/Maoeyu/MRI-PET-diffu/main.py", line 517, in
average_loss,average_mae,average_psnr,average_ssim,average_ncc = evaluate(A_to_B_model,epoch,path,test_loader1,best_loss)
AssertionError: input feature has wrong size

Weird, this error occurs when your input image size (patch_size) is not large enough. But if you are good in training, you should be also good in testing. Can you try patch_size = (64x64x8)?

Ok I try it!

Oh no! 64648 and batch_size is 2 is out of CUDA memory . Is there any other option?

so you are good in 64x64x8? Then I suggest you use batch=1, so you can also try patch_size = (32x32x8)

Ok I am tring !

Oh no it still has something wrong!

I know what happen. The network is too deep to downsample the input into non-dividible features. In the building network block in the jupyter, try:
num_channels=64
attention_resolutions="16,8"
channel_mult = (1, 2, 3)
num_heads=[4,4,8]
window_size = [[4,4,4],[4,4,4],[4,4,2]]
num_res_blocks = [2,2,2]
sample_kernel=([2,2,2],[2,2,1],[2,2,1]),
Here I reduce the network depth from 4 to 3. Try this with 32x32x4 patch size. When you have larger gpu, increase the depth again.

It is sad!

I have reduce the network depth from 4 to 3 .

Maybe if you have time and I send my code and part of data to you!

how about try this one? Let's do one last try.
num_channels=64
attention_resolutions="16,8"
channel_mult = (1, 2, 3)
num_heads=[4,4,8]
window_size = [[4,4,4],[4,4,4],[4,4,2]]
num_res_blocks = [2,2,2]
sample_kernel=([1,1,1],[2,2,1],[2,2,1]),

Oh it is still failed.

Let me do it tomorrow haha. I wil make one for the patch size = 32x32x8. Btw, have you try batch_size= 1 for 64x64x8？

When i use batch_size =1 and 64648 ; it ouccrs a new wrong situation:

x1 y1 is the output of my debugging phase . I can not figure out why they have the different dimension.

I see. The error tells your network output is 1x1x84x102x84 (I think because your MRI has the same size), but your truth PET image is 1x1x91x102x91, so cannot calculate the mae. That should be data error.
Another thing, I suggest you need to start this code in your reader:

To make sure your image is some consistency size and should be divided by 2^4 (since you have four layers)
But be careful, the above error may tells you, you have different voxel spacing for your MRI and PET. This is not good. You should make them into same spacing then pad/crop them.

Yes, it may need some time to run and whether I can get your telegram or X account to commnuicate detailly.

Since I start the ResizeWithPadCropd, the phase is holding on

but the gpu memory is full. It is normal?

It is still on holding GPU. I want to ask this ResizeWithPadOrCropd is suited for train or test or both?

You should use this resize function in both training and testing. Well it is normal to have GPU in full. Is it still running and showing loss and evaluation mae with different epochs?

Ok! It is still running but only set in the epoch 0;

you mean it is still in epoch 0 and still evaluating?

Yes;
/root/userfolder/tonggan/anaconda3/envs/Xiong_poj/lib/python3.8/site-packages/torch/nn/functional.py:3657: UserWarning: The default behavior for interpolate/upsample with float scale_factor changed in 1.6.0 to align with other frameworks/libraries, and now uses scale_factor directly, instead of relying on the computed output size. If you wish to restore the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details.
warnings.warn(
optimization time: 5.730208873748779
[    0/  147 (  0%)]  A_to_B_Loss: 1.0015516
optimization time: 0.9895610809326172
[   30/  147 ( 20%)]  A_to_B_Loss: 1.5312134
optimization time: 1.0017342567443848
[   60/  147 ( 41%)]  A_to_B_Loss: 1.2967397
optimization time: 1.0088763236999512
[   90/  147 ( 61%)]  A_to_B_Loss: 1.0642425
optimization time: 1.0104715824127197
[  120/  147 ( 82%)]  A_to_B_Loss: 0.9033197
Total time per sample is:<PHONE_NUMBER>6718445
Averaged loss is: 0.7906994
Execution time: 169.63 seconds
This code has run nearly 4 hours with GPU full.

can you try commemt out the training, run the evaluation using the untrained ddpm? Just need to comfirm it is working.

Ok I will try it. It's already late at night in China. I'll tell you about the test tomorrow morning.

不幸的是，我将训练部分注释，直接显存爆掉了；
相关的参数设置以及evaluation部分代码为：
`
def evaluate(model,epoch,path,data_loader1,best_loss):
model.eval()
prediction = []
true = []
img = []
loss_all = []
mae_all = []
psnr_all = []
ssim_all = []
ncc_all = []
aa = time.time()
with torch.no_grad():
for i, (x1,y1) in enumerate(data_loader1):
            target = y1.to(device)
            condition = x1.to(device)
            with torch.cuda.amp.autocast():
                  sampled_images = inferer(condition,diffusion_sampling,model)
            #x1 [1 1 84 102 84]
            #y1 [1 1 91 108 91]
            #sampled_images : [1 1 84 102 84]
            #target : [1 1 91 108 91]
            loss = metric(sampled_images,target)
            # print('L1 loss: '+ str(loss))
            img.append(x1.cpu().numpy())
            true.append(target.cpu().numpy())
            prediction.append(sampled_images.cpu().numpy())
            loss_all.append(loss.cpu().numpy())

            mae = compute_mae(true[-1],prediction[-1])
            psnr = compute_psnr(true[-1],prediction[-1])
            ssim = compute_ssim(true[-1],prediction[-1])
            ncc = compute_ncc(true[-1],prediction[-1])

            mae_all.append(mae)
            psnr_all.append(psnr)
            ssim_all.append(ssim)
            ncc_all.append(ncc)

    print('optimization time: '+ str(1*(time.time()-aa)))
    # The save code, you can replace it by your code for other files, e.g. nii or dicom
    data = {"img":img,
            'label':true,
            'prediction':prediction,
            'loss':np.mean(loss_all),
            'mae':np.mean(mae_all),
            'psnr':np.mean(psnr_all),
            'ssim':np.mean(ssim_all),
            'ncc':np.mean(ncc_all)
            }
    scipy.io.savemat(path+ 'test_example_epoch'+str(epoch)+'.mat',data)
    if np.mean(loss_all) < best_loss:
        scipy.io.savemat(path+ 'all_final_test_another.mat',data)
    return np.mean(loss_all),np.mean(mae_all), np.mean(psnr_all), np.mean(ssim_all), np.mean(ncc_all)

    num_channels=64

attention_resolutions="16,8"
channel_mult = (1, 2, 3)
num_heads=[4,4,8]
window_size = [[4,4,4],[4,4,4],[4,4,2]]
num_res_blocks = [2,2,2]
sample_kernel=([1,1,1],[2,2,1],[2,2,1]),
sample_kernel=([2,2,2],[2,2,1],[2,2,1]),
BATCH_SIZE_TRAIN = 1*1
img_size = (128,128,128)
patch_size = (64,64,8)
spacing = (2,2,2)
patch_num = 2
channels = 1
metric = torch.nn.L1Loss()
`

我觉得是evaluation存在问题 一直占用但是 并不运行。

Ok, I will try it!

Yes, the target shape is as you see. But the code is still running.

OK. The reader is correct. Then let's move to the next step:

Comment out this line, unindent the next line. print('aaaaaaaaaaaaa') below the line "sampled_image =......"

Yes,It seems that run smoothly.

OK. Now make your testing dataset only have 1 MRI and 1 PET. Run the whole evaluation.

ok So, it is just too slow?

Haha yes. I can see your network run 147 data for one timestep is 171 seconds. Lets say about 1 second for one patient one timestep, each patch needs 50 timestep. If one patient has size of 128x128x128, then we have 2x2x32 patchs (if patch size 64x64x4), so each patient should need about 2 hour maybe. It looks your first patient is small so only takes 500 seconds.

You have to make 70:10:20 for training, testing and validation, in terms of writing paper. Even worse in clinical journals, you may need to do five-fold cross validation otherwise no one trust you. Unless you are very good at clinical application, you can manually select some few very clinical meaningfull patients for testing then you can use all the rest for training......

Ok, Thank your for detailed explaination.


Server Tick Loop upon World Creation

crash-2021-08-19_13.16.20-server.txt

Hello,
Thank you for the report. Unfortunately I am away from my workspace at the moment, but I will be happy to look into this once I return.
In the meantime, disabling the villager trading feature in the config should prevent more crashes.
Hope your day has otherwise been pleasant.

Hello again,
I've investigated this issue and after experimenting under various circumstances I have been unable to replicate it with only the Wily Textiles mod installed. I did, however, find a (probably) unrelated bug and have provided a fix in version 0.1.2.
While I believe the cause of your crash to be some kind of mod conflict, please test again with the new version once it is available from CurseForge and advise me of the result.
In the likely case that the new version does not resolve your issue, I would appreciate any other information you have to share about the crash (frequency, possible suspects, etc.) as your mod list is quite long and it will otherwise be quite the undertaking to work through it myself.

Closing this issue for now, under the assumption that no news is good news. If the issue recurs, feel free to reply here again or open another issue.


Weird error message on duplicate

Trying to create a prefix that already exists usually results in the following:
>>> p2.save()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/pynipap.py", line 1076, in save
    raise _fault_to_exception(xml_fault)
pynipap.NipapDuplicateError: Duplicate value for 'prefix', the value '0, <IP_ADDRESS>/24' is already in use.

In the above example I tried to create <IP_ADDRESS>/24 as an assignment but that prefix already exists, as a reservation. If I now add  <IP_ADDRESS>/32 as an assignment and then try to create <IP_ADDRESS>/24 again (as assignment) I will get:
>>> p2.save()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/pynipap.py", line 1076, in save
    raise _fault_to_exception(xml_fault)
pynipap.NipapValueError: Prefix of type 'assignment' must not have any subnets other than of type 'host'

So it seems the check for what children a prefix contains comes first.. but it shouldn't. We should always give the duplicate message when there is a duplicate.

It totally makes sense that the checks in the trigger runs before the unique check. Since we have the ability to modify the value in the before trigger PostgreSQL couldn't possibly check against the unique index before the trigger.
I don't quite like adding another SQL SELECT just to see whether a prefix already exists but I suppose I don't have much choice if I want to have a prettier message.


Validation problems using additional elemets in the XML file

Hi,
we are using more elements than the basic shema. This leads to a validation error when we add the XML into the PDF/A document. We were able to validate our file with online validation tool.
{info:2024-10-09 14:12:42,807 [INFO] Flavor is factur-x (autodetected)\n2024-10-09 14:12:42,807 [INFO] Level is basic (autodetected)\n2024-10-09 14:12:42,810 [ERROR] The XML file is invalid against the XML Schema Definition\n2024-10-09 14:12:42,810 [ERROR] XSD Error: Element '{urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}SellerAssignedID': This element is not expected. Expected is ( {urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}Name )., line 1\n2024-10-09 14:12:42,810 [ERROR] factur-x lib call failed. Error: The Factur-x XML file is not valid against the official XML Schema Definition. Here is the error, which may give you an idea on the cause of the problem: Element '{urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}SellerAssignedID': This element is not expected. Expected is ( {urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100}Name )., line 1.\n,success:false...
Is there a way to add the XML without the validation? If not, how can we adjust the shema that controls the xml structure?
Here the sample data from our XML. In the "SpecifiedTradeProduct" block we use the elements "SellerAssignedID" and "Description" to store specific information that is important for the invoice.
ram:SpecifiedTradeProduct
<ram:GlobalID schemeID="0160">04012345123456</ram:GlobalID>
ram:SellerAssignedIDTest•</ram:SellerAssignedID>
ram:NameGlasgewebe 5 g/m² (FE 800, LW) 127 cm, Hallo</ram:Name>
ram:DescriptionPZN: 16036968</ram:Description>
</ram:SpecifiedTradeProduct>
This would allow the recepient to use the date more easy. In the "BASIC_einfach" example the "Unsere Art.-Nr." information si coded into the "name" element together with additional date.
ram:SpecifiedTradeProduct
<ram:GlobalID schemeID="0160">4012345001235</ram:GlobalID>
    <ram:Name>GTIN:<PHONE_NUMBER>235

Unsere Art.-Nr.: TB100A4
Trennblätter A4
</ram:Name>
</ram:SpecifiedTradeProduct>

the plugin code is not very adaptable, I was learning while coding.
you can probably see from the messy source code.

Is there a way to add the XML without the validation? If not, how can we adjust the shema that controls the xml structure?

I need to study your case but it might require significant rewriting of the plugin.
the plugin currently can't do more that what is done in the sample project.

I would appreciate if you could share your XML with me at<EMAIL_ADDRESS>


Fix issues reported by Snyk

Oh I think we need to update the regex for the EC version

/retest

The checks pass now, the issue was that the task variable was redefined within image.go, so when I changed all references to task.Name() to taskName the new value was lost. SAST Snyk task now reports success. Going to merge this now.


get contact details of profile

is it possible to get the contact details if the profile provides them? I noticed getProfile doesn't include the users contact details (email, website, etc)

So I explored this request, it's quite straightforward to implement.
We will need to add an extra method within profile.repository.ts:
getContactInfo({ publicIndentifier }): ({ publicIdentifier }: { publicIdentifier: string })
The method will request the following URL: identity/profiles/<publicIdentifier>/profileContactInfo
where publicIdentifier is the parameter.
@PMLS3
What do you think? Do you want to contribute to this one? I'm here to walk you through of course.

@eilonmore Ill be happy to help!

Is this feature added? can we fetch contact details?

@ItzmeSwapy
I'm currently training a new maintainer that will take this soon.

@eilonmore but you are sure that we can access anyone's email using this?


Minor refactoring of pre-caching plugin

Refactor pre-caching plugin to conform with Handler pattern used by the Backup&Restore and ExtraManifests plugins.
/cc @pixelsoccupied @jc-rh

/lgtm

/assign @jc-rh

/lgtm

We have this in main.go https://github.com/openshift-kni/lifecycle-agent/pull/90/files#diff-327181d0a8c5e6b164561d7910f4eeffd41442d55b2a2788fda2aa2692f17ec0R114
Is it possible to use logrus here?

@sudomakeinstall2 - it would be better to change logging for all plugins in a separate PR. The objective behind the current PR is to refactor the pre-caching plugin to conform with the Handler patter used by both B&R and EM plugins.

/retest


[Enhancement]: Should be more elegant to handle exceptions

Is there an existing issue for this?

[X] I have searched the existing issues

What would you like to be added?
This is not user friendly.
Downloading: "https://download.pytorch.org/models/resnet50-0676ba61.pth" to /Users/ryjiang/.cache/torch/hub/checkpoints/resnet50-0676ba61.pth
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 97.8M/97.8M [00:05<00:00, 18.1MB/s]
Traceback (most recent call last):
  File "index.py", line 9, in <module>
    output = embedding_pipeline('towhee_logo.png')
  File "/usr/local/lib/python3.7/site-packages/towhee/__init__.py", line 73, in __call__
    out_df = self._pipeline(in_df)
  File "/usr/local/lib/python3.7/site-packages/towhee/engine/pipeline.py", line 91, in __call__
    return graph_ctx.result()
  File "/usr/local/lib/python3.7/site-packages/towhee/engine/graph_context.py", line 75, in result
    raise RuntimeError(op.err_msg)
RuntimeError: preprocessing:0 runs failed, error msg: [Errno 2] No such file or directory: 'towhee_logo.png'

Why is this needed?

Prevents program from crashing if an error occurs
Better error message could save a lot of time for developers to debug

Anything else?
No response

Potential duplicate: #336


FIX: dev/build not flushing manifests if site is in a subfolder

For example: http://localhost/silverstripe/dev/build would result in $requestURL being silverstripe/dev/build, but BASE_URL . '/dev/build' would be /silverstripe/dev/build (note leading slash).

Is this unit-testable?

Not sure, I have no idea how you’d approach testing something like this!

Bump :)

On sites not in a subdir, wouldn't the BASE_URL be an empty string? if so, the 2nd of the 3 conditions is redundant, no?

@dhensby Good spot, I’ve removed that redundant check now

Ok, have you tested this manually to ensure it works as expected?

I do find this quite a hacky solution, don't the other dev functions need this kind of fix too?

Yep, I’ve tested both in and not in a subdirectory, with and without trailing slashes and it works as expected.
It does feel hacky, but I’m just trying to fix a regression from #3677 rather than refactor anything :)

agreed


Bump the compiler version to v2023.5.1

Description
Bump the compiler version to v2023.5.1.
Part of inmanta/inmanta-service-orchestrator#466
Self Check:

[x] Attached issue to pull request
[x] Changelog entry
[ ] Type annotations are present
[ ] Code is clear and sufficiently documented
[ ] No (preventable) type errors (check using make mypy or make mypy-diff)
[ ] Sufficient test cases (reproduces the bug/tests the requested feature)
[ ] Correct, in line with design
[ ] End user documentation is included or an issue is created for end-user documentation
[ ] If this PR fixes a race condition in the test suite, also push the fix to the relevant stable branche(s) (see test-fixes for more info)

Processing this pull request

Merged into branches iso6 in dc16824cb0818eb787b930b925f221f314eb896c


packaging haven-and-hearth

Though it doesn't even work :D This PR is more like a reminder for me than anything working…


demo.yaml

there is no demo.yaml file in this repo.
could you check it again please?
is it okay to use eval.yaml for the inference job?

plus, could you provide the training yamls for the panoptic segmentation task?
it seems the yamls for the traing panoptic seg are missing in the repo.
thanks in advance!


How to properly gather results of PartialState for inference on 4xGPUs

System Info
torch==2.2.0
transformers==4.37.2
accelerate==0.27.0

Information

[X] The official example scripts
[X] My own modified scripts

Tasks

[ ] One of the scripts in the examples/ folder of Accelerate or an officially supported no_trainer script in the examples folder of the transformers repo (such as run_no_trainer_glue.py)
[X] My own task or dataset (give details below)

Reproduction
Hi, my question may look like stupid but I want to ask for clarification, because I didn't find it in documentation
I have 2 million documents to process with ner model. And also I have 4 GPU. I don't wanna write script with multiprocess and manually handle each gpu. I decided to try use accelerate.
# Assume there are two processes
from accelerate import PartialState
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

model = AutoModelForTokenClassification.from_pretrained('ner')
tokenizer = AutoTokenizer.from_pretrained('ner')

ner = pipeline('token-classification', model=model, tokenizer=tokenizer, aggregation_strategy="simple")

state = PartialState()
ner.to(state)

# here the list of the list,  I wanna treat like a list of batches
data = [[{'text': 'text1', 'id': 1}, {'text': 'text2', 'id': 2}], [{'text': 'text3', 'id': 3}, {'text': 'text4', 'id': 4}] ]

results = []
with state.split_between_processes(data) as inputs:
    output = ner([i['text'] for i in inputs], max_length=128)

    for i, o in zip(inputs, outputs):
        i['annotation'] = o
        results.append(i)

And my question is: Am I properly gather results or it could be problems because its distributed between different process.
How to properly gather results when use split_between_processes?
Expected behavior
Documentation will have more examples how to gather data.

Use accelerator.utils.gather. We definitely could add this to the docs.

@muellerzr can you give me the example how to use accelerator.utils.gather with split_between_processes context manager?

Something like so:
# Assume there are two processes
from accelerate import PartialState
from accelerate.utils import gather
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

model = AutoModelForTokenClassification.from_pretrained('ner')
tokenizer = AutoTokenizer.from_pretrained('ner')

ner = pipeline('token-classification', model=model, tokenizer=tokenizer, aggregation_strategy="simple")

state = PartialState()
ner.to(state)

# here the list of the list,  I wanna treat like a list of batches
data = [[{'text': 'text1', 'id': 1}, {'text': 'text2', 'id': 2}], [{'text': 'text3', 'id': 3}, {'text': 'text4', 'id': 4}] ]

results = []
with state.split_between_processes(data) as inputs:
    output = ner([i['text'] for i in inputs], max_length=128)

    for i, o in zip(inputs, outputs):
        i['annotation'] = o
        results.append(i)
results = gather(results)
print(results)

Thank you!

@muellerzr  What I should pass into gather? Because I get the error:
TypeError: Unsupported types (<class 'int'>) passed to `_gpu_gather_one`. Only nested list/tuple/dicts of objects that are valid for `is_torch_tensor` should be passed.

They should be tensors, ideally. Otherwise use the gather_object function instead

@muellerzr thanks for your support. Here is my complete script, which also includes progress bar. It works on 4 GPUs.
I think you can use this to improve documentation, or you could direct me to where I can contribute to it, I would be glad to help.
import json
import math

from accelerate import PartialState
from accelerate.utils import gather_object
from tqdm import tqdm
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
from transformers.pipelines.pt_utils import KeyDataset

model = AutoModelForTokenClassification.from_pretrained('models/ner')
tokenizer = AutoTokenizer.from_pretrained('models/ner')

batch_size = 1024

# Create a PartialState object to manage the distributed execution
state = PartialState()

# Create the instance of pipeline and move it to the correct device
ner = pipeline('token-classification',
               model=model,
               tokenizer=tokenizer,
               device=state.device,
               aggregation_strategy="simple",
               batch_size=batch_size)

# here the list of the dicts [{'id': 1, 'title': 'some title'}, ...] is loaded from the file
with open('data/data.json') as f:
    data = json.load(f)

results = []
num_steps = math.ceil(len(data)/state.num_processes)
progress = tqdm(total=num_steps, disable=not state.is_local_main_process)  # only show progress on the main process

with state.split_between_processes(data) as inputs:
    outputs = ner(KeyDataset(inputs, key='title'))
    for item, tags in zip(inputs, outputs):
        # convert numpy.float32 to float
        for word in tags:
            word['score'] = word['score'].item()

        item['annotation'] = tags
        results.append(item)
        progress.update(1)

# Wait for all processes to finish
state.wait_for_everyone()
# Gather the results
results = gather_object(results)

# Save the results
if state.is_main_process:
    with open('data/results.json', 'w') as f:
        json.dump(results, f)

You’re more than welcome to add it to the distributed inference tutorial, however it is strongly encouraged to work with tensors up until after calling gather() as gather_object does not work on event distributed compute type.


How is the license determined?

On the ROS wiki and ROS index, the rqt_publisher license is listed as BSD. In this repository, I can't find a license file or any mention of the license. How are these sites determining the license? Would it be appropriate to add an explicit license file to this repository?
Thanks!

You are right that this should have a LICENSE file.  See #46, which adds this in.


[WIP] Allow building boxes of kubevirt vagrant VMs

Add script which builds boxes out of preprovisioned master and node vms.
Building them works: Only problem is, when you want to use the boxes, kubernetes does not come up properly becaues it wants to connect to etcd via an invalid ip (proably the IP of eth0 during the provisioning).

box/boxes.sh and .gitignore both refer to a script named "create_box.sh" which is not present.

It is downloaded by the script.

Demo will be minikube, no need for that anymore.


Missing file and folder in example

I am following the instructions in the tutorial, but I can't find the real_data folder and the label_configure.txt file under the example folder. Should I create them myself?

Thank you for reaching out and bringing this issue to our attention. The file label_configure.txt has been added to the example folder. The real_data folder should contain real genomic data for selective sweep analysis in VCF format, split by chromosome. This folder needs to be created by the user.


Update sbt-scoverage to 1.9.2

Updates org.scoverage:sbt-scoverage from 1.9.1 to 1.9.2.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.scoverage", artifactId = "sbt-scoverage" } ]

labels: sbt-plugin-update, early-semver-patch, semver-spec-patch

Codecov Report

Merging #125 (b75943f) into master (9698733) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #125   +/-   ##
=======================================
  Coverage   92.68%   92.68%
=======================================
  Files           2        2
  Lines          82       82
=======================================
  Hits           76       76
  Misses          6        6

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9698733...b75943f. Read the comment docs.


Kubernetes material should be separated from Docker

Kubernetes material should ideally be in a separate repo "kubernetes excercises", so the students are not confused when they are trying to focus on learning one technology at a time.
Mixing Kubernetes in a Docker course will be overwhelming for the students, and I would not want to do it, if it is a course I am teaching. :)

Has been resolved with : https://github.com/praqma-training/kubernetes-katas

https://github.com/praqma-training/kubernetes-katas/issues/1


Fixes gh-1009

Implement client specific LoadBalancedRetryFactory

@Ferioney  - thanks for submitting this. Will review on Monday.


Unable to call any methods

I seem to have this issue where anytime I try to call any of the methods I'm getting undefined, no matter where I place it....
Here is a console log showing in line 1 that I can evaluate the contents of my tracker object.  Can't explain it.
https://www.dropbox.com/s/afq6pj215jwrp4d/Screenshot 2017-01-06 16.23.31.png?dl=0

+1

have you done manual installations?

Yes, it actually seems to work with ios. Just now with android

@em222iv what are you failing with android?

The following code in index.ios/index.android files breaks the build on android but not in ios for RN: 39.02.

@em222iv Can you verify that settings.gradle, build.gradle & MainApplication.java have all the additions that are described in the manual install for Android?

I can confirm that I have followed the manual installation for android.
app/build.gradle:

mainApplication

mainApplication

settings.gradle

I have used this library in multiple project but this is the first time this behaviour shows up.

Mine fails in iOS too. Manual installation.

Which RN versions, and which versions of this module are you using?
I'd recommend just trying to react-native init some sample project, then installing + linking this module there to see if the same happens. If it is limited to just one project, I'd recommend trying to install it again.

RN 0.39.2
This package (analytics) 4.0.2

I also got this error using the following:
GoogleTagManager.pushDataLayerEvent({event: "someEvent"})
            .then((success) => console.log(success)); // Removing this fixed it.

Removing the .then fixed it (temporarily).
I double checked my configuration, everything is linked as expected.
This was on iOS.
    "react": "^15.4.1",
    "react-native": "^0.38.1",
    "react-native-google-analytics-bridge": "^4.0.2",

$ react-native --version
react-native-cli: 1.3.0
react-native: 0.38.1

Are any of you able to provide a sample project for this error? I am not able to reproduce this.

Hey guys,
I'm not sure if this is the root cause of your issues, but if you're on React Native prior to 0.40, the latest (5.0.0) release of this library will not work.  The reason is React Native 0.40 basically introduced a breaking change to iOS with the header declarations.
I'm on React Native 0.38 and am using the 4.0.0 version of this library ok on iOS, gonna check my Android builds shortly.
hth,
Eric

Same as @ericnograles  for me version 5.0 does not work (IOS) downgraded to 4.0 and all good.

Can any of you provide a sample project that can reproduce this?
All 5.0 does is change the header imports for RN 0.40+. Everyone on less than RN > 0.39 should not use 5.0.

I have a similar issue running on iOS using react-native 0.34.1 with react-native-google-analytics-bridge 4.0.3.
When I start my emulator from the console using $ react-native run-ios
const tracker = new GoogleAnalyticsTracker('UA-XXXXXXXX-X');
The tracker has only the id and customDimensionsFieldsIndexMap properties
calling tracker.trackScreenView('SCREEN_NAME') throws an undefined error
When I start the emulator from XCode the same code is working however (Google Analytics realtime dashboard correctly displays the screens I'm passing it).
Is there some debug setting I missed?

Conclusion : it will work on only release APK or IPA .
It will not work with react native bridge

This is a catch-all issue without any real code to reproduce. If anyone else is experiencing this problem, please open a new issue with actual code/project to reproduce.


How to avoid routing jumps and component rerendering?

In the React function component, you route from component A to component B, and then from component B to component A, component A and component B will rerender again, the data is asynchronous! What I want is to cache the render once and then jump back and forth to the first render. How can I do that? Are there caching components like Vue's keep-alive?
Version: 5.1.2
Expected Behavior
What I expect is that when jumping to the same routing component, there will be no re-rendering, keeping the first component's rendering and populated data, because the page refresh is controlled by a button!
Actual Behavior
In practice, the component will be unloaded and loaded every time it jumps to a Route. According to the official documentation, the Route component property will be unloaded and reloaded every time. The render property will not! I understand. Any questions? The desired effect should be the same as the behavior of the Vue's keep-alive component.

That's the way React Router works. The components will re-render when the route changes. But you could cache your data so you can access immediately when your component is re-rendered. Therefore it should not be noticeable, that there was a re-render.

@MeiKatz If so, should the data be stored in localStorage or sessionStorage? Are there routing cache component libraries like Vue's keep-alive?

@VitaminCtea This depends on what you want to do: localStorage saves your data per website (data will be shared over many tabs), and sessionStorage saves your data per tab. So it's your decision.

@MeiKatz Does that prevent components from being re-mounted and unmounted?

@VitaminCtea No. Re-rendering is done very quickly. What takes some time is either heavy computation or fetching data from the server. And we are talking about the last one. So you can speed up everything, if you don't re-fetch your data on every render.

@MeiKatz In this case, the only way to optimize is to cache the data! However, when there is a lot of data on the page, it may be difficult to store the data using session or local

@VitaminCtea And here comes the hard part: you have to decide what's best in your case. There's a lot of options you have: Redux, MobX, localStorage, sessionStorage, ... You have to decide what fits your needs the best.

@MeiKatz It's too difficult! Thank you for your answer!


Enhancement: use directory step for creating new folders in spfx tour upgrade report

In the SPFx project upgrade CodeTour report, we should use directory steps to provide instructions for creating new folders. Right now we fallback to package.json line 1 because the file to be created doesn't exist yet and the tour step needs a file.

@pnp/cli-for-microsoft-365-maintainers seems like over time there was very little interest in this one 🤔. Do we want to leave this open or maybe close and wait and see if someone will rise this again in future?

Agree that we should clear up some old ones but this one still feels like a great improvement 🤔

I think this is a nice issue to get started. Let's keep it for now

Seems like right now this isn't relevant because we've got only one case where we're creating a folder and the folder needs to be created in the root folder of the workspace, so there's no way for us to really use this feature. Closing for now.


only insert eggs ahead of parent if not already on path

in insert_on(replace=False)
and set replace=False by default in activate()
Fixes pkg_resources modifying sys.path for all eggs with SETUPTOOLS_SYS_PATH_TECHINQUE=raw
There's one failing test where setup_requires should be loading a package at higher priority, but the activate(replace=False) change means it is showing up at lower priority, rather than higher.
The setup_requires code triggered in this test does indeed have several explicit replace=True, remove_conflicting flags, but the only one that seems to matter with respect to sys.path is the implicit one passed to .activate(), which is registered as a zero-argument callback in self.callbacks. I'll see if I can figure out a way to pass the same replace argument in .add to .activate.
closes #686

I've added code to passthrough the replace argument from .add to callbacks, which fixes the setup_requires test but I'm not sure it's the right thing to do. It depends, to some degree, on what .activate() is meant to do, and when it is meant to be called. In master, it's called for every distribution found on sys.path and added with dist.add(), and its behavior is to ensure that every package added has a high import priority. The first commit on this PR is to call it on the same packages, but never modify import priority if packages are found.
Another behavior would be to only activate 'new' packages with high priority, and leave those found by default as lower priority

This now calls dist.activate(replace=True) for runtime-added dists (same as previous behavior), only modifying the activation of the initial set, loading with replace=False, so that sys.path is left completely unmodified for normal behavior.
I'm still not confident about what circumstances there are in which packages are activated beyond the initial set, so this may not be doing the right thing in every case. It seems to me that sys.path should not be modified in any way, unless:

the package is certainly not on sys.path
there are known conflicts with other packages already on sys.path

This PR does not go that far, but it would be nice if ultimately pkg_resources modification of sys.path could be confined to clearly defined, explicit, rare cases.

Thanks @minrk for looking at this. Also thanks to @embray for creating the tests to protect the setup_requires expectation. It does feel like we're slowly refining to the behavior that's desirable, though I do worry about boolean flags proliferating. As you say, we can leave a refactor to a more explicit, clear implementation as a later exercise.

This PR does not go that far, but it would be nice if ultimately pkg_resources modification of sys.path could be confined to clearly defined, explicit, rare cases.

Agreed. I think most of the use case for this is packages that are loaded via the setup_requires mechanism later in the setup process.  And in principle this could happen any time but maybe we should just put our foot down and limit the contexts where that can actually happen.


Dropping a Handle should stop the sound

And a detach(self) method should be added to Handle instead.

Done in #42


Config not working. >:(

"link": "https://discord.com/api/oauth2/authorize?client_id=604245652624506881&redirect_uri=https%3A%2F%2Fsnaildos.com&response_type=code&scope=identify guilds guilds.join connections email",
"callbackpath": "/callback",

try using "callback" without the "/"


Sort function doesn't handle transparent materials well

Test model:
model.zip
With PyJ3DUltra's current sort function, the water in this custom model renders like this:

It renders correctly in Jekyll:

If I copy Jekyll's sorting function (SortFuncTest) to PyJ3DUltra, it fixes the water:

But moving or rotating the camera from its default position at all makes most of the model start rendering as transparent, which didn't happen with the original sort function:

I'm not sure what's causing this rendering issue, but it happens for both the example test/model_viewer.py in this repo, and for GCFT, but not in Jekyll, so I suspect it's an issue in this repo and not with J3DUltra or GCFT's code.

Yeah the default sort method isn't very good, should probably make it so user code can define and set the sort function.


Limit number of parallel subscribers to backing event store

Currently the event store implementation is a bit aggressive with the number of consumers. This makes, in this case NATS, hit the (artificial) limits regarding subjects and subscribers.
TODO

[x] bump up limits in NATS streaming pod
[x] Unsubscribe from completed invocations in event store implementation

This issue is a short term solution for the longer term issue #4

Fixed in #103 and https://github.com/fission/fission/pull/482


Default behavior for PR builds from forks fails

A very common scenario is people outside the repo contributing PR's. The current default Actions template fails the PR since the secrets aren't available.
At the very least, it should still build but then pass the PR without doing any deploy.
This should be fixed soon or people who try it out may quickly get frustrated and remove it since all their PR's fail.

We are planning to consider build and pass the PR without deployment as future behavior. Pre-production environments are limited and auto-deployment in this scenario may not be what the app owner intends in all cases.

What if we do want to auto deploy those?

Hi folks, pretty advanced GitHub Actions user here. Now that we can have microsoft repos use SWA, I got it running for TypeScript. I have it set up to deploy for on an open source repo for external PRs, but I need to find a way to get the URL back into my PR.
Here's what I originally did:

I set up the repo in azure portal
I refactored that new workflow into my normal CI workflow

This hit the 'public repos' don't get secrets issue. Which is fine, because workflow_run exists.
Here's how it works:
Now, my CI builds an artifact on CI instead of deploying. That artifact is passed to a workflow_run action which then uploads it (because it has access to the secrets)

CI.yml
CI-post.yml

This allows an OSS repo to get contribution PRs which trigger the upload. Doing it this way doesn't get the message back in the comment thread however, but it does upload
So my request is that the GitHub Action sets an output of the URL, then I can have all sorts of ways of grabbing the URL and presenting it to users. ( I built danger-js for this use-case a few years ago. )
If someone reaches out to me on MS teams, to let me know where code lives - I can help ship that code get that to work. Otherwise I'll look around and see if there are APIs I can use to find the URL like https://nice-meadow-0c9756810.azurestaticapps.net

@orta that's awesome!

@orta this is super cool! Having the url as an output is something a lot of folks have asked for especially for performing tests after deployment. The challenge for us is that we run inside a Docker based Github Action. Do you know of anyway to set the output for the action when using Docker based actions?

I do, the way it works is that GH listens to specially crafted stdout messages from your action to determine outputs.
I'll assume bash (for my familiarity), but realistically it can be anything:
echo “::set-output name=<output name>::<value>”

e.g.
echo “::set-output name=static_web_app_deploy_url::https://nice-meadow-0c9756810.azurestaticapps.net”

Would let me pick that up in another workflow step, there's some docs here with sample code here

Small update, we did get a working prototype of this! Thanks for the help. I will followup once we've finished testing and released it.

This is now in production, you can access the build and deploy output like so:
${{ steps.builddeploy.outputs.static_web_app_url }}

Thanks!

👋🏻 - I've been working on a sample repo which shows the OSS PR process. Here's how it works so far, and then after, why it's not working yet.
Repo: https://github.com/orta/pr-builds-static-web-apps
Workflow Files: One for CI then a Post-CI yml
( I'd open ^ in a new window to run along-side this comment, they're well commented )
The Problem
A cross-fork PR does not get the access token to push to azure. The token is a secret, and secrets aren't shared to fork PRs, which is a reasonable security measure by GitHub on GH Actions.
Other static site providers like next/gatsby/etc will build the PR builds themselves, and don't have this problem. Because SWA build happens on GH Actions, then the security model of GH Actions affects PR builds.
The Solution
Use the new workflow_run process in GitHub Actions. Basically the CI run has limited access, but you can pass an artifact from that build to a workflow which happens after CI.
So, we pass the built version of the site and some PR metadata to a workflow_run which uploads to SWA. Then I use danger to send a message to the PR.
The Process

The CI generates all the *.html files
The CI adds the PR JSON to the same folder as the html files
The CI uploads the html files as an archived zip
After the CI is finished, the Post-CI workflow starts
The Post-CI workflow downloads the zip
The Post-CI workflow uploads the SWA
The Post-CI workflow triggers a danger run passing the URL from the SWA in

You can see a working PR here: https://github.com/orta/pr-builds-static-web-apps/pull/5
What Doesn't Work
It only uploads to the 'master' environment, I've tried using a custom branch and pushing that but I think the dockerfile makes assumptions that it is being ran in a PR workflow and I'd need some args which let me define the environment

Potential Solutions

Allow some kind of anonymous upload feature to SWA, then you don't have to do all of the above faff. If someone wants to chat about what that could look like, feel free to ping me on MS Teams.

Add some more args to uses: Azure/static-web-apps-deploy. I could imagine environment as a string.

    # Uploads the static build
    - name: Build And Deploy
      uses<EMAIL_ADDRESS>      id: deploy
      with:
        azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_MOSS_0DAC87810 }}
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        action: "upload"
        app_location: "built"
        app_artifact_location: "public"

        environment: "pr_${{ steps.pr_info.outputs.number }}"

or the PR meta could be manually added instead:
      # Uploads the static build
      - name: Build And Deploy
        uses<EMAIL_ADDRESS>        id: deploy
        with:
          azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ICY_MOSS_0DAC87810 }}
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          action: "upload"
          app_location: "built"
          app_artifact_location: "public"

          repo: ${{ steps.pr_info.outputs.number }}
          pull_number: ${{ steps.pr_info.outputs.number }}

This would let this technique work, but dang the whole thing a bit unfriendly and requires quite a lot of knowledge about how GH Actions works for something which I think someone would expect to kinda work out of the box.

Support building on Azure, which is kinda a roundabout way of re-running GH actions I guess. I'm not a general fan of the idea, but I don't have to build it, though that is what the competition is doing,

Hello there,
I have the same issue for this opensource project ( See here).
@orta proposed solution (capturing the artifact and using workflow_run) is interesting. My only remark would be time to capture the artifacts (can be time-consuming, specially with some languages).
Some alternative ideas:

Use the pull_request_target that uses the workflow file of the target branch and not the one from the merge commit.
Have a way to deploy from PR comments, like "#swa-deploy" (could leverage issue_comment and if: ${{ github.event.issue.pull_request }} ).

I haven't tested them yet, but I can dedicate some time trying something if asked :).

It seems like the workaround that @orta proposed is now possible via deployment_environment and production_branch inputs. I have something working between the CI.yml, deploy-preview.yml, and close-preview.yml workflows at https://github.com/microsoft/TypeScript-Website/tree/v2/.github/workflows. Branch-based PRs use the simple approach. Fork-based PRs upload the built site as an artifact, which is then downloaded and deployed when (1) a magic label is added to the PR, (2) the CI workflow completes on such a labeled PR, or (3) a workflow_dispatch is run. The script to find the artifact differs slightly between each of these scenarios. It took me over a day of work to sort it all out. So yeah, it’s possible, but not exactly a cakewalk.


Standardize and make ID fields consistent

Description:

What issue is being seen?  Describe what should be happening instead of the bug, for example: Cartography should not crash, the expected value isn't returned, the data schema is wrong, etc.

As mentioned in #910, cartography node fields are inconsistent. For example,

in an AWSAccount you'd need to use id, whereas an AWSUser has a userid and arn but not an id.

Please complete the following information::

Cartography release version or commit hash [e.g. 0.12.0 or 95e8e11913e2a44a4d4682506d8364a638ceac69]
0.65.0

Add any other context about the problem here

This blocks #910.

I think the first step should be to list all the different node types and identify which property to use as a unique ID for each.

consistency also applies to other field/tools.
hostname/short_hostname can have different case. hostname can be short or long depending on tool, or truncated to 15 characters for windows per netbios limitations)
mac address can be written in a variety of way too.
tags can be values or key-values

Is it possible give unique id for all nodes & add separate field which describes that node(label/ description).

@achantavy one solution for this problem (and especially #910) is to use computed community ID.
With new datamodel it will be easy to implement:

add a flag for Field to indicate a field is part of community ID OR add a property to NodeSchema that list all property fields that are part of community ID
when generating insert query compute this field value and hash the result (ex : concat field value and get the md5 hash of this concatenated value) and insert it under "community_id" field

I used this method in my previous job to handle partial node from network logs.
Today I use this to extract inventories from Cartography

As a brief update, I'd like to refactor more AWS assets to the new data model before working on ID standardization. Once things are in the new model, the standardization task will be a lot more straightforward and less error prone.


Minor clarifications of 0417-task-executor-preference.md

Minor clarifications and cleanup.

@rjmccall these are just wording polishing and don't change semantics, would we want to merge this?


Event ID changed: Battleground Bonus Event

The event ID for the Battleground Bonus Event has changed, it is now 536. This affects the weekly quest A Call to Battle.

Oops, looks like I put a whole bunch of event IDs in wrong. Fixed in v<IP_ADDRESS>.


incompatible with SE required mod

missing the crater graphic or something due to alien_biomes, which is required for Space Exploration

had dectorio as well


Decouple application code from etl repository

This will ultimately serve us well to decouple azure function app implementations from the infrastructure code, allowing devops services in azure to deploy from repositories when the perimeter is no longer directly accessible.

[ ] forecast-processor from icenetprocessor docker image / repository from the icenet-event-processor repository

[x] Move code out of etl codebase (docker images will update automatically on push anyway)
[ ] Check whether additional function deployment over the top of docker image deployment works
[ ] Test manual update of application

[ ] pygeoapi as its function app implementation from the icenet-geoapi repository

[ ] Check configuration usage of environment variables
[ ] Update deployment
[ ] Determine github integration method / publish mechanism, implement in repository
[ ] Test manual update

[ ] webapp/asset deployment from the icenet-application repository

[ ] Application deployment from github via deployment center / push mechanism
[ ] Test manual update

For the other apps, local-exec of the az agent mean that decoupling is more complicated, as that invokes the build process within the container which we rely on. However, hopefully in all cases this can be farmed out to an action in the individual repositories. If so, we stand a much better chance of isolating the application deployments and thus securing the endpoints prior to needing to deploy, which can then be done via a bastion or VPN to satisfy #37

Additional deployment over the top of a docker image doesn't seem to work, so abandoning that. The docker image was used thanks to the size of tensorflow binary setup and which wasn't working well with the oryx build process, so sticking with docker for the moment.
func azure functionapp publish [[REDACTED]] --python
Your functionapp is using a custom image DOCKER|registry.hub.docker.com/jimcircadian/iceneteventprocessor:latest.
Assuming that the image contains the correct framework.

Getting site publishing info...
Updating Application Settings for Remote build...
Timed out waiting for SCM to update the Environment Settings

Confirmed that the new geoapi deployment from icenet-geoapi works using the secrets file output from terraform


test: skip some integration tests for InstanceAdminClient by default

This change disables some integration tests for InstanceAdminClient by default.
You can still run them with setting RUN_SLOW_INTEGRATION_TESTS environment variable to yes. For example the following command will run them:
RUN_SLOW_INTEGRATION_TESTS=yes RUN_INTEGRATION_TESTS=yes ci/kokoro/docker/build.sh clang-tidy

This change mitigates #681

This change is

@coryan Good point, how about to enable these tests on the coverage builds?

@coryan PTAL
I changed it to only skip some tests on InstanceAdminClient. I also changed the name of the environment variable accordingly.

@coryan Thanks, addressed your comments, I'd let Kokoro run the tests.

@coryan PTAL
It seems working as expected :)


There is no reactor running, must be called from the context of a Tokio 1.x runtime

Describe the bug
Panic at src/api/override_web_audio_api.rs:124
When I set a callback function for the endedevent of my audio_buffer_source node.
Steps to reproduce
  Future<void> finished(Event event) async
  {
    Tau.tau.logger.d('lolo');
    await stop();
  }
....
src = await audioCtx.createBufferSource();
...
await src.setOnEnded(callback: finished);

override_web_audio_api.rs:124
handle_audio_scheduled_source_node_trait_impls_override!(AudioBufferSourceNode);

Logs
'<unnamed>' panicked at src/api/override_web_audio_api.rs:124:1:
there is no reactor running, must be called from the context of a Tokio 1.x runtime
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_display
   3: tokio::task::spawn::spawn_inner::panic_cold_display
   4: tokio::task::spawn::spawn_inner
   5: tokio::task::spawn::spawn
   6: <web_audio_api::node::audio_buffer_source::AudioBufferSourceNode as tau::api::override_web_audio_api::AudioBufferSourceNodeScheduledSourceNodeMiscExt>::set_on_ended::{{closure}}
   7: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
   8: web_audio_api::node::scheduled_source::AudioScheduledSourceNode::set_onended::{{closure}}
   9: core::ops::function::FnOnce::call_once{{vtable.shim}}
  10: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
  11: web_audio_api::events::EventLoop::handle_event
  12: web_audio_api::events::EventLoop::run_in_thread::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

OS
Macos
Version of flutter_rust_bridge_codegen
flutter_rust_bridge_codegen 2.0.0

Ok I guess that's because of something like: https://github.com/fzyzcjy/flutter_rust_bridge/blob/7e2a5f1ca930216697a785c9e29ef258cd8ca766/frb_example/integrate_third_party/rust/src/api/override_web_audio_api.rs#L114 (and various other places). I did not run them before (since that was just a prototype). I will check it a bit later/

PR: https://github.com/fzyzcjy/flutter_rust_bridge/pull/2151 (Just copy-paste the update code)
I have not run it to test whether it is fixed though, since integrate_third_party does not contain things to be run but only things at compile time.

Looks great!


fix for #176

Thank you for contributing to Coraza WAF, your effort is greatly appreciated
Before submitting check if what you want to add to coraza list meets quality standards before sending pull request. Thanks!

Note: that go.mod and go.sum can only be modified for tested dependency updates or justified new features.
Make sure that you've checked the boxes below before you submit PR:

[x] My code includes positive and negative tests.
[x] I have an appropriate description with correct grammar.
[x] I have read Contribution guidelines, maintainers note and Quality standard.

Thanks for your PR :heart:

@jptosso My question now is: was there any reason for this to be forced lower case?

@jptosso My question now is: was there any reason for this to be forced lower case?

I think some places are case insensitive, such as header configuration, but args configuration is case sensitive

And the main question now is: what the RFC says about this?

https://www.rfc-editor.org/rfc/rfc7230#page-19

The scheme and host are case-insensitive and normally provided in lowercase; all other components are compared in a case-sensitive manner

It's case sensitive according to the RFC but I think we must make it lower case to avoid bypasses.
I think the only thing I would edit to fix this issue is the cookie processor under tx.AddRequestHeader.

https://www.rfc-editor.org/rfc/rfc7230#page-19

The scheme and host are case-insensitive and normally provided in lowercase; all other components are compared in a case-sensitive manner

It's case sensitive according to the RFC but I think we must make it lower case to avoid bypasses.
I think the only thing I would edit to fix this issue is the cookie processor under tx.AddRequestHeader.

I removed the problem of argument case-sensitive, and we will discuss this problem later.


Cannot read property 'speed' of undefined

In the console Rellax returns the object. Though Rellax.speed returns undefined. I have why this is not working.

I should add this to the README, but you would pass the speed in an options block... new Rellax('.rellax', {speed: 10})


DataSerializer bug?

net/tomp2p/storage/DataSerializer.java
private Data deserializeMapDB(DataInput in) throws IOException {
    ByteBuf buf = Unpooled.buffer();
    Data data = null;
    while(data == null) {
        buf.writeByte(in.readByte());
        data = Data.decodeHeader(buf, signatureFactory);
    }
    int len = data.length();
    byte me[] = new byte[len];
    in.readFully(me);
    buf = Unpooled.wrappedBuffer(me);
    boolean retVal = data.decodeBuffer(buf);
    if(!retVal) {
        throw new IOException("data could not be read");
    }
    retVal = data.decodeDone(buf, signatureFactory);
    if(!retVal) {
        throw new IOException("signature could not be read");
    }
    return data;
}

This function always throws IOException("signature could not be read")
I think this line goes wrong : retVal = data.decodeDone(buf, signatureFactory);
Because "buf" is still the buffer for "data.decodeBuffer"!!! Maybe you should read the buffer before "data.decodeDone"?
: )

You are right! There was a bug in the decoder and I forgot to read the buffer before decodeDone(). Thanks for this bugreport!

Oh, where you was earlier?!?!


Add differing exit codes for differing end states

Please follow the guide below

You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
Put an x into all the boxes [ ] relevant to your issue (like that [x])
Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.12.12. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

[x] I've verified and I assure that I'm running youtube-dl 2016.12.12

Before submitting an issue make sure you have:

[x] At least skimmed through README and most notably FAQ and BUGS sections
[x] Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

[ ] Bug report (encountered problems with youtube-dl)
[ ] Site support request (request for adding support for a new site)
[x] Feature request (request for a new functionality)
[ ] Question
[ ] Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
Description of your issue, suggested solution and other information
Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
When scripting, it is often useful to get different exit codes for different sorts of failures (e.g.  0 for everything went correct, 1 for unrecognized options, 2 for an authentication error, 3 for lack of pay wall credentials, etc.). Curl, for instance, provides some extremely useful exit codes that help scripters to provide other contingent reactions like reattempting the download, parsing the url for errors, etc. Moreover, having these error codes would be more elegant than redirecting stderr to stdout and grep'ing the resulting string for key phrases.

Duplicate of #882.


Beginner help wanted please!

Hi guys,
Sorry but I am new to this and trying to invest some time on an open source project, one small step at a time.
Can someone explain how to create an instance of LinearGauge using Typescript please? What I want to do here is use an instance of the LinearGauge class directly from code so that I can use thing like MyGauge.options.lenght = 100; to manipulate the object properties in real time: change colors, font, etc. I know you can use the html declarative approach, I have and it works, but it's messy code and I find myself recreating feature that I believe are part of the LinearGauge class; things like lifecycle management, gauge option functions, etc. See where I'm going?
Using HTML works fine
What I mean by this is (sorry if I don't have all my terminology right!), I can see my gauge by adding the <linear-gauge> with appropriate properties to my template file. I can use [attr.XXX]="typescript variable" in the template file to update anything. I took me lots of time to figure this out (I am new to this so I have to read on Typescript, Angular and Material docs and google a lot) and it works fine. But I can't escape the fact that their is a better way to do this. When I look at the ng-canvas-gauge base class I see features I am not exploiting!
Help Using Typescript
I added ng-canvas to my project and registered what's needed manually. I have created a separate component that imports LinearGauge and LinearGaugeOptions from ng-canvas-gauge.
In my template file I use <linear-gauge #linearGauge>, etc. What I cannot figure out is how to bind the template file gauge to a LinearGauge object. I tried all kinds a variations of:
@ViewChild('linearGauge') public linearGauge: LinearGauge;
but when I try to use this.linearGauge.options.tilte = "My Title"; it does not update the gauge. I can read from this.linearGauge object but can affect it for some reason. I also tried @ViewChild('linearGauge',{read: true}) linearGauge: LinearGauge; etc. but damn...no success.
Do I need to do an extends of LinearGauge? Do I need to add something in the constructor? Should I be creating the gauge in Typescript?
Ultimately I'd like to have a LinearGauge and LinearGaugeOptions objects and to drive everything.
Thank for you help.

I don't know if you have fixed it but...
In your HTML, include a name to the gauge like :
            <radial-gauge #elGauge minor-ticks="10" stroke-ticks="true" color-plate="#222" color-major-ticks='#f5f5f5' color-minor-ticks='#ddd' border-shadow-width="5" value-int="2" value-dec="2" width="150" height="400">
            </radial-gauge>

Then in your module , reference to the gauge like this ( Before constructor, butin the class):
@ViewChild('elGauge', {static:false} ) miGauge;
And now, you can access to all the information and methods like this:
this.miGauge.gauge.options.value=this.ElSensor.value;
 this.miGauge.gauge.update()

Object is not available in constructor. Only after ngAfterViewInit


unload function cause my page crashed

I have a situation where, after packaging my Unity project as WebGL and calling unload function, the tab in Google Chrome becomes unresponsive. The DevTools for that tab are also unavailable. When I check the Google Chrome Task Manager, I see that the CPU usage for that tab's process is around 100%. This issue seems to occur shortly after calling unityInstance.quit. How can I resolve this problem to prevent the webpage from freezing and consuming high CPU resources?

I'm not experiencing this, can you provide an online example?

I think the same thing happened to me. I wanted to destroy unity when I switched pages, so I called unload(), causing the browser TAB to freeze and become unresponsive.

Check for a long time, found that it seems to be a problem with unity resources, I use oss resources in the author demo, there will be no tab page card dead problem, embarrassing.
	loaderUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.loader.js", 	dataUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.data", 	frameworkUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.framework.js", 	codeUrl: "https://static-huariot-com.oss-cn-hangzhou.aliyuncs.com/unity/test1/Build/OUT_BIM.wasm"


Error while deploying on Ubuntu.

I'm using Ubuntu on Digital Ocean. Not quite sure why this error is popping up considering all the paths were correct in the multiparty-meeting.service file. It was working perfectly in the npm start development mode.

check if you run it multiple times...

No I'm not.

It seems file created already.. killall node process and delete file from tmp and start again..

Thanks, it works.


Proposal: Flag use of identifier in prop value when not in scope

Note: I could not find an applicable rule that already exists in the readme. If I missed it, please let me know, and I apologize for the extra noise.

This one bit me pretty bad today.
Example:
<ElementName someProp={status} />

In this ES module, there was no defined identifier for status. However, there is a global for status in browsers, so our unit tests passed when run in a browser. We only noticed the issue when starting to run tests in node.
Is there any interest in adding this rule? I'd be happy to contribute it. I started an (ugly) rough draft of it here

Does the normal eslint rule for undefined vars not catch this?

Huh - interesting. It's not flagging this particular scenario in our codebase, but I at least verified in ASTExplorer that it should be working. For some reason I was operating under the assumption that ESLint rules wouldn't be checking JSX nodes in the AST, but I guess they're just looking for any identifier.
Thanks for the sanity check @ljharb.

Should have realized sooner - wasn't being flagged because browser was set to true for env, and status is part of the browser globals

Can't really avoid that, I think - if browser is true, then all browser globals are bugs waiting to happen :-/


I think one word has multiple contextualized embeddings in the corpus. How do you deal with that?

I like your paper but I think it's confusing that how to tackle multiple embeddings of the same word/token. I wonder is there any chance that different embeddings of the same word are mapped to different clusters and all of them are quite close to the cluster center in the spherical space. How do you deal with that?

Hi @namespace-Pt ,
Thanks for the question. You are right that each word can have multiple contextualized embeddings, and they can be mapped to different clusters during the clustering step in our algorithm. However, when deriving the final results, we take the average of the latent contextualized embeddings as the (context-free) representation for each word, which is then used for computing the topic-word distribution.
I hope this helps. Please let me know if anything remains unclear.
Best,
Yu

So the average step is like in the paper ''Tired of Topic Models Clusters of Pretrained Word Embeddings Make for Fast and Good Topics too''?

Yes. The difference is that TopClus uses contextualized embeddings (instead of context-free embeddings as in that paper) for clustering.

Did you reweight the averaged token embeddings?

No, we do not have any reweighing steps.

Also, how do you deal with subwords?

We remove subwords from the vocabulary when deriving the final results, so our results will not contain subwords.

Thank you.


build rails new command

generate new rails app based on cli input.

@npezza93 what do you think of something like this for our "new" project?


[BUG] illegal argument on leaving  a fragment

to reproduce open a course detail then leave the page, wait for a while the app will crash

can i work on this issue? @kulloveth , @ujjwalagrawal17

can i work on this issue? @kulloveth , @ujjwalagrawal17

@amit6663  I think this has been fixed. @ujjwalagrawal17 Kindly confirm this. I closed my PR because I figured it was fixed

Yes, this issue is fixed. Thanks, @kulloveth .


[ffmpeg] fix theora, speex, and openssl static linkage, and refactor/robustify library selection code into functions

What does your PR fix? Currently ffmpeg's theora, speex, and openssl features, under x64-windows-static, cannot be compiled against, due to incorrect linkage specifications in FindFFmpeg.cmake. This patch fixes this. It also refactors all the library selection code to use select_library_configurations as per cmake standard. So this solution is meant to be more robust. It also simplifies the code a lot. The two new functions might be of interest by themselves for other ports and could be added to vcpkg for reuse, but I haven't done that in this patch as I'm not sure how widespread they would be used. Either way, that could be done later if desired.

Which triplets are supported/not supported? Have you updated the CI baseline? No changes.

Does your PR follow the maintainer guide? Yes.

I think if we decide to remove the unofficial targets dependency, we can apply that to all ports, for this PR, I think it's fine.
All features test pass with x64-windows and x64-linux.

Thanks @PhoebeHui. I'll leave it as is then. I'll be keeping an eye on what happens with upstream theora.
Note that I'm also running regular regression tests (not just for this pull request) of all individual ffmpeg features on appveyor for windows, and travis for linux and osx. So this pull request is well tested from my end. In particular, these two builds include the patches posted here in this PR and pass all expected features:
https://ci.appveyor.com/project/mcmtroffaes/ffmpeg-msvc-build/builds/35731236
https://travis-ci.org/github/mcmtroffaes/ffmpeg-msvc-build/builds/735493132
You'll note x264 is the only remaining failure on windows but this is due to a build error of x264:x64-windows-static-md, which has nothing to do with this PR. Linux has more failures as I think it is less well tested, but my aim is eventually to get those all in the green too.

Ping

Thanks for your contribution!

You're welcome, thank you for merging!


SOCK_NONBLOCK should re-export libc::SOCK_NONBLOCK

I believe there is a bug for SOCK_NONBLOCK as the value is not the same for all architectures so will break if it's used on a non-x86 architecture - like MIPS. For example the flag value is 128 on MIPS.

I just noticed that you have a dependency to libc. I submitted a PR to add SOCK_NONBLOCK and SOCK_CLOEXEC flags to libc  so you can potentially reference them and don't have to split your code into different architectures.

Thanks for taking a look. Bringing in the value from libc is probably the right thing to do.

Alex has already merged the change into libc so I can submit a PR to you - hopefully tonight if I get time.

There's no release out with it yet, from what I could see.

@jamperry I just checked, both your commits made it into libc 0.2.6 which is out.

@jamperry Any interest in filing a PR for this? Seems pretty straightforward since the constant is properly defined in libc.

I believe this is resolved as of f067e73.

@kamalmarhubi @Susurrus
My apologies, it seems that SOCK_NONBLOCK does not exist in darwin.
I will stick to using fcntl() and friends, thanks.

@kamalmarhubi @Susurrus
Now I'm curious: nix::sys::socket::socket provides a fourth parameter that calls fcntl() but seemingly does not support macos. Opened an Issue (#861) for clarification. thanks.


Convert 'config' to be based on labels

right now the config bake in some assumptions of what your artifcat labels are.
IE: env-id=pr-18.. some projects may have env-id=pullrequest-18
we should provide a templating mechanism so a user can provide a config of what labels to = and what ones !=
something like
[
  {
     "name": "env-id",
     "does": "=",
     "value": "pr-{prNum}"
  },
{
     "name": "app",
     "does": "=",
     "value": "foo"
  },
{
     "name": "app",
     "does": "!=",
     "value": "bar"
  }
]

this analagos to selectors so we may as well use oc cli's scheme on selectors.
Using the cli tool with flag identify things with oc-clean-stale-artifactos --oc-selectors=foo=bar,baz=boop. Tokenize the selectors and process them.
In config simplify the configuration as well
{
"ocSelectors": "foo=bar,boo=baz"
}


Set-DbaMaxMemory fails on SQL Login with Sql Credential

Is this a feature OR bug:
Bug

Powershell Version:  5
OS Version: Windows 10

Steps to Reproduce
Attempt to set the max memory of an SQL Instance with an SQL Login with Sysadmin privileges
Action Results
Fails to connect when running Test-DbaMaxMemory
Expected Results
That it connects and sets the max memory
Additional comments
Have PR coming in to Fix this in a second.

This was merged, closing.


Update i18n.rst

Changed the sequence of different languages to match the order of Chinese, Japanese and Korea, as appeared in the very beginning.
And made some small modifications to the Chinese search section to make it read more natural.

Summary

Ticket Link

Hello @Zukerherr,
Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.
Per the Mattermost Contribution Guide, we need to add you to the list of approved contributors for the Mattermost project.
Please help complete the Mattermost contribution license agreement?
Once you have signed the CLA, please comment with /check-cla and confirm that the CLA check is green.
This is a standard procedure for many open source projects.
Please let us know if you have any questions.
We are very happy to have you join our growing community! If you're not yet a member, please consider joining our Contributors community channel to meet other contributors and discuss new opportunities with the core team.

@kaakaa, for some reason I can't add you as a reviewer but would appreciate your feedback. :)

This PR has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!
/cc @jasonblais @jfrerich @emilyacook


Add information on how to customise logging

See https://gitter.im/PegaSysEng/orion?at=5e5e9d47376d882250cbbf22

Closing because Orion is being deprecated.


Add SFBot & additional testing stats

SFBot (Level 0-20) as match opponent
New match stats:
Win%
LOS
ELo (+-Error Margin)

Using Stockfish was shared by zacklukem and discussed here:
https://discord.com/channels/1132289356011405342/1133121504398295060/1133450869086625945
error margin formula is from:
https://github.com/Sidhant-Roymoulik/Chess-Challenge


Added Bahasa Indonesia language

Added Bahasa Indonesia as app language #331

@vipinpaul and @abelpz Bahasa Indonesia App language is working as expected. This PR can be merged.


It seems error to close or destroy a TCP connection

I need a persistent TCP connection in my flutter app, I use singleton mode to make sure there's only one TcpMsgService and TCP connection, but sometimes(after hot reload or in a complex network(wifi/4G/5G switch)) it will generate more than one TCP connection, some connections seem lost of control, they try to connect over and over again unless I kill my app.
dart --version
Dart SDK version: 3.0.0 (stable) (Thu May 4 01:11:00 2023 -0700) on "macos_arm64"

import 'dart:async';
import 'dart:io';
import 'dart:typed_data';

class TcpMsgService {
  TcpMsgService._internal();

  static TcpMsgService? _singleton;

  factory TcpMsgService() {
    _singleton ??= TcpMsgService._internal();
    return _singleton!;
  }

  Socket? _socketClient;
  final int _timeout = 20;

  _initSocketClient() async {
    try {
      _socketClient?.timeout(Duration(seconds: _timeout),
          onTimeout: (EventSink<Uint8List> sink) async {
        await toConnect();
      });
      _socketClient?.listen(_onData, onError: _onError, onDone: _onDone, cancelOnError: false);
    } on SocketException catch (e) {
      await toConnect();
    }
  }

  _onData(List<int> event) async {}

  _onError(err) async {
    await toConnect();
  }

  _onDone() async {
    await toConnect();
  }

  closeListening() {
    _socketClient?.close();
    _socketClient?.destroy();
    _socketClient = null;
  }

  toConnect() async {
    closeListening();

    await Future.delayed(const Duration(seconds: 5));

    await _initSocketClient();
  }
}

main() {
  TcpMsgService().toConnect();
}

@gkdgo in the repro code above are you missing a call to 'connect' somewhere? WhenI run your reproduction test case it doesn't seem to do anything

@gkdgo in the repro code above are you missing a call to 'connect' somewhere? When I run your reproduction test case it doesn't seem to do anything

Thanks for your response , Sorry, I accidentally deleted some code. I have already updated the above code

It appears that  your toConnect method is called multiple times once from _onError and once from _onData when an error condition arises as a result of which multiple connections get established with the server and each time an error occurs this gets multiplied resulting in numerous connections to the server. Could you revise the code as follows and try your example
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';

class TcpMsgService {
  TcpMsgService._internal();

  static TcpMsgService? _singleton;

  factory TcpMsgService() {
    _singleton ??= TcpMsgService._internal();
    return _singleton!;
  }

  // 创建WebSocketChannel 单利，全局只有一个对象
  Socket? _socketClient;
  Timer? _heartbeatTimer;
  final int _timeout = 20;
  final int _heartbeatTimeout = 10;
  bool _reconnecting = false;

  // 开始进行链接
  _initSocketClient() async {
    try {
     var ctime = Duration(seconds:_timeout);
     _socketClient = await Socket.connect("<IP_ADDRESS>", 8888, timeout:ctime);
      _reconnecting = false;

      _socketClient?.listen(_onData, onError: _onError, onDone: _onDone, cancelOnError: false);

      _heartbeat();
    } on SocketException catch (e) {
     _reconnecting = false;
      await toConnect();
    }
  }

  _heartbeat() {
    _heartbeatTimer = Timer.periodic(Duration(seconds: _heartbeatTimeout), (timer) async {
      writeData("heartbeat");
    });
  }

  _onData(List<int> event) async {}

  _onError(err) async {
    await toConnect();
  }

  _onDone() async {
    await toConnect();
  }

  closeListening() async {
    _heartbeatTimer?.cancel();
    await _socketClient?.close();
    _socketClient?.destroy();
    _socketClient = null;
  }

  toConnect() async {
    if (!_reconnecting) {
      _reconnecting = true;
      await closeListening();

      await Future.delayed(const Duration(seconds: 5));

      await _initSocketClient();
    }
  }

  writeData(String data) {
    Uint8List newData = Uint8List.fromList(data.codeUnits);
    _socketClient?.add(newData);
  }
}

main() async {
  await TcpMsgService().toConnect();
}

Thanks a lot ,it works fine now.