text:
0.14: NotSerializableException: io.moquette.broker.SessionRegistry$PublishedMessage

I'm testing 0.14 on our server, and woke up to a console filled with the below exception.
SessionRegistry.PublishedMessage and its superclass do not implement Serializable. Should they be put into the store?
Expected behavior
No exceptions...
Actual behavior
07:41:12.367 [nioEventLoopGroup-3-1] ERROR i.m.broker.NewNettyMQTTHandler - Error processing protocol message: SUBSCRIBE
java.lang.IllegalStateException: This store is closed [1.4.199/4]
	at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:883)
	at org.h2.mvstore.MVStore.checkOpen(MVStore.java:2634)
	at org.h2.mvstore.MVStore.getMapName(MVStore.java:2736)
	at org.h2.mvstore.MVMap.beforeWrite(MVMap.java:889)
	at org.h2.mvstore.MVMap.operate(MVMap.java:1649)
	at org.h2.mvstore.MVMap.put(MVMap.java:151)
	at io.moquette.persistence.H2SubscriptionsRepository.addNewSubscription(H2SubscriptionsRepository.java:41)
	at io.moquette.broker.subscriptions.CTrieSubscriptionDirectory.add(CTrieSubscriptionDirectory.java:101)
	at io.moquette.broker.PostOffice.subscribeClientToTopics(PostOffice.java:81)
	at io.moquette.broker.MQTTConnection.processSubscribe(MQTTConnection.java:329)
	at io.moquette.broker.MQTTConnection.handleMessage(MQTTConnection.java:72)
	at io.moquette.broker.NewNettyMQTTHandler.channelRead(NewNettyMQTTHandler.java:58)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.moquette.broker.metrics.MQTTMessageLogger.channelRead(MQTTMessageLogger.java:47)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.moquette.broker.metrics.MessageMetricsHandler.channelRead(MessageMetricsHandler.java:50)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.moquette.broker.metrics.BytesMetricsHandler.channelRead(BytesMetricsHandler.java:51)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: java.lang.IllegalArgumentException: Could not serialize io.moquette.broker.SessionRegistry$PublishedMessage@2c5195b1 [1.4.199/0] [1.4.199/3]
	at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:883)
	at org.h2.mvstore.MVStore.store(MVStore.java:1194)
	at org.h2.mvstore.MVStore.commit(MVStore.java:1166)
	at io.moquette.persistence.H2Builder.lambda$initStore$0(H2Builder.java:45)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	... 1 common frames omitted
Caused by: java.lang.IllegalArgumentException: Could not serialize io.moquette.broker.SessionRegistry$PublishedMessage@2c5195b1 [1.4.199/0]
	at org.h2.mvstore.DataUtils.newIllegalArgumentException(DataUtils.java:857)
	at org.h2.mvstore.type.ObjectDataType.serialize(ObjectDataType.java:359)
	at org.h2.mvstore.type.ObjectDataType$SerializedObjectType.write(ObjectDataType.java:1527)
	at org.h2.mvstore.type.ObjectDataType.write(ObjectDataType.java:127)
	at org.h2.mvstore.type.ObjectDataType.write(ObjectDataType.java:121)
	at org.h2.mvstore.Page$Leaf.writeValues(Page.java:1556)
	at org.h2.mvstore.Page.write(Page.java:732)
	at org.h2.mvstore.Page$Leaf.writeUnsavedRecursive(Page.java:1565)
	at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1298)
	at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1284)
	at org.h2.mvstore.Page$NonLeaf.writeChildrenRecursive(Page.java:1298)
	at org.h2.mvstore.Page$NonLeaf.writeUnsavedRecursive(Page.java:1284)
	at org.h2.mvstore.MVStore.storeNow(MVStore.java:1290)
	at org.h2.mvstore.MVStore.store(MVStore.java:1190)
	... 9 common frames omitted
Caused by: java.io.NotSerializableException: io.moquette.broker.SessionRegistry$PublishedMessage
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at org.h2.mvstore.type.ObjectDataType.serialize(ObjectDataType.java:356)
	... 21 common frames omitted

Steps to reproduce
Not quite clear yet
Minimal yet complete reproducer code (or URL to code) or complete log file
None yet
Moquette MQTT version
0.14
JVM version (e.g. java -version)
OpenJDK 1.8
OS version (e.g. uname -a)
Linux

I just got the exception again, but this time I could still get at the entire log file. The exception happens out of the blue, with no prior errors.
In the log I've found 6 variations of the exception that differ in the first part, the the "causes" sections are all identical.

I just got the exception again, but this time I could still get at the entire log file. The exception happens out of the blue, with no prior errors.
In the log I've found 6 variations of the exception that differ in the first part, the the "causes" sections are all identical.

Finally managed to reliably reproduce it reliably. All one needs to do is have a SessionRegistry$PublishedMessage be stored in H2. That however, is easier said than done :)
Fast way to reproduce:

git clone https://github.com/hylkevds/moquetteTests.git
In your favourite IDE

Set a breakpoint at Session.java:337
debug tests.moquettetests.MoquetteTest

What it does:

Create a broker

With H2 store
With BrokerConstants.AUTOSAVE_INTERVAL_PROPERTY_NAME set to 1 (second)

Create a paho client

That has cleansession = false
That listens on some topics with QOS=1

Create a thread that posts messages

With QOS=2
With a frequency high enough to force messages on the queue

Why this reproduces it: The breakpoint makes sure that any message put on the queue is not removed, thus making H2 store it as soon as the autosave triggers (every second)

I've created a PR that seems to fix the problem. I hope I got the serialization of the ByteBuf correct.


text:
Unable to use code sample in README.md

I was following your example code on README.md. However when running babel with this presets: presets: ['es2015', 'react'], it gives me this error:

> 43 | onChange = (event, { newValue }) => {
     |          ^
  44 |     this.setState({
  45 |       value: newValue
  46 |     });

What did I do wrong? I am new to react and eager to learn :)

To use class properties, like I do in the README, you also need:
{
  "plugins": ["transform-class-properties"]
}

