Generate a Rest Client with XML Deserialization and not JSON

I am interfacing with an "external web API server" that returns only xml content-type. I have generated a rest client with NswagStudio but an exception is always thrown because of the response type which is XML and the deserialisation type which is JSON.
Is there any way to generate a client with XML Deserialisation?

The client is mostly optimized for json. I think it does not yet support xml serialization...

Hey guys, I'm facing this same issue at the moment as well. I'm running on dotnet core (still only 2.1).
While researching my options I took a look at the various csharp client generators in openapi-generator as well, but they don't support XML either. The openapi-generator also don't parse Enums nicely (they come out as string properties), so NSwag is a winner here for me as it generates proper enums. There are some other differences but from what I can tell NSwag should meet our requirements once I switch over the seralisation to XML.
I did a few quick hacks on a generated client to see what's involved in adding XML support after generation. In my case I know I won't need to regenerate my client for a while. So I'm weighing up whether I just continue with the XML conversion in my generated client, or whether I start implementing XML support in a fork of NSWag. Unfortunately I'm pretty time-poor right at the minute.
At this stage I think I might do both (manually update the client, and start on XML support). But the XML support will be slow (until it becomes a priority :) ).
In terms of implementation, I think what would be nice to support both XML and JSON out of the box and use standard Content negotiation to determine which serialisation to use at runtime. The default (preferred) content type could therefore be set to application/json by putting it first in the list of Accept header values.
One other thing worth mentioning is the use of System.Collections.Generic.ICollection<T> which the XmlSerializer complains about. It throws an System.NotSupportedException for interfaces so I ended up changing the property definitions to use the concrete implementation of System.Collections.ObjectModel.Collection<T> in my generated client instead of interfaces. This is probably the biggest hurdle to XML as it would be a fairly major change. @RicoSuter, what are your thoughts on this if we were to proceed?
Result StackTrace:
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel model, XmlRootAttribute root, String defaultNamespace, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)
   at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
   at System.Xml.Serialization.XmlSerializer..ctor(Type type)
   at MyProject.UnitTests.MyClient.erializationTests.CanSerialize() in C:\source\repos\MyProject.UnitTests\SerializationTests.cs:line 34
--- End of stack trace from previous location where exception was thrown ---
----- Inner Stack Trace -----
   at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
----- Inner Stack Trace -----
   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, String ns, Type choiceIdentifierType, Boolean rpc, Boolean openModel, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping(StructModel parent, FieldModel model, XmlAttributes a, String ns, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
----- Inner Stack Trace -----
   at System.Xml.Serialization.StructModel.CheckSupportedMember(TypeDesc typeDesc, MemberInfo member, Type type)
   at System.Xml.Serialization.StructModel.GetPropertyModel(PropertyInfo propertyInfo)
   at System.Xml.Serialization.StructModel.GetFieldModel(MemberInfo memberInfo)
   at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter)
   at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
----- Inner Stack Trace -----
Result Message:
System.InvalidOperationException : There was an error reflecting type 'MyProject.MyClient.WorkspaceCreationRequest'.
---- System.InvalidOperationException : There was an error reflecting property 'PartyDetails'.
-------- System.InvalidOperationException : There was an error reflecting type 'MyProject.MyClient.PartyDetails'.
------------ System.InvalidOperationException : Cannot serialize member 'MyProject.MyClient.PartyDetails.Party' of type 'System.Collections.Generic.ICollection`1[[MyProject.MyClient.Anonymous12, MyProject.MyClient, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null]]', see inner exception for more details.
---------------- System.NotSupportedException : Cannot serialize member MyProject.MyClient.PartyDetails.Party of type System.Collections.Generic.ICollection`1[[MyProject.MyClient.Anonymous12, MyProject.MyClient, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null]] because it is an interface.

Cheers!

Just reading #2036. Perhaps an extensible Input/Output formatter style approach similar to ASP.NET Core would be a better approach here. That pattern is widely understood as well.
Then custom formatters could be registered via the partial implementation.

There are settings to change ICollection to Collection...

Thanks, that will simplify things! Will RTFM and see what else I'm missing :)

That was not my final answer to this issue... will add more soon 🙂

There are many dimensions to this issues:

Generate XML information in the JSON Schema/Swagger generator @emilw did a lot in this area and I think this should be completed: https://github.com/RicoSuter/NJsonSchema/pulls?q=is%3Apr+is%3Aclosed+author%3Aemilw
Generate XML annotations (e.g. XmlElementAttribute, etc.) in the CSharp DTO generator based on the XML information in the schemas - not sure whether this is already there - we need to check that...
When a response/request is not JSON but XML we need to use the XML serializer in the generated code to serialize/deserialize (which will pick up the attributes)

Maybe set the Accept header so that the correct format is received
At the moment we have something like if JSON then code for JSON else FileRespone we need to change the output to if JSON then code for JSON else if XML then code for XML else FileRespone

Just reading #2036. Perhaps an extensible Input/Output formatter style approach similar to ASP.NET Core would be a better approach here. That pattern is widely understood as well.

I think we shouldn't implement this externally (as proposed in #2036) but the generated clients should be completely self-contained and not require external code - #2036 would only be needed for special customizations (e.g. MessagePack serialization which is not directly supported by Swagger) and/or to make the generated clients easier to understand (but still generating a default implementation).

Hi,
The background for only doing "half" of the implementation e.g. supporting C# to Swagger spec was to be able to handle "legacy" middlewares that only could handle XML but still could consume the Swagger spec. This is quite common as many enterprises still sits on old middlewares where XML still is king.
In my head i did not see the use case where the server would generate a Swagger spec that only supported XML, so can you add some additional background to that @DanielSmon ? What servers/rest/http-rpc:s do you have in mind that do not support JSON?
@RicoSuter , regarding your bullet number 1 i see it as finalized for C# to Swagger. It's the other way that is not done in my head.

Hey guys, thanks for the replies.
@RicoSuter, your points 2 and 3 look good to me - that's what I had to do to hack my generated client to get it to work as a test.
I understand and agree that generated clients should be self-contained. I was merely thinking of a change to make it a bit more extensible so that if someone needs some other serialiser, they're free to implement it without having to modify the generator further. So for example, instead of this:
if JSON then code for JSON
else if XML then code for XML
else FileResponse

we were to do something like this:
formatter = select formatter for current content-type
if formatter is found, use formatter
else FileResponse

Then we'd just move the "code for JSON" and "code for XML" to be an implementation of the formatter interface. That way, generated clients would have the JSON and XML formatters loaded by default so the out of box experience would "just work" for JSON and XML. I..e they wouldn't require external code.
But if someone wanted another formatter for another content type, they could implement their own formatter and load it somewhere using the partial class so it would persist when the client is re-generated. The only problem with this approach is if people need additional attributes for their custom formatter, but I think that's outside of the scope of this (at least there's an entrypoint to have a formatter and they can perform whatever logic they need in there). It's only a little more complex than just adding if JSON, else if XML..., but lets people extend it more easily for edge cases.
@emilw, yeah unfortunately I'm integrating with a 3rd party that has implemented their API just like that. They only support XML, but thankfully have an OpenAPI spec (complete with Swagger UI). It's a financial/related institution to do with property transactions here in Australia. I don't know why they decided to implement it like this, but they have! :)
In fact, their OpenAPI spec is in YAML, so I have to convert it to JSON because most tooling doesn't play nicely with YAML out of the box. That reminds me, I think NSwag is meant to support YAML but I couldn't get it to work. I'm not terribly fussed about that though and I haven't had time to investigate which is why I haven't raised an issue here yet. Plus there are some other minor manual tweaks I have to make to their YAML to get it to work anyway (a few typos and inaccessible external references). Overall it's pretty good though - certainly far better than not having the spec!

Hi guys,
Sorry for the absence. I haven't forgotten about this as we still have this requirement. It's just a bit lower on our priority list right now. I might have some help soon though. So will let you know when we are able to make a proper start on this.
Cheers,
Daniel

In our org we have a requirement to use more sophisticated serialization techniques such as msgpack and compression for performance.
So I would also love an extensible solution where the client comes with json as default, but then enable you to add options regarding content, very much like AspNetCore does.
As it stands now, I would probably generate a client using nswag and then either find a way to create a script that does replaces json with msgpack or hand-code the changes.

ATM the easiest solution would be to replace this template:
https://github.com/RicoSuter/NSwag/blob/master/src/NSwag.CodeGeneration.CSharp/Templates/Client.Class.ReadObjectResponse.liquid

The final solution would be to either call different methods, e.g. ReadJsonObjectResponseAsync, ReadXmlObjectResponseAsync, etc. or rename ReadJsonObjectResponseAsync to ReadObjectResponseAsync and handle different protocols with the content header

Create a PR: https://github.com/RicoSuter/NSwag/pull/2248/files
Please review.

I would like to see support for any serialization/transport type; json, xml, protobuf, message pack... I'm after a swagger client generator that can handle protobuf & json...

@RicoSuter Is there any news for the open PR?

Hi, any news?


exatn::getService failure

Branch devel. After gluing together exatn::numerics and exatn::runtime it looks like CPP microservices exatn::getService does not work (it does not discover tensor runtime services). Three test fail with the same error.

I observed a failure in TAProlParserTester. It was missing exatn::initialize(). Can you post the other errors you saw, ctest --output-on-failure

Test project /home/dima/src/exatn/build
Start 1: ServiceRegistryTester
1/5 Test #1: ServiceRegistryTester ............   Passed    0.00 sec
Start 2: NumericsTester
2/5 Test #2: NumericsTester ...................***Exception: SegFault  0.11 sec
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from NumericsTester
[ RUN      ] NumericsTester.checkSimple
2 1 13 0
{1:5,0:13}
2 61 32
{61,32}
{1:4}
[       OK ] NumericsTester.checkSimple (0 ms)
[ RUN      ] NumericsTester.checkNumServer
Exatn not initialized before use. Please execute exatn::Initialize() before using API.
Could not find service with name eager-dag-executor. Perhaps the service is not Identifiable.
Invalid exatn Service. Could not find eager-dag-executor in Service Registry.
Exatn not initialized before use. Please execute exatn::Initialize() before using API.
Could not find service with name talsh-node-executor. Perhaps the service is not Identifiable.
Invalid exatn Service. Could not find talsh-node-executor in Service Registry.
Start 3: TAProLInterpreterTester

3/5 Test #3: TAProLInterpreterTester ..........***Exception: SegFault  0.10 sec
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from TAProLInterpreterTester
[ RUN      ] TAProLInterpreterTester.checkSimple
Exatn not initialized before use. Please execute exatn::Initialize() before using API.
Start 4: DirectedBoostGraphTester

4/5 Test #4: DirectedBoostGraphTester .........   Passed    0.00 sec
Start 5: TensorRuntimeTester
5/5 Test #5: TensorRuntimeTester ..............***Exception: SegFault  0.10 sec
Exatn not initialized before use. Please execute exatn::Initialize() before using API.
Could not find service with name eager-dag-executor. Perhaps the service is not Identifiable.
Invalid exatn Service. Could not find eager-dag-executor in Service Registry.
Exatn not initialized before use. Please execute exatn::Initialize() before using API.
Could not find service with name talsh-node-executor. Perhaps the service is not Identifiable.
Invalid exatn Service. Could not find talsh-node-executor in Service Registry.
40% tests passed, 3 tests failed out of 5
Total Test time (real) =   0.32 sec
The following tests FAILED:
2 - NumericsTester (SEGFAULT)
3 - TAProLInterpreterTester (SEGFAULT)
5 - TensorRuntimeTester (SEGFAULT)
Errors while running CTest

Oh cool, these are easy to fix. You just need to update the failing testers main() functions to first run exatn::initialize().

I actually did that in NumericsTester but it still fails for some reason ...

Oh, you meant I should put exatn::initialize() into main() instead of test itself?

Well either would do if there is only one TEST(). Did you run make install?

NumericsTester has two tests and I put exatn::initialize() and exatn::finalize() in the second one since it was failing. So, I guess I should just move this to main() instead. Will try.

Do you think getService not being able to find registered exatn::runtime services was because of this as well?

yes, if you don't call initialize() then the ServiceRegistry is not instantiated and initialized. ServiceRegistry::initialize() searches the ~/.exatn/plugins directory for shared libraries, loads them, and calls *Activator::start() on each one. Without doing this, there are no services available to get.

Nope, it does not help either, same thing:
Exatn not initialized before use. Please execute exatn::Initialize() before using API.
Could not find service with name eager-dag-executor. Perhaps the service is not Identifiable.
Invalid exatn Service. Could not find eager-dag-executor in Service Registry.
Exatn not initialized before use. Please execute exatn::Initialize() before using API.
Could not find service with name talsh-node-executor. Perhaps the service is not Identifiable.
Invalid exatn Service. Could not find talsh-node-executor in Service Registry.

Also note that it only complains about exatn runtime services: EagerGraphExecutor and TalshNodeExecutor.

This is interesting. I was able to reproduce this. It is happening because TensorRuntime::TensorRuntime(..) constructor is getting reference to the executor services before the exatn::initialize() call is finished. So exatn::initalize() gets called, which loads the bundles, which loads the MPIRPCActivator.start(), which constructs MPIServer, which calls DriverServer super constructor, which instantiates a TAProlInterpreter, which creates the NumServer, which creates the TensorRuntime, which calls getService()... all before initialize() finishes. Phew....
Simple fix is to move the Taprol parser construction from DriverServer constructor initializer list, to the MPIServer.start() method.


Postal Address Issues

Hello,
I'm trying to use this library to get and set postal addresses on both iOS and Android and running into some problems.

Getting "postCode" on iOS works, however when I set an address with "postCode", it does not appear to save it. (All other fields do save). The data will come back success and appear in the UI, but if you go to the address book the data is not saved and therefore not returned next time. I tried on phones set to both US and Canadian regions. Same issue. Note: Fixed in PR

Android seems to only have addresses in one line by default on device, so when I retrieve it, I only get "street" with all the address in it. You have a "formatted" address field, but that does not seem to return anything other than the same, unformatted address again. So on android, if the user enters their address natively in their contact book (i.e. not syncing from some other service), this library does not return an address in the format that the docs say it does. It would be nice to return a properly structured address on android. I believe Android has geocoding functionality on device for doing this. Perhaps it would be smart to have it as an option in the method or returned in another field like "parsedAddress" (as it would be changing the users entered text). Honestly this is what I thought "formattedAddress" was. [Tested on Android 8, Emulator]

On Android setting an address seems totally broken. When I set an address on iOS, it works (other than the issue with the postCode above). However on Android, with the same code, the library returns a success message with the updated fields, but upon going to the device to inspect the contact, the address is completely empty. The original address is removed and the new address is not there at all. Also, if there are more than one address setting the first address i.e. address[0] will wipe out both addresses. Not good. [Tested on Android 8, Emulator] Note: Submitted PR

A smaller issue, more of a convenience thing, is that the "Street" fields in addresses get flattened into one. Is this coming directly from iOS, or is it in the library? If a user has two "street" fields, they get flattened into one. I can do a check on my end for the new line that gets entered and deal with it there, and if I set the address with a newline character added it saves back to the device in two lines, but this seems like something the library should handle.

A separate issue I found is that with getContacts, on iOS if there are no contacts, it returns null. However on Android if there are no contacts, it seems to return an object with an empty array. Small issue, but one that did crash my app until I added different checks.

For issues 2-5 in an ideal world, both iOS and Android would always return the exact same data structure and accept the exact same data structure from the developer and your library should ideally be the bridge for us. Seems like there are some differences.

Lastly a small question - I'm not sure how it is supposed to be, but in your iOS code, you have both "state" and "region" coming from the same field from device. You are returning to the developer both "Region" and "State" in separate fields, but their source data is coming from the same field on device. Is that on purpose? I don't know the inner workings of the iOS address book, so perhaps this is an internationalization thing and is expected behaviour, but I thought I'd point it out.

Thanks,
Paul

I've submitted PR: https://github.com/rt2zz/react-native-contacts/pull/269 for point 1 above.

I've submitted PR https://github.com/rt2zz/react-native-contacts/pull/271 for point 3 above.


Sorting list of torrents in torrent widget?

Description
Apologies if this exists and I just can't find it.
Basically, it would be very useful to be able to sort the torrents based on criteria like status, up/down speed, eta, etc. For my own use, I'd like for currently downloading torrents to appear higher on the list than seeding/idle completed torrents. Currently it seems to be the inverse of this is true, and my downloading torrents go to the bottom of this list.
Thanks for a great homepage!
Priority
Medium (Would be very useful)

https://github.com/ajnart/homarr/pull/1557
Already in the works


[review] Fix type inconsistencies in ParameterBlakcboard API

The recently-introduced methods readBytes() and writeBytes() where using a
uint32_t for the 'offset' argument whereas all other methods use a size_t. This
is inconsistent and also will trigger a conversion warning with -Wconversion.

@krocard please review. We missed this is the previous review :(

Why was the build not failing with -Wconversion ?

Because that flag was added on the master branch. I detected the error when trying to merge master into serialization_api.

:+1:

:shipit:


title: Added blog on how EnumTryParse works in csharp.

Checklist

Please note that in case of below checklist not updated accordingly, the maintainers have the right to immediately close your pull request.

[x] You created a branch from dev branch.
[x] You PR is raised on dev branch and not onmaster.
[x] Blog follows Blog Guidelines.
[x] You have read the Contribution Guidlines before creating this PR.
[x] Checked for any duplicate blog entry.
[x] Checked for all grammatical errors in the blog.
[x] You have not published the blog content anywhere else on the internet on platforms like medium, dev.to etc.
[x] The content is not copy-pasted from anywhere else on the Internet.

Description of change

Added blog on how EnumTryParse works in csharp
Author Details for Blog Post Entry

id: Hemant Manwani

@pareek-narendra Please review.


Don't use flat_hash_map where pointer stability is needed.

Use node_hash_map instead.
Signed-off-by: Henner Zeller<EMAIL_ADDRESS>

Codecov Report

Merging #1182 (411b027) into master (b2277c5) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1182      +/-   ##
==========================================
- Coverage   92.85%   92.85%   -0.01%
==========================================
  Files         337      337
  Lines       22777    22776       -1
==========================================
- Hits        21149    21148       -1
  Misses       1628     1628

Impacted Files
Coverage Δ

verilog/tools/kythe/scope_resolver.h
100.00% <ø> (ø)

Continue to review full report at Codecov.

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


Update translations_2.rs

In computer networks, "inspect" is often translated as "检查" or "审查".

Thanks so much!

@all-contributors please add @wangzishi for translation.


feat(type): make TreeName and TreePath more useful

These types are used (temporarily, until they are moved) in Enarx for VFS implementation.
A few improvements that make that possible

Merging, because this is blocking further progress


APEXMALHAR-2335 APEXMALHAR-2333 APEXMALHAR-2334 #resolve #comment Pro…

…blems on StateTracker

@davidyan74 Please review

@davidyan74 please review

@davidyan74 Merged your update, please review


Link from the Flag icon to a GitHub issue or other spot to report bugs

Pretty pleased with how this worked out, though it does require people to make a GitHub account to file a bug.


Update REST API State digram to include Execution API

What is the feature request? What problem does it solve?
We have a diagram that describes the relationships between different API components - https://raw.githubusercontent.com/wiki/vmware/versatile-data-kit/vdk-data-job-lifecycle-state-diagram.png
The purpose of the diagram is to help users understand better how the API works and how it is expected to be used (describing the usual data engineering work flow)
It would be good to describe how Execution API fits. If it is too much one diagram we can split it in two.

Triaged. Closed as stale.


Labeler Crash with Mercator or Orthographic projection

This is a re-hash of https://github.com/DotSpatial/DotSpatial/pull/1248 with updated code and sample for .NET Core.
When using a map projection of Mercator or Orthographic (possibly others as well) and labeling features there is a small bug that I have been trying to squash all weekend. I believe it is because when the reprojection of the polygons occurs there are some inherent values of NaN for x or y or both. When the labeler tries to determine the centroid of the said features it results in an exception.
https://github.com/DotSpatial/DotSpatial/issues/1171
https://github.com/DotSpatial/DotSpatial/issues/1140
Fixes https://github.com/DotSpatial/DotSpatial/issues/1199
Checklist

[x] I have included examples or tests
[x] I have updated the change log
[x] I am listed in the CONTRIBUTORS file
[x] I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

Centroid of feature with NaN coordinates is skipped so that an exception is not thrown,.

@sindizzy Geometry has a IsValid property. Based on the fact that I'd like to remove Shape and IndexMode and so on you could simply check feature.Geometry.IsValid to make sure you can draw the label. I wouldn't want to remove invalid shape vertices in a class that is simply supposed to draw labels.

@jany-tenaj  ok I went in and experimented with detecting an invalid geometry and not adding it to the list of labels to be drawn. That part of the code is here . I have tried various ways to get the validity of the geometry but it seems to me that the methods try to create the geometry first and end up crashing. When I run the labeler on a geographic projection it all works great (all vertices are numeric). But when I label an Orthographic projection it crashes at the line I have noted.
Debug.Print("start<---");
foreach (int fid in features)
{
    Debug.Print("fid={0}", fid);
    //Debug.Print("idx={0} Fid={1}", fid, FeatureSet.Features[fid].Fid);
    //bool isOk = FeatureSet.GetShape(fid, false).ToGeometry().IsValid;
    //Debug.Print("b:fid={0} isOk={1}", fid, isOk);
    bool isValid = FeatureSet.Features[fid].Geometry.IsValid; // *** crash here ***
    Debug.Print("c:fid={0} isValid={1}", fid, isValid);

    if (drawStates[fid] == null || drawStates[fid].Category == null) continue;
    if (drawStates[fid].Category == category)
    {
        catFeatures.Add(fid);
    }
}
Debug.Print("end<---");

@sindizzy Based on the fact that you are working in IndexMode the system only knows your Shapes. You'd have to switch to IndexMode = false. Initialize everything that is needed. Then reproject and then check the validity. If everything works as expected this should result in IsValid = false and you could skip the feature. If you'd want to go another step I'd remove the invalid features right after reprojecting and send the user a message that not all features could be reprojected.

@jany-tenaj that seems like a lot of overhead. Keep in mind that this is for generating the label (not the feature itself). With this in mind, I did find some function names and parameters in this class that do not really represent what they are.
Example:
        /// <summary>
        /// Draws the labels for the given features.
        /// </summary>
        /// <param name="e">MapArgs to get Graphics object from.</param>
        /// <param name="features">Indizes of the features whose labels get drawn.</param>
        private void DrawFeatures(MapArgs e, IEnumerable<int> features)

This method is used to render labels, yet its called 'DrawFeatures'. A more appropriate name would be 'DrawLabelFeatures' or just 'DrawLabels'. Also, the parameter 'features' suggests it's a list of Feature objects. I think a more appropriate name would be something like featureIndices.

So my suggestion is to leave everything as-is and use my function to determine if the vertices of the shape are valid. If they are then we add that feature to the list of features that will have a label rendered. Features that are not valid will not be drawn anyway through a different mechanism. Anyways, we wait until the very last second to determine validity. This way we don't waste cycles if a feature doesn't meet the other criteria.
if (drawStates[fid] == null || drawStates[fid].Category == null) continue;
if (drawStates[fid].Category == category)
{
    // Check if the shapes vertices are valid (ie all vertices must be numeric and not NaN).
    // Todo: NaN vertices happen most often on a projected CS so maybe we can skip this step on a geographic CS.
    var hasValidVertices = AreFeatureVerticesValid(FeatureSet.ShapeIndices[fid].Parts);
    Debug.Print("  hasValidVertices={0}", hasValidVertices);
    if (hasValidVertices)
    {
        catFeatures.Add(fid);
    }
}

Without labels

With labels

Your still manipulating vertices in a place they shouldn't be manipulated and your method would get removed again when we remove shapes and indexmode and the wrror would still be there.

If you know that your error comes from reprojecting then clean up after doing that and it won't be a problem here.

I am not manipulating vertices at all. All I'm doing is checking if any of them are NaN. If any one vertex is NaN then the feature is invalid, as the label renderer will not be able to compute the shape's centroid.
The vertices stay as-is. On a reprojection, the vertices will get recomputed and then tested again for validity. I do not remove vertices. I only compute if they are valid.

The problem is not reprojection per say. If you reproject from geographic to geographic then no vertices get NaNed. It's usually projections like Orthographic or Mercator that have areas that will result in vertices with NaN.
They are correct in that the reprojection results in NaN vertices. For example, in Orthographic there are shapes that are in the backside of the globe that will not get rendered. There is no way for me to "fix" this as it is proper behavior. But the labels will not render if any vertex is NaN.

@sindizzy If I remember correctly NAN values are by definition not allowed in shapefiles. So if you reproject and get NaN values you'd have to fix your geometry to become valid again. You can't expect the drawing functions to work with invalid geometries.
If you state that in orthographic the geometry is at the backside of the globe and doesn't get rendered I'd say so what I can't see it but if it is correct I could calculate its size. But I can't do that if it has NaN values. So basically you can't have this geometry in a featureset that uses Orthographic as coordinate system or you'd have to fix the geometry into an empty geometry whose calculation would result in size = 0. Also I'm not sure why I'd keep empty geometries.

So I think we are on the same page but maybe different paragraph. This whole PR was only for labels. Right now DotSpatial can render a map in Orthographic no problem. It is when you try to label the features then DotSpatial hard crashes.
With labeling we are not saving to a shapefile. We are only looking at the reprojected vertices to determine where the label should be. With NaN vertices, it will crash the labeling method.
Again, nothing to do with rendering the feature itself. It is the labeler that's crashing. When determining where to put the label the method determines the centroid of the feature but it cant do that if the feature has a NaN. My PR skips the labeling of these types. Everything else stays the same. I would say the drawing methods for the features does this already or it would have crashed. It skips drawing a feature if it has NaN vertices. The label routines however will crash.
The esri product shows this for Orthographic with and without labels. It works as, I would say, a user might expect.

@jany-tenaj in contrast to the sample from the ESRI product above, here is DotSpatial.
Orthographic projection without labels

with labels (current production)

with labels (includes my small code adjustments)

@jany-tenaj that works for me.


Feature Request: Requesting few currencies in smaller quantity causes 'unexpected error' and does not allow to pay

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Open the app and login with user A
Open the report for user B
Request 1 AMD or 20 or less VND to user B
Login with user B and open report of user A
Click on pay and click on "I'll settle elsewhere"
(Tested with AMD to INR and VND to INR)

Expected Result:
Request should be marked as paid without any error
Actual Result:
Request is not marked as paid, it glitched the information box for paid and displays 'unexpected error' below the request.
Workaround:
unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[ ] Android / native
[ ] Android / Chrome
[ ] iOS / native
[ ] iOS / Safari
[ ] MacOS / Chrome / Safari
[ ] MacOS / Desktop

Version Number: 1.2.60-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/215178802-a298f5ab-dedb-4018-a580-acdadc551493.mp4
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1674120622953559
View all open jobs on GitHub

8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

10 days overdue. I'm getting more depressed than Marvin.

12 days overdue now... This issue's end is nigh!

This issue has not been updated in over 14 days.  eroding to Weekly issue.

This issue has not been updated in over 15 days.  eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!


ci(*): use dart format instead of flutter format

Description
flutter format shouldn't be used anymore:
[!] The "format" command is deprecated and will be removed in a future version of Flutter. Please use the "dart format" sub-command instead,
which takes all of the same command-line arguments as "flutter format".

Type of Change

[ ] ✨ feat -- New feature (non-breaking change which adds functionality)
[ ] 🛠 fix -- Bug fix (non-breaking change which fixes an issue)
[ ] ❌ ! -- Breaking change (fix or feature that would cause existing functionality to change)
[ ] 🧹 refactor -- Code refactor
[x] ✅ ci -- Build configuration change
[ ] 📝 docs -- Documentation
[ ] 🗑 chore -- Chore

Thanks 🤓


Option to pass rendered note as opposed to source

When using dynamic content, e.g. with Dataview or similar, you can create useful summaries from multiple notes that you may want to run queries against. Currently the chat with the current note considers the source and therefore is unable to provide any useful responses. The only option is to export the rendered content and create a new note with it, which can then be queried. This is quite cumbersome and I guess there should be a way to (optionally) pass the rendered note instead. I hope this is clear.

v2.1.0
Every language block (e.g. Dataview and Tracker) will now append with the tags <block-rendered>...</block-rendered> for the model to read and respond to.
Try it out and let me know if you run into any issues, thanks!


Fix coverage with new decoupled backend

Describe the bug
current convert_coverage.sh script:
#!/bin/sh
docker cp backend:/root/core/.coverage .coverage
sed -i "s;/root/core/;${PWD}/backend/core/;g" .coverage
coverage xml --rcfile testing/.coveragerc

We need to account for the new modules, which are under
backend-services
Structure is as follows:
backend-services/
├── service
│   ├── AUTHORS.md
│   ├── core
│   │   ├── service.py
│   │   └── __init__.py
│   ├── Dockerfile
│   ├── entrypoint
│   ├── LICENSE
│   ├── Makefile
│   ├── requirements.txt
│   └── wait-for
..........

where service = [autoignore, autostarter, configuration, database, detection, fileobserver, mitigation, notifier, prefixtree]
Affected Component(s)

[ ] Back-End (Database, Microservices, Containers, etc)
[ ] Front-End (Flask, API, etc)
[ ] Docs
[X] Build System

Expected behavior
Backend services need to be properly covered.

@slowr should I move this to another release?

@slowr should I move this to another release?


[Doc Enhancement] [updated upload custom app]

added a note on migrate to teams store.

Acrolinx Scorecards
We currently enforce a minimum score of 80.
Click the scorecard links for each article to review the Acrolinx feedback on grammar, spelling, punctuation, writing style, and terminology:

Article
Score
Issues
Scorecard
Processed

msteams-platform/concepts/deploy-and-publish/apps-upload.md
94
5
link
:white_check_mark:

More info about Acrolinx
Use the Acrolinx extension, or sidebar, in Visual Studio Code to check spelling, grammar, style, tone, clarity, and key terminology when you're creating or updating content. For more information, see Use the Visual Studio Code extension to run Acrolinx locally.

Docs Build status updates of commit b8bbd9c:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

msteams-platform/concepts/deploy-and-publish/apps-upload.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel


fix side view offset when main offset does not start at 0

a few changes:

fix side view offset when main offset does not start at 0
fix typo itemExtend -> itemExtent
remove listener on dispose, and only create ScrollController on initState (not on build)
modernize dart style with no new, and with => shorthand notation where possible

I agree with your changes to clean the code, and I absolutely agree with creating the controller in initstate, but I don't really understand this problem and how you fixed it:

fix side view offset when main offset does not start at 0

I don't see any significant change in the build method or in the calculation of the current position. But that's partly because so many lines changed without really changing anything that I have a hard time finding the real change. 1 tip for next time is to do such big formatting changes separately from the functional changes.

Sorry I agree I should have split it in two PRs (I just did in locally and thought I would contribute back)
The only "real" change is:
https://github.com/renefloor/side_header_list_view/blob/fdcaca746ba30bde080fec1eae1afa69c9a7233b/lib/side_header_list_view.dart#L51
which repositions the side view without waiting for a scroll event
The problem is that if you save the scroll position (e.g. by using PageStorageKey) then when your widget rebuilds, the main list view is scrolled to the right offset, but the side view is always at offset 0. Only when the user scrolls do we update the side view because there's a listener.

I agree with your changes to clean the code, and I absolutely agree with creating the controller in initstate, but I don't really understand this problem and how you fixed it:

fix side view offset when main offset does not start at 0

I don't see any significant change in the build method or in the calculation of the current position. But that's partly because so many lines changed without really changing anything that I have a hard time finding the real change. 1 tip for next time is to do such big formatting changes separately from the functional changes.

Sorry I agree I should have split it in two PRs (I just did in locally and thought I would contribute back)
The only "real" change is:
https://github.com/renefloor/side_header_list_view/blob/fdcaca746ba30bde080fec1eae1afa69c9a7233b/lib/side_header_list_view.dart#L51
which repositions the side view without waiting for a scroll event
The problem is that if you save the scroll position (e.g. by using PageStorageKey) then when your widget rebuilds, the main list view is scrolled to the right offset, but the side view is always at offset 0. Only when the user scrolls do we update the side view because there's a listener.

Ah now I understand, so it was about the offset of the scrollcontroller. You can't get it in initstate because the scrollcontroller isn't attached to the widget yet. This is still the case in the build widget (I assume), so you can indeed only get it in the frame after the build, but that's too late.
If i'm correct this only happens on a rebuild, and the state is preserved in that case including all the variables. InitState shouldn't be called in that case. What if we don't store the currentPosition, but the currentOffset and let the build method calculate the position? In that case in a rebuild we still have the currentOffset and can calculate the position in the build method?

Ah now I understand, so it was about the offset of the scrollcontroller. You can't get it in initstate because the scrollcontroller isn't attached to the widget yet. This is still the case in the build widget (I assume), so you can indeed only get it in the frame after the build, but that's too late.
If i'm correct this only happens on a rebuild, and the state is preserved in that case including all the variables. InitState shouldn't be called in that case. What if we don't store the currentPosition, but the currentOffset and let the build method calculate the position? In that case in a rebuild we still have the currentOffset and can calculate the position in the build method?

Ah now I understand, so it was about the offset of the scrollcontroller. You can't get it in initstate because the scrollcontroller isn't attached to the widget yet. This is still the case in the build widget (I assume), so you can indeed only get it in the frame after the build, but that's too late.
If i'm correct this only happens on a rebuild, and the state is preserved in that case including all the variables. InitState shouldn't be called in that case. What if we don't store the currentPosition, but the currentOffset and let the build method calculate the position? In that case in a rebuild we still have the currentOffset and can calculate the position in the build method?

So here's an example app reproducing the problem: https://gist.github.com/joachimvalente/3a098982c9cd9f93186f6f7e3811a8ac
And here's a video of it:
https://user-images.githubusercontent.com/1289004/105646252-ce37ec00-5e53-11eb-9b5e-89e742cb0b4c.mp4
When you change tabs, flutter actually calls dispose and then when you switch back it calls initState again (I checked by adding print statements). Hence the need for PageStorageKey to keep the offset.
I tried keeping the current offset instead of the current position, but it doesn't work for the same reason. The only thing I could do that didn't require a post-build reposition is to save the current offset as a static field, but obviously it's not desirable since you might have several list views in your app. See this branch to see what I'm talking about:
https://github.com/joachimvalente/side_header_list_view/compare/master...joachimvalente:joachimvalente-static?expand=1
Or maybe we could re-use the key and store our own key => offset mapping as a static field? A bit hacky but that could work...

Ah now I understand, so it was about the offset of the scrollcontroller. You can't get it in initstate because the scrollcontroller isn't attached to the widget yet. This is still the case in the build widget (I assume), so you can indeed only get it in the frame after the build, but that's too late.
If i'm correct this only happens on a rebuild, and the state is preserved in that case including all the variables. InitState shouldn't be called in that case. What if we don't store the currentPosition, but the currentOffset and let the build method calculate the position? In that case in a rebuild we still have the currentOffset and can calculate the position in the build method?

So here's an example app reproducing the problem: https://gist.github.com/joachimvalente/3a098982c9cd9f93186f6f7e3811a8ac
And here's a video of it:
https://user-images.githubusercontent.com/1289004/105646252-ce37ec00-5e53-11eb-9b5e-89e742cb0b4c.mp4
When you change tabs, flutter actually calls dispose and then when you switch back it calls initState again (I checked by adding print statements). Hence the need for PageStorageKey to keep the offset.
I tried keeping the current offset instead of the current position, but it doesn't work for the same reason. The only thing I could do that didn't require a post-build reposition is to save the current offset as a static field, but obviously it's not desirable since you might have several list views in your app. See this branch to see what I'm talking about:
https://github.com/joachimvalente/side_header_list_view/compare/master...joachimvalente:joachimvalente-static?expand=1
Or maybe we could re-use the key and store our own key => offset mapping as a static field? A bit hacky but that could work...

Hi @renefloor, any updates on this?

I'll try to fix that jump, but I didn't have time for it yet unfortunately.


Detects compiler support of C++17 at configure time

Addresses issue #3769

This would be a candidate for 8.0.x
And maybe a back port to 7.0.x detecting c++11

We require C++17 now on master and for all 8.x releases.

Yeh, I don't think we need this. However, one thing that's semi ugly now, and we should address, is that if the compiler doesn't support -std=c++17, we don't seem to fail during configure, only during "make" does it fail. We should ideally have a check in configure.ac that fails immediately if the compiler is not C++17.

Yes, it would definitely be good to fail during autoconf or configure if the compiler doesn't do -std=c++17.

I've reworked this to be much simpler (no other dependencies pulled in).
The RAT build will need to be updated to use an appropriate compiler.

[approve ci rat]

Cherry-picked to 8.0.x


[SPARK-46772][SQL][TESTS] Benchmarking Avro with Compression Codecs

What changes were proposed in this pull request?

This PR improves AvroWriteBenchmark by adding benchmarks with codec and their extra functionalities.

Avro compression with different codec
Avro deflate/xz/zstandard with different levels

buffer pool if zstandard

Why are the changes needed?

performance observation.
Does this PR introduce any user-facing change?

no
How was this patch tested?

connector/avro/src/test/scala/org/apache/spark/sql/execution/benchmark/AvroWriteBenchmark.scala
Was this patch authored or co-authored using generative AI tooling?

no

Thank you @dongjoon-hyun


How to keep the same name when mangle properties within multiple chunks ?

I am mangling properties by regex. Mangle properties work well when there is only one file output. But it won't work when there are multiple chunks or code splitting, because the variable will not match.
Any way to fix this issue ?
Here is my webpack config.
module.exports = {
    bail: true,
    entry: {
        app: path.resolve(__dirname, 'src/index.jsx'),
        vendor: ['react', 'react-dom', 'mylib']
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'static/js/[name].[chunkhash:8].js',
        chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js',
    },
    module: { ... },
    resolve: { ... },
    plugins: [
        new HtmlPlugin({
            filename: 'index.html',
            template: path.resolve(__dirname, 'public/index.html')
        }),
        new ExtractTextPlugin('static/css/[name].[contenthash:8].css'),
        new UglifyJsPlugin({
            parallel: true,
            uglifyOptions: {
                compress: false,
                mangle: {
                    properties: {
                        debug: false,
                        regex: require('./config/uglify/regex')
                    }
                },
                output: {
                    beautify: true
                }
            }
        }),
        new webpack.optimize.CommonsChunkPlugin({
            name: 'vendor'
        })
    ]
}

@scarletsky i think it is possible only disable mangle, but you can create issue in uglify-es about this, we just uglify-es wrapper for webpack. Also you can create multiple instance UglifyJsPlugin and use test/exclude/include option for filtering chunks

Look up nameCache and --name-cache in the uglify docs.  Because it's an inherently serial operation, it would only work with parallel: false.

@kzc
Great! nameCache is what I am looking for. Thanks!


Proposed ? Syntax

Currently, boolean logging syntax is on expressions like so:
let boolean_var = boolean_expression?

anywhere a boolean expression is, it may be logged.
We can introduce a less flexible, but more visually simple syntax, usable in any variable declaration of booleans:
let boolean_var? = boolean_expression

This shifts the operator to the LHS. If the boolean expression is very complex, this lets you avoid an extra layer of parenthesis, and makes your boolean logic clearer.
Potential problem: confusion with optionals. Suggestion: use different operator overall. Suffix exclamation point (true!) makes the most sense to me.
@KtorZ

hm I'm not feeling it to be honest


Add hollow triangle pattern

Hey i want to have patterns like this:
*
* *
*   *
*     *
* * * * *

Do it in your favorite programing language, remember to ask for assign this issue.
Make sure it's dynamic meaning your pattern can easily resized just by change a variable
If your favorit language folder doesn't exist, make it by your self and add file name it hollowtrianglepatternby[your name]
Don't forget to test and check your PR

Rules:

Do not overwrite other people file

This is not about who the fast but is about writing a beautiful code

Comment the output of your code at the end of file

Add yourself to README.md

@Reynadi531 i can work on this :)

@Reynadi531 I would like to contribute. Please assign me this task.
I can implement in C, C++, Java, Python.

@Reynadi531 I am ready to do this. Please let me in.

OK everyone go ahead

let me in!

sure

@Reynadi531 I would like to work on this

Please assign it to me. I wish to do it in C.

Please assign it to me.
I will do it with javascript

feat : Add hollow triangle pattern @Reynadi531 #41

I would like to contribute! Can do it in Java.

Go ahead everyone

Changes made as per your suggestion
Add Hollow Triangle pattern @Reynadi531  #41

I would be happy to contribute (in c++).

Can I try this ? Please.

I can make some patterns, also triangles in java and javascript, can you assign me?

I did it !! Please check #51

Thanks for the opportunity.

This will be my first contribution If you assign me. ;)

I can perform task in c, cpp, python language.
please assign me to do task.

I would like to contribute. Assign me this task.
I can implement in C, C++, Java, Python.

limitation of people who can be assigned is just 10. Maybe you can try on another issue

@Reynadi531 In Which language should I work?

@Reynadi531 In Which language should I work?

Your favorite language

limitation of people who can be assigned is just 10. Maybe you can try on another issue

can you please add me also as I have asked first.


[QUERY] Authentication using bearer token from AAD

Query/Question
V8 SDK has a class com.microsoft.azure.storage.StorageCredentialsToken which can be used for authentication with an existing bearer token from active directory like below:
StorageCredentials creds = new StorageCredentialsToken("<account_name>", "<access_token>");
CloudBlobClient client = new CloudBlobClient(<storageEndpoint>, creds);

Is there something similar in V12 SDK? One option is to implement TokenCredential interface, but this interface needs the token to be wrapped in reactor framework type Mono and I'd prefer keeping my application code free of frameworks used by the SDK and also I'm using only the sync APIs but forced to deal with async artifacts.
Why is this not a Bug or a feature Request?
I don't know if there is already something in place to do what I asked and if there isn't, I can raise a feature request.
Setup (please complete the following information if applicable):

OS: Linux
IDE : IntelliJ
Version of the Library used: 12.0.0

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

[x] Query Added
[x] Setup information Added

Hi @SukruthKS,
Yes, we do currently support authentication via Bearer Token from AAD.
Perhaps, this sample could help point you in the right direction.
The Azure Identity library also provides a variety of other implementations of the TokenCredential interface.

I am going to close this issue as I believe the question has been addressed, but please feel free to reopen it or post again if you need more support.

Thanks @gapra-msft ! I briefly looked into Azure Identity SDK and all the implementations of TokenCredential require a client ID and secret and they get a bearer token from AAD when needed but I couldn't find an implementation which accepts an already existing token.

Sorry, @SukruthKS, for closing the issue prematurely. We are following up with the Identity and Core teams to confirm if this option is indeed missing, and if so, which team should pick it up. We will follow up with more information soon.

Hi @SukruthKS, It looks like there is no current implementation of TokenCredential that only accepts a bearer token. I’ve put in a feature request to the identity team, and the work should be tracked here https://github.com/Azure/azure-sdk-for-java/issues/6525

@SukruthKS, if you are satisfied with this worked being tracked in #6525 and have no further questions for this thread, can you please close this issue?


Delete attachment and show attachment size [enhancement]

RainLoop version, browser, OS:
1.11.3, Chrome, Windows
Expected behavior and actual behavior:
Able to delete attachment on inbox without deleting the actual mail
Show total attachment size per email in mail list

Show and sort mails by size would be super useful!


Configuration trigger for locales

Currently, there seems no trigger to set the default locale.
I also suggest one additional config option, which adjusts the interface language according to the browser language.

It has been fixed. The first one will be used in the app.ini

Introduced by  Remove legacy unmaintained packages, refactor to support change default locale #19308

https://github.com/go-gitea/gitea/pull/19308


Add integration with bt-hci crate

Implementing traits from bt-hci allows the BleConnector to be used with the Trouble BLE stack.
See #1933
The bt-hci crate is not yet released on crates.io, hence marking this as draft until that's done. I've created an example here that use the TrouBLE stack. I'm not sure if it makes sense to add an example to esp-hal or not, there's no trouble release yet so it would have to be a git dependency.

I'm not sure if it makes sense to add an example to esp-hal or not, there's no trouble release yet so it would have to be a git dependency.

I think that's what this PR should be. Which can land now, rather than wait for a release.
Ideally esp-wifi should expose an API that allows users to implement traits of any 3rd party library, rather than require esp-wifi to provide an implementation for every bluetooth library that exists out there.
This PR can just be to add an example trouble.rs that just shows how to integrate esp-hal and trouble yourself.
(For pragmatic reasons, once trouble is released esp-wifi will probably provide an implementation 🙂)
I strongly suggest using a commit hash rather than the main branch. The examples are built in CI and breaking changes in trouble would break CI here.

I'm not sure if it makes sense to add an example to esp-hal or not, there's no trouble release yet so it would have to be a git dependency.

I think that's what this PR should be. Which can land now, rather than wait for a release.

We're in the process of moving the bt-hci crate to the embassy org, so will wait for that before updating this PR.

Ideally esp-wifi should expose an API that allows users to implement traits of any 3rd party library, rather than require esp-wifi to provide an implementation for every bluetooth library that exists out there.

Just to clear things up, there are two crates at play:

bt-hci which is just HCI type definitions following the bluetooth specification (no BLE stack implementation), it's not bound to any BLE stack and is generally a small stable dependency that doesn't change. This is not part of trouble at all.
trouble which implements the BLE Host stack, similar to bleps. I agree an integration with that is outside the scope of esp-hal, so it should only be put as an example (which I've pushed now).

Whether or not to depend on bt-hci in esp-hal is up to you. It would reduce the boilerplate needed for users, so my recommendation would be to do that, as I think whatever API would be in esp-hal instead would end up pretty similar (since HCI is a spec). It's another dependency though, so I can understand why you'd want to keep it out as well.

This PR can just be to add an example trouble.rs that just shows how to integrate esp-hal and trouble yourself.

I agree that the trouble crate should only be depended on in the example. I've pushed an example just now for that.

(For pragmatic reasons, once trouble is released esp-wifi will probably provide an implementation 🙂)

Just to clarify, there isn't any need for esp-wifi to integrate with trouble, it's kind of at the layer above, using the esp-wifi implementations of the bt-hci traits.

I strongly suggest using a commit hash rather than the main branch. The examples are built in CI and breaking changes in trouble would break CI here.

I think it's totally fine (and something I want) to offer two HCI interfaces - embedded-io (what we already have) since it's not too uncommon to have a serial interface and bt-hci. I agree esp-wifi shouldn't depend on any BLE-stack directly (which it doesn't and this PR doesn't change that)
In theory we could have just one interface and use / offer adapters but in the end, I think this is a more convenient solution.

Ah yeah sorry, I used "trouble" and "bt-hci" interchangeably. (I understand the difference)
To be more precise, I always referring to bt-hci.
I was just saying that the bt-hci integration can live in the example code until the crate is released, that way the PR can land now.

Allright its ready for a proper review now, bt-hci is released

Thanks a lot!
I tried this on some targets but unfortunately on ESP32-C3 and ESP32-S3 it advertises but I cannot connect. On ESP32-C6 I don't see it advertising.
Here is a pcap from ESP32-C3 (using Windows BLE Explorer, but also NRF Connect on Android shows same behavior)
esp32c3_trouble.zip

@bjoernQ Oh, that's not good, thanks for testing. I only have esp32c3 to test on, but I'm able to connect, read attribute and get notifications. On iphone (nrf connect 2.7.8), so it might be some differences with Android that triggers that. I'll look more into it.

You probably already know this but you can use https://github.com/esp-rs/esp-hal/tree/main/extras/esp-wifishark to capture HCI data in Wireshark - at least for me that was quite helpful before. I remember at least e.g. Windows and Android perform very different things during service discovery

@bjoernQ Well, that was a good find. The BleConnector integration was using read_hci, which ended up giving 2 hci frames during read. I switched it to use read_next which just reads a single HCI packet rather than a stream, and now it's working on both Android and iOS for me. My guess I was just 'lucky' that it worked on iOS before.

Thanks!

The BleConnector integration was using read_hci, which ended up giving 2 hci frames during read, and the second one was skipped. I switched it to use read_next which just reads a single HCI packet rather than a stream, and now it's working on both Android and iOS for me.

That makes a lot of sense - thanks for fixing this. I am now able to connect from Android to most chips. Unfortunately, Windows LE Explorer still locks-up on connecting.
Also, for some chips (ESP32-C2, ESP32-C6 and ESP32-H2) it seems that it never gets to start the advertising. The example stops at
I (23) boot: ESP-IDF v5.1-beta1-378-gea5e0ff298-dirt 2nd stage bootloader
I (24) boot: compile time Jun  7 2023 08:03:28
I (25) boot: chip revision: v0.1
I (29) boot.esp32h2: SPI Speed      : 32MHz
I (33) boot.esp32h2: SPI Mode       : DIO
I (38) boot.esp32h2: SPI Flash Size : 4MB
I (43) boot: Enabling RNG early entropy source...
I (48) boot: Partition Table:
I (52) boot: ## Label            Usage          Type ST Offset   Length
I (59) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (67) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (74) boot:  2 factory          factory app      00 00 00010000 003f0000
I (82) boot: End of partition table
I (86) esp_image: segment 0: paddr=00010020 vaddr=40800000 size=04ba4h ( 19364) load
I (100) esp_image: segment 1: paddr=00014bcc vaddr=40824958 size=00030h (    48) load
I (103) esp_image: segment 2: paddr=00014c04 vaddr=00000000 size=0b3f4h ( 46068)
I (124) esp_image: segment 3: paddr=00020000 vaddr=42000000 size=4f258h (324184) map
I (212) esp_image: segment 4: paddr=0006f260 vaddr=00000000 size=03ae8h ( 15080)
I (217) esp_image: segment 5: paddr=00072d50 vaddr=42052d50 size=0adc0h ( 44480) map
I (231) boot: Loaded app from partition at offset 0x10000
I (231) boot: Disabling RNG early entropy source...
INFO - esp-wifi configuration Config { rx_queue_size: 5, tx_queue_size: 3, static_rx_buf_num: 10, dynamic_rx_buf_num: 32, static_tx_buf_num: 0, dynamic_tx_buf_num: 32, ampdu_rx_enable: 0, ampdu_tx_enable: 0, amsdu_tx_enable: 0, rx_ba_win: 6, max_burst_size: 1, country_code: "CN", country_code_operating_class: 0, mtu: 1492, heap_size: 65536, tick_rate_hz: 100, listen_interval: 3, beacon_timeout: 6, ap_beacon_timeout: 300, failure_retry_cnt: 1, scan_method: 0 }
INFO - Starting advertising and GATT service

What all these chips have in common is that they are using the newer (Nimble based) driver under the hood - so might be something on our side. Haven't looked into this yet

Thanks!

The BleConnector integration was using read_hci, which ended up giving 2 hci frames during read, and the second one was skipped. I switched it to use read_next which just reads a single HCI packet rather than a stream, and now it's working on both Android and iOS for me.

That makes a lot of sense - thanks for fixing this. I am now able to connect from Android to most chips. Unfortunately, Windows LE Explorer still locks-up on connecting.

I don't have a windows system, so I'm not sure how to debug that. If you some kind of a packet trace, that would be helpful.

Also, for some chips (ESP32-C2, ESP32-C6 and ESP32-H2) it seems that it never gets to start the advertising. The example stops at
I (23) boot: ESP-IDF v5.1-beta1-378-gea5e0ff298-dirt 2nd stage bootloader
I (24) boot: compile time Jun  7 2023 08:03:28
I (25) boot: chip revision: v0.1
I (29) boot.esp32h2: SPI Speed      : 32MHz
I (33) boot.esp32h2: SPI Mode       : DIO
I (38) boot.esp32h2: SPI Flash Size : 4MB
I (43) boot: Enabling RNG early entropy source...
I (48) boot: Partition Table:
I (52) boot: ## Label            Usage          Type ST Offset   Length
I (59) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (67) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (74) boot:  2 factory          factory app      00 00 00010000 003f0000
I (82) boot: End of partition table
I (86) esp_image: segment 0: paddr=00010020 vaddr=40800000 size=04ba4h ( 19364) load
I (100) esp_image: segment 1: paddr=00014bcc vaddr=40824958 size=00030h (    48) load
I (103) esp_image: segment 2: paddr=00014c04 vaddr=00000000 size=0b3f4h ( 46068)
I (124) esp_image: segment 3: paddr=00020000 vaddr=42000000 size=4f258h (324184) map
I (212) esp_image: segment 4: paddr=0006f260 vaddr=00000000 size=03ae8h ( 15080)
I (217) esp_image: segment 5: paddr=00072d50 vaddr=42052d50 size=0adc0h ( 44480) map
I (231) boot: Loaded app from partition at offset 0x10000
I (231) boot: Disabling RNG early entropy source...
INFO - esp-wifi configuration Config { rx_queue_size: 5, tx_queue_size: 3, static_rx_buf_num: 10, dynamic_rx_buf_num: 32, static_tx_buf_num: 0, dynamic_tx_buf_num: 32, ampdu_rx_enable: 0, ampdu_tx_enable: 0, amsdu_tx_enable: 0, rx_ba_win: 6, max_burst_size: 1, country_code: "CN", country_code_operating_class: 0, mtu: 1492, heap_size: 65536, tick_rate_hz: 100, listen_interval: 3, beacon_timeout: 6, ap_beacon_timeout: 300, failure_retry_cnt: 1, scan_method: 0 }
INFO - Starting advertising and GATT service

What all these chips have in common is that they are using the newer (Nimble based) driver under the hood - so might be something on our side. Haven't looked into this yet

I don't have any other esp32 to test on, so I'm not sure what that could be. I tested the apache-nimble controller integration on nrf, which does work, but that controller is perhaps different to the one used in esp32?

@bjoernQ You're right, it's the initial command complete that causes an error when bt-hci attempts to parse it. It's an interesting edge case, because all valid BLE command complete events corresponding to a command have an additional 'status' byte set, whereas this one is one byte short (you can see the Reset command for instance is 7 bytes), and not in response to a command.
An error like this will cause the ble.run() in the example to exit, which is probably why everything hangs.
Here is the alternatives I think:

Change bt-hci event parser to not require the status byte to be present. It feels a bit wrong to deal with it in the bt-hci crate though, since this is specific to a controller and I'm not sure if it's really allowed or not.
Change trouble to ignore parsing errors. I don't like this one, because it masks potential real bugs.
Change the esp-hal bt-hci integration to check for this case when parsing the HCI command.

I've gone with 3. and pushed a fix that should ignore this event,, it would be great if you could try it out.

Thanks! I agree option 3 is the best way here
I can confirm it's now working with ESP32-C6 and nrf-Connect on Android!
I got the example to crash when closing nrf-Connect - not an issue / just mentioning:

Thanks! I agree option 3 is the best way here
I can confirm it's now working with ESP32-C6 and nrf-Connect on Android!

Great, thanks for testing!

I got the example to crash when closing nrf-Connect - not an issue / just mentioning:

Ah yes, it could happen if trying to notify a host that was disconnected. I've modified the example to just ignore that for now.

I think this looks good and works fine for me with an Android central - would love to get this in - do you know if using Windows as central is a general known problem in Trouble currently? (I don't think it's an issue with the integration if Android and iOS are working fine)

Regarding that trouble PR, I'll see if I can get hold on some windows pc one day to reproduce, but it might not be very soon. It should probably be looked into, I don't think the intersection of 'windows BLE connector' and trouble users are that big yet for anyone to notice.

Whether or not it should block the PR I dunno.

I don't think it should, this is really nice to have, so let's get this in now. Would you mind rebasing?

@MabezDev Done. I'll raise an issue in trouble repo regarding the Windows LE explorer so it's not forgotten.

@jessebraham I wasn't sure where to bump that, I set it on esp-wifi, is that ok?

Finally green :tada: :joy:


Translate settings menu items

This PR adds the translation function to items name of Settings menu (Admin Hub)

It looks like this PR is no longer required, as the translations are already in. Thank you for the PR though.


Note on blocking statement/job info for BACKUP, RESTORE, IMPORT

Added this clarification to 20.2 and 21.1, including: notes in the opening sections, changes to the options table where detached is supported, and additional emphasis on the differences in output with/without detached in the relevant example section.
Also updated 20.1 versions due to the age of this issue: one clarifying note in the opening section for each statement.
Close #7670

This change is


[JP] Lottery not resetting on emulator

Before opening an issue:

[x ] I tested the latest release
[x ] I looked at other issues (even the closed ones)
[x ] I read the Troubleshooting Guide
[x ] I'll fill this template properly

Your issue will get closed/locked by the bot in case proper info isn't provided
If you open unnecessary/dumb issues, you'll be rewarded with appropriate tags.

Describe the bug
When I run the Lottery script on the recent JP Christmas Event lottery on Bluestacks, the script can't reset the lottery box. I am using the most recent CI build.
Screenshots
See Video
Video
https://youtu.be/Zg-pdZle8qI
This is a Youtube video of the recording.
Device Info (please fill at-least 'Device model'):

Device model: Bluestacks
Screen size: 1600 x 900
Android Version: Unknown
RAM: 4GB

Seems like they changed the label on the button. Can you please take a screenshot of the screen before you reset?

I made the area a bit wider to the left so the new 1 position is included. Can you try the newest Canary build?

It's working now. Thank you so much.


python3Packages.flake8-class-newline, flake8-deprecated: init

Add two new flake8 extensions that were recently added as dependencies of the ROS package ament_flake8. These packages will be used in nix-ros-overlay.
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

nixpkgs-review result
Generated using nixpkgs-review.
Command: nixpkgs-review pr 359892

x86_64-linux

:white_check_mark: 8 packages built:

python311Packages.flake8-class-newline
python311Packages.flake8-class-newline.dist
python311Packages.flake8-deprecated
python311Packages.flake8-deprecated.dist
python312Packages.flake8-class-newline
python312Packages.flake8-class-newline.dist
python312Packages.flake8-deprecated
python312Packages.flake8-deprecated.dist


Configurable Layer Messenger

Goal
First phase of a configurable Atlas Messenger.
To set the app id, modify LayerConfiguration.json or run
rake configure:setAppID["app://abcxyz"]
To set the provider url, modify LayerConfiguration.json or run
rake configure:setProviderURL["http://providerURL"]
And it will set the LayerConfiguration.json just the same as if a dev did it. :) I think it's better if InstaStart isn't modifying source code directly. And it would be weird to have a tool in the repo just for InstaStart, so I found something that works for InstaStart and/or devs.
Future
We can expand on this solution! It would be neat to write more rake tasks to help devs get started. For example, rake layer:add_user[args] could add a user to their backend (we'd need to add the backend URL to the Layerfile for that to work) and so on.
What ideas do you all have for Layer config? I think Layerfile is net better than the hard coded strings in source, but there may be solutions past Layerfile that would be better, like a wizard that just sets environment variables, etc. (The only con to that I see is that is if the developer wants to spin up their own repo and work on their project with their team, it would be less of a 'pull and build' solution)
Also, we should make use of Environment Variables in the future.
Other thoughts
I think it's ok to have this LayerConfiguration.json as part of the repo for now, even if devs do spin up their own with their teams. This is a demo project. If they want to change how they're reading their App ID, they can do that easily.  The simplest way would be to reimplement the ATLMConfiguration methods.
Notes
You'll notice there is only one method in ATLMConfiguration so the internal caching w/ private variables seems unnecessary, but we're anticipating more configurations, so I used a model that prepares for that with performance in mind, especially since configuration is done during App Launch!
This PR does the following:

Adds a LayerConfiguration.json
Adds a Rakefile for some simple Rake tasks (init, setting App ID and Identity Provider URL, clearing config)
Restructures the project to match the structure defined by XCode (I ran 'synx' on the project)
Removed hard coded App ID from code

Running a rake task is slightly harder than the find-and-replace I'm doing (partly since the Instastart backend is Node). But changing the JSON file is easy enough.
Any reason not to expose the identity provider URL in the Layerfile as well?

After thinking more about this, I have to reiterate my hesitation for using a Layerfile.
By having a new file we are introducing more configuration for the project, to make sure they have it included in the "Copy Bundle Resources" Build Phase.
The rake tasks are nice for us, but how would customers consume those within their own projects? They could use our rakefile, but they may already have one. Doesn't this mean we have to now write a dedicated tool (Podfile -> pod, Gemfile -> bundler, Fastfile -> fastlane)? Let's consider that we're creating a new product that must be maintained.
I know @blakewatters has already stated his (dis?)taste for plist configuration, but compared to the above, I think it would be much easier to display the keys/values (and the raw plist code) in an instastart step, that would go into their app's plist.

@feifanzhou yea you can just update the JSON file directly ;)

@feifanzhou

Any reason not to expose the identity provider URL in the Layerfile as well?

Nope. Just iterating towards that. I left the configuration class open to allow more variables :) We can definitely use this for identity provider URL. How is it getting it right now??? Still learning.

@armcknight good points.
I would actually love if we had a layer cli :P Were you implying its a good idea or a bad idea?
For now couldn't we 'Rake' until we iterate toward that? It would be interesting to port once we have a core set of commands, you know?
Also, we can break the Rakefile up. Rakefile could just, at the top, could just require a LayerRakeFile or something. Then, if people want to use their own Rakefile and use our stuff, they just have to make sure they add that require.
Thoughts?
I guess I feel similar to @blakewatters in not preferring the .plist, personally. If we can avoid that, that'd be great haha.
But, it's not sloppy so I'm not totally against it.

How is it getting it right now???

Hardcoded here. Instastart does a find-and-replace in that file.

So funny. Ok, yea, let's add that to the Layerfile

I'm late to the game here, but is this configuration file and process being shared with Android?  If not, it should.  Not all developers use a single source base for development, but a number of them do.  When they are performing their base setup via InstaStart, I believe it should be possible for the developer to go through those steps once and share the base configuration.


Documentation update for installing on Ubuntu 16.10

I followed the 16.04 instructions to install on a new Ubuntu 16.10 VM but the library ended up being linked with -lpython3.5m and would not work.
To link with python 2.7 I had to use this cmake command:
cmake \
  -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python2.7 \
  -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2.7 \
  -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython2.7.so \
  ..

Another way may be changing the line
find_package(PythonLibs REQUIRED)

with
find_package(PythonLibs 2.7 REQUIRED)

Different versions of python can be indeed a tricky problem. I hope this solves the coexistence of python 2 and 3.
Things become more complicated with different version python 2, which is the case on my Mac. My situation is like brew installs boost::python with python 2.7.8 and CMake finds python 2.7.10 (the version required by the system) thus results in a mess. I'm looking for a better solution other than hard coding.

Thanks for the feedback.
I updated the python configuration finder and now the default python in bash will be used. You can also specify your own python by simply  add -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2.7 to cmake options.
You are welcome to have a try.

I also updated the doc about python issue during installing, but I haven't actually tested it on Ubuntu 16.10.


RBAC: Filters not applied using LDAP role access

Issue submitter TODO list

[X] I've looked up my issue in FAQ
[X] I've searched for an already existing issues here
[X] I've tried running master-labeled docker image and the issue still persists there
[X] I'm running a supported version of the application which is listed here

Describe the bug (actual behavior)
Hi all,
after successful access with LDAP auth mechanism and corresponding role config, as explained into previous discussion, I tried to config a custom role with just few permissions on TOPICS and CONSUMERS, but no luck.
All topics are visible and not filtered and I succeeded in creation/deletion of topics even if specified just "view" permission.
No LOG useful even at debug level.
Expected behavior
Topics/Consumers filtering .
Your installation details
APP version 0.7.0
CONFIG:
compose.yml
 kafka-ui:
    image: provectuslabs/kafka-ui:latest
    container_name: kafka-ui
    ports:
      - "8083:8080"
    restart: always
    user: "0"
    environment:
      LOGGING_LEVEL_ROOT: debug
      LOGGING_LEVEL_COM_PROVECTUS: debug
      TZ: Europe/Rome
      KAFKA_ADMIN-CLIENT-TIMEOUT: 60000
      #######
      AUTH_TYPE: LDAP
      SPRING_LDAP_URLS: ldap://ldap_server:389
      SPRING_LDAP_BASE: CN=***********,OU=company,OU=tech_users,DC=g,DC=b,DC=s
      SPRING_LDAP_ADMIN-USER: CN=***********,OU=company,OU=tech_users,DC=g,DC=b,DC=s
      SPRING_LDAP_ADMINP-ASSWORD: **************************
      SPRING_LDAP_USER-FILTER-SEARCH-BASE: OU=obp,OU=users,DC=g,DC=b,DC=s
      #SPRING_LDAP_USER-FILTER-SEARCH-FILTER: "(&(sAMAccountName={0})(memberOf=CN=FBK_AWX_PRE,OU=company,OU=tech_users,DC=g,DC=b,DC=s)(memberOf=CN=FBK_AWX_PRO,OU=company,OU=tech_users,DC=g,DC=b,DC=s))"
      SPRING_LDAP_USER-FILTER-SEARCH-FILTER: "(sAMAccountName={0})"
      SPRING_LDAP_GROUP-FILTER-SEARCH-BASE: OU=company,OU=tech_users,DC=g,DC=b,DC=s
      SPRING_CONFIG_ADDITIONAL-LOCATION: /roles.yml
      #      AUTH_TYPE: "LOGIN_FORM"
      #      SPRING_SECURITY_USER_NAME: team
      #      SPRING_SECURITY_USER_PASSWORD: **************************
      #######
      KAFKA_CLUSTERS_0_NAME: fbk_kafka_tst
      ... ... ... ...
      #######
      KAFKA_CLUSTERS_1_NAME: fbk_kafka_pre
      ... ... ... ...
      #######
      JAVA_OPTS: ... ... ...
    volumes:
      - type: bind
        source: /opt/kafkaui/logs
        target: /opt/kafkaui/logs
      - type: bind
        source: /opt/kafkaui/config
        target: /opt/kafkaui/config
      - /etc/localtime:/etc/localtime:ro
      - /opt/kafkaui/roles.yml:/roles.yml

roles.yml
rbac:
  roles:
    - name: "FBK_AWX_PRO"
      clusters:
        - fbk_kafka_tst
        - fbk_kafka_pre
      subjects:
        - provider: ldap
          type: group
          value: "FBK_AWX_PRO"
      permissions:
        - resource: topic
          value: "fake.*"
          actions:
            - view
            - massages_read

        - resource: consumer
          value: "fake.*"
          actions:
            - view

Steps to reproduce
ENABLING roles through "roles.yml" I can log in but see everithing without filters.
Screenshots
I can see 144 pages of topics and the last doesn't match regex "fake.*".

No matching topics would be visible if regex filter was applied correctly as show here:

Same issue on consumers filter:

Logs
I wasn't able to found any useful trace on logs, even using DEBUG level.
Additional context
No response

@MxFbk do you get a 403 if you try to open the topic which shouldn't be accessible from the list?

Hi @Haarolean,
I'm trying to look for topic: fbk.sme.update-bank-instruction-items-domain-status.
I can see it, click on it and read messages.
I don't know if something wrong on my config.
From browser inspection all calls are 200 OK.

@MxFbk Please provide the output of /api/authorization endpoint

Hi @Haarolean,
thanks for suggestion.
Here are the api call output as requested:
{"rbacEnabled":false,"userInfo":{"username":"GBS07272","permissions":[]}}
I can add what I can see on my config and container.
ROLES CONFIG:
[root@fbkppawx /opt/kafkaui]$ cat roles.yml
rbac:
  roles:
    - name: "FBK_AWX_PRO"
      clusters:
        - fbk_kafka_tst
        - fbk_kafka_pre
      subjects:
        - provider: ldap
          type: group
          value: "FBK_AWX_PRO"
      permissions:
        - resource: topic
          value: "fake.*"
          actions:
            - view
            - massages_read

        - resource: consumer
          value: "fake.*"
          actions:
            - view

CONTAINER CONFIG => roles.yml mount into the container
[root@fbkppawx /opt/kafkaui]$ cat kafkaui.yml | grep roles
      #SPRING_CONFIG_ADDITIONAL-LOCATION: /roles.yml
      - /opt/kafkaui/roles.yml:/roles.yml

CONTAINER FS CHECK => roles.yml is in place
[root@fbkppawx /opt/kafkaui]$ docker ps -a | grep kafka
9f058d503e25   provectuslabs/kafka-ui:latest   "/bin/sh -c 'java --…"   11 days ago    Up 11 days    <IP_ADDRESS>:8083->8080/tcp            kafka-ui
[root@fbkppawx /opt/kafkaui]$ docker exec -ti 9f058d503e25 /bin/sh -c 'ls -ltr / | grep *.yml'
-rw-r--r--    1 root     root           433 Jun  9 11:32 roles.yml

What I've missed or wrongly configured?
Thanks a lot
Massimiliano

The property is commented out

Stupid error.
Thanks and sorry.


Add pyupgrade

Pyupgrade https://github.com/asottile/pyupgrade/
This will help us to remove all the code for python2 support, I just tested it with one fiile, and looks good.

Will it show errors or will it automatically change the code for us? Can we see an example of the result?

It will change the code for us, here is an example of what it does https://github.com/asottile/pyupgrade/#implemented-features. I tested it on the projects/tasks.py file, and it really does a good job.


constant fan setting

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

Hi. Thank you for putting this together. It’s a huge upgrade for the actron que being able to control in HomeKit with automations etc.
I noticed you don’t use the constant fan mode but said it might be possible to add. Would be great if so. I run this feature overnight as when the rooms cool to set temp, the constant fan keeps air moving and avoids the on/off operation. so it is quiet, less disruptive whilst sleeping and more comfortable. It is much slower than low fan setting so running in fan only wouldn’t replicate.
If it can be added as a seperate switch, that would avoid having to jump back to the actron app.
Look forward to seeing this come through at some point.

Yep - i can add this. Ive been using the constant fan setting occasionally myself recently so have had this annoyance

That’s great. Thank you.
Any idea when it would be ready? No rush, just want to know when to check back for an update.
Thanks again
On 18 Mar 2024, at 2:07 pm, Julian Greensmith @.***> wrote:
Yep - i can add this. Ive been using the constant fan setting occasionally myself recently so have had this annoyance
—
Reply to this email directly, view it on GitHubhttps://github.com/jxg81/homebridge-actron-que/issues/18#issuecomment-2002808347, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BHADR27TD4RHBEVQC53ZUZDYYZK53AVCNFSM6AAAAABEYTOO42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBSHAYDQMZUG4.
You are receiving this because you authored the thread.Message ID: @.***>


Render Text issues when using tabs in Chrome

I've realized that when a pdf is run in tabs with render_text set to True it would only work for the selcted tab as the page loads
            paths = glob("../../*/*.pdf")
            for tab,path in zip(streamlit.tabs(paths),paths):
                with tab:
                    with streamlit.container(height=600):
                        pdf_viewer(path, width=800, render_text=True)

When trying to inspect it on the browser I've seen the following warnings on the console (for each document except the first one):
Warning: Setting up fake worker.
Warning: TT: undefined function: 32

As always thanks for the good work and support :)

Hi @hamdi3,
thanks for reporting back of a problem.
This is indeed weird. In one of the unit tests that I wrote I check also that the PDF on the second tab contains rendered text. 🤔 Nevertheless, I tried with a code similar to your and it looks working.
Are you sure the PDF does contains text? It could be that the PDF is an image PDF? Have you tried to change the order on which the PDF are loaded?
I did a test with 3 pdf documents. How many do you load?

 I don't think is harmless.

I've tried again, whatever pdf I'm rendering in the first tab is the only one with rendered texts (I've tried it on all my pdfs iteratively).
I've tried with 2-3-10-15-20 pdfs and had the same issue.
I'm using Chrome Version 127.0.6533.89 and unfortunately can't test it on another browser, could this be a browser issue?

OK. It's a problem with Chrome. 😭

First answer about the underfined function is nothing to worry about, just due to fonts.
I'll look into the other part, maybe I need the help of @t29mato who's a JS and Chrome Guru! 😅

@lfoppiano As always thanks for the hard work and support :)

The PR https://github.com/mozilla/pdf.js/pull/18283 added the feature to support browsers' user-configurable minimum font size. However, Google Chrome's minimum font size becomes 0 when using Streamlit's tab functionality.
PDF.js implements the text dragging feature by overlaying transparent text on the PDF. But, when the font size is set to 0, there is no text to drag, causing the feature to fail.
Code
https://github.com/mozilla/pdf.js/pull/18283/files#diff-eb5220436f55f0c6ff687c15781981b323be818cb77e49d53d66f7f372f1f23dR475-R491
ensureMinFontSizeComputed method is supposed to return more than 1, but it returns 0 when the feature doesn't work.
Temporary Solution
Downgrading to the version 4.3.136 which does not support the minimum font size, restores the drag-and-drop functionality.
Additional Information
I want to explain why the custom pdf_viewer component works when RELEASE=FALSE.
When RELEASE=FALSE, the JavaScript runs each time you click on a tab. This lets it correctly get the minimum font size, even in Google Chrome.
But when RELEASE=TRUE, the JavaScript tries to get the minimum font size for all tabs as soon as the page loads, which can cause issues.

@t29mato can you please try to make a patch that tries to force the text characters to be greater than zero?

@lfoppiano
https://github.com/lfoppiano/streamlit-pdf-viewer/commit/db7a26d606100b3b98acd1f332e2eeb01e897d1a
Okay, I made a patch branch. You need to do npm install before run the application

OK I make a release.

@t29mato I made rc1 but it doesn't seems to work.
@hamdi3 could you please give it a try to version 0.0.18-rc1?

@lfoppiano
I fixed it by downgrading the PDFjs version from 4.5.136 to 4.3.136, so updating it further won’t fix the issue.
https://github.com/lfoppiano/streamlit-pdf-viewer/commit/db7a26d606100b3b98acd1f332e2eeb01e897d1a

@t29mato that I understood :-)
I made a release 0.0.18rc1 and tested here, but did not seems to work.

@lfoppiano
It doesn't work on 0.0.18rc1 because it specifies the PDF-js version as ^4.6.82 here.
https://github.com/lfoppiano/streamlit-pdf-viewer/blob/v0.0.18-rc1/streamlit_pdf_viewer/frontend/package.json
Or am I misunderstanding something...

mmm, maybe you pushed on a different branch than fix-problem-with-chrome?

@lfoppiano
Ah, yes 💦
I've pushed it as new one
https://github.com/lfoppiano/streamlit-pdf-viewer/tree/fix/enable-text-content-on-chrome

Ok. I've released rc2, tested it works on Chome. @hamdi3 could you please try it?

@hamdi3 if you have still problems, let us know, and feel free to reopen this issue.


JDBC sink should build UPSERT query instead of using JdbcInsertBolt default INSERT query

Currently JDBC sink just uses JdbcInsertBolt and doesn't set custom query. This means the query for insertion would be INSERT INTO <table> (<column list>) VALUES (<values>).
Given that Storm guarantees at-least-once, even there's no duplicate unique key for input tuples of JDBC sink, there could be same tuples received multiple time and it makes duplication of unique key. This means basic query only works with table which don't have unique keys (including primary key) which heavily limits functionality.
Moreover, Phoenix doesn't support non-PK table and support UPSERT instead of INSERT.
So JDBC sink should basically build UPSERT-like query, which format is up to the target DB type.
JDBC sink needs to have supported DB types, and lets users select correct one.

#615

#615 is merged


APT package name gets truncated if it contains a dot

I've tried out the new prerelease (0.4.0-prerelease.2), in a branch https://github.com/probe-rs/probe-rs/pull/1830.
It seems that the package name gets truncated if it contains a dot.
I've specified the libusb package like this:
libusb-1.0-0-dev = "*"

The result was that the workflow tried to install a  libusb-1 package.
I was able to fix this by putting the package name in quotes "libusb-1.0-0-dev".
This seems to be a TOML issue, but maybe it could be detected somehow?

Hmmm, interesting issue I hadn't considered. Yes, you're right - it's a TOML thing. I wonder if it's possible for us to detect to warn about.


Switch line D readout from octave5 to octave6

Due to issues with doing acquisition on QM con6, we decided to move the readout of qw11q line D to octave6 which is connected to con8. I have tried to run a few routines and they seem to work, however thorough recalibration is probably needed.
Here is the high-power resonator spectroscopy: http://login.qrccluster.com:9000/pIVIdAmJS9W3bgbvK6NUvw==

Here is the high-power resonator spectroscopy: http://login.qrccluster.com:9000/pIVIdAmJS9W3bgbvK6NUvw==

When fits are failing because it is clearly not a Lorentzian, you may try to use the fit_function: "s21" parameter, as described in https://qibo.science/qibocal/stable/protocols/resonator_spectroscopy/resonator_spectroscopy.html#id5
Most likely you do not care that much, but it may be able to find automatically the value even when the bell shape is significantly distorted.


add whisper button to the user popup

this could either work as just autocompleting /w <username> <space> or opening the whispers tab and then autocompleting, however I think if anything, the first option would be better as not everyone has the mentions tab open

I believe this is a duplicate of #1144, however it's way better to keep this as a separate issue :)

I believe this is a duplicate of #1144, however it's way better to keep this as a separate issue :)

I mean that issue is kinda dead

twitch blocked whispers from 3rd party clients

They did not block whispers from 3rd party clients, only accounts created after 07.05.2019 are unable to send whispers over IRC.


Ability to add the date in front of every events

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior
The date is not in front of every event when there is more than one event in that day.
Expected behaviour
I would like to be able to have the date in front of every events.
Possible Solutions
Adding a new entry in the config.
Context / Reason
I have animated my card with card-mod so I can have 3 of my upcoming events in a very small card. Feel free to add something similar to my animation in your code if you like to add a "compact" view, it could be a really cool new feature.

Code of Conduct

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

@Quentin-Cloos Can you share the code for card-mod? Your animation is interesting. Thanks!

Here it is, there is probably a much cleaner way to do this (not always easy to be clean with card mod) but it works like a charm, you just need to always have 4 upcoming events if you want it to work.
  style: |
    ha-card {
      border-radius: 2.5em;
      overflow: hidden !important;
      padding-right: 20px !important;
    }
    ha-card > div > table > tbody > tr.daywrap {
      border-top: none;
    }
    ha-card > div > table > tbody {
      padding: 0px !important;
    }
    ha-card > div > table {
      margin-top: -8px !important;
      animation: scroll 15s ease infinite;
    }
    ha-card > div > table > tbody > tr > td {
      padding-bottom: 20px !important;
      padding-top: 2px !important;
    }
    ha-card > div {
      padding-top: 0.3em !important;
      margin: 0 !important;
      overflow: hidden !important;
    }
    div.event-main {
      width: 10px !important;
      white-space: nowrap !important;
      text-overflow: ellipsis !important;
    }
    div.event-main:before {
      content: '';
      display: block;
      height: 20px;
      position: absolute;
      margin-bottom: -20px;
      width: 200px;
      right: 0;
      z-index: 10000;
      background: linear-gradient(to right, rgba(43, 55, 78, 0) 0%,rgba(43, 55, 78, 0) 92%, rgba(43, 55, 78, 1) 98%, rgba(43, 55, 78, 1) 100%);
    }

    @keyframes scroll {
      0% { opacity: 0; transform: translateY(0); }
      3% { opacity: 1; transform: translateY(0); }
      20% { opacity: 1; transform: translateY(0); }
      23% { opacity: 0; transform: translateY(0); }

      26% { transform: translateY(calc(-25%)); opacity: 0;}
      29% { transform: translateY(calc(-25%)); opacity: 1;}
      46% { transform: translateY(calc(-25%)); opacity: 1;}
      49% { transform: translateY(calc(-25%)); opacity: 0;}

      52% { transform: translateY(calc(-50%)); opacity: 0;}
      55% { transform: translateY(calc(-50%)); opacity: 1;}
      72% { transform: translateY(calc(-50%)); opacity: 1;}
      75% { transform: translateY(calc(-50%)); opacity: 0;}

      78% { transform: translateY(calc(-75%)); opacity: 0;}
      81% { transform: translateY(calc(-75%)); opacity: 1;}
      97% { transform: translateY(calc(-75%)); opacity: 1;}
      100% { transform: translateY(calc(-75%)); opacity: 0;}
    }

Thanks!