Provide Range function/class

In Dart code, I see code with the following structure very often:
for (var i = 0; i < 10; i++) {
  print('Hello world');
}

This is a very imperative way of programming (first, setting i to 0, then checking if i < 10 and after each iteration increasing i by one).
Most people try to code in a higher-level declarative way and I thought it's weird that the Dart core SDK doesn't have something like a Range that could be created with a to extension method on int so that you could simply do
for (final i in 0.to(10)) {
  print('Hello world');
}

Sure, there are third-party packages that offer this functionality, but this is such a fundamental, basic functionality that I believe it's common enough to be in the standard library. I'm looking forward seeing this being integrated into the platform.

The to method on int has been discussed a few times.
The arguments against it usually comes down to it being extremely unclear whether the argument value is included or not.
That is, is 10 included in 1.to(10)?
Maybe we should have improved list interpretations: [1..10] is a list with the elements 1 through 9, and [1...10] contains 1 through 10. (Not inspired by Perl at all!)
It could work for any type T which has a T operator+(int) method, where [a..b] was defined as:
[for (var tmp = a; tmp != b; tmp += 1) tmp]

and [a...b] would be:
[for (var tmp = a, wasEnd = false; !wasEnd; tmp = (wasEnd = a == b) ? tmp : tmp + 1;) tmp]

(or something more direct internally in the compiler)
There is the obvious issue with ambiguous syntax for  a..b, because it is also a cascade invocation. That's not a problem for integers, because 1..2 is not a valid cascade, but if the end is a variable, we have a problem. Using only ... would solve that part, but still hog the syntax from other potential uses.

