For discussion: Constructor methods and polymorphic instantiation

[@lucidfox] This is my take on issues discussed in #3366 and #3425. It is yet another attempt at providing a language framework for implementing cloning and related features. This is building up on Gavin's earlier proposed syntax for constructor methods.
I'm not a Ceylon developer and I don't know how to properly open a discussion for such a feature, so I'm just posting it here. Close the issue if I'm doing it wrong.
Problem Statement
A class may need to create new instances of its own polymorphic type using a different mechanism than its interface initializer. The mechanism needs to be compatible with inheritance, allowing derived classes to extend the implementation without breaking superclass invariants.
Syntax
A constructor method is a special kind of method with the return type replaced by the keyword constructor.
The type system treats a constructor method as a method with its return type being the same as the type of the caller instance. However, it may not explicitly specify a return type in its declaration, not even the declaring class type.
A constructor method is not allowed to explicitly return a value. It can only have a return statement without a value, like a void method.
The first statement of a constructor method in a class, called the instantiating statement, must be one of:

Invocation of the superclass constructor, using the super(arguments) syntax.
Invocation of the declaring class constructor, using the this(arguments) syntax.
Invocation of a superclass constructor method, using the super.methodName(arguments) syntax.
Invocation of a different constructor method in the declaring class, using the this.methodName(arguments) syntax.

A constructor method may also be declared in an interface, in which case, if it has a body, it may not contain any of the above four declarations.
Constructor methods of the same class may not call each other in a loop.
No argument of a constructor method may be named prototype. The word prototype, while not a keyword, has special meaning within a constructor method. It is considered an implicit argument with the type of the declaring class. The invocation of a constructor or constructor method in the first statement may invoke values and methods of prototype, but not values and methods of this.
All constructor methods are implicitly shared, default, and (if refining) actual.
A constructor method may refine a normal (non-constructor) default or formal superclass method if its signature (with the return type considered to be the declaring class) matches the rules for refinement. However, such a method may not use the super.refinedMethod instantiating statement and must call either a constructor or another constructor method.
If a constructor method in a class is inherited from an interface and has an implementation in that interface, the interface implementation will be used if the superclass has an argumentless constructor. Otherwise the class must refine the interface constructor method using one of the four forms for the instantiating statement specified above. They may call the interface constructor method anywhere in the body of the refined method after the instantiating statement, as if it was an ordinary method, using the syntax InterfaceName.methodName(arguments).
Semantics
A constructor method creates a new instance of its declaring type by calling the declaring class constructor, superclass constructor, declaring class constructor method, or superclass constructor method using its first statement. Each of these methods is guaranteed, by definition, to create an instance of the polymorphic type.
During execution of the constructor method, the implicit argument this references the instance being created, while the implicit argument prototype references the instance that was used to invoke the constructor method.

If the instantiating statement calls a declaring class constructor or constructor method, the object is considered fully initialized and may not set any immutable values of the declaring class.
If the instantiating statement calls a superclass constructor or constructor method, the object is considered partially initialized, with only its superclass part initialized, and may set each immutable value of the declaring class at most once. Any immutable values that cannot be proven to be definitely initialized in the body of the constructor method are initialized between the instantiating statement and subsequent statements to shallow copies of corresponding values of prototype. The annotation suppressCopyInitialization may be added to the constructor method to suppress this implicit initialization, but in that case, references to values that are not initialized by some extralinguistic means (e.g. reflection) cause undefined behavior.

When the execution flow of the constructor method reaches its end or a return statement, it returns the newly created object (this).
Constructor methods are considered automatically refined in derived classes, with their return type always matching the type of the derived class, as if their only statement is a call to the superclass constructor method with the same arguments.
If the class gets its implementation of the constructor method from an interface, the constructor method executes as if its instantiating statement is super() (having a superclass with a non-trivial constructor is a compile error, unless the method is explicitly refined) and its only other statement is an invocation of the interface implementation, with the same arguments.
Use Cases
Cloning
The interface Cloneable is defined as:
shared interface Cloneable {
	constructor clone() { }
}

Thus, the default behavior of all classes satisfying Cloneable, or extending classes with the default implementation of clone, is to make a shallow copy of all its values. This behavior can be overridden as needed on a per-value basis, with subclasses inheriting the customized implementation.
An example explicitly refined implementation:
class ListContainer<E>(str, list) satisfies Cloneable {
	shared String str;
	shared MutableList<E> list;

	constructor clone() {
		super();
		// str is automatically copied
		list = prototype.list.clone();
	}
}

Immutable classes should not implement Cloneable, as it would give them no benefit and only waste resources on creating an identical instance. Cloneable is intended for edge cases like making a snapshot of the state of a mutable class. As such, the following idiom is expected to be common:
shared T cloneIfPossible<T>(T obj) {
	if (is Cloneable obj) {
		return obj.clone();
	} else {
		return obj;
	}
}

In particular, mutable container implementations are encouraged to refine clone to use the above idiom to deep-copy their elements.
Extralinguistic Initialization and Serialization
Ceylon is going to have a built-in serialization mechanism, of which I do not know enough to comment. However, constructor methods may be useful for implementing custom serialization mechanisms.
For example, consider the following interface:
shared interface XmlSerializable {
	shared default void writeXml(XmlWriter writer) {
		defaultWriteObjectToXml(this, writer);
	}

	suppressCopyInitialization constructor readXml(XmlReader reader) {
		defaultReadObjectFromXml(this, reader);
	}
}

the defaultXXX take the responsibility of writing and, correspondingly, initializing class values via reflection. It is up to them to guarantee that all values are initialized correctly. The intended idiom for the readXXX method is to create an "inexpensive" instance using the default constructor and then call readXXX as necessary.
Incremental Modifications and Builder Pattern
Constructor methods may be used to implement the builder pattern without a separate mutable factory class, or make small changes to an immutable class, without sacrificing immutability.
Example:
class Employee(name, dateOfBirth, job, salary) {
	shared String name;
	shared Date dateOfBirth;
	shared String job;
	shared Decimal salary;

	constructor transfer(String newJob) {
		super();
		job = newJob;
	}

	constructor raiseSalary(Decimal raise) {
		super();
		salary = prototype.salary + raise;
	}
}

Implementation
A constructor method is compiled into two methods: an ordinary public polymorphic method whose return type is the declaring class type, which is responsible for creating and returning the new instance, and a protected constructor (see below). It is overridden in derived Java classes to return the derived class type, even when not explicitly refined in Ceylon.
For each constructor method, the compiler generates a synthetic protected constructor whose first argument is a type unique for that constructor method name within the class (a protected static final nested class), its second argument is the prototype, and the remaining arguments match the arguments of the constructor method. It contains initialization code. It is also called instead of the actual constructor method when it appears as the super instantiating statement of a subclass constructor method.
Example
Ceylon code:
shared interface Cloneable {
	constructor clone() { }
}

class Base(str) satisfies Cloneable {
	shared String str;
}

class Derived(str) extends Base {
	shared Integer generation = 0;

	constructor clone() {
		super.clone();
		generation = prototype.generation + 1;
	}
}

Approximate Java code:
public interface Cloneable {
	Cloneable clone();
}

class Base implements Cloneable {
	private final String str;

	public Base(String str) {
		this.str = str;
	}

	protected static final class clone$ctor { }

	protected Base(clone$ctor dummy, Base prototype) {
		this.str = prototype.str;
	}

	public String getStr() {
		return str;
	}

	@Override
	public Base clone() {
		return new Base((clone$ctor) null, this);
	}
}

class Derived extends Base {
	private final long generation;

	public Derived(String str) {
		super(str);
		generation = 0;
	}

	protected Derived(clone$ctor dummy, Derived prototype) {
		super(dummy, prototype);
		generation = prototype.generation + 1;
	}

	public long getGeneration() {
		return generation;
	}

	@Override
	public Derived clone() {
		return new Derived((clone$ctor) null, this);
	}
}

[Migrated from ceylon/ceylon-spec#632]

We added constructors in Ceylon 1.2, though with a somewhat different approach. They can be used to solve this problem.


Disable merge on refresh in DiskThresholdDeciderIT

Disables merge on refresh for DiskThresholdDeciderIT.testRestoreSnapshotAllocationDoesNotExceedWatermark. This fixes reproducible failure on main and 2.x branches:
./gradlew ':server:internalClusterTest' --tests "org.opensearch.cluster.routing.allocation.decider.DiskThresholdDeciderIT.testRestoreSnapshotAllocationDoesNotExceedWatermark" -Dtests.seed=926BB9577ACEFB6 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=es-PR -Dtests.timezone=America/Virgin -Druntime.java=17

Issue https://github.com/opensearch-project/OpenSearch/issues/4162

#4830

Codecov Report

Merging #4828 (493a629) into main (cdc7a2f) will decrease coverage by 0.01%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##               main    #4828      +/-   ##
============================================
- Coverage     70.74%   70.73%   -0.02%
+ Complexity    57888    57868      -20
============================================
  Files          4689     4689
  Lines        277305   277296       -9
  Branches      40370    40363       -7
============================================
- Hits         196190   196138      -52
- Misses        64794    64893      +99
+ Partials      16321    16265      -56

Impacted Files
Coverage Δ

...reness/get/GetDecommissionStateRequestBuilder.java
0.00% <0.00%> (ø)

...eness/get/TransportGetDecommissionStateAction.java
23.07% <0.00%> (-1.93%)
:arrow_down:

.../org/opensearch/client/support/AbstractClient.java
32.54% <ø> (ø)

.../admin/cluster/RestGetDecommissionStateAction.java
42.85% <25.00%> (-17.15%)
:arrow_down:

...on/awareness/get/GetDecommissionStateResponse.java
42.85% <47.36%> (-1.92%)
:arrow_down:

...ion/awareness/get/GetDecommissionStateRequest.java
82.35% <83.33%> (+82.35%)
:arrow_up:

...adonly/AddIndexBlockClusterStateUpdateRequest.java
0.00% <0.00%> (-75.00%)
:arrow_down:

...luster/routing/allocation/RoutingExplanations.java
41.37% <0.00%> (-58.63%)
:arrow_down:

...readonly/TransportVerifyShardIndexBlockAction.java
9.75% <0.00%> (-58.54%)
:arrow_down:

.../admin/cluster/reroute/ClusterRerouteResponse.java
55.00% <0.00%> (-45.00%)
:arrow_down:

... and 478 more

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


Use specialization constants in clustered renderer

Keep track of when projector, soft shadows or directional soft shadows are enabled.
Enable them via specialization constant where it makes sense.
Re-implements soft shadows.
Re-implements light projectors.

Bugsquad edit: Follow-up to https://github.com/godotengine/godot/pull/50325. This closes https://github.com/godotengine/godot/issues/45733 and closes https://github.com/godotengine/godot/issues/50094.

Need to look at this more closely but sounds like a good way to improve multiview as well, instead of using defines add a constant in. Though not sure if that would rhyme well with us not wanting to compile any multiview shaders if XR is not enabled.

@BastiaanOlij specialization constants work as long as you dont add any new input or output to the shaders, not sure if this is the case with multiview, but probably not.

@BastiaanOlij specialization constants work as long as you dont add any new input or output to the shaders, not sure if this is the case with multiview, but probably not.

Hmmm, thats a good point because Multiview adds the gl_ViewIndex built-in input.


error: 'Right-hand side of 'instanceof' is not an object' after updating to 2.0.0

Hi! After upgrading to 2.0.0 I got a error:

and in the:
@UIRouterModule({
  imports: [
    CommonModule,
    NgbModule,
    FormsModule,
  ],

Hey thanks for this.
I'm reworking the approach to NgModule support.  My original approach wouldn't work with AoT compile.  We'll be nuking the UIRouterModule decorator in favor of an approach like the v3 router with forRoot() and forChild() factory methods.
Once that lands, I'll take a closer look at this PR.

I think this was fixed by 7c54b751bf25f3f07250bc9769917d58b1d30934

Getting same error with 1.0.0-beta.2 .

Is there workaround for this? Cannot find what exactly in my app is causing this issue. Commented out almost everything in my app but still getting this error. Is this error happens to everyone using 1.0.0-beta.2 or there is something specific in configuration, etc.?

@erik-rope, what version of typescript you are using?

@kolkov I'm actually not using TS. Using ES6 instead. How is it related?

Angular 2.0.0 removed all the *MetaData classes.  We were checking instanceof ComponentMetadata, but ComponentMetadata is undefined in 2.0.0.
https://github.com/angular-ui/ui-router/commit/7c54b751bf25f3f07250bc9769917d58b1d30934#commitcomment-19100421
This hasn't been released, but will be as beta.3 (later this week, probably)

@erik-ropez you can either:

wait for beta.3 and stay on angular 2.0.0-rc.6
build ui-router-ng2 off master today

@christopherthielen, tried to build but failed with #3025.

Thanks! Fixed with new version.

@erik-ropez if you're still having trouble building, I built latest master:
https://rawgit.com/christopherthielen/4170db48d3cafd3dc5948042fdaa7312/raw/54f4910fdca5c9c6afb5eddee3d6fc2476d73c4c/ui-router-ng2.js

in Angular6 am getting below error


Using CORS plugin with Preflight checks

I have a CORs plugin with rules...
		if (origin.isEmpty()) {
			corsConfig.addRule(r -> {
				r.allowHost("localhost");
				r.allowCredentials = true;
				exposeHeaders.forEach(r::exposeHeader);
			});
		} else {
			corsConfig.addRule(r -> {
				r.allowHost(origin);
				r.allowCredentials = true;
				exposeHeaders.forEach(r::exposeHeader);
			});
		}

(exposeHeaders is a list "withCredentials, Authorization, Content-Type, access-control-allow-methods")
The frontend does preflght checks on each URL, but I get 404 on OPTIONS methods, so have added a filter...
		javalin.after(ctx -> {
			if (ctx.method() == HandlerType.OPTIONS) {
				switch (ctx.status()) {
					case NOT_FOUND, METHOD_NOT_ALLOWED -> ctx.result("ok").status(200);
				}
			}
		});

Is this the correct implementation? I would have expected the CORs plugin to have automatically handled the OPTIONS response for all endpoints?

Seems there is an after handler in the CorePlugin.kt
                it.after(corsRule.path) { ctx ->
                    if (ctx.method() == OPTIONS && ctx.status() in validOptionStatusCodes) {
                        ctx.result("").status(200) // CORS is enabled, so we return 200 for OPTIONS
                    }
                }

Trying to figure out why I get a not found exception with:
javalin.exception(EndpointNotFound.class, ReturnModel::notFound);

In DefaultTasks.kt  submitTask(...) falls through to the exception
 throw EndpointNotFound(method = ctx.method(), path = requestUri)

before the CorsPlugin after function is triggered...
                it.after(corsRule.path) { ctx ->
                    if (ctx.method() == OPTIONS && ctx.status() in validOptionStatusCodes) {
                        ctx.result("").status(200) // CORS is enabled, so we return 200 for OPTIONS
                    }
                }

I'm using implementation 'io.javalin:javalin-bundle:6.1.6'

@p4paul I need some extra information from you. Which code path is being hit in your tests? Do note that the allowHost part assumes https by default, so it checks for https://localhost:443 with an input of localhost. Scheme, host and Port have to match exactly for the origins to match. Do your incoming requests have an Origin Header? The cors plugin cannot operate without it.

I'm testing with http, here are the values at debug: for the allowHost origin...
r.allowHost(origin);          origin: "http://localhost:3000"

and exposeHeaders...
exposeHeaders.forEach(r::exposeHeader);

0 = "x-server"
1 = "Origin"
2 = "X-Requested-With"
3 = "Content-Type"
4 = "Accept"
5 = "Authorization"
6 = "withCredentials"
7 = "access-control-allow-methods"

For the incoming request (breakpoint DefaultTasks:58)
ctx.req.request._httpFields._fields

0 = {HostPortHttpField@12782} "Host: localhost:1601"
1 = {HttpField@12783} "Connection: keep-alive"
2 = {HttpField@12784} "Accept: */*"
3 = {HttpField@12785} "Access-Control-Request-Method: GET"
4 = {HttpField@12786} "Access-Control-Request-Headers: access-control-allow-methods,authorization,withcredentials"
5 = {HttpField@12787} "Origin: http://localhost:3000"
6 = {HttpField@12788} "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36"
7 = {HttpField@12789} "Sec-Fetch-Mode: cors"
8 = {HttpField@12790} "Sec-Fetch-Site: same-site"
9 = {HttpField@12791} "Sec-Fetch-Dest: empty"
10 = {HttpField@12792} "Referer: http://localhost:3000/"
11 = {HttpField@12793} "Accept-Encoding: gzip, deflate, br, zstd"
12 = {HttpField@12794} "Accept-Language: en-GB,en-US;q=0.9,en;q=0.8"

We have a workaround by setting:
		String o = ServiceConfiguration.getAllowedOrigin();
		Set<String> allowedOrigins = new HashSet<>(Arrays.asList(o.split(",")));
		javalin.options("/*", ctx -> {
			String origin = ctx.header("Origin");
			if (origin != null && allowedOrigins.contains(origin)) {
				ctx.header("Access-Control-Allow-Origin", origin);
				ctx.status(200);
			}
		});

However in the process of using this we noticed that you don't have a null check in the CorsPlugin for no Origin in the header:
CorsPlugin
    private fun handleCors(ctx: Context, cfg: CorsRule) {
        val clientOrigin = ctx.header(ORIGIN) ?: return

Instead of returning on null shouldn't this respond with a ctx.status(HttpStatus.BAD_REQUEST)

We have a test that covers 404 requests with the cors plugin https://github.com/javalin/javalin/blob/master/javalin%2Fsrc%2Ftest%2Fjava%2Fio%2Fjavalin%2FTestCors.kt#L192-L210
So I am not really sure what's happening with your setup.

A simple Java setup of Javalin...
public class JavalinTest {

	public static void main(String[] args) {
		Javalin.create(JavalinTest::config)
				.get("/test", ctx -> ctx.result("Hello World"))
				.exception(EndpointNotFound.class, JavalinTest::notFound)
				.start(7070);
	}

	private static void notFound(Exception e, Context ctx) {
		System.out.println(e.getLocalizedMessage());
	}

	private static void config(JavalinConfig config) {
		String value = "x-server,Origin,X-Requested-With,Content-Type,Accept,Authorization,withCredentials,access-control-allow-methods";
		String[] tags = value.split(",");
		List<String> exposeHeaders = Arrays.asList(tags);

		config.bundledPlugins.enableCors(cors -> cors.addRule(r -> {
			r.allowHost("http://localhost:3000");
			r.allowCredentials = true;
			exposeHeaders.forEach(r::exposeHeader);
		}));
	}
}

Then use Curl to simulate the frontend...
curl -I -X OPTIONS --location "http://localhost:7070/test" -H "Origin: http://localhost:3000"

returns 200, but...
You get the exception in the output...
2024-07-25 15:11:07 [main] INFO  Javalin:16 -
       __                  ___           _____
      / /___ __   ______ _/ (_)___      / ___/
 __  / / __ `/ | / / __ `/ / / __ \    / __ \
/ /_/ / /_/ /| |/ / /_/ / / / / / /   / /_/ /
\____/\__,_/ |___/\__,_/_/_/_/ /_/    \____/

       https://javalin.io/documentation

2024-07-25 15:11:07 [main] INFO  Javalin:16 - Javalin started in 112ms \o/
2024-07-25 15:11:07 [main] INFO  Javalin:16 - Listening on http://localhost:7070/
2024-07-25 15:11:07 [main] INFO  Javalin:16 - You are running Javalin 6.1.6 (released May 28, 2024).
Endpoint OPTIONS /test not found

That is as expected as you have not defined an options handler, the after handler still runs so everything works as expected cors wise. Having your own options handler is also supported, as documented with one of the unit tests.
You can theoretically run everything in a before handler and just don't define any endpoints but that would be definitely confusing for everybody.
We cannot use option handlers directly as there is an inherent specifity problem, an users options handler would run instead of the cors options handler. Cors is also something that has to be validated on non options requests, so we would still need the before handler.
Hope that makes sense. I would probably just filter out options requests in your EndpointNotFound handler if you want to do something with the EndpointNotFound exception.

Thank you for the explanation.  I like the idea of filtering it in the EndpointNotFound exception.


[BUG] - Date picker with month and year

NextUI Version
2.4.6
Describe the bug
It is working on macOS Chrome. But on window OS Chrome, when using the Next UI date picker, selecting a specific month or year results in an incorrect display. For example, when I select August, the date picker shows July. Similarly, when I choose the year 2024, the date picker displays 2023.
Steps to Reproduce the Bug or Issue

Go to Next UI date picker
Scroll down to with month and year picker
Attempt to select the month of august
Notice that the date picker displays July instead.
Now, attempt to select the year 2024.
Notice that the date picker displays 2023 instead.

Expected behavior
When a user select August, the date picker should display August. Similarly, when a user selects the year 2024, the date picker should display 2024
Screenshots or Videos

Operating System Version
Window 11 pro 64-bit, x64 based processor
Browser
Chrome

@myatminag : Can you please assign this issue to me

Hello @wingkwong and @myatminag
First, to fix the NextUI date picker issue on Windows OS Chrome, ensure you're using the latest version of NextUI and Chrome. Verify that your timezone and locale settings are correct. Inspect the date picker with Developer Tools for JavaScript errors. If the problem persists, test in incognito mode, or other browsers, or apply a temporary workaround and report the bug to NextUI.

@HrushiYadav
I am sure using the latest version of NextUI and Chrome. I also have correct timezone and locale settings. Here is my testing in incognito mode.

I am getting the correct time zone and i am using window OS.

I am getting the correct time zone and I am using window OS.

I tried to reproduce same issue but failed to do it  I'm using windows 11


How should we reliably handle line ending

I don't think this is something we need to fix urgently, but I want to bring it up.
So, we don't want to force EOL to LF inside .editorconfig because this always conflict with git line ending normalization and mess up some windows tool. I know it's shitty, but I've been there and handling this while you work on windows is a nightmare. Let's be responsible and fix it correctly.
In almost any cases, we don't care whether we have LF or CRLF. The only case where it does matter is for cli.js because CRLF will break bash script.
I'd like us to have a foolproof prepublish hook that will ensure us correct package publication.

I would also vote for prepublish hook.

Why can't we just don't care and use LF? That is what git converts it to any ways. Starting from the following major of Git that will even be the requirement (not optional).

@twixie Git only normalize on commit, not checkout. And you publish to npm from your computer, not from the code inside a git repo.
So even if we "force" LF, that won't change anything and some people will still get it wrong.

Maybe something like gulp-line-ending-corrector with prepublish task

@hemanth why did you close this issue?

Ha, ok. I related this issued with this fix.

gulp-line-ending-corrector seems like a good idea.


Problems with space page preview

I found 3 bugs in the feature.

It is quite a problem with this for instance on suggestions report
https://www.wikitree.com/wiki/Space:Data_Doctors_Report_2022-10-02
where moving a mouse over the first row causes a lot of window openings and they don't all complete and remain opened making it imposible to navigate the page.

I think you should start preview if the user stops moving the mouse on a link for a second.

You also open the page in two steps. first a narow window, that laters extends to a wide one. can't you hide (not show) the window until the page is retrieved.

The page is not displayed as it should be. I think it inherits the formating of the link. For instance on Bold link, the displayed content is bolded. I also saw green or red content and with differnt font size.

Aleš

There is also a problem with hints onthe first paragraph on the right side. where there are edit links and they are rendered as 'undefined'
Collaboration
Edit: As a member of the Trusted List you're invited to improve this profile and upload images.
Also rendering of the tabs looks silly. If you want to click edit, you click it and you certainly don't need a preview.
Aleš

Now it is much less disturbing.
It still happens, that I end up with a few popups, if I hower on one link and then without clicking on another. If that is by design, it is ok with me. If it isn't, you should probably close existing opened window before showing a new one.
Aleš


Add Spacebring to showcase

We use Keystatic to manage all the content of our website. The PR is missing the cover URL though, I had no luck with permissions to upload it.

Very cool — thanks for sharing, @rosskhanas 🤙
I will add the cover image.

Added to the showcase — great job on this site! That's a lot of content — would love to see some screenshots or info about what the Keystatic Admin UI and config look like :)

Added to the showcase — great job on this site! That's a lot of content — would love to see some screenshots or info about what the Keystatic Admin UI and config look like :)

This is what it looks like:

Most pages are created using by using a Document component, like this:

Pages with unique structure like this:

Let me know if you want to see something more specifically, I will be happy to share 🙂
Our team loves Keystatic CMS and I love that Keystatic Cloud is solving our main problem - access to the content for our non-engineering team. So thank you for a great product 💪


Support input types and placeholders

The Field Component in the primative package currently does not allow for a type attribute to be passed to the input component field. This results in fields like password not having the proper attributes to be masked by browsers.
Main Story: ch53979
Acceptance Crtieria

[ ] When a value to the type attribute is passed to field it is applied to the Input component

@asseti6 are you going to update the type as well?


Waterdog & CloudNet

Hey
I have a Problem with my Server.
I use CloudNet and I use Waterdog (it is a fork from Bungee for the minecraft bedrock edtion).
When I turn on CloudNet maintenance and a player tries to join, this error comes up.
Error: https://paste.devin.id/kayekuvaho.md

CloudNet is checking for the permissions of a player that either is not online or hasn't has a login event fired for them.

I have the same problem.
Can you fix that?


UndefinedError on render not helpful.

Rendering a template with a dict that is missing a value returns an undefined error, which it should when using StrictUndefined(), but always returns None rather than the expected key name in the error message. Obviously, this isn't a helpful error message.
bpython version 0.14.2 on top of Python 3.4.3 /Users/rory/repos/jinja2/venv/bin/python3.4
>>> import jinja2
>>> from jinja2 import Template, StrictUndefined
>>> jinja_template = Template("{{ foo }}: {{ bar }}")
>>> jinja_template.environment.undefined = StrictUndefined()
>>> jinja_template.render({"foo": 3, "bar": 4})
'3: 4'
>>> jinja_template.render({"foo": 3})
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/Users/rory/repos/jinja2/venv/lib/python3.4/site-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/Users/rory/repos/jinja2/venv/lib/python3.4/site-packages/jinja2/environment.py", line 742, in handle_exc
eption
    reraise(exc_type, exc_value, tb)
  File "/Users/rory/repos/jinja2/venv/lib/python3.4/site-packages/jinja2/_compat.py", line 36, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 1, in <module>
  File "/Users/rory/repos/jinja2/venv/lib/python3.4/site-packages/jinja2/runtime.py", line 154, in resolve
    return self.environment.undefined(name=key)
jinja2.exceptions.UndefinedError: None is undefined

This is a usage error. It should be undefined = StrictUndefined.


Feature request: Add a resolve threshold

Proposal
So it happens quite often that I have to too much noise with flapping Alerts. I know that this can be reduced by using a longer FOR or by using thresholds over time e.g. `mean_over_time ``, but sometimes there are Situations where it is difficult to reduce noise and still have a fast response time of the alert itself.
So my Proposal is to add an optional resolve_expr to the rules where an secondary expression can be defined that resolves the alert.
Example:
  - alert: OutOfDiskSpace
    for: 10m
    expr: node_filesystem_free_bytes{mountpoint ="/"} / node_filesystem_size_bytes{mountpoint ="/"} * 100 < 10
    resolve_expr: node_filesystem_free_bytes{mountpoint ="/"} / node_filesystem_size_bytes{mountpoint ="/"} * 100 > 15
    labels:
      severity: warning
    annotations:
      summary: "Out of disk space (instance {{ $labels.instance }})"
      description: "Disk is almost full (< 10% left)\n  Space left = {{ $value }}%"

This Alert would only trigger if there is less than 10 % of Disk Space left and only resolve if there is more than 15% available. So If my Alert is fluctuating between 10% I don't get spammed by alerts. Assuming of course in this example, that the alerting on the 10% is important, so the Threshold can't be adapted.

Thank you for your report.
This is a duplicate of #4681 and can therefore be closed.
Alternatilively, you can do Hysteriesis like describe in the following blog post I wrote https://sysadvent.blogspot.com/2019/12/day-1-alerting-with-prometheus.html . Keep in mind however that you should get your alerts as simple as possible.
Another interesting resource regarding this is @brian-brazil 's blog post https://www.robustperception.io/running-into-burning-buildings-because-the-fire-alarm-stopped


When creating an org, join it in a transaction

Old tech debt from  the first iterations

Since we use the joinorg while accepting invites, I think it's fine to keep this separate..


Blog post about CZI proposal

This adds a CZI proposal along with a link to a Zenodo entry for our recent grant narrative. It also updates a few categories to standardize them with 2i2c's organizational groups.
Here's a preview of the post: https://630dfafa7418ca000922a999--cocky-booth-e7ed17.netlify.app/blog/2022/czi-global-communities-proposal/
I'll leave this PR open for a few hours and will post it later today if there are no objections!

closes https://github.com/2i2c-org/team-compass/issues/497

Looks awesome, Chris! thank you so much for taking the lead to write this.
Sorry I do not remember how to make my suggestions look like suggestions directly on the text.
I do not need to take a look again before this goes live.

thanks everybody for your helpful comments and suggestions!


Merge codebases

Copy/paste code from one repo to the other (from Lite to HB),
Remove redundancies

Hey team! Please add your planning poker estimate with Zenhub @EightRice @fabiolalombardim @Man-Jain


Update the version of jcabi log

Upgrading jcabi log from 0.17.1 to 0.18.1 in order to stay up to date and leverage the most recent improvements"

Codecov Report

Merging #11047 (b0f3d7c) into master (878f613) will increase coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master   #11047     +/-   ##
=========================================
  Coverage    0.11%    0.11%
=========================================
  Files        2200     2146     -54
  Lines      118822   116297   -2525
  Branches    18002    17689    -313
=========================================
  Hits          137      137
+ Misses     118665   116140   -2525
  Partials       20       20

Flag
Coverage Δ

integration1temurin11
?

integration1temurin17
?

integration1temurin20
?

integration2temurin11
?

integration2temurin17
?

integration2temurin20
?

unittests1temurin11
?

unittests1temurin17
?

unittests1temurin20
?

unittests2temurin11
?

unittests2temurin17
0.11% <ø> (+<0.01%)
:arrow_up:

unittests2temurin20
0.11% <ø> (+<0.01%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.
see 65 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Feature Request: React like hook shouldComponentUpdate for Vue lifecycle

I think it would be useful to have a hook like React's shouldComponentUpdate in the Vue lifecycle. The idea behind this hook would be to dynamically prevent the DOM from refreshing the component with data change.
For my use case I am attempting to build a component that uses Contenteditable as a text editor interface which updates on keyup. The DOM refresh in the lifecycle results in the caret / cursor resetting with the refreshed component. Having the option to define when the component should update would allow use of Contenteditable while continuing to update the state (vuex) and keep any of the component {{references}} in the template reactive.
From my understanding of React, the ability to make re-render conditional would also be a big performance booster for components with lots of DOM refreshes like my example above. I'm a big fan of Vue and I think adding this lifecycle hook would open up a lot of doors.

I'm not sure if shouldComponentUpdate is the right solution for your problem, maybe you should provide a jsfiddle to better illustrate what you are trying to achieve.

Vue doesn't have shouldComponentUpdate exactly because Vue doesn't need it. Vue's reactivity system ensures only the right components get re-rendered when state changes. Think of it as React with shouldComponentUpdate already implemented for you.

@yyx990803 thanks for the reply,

I have put together a JSFiddle. It contains two components. The first shows that the contenteditable updating with no caret jump. This is because there are no HTML changes to the state, and so Vue does not re-render the component. The second contenteditable component contains HTML, and when editing displays the behavior I described above. The DOM refreshes and the caret jumps to the beginning.

You are right that Vue is correctly determining which components to re-render. It is re-rendering the contenteditable div when the state changes. However in my use case I need an option to stop that automated behavior. I would like the state to continue updating, but for the component to wait to re-render until I want it to refresh. This is where a shouldComponentUpdate hook would be useful.

I like that Vue automates the rendering of the correct components, but I believe it makes sense to have an option to circumvent that behavior if desired. I believe exposing such an option/hook would open Vue up to the use of contenteditable, provide potential for performance boosts, and solve my headache :)

Hi, v-once might be helpful here. https://jsfiddle.net/he1ug0fo/
If you still need more fine grained control over rendition, one more computed setter might be helpful.(For example, getContent only updates when the cursor is not in the contenteditable).

@HerringtonDarkholme thanks for the direction! you are correct, v-once does indeed resolve this issue for my use case.
The original JSFiddle you updated did not work correctly because it was using older versions of Vue and Vuex. I have created another JSFiddle with Vue and Vuex 2.0 which demonstrates the updated functionality.
Your suggestion of a computed property makes sense to me if I intended to display the content separately through the template, however that part of the JSFiddle was just for example purposes. I still believe a shouldComponentUpdate option would be necessary for a contenteditable component that also acts as the display. Basically for anything that acts as a "text editor".
Your v-once solution works as long as I am ok with not re-rendering the component, however I could see use cases where one might wish to re-render a component  @blur or @keydown. I am currently working on adding a watcher to trigger component re-render @blur, but have not had success.
I would still be interested in seeing a shouldComponentUpdate hook, or on a more macro scale, an option to end the lifecycle at any point without causing errors.

After looking at your use case, I still don't think shouldComponentUpdate is the correct answer to it. What you want is essentially a way to let you explicit make the view and the state out of sync, (which is imo not a correct approach in the first place) and shouldComponentUpdate is primarily offered for performance optimization.
The fully framework-compliant way to deal with it (and is also what I would suggest even in React) is to have a separate piece of state that represents the input content, which can then be out of sync with the model state and can be updated only when you want to.

I just found a case that shouldComponentUpdate may make sense.
https://jsfiddle.net/hnc1u3bn/
You can see the dev console. Every time you click on a tab, all other tabs will re-render because they depend on selectedIndex (I guess). They think they need to re-render, but in fact they don't.
So in this case, even all the props are the same (index and selected), the components will still update itself. If we want to optimize the performance, shouldComponentUpdate or a react-like PureComponent may be helpful.

@CodinCat in this case the tabs are forced to update because they have slot children. Technically, this means if you implement a shouldComponentUpdate for your tabs that solely depends on the selected prop, it will be incorrect because the slot children may have changed and are not accounted for. It can lead to subtle bugs when the slot content of your tab component changes.
In React, if you use a pure component for this purpose, it will also always re-render because the children prop always gets new ReactElement references, so a shallow compare will consider them different.
Of course, you can try to diff the children nodes in a custom shouldComponentUpdate, but it's unlikely to be correct for all edge cases - plus at that point it's not much different from just re-rendering the containing component.

+1 shouldComponentUpdate might be added only to Render Functions & JSX section.

The one case from React docs maybe will make sense for You, @yyx990803.
What if the component needs to update, but only if some (not all) of its props changed?

have a separate piece of state

@yyx990803 How would you recommend passing parent data to a child without re-rendering the child? I'm currently wrapping the data-from-parent in a function and then having the parent use child.$forceUpdate to render the child as needed.
Scenario
I have mousePositionTrail data in <parent> that is changing at 60fps, the child is a DOM heavy graph that I want to update at 1fps.

I sometimes come across threads like this in the open-source world, where a person requests a feature like computed re-render, and others jump in to tell them they're doing it wrong.
I always feel like this misses the point: As developers, we need power tools. We need the power to tell the system what to do.

While I do agree (in general) with you @glassdimly, and I love the ruby programming language for following the assume-the-dev-knows-best paradigm, Vue.js does have a responsibility to be minimal.
I don't want a fix like goto just because it would solve my current problem. I'd rather the Vue.js team analyze the entire range of limitations and integrate a tool that solves all of them, or add a tool that eliminates the issue in the first place, instead of the quick fix of tacking on a shouldComponentUpate.
For example, maybe it would be better for there to be a v-should-update attribute that lets the parent control the updates, or maybe there should be a <component #data="data" /> where the # indicates that changes in the data attribute won't cause the component to re-render. I don't have all of the possible situations available so I can't say I have the ideal solution.
However, I still would like to know how @yyx990803 or anyone else would recommend passing rapidly-changing data to a component that needs to render less-rapidly.

I think your second paragraph makes a very good point @jeff-hykin which no one should overlook. I learned Vue first before learning React, and when I discovered that React didn't actually react to my data changes automatically (à la Vue), I was flabbergasted. How could something so "revolutionary" require such a primitive hack.
shouldComponentUpdate is an anti-pattern in a true reactive framework.
As for solutions to the problems outlined in this nearly 4-year-old topic, you are basically looking at a throttle or debounce. This is not strictly a Vue problem/solution. It is, however, a problem which can be solved in a userland component:
<template>

Slow data: {{ throttledData }}

</template>

Vue's $watch function on a prop works great for when you need to control updates like this. The ThrottledDataView component will always receive the most up-to-date value of data, but the watcher only updates the data model every 1000ms using throttle.

I agree with you @jeff-hykin. One doesn't want to implement a goto solution. But I think @sirlancelot's post is suggesting a workaround for a specific problem that shouldComponentUpdate solves.
In React, whenever state changes, it triggers an update--similar to data. And the same happens  with a props update. So in React, the assumption is the same as in Vue (as I understand it from my novice perspective): that when state or props update, the component re-renders. The question is whether or not your component can bail out of an update. shouldComponentUpdate allows you to bail out based on the nextState or nextProps. Here're the docs.
Now, throttling component updates is great (mout/function/throttle), and so is rendering once and only once (v-once), but what if I want to to render twice, for example? These are the sorts of totally unforeseeable (yet daily) arbitrary needs that computed bailouts of re-render solve.
shouldComponentUpdate is a power tool that allows fine-grained control over component performance by allowing the component to bail out of re-render based on arbitrary, computed criterion. And while I certainly have a lot to learn about Vue and could be wrong, it seems a problem to me that it lacks this kind of power tool.

Here's something interesting I pulled verbatim from that section of the docs (emphasis mine):

This method only exists as a performance optimization. Do not rely on it to “prevent” a rendering, as this can lead to bugs.

React shouldn't be your metric for what is "right". It is full of workarounds such as shouldComponentUpdate which obscure the developer's understanding of their own data model. When you have a clear understanding of your data model and when you want things to change, you will never need to reach for this anti-pattern. Vue doesn't have this "feature" because it doesn't need it.
As I've demonstrated in my previous comment, there is a clear, and elegant solution with a clear data model and lifecycle. I don't feel Vue.js developers need to explain why they're not creating more footguns. Even though JavaScript the language provides many of them, I find it refreshing that Vue.js helps me enforce clarity in my work.

@sirlancelot: Respectfully, it's important to have experience with the frameworks you critique.

Thanks @sirlancelot , I've actually used debouncing before but did not think of it in this situation. I'll see if I can make a version of that solution that works, but my concern is that assigning to the this.throttledData won't help because the data is an array. The value doesn't ever change, it just gets mutated by adding more data. The simple workaround is to deep copy, however that is also an issue because it results in O(n) operation and the array is very large (hour-long video data). There would need to me a more complex solution such as diffing all the values that had been added in the time since the last throttled change, which gets complicated quickly. Wrapping the data inside function that can be called when needed is a, still non-ideal, but less complex solution.

In React, whenever state changes, it triggers an update--similar to data. And the same happens with a props update.

@glassdimly My first web framework was React, I spent 1.5 years using it in work and school before I found Vue. I'm all too familiar with setState and props.
Notably, at work, we decided to use shouldComponentUpdate on a component near the beginning of a project since it was causing quite a slowdown even when the data appeared to not be changing. Later, input validation removed invalid text during render (it was in render because things other than user-events could change text and there was no way to $watch them), but changing state during render causing an infinite loop, so, to prevent the infinite loop we used shouldComponentUpdate. By the end of the project (1 year later) we had shouldComponetUpdate on 50% of all class based components. It was so difficult to debug why the component was/wasn't rendering that there were cases where after changing state we would immediately call a force render just to be sure. We also had places where we added randomly generated numbers to the state of some components so that the diffing being done in shouldComponentUpdate would detect a change and re-render. It was a colossal mess and is one of the worst codebases I have ever contributed to.

I agree with you @jeff-hykin. One doesn't want to implement a goto solution. But I think @sirlancelot's post is suggesting a workaround for a specific problem that shouldComponentUpdate solves.

goto is a solution to many specific problems, and shouldComponetUpdate  is very similar in nature: it breaks what is otherwise a predictable flow of code to directly achieve a specific behavior. Once the general rules have been broken: the only means of predicting the output is to know every intricate detail of the system, which is costly and impractical at even medium scales.
I'm a Texan, I believe in the right to shoot myself in the foot if I so desire, and I have successfully used goto to make code less complex. But, if there is a frequent reason (as indicated by a GitHub issue with many upvotes) where people truly NEED to break the rules, then the rules themselves are likely broken, and that should be discussed/addressed before handing someone a gun to shoot something very near to their foot.
I want fine grain control as well, but we should try to discuss how to provide that control through a well designed tool (like $watch) instead of an easy-to-implement tool like goto. I would like it to be easy to control the render rate AND do it without breaking any principles.


get connected peer list and their progress

I want to use webtorrent in the browser. I need to get the list of connected peers and their progress. eg: <IP_ADDRESS>, 95% ; <IP_ADDRESS>, 100% etc.
I have looked into API section and found out torrent.numPeers and torrent.on('wire', function (wire) {}). but didn't find any specific tutorial/help for my requirement.  torrent.numPeers returns the total number of peers but I need connected peers. Also, it is mentioned torrent.on('wire', function (wire) {}) is emitted whenever a new peer is connected for this torrent. but how to get the IP of the peer?
Is this feature available? If yes, can you please point me towards the right direction?

You'd be best scraping a tracker or creating a backend where you send that information. The wire API can be found here: https://github.com/feross/bittorrent-protocol, but you can only query the stats between you as a peer and that peer.
If the peers are TCP/UDP (Won't work on browser), you can get the IP using wire.addr

Btw, torrent.numPeers does return the number of currently connected peers.
You might be able to get the info you need by listening to the 'wire' event, actually:
torrent.on('wire', function (wire) {
  var downloaded = 0
  for (var index = 0, len = torrent.pieces.length; index < len; ++index) {
    if (wire.peerPieces.get(index)) {
      downloaded += (index === len - 1) ? torrent.lastPieceLength : torrent.pieceLength
    }
  }
  var percentComplete = (downloaded / torrent.length) * 100
  console.log('Peer ' + wire.addr + ' connected with ' + percentComplete + '% complete')
})

(Untested, but something like that should work)

@feross Thank you for your help. I will test the code later. just for information, is this okay to post such questions asking for help here? After all, the section is named as 'issues'. Or, should I post this to some place else, like StackOverflow? I would prefer to post here if this is not much a problem.

Posting questions is fine, but ideally you would chat with others on https://gitter.im/feross/webtorrent first 👍 Or if you use IRC, that chat room is linked to #webtorrent  on freenode.


TenUpToolkit\set_dist_url_path() function referenced but does not exist.

Describe the bug
This function (TenUpToolkit\set_dist_url_path) does not exist in the wp-scaffold code base. We should either add the function or remove the 2 function calls.
Steps to Reproduce
The function is wrapped in a conditional that would most likely not be true in most cases. The function is referenced in these 2 locations:

https://github.com/10up/wp-scaffold/blob/4b7fe407b50b8fa16d6650f32caf56bff83eb334/mu-plugins/10up-plugin/plugin.php#L11
https://github.com/10up/wp-scaffold/blob/4b7fe407b50b8fa16d6650f32caf56bff83eb334/themes/10up-theme/functions.php#L20

If you search the codebase for the function you will not find it.
Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
No response
Code of Conduct

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

@PypWalters
The function exists as part of 10up-toolkit
Can be found here: https://github.com/10up/10up-toolkit/blob/fd8b7ec9c0a4f7c22174608852d9c38dcbe37282/projects/10up-theme/functions.php
CC: @nicholasio

That's right, this file is created at build time by toolkit and it's what power hot mode reloading/fast refresh. It's only ever loaded when running locally. Toolkit also does not create that file when building for production


Add NSF's NOIRLab as registered domain

@leannep Thank you for your patience while waiting for a review and processing your request. Pull request merged. Please start applying for JetBrains educational subscription at https://www.jetbrains.com/shop/eform/students in an hour, to allow the changes to propagate through JetBrains systems.


Update docs theme

I've updated the docs theme to be consistent with the changes I've made to the tket and pytket-quantinuum repo.
https://github.com/CQCL/pytket-quantinuum/pull/91
pytket-qiskit and pytket-quantinuum seem like the most important ones to have done. I will figure out a way to do the other extensions later (ideally without making 15 identical PRs)

Can this be merged now @CalMacCQ ?


[Task] Build Kumiko's GWS API

Task Description
maybe django api, or fastapi. This will be used to retrieve assets from the api in order to then give back to the user

No need to. in fact, it's actually not recommended to do so. all assets will be on a separate github repo


Landing Page - Our Partners section

Pictures size needs to be the same.
Clicking picture needs to direct to their sites.
Updated pictures size and links on:
https://drive.google.com/drive/folders/12ln5pR-G8Pkn3_N0F8gx8OWCprMNjkWU
Please note that the pictures are double the size it needs to be (resize 50%)

@chechiktomer If we need pictures to be the same size, they need to be CUT the same size.. it's super easy and it'll make our life 10x better.

@eyalmigd @annlillman
OK?


Add new feature "rand_prime(m,n)", extending the "between(m,n)" function

Summary
rand_prime(m,n): Returns a random prime number within the range m,n.
Expected Result
It would be great to have a feature that returns a random prime number between the range as we already have "between(m,n)" that returns all the prime numbers between the range m,n.
Reproduction Steps
from primality import primality
print(primality.rand_prime(2,50))
17
print(primality.rand_prime(2,50))
29

System Information
Python 3.8.6
macOS Catalina 10.15.7

🎉 Thanks for your interest in contributing to Primality
Hello @kadhirash!
This is an interesting enhancement, but I'm having trouble figuring out how it could be implemented to fit every user's need.
A first approach could be achieved by using random.choice(), as follows.
between = primality.between(2, 4000)
random.choice(between)

But this implementation may not suit some users, who require a more advanced source of randomness like Secrets, as follows.
secrets.choice(between)
secrets.SystemRandom().choice(between)

From the above, I currently can't seem to point to any particular implementation as perfectly suiting for Primality, and would suggest users to be the ones in charge of choosing between them, reggarding their specific needs.
If you are certain about any of them (or any method that I could be missing), or can think of an implementation that could provide multiple options to fit different user needs, please let me know so we can discuss this further.
Thank you!

@nbcl I see, I don't know much about the "Secrets" functionality but I was leaning towards the first approach. Maybe there could be a way to have the user choose which random function they want (randomint or secrets) and the function will do that after.

Maybe there could be a way to have the user choose which random function they want (randomint or secrets) and the function will do that after.

Exactly @kadhirash! This can be achieved in different ways, such as, for example, using default arguments to provide default values in the function's arguments.


Background of the dataset used

Hi Praveen,
Thanks for the great project! I have the following questions :

Can you give some more context as to which data did you use? (the one in the image).
Does it limit to tracking only 5 objects or can that parameter be changed?
When visualizing in rviz, how do I overlay the markers with the pointcloud? It seems that the filtered_cloud uses velodyne frame  while the markers use map frame.

Hey @jadhavhninad  please find responses to your questions below:

The data used in the image demo was collected from a wheeled, mobile robot with a LiDAR
It can be changed to track more than 5 objects. I only needed to track 5 objects at most. It can be extended to N object tracking.
The point clouds are generated w.r.t the Velodyne sensor's frame so, it is appropriate to visualize the points w.r.t to that frame of reference. Depending on your robot/setup you can change the  LiDAR sensor's coordinate frame (to map). You could also convert the points from the map's frame to the Velodyne's frame.

@jadhavhninad : Hope the above responses were adequate. Closing this item. Feel free to re-open or create a new one if you need more info.


[RFC] defmt-test: add unit test support

Summary
Extend #[defmt_tests::tests] to support "unit testing" (internal testing) an embedded no-std crate, i.e. with cargo test --lib
Motivation
defmt_test currently supports "integration tests" (external testing) that live in tests/*.rs.
These tests (#[test] functions) can only test the public API of a (library) crate.
It would be advantageous to also support "internal testing" and reach feature parity with the standard test harness.
For example, this would let one add unit tests to a HAL and be able to organize those tests by module, where each module could map to a peripheral for example.
Design
#[defmt_test::tests] can be used in any module and as many modules as one wants.
// crate: my-hal

#![cfg_attr(test, no_main)] // <- REQUIRED
#![no_std]

mod serial {
    // ..

    #[defmt_test::tests]
    mod tests {
        #[test]
        fn it_works() {
            // ..
        }
        // ..
    }
}

mod i2c {
    // ..

    #[defmt_test::tests]
    mod tests {
        #[test]
        fn it_works() {
            // ..
        }
        // ..
    }
}

// top-level unit tests (these can overlap with `tests/*.rs` but are also supported)
#[defmt_test::tests]
mod tests {
    #[test]
    fn it_works() {
        // ..
    }
    // ..
}

To use the defmt-test test harness one needs to include the #![cfg_attr(test, no_main)] in the root of the crate and disable the standard test-harness in Cargo.toml:
[lib]
harness = false # <- REQUIRED

With those changes in place, cargo test --lib will run all the unit tests in the crate:

NOTE output format is not final

$ cargo t --lib
running (1/3) i2c::tests::it_works ...
running (2/3) tests::it_works ...
running (3/3) serial::tests::it_works ...

The order in which test modules are executed is left unspecified.
The tests within a single test module are executed in declaration order:
#[defmt_test::tests]
mod tests {
    #[test]
    fn runs_first() {
        // ..
    }

    #[test]
    fn runs_second() {
        // ..
    }

    // .. later tests run afterwards
}

Implementation details
This section details a possible implementation but the final implementation is free to diverge from what's described here.
TL;DR we use something like the .init_array "feature" used by ELF files for execution of functions before main (unsure if that's some sort of standard)
#[defmt_test::tests]
We change the expansion of #[defmt_test::tests] to not include a main function.
Instead the main function is defined in defmt_test crate so that linking to defmt_test brings in the symbol.
Each #[defmt_test::tests] module will place a variable in the .defmt_tests linker section.
The static variable will contain a list of the #[test] functions defined in the module.
Given this input
#[defmt_test::tests]
mod tests {
    #[init]
    fn init() -> State {
         // ..
    }

    #[test]
    fn foo(state: &mut State) {
        // .. user code ..
    }

    #[test]
    fn bar() {
        // .. user code ..
    }

    #[test]
    fn baz() -> Result<(), ()> {
        // .. user code ..
    }
}

The macro produces:
#[cfg(test)]
mod tests {
    use defmt_test as _; // link in `defmt_test` to inject the `main` symbol

    #[linker_section = ".defmt_tests"]
    static TESTS: [extern "C" fn(); 4] = [
        init,
        foo,
        bar,
        baz,
    ];

    // trampoline that
    // - calls user `init`
    // - stores its return value in a static variable
    extern "C" fn init() {
        fn init() -> State {
            // .. user code ..
        }

        // ..
    }

    // trampoline that
    // - calls user `foo` with `State`
    // - reports progress using `defmt::println!`
    extern "C" fn foo() {
        fn foo(state: &mut State) {
             // .. user code ..
        }
        // ..
    }

    // similar trampolines
    extern "C" fn bar() { /* .. */ }
    extern "C" fn baz() { /* .. */ }
}

linker script
in some linker script, maybe in defmt.x, we'll need something like this:
.defmt_tests : FLASH {
  _defmt_tests_start = ALIGN(4);
  KEEP(*(.defmt_tests));
  _defmt_tests_end = ALIGN(4);
}

main
The main function in defmt_tests needs to do something like this:
#[no_mangle]
extern "C" fn main() -> ! {
    extern "C" {
        static _defmt_tests_start: u32;
        static _defmt_tests_end: u32;
    }

    // execute all the trampolines in stored in `.defmt_tests`
    let mut cursor = &_defmt_tests_start as *const u32;
    let end = &_defmt_tests_end as *const u32;
    while cursor < end {
        unsafe {
            let trampoline: extern "C" fn() = mem::transmute(cursor);
            trampoline();
            cursor = cursor.offset(1);
        }
    }

    // make probe-run exit with exit-code = 0
    loop { asm::bkpt() }
}

future extensions
these are outside the scope of this RFC and are only meant to explore some possibilities

it could be useful to have some mechanism to reset all device peripherals at the start of each #[defmt_test::tests] module so that all the unit tests for a peripheral module start from a clean state.

it could even be necessary to software reset the device per test module to support existing HALs that use the "take once" singleton pattern as some peripherals, like the ones used in clock control, are needed by several high level peripheral APIs

This RFC looks like a feasible approach 👍
Overall I really like the idea to extract main from the test-module.
Although it will definitely be a breaking change.
Some concerns and proposed changes from my side:
Concerns with the RFC as it is proposed

Handling multiple init functions
At the moment, there can only be one init function per test-binary,
because defmt-test only allows one in the test module.
With the proposed change, each test-module could have its own init function.
Essentially every test-module would be more like a group of tests, and a binary
could now have multiple of such groups.
This makes it difficult to run code that must only run once before executing all tests.
The same goes for teardown functionality, because there is no guaranteed order in the execution of these groups.

How to calculate the number of tests?
Looking at the proc-macro code, the total number of tests is calculated by the number of tests found in the module.
Not sure if the total number of tests added via linker_section can be tracked, because in the example above, the init, before_each, and after_each functions would also be part of the same section.

Possible changes
Instead of putting init and teardown into the same section as the tests,
two additional linker sections should be used instead.
defmt-test could then fail if more than one function got linked.
before_each and after_each could be linked together with the tests.
This depends how the number of tests can be calculated.
Alternatively, wrapper functions could be created that internally call
before_each, after_each, and the actual test function.
I am just not sure if it is possible for defmt-test to get the correct modpath for a test function with this approach.
In case you additionally need a init/teardown function per module, I suggest renaming the module-scoped attributes to before_all/after_all.
These changes would require to create proc-macros for init, teardown, and test,
but would allow to directly annotate functions without the need to wrap them
in a defmt-test module.
Example:
// foo.rs
#[defmt_test::test]
fn test_foo() {}

// bar.rs
#[defmt_test::tests]
mod tests {
  #[before_all]
  fn before_all() {}

  #[before_each]
  fn before_each() {}

  #[after_each]
  fn after_each() {}

  #[after_all]
  fn after_all() {}

  #[test]
  fn test_bar1() {}

  #[test]
  fn test_bar2() {}
}

// lib.rs
use defmt_test as _;

#[defmt_test::init]
fn init() {}

#[defmt_test::teardown]
fn teardown() {}

This could allow the following flow:

init()
test_foo()
test group in bar.rs

before_all()
before_each()
test_bar1()
after_each()
before_each()
test_bar2()
after_each()
after_all()

teardown()


portalicious e2e test and new seed script

AB#30150
Describe your changes
Adds E2E tests for: Manage team feature
Checklist before requesting a review

[x] I have performed a self-review of my code
[x] I have added tests wherever relevant
[x] I have made sure that all automated checks pass before requesting a review
[x] I do not need any deviation from our PR guidelines

Closing. Changes are moved to this PR: https://github.com/global-121/121-platform/pull/5795


feat: remember line number

Hi All,
I'm using Grapple as a Harpoon replacement, and I have keys bound to jump to the files in my list:
Here is my config:
vim.keymap.set("n", "<leader>a", require("grapple").tag, {})
vim.keymap.set("n", "<leader>A", require("grapple").popup_tags, {})

vim.keymap.set("n", "<leader>h", function() require('grapple').select({ key = 1 }) end, { silent = true })
vim.keymap.set("n", "<leader>j", function() require('grapple').select({ key = 2 }) end, { silent = true })
vim.keymap.set("n", "<leader>k", function() require('grapple').select({ key = 3 }) end, { silent = true })
vim.keymap.set("n", "<leader>l", function() require('grapple').select({ key = 4 }) end, { silent = true })

Is there a way to have it such that when I press <leader>h for example, that it remembers the line number, and jumps to the correct line in that file?  I would love this to work while I'm inside the file already too, so if I scroll all the way to the top, and press <leader>h, it jumps to the line that I tagged.
Thanks for a very useful plugin!

I just took a look and it's caused by this line, and also the autocmd event that updates on quit in the autocmds.lua file:
https://github.com/cbochs/grapple.nvim/blob/ab274a3bfb674442d57fca05df866b71895853bc/lua/grapple/tags.lua#L102
change this to:
        if opts.toggle then
          cursor = vim.api.nvim_win_get_cursor(0)
        else
          cursor = vim.api.nvim_buf_get_mark(opts.buffer, '"')
        end

And add this in your nvim config file:
vim.api.nvim_clear_autocmds({group = "Grapple", event = 'BufLeave'})


feat: add restaurant links

I also think there should be some visual indicator to distinguish clickable restaurant titles from non-clickable ones. But I'm also not sure how to do that unintrusively.

Worth creating a ticket for and thinking about - we agreed offline to leave as-is for now though.


enhanced table style to be more readable, history page is now respons…

…ive (I edited navbar too to acheive responsivity) /n didn't change alot of style to be consetent with your design

Hey could you please share the screenshots of the current design

Thanks for the pr 😄


Fix disposable implementation

The IDisposable implementation for OllamaApiClient has some overloading issues.
More info here https://github.com/dotnet/roslyn-analyzers/issues/7462
Not sure if this is how you want to do it but here is one way to resolve it.
I personally see no reason to not just get rid of the Cleanup method and just put everything in dispose but I tried to leave it setup mostly the same.
As far as breaking changes go if someone is calling dispose it will still call the clean so it is really just an addition.

I don't really understand the mentioned issue here and how having two separate methods fixes this.
Would you elaborate?

There are two methods called dispose with the same signature other than the one explicitly implementing IDisposable.
This causes a resolution issue in the dotnet analyzers resulting in false positives.
My suggestion is to merge the two methods.

Hm, I prefer actually to not have two methods for this, but don't get me wrong, I really appreciate you bringing this to the table.
I made it this way: https://github.com/awaescher/OllamaSharp/commit/ba1a697603538365b0d6b4f3157ec00c79e915b3

I agree I don't like the two methods.
Sorry for making it confusing but the latest commit just has one method.
I just merged the two Dispose methods.

Oh, nevermind you did the same thing my latest commit did thanks.


retries: Determine what to retry on

Please describe the Improvement and/or Feature Request

For retry policy there are a list of possible fields for when to retry a request, which ones should be included as possible options for users to use? Parent Issue: #3338

5xx
gateway-error
reset
connect-failure
envoy-ratelimited
retriable-4xx
refused-stream
retriable-status-codes
retriable-headers

For details on each option
Scope (please mark with X where applicable)

New Functionality          [ x]
Install                    [ ]
SMI Traffic Access Policy  [ ]
SMI Traffic Specs Policy   [ ]
SMI Traffic Split Policy   [ ]
Permissive Traffic Policy  [ ]
Ingress                    [ ]
Egress                     [ ]
Envoy Control Plane        [ ]
CLI Tool                   [ ]
Metrics                    [ ]
Certificate Management     [ ]
Sidecar Injection          [ ]
Logging                    [ ]
Debugging                  [ ]
Tests                      [ ]
CI System                  [ ]
Demo                       [ ]
Project Release            [ ]

Possible use cases

Pretty old issue. @shalier Kindly create a single issue for the retry policy feature work if an issue doesn't exist already.


Can't reproduce thre results ?

I can't reproduce the results reported in "README.md"
I run the following command with the downloaded checkpoint :
python prog-test.py --graph_evolve True --n_timesteps 2 --model_type residual --checkpoint {PATH_TO_WEIGHT} --gpu_id 0
The output information includes:

seed: 123
verbose: False
prefix: test
checkpoint: None
sketch_path: None
results_prefix: None
n_workers: 4
max_words: 35
use_constraint_mask: False
graph_evolve: True
graph_hidden: 64
n_timesteps: 2
model_type: residual
embedding_dim: 100
sketch_hidden: 256
program_hidden: 256
debug: False
gpu_id: None
batch_size: 64
train_iters: 40000.0
model_lr_rate: 0.0003
training_scheme: schedule_sampling
schedule_sampling_p_min: 0.3
schedule_sampling_p_max: 1.0
schedule_sampling_steps: 20000.0
cuda: False
All the data will be saved in ./testing_dir/
D:\Research\project\VirtualHome\b. EnvProgram_Project\env-aware-program-gen-master\src
Load the txt files
100%|██████████| 46331/46331 [00:09<00:00, 4886.02it/s]
Total available of programs: 46331
Trim out 6.71%  of program
'------------------------------'
29.17% of programs do not have sketch label
Total programs with sketch annotation: 30615
'------------------------------'
Train set size: 14934, Test set size: 2415
Trim out 6.71%  of program
'------------------------------'
29.17% of programs do not have sketch label
Total programs with sketch annotation: 30615
'------------------------------'
Train set size: 14934, Test set size: 2415
[*] Load model at ../checkpoint/sketch2program-40000.ckpt
Start testing...
Size of the testing set: 2415

And the results are:

lcs: 0.5132999117029526
attribute_precision: 0.27715797430083144
relation_precision: 0.2604700605164265
total_precision: 0.263463978596726
attribute_recall: 0.24378415924999752
relation_recall: 0.2479945858950219
total_recall: 0.24886716728394975
attribute_f1: 0.25659780050699826
relation_f1: 0.24981876398646258
total_f1: 0.25192884144701727
parsibility: 0.8513457556935817
executability: 0.29151138716356106

I wonder what causes this. The results of 'lcs' and 'parsibility' is close to the repoted results. But the results of executability, total_f1, attribute_f1 and relation_f1 are far from the reported results.

Problem solved by altering the version of virtualhome to v1.0.0


Why does exhibitor keep on restarting zookeeper?

I am running exhibitor 1.5.6 + zookeeper 3.4.8 in an Alpine Linux OpenJDK 8 JRE docker container. Only 1 instance is started.
Exhibitor is started with the following command:
java -jar /opt/exhibitor/exhibitor.jar --defaultconfig /opt/exhibitor/exhibitor.properties --hostname zookeeper  --configtype file --fsconfigdir /tmp

This is what I see in the logs:
Thu Sep 01 11:18:13 GMT 2016    INFO    ZooKeeper Server: Starting zookeeper ... STARTED
Thu Sep 01 11:18:12 GMT 2016    ERROR   ZooKeeper Server: Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Thu Sep 01 11:18:12 GMT 2016    ERROR   ZooKeeper Server: ZooKeeper JMX enabled by default
Thu Sep 01 11:18:12 GMT 2016    INFO    Process started via: /opt/zookeeper/bin/zkServer.sh
Thu Sep 01 11:18:12 GMT 2016    ERROR   Could not kill zookeeper process: 360
Thu Sep 01 11:18:12 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:18:12 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:18:12 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:18:12 GMT 2016    INFO    Attempting to start/restart ZooKeeper
Thu Sep 01 11:18:12 GMT 2016    INFO    Attempting to stop instance
Thu Sep 01 11:18:12 GMT 2016    INFO    Server list has changed
Thu Sep 01 11:18:12 GMT 2016    INFO    State: serving
Thu Sep 01 11:18:10 GMT 2016    INFO    Automatic Instance Management will change the server list:  ==> 1:m9edd51-zookeeper.m9edd51
Thu Sep 01 11:16:55 GMT 2016    INFO    ZooKeeper Server: Starting zookeeper ... STARTED
Thu Sep 01 11:16:54 GMT 2016    ERROR   ZooKeeper Server: Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Thu Sep 01 11:16:54 GMT 2016    ERROR   ZooKeeper Server: ZooKeeper JMX enabled by default
Thu Sep 01 11:16:54 GMT 2016    INFO    Process started via: /opt/zookeeper/bin/zkServer.sh
Thu Sep 01 11:16:54 GMT 2016    INFO    Starting in standalone mode
Thu Sep 01 11:16:54 GMT 2016    ERROR   Could not kill zookeeper process: 56
Thu Sep 01 11:16:53 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:53 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:53 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:52 GMT 2016    INFO    Attempting to start/restart ZooKeeper
Thu Sep 01 11:16:52 GMT 2016    INFO    Attempting to stop instance
Thu Sep 01 11:16:52 GMT 2016    INFO    Server list has changed
Thu Sep 01 11:16:52 GMT 2016    INFO    State: serving
Thu Sep 01 11:16:51 GMT 2016    ERROR   ZooKeeper Server: Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Thu Sep 01 11:16:51 GMT 2016    ERROR   ZooKeeper Server: ZooKeeper JMX enabled by default
Thu Sep 01 11:16:51 GMT 2016    INFO    Process started via: /opt/zookeeper/bin/zkServer.sh
Thu Sep 01 11:16:51 GMT 2016    INFO    Starting in standalone mode
Thu Sep 01 11:16:51 GMT 2016    ERROR   Could not kill zookeeper process: 56
Thu Sep 01 11:16:51 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:51 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:51 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:50 GMT 2016    INFO    Attempting to start/restart ZooKeeper
Thu Sep 01 11:16:50 GMT 2016    INFO    Attempting to stop instance
Thu Sep 01 11:16:50 GMT 2016    INFO    Server list has changed
Thu Sep 01 11:16:50 GMT 2016    INFO    State: down
Thu Sep 01 11:16:50 GMT 2016    INFO    Process started via: /opt/zookeeper/bin/zkServer.sh
Thu Sep 01 11:16:50 GMT 2016    INFO    Starting in standalone mode
Thu Sep 01 11:16:50 GMT 2016    ERROR   Could not kill zookeeper process: 56
Thu Sep 01 11:16:49 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:48 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:47 GMT 2016    INFO    Kill attempted result: 0
Thu Sep 01 11:16:47 GMT 2016    INFO    Attempting to start/restart ZooKeeper
Thu Sep 01 11:16:47 GMT 2016    INFO    Attempting to stop instance
Thu Sep 01 11:16:47 GMT 2016    INFO    Server list has changed
Thu Sep 01 11:16:47 GMT 2016    INFO    State: serving
Thu Sep 01 11:16:46 GMT 2016    INFO    ZooKeeper Server: Starting zookeeper ... STARTED
Thu Sep 01 11:16:45 GMT 2016    INFO    Process started via: /opt/zookeeper/bin/zkServer.sh
Thu Sep 01 11:16:45 GMT 2016    ERROR   ZooKeeper Server: Using config: /opt/zookeeper/bin/../conf/zoo.cfg
Thu Sep 01 11:16:45 GMT 2016    ERROR   ZooKeeper Server: ZooKeeper JMX enabled by default
Thu Sep 01 11:16:45 GMT 2016    INFO    Starting in standalone mode
Thu Sep 01 11:16:45 GMT 2016    INFO    jps didn't find instance - assuming ZK is not running
Thu Sep 01 11:16:45 GMT 2016    INFO    Attempting to start/restart ZooKeeper
Thu Sep 01 11:16:45 GMT 2016    INFO    Attempting to stop instance
Thu Sep 01 11:16:45 GMT 2016    INFO    State: down
Thu Sep 01 11:16:42 GMT 2016    INFO    Exhibitor started

Why does exhibitor thinks the server list keeps on changing and restarting zookeeper?

Same issue here.

@estebangarcia, @F21

Are you sure your hostname is correct in the --hostname param value?
Did you give the user running exhibitor access to the zookeeper dirs?

Run it as root

See my suggestions here:
https://groups.google.com/forum/#!topic/exhibitor-users/KnshN6r6F7o

Closing this issue for lack of activity. You can re-open by commenting if necessary.


Add Operator volumes and volumeMounts in chart

It is needed to mount one or more volumes into spark operator pod  because of various reasons such as external ivy cache.
In this pr, it is supported to operator pod's volumes and volumeMounts in chart.

@ahnlab-oss

Please update the chart version.

Please update the chart version.

chart version is updated to 1.1.18

Looks like you need to bump the Chart version again due to conflict.

Looks like chart fails to build due to the following error. So you need to fix the linting.
Error: Error linting charts: Error processing charts

Looks like chart fails to build due to the following error. So you need to fix the linting.
Error: Error linting charts: Error processing charts

It is fixed


infinite loop in GeometryRefiner::Refine

If GeometryRefiner::Refine() is called on a mesh with quadrilaterals and with Times=0, ETimes=1, then lines 625 and 634 in geom.cpp lead to loops that do not increment and so go on infinitely.
The call to GeometryRefiner::Refine() with Times=0, ETimes=1 happens if you call SaveVTK() with ref=0, see gridfunc.cpp line 2148. This seems like a reasonable way to call SaveVTK().

In SaveVTK the parameter ref is meant to represent a number of intervals for subdividing in one direction (i.e. along edges), not number of refinement levels, so ref=0 does not make sense. Probably the name is confusing. What name would be better? How about subdiv?

Veselin - what is the appropriate ref parameter to use in SaveVTK() if you have called mesh.PrintVTK() with no ref parameter, using the one-argument version of mesh.PrintVTK() ? Seems to me it should be SaveVTK(ref=0).

Oh, I think see what the issue is: are you calling
Mesh::PrintVTK(std::ostream &out);

and then
GridFunction::SaveVTK(std::ostream &out, const std::string &field_name, int ref);

with ref=0? If that is the case, then the issue is that instead of the above Mesh::PrintVTK method, GridFunction::SaveVTK expects you to call the other Mesh::PrintVTK method that has a ref parameter:
Mesh::PrintVTK(std::ostream &out, int ref, int field_data=0);

and use the same value for ref which should be positive.
The two PrintVTK methods do different things: the first one saves a linear or quadratic mesh in native VTK format preserving all element connectivity; the second one writes each (curved) mesh element as a separate subdivided linear mesh. The SaveVTK method writes data corresponding to the GridFunction subdivided in the same manner as the mesh. This functionality was used just for visualization in VisIt before VisIt had native support for mfem meshes and solutions.

Yes, that's what I'm doing. After some more digging I think VisItDataCollection is what I want and will solve my problem. (Arguably you should improve documentation for PrintVTK, SaveVTK and/or assert ref > 0, but I don't think issue will effect me anymore.) Thanks.


Calls to uri_stat() triggers a notice

When checking for directories with is_dir() and the directory exists, the following notice is thrown:
PHP Notice:  Undefined offset: 0 in <SOME_PATH>/vendor/twistor/flysystem-stream-wrapper/src/Flysystem/Plugin/Stat.php on line 157
The following code should trigger the error:
<?php

use League\Flysystem\Filesystem;
use League\Flysystem\Memory\MemoryAdapter;
use Twistor\FlysystemStreamWrapper;

require_once 'vendor/autoload.php';

$filesystem = new Filesystem(new MemoryAdapter());
FlysystemStreamWrapper::register('test', $filesystem);

$directory = 'test:///test';
var_dump(is_dir($directory)); // Works as expected, no notice

mkdir($directory);
var_dump(is_dir($directory)); // Works as expected, but a notice is thrown

This happens because $metadata['visibility'] = false. It tries to use that false as an index for $this->permissions and the false is casted to 0. The indexes in $this->permissions['dir'] are private & public hence the 0 isn't found.

After doing some research, the error originates in het MemoryAdapter. When creating a new directory, the visibility isn't stored properly. I still think you should validate the metadata properties though.

https://github.com/twistor/flysystem-stream-wrapper/blob/master/src/Flysystem/Plugin/Stat.php#L157

A recent change in league/flysystem (1.0.55) is causing more problems with this:
https://github.com/thephpleague/flysystem/commit/b0f7bee046dec58814f7f0fbe025c4ff4eb3fdc5
Error "Undefined index: 0666" is triggered when calling $metadata = $this->filesystem->getMetadata($path); from Stat:getWithMetdata when working with the Local Adapter.

the $metadata['visibility'] is supposed to be either a "named permission" string like public, or an octal pemission mode.
this should fix it for the moment:
https://github.com/twistor/flysystem-stream-wrapper/pull/15/files
but it looks it will be changed again:
https://github.com/thephpleague/flysystem/issues/1051

the $metadata['visibility'] is supposed to be either a "named permission" string like public, or an octal pemission mode.
this should fix it for the moment:
https://github.com/twistor/flysystem-stream-wrapper/pull/15/files
but it looks it will be changed again:
thephpleague/flysystem#1051

tested and works 👍

This is affecting usage on PHP 7.4.
This repo hasn't been updated in quite a while, is it no longer being maintained?

@twistor, any chance we could get #15, #18 and #19 reviewed or merged? It appears that #15 and #19 address this particular error in different ways, and #18 is just about PHP 7.4 support in Travis.

@hexus well, mine #15 was just a quick fix, but #19 looks more sophisticated, so i'd prefer this one.
well, @twistor ain't responding for over a year 🤷♂  so perhaps i'll make a fork and merge #18 and #19 in there.

ok so here it is, tagged to v1.0.10:
https://github.com/kor3k/flysystem-stream-wrapper

Hi @kor3k I just stumbled upon your fork and really like that you made sure to have a version of this with the available bug fixes merged. I want to refer to your version in my composer requirements. As only root composer files can override repositories I basically can't reference it. Would you mind submitting your version to packagist with your prefix so one can easily pull in your version as dependency?
I am a bit sad that @twistor neglects this. Solutions are available and there seems to be activity. If this is not updated anymore please mark it as archive so we can be sure that someone else needs to step in.

@JoshuaBehrens hello and thank you.
yes i'll take a look on adding it to packagist.
but, this is for flysystem v1, which is obsolete now. (imho that's why twistor is neglecting it).
there is actively maintained version of stream wrapper for flysystem v2|v3. i recommend you to upgrade it in your projects if possible, like
"league/flysystem": "^3.0",
"m2mtech/flysystem-stream-wrapper": "^1.3",

you're welcome @kor3k
I know I use the other wrapper already. In our library we use stream wrappers as abstraction layer. But at one point the library is used within shopware 6 and up to this point they depend on v1:
https://github.com/shopware/platform/blob/<IP_ADDRESS>/composer.json#L83-L85
        "league/flysystem": "~1.1.4",
        "league/flysystem-aws-s3-v3": "~1.0.29",
        "league/flysystem-memory": "~1.0.2",

it is here: https://packagist.org/packages/kor3k/flysystem-stream-wrapper
and tagged to v1.0.11
@JoshuaBehrens

@kor3k thank you very much :)


Fix matching fund

making sure we don't override the original order
added test for recurring donation case

Coverage decreased (-0.1%) to 75.853% when pulling 73cea6ae00a04845371ecf08b0914836e578bc44 on fixMatchingFund into 0f018c08bf6753b993d1cb4704a7bdadf0d110ba on master.

Coverage decreased (-0.01%) to 75.982% when pulling f488831c88797af05ea5336029cb9181b3a0d040 on fixMatchingFund into 0f018c08bf6753b993d1cb4704a7bdadf0d110ba on master.


[8.x] Add commonmark as recommended package for Illuminate\Support

league/commonmark is a required package when using the Str::markdown() and $stringable->markdown() methods.
illuminate/support when used outside of laravel/framework does not require league/commonmark in it's composer.json.
Added as a suggested package, which seems to be the home for others like this, such as ramsey/uuid.
PR that introduced of these methods: https://github.com/laravel/framework/pull/36071

Is this missing on 6.x?

Is this missing on 6.x?

I've just checked 6.x and 7.x and neither of them have this in their composer.json, however these markdown method were only added to 8.x, so unless there was another reason for it to exist in the previous versions, I think that makes sense...unless I'm misunderstanding the question.

It's only needed for 8.x


Example notebooks include local file link

Hi,
some of the notebooks still include some local include, such as:
sys.path.append("C:/Users/lUKAS/Documents/UDCM/Objects")
e..g in the Comparisom4.ipynb there is also a non-working import
import TMM_abs as atmm

The local file import of the TMM_abs module is to pedagogically demonstrate the effect of the Transfer Matrix Method. This module is implemented in the NTMpy package but can be separately inspected here.


Xilinx fpga dace benchmark support

Hi, is there any benchmark for fpga dace? I saw there is a benchmark https://github.com/spcl/npbench for dace, however, it only support cpu and gpu. Thanks

Closing as resolved, since NPBench supports FPGA as well and our tests/npbench generate Xilinx/Intel FPGA code.


Removing outdated page

Hello, I am currently working on updating the PlayReady.com website. My program manager brought to my attention that this page was outdated and needed to be removed. Since it is not on the PlayReady.com repository but here, I was wondering what the better way would be to delete this page from the Microsoft Learn website. Thank you for your help.

Learn Build status updates of commit 0c041d3:
:warning: Validation status: warnings

File
Status
Preview URL
Details

Docs/Specifications/playready-plugin-for-android-specification.md
:warning:Warning

Details

Docs/Specifications/playready-plugin-for-android-specification.md

Line 0, Column 0: [Warning: h1-missing - See documentation] H1 is required. Use a single hash (#) followed by a space to create your top-level heading.
Line 1, Column 1: [Warning: title-missing - See documentation] Missing required attribute: 'title'. Add a title string to show in search engine results.
Line 1, Column 1: [Suggestion: description-missing - See documentation] Missing required attribute: 'description'.

For more details, please refer to the build report.
If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Learn Build.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:Try searching the learn.microsoft.com contributor guidesPost your question in the Learn support channel


[Feature Request] - KubernetesV1 - Don't force commands to use '-o' json/yaml

Required Information
Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Feature
Enter Task Name: Kubernetes
list here (V# not needed):
https://github.com/microsoft/azure-pipelines-tasks/blob/866830aecf96e48e2610c8876ec1d27b0767644f/Tasks/KubernetesV1/src/kubernetescommand.ts
@Environment
Azure Pipelines

Agent - Hosted

Issue Description
The Kubernetes task will per default add -o json to the command unless outputFormat input variable is used to change it to yaml.
My issue is that, at times, you do not wish to see the output so verbose at all. For example, applying configmaps with JSON in them used for dashboards by Grafana, these becomes massive and pollutes the output.
It would be nice to have the option to choose not to use any -o at all so all that remains is just the "applied" message.
As a side note, with this kind of usage, since the output steam becomes so big, we get warnings:
Error logs
[warning]Output variable not set as kubectl command output exceeded the maximum supported length. Output length: 290661, Maximum supported length: 32766

Any update for this?

If you set outputFormat: '' like this.. it won't add -o to the commands!


Publish the latest dev to the GitHub Packages registry

Description
Every time a new PR is merged to dev, publish the @ntohq/buefy-next package containing the latest features and fixes to the GitHub Packages registry for evaluation. Please be careful so that the versions for evaluation never overlap with existing and future releases of @ntohq/buefy-next.
Why Buefy need this feature
It will facilitate evaluation of the new features and fixes before releasing the next version of @ntohq/buefy-next. Special configurations are necessary to use the GitHub Packages registry, however, it will be less cumbersome to pull the dev branch, build the library, and locally import it.

@kikuomax what is the status of this issue?

@wesdevpro This was done by

#136


Exporting an API twice fails without proper feedback

API-Mgr. CLI version
1.3.9
API-Manager and Service-Pack Version
7.7 march
Expected behavior
Executing "apim api get -s xx -n "*name*" -o json" twice times should either replace latest export dir, or inform some error
Actual behavior
Second time it executes without any error or message, nor updating previous export
----------------------------------------------------------------------------------------
Module: API - E X P O R T / U T I L S (1.3.9)
----------------------------------------------------------------------------------------
177    INFO     APIManagerAdapter| Successfully connected to API-Manager (7.7.20210330) on: https://localhost:8075
282    INFO          APIExportApp| No APIs found based on the given filters.

[edited to format]

Hi,
sure, fortunately, this is so easy to reproduce for me.
I've enabled debug by following this note https://github.com/Axway-API-Management-Plus/apim-cli/wiki/9.1.-Enable-Debug:
found the lib/log4j.xml, and updated INFO to DEBUG for com.axway.apim logger
I don't get any new output when executing. What I am missing?
In any case, I was testing in powershell, and I just tried with windows cmd and it works as excepted.
Thanks,
Emmanuel.

Oh, I see there is a mistake in the delivered log4j.xml - I will change this in the next version to be consistent with the docs.
For now, please change the following line in the log4j.xml:
<param name="Threshold" value="INFO"/>
to:
<param name="Threshold" value="DEBUG"/>
Also, you may try to run the test with cache disabled and see what happens:
apim api get -s api-env -n "Order*" -ignoreCache

Hi,
that did the trick. This is the output of the second attempt in powershell.
Also, yesterday (or the day before) I've replaced scripts and lib in apim to 1.3.10 but it is still showing as 1.3.9?
apim api get -s local -n "*name*" -o json
----------------------------------------------------------------------------------------
API-Manager CLI: 1.3.9

To report issues or get help, please visit:
https://github.com/Axway-API-Management-Plus/apim-cli
----------------------------------------------------------------------------------------
Module: API - E X P O R T / U T I L S (1.3.9)
----------------------------------------------------------------------------------------
0      DEBUG nvironmentProperties| Trying to load environment properties from file: env.properties ... not found.
1      DEBUG nvironmentProperties| Loaded environment properties from file: env.local.properties
164    DEBUG    APIManagerAdapter| Logging in with User: 'apiadmin'
2186   DEBUG tionsCredentialCache| Initialize successful.
2249   DEBUG he-organizationCache| Initialize successful.
2270   DEBUG he-applicationsCache| Initialize successful.
2315   DEBUG zationAPIAccessCache| Initialize successful.
2372   DEBUG onsSubscriptionCache| Initialize successful.
2419   DEBUG cationAPIAccessCache| Initialize successful.
2449   DEBUG hClientProviderCache| Initialize successful.
2491   DEBUG plicationsQuotaCache| Initialize successful.
2533   DEBUG    Ehcache-userCache| Initialize successful.
2603   INFO     APIManagerAdapter| Successfully connected to API-Manager (7.7.20210330) on: https://localhost:8075
2672   DEBUG APIManagerAPIAdapter| Sending request to find existing APIs: https://localhost:8075/api/portal/v1.3/proxies?field=name&op=eq&value=territory-management-api-ahint-eco
2808   DEBUG APIManagerAPIAdapter| No existing API found based on filter: [ filter=APIFilter [id=null, name=name-api, vhost=null, apiPath=null, queryStringVersion=null, state=null, deprecated=false, retired=false, loadBackendAPI=false]]
2811   INFO          APIExportApp| No APIs found using filter: APIFilter [id=null, name=name-api, vhost=null, apiPath=null, queryStringVersion=null, state=null, deprecated=false, retired=false, loadBackendAPI=false]

What is the real filter value you are trying to filter the API-Result-Set? I see *name* and name-api

Hi,
yes. It looks to fail with an existing API only. i've downloaded petstore and this doesn't happen.
Unfortunately I can't share the failing contract and it might take me some time to strip it out for you to reproduce the issue and I am not seeing that happen in the short term, therefore I will close the issue and if i can do it, I'll open anew one with better data.
thanks,
Emmanuel.


MP Biomedicals - Sender Onboarding

[ ] Kickoff and Introduction to ReportStream & TOS
"• Get and analyze sample/dummy data from sender
• Finalize schema and share with sender"
Onboard to Staging
Send staging private key to sender (keybase.io)
Sender tests in staging until mutually agreed stability of data and connectivity is reached (no PII)
Validate sender data with receiver states
Onboard to Production (in test mode)
Mutual agreement to RS/Sender TOS
Send production private key to sender (keybase.io)
Sender and RS perform final validation data in production (using PII)
Onboard to full Production (connectivity with states)
Fully in production; onboarding complete

@jbiskie moving this to sprint backlog.

Attaching 3 versions of a sample file MP Biomedicals sent us on 3/11.
mpbiomed-01.csv - Original xlsx file saved as csv
mpbiomed-01a.csv - removed the "null" values from all columns
mpbiomed-01b.csv - same as 01a with the equipment_model_name changed to BinaxNOW, since MP's test does not have EUA yet

@jbiskie Are these files meant to be shared with any state? Not finding any thread on this.

4/7/22 Test file based on existing NIH OTC specs look good, and Sender has been informed that this specs will change.  We need to discuss criteria for moving them to PROD.
4/8/22 Security key created and sent via keybase.io.  TOS was received. Zoom call today.  Fixed API connectivity. Reviewed JSON messages.


Added plugin system to fastlane

New load_plugin action
Extracted temporary git clone into git_fetcher.rb as it's used by the import_from_git action too
Moved all local action documentation into its own file
Moved Fastfile detection to a central place
Added tests for the plugin integration

This looks great to me but I'd also love to hear @i2amsam's opinion here!

Thanks @asfalcone, just pushed 2 more commits to fix the tests. The tests were super useful again, telling me about missing documentation :+1:

Tests passing, waiting for confirmation by @i2amsam before merging :rocket:

@KrauseFx Is there something I could help with?

@RishabhTayal Thanks for offering help, we're still looking into how we make it super easy for developers to use this feature, we'll update the PR over the next days / weeks :+1:

This work is being deferred a bit, so I'll close this for now.