Alternatively, you could use the stage-0 preset (that's what I do).

Closing for now.

thank you 👍

source: gharchive/issue

authors: fajarmf moroshko

repo: moroshko/react-autosuggest

license: mit

license_type: permissive

license_source: bigquery


text:
Recommend another toolbox

Hello, maybe you will like this, another tool set that contains more tools and is more powerful.
https://github.com/VulnTotal-Team/Vehicle-Security-Toolkit/tree/main/apk_scan
https://github.com/VulnTotal-Team/Vehicle-Security-Toolkit/blob/main/apk-allinone.py

Great suggestions I will look into it

authors: firmianay morpheuslord

repo: morpheuslord/QuadraInspect

license: MIT

license_source: github-api


text:
update readme badges

update the readme badges to point to the new morphometrics org

Codecov Report

Merging #33 (6996a0d) into main (0061237) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #33   +/-   ##
=======================================
  Coverage   92.71%   92.71%
=======================================
  Files          48       48
  Lines        1853     1853
=======================================
  Hits         1718     1718
  Misses        135      135

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

source: gharchive/pull-request

authors: codecov-commenter kevinyamauchi

repo: morphometrics/morphometrics


text:
🛑 Bama is down

In 1e373a2, Bama (https://bama.design) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Bama is back up in b41fe12 after 6 minutes.

repo: mortonpepper/upptime-upptime


text:
Add license

Love this library! Thanks for all the effort. Under which license are you making this available?

Thank you, I added the MIT License! I'm happy that you find it useful, considering how hard it is to setup (build a CoAP client, generate a DTLS identity and so on...)


text:
Adapt addNormalizer to symfony tag

Symfony tag is giving an iterable as paramater instead of the good
typehint.

:+1:

authors: Lucas-Lombardo gmorel

repo: mosaichealth/normalizer


text:
train error during evaluation

Hi thanks for this contribution
as a small exercise I am training SD2 on the pokemon dataset
I precomputed the latents and it starts training on one gpu
However at the evaluation time I get the following error
File "/fsx_vfx/users/csegalin/code/diffusion/venv/lib/python3.10/site-packages/composer/trainer/trainer.py", line 2814, in _eval_loop
    self.state.outputs = self._original_model.eval_forward(self.state.batch)
  File "/fsx_vfx/users/csegalin/code/diffusion/diffusion/models/stable_diffusion.py", line 255, in eval_forward
    gen_images = self.generate(tokenized_prompts=prompts,
  File "/fsx_vfx/users/csegalin/code/diffusion/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/fsx_vfx/users/csegalin/code/diffusion/diffusion/models/stable_diffusion.py", line 464, in generate
    pred = self.unet(latent_model_input,
  File "/fsx_vfx/users/csegalin/code/diffusion/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/fsx_vfx/users/csegalin/code/diffusion/venv/lib/python3.10/site-packages/diffusers/models/unet_2d_condition.py", line 934, in forward
    sample = self.conv_in(sample)
  File "/fsx_vfx/users/csegalin/code/diffusion/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/fsx_vfx/users/csegalin/code/diffusion/venv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 463, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/fsx_vfx/users/csegalin/code/diffusion/venv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Calculated padded input size per channel: (162 x 2). Kernel size: (3 x 3). Kernel size can't be greater than actual input size`

this is my confguration
name: trial0 # Insert wandb run name
project: pokemon_sd2_256 # Insert wandb project name
seed: 17
eval_first: false
algorithms:
  low_precision_groupnorm:
    attribute: unet
    precision: amp_fp16
  low_precision_layernorm:
    attribute: unet
    precision: amp_fp16
model:
  _target_: diffusion.models.models.stable_diffusion_2
  pretrained: false
  precomputed_latents: true
  encode_latents_in_fp16: true
  fsdp: true
  val_metrics:
    - _target_: torchmetrics.MeanSquaredError
    - _target_: torchmetrics.image.fid.FrechetInceptionDistance
      normalize: true
  val_guidance_scales: [3, 7]
  # val_guidance_scales: []
  loss_bins: []
dataset:
  train_batch_size: 1 # Global training batch size
  eval_batch_size: 1  # Global evaluation batch size
  train_dataset:
    _target_: diffusion.datasets.pokemon.pokemon.build_streaming_dataloader
      # Path to object store bucket(s)
    local: /fsx_vfx/users/csegalin/data/pokemon/latents2_train
      # Path to corresponding local dataset(s)
    mode: 0
    version: 2
    drop_last: False
    shuffle: true
    prefetch_factor: 2
    num_workers: 8
    persistent_workers: true
    pin_memory: true
  eval_dataset:
    _target_: diffusion.datasets.pokemon.pokemon.build_streaming_dataloader
    local: /fsx_vfx/users/csegalin/data/pokemon/latents2_eval # Path to local dataset cache
    prefetch_factor: 2
    num_workers: 8
    persistent_workers: True
    pin_memory: True
    mode: 0
    version: 2
optimizer:
  _target_: torch.optim.AdamW
  lr: 1.0e-5
  weight_decay: 0.01
scheduler:
  _target_: composer.optim.LinearWithWarmupScheduler
  t_warmup: 1000ba
  alpha_f: 1.0
logger:
  comet-ml:
    _target_: composer.loggers.cometml_logger.CometMLLogger
    name: ${name}
    project_name: ${project}
callbacks:
  speed_monitor:
    _target_: composer.callbacks.speed_monitor.SpeedMonitor
    window_size: 10
  lr_monitor:
    _target_: composer.callbacks.lr_monitor.LRMonitor
  memory_monitor:
    _target_: composer.callbacks.memory_monitor.MemoryMonitor
  runtime_estimator:
    _target_: composer.callbacks.runtime_estimator.RuntimeEstimator
  optimizer_monitor:
    _target_: composer.callbacks.OptimizerMonitor
  image_monitor:
    _target_: diffusion.callbacks.log_diffusion_images.LogDiffusionImages
    prompts: # add any prompts you would like to visualize
    - cute dragon creature
    size: 256 # generated image resolution
    guidance_scale: 3
trainer:
  _target_: composer.Trainer
  device: gpu
  max_duration: 550000ba
  eval_interval: 1000ba
  device_train_microbatch_size: 1
  run_name: ${name}
  seed: ${seed}
  save_folder:  trained_model # Insert path to save folder or bucket
  save_interval: 3000ba
  save_overwrite: true
  autoresume: false
  # fsdp_config:
  #   sharding_strategy: "SHARD_GRAD_OP"

``

I think I solved setting false fspd in config

when I try to train on a multi gpu machine  (resetting fspd to true) and uncommenting last two lines of the config and batch size accordingly  I get this error

ValueError: The world_size(2) > 1 but dataloader does not use DistributedSampler. This will cause all ranks to train on the same data, removing any benefit from multi-GPU training. To resolve this, create a Dataloader with DistributedSampler. For example, DataLoader(..., sampler=composer.utils.dist.get_sampler(...)).Alternatively, the process group can be instantiated with composer.utils.dist.instantiate_dist(...) and DistributedSampler can directly be created with DataLoader(..., sampler=DistributedSampler(...)). For more information, see https://pytorch.org/docs/stable/data.html#torch.utils.data.distributed.DistributedSampler.

I don't see a distributesampler for the laion or coco functions

repo: mosaicml/diffusion


text:
Integration with Jax?

Hey guys,
Huge fan of the work you guys did with Composer, and was very excited to see this -- IMO fills a much needed whole on the data infra side.
I'm curious if it's recommended / if anyone's played around using this with Flax/JAX? I think the MDS is a nice solution to still having random access to sharded, serialized data (and sharded tfrecords + tf.Data is a pretty common stack). I know it's early days, but would love to know if anyone can warn me of any sharp edges / pitfalls ahead.
On a similar note, I'm not an expert in the PyTorch ecosystem, but as I understood the torch dataloaders have had issues keeping the GPUs fed. It looks like the recommended setup right now is to pass a StreamingDataset to a torch dataloader -- did you guys notice any issues related to the GPU usage?
Thanks!

@rdilip Closing this issue for now. Please feel free to re-open in case your issue is not addressed. Thanks!

repo: mosaicml/streaming


text:
Updated GOMC analysis.

Previous merge request was automatically deleted because I couldn't find a quick way to not include a file in a pull request so I deleted and reforked the repository.
https://github.com/mosdef-hub/reproducibility_study/pull/190
I attached the files that show that analysis does not impact the simulation by running simulation without analysis (rcloned) and with analysis (startToFinish)
startToFinishData.zip
rclonedData.zip
)

Updated data from 16 replicates of methane run:
setAverages.txt

I will approve this PR.  The only little thing I noticed is that when adding replicates, the analysis will not run for the new replicates unless the original replicate's analysis files are deleted.  I don't think this should be an issue for anyone, but thought it was worth noting in the comments.


text:
FavoriteServers and FavoriteVolumes

Is there a way to edit the other lists like FavoriteServers and FavoriteVolumes?

On newer MacOS versions (e.g. Catalina), the new location of those lists are here:
~/Library/Application Support/com.apple.sharedfilelist/
also there is a tool to list them, but which does not edit them.
sfltool list

authors: garneran pradorocchi

repo: mosen/mysides


text:
ext-auth: implement failure_mode_allow

See https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/ext_authz/v3/ext_authz.proto.html

plz assign this issue to me

authors: hanxiantao spacewander

repo: mosn/htnn


text:
add metric config for layotto

What this PR does:
add metric config for layotto #379
user can use curl --location --request GET 'http://127.0.0.1:34903/metrics' to get metric of mosn, and result should be like this:

Which issue(s) this PR fixes:

Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:

Great ! Could u please add a simple document for it ?

authors: seeflood wenxuwan

repo: mosn/layotto


text:
cli.py: Return 1 if there is any lint failure

Great project you have here!
For painless integration in CI, I made a PR to return 1 in case there is any lint error. The command will return 0 otherwise.

Thank you for this patch and sorry for the delay! I have not integrated jinjalint with the CI in an existing project yet so there are probably a few other issues like this one.

(btw I just fixed the CI status on the master branch)

authors: malikolivier motet-a

repo: motet-a/jinjalint


text:
🛑 berty.tech is down

In 5d08a3f, berty.tech (https://www.berty.tech/) was down:

HTTP code: 0
Response time: 0 ms

Resolved: berty.tech is back up in 8f451ac.

repo: moul/uptime


text:
Hot fix

Describe tus cambios
(Opcional) Sobre todo aconsejable si la "Pull Request" se corresponde con una corrección adicional y no con la presentación de un ejercicio.
Comprobaciones
Asegúrate de cumplir los siguientes puntos antes de realizar la "Pull Request":

[x] El título de mi Pull Request sigue este formato: "#[número] - [lenguaje_utilizado]". (Ej: #00 - Python")
[x] El nombre el fichero que se corresponde con el de mi usuario en GitHub más la extensión del lenguaje. (Ej: mouredev.py)
[x] El fichero de corrección se encuentra dentro del directorio del ejercicio y en una carpeta con el nombre del lenguaje de programación utilizado en minúsculas. (Ej: 00/python/mouredev.py)
[x] He revisado que el nombre del directorio del lenguaje no es conflictivo:

c#, no csharp
c++, no cplusplus
go, no golang
javascript, no js

[x] Únicamente he incluido los ficheros de ejercicios. No se aceptarán Pull Requests que contengan archivos adicionales asociados a editores de código o semejantes.

Información

Tienes toda la información sobre los retos semanales en retosdeprogramacion.com/roadmap.
Cada semana se realizará la corrección en directo y publicación de un nuevo reto en twitch.tv/mouredev.
Recuerda que tienes un grupo de apoyo llamado "reto-semanal" en Discord.

Quieres eliminar el ejercicio #5 Valor y referencia?

Si, por favor!

Hola,
Cerramos PR por inactividad. Puedes enviar una nueva cuando quieras. Recuerda revisar reglas y comentarios.
Muchas gracias.

authors: SaicoBys kontroldev

repo: mouredev/roadmap-retos-programacion


text:
Undocumented: orient2d returns -0, not +0

For all the cases I tested, orient2d returns -0, not +0 as I would have assumed, since the readme doesn't specify a sign. Is this always the case? If not, under what circumstances would it not be?
One interesting (although possibly out-of-scope) idea for remedying this asymmetry for collinear points would be to return +0 if b is between a and c, and -0 otherwise (or vice versa). That would allow distinguishing between 0º and 180º angles, which might be kinda cool. (Like for example, one use-case for that could be checking the convexity of a polygon... you can make only same-sign turns and 0º turns, but not 180º turns). Effectively that would mean the half-open interval [0º, 180º) would be positive-signed and [180º, 360º) would be negative-signed, which seems a bit more symmetric & informative than the current behavior of the open interval (0º, 180º) positive-signed and closed interval [180º, 360º] negative-signed. Food for thought 😄

It just hit me: I'm guessing this is a side-effect of your reversal of the Y-axis, since the original predicates code doesn't do this.

Closing as 2 wrongs make a right.

repo: mourner/robust-predicates

license: Unlicense


text:
[NEED URGENT HELP] Not able to see any topics in context tab of the hand-eye calibration window

Description
I'm trying to do hand-in-eye calibration for kmriiwa robotic arm, but I can't see any topics being published in the context tab of the calibration window.
Your environment

ROS Distro: Noetic
OS Version: e.g. Ubuntu 20.04.6 LTS

Steps to reproduce
Tell us how to reproduce this issue. Attempt to provide a working demo, perhaps using Docker.
I followed this - https://ros-planning.github.io/moveit_tutorials/doc/hand_eye_calibration/hand_eye_calibration_tutorial.html , I can see the relevant topics in the image and camera info drop downs. These are the error messages I'm getting on terminal and moveit -

I am not able to see anything in the context tab here -

Although I am publishing the robot link transformations from iiwa. Can someone please help me out here?
I am getting an error saying robot_model not found, or robot_description has been overwritten, but I think I've made sure not to overwrite the robot_description parameter in the launch files. I don't understand how or why this error is occurring again and again.

Hey, I am currently facing the same problem. Were you able to solve this issue?


text:
fix:typos and broken links

This PR fixes #44 #83 and some minor typos

@Rahat-ch Can you review the PR?

repo: movementlabsxyz/movement-docs


text:
🛑 DSM is down

In 5e70c49, DSM (https://dsm.timovolkmann.de) was down:

HTTP code: 0
Response time: 0 ms

Resolved: DSM is back up in 56c577a.

repo: moximoti/upptime


text:
Impossible to compose a lock..

when attempting to compose a release function, e.g. so that re-requesting the lock (if it exists) returns the release function, it fails stating:
TypeError: method is not a function
Example implementation:
        const release = getLock(file);
        let released = false;
        locks[file] = () => {
            if (!released) {
                released = true;
                release();
                delete locks[file];
            }
        };

Suspected cause: you're using function composition so that even with an arrow function, somehow scope is lost and method returns as undefined

Still seeing this

repo: moxystudio/node-proper-lockfile


text:
Added separate ToS page (bug 1209226)

Work in Progress:
Having issues with tests due to the fact that the user is populated somewhere in the unit tests which automatically causes the request to forward onto the next step (throwing assertion errors). Can't seem to figure out how to populate that request.user object.

r- because of missing api_key_agreement tests and also too much copy/paste of existing code

I stubbed out the view for showing the API key but I was going to leave that for a separate PR. Everything else should be resolve aside from the one comment that I replied to.

r- for some fixups needed to the test logic. Let me know if you get stuck or have questions.

The redirect chain test looks a little fragile so I offered a solution for that. Otherwise, r+ on the latest changes. Thanks!

repo: mozilla/olympia


text:
How to avoid using a retry workaround to get fonts rendered correctly?

I have a kind-of working setup (node using canvas package in debian container) that successfully rasterizes a variety of PDF types. However it is based on a hacky workaround, which is basically:
try {
  return await attemptConversion(pdfData, true);
} catch (x) {
  return await attemptConversion(pdfData, false);
}

const CMAP_URL = "node_modules/pdfjs-dist/cmaps/";
const STANDARD_FONT_DATA_URL = "node_modules/pdfjs-dist/standard_fonts/";

async function attemptConversion(pdfData, firstTry) {
  const pdfDoc = await pdfjsLib.getDocument({
    data: pdfData,
    cMapUrl: CMAP_URL,
    cMapPacked: true,
    standardFontDataUrl: STANDARD_FONT_DATA_URL,
    disableFontFace: firstTry
    stopAtErrors: firstTry
  }).promise;

  // loop through pages and render to canvas to get a bitmap...

i.e. try rendering with disableFontFace = true and stopAtErrors = true, if necessary retry with disableFontFace = false.
I have to use this workaround because some real-world PDFs only render correctly with disableFontFace = false and some only work with disableFontFace = true. So there's a matrix of outcomes:

PDF
disableFontFace = false
disableFontFace = true

test1.pdf
✔
❌ no text rendered

test2.pdf
❌ renders block chars
✔

So presumably this workaround is broken if the PDF has a mix of font types.
Is there a configuration I can use that will make it use disableFontFace appropriately the fly, depending on what will work for each font?

That sounds plausible given that some failures will just look wrong. So I'm not talking about the general case, just this case where it is possible to programmatically determine what setting to use - pdf.js throws an exception, so it has spotted the problem.
In cases such as this, where I can already see it can be programmatically determined, can I do anything to select the appropriate method of rendering fonts on a per-font basis?

can I do anything to select the appropriate method of rendering fonts on a per-font basis?

No, and introducing a new option (which usually requires adding/maintaining a bunch of code and tests) for a feature that'd only work sometimes doesn't really strike me as a good idea unfortunately (since it'd have to work with all the existing options).

authors: Snuffleupagus danielearwicker


text:
Embedded font displayed as random characters

I made a document using Scribus 1.5.0svn with only the text "This should be readable" in it using the embedded Arial Regular font. While it displays fine in Adobe Acrobat Reader DC, PDF.js displays random characters when using Windows 10 x64 and Firefox 43.0.4.
Initially I thought my issues with the Scribus PDF exports were fixed by #6068. That issue is still fixed, so this is not a regression, but something must have changed in the meantime (either in Scribus or in my system fonts) because, as far as I can remember, this new PDF is generated in the exact same way as the one in that issue, yet this one is broken and the other one is not.
Here is a reduced test case for inclusion in the PR that fixes this issue:
example.pdf
Using Brendan's PDF browser I see that this font also has names of the form uniXXX in the differences array, which might indicate a similarity with #6090. @Snuffleupagus Do you perhaps have an idea if the fix for this issue is similar to the one in #6090, but for a different code path?

[...] but something must have changed in the meantime (either in Scribus or in my system fonts)

The embedded TrueType fonts are not entirely identical, since the 'post' table1 format differs:
in #6068 it's 2, and here it's 3. Note how properties.glyphNames is undefined in the latter case2.
Also, it seems that Scribus PDF includes a lot of unnecessary junk in the files it generates, so I figured it couldn't hurt to "reduce" the PDF file even more :)

[1] https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6post.html
[2] https://github.com/mozilla/pdf.js/blob/master/src/core/fonts.js#L3748-L3815

authors: Snuffleupagus timvandermeij


text:
Replace dir-dependent padding-left/padding-right/text-align with logical properties

Please note: This is small first step in what will, time permitting, become a series of patches to simplify/modernize the viewer CSS.
Rather than having to manually specify ltr/rtl-specific padding-values in the CSS, we can use logical padding instead (and similar for text-align).
These logical properties depend on, among other things, the direction of the HTML document which we always specify in the viewer.
Note that a number of logical CSS properties are new enough that we'll need to use PostCSS plugins, however the ones in this patch are natively supported in all browsers that we currently support:

https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-start#browser_compatibility
https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-end#browser_compatibility
https://developer.mozilla.org/en-US/docs/Web/CSS/text-align#browser_compatibility

/botio-linux preview

I didn't know about those CSS properties yet, but this is very useful to avoid duplication. Thank you for doing this!


text:
Add (basic) support for Optional Content in Annotations

Given that Annotations can also have an OC-entry, we need to take that into account when generating their operatorLists.
Note that in order to simplify the patch the getOperatorList-methods, for the Annotation-classes, were converted to be async.

/botio test

/botio-windows test

In the JS api there is an OCG object which allows to show/hide the corresponding OC layer, do you think it's worth spending to implement it ?

Perhaps not, unless it turns out to be at least a somewhat common requested feature.

Do you know if OCG are widely spread in Acroform to make them more "dynamic" ?

I can only recall having seeing such a document once before, but of course I cannot find it right now.


text:
Update Puppeteer to the latest version

This also required updating the postinstall-step to account for recent changes in Puppeteer.

Given that Firefox Nightly was just updated to version 120, let's re-run the tests to check that nothing else is broken here.
/botio test

/botio makeref

/botio-windows makeref

authors: Snuffleupagus calixteman


text:
Play() sub-second resolution?

I'm using popcorn.js to create a custom video controller and am running into issues with the resolution of the play() function.  You can test it out here:
http://spin360-staging.herokuapp.com/projects/2
The video is compiled of images at a 5 fps framerate.  Each position on the slider is set to increment the video by 0.2 seconds.  You can see that for particular times, the video is not advanced properly, missing frames of the video.
Another way to test this out is using the console; I created two functions to test the video playback:
function goToImage(image_number){
    $pop.play(image_number*0.2);
    console.log('time: ' + image_number*0.2);
    $pop.pause();
}

function goToTime(time){
    $pop.play(time);
    $pop.pause();
}

For an example of the issue, you can try goToImage(2) and then goToImage(3) to see that a frame has been skipped.
In the documentation I've seen of popcorn.js, play() is always used for full-integer increments.  Are there any working examples using fractions of a second?

Unfortunately, the HTML5 Video specification is missing any notion of "frames". There is a timeupdate event, but it's specified as:

When the earliest possible position changes, then: if the current playback position is before the earliest possible position, the user agent must seek to the earliest possible position; otherwise, if the user agent has not fired a timeupdate event at the element in the past 15 to 250ms and is not still running event handlers for such an event, then the user agent must queue a task to fire a simple event named timeupdate at the element.

The best we can do to fake higher resolution "timeupdate" with a requestAnimationFrame loop—but there is no way to sync to specific frames by specific frame rates.

authors: rwaldron ttseng

repo: mozilla/popcorn-js


text:
Split completion row into own component. r=bgrins

Fixes #604

Coverage increased (+0.2%) to 43.049% when pulling f11fea24021daf5c4942e5b8ecb101dd30c13dc5 on linclark:604-completion-row into 0b453f03769f9bdaf5293bd7f8e84c7436c26d88 on mozilla:master.

Really happy to see this PR @linclark

Good call, I extracted the styles out and that makes things much clearer. If anyone has suggestions for other const names for them, lmk.
@bgrins, I want to make sure that you have a chance to review this before we land it. No rush, I'll be off doing this for a while 🚴🌅

Coverage decreased (-0.01%) to 42.857% when pulling 82a458da5a1bf267ab94f5da6e73ff602631f7e8 on linclark:604-completion-row into 0b453f03769f9bdaf5293bd7f8e84c7436c26d88 on mozilla:master.

I've left a few notes, clearing review flag (not sure if that's the correct process here)

Hey hey, look at that, it even works now. Marking for review again.

LGTM, thanks!  Please squash when landing

Coverage increased (+0.01%) to 41.405% when pulling e7b50b3c060882e5c07c04df6837591f0f6cfa47 on linclark:604-completion-row into 2098f36de82500c9d7e8ed726931d1695bd31381 on mozilla:master.

authors: bgrins coveralls linclark victorporof

repo: mozilla/tofino


text:
Can't get stateful redis cluster connection, when the first node of redis cluster is unavailable.

Hi mp911de, My redis cluster looks like this:
Partitions [
RedisClusterNode [uri=RedisURI [host='192.168.0.122', port=6380], nodeId='071cbfb1d0706c7f5db1250f52d5fdd2c8184c56', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=0, configEpoch=1, flags=[MYSELF, MASTER], slot count=5461],
RedisClusterNode [uri=RedisURI [host='192.168.0.123', port=6380], nodeId='2f17db2a1b066bbef67339e12500e4ea3fdbd0cd', connected=true, slaveOf='9dc33d837197d9fa919e404f8580afa184821c4a', pingSentTimestamp=0, pongReceivedTimestamp=1450618611017, configEpoch=8, flags=[SLAVE], slot count=0],
RedisClusterNode [uri=RedisURI [host='192.168.0.123', port=6381], nodeId='9349de7d551a5e0ae2b73e5b0edf7efca2d28f26', connected=true, slaveOf='071cbfb1d0706c7f5db1250f52d5fdd2c8184c56', pingSentTimestamp=0, pongReceivedTimestamp=1450618610008, configEpoch=5, flags=[SLAVE], slot count=0],
RedisClusterNode [uri=RedisURI [host='192.168.0.123', port=6382], nodeId='f2cef699566014933f69ee3d61fba45ce3493d89', connected=true, slaveOf='2d8c8a96aa41f62399f10940f079ef99b1f58bdf', pingSentTimestamp=0, pongReceivedTimestamp=1450618612026, configEpoch=6, flags=[SLAVE], slot count=0],
RedisClusterNode [uri=RedisURI [host='192.168.0.122', port=6382], nodeId='9dc33d837197d9fa919e404f8580afa184821c4a', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1450618609004, configEpoch=8, flags=[MASTER], slot count=5462],
RedisClusterNode [uri=RedisURI [host='192.168.0.122', port=6381], nodeId='2d8c8a96aa41f62399f10940f079ef99b1f58bdf', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1450618613033, configEpoch=2, flags=[MASTER], slot count=5461]]

Redis client like this:
        // Syntax: redis://[password@]host[:port]
    	List<RedisURI> redisURIs = new ArrayList<RedisURI>();
    	redisURIs.add(RedisURI.create("redis://192.168.0.122:6380"));
    	redisURIs.add(RedisURI.create("redis://192.168.0.122:6381"));
    	redisURIs.add(RedisURI.create("redis://192.168.0.122:6382"));
    	redisURIs.add(RedisURI.create("redis://192.168.0.123:6380"));
    	redisURIs.add(RedisURI.create("redis://192.168.0.123:6381"));
    	redisURIs.add(RedisURI.create("redis://192.168.0.123:6382"));
        RedisClusterClient redisClient = RedisClusterClient.create(redisURIs);
        redisClient.setOptions(new ClusterClientOptions.Builder()
                .refreshClusterView(true)
                .refreshPeriod(1, TimeUnit.MINUTES)
                .build());
        System.out.println(redisClient.getPartitions().toString());
        StatefulRedisClusterConnection<String, String> connection = redisClient.connect();

        System.out.println("Connected to Redis");

        connection.close();
        redisClient.shutdown();

When 192.168.0.122:6380 is running, this client works well.
When I killed it, this client get error message:
Partitions [RedisClusterNode [uri=RedisURI [host='192.168.0.123', port=6380], nodeId='2f17db2a1b066bbef67339e12500e4ea3fdbd0cd', connected=true, slaveOf='9dc33d837197d9fa919e404f8580afa184821c4a', pingSentTimestamp=0, pongReceivedTimestamp=1450627345833, configEpoch=8, flags=[SLAVE], slot count=0], RedisClusterNode [uri=RedisURI [host='192.168.0.123', port=6381], nodeId='9349de7d551a5e0ae2b73e5b0edf7efca2d28f26', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1450627349868, configEpoch=9, flags=[MASTER], slot count=5461], RedisClusterNode [uri=RedisURI [host='192.168.0.122', port=6382], nodeId='9dc33d837197d9fa919e404f8580afa184821c4a', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1450627348860, configEpoch=8, flags=[MASTER], slot count=5462], RedisClusterNode [uri=RedisURI [host='192.168.0.123', port=6382], nodeId='f2cef699566014933f69ee3d61fba45ce3493d89', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1450627346843, configEpoch=10, flags=[MASTER], slot count=5461], RedisClusterNode [uri=RedisURI [host='192.168.0.122', port=6381], nodeId='2d8c8a96aa41f62399f10940f079ef99b1f58bdf', connected=true, slaveOf='f2cef699566014933f69ee3d61fba45ce3493d89', pingSentTimestamp=0, pongReceivedTimestamp=0, configEpoch=2, flags=[SLAVE, MYSELF], slot count=0], RedisClusterNode [uri=RedisURI [host='192.168.0.122', port=6380], nodeId='071cbfb1d0706c7f5db1250f52d5fdd2c8184c56', connected=false, slaveOf='9349de7d551a5e0ae2b73e5b0edf7efca2d28f26', pingSentTimestamp=1450627342494, pongReceivedTimestamp=1450627339768, configEpoch=9, flags=[SLAVE], slot count=0]]
Exception in thread "main" com.lambdaworks.redis.RedisConnectionException: Unable to connect to /192.168.0.122:6380
	at com.lambdaworks.redis.AbstractRedisClient.initializeChannel(AbstractRedisClient.java:216)
	at com.lambdaworks.redis.AbstractRedisClient.connectAsyncImpl(AbstractRedisClient.java:101)
	at com.lambdaworks.redis.cluster.RedisClusterClient.connectClusterImpl(RedisClusterClient.java:333)
	at com.lambdaworks.redis.cluster.RedisClusterClient.connect(RedisClusterClient.java:194)
	at com.lambdaworks.redis.cluster.RedisClusterClient.connect(RedisClusterClient.java:181)
	at com.beautyorange.test.redis.lettuceClient.App.main(App.java:37)
Caused by: java.net.ConnectException: Connection refused: /192.168.0.122:6380
	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
	at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:224)
	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:289)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
	at java.lang.Thread.run(Thread.java:745)

At the same time, run redis-trib.rb check 192.168.0.122:6381, other nodes work well and all slots covered. How to fix it?

@leofanaq lettuce fails when the first node in the seed list or the partition list (once it is loaded) is down. Currently there is no workaround. The feature to skip unhealthy nodes at connect time is overdue and I want to implement that feature.

This issue is fixed now and the fix is available as snapshot (4.1-SNAPSHOT) on Sonatype's Snapshot repo (https://oss.sonatype.org/content/repositories/snapshots/).

thanks


text:
Question - How do I provide an uamsecret ???

I need to logon to chilli. I have build the pepper.js and I am trying to use the library to logon from an angular app. Following the instructions I instatiated the peper object passed host and port and called logon... the callback function doesnt return the data object.
I should also mention that the chilli is using an uamsecret. How do I provide it?

Hi!
You don't have to provide any uamsecret option to Pepper. uamsecret is a configuration option of CoovaChilli only.
However, I remember that CoovaChilli's JSON interface doesn't work if uamsecret option is enabled and configured. And, if CoovaChilli JSON interface doesn't work, Pepper doesn't work too.
Try to disable uamsecret, then try to logon with Pepper. If it works, you could open an issue to CoovaChilli reporting that problem. I will support you in that case.

Thank you Michele for your answer an all your effords that make our work much easier! I will open an issue as you suggested.

Hi,
The UAMSecret is used to hash the password.
Hereafter a little script that uses this value. The UAMSecret must be the same as the one set in the coova chilli configuration:

$uam_secret = "J3ZYzRpqBC";

function encode_password($plain, $challenge, $secret) {
	if ((strlen($challenge) % 2) != 0 ||
	    strlen($challenge) == 0)
	    return FALSE;

	$hexchall = hex2bin($challenge);
	if ($hexchall === FALSE)
		return FALSE;

	if (strlen($secret) > 0) {
		$crypt_secret = md5($hexchall . $secret, TRUE);
		$len_secret = 16;
	} else {
		$crypt_secret = $hexchall;
		$len_secret = strlen($hexchall);
	}

	/* simulate C style \0 terminated string */
	$plain .= "\x00";
	$crypted = '';
	for ($i = 0; $i < strlen($plain); $i++)
		$crypted .= $plain[$i] ^ $crypt_secret[$i % $len_secret];

	$extra_bytes = 0;//rand(0, 16);
	for ($i = 0; $i < $extra_bytes; $i++)
		$crypted .= chr(rand(0, 255));

	return bin2hex($crypted);
}

It will be geat if this project could use this feature.

Hi Spomky,
uamsecret is described as "shared secret between uamserver and chilli". A typical use case is the following:
Client -> HTTP(S) POST -> PHP script (which uses your code and knows uamsecret) -> CoovaChilli (which of course knows uamsecret)

And we know that it works great. If you are using Pepper, the authentication flow is (almost) totally on client side:
Client with Pepper (JSONP call) <-> CoovaChilli (JSON interface)

uamsecret is supposed to be used on server side. If we put it on client side, we are potentially creating a security issue.
Can I ask you what exactly are your needs?

You are right, at the moment I use the UAM Secret within my PHP script to increase the obfuscation of the password.
If that shared secret is exposed on client side, then it becomes useless.
So it is not relevant to implement such feature on a JS library.

Yes, exactly :)

authors: Spomky greemlin mpangrazzi

repo: mpangrazzi/pepper


text:
Full screen button on iphone

Hi how to enable full screen view button on iphone? All devices have a button on Ipad, android mobile, desktop, but on iphone there is no button.

Convince Apple to support the fullscreen API in Safari on the iPhone. For iOS, Safari only supports the fullscreen API for iPads: https://caniuse.com/fullscreen

Duplicate of #467, #313, #309, and #66.

authors: lavarich mpetroff

repo: mpetroff/pannellum


text:
小程序分享功能报错

点击小程序右上角的发送给朋友，在微信开发者工具会报这样的错：
TypeError: Cannot read property 'title' of null
应该是没有读到小程序的名称，但我试着改动mpdom.min.js中的onShareAppMessage方法，让此方法直接返回一个Object，仍然会出现相同的报错。

不要改动 mpdom.min.js
你需要在 MPScaffold 中的 onWechatMiniProgramShareAppMessage 返回 Object。

一般而言，至少需要返回以下信息。
{
'title': '123123',
'path': '/pages/index/index?route=theflutterroute',
}

感谢指导。另外有一点小建议，这样的功能应该在文档中的微信小程序模块有所提及，当我想要实现分享功能的时候，我的第一反应就是查看文档的微信小程序模块。

感谢指导。另外有一点小建议，这样的功能应该在文档中的微信小程序模块有所提及，当我想要实现分享功能的时候，我的第一反应就是查看文档的微信小程序模块。

好的，这一块也准备优化调整一下。

authors: PonyCui moseyah

repo: mpflutter/mpflutter


text:
Provide support for non-negative quantities

ISO 80000 explicitly specifies quantities that have to be non-negative (width, thickness, diameter, radius).
Some of the quantities are implicitly defined as non-negative. For example, "path length" is defined as hypot(dx, dy, dz). Others are defined as the magnitude of a vector which also is always non-negative.
Some quantities are also explicitly defined as signed (i.e. height), so they should not be treated as a norm(position_vector).

We should probably provide some exceptions from the rules for engineering purposes. For example, speed is defined as a magnitude of velocity which implies that it is non-negative.
For engineering purposes, speed probably should be defined as length / time which improves usability. For example, we can easily calculate height / length without mandating users to use a linear algebra library. In such a case a negative height can result in a negative speed.

What does the library need to do,
besides permitting user-defined representation types that can catch negative values?

I think I have an answer.
Either we do nothing,
or provide a way to opt-into having a non-negative quantity type.
For example, I wrap a width and a height in a Cartesian vector.
I should be able to add and subtract these values without triggering assertions.
Sometimes, the Cartesian vector represents a size,
in which case both of the components should be non-negative.
In this case, the width and height components are equally constrained.
So there isn't anything particularly special about width.
It seems to me that ISO/IEC 80000 sometimes calls out special cases like this.
However, that shouldn't prevent us from applying the maths to manipulate these values.
As for

or provide a way to mark a given value's type as non-negative

it seems to me that we actually want an interface that both applies abs when first converting the quantity
and updates the quantity_spec to require the numerical value to be non-negative from there on.
So I can do
Quantity_of<width> auto q = (entity1.pos.x - entity2.pos.x).non_negative();

when I require the result to be the width that is non-negative,
and an equivalent interface to easily name such a constrained type.

It seems to me that ISO/IEC 80000 sometimes calls out special cases like this.

Others include quantity difference and quantity point pairs.
So where we might use quantity<time[s]> and quantity_point<time[s]> as a difference and point, respectively,
ISO/IEC 80000 might actually have different names for those.
For example, I get the impression that these come in groups of points and corresponding difference:

Position vector and displacement (Part 3, §3-1.10, §3-1.11).
Electric potential, electric potential difference, and voltage (Part 6, §6-11).
There may be a few others, but I don't remember.
I think I may have mentioned this before.
I also don't remember if V2 does anything in particular with this information.

For example, I wrap a width and a height in a Cartesian vector.
I should be able to add and subtract these values without triggering assertions.

Sure, please note that subtracting width from height is a length that is not constrained by itself.
ISQ defines only width, thickness, diameter, and radius to be non-negative. Additionally, probably quantities that are defined as magnitudes of vectors could be non-negative as well.
However, subtracting width and width will give you width as a result, and we have to decide what to do with that... 😉

So I can do
Quantity_of<width> auto q = (entity1.pos.x - entity2.pos.x).non_negative();

when I require the result to be the width that is non-negative,
and an equivalent interface to easily name such a constrained type.

I actually never thought of that, but I am not sure if that is needed. The temporary result probably does not need constraints. The check has to be done in the width constructor if the value is non-negative anyway.

I also don't remember if V2 does anything in particular with this information.

I am not sure if we should constrain some ISQ types to be used only for either quantity or quantity_point. It could be too much, but maybe we should discuss this option in a dedicated issue? Another question is who would be able to properly identify those?

For example, I wrap a width and a height in a Cartesian vector.
I should be able to add and subtract these values without triggering assertions.

Sure, please note that subtracting width from height is a length that is not constrained by itself.

I meant the vector values, which does the component-wise operation
(so no width plus height, but rather width plus width and height plus height).

However, subtracting width and width will give you width as a result, and we have to decide what to do with that... 😉

This is why I answered

Either we do nothing,
or provide a way to opt-into having a non-negative quantity type.

I forgot that to mention that it might just be the case of a missing abstraction.
Which is why I mentioned enhancing quantity_spec to recognize the constrained case.
We still want to be able to have differences and points of "negative" quantities that aren't actually constrained.
If we force the property for all uses of the quantity, it becomes engineering unfriendly.

Please note that isq::height can be negative.
Probably, you are abusing isq::width for your coordinate needs. Width is something that you may measure with a
caliper. There is no physical way for it to be negative. Maybe you should derive your own quantity_spec from isq::length to denote X axis?

Yeah, I'm considering that.
I need to do it for depth, anyways, which in ISQ is a synonym for height.
However, I'm not convinced that my abuse of width means that my opinions on how it should be handled by the library are invalid.
If it's constrained, the only reasonable way to change width values is to work on lengths before converting to widths.

I would do something like:
QUANTITY_SPEC(pos_x, isq::length);
QUANTITY_SPEC(pos_y, isq::length);
QUANTITY_SPEC(pos_z, isq::length);

I also don't remember if V2 does anything in particular with this information.

I am not sure if we should constrain some ISQ types to be used only for either quantity or quantity_point. It could be too much, but maybe we should discuss this option in a dedicated issue? Another question is who would be able to properly identify those?

I remember that we did discuss this before.
I think it was something about how a quantity difference can have different associated points.
The associated points could be different by definition, and thus not share an origin among themselves.
And I think I concluded that a quantity difference doesn't necessarily have a default associated point.
So it's the user who should opt-into using the correct quantity point for their use case.

Probably, you are abusing isq::width for your coordinate needs.

The reason I haven't convinced myself of that
is that the definition of width and height in ISO
seem to match that of the components of a Cartesian vector.

My Cartesian vectors, represented with cartesian_vector𝘕d and cartesian_point𝘕d in code,
are more specific quantities of displacement and position vector, respectively.
However, I believe it has an even more specific representation as a tuple of (width, height, depthₒₚₜ).
Only when a Cartesian vector represents a size, do all of its components need to be non-negative.
I think it's perfectly valid for a difference of widths to be negative.
A quantity is supposed to represent a quantity difference.
And quantity_point is just a more specific version representing a quantity offset from an origin.
So I think it's fine for those to be negative.
So if a quantity of width is supposed to be non-negative, what is the missing abstraction?
Is it that quantity doesn't always represent a quantity difference?
What are the implications of making it so, and enhancing quantity_spec to represent this use case?

I think it's perfectly valid for a difference of widths to be negative.

The ISQ defines width as:

minimum length of a straight line segment
between two parallel straight lines (in two
dimensions) or planes (in three dimensions)
that enclose a given geometrical shape

How can a length between two parallel lines be negative? I do not think it has anything to do with points here. If we subtract two widths, we actually do not subtract the widths but their lengths. That is why I think that the cast I mentioned above makes a lot of sense from the physical point of view.

That's why this time I'm referring to a difference of widths,
which shouldn't be the same as a width (the non-negative quantity).

Maybe it'd make more sense if quantity was named quantity_vector.
Then we could add quantity_magnitude
for the times we want the non-negative quantity
that doesn't represent a vector.
It could be implemented on top of quantity_vector (like quantity_point is),
but without operations (other than an accessor for the vector),
and possibly constrained to non-negative quantities.

So yeah, as a generalization of std::chrono::duration,
I was under the impression that mp_units::quantity was supposed to represent a vector space.
But widths don't have inverse elements, so it doesn't form a vector space.
It's still useful to have width vectors, and have their magnitude result in an actual width.
So I think quantity_magnitude is the missing abstraction.

I am not sure if that is correct. If we subtract a longer length from a shorter one and take a magnitude of it, it would not be a width in a physical sense.

If you deal with vectors, you probably should use isq:: position_vector (if your vector originates from the center of the coordinate system) or isq::displacement otherwise.you can also derive more specific quantities from them if you need additional safety.
Having those you can subtract them as you like, take the magnitude of the result and cast it to isq::width if that is what you actually deal with.

But widths don't have inverse elements, so it doesn't form a vector space.
It's still useful to have width vectors, and have their magnitude result in an actual width.
So I think quantity_magnitude is the missing abstraction.

I do not think that we miss something here. We might just misuse what we have. Notice that isq::width is defined as a scalar quantity so trying to represent it with vectors or expect it to model a vector space is wrong.

Rather than vector space, it seems like I meant more specifically affine space.
This is the vector I'm talking about: https://mpusz.github.io/mp-units/2.0/users_guide/framework_basics/the_affine_space/#vector-is-modeled-by-quantity.
And a width doesn't support this operation listed at https://mpusz.github.io/mp-units/2.0/users_guide/framework_basics/the_affine_space/#operations-in-the-affine-space:

-vector -> vector

OK, I was confused because you mentioned taking the magnitude of a vector several times. What does the magnitude of such a vector/difference quantity mean?

Also, I think I was wrong in claiming that a negative width has no physical sense. For example, let's assume that we measure the width of brake pads in my case with a caliper today and after half a year. The second measurement will be smaller, which should give me the answer that the pads shrunk by this amount. It is still a quantity of width and its value probably should be negative.

Does it mean that in case we will add support for non-negative quantities they should actually apply only to the values in the quantity_point and not for quantity?

If quantity represents a vector,
then it can't represent negative quantities like width.
But you can indeed represent changes in width.
Like you mention with https://github.com/mpusz/mp-units/issues/468#issuecomment-1708157645.
That's what vectors are for, after all.
I'm struggling more finding something that you can't measure with quantity or a vector.
That's besides nominal properties and ordinal quantities.
And of course, algebraic structures that don't form a vector space.

Does it mean that in case we will add support for non-negative quantities they should actually apply only to the values in the quantity_point and not for quantity?

I don't think so, since you can have negative points.
I really think it's a new abstraction: Magnitude.

If quantity represents a vector,
then it can't represent negative quantities like width.
But you can indeed represent changes in width.
Like you mention with https://github.com/mpusz/mp-units/issues/468#issuecomment-1708157645.
That's what vectors are for, after all.

I am not sure if I understand what you meant here. First, you say that a vector can't represent negative quantities and then you say that is obvious 😉

I don't think so, since you can have negative points.
I really think it's a new abstraction: Magnitude.

What does a negative point of width mean?

Depends on your origin, I guess.
With ideal_waist_size_of_adult_supermodel,
it'd mean your waist size is less than that of the ideal for an adult supermodel.

quantity always expresses the change of something and quantity_point provides the actual point/position. We are just not using points often enough thinking that they are mostly used for temperatures.

We are just not using points often enough, thinking that they are mostly used for temperatures.

I totally wouldn't want to mix positions and sizes/magnitudes in the type system.
I once tried to merge quantity and quantity_point,
disabling unwanted overloads with constraints.
The result was unsightly compared to each being its own template,
so I wouldn't want to do the same with quantity_point.

Depends on your origin, I guess.
With ideal_waist_size_of_adult_supermodel,
it'd mean your waist size is less than that of the ideal for an adult supermodel.

Right 😜 Do you think such an origin should be defined as absolute or relative? Maybe then, absolute values should be non-negative?

Maybe then, absolute values should be non-negative?

With something like mean_sea_level,
you'd want negative points.
And regardless of it being an absolute or relative origin,
you should be able to have negative points
(if you can do the same with any single other related origin).

But height is not specified as non-negative. Only width and derived ones in a tree: https://mpusz.github.io/mp-units/2.0/users_guide/framework_basics/systems_of_quantities/#system-of-quantities-is-not-only-about-kinds.

Yeah, I said before that width is no different than height in respect to being negative or non-negative.
You can have an object with a width and a height.
These are magnitudes, because a negative width or height for an object doesn't make sense.
So both are equally non-negative in this case,
even if ISQ defines both from different applications
(as a magnitude for width, and as a vector for height).
You can also have the object change its width or height.
A vector applied to one of the two parallel straight lines that define a width as a magnitude
can represent this change in the width of the object.
The same applies to the primitives that define the height of the object.
The object can also be in a space.
Conveniently, I use the same space of the primitives used to define its width and height.
So I use these primitives to the define
points of the object in the space (e.g., it's center), and
changes to the points of the object
(in the type system using the same vectors that describe the width and height of the object).

Terminology is hard.  "Height" can mean "height relative to a reference altitude" (which can be positive or negative), or "minimum clearance to pass over an object on the ground" (which must be non-negative).  It's important to be clear about which we're discussing when we say "height"... although I have no good ideas for how to make this distinction in code.

how to measure a negative width

I agree with ISQ; there are no negative widths.
As currently defined, mp_units can't represent a width.
mp_units::quantity is a vector.
But a width isn't a vector because its negative is undefined.
mp_units::quantity_point is a point.
But a width has no origin.
Or you could say it has the two parallel lines in its definition.
But those are very dynamic in nature; they enclose an object in a space.
Then what do mp_units::quantity<width[m]> and mp_units::quantity_point<width[m]> measure?
Is it something we want to prohibit?
And instead allow only through a new abstraction mp_units::magnitude<width[m]>?
My application has sizes, points, and vectors.
I can define a size as the magnitude of a vector.
And the vector can be the difference of two points.
So if magnitude(point_a - point_b) can give me a size,
then it makes sense that I can add a vector like point_a - point_b
to any point of the same "quantity" to change an eventual magnitude.
Do note that ISO/IEC 80000 already defines "quantities" that are points.
So it's no surprise that it also defines "quantites" that are magnitudes.
Part 8 (Acoustics) also defines logarithmic quantities,
which we haven't figured out yet (#35).
It might be that they also are their own new abstraction.
Knowing whether they make a vector space could be a starting point to figuring that out.
[ Note:
Even though ISQ remarks that height "is usually signed",
I can have non-negative heights
(i.e., magnitudes,
e.g., to describe the height of an object or space,
which isn't a point or a vector).
-- end note ]
[ Note:
In reality, some of my objects are represented with a single point offset from some origin
(e.g., the top-right of a GUI button offset from the window's top-right).
Their representation also include a size (a pair of magnitudes of width and height).
Those can be enough to manipulate all its points.
Those primitives currently go by the name of
vector<width, pixel>, magnitude<width, pixel>, and point<window, width, pixel>,
which currently respectively correspond to mp_units's
quantity<width[pixel]>, quantity<width[pixel]>, and quantity_point<window, width[pixel]>.
-- end note ]

although I have no good ideas for how to make this distinction in code.

This is why I'm contemplating using a magnitude abstraction for this.
I'm still rewriting things to use magnitude.
And mp_units also has some examples that use widths and heights.
So looking at those with this new information in mind might help in figuring things out.
I already have my own application, which is how I got here in the first place.

I wouldn't like to use the term vector here, because I prefer to leave it to quantity character so saying that width might be a vector is really misleading as ISQ says that it is a scalar quantity. ISQ defines only two vector quantities of kind length (position_vector and displacement). Using the same term for two different things leads to confusion. Can we find a better name for it (i.e. difference, offset, shift, ...)?
Also, magnitude is already taken for the "factor" of a unit. We should rename either of those to avoid the confusion. For vector quantities, we plan to use norm() to calculate the magnitude of a vector as described in #463, but this may change as well.

Terminology is hard. "Height" can mean "height relative to a reference altitude" (which can be positive or negative), or "minimum clearance to pass over an object on the ground" (which must be non-negative). It's important to be clear about which we're discussing when we say "height"... although I have no good ideas for how to make this distinction in code.

ISQ is not that specific, but if some life-critical aviation application needs to distinguish those, it can always derive its own quantity kinds from isq::height and make one of them non-negative if needed.

This is what I've settled with for now: https://cpp2.godbolt.org/z/sWj1K5rc8.
With that, I specify arguments and members that are magnitudes.
It's clear from context what's a magnitude,
so I chose for vector to be implicitly convertible to magnitude.
I still need to use magnitudes as vectors.
So I overloaded unary * on magnitude to return the vector.
Using that, I avoid having to overload vector functions for magnitudes.
So far, I've been able to rely on the implicit conversion of vector to magnitude.
But when implicit conversion doesn't happen, a named conversion might be need.
If Cpp2 had conversion operators, I'd have used that, too.

#428, and https://github.com/mpusz/mp-units/issues/353#issuecomment-1084679393 in particular,
reminded me that we can just use a constrained number type.
When it comes to saying whether such a type would be a vector space,
I think it's the same as using an unsigned number type.
That means that the domains of some operations are more restricted.

No, sorry, that not entirely right.
A number type constrained to not be negative isn't the same as an unsigned integer type.
Unsigned integer types have more defined operations
(see the last sentence of the "Note 1 to entry" of IEV 102-01-11).
Using an unsigned integer type for representing magnitudes is as problematic as
using unsigned integer types for representing sizes (e.g., of C++ standard library containers).

#428, and https://github.com/mpusz/mp-units/issues/353#issuecomment-1084679393 in particular,
reminded me that we can just use a constrained number type.
[...]
That means that the domains of some operations are more restricted.

This is also doubtful.
Elements of a vector space have an opposite.
But with such a constrained number type, all elements are out the domain of unary -.

I wouldn't recommend using unsigned type for that, but a custom wrapper for representation type could do the work. However, I do not see how it is different than adding proper checks to the constructor and assignment of quantity?

IIUC, the consensus on yesterday's meeting was that, for non-negative quantities,
contract-checking the number suffices and that anything else should prove the safety it brings.
I have been thinking that, indeed, that should suffice.
But that doesn't answer how the library should handle non-negative quantities.
Right now, we have to use a number type that is contract-checked to catch negative values.
IIRC, @rothmichaels wanted to be able to specify a quantity_spec as non-negative to reduce boilerplate.
In that case, mp_units::quantity could be contract-checked with .is_non_zero().
And a quantity_point with a non-negative quantity_spec would also be contract-checked for free.
We also talked about being able to subtract quantities specified as non-negative.
That could result in a negative value depending on the order of the arguments.
But that there are conceivable use cases where such manipulation is useful (or the lack thereof restrictive).
@mpusz also mentioned having to specify speed not as the magnitude of velocity (as in ISO 80000),
which would make it implicitly non-negative,
but as something else because negative speeds are entirely reasonable.
I still view quantity as a vector for which we should be able to always subtract in any order.
We also talked about the value of having non-negative quantities
of quantities that aren't necessarily specified as being non-negative.
Let's consider height, not specified by ISO 80000 as non-negative.
Some amusement park rides requires have a minimum height requirement on its riders.
The convenience of generalized non-negative quantities is being able to catch math errors.
Did the user get a sign wrong or arguments inverted, or simply forgot to call abs or magnitude?
So even if amusement park goers never have 0 height, we can help catch logic errors.
Based on all the feedback, I'm leaning towards this:

Not allowing users to explicitly define their quantity_specs as non-negative.
Having a magnitude<Reference, Rep> template alias that "sets the non-negative bit in quantity_spec",
that aliases quantity<Reference.non_negative(), Rep>
(I think a magnitude_point might also be useful).
I think magnitude is mainly useful in interfaces.
So in order to allow using their values as vectors,
they should drop the "non-negative bit" at the drop of a hat.
For example, given a magnitude x:

x -= y works and checks that the resulting number of x is non-negative.
x - y results in a quantity with the "non-negative bit" unset.

As an aside, I originally gave the example of frequency instead of height.
But that might not be entirely right, as it's specified in terms of period (IEV 103-06-01).
Although it being non-negative isn't clear from the ISO 80000 definition:
"duration (item 3-9) of one cycle of a periodic event".
@mpusz Here's an example of what you were wondering about other non-negative quantities in ISO/IEC 80000.

Based on all the feedback, I'm leaning towards this:

Not allowing users to explicitly define their quantity_specs as non-negative.
Having a magnitude<Reference, Rep> template alias that "sets the non-negative bit in quantity_spec",
that aliases quantity<Reference.non_negative(), Rep>
(I think a magnitude_point might also be useful).
I think magnitude is mainly useful in interfaces.
So in order to allow using their values as vectors,
they should drop the "non-negative bit" at the drop of a hat.
For example, given a magnitude x:

x -= y works and checks that the resulting number of x is non-negative.
x - y results in a quantity with the "non-negative bit" unset.

More simply, magnitude<Reference, Rep> aliases quantity<Reference, non_negative<Rep>>.
Where mp-units defines non_negative because it wants to support the good stuffs above.
Accordingly, -= is checked, and - returns the Rep (i.e., not wrapped in non_negative).

I think it was @mpusz who said that we wouldn't be having this discussion if std had something like non_negative.
I'm going to suggest that the non_negative I'm suggesting that mp-units needs
should be named magnitude_rep to highlight its special behavior.
Other constrained numbers keep their constrains when operating on them.
I'm suggesting that magnitude_rep<Rep> should instead return Rep from those.
Now, a question of safety.
Is it clear that quantity<width[m], int> can be negative?
Today's mp-units could be a source of logic errors due to users who expect naively it to be contract-checked.
I see two ways forward.
The first one is the very constraining choice of all non-negative quantities always being contract-checked.
The second one is to attempt to educate users.
My suggestion of adding magnitude is one such attempt in this direction.

because negative speeds are entirely reasonable.

The more I think of it, the more I am convinced that negative speeds should indeed be velocities. A negative value is to represent a vector in the "backward" direction, right? 😉

Let's consider height, not specified by ISO 80000 as non-negative.

Height and altitude are the same quantities in ISQ and negative altitudes are perfectly fine.

Yeah.
That's why I'm saying there's value in having it checked as non-negative
when a negative altitudes would be a logic error.

But negative altitude is possible. Nearly all Netherlands apply here ;-)

Not allowing users to explicitly define their quantity_specs as non-negative.

I do not think it is correct. For example, I think it would be perfectly fine to define:
inline constexpr struct passenger_height : quantity_spec<isq::height, non_negative> {} passenger_height;

Yeah.
But the height of a person can't be negative (nor zero).
But being able to represent that in code will help catch errors in calculations.

hat aliases quantity<Reference.non_negative(), Rep>

I would not like to increase the number of template arguments for a quantity for this "niche" use case.

But the height of a person can't be negative (nor zero).
But being able to represent that in code will help catch errors in calculations.

This is why we need a dedicated/custom quantity type for such use cases. See https://github.com/mpusz/mp-units/issues/468#issuecomment-1758273432.

passenger_height makes sense.

because negative speeds are entirely reasonable.

The more I think of it, the more I am convinced that negative speeds should indeed be velocities. A negative value is to represent a vector in the "backward" direction, right? 😉

If speed can't be negative, how do we represent changes in speed?
For example, the change in average speed of a F1 car between its adjacent races could be 0 m/s, 1 m/s, -1 m/s.

Right. The same logic could be applied to passenger_height: "The second passenger is lower by 3 cm than the first one.".
I think that quantity<Reference, non_negative<Rep>> could work, and dropping non_negative part on subtraction may make sense.

As you say, the same can be done for passenger_height.
Do we go back to measuring in height,
even thought they're still heights of passengers?
It might make sense to have a delta of a quantity_spec that is non-negative so we can measure that stuff.
But that's just adding more abstractions.
This is similar to force being a vector quantity, and the force normal a scalar quantity.
I remember seeing some ISO/IEC 80000 quantities
where some formulas used a delta of a quantity,
wondering if that'd have to be a new abstraction
to not accidentally mix "plain" differences from some kind of more specific "change" in quantity.

So yeah, I think that

if subtraction that includes a non-negative quantity returns a quantity that can be negative, and
we can name this delta quantity, e.g., quanity<width.delta[m], int>,

then we're set to be able to enable the safer default of
quantity<width[m], int> and quantity<speed[m/s], int>
being contract-checked to reject negative values.
It leaves the mouth a bit salty that the checks are done at runtime.
So it's not completely safe (maybe you never tested extreme conditions and crashed [physically] at runtime).
And specially not in the other direction, where quantity<width[m], int> is used,
but negative values would have worked fine, but you instead crashed in production.
But there's only so much safety that type-safety can buy you,
and I think this is already close to the pinnacle.
At least, it might be a good balance of safety and usability.
There are more extreme number types, as shown in #492, that go 100% safety, 0% "care about usability".

Still working through my ideas about non-negative (as well as other constrained quantities) but finally made it through this whole thread in detail so wanted to leave a few notes.
Earlier this year when discussing (DSP) level and power (i.e level^2) (both non-negative quantities) I initially thought that maybe the quantities should be allowed to be negative so you could do signed math on them and use just "non-negative" as an API precondition. I had some colleagues make some arguments in favor of these being explicitly non-negative quantities because if level were allowed to be negative then the relationship between level and power would not be isomorphic. Recently with doing various quantity/unit experiments I do think I agree with this but at the same time think being able to do signed math that could result in negative values with these quantities (thinking about ES.102: Use signed types for arithmetic). I think using a signed representation type with non-negative preconditions would violate that guideline. I'm still puzzling through ways to both follow this guideline and put preconditions on quantities that shouldn't be allowed to be negative.
First some comments older comments:

I think it's perfectly valid for a difference of widths to be negative.

The ISQ defines width as:

minimum length of a straight line segment
between two parallel straight lines (in two
dimensions) or planes (in three dimensions)
that enclose a given geometrical shape

How can a length between two parallel lines be negative? I do not think it has anything to do with points here. If we subtract two widths, we actually do not subtract the widths but their lengths. That is why I think that the cast I mentioned above makes a lot of sense from the physical point of view.

I would agree that a "width" with this definition cannot be negative. At the same time it may be useful to be able to do math with widths that could result in negative values as intermediate values in a calculation as long as the final result is non-negative when it needs to be "used" similar to the benefits of signed container sizes and signed arguments to array subscripts: if you are doing math on indexes you want to do signed math that could go negative but this is okay as long as your final result is non-negative when used as a subscript.

If I accidentally subtract the outside diameter from the inside one I will get a negative value which does not make sense and the entire purpose of this Issue is to help find such problems (unfortunately only at runtime).

I think we might be stuck with a runtime check. The only other solution I could think other than runtime checks would be to disallow subtraction but this would not help with multiplication/division which would still have a runtime precondition that the quantity is being scaled by a positive value. I guess thinking out loud, addition of a negative value would also need a precondition or not be allowed. Maybe we should not do math on non-negative quantities? This would seem to limiting I think.

So yeah, I think that

if subtraction that includes a non-negative quantity returns a quantity that can be negative, and
we can name this delta quantity, e.g., quanity<width.delta[m], int>,

then we're set to be able to enable the safer default of quantity<width[m], int> and quantity<speed[m/s], int> being contract-checked to reject negative values.

I had thought about something like a this width.delta idea but based on some internal experiments I'm not sure that I'm sold on "delta" quantity types—I'm of two minds about it. I also had thought about a variation of this idea where doing math on a width would result in a length which could then be then used to construct a width with the precondition that you are constructing it with a negative value.

It leaves the mouth a bit salty that the checks are done at runtime. So it's not completely safe (maybe you never tested extreme conditions and crashed [physically] at runtime). And specially not in the other direction, where quantity<width[m], int> is used, but negative values would have worked fine, but you instead crashed in production.
But there's only so much safety that type-safety can buy you, and I think this is already close to the pinnacle. At least, it might be a good balance of safety and usability. There are more extreme number types, as shown in #492, that go 100% safety, 0% "care about usability".

I am curious to check out the safe-numerics stuff presented at CppCon this year because maybe there is something I'm missing but it seems like run-time checks are the best solution for this although of course doesn't provide 100% safety.

IIRC, @rothmichaels wanted to be able to specify a quantity_spec as non-negative to reduce boilerplate

Reducing boilerplate was what made me first think about this but I later realized that my current approach with using non-negative representation types when creating a quantity isn't ideal because non-negative is a property of the quantity in general and if it is specified on a specific quantity template instantiation then it still allows negative values to to be used in other places in the code. If it were specified as part of the quantity_spec for "width" then all values of "width" throughout the program would be non-negative.

authors: JohelEGP chiphogg mpusz rothmichaels

repo: mpusz/mp-units


text:
PV Power needs to be negative for proper energy accounting

This should be noted in the readme: PV power must have a negative sign for proper accounting.
With positive power the computed consumption / AC-Load will be wrong, also in VRM portal:

And with negative power - as it is done with any other power source like battery discharge - the computed consumption is correct:

PV power cannot be negative. You probably have a configuration error.


text:
Add LeetCode into Coding Practiсe section

Great site for coding practice. Many categories for practicing, like Algos, DB, Shell, etc. Many algo tasks have editorial clear and illustrated solutions. For sample: https://leetcode.com/articles/symmetric-tree.

Cool! 👍

authors: ismagilov mr-mig

repo: mr-mig/every-programmer-should-know


text:
dom or domElement ?

Hey @mrdoob, great tool. I was having trouble accessing the stats.dom variable as presented in your example. On the other hand domElement works just fine (r16). Also I have switched from r17 since the Stats class will be undefined for some reason.
Language: TypeScript
CDN r17: cdnjs.com
IDE: stackblitz.com

[edit] when opening the cdn link above in a new type it will output the following:
// Error: Unexpected token: punc ({)

It seems the minified version was improperly compiled for r17. The normal js file is intact for r17. If you use r16 and domElement it should work properly.

authors: Nektro nukadelic


text:
add option to statically disable decimal mode

So I've never looked at conditional compilation before in Rust. Maybe I got something wrong here. But the tests still pass.

the cfg! macro checks for the condition at runtime. Did you intend to do that? There's also a config attribute for compile-time checks (https://doc.rust-lang.org/rust-by-example/attribute/cfg.html). On a more general note, how about we put the setting behind a feature flag? This way, library users can decide to enable it if they like. The syntax is quite similar.

I did not intend to check that flag at runtime! Thanks for the catch. I'm learning about conditional compilation in Rust as I go here so bear with.

So what I believe we've got here is #[cfg(feature="disable_decimal_mode")] essentially checks if the host has stuck in features = "disable_decimal_mode" in the Cargo.toml. This way, the flag gets passed to rustc when mos6502, its dependency, gets compiled. This will chop & change what gets compiled in. I wonder if there's anything more we need to do here.

Okay, CI is failing but it's nothing to do with this code I've just changed. I'll take a look in the morning.

Here, the tests pass again. I pushed a commit to master and then rebased this branch; hope that's okay

Here, I think this branch is ready. What do you think?

From my experience, features are usually phrased "permissively", so I'd change the feature name to just decimal_mode.
Then
#[cfg(not(feature = "disable_decimal_mode"))]

becomes
#[cfg(feature = "decimal_mode")]

At a later point in time we could consider grouping those features into more generic "emulation modes" — one for NMOS and one for CMOS for example. We could add the missing instructions for CMOS then as well. Let's keep it simple for now, though. 😉

Oh and if we want to enable decimal mode by default, we can add it to the list of default features:
default = ["decimal_mode"]

Oh I see, that's better yes I agree.
But how do we put in cargo test -F something to disable it then? Or in a host project's Cargo.toml?

To disable default features, you can pass
cargo test --no-default-features

As described in https://doc.rust-lang.org/cargo/commands/cargo-test.html#feature-selection.
So in our case we'd run cargo test for the default version with decimal support and cargo test --no-default-features for the vanilla version without decimal support.
Does that answer your question? 🤔

I suppose so, but in the future we'd want something like default = ["illegal-opcodes" "decimal-mode"]. And then we'd want to test all default features except decimal mode.

Ah, the common way is to first disable all default features and then re-enabling the ones under test, e.g.
cargo test --no-default-features -F illegal-opcodes

The same is done in the Cargo.toml of some popular projects like ripgrep here.
Granted, it gets a little tedious with many features, but it's mostly a CI thing as normal users would probably just enable one feature in the end — we can combine features into more general features to make that easier if we like. 😉
If we get to a point where testing all combinations gets awkward, we can list them in a Makefile target, but let's wait until we get there.

How's this?

Great, looks good to me. Thanks a lot @omarandlorraine.

authors: mre omarandlorraine


text:
🛑 SADaCC is down

In ba4350e, SADaCC (https://sadacc.org) was down:

HTTP code: 0
Response time: 0 ms

Resolved: SADaCC is back up in 0659c05.

repo: mrejonas/websitemonitoring


text:
version `GLIBC_2.29' not found

I've just installed minidsp-rs on Debian 10. Hardware is an Intel nuc
I've used the "minidsp_0.1.7_amd64.deb" release
hostnamectl 	Static hostname: server-familie          Icon name: computer-desktop            Chassis: desktop         Machine ID: 329b9eaea9c64edc9f55ab952f36762c            Boot ID: a2819175ee72444f987a4645ce7fdac7   Operating System: Debian GNU/Linux 10 (buster)             Kernel: Linux 4.19.0-17-amd64       Architecture: x86-64
The minidsp server doesn't start
This is my syslog output
Jul 29 12:23:14 server-familie systemd[1]: Started MiniDSP Server. Jul 29 12:23:14 server-familie minidspd[23686]: /usr/bin/minidspd: /lib/x86_64-linux-gnu/libm.so.6: versionGLIBC_2.29' not found (required by /usr/bin/minidspd)
Jul 29 12:23:14 server-familie systemd[1]: minidsp.service: Main process exited, code=exited, status=1/FAILURE
Jul 29 12:23:14 server-familie systemd[1]: minidsp.service: Failed with result 'exit-code'.
Jul 29 12:23:14 server-familie systemd[1]: minidsp.service: Service RestartSec=100ms expired, scheduling restart.
Jul 29 12:23:14 server-familie systemd[1]: minidsp.service: Scheduled restart job, restart counter is at 5.
Jul 29 12:23:14 server-familie systemd[1]: Stopped MiniDSP Server.
`
Is it possible that mindsp-rs doesn't work on debian10?

I compiled new
it works
thanks

repo: mrene/minidsp-rs


text:
Error: ETIMEDOUT exception

I can't pinpoint how this is caused but hopefully others will be able to recognize it (has happened a few times in 30 minutes of uptime). sometimes it just displays the exception and continues functioning (though have noticed it ignore commands after that) other times it just crashes.
It does only happen when someone is interacting with the Kassy, otherwise it runs fine
It did not happen when I ran it on my windows machine and later on an Ubuntu 15.04 VM. It happened while running on Kali 2.0 (Debian Jessie). Node is v5.5.0 and NPM is v3.3.2
ERR! Error in getUserInfo Error: ETIMEDOUT
ERR! Error in getUserInfo     at [object Object]._onTimeout (/root/Dev/Kassy/node_modules/request/request.js:956:15)
ERR! Error in getUserInfo     at Timer.listOnTimeout (timers.js:92:15)
ERR! Error in getUserInfo  { [Error: ETIMEDOUT]
ERR! Error in getUserInfo   cause: { [Error: ETIMEDOUT] code: 'ETIMEDOUT' },
ERR! Error in getUserInfo   isOperational: true,
ERR! Error in getUserInfo   code: 'ETIMEDOUT' }
Unhandled rejection Error: ETIMEDOUT
    at [object Object]._onTimeout (/root/Dev/Kassy/node_modules/request/request.js:956:15)
    at Timer.listOnTimeout (timers.js:92:15)
ERR! ERROR in listen -->  Error: ETIMEDOUT
ERR! ERROR in listen -->      at [object Object]._onTimeout (/root/Dev/Kassy/node_modules/request/request.js:956:15)
ERR! ERROR in listen -->      at Timer.listOnTimeout (timers.js:92:15)
ERR! ERROR in listen -->   { [Error: ETIMEDOUT]
ERR! ERROR in listen -->    cause: { [Error: ETIMEDOUT] code: 'ETIMEDOUT' },
ERR! ERROR in listen -->    isOperational: true,
ERR! ERROR in listen -->    code: 'ETIMEDOUT' }
undefined

There were other instances of similar errors as well, one of the notable ones is this

ERR! ERROR in listen -->  Error: read ECONNRESET
ERR! ERROR in listen -->      at exports._errnoException (util.js:856:11)
ERR! ERROR in listen -->      at TLSWrap.onread (net.js:544:26)
ERR! ERROR in listen -->   { [Error: read ECONNRESET]
ERR! ERROR in listen -->    cause: { [Error: read ECONNRESET] code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' },
ERR! ERROR in listen -->    isOperational: true,
ERR! ERROR in listen -->    code: 'ECONNRESET',
ERR! ERROR in listen -->    errno: 'ECONNRESET',
ERR! ERROR in listen -->    syscall: 'read' }
undefined

The errors has occured while listen getUserInfo and sendMessage

Once again this belongs upstream in https://github.com/Schmavery/facebook-chat-api/.
Any errors that begin with "ERR!" within Kassy belong there (their API is the only integration that logs to the console in that way). So you know in future: we have a less verbose way of dealing with errors (console.critical() + debug cli arg) which would simply give you an error message unless you enabled stack traces.
It has already been reported here as:
https://github.com/mrkno/Kassy/issues/30
and seems to be similar to:
https://github.com/Schmavery/facebook-chat-api/issues/147
I would suggest reporting it upstream as there is not much we can do about it here :(

authors: ParasDPain mrkno

repo: mrkno/Kassy


text:
Support colors in Unity C# styled text strings

from https://marketplace.visualstudio.com/items?itemName=MattLaceyLtd.CSInlineColorViz&ssr=false#qna

Hello, I'm wondering if there is the possibility to support strings like this: "<color=#ffa500ff><i>New connection </i></color><color=#add8e6ff><i>"? This is standard in Unity C#. Thank you!

See also https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/StyledText.html

Reference file (for testing) at https://github.com/brettcook99/C-Inline-Color-Visualizer-Test-Code/blob/main/TChat.cs

It will look like this:

Added in v1.4

repo: mrlacey/CSInlineColorViz


text:
Bioconda package

Hi,
Any plans to generate a Bioconda package for Fast-Plast?
Thank you in advance.
Best wishes,
Michal

Hi Michal,
I had not thought about it, but in looking into Bioconda packages, I think
it would be really useful (and make my life easier).  I am finishing up
some new updates for Fast-Plast, but afterward, I would be interested in do
so.
Best,
Michael
On Mon, Jan 23, 2017 at 10:16 PM, Michał T. Lorenc <notifications@github.com

wrote:

Hi,
Any plans to generate a Bioconda package
https://github.com/bioconda/bioconda-recipes for Fast-Plast?
Thank you in advance.
Best wishes,
Michal
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mrmckain/Fast-Plast/issues/11, or mute the thread
https://github.com/notifications/unsubscribe-auth/AB6GU-6FlBQ8R0vA3YvLwjdBs-g3Ubtjks5rVW0pgaJpZM4Lr0Zi
.

--
Michael R. McKain
Postdoctoral Associate
Donald Danforth Plant Science Center

Hi,
I'm wondering if conda package for the Fast-Plast is available now?
Regards,
Denis

Hi Denis,
It is not. I am doing an update of Fast-Plast. After that, I will release a conda package.
Best,
Michael

authors: DenisGoryunov mictadlo mrmckain

repo: mrmckain/Fast-Plast


text:
Disconnect and Reconnect causing files to be open

Hello,
Issue: When a client disconnects and reconnects, sometimes it is causing files to remain open.
Setup:
I am using client and server example from here: https://github.com/mrniko/netty-socketio-demo
I have made one modification in the server: ChatLauncher lines 21 onwards
                while (true) {                     data.setMessage("Sending new message at " + new Date());                     server.getBroadcastOperations().sendEvent("chatevent", data);                     Thread.sleep(2000);                 }
Reproduction Steps:
Run the ChatLauncher server and find its PID. Then do this:  lsof -p <pid_of_server> | wc -l && lsof -p <pid_of_server> | grep CLOSE_WAIT | wc -l
This command will tell you how many files are currently open by ChatLauncher and how many of them are in state CLOSE_WAIT

Start the server and client; send a message from client. Now you should see new messages come in
Refresh the page (new messages should keep coming)
Hit Disconnect
Check  lsof -p <pid_of_server> | wc -l && lsof -p <pid_of_server> | grep CLOSE_WAIT | wc -l
go to 2

As you repeat step 2 to 4, you will see that files in CLOSE_WAIT state gradually increases.
(example of TCP connections remaining open:
TCP localhost:XmlIpcRegSvc->localhost:56513 (CLOSE_WAIT))
Impact: This can be a problem in high frequency (connect/disconnect) systems since a linux server will very likely hit 4096 (standard limit) files open per process. Beyond this, the process will crash.

We were seeing a similar problem with too many open files so I attempted to reproduce this bug to see if it was the cause. It appears this issue no longer occurs, at least not with version 1.7.19--open sockets remain for ~30 sec and then are closed as expected.
The cause of our issue was ultimately found to be something outside of the socket IO library.

authors: nakulshah sclaggett

repo: mrniko/netty-socketio


text:
Migrar Husky para versão 6.0

Olhar com carinho para o #88

agora no #136


text:
❓ how to implement night mode for ios

Question
❓ how to implement night mode for ios
What I tried
No response
VisionCamera Version
2.14.1
Additional information

[ ] I am using Expo
[X] I have read the Troubleshooting Guide
[X] I agree to follow this project's Code of Conduct
[X] I searched for similar questions in the issues page as well as in the discussions page and found none.

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.

authors: mrousavy zheniagnedchik

repo: mrousavy/react-native-vision-camera


text:
Harita yanlış yeri gösteriyor.

Hata açıklaması
Koordinatlara göre harita olması gereken yer yanlış gözüküyor.
Hata tetikleme
Hatanın meydana gelmesi için yapılması gerekenler:

Şuraya gidin 'mCTerminal.exe'
Şuna tıklayın 'Haritayı Göster'
Şuraya bakın 'Harita'
Hata oluştu!

Normalde olması beklenen olay
Koordinatlar ile haritada gözüken yerin aynı olması
Ekran görüntüleri
YOK
Sistem bilgileriniz (Lütfen aşağıdaki bölümü doldurun!):

İşletim Sistemi: Windows 10 x64bit
.NET Framework Sürümü: .NET Framework 4.7.2
Program Sürümü: 0.8-alpha

Ek olarak bahsetmek istedikleriniz
Büyük ihtimalle dummy sistem ile gerçek sistem arasında gps sensöründen gelen koordinat verisinin farklı olması sebebiyle meydana gelen bir hata veya GMap.NET kütüphanesinde haritanın doğru gözükmesi için yapılan '.' işaretinden ',' işaretine dönüştürmede meydana gelen bir hata olabilir. Belkide haritaya gönderilen enlem-boylam verisinin yerleri karışmış da olabilir.

Uzun zaman sonra gelen güncelleme. Sorun çözüleli çok oldu, bu yüzden konu kapanmıştır.

repo: mrpatatesamca/mCTerminal


text:
memory leaks ?

This methods process tables of floats. Convert them to ruby, pass to a ruby method and convert back to C. Event if I skip ruby method call, memory usage raise.
Should I release this object ?
Thanks for reply.
replace(float** inputs, float** outputs, int sampleFrames) {
  if(mrb_respond_to(mrb, vst_instance, mrb_intern_lit(mrb, "process"))){
    float* in1  =  inputs[0];
    float* in2  =  inputs[1];
    float* out1 = outputs[0];
    float* out2 = outputs[1];

    mrb_value mrb_inputs = mrb_ary_new(mrb);
    mrb_value mrb_input_1 = mrb_ary_new(mrb);
    mrb_value mrb_input_2 = mrb_ary_new(mrb);

    for (int i=0;i<sampleFrames;i++) {
      mrb_ary_push(mrb, mrb_input_1, mrb_float_value(mrb, (*in1++)));
      mrb_ary_push(mrb, mrb_input_2, mrb_float_value(mrb, (*in2++)));
    }

    mrb_ary_push(mrb, mrb_inputs, mrb_input_1);
    mrb_ary_push(mrb, mrb_inputs, mrb_input_2);

    //mrb_value mrb_outputs = mrb_funcall(mrb, vst_instance, "process", 1, mrb_inputs);

    mrb_value mrb_outputs = mrb_inputs;

    if (!mrb_nil_p(mrb_outputs)) {
      mrb_value mrb_output_1 = mrb_ary_shift(mrb, mrb_outputs);
      mrb_value mrb_output_2 = mrb_ary_shift(mrb, mrb_outputs);

      for (int i=0;i<sampleFrames;i++) {
        (*out1++) = mrb_float(mrb_ary_shift(mrb, mrb_output_1));
        (*out2++) = mrb_float(mrb_ary_shift(mrb, mrb_output_2));
      }
    }
  }
}

It depends on how you call your replace function. If it doesn't return to VM loop, you have to maintain GC arena by yourself.  For more info, see #887.

Saving and restoring arena just help.
int ai = mrb_gc_arena_save(mrb);
// creating object
mrb_gc_arena_restore(mrb, ai);

Thanks a lot.

authors: fazibear matz

repo: mruby/mruby


text:
🛑 OCA Learn (VLE) is down

In 6a11a37, OCA Learn (VLE) (https://learn.oca.ac.uk) was down:

HTTP code: 0
Response time: 0 ms

Resolved: OCA Learn (VLE) is back up in b59c633 after 10 minutes.

repo: mrvinceo/ocaUptime