[Bug]: Training EfficientAd failed: ZeroDivisionError: integer division or modulo by zero

Describe the bug
Hi, I have tried to run the following example in last anomalib version:
from anomalib.data import MVTec
from anomalib.models import EfficientAd
from anomalib.engine import Engine

from anomalib.callbacks import ModelCheckpoint
from lightning.pytorch.callbacks import EarlyStopping

datamodule = MVTec()
model = EfficientAd()
engine = Engine()

engine.fit(datamodule=datamodule, model=model)

But It gives the following error:
ZeroDivisionError                         Traceback (most recent call last)

[<ipython-input-7-4052201ff8ac>](https://localhost:8080/#) in <cell line: 3>()
      1 # start training
      2 engine = Engine(task=TaskType.SEGMENTATION)
----> 3 engine.fit(model=model, datamodule=datamodule)

15 frames

[/content/anomalib/src/anomalib/engine/engine.py](https://localhost:8080/#) in fit(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path)
    354             self.trainer.validate(model, val_dataloaders, datamodule=datamodule, ckpt_path=ckpt_path)
    355         else:
--> 356             self.trainer.fit(model, train_dataloaders, val_dataloaders, datamodule, ckpt_path)
    357
    358     def validate(

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/trainer/trainer.py](https://localhost:8080/#) in fit(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path)
    542         self.state.status = TrainerStatus.RUNNING
    543         self.training = True
--> 544         call._call_and_handle_interrupt(
    545             self, self._fit_impl, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path
    546         )

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/trainer/call.py](https://localhost:8080/#) in _call_and_handle_interrupt(trainer, trainer_fn, *args, **kwargs)
     42         if trainer.strategy.launcher is not None:
     43             return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
---> 44         return trainer_fn(*args, **kwargs)
     45
     46     except _TunerExitException:

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/trainer/trainer.py](https://localhost:8080/#) in _fit_impl(self, model, train_dataloaders, val_dataloaders, datamodule, ckpt_path)
    578             model_connected=self.lightning_module is not None,
    579         )
--> 580         self._run(model, ckpt_path=ckpt_path)
    581
    582         assert self.state.stopped

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/trainer/trainer.py](https://localhost:8080/#) in _run(self, model, ckpt_path)
    987         # RUN THE TRAINER
    988         # ----------------------------
--> 989         results = self._run_stage()
    990
    991         # ----------------------------

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/trainer/trainer.py](https://localhost:8080/#) in _run_stage(self)
   1033                 self._run_sanity_check()
   1034             with torch.autograd.set_detect_anomaly(self._detect_anomaly):
-> 1035                 self.fit_loop.run()
   1036             return None
   1037         raise RuntimeError(f"Unexpected state {self.state}")

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/loops/fit_loop.py](https://localhost:8080/#) in run(self)
    200             try:
    201                 self.on_advance_start()
--> 202                 self.advance()
    203                 self.on_advance_end()
    204                 self._restarting = False

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/loops/fit_loop.py](https://localhost:8080/#) in advance(self)
    357         with self.trainer.profiler.profile("run_training_epoch"):
    358             assert self._data_fetcher is not None
--> 359             self.epoch_loop.run(self._data_fetcher)
    360
    361     def on_advance_end(self) -> None:

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/loops/training_epoch_loop.py](https://localhost:8080/#) in run(self, data_fetcher)
    134         while not self.done:
    135             try:
--> 136                 self.advance(data_fetcher)
    137                 self.on_advance_end(data_fetcher)
    138                 self._restarting = False

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/loops/training_epoch_loop.py](https://localhost:8080/#) in advance(self, data_fetcher)
    248         self.update_lr_schedulers("step", update_plateau_schedulers=False)
    249         if self._num_ready_batches_reached():
--> 250             self.update_lr_schedulers("epoch", update_plateau_schedulers=False)
    251
    252         if using_dataloader_iter:

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/loops/training_epoch_loop.py](https://localhost:8080/#) in update_lr_schedulers(self, interval, update_plateau_schedulers)
    335         if interval == "step" and self._should_accumulate():
    336             return
--> 337         self._update_learning_rates(interval=interval, update_plateau_schedulers=update_plateau_schedulers)
    338
    339     def _update_learning_rates(self, interval: str, update_plateau_schedulers: bool) -> None:

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/loops/training_epoch_loop.py](https://localhost:8080/#) in _update_learning_rates(self, interval, update_plateau_schedulers)
    386
    387                 # update LR
--> 388                 call._call_lightning_module_hook(
    389                     trainer,
    390                     "lr_scheduler_step",

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/trainer/call.py](https://localhost:8080/#) in _call_lightning_module_hook(trainer, hook_name, pl_module, *args, **kwargs)
    155
    156     with trainer.profiler.profile(f"[LightningModule]{pl_module.__class__.__name__}.{hook_name}"):
--> 157         output = fn(*args, **kwargs)
    158
    159     # restore current_fx when nested context

[/usr/local/lib/python3.10/dist-packages/lightning/pytorch/core/module.py](https://localhost:8080/#) in lr_scheduler_step(self, scheduler, metric)
   1246         """
   1247         if metric is None:
-> 1248             scheduler.step()  # type: ignore[call-arg]
   1249         else:
   1250             scheduler.step(metric)

[/usr/local/lib/python3.10/dist-packages/torch/optim/lr_scheduler.py](https://localhost:8080/#) in step(self, epoch)
    145             if epoch is None:
    146                 self.last_epoch += 1
--> 147                 values = self.get_lr()
    148             else:
    149                 warnings.warn(EPOCH_DEPRECATION_WARNING, UserWarning)

[/usr/local/lib/python3.10/dist-packages/torch/optim/lr_scheduler.py](https://localhost:8080/#) in get_lr(self)
    385                           "please use `get_last_lr()`.", UserWarning)
    386
--> 387         if (self.last_epoch == 0) or (self.last_epoch % self.step_size != 0):
    388             return [group['lr'] for group in self.optimizer.param_groups]
    389         return [group['lr'] * self.gamma

ZeroDivisionError: integer division or modulo by zero

Dataset
MVTec
Model
Other (please specify in the field below)
Steps to reproduce the behavior
Model: EfficientAd
OS information
OS information:

Google Colab

Expected behavior
Train the model successfully.
Screenshots
No response
Pip/GitHub
pip
What version/branch did you use?
Branch: main
anomalib version: v1
Configuration YAML
Default

Logs
Default

Code of Conduct

[X] I agree to follow this project's Code of Conduct

Hi @glucasol, it might not be the fix, but u have declared Padim instead of EfficientAD. I have also found this bug when I add auto_find_lr in trainer parameters for >0.7.0 anomalib config file.

Hi, @isaacdominguez thanks for the reply! My mistake, I have updated the wrong import in the issue, but now it is correct! The error it’s not due to the import. I will check the auto_find_lr parameter, thanks!
@samet-akcay any idea on what could it be?

Ok so I found it was not the auto_find_lr, doing some test today found the same error:
  File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/loops/loop.py", line 199, in run
    self.advance(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/loops/fit_loop.py", line 267, in advance
    self._outputs = self.epoch_loop.run(self._data_fetcher)
  File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/loops/loop.py", line 199, in run
    self.advance(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 221, in advance
    self.update_lr_schedulers("epoch", update_plateau_schedulers=False)
  File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 395, in update_lr_schedulers
    self._update_learning_rates(
  File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/loops/epoch/training_epoch_loop.py", line 456, in _update_learning_rates
    self.trainer._call_lightning_module_hook(
  File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/trainer/trainer.py", line 1356, in _call_lightning_module_hook
    output = fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pytorch_lightning/core/module.py", line 1671, in lr_scheduler_step
    scheduler.step()  # type: ignore[call-arg]
  File "/usr/local/lib/python3.10/dist-packages/torch/optim/lr_scheduler.py", line 147, in step
    values = self.get_lr()
  File "/usr/local/lib/python3.10/dist-packages/torch/optim/lr_scheduler.py", line 387, in get_lr
    if (self.last_epoch == 0) or (self.last_epoch % self.step_size != 0):
ZeroDivisionError: integer division or modulo by zero
Epoch 0:  79%|███████▉  | 2756/3478 [2:00:49<31:39,  2.63s/it, loss=12, v_num=e833, train_st_step=26.90, train_ae_step=1.910, train_stae_step=0.253, train_loss_step=29.10]

Still don't know why, but this only happened to mewith EfficientAD model.

I'm a bit occupied some other tasks, will try to have a look asap

Juding from issue, the problem is in step_size which is equal 0. I think I encountered this once when I wanted to train EfficientAD for only 2 epochs. So I think something might be wrong with epoch setup.

Something probably goes wrong here:
https://github.com/openvinotoolkit/anomalib/blob/5b7904578d7991e6dbc1a005afc12dbd5e66e616/src/anomalib/models/image/efficient_ad/lightning_model.py#L236-L248
so step_size is set to 0, probably indicating that num_steps is also 0, which in turn means something is not correct with max_steps and max_epochs of trainer.

@blaz-r Thanks for the reply!
You're right, step_size is set to 0 because num_steps is the defaut value (-1) and then step_size=int(0.95*(-1))=0.
Any reason for num_steps be the mininum between trainer.max_steps and trainer.max_epochs * len(self.trainer.datamodule.train_dataloader()) ?

Due to the way efficientad training is specified, so it's set like this in config:
https://github.com/openvinotoolkit/anomalib/blob/main/src%2Fconfigs%2Fmodel%2Fefficient_ad.yaml#L16-L18
Default config has this, but this causes issues if you use the model directly.

Just ran into the same issue and the solution that @blaz-r mentioned solves it.
Using the API instead of the CLI you can then adjust your Engine like this:
engine = Engine(max_epochs=200,max_steps=70_000)

For me the solution @blaz-r mentioned worked too. Thank you guys!

Yeah, maybe we should add a check for that somewhere in code. @alexriedel1 what do you think would be the best option here?

@blaz-r Thanks for the reply! You're right, step_size is set to 0 because num_steps is the defaut value (-1) and then step_size=int(0.95*(-1))=0. Any reason for num_steps be the mininum between trainer.max_steps and trainer.max_epochs * len(self.trainer.datamodule.train_dataloader()) ?

Without setting any steps or epochs, the trainer will default max_epochs = 1000
(https://lightning.ai/docs/pytorch/stable/common/trainer.html#trainer-class-api)
The easiest way (that would also make the model a bit more epoch-agnostic) would be to use the max instead of the min here: https://github.com/openvinotoolkit/anomalib/blob/5b7904578d7991e6dbc1a005afc12dbd5e66e616/src/anomalib/models/image/efficient_ad/lightning_model.py#L243
However, the original papers say they are using 70k steps for training. From my point of view this was an arbitrary choice for training on typical anomaly datasets. In real world datasets there might the completely different numbers of steps and epochs necessary, so I have no bad feeling of using the number of epochs instead of steps.

Thanks for the answer.
I think that using max would break the mechanism though. If I understand this correctly, the point is to set a scheduler step to 90% of steps.
Due to the mechanism of Trainer, it stops at the earliest that is reached (either max_steps is reached or max_epochs) meaning that for scheduler (which tracks steps) to work as intended, we need to find the actual number of steps that the model will run.
This translates into minimum in code between max_steps and  epochs * "steps in each epoch".
If we had max here, and let's say max_epochs = 100, max_steps = 10, and "steps in each epoch" = 4, then maximum would eval to 100 * 4, but the training would stop at max_steps, which in turn means that scheduler didn't make the reduction.
So, with all this information, I would actually say that we add an if statement like this:
max_steps = self.trainer.max_steps
max_steps_from_epochs = self.trainer.max_epochs * len(self.trainer.datamodule.train_dataloader())

if max_steps == -1 or max_steps_from_epochs == -1:
        num_steps = max(
            max_steps ,
            max_steps_from_epochs
        )
else:
        num_steps = min(
            max_steps ,
            max_steps_from_epochs
        )

which would set to the minimum of each if they are both defined. If only one is defined, then the max would take the other. If by any chance infinite training is specified, this would again fail, so it'd need another guard, but I'm not sure if it's realistic to expect infinite training here?

We want to recreate this behaviour of pytorch lightning:
max_epochs ([Optional](https://docs.python.org/3/library/typing.html#typing.Optional)[[int](https://docs.python.org/3/library/functions.html#int)]) – Stop training once this number of epochs is reached. Disabled by default (None). If both max_epochs and max_steps are not specified, defaults to max_epochs = 1000. To enable infinite training, set max_epochs = -1.
max_steps ([int](https://docs.python.org/3/library/functions.html#int)) – Stop training after this number of steps. Disabled by default (-1). If max_steps = -1 and max_epochs = None, will default to max_epochs = 1000. To enable infinite training, set max_epochs to -1.
if self.trainer.max_epochs <  0:
    raise ValueError("A finite number of steps or epochs must be defined")

num_steps = min(
            self.trainer.max_steps,
            self.trainer.max_epochs * len(self.trainer.datamodule.train_dataloader()),
        )

if self.trainer.max_steps == -1:
   num_steps = self.trainer.max_epochs * len(self.trainer.datamodule.train_dataloader())

Yeah. This would probably be the best solution. Do you want to make a PR or should I?

Yeah. This would probably be the best solution. Do you want to make a PR or should I?

you can go for it! thanks!


Where to discuss realistic bounties?

Is there some some feature / suggested way for potential coders to discuss how much they would expect to solve an issue?
Is it the "set goal" feature?

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7639116-where-to-discuss-realistic-bounties?utm_campaign=plugin&utm_content=tracker%2F47&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47&utm_medium=issues&utm_source=github).

@adrelanos This is the intention of "set goal", yes. Developers should set a goal for how much they would want to solve the issue. When the funding goal is met, they will receive an email.


Fixes #6 #Added CODE_OF_CONDUCT.md

Fixes #6 Added Code Of Conduct

Thanks for your contribution!


[FEATURE] Add code snippets to run MeaningBERT locally

Is your feature request related to a problem? Please describe.
How do you actually use the MeaningBERT metric? I wasn't able to reproduce sensible results with this model.
Describe the solution you'd like
Provide a code snippet for Python which can be used to use the model locally.
Describe alternatives you've considered
I tried this code to run the model locally:
`import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("C:/big-files-m5/MeaningBERT")
model = AutoModelForSequenceClassification.from_pretrained("C:/big-files-m5/MeaningBERT")
sentences = ["He wanted to make them pay.", "This sandwich looks delicious."]
inputs = tokenizer(sentences[0], sentences[1], return_tensors="pt", padding=True)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
print(logits)`
Even though the code executes successfully I don't get sensible results. For completely identical sentences I get a low score and for completely unrelated sentences I get a high score.
Additional context
I tried to verify whether the results are as they should be by comparing the results from the local model with the results from the remote models but when I use the model via the "Compute" button on HuggingFace I don't get any value as a result and when I want to use the model via the Inference API I always get the value of 1. This is the code which I used to access the model via the Inference API:
`import requests
API_URL = "https://api-inference.huggingface.co/models/davebulaval/MeaningBERT"
headers = {"Authorization": f"Bearer xxx"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
output = query({
"inputs": "He wanted to make them pay. This sandwich looks delicious.",
})
print(output)`

I do not have time this week to investigate the problem. I will look at it next week.
I may have pushed the wrong model online. I did not try the model after the push on HuggingFace.

I have investigated the problem.

I have added code snipped in the README.
I have pushed the wrong model. I am currently retraining a new one and will make it as soon as possible. I will let you know.
The Metrics Card is not working and is not available. I will fix it with the new model.

@DennisDavari, I am working on a better fix. I have lost a part of the data augmentation dataset between the article and model releases. The data augmentation is different, and this version's performance seems to be lower. I have created a better data augmentation procedure (I do not know why I did not do this at first). I am currently training the model to validate if performance matches the article. I will make sure to keep you posted.

Thank you for the update! I am looking forward for the model!

@DennisDavari, I have pushed for a better model version, but I sometimes get strange results. I have improved the data augmentation approach and released a new dataset (and model) version. I am working on a third version.

Thanks a lot for your effort! Since I am finishing my master thesis soon I just wanted to know if you know about when you will be finishing the third version. I am asking this question because I am considering whether I should use the current version for my master thesis or whether I can still wait for the third version.

I am currently training V3 as of RN. Maybe 2-3 days.

I await the last training to see if I can get better quantitative metrics. I have created a Metrics Card to simplify the MeaningBERT use and quickly fix some errors. See here.

@DennisDavari I just pushed V3 and released weights. Quantitative metrics are better, but I still observed some errors. I have fixed some issues with the metric card, so I recommend using the metric module.
Here is a code snippet:
import evaluate

documents = ["He wanted to make them pay.", "This sandwich looks delicious.", "He wants to eat."]
simplifications = ["He wanted to make them pay.", "This sandwich looks delicious.",
                   "Whatever, whenever, this is a sentence."]

meaning_bert = evaluate.load("davebulaval/meaningbert")

print(meaning_bert.compute(documents=documents, simplifications=simplifications))


Add dispenser support for bottled fluids

Ink and vegetable oil fluids should be placeable by dispensers. Soap solution already has a dispenser behavior, so it's not applicable.

Soap fluid is the best fluid in the whole modded history. It deserves to be placed on ground!

I should be able to make soap solution placeable by adding a bucket version of it. That way, you could craft soap solution using piston crafting (or fill a tank using a bottle of soap solution) and then pick it up using a bucket, which would allow you to place it back down wherever you want.
I really need to get back to working on this mod. There's a lot that I worked on a while back but never quite finished up.


hv-sock: Binaries does not work on server core without extra runtime package

Hi @ilenghel
We have been running hv-sock-basic case, but it failed on our hosts. I tried to run the server_on_host.exe on our hosts, and did not work. I did a little digging and found that the the binaries might be built using DLL runtime library. Most of our hosts are installed with Hyper-V Server Core without extra runtime packages, which does not have the dependencies for the binaries. Would you help check about it and if it is true, it would be very helpful if you could recompile the binaries with C++ (MT) option as Recommendation 3 in README file.
Thank you in advance!

Hello,
I have tested the above scenario, and indeed, the Server Core on which I initially tested had the runtime libraries installed and because of that I didn't come across this issue. I recompiled the binaries and will make a PR to replace the old ones.
Thank you for pointing this out!

Thank you very much for your help!


Nix package

It would be good if this project is also available as a Nix package, it will be much easier to install it and update it.

Hey @keyvaann Id happily take the PR if that's something you could supply?

`{ stdenv, fetchFromGitHub, go }:
stdenv.mkDerivation rec {
pname = "pike";
version = "1.0.0"; # Update this with the correct version
src = fetchFromGitHub {
owner = "JamesWoolfenden";
repo = "pike";
rev = "v${version}"; # Ensure this matches the version tag in your repository
sha256 = "0c9vv8i3xysyyy4ncj7ryklh20vpxa3zzlcw5v6bmwxd949rvv2d"; # Update with the correct hash
};
buildInputs = [ go ];
buildPhase = ''
mkdir -p $out/bin
go build -o $out/bin/pike
'';
meta = with stdenv.lib; {
description = "Pike is a tool to simplify the creation and management of AWS IAM policies.";
homepage = "https://github.com/JamesWoolfenden/pike";
license = licenses.mit;
maintainers = [ maintainers.yourGitHubUsername ];
};
}
`


ON DELETE CASCADE for everything having to do with the users table

I added this to the model, but the migrations don't seem to like it. :/


multiple input/output of a layer

Hi, for example, My network has two branches a and b, and in some middle layer(which I will implement later, let's call it newLayer), how can I pass two branches a and b to newLayer?
(Note: a and b have different data shapes!)
for a common layer, I can write the following code with one input and one output
fc = mx.symbol.FullyConnected(data=a, name='fc', num_hidden=10)

what if input data has two streams?
and what if my newLayer also has two output streams, how can I use them? like below?
outs = mx.symbol.newLayer(data=(a,b), name='newLayer')
c = outs[0]
d = outs[1]

is the above codes right? I can not find any docs!!!
thanks in advance!

You are in general correct, except that if you define an input of two inputs, you can declare two inputs, and it is likely you will do
outs = mx.symbol.newLayer(a, b, name='newLayer')

This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!


Perform step 1 calculations in Glicko functions

This fixes an issue which caused Glicko functions such as glicko and glicko_rating_period not to perform calculations from the step 1 of the original Glicko paper. Those calculations are used to increase the rating deviation at the beginning of every rating period.
Fixes #3.
The results between test_glicko_rating_period and test_glicko are not exactly as similar as the comment on line 523 says they should be, someone probably should check carefully to make sure I didn't mess anything up.
Formatting changes were done by rustfmt.

Codecov Report
Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (a651509) compared to base (eeaf0fd).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master        #4   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files           13        13
  Lines         7052      7081   +29
=========================================
+ Hits          7052      7081   +29

Impacted Files
Coverage Δ

src/glicko.rs
100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Thanks again for the PR!
If I understood the glicko paper correctly, the pre_deviation as you called it needs to be inserted into the g_value functions in both the glicko and glicko_rating_period functions, instead of the old_deviation.

I believe RD in g function refers to that RD argument that you see in g's definition, you can see opponent's RD RD_j being passed into g  function in d^2's definition as well

Oh wait, nevermind, I was thinking about glicko_rating_period

The paper doesn't seem to make it clear whether opponents' RD values are supposed to be pre-step1 or post-step1. If it's the latter, this would be more complicated that I thought. If that's the case, glicko_rating_period probably should calculate pre_deviation for opponents just to use it in those g_value calculations and then throw away, which kind of seems like a hack but should work.

If I understand this line in the paper correctly:

Let the pre-period ratings of the m opponents (again from Step 1)
be r1, r2, . . . , rm and the ratings deviations be RD1, RD2, . . . , RDm.

This should mean the RDj in the calculations are the pre-period RD of the opponent, and so we do not need to calculate the pre_deviation of the opponent, but only the player. But I am not 100% sure. What do you think?

This is actually one of my first confusions that I had after I first read this paper. After reading the text before the step 1 I was left with an impression that rating and deviation are calculated twice per rating period, once in the beginning and once in the end. After reading both of the steps, I wasn't sure if those calculations are supposed to be at the beginning or at the end of a rating period, so I decided to re-read both of the steps and pay more attentions to phrases like "at the end of previous period" and "pre-period". However, this didn't resolve my confusion and at that time for some reason I thought the information introduced by those phrases was conflicting with each other. After looking at some Glicko-2 implementations I concluded that rating and deviation are probably calculated only once in the rating period, when one rating period ends and another one begins.
I'm still not really sure what pre-period actually means, so I can't really tell if that means we need to calculate pre_deviation of opponents, I'm just going to do what you said. That means passing pre_deviation into g_value in glicko, but not in glicko_rating_period, right?

Since Glicko-2 doesn't use modified opponent RDs, I'm inclined to believe what you said is correct.

That means passing pre_deviation into g_value in glicko, but not in glicko_rating_period, right?

I think we should keep both functions "compatible" so that if you were to pass in a single game into glicko_rating_period it would produce the same result as glicko. And I looked into a Java implementation of Glicko/Glicko-2 and they do it like the way it is right now in your PR, having the "old deviation" in the g-calculations instead of the "pre deviation". So to be honest I think leaving it like this is fine.

This should mean the RDj in the calculations are the pre-period RD of the opponent, and so we do not need to calculate the pre_deviation of the opponent, but only the player.

Actually, if this is correct, doesn't that mean that there is no need to calculate pre_deviation in both glicko and glicko_rating_period because in both of them only opponent deviations are passed to g_value?

So I guess we're leaving this as is? The difference between results on lines 670 and 671 seems to be pretty large, this is normal, right?

So I guess we're leaving this as is? The difference between results on lines 670 and 671 seems to be pretty large, this is normal, right?

Might be because the value of 41 could be just unrealistically low, with the proper calculations, and it adjusts upwards.
After reading the paper carefully again, I think this should look correct. What do you think?
Sorry that this was much more confusing than expected.

I think it's correct, but the difference might be large because of default c = 63.2, after all in the paper this number was calculated with an assumptions that typical RD is 50, ratings periods last two months and it takes 5 years for player's rating to become as unreliable as initial rating, while my value 23.75 that I usually use was calculated with assumptions 50, one week and 3 years respectively.
Merge if you're OK with this PR, I'm fine with it.


Informational Post: Releases 0.8.1 and 0.8.2 assign incorrect vdW parameters

This morning, we become aware of a major bug (#807) introduced in OpenFF Toolkit 0.8.1 and that is also present in 0.8.2 which causes van der Waals sigma terms to be off by a factor of 2. This could affect environments created or updated after December 7. Unfortunately, we expect that this affected the main code path that most users follow to assign parameters.
Basically, all energies calculated using these two versions of the Open Force Field Toolkit should be considered incorrect.
We sincerely apologize for this.
The following actions are being taken:

Versions 0.8.1 and 0.8.2 of the Open Force Field Toolkit have been removed from the main label on omnia
A bugfix is being implemented and version 0.8.3 will be released later today
A postmortem will be scheduled for early next week to establish how our development practices can be changed to prevent this from happening in the future

We've released the Open Force Field Toolkit version 0.8.3. This fixes the major bug reported earlier today. Detailed release notes are available at https://open-forcefield-toolkit.readthedocs.io/en/0.8.3/releasehistory.html
Conda packages available now on the omnia channel.
https://anaconda.org/omnia/openforcefield/files
Single-file installers are available in the "assets" section of the GitHub release, at https://github.com/openforcefield/openforcefield/releases/tag/0.8.3

We've released the Open Force Field Toolkit version 0.8.3. This fixes the major bug reported earlier today. Detailed release notes are available at https://open-forcefield-toolkit.readthedocs.io/en/0.8.3/releasehistory.html
Conda packages available now on the omnia channel.
https://anaconda.org/omnia/openforcefield/files
Single-file installers are available in the "assets" section of the GitHub release, at https://github.com/openforcefield/openforcefield/releases/tag/0.8.3


Remove before_start, before_stop, after_start and after_stop

Since current version is 0.5.2, this removes before_start, after_start, before_stop and after_stop.

Why has this been removed ? Now if I need to use the loop then how do I use it ?

Listeners  will solve.


[Windows] Cannot logout and login into another account

Expected Behaviour
After I logout, I want to be able to login again but with another account.
Actual Behaviour
After logout, on the second login, in Chrome, I don't have a chance to switch account because it goes too fast. Therefore, I'm logged in again, but with the wrong account.
Reproduce Scenario (including but not limited to)
Pre-requisite: Working on Windows, with a Chrome browser opening the login page.
Steps to Reproduce

Log into an account using aio auth login
Logout using aio auth logout
Try to log into another account by changing the email address on login page. On Chrome at least, it reuses previous credentials and you should not have the time to switch account.

Platform and Version
Windows 10, Node 14
Sample Code that illustrates the problem
Logs taken while reproducing problem
What happens on subsequent logins: The "you're logged in" page appears nearly immediately.

See #32

Removing all cookies fixes the issue, indeed.

Thanks for confirming @tmathern !
I don't think that we should do anything else at CLI level.
While as a CLI user I expect to be logged in automatically if I am logged in from the browser, I still feel it weird to be logged out in the browser if I log out from my CLI.
WDYT?

I agree that the user should not be automatically logged out in the browser by default.
However, it looks like it's not clear (currently) how a user can log out in the current flow without having to manually type in a different URL (experience cloud for instance). Perhaps we should add a logout functionality to the CLI log in UI.

I like the idea, @shazron what about adding a logout link as suggested by @sarahxxu ?

Nope, in the web UI that pops-up to login and then to confirm that the user has successfully logged in.

Yes ^ actually -- let's close this topic and do a separate one for UI improvements on this page. I'm connected with our design team to discuss further!


prettier-eslint should be a devDependency (fixes #75)

For fixing #75

That should not have happened. I'm Sorry. Thanks for the PR.


Identify inconsistencies between design and implementation

Description
Compare design and already implemented screens and define changes that must be made; if possible, implement them as well.
Acceptance criteria

Both design and implementation must be syncrhonised.
When design and implementation look different, it must be decided whether we want to fine-tune them (bring them to 100%-100%) or whether we leave them as they are.

Tasks

[ ] @nephix and @roy-castrillo hold meeting to compare design vs implementation
[ ] @nephix and @roy-castrillo make list of inconsistencies and prioritize them in order of importance and feasibility to implement during next iteration.

@roy-castrillo Do you still work on this issue or can we close it?

@christianbrb it's still something I'd like to do before leaving. Maybe I could arrange a meeting with @nephix?

@roy-castrillo sure, how about next Thursday?

Meeting notes:

Connected tokens:

Wrong letter spacing on buttons in dropdown

Replace start screen with transfer screen (#519)
Find meaningful app header label (e.g. currently Raiden dApp or Send on transfer screen)
Token overlay

Wrong icon spacing

Transfer screen

Missing > arrow in call to action button

Transfer stepper

Missing > arrow in call to action button
PFS selection

Maybe not pre-select a route?
Show amount to be transfered in continue button, after PFS got selected
Remove separating header line from PFS selection table
Add more spacing between rows in PFS table

Select Route

Remove separating header line from PFS selection table
Add more spacing between rows in PFS table

Confirmation screen

Proposal TBD by @roy-castrillo & @taleldayekh

Route payment overlay (implemented as part of #463)

@nephix Thanks :)
Could you split the comment into separate issues? Maybe summarizing the very small changes into one issue.

@christianbrb I have created the following tickets:
#542
#543
#544
I'm closing this ticket, because we've identified the inconsistencies


Formatted README

  Please Check The Preview

Disable unused Tabs:

Wiki

General formatting / spacing

Added license / crowdin badge

Added quicklinks

Linked referenced mods

If you have any questions.

In case you do not agree with some of the changes made in this PR,
please first let me know about them, before disregarding it entirely so
we can possibly find a middle ground and have it not go to waste.

             No, I'm not a robot.
     Yes, you are not the first.
      I just made a PR template.

If you are new to GitHub and aren't sure how to accept commits,
please familiarize yourself with the basics of Git / GitHub first.
Pull Requests
To accept pull requests you simply have to
press the      Merge PullRequest      button.
Never Copy-Paste Someones Contribution,
this robs them off their attribution and is thus
just plain copyright theft.

If you want to know more about Markdown check out:

Thank you for the wonderful work!


[varLib.interpolate_layout] Tests for GPOS LookupType 2 class pairs

Merging of class kerning pairs seems to be broken.
Traceback (most recent call last):
  File "interpolate_layout_test.py", line 425, in test_varlib_interpolate_layout_GPOS_only_LookupType_2_class_pairs_same_val_ttf
    instfont = interpolate_layout(ds_path, {'weight': 500}, finder)
  File "fonttools/Lib/fontTools/varLib/interpolate_layout.py", line 85, in interpolate_layout
    merger.mergeTables(font, master_fonts, axes_dict, base_idx, ['GPOS'])
  File "fonttools/Lib/fontTools/varLib/merger.py", line 107, in mergeTables
    self.mergeThings(font[tag], [m[tag] for m in master_ttfs])
  File "fonttools/Lib/fontTools/varLib/merger.py", line 93, in mergeThings
    self.mergeObjects(out, lst)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 70, in mergeObjects
    mergerFunc(self, value, values)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 93, in mergeThings
    self.mergeObjects(out, lst)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 70, in mergeObjects
    mergerFunc(self, value, values)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 93, in mergeThings
    self.mergeObjects(out, lst)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 70, in mergeObjects
    mergerFunc(self, value, values)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 95, in mergeThings
    self.mergeLists(out, lst)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 80, in mergeLists
    self.mergeThings(value, values)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 91, in mergeThings
    mergerFunc(self, out, lst)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 531, in merge
    merger.mergeLists(self.SubTable, subtables)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 80, in mergeLists
    self.mergeThings(value, values)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 91, in mergeThings
    mergerFunc(self, out, lst)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 430, in merge
    _PairPosFormat2_merge(self, lst, merger)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 368, in _PairPosFormat2_merge
    self.ClassDef1, classes = _ClassDef_merge_classify([l.ClassDef1 for l in lst], allGlyphs=glyphSet)
  File "fonttools/Lib/fontTools/varLib/merger.py", line 326, in _ClassDef_merge_classify
    sets[0] = set(allGlyphs)
IndexError: ('list assignment index out of range', 'PairPos', '[1]', 'Lookup', '[0]', 'list', '.Lookup', 'LookupList', '.LookupList', 'GPOS', '.table', 'table_G_P_O_S_')

Thanks.  Will look into it today.

looks like this happens when the varLib.merger attempts to merge empty ClassDef1 in PairPos Format 2.
the _ClassDef_invert function returns an empty list if the ClassDef1 is empty, but then in _ClassDef_merge_classify fails because it attempts to set the first item (of an empty list) to set[0] = set(allGlyphs):
https://github.com/fonttools/fonttools/commit/9544a538eefb0fe37fde4f41be3e5ef84f8f666a#diff-d53a8e57be84b219475e1de32e2de048R326

I managed to reduce the difference with the expected TTX result to a single line... but I still don't know how to fix that zero value record:
--- fonttools/Tests/varLib/data/test_results/InterpolateLayoutGPOS_2_class_diff.ttx
+++ /var/folders/jb/rjz76yw92w7144mwqg119jnm0000gn/T/tmpn3zhjarm/tmp1.ttx
@@ -48,6 +48,7 @@
           <!-- Class2Count=2 -->
           <Class1Record index="0">
             <Class2Record index="0">
+              <Value1 XAdvance="0"/>
             </Class2Record>
             <Class2Record index="1">
               <Value1 XAdvance="-40"/>

This is the patch so far:
diff --git a/Lib/fontTools/varLib/merger.py b/Lib/fontTools/varLib/merger.py
index 06a47bd..501d6de 100644
--- a/Lib/fontTools/varLib/merger.py
+++ b/Lib/fontTools/varLib/merger.py
@@ -322,10 +322,12 @@ def _ClassDef_merge_classify(lst, allGlyphs=None):
                sets = _ClassDef_invert(l)
                if allGlyphs is None:
                        sets = sets[1:]
-               else:
+               elif sets:
                        sets[0] = set(allGlyphs)
                        for s in sets[1:]:
                                sets[0].difference_update(s)
+               else:
+                       sets = [set(allGlyphs)]
                classifier.update(sets)
        classes = classifier.getClasses()

@@ -506,15 +508,18 @@ def _Lookup_PairPos_subtables_canonicalize(lst, font):
        head = []
        tail = []
        it = iter(lst)
+       has_Format1 = False
        for subtable in it:
                if subtable.Format == 1:
                        head.append(subtable)
+                       has_Format1 = True
                        continue
                tail.append(subtable)
                break
        tail.extend(it)
-       # TODO Only do this if at least one font has a Format1.
-       tail.insert(0, _Lookup_PairPosFormat1_subtables_merge_overlay(head, font))
+       if has_Format1:
+               # only insert if at least one font has a Format1
+               tail.insert(0, _Lookup_PairPosFormat1_subtables_merge_overlay(head, font))
        return tail

 @AligningMerger.merger(ot.Lookup)

I'll leave it to Behdad.

Thanks Cosimo. It's quite possible that the test result is incomplete. I'll double check.

Now it fails on the XML roundtrip check e.g. <ClassDef1> vs. <ClassDef1 Format="2">.

This change makes the tests pass. But is it right?
diff --git a/Lib/fontTools/varLib/merger.py b/Lib/fontTools/varLib/merger.py
index de3c970..a84af6c 100644
--- a/Lib/fontTools/varLib/merger.py
+++ b/Lib/fontTools/varLib/merger.py
@@ -369,6 +369,10 @@ def _PairPosFormat2_merge(self, lst, merger):
        # Align first classes
        self.ClassDef1, classes = _ClassDef_merge_classify([l.ClassDef1 for l in lst], allGlyphs=glyphSet)
        self.Class1Count = len(classes)
+       if self.Class1Count > 1:
+               self.ClassDef1.Format = 1
+       else:
+               self.ClassDef1.Format = 2
        new_matrices = []
        for l,matrix in zip(lst, matrices):
                nullRow = None
@@ -396,6 +400,10 @@ def _PairPosFormat2_merge(self, lst, merger):
        # Align second classes
        self.ClassDef2, classes = _ClassDef_merge_classify([l.ClassDef2 for l in lst])
        self.Class2Count = len(classes)
+       if self.Class2Count > 1:
+               self.ClassDef2.Format = 1
+       else:
+               self.ClassDef2.Format = 2
        new_matrices = []
        for l,matrix in zip(lst, matrices):
                classDef2 = l.ClassDef2.classDefs

Miguel, I think we should create a branch here on the upstream repo that only contains the failing tests and the correct expected test data. Then, when Behdad or someone else finds the time to look into this they can commit directly to that branch.
I'll do it later today.

I don't think we want to modify the expected results to match the current output simply to make the test "pass". Ideally we would construct the expected TTX manually, then assert that the output matches these expectations, else fix the code to match that.
@miguelsousa Can you please close this PR and re-open it from a new branch here on upstream, instead of from your fork? It should only contain only the (failing) tests and the correct expected results. Then we could work together towards fixing the issue.

The results are correct and were achieved by using feaLib.builder.addOpenTypeFeaturesFromString on a non-variable font, saving it, and then dumping the GPOS feature. This approach works because the output of varLib.interpolate_layout is an instance rather than a variable font.
@anthrotype yes I'll create the branch.

Development moved to branch class-kern-merge.

Good! Also thanks for working on the CFF2CharStringPen 👍

I'm taking a stab at it, but it's still too early to tell if I'll succeed.


added Rhombus under Graphs and Shapes

Related Issuse

Info about Issue or bug

Closes: #425
Describe the changes you've made
A clear and concise description of what you have done to successfully close your assigned issue. Any new files? or anything you feel to let us know!
Checklist:

[x] My code follows the style guidelines of this project.
[x] I have performed a self-review of my own code.
[ ] I have commented my code, particularly in hard-to-understand areas.
[ ] I have made corresponding changes to the documentation.
[x] My changes generate no new warnings.

Screenshots

Original
Updated

original screenshot
updated screenshot

@sairish2001 Please add labels here, its missing here


download file

Hi, Guys!
I don't understand how should i describe my swagger.yaml to download a file.
Can I write
      responses:
        200:
          description: OK
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary

or it isn't impossible yet in the current specification.
If it isn't implemented yet. Can you give me a workaround.

@dpblh I don't believe this is implemented currently in Scala frameworks, though it is present in Dropwizard. To work around this, please use x-server-raw-response.
If you're available to assist with implementation (even if it's just for one framework!), please take a look at the consumers of the produces.flatMap(RouteMap.ContentType.unapply):
brick:guardrail ((bf089985e...)) dstewart$ git grep '\.produces\>'
modules/codegen/src/main/scala/com/twilio/guardrail/generators/AkkaHttpClientGenerator.scala:          produces = operation.produces.toList.flatMap(RouteMeta.ContentType.unapply(_))
modules/codegen/src/main/scala/com/twilio/guardrail/generators/EndpointsClientGenerator.scala:          produces = operation.produces.toList.flatMap(RouteMeta.ContentType.unapply(_))
modules/codegen/src/main/scala/com/twilio/guardrail/generators/Http4sClientGenerator.scala:          produces = operation.produces.toList.flatMap(RouteMeta.ContentType.unapply(_))
modules/codegen/src/main/scala/com/twilio/guardrail/generators/Http4sServerGenerator.scala:        val produces = operation.produces.toList.flatMap(RouteMeta.ContentType.unapply(_))

I suspect what would likely be desirable is consuming either a OutputStream or something to be largely compatible with other libraries, but supporting OutputStream as well as the native streaming formats (Source in akka-http, maybe fs2 streams or otherwise for http4s). The intent is to focus on maximally useful idioms in each ecosystem.

@blast-hardcheese Thank you so much!
I'll definitely contribute.

Proper support for dropwizard is in https://github.com/twilio/guardrail/pull/571


Feature Request: Add Headings Above Code Input and Output Boxes

Feature Request: Add Headings Above Code Input and Output Boxes
Description:
I would like to request a new feature for the current Python lessons interface. The interface should include headings above the two code editor sections to enhance clarity and usability.
Feature Details:

Code Input Box Heading: Add a heading titled Code Input above the left-side box where users type their code.
Output Box Heading: Add a heading titled Output above the right-side box where users see the results of their code execution.

This change will make the interface more intuitive and help users quickly identify the purpose of each section.
Benefits:

Improves the user experience by clearly indicating the functionality of both sections.
Helps users, especially beginners, to better navigate the interface.

please assign this issue to me .


fix composable lora compatibility

Make the extension work with composable lora

Note: tested with https://github.com/a2569875/stable-diffusion-webui-composable-lora


time-series should not use 'limit=1' when specifying a range

Hi,
If you specify the 'range' as an option in timeseries the limit is automatically set to 1. I don't think that this is the desired behavior. When specifying the range, I would assume that the full range will be downloaded.
For example:
client.timeSeries({
      id: 'BALANCE_SHEET',
      key: 'AAPL',
      range: '4y'
})

The code above will use the following url:
https://sandbox.iexapis.com/stable/time-series/BALANCE_SHEET/AAPL?range=4y&limit=1&token=...

You don't necessarily know how many records are in the range and the default is always to opt for the option that charges the least credits. I'm open to alternatives but the motivation is for protective defaults.


Updated brief comments in app.py

Every function has brief descriptions about the function , pre conditions , post conditions and return values . Which makes the functions more easy to understand .


Simple parsing of integer to string is unclear

...or at least it is to me!...
If I want to stringify numbers, I'm currently using the 'join' block - for example I resolve this error (this is an artificial example, I know 'show number' exists):

By modifying join to take only one argument:

...but join isn't a very natural way to do that!
Is there a 'convert to string' block I'm missing somewhere? I see the handy 'parse to integer' to go the other way, but what about 'convert to string' in the 'Text' menu?

...the other thing is that someone who wasn't aware 'join' could be easily configured might not even think to grab the 'two input' version of it to use for stringification.

Looks like toString block is what  is needed here.

Moved to pxt-microbit


Adds BUILD_GUEST_IMAGE variable to skip building the image

Relevant Issue (if applicable)
N/A
Details
This PR adds "BUILD_GUEST_IMAGE" variable to skip building the image.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

I will re-PR this because wrong code contains.


WIP BibAuthorID: improvements for master

This superseeds #2260

What do we do with this PR?  Shall we keep given later v1.3 milestone even though the priority is critical?

Have to double check. I'll do it this week. I think with the last bibindex fix I solved all failing regression test. However it needs to be rebased against latest master which now contains all BibEdit improvements

Invenio 1.x is in a feature freeze state. Please continue in https://github.com/inveniosoftware/invenio-authorities.

More specifically at INSPIRE we have reimplemented the author disambiguation project into a suite of components:

beard: https://github.com/inspirehep/beard (Bibliographic Entity Automatic Recognition and Disambiguation), a ML library focused on bibliographic metadata
beard-server: https://github.com/inspirehep/beard-server, a Celery+REST wrapper around beard
a specific sub-module in our overlay: https://github.com/inspirehep/inspire-next/pull/1353 that is responsible for the middleware, i.e. understanding which literature records have been modified, send the needed data to beard-server, and apply the response back.


useDeepSubscription returns empty array while deep.select finds the link with the same query

useDeepSubscription
Code
    const { data, loading, error } = useDeepSubscription({
      type_id: {
        _id: ['@deep-foundation/core', 'Package'],
      },
      string: {
        value: DEEP_MEMO_PACKAGE_NAME,
      },
    });
    useEffect(() => {
      console.log({data, loading, error})
    }, [data, loading, error]);

Result:

Deep.select
Code
await deep.select({
    "type_id": {
        "_id": [
            "@deep-foundation/core",
            "Package"
        ]
    },
    "string": {
        "value": "@deep-foundation/deep-memo"
    }
})

Result

Did you try useDeepQuery?

Did you try useDeepQuery?

The same behavior


Update deploying-to-azure-static-web-app.md

Updated app_artifact_location to output_location
Updated static-web-apps-deploy@v1 action name
Updated close job naming to close_pull_request

Why:
Closes: #23126

What's being changed (if available, include any code snippets, screenshots, or gifs):
Changes to: https://docs.github.com/en/actions/deployment/deploying-to-your-cloud-provider/deploying-to-azure/deploying-to-azure-static-web-app#creating-the-workflow
Supporting vendor documentation: https://learn.microsoft.com/en-us/azure/static-web-apps/build-configuration?tabs=github-actions#build-configuration
Example workflow run: https://github.com/brianwaithaka/domaintest.github.io/actions/runs/5300069754/workflow

Check off the following:

[x] I have reviewed my changes in staging, available via the View deployment link in this PR's timeline.

For content changes, you will also see an automatically generated comment with links directly to pages you've modified. The comment won't appear if your PR only edits files in the data directory.

[x] For content changes, I have completed the self-review checklist.

And welcome to the Docs OS community!


DLTS integration

This PR added DLTS integration to NNI.
Key Points:

Run both NNI mamager / NNI Trial in DLTS job, as manager job / trial job.
User should copy the trial code / NNI config to Samba, which will be synced to NFS by DLTS.
Both manager job and trial job will share the same NFS mounting, includes user's trial code and config, so no copy operation needed.

Will you add document about dlts training service?

How did you workaround eslint/eslint#11899 ? I have lots of these lint errors currently.

Would you please fix following eslint error reported by IT pipeline?
/home/vsts/work/1/s/src/nni_manager/training_service/dlts/dltsTrainingService.ts
   72:25  warning  'trialJobId' is assigned a value but never used                                                                               @typescript-eslint/no-unused-vars
  111:17  error    Possible race condition: `dltsTrialJob.status` might be reassigned based on an outdated value of `dltsTrialJob.status`        require-atomic-updates
  114:17  error    Possible race condition: `dltsTrialJob.status` might be reassigned based on an outdated value of `dltsTrialJob.status`        require-atomic-updates
  116:21  error    Possible race condition: `dltsTrialJob.startTime` might be reassigned based on an outdated value of `dltsTrialJob.startTime`  require-atomic-updates
  119:21  error    Possible race condition: `dltsTrialJob.url` might be reassigned based on an outdated value of `dltsTrialJob.url`              require-atomic-updates
  123:17  error    Possible race condition: `dltsTrialJob.status` might be reassigned based on an outdated value of `dltsTrialJob.status`        require-atomic-updates
  126:17  error    Possible race condition: `dltsTrialJob.status` might be reassigned based on an outdated value of `dltsTrialJob.status`        require-atomic-updates
  130:17  error    Possible race condition: `dltsTrialJob.status` might be reassigned based on an outdated value of `dltsTrialJob.status`        require-atomic-updates
  135:21  error    Possible race condition: `dltsTrialJob.status` might be reassigned based on an outdated value of `dltsTrialJob.status`        require-atomic-updates
  138:21  error    Possible race condition: `dltsTrialJob.status` might be reassigned based on an outdated value of `dltsTrialJob.status`        require-atomic-updates
  142:17  error    Possible race condition: `dltsTrialJob.status` might be reassigned based on an outdated value of `dltsTrialJob.status`        require-atomic-updates
  334:37  warning  'key' is defined but never used                                                                                @typescript-eslint/no-unused-vars
  474:39  warning  'res' is defined but never used


Images within a div are not read as image posts by Sunlit

Sunlit will show this post, but not this post.
There are two main differences. In the post that doesn't show up, the multiple images are within a div rather than a "top level" img tag. The other cause could be the text before the images rather than after-- but I think that Sunlit can deal with that.
My expectation is that both posts would appear in Sunlit.

We've been talking about how to solve this and have a couple ideas. The main problem is how Micro.blog treats posts with titles differently. In your example, it would be easy to support both posts, but the "real" solution is to figure out the best way to support longer photo posts in Sunlit. Then that will take care of this issue as well.

I think this is now resolved (for new posts). We may make further improvements later.


Fixed bug in token generation for outputs that chose additional proto…

…col edges.
Fixes issue #104.

I approved so that this can go in, but I think it also should get some comments to help clarify what's going on and a test to validate the fix.


feat: introduce Body Limit Middleware using stream

This is an implementation of the feature proposed in #2077 using stream.
How to use
Simply specify the maximum size.
app.post(
  '/hello',
  bodyLimit({
    maxSize: 15 * Unit.b, // byte,
    onError: (c) => {
      return c.text('oveflow :(', 413)
    },
  }),
  (c) => {
    return c.text('pass :)')
  }
)

Using stream
The problem discussed in #2077 that a body must be read at a time is solved by using stream.
c.req.bodyCache
It uses c.req.bodyCache used by the Validator implementation. By setting the loaded ArrayBuffer to c.req.bodyCache.arrayBuffer, such as c.req.json() will use that cached body from then on.
Author should do the followings, if applicable

[x] Add tests
[x] Run tests
[x] yarn denoify to generate files for Deno

Express has an effortless way to customize its body limit, defaulting to 100kb max.

Hey @usualoma
Could you review this merged code again?

Do we need data called Unit?
As a matter of fact, to me, the following statement seems cognitively loaded. Of course it is not incomprehensible, and I think it is wonderful that it comes with a type. But later, when you take a quick look at the code, what is Unit?" is not so obvious and requires knowledge of body-limit.
impot { bodyLimit, Unit } from "hono/middleware/body-limit"
bodyLimit({
  maxSize: 15 * Unit.mb,
})

I find it less cognitively demanding to write the following rather than using utility type.
impot { bodyLimit } from "hono/middleware/body-limit"
bodyLimit({
  maxSize: 15 * 1024 * 1024, // 15mb
})

Alternatively, if we need to provide a way to specify using units, I feel the following would be better
impot { bodyLimit } from "hono/middleware/body-limit"
bodyLimit({
  maxSize: '15mb',
})

diff --git a/src/middleware/body-limit/index.test.ts b/src/middleware/body-limit/index.test.ts
index 058ffc77..7be5c41b 100644
--- a/src/middleware/body-limit/index.test.ts
+++ b/src/middleware/body-limit/index.test.ts
@@ -1,5 +1,6 @@
 import { Hono } from '../../hono'
-import { Unit, bodyLimit } from '.'
+import { bodyLimit } from '.'
+import type { Size } from './index'

 const GlobalRequest = globalThis.Request
 globalThis.Request = class Request extends GlobalRequest {
@@ -35,7 +36,7 @@ describe('Body Limit Middleware', () => {

   beforeEach(() => {
     app = new Hono()
-    app.use('*', bodyLimit({ maxSize: 15 * Unit.b }))
+    app.use('*', bodyLimit({ maxSize: '15b' }))
     app.get('/', (c) => c.text('index'))
     app.post('/body-limit-15byte', async (c) => {
       return c.text(await c.req.raw.text())
@@ -112,45 +113,49 @@ describe('Body Limit Middleware', () => {
     })
   })

-  describe('custom error handler', () => {
+  describe('Size', () => {
+    it('should accept string with unit', () => {
+      expectTypeOf<Size>('1b').toEqualTypeOf<Size>('1b')
+      expectTypeOf<Size>('1kb').toEqualTypeOf<Size>('1b')
+      expectTypeOf<Size>('1mb').toEqualTypeOf<Size>('1b')
+      expectTypeOf<Size>('1gb').toEqualTypeOf<Size>('1b')
+      expectTypeOf<Size>('1tb').toEqualTypeOf<Size>('1b')
+      expectTypeOf<Size>('1pb').toEqualTypeOf<Size>('1b')
+
+      expectTypeOf<Size>('1.5gb').toEqualTypeOf<Size>('1b')
+    })
+    it('should accept number', () => {
+      expectTypeOf<Size>(1).toEqualTypeOf<Size>('1b')
+      expectTypeOf<Size>(1.1).toEqualTypeOf<Size>('1b')
+    })
+  })
+
+  describe('maxSize with string', () => {
     beforeEach(() => {
       app = new Hono()
-      app.post(
-        '/text-limit-15byte-custom',
-        bodyLimit({
-          maxSize: 15 * Unit.b,
-          onError: (c) => {
-            return c.text('no', 413)
-          },
-        }),
-        (c) => {
-          return c.text('yes')
-        }
-      )
     })

-    it('should return the custom error handler', async () => {
-      const res = await app.request(
-        '/text-limit-15byte-custom',
-        buildRequestInit({ body: exampleText2 })
+    test.each`
+      maxSize  | size
+      ${'15b'} | ${15}
+      ${'1kb'} | ${1 * 1024}
+      ${'1mb'} | ${1 * 1024 ** 2}
+    `('should accept $maxSize as byte unit', async ({ maxSize, size }) => {
+      app.post(
+        '/hello',
+        bodyLimit({
+          maxSize,
+        }),
+        (c) => c.text('pass :)')
       )

+      let res = await app.request('/hello', buildRequestInit({ body: 'a'.repeat(size) }))
+      expect(res).not.toBeNull()
+      expect(res.status).toBe(200)
+
+      res = await app.request('/hello', buildRequestInit({ body: 'a'.repeat(size + 1) }))
       expect(res).not.toBeNull()
       expect(res.status).toBe(413)
-      expect(await res.text()).toBe('no')
     })
   })
 })
-
-describe('Unit', () => {
-  it('should return the correct size', () => {
-    let beforeSize = 1 / 1024
-
-    for (let i = 0, keys = Object.keys(Unit), len = keys.length; i < len; i++) {
-      // @ts-expect-error: <safe access>
-      const size = Unit[keys[i]]
-      expect(size === beforeSize * 1024).toBeTruthy()
-      beforeSize = size
-    }
-  })
-})
diff --git a/src/middleware/body-limit/index.ts b/src/middleware/body-limit/index.ts
index 929de058..0c227963 100644
--- a/src/middleware/body-limit/index.ts
+++ b/src/middleware/body-limit/index.ts
@@ -4,9 +4,22 @@ import type { MiddlewareHandler } from '../../types'

 const ERROR_MESSAGE = 'Payload Too Large'

+const unitData = {
+  b: 1,
+  kb: 1024,
+  mb: 1024 ** 2,
+  gb: 1024 ** 3,
+  tb: 1024 ** 4,
+  pb: 1024 ** 5,
+} as const
+type Unit = keyof typeof unitData
+
+export type Size = number | `${number}${Unit}`
+const sizeRe = new RegExp(`(.*?)(${Object.keys(unitData).join('|')})$`)
+
 type OnError = (c: Context) => Response | Promise<Response>
 type BodyLimitOptions = {
-  maxSize: number
+  maxSize: Size
   onError?: OnError
 }

@@ -17,6 +30,15 @@ class BodyLimitError extends Error {
   }
 }

+const calculateSize = (maxSize: Size): number => {
+  if (typeof maxSize === 'number') {
+    return maxSize
+  }
+
+  const [, size, unit] = maxSize.match(sizeRe) as [never, string, Unit]
+  return parseInt(size, 10) * unitData[unit as Unit]
+}
+
 /**
  * Body Limit Middleware
  *
@@ -25,7 +47,7 @@ class BodyLimitError extends Error {
  * app.post(
  *  '/hello',
  *  bodyLimit({
- *    maxSize: 15 * Unit.b,
+ *    maxSize: "15mb",
  *    onError: (c) => {
  *      return c.text('overflow :(', 413)
  *    }
@@ -45,7 +67,7 @@ export const bodyLimit = (options: BodyLimitOptions): MiddlewareHandler => {
       })
       throw new HTTPException(413, { res })
     })
-  const maxSize = options.maxSize
+  const maxSize = calculateSize(options.maxSize)

   return async function bodyLimit(c, next) {
     if (!c.req.raw.body) {
@@ -94,13 +116,3 @@ export const bodyLimit = (options: BodyLimitOptions): MiddlewareHandler => {
     }
   }
 }
-
-/**
- * Unit any
- * @example
- * ```ts
- * const limit = 100 * Unit.kb // 100kb
- * const limit2 = 1 * Unit.gb // 1gb
- * ```
- */
-export const Unit = { b: 1, kb: 1024, mb: 1024 ** 2, gb: 1024 ** 3, tb: 1024 ** 4, pb: 1024 ** 5 }

Personally, I have the above opinion about the current specifications of Unit.
But, well, it doesn't mean that it is no good. If the current specifications of Unit are good as they are, then I think it is good regarding other points.

(A few updated implementation examples)

Thanks, @usualoma !
As for Unit, I think removing it might be a good idea. I agree with the following opinion.

I find it less cognitively demanding to write the following rather than using utility type.

impot { bodyLimit } from "hono/middleware/body-limit"
bodyLimit({
  maxSize: 15 * 1024 * 1024, // 15mb
})

All works are finished!
@EdamAme-x If you are okay, I'll merge this PR to the "next" with you as a co-author!

@yusukebe Thank you!
I think we need to update the example as well.
https://github.com/honojs/hono/pull/2103/files#diff-89ad83d98e090b039aeff149d642b8497313bf717293de6d33c0606b25baccd7R28

@usualoma
You are right. Updated!

Oops. Mistook. Merged into the main. Reverting.


[Support] Can't access network drive through OpenVPN

In raising this issue, I confirm the following:

[x] I have read and understood the contributors guide.
[x] The issue I am reporting can be replicated.
[] The issue I am reporting can be is directly related to the pivpn installer script.
[x] The issue I am reporting isn't a duplicate (see FAQs, closed issues, and open issues).

Issue
What I need: I need to access hard drive in my home network from the outside world.
I installed pivpn on a RPI with OpenVPN. OpenVPN use the port 1195 because 1194 is already taken by my router. I don't use a domain because I have a static IP address. I can connect to the VPN without worries and make requests on the Internet.
My problem is that a hard drive connected to my router is accessible if I am in LAN, but not from the VPN from outside the network. Weirder, I can access the share drive if I plug the hard drive into a Windows 7 PC over wifi and share it. But if I connect the PC by ethernet cable I can't access the share drive anymore.
I am not very good at networking, so I need help to debug this situation. I would prefer to connect the hard drive to the router, or alternatively, share the hard drive on an ethernet connected PC. If you think this is a OpenVPN related issue let me know.
Is it possible that my ISP blocks requests based on the local IP address? How can I confirm that this is the problem?
Thank you in advance for your precious time.
pivpn debug
=============================================
::::        Installation settings        ::::
PLAT=Raspbian
OSCN=buster
USING_UFW=0
IPv4dev=wlan0
dhcpReserv=1
IPv4addr=<IP_ADDRESS>/24
IPv4gw=<IP_ADDRESS>
install_user=admin
install_home=/home/admin
VPN=openvpn
pivpnPROTO=udp
pivpnPORT=1195
pivpnDNS1=<IP_ADDRESS>
pivpnDNS2=<IP_ADDRESS>
pivpnSEARCHDOMAIN=
pivpnHOST=REDACTED
TWO_POINT_FOUR=0
pivpnENCRYPT=2048
USE_PREDEFINED_DH_PARAM=1
INPUT_CHAIN_EDITED=0
FORWARD_CHAIN_EDITED=0
pivpnDEV=tun0
pivpnNET=<IP_ADDRESS>
subnetClass=24
ALLOWED_IPS=""
UNATTUPG=1
INSTALLED_PACKAGES=()
HELP_SHOWN=1
=============================================
::::  Server configuration shown below   ::::
dev tun
proto udp
port 1195
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/raspberrypi_{{guid}}                        bb0511.crt
key /etc/openvpn/easy-rsa/pki/private/raspberrypi_{{guid}}                        bb0511.key
dh /etc/openvpn/easy-rsa/pki/dh2048.pem
topology subnet
server <IP_ADDRESS> <IP_ADDRESS>
# Set your primary domain name server address for clients
push "dhcp-option DNS <IP_ADDRESS>"
push "dhcp-option DNS <IP_ADDRESS>"
# Prevent DNS leaks on Windows
push "block-outside-dns"
# Override the Client default gateway by using <IP_ADDRESS>/1 and
# <IP_ADDRESS>/1 rather than <IP_ADDRESS>/0. This has the benefit of
# overriding but not wiping out the original default gateway.
push "redirect-gateway def1"
client-to-client
client-config-dir /etc/openvpn/ccd
keepalive 15 120
remote-cert-tls client
tls-version-min 1.2
tls-auth /etc/openvpn/easy-rsa/pki/ta.key 0
cipher AES-256-CBC
auth SHA256
user openvpn
group openvpn
persist-key
persist-tun
crl-verify /etc/openvpn/crl.pem
status /var/log/openvpn-status.log 20
status-version 3
syslog
verb 3
#DuplicateCNs allow access control on a less-granular, per user basis.
#Remove # if you will manage access by user instead of device.
#duplicate-cn
# Generated for use by PiVPN.io
=============================================
::::  Client template file shown below   ::::
client
dev tun
proto udp
remote REDACTED 1195
resolv-retry infinite
nobind
key-direction 1
remote-cert-tls server
tls-version-min 1.2
verify-x509-name raspberrypi_{{guid}}bb0511 name
cipher AES-256-CBC
auth SHA256
auth-nocache
verb 3

...

=============================================
::::            Self check               ::::
:: [OK] IP forwarding is enabled
:: [OK] Iptables MASQUERADE rule set
:: [OK] OpenVPN is running
:: [OK] OpenVPN is enabled (it will automatically start on reboot)
:: [OK] OpenVPN is listening on port 1195/udp
=============================================

I am not very good at networking, so I need help to debug this situation. I would prefer to connect the hard drive to the router, or alternatively, share the hard drive on an ethernet connected PC. If you think this is a OpenVPN related issue let me know.

Can you access other devices on the local network when using the VPN? How do you access the network drive (protocol)?

Is it possible that my ISP blocks requests based on the local IP address? How can I confirm that this is the problem?

That's not possible, the traffic between your VPN client and your Raspberry Pi is encrypted.

We haven't troubleshoot, but my partner wants a harddrive directly connected to the RPI. We do not have any trouble with this new strategy.


ContinueConversation with a custom activity

Raising issue to track this following discussion with @johnataylor.
Add an overload to continue conversation (ideally on the new cloud adapter and the existing BF adapter) that allows a custom activity to be sent to the bot.  This will be used as part of the handoff pattern where messages are received from handoff platforms (e.g. liveperson or omnichannel) onto a controller, are converted into activities and then need to be sent to the bot.
ContinueConversation today creates a continuation activity, but we require an overload that allows us to send a bespoke activity.

Also close this https://github.com/microsoft/botbuilder-dotnet/issues/4018 when done, thanks~

Also close this https://github.com/microsoft/botbuilder-dotnet/issues/4018 when done, thanks~

This is merged for CloudAdapter.


Not an issue but an idea

Maybe you want to add to the progress bar to take it up a notch.
example of a busy spinner
https://youtu.be/Pd0pH53BDGE
example of bars
https://youtu.be/69Ahp4dK0eI
It's cross platform; Linux, Windows, OSX, Emscripten, etc... It will also render directly to the Linux frame buffer.
And the size isn't too bad at 1.8MB compiled on Windows 11. Probably smaller on other OS's
Has support for bitmap, jpeg, png and gif.  can add custom fonts or use the ones that are loaded into it already. There are quite a few fonts that come loaded into it and if it is compiled with only one the size shrinks down to 659k. Fonts can be loaded dynamically so they do not need to be compiled into it.
Wheels can be provided for Windows and OSX installations. For Linux it would have to be compiled at time of use. It takes about 8 seconds to compile on my computer running Windows 11, not a huge amount of time.
The output from a console can be redirected to it and it has support for LTR and RTL text as well as unicode characters provided the font being used supports the characters. True Type Fonts that are stored on the system can be used as well.
It's written in C99 and there is a Python Binding for it. The binding uses ctypes

That does look pretty awesome if you ask me but I'm not sure how well it would integrate into this project to be honest.
It seems like something that would be amazing as part of a GUI library, or as a plugin for a GUI library.
I wouldn't mind linking to the library from the readme though :)

it can be used without any GUI framework. That's the cool part of it so long as there is a frame buffer available it is able to render to it. So on a  NIX type OS the rendering can be done right to the console and on Windows there is possibly a way to render directly to the console window. If not it can be made to look like it using a transparent frame or a shaped frame.
It runs using python which is pretty cool and if tied to your progress bar library it can be used on things like an MCU with a display.
These examples below are written using that GUI framework with a python Binding. The second example is running on an MCU using MicroPython while the other 2 are running in MicroPython that is encapsulated in JavaScript through a web page.
https://www.youtube.com/watch?v=NxQ7cLobr_Q
https://www.youtube.com/watch?v=Yiq3RKSpnZo
https://www.youtube.com/watch?v=Ko-yzwjXRX4
I know that your library is aimed at text based progress bars but I am pretty sure it can be adapted to use something like this library

While I'm honestly not sure if people want this, it looks too amazing not to want to include it :)
I'm not entirely sure how to include it though... binaries significantly complicate the build process, but I'm happy to outsource the build process to Github Actions anyhow since it reduces variability a bit.

Github bots being overly active again


Uncaught Error: kill EINVAL

I exepected either a comprehensible error or arbitrary order application of the environment variables

add the same environment variable twice to .atom-build.json
build

Atom Version: 0.200.0
System: Unknown Windows Version
Thrown From: build package, v0.33.0
Stack Trace
Uncaught Error: kill EINVAL
At child_process.js:1220

Error: kill EINVAL
  at exports._errnoException (util.js:734:11)
  at ChildProcess.kill (child_process.js:1220:13)
  at Object.module.exports.abort (C:\Users\ca8159\.atom\packages\build\lib\build.js:276:16)
  at Object.<anonymous> (C:\Users\ca8159\.atom\packages\build\lib\build.js:285:14)
  at saveAndContinue (C:\Users\ca8159\.atom\packages\build\lib\build.js:297:7)
  at Object.module.exports.doSaveConfirm (C:\Users\ca8159\.atom\packages\build\lib\build.js:301:14)
  at Object.module.exports.build (C:\Users\ca8159\.atom\packages\build\lib\build.js:283:10)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\ca8159\AppData\Local\atom\app-0.200.0\resources\app.asar\src\command-registry.js:238:29)
  at C:\Users\ca8159\AppData\Local\atom\app-0.200.0\resources\app.asar\src\command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\ca8159\AppData\Local\atom\app-0.200.0\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:519:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\ca8159\AppData\Local\atom\app-0.200.0\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:354:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (C:\Users\ca8159\AppData\Local\atom\app-0.200.0\resources\app.asar\src\window-event-handler.js:178:20)

Commands
     -0:59.6.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:58.1.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:56.2.0 core:paste (atom-text-editor.editor.is-focused)
     -0:53.3.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:52.1.0 editor:move-to-first-character-of-line (atom-text-editor.editor.is-focused)
 13x -0:51.9.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:48.5.0 core:copy (atom-text-editor.editor.is-focused)
  3x -0:47.5.0 core:paste (atom-text-editor.editor.is-focused)
     -0:41.6.0 core:save (atom-text-editor.editor.is-focused)
     -0:37.5.0 build:trigger (atom-text-editor.editor.is-focused)
     -0:10.7.0 core:copy (atom-text-editor.editor.is-focused)
     -0:09.8.0 core:paste (atom-text-editor.editor.is-focused)
     -0:08.2.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:05.8.0 build:trigger (atom-text-editor.editor.is-focused)
  2x -0:03.0 core:undo (atom-text-editor.editor.is-focused)
     -0:00.8.0 build:trigger (atom-text-editor.editor.is-focused)

Config
{
  "core": {
    "disabledPackages": [
      "autocomplete-plus",
      "language-ruby-on-rails",
      "background-tips"
    ],
    "themes": [
      "atom-dark-ui",
      "base16-tomorrow-dark-theme"
    ]
  },
  "build": {
    "saveOnBuild": true,
    "minimizedHeight": 0.25,
    "panelVisibility": "Keep Visible"
  }
}

Installed Packages
# User
build, v0.33.0
git-log, v0.3.0
language-rust, v0.4.3
linter, v0.12.4
linter-rust, v0.0.13
minimap, v4.9.0
project-manager, v1.15.5
racer, v0.11.0
save-session, v0.15.1
trailing-spaces, v0.2.5

# Dev
No dev packages

I am not able to reproduce this on OS X. Could this be a Windows issue? Haven't tested on Linux.
There has been some changes on how the environment variables are handled and replaced. Could you re-test with latest version (v0.35.0) ?

still happening on v0.35.0. But I have noticed that if all instances of the env-var have the same value, no error occurs. My use case was a readable PATH setting, instead of everything in one line.
    "PATH": "C:\\Program Files\\Rust stable 1.0\\bin;%PATH%",
    "PATH": "bin\\x86_64-pc-windows-gnu;%PATH%",

Why are you using multiple entries of the same variable? Was this just an error, or do you have a real use case for it?

My use case is making the .atom-build.json readable with long PATH variables. My PATH variable was getting very long, so I wanted to split it up.

Oh I see. I don't think that would work anyway since atom-build can only pass one variable of each key to the spawn command. I think your best course of action for now is to simply have one long row.
There should be a fix for this so it doesn't throw EINVAL anway. I'll look into this.


[Snyk] Upgrade com.google.guava:guava from 32.1.2-jre to 32.1.3-jre

This PR was automatically created by Snyk using the credentials of a real user.Snyk has created this PR to upgrade com.google.guava:guava from 32.1.2-jre to 32.1.3-jre.
:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.

The recommended version is 2 versions ahead of your current version.
The recommended version was released 5 months ago, on 2023-10-10.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs

📚  View the storybook of this branch here

Close in favor of https://github.com/gravitee-io/gravitee-api-management/pull/6850


Add column with age-1 survey values to the survey table

And change existing header to be age-2+ biomass

This is in data/survey-history.csv which is read in in data-tables.R


Async handler support

closes #3
@praswicaksono

Nice! just test async handler it works flawlessly.
Implementation is good and also big 👍 for typings for message event
Thanks!


Strange compiler error using Error Prone 2.4.0

Description of the problem
Declaring an enum with a method documented with a {@link } causes a compiler error in Error Prone 2.4.0.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
This repo contains the steps to reproduce and additional details.
In short:

Declare an enum.
Declare an enum constant.
In the body of this constant, declare a method.
Document the method with a Javadoc that references another class with a {@link }. The class itself doesn't seem to matter, I've tested against java.lang.Object and java.lang.Throwable.
Try to mvn clean compile.

What version of Error Prone are you using?
2.4.0
Have you found anything relevant by searching the web?
I have not.

Thanks for the report, the underlying issue here appears to be a javac bug: https://bugs.openjdk.java.net/browse/JDK-8248117. I think I can work around it.


Upgrade current Puma dependencies

Upgrade progressively the major part of pumascript dependencies. We need avoid security issues and take the advantage of new libraries features.

This issue is related to issue #93: Migrate Bower Dependencies to NPM.
As soon as I'm done with issue #93, I'll take care of this too

@consugus  Isn't related with the #93 issue due to these one is focused in update the editor and this is for runtime dependencies.
@emravera are you keeping working on it?

Uppsssss! @nestornav, I missunderstood what this issue was about, and as you explain, it's very complex. Not sure if I can take care of so much

I have started this issue I will continue working on this.


SUGGESTION:  Allow runtime definition of signaling server

Again, your work on this is BRILLIANT!!!!  I do have one suggestion.  There may be cases where the signaling server needs to be set at runtime vs a static config file.  While the MemoryConfigurationSource seems to be an option on Xamarin, it doesn't seem to work with the Blazor implementation.  Perhaps creating a service that provides a runtime URL and injecting it into the SignalingStub constructor.  Maybe something like this:
`namespace WebRTCme.Connection.Signaling.Proxy.Interfaces
{
public interface ISignalingUrlProvider
{
string GetSignalingServerUrl();
}
}`
`       Interfaces.ISignalingUrlProvider signalingUrlProvider;
public SignalingStub(IConfiguration configuration, Interfaces.ISignalingUrlProvider sigProvider)
{
_signallingServerBaseUrl = configuration["SignallingServer:BaseUrl"];
        signalingUrlProvider = sigProvider;

        if (signalingUrlProvider != null)
        {
            _signallingServerBaseUrl = signalingUrlProvider.GetSignalingServerUrl();
        }

//  Rest of your constructor`
Then adding an implementation of ISignalingUrlProvider and injecting it at startup.
builder.Services.AddSingleton<WebRTCme.Connection.Signaling.Proxy.Interfaces.ISignalingUrlProvider,                  Services.SignalingServerUrlProvider>();

Hi there and thanks for your kind words.
Currently I am in the middle of something and pretty busy. I will check both items at the weekend.
Thanks

Sorry I couldn't create any time this weekend. Simple too busy.
I will check these in the coming days when I have some free time.


IISWebAppDeploy : XML transformation issue

Hi,
using IISWebAppDeploy task on VSO, everything works fine but applying XML transformation per environment the transformed XML is not indented, and this generates issues with configuration parser, as in this bug report:
https://blogs.msdn.microsoft.com/tess/2010/02/16/system-configuration-configurationerrosexception-unrecognized-element-setting-and-other-unrecognized-elements/
eg., this happens in applicationSettings section, with multiple assembly  "setting" tags:
<My.Properties.Settings>
    <setting name="SettingA" serializeAs="String">
      <value>ValueA</value>
    </setting>
    <setting name="SettingB" serializeAs="String">
      <value>ValueB</value>
    </setting>
</My.Properties.Settings>

When transformed with the task, it becomes:
<My.Properties.Settings>
    <setting name="SettingA" serializeAs="String"><value>TransformedValueA</value></setting><setting name="SettingB" serializeAs="String"><value>TransformedValueB</value></setting>
</My.Properties.Settings>

which won't be parsed correctly.

@marco-gallinari , this issue is related to VSTS-TASKS .
Closing this issue.

Created a fix for the same here.


How to set Theano flags

I failed to run the scripts/translate-norerank.sh nist input.seg output
 "The file scan_perform.c is not available. This do"
/home/deployer/clark/anaconda2/envs/c2e_py2/lib/python2.7/site-packages/theano/scan_module/scan_perform_ext.py:76: UserWarning: The file scan_perform.c is not available. This donot happen normally. You are probably in a strangesetup. This mean Theano can not use the cython code for scan. If youwant to remove this warning, use the Theano flag'cxx=' (set to an empty string) to disable all ccode generation.

Could you tell me how to set Theano flags.

This could be the installation problem of Theano. Please follow the installation guide of Theano to check if you have successfully installed it.
In any case, my Theano flags are as follows:
export THEANO_FLAGS=base_compiledir=/tmp/christian/theano.NOBACKUP,mode=FAST_RUN,floatX=float32,device=dev1->cuda0;dev2->cuda2;dev3->cuda3,on_unused_input=warn

Hope this helps.


iOS Dialog.ShowSuccess needs a frame shadow or ability to set color.

[x] iOS
[] Android
[] UWP
[] PCL

Version of OS(s) listed above with issue
iOS 10
Version of ACR UserDialogs Library
ACR 6.3.1
Is there a way to modify the default white box with black text+tick icon?
Currently, the showsuccess dialog doesn't look good when it pops up.
Best outcome would be blurred background (like with most of ios's prompts), with optional frame shadow OR view masking like with your other dialogs/prompts. If I can change the color of the text/tick image that would be a nice addition.

+1

+1

ShowSuccess will be gone.  You can use ShowImage going forward.


Fix bug in MITgcmutils readstats

What changes does this PR introduce?
bug fix
What is the current behaviour?
MITgcmutils.readstats throws error when multiple fields are present in the diagstats file.
What is the new behaviour
diagstats file is read correctly.
Does this PR introduce a breaking change?
No.
Other information:
Includes two unrelated fixes for API updates in recent versions of matplotlib.

LGTM on the readstats mod (tested)

LGTM on the readstats mod (tested)

I will merge and publish to PyPI is noone objects.

I will merge and publish to PyPI is noone objects.


Add API for serializing bootstrapping keys

We have APIs for SerializeEvalMultKey and SerializeEvalAutomorphismKey. We should add one for bootstrapping keys. Maybe it is possible to serialize bootstrapping keys with the SerializeEvalAutomorphismKey API, but we need to double check.

Related to this, in case of CKKS, I think we are missing APIs to quickly (de)serialize m_bootPrecomMap, in FHECKKSRNS.
Rotations needed by the bootstrapping are indeed included in the (de)serialization of the rotation keys.

Related to this, in case of CKKS, I think what is missing are APIs to quickly (de)serialize m_bootPrecomMap, in FHECKKSRNS.
Rotations needed by the bootstrapping are indeed included in the (de)serialization of the rotation keys.


Allow back button to close modal

DO NOT MERGE. WORK IN PROGRESS.
This fixes #48 and should fix #57 as well. This branch refactors a portion of the library and depends on the changes made in #68 and #69, so this should not be merged until those are reviewed.
This PR introduces a new option history (default true, for now) that creates history events when opening modals, and closes the modal in response to them. When the modal opens, it modifies the current history state to include a unique identifier for that particular modal, then pushes a new history state. The modal closes when a history popstate event is received containing that unique id (which will happen when back is pressed). All of the logic in close() has been broken off into a private method _close(), and _close() is called when the browser back button is pressed. Calling close() directly cause the back button press to be simulated.
Here's a video of this in action: video demo
This has the following ramifications for the library:

Multiple modals cannot be open at once. This causes side effects in the browser history. This doesn't seem like something that should be done anyways, as opening multiple modals layers them on top of each other and doesn't look great. The developer should close a modal before opening another. In this PR, this is enforced by checking if another modal is open before opening. If one is, it tries again in 250ms (due to the async nature of browser events, calling close() on one modal then open() on another will cause the new modal to try and open before the first one is closed). I'm not certain about this behavior, however, so it's something I want to get feedback on. Should we automatically try to handle this situation for the developer, or perhaps just throw an error for the developer to handle their selves? The latter seems more reliable, but decreases the usability of the library.
Developer cannot call close() on a modal that is not open. This doesn't seem like something the developer should be doing anyways. Again, this causes unwanted side effects in the browser history. In this PR, an isOpen() check is done before close() runs.

I've implemented closing on backbutton like this:
// When opening modal location.hash = "something";
Then have an event listener:
// have backbutton close the modal window.onhashchange = function() { 	if (location.hash=='') { 		modalOrder.close(); 	} }


App Studio import failing

Hi,
I've been importing a chatbot from the same zip file for over a year, and it worked great.
Today suddenly when I tried to import the same zip file, I got the Fix validation errors pop up, and no errors were displayed.
What is the possible cause for this error? And how can I fix this /
Adding a screenshot, Thanks in advance!

@DanielLevy0705 - Could you please check in Manifest Validator, if there is any error? If not please share your zip package, so that we can check once from our end

@Prasad-MSFT , Manifest Validator passed all tests. 0 errors and warnings.
here's the zip
microsoft-teams-manifest (2).zip

@DanielLevy0705 -We tried to import the zip provided in the App Studio and were able to do so without any error.

@Prasad-MSFT That's really weird. Since I'm trying now with that zip file, and also tried to restart my ms-teams client and my computer.
This is also happening to other people in my organization.

@Prasad-MSFT is there any update?

@DanielLevy0705 - It might be the issue due to duplication. As when i tried to re-import the package again, i am getting the same error

Thanks, I tried to delete the app and reimport it when I have no apps in the app studio, but still getting this error. is there any solution/workaround?

I deleted the app from app studio and re-imported and it worked fine

Please try importing from dev portal. That might help

Hi, Prasad. I tried to delete and import again and it's still not working.
importing from the dev portal doesn't seem like a valid solution, since I'm having issues configuring the bot as I'd like with an endpoint.

Could you please try to update MS Teams app version and also upgrade the manifest version and check if it helps in any way?

@Prasad-MSFT hi Prasad, sorry for the late response.
Upgrading both ms-teams version and Manifest version didn't help.

@DanielLevy0705 - Is it happening for this particular app manifest or for every manifest you are trying to import?

I created a brand new application and deleted it and managed to add its manifest.
but still can't manage to add my manifest.

I created a brand new application and deleted it and managed to add its manifest. but still can't manage to add my manifest.

I am bit not clear here
You are able to add new app manifest ,but not this particular manifest , right?

Hi Prasad, That's correct, I've managed to create a sample manifest and import it and it worked.
But then I went even further and tried to create a new app manifest using the data from my old manifest.
(created a new app and added all of the data to the relevant fields)
It gave me the same validation error.
adding both new manifests. the one that worked is called NewApp and the other is called algobot.

Its bit strange, because i tried to import both the apps shared and both got added successfully.
1.

Microsoft Teams Version <IP_ADDRESS>65 (64-bit). It was last updated on 5/11/2022.

Oh, great. Glad that you find the root cause. Thanks for the update
We are closing the issue for now. Please feel free to reopen if required

@Prasad-MSFT hi Prasad, please re-open this issue.
our QA tried to test the new manifest, but it gets the same error on his client, he tried to upgrade the client to last version, but same results. he even tried to test it on other QA clients.
on my client on the other hand, the old manifest is still getting this error, but the new client doesn't.
I'll try to find a work-around for our customers if they get the same error, but still it looks like a bug that should be fixed. (even though it's hard to reproduce it on your clients).

hi Prasad, by console logs do you mean the error in the popup window or are there any other logs that I can collect?
if you mean only the popup it's the same message as in the original post.
the client's version is: Microsoft Teams Version <IP_ADDRESS>63 (64-bit)

@DanielLevy0705 - Please refer this to get console log:https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/developer-tools#access-devtools-on-the-desktop

Thanks @Prasad-MSFT , I'm waiting for the logs from our QA.
in the meantime, I've managed to find a workaround, I figured that since I've managed to solve the issue locally by changing the App Id, maybe if the QA will generate a new App ID and copy it to the Manifest.json, it would solve the issue for him as well. and in fact, it did.
So first of all it may help you with understanding the issue.
Secondly, my question is - can I offer such a workaround until the issue is solved globally? what are the consequences of changing the App Id of a distributed manifest zip?

Okay great. But if the App Id is being used somewhere for deeplinking or anything, it will impact the functionality.

@Prasad-MSFT these are the console logs when trying to import the manifest from the ms-teams web application.

@DanielLevy0705 - We have raised a bug for this issue and engineering team is looking into it. We will inform you once we get further update. Thanks!

any update regarding this bug?

@DanielLevy0705 - We got update from engineering team saying that  "This is due to an app of the same ID is already in the app studio. Its highly recommend to use the developer portal instead as we are deprecating app studio in the near future. Please use the developer portal Developer Portal (microsoft.com)"

We are closing the issue for now. Please feel free to reopen if required.


docs: Add info about store.get

@Jannis could you review updated doc?

@Jannis updated as per feedback – could you review and merge? Thanks!


Added finnish dvorak layout

Please rename LISENCE.TXT to LICENSE and README.TXT to README for consistency with other layouts.

Please rename LISENCE.TXT to LICENSE and README.TXT to README for consistency with other layouts.

Renamed.

Sorry, still not quite correct - should be LICENSE rather than LISENCE.

Sorry, still not quite correct - should be LICENSE rather than LISENCE.

My bad, it should be corrected now.


Update README.md

Fixed assorted minor punctuation and wording issues. For some reason, backticks aren't  working in the "Debugger configuration options" section. Not sure how to reword this: "... you will want @echo off at the top and >nul."

Thanks


Make _check_feed_client_credentials preflight check optional

Is this a request for help?:
YES
Is this a BUG REPORT or a FEATURE REQUEST? (choose one):
FEATURE REQUEST

Version of Anchore Engine and Anchore CLI if applicable:
Master
What happened:
https://github.com/anchore/anchore-engine/blob/fa7d52cd09435c807ed0c9179d521437276a89e4/anchore_engine/services/policy_engine/__init__.py#L159
I think this check should become optional if you decide to turn off feed syncing all together in anchore. I wanted to run anchore offline and this prevented it, even though I already had a pre-existing vulnerability database on disk. You could implement a conditional which only does the preflight check if there are feeds to sync.

@CameronLonsdale , I think the general setting to create would be a feed_sync_enabled option that you could set to False and would also cause a skip of the credential checks in preflight. I'll take a look at that option as well as a way to test/query the credential status so that it can be monitored reasonably.
Is your use-case to do an initial feed sync and then disable it, probably to support installation from db snapshots?

hi @CameronLonsdale - update on the ability to disable feed syncs in anchore-engine!
We've added a new configuration parameter that allows feed syncs to be disabled in commit 'd61f643d3652579d105b4500e6da6bf804cbf073', which is also available in the latest unstable container build (docker.io/anchore/anchore-engine:dev), for from-scratch testing purposes.
The new parameter is called 'sync_enabled: <True|False>', inside the 'feeds' section of config.yaml.
I'll close our this ticket as the new parameter should hit this use case!


Update maps.livemd to use colon instead of semicolon

Instead of semicolon ;, use colon as it is a punctuation mark (:) used to precede a list of items, a quotation, or an expansion or explanation.

❤💚💛💜💙❤