Another option is the "slice" syntax (e.g., https://github.com/dart-lang/language/issues/1066) of [a:b].
This is currently unused syntax for lists because {a:b} only works for map literals, but if [a:b] was a list of the elements from a to b, then we would like {a:b} to be a set of those values, but that's a syntactic conflict.
So, maybe we can use (a:b) for the range iterable, and you'd have to write [...(a:b)] to get a list.
(We could also add slice operators to the language: operator[:](a, b) and operator[:]=(a, b, v) as user-definable operators, and maybe even operator[:]=[:](a, b, o, c, d) for slice assignment, although that might get a little too complicated).

I agree that it's unclear whether the argument is included or not. And yes, being able to create Iterables instead of Lists would be necessary – otherwise, there's a real overhead in first creating the whole list with items and only then iterating over it.
Maybe, instead of a slice operator, a simplistic range syntax would be enough? You could use something like 1:7 to create a range (and use that by itself i.e. in for-loops) and it would automatically enable us to do something[1:2] by overriding the operator[](Range range). Of course, this would get tricky if you tried to implement both operator[](int position) and operator[](Range range) because Dart doesn't support overloading methods yet.
Or if infix functions would be supported, a syntax like 1 to 5 or 1 until 7 (inspired by Kotlin's infix functions for exclusive and inclusive range) would be possible.
Either way, I agree that the current language doesn't allow for a terse creation of ranges, so (for now) this is more of a language issue and not an SDK issue. I'll comment on the issue your referenced, so I guess this one can be closed.

Hang on. I did talk about syntax, but before closing this for real, I want to also discuss this argument:

The arguments against it usually comes down to it being extremely unclear whether the argument value is included or not.

Regarding clear syntax: As usual, ranges being explicit or implicit is more a matter of convention than being able to see it in the function name – that's why the Effective Dart guide has a section about using inclusive start and exclusive end parameters to accept a range. The same argument of users not being able to see if 1.to(3) includes 3 could be made about not being able to see if 'hello'.substring(0, 5) includes the 5th character. The best-fitting example we can compare this to is Kotlin, which does have 1 to 3 and 1 until 4 – and it seems to work out fine for them.
Btw, I think the same problem would also apply for special syntax like 1:3 – that doesn't make it any clearer whether the range is inclusive or not.
Regarding confusion: Of course, Kotlin developers will feel right at home. Developers writing for (var i = 0; i < 10; i++) or for (var i = 0; i <= 5; i++) could be gently pushed by lint rules to use 1.to(10) and 1.until(5), respectively. Regarding developers that encounter this syntax the first time when reading other code, I can't imagine that it would take users any longer to learn that .to is exclusive than to learn that .substring is exclusive. In most IDEs, it takes only a second to hover over the function to see the comment of what it does.

If the right-open/right-closed issue confuses people you can make it explicit, kind of like Rust has:
0..<8   // [0,8)
0..=7   // [0,7]

This syntax is also nicer than 0.to(8) in my opinion.

@Timmmm Yes, I'd totally agree with you.
That's a language feature though, not an SDK feature, so it would require a lot more changes (even changes in the compiler stack) and take much longer to implement. Adding a first-level Range class and some extension methods seem like a very useful and widely applicable, yet easy-to-implement addition in the short-term.
Language-level syntactic sugar for Range creation could also be added at a later point in time.

@Timmmm I especially like this syntax. It's distinct, unambiguous, fits with Dart's general style, and will not conflict with any other operators.
I don't know how much extra work it would require though; if what @marcelgarus says is true, it probably isn't worth it.

More discussion over at https://github.com/dart-lang/collection/issues/207


dpkg-deb fails without declaration of description

When running the action without declaring a desc property, dpkg-deb fails with:

dpkg-deb: error: parsing file '.debpkg/DEBIAN/control' near line 5 package 'package:arm64':
end of file before value of field 'Description' (missing final newline)

According to the README, this should be working. All other parameters were defined.

@usimd


Running in Google Colab: Output and Running Time Issues

Hi @hukkelas,
Thanks for your work. I am currently running DeepPrivacy2's face anonymization in Google Colab using the V100 GPU, specifically the face.py anonymizer on a subset of the FDF256.
Google Colab's Parameters:

Python Version: 3.10
TensorFlow version: 2.15.0
CUDA ver. 12.2
Pytorch Version: 2.2.1+cu121

When I try to run anonymization on an image
! python3 anonymize.py configs/anonymizers/face.py -i ../DeepPrivacy2_Data/fdf256_DeepPrivacy2/002001.png --output_path ../002001.png

I get the following output:
/content/deep_privacy2
2024-03-17 14:04:53.462022: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-03-17 14:04:53.462077: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-03-17 14:04:53.463799: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-03-17 14:04:55.284089: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
pygame 2.5.2 (SDL 2.28.2, Python 3.10.12)
Hello from the pygame community. https://www.pygame.org/contribute.html
error: XDG_RUNTIME_DIR not set in the environment.
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
Saving outputs to: outputs/anonymizers/face
2024-03-17 14:05:00,615 [INFO ] logger.py: 102 [0]
anonymizer = dp2.anonymizer.Anonymizer(
    _args_=[],
    detector=dp2.detection.face_detector.FaceDetector(
        _args_=[],
        cache_directory=PosixPath("outputs/face_detection_cache"),
        face_detector_cfg={"clip_boxes": True, "name": "DSFDDetector"},
        face_post_process_cfg={"fdf128_expand": False, "target_imsize": [256, 256]},
        score_threshold=0.3,
    ),
    face_G_cfg="configs/fdf/stylegan.py",
)
checkpoint_dir = PosixPath("outputs/anonymizers/face/checkpoints")
common.experiment_name = None
common.logger_backend = ["wandb", "stdout", "json", "image_dumper"]
common.output_dir = PosixPath("outputs")
common.wandb_project = "deep_privacy2"
detector = dp2.detection.face_detector.FaceDetector(
    _args_=[],
    cache_directory=PosixPath("outputs/face_detection_cache"),
    face_detector_cfg={"clip_boxes": True, "name": "DSFDDetector"},
    face_post_process_cfg={"fdf128_expand": False, "target_imsize": [256, 256]},
    score_threshold=0.3,
)
experiment_name = "configs/anonymizers/face.py"
filename = "configs/anonymizers/face.py"
output_dir = PosixPath("outputs/anonymizers/face")

2024-03-17 14:05:01,115 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
  warnings.warn(

2024-03-17 14:05:01,115 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=None`.
  warnings.warn(msg)

Saving outputs to: outputs/fdf/stylegan
2024-03-17 14:05:04,332 [INFO ] logger.py: 102 [0]Generator loaded, num parameters: 43.131523M
2024-03-17 14:05:04,333 [INFO ] logger.py: 102 [0]W cluster centers loaded. Number of centers: 512
2024-03-17 14:05:04,381 [INFO ] logger.py: 102 [0]Loaded generator from: configs/fdf/stylegan.py
2024-03-17 14:05:04,382 [WARNI] logger.py: 102 [0]Overwriting previous file: ../002001.png
2024-03-17 14:05:05,560 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,592 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,593 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,596 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,737 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,738 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,740 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,747 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,752 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,763 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,769 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,773 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,783 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,787 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,791 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,801 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

2024-03-17 14:05:05,806 [WARNI] warnings.py: 109 /usr/local/lib/python3.10/dist-packages/torch/nn/modules/instancenorm.py:80: UserWarning: input's size at dim=1 does not match num_features. You can silence this warning by not passing in num_features, which is not used because affine=False
  warnings.warn(f"input's size at dim={feature_dim} does not match num_features. "

Saved to: ../002001.png

I still get an anonymised output, but it takes 17 seconds to complete.
As such I have a couple of questions:

How can I shorten the running time for a single anonymization, given if I were to measure FID, I would require more than 2000 samples?
You suggest face.py for face anonymization only, but can FB_cse.py also work with the FDF256 in a similar runtime?
What is the pygame terminal message, where is it from, and is it necessary to runtime?
What is the reason for the ASLA errors, given that I do have access to a GPU in Google Colab?
Why does it save to outputs/anonymizers/face and outputs/fdf/stylegan if I am only running anonymization and not training?
How can I silence the UserWarning: input's size at dim=1 does not match num_features in-code?

Thanks for taking a look.
Kind Regards.

Did you find a solution to 6?


Provide more ways to customize RequestContextExporter.

Currently, a user can export built-in properties and context attributes into the map entries with pre-defined keys. For example, BuiltInProperty.CLIENT_IP is always exported to client.ip. However, a user sometimes want to export it to a different key.
To fix this issue:

We could allow a user provide an alternative key string for a property.
We could allow a user provide a custom logic for further customization, e.g. Function<RequestContext, Map.Entry<String, ?>>.

We need to find a way to expose this functionality to logging framework integrations. Maybe putting some Java code into logback.xml and compiling it?

/cc @andrewoma

Another idea from @andrewoma:

I think something along the lines of:
<export>custom.my_name:com.foo.Bar</export> where com.foo.Bar is something that implements Function<RequestContext, Object> would be the kind of thing I'm after.

A related issue is that it would be great to name exported properties whatever the user wishes. We use JSON structured logging and having . in the name of fields is a little cumbersome for tooling.


Minor fixes

bin/lumen fixes:

Fix bin/lumen to handle spaces in $0

runtime.l fixes:

Generate an informative error when read-file or write-file fails

I merged the first fix and implemented the second using the error message returned by io.open.


Upgrade Spring Dependencies to 5.3.34-wso2v1

Purpose
$Subject

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/9241684394

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/9241684394
Status: failure

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/9241692564

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/9241692564
Status: failure

PR builder is not supported, hence the failures.

Change the $subject


Added support for Slovenian language

Added support for Slovenian language - language file.

Added support for Slovenian language - language file.

Hello!
Thank you for providing support with Slovenian language translation. Slovenian language will be added to the interface with Glow v1.88.
Best regards.


fix:CI error

Describe what this PR does / why we need it
fix:CI error
Does this pull request fix one issue?

#2030
Describe how you did it
Describe how to verify it
Special notes for reviews

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

Coverage data is based on head (08a23ec) compared to base (866a48f).
Patch has no changes to coverable lines.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2036   +/-   ##
=======================================
  Coverage   18.34%   18.34%
=======================================
  Files         101      101
  Lines        9222     9222
=======================================
  Hits         1692     1692
  Misses       7299     7299
  Partials      231      231

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

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


smtp: more valid SMTP for protocol-changed test

That is one server banner, plus one response per request

See https://github.com/OISF/suricata/pull/8141

Merged in #1013


Updating the hostplumber plugin version to 0.5.5

@vedantjoshi84 please check if this needs porting to master branch too.


Restructure project

make it more modular

This can be re-opened if someone wants to work on it.
Re-structuring was started, thanks @nx2k3 but wasn't complete. We can re-structure incrementally when working on new features.


Update TextureLoader.hpp

support loadFromMemory

Please make this and #135 into one PR and target dev.
Also:
const std::string name -> use by-value or const reference.
const unsigned char* pData, int nSize -> use std::vector


GIS examples for teaching

It might be useful to show how to work with basic GIS data.  We have an ArcGIS license at UBC, which might help.
This is used in geographic RD models,  and others.  An example:

2 sets of addresses (businesses and people).  Find the closest hospital, etc.
Consider getting google API code, and using google maps to compute commute distance.

Basic visualization?

http://geopandas.org/

This is a good idea. Also http://geojson.org/.

https://github.com/mwaugh0328/data_bootcamp_spring_2018/blob/master/week13/geopandas.ipynb
Some relevant libraries I was told about: fiona, cartopy, shapely, basemap, geocoder, pyproj


HTTP/2: Fix some errors reported by h2spec.

Motivation:
h2spec [1] reported 32 issues [2] with Netty's HTTP/2 implementation.
Modifications:
Fixed 9 of those issues. Mostly wrong error codes or added missing validation
code in the frame reader.
Result:
9 fewer errors. h2spec now reports: 70 tests, 46 passed, 1 skipped, 23 failed
[1] https://github.com/summerwind/h2spec
[2] https://github.com/netty/netty/issues/5761
PTL @Scottmitch @nmittler

PTAL @normanmaurer

@buchgr LGTM

@Scottmitch PTAL as well

1 comment and lgtm

@Scottmitch @normanmaurer @nmittler thank you for the review.
addressed comments and squashed commits.

Still LGTM

Cherry-picked into 4.1 as 515f8964b42dc34bd42cf0708a11147e2279076f


Add Kerberos credentials provider

This PR is ready for review.

Closing this and will open when we implement this.


Use cdk metadata to selectively disable a control

For making fine graned exceptions:
I saw the usage in the AWS Guard Rules Registry
They just add a condition to the resource selectors:
#
# Select all API GW Method resources from incoming template (payload)
#
let api_gw_resources_type_check = Resources.*[ Type == 'AWS::ApiGateway::DomainName'
  Metadata.guard.SuppressedRules not exists or
  Metadata.guard.SuppressedRules.* != "API_GW_ENDPOINT_TYPE_CHECK"
]

In cloudformation the exception looks like this:
"Resources": {
  "ElasticsearchDomain": {
    "Type": "AWS::Elasticsearch::Domain",
    "Metadata": {
      "guard": {
        "SuppressedRules": ["ELASTICSEARCH_ENCRYPTED_AT_REST"]
      }
    },
    "Properties": {
      "DomainName": "test"
    }
  }
}

In CDK code something like this:
function addExceptionToResource(resource: IConstruct, rulename: string) {
          const resource = resource as CfnResource;
          let metadata = resource.getMetadata('guard') || {};
          metadata['SuppressedRules'] |= []
          metadata['SuppressedRules'].push(rulename)
          resource.addMetadata('guard', metadata);
}

BTW: I have created some python/nodejs scripts that can automatically pull all the data needed for cdk-validator-cfnguard. The sources it uses to match the detailed metadata are: blackbeard service used by controltower console, two javascript files uses by the controltower console containing metadata, the aws documentation website (to get the config rule). I am already parsing the .guard resources to extract the RemediationMessage from the guard file. It will be very easy to add the metadata condition to the guard files while extracting the assets.
!! If you are interested in these scripts let me know. !!

Here is the python code I used to scrape the undocumented BlackBeard service. I hoped it contained all the necessary data but unfortunately more datasources were needed.
This script does not yet place the metadata/guard files in separate directories. That is done in another step that involves javascript from the console page using nodejs. The servicenames are in there that I use to determine the directory names.
I'd be happy to convert this script to TypeScript if you want :-)
import json
import requests
import boto3
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
import inspect
import re

def snake_to_camel(snake):
    if '_' in snake:
        return ''.join([part.capitalize() for part in snake.split('_')])
    else:
        return snake

class BlackbeardSession:
    def __init__(self, boto_session):
        self._sigv4 = SigV4Auth(boto_session.get_credentials(), 'controltower', 'eu-west-1')
        self._endpoint = 'https://prod.eu-west-1.blackbeard.aws.a2z.com'

    def do_request(self, method, **kwargs):
        args = { snake_to_camel(k): v for k, v in kwargs.items() }
        data = json.dumps(args)
        headers = {
            'Content-Type': 'application/x-amz-json-1.0',
            "X-Amz-Target": "AWSBlackbeardService." + snake_to_camel(method)
        }
        request = AWSRequest(method='POST', url=self._endpoint, data=data, headers=headers)
        request.context["payload_signing_enabled"] = True # payload signing is not supported
        self._sigv4.add_auth(request)
        prepped = request.prepare()
        response = requests.post(prepped.url, headers=prepped.headers, data=data)
        return json.loads(response.text)

    def describe_guardrail(self, **kwargs):
        nm = inspect.currentframe().f_code.co_name
        return self.do_request(nm, **kwargs)

    def list_guardrails(self, **kwargs):
        nm = inspect.currentframe().f_code.co_name
        return self.do_request(nm, **kwargs)

def get_remediation_text(template):
    remeds = set()
    for m in re.finditer(r'\[FIX\]:\s+(?P<remed>.*)\n', template, flags=re.MULTILINE):
        remeds.add(m.groupdict()["remed"])
    if len(remeds) > 1:
        print("WRONG", name)
    return list(remeds)[0]

if __name__ == "__main__":
    # you need to set up so these actions are allowed
    # "controltower:DescribeGuardrail",
    # "controltower:ListGuardrails",
    boto_session = boto3.Session(region_name='us-east-1')

    bb = BlackbeardSession(boto_session)
    nxt = None
    guardrails = []
    while True:
        r = bb.list_guardrails(**({ "NextToken": nxt } if nxt else {}))
        lst = r['GuardrailList']
        names = [guardrail["Name"] for guardrail in lst]
        guardrails.extend(r['GuardrailList'])
        nxt = r.get("NextToken", None)
        if not nxt:
            break

    for guardrail in guardrails:
        if not guardrail["Name"].startswith('CT.'):
            continue
        r = bb.describe_guardrail(guardrail_name=guardrail["Name"])
        print(guardrail["Name"])
        if r["ImplementationType"] == "AWS_CLOUDFORMATION_GUARD_RULE":
            template = r["Artifacts"][0]["Content"]
            with open("./guardrails/cfn-guard/" + guardrail["Name"].lower() + ".guard", "w") as f:
                f.write(template)
            del r["Artifacts"]
            r["RegionalPreference"] = guardrail["RegionalPreference"]
            r["RemediationMessage"] = get_remediation_text(template)
            with open("./guardrails/metadata/" + guardrail["Name"].lower() + ".metadata.json", "w") as f:
                f.write(json.dumps(r, indent=2, default=str))

Hi @Jacco. Thanks for your feedback. Regardless of the implementation mechanism, is it fair to say your goal is to have a more fine-grained way to turn controls on and off?
Regarding the script to pull from the Blackbeard API - I'm not sure how that relates to the above goal, if in fact that is your goal. If you could help me understand what you use the script for, I would appreciate it. If you're just looking for the metadata associated with each Guard control, this directory might already have what you're looking for: https://github.com/cdklabs/cdk-validator-cfnguard/blob/main/rules/control-tower/metadata

The issue is indeed fine grained control :-)
The script does not really relate to the goal, sorry for the confusion. I used this script to pull all the guard rules from ControlTower (I used it to parse the guardrules and inject the metadata conditions for my use case). I was wondering if you construct the metadata directory manually. I (almost) fully automated this using above script plus a few others. If you are doing it manually then I am happy to donate/explain my script :-)


web: Modifier should support mouse events similar to Desktop Compose

In particular: https://github.com/JetBrains/compose-jb/tree/master/tutorials/Mouse_Events
If for some reason, the API intentionally diverges due to differences in how web and desktop work, that's fine -- but there needs to be a way to support onMouseEnter, onMouseLeave, and onMouseMove at the very least.

Note: I fully expect for you to diverge from how I'm doing it, but here's what I'm doing at the moment as a workaround:
https://github.com/bitspittle/kobweb/blob/main/lib/compose-ext/src/jsMain/kotlin/kobweb/compose/ui/ModifierExtensions.kt#L64

Perhaps I don't get the question. Let's figure it out.
Currently there is a way to add listeners that you're asking about:
onMouseEnter
onMouseLeave
onMouseMove
And as I see in your code snippet you're already using them.
So my question is:
What kind of mouse events support would you like to have?

My apologies for the lack of clarity, thanks for following up with those questions.
I updated the title, hopefully it's more clear now. I think mouse events should be exposed through the Modifier class, beyond just clickable which is available right now.
FWIW, the code I linked to it in a module in my project called compose-ext which I'm hoping one day to delete entirely. I don't think it should exist - I'm just patching what I think are the current holes in the API so I can keep moving.

closing this issue. Reason: since 1.0.0 compose.web.widgets module was deprecated.

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.


I can't use delayed_job because of ActiveRecord::StatementInvalid: SQLite3::SQLException: cannot rollback - no transaction is active: rollback transaction

#controllerr

  def quizlet
    @response=[]
    response = Unirest.get "https://api.quizlet.com/2.0/search/sets/?client_id=7JH38T27zM&whitespace=1",
                           parameters:{ whitespace: true,q: "Duo3.0",term:100,sort:"most_studied"}
    res=response.body

    quizlet_ids=[]
    res["sets"].each do|res|
      quizlet_ids<<res["id"]
    end

    quizlet_words = Unirest.get "https://api.quizlet.com/2.0/sets/?client_id=7JH38T27zM&whitespace=1",
                                parameters:{ whitespace: true,set_ids:"#{quizlet_ids}"}

    quizlet_words.body.each do|words|
      words["terms"].each do|word|
        response=word
        response["quizlet_id"]=words["id"]
        response["check_id"]=word["id"]
        response["question_language"]= words["lang_terms"]
        response["answer_language"]  = words["lang_definitions"]
        @response<<response
        @response.each do|response|
          Word.delay.quizlet_save(response["quizlet_id"],response["check_id"],response["term"],response["definition"],response["question_language"],response["answer_language"])
        end
      end
    end
  end

#model

def quizlet_save(quizlet_id,check_id,question,answer,question_language,answer_language)
    unless Word.find_by(check_id:check_id)&&Word.find_by(quizlet_id:quizlet_id)
      Word.create(quizlet_id:quizlet_id,check_id:check_id,title:"Quizlet",question:question,answer:answer,user_id:1,tag_list:"English,duo3.0,Vocabulary",
                  question_language:question_language,answer_language:answer_language)
    end
    word=Word.find_by(check_id:check_id)
    unless word == nil
      checking_word=Word.find_by(quizlet_id:quizlet_id)
      group=Group.find_by(id: checking_word.group_id)
      if group==nil
        created_group=Group.new(user_id:1,title:"Quizlet",explanation:"Quizlet Duo3.0")
        created_group=created_group.save(validate: false)&&created_group
        word.update_attribute(:group_id,created_group.id)
      else
        word.update_attribute(:group_id,group.id)
      end
    end
  end

Can anybody tell me the solution?

SQLite is a single process database, meaning only one process can access the database at a time, so it does not work with DJ or any other background processor that runs in a separate process. The only option I know of that MIGHT work for you is https://rubygems.org/gems/sucker_punch

Thank you for answering. I could understand and thanks to you I used sucker_punch in my development environment but it didn't helpful in heroku that uses progresql so such a problem will never happen .So I wanna use delayed_job but an error happened that is below.
 ArgumentError (job cannot be created for non-persisted record: #<Word id: nil, group_id: nil, user_id: nil, answer: nil, question: nil, title: nil, image: nil, created_at: nil, updated_at: nil, answer_language: nil, question_language: nil, favorites_count: 0, quizlet_id: nil, check_id: nil>):
2017-07-12T09:45:33.457139+00:00 app[web.1]:   app/controllers/words_controller.rb:209:in `block (3 levels) in quizlet'
2017-07-12T09:45:33.457141+00:00 app[web.1]:   app/controllers/words_controller.rb:208:in `each'
2017-07-12T09:45:33.457141+00:00 app[web.1]:   app/controllers/words_controller.rb:208:in `block (2 levels) in quizlet'
2017-07-12T09:45:33.457142+00:00 app[web.1]:   app/controllers/words_controller.rb:201:in `each'
2017-07-12T09:45:33.457143+00:00 app[web.1]:   app/controllers/words_controller.rb:201:in `block in quizlet'
2017-07-12T09:45:33.457143+00:00 app[web.1]:   app/controllers/words_controller.rb:200:in `each'
2017-07-12T09:45:33.457144+00:00 app[web.1]:   app/controllers/words_controller.rb:200:in `quizlet'
2017-07-12T09:45:33.457144+00:00 app[web.1]:   app/controllers/words_controller.rb:49:in `new'

As the error says DJ can't create jobs for or on non-persisted records. The record must be saved before it can be used in a job.

Thanks I could fix.In spite of Asynchronous processing,It needs too much time to response so it doesn't use in Heroku. So I wanna  ask you,is that to blame for sever that is Heroku ?


Issue-1078: missed kwargs in TFT init

Before submitting (must do checklist)

[x] Did you read the contribution guide?
[x] Did you update the docs? We use Numpy format for all the methods and classes.
[x] Did you write any new necessary tests?
[x] Did you update the CHANGELOG?

Proposed Changes
I've checked other inits. It seems  TFT is the only model with such issue
Closing issues

closes #1078

Codecov Report

Merging #1084 (b8b91a0) into master (e5ce280) will decrease coverage by 0.11%.
The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@            Coverage Diff             @@
##           master    #1084      +/-   ##
==========================================
- Coverage   87.08%   86.98%   -0.11%
==========================================
  Files         170      170
  Lines        9309     9310       +1
==========================================
- Hits         8107     8098       -9
- Misses       1202     1212      +10

Impacted Files
Coverage Δ

etna/models/nn/tft.py
99.13% <100.00%> (+<0.01%)
:arrow_up:

etna/models/tbats.py
85.00% <0.00%> (-10.00%)
:arrow_down:

etna/transforms/nn/pytorch_forecasting.py
90.47% <0.00%> (-4.77%)
:arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Windows 10 application calls WSL program

Microsoft Windows [Version 10.0.19042.1110]
I want to install openfoam on ubuntu on windows, and make an application on windows to call openfoam, I want to know whether WSL can realize this function, if WSL has already had this function, which version (WSL1 or WSL2) is better?

This is not an issue, please use the discussions tab.


Update simd.md to fix Vector sample code issue

Summary
In Vector sample code, it has logic of handling case about input array length not be integral multiple of Vector.Count, but first half of code cannot handle it and will throw out of range related exception if happens. This PR is for that.
Fixes #26195

@tannergooding Could you review this code change?

Sorry for the delay, I had missed the review request here.


MassTransit with SimpleInjector 5 integration

Project MassTransit.SimpleInjectorIntegration:

Replaced reference to SimpleInjector v4.10.2 with v5.0.3.

Project MassTransit.Containers.Tests:

Created extension method to disable auto-verification (in SIv5 is on by default)

namespace MassTransit.Containers.Tests
{
    using SimpleInjector;
    using SimpleInjector.Lifestyles;

    internal static class SimpleInjectorContainerOptionSetter
    {
        public static void SetRequiredOptions(this Container container)
        {
            container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle();
            container.Options.EnableAutoVerification = false;
        }
    }
}

Replaced all occurrences of

    _container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle();

with
    _container.SetRequiredOptions();

Changed _container.Dispose() with _container.DisposeAsync() in [TearDown]/[OneTimeTearDown] methods.
For example:

[TearDown]
public void Close_container()
{
    _container.Dispose();
}

becomes
[TearDown]
public async Task Close_container()
{
    await _container.DisposeAsync();
}

All tests under namespace MassTransit.Containers.Tests.SimpleInjector_Tests passed! :heavy_check_mark:

Not on the build they didn't...

Hi,
yes I saw. The VS2019 image tests are ok but 3/1490 failed on Image Ubuntu1804 (SimpleInjector_Saga.Should_have_a_subscription_for_the_...)
I'm trying to find the problem.

Try dotnet test from the command line? The VS image only runs the tests that can't be run on Linux, like CosmosDB.

Rebased/merged, thanks!

Hi Chris,
I'm conscious that the solution provided is based on a tactical rather than a strategic approach. But at the moment it allows me and my team to use MassTransit 7 with SimpleInjector 5.
Even with the new required container options we strive to use the recommendations of the SIv5 and always use the Verify() method so it's ok.
PS: thanks a lot for your fantastic work on MassTransit. It helped us a lot to quickly move from an old db based queue management to a RabbitMQ based environment.


Bitmap to NDArray

Hi,
I have an issue while creating an NDArray from a Bitmap/Image, an exception is thrown.
var ndarray = np.array(img);

Exception message : Allocate Image
Stack Trace :
at NumSharp.Backends.TypedArrayStorage.Allocate(Shape shape, Type dtype)
at NumSharp.np.array[T](T[] data)

??? is it solved???

NumSharp does not support Image directly.
Youll have to tranform the bitmap into a byte array and then feed it to np.array, see:
https://stackoverflow.com/questions/4747428/getting-rgb-array-from-image-in-c-sharp

@Nucs I see your post, thank you. However, when I try to convert the Bitmap to a byte array and feed it into an np.array, I get a 1D array and this exception when I try to run it through Tensorflow:

System.Exception: 'input must be 4-dimensional[1] [[{{node Preprocessor/map/while/ResizeImage/ResizeBilinear}}]]'

Here is the basic code I am using for now as a test:
      public void Score()
        {
            var modelPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, tensorPb);
            var testImage = new Bitmap(@"C:\Images\test1.jpg");

            var bitmapBytes = GetBitmapBytes(testImage);
            var imgArr = NumSharp.np.array(bitmapBytes);

            var graph = new Graph().as_default();
            graph.Import(modelPath);

            Tensor tensorNum = graph.OperationByName("num_detections").output;
            Tensor tensorBoxes = graph.OperationByName("detection_boxes").output;
            Tensor tensorScores = graph.OperationByName("detection_scores").output;
            Tensor tensorClasses = graph.OperationByName("detection_classes").output;
            Tensor imgTensor = graph.OperationByName("image_tensor").output;

            Tensor[] outTensorArr = new Tensor[] { tensorNum, tensorBoxes, tensorScores, tensorClasses };

            // Start tf session
            using (var sess = tf.Session(graph))
            {
                // Run the op
                var results = sess.run(outTensorArr, new FeedItem(imgTensor, imgArr));

                NDArray[] resultArr = results.Data<NDArray>();

                BuildOutputImage(resultArr);
            }
        }

        public static byte[] GetBitmapBytes(Bitmap image)
        {
            // En garde!
            if (image == null) throw new ArgumentNullException("image");

            BitmapData bmpData = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadOnly, image.PixelFormat);
            try
            {
                // Get the address of the first line.
                IntPtr ptr = bmpData.Scan0;

                // Declare an array to hold the bytes of the bitmap.
                int bytes = bmpData.Stride * image.Height;
                byte[] pixelData = new byte[bytes];

                // Copy the RGB values into the array.
                Marshal.Copy(ptr, pixelData, 0, bytes);

                return pixelData;
            }
            finally
            {
                image.UnlockBits(bmpData);
            }
        }

@Oceania2018 In what way does TF.NET accepts an image?

Just a gentle nudge! This is really holding me up. I cannot figure out for the life of me, how to get an in memory bitmap to a 4D array to feed into things like tensorflow.

@mjbedford2017 check out the transfer learning example in TF.NET, it loads JPEG bitmaps into TF.
hope it helps.

@henon Thank you for the response. I scanned the whole file (it is massive) just to find the example you are talking about. The only thing that looks remotely close is at line 456:
        // First decode the JPEG image, resize it, and rescale the pixel values.
        var resized_input_values = sess.run(decoded_image_tensor, new FeedItem(image_data_tensor, new Tensor(image_data, TF_DataType.TF_STRING)));

I assume this is what you mean? If so, I am still having an issue with this. I can convert my in memory image to a byte array and use that byte array in place of the "image_data" byte array. However, I would need to figure out the "image_data_tensor" and the "decoded_image_tenor" items along with the session and graph to use.
Is this the line you meant? If not, can you point me a little closer because I am not seeing it.
If it is what you meant, can you help me close the gap a bit more? It seems like a huge amount of complicated work just to turn an in memory image into a 4D NDArray to feed into Tensorflow.
Thanks!!!

also look at line 544 and following in that file. there they directly decode JPG using TF, maybe you can do it the same way?

also, you don't need to use NDArray at all if that helps. you can directly create a Tensor  from a byte[], or float[] (check out the different constructors of Tensor) and feed that Tensor to the session instead of an NDArray

@henon Thank you again so much for the help, I am really stuck here. I know this is not the place to post Tensorflow.Net items but the original problem is that I cannot feed my image into my tensorflow model for object detection (using a standard MobileNet SSD model) without this error:

System.Exception: 'input must be 4-dimensional[1] [[{{node Preprocessor/map/while/ResizeImage/ResizeBilinear}}]]'

I noticed in the samples that load the image as a jpeg from a file (which work just fine) they create a 4D NDArray.
I don't care what I use, Tensor or NDArray, but I just need to feed the image in to the tensorflow model, which apparently expects it to be 4D array. The only other challenge is that my images are already in memory, not reading from a file.
This is where I am stuck.
I will look at line 544 and below to see if that helps me with this problem.
Thanks again!!!

Here are tensorflow's image related function, loading specifically:

You should look into them before you use them.
Heres an official guide on how TF handles images: https://www.tensorflow.org/hub/common_signatures/images#image_input
Allow me to quote:

A signature that takes a batch of images as input accepts them as a dense 4-D tensor of dtype float32 and shape [batch_size, height, width, 3] whose elements are RGB color values of pixels normalized to the range [0, 1]. This is what you get from tf.image.decode_*() followed by tf.image.convert_image_dtype(..., tf.float32).

Based on that quote, it seems that you simply need to read the file's bytes (File.ReadAllBytes) and pass them as a 1d to the respective format  tf.image.decode_*() where * is the format.
@mjbedford2017 Let me know if it helped.

If you have the images already in memory then you'd use this constructor:

        /// <summary>
        /// Create a N-dimensional Tensor from the given array
        /// </summary>
        public Tensor(float[] data, long[] shape, TF_DataType? dType = null)  { ...   }

Say your images are all in a single float[] called img where every image is RGB width times height and there are batch_size number of images.
var tensor = new Tensor(img, new long[]{ batch_size, height, width, 3 });

Thank you @Nucs and @henon for the very detailed help and effort on this. First of all, @Nucs, all of those image related functions look really good and I see that they are built into tensorflow. However, in the Tensorflow.Net implementation/wrapper, they are not all implemented. In the tf.Image namespace, there is only the decode_jpeg function. So, this was not going to work. Furthermore, it is a bit complicated to use those functions because you must also have a graph and session to use with them, all of which take time to set up and run. If I want to run this at close to real time, I cannot afford the extra complexity and time. With that said, I am sure your method will work in general if and when Tensorflow.Net implements the other functions.
With that said, @henon, you solution worked great! I did not realize I could create the flat image byte array as a 4D tensor and feed that into Tensorflow.Net but it worked perfectly with this one line of code
var tensor = new Tensor(img, new long[]{ batch_size, height, width, 3 });
Not only did it work by creating me a 4D Tensor but it also fed into Tensorflow.Net with no errors. It is fairly fast, it takes about 75/ms based on my logged stopwatch times, to create the Tensor from the image byte array. This will allow me to run at about 13-14 fps max based on this limitation alone.
I am going to look at ways to improve this performance a bit but for now, functionally, I am marking this as closed as this solution works great!
Thanks again for all the help to all of you!

Actually, I can't mark it as closed. Feel free to close it.

@mjbedford2017, Glad you found a solution, If I understood @henon's solution correctly,
It can be done similarly in NumSharp by calling:
var _4darray = flatbitmap_ndarray.reshape(batch_size, height, width, 3);

@mjbedford2017, I took the liberty to optimize your NDArray GetBitmapBytes(Bitmap image)
This should work atleast 50% faster. Note the //TODO there which is optional.
public static NDArray GetBitmapBytes(Bitmap image)
{
    // En garde!
    if (image == null) throw new ArgumentNullException(nameof(image));

    BitmapData bmpData = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadOnly, image.PixelFormat);
    try
    {
        unsafe
        {
            //Create a 1d vector without filling it's values to zero (similar to np.empty)
            var nd = new NDArray(NPTypeCode.Byte, Shape.Vector(bmpData.Stride * image.Height), fillZeros: false);

            // Get the respective addresses
            byte* src = (byte*)bmpData.Scan0;
            byte* dst = (byte*)nd.Unsafe.Address; //we can use unsafe because we just allocated that array and we know for sure it is contagious.

            // Copy the RGB values into the array.
            Buffer.MemoryCopy(src, dst, nd.size, nd.size); //faster than Marshal.Copy
            //TODO: replace return with: return nd.reshape(batch_size, height, width, 3);
            return nd;
        }
    }
    finally
    {
        image.UnlockBits(bmpData);
    }
}

Let me know the results, I haven't tested it locally

@Nucs Thank you again for the extra effort to help me and others out. I have some findings to report. With your first post, where you took the liberty to re-do the conversion of my in memory image to bytes. There are two major issues.

In the instantiation/creation of the new NDArray, the parameter combination you have provided is not available. First, there is no Shape.Vector. However, I can create a new Shape. Second, there is no option for fillZeros. Also, I cannot specify an NPTypeCode AND the Shape.
In the line byte* dst = (byte*)nd.Unsafe.Address; there is no parameter or property for Unsafe in the NDArray (nd). So, this line has an error.

Now for the good news!!!
I followed your other post where I can create a 4D NDArray instead of a Tensor but in a very similar way. This worked great and Tensorflow.Net was able to use this feed input as well. Furthermore, even though the two are similar, it takes 82ms to create a Tensor but only 32ms to create an NDArray with the reshape. This seems to be much faster. Thank you!
For reference, this is the line I ended up using to create a Tensor at 82ms
var imgArray2 = new Tensor(resized_image.Bytes, new long[] { 1, resized_image.Height, resized_image.Width, 3 });
And this was to create the NDArray at 32ms
var imgArr = np.array(resized_image.Bytes).reshape(1, resized_image.Height, resized_image.Width, 3);

@mjbedford2017, glad to hear.
My bad, these methods are in our alpha pre-releases (rewrite of the library) which I forgot that TF.NET is yet to support it. This code will be usable once we finish the merging the new alpha work with TF.NET.

var imgArr = np.array(resized_image.Bytes).reshape(1, resized_image.Height, resized_image.Width, 3); only took 32ms ? faster than new Tensor(resized_image.Bytes, new long[] { 1, resized_image.Height, resized_image.Width, 3 }) ? I can't believe. @mjbedford2017

@mjbedford2017 are you saying that creating an NDArray + passing into TF is faster than creating a Tensor and passing into TF? I would be surprised if it were.

Sorry for the confusion, let me explain for clarity. First, @henon no, I am not stating anything about TF processing times at the moment. The time I gave was simply to load the in memory Bitmap object into the 4D array to then be later used or passed in to TF. That process alone was 32ms for the NDArray and 82ms for the Tensor. @Oceania2018 unless i am doing it wrong, that is the result i got. I took an in memory Bitmap object and a stopwatch. Created an NPArray, reset stopwatch and then created a Tensor, one right after the other and those are the times I got. Again, just for creating the array, nothing to do with feeding in to TF yet.

There is still confusion, so I am trying to clear it up. When you create a Tensor the memory is already passed into the native C++ part of TF. When you create an NDArray, that is of course not the case and it still needs to be converted to a Tensor to be able to work with it in TF.

"And this was to create the NDArray at 32ms
var imgArr = np.array(resized_image.Bytes).reshape(1, resized_image.Height, resized_image.Width, 3);
"
May i know the details of resized_image? Is this a variable only or a function?

@itzukah, please take a look at our wiki for how to load an image Into System.Drawing.Bitmap. After you have it as a Bitmap you can resize it and load into a NDArray using bitmap.ToNDArray() extension.


Error running tests on latest packages

Received the following error when running tests on the latest packages.
Test: "WHEN user enters a valid email and passwordAND user taps on the sign-in buttonTHEN
signInWithEmailAndPassword is calledAND user is signed in"
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test:
Tried to listen to a value exposed with provider, from outside of the widget tree.

This is likely caused by an event handler (like a button's onPressed) that called
Provider.of without passing `listen: false`.

To fix, write:
Provider.of<AuthBase>(context, listen: false);

It is unsupported because may pointlessly rebuild the widget associated to the
event handler, when the widget tree doesn't care about the value.

The context used was: EmailSignInFormStateful(dirty, state: _EmailSignInFormStatefulState#4ce1f)
'package:provider/src/provider.dart':
Failed assertion: line 202 pos 7: 'context.owner.debugBuilding ||
          listen == false ||
          debugIsInInheritedProviderUpdate'

When the exception was thrown, this was the stack:
#2      Provider.of (package:provider/src/provider.dart:202:7)
#3      _EmailSignInFormStatefulState._submit (package:time_tracker_flutter_course/app/sign_in/email_sign_in_form_stateful.dart:46:29)
#4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:992:19)
#5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:1098:38)
#6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:184:24)
#7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:524:11)
#8      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:284:5)
#9      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:219:7)
#10     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:477:9)
#11     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:78:12)
#12     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:124:9)
#13     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:377:8)
#14     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:122:18)
#15     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:108:7)
#16     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:220:19)
#17     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22)
#18     TestWidgetsFlutterBinding.dispatchEvent (package:flutter_test/src/binding.dart:471:11)
#19     WidgetTester.sendEventToBinding.<anonymous closure> (package:flutter_test/src/widget_tester.dart:654:15)
#20     WidgetTester.sendEventToBinding.<anonymous closure> (package:flutter_test/src/widget_tester.dart:653:39)
#23     TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:72:41)
#24     WidgetTester.sendEventToBinding (package:flutter_test/src/widget_tester.dart:653:27)
#25     TestGesture.up.<anonymous closure> (package:flutter_test/src/test_pointer.dart:422:24)
#26     TestGesture.up.<anonymous closure> (package:flutter_test/src/test_pointer.dart:420:39)
#29     TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:72:41)
#30     TestGesture.up (package:flutter_test/src/test_pointer.dart:420:27)
#31     WidgetController.tapAt.<anonymous closure> (package:flutter_test/src/controller.dart:263:21)
#43     WidgetController.startGesture (package:flutter_test/src/controller.dart)
#54     FakeAsync.flushMicrotasks (package:fake_async/fake_async.dart:192:32)
#55     AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:1149:17)
#56     AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:1137:35)
(elided 42 frames from class _AssertionError, dart:async, dart:async-patch, and package:stack_trace)

The test description was:
  WHEN user enters a valid email and passwordAND user taps on the sign-in buttonTHEN
  signInWithEmailAndPassword is calledAND user is signed in

Fixed by adding listen: false to the _submit method
Future<void> _submit() async {
    setState(() {
      _submitted = true;
      _isLoading = true;
    });
    try {
      final auth = Provider.of<AuthBase>(context, listen: false);
      if (_formType == EmailSignInFormType.signIn) {
        await auth.signInWithEmailAndPassword(_email, _password);
      } else {
        await auth.createUserWithEmailAndPassword(_email, _password);
      }
      if (widget.onSignedIn != null) {
        widget.onSignedIn();
      }
    } on PlatformException catch (e) {
      PlatformExceptionAlertDialog(
        title: 'Sign in failed',
        exception: e,
      ).show(context);
    } finally {
      setState(() {
        _isLoading = false;
      });
    }
  }


In thermostat_over_climate mode, error when underlying climate is not available on startup

Cf title.
At startup we have an error like this:
VersatileThermostat-Thermostat chambre - Cannot find the underlying climate entity: climate.clim_chambre_parents_tuya. Thermostat will not be operational
and then many errors like:
2023-02-28 08:21:05.484 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/versatile_thermostat/climate.py", line 1540, in _async_climate_changed
    self.update_custom_attributes()
  File "/config/custom_components/versatile_thermostat/climate.py", line 2243, in update_custom_attributes
    ATTR_MEAN_POWER_CYCLE: self.mean_cycle_power,
  File "/config/custom_components/versatile_thermostat/climate.py", line 1008, in mean_cycle_power
    return float(self._device_power * self._prop_algorithm.on_percent)
AttributeError: 'NoneType' object has no attribute 'on_percent'

2023-02-28 08:21:05.612 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/versatile_thermostat/climate.py", line 1319, in _async_ext_temperature_changed
    self.recalculate()
  File "/config/custom_components/versatile_thermostat/climate.py", line 2175, in recalculate
    self._prop_algorithm.calculate(
AttributeError: 'NoneType' object has no attribute 'calculate'

2023-02-28 08:25:00.817 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/versatile_thermostat/climate.py", line 2049, in _async_control_heating
    on_time_sec: int = self._prop_algorithm.on_time_sec
AttributeError: 'NoneType' object has no attribute 'on_time_sec'

If not available, we should try to reconnect sometimes which is not the case.

When underlying climate is not found the thermostat will try to discover it at each cycle.
So when the underlying climate reappears, the VThermostat restart automatically.


[fixes #1359] multiple-column sort problem 修复多字段排序问题

[fixes #1359] multiple-column sort problem 修复多字段排序问题
If some field aliases, some without an alias is to generate the Order by clause orders the results is not expected

@cjy37 looks like there are some stylistic changes in here (e.g. getting rid of var).  Would you clean up this pull request so it contains the minimum amount of code to demonstrate the patch?  Thanks a lot!

bad pull request to master


Implement PanelPreferencesToolbar component

closes : https://github.com/zakodium-oss/react-science/issues/520

Codecov Report
Patch coverage: 54.00% and project coverage change: +0.03% :tada:

Comparison is base (3dca293) 48.83% compared to head (350b15c) 48.86%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #524      +/-   ##
==========================================
+ Coverage   48.83%   48.86%   +0.03%
==========================================
  Files         139      140       +1
  Lines        7771     7821      +50
  Branches      185      185
==========================================
+ Hits         3795     3822      +27
- Misses       3976     3999      +23

Files Changed
Coverage Δ

src/components/toolbar/PanelPreferencesToolbar.tsx
53.06% <53.06%> (ø)

src/components/toolbar/index.ts
100.00% <100.00%> (ø)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

I think the buttons should be closer to each other like in NMRium

Nmrium:

Our component:

The two are size 16px


Achieving Higher FPS with Multiple Object Tracking

Hey,
I am using SAM2 to analyze videos recorded at 30 FPS and currently tracking around 16 objects, achieving a tracking speed only of 2 FPS (propagating every 4 frames). I am interested in understanding the factors impacting this performance, for example the number of frames loaded for the video predictor.
Could you provide insights on optimizations or adjustments that might help improve performance? For example, would loading object IDs directly into tensors enhance processing speed? Any guidance on potential changes to reach my desired FPS would be greatly appreciated.
Dania

There are a few changes that can be made to speed things up, but they'll generally come at the cost of accuracy. The time required per frame is (roughly) something like:
time per frame = E + M*n

Where:
  E is the image encoding time
  M is the masking + memory encoding + memory attention time
  n is the number of objects being tracked

The image encoding time can be decreased by switching to smaller models (e.g. using the tiny model) as well as running at a lower image resolution (see issue #257). Both of these changes can reduce segmentation quality/accuracy though.
The time required to load the image could also be considered part of this timing and could be reduced by loading images in parallel to running the model itself, though it should be a relatively small part of the total time either way.
The masking/memory time can be decreased by using fewer previous frames in the memory attention step as well as using a lower image resolution. Again, these changes can reduce the quality of the outputs.
Using fewer memory frames requires changes to the code unfortunately, if you wanted to try it a simple hack is to edit line 539 in sam_base.py:
num_prev_frames = 1  # Values between 0 and 6 are valid
for t_pos in range(1, 1 + num_prev_frames): #self.num_maskmem):

It's very situational, but it some scenes it might also be possible to decrease the number of objects by using a prompt that masks several objects together in a single mask, though you would have to separate the results after-the-fact.

Hi @daniaFrenel, you can also try setting compile_image_encoder: True in the model config to increase the inference speed.


EPMLABSBRN-950 BE Mistyping of words

EPMLABSBRN-950
Description:

https://github.com/Brain-up/brn/pull/2142/files


Same old error. Can someone help. I'm new to VS 2015

Hi, I'm using VS 2015. I'm running opencv simple program, but it giving error. Please look at the link below and suggest an solution. Thanks for your time

I'm thinking that additional dependence are missing but i could not figure it out. I'm new to VS & opencv.

Some introduction tutorials are here:
http://docs.opencv.org/2.4/doc/tutorials/introduction/table_of_content_introduction/table_of_content_introduction.html#table-of-content-introduction
This question must go to http://answers.opencv.org


Is there a way to display an alert message when user reached maxTags

Is there any way to display an alert message when a user tries to select more than maxTags.
Below code is working fine and its accepting maximum 10 values. When a user tries to enter more values it's not accepting and the user doesn't know that the maximum is 10 languages. There is no validation to display. But I would like to display an alert message saying "You already selected maximum 10 languages". Is there a way to display an alert message when a user tries to select more than maxTags?
var languages = new Bloodhound({
    datumTokenizer: Bloodhound.tokenizers.obj.whitespace("name")
    , queryTokenizer: Bloodhound.tokenizers.whitespace
    , prefetch: "./assets/languages.json"
});

languages.initialize(),
$("#inputtags").tagsinput({
    maxTags: 10
    , freeInput: !1
    , typeaheadjs: {
        name: "id"
        , displayKey: "name"
        , valueKey: "name"
        , source: languages.ttAdapter()
    }
});

Thanks @janstieler
Temporary I did another solution. Using click function I count the length of the input tags and if it reached the maxTags then it displays an alert. But I think your solution is the best one.
Thanks man... :)
$(".tt-dataset-id").click(function(){
    var numItems = $('.tag').length -1;
    //console.log(numItems);
    if(numItems>=10){
       alert('Maximum 10 languages are allowed')
    }
});


TTL must be set on date field

Description
Fixes #780
Type of change

Bug fix

How Has This Been Tested?

Added user
Requested password reset
Made sure entry was gone after expiration time

Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes

@shinnlok Welcome to Appsmith & thanks a lot for the PR!
I've added a minor comment to the code. Once you make the necessary changes, we can merge this in.

@shinnlok Thank you for the PR! :tada:


Generate tests for generated code

Motivation
It's important for us to be sure that our generated code works, and while we currently test that the code compiles on a range of examples, the only way to know for sure if this code actually works is to try it out with a real API.
For the most part this is fine, but we currently know that there are some issues in that some configurations generate invalid Codable implementations but we don't usually figure this out until it's too late.
For example, the underlying issue behind #45 was not discovered until we refactored our implementation to use CreateAPI only to find that in some edge cases, the generated code was not actually doing what we expected. Luckily QA teams spotted this issue, and maybe we should have written more advanced tests manually, but it got me thinking about if we could actually generate code that helps to catch this kind of issue?
From my investigation, I think the answer is yes. It would be great if CreateAPI could generate test coverage for generated code that we can run in our own CI as well as allowing others to run on their own schemas to gain confidence of our generated source.
Proposal
I'm going to split this into three parts:

Generating an entity example
Generating a test target
Testing Codable implementations of entities

Generating an entity example
To be able to test anything, we'll need a subject to test. In the case of entity encoding and decoding, we'll want a JSON representation of the entity to test.
The OpenAPI Specification allows you to add examples to responses, schemas and individual properties (see Adding Examples) and we already use these examples today when generating documentation.
While we could depend on the example documented by the schema author, this isn't always appropriate for the following reasons:

Examples are typically not validated by common tooling that exists today.
Adding examples for large schemas or responses is not common since it often bloats the schema document and results in repetition in a lot of cases (i.e if the properties had examples, then the schema example is typically duplicating that example).

SwaggerUI has an interesting way of handling this. If an example is not provided for a response, schema or property then it'll use other aspects of the document to produce a valid example to display in the documentation. This can involve techniques such as:

Falling back to a default value of a property
Using the first item in an enum list of a property
Constructing an object that contains all of the examples defined on individual properties

If you would like to visualise this, check out Cookpad's Mobile Hiring schema and documentation site here: https://cookpad.github.io/global-mobile-hiring
If you look through the response documentation, you will see the Example Value for each response is a fully constructed object or array, but if you look at the raw schema, you will see that example's were only documented for individual properties.
This technique was a great way to provide rich examples while helping schema authors to keep their documents clean and maintainable. You can see the actual implementation here: https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js
We could adopt a similar tactic in CreateAPI in order to fabricate example JSON that can be used in generated test methods.
Now it's not as simple as it sounds, but I was able to put a demonstrable example together. Alternatively, we could consider seeing if such a feature could be implemented as part of OpenAPIKit instead.
Generating a test target
Assuming that this approach aligns with a direction that we'd like to take. The next challenge would be to actually support generation. In terms of configuration, this could be an opt in mode that is included as part of the generate option.
For example:
module: APIKit
generate:
- entities
- paths
- enums
- package
- tests # Indicates that we should also generate sources for APIKitTests

With the presence of this option, The Package generator can include the appropriate test target and the the Output writer would take generated tests and write them out into the ./Tests directory.
There is an unresolved question about generating tests without package and there are probably a few options here:

Error and make this a Package only feature.
Write the tests to the same --output directory and leave it to the user to move them to an appropriate location.
Offer some kind of --test-output flag for writing tests.

Since this would be an opt-in feature, I'm leaning towards the second option since it's relatively simple to achieve. I don't anticipate this being a commonly used option though so we could also error and revisit if somebody requests it.
Testing Codable implementations of entities
I spent some time thinking about different things we could test and what the optimal way to achieve this was. While there could be some benefit from testing Paths/Requests in general, I prefer to scope this initial implementation to the testing of entities.
In the future, we could introduce different types of tests (but to be honest, I haven't explored this) if we wished.
For testing of entities, I want to take advantage of those that contain an Encodable and Decodable implementation with an aim of running the JSON example representation through a JSONDecoder into the generated entity type and then back into a JSON representation via a JSONEncoder.
In theory, the encoder output should match the original input JSON providing that the encoder/decoder options are aligned (i.e sorted keys, pretty printed etc).
As an example, I prototyped generating the following output:

CollectionTests.swift
// Generated by Create API
// https://github.com/CreateAPI/CreateAPI

import Foundation
import XCTest
import cookpad

final class CollectionTests: XCTestCase {
    var decoder: JSONDecoder!
    var encoder: JSONEncoder!

    override func setUp() {
        super.setUp()

        decoder = JSONDecoder()
        decoder.dateDecodingStrategy = .iso8601
        encoder = JSONEncoder()
        encoder.dateEncodingStrategy = .iso8601
        encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
    }

    func testCoding() throws {
        let input = Data("""
        {
          "description" : "The sun is shining? The BBQ is out? Check out this collection of recipes for the perfect summer BBQ.",
          "id" : 1,
          "preview_image_urls" : [
            "https://img-global.cpcdn.com/recipes/65555efe64df98ce/m/photo.jpg"
          ],
          "recipe_count" : 27,
          "title" : "BBQ Classics"
        }
        """.utf8)

        let decoded = try decoder.decode(Collection.self, from: input)
        let encoded = try encoder.encode(decoded)

        XCTAssertEqual(input, encoded)
    }
}

The results were good 👍 It needs improvement, for example XCTAssertEqual on two data blobs is not great for debugging and decoder/encoder errors should be communicated more clearly. But with the help of an extension and a template, we could massively simplify the test case into something like this:
// Generated by Create API
// https://github.com/CreateAPI/CreateAPI

import Foundation
import XCTest
import cookpad

final class CollectionTests: EntityTestCase {
    func testCoding() throws {
        try assertCodable(of: Collection.self, using: """
        {
          "description" : "The sun is shining? The BBQ is out? Check out this collection of recipes for the perfect summer BBQ.",
          "id" : 1,
          "preview_image_urls" : [
            "https://img-global.cpcdn.com/recipes/65555efe64df98ce/m/photo.jpg"
          ],
          "recipe_count" : 27,
          "title" : "BBQ Classics"
        }
        """)
    }
}

So far I have ran this against the Cookpad Hiring schema and have seen good results. We do have an issue where an example for the recipe published_at isn't in the same ISO 8601 format (but still valid) that the JSONEncoder will output as and to fix this, we'd either need to change the schema or the behaviour when generating examples to entirely ignore the example property.
I'm sure that we'll also run into more problems with larger examples, especially issues where our generator produces the incorrect behaviour, but also probably limitations of how much we can assert just by comparing two JSON outputs.
There are also options to do much more advanced assertions, but I'm going to say that it would be out of scope for now. The primary goal is making sure that our entities can decode against the schema.

Just want to say I love this, and can't wait to integrate these tests into my existing project!

Hi! Happy user of CreateAPI, great work 👍🏼. I would also love to have this, but I wanted to note that asserting based on the encoded data will not be deterministic across platforms, particularly those that depend on swift-corelibs-foundation (Linux, Red Hat, Windows, etc). If I were writing these tests myself, I would want to round-trip from the starting point of an object, not from data.


Minor documentation problem about normalizing underscores

The documentation for normalize_characters says “BCP 47 is case-insensitive, and considers underscores equivalent to hyphens”, but BCP 47 doesn’t say anything about underscores. I think that’s a CLDR thing.

okay, I'll make it say "CLDR considers" instead.


Workbox works for all browsers, Google Chrome shows: Uncaught (in promise) DOMException error

https://stackoverflow.com/questions/54198028/workbox-serviceworker-working-everywhere-except-chrome-uncaught-in-promise-do
Library Affected:
workbox-sw, workbox-build, etc.
Browser & Platform:
Google Chrome, Chrome Canary
I'm using the workbox-webpack-plugin
webpack.config.js
const workbox = require('workbox-webpack-plugin');

module.exports = {
    plugins: [
        new workbox.GenerateSW({
            swDest: './service-worker.js',
            skipWaiting: true,
            clientsClaim: true
        })
    ]
}

index.ts (entry)
 if ('serviceWorker' in navigator) {
      window.addEventListener('load', function() {
      navigator.serviceWorker.register('/js/app/dist/service-worker.js');
    });
  }

The error is thrown at
workbox-precaching.dev.js: 1011
I attached screenshots on the stackoverflow link

Can you try updating to use Workbox v4.0.0-beta.1 and see if the issue persists? The precaching code was significantly rewritten in that release.
npm install workbox-webpack-plugin@beta should do it.

The issue has been fixed for Chrome 72, it works now for me and my colleagues.
This issue is to be closed.

Can you try updating to use Workbox v4.0.0-beta.1 and see if the issue persists? The precaching code was significantly rewritten in that release.
npm install workbox-webpack-plugin@beta should do it.

Thanks for your help

Can you try updating to use Workbox v4.0.0-beta.1 and see if the issue persists? The precaching code was significantly rewritten in that release.
npm install workbox-webpack-plugin@beta should do it.

The issue has been fixed for Chrome 72, it works now for me and my colleagues.
This issue is to be closed.

that same issue occur at chrome 73 , are you has same issue now


Do We Need Custom Flow Control or Congestion Control？

Is it necessary to implement any custom flow control mechanisms or congestion control at the Netty layer, or does the quiche library handle these internally?Thanks！

@blueuuufish all the flowcontrol is basically handled by quiche itself which will tell netty when it can send more data or not. So I think there is really not much we can provide here.


Minor bug fixes

Summary
PLT-7575 - Removing help text if length exceeds
PLT-7528 - Updating Slack attachments
Ticket Link
https://mattermost.atlassian.net/browse/PLT-7575
https://mattermost.atlassian.net/browse/PLT-7528
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[ ] Added or updated unit tests (required for all new features)
[ ] Has server changes (please link)
[ ] Has redux changes (please link)
[x] Has UI changes
[ ] Includes text changes and localization file (.../i18n/en.json and .../webapp/i18n/en.json) updates
[ ] Touches critical sections of the codebase (auth, posting, etc.)

Done @jwilander


Kill names and decoration in inlining.

Currently when inlining a call, the name and decorations for the result of the call is not deleted.  This should be changed.  Just before deleting the basic block that contains the call, we delete the name and decorations for the call.
This fixes issue #622.

I think I should add a test as well.


A little question

Hello, I trained my own CSV dataset by using chainer-chemistry, but I only got MAE when I used the model for prediction. How can I get the prediction value of each test data? I want to be able to compare it with the true value of my data.

You can use regressor.predict method to get predict value.

https://github.com/chainer/chainer-chemistry/blob/master/examples/qm9/predict_qm9.py#L142-L143

Evaluator only calculates MAE or other metrics.

OK, thank you very much for your reply. If I want to draw the loss or MAE in the model training process, what should I do?

Do you use Trainer to train model?
In that case you can use PlotReport, please refer this example.
https://github.com/chainer/chainer/blob/90b0cd425014d31aae122f21bce20ecf23486e11/examples/mnist/train_mnist.py#L113

I used the model in example / own_dataset to train my own data. The model uses the run_train () method. Is it different from the Trainer?

It internally uses Trainer.

https://github.com/chainer/chainer-chemistry/blob/56e83dedb5de9dc9eb08ebf292be9ba76a4883ba/chainer_chemistry/utils/train_utils.py#L11

I guess you can pass below to run_train method:
extensions_list=[extensions.PlotReport(['main/loss', 'validation/main/loss'], 'epoch', file_name='loss.png')] to add PlotReport extensions.

OK, when using CSV data for multiple label training, I found that the model only outputs one loss. How do you handle multiple label training? Will different labels affect each other?


Update README with latest screenshots

Actual Behaviour
ReadMe features old screenshots of app
Expected Behaviour
Latest screenshots of the application should be featured

Would you like to work on the issue?
Yes

@iamareebjamal
please use images from GitHub cloud no need to unnecessarily bloat the repository by uploading new images.

That's why I have uploaded the images in issue itlself

Great
+1


fix(cmake): rework ucontext_t introspection

Fixes #953
@cieplik Does this work for you?

Fixes #953
@cieplik Does this work for you?

@sergiud, thank you for the PR, I'll check it early next week and will let you know.

Fixes #953
@cieplik Does this work for you?

@sergiud, thank you for the PR, I'll check it early next week and will let you know.

@sergiud, that works for me on aarch64 Linux:
-- Performing Test HAVE_PC_FROM_UCONTEXT_uc_mcontext_gregs_REG_RIP
-- Performing Test HAVE_PC_FROM_UCONTEXT_uc_mcontext_gregs_REG_RIP - Failed
-- Performing Test HAVE_PC_FROM_UCONTEXT_uc_mcontext_sc_ip
-- Performing Test HAVE_PC_FROM_UCONTEXT_uc_mcontext_sc_ip - Failed
-- Performing Test HAVE_PC_FROM_UCONTEXT_uc_mcontext_pc
-- Performing Test HAVE_PC_FROM_UCONTEXT_uc_mcontext_pc - Success

$ cat config.h | grep PC
/* How to access the PC from a struct ucontext */
#define PC_FROM_UCONTEXT uc_mcontext.pc

Thank you!

@cieplik Thanks for validating the fix!


Fix crash on discovery due to missing import

TL;DR: it was failing without this. This fixes it.

Thanks for the PR, but this is actually already fixed in the dev branch.
I'll do a new release tonight with the patch.
Thanks!

Aaaah, must remember to check what branch I am pulling from next time :)


M3-4077 TDT: Update Linode shape in Redux

Description
Use the updated Redux state data model for Linodes. Any changes outside of /src/store are updating accessors to use the new shape.
Note to reviewers
Make sure everything related to Linodes--CRUD, migration, events, etc.--works as before.

I went through and verified the following actions for Linodes:
• adding/removing tags
• renaming a Linode
• detaching/reattaching a volume
• resize
• rescue
• rebuild (from image)
• creating manual snapshot
• clone (from disk)
• migration
I'm good to approve this, but let me know if there's any other actions I should test!

that seems pretty comprehensive, thanks!


Simplify login and refactor user info query

Will update this description later today.

Eh I need to work on this more. I'll open a PR when its ready.


🐛 App freezes when toggling to selfie camera

What were you trying to do?
Using the example from this repo, in the CameraPage there is a button to toggle front/back camera.
this button is only displayed if there is indeed both front and back camera (const "supportsCameraFlipping")
Unfortunately, the app freezes when tapping on it on some android devices.
( could not reproduce on mine, but many users complained about it; and I see a LOT of new ANR in my google play console )
Reproduceable Code
use the example code provided by this library.
Tap on the "toggle" camera back/front; experience the freeze. (on some android devices)

What happened instead?
the app does not actually crash, but freeze until we toggle back again to initial default camera.
Relevant log output
No response
Device
Android
VisionCamera Version
2.13.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 issues in this repository and found none.

Hey, thank your for the issue report!
Unfortunately I cannot reproduce the error. And you did not provide a reproduceable sample code (you're not shipping this example/ app in the app-store are you?). Also, you didn't provide any logs.
Sorry, I know I'm a really good developer but I'm not a magician, don't have any way to reproduce the error.

Thank you @mrousavy , I fully understand.
Here is the log from the google play crash console:
java.lang.IllegalStateException:
  at c.d.a.a1.a
  at c.d.a.f1.O
  at c.d.a.f1.V
  at c.d.a.f1.T
  at c.d.a.f1.U
  at c.d.a.b0.a
  at androidx.camera.camera2.e.w1.R
  at androidx.camera.camera2.e.v.run
  at android.os.Handler.handleCallback (Handler.java:815)
  at android.os.Handler.dispatchMessage (Handler.java:104)
  at android.os.Looper.loop (Looper.java:207)
  at android.app.ActivityThread.main (ActivityThread.java:5777)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)

Also, not sure yet if this one is related to this specific issue, but the CameraPage also gives this error:
com.facebook.react.bridge.JSApplicationIllegalArgumentException:
  at com.facebook.react.animated.l.g (Unknown Source:79)
  at com.facebook.react.animated.NativeAnimatedModule$f.a (Unknown Source:4)
  at com.facebook.react.animated.NativeAnimatedModule.executeAllOperations (Unknown Source:31)
  at com.facebook.react.animated.NativeAnimatedModule.access$400 (Unknown Source)
  at com.facebook.react.animated.NativeAnimatedModule$p.execute (Unknown Source:8)
  at com.facebook.react.uimanager.z0$t.m (Unknown Source:8)
  at com.facebook.react.uimanager.z0$a.run (Unknown Source:135)
  at com.facebook.react.uimanager.z0.U (Unknown Source:53)
  at com.facebook.react.uimanager.z0.s (Unknown Source)
  at com.facebook.react.uimanager.z0$j.doFrameGuarded (Unknown Source:31)
  at com.facebook.react.uimanager.f.doFrame (Unknown Source)
  at com.facebook.react.modules.core.g$d.doFrame (Unknown Source:46)
  at com.facebook.react.modules.core.a$a$a.doFrame (Unknown Source:2)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1106)
  at android.view.Choreographer.doCallbacks (Choreographer.java:866)
  at android.view.Choreographer.doFrame (Choreographer.java:792)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1092)
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8680)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:567)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)

Does that help in any way? :/

Unfortunately not, no.
The logs you shared are stripped/minified, you need to either give me adb logs or symbolicated stacktraces (e.g. when not using Proguard).
The other error is an animation/reanimated error.


Update Readme

Because you are committing a huge refactor of this project, you must update the Readme.
They say maintaining documentation is the hardest part of code maintenance, and I agree.
You will probably have to rewrite most of the Readme, which is fine, you don't have to write an essay. Just give a succinct description of what the project does and how it works.
I would wait until you are almost done with the refactor until you tackle this task.
100 points

50 pts awarded for now - JE

Last 50 awarded - JE


It deleted 2024 posts for me but when I try to run it for 2023...

It closes the program? Please help.

Same issue. Is there any appdata settings to remove?


Fix test -e with wildcard arguments.

The test command fails with multiple arguments when given a unary operator such as '-e'. Add a function that can test one or more files by looping over all files.
Specifically, if I add another template asset (i.e. 404.html) the e2e scripts fail with "binary operator expected" because the glob expands to test -e build/404.html build/index.html.

Why not just repeat test -e twice? I would like to avoid adding functions and other abstractions since Bash is a pretty annoying language to program in.

The single test -e works in upstream CRA. In my fork I've added another .html file to public which is where it breaks the way I've described. Fact is, using any test unary operator with a glob will break when the match returns more than one file.
I imagine anyone adding assets to their custom CRA (for use with --scripts-version) would run into this issue.

On Feb 8, 2017, at 4:49 PM, Dan Abramov<EMAIL_ADDRESS>wrote:
Why not just repeat test -e twice? I would like to avoid adding functions and other abstractions since Bash is a pretty annoying language to program in.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@EnoahNetzach @Timer Leaving this up to you.

Ooh, I get what you're saying now 😄 .
LGTM


[Feature Request]: Xaeros Map Entity Icons

currently we have an option to show the icon of the pinged item. it would be cool to also have an option to show the icon of the pinged entity. i would suggest to check whether or not xaeros map is installed, and then use the appropriate icons.

Xaero's Map is closed source and doesn't offer an API. It might still be possible to access the resources using reflection, but not sure if that can be a robust solution.
Besides using third-party resources, I have previously tried drawing the mobs texture, but I couldn't find an easy way to dynamically do this for all mob types (which should include modded entities).


bindings: add new functions to header file

Was gonna start implementing these functions because they were missing in the lib, only to see that they were already implemented in the source file.

Oopsie daisy, thank!
Merged.


submit form and enum

Is there a way to submit the form back to the server? Is there any way of binding the inputs?
Also does this support [enum]? something like this
,       "Status":{            "enum":[               "Preparing",             "AwaitingCompletion",             "Cancelled",             "Completed"          ],          "type":"string"       },
Just hoping that the module would be something like this
http://brutusin.org/json-forms/#2

Is there a way to submit the form back to the server?

Yes of course (that's basically what everybody would expect from a form lib, right :) ), you just need to implement an action for that.
If you consider the demo, here https://github.com/makinacorpus/angular2-schema-form/blob/master/demo/app.component.ts#L83 we define an action, which just does an alert, but it could also call the http service to post the data to a backend.

Is there any way of binding the inputs?

the model is bound, so you do get the input values that way

Also does this support [enum]?

we do not support the basic enum usage, we prefer oneOf as it allows to specify value/label pairs, example: https://github.com/makinacorpus/angular2-schema-form/blob/master/demo/sampleschema.json#L86

Thanks, yeah ofc that's what everybody expect haha just didn't realise that the action button is within the schema as well. Just looked at the demo and seems pretty clear :)
Model: do I need to use [model]=""?
Enum: I see, I don't think I will be able to change how the data is as its all coming from the back-end people and its all being generated by Swagger.

In your app, you are free to perform any changes on the data you receive from your backend.
So if your backend use regular enum, you can process it in your subscribre() to turn it into oneOf and then pass it to the schema-form component.
The same goes with $ref: you can read its value, resolve it to get the corresponding schema and inject it in the schema you pass to the form.

@ebrehault is this demo still available somewhere? because the new demo is not containing this allert statement?

What I do:
<sf-form [schema]=config_json_schema.schema [model]=config_json_schema.model></sf-form>
What I want:
I want the "changed" model back by clicking a submit button.

The demo has been moved in ./tests. The code you are talking about is here:
https://github.com/makinacorpus/angular2-schema-form/blob/master/tests/src/app/app.component.ts#L101.
I am not sure how you want to do it, but I would store the changed schema directly in this.config_json_schema.schema, so you can access anytime.


Check if wait waits long enough

Since the previous test only checked that wait doesn't wait for too
long, this would provide a better test coverage.

Excellent, thanks a lot!


mysql version: 5.7.99-log not pass

mysql version: 5.7.99-log   debezium-connector-setup-schema-registry.sh   "error_code":400,"message":"Connector configuration is invalid and contains the following 1 error(s):\nUnable to connect: Unknown system variable 'transaction_isolation'
mysql version:  5.7.19-log  pass

It is related to the Java MySQL driver not being compatible with 5.7.
We tested with MySQL 8. There should be a workaround though.

https://stackoverflow.com/questions/51016980/java-sql-sqlexception-unknown-system-variable-tx-isolation

@poseidon2011 I would recommend to upgrade to MySQL 8 if possible. It has been out for a while.
this is a new project, so we develop on the modern releases, CH and MySQL.
otherwise, it may be possible to use an earlier version of the connector but there are lot lf benefits to upgrade to MySQL 8.

MySQL 5.7 is EOL soon, closing.


[Gally]: master <- dev

Automatically created by Git-Ally

:tada: This PR is included in version 2.16.1 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Acentuation in portuguese

p�ginas

can you please give more detail?

if I write Olá as a value of a property and when i want to access this value,  I  get Ol� as value where  I used property object as..
$.i18n.properties({
name: 'messages',
path: '/static/bundles/',
mode: 'map',
encoding: 'UTF-8',
language: lang,
callback: function() {}
});
Please help...

To does have this problem. Its the enconding.
Change your page to iso8859-1 or your file to utf-8.
If cant do any try this:
change the plugin on line 290:
function loadAndParseFile(filename, settings) {
$.ajax({
url: filename,
async: settings.async,
cache: settings.cache,
dataType:'text'
}
To:
function loadAndParseFile(filename, settings) {
    $.ajax({
        url: filename,
        async: settings.async,
        cache: settings.cache,
        contentType:'Content-type: text/plain; charset=iso-8859-1',
        beforeSend: function(jqXHR) {
            jqXHR.overrideMimeType('text/html;charset=iso-8859-1');
        },
        dataType: 'text',

see pull request jquery-i18n-properties/jquery-i18n-properties#75

The solution to this is to use unicode escapes in your property files.
http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.Reader)
You shouldn't need to force the mime type at all.

Maybe this is a solution for non-ISO-8859-1 characters. But for normal ISO-8859-1 characters like German umlauts it should work without escaping (see http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load(java.io.InputStream) ). ISO 8859-1 is the standard for Java properties.