Reorganize Classes/Interfaces

You currently have an Interfaces directory/namespace, but have a mixture of interfaces and classes within that folder. The interfaces aren't clearly called out in their names, so it's all very confusing when looking in the folder or in determining what something is.
I propose that you:

Follow items one through three of the PHP-FIG recommendations
Split this folder up into more meaningful folders/namespaces. As a general rule of thumb, I've found that if there's a single interface that is supported by multiple classes, those should all go into the same folder. e.g. the snscripts\html-helper\Form namespace would contain FormInterface and some specific implementation of that interface. If you have a hierarchy of interfaces, each of those child interfaces gets its own folder.

Also note that the leading back-slash on a use statement is both unnecessary and undesirable. You can take those off and get slightly better code readability. Consider also not aliasing entities when calling use, unless you have a name conflict. When you use the base name directly, there's less mental processing involved with reading the code. It cuts out a translation step.

From scanning the code and your examples, it would appear that you should have these folders:

Form
Router
Assets

Note that this recommendation is based on the current logical structure of your code. I have yet to look at your classes in depth for how this functions. ;)


Donation link should have "source=tacotruckparty"

Updated link:
https://www.hillaryclinton.com/donate/?amount=3.00&utm_source=tacotruckparty

Fixed in PR #69.


Codeunit 368 Format Document / Procedure SetPurchaseLine: Additional parameters

The function SetPurchaseLine in CU368 should have additional parameters "FormattedVATPercentage" / "FormattedLineAmount" according to the function SetSalesLine to be able to format the Line Amount in report 1322 "Standard Purchase - Order"

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.


Greenkeeper/commitizen 3.0.2

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

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Drop-Down for Dev Drive Insights doesn't show anything.

Dev Home version
0.1301.472.0
Windows build number
10.0.26100.1000
Other software
OS Build Version: 10.0.26100.1000.amd64fre.ge_release_we_adept.240331-1700
.NET Version: .NET 8.0.3
Steps to reproduce the bug
Go to Dev Drive Insights page and click on the drop-down for dev drive insights
Expected result
There should be some information displayed to the user about their dev drive.
Actual result
There is a transparent box with no information displayed.


High Severity Vulnerabilities Found

What happened?
Resulting image failed a Trivy Vulnerability scan due to multiple High severity vulnerability (CVE-2021-3600, CVE-2021-3609).
https://ubuntu.com/security/notices/USN-5003-1

What were you attempting to do?
Build an image with 'mvn spring-boot:build-image', referencing 'gcr.io/paketo-buildpacks/builder:full-cf' and run Trivy it on it.

What did you expect to happen?
Find no High level vulnerabilities

What was the actual behavior? Please provide log output, if possible.
Found high level vulnerabilities. (see attached log)
trivy_scan_output.log

Build Configuration
Using 'mvn spring-boot:build-image', referencing 'gcr.io/paketo-buildpacks/builder:full-cf'.

Patched in https://github.com/paketo-buildpacks/full-stack-release/releases/tag/1.2.13. Looks like the automation that pulls new versions of the base ubuntu:bionic image needs to be run more frequently. I'm gonna start an issue on the stacks repo to have it run daily.

https://github.com/paketo-buildpacks/stacks/issues/75

Thanks, @ryanmoran! The resulting image now has no high level security vulnerabilities.
It looks like the builder image tagged 'full-cf' at https://console.cloud.google.com/gcr/images/paketo-buildpacks/GLOBAL/builder?gcrImageListsize=30 has not been updated, which gave me pause, but my Trivy scan passed, so I'm closing this issue.


[Snyk] Security upgrade ruby from 3.0-alpine to 3.3.4-alpine

This PR was automatically created by Snyk using the credentials of a real user.![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)
Snyk has created this PR to fix 1 vulnerabilities in the dockerfile dependencies of this project.
Keeping your Docker base image up-to-date means you’ll benefit from security fixes in the latest version of your chosen image.
Snyk changed the following file(s):

samples/server/petstore/ruby-sinatra/Dockerfile

We recommend upgrading to ruby:3.3.4-alpine, as this image has only 0 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.
Vulnerabilities that will be fixed with an upgrade:

Issue
Score

Out-of-bounds Write SNYK-ALPINE316-BUSYBOX-6913410
  80

Out-of-bounds Write SNYK-ALPINE316-BUSYBOX-6913410
  80

[!IMPORTANT]

Check the changes in this PR to ensure they won't cause issues with your project.
Max score is 1000. Note that the real score may have changed since the PR was raised.
This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic

Learn how to fix vulnerabilities with free interactive lessons:
🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

@dependabot recreate


Revert to Netty 4.1.79.Final

Signed-off-by: Craig Perkins<EMAIL_ADDRESS>Description
See related issue: https://github.com/opensearch-project/OpenSearch/issues/4427
The last minor version of Netty included a change to eagerly load certificates using BouncyCastle if BouncyCastle is on the classpath: https://github.com/netty/netty/pull/12670
This change has led to errors on startup with the security plugin (See https://github.com/opensearch-project/OpenSearch/issues/4427) because of a bug in checking all required BouncyCastle dependencies (See https://github.com/netty/netty/pull/12743)
There is another bug related to the change that impacts custom bundles for private keys (https://github.com/netty/netty/pull/12746). Both bugs have since been fixed and are targeted for the next 4.1.X release of netty.
This PR reverts netty until the next 4.1.X (4.1.81.Final) release. The full list of changes in netty 4.1.80.Final can be found here
Issues Resolved
https://github.com/opensearch-project/OpenSearch/issues/4427
Check List

[ ] New functionality includes testing.

[ ] All tests pass

[ ] New functionality has been documented.

[ ] New functionality has javadoc added

[ ] Commits are signed per the DCO using --signoff
[ ] Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@cwperks all backports failed :( I think 1.3 and 2.x would a priority to get it before the release

@reta I created manual backports for 2.x and 1.3.

2.x - https://github.com/opensearch-project/OpenSearch/pull/4432
1.3 - https://github.com/opensearch-project/OpenSearch/pull/4433

Remaining manual backport PRs have been created:

https://github.com/opensearch-project/OpenSearch/pull/4438
https://github.com/opensearch-project/OpenSearch/pull/4439
https://github.com/opensearch-project/OpenSearch/pull/4440
https://github.com/opensearch-project/OpenSearch/pull/4441


Update examples to use L2s instead of L1s

Most people are probably not going to use CDK L1s with pulumi-cdk The L1s map directly to pulumi resources so you don't really gain anything by using them. The examples should be updated to use L2s which more accurately reflect what the end user will do.

Completed with all the test PRs


Fix code ordering for ubuntu 18.04 and puppet6

Pull Request (PR) description

This Pull Request (PR) fixes the following issues
Fixes : #920

Can this be merged? seems to work for me

This doesn't look correct to me. My impression is that you first need to stop the old sysvinit service and then you can define the new service. Otherwise systemd will just stop the systemd based service but leave sysvinit around.

Anything I need to do to improve this and maybe get it merged ?

I think your solution is incorrect. Once the systemd unit file is in place, systemd will use that to stop the service. However, the entire goal of the transition is to stop the service using the sysvinit script before removing that script. Only then can you start to set up systemd based services. While your change may appear to work, I don't think the transition has any effect anymore.
It also breaks the tests.

Closing for inactivity.


CookieOptions doesn't have MaxAge property

Even though SetCookieHeaderValue supports it, CookieOptions does not have a MaxAge property which means that there is no way to append cookies with a Max-Age.

Interesting, you're the first to ask for it.
Note you can use SetCookieHeaderValue and add the header directly.

Thanks @Tratcher.
For anyone reading this, here's a quick extension method that uses SetCookieHeaderValue directly:
public static class HttpExtensions
{
	public static void AppendCookie(this IHeaderDictionary headers, SetCookieHeaderValue cookie)
	{
		headers[HeaderNames.SetCookie] = StringValues.Concat(headers[HeaderNames.SetCookie], cookie.ToString());
	}
}

Usage:
Response.Headers.AppendCookie(new SetCookieHeaderValue("usid", String.Empty)
{
	Path = "/",
	HttpOnly = true,
	MaxAge = TimeSpan.Zero,
});

Thanks for the recommendation. We'll consider post 1.1. Feel free to send a PR :)

We may also have to modify CookieBuilder.cs to accommodate this change.


Make the pad op be fused with other ops

In Linalg, we can't apply transformations on ops that have padding attribute. For now, we make a pad op live in their own dispatch function, so they won't need to fuse with others.
This issue is for tracking the status of fusing pad op.

dupe of #2783


[RFE] setup dev flag for early release features

This is to keep new features from polluting the UI for users that do not want bleeding edge.

setup to use the same variable settings, "preview" flag as vscode-f5 under ext.settings.preview


How does max_distance parameter in routing solver of or-tools work

https://stackoverflow.com/questions/58523811/how-does-max-distance-parameter-in-routing-solver-of-or-tools-work

When I tried the PARALLEL_CHEAPEST_INSERTION, I did not get any result, hence, as per the condition given condition, It returned 'No solution found'
`    # Solve the problem.
assignment = routing.SolveWithParameters(search_parameters)
# Print solution on console.
if assignment:
  print_solution(data, manager, routing, assignment)
else:
  print('No Solution Found')`

Answered on stack overflow


Beta fixes: Optional Properties handling

Since the new Beta of ts-for-gir the approach to optional parameters has changed, now everywhere Partial<XY.ConstructorProps> is used, instead of declaring each property in the ConstructorProps property?: xy
This breaks many things, and they all have to be changed, this wasn't caught before, since apparently no-one (including me) used the 4.0.0-beta.2 types.
I'll try to find all places and then squash it into one commit.
Here's a fun screenshot, of using this types with the beta-2 packages:

@Totto16 You need to resolve merge conflicts here 🙂

Note: I released this and the previous commits to npm as 46.0.0-4.0.0-beta.3 in the next tag on npm and as a prerelease here on github


Low Contrast Issue in Navigation Menu and Navigation Bars

Describe the bug
The website is using a dark background with dark-colored links in the navigation menu. This causes poor visibility for the links, making them difficult to read. For instance, the links like "Meet Our Team," "Join Our Team," etc., are in dark blue, which blends into the background in dark mode.
To Reproduce
Steps to reproduce the behavior:

Go to 'Learning'.
See error

Expected behavior
Proper readability of the text written on navigation bar.
Screenshots
If applicable, add screenshots to help explain your problem.

@Rizwan102003
Can you please assign me this issue?

@Kshitijasharma I have assigned you. @SaurabhS55 @pulkitpathak99 please put the labels.


max(symbolic, int) has unexpected behaviour

The following fails:
vi = Variable("i", 1, 10)
assert max(5, vi) == max(vi, 5)

Because  max(5, vi) == <i[1-10]>
And max(vi, 5) == 5
Sorry I don't have a fix for it at the moment but do want do mention it.
And it looks like we use max on symbolic: https://github.com/tinygrad/tinygrad/blob/9c6bb7ff1344c198de21b23290bc576b3a8c9219/tinygrad/codegen/optimizer.py#L243

Hmm cool find.

I couldn't get my head around it either. It depends a bit on the use case, but I think most of the time you want the real maximum number. You could have Node.max(nodes) which retrieves the real max number for every node and then returns the maximum of all.

max() compares its arguments to determine the largest one. That results in LtNodes being used in if statements (which in turn get converted to bool).
x = Variable("x", 1, 10)
assert bool(x < 5) == True
assert bool(x > 5) == True

x < 5 is an instance of LtNode which will always get converted to True regardless of whether x will be less than 5 or not.

max(5, vi) is equal to vi because vi > 5 is True.
max(vi, 5) is equal to 5 because 5 > vi is also True.


Disable Hydration/Partial Hydration

HI is there any way to do this? I didn't see anything on the docs. It's pretty useful when you have a lot of statics nodes which don't need reactivity and they would slow the app performance without reason. I think people usually don't need Hydration on the whole tree

This has been on our radar, but not a high priority at the moment. I agree, this would be nice.
@deckchairlabs, we're you working on this concept?

This is outside of the scope of Ultra atm


feat(ocdav meta api): add id to path

Added support for fileid to filepath in ocdav meta api

ther is some related work in https://github.com/cs3org/reva/pull/1604/files


Add Example_Notebook_VIS

Add Example Notebook for GOES16 data using VIS channels for tobac functionalities. Needs revision.

sarah, thanks for the great addition!


Blursed Earth Light Level

I'm using Blursed Earth for a mob farm, but not sure how to disable it?  Seems to ignore light level, I typically use lit redstone lamps to disable the farm.

I removed the light level limit as its a mixture of the cursed and blessed, and the blessed has to have light. didn't realize that people need to stop their farms. Will readd light req


I can't open Artisan anymore

I updated my plugins (probably also Artisan) while working on a crafting list.
It caused my game to crash.
Now I can't open Artisan anymore. Here's what I've tried:

Restarting the game
Turning off the addon (causes an unload error so I can't turn it on again)
Uninstalling and re-installing the addon

If you need any more information, feel free to reach out.

This should be fixed in the latest update.

While i can now disable and enable it, I still can't open it 😭


[6.0] Adding support for custom error bags in the @error Blade directive

This change adds a new parameter to the @error directive to choose the message bag being used. Useful when there are multiple forms with separate fields/validation on the same page (e.g. shared login/register page.)
The change should be backwards compatible as it only adds an extra parameter, which when left off defaults to the old behavior of using the default error bag (named 'default'.)
I wasn't sure on the best way to parse out the second parameter, so if anyone has any suggestions on a better way to do it, I'm all ears.
My current approach uses two variables staring with $__ which then get cleaned up at the end. I also renamed the $messageCache variable that stored the previous value of $message to $__messageOriginal to match this style, if you'd prefer me to leave that unchanged I can revert it.
I've also updated the related test to test the new parameter.
Examples:
{{-- unchanged previous behavior, uses 'default' error bag --}}
@error('field')
    {{ $message }}
@enderror

{{-- new parameter to select the 'register' error bag --}}
@error('field', 'register')
    {{ $message }}
@enderror

{{-- similarly to select the 'login' error bag --}}
@error('field', 'login')
    {{ $message }}
@enderror

Resubmitted from #29747 but now on v6.0, rather than v5.8


Zoom where cursor is

Similar to the PC game Supreme Commander; I'd like to be able to zoom in on the edge of my drawing to do detail work, but zoom focuses on the center, and I can't find a way to pan the view.

To move the viewport you can either :

drag the white rectangle on the animated preview (top right)
hold the middle mouse button (or wheel button) and move your cursor

Ah, that'll do the trick. Thanks.

Fixed with #385


Question about refit

Hi,
I am now applying the refit method on my pre-trained model(model A) with new data (model B after). However, it performs worse than model A on a valid dataset. I know it could happen, but is it possible to tune the parameters during refitting to get a better result? Or my question also can be explained as Should I use the very same parameters during refitting?

could you provide the code about how you do it?
It model B is tested over "new data", you should be better than model A.
But for valid data, it is hard to say. if it is closer to data of the pretrain, the refit could not improve it.

Thanks for replying!
Well, I use the CLI version of lightgbm so it's hard to provide the code. In more details, I train model A over 7 days data, say, Sep.15 to Sep.21, model A, which will be used during Sep.22 all day.
Every hours I can collect realtime brand new data. Now I want to  update it within Sep.22. Since 'refit' is quit faster than just retraining a new model over 7 plus half days data, if I do this in the middle of Sep.22, I try using the data from half of Sep.22 to refit the model A to get model B. Another half data is my valid data, and I calculate AUC(in turn AUC_A, AUC_B).  Parameters in configure files are the same except 'task'.
The result is, AUC_B is smaller than AUC_A.

I feel like the distribution of two halves (let us donate them to p and q) in one day is much different.
So it is possible the model B is fit to p. So I think a more reasonable usage is to update it per day, not per half day.

I think the only parameter in refit is refit_decay. Others are not used.

Thanks! That helps a lot.


Change cookie serialization from Marshal to JSON

Thanks for submitting this! Have a few questions and comments:
What are the implications of this change? Will it change user visible behaviour (e.g. how values get round-tripped through the cookies)?


readTextFromClipboard  always return null

I want to know how to get the access to clipboard in telegram mini app.
Thanks!

Available only for Telegram partners.


Ssh support not working?

Application error: Connection failed: 'file_put_contents(./ssh.1537874975.156.key): failed to open stream: Permission denied' docker-f44adf22a203f34bbbae69474d628928

Maybe it's not needed.

Ne SSH to nepodporuje (V UI to ale zapnout jde). Kde jsi na to narazil.
Dodelat by se to tam dalo ale moc nevim kdo by to potreboval.

No tak by sme to mali vyhodit z UI


Failed to remove clusters from Rancher GUI

What kind of request is this (question/bug/enhancement/feature request):
Bug
Steps to reproduce (least amount of steps as possible):
step1: Run rancher server with image rancher/rancher:master, I hosted one on DO, one on GCP
step2: Add new clusters from different providers, in my case I tried DO, AWS, and GKE
step3: After clusters are active, do something work, then remove those clusters
Result:
Clusters are not removed correctly, their status are stuck on removing, clicking on their names causes 503 error.
Other details that may be helpful:
On DO/AWS/GCP dashboards, those instances are not destroyed at all.
Environment information

Rancher version (rancher/rancher/rancher/server image tag or shown bottom left in the UI): rancher/rancher:maste 10/29
Installation option (single install/HA):
single install

Cluster information

Cluster type (Hosted/Infrastructure Provider/Custom/Imported):
Hosted, Infrastructure Provider
Machine type (cloud/VM/metal) and specifications (CPU/memory):
cloud
Kubernetes version (use kubectl version):

(paste the output here)

Docker (use docker info):

(paste the output here)

@jiaqiluo does this reproduce consistently?

@cjellick It is not reproducible anymore. I think it used to happen in some rare condition and it has been fixed in the mater. The ticket can be closed.


Update Delegate and Signal for lambdas

Our Delegate code is super old. We should consider updating it.

The Delegate code has a lot of macro #if to support really old compilers. Our code relies on C++17, and perhaps soon, C++20. That means we need a reasonably modern compiler. We could gut many of the #if checks for old compiler support from the Delegate code.

Our custom Delegate implementation is from about 2005. Source:
https://www.codeproject.com/Articles/11015/The-Impossibly-Fast-C-Delegates
The current implementation far predates the C++11 standard, which introduced std::function. It seems std::function replaces the need to write a custom Delegate class. Maybe we should update to using std::function and get rid of the custom Delegate class.

Our current implementation of Delegate and Signal only really supports member function pointers. We should add lambda support when calling Signal::connect and Signal::disconnect.
NAS2D::Signal<> signal;
const auto delegate = [&object]() { object.method(); };

signal.connect(delegate);
signal.emit();
signal.disconnect(delegate);

It may be possible to inline the lambda. Here's how lambdas would compare to the existing way:
signal.connect([&object]() { object.method(); });
signal.connect(&object, &object::method);

If we move to std::function, it may make sense to use lambdas as the primary means of representing Delegate. That might mean using it as the primary storage type internally, or perhaps updating calls to prefer passing lambdas.

One area of concern I wanted to mention regarding the use of std::function, is there are some reports of performance issues with std::function, as compared to using lambas with templated methods. In particular, it adds a virtual function call, and may result in allocation of external memory when storing certain large functions, such as lambdas with a large capture group. These are not likely to be of any concern to our particular use case. In particular, for user input handlers, the tiny amount of overhead is never going to matter. Nevertheless, it might be good to better understand the situation by learning how std::function works.
First off, the performance comparison was relating std::function to template methods taking a lambda, which could inline the lambda call when instantiating the template method. The current implementation of Delegate doesn't do that. It uses pointers internally, and so it's already very similar to the virtual function call dispatch offered by std::function. The main concern then is the potential allocation of external memory.
Second, the potential use of external memory is because std::function takes ownership of the function it holds, and it can hold arbitrarily large functors, such as lambdas with large capture groups. The current implementation of Delegate doesn't provide for capturing anything beyond the this pointer, and a member function pointer, so we effectively already limit capture group size. Further, std::function offers a SBO (Small Buffer Optimization), which is generally sufficient to store such references without allocating external memory. Effectively, the only cases where std::function should need to allocate, are cases not currently supported by the Delegate code.
According to the C++ standard, the std::function object will not allocate external memory when used to store two particular small cases:

a function pointer
a std::reference_wrapper to a callable object

Notably absent is a pointer to a member function. This is relevant, as all our current uses are pretty similar to calling std::bind on a this pointer with a member function pointer. As can be demonstrated, using std::bind to group a this pointer with a member function pointer does generally produce a functor that is too large to store in a std::function without externally allocated memory. However, the solution to that is simply to use a lambda rather than std::bind, as the lambda generally does fit without the SBO constraints offered by std::function.
Example:
#include <iostream>
#include <functional>

struct Object{
	void method() {}
};

int main() {
	Object object;

	const auto func1 = std::bind(&Object::method, &object);
	const auto func2 = [&object]{ object.method(); };

	std::cout << sizeof(func1) << std::endl; // 24 - (64-bit g++)
	std::cout << sizeof(func2) << std::endl; // 8 - (64-bit g++)

	std::function<void()> callback;
	callback = func1; // external allocation
	callback = func2; // no external allocation
}

The reason for the difference in size is the lambda stores only a single pointer to object, where as the std::bind call produces an object with a pointer to object, and a somewhat large member function pointer, which consists of a function pointer and an offset value for the this pointer. For the lambda, that member function pointer and this adjustment is effectively compiled into a thunk when the compiler generates code for the lambda's operator(), and so become part of the code rather than extra data fields.
As for verifying the lambda can be stored without extra memory allocation, that can be done with valgrind, or with other test code, such as is presented in one of the ansers to this StackOverflow question:
Avoid memory allocation with std::function and member function
In summary, std::function can replace all our current uses of Delegate with no loss of efficiency, plus support other new uses of lambdas, which may (or may not) incur a slight overhead over the existing code if they are actually used (and only when they are used).

On a related matter, there is a proposal for a non-owning function_ref that never requires external storage. Some reasonably short code (~200 line) can be found on GitHub:

https://github.com/TartanLlama/function_ref

It may be worth giving some consideration to ownership characteristics. Should Signal store owning references or non-owning references to delegates.
Currently SignalSource stores the Delegate instances internally, and makes calls to them at arbitrary later times. This seems to imply ownership, and so it would make sense for SignalSource to use the characteristics of std::function.
On the other hand, SignalSource offers a disconnect function, which requires passing in a Delegate instance, which can then be searched for and removed from the list of connections. This implies the Delegate instance may exist externally for the duration of it's active lifetime. This would imply that function_ref may have suitable characteristics.
Somewhat complicating the matter is that all Delegates are cleaned up when SignalSource is destructed, and so automatically cleaned up Delegate instances might not have any corresponding external instances. Additionally, the current Delegate class has a trivial destructor, so there really is no cleanup, and no particular relevance to ownership characteristics. In fact, during cleaning, sometimes a new Delegate object is constructed, which is merely compared as having equal value to the stored Delegate instance (corresponding fields are equal), rather than having the same identity (same address).

When the delegate is a callback to a long lived object, extra storage can be kept in that long lived object, rather than the delegate. Such a setup makes std::function and std::function_ref somewhat equivalent. Instead of capturing lots of values and copying them into a lambda, a reference can be stored to externally managed data. This is pretty much the example from the earlier posts where the delegates captures &object.
For more local usage, such as for an immediate callback, catpure group parameters could potentially be stored in a struct or std::tuple, which is captured by reference:
auto data = std::tuple(a, b, c);
auto func = [&data]() { doSomething(data); };
someFunctionCallWithACallback(func);

This seems to be more what function_ref is about, since here the lambda doesn't need to live past the end of the function call it was passed to. For such a case, the function could take a function_ref instead of a std::function, which would allow it to bind to a lambda with a larger capture group without external memory allocation:
someFunctionCallWithACallback([&a, &b, &c]() { doSomething(a, b, c); });

This isn't really our use case though.
I think we should probably stick with std::function, rather than try to force function_ref hoping to gain efficiencies in areas we don't actually need or could easily work around.

A deeper question is if we even need the Signal abstraction. The point of SignalSource is to distribute an event to multiple listeners. The current code base only appears to ever have a single listener for any event. We could be using Delegate directly, rather than using SignalSource. Though I suppose there is that "what if" scenario.

I spent a fair bit of time doing research into std::function, and background material on "Type Erasure". I thought maybe I should store a list of links for posterity.
Basic research:

Avoid memory allocation with std::function and member function
Avoid memory allocation with std::function and member function
Avoiding The Performance Hazzards of std::function
C++ type erasure

Andrzej's C++ blog:

Type erasure — Part I
Type erasure — Part II
Type erasure — Part III
Type erasure — Part IV

The Old New Thing:

Inside std::function, part 1: The basic idea
Inside std::function, part 2: Storage optimization

Arthur O'Dwyer's blog:

What is Type Erasure?
The space of design choices for std::function

Misc related research:

Be Mindful with Compiler-Generated Move Constructors
Why C++ Member Function Pointers Are 16 Bytes Wide
Pointers to member functions are very strange animals
Value semantics
std::ref and std::reference_wrapper: common use cases

Standard library documentation:

std::function
std::reference_wrapper
std::ref, std::cref
std::bind

Standard library implementations and proposals:

GCC std::function
Clang std::function
MSVC std::function
function_ref
function_ref: a non-owning reference to a Callable

So I've discovered a bit of a snag. There is no operator== on std::function, which means you can't search a collection for an instance of one, either to check for duplicates in connect, or to remove an existing entry in disconnect.
There is a target template method, which can convert the std::function to the underlying function type, and which could potentially be used to write an equality comparison. However, if you're converting to a lambda type, the lambda also lacks operator==.
Conceptually it should be fairly simple to compare a lambda instance if you know they're the same type, and all captures are equality comparable. It would essentially be the same as the default equality comparison for any regular struct. Though given the nature of lambdas, I don't know of any way to add such a comparison operator to one.

Bit of a side note, but I've always found the DefaultVoidToVoid template in the Delegate code to be a bit unexpected. It doesn't appear to actually do anything. I assume it was some kind of workaround for an earlier compiler bug, though I've never found any document that describes that in any sort of detail.


WIP: Testing windows tests compilation with cache

Description: Seeing if we can force along caching of compiled test bits so we can enable compiling tests in CI
Risk Level: Low
Testing: N/A
Docs Changes: N/A
Release Notes: N/A

Testing also whether we can use tags = ["exclusive"] to sequentially perform heap-hungry compilation steps;
bazel build //test/... --build_tag_filters=-exclusive
bazel --jobs=1 build //test/... --build_tag_filters=exclusive

We're seeing some interesting results also locally with working set memory usage of cl.exe that can be significantly reduced by fixing some unnecessary mock usage, we are planning on opening an issue once we have collected data overnight to share

We can close this, we learned 1 job at a time was much too slow to finish compilation on these AZP workers and more than one ran us into resource contention issues. We could try strategies to breaking up compilation of tests into smaller increments but as we’re moving along with provisioning larger workers/RBE it’s likely not worth it


db.HasTable doesn't work for models whose TableName() returns two level name like "schema.table"

Your Question
db.HasTable doesn't work for models whose TableName() returns two level name like "schema.table"
The document you expected this should be explained
https://gorm.io/docs/conventions.html#Pluralized-Table-Name
Expected answer
Is it a bug or a correct behavior?

should been fixed.

No fixed. I still get HasTable=False when table is exist


Proposal for 'ng-where'

A really simple directive I find myself using a lot, particularly for arrays that have a 'current' index, like a slideshow, It would be cool to have some realtime variable assignment without having to write a whole directive each time.

{{slide.title}}

{{slide.body}}

angular.module('ng')

.directive( 'ngWhere', function($parse){
  return {
    scope: true,
    link: function(scope,el,attr){
      var fn = $parse(attr.ngWhere);
      scope.$watch( function(){
        fn(scope);
      });
    }
  }
});

This replaces a hack I used to do to achieve the same thing:

{{slide.title}}

{{slide.body}}

An alternate syntax, which would need a different implementation:

{{slide.title}}

{{slide.body}}

The downsides would include stuff like people putting expensive things, or real logic, inside the attribute. But overall I think it would be a cool feature for templates.
Thoughts? If there is any interest at all I can put together a real PR with tests and jazz.

We don't want to add more syntactic sugar to core. It's good as a 3rd party directive for people who need it.


Pre commit hooks

Several people working on different projects asked for help to have pre-commit hooks in their projects, in my opinion it would make sense centralize this here.
pre-commit-hooks.nix seems to be the de facto standard for this but I agree with @L-as that it would be bloated for our purposes (we already have our linter/formatter derivations and we don't want to fetch a different ghc only to build the formatter executable).
I see two possible solutions:

we implement a barebone custom solution aping pre-commit-hooks.nix (the "core" of pre-commit-hooks.nix should be quite trivial, if its repo "seems big" is because of the many supported languages)
we use pre-commit-hooks.nix adding our own custom hooks that leverages on our ,format and ,lint scripts (overriding default hooks for haskell possibly)

By the way I would make this optional.
cc @bladyjoker @maciej-bendkowski @brainrake

Hey @aciceri good stuff!
Check out https://github.com/mlabs-haskell/protobufs.nix/blob/main/src/pre-commit-hooks.nix for how to add a new hook, and https://github.com/mlabs-haskell/protobufs.nix/blob/main/pre-commit-check.nix#L16 on how to provide your own 'tools' (primarily fourmolu, but perhaps works with ghc as well).
Note that each repo comes with their own needs
  hooks = {
    nixpkgs-fmt.enable = true;
    nix-linter.enable = true;
    cabal-fmt.enable = true;
    fourmolu.enable = true;
    shellcheck.enable = true;
    hlint.enable = true;
    typos.enable = true;
    markdownlint.enable = true;
  } // protoHooks;

For the most part, mlabs-tooling can assume some common checks (nix, cabal, haskell), but we should have the ability to configure (remove and add hooks) as desired.
Additionally, most of these code quality tools have their own configuration files, would be nice to have those in a reusable but also configurable mode. Example config files: https://github.com/mlabs-haskell/protobufs.nix/blob/main/.markdownlint.yaml and https://github.com/mlabs-haskell/protobufs.nix/blob/main/_typos.toml
Hope that helps.

@bladyjoker Thank you! We'll definitely check these links when we'll work on this (don't know how soon).

We should just allow overriding the script added to the pre-commit hook.


[Event Request] C90 OnBeforeUpdPostingDescriptionOnInvoice

Hi
We need the possibility to post our own Posting Descriptions, so we would be happy about the following change:

The same event should be in the same function in CU80 as well.

We don't have this code in latest version, please check you request


cursor doesnt work when mirroring monitors

i set the HDMI-A-1 input to mirror the eDP-1 input, it works fine, however the cursor does not appear on HDMI-A-1
my config:
monitor=eDP-1,1336x768,0x0,1
monitor=HDMI-A-1,preferred,auto,1,mirror,eDP-1

#1568


Emit missing scan metrics from ScanServer

Moved lookupCount, scannedCount, queryResultCount, and queryBytesCount from
TabletServerMetricsUtil to TabletServerScanMetrics. Changed their type from
AtomicLong to LongAdder and fixed up the plumbing
Closes #2733

I deployed this to a cluster and tested it, I think it's working as intended as I'm seeing metrics from the scan servers on the Grafana main page.


CNS-2022 - Upsert operation always result in Create if the object id …

…is used as the default value for calculating sharding hashes
The fix was to not include zhash to the filter for upsert if
the object's zhash strategy uses a custom hash key instead of the
the default strategy of hashing mongo object id.

Closing this PR since it does not follow the expected nomenclature. Opening another with one the review comments included.


Support for storing fonts on flash memory

Hello Peter,
this library is great, thank you! Playing with images rendering in the Pico and ESP32 MCUs, I noticed that to read the data from file and transferring them to the video memory is not slow at all, and saves a lot of memory. I wonder if there is any interest in doing this in this library: the font index and data could be stored on the file. When a character is requested, the index is checked directly in the file, then we seek in the right place and return the bytes() with a single read_into() call, and that's it. RAM is scarse but flash memory is a bit more available.
Of course, this is mostly relevant in case the font is not frozen inside MIcroPython, but to build MicroPython to include a file that can be just copied in the flash is something many folks are not willing to do.

There is a forthcoming MicroPython feature called romfs. The idea is that there will be a read-only mountable filesystem located in Flash. This means that files can be stored in Flash without the need to recompile. Fonts will be a prime target :)

@peterhinch thanks, I followed this issue in MP GitHub! It's a great thing, indeed :) I also saw that your system also supports font files target, sorry for not noticing when I opened this issue. However you are reporting that this system is slow, but I want to give it a try, maybe with mixed approaches like taking the index in memory and only the font on disk. Anyway really a great work. Now I'm going to explore your writer class as well. Closing for now, as there are little reasons to take this open now that all is clear. However if I get any decent result I'll ping back. Cheers.

Re speed there was a major improvement in rendering of color fonts when the framebuf.blit method acquired the palette arg. This enabled glyphs to be blitted with color mapping, rather than being rendered in Python one pixel at a time. If you do decide to develop your own alternative, I suggest you ensure you use blitting with a palette.
Text rendering in the various GUI libraries is visually fast. I think you would have to be rendering a lot of small text to a large display for a problem to be visible.
Have you actually encountered a visible problem, or have you another concern such as blocking time?

@peterhinch the idea that it could be slow comes from the README of this project actually. There is a mention about the availability of file targets instead of in-memory arrays, but it is mentioned that in this way rendering is very slow. About blitting, yep, I'm aware of it, but recently by using the Viper code emitter I was able to overcome most speed limits of MIcroPython even when the C-coded library does not implement certain things.

The reference to "slow" in the README specifically refers to storing binary fonts in a file, a technique I used nearly ten years ago with ePaper displays. This was probably before the time when frozen bytecode was available. I don't think there is any real application for binary fonts. Especially once romfs goes live.
The real focus of font_to_py.py is on creating Python font files which can be frozen. The lookup performance is very much faster than a seek in a binary file; in the case of normal (non-sparse) font files it is done by array indexing. The ordinal value of the character is an address of the index, which provides an address into the font array. I'm not sure how this could be made faster.
Sparse fonts add a level of indirection but it is still a fast, efficient lookup.

@peterhinch Hello again Peter! Yes, your reasoning makes sense, however I was able to obtain good results by storing fonts directly in the flash! Probably modern flash memories are much faster. What I do, however, is to perform the binary search in-memory of course. So the seek is just to retrieve the chars bitmaps.
All the details and the code here:
https://github.com/antirez/microfont
You may be potentially interested in the blitting code I wrote in Viper, that supports rotations, a feature that the framebuf library lacks. However I understand that it's not everyday that one needs rotations :) I hope I credited you appropriately. And let me say: thank you for your great work.

Impressive! Rotation support is remarkably efficient.
You state that RGB565 is the most common color format. This is true at the device level, but is ruinously expensive in framebuf RAM for large displays. My drivers such as ILI9341 use GS4_HMSB with Viper code mapping the 4-bit color values onto 16 bit RGB565 via a LUT when the data is output to the display. If you're interested in color on bigger displays you might want to consider this approach.
I don't think vertical mapping is worth supporting: I don't know a single display currently in production that uses it.
Looking back, the "slow" performance I experienced was with binary font files stored on an SD card accessed via the official sdcard.py driver. However I made no attempt to optimise this as the target display was ePaper which took about 5s to update.
Out of interest why does the text at 45° on the blue display appear to have missing pixels? The other display looks fine.
As an aside, storing fonts as Python source has other advantages apart from the ability to freeze them. A Python font includes its indices plus the code to access the font. This means that normal and sparse fonts provide the same API: sparse fonts work with applications that pre-dated their introduction.

Thank you! I used the same technique you are using in my ST77xx driver and indeed it works great! But in this case a monochrome framebuffer is used, for minimal memory usage. Apparently many of the recent ESP32-S3 are now implementing an on-board SPIRAM of 2MB, and MicroPython can use it transparently, so we will be able to drive very large displays with an in memory RGB565 framebuffer soon, but the problem with the Pico2040 is still here, and is becoming one of my preferred MCUs.
About the missing pixels, are you referring to the lateral pixel holes you can see in the question mark of "Test!"? Other than math rounding error, there is more fundamental issue: for instance in the case of a perfect rotation to 45 degrees, in theory there are pixels coordinates approximating very well a rotated straight line. However, what the library does is different: it is actually mapping a straight line in the corresponding rotated pixels, so we are getting pixels with non-perfect coordinates. It is clear if we think at two pixels aligned vertically, one on top of the other. They have no mapping rotated 45 degrees, can either translate to a single one, or two (incrementing the length from 2 to 2*sqrt(2), either ways is wrong).
To verify that this problem is not due to oversampling, I tried to generate the same image with and without oversampling. Images attached just for fun.

My comment was on the oblique "Test!" text in this image, which seems quite corrupt:

I guess something was amiss when you created that image as the ones above don't show the effect.
These are my take-aways from our interesting discussion:

Rendering speed with your Viper optimisation is similar to my approach using blitting.
My observation about accessing a random access binary file being "slow" is out of date and was probably influenced by the official SD card driver. On-chip Flash is evidently faster. Perhaps I should remove the comment from the docs and link to this solution.
I haven't attempted text rotation but the fact that you can do it without a performance penalty is impressive.

Onboard SPIRAM has actually been around for some time on ESP32 but has only recently been widely available. Like you, I favour RP2. In my case this is because of its bare metal design: it supports hard ISR's unlike ESPx. I also like the fact that the Pico W uses a separate chip for WiFi. The second core is good, but tricky to use owing to the GIL-free MicroPython design. The super low cost is good too: I'm happy to solder them onto test boards unlike (say) Pyboard D!
My solutions aim to be cross-platform so limited RAM is something I have to accept. At the moment, even if romfs becomes available, I intend to stick with Python font files for the reason I gave and also because frozen bytecode may still have a role.
As a final comment I haven't attempted to optimise the Writer classes beyond the use of blitting with a palette. This is because, in its primary role in the various GUIs, the result is visually quick.

Thank you, @peterhinch, very interesting remarks! And I really wanted to hear the reasons for somebody with more experience than me in the embedded field about favoring the Pico VS ESP32: I look forward to test the Pico W in the next days, I ordered a few from UK, but the new borders setup make everything slow to ship. It is also super interesting how drivers and optimizations that software gets can change the game about disk VS memory (and now there is the not-so-new player, SPIRAM). I really enjoyed our exchange, and want to congratulate for the quality of your code, to modify the font conversion was straightforward because it was so well written. Great software is rare but in the embedded space perhaps even more so. Cheers!


[DRAFT] Speed up base64 encoding step for CV data logging

Please do not create a pull request without creating an issue first.
Changes need to be discussed before proceeding, pull requests submitted without linked issues may be rejected.
Please provide enough information so that others can review your pull request. You can skip this if you're fixing a typo – it happens.

[ ] I have added tests to tests to cover my changes.
[ ] I have updated docs/, if necessary.
[ ] I have updated the README.md, if necessary.

What existing issue does this pull request close?
Put closes #issue-number in this pull request's description to auto-close the issue that this fixes.
How are these changes tested?
This pull request includes automated tests for the code it touches and those tests are described below. If no tests are included, reasons why must be provided below.
These changes are tested with [...]
Demonstration
Demonstrate your contribution.
For example, what are the exact commands you ran and their output, related screenshots, screen-recordings, test runs, anything that can showcase.
Provide additional context.
Provide as much relevant context as you like.

Codecov Report

Merging #491 (cc81f92) into main (b88c3be) will decrease coverage by 0.04%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##             main     #491      +/-   ##
==========================================
- Coverage   91.50%   91.47%   -0.04%
==========================================
  Files         118      118
  Lines        8843     8853      +10
==========================================
+ Hits         8092     8098       +6
- Misses        751      755       +4

Impacted Files
Coverage Δ

dataquality/utils/cv.py
40.74% <27.27%> (-9.26%)
:arrow_down:

...uality/loggers/data_logger/image_classification.py
87.50% <100.00%> (-0.74%)
:arrow_down:

dataquality/clients/api.py
51.40% <0.00%> (+0.31%)
:arrow_up:

tests/core/test_init.py
100.00% <0.00%> (+1.42%)
:arrow_up:

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

nice! Can we add a quick test for these helpers?

I added test_base64_image_logging -- is that the kind of thing you wanted?  It's a bit complicated... I wasn't sure how to write a simple test given that we have to deal with images and files here.
I wanted to turn the part that makes a synthetic image dataset into a shared utility, but it might be tricky because of the tempfile stuff, so I just added a TODO.


Mac - Compile new binary from master before new release version

Checklist

[X] I'm asking a question and not reporting a bug/feature request
[X] I've looked through the README
[X] I've read the guidelines for opening an issue
[X] I've searched the bugtracker for similar questions including closed ones

Question
This is guide for other users who are apple dummy like me and don't understand this information from readme:
DO NOT post unrelated comments here. This has nothing to do with this thread. The instructions for running from master branch are in the README. And if you are not able to follow it, wait for the new release
If you don't want wait for new binary (maybe new master have new merged PR, but still not created new release)
you can create your custom:
A) Clone this GitHub repo with all branches
I use app Fork and clone to localhost
B) Install new version Python 3 and setup as global
https://www.freecodecamp.org/news/python-version-on-mac-update/

I use Homebrew == install Homebrew on Mac

I use  pyenv to Manage Your Python Versions == install pyenv

I use pyenv to install Python > 2.7 == Install python 3.10

I setup the last version of Python as global == setup Python as global

I install PyInstaller by Homebrew - https://formulae.brew.sh/formula/pyinstaller

So on my iMac I have now Mac OS Big Sur, homebrew, pyenv, python3, pyinstaller, make (default), zip (default).
Now open clone this project by Fork, open project folder by terminal (you see the same folder as this - https://github.com/yt-dlp/yt-dlp)
Now you have to continue as the same from readme - https://github.com/yt-dlp/yt-dlp#compile for Unix:

In terminal you write - /usr/bin/python3 devscripts/update-version.py

The version of your localhost project is update to new version by actually date

In terminal you write - make yt-dlp

The binary (execute Unix file) now will be create in actually folder

Rename your app yt-dlp in folder usr/local/bin/yt-dlp to usr/local/bin/_yt-dlp

Copy the new binary app from your fork folder to usr/local/bin/yt-dlp

Test version by terminal: yt-dlp --version

If you see new version > as from there - https://github.com/yt-dlp/yt-dlp/tags, you are finished

Thanks for this PR for me:
https://github.com/yt-dlp/yt-dlp/issues/1075
https://github.com/yt-dlp/yt-dlp/pull/1221

So what is the question?

And why open 2 issues? #1538

Ohhhh, you are very quickly and close task before I finish :)

So what is the question?

Questions was before in closed discussion, a lot of testing, install and now this is quide for apple dummy as me, how create binary for apple.

And why open 2 issues? #1538

Sorry, but maybe my iMac, but I don't want create two issues, only one :)
you can delete this other

From https://github.com/yt-dlp/yt-dlp#with-pip

You can also install the master branch with:

python3 -m pip3 install -U https://github.com/yt-dlp/yt-dlp/archive/master.zip


OCPBUGS-11882: CPO now annotates HCP pods with safe-to-evict CA annot…

Which issue(s) this PR fixes:
Fixes #OCPBUGS-11882
Depend on:

https://github.com/openshift/aws-ebs-csi-driver-operator/pull/231
https://github.com/openshift/cluster-network-operator/pull/1822
https://github.com/openshift/aws-ebs-csi-driver-operator/pull/232

This is a second approach from https://github.com/openshift/hypershift/pull/2597. This makes more sense.
Checklist

[x] Subject and description added to both, commit and PR.
[x] Relevant issues have been referenced.
[x] This change includes e2e and unit tests.

/area control-plane-operator

/lgtm

E2E tests failing because of a volume that initially does not looks like a EmptyDir one, but it turns into that one, once it gets deployed.

Test content

"cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes": "socket-dir",

Test expectation

"cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes": "bound-sa-token,socket-dir",

But in the deployment shows like this:
- name: bound-sa-token
   projected:
     sources:
     - serviceAccountToken:
       path: token
       audience: openshift

PR to fix the issue: https://github.com/openshift/aws-ebs-csi-driver-operator/pull/232

/retest-required

dropped some more suggestions, lgtm otherwise
/approve

/retest-required

/retest e2e-aws

/test e2e-aws

/cherry-pick release-4.13


White screen

I tried the polyline example and when it was run white screen
E/flutter (21942): [ERROR:flutter/shell/common/engine.cc(172)] Could not prepare to run the isolate.
E/flutter (21942): [ERROR:flutter/shell/common/engine.cc(119)] Engine not prepare and launch isolate.
E/flutter (21942): [ERROR:flutter/shell/platform/android/android_shell_holder.cc(167)] Could not launch engine in configuration.
I/zygote64(21942): Do partial code cache collection, code=30KB, data=23KB
I/zygote64(21942): After code cache collection, code=30KB, data=23KB
I/zygote64(21942): Increasing code cache capacity to 128KB

It's hard to say what's causing this. Perhaps the polyline layer is using a lot of memory.

Can you add a small example that reproduces the issue?

marking as stale


Update VS-only tooling to 4.7.2

Think you need to update this - https://github.com/aspnet/BuildTools/blob/09bf90f8fe17ff36346d293c990bec03247d8937/files/KoreBuild/KoreBuild.sh#L105

Spoke with Nate - I needed to also have a few changes from here: https://github.com/aspnet/HttpSysServer/commit/3e08bf8833827737a5bd1b64210c7a5e8e2941ec


sass syntax mixin include error "Cannot read property 'first' of undefined"

When using Sass syntax mixin includes (+foobar), extends-before-declarations.js expects these to have an atkeyword node and then attempts access properties on an undefined object resulting in the following error. This provides test cases that were able to reproduce the error and a fix to resolve it.
/.../node_modules/sass-lint/lib/rules/extends-before-declarations.js:18
          if (item.first('atkeyword').first('ident').content === 'extend') {
                                     ^
TypeError: Cannot read property 'first' of undefined

Hi @dotdat thanks for this, could you please read the Contribution guidelines before submitting a PR though.

Sure thing. Sorry for missing that document. I'll close this and start over.


When SenzingAPI supports arm64 add linux/arm64 support

Once the SenzingAPI package supports the arm64 architecture,
Change

https://github.com/Senzing/github-action-docker-buildx-build/blob/2559561faa3bb853fcf6441eae535c7f4e161ec5/action.yaml#L22

to
      default: linux/amd64,linux/arm64

Pull requests:

https://github.com/Senzing/github-action-docker-buildx-build/pull/13


Reword error message when failing to match pr

Resolve is only something internal to PAC that user don't necessary understand.
Change it to match instead which is a bit more understable i guess.
Fixes #967
Signed-off-by: Chmouel Boudjnah<EMAIL_ADDRESS>
Changes

Submitter Checklist

[ ] ♽  Run make test lint before submitting a PR (ie: with pre-commit, no need to waste CPU cycle on CI
[ ] 📖 If you are adding a user facing feature or make a change of the behavior, please verify that you have documented it
[ ] 🧪 100% coverage is not a target but most of the time we would rather have a unit test if you make a code change.
[ ] 🎁 If that's something that is possible to do please ensure to check if we can add a e2e test.
[ ] 🔎 If there is a flakiness in the CI tests then don't necessary ignore it, better get the flakyness fixed before merging or if that's not possible there is a good reason to bypass it. (token rate limitation may be a good reason to skip).

Codecov Report

Merging #1061 (64cd833) into main (57d9bf2) will increase coverage by 0.05%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main    #1061      +/-   ##
==========================================
+ Coverage   61.35%   61.40%   +0.05%
==========================================
  Files         101      101
  Lines        6133     6144      +11
==========================================
+ Hits         3763     3773      +10
  Misses       2016     2016
- Partials      354      355       +1

Impacted Files
Coverage Δ

pkg/pipelineascode/match.go
59.01% <0.00%> (ø)

pkg/resolve/resolve.go
89.81% <100.00%> (ø)

pkg/hub/get.go
82.85% <0.00%> (+3.69%)
:arrow_up:

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


Test class directory not set

When cloning master and trying to run Robolectric tests I get this error:
Class not found: "com.example.activity.DeckardActivityRobolectricTest"
Process finished with exit code 1

When I change the 'Test output path' to .../deckard-gradle-master/build/test-classes everything works fine.
@seadowg any thoughts.

I have the same problem too with Android Studio, any workaround?


Share updated python class object through multiple workers (gunicorn-fastAPI)

First Check

[X] I added a very descriptive title to this issue.
[X] I used the GitHub search to find a similar issue and didn't find it.
[X] I searched the FastAPI documentation, with the integrated search.
[X] I already searched in Google "How to X in FastAPI" and didn't find any information.
[X] I already read and followed all the tutorial in the docs and didn't find an answer.
[X] I already checked if it is not related to FastAPI but to Pydantic.
[X] I already checked if it is not related to FastAPI but to Swagger UI.
[X] I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

[X] I commit to help with one of those options 👆

Example Code
from fastapi import FastAPI, Depends
import pandas as pd
import os

class SsCorpusDataframe:
    dataframe: Optional[pd.DataFrame]

    def load_dataframe(self):
        """Loads the dataframe within the pickle file"""
        dataframe_file = os.path.join("./app/artifacts","ListsOfTitles_all_final_embeddings_formatted.pkl")
        dataframe = pd.read_pickle(dataframe_file)
        self.dataframe = dataframe
        if self.dataframe.empty:
            raise RuntimeError("Corpus dataframe is not loaded")

ss_corpus_dataframe = SsCorpusDataframe()
app = FastAPI()

@app.on_event("startup")
async def startup():
    ## Load corpus dataframe
    if os.path.isfile(os.path.join("./app/artifacts","ListsOfTitles_all_final_embeddings_formatted.pkl")):
        ss_corpus_dataframe.load_dataframe()

@app.post("/update_corpus/", status_code=status.HTTP_201_CREATED, response_model=SsCorpusOut)
def ss_update_corpus_embeddings(ss_corpus: SsCorpusBase):

    ## Set full path of the corpus embeddings pickle file
    full_path_pickle_file = os.path.join("./app/artifacts","ListsOfTitles_all_final_embeddings_formatted.pkl")

    ## Synchronous way
    update_corpus_embeddings(api_sent_embed_url=settings.api_sent_embed_address, full_path_pickle_file=full_path_pickle_file)

    ## Load corpus dataframe
    ss_corpus_dataframe.load_dataframe()

    update_corpus_out = SsCorpusOut(full_path_pickle_file=full_path_pickle_file,
                                    tag_pickle_file=ss_corpus.tag_pickle_file,
                                    size_pickle_file=os.path.getsize(full_path_pickle_file),
                                    ctime_pickle_file=os.path.getctime(full_path_pickle_file))

    return update_corpus_out

@app.post("/create_semantic_search/", status_code=status.HTTP_201_CREATED, response_model=SemanticSearchOut)
async def create_semantic_search(*, session: Session = Depends(get_session), user_query: SemanticSearchIn, background_tasks: BackgroundTasks, settings: Settings = Depends(get_settings)):

    if hasattr(ss_corpus_dataframe, 'dataframe'):

       ...

    else:
        raise HTTPException(status.HTTP_404_NOT_FOUND, detail=f"ss_corpus_dataframe object has no attribute 'dataframe'. Please update the semantic search corpus.")

Description
When running gunicorn fastAPI docker image (multiple workers processes) with no pickle file included in ./app/artifacts at startup, I managed to create the dataframe attibute of ss_corpus_dataframe object calling the /update_corpus/ route.
However, this dataframe seems to be loaded only on one process, since when calling /create_semantic_search/ route sometimes it got attended result and sometimes got HTTPException(status.HTTP_404_NOT_FOUND, detail=f"ss_corpus_dataframe object has no attribute 'dataframe'. Please update the semantic search corpus.") error.
When using gunicorn fastAPI docker image, how is it possible to share a global class object through all processes when updating the pickle file while API is running through the  /update_corpus/ route?
I saw this stackoverflow topic (https://stackoverflow.com/questions/65686318/sharing-python-objects-across-multiple-workers) discussing about caching (aiocache) but don't really understand how to apply it to my case.
Operating System
Linux
Operating System Details
Ubuntu 18.04 LTS
FastAPI Version
0.70.0
Python Version
3.8.8
Additional Context
No response

The first answer in the stackoverflow topic you linked pretty much sums it up. You can't easily share a python object between multiple gunicorn worker processes. What you want to do is store the data in an external location (server) that is accessible from any of the workers. In the example in the stackoverflow question the author describes using aiocache with a redis backend, which would work nicely, or you could simply just include something like redis and use it directly from python.
To use that you would need to extend the docker image to include redis and friends. There is a section of the documentation which describes how to extend the base fastapi docker image you're using https://fastapi.tiangolo.com/deployment/docker/#create-a-dockerfile but you should read the whole page is that is not clear to you. After that it would just be a matter of doing something like adding the connection info to the redis server in the app startup function. Then any of your worker processes can query the local redis server for the data.

already answer -> https://github.com/tiangolo/fastapi/issues/2425#issuecomment-734790381
you can close your issue, thanks

Thanks @ugtar for your detailed answer. I tested the redis option but it is slower than using a single process with uvicorn.
@raphaelauv no your reference solves the problem when loading object once at startup on multiprocesses. However, I not only need to potentially load object at startup but to update it within one specific route at anytime on all processes.

@Matthieu-Tinycoaching sorry my message wasn't clear.
How sharing memory between process is not a FastAPI question (that's why I think you can close your issue).
As you seen the --preload option of gunicorn is an easy option for copy-on-write ( where each process do not share write operations)
you want shared memory ( very probably with synchonisation mechanisme , to keep consistency) then have a look to mmap or higher level of abstraction with the python lib  but it's a bit buggy.

Understood.

A simpler solution for this is to use the python multiprocessing module and the Manager class
In  the part before the fork, create a manager object. Then every worker process will have access to this instance, that will be shared for everybody


Upload file

I need to test an upload screen, but I'm having problem with the .setFilesToUpload. I can`t upload a file.
I tryed .setFilesToUpload(Selector('input').withAttribute('type','file'), '../src/assets/logo.png') and .setFilesToUpload(Selector("#customInputFile"), "../src/assets/icon.png")
But in both cases nothing is uploaded. The screen waits for it, but no file are uploaded
<template>

      {{ label }}

        <input
          type="text"
          @dragover="handleDragAndDrop"
          @dragenter="handleDragAndDrop"
          @dragleave="handleDragAndDrop($event, true)"
          @drop="onFileChange"
          v-bind:class="{ error: dataError }"
          :placeholder="dataPlaceholder"
          :value="dataFileName"
          readonly

        />

          <button class="file-button" type="button" @click="launchFilePicker">
            SELECT A FILE
          </button>

      <input
        type="file"
        :value="filePayload"
        @input="onFileChange"
        ref="file"
        id="customInputFile"
        style="display: none"

      />
      {{ dataErrorMessage }}

      <button @click="removeImage">Remove image</button>

</template>

I see that you posted the same question on StackOverflow. Let's continue discussing this problem there.
We try to keep the GitHub issues tracker for bugs and feature requests only (see also: Contributing).
If you think that this issue is a bug, feel free to open a new issue. Please make sure to follow the bug template. Thank you in advance.


Fishing Rod line override causing issues where other mods.

Can you please change your RenderFishMixin to do something similar to how its being done in NotEnoughUpdates where its injected at the front and if the conditions are meet it will cancel the method meaning it will cancel the vanilla method but not your injected method and will run your code for rendering you can see an example of this here. https://github.com/Moulberry/NotEnoughUpdates/blob/beta/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRenderFish.java This change will allow players to use such features as the coloured fishing rod lines which is in NEU, I just hate to see players not getting the full experience of mods because of incompatibilities. Thanks for reading and I hope this change can be added!

Yeah it was my own private mod before, so removed it all should solve all issues. :D
Fixed in https://github.com/SteveKunG/SkyBlockcatia/commit/0e4834f2d9863a58f1117e26129bb37e30e5e581

You can also get experimental build in my discord : https://discord.gg/54VqgZb

Fixed in 1.0.13.


precompile(false)

Any plans to support precompilation in ReverseDiffSource?

I tried but it turned out to not work properly (possibly because of the derivation rules dictionary which is indexed by a Function). But it is certainly doable.
I'll tag this as an enhancement.
Are you facing a context in which this is a big issue ?

Thanks for looking into it! Over at Celeste.jl we'd like to use ReverseDiffSource for all the derivatives we're computing manually now (e.g., ElboDeriv.jl . Without precompilation, however, using ReverseDiffSource and calling rdiff the first time takes about 30 seconds. Since we're deploying this across a lot of nodes on a supercomputer, it would add up to quite a bit of extra runtime.

version v0.3.0 adds precompilation (and julia v0.5 compatibility) => closing
Please reopen if pre-compilation still has issues.


Add rendezvous hashing to go and python. Add Assignment policy to go so it can be used in future commits

Description of changes
Summarize the changes made by this PR.

Improvements & Bug fixes

...

New functionality

...

Test plan
How are these changes tested?

[ ] Tests pass locally with pytest for python, yarn test for js

Documentation Changes
Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

Current dependencies on/for this PR:

main

PR #1354

PR #1359

PR #1360   👈

This stack of pull requests is managed by Graphite.


Better rules parsing errors

What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area engine
/area rules
What this PR does / why we need it:
This cleans up rule validation to pass back consistent and appropriate error messages along with meaningful context. It can be used by callers that want to validate falco rules files.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:

Improve rule validation (-V) output to provide consistent info ("Ok", or error string) to stdout, including appropriate context.

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

Needs approval from an approver in each of these files:

OWNERS

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

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: leodido
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [leodido]

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

LGTM label has been added.  Git tree hash: 4a23a0b60ca6b4d984c853c2dac11062ab4eef3b

New changes are detected. LGTM label has been removed.

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

Needs approval from an approver in each of these files:

OWNERS

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

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

Needs approval from an approver in each of these files:

OWNERS

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

LGTM label has been added.  Git tree hash: 4f46d0e4761b438e14c8d56a94be06745def0618

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: leodido
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [leodido]

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

@fntlnz , since we agreed that any lua formatting changes will occur in a separate PR, can you approve this one? I can't merge w/ requested changes.

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: fntlnz, leodido
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [fntlnz,leodido]

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

Thank you!


Introduce BlockNameSpacing

Codecov Report

Merging #143 (763f88e) into main (5b5ff55) will not change coverage.
The diff coverage is 100.00%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
@@             Coverage Diff             @@
##                main      #143   +/-   ##
===========================================
  Coverage     100.00%   100.00%
- Complexity       466       470    +4
===========================================
  Files             37        38    +1
  Lines           1344      1355   +11
===========================================
+ Hits            1344      1355   +11

Files
Coverage Δ

src/Sniff/BlockNameSpacingSniff.php
100.00% <100.00%> (ø)

src/Sniff/OperatorSpacingSniff.php
100.00% <100.00%> (ø)

src/Standard/Generic.php
100.00% <100.00%> (ø)

src/Token/Token.php
100.00% <ø> (ø)

src/Token/Tokenizer.php
100.00% <100.00%> (ø)

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


add fershad.com

Got an invalid trailing slash in your json there

going to try again with a fresh PR


Add "layout" to the SparsePauliOp (and related operators)

What should we add?
The Pitch (or TL;DR)
For certain applications and operations I keep myself wishing for a builtin "layout" inside the SparsePauliOp. Note, that I am using "layout" due to the lack for a better word (since qargs is already taken).
Example
I think my particular application is best described with an example:
Consider I have a 127-qubit QuantumCircuit and would like to define a single-qubit Z observable on qubit index 13. While there are many means to construct a SparsePauliOp to represent this, in the end, the resulting object will always contain 126 identities.
>>> SparsePauliOp.from_sparse_list([("Z", [13], 1.0)], 127)
SparsePauliOp(['IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIZIIIIIIIIIIIII'],
              coeffs=[1.+0.j])

Not only is it pretty hard to tell on which index the Z lies, but any subsequent mathematical operations with this object will also be "expensive".
For example. consider I want to compose this operator with an XX on qubits 12 and 13. This would "perform unneeded math" on all the identities surrounding the very local observables.
Granted, for many arithmetic operations, one can set the qargs to perform local arithmetics. However, keeping track of the qargs alongside the operators can become cumbersome and cluttering.

Simple proposal
Thus, I propose some sort of "layout" or "qargs" (but this is already used) attribute that is internal to the SparsePauliOp (and likely PauliList and maybe BasePauli by extension).

Again, I am using "layout" due to a lack for a better word. I am open to suggestions!

Basically, here is a proposed idea:
a = SparsePauliOp("Z")
a.layout = [13]
a.global_num_qubits = 127  # again, open for naming suggestions

This defines a SparsePauliOp with a builtin layout. This object has an internal PauliList of length 1 but understands that it acts on a qubit index 13 out of 127 (hence the "layout" name suggestion).
Later, one can also define the XX similarly and do math as follows:
b = SparsePauliOp("XX")
b.layout = [12, 13]
b.global_num_qubits = 127

ab = a @ b
print(ab)
print(ab.layout, ab.global_num_qubits)

which will result in:
SparsePauliOp(['YX'],
              coeffs=[-0.+1.j])
[12, 13] 127

The key takeaways are, that even though we performed arithmetic operations, the operator remained small and, thus, avoids unnecessary computations.
I would also expect this to work on an XX with a layout [7, 13] which should still output a 2-qubit overall sized object:
SparsePauliOp(['XY'],
              coeffs=[-0.+1.j])
[13, 7] 127

Naive PoC
SparsePauliOp.apply_layout already makes an implementation of this fairly straight forward. Here is a naive insertion that I added to SparsePauliOp.compose to make the example above actually functional:
        composed_layout = None
        global_num_qubits = None
        if qargs is None:
            do_layouting = self.layout is not None or other.layout is not None
            if do_layouting:
                composed_layout: set[int] | list[int] = set()
                if self.layout is not None:
                    composed_layout = set(self.layout)
                else:
                    composed_layout = set(range(self.num_qubits))
                if other.layout is not None:
                    composed_layout.update(set(other.layout))
                else:
                    composed_layout = set(range(other.num_qubits))
                composed_layout = list(composed_layout)

                global_num_qubits = max(
                    self.global_num_qubits or self.num_qubits,
                    other.global_num_qubits or other.num_qubits,
                )

                if self.layout is not None:
                    self = self.apply_layout(
                        [composed_layout.index(q) for q in self.layout],
                        len(composed_layout),
                    )
                if other.layout is not None:
                    other = other.apply_layout(
                        [composed_layout.index(q) for q in other.layout],
                        len(composed_layout),
                    )

This is, of course, by no means a production quality solution, but it shows the basic idea and it shows, that with the addition of apply_layout we have already taken a step into this direction.

Open Question

how would this need to interact with OpShape?
what is the "best" level to implement this on? Should the layout and global_num_qubits better be placed on PauliList and leave SparsePauliOp mostly untouched? I think this should be possible to a large degree. The same could probably be said for the apply_layout method (see also #11824)
should we wrap layout and global_num_qubits into a single object of some sort?

Use cases

easier "local" arithmetics
step towards "sparse SparsePauliOp" (caveat being that all terms inside a SparsePauliOp are constrained to the same sparse qubit indices; so this is not quite fully sparse yet)
routing of observables (possibly of interest to the runtime team)

I am happy to work on a PR to implement this. @caleb-johnson had also expressed interest in helping out with this.

a = SparsePauliOp("Z")
a.layout = [13]
a.global_num_qubits = 127  # again, open for naming suggestions

I think it is important for any solution to this problem to be elegantly composable.  One should be able to create an operator in some succinct way with a Pauli Z on the 13th qubit (as you have done), stored sparsely.  But one should also be able to compose that with a layout (e.g. a TranspiledLayout) to get an even bigger operator in the same form.  For instance, I should be able to apply a layout on a 133 qubit device to the operator a above and work with it as a new, well defined SparsePauliOp.  In this case, should layout be simply a list, or some object that represents this history?  I suppose a list-like object is probably best because it would make working with it the most efficient.

Sorry this didn't have much of a response.  To link to other threads of work that we have going on, we're going to be implementing #12282 as part of our six-month performance push, which heavily touches on the same kinds of concerns as this, as I understand it.
Let me preface this with: having sparse-per-qubit operators, as mooted by this issue, is absolutely something I agree is a good idea and super useful.  Beyond that, though, I'm not certain that putting it onto SparsePauliOp would be super successful/useful:

just from an engineering perspective, there's a lot of code out there that uses SparsePauliOp and the symplectic structure directly, and adding an extra attribute onto it that changes the meaning of the operator is going to be hard to do in-place without causing problems for existing code.
the tendency to do arithmetic on these operators is likely to stop them from being qubit-sparse very quickly, which means we then end up with an operator that's not optimised to store the qubit-sparse components, and because of the partial support, is no longer well-optimised to operate in the general case fast either.

Point one I think is relatively self-explanatory - there's ways to mitigate it, but it'll always be tricky given then extant body of code that already relies on SparsePauliOp, including as an input format (primitives).
To explain my worries around point two more: this makes it such that now most operations on SparsePauliOp can no longer be direct bitwise operations on the two sets of symplectic matrices, but first need some sort of temporary expansion (say if there's a layout [0, 1] interacting with [0, 2]) or qubit re-ordering ([0, 1] interacting with [1, 0]), and even operations that don't need to do that would still have to run through the layouts to compare them before doing anything.  There'd also be the risk that things like parity operators like $Z_0 + Z_1 + Z_2 + \dotsb$ would erase the sparsity structure entirely (since all summands need to be the same width in the SparsePauliOp symplectic format).

From this, then, the way I'm looking at the problem of "we need an operator that's efficient to manipulate where the terms are sparse over qubits" is more in favour of a new operator that builds in the sparsity structure to individual summands, and that that's something that would be cleaner and more performant to build into a solution to #12282 than to put on the top of SparsePauliOp and risk performance and affecting existing interfaces.
If we wanted to move ahead with the general principles laid out in this issue, I think something to consider is whether it would be better to make a wrapper around SparsePauliOp that adds the concept of layout, similar to how a Qiskit Gate is only defined as the natural width of the gate, but QuantumCircuit stores a (gate, operands) context pair, and interacts gates that way.  A similar thing could be done with a wrapper object around SparsePauliOp (though more likely, (Pauli, coeff) pairs) .  That said, that's kind of just coming down to how I'm thinking about #12282 as well.

Fwiw, at the ~100-qubit scale, I think the memory savings of a fully qubit-sparse operator vs a bitpacked full symplectic representation of the Pauli terms (i.e. just SparsePauliOp, but bitpacked in Rust space rather than byte-aligned Booleans like here) are rather less than one might think once things like the extra sparse overhead and internal data alignment have been fully considered.  But at the several-thousand qubit scale it's obviously much more of an improvement, and the real kicker with #12282 is the extended alphabet to avoid exponential explosion of the terms for things like magnetisation operators.

With the merging of SparseObservable in #12671 (and others), the idea of a "qubit sparse" observable is now present in Qiskit.  The feature set of SparseObservable isn't quite as complete as SparsePauliOp's for Qiskit 1.3 (I ran out of time to write the implementations of compose, evolve and to_matrix, and didn't give it qargs I think are the main ones), but the base representation is now in Qiskit.
Given the above discussion, I'll close this now with the ideas being that SparseObservable will fulfil the use-case, that adding a long-standing layout field to SparsePauliOp would break too much existing code that acts on the class, and that the requirement of each term to include all qubits from every term will cause problems for the sparsity in general.
Feel free to open more if there's more to discuss here (and to point out stuff that's missing in SparseObservable other than the current trackers #13389, #13390, #13391).


Could you please translate the browser interface into Chinese?

Operation System:macOS
Beaker Version:v0.7.10
Is there any plan to translate the browser interface into Chinese?
We really need it, thank you

@pfrazee Also did you have any thoughts about translating Beaker's website?

We'll probably try to handle both at the same time, but we are very far away from having the resources for it.


Thanks for Lagrange!

Hi, I wanted to drop by and leave a note that this software is amazing. I've been playing around with the new release and...

Replacing link icons w/ emojis is really elegant
The new translation tool is straight up magic
Everything works seamlessly across desktop and mobile
gopher:// and finger:// both work great

The amount of built-in functionality in Lagrange is insane! You rock!

Thanks for the feedback, I really appreciate it!

Seconding this <3


#48 Rotate image in c++ @hacktoberfest

Problem Number: 48
Link to Problem: https://leetcode.com/problems/rotate-image/

@fnaticIT Assigned in C++

@piyushsharma220699 Can you assign this problem to me for C.

@khushij12 Assigned in C 👍🏻


Handler for aliases to child directories

path.relative does not give a requirable path for aliases that exist under a child directory.

Sorry for the delay, nice! Thanks for your contribution!


Issue with context lifetimes

Hey all, I've been trying to integrate this library into Bevy for helping managing entity states. However I've encountered some issues with the borrow checker and passing in mutable references via Context to the state machine. I believe the root of the issue is that in IntoStateMachine type Ctx<'ctx> only has a single lifetime, which is not expressive enough to pass around mutable references to structs that contain mutable borrows themselves.
I've tried to reduce the problem to some minimal examples
mod example_broken {
    struct Foo;

    struct Event<'a> {
        value: &'a mut Foo,
    }

    struct Context<'a, 'b> {
        event: &'a mut Event<'b>,
    }

    type Ctx<'a> = Context<'a, 'a>;

    fn takes_context(context: &mut Ctx<'_>) {
        unimplemented!()
    }

    fn example(mut event: Event) {
        // Error: Event does not live long enough
        takes_context(&mut Context { event: &mut event })
    }
}

This example I think shows the root of the problem, the type alias type Ctx<'a> = Context<'a, 'a> forces the lifetime of the borrow 'a in event: &'a mut Event<'b> to be the same as the data borrowed by Event 'b. In this case, Event contains data borrowed from the ECS system, whereas 'a only lives for the lifetime of example. Hence the problem, it wants event in example to life as long as the data borrowed from the ECS system.
If we allow type Ctx<'a> to have two lifetime parameters type Ctx<'a, 'b> this is enough to allow the borrow checker to track the lifetimes independently.
mod example_working {
    struct Foo;

    struct Event<'a> {
        value: &'a mut Foo,
    }

    struct Context<'a, 'b> {
        event: &'a mut Event<'b>,
    }

    type Ctx<'a, 'b> = Context<'a, 'b>;

    fn takes_context(context: &mut Ctx<'_, '_>) {
        unimplemented!()
    }

    fn example(mut event: Event) {
        takes_context(&mut Context { event: &mut event })
    }
}

Another solution I explored was adding lifetime constraints to the function itself, however this makes the function longer a valid system for bevy.
mod example_lifetime_constraints {
    struct Foo;

    struct Event<'a> {
        value: &'a mut Foo,
    }

    struct Context<'a, 'b> {
        event: &'a mut Event<'b>,
    }

    type Ctx<'a> = Context<'a, 'a>;

    fn takes_context(context: &mut Ctx<'_>) {
        unimplemented!()
    }

    fn example<'event, 'value>(event: &'event mut Event<'value>)
    where
        'event: 'value,
    {
        takes_context(&mut Context { event: event })
    }
}

Another approach is to use Rc<RefCell<Event>> which lets us eliminate the compile checking of the problematic borrow of event so that Context only has a single lifetime and is thus compatible with the type Ctx<'ctx> definition.
mod example_ref_cell {
    use std::{cell::RefCell, rc::Rc};

    struct Foo;

    struct Event<'a> {
        value: &'a mut Foo,
    }

    impl<'a> Event<'a> {
        fn mutate(&mut self) {
            unimplemented!()
        }
    }

    struct Context<'a> {
        event: Rc<RefCell<Event<'a>>>,
    }

    type Ctx<'a> = Context<'a>;

    fn takes_context(context: &mut Ctx<'_>) {
        context.event.borrow_mut().mutate()
    }

    fn example(mut event: Event) {
        let rc = Rc::new(RefCell::new(event));

        for i in 1..3 {
            takes_context(&mut Context { event: rc.clone() })
        }
    }
}

Curiously, if you pass the &mut event directly i.e. Context is just a type alias, it works?
mod example_bare {
    struct Foo;

    struct Event<'a> {
        value: &'a mut Foo,
    }

    impl<'a> Event<'a> {
        fn mutate(&mut self) {
            unimplemented!()
        }
    }

    type Context<'a> = Event<'a>;

    type Ctx<'a> = Context<'a>;

    fn takes_context(context: &mut Ctx<'_>) {
        context.mutate()
    }

    fn example(mut event: Event) {
        for i in 1..3 {
            takes_context(&mut event);
        }
    }
}```

Given this, would you be open to a Pull Request that changed type Ctx<'ctx> to have two lifetime parameters instead? Given the stated purpose of Ctx is to allow the passing of mutable references into the State Machine it would seem needing two lifetime parameters is required.

Hi Dylan
Would reborrowing value be an option for you?
mod example_reborrow {
    struct Foo;

    struct Event<'a> {
        value: &'a mut Foo,
    }

    struct Context<'a, 'b> {
        event: &'a mut Event<'b>,
    }

    type Ctx<'a> = Context<'a, 'a>;

    fn takes_context(context: &mut Ctx<'_>) {
        unimplemented!()
    }

    fn example(mut event: Event<'_>) {
        // Reborrow `value`
        let mut event = Event { value: &mut event.value };
        takes_context(&mut Context { event: &mut event })
    }
}

I must admit support for Bevy was a bit of an afterthought. I've been following its development from a distance, and only added the bevy feature when I saw people were interested in using it.

Unfortunately the fields of EventWriter are private so I don't think I can re-borrow it.
I understand that Bevy support is not priority for this library, but wouldn't the lifetime issue occur whenever Context involves borrowed mutable data?

My plan was to have the StateMachine be pure / effectless (for easier testing, e.g. property / model testing) and emit an event stream that other systems could subscribe to, to perform mutations on the game state. The Rc<RefCell<EventWriter<'_, _> works well enough for now. I don't think it carries much overhead.

I could also use some kind of intermediary event stream that I can give to the StateMachine and then pipe it into the Bevy ECS EventWriter.


[Trigger] Translation update request

Hi,
Sometimes when RainLoop is updated there are strings added to the language files which need translation. To my best knowledge there is no trigger for (regular) translators to update the language files.
Is it perhaps an idea to ask regular translators to subscribe to this bug if they are not already subscribed to the whole repository? Then when you (@RainLoop) put a comment in this bug when there are added strings that need translation, the translators will get a notification of that.
I think this bug can even be closed for that to work, so it won't show as an open bug all the time.
Ralf.

Ok, let's try to do it.

Okay. I have parsed all pull requests and extracted who did updates on which language. I hope this is correct.
Dutch: @wtrdk and @ervee
French: @davbaumgartner and @Rbeuque74 and @sloomy
German: @Teranas
Hungarian: @KardiWeb
Italian: @nicolar and @pietroalbini
Latvian: @eddsstudio
Lithuanian: @daliusm
Norwegian: @filipblaauw
Polish: @james4321 and @skibbipl
Portuguese (Brazilian): @robertol and @arturbonnett
Portuguese (European): @insertc0in
Simplified Chinese: @yutianhot
Spanish: @yasselavila
Turkish: @s4l1h
Ukrainian: @alex-connor
These people will now get a notification if I'm correct.
If you do not want this notification, you can unsubscribe to this via the unsubscribe button on GitHub.

[SETTINGS_SECURITY]
LEGEND_SECURITY = "Security"
LABEL_AUTOLOGOUT = "Auto Logout"
AUTOLOGIN_NEVER_OPTION_NAME = "Never"
AUTOLOGIN_MINUTES_OPTION_NAME = "%MINUTES% minute(s)"

[SETTINGS_ACCOUNTS]
DEFAULT_IDENTITY_LABEL = "default"

[COMPOSE]
BUTTON_REQUEST_DSN = "Request a delivery receipt"

Cool

[MESSAGE]
BUTTON_THREAD_LIST = "Thread list"
BUTTON_THREAD_PREV = "Previous"
BUTTON_THREAD_NEXT = "Next"

[SHORTCUTS_HELP]
LABEL_THREAD_NEXT = "Next message in thread"
LABEL_THREAD_PREV = "Previous message in thread"

[MESSAGE]
BUTTON_THREAD_MORE = "More messages"

[MESSAGE_LIST]
BACK_TO_MESSAGE_LIST = "back to message list"

[SHORTCUTS_HELP]
LABEL_OPEN_THREAD = "Open selected thread"

[SETTINGS_FOLDERS]
HELP_DELETE_FOLDER = "Delete folder"
HELP_SHOW_HIDE_FOLDER = "Show/hide folder"
HELP_SHOW_HIDE_FOLDER_COUNT = "Show/hide folder message count"

[MESSAGE]
LINK_DOWNLOAD_AS_ZIP = "Download as zip"
LINK_SAVE_TO_OWNCLOUD = "Save to ownCloud"
LINK_SAVE_TO_DROPBOX = "Save to Dropbox"

@RainLoop. The rainloop/v/0.0.0/langs/nl.ini is English after your latest commit. Can you revert your change and re-add the new strings so I can translate them?

@ervee Done. Thanks!

[SETTINGS_FOLDERS]
HELP_CHECK_FOR_NEW_MESSAGES = "Check/don't check for new messages"

@RainLoop
polish translation not updated with new strings

Sorry, fixed.

[POPUPS_FILTER]
SELECT_TYPE_OVER = "Over"
SELECT_TYPE_UNDER = "Under"

[SETTINGS_GENERAL]
LABEL_IDENTITY = "Identity"

[SETTINGS_OPEN_PGP]
GENERATE_ONLY_HTTPS = "HTTPS only"

add me to the language team.
i have already added arabic language.. and sent ya an email about it .

@COLORLINK, you just have to pull-request your file on the repository and they'll merge it.

And by commenting on this thread, you just added yourself to the language team ;-)

@davbaumgartner  done that.. but it seems they are not there since a while o.e
@ervee tyvm :)

[POPUPS_FILTER]
VACATION_RECIPIENTS_LABEL = "Recipients (comma separated)"

[PGP_NOTIFICATIONS]
ADD_A_PUBLICK_KEY = "Add a public key"

Hi!
I did some corrections and completed the Norwegian translation as of 29 days ago with 55011d7ae9e4c32be19de99fa549ee407534ed00, but I have not seen any response, probably because I did not ask here first.
So, is there anything else I should do, or do you think it can be merged as-is?
Thanks.

Do you still want us to contribute and pull-request translations? If so, how do we "sign the CLA"? The page you linked in your guidelines (http://www.rainloop.net/contribute/) only says "Contribute" and "Work in progress".

@akrosikam No, it is just for core developers. No need to worry if you just want to contribute a translation file.

Alright, thanks.

Hi, I have moved all translations to Transifex (https://www.transifex.com/rainloop/rainloop-webmail/).
To start translating, you have to become a member of the RainLoop translation team.

Right ;)
Requested to join the Rainloop Team :+1:

cant find arabic ?

nm. just woke up.. found it

Le 15/11/2015 01:29, RainLoop Team a écrit :

Hi, I have moved all translations to Transifex (https://www.transifex.com/rainloop/rainloop-webmail/).
To start translating, you have to become a member of the RainLoop translation team.
—
Reply to this email directly or view it on GitHub https://github.com/RainLoop/rainloop-webmail/issues/467#issuecomment-156765025.

Done :)
--
Bruno MILLION
WebDevelopeur et Webservices pour particuliers et professionnels.
Infogérance et consulting sur demande.
Site Internet : http://www.timelord.fr
Twitter : https://twitter.com/brunomillion

Requested to join the team.

Hi. 'BCC' needs translation, as well as "Request delivery receipt" and "Mark as important", all in the mail-composing window, at least in spanish

Edit: Only bcc needs the label/string. The rest weren't translated, I'll make a PR soon with translations

Translations are now managed on Transifex.

Can close the issue since Transifex is here, no ?

I think so. cc @RainLoop


Pin Numpy: numpy<2.0.0, Prevent ModuleNotFoundError

Addresses: https://github.com/outlines-dev/outlines/issues/976
Fixes https://github.com/vllm-project/vllm/pull/5582
We should close 976 after we fix Outlines to be compatible with Numpy >= 2.0.0, which this PR doesn't do.
Problem
Cannot import outlines due to outlines/base.py importing from numpy.lib.function_base import ( which no longer exists in numpy 2.0.0.
Temporary Solution
Pin numpy<2.0.0

Major revision bumps (1.x.x -> 2.x.x) always have breaking changes. Should the other requirements not be limited in this way as well?
That would have to wait, though. This issue affects all scripts and modules that import outlines, and should be merged ASAP.

Major revision bumps (1.x.x -> 2.x.x) always have breaking changes. Should the other requirements not be limited in this way as well?
That would have to wait, though. This issue affects all scripts and modules that import outlines, and should be merged ASAP.

Good idea, I created an issue for that https://github.com/outlines-dev/outlines/issues/981

Hi @rlouf, could you please make a new release? vLLM imports outlines for the OpenAI server and is currently broken because of this Numpy issue.

Will do right now


Problem with sending files on Ubuntu

Steps to reproduce

Run flask server on Linux machine.
Try to send a file after getting 'Connected' status

Expected behavior

File transfer starts.

Actual behavior

Getting the following error from browser console

Uncaught (in promise) DOMException: Failed to execute 'send' on 'RTCDataChannel': RTCDataChannel.readyState is not 'open'
    at RTCDataChannel.send (https://webrtc.github.io/adapter/adapter-latest.js:1442:34)
    at FileReader.sendChunk (http://<IP_ADDRESS>:5000/static/js/sender.js:71:21)

Operating System

Ubuntu 20.04 LTS

Browser

Google Chrome 91.0.4472.164

It seems that the problem was caused by firewall blocking packets.