Improve pure functions spec

I've redone the pure functions section to improve definitions. I'm aiming for a narrow and precise definition of strongly pure functions; following that, aggressive optimizations can be applied. cc @WalterBright @tgehr @dnadlinger @JohanEngelen @redstar

N.B.: this is best viewed as a split diff.

Searching for trailing whitespace
./spec/function.dd:411:$(P A pure function that passes all tests for strongly pure functions except (4) is called a

I think there may be the idea that strong and weak purity mean "can optimize" and "cannot optimize", but this is not true. For example, a weakly pure function that may only modify data that is not accessed later can be elided. I believe however that this is what probably motivated the special case for void return.
I have no idea why there would be a special case for functions with zero arguments. This does not exist now and it contradicts existing compiler behavior:
int[] foo()pure{
return [1,2,3];
}
void main(){
immutable a=foo(); // ok
}

Also, I think it is a bit weird that the spec defines "weakly pure" and then "strongly pure" as "pure but not weakly pure".

I think there may be the idea that strong and weak purity mean "can optimize" and "cannot optimize", but this is not true. (For example, a weakly pure function that may only modify data that is not accessed later can be elided. There can also be optimizations based on pure functions accessing only const arguments.)

I'm trying to define strong purity as "definitely have freedom to optimize in functional tradition, even when definition is not available". Weak purity is "may or may not depending on information at hand".
Also: the weakly pure definition is more conservative than it could be. Consider:
pure void fun(int input, out int output);

This should be categorized as a pure function, because it's just an awkward way of writing:
pure int fun(int input);

By this PR, however, it's categorized as weakly pure. Making it strongly pure would complicate the definition while not allowing additional useful cases.

I have no idea why there would be a special case for functions with zero arguments. This does not exist now and it contradicts existing compiler behavior:

int[] foo()pure{
	return [1,2,3];
}
void main(){
	immutable a=foo(); // ok
}

Can you please explain that further? By this PR the function would need to return fresh memory every time, which is the right thing to do.

Also, I think it is a bit weird that the spec defines "weakly pure" and then "strongly pure" as "pure but not weakly pure".

What would be a better way?
The way I went for maximum clarity was to define weakly pure first. Then to make clear that a function can be either weakly pure or strongly pure (but not neither or both), I mention that a strongly pure function is a pure function that is not weakly pure. THEN just to make things crystal clear the doc goes ahead and enumerates the conditions for strong purity.
Are you thinking it's better to define strongly pure first and then just say "if it's pure but not strongly pure, it's weakly pure"?

@tgehr Consider:
int[] foo()pure{
	return [1,2,3];
}
void main(){
	immutable a=foo(); // ok
    auto b=foo();
    assert(b == a);
    assert(b !is a);
}

This currently passes, which is good. If foo() were strongly pure it would return the same array.

Direct link to html for ease of viewing: http://dtest.dlang.io/artifact/website-008142779c13e1c98c82d000287b2780f73fb9eb-2c9b19a3e85d4bd5b9ca85d217459224/web/spec/function.html#pure-functions

I think there may be the idea that strong and weak purity mean "can optimize" and "cannot optimize", but this is not true. (For example, a weakly pure function that may only modify data that is not accessed later can be elided. There can also be optimizations based on pure functions accessing only const arguments.)

I'm trying to define strong purity as "definitely have freedom to optimize in functional tradition, even when definition is not available".

Besides not being necessary for that, it is also not sufficient (with the current language definition). E.g., Haskell has non-deterministic exception semantics, to allow more rewrites. Furthermore, Haskell does not expose reference identities for immutable values.

Weak purity is "may or may not depending on information at hand".
...

Strong and weak purity isn't really about optimizations. I think it's mostly a marketing thing to avoid the claim that D does not have "true" functional purity (which it really does not because e.g., you can't have an immutable list data type with value semantics due to the is operator).
The important distinction is between what you call weakly pure functions and pure factory functions, because it affects implicit conversions. Currently, the pull request says pure factory functions must have at least one argument.

Also: the weakly pure definition is more conservative than it could be. Consider:
pure void fun(int input, out int output);

This should be categorized as a pure function, because it's just an awkward way of writing:
pure int fun(int input);

By this PR, however, it's categorized as weakly pure. Making it strongly pure would complicate the definition while not allowing additional useful cases.

It's weakly pure because it modifies a parameter by reference.

I have no idea why there would be a special case for functions with zero arguments. This does not exist now and it contradicts existing compiler behavior:

int[] foo()pure{
	return [1,2,3];
}
void main(){
	immutable a=foo(); // ok
}

Can you please explain that further? By this PR the function would need to return fresh memory every time, which is the right thing to do.

By this PR the implicit conversion to immutable should not compile because foo has no arguments.

Also, I think it is a bit weird that the spec defines "weakly pure" and then "strongly pure" as "pure but not weakly pure".

What would be a better way?
...
Are you thinking it's better to define strongly pure first and then just say "if it's pure but not strongly pure, it's weakly pure"?

Yes, I think it is, but of course that's fully up to you, as it does not influence correctness.

@tgehr Consider:
int[] foo()pure{
	return [1,2,3];
}
void main(){
    immutable a=foo(); // ok
    auto b=foo();
    assert(b == a);
    assert(b !is a);
}

This currently passes, which is good. If foo() were strongly pure it would return the same array.

"Might", not "would". Also, you are justifying why you think strongly pure functions should not have mutable indirections in their return values, not why they must have arguments. It really does not make sense to require them to have arguments.

Strong and weak purity isn't really about optimizations. I think it's mostly a marketing thing to avoid the claim that D does not have "true" functional purity (which it really does not because e.g., you can't have an immutable list data type with value semantics due to the is operator).

I'm not that concerned about marketing as much as about making decisions that keep things simple and meaningful. In that sense allowing optimizations is a litmus test - if we can't do it we might have taken the wrong turn someplace. Also I don't want to define pure so as to lock us away from __metadata, or __metadata to lock us away from good optimizations of pure.
I think I have a response to the paren - revised version upcoming which restricts what "equivalent parameters" means.

@tgehr eliminated the no-args requirement in the upcoming revision

@tgehr followed your advice by placing definition of strongly pure first. Then made weakly pure definition as the complement. Things seem a lil cleaner. Thx.

Strong and weak purity isn't really about optimizations. I think it's mostly a marketing thing to avoid the claim that D does not have "true" functional purity (which it really does not because e.g., you can't have an immutable list data type with value semantics due to the is operator).

I'm not that concerned about marketing as much as about making decisions that keep things simple and meaningful.

I was concerned about conflating strongly pure, which originated as a marketing concept used to justify weak purity, with language semantics. The PR makes more sense with your latest edits. (Or I missed the part restricting reordering before. I have no way to tell as the previous version disappeared after a force push.)

In that sense allowing optimizations is a litmus test - if we can't do it we might have taken the wrong turn someplace.

That's fine, as long as it is with an understanding that the set of specified optimizations is a small subset of what is possible, and not a comprehensive list.

Also I don't want to define pure so as to lock us away from __metadata, or __metadata to lock us away from good optimizations of pure.
...

Neither do I, but that might make it necessary to specify the complete set of allowed rewrites. (Explicitly or implicitly.)
Some possible bad outcomes that I really want to avoid:

void returns become optimization blockers.
weakly pure functions become optimization blockers.
__metadata in arguments become optimization blockers, turning off purity-based optimizations in the presence of lazy evaluation or reference counting.
__metadata in arguments implies at most weak purity.

I was concerned about conflating strongly pure, which originated as a marketing concept used to justify weak purity, with language semantics. The PR makes more sense with your latest edits. (Or I missed the part restricting reordering before. I have no way to tell as the previous version disappeared after a force push.)

Yeah, I switched to no-amend commits going forward.

In that sense allowing optimizations is a litmus test - if we can't do it we might have taken the wrong turn someplace.

That's fine, as long as it is with an understanding that the set of specified optimizations is a small subset of what is possible, and not a comprehensive list.

Cool!

Also I don't want to define pure so as to lock us away from __metadata, or __metadata to lock us away from good optimizations of pure.
...

Neither do I, but that might make it necessary to specify the complete set of allowed rewrites. (Explicitly or implicitly.)

That would be acceptable. And don't forget - fewer is not a disaster.

Some possible bad outcomes that I really want to avoid:

Allow me to put my pointy-haired manager hat (or wig) by interspersing the top-level view with these:

void returns become optimization blockers.

Very low impact. Pure void functions will be very rare if any, and don't forget we currently do zero optimizations based on purity.

Low impact.

__metadata in arguments become optimization blockers, turning off purity-based optimizations in the presence of lazy evaluation or reference counting.

Low impact.

__metadata in arguments implies at most weak purity.

Low impact.
What is high impact:

Reference counted data structures usable with immutable and in pure functions
Lazy initialization of members

These are what matters. I would very happy give away any and all items on your list to get these two. And it would be great if you did, too.

What is high impact:
* Reference counted data structures usable with `immutable` and in `pure` functions

* Lazy initialization of members

Why not take advantage of purity to temporarily disable ref counting knowing at the end of the function that there will be no leaks. Otherwise purity means many things among which is free scalability in a multithreaded setup and some hidden detail like ref counting isn't supposed to affect that.

@SSoulaimane Sounds intriguing, but there's a ton of detail you'd need to bring. How would this work?
pure rcstring fun(rcstring a, rcstring b) { a ~= 'x'; return a ~ b; }

...
Also I don't want to define pure so as to lock us away from __metadata, or __metadata to lock us away from good optimizations of pure.
...

Neither do I, but that might make it necessary to specify the complete set of allowed rewrites. (Explicitly or implicitly.)

That would be acceptable. And don't forget - fewer is not a disaster.
...

The point of the rewrites is to define the meaning of pure and immutable.

Some possible bad outcomes that I really want to avoid:

Allow me to put my pointy-haired manager hat (or wig) by interspersing the top-level view with these:
...

It was you who said: "Also I don't want to define pure so as to lock us away from __metadata, or __metadata to lock us away from good optimizations of pure."

Pure void functions will be very rare if any, and don't forget we currently do zero optimizations based on purity.

That's not the point. Currently, pure and immutable have well-defined meanings from which such optimizations can be derived (note that pure function elision can't even be derived if we require pure functions to preserve non-termination). With __mutable this goes out of the window, so you need an alternative way to specify what they mean. I was aiming for a state where we don't lose what we already have with pure and immutable.

What is high impact:

Reference counted data structures usable with immutable and in pure functions

I guess you mean nominally immutable. I don't really see the point of that. It's rare to want to use the same complex data structure as both mutable and immutable, and immutable structs and class references can't be reassigned, limiting their usefulness. Furthermore, it can make sense to store mutable data within a persistent data structure.

Lazy initialization of members
...

I can do lazy initialization of members today, even within a weakly pure function.

These are what matters.

I thought you wanted to support general manual memory management within pure functions, not just reference counting?

I would very happy give away any and all items on your list to get these two. And it would be great if you did, too.

I'm just not very excited to have merely nominal immutability in the type system, and I am certainly not the only one. It means whenever there is an immutable in the code, I have to worry about whether or not it is a lie. Libraries will require const arguments in the misguided name of "const correctness", arguing that I should just use __mutable fields if I really need to do some mutation in a callback. If I want to avoid the synchronization overhead, then I will need to make sure nobody can create an immutable instance of my type. At least right now, function signatures are honest. I don't really see the point of watering down attributes such that they can be legally slapped even on code that does not behave the way the attribute would suggest, not even logically.

It was you who said: "Also I don't want to define pure so as to lock us away from __metadata, or __metadata to lock us away from good optimizations of pure."

Yes, but that's not a hard requirement. In fact if we drop strongly pure entirely and stay with weakly pure that's acceptable if there's no other way to get work done on reference counting.

Pure void functions will be very rare if any, and don't forget we currently do zero optimizations based on purity.

That's not the point. Currently, pure and immutable have well-defined meanings from which such optimizations can be derived (note that pure function elision can't even be derived if we require pure functions to preserve non-termination). With __mutable this goes out of the window, so you need an alternative way to specify what they mean. I was aiming for a state where we don't lose what we already have with pure and immutable.

Maybe we have too much with pure and immutable, and of low-impact. Like, the ability to do optimizations that have not been done in a decade. What we need is high impact: reference counting without compiler magic.

Reference counted data structures usable with immutable and in pure functions

I guess you mean nominally immutable. I don't really see the point of that. It's rare to want to use the same complex data structure as both mutable and immutable, and immutable structs and class references can't be reassigned, limiting their usefulness. Furthermore, it can make sense to store mutable data within a persistent data structure.

This might be the case with complex data structures, but it is not with strings and slices. Currently string and generally T[] work nicely in pure functions and in conjunction with immutable. A simple rephrasing of the challenge is: design a type rcstring and a type Slice!T that do what string and T[] do, just that they manage their own memory instead of relying on the tracing collector.
Can you lead such an effort?

Lazy initialization of members
...

I can do lazy initialization of members today, even within a weakly pure function.

Not in an immutable or const object. This is the problem, and a very real one.

These are what matters.

I thought you wanted to support general manual memory management within pure functions, not just reference counting?

I'd be happy with just reference counting if that's all that's possible.

I would very happy give away any and all items on your list to get these two. And it would be great if you did, too.

I'm just not very excited to have merely nominal immutability in the type system, and I am certainly not the only one. It means whenever there is an immutable in the code, I have to worry about whether or not it is a lie.

NO it's not a lie! The point is to allow controlled use of metadata that is transparent to the user of the immutable data structure.
Is tracing GC a lie? Because it does make mutable memory into immutable memory (construction) and immutable memory back into modifiable memory (reclamation). It is also easy to circumvent in any number of ways. Yet nobody is spending nights losing sleep over it.

Libraries will require const arguments in the misguided name of "const correctness", arguing that I should just use __mutable fields if I really need to do some mutation in a callback.

That is working just fine for C++. A good success story to learn from.

If I want to avoid the synchronization overhead, then I will need to make sure nobody can create an immutable instance of my type.

I don't understand this.

At least right now, function signatures are honest. I don't really see the point of watering down attributes such that they can be legally slapped even on code that does not behave the way the attribute would suggest, not even logically.

I understand, and I don't want to be there either. But I also reckon that without workable reference counting we're dead in the water.
Sadly we have re-entered an unhelpful pattern.

I try to break the stalemate

I don't know what I am doing, and both you and I know I don't know what I'm doing.

You rightly poke holes in my proposal, pointing out that I'm making something worse and overall that I don't know what I'm doing.

I give up and we're back to where we were. How can I not? You know what you're doing, and your counterarguments are correct.

There is no progress - no reference counting for the next ten years.

How can we get from this pattern to a pattern whereby you actually do steer things to the positive? What steps can we get to get reference counted data structures while at the same time preserve most of the good qualities of pure and immutable? That's the real challenge, not to say it can't be done. My mailman can tell me it can't be done. We need your good skill put to work in the right direction.

You can't elide strongly pure calls to zero, because they can throw exceptions, it must be called at least once. So void function is fine as strongly pure, a use case for it is data validation. A void function that does nothing - that's low impact.
Maybe you can reorder two pure nothrow functions between each other, but not anything else, again because exceptions.
Lazy initialization doesn't seem to conflict with purity. Reference counting can be done as weakly pure:
void* addRef() pure immutable
{
  _counter++;
  return null;
}

Also postblit should be weakly pure too.
new and malloc are special cases and should be in the list of special cases.

You can't elide strongly pure calls to zero, because they can throw exceptions, it must be called at least once.

Good insight, thanks. Can throw errors or abort the program even if nothrow. I can't believe I'm saying this, but that's a relief :o).

Lazy initialization doesn't seem to conflict with purity. Reference counting can be done as weakly pure:
void* addRef() pure immutable
{
  _counter++;
  return null;
}

You can't update the counter of an immutable structure. (It's actually a pointer to a counter.)

Also postblit should be weakly pure too.

Good news - we don't need to worry about postblit :o).

new and malloc are special cases and should be in the list of special cases.

Yes to new, no to malloc.

Eliminated the void return test.

@andralex I'd say just do the ref counting. escape the type system. improve later.

@SSoulaimane we have that already... https://github.com/dlang/druntime/pull/2348

Mutable data can be stored like this:
struct __mutable(T)
{
    private size_t _ref;
    this(T val){ _ref=cast(size_t)val; }
    T unwrap() const
    {
        return cast(T)_ref;
    }
}

struct A
{
    __mutable!(int*) rc;
    this(int) immutable
    {
        rc=new int;
    }
    int inc() immutable
    {
        return ++*rc.unwrap;
    }
}

int main()
{
    immutable A b=0;
    assert(b.inc==1);
    assert(b.inc==2);
    return 0;
}

@anon17 thanks for the suggestion. It's in line with some of what @edi33416 and myself have tried over time. It has a number of small issues (not safe, the GC may free the memory prematurely) that can be fixed as follows:
@safe:

struct __mutable(T)
{
    private union { T _unused; size_t _ref; }
    this(T val) pure immutable { _ref=cast(size_t)val; }
    T unwrap() const pure @system
    {
        return cast(T)_ref;
    }
}

struct A
{
    __mutable!(int*) rc;
    this(int) immutable pure
    {
        rc=new int;
    }
    int inc() immutable pure @trusted
    {
        return ++*rc.unwrap;
    }
}

int main() pure
{
    immutable A b=0;
    assert(b.inc==1);
    assert(b.inc==2);
    return 0;
}

This code compile and runs. The large problem is that A.inc is a strongly pure function (pure operating on immutable data). However, that's a trick - unbeknownst to the type system, the code ends up changing immutable data. Per the spec (with or without this PR), the call to b.inc can be memoized, which would render code incorrect.

Weakly pure variant:
struct A
{
    __mutable!(int*) rc;
    this(int) immutable pure
    {
        rc=...; //PrefixAllocator is fine
    }
    private void* addRef() pure const @trusted
    {
        ++*rc.unwrap;
        return null;
    }
    private void* release() pure const @trusted
    {
        int counter=--*rc.unwrap;
        if(counter==0)deallocate();
        return null;
    }
    private void deallocate() pure const
    {
        ...
    }
    ~this() pure const
    {
        release();
    }
}

Also this way the change is not visible outside, so the type system can't really tell if it changes or not, it only needs to call weakly pure functions.

@anon17 thanks! @edi33416 will take a look at this


Is there a way to resize the arrows/notes?

Describe your problem here.
Hi! So um I've been wanting to resize the opponents notes to be much smaller then they are.
I tried using the note tween like this: noteTweenX('opponentNoteTween', '4.scale', 0.3, 0.01, 'linear') but nothing seemed to work.
Just curious if its possible to do it like this? If so what am I doing wrong.  And if not is there any other way of changing the size of the notes/arrows?
Any help with this is appreciated! Thanks!
Are you modding a build from source or with Lua?
Lua
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
I have not, using LUA.

Use setPropertyFromGroup() instead of tweens if you're just going to set a property

Use setPropertyFromGroup() instead of tweens if you're just going to set a property

I see, I've never used that before. What would I have to put?

setPropertyFromGroup(strums, id, 'scale.x', value)

strums can be opponentStrums, playerStrums or strumLineNotes
id is 0-3, or 0-7 for strumLineNotes
scale.x can also be scale.y or any other property
value is scale, 1 is original size

holy crap that worked! Thanks so much!

setPropertyFromGroup(strums, id, 'scale.x', value)

strums can be opponentStrums, playerStrums or strumLineNotes id is 0-3, or 0-7 for strumLineNotes scale.x can also be scale.y or any other property value is scale, 1 is original size

is there a way to tween it?


hyperlink URL having special chars like & isn't working

hyperlink URL having special chars like & isn't working- getting repair error..
(version-  PptxGenJS 3.3.1)
Please check with the below sample URL -
https://www.google.com/search?q=nature&source=lnms&tbm=isch&sa=X&ved=2ahUKEwjG1J-V8N7uAhUw6XMBHXAxCkQQ_AUoAXoECB8QAw&biw=1440&bih=732

@gitbrent are you sure that this is related to url? I just tried your code and it is ok for me

Hi,
I checked, this is resolved in the new version.
thanks


Can't build on Windows™

While running the command ./mvnw clean install -Pprod the build fails with the following error:
[INFO] --- frontend-maven-plugin:1.8.0:npm (npm run gen:sources) @ kafka-ui-contract ---
[INFO] Running 'npm run gen:sources' in C:\Users\amarcu\Documents\Code\_aws_projects\kafka-ui-master\kafka-ui-react-app
[INFO]
[INFO] ><EMAIL_ADDRESS>gen:sources C:\Users\amarcu\Documents\Code\_aws_projects\kafka-ui-master\kafka-ui-react-app
[INFO] > rm -rf src/generated-sources && openapi-generator-cli generate
[INFO]
[INFO] [error] Required option '-i' is missing
[INFO] npm ERR! code ELIFECYCLE
[INFO] npm ERR! errno 1
[INFO] npm ERR<EMAIL_ADDRESS>gen:sources: `rm -rf src/generated-sources && openapi-generator-cli generate`
[INFO] npm ERR! Exit status 1
[INFO] npm ERR!
[INFO] npm ERR! Failed at the<EMAIL_ADDRESS>gen:sources script.
[INFO] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[INFO]
[INFO] npm ERR!      C:\Users\amarcu\AppData\Roaming\npm-cache\_logs\2021-10-19T20_44_11_996Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for kafka-ui 0.2.2-SNAPSHOT:
[INFO]
[INFO] kafka-ui ........................................... SUCCESS [  0.168 s]
[INFO] kafka-ui-contract .................................. FAILURE [ 26.387 s]
[INFO] kafka-ui-api ....................................... SKIPPED
[INFO] kafka-ui-e2e-checks ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  26.726 s
[INFO] Finished at: 2021-10-19T23:44:12+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.8.0:npm (npm run gen:sources) on project kafka-ui-contract: Failed to run task: 'npm run gen:sources' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :kafka-ui-contract

Environment:
win 10
using latest master kafka-ui
latest docker-desktop 4.1.1 (69879)
java version:
$ java --version
openjdk 17 2021-09-14
OpenJDK Runtime Environment Temurin-17+35 (build 17+35)
OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing)
From the readme, the requirements are to have docker and java 13 or greater but for some reason the build fails.
Thank you
2021-10-19T20_44_11_996Z-debug.log

Hi @Haarolean ,
I am using Docker Desktop with wsl2 already. Or do you mean do run this in an Ubuntu wsl2 based on windows?
What is strange is that I just replaced my laptop, and about a month ago on the previous laptop is worked fine.
Also on the previous laptop I even had  AdoptOpenJDK 11 but an older Docker Desktop ( 1 or 2 verions older so still pretty new) ...

Hi @Haarolean,
I just tried directly starting the UI now, using docker-compose -f ./docker/kafka-ui.yaml up from gitBash and surprisingly it works for me even now. So probably the build failed back then also but the UI and the cluster are working for me now as they worked then.
Maybe I misunderstood something but I thought that the build is required for the Kafka UI to work, and it seems that is not.

Ok, I understood somehow from the readme that it required to build first to use it, assumed that it will generate some files to be mounted etc ... So all I need to start Kafka local cluster and UI is the docker compose file!


pause instruction?

There's none in Rust. RFC?

https://internals.rust-lang.org/t/pre-rfc-introducing-std-thread-pause/2469


ReorderableListView throws error on reorder list items

I am trying to create a ReorderableListView with items. These items are either Containers or Dismissibles (with child as ListTile) depending on certain conditions. The data is being retrieved from Cloud Firestore and a list of widgets is then created which is used to render the ReorderableListView. The onReorder function is very simple as shown below.
reorder(oldIndex, newIndex) {
    if (newIndex > oldIndex) {
      newIndex -= 1;
    }

    setState((){
        final Widget item = tiles.removeAt(oldIndex);
        tiles.insert(newIndex, item);
    });
}

tiles is the list of Widgets as explained above.
It works fine as long as we try to move an item in the list from a lower index to a higher index. As soon as we try to move an item up in the list, i.e., higher index to a lower index, it throws the error.
Multiple widgets used the same GlobalKey.

Steps to Reproduce

Create a ReorderableListView with different widgets as children.
Implement the onReorder as quoted above.
Try moving an item from a higher index to a lower index (up in the list).

Logs
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building LongPressDraggable<Key>(state:
flutter: _DraggableState<Key>#e8a65):
flutter: Multiple widgets used the same GlobalKey.
flutter: The key [GlobalObjectKey ValueKey<String>#0ecff] was used by multiple widgets. The parents of those
flutter: widgets were:
flutter: - Listener(listeners: [down], behavior: deferToChild, renderObject: RenderPointerListener#f9529
flutter:   relayoutBoundary=up4 NEEDS-LAYOUT)
flutter: - Listener(listeners: [down], behavior: deferToChild, renderObject: RenderPointerListener#e8933
flutter:   relayoutBoundary=up3)
flutter: A GlobalKey can only be specified on one widget at a time in the widget tree.
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      GlobalKey._debugReserveFor.<anonymous closure> (package:flutter/src/widgets/framework.dart:172:11)
flutter: #1      GlobalKey._debugReserveFor (package:flutter/src/widgets/framework.dart:190:6)
flutter: #2      Element.updateChild.<anonymous closure> (package:flutter/src/widgets/framework.dart:2693:13)
flutter: #3      Element.updateChild (package:flutter/src/widgets/framework.dart:2696:6)
flutter: #4      SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4673:14)
flutter: #5      Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #6      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3665:16)
flutter: #7      Element.rebuild (package:flutter/src/widgets/framework.dart:3507:5)
flutter: #8      StatefulElement.update (package:flutter/src/widgets/framework.dart:3811:5)
flutter: #9      Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #10     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4673:14)
flutter: #11     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #12     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3665:16)
flutter: #13     Element.rebuild (package:flutter/src/widgets/framework.dart:3507:5)
flutter: #14     StatefulElement.update (package:flutter/src/widgets/framework.dart:3811:5)
flutter: #15     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #16     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3665:16)
flutter: #17     Element.rebuild (package:flutter/src/widgets/framework.dart:3507:5)
flutter: #18     StatelessElement.update (package:flutter/src/widgets/framework.dart:3714:5)
flutter: #19     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #20     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4391:32)
flutter: #21     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4781:17)
flutter: #22     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #23     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4673:14)
flutter: #24     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #25     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3665:16)
flutter: #26     Element.rebuild (package:flutter/src/widgets/framework.dart:3507:5)
flutter: #27     ProxyElement.update (package:flutter/src/widgets/framework.dart:3921:5)
flutter: #28     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #29     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4673:14)
flutter: #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #31     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4673:14)
flutter: #32     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #33     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4673:14)
flutter: #34     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #35     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4673:14)
flutter: #36     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #37     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3665:16)
flutter: #38     Element.rebuild (package:flutter/src/widgets/framework.dart:3507:5)
flutter: #39     StatefulElement.update (package:flutter/src/widgets/framework.dart:3811:5)
flutter: #40     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #41     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4673:14)
flutter: #42     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #43     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3665:16)
flutter: #44     Element.rebuild (package:flutter/src/widgets/framework.dart:3507:5)
flutter: #45     StatefulElement.update (package:flutter/src/widgets/framework.dart:3811:5)
flutter: #46     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #47     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3665:16)
flutter: #48     Element.rebuild (package:flutter/src/widgets/framework.dart:3507:5)
flutter: #49     StatelessElement.update (package:flutter/src/widgets/framework.dart:3714:5)
flutter: #50     Element.updateChild (package:flutter/src/widgets/framework.dart:2711:15)
flutter: #51     _LayoutBuilderElement._layout.<anonymous closure> (package:flutter/src/widgets/layout_builder.dart:118:18)
flutter: #52     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2235:19)
flutter: #53     _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:107:11)
flutter: #54     RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1659:58)
flutter: #55     PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:728:15)
flutter: #56     RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1659:13)
flutter: #57     _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:205:5)
flutter: #58     RenderObject.layout (package:flutter/src/rendering/object.dart:1563:7)
flutter: #59     RenderStack.performLayout (package:flutter/src/rendering/stack.dart:520:15)
flutter: #60     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1438:7)
flutter: #61     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:697:18)
flutter: #62     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:270:19)
flutter: #63     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:654:13)
flutter: #64     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
flutter: #65     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
flutter: #66     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
flutter: #67     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
flutter: #68     _invoke (dart:ui/hooks.dart:128:13)
flutter: #69     _drawFrame (dart:ui/hooks.dart:117:3)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════

Analyzing jesuskids...
No issues found! (ran in 2.7s)

samarthagarwal$ flutter doctor -v
[✓] Flutter (Channel beta, v0.7.3, on Mac OS X 10.13.2 17C205, locale en-IN)
    • Flutter version 0.7.3 at /Users/samarthagarwal/flutter
    • Framework revision 3b309bda07 (2 weeks ago), 2018-08-28 12:39:24 -0700
    • Engine revision af42b6dc95
    • Dart version 2.1.0-dev.1.0.flutter-ccb16f7282

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/samarthagarwal/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /Users/samarthagarwal/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3, Build version 9E145
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 28.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[!] VS Code (version 1.27.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected devices (1 available)
    • iPhone X • 80AF0226-FD88-4237-9639-ACF2CB8C3D37 • ios • iOS 11.3 (simulator)

! Doctor found issues in 1 category.

Looks like an added delay of 20-50 milliseconds fixed the issue.
reorder(oldIndex, newIndex) {
    if (newIndex > oldIndex) {
      newIndex -= 1;
    }

    Future.delayed(Duration(milliseconds: 20), (){
      setState(() {
        final Widget item = tiles.removeAt(oldIndex);
        tiles.insert(newIndex, item);
      });
    });
}

Are you using GlobalKeys for items in the list?

Yes, each item in the tiles list (either Dismissible or Container) has a unique GlobalKey. I have ensured that the keys are unique by logging them to the console. I have also tried using Key instead of using GlobalKey. But the error exists.
PS: The GlobalKeys/Keys are the document ids of the documents from Cloud Firestore, hence they are always unique.

GlobalKey is expensive and discouraged.
What are you using them for?
Can you please provide a runnable minimal reproduction (main.dart)?

The problem is caused by building widgets in advance and reusing them instead of rebuilding them every time in build()
import 'package:flutter/material.dart';
//import 'package:cloud_firestore/cloud_firestore.dart';
import 'dart:async';
import 'dart:convert';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Firebase',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage() : super();

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
//  final cloudFirestore = Firestore.instance;
  List<int> items = [];
  List<dynamic> programItems = [];

  bool programItemsLoaded = false;

  Future getProgramsItems() async {
    programItems = json.decode(
        '[{"documentID": "001_ABC", "program_item_title": "Activity"}, {"documentID": "002_ABC", "program_item_title": "Connect with Others"}, {"documentID": "003_ABC", "program_item_title": "Bible Story"}, {"documentID": "004_ABC", "program_item_title": "Discussion"}, {"documentID": "005_ABC", "program_item_title": "Prayer"}, {"documentID": "006_ABC", "program_item_title": "Welcome"}]');

    makeTiles();

    this.setState(() {
      programItemsLoaded = true;
    });

    return programItems;
  }

  makeTiles() {
    items = [];

    for (int i = 0; i < programItems.length; i++) {
      items.add(i);
//      var item = programItems[i];
//
//      print(i.toString() + " " + item["documentID"]);
//
//      ListTile tile = ListTile(
//        key: Key(item["documentID"]),
//        title: Text(item["program_item_title"]),
//      );
//
//      tiles.add(tile);
    }
  }

  ListTile makeTile(int index) {
    var item = programItems[index];
    return ListTile(
      key: Key(item["documentID"]),
      title: Text(item["program_item_title"]),
    );
  }

  onReorder(oldIndex, newIndex) {
    if (newIndex > oldIndex) {
      newIndex -= 1;
    }

    setState(() {
      final int item = items.removeAt(oldIndex);
      items.insert(newIndex, item);
    });
  }

  @override
  void initState() {
    super.initState();
    getProgramsItems();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Test"),
      ),
      body: programItemsLoaded == false
          ? Container(
              child: Center(
                child: Text("Loading..."),
              ),
            )
          : ReorderableListView(
              children: items.map(makeTile).toList(),
              onReorder: (oldIndex, newIndex) {
                onReorder(oldIndex, newIndex);
              },
            ),
    );
  }
}

Thanks for the great reproduction BTW!

Thanks for the code that you shared, Could you please explain the difference between your code and the code in question in a little more detail?

The main difference is that in my code a new list of ListTile() is created from makeTile in every build.
It might still be a bug in the framework that your code causes an exception.
To me it sounds like an issue in the diffing algorithm that tries to figure out which widgets need to be re-rendered.
When the whole list is a new instance Flutter might just drop and re-render all items and therefore not run into the bug.
@Hixie ?

I am not sure if that is what is it. It is possible that what you are saying is correct because of the knowledge of how the framework works that you have, but it does not make sense to me. Setting state also rebuilds the widget tree, and on reorder, I am reordering the elements and recreating the list and then setting the sate. So the list is rebuilt. Moreover, the bug is fixed if I add a slight delay using Future.delayed (as small as 20 milliseconds works) inside the reorder method, it works fine. It feels like for a very small duration of time (about 20 ms or so), the reordered items or the lists (old and new) tend to have the same keys. I don't know how flutter handles this internally but that is what the error message indicates to me.

I have the same problem here. I'm using a normal Key() that I'm sure it is unique.
Recreating the entire list on every build is very expensive. I hope you guys can fix it.

Is it serious?
still no closing bug in a year?
only adding delay to fix??

Is the delay the accepted way of doing this right now?

Just came across this and what solved for me was that the Key object also needs to be recreated rather than captured upfront on the creation of the page/widget.

@aqwert you mind showing how us how you did it? Curious about your approach. Did you went with the approach of creating cells on every re-build? Or perhaps loop through the already created ones and assign new keys or some other better approach perhaps?

The widgets themselves are new for each build. In the example above it is new ListTile in each build. What would not work is if you cache the keys in the stateful widget and then reused them on the newly built ListTile. The key also had to be a new instance on the build.

On the beta version of flutter at least, @zoechi's revised code in https://github.com/flutter/flutter/issues/21829#issuecomment-424412362 only works for dragging items down the list - if I drag an item higher up the list I get the 'multiple widgets used the same GlobalKey' exception.
My flutter doctor:
[√] Flutter (Channel beta, v1.10.7, on Microsoft Windows [Version
    10.0.17763.805], locale en-AU)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.38.1)
[√] Connected device (1 available)

I changed line347 in reorderable_list.dart
from  final GlobalObjectKey keyIndexGlobalKey = GlobalObjectKey(toWrap.key);
to final GlobalObjectKey keyIndexGlobalKey = GlobalObjectKey(UniqueKey());
the exception stopped and dragging an item up the list worked ok.
I dont understand the reorderable_list.dart code enough to know if the change has some knockon effects though.

I changed line347 in reorderable_list.dart
from final GlobalObjectKey keyIndexGlobalKey = GlobalObjectKey(toWrap.key);
to final GlobalObjectKey keyIndexGlobalKey = GlobalObjectKey(UniqueKey());
the exception stopped and dragging an item up the list worked ok.
I dont understand the reorderable_list.dart code enough to know if the change has some knockon effects though.

Any way it doesn't look like correct solution

Submit a PR @PeteSwad ?

I believe this has been fixed with https://github.com/flutter/flutter/pull/49896 (more info in https://github.com/flutter/flutter/issues/43780). It turns out that this was a result of a problem with the GlobalKey detection algorithm.
I tested it in stable and was able to reproduce the error, but it seems to be okay in master. I will close the issue for now, but if it still occurs in master, please feel free to re-open the issue!

any new on this? Is it fixed?


Various Grammatical and Spelling Changes to the README

This isn't a valuable or meaningful change, please feel free to make specific changes that you feel would improve these standards as a whole.


M1 Support

:white_check_mark: x86_64 JVM: Works
:no_entry_sign: aarch64: Crashes

Steps:

Install OpenJDK16 for arm64 brew install openjdk
Bump pom.xml to use <version.jna>5.8.0</version.jna>
Run BasicUsage.java using arm64 version

Stack trace: https://gist.github.com/tresf/b36b0fc7b2a439fefae89cb1a2df2904

Per @dyorgio, the crash goes away if objc_msgSend is switched from varargs to explicit invocation.
e.g.
- NativeLong objc_msgSend(NativeLong receiver, Pointer selector, Object... args);
+ NativeLong objc_msgSend(NativeLong receiver, Pointer selector);

Hi @tresf, could you give me a feedback about last commit on a M1 hardware?

Hi @tresf, could you give me a feedback about last commit on a M1 hardware?

Yes it works if #7 is also merged to update JNA to a version with aarch64 support.

Merged! closing. 😃


MarshalResponse maybe panic

func MarshalResponse(msg []byte) (Response, error) {
	var j map[string]interface{}

	err := jsonUnmarshal(msg, &j)
	if err != nil {
		return Response{}, gremerror.NewUnmarshalError("MarshalResponse", msg, err)
	}

	var (
		status = j["status"].(map[string]interface{})
		result = j["result"].(map[string]interface{})
		code   = status["code"].(float64)
		resp   = Response{Code: int(code)}
	)

	err = responseDetectError(resp.Code)
	if err != nil {
		resp.Data = err // Use the Data field as a vehicle for the error.
	} else {
		resp.Data = result["data"]
	}
	resp.RequestID = j["requestId"].(string)

	return resp, nil
}

resp.RequestID = j["requestId"].(string) maybe cause panic,panic message:
interface conversion: interface {} is nil, not string

I can happen when your request is too long (larger than the gorilla buffer, 8192 bytes I think) and the request is split. In that case the server doesn't see the request ID so in the response it doesn't send one.
The current solution is to increase the request buffer, or make your request smaller.


[Bug Report] Glint doesn't work on worn armor

Checklist before creating an issue:

[X] I'm using the latest version of Apollo.
[X] I'm using the latest version of Lunar Client. (Relaunched in the last hour)
[X] I'm running Apollo on ONLY the backend server OR the proxy. (YOU CANNOT RUN IT ON BOTH)
[X] I do NOT have both Apollo and the LEGACY API installed on the same server. (YOU CANNOT RUN BOTH AT THE SAME TIME)
[x] I've gathered all screenshots, logs and appropriate information related to creating a bug report.

Issue Description
Glint doesnt show up on worn armor only the item form as you can see in the image attached below the glint of the armor is red but the glint on the item but not on the actual armor model
Reproduction steps
Add red glint to armor
Wear it

Code Snippet (If applicable, if not write N/A)
N/A
Versions
1.8
Platforms
Spigot / Bukkit
Server Version
1.8
Modules
Optifine
Screenshots
![image](https://github.com/user-attachments/assets/c7ab5c4b-98cc-402a-8ec2-67ca25109656)

Contact Information
Discord - ambassator

Additional Context (Examples, Links, ETC)
No response

This is outside the scope of the module, this is not a standing issue. If you want to suggest its addition, do so in the Discord.


Can't get winpty working

Hi!
Thank you all for this great tool!
Unfortunately I can't get winpty working:
My OS: Win7 32bit
Latest winpty version: https://github.com/rprichard/winpty/archive/master.zip
via Cygwin
packages:
mingw-gcc-g++
gcc-g++  (gcc4-g++ is obsolete)
make
 ~/winpty-master
$ ./configure
uname -s identifies a Cygwin environment.
uname -m identifies a i686 environment.
Found Cygwin/MSYS G++ compiler: i686-pc-cygwin-g++
Found 32-bit MinGW G++ compiler: i686-pc-mingw32-g++
Writing config-unix.mk
Writing config-mingw.mk

 ~/winpty-master
$ make
cd agent && make
make[1]: Entering directory '/home/User/winpty-master/agent'
Compiling EventLoop.cc
Compiling NamedPipe.cc
Compiling Agent.cc
Compiling AgentAssert.cc
Compiling Terminal.cc
Compiling Win32Console.cc
Compiling ConsoleInput.cc
Compiling ../shared/DebugClient.cc
Compiling Coord.cc
Compiling SmallRect.cc
Compiling main.cc
Linking ../build/winpty-agent.exe
make[1]: Leaving directory '/home/User/winpty-master/agent'
cd libwinpty && make
make[1]: Entering directory '/home/User/winpty-master/libwinpty'
Compiling winpty.cc
winpty.cc: In function ‘void* createNamedPipe(const wstring&, bool)’:
winpty.cc:142:28: error: ‘FILE_FLAG_FIRST_PIPE_INSTANCE’ was not declared in this scope
winpty.cc:150:1: warning: control reaches end of non-void function [-Wreturn-type]
../config.mk:31: recipe for target 'winpty.o' failed
make[1]: *** [winpty.o] Error 1
make[1]: Leaving directory '/home/User/winpty-master/libwinpty'
Makefile:24: recipe for target 'all' failed
make: *** [all] Error 2

I don't know what to do at this point in Cygwin.
via MinGW
packages:
mingw32-make
g++
msys-dvlpr
and the zlib1.dll in C:\MinGW\bin (source: http://zlib.net/zlib128-dll.zip)
 ~/winpty-master
$ ./configure
uname -s identifies a MSYS environment.
Found Cygwin/MSYS G++ compiler: i686-pc-msys-g++
Found 32-bit MinGW G++ compiler: mingw32-g++
Writing config-unix.mk
Writing config-mingw.mk

 ~/winpty-master
$ make
cd agent && make
make[1]: Entering directory `/home/User/winpty-master/agent'
Compiling EventLoop.cc
Compiling NamedPipe.cc
Compiling Agent.cc
Compiling AgentAssert.cc
Compiling Terminal.cc
Compiling Win32Console.cc
Compiling ConsoleInput.cc
Compiling ../shared/DebugClient.cc
Compiling Coord.cc
Compiling SmallRect.cc
Compiling main.cc
Linking ../build/winpty-agent.exe
make[1]: Leaving directory `/home/User/winpty-master/agent'
cd libwinpty && make
make[1]: Entering directory `/home/User/winpty-master/libwinpty'
Compiling winpty.cc
Compiling ../shared/DebugClient.cc
Linking ../build/winpty.dll
make[1]: Leaving directory `/home/User/winpty-master/libwinpty'
cd unix-adapter && make
make[1]: Entering directory `/home/User/winpty-master/unix-adapter'
Compiling main.cc
Compiling Shared.cc
Linking ../build/console.exe
make[1]: Leaving directory `/home/User/winpty-master/unix-adapter'

Everything fine at this point. But the console.exe doesn't work.
I tried your testcase via mintty and put everything into
$ ls /usr/local/bin
console.exe  msys-1.0.dll  winpty.dll  winpty-agent.exe

With the msys-1.0.dllbecause of:
$ console
/usr/local/bin/console.exe: error while loading shared libraries: msys-1.0.dll: cannot open shared object file: No such file or directory

If I try
$ console /cygdrive/c/Python27/python.exe

it just hangs and I have to kill it.
(Python source: https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi)

I added make to the Cygwin and MSYS2 package lists in the README.
I think I'll upload new binaries at some point.  The ones at https://github.com/rprichard/winpty/downloads are a few years old now, assume 32 bits, and lack various bugfixes.  (They break badly on Windows 10.)  Issue https://github.com/rprichard/winpty/issues/32 covers that, though.
The FILE_FLAG_FIRST_PIPE_INSTANCE bug was fixed in the winbase.h header, http://sourceforge.net/p/mingw/bugs/2050/.  If I remove my hack, my code compiles fine with:

MSYS1/MinGW (installed using mingw-get)
MSYS2 (installed via https://msys2.github.io/ and pacman)
MinGW-w64 in Cygwin

It still fails using the original MinGW installed via Cygwin.  Maybe no one is updating its w32api package?  In any case, I changed the configure script to prefer MinGW-w64 over MinGW for Cygwin.


Add note to readme about Open edX differences from #22

Adding the helpful note from @aihuacville in https://github.com/mit-teaching-systems-lab/discourse-edx-lti/issues/22#issuecomment-350617779.

selfie


Harrison/new search

LGTM, but left comments with high effective temperature

which is to say, given the emissivity of the comments, the real temperature is likely much higher


Add Wechaty logo to the Open Graph Image metadata of https://wechaty.js.org

🚀 Feature
When we share https://wechaty.js.org over social media, it is good that the card they generate for the link has useful information.
Facebook, LinkedIn, and Twitter do not render correctly and get an image to use for https://wechaty.js.org.
Facebook:

LinkedIn:

Twitter:

References:

Use https://developers.facebook.com/tools/debug/ to validate results for Facebook.
Use https://www.linkedin.com/post-inspector/ to validate results for LinkedIn.
Use https://cards-dev.twitter.com/validator to validate results for Twitter.

@huan Please take a look.

Thanks for raising this issue!
I agree with you that we should have a beautiful Open Graph Image in our metadata.
However, I feel this should be done by the Docusaurus system, and I believe that the Docusaurus should have already supported this.
Could you please have a check on Docusaurus to see if it supports it, and how can we add config in our site?
Thank you very much.

Hi @huan, I have resolved this issue and created a PR on this. Do take a look.

Hi @huan, I have resolved this issue and created a PR on this. Do take a look.


[raygui] update to 3.6

Library name
raygui
New version number
3.6
Other information that may be useful (release notes, etc...)
https://github.com/raysan5/raygui/releases/tag/3.6

Fixed by #31896.


⚠ Bofrost.at has degraded performance

In 42db729, Bofrost.at (https://www.bofrost.at) experienced degraded performance:

HTTP code: 200
Response time: 1544 ms

Resolved: Bofrost.at performance has improved in f012a0d.


Write consoleAlerts to stderr

Do you want to request a feature or report a bug?
feature
Has someone had this problem before?
no
What is the current behavior?
When Raven is configured with an empty DSN (aka in development), it outputs this to stdout:
<EMAIL_ADDRESS>alert: no DSN provided, error reporting disabled

this is very nice and I appreciate it. However when writing scripts that are supposed to write to stdout, this will mix into the output of the script, making it very difficult to use.
What is the desired behavior?
Would it be possible to write to stderr for these messages instead of stdout? This could come in the form of just using console.warn or some sort of utility to pass in a Console object that was configured differently, like this:
const { Console } = require('console');

// somehow pass newConsole to Raven...
// This would not be as easy to use, but I suppose it provides some flexibility.
const newConsole = new Console({ stdout: process.stderr, stderr: process.stderr });

I am running<EMAIL_ADDRESS>but I believe this behavior is still present in master (2.6-ish?).
https://github.com/getsentry/raven-node/blob/381dd6fe69f6c193e8f0fcaf46919efb68dc6e16/lib/utils.js#L126-L137

Thanks @kamilogorek !

@rockymeza released as 2.6.1


Uploading final track of good vibes

I messed up the recording and mixing of the acq guitar and added more sfx to make sound more interesting. I have also have .wav files but they are too big for github

more songs to come just need more time on it


squid: visible_hostname {{OPNsense.proxy.general.VisibleHostname}}

Gives in clean install "localhost" as an result.
And exposes header: Via: 1.1 localhost (squid/3.5.27)

@shacal thanks for the report! I removed the default value of "localhost" making this feature opt-in, but only when we release new images, which is OPNsense 18.1. Is this fix ok for you?

Sure, in fine with this.
Would like an field on web UI 🙈

@shacal not sure what you mean, it's on the UI :)
General Proxy Settings: enable "advanced mode"

I mean that even empty "" hostname or toggle to have that in config or not.
As that info should not be exported.

@shacal try again with the patch, run from the root shell:
# opnsense-patch e99275d


Multiprocessing in SubprocVecEnv not thread-safe

Describe the bug
On UNIX, SubprocVecEnv defaults to creating processes using the fork method. The Python docs warn that "safely forking a multithreaded process is problematic." This is since the child process inherits all objects from the parent, including -- for example -- TensorFlow sessions and graphs. In practice, this tends to manifest itself with difficult to diagnose deadlocks.
This is easily solved by switching the method to spawn (which is already used by default on Windows). This imposes a small fixed overhead to creating environments. I'll submit a PR that does this for discussion.
Code example
Running ci/local_tests.sh of this commit will reproduce this error (inside Docker, reproduced on my local machine and on Travis). If required I can try and create a more minimal breaking example, but I expect this will be difficult -- race conditions tend to be fickle.
The key ingredient to cause the problem is having created a session before calling SubprocVecEnv. This happens quite naturally in some contexts, e.g. population-based training, but does not occur in most code.
System Info

Docker; Ubuntu 16.04
Python 3.6.8
Tensorflow 1.12, CPU version
Stable Baselines 2.4.1, pip install

closed by #218


feat: create kics plugin

Leaving this as a draft until we release the core functionality in the CDK framework.

Thanks @otaviomacedo


Add new regions (ap-northeast-3, china)

Adds 3 new regions:

ap-northeast-3
cn-north-1
cn-northwest-1

This change is

Not sure if you got a notification on this @durch, should be a pretty easy review.

Sorry @nastevens I just can't seem to get a handle of github notifications. Will merge + publish promptly

No worries, thanks for getting this merged!


Repackage DOTNETFX for offline use

I am trying to manually repackage DOTNETFX with the local install file embedded, as the destination machine does not have internet access. I am trying to use this guide : https://docs.chocolatey.org....
But the install.ps1 for dotnetfx is rather different to the one used in demo link above (for Notepad++). This is the Dotnet version below. So how do I safely replace the URL to instead point to the ./tools path (where I will place the .exe file) ?
$version = '4.8'
$arguments = @{
PackageName = 'dotnetfx'
Release = 528040
Version = $version
ProductNameWithVersion = "Microsoft .NET Framework $version"
Url = 'https://download.visualstud...
Checksum = '9B1F71CD1B86BB6EE6303F7BE6FBBE71807A51BB913844C85FC235D5978F3A0F'
ChecksumType = 'sha256'
}
Install-DotNetFramework @arguments

Yes, the .NET packages are constructed differently than the simple example from the docs. The Install-DotNetFramework function comes from the chocolatey-dotnetfx.extension module (specifically, from here).
As you can see in the source code, the Url value is eventually passed to the Get-ChocolateyWebFile helper. I believe this helper supports local filesystem (file:) URIs (of the format file:///C:/ProgramData/...). To construct such an URI, you can use the $Env:chocolateyPackageFolder environment variable (provided by Chocolatey), which will point to the location where your package is extracted on the target machine. You should take care, however, to replace Windows path separators (backslashes) with slashes expected by the uri syntax.
Putting it all together, the Url in your package could probably be set as such:
Url = "file:///${Env:chocolateyPackageFolder}/tools/ndp48-x86-x64-allos-enu.exe".Replace('\', '/')

Closing due to inactivity.


Remove string append in checkNotNull, replace with lazily evaluated format string.  Also some other automatic cleanups (java.io.FileReader->java.nio.Files, no multiple variable declarations). [phab:D1510]

Created by danielmoy-google at 2017-04-11 23:28:41:

danielmoy-google commented inline (context lost during migration) at 2017-04-11 23:29:58:
probably wanna delete this?  not sure how it showed up, probably copy/paste error since I did this over in google3/cider first

jrtom commented inline (context lost during migration) at 2017-04-11 23:52:30:
Sure.

jrtom accepted this revision at 2017-04-11 23:52:30

danielmoy-google closed via commit 3009a7483b4468e532320eba0bba2813b2174dc3 at 2017-04-12 00:25:53


pgadmin4 crashes on launch

Describe the bug
pgadmin4 crashes on launch.
NixOS x86_64-linux
nixpkgs master@887743a2734
Steps To Reproduce

Open pgadmin

Additional context
           [Errno 13] Permission denied: '/var/lib/pgadmin'
HINT :   Create the directory /var/lib/pgadmin, ensure it is writeable by
         'user', and try again, or, create a config_local.py file
         and override the SQLITE_PATH setting per
         https://www.pgadmin.org/docs/pgadmin4/6.18/config_py.html
Traceback (most recent call last):
  File "/nix/store/j9j9v0swfi207gajgs8n8jwvg22w5q45-pgadmin-6.18/lib/python3.10/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 33, in create_app_data_directory
    is_directory_created = _create_directory_if_not_exists(
  File "/nix/store/j9j9v0swfi207gajgs8n8jwvg22w5q45-pgadmin-6.18/lib/python3.10/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 20, in _create_directory_if_not_exists
    os.mkdir(_path)
PermissionError: [Errno 13] Permission denied: '/var/lib/pgadmin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/j9j9v0swfi207gajgs8n8jwvg22w5q45-pgadmin-6.18/bin/.pgadmin4-wrapped", line 6, in <module>
    from pgadmin4.pgAdmin4 import main
  File "/nix/store/j9j9v0swfi207gajgs8n8jwvg22w5q45-pgadmin-6.18/lib/python3.10/site-packages/pgadmin4/pgAdmin4.py", line 93, in <module>
    app = create_app()
  File "/nix/store/j9j9v0swfi207gajgs8n8jwvg22w5q45-pgadmin-6.18/lib/python3.10/site-packages/pgadmin4/pgadmin/__init__.py", line 265, in create_app
    create_app_data_directory(config)
  File "/nix/store/j9j9v0swfi207gajgs8n8jwvg22w5q45-pgadmin-6.18/lib/python3.10/site-packages/pgadmin4/pgadmin/setup/data_directory.py", line 46, in create_app_data_directory
    sys.exit(1)
NameError: name 'sys' is not defined

Notify maintainers

@gador
Metadata
 - system: `0`
 - host os: `Linux 5.4.230, NixOS, 22.11 (Raccoon), 22.11.20230130.f413457`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(root): `""`
 - channels(user): `""`

It works if I run it like this: PGADMIN_SERVER_MODE=OFF ./result/bin/pgadmin4

Did you create the directory mentioned /var/lib/pgadmin?
This is necessary for the app to work.
If you run in desktop Mode, it uses the homedir.
Are you on NixOS? Then you should really use the NixOSmodule

Yes, it's on NixOS. I didn't realize there was a module that had to be enabled. Thanks!


Update k8s.io/apimachinery to v0.26.2

This remediates CVE-2022-41723
Ref: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.26.md#dependencies

/lgtm
Builds and works well


Adding data-stream related permissions

Signed-off-by: Sandesh Kumar<EMAIL_ADDRESS>opensearch-project/security-dashboards-plugin pull request intake form
Please provide as much details as possible to get feedback/acceptance on your PR quickly

Category: (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)
Enhancement

Github Issue # or road-map entry, if available:
https://github.com/opensearch-project/security-dashboards-plugin/issues/782

Description of changes:
Update list of permissions displayed in UI with data-stream related permissions.

Why these changes are required?
So that the data-stream related permissions are displayed in UI Permissions list.

What is the old behavior before changes and new behavior after changes? (Please add any example/logs/screen-shot if available)
No permissions were displayed in UI for data-stream related tasks. User had to manually type in the desired permissions.

Testing done: (Please provide details of testing done: Unit testing, integration testing and manual testing)
Testing of the permission groups added in this change was already done as part of https://github.com/opensearch-project/security/pull/1170

TO-DOs, if any: (Please describe pending items and provide Github issues# for each of them)

Is it backport from main branch? (If yes, please add backport PR # and commits #)
No

By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Codecov Report

Merging #784 (e34a743) into main (fdaff81) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #784   +/-   ##
=======================================
  Coverage   71.96%   71.96%
=======================================
  Files          87       87
  Lines        1905     1905
  Branches      242      247    +5
=======================================
  Hits         1371     1371
  Misses        480      480
  Partials       54       54

Impacted Files
Coverage Δ

...rds-plugin/public/apps/configuration/constants.tsx
85.71% <0.00%> (ø)

Continue to review full report at Codecov.

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


AttributeError: type object 'QPalette' has no attribute 'Base'.

I installed cellpose with pip install cellpose[gui] in a venv environment and Python 3.10. I have PyQt5.15.7. I get the following error
2022-10-25 20:39:18,513 [INFO] WRITING LOG OUTPUT TO C:\Users\Frank\.cellpose\run.log
[qdarktheme.main] [INFO] The caches(C:\Users\Frank\.qdarktheme) has been deleted
Traceback (most recent call last):
  File "C:\Users\Frank\.pyenv\pyenv-win\versions\3.10.7\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Frank\.pyenv\pyenv-win\versions\3.10.7\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Frank\.virtualenvs\cellpose\Scripts\cellpose.exe\__main__.py", line 7, in <module>
  File "C:\Users\Frank\.virtualenvs\cellpose\lib\site-packages\cellpose\__main__.py", line 184, in main
    gui.run()
  File "C:\Users\Frank\.virtualenvs\cellpose\lib\site-packages\cellpose\gui\gui.py", line 207, in run
    win = MainW(size, clipboard, image=image)
  File "C:\Users\Frank\.virtualenvs\cellpose\lib\site-packages\cellpose\gui\gui.py", line 277, in __init__
    c = self.palette().brush(QPalette.Base).color()
AttributeError: type object 'QPalette' has no attribute 'Base'. Did you mean: 'base'?

I reinstalled from scratch in Python 3.9 and it works. Is Python 3.10 not supported? Thanks!

yes currently only python 3.8 is officially supported, but python 3.9 should work

fyi in anaconda (not venv) in python 3.10.6 I did not receive this error

Ok cool good to know, thank you very much for the response. PS: I was on Windows


Drupal migration: What we do

There are currently 90 pieces of content in the what we do section of the site.
I think the process can be something like:

Create content with basic HTML (no content lists)
Import into Prismic
Once the pages are created, we can then import the Content list slices. We need the content to exist before linking to it.

To achieve this the model needs to store the Drupal ID, we can then start create the references.
We should also store the "Site section" just in case.
The first piece seems simple, the second piece might take a little more time.

Shape of Drupal pages

@jennpb given the 2 step nature of how we do the process, do you think it would be fair to ask the content team to review the content without the content lists, and add those in after?

Perhaps, but it's likely to be me and Jen doing the review anyway (sadly!)

We have tables on these pieces of content which we haven't supported, but I imagine would want to.
It's a big push in Prismic to allow it in the RTE, but they haven't added it, we can add a body slice that could support it though.
https://wellcomecollection.org/what-we-do/access
https://wellcomecollection.org/what-we-do/henry-wellcome-auditorium
https://wellcomecollection.org/what-we-do/williams-lounge
https://wellcomecollection.org/what-we-do/dale-room
https://wellcomecollection.org/event-spaces/rooms/burroughs-room
https://wellcomecollection.org/event-spaces/rooms/medicine-now-gallery

In the short term I think we should just transform these as unnumbered lists. Once we rewrite the content (later on) it might not require tables (this also gives us time to design tables)
Here's an example:

Theatre: 154
Classroom: 154 (with armrest tables)

Taken from the list supplied, things that have been marked up as exclude or V2, it's actually most of the content.
There is 64 / 88.
/what-we-do/proposing-online-article
/what-we-do/ideas-hub-who-can-apply
/what-we-do/whats-involved
/what-we-do/frequently-asked-questions-0
/keep-in-touch-with-hub
/what-we-do/research-network
/what-we-do/created-out-mind
/what-we-do/hubbub
/what-we-do/hub-award
/what-we-do/ideas-hub
/what-we-do/safeguarding-children-and-vulnerable-adults-policy
/what-we-do/rawminds-summer-filmmaking-project
/what-we-do/rawminds-public-speaking-and-presentation-project
/what-we-do/outsider-art-community-workshops
/what-we-do/rawminds-ambassadors-panel
/vocalexercises
/what-we-do/previous-saturday-studios
/schools
/what-we-do/community
/what-we-do/working-wellcome-collection
/visit-us/it-could-happen-anyone
/what-we-do/states-mind-learning-resource
/sleepstories
/visit-us/tabiyat-medicine-and-healing-india
/what-we-do/rawminds-creative-merchandise
/what-we-do/tools-trade
/visit-us/learning-resources-permanent-exhibitions
/electricitytouring
/visit-us/rawminds-creative-audio-project
/what-we-do/rawminds-trailer
/rawminds
/thecollectors
/medicinecorner
/sexologyresource
/mindcraft
/transvengers
/what-we-do/food-and-drink
/what-we-do/venue-hire
/what-we-do/library-collections-online
/what-we-do/youth-and-schools
/what-we-do/previous-touring-exhibitions
/what-we-do/touring-exhibitions
/what-we-do/art-global-health
/what-we-do/projects
/what-we-do/curious-conversations
/what-we-do/space
/what-we-do/interested
/what-we-do/residents
/what-we-do/introducing-henry-wellcome
/what-we-do/wellcome-trust
/what-we-do/wellcome-images
/what-we-do/frequently-asked-questions
/what-we-do/collection-enquiries
/what-we-do/learning-resources
/what-we-do/access
/what-we-do/terms-conditions
/what-we-do/henry-wellcome-auditorium
/what-we-do/williams-lounge
/what-we-do/franks-and-steel-rooms
/what-we-do/dale-room
/event-spaces/rooms/burroughs-room
/event-spaces/rooms/medicine-now-gallery
/what-we-do/about-wellcome-collection
/what-we-do/hub

:boom:


Update minizincide to 2.1.7

After making all changes to the cask:

[x] brew cask audit --download {{cask_file}} is error-free.
[x] brew cask style --fix {{cask_file}} left no offenses.
[x] The commit message includes the cask’s name and version.

@vitorgalvao The developer confirmed the change was legitimate.


Finish Strict Codegen

fragment application
function definitions [✓ code complete / ✗ tested confirmed]
cdecl function calls
main argc / argv
if statements  [✓ code complete / ✗ tested confirmed]
while statements  [✓ code complete / ✗ tested confirmed]
declare cstring
set / get local variables  [✓ code complete / ✗ tested confirmed]
set / get global variables  [✓ code complete / ✗ tested confirmed]
labels
define struct accessor methods

Push args:

translate LocalVariable > expression locations to use new base pointer
compile arg expression fragments
if representation is StackVariable (do nothing)
otherwise call 'push onto each non-stack-variable fragment
insert push arg snippets into function call program body

Resolve and return context variables


Task type for answers; leaderboard

#36 - We need a way to identify answers by task_type
#39 - Proper position calculation in ratings (concept)
migration should look like http://code.re/7Ip

@dchaplinsky @hotsyk anyone?

Migration is not needed actually. First real batch I've already exported.
Next batch will run on the new code. And the problem with task_type in answers was real only if we were running two plugins simultaneously.
Anyway.


Add support for git submodules to the rake update task.

There doesn't seem to be a downside to calling these needlessly, and it's nice to have the support for submodules.

Thank you for supporting Chef! Our process has a couple prerequisites before we can merge your contribution. We need to ensure you've completed a Contributor License Agreement (CLA) and a ticket on our ticket tracker for the release workflow. Pull requests are optional, but should always include the ticket number that they're related to for cross-referencing. Please take a moment to review the below wiki page for the appropriate steps:
http://wiki.opscode.com/display/chef/How+to+Contribute

Hi there!  I did submit a CLA before submitting this pull request, though I did not submit a ticket. I will investigate that process.

Thanks! Once the CLA is processed we can verify it on the tickets website
and it helps us out a lot.
On Dec 22, 2011 12:28 PM, "seph" <
<EMAIL_ADDRESS>wrote:

Hi there!  I did submit a CLA before submitting this pull request, though
I did not submit a ticket. I will investigate that process.

Reply to this email directly or view it on GitHub:
https://github.com/opscode/chef/pull/64#issuecomment-3254378


Guard::RSpec#run_on_change thinks all specs fail

This line assumes that Runner.run returns a truthy value when specs pass and a falsey value when specs fail. Instead, Runner.run returns nil when specs pass and passed specs get added to @failed_paths and they get run again.

Hi @balexand, thanks for the report, I've pushed a fix, could you try it before we release a new version?
Thanks!

Yes, that fixed it. Thanks!

Cool, I'll tell @thibaudgg to release a new version then! :)

Just released version 0.5.5, Thanks all!


Deadbolt integration breaks when using deadbolt.restrict tag

This is related to issue #23.
If I attempt to use the deadbolt.restrict tag on a template where the user is not logged in, then I get an exception because SecureSocial attempts to redirect to the login page after the template has already sent content. I'm trying to use these tags on a page that has different content/buttons if the user is logged in or not. This happens because the DeadboltHelper.beforeRoleCheck calls checkAccess, which does the redirect when the user is not logged in.
This may be as designed. However, I don't think it's a good idea to have template tags potentially call a redirect. I think the deadbolt integration needs to be cleaned up a bit if possible. I think this can work better if the changes suggested in issue #23 are fixed.
I can avoid this issue by using deadbolt.roleHolderPresent around the deadbolt.restrict tag for now.

The Deadbolt documentation says:

void beforeRoleCheck()
This method will be invoked prior to checking the authorisation of the current RoleHolder. This forms the basis for hooking into authentication, i.e. in this method you can check if the user is actually logged in, and redirect accordingly if not.

So it looks like beforeRoleCheck() is the right place to do a redirection if the user is not logged in.   Maybe you're doing something wrong in your integration?

Yeah, it's certainly possible that I'm doing something wrong. I'll look into it more. But based on the deadbolt documentation you posted, I suspect deadbolt makes some assumptions about the use of its tags, e.g. you've already checked if a user has logged in prior to rendering content. Anyway, like I said I can work around it and the fix to #23 will help. Thanks for the prompt response!


[SP-4182] Backport of PDI-16910 - Excel Input does not work when reading from an XLSX created by the MSSQL report (8.0 Suite)

backport of #4931

Build Completed
:fire: This pull request has some issues. It would be preferable to fix them in order for it to be just perfect. See below for more details. Some links are also available below for further assistance in addressing those issues.
Build Commands
mvn -Dsurefire.runOrder=alphabetical -B -fn -f 'pom.xml' -pl 'engine' -P '!assemblies' -amd clean install && mvn -B -f 'pom.xml' -pl 'engine' -P '!assemblies' -amd site

Cleanup Commands
mvn -B -f 'pom.xml' -pl 'engine' -P '!assemblies' -amd build-helper:remove-project-artifact

Changed files
  engine/src/main/java/org/pentaho/di/trans/steps/excelinput/staxpoi/StaxPoiSheet.java
  engine/src/test/java/org/pentaho/di/trans/steps/excelinput/staxpoi/StaxPoiSheetTest.java

Unit Test Coverage
These statistics help you identify how your changes have affected the coverage of the following files. If a file is not in this list, then its coverage was not affected by your changes. To get some help interpreting these metrics, please refer to Jacoco's documentation.

:warning: Coverage Changes: <0.1% (click to expand)
org.pentaho.di.trans.step.BaseStep

Complexity Change: -0.2% :small_red_triangle_down:
Line Change: -0.1% :small_red_triangle_down:
Method Change: -0.4% :small_red_triangle_down:

org.pentaho.di.trans.steps.dimensionlookup.DimensionLookupMeta

Method Change: -1% :small_red_triangle_down:

org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatch

Branch Change: -27.6% :small_red_triangle_down:
Complexity Change: -21.9% :small_red_triangle_down:
Instruction Change: -33.8% :small_red_triangle_down:
Line Change: -42% :small_red_triangle_down:
Method Change: -85.7% :small_red_triangle_down:

org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchData

Complexity Change: -100% :small_red_triangle_down:
Instruction Change: -100% :small_red_triangle_down:
Line Change: -100% :small_red_triangle_down:
Method Change: -100% :small_red_triangle_down:

org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta

Branch Change: -7.7% :small_red_triangle_down:
Complexity Change: -1% :small_red_triangle_down:
Instruction Change: -2.9% :small_red_triangle_down:
Line Change: -4.9% :small_red_triangle_down:
Method Change: -2.1% :small_red_triangle_down:

org.pentaho.di.trans.steps.groupby.GroupByMeta

Branch Change: -1.1% :small_red_triangle_down:
Complexity Change: -1% :small_red_triangle_down:

org.pentaho.di.trans.steps.insertupdate.InsertUpdateMeta

Instruction Change: -0.1% :small_red_triangle_down:

org.pentaho.di.trans.steps.ldapinput.LDAPInputMeta

Branch Change: -1.6% :small_red_triangle_down:
Complexity Change: -0.9% :small_red_triangle_down:
Instruction Change: -0.1% :small_red_triangle_down:

org.pentaho.di.trans.steps.memgroupby.MemoryGroupByMeta

Branch Change: -1.1% :small_red_triangle_down:
Complexity Change: -1.3% :small_red_triangle_down:

org.pentaho.di.trans.steps.replacestring.ReplaceStringMeta

Instruction Change: -0.1% :small_red_triangle_down:

org.pentaho.di.trans.steps.rest.Rest

Complexity Change: -3.1% :small_red_triangle_down:
Instruction Change: -1.3% :small_red_triangle_down:
Line Change: -2% :small_red_triangle_down:
Method Change: -30% :small_red_triangle_down:

org.pentaho.di.trans.steps.synchronizeaftermerge.SynchronizeAfterMergeMeta

Instruction Change: -0.1% :small_red_triangle_down:

org.pentaho.di.trans.steps.webservices.WebServiceMeta

Branch Change: -1.7% :small_red_triangle_down:
Complexity Change: -1.2% :small_red_triangle_down:
Instruction Change: -0.1% :small_red_triangle_down:

org.pentaho.di.trans.Trans

Branch Change: -0.1% :small_red_triangle_down:
Complexity Change: -0.1% :small_red_triangle_down:
Instruction Change: -0.1% :small_red_triangle_down:
Line Change: -0.1% :small_red_triangle_down:

org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIEERepositoryUser

Branch Change: -8.3% :small_red_triangle_down:
Complexity Change: -6.7% :small_red_triangle_down:
Instruction Change: -0.8% :small_red_triangle_down:
Line Change: -3% :small_red_triangle_down:

Note: The list of offending coverage changes extends beyond the presented results and was truncated to prevent reaching the comment size limit.

@pamval @mbatchelor @bmorrise please review


UX: Name-entry page doesn't shorten long names, breaks formatting

This is very minor, and it's mostly handled in other parts of the game where long names get shortened, but during game set-up, the full names will run on and break the layout.

oh yes could catch. Designs are constructed to limit player names to 10 characters only. for now, lets implement that restriction. This for now also does not need to be a notification to players if they go over ten characters, only that when typing their name, the cursor stops inputting characters after ten.


[faz.net] RegexNotFoundError: Unable to extract perform url

Please follow the guide below

You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
Put an x into all the boxes [ ] relevant to your issue (like this: [x])
Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.08.04. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

[x] I've verified and I assure that I'm running youtube-dl 2018.08.04

Before submitting an issue make sure you have:

[x] At least skimmed through the README, most notably the FAQ and BUGS sections
[x] Searched the bugtracker for similar issues including closed ones
[x] Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

[x] Bug report (encountered problems with youtube-dl)
[ ] Site support request (request for adding support for a new site)
[ ] Feature request (request for a new functionality)
[ ] Question
[ ] Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'http://www.faz.net/aktuell/gesellschaft/nashorn-schiebt-familie-15722471.html']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.08.04
[debug] Python version 2.7.6 (CPython) - Linux-4.4.0-130-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 9.20-6, avprobe 9.20-6, rtmpdump 2.4
[debug] Proxy map: {}
[faz.net] 15722471: Downloading webpage
ERROR: Unable to extract perform url; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 792, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 502, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/faz.py", line 55, in _real_extract
    webpage, 'perform url')
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 972, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract perform url; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
...
<end of log>

If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Single video: https://www.youtube.com/watch?v=BaW_jenozKc
Single video: https://youtu.be/BaW_jenozKc
Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.

Description of your issue, suggested solution and other information
Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
Still happens for most of the videos.

@dstftw Had a look on this and found out that we are trying to find a regex in the html source if the media is extern but when I manually checked the page there isn't any such kind of pattern present.


[Bug]: Tray has weird square around tray icons

Checklist

[X] I have read the appropriate section in the contributing guidelines
[X] I believe this issue is a problem with polybar itself and not a misconfiguration on my part
[X] I have searched for other open and closed issues that may have already reported this problem
[X] I have checked the known issues page for this problem.
[X] I have followed the debugging guide to narrow down the problem to a minimal config.

Steps to reproduce
Running polybar with config below
Minimal config
[bar/example]
width = 98%
height = 28
radius = 0
fixed-center = true

tray-position = right
tray-scale = 1.0

Polybar log
polybar|notice:  Parsing config file: .config/bspwm/polybar/config.ini
polybar|notice:  Listening for IPC messages (PID: 369746)
polybar|warn:  No monitor specified, using "DisplayPort-2"
polybar|notice:  Loading module 'left1' of type 'custom/text'
polybar|notice:  Loading module 'bspwm' of type 'internal/bspwm'
polybar|notice:  Loading module 'left2' of type 'custom/text'
polybar|notice:  Loading module 'left1' of type 'custom/text'
polybar|notice:  Loading module 'windowtitle' of type 'internal/xwindow'
polybar|notice:  Loading module 'left2' of type 'custom/text'
polybar|notice:  Loading module 'sep' of type 'custom/text'
polybar|notice:  Loading module 'left1' of type 'custom/text'
polybar|notice:  Loading module 'spotify-prev' of type 'custom/script'
polybar|notice:  Loading module 'spotify' of type 'custom/script'
polybar|notice:  Loading module 'spotify-play-pause' of type 'custom/ipc'
polybar|notice:  Loading module 'spotify-next' of type 'custom/script'
polybar|notice:  Loading module 'left2' of type 'custom/text'
polybar|notice:  Loading module 'right1' of type 'custom/text'
polybar|notice:  Loading module 'pacman-updates' of type 'custom/script'
polybar|notice:  Loading module 'sep1' of type 'custom/text'
polybar|notice:  Loading module 'cpu' of type 'internal/cpu'
polybar|notice:  Loading module 'sep1' of type 'custom/text'
polybar|notice:  Loading module 'date' of type 'internal/date'
polybar|notice:  Loading module 'sep1' of type 'custom/text'
polybar|notice:  Loading module 'volume' of type 'internal/pulseaudio'
polybar|notice:  pulseaudio: using default sink alsa_output.usb-Logitech_PRO_000000000000-00.analog-stereo
polybar|notice:  Loading module 'sep1' of type 'custom/text'
polybar|notice:  Loading module 'memory' of type 'internal/memory'
polybar|notice:  Loading module 'right2' of type 'custom/text'
polybar|notice:  Loaded 24 modules
polybar|notice:  Loaded font "Sauce Code Pro Nerd Font Complete:size=13" (name=Noto Sans, offset=5, file=/home/ohm/.local/share/fonts/Noto_Sans/NotoSans-Regular.ttf)
polybar|notice:  Loaded font "SauceCodePro Nerd Font Mono:size=20" (name=SauceCodePro Nerd Font Mono, offset=5, file=/usr/share/fonts/TTF/Sauce Code Pro Nerd Font Complete Mono.ttf)
polybar|notice:  Loaded font "Material Icons:pixelsize=15" (name=Material Icons, offset=5, file=/home/ohm/.local/share/fonts/MaterialIcons/MaterialIcons-Regular.ttf)
polybar|notice:  Loaded font "Sinji:pixelsize=15" (name=Noto Sans, offset=5, file=/home/ohm/.local/share/fonts/Noto_Sans/NotoSans-Regular.ttf)
polybar|notice:  Loaded font "Togalite medium:pixelsize=11" (name=Noto Sans, offset=2, file=/home/ohm/.local/share/fonts/Noto_Sans/NotoSans-Regular.ttf)
polybar|notice:  Loaded font "SauceCodePro Nerd Font Mono:size=16" (name=SauceCodePro Nerd Font Mono, offset=5, file=/usr/share/fonts/TTF/Sauce Code Pro Nerd Font Complete Mono.ttf)
polybar|notice:  Loaded font "JetBrainsMono Nerd Font Mono:size=12" (name=JetBrainsMono Nerd Font Mono, offset=4, file=/usr/share/fonts/TTF/JetBrains Mono Regular Nerd Font Complete Mono.ttf)
polybar|notice:  Loaded font "JetBrainsMono Nerd Font:pixelsize=12" (name=JetBrainsMono Nerd Font, offset=4, file=/usr/share/fonts/TTF/JetBrains Mono Regular Nerd Font Complete.ttf)
polybar|warn:  Dropping unmatched character 👷 (U+1f477) in '  👷-dev - Discord '
polybar|warn:  Dropping unmatched character 👷 (U+1f477) in '  👷-dev - Discord '
polybar|warn:  Dropping unmatched character 👷 (U+1f477) in '  👷-dev - Discord '
polybar|warn:  Dropping unmatched character 👷 (U+1f477) in '  👷-dev - Discord '
polybar|warn:  Dropping unmatched character 👷 (U+1f477) in '  👷-dev - Discord '
polybar|warn:  Dropping unmatched character 👷 (U+1f477) in '  👷-dev - Discord '
polybar|warn:  Dropping unmatched character 👷 (U+1f477) in '  👷-dev - Discord '
polybar|warn:  Dropping unmatched character 👷 (U+1f477) in '  👷-dev - Discord '

Expected behavior
There shouldn't be a square around tray icons
Actual behavior
There is a weird square around tray icons
Window Manager and Version
BSPWM 0.9.10
Linux Distribution
Arch Linux, Linux LTS 5.15.48-1-lts
Polybar version
polybar 3.6.3

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: Release
Compiler: /usr/bin/c++
Compiler flags: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/polybar/src=/usr/src/debug -flto=auto -O3 -DNDEBUG -Wall -Wextra -Wpedantic -Wsuggest-override
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -Wall -Wextra -Wpedantic -Wsuggest-override  -Wall -Wextra -Wpedantic -Wsuggest-override

Additional Context / Screenshots

Tray is on the top right, sorry if I didn't explain some stuff properly/correctly.

Hi,
i tried out your config but it isn't valid/doesn't run.
Can you please create a config which runs and shows the error? Please also post a screenshot of the error in the running minimal config.

Hi, i tried out your config but it isn't valid/doesn't run. Can you please create a config which runs and shows the error? Please also post a screenshot of the error in the running minimal config.

Screenshot shows the error, also I am running the tray as shown in the configuring section of the polybar wiki.

Without a config that results in the error I can't try to fix it.
The config you sent does not work. Please create one following these principles

Fixed, it was a configuration error on my end.


Make binary and unary operators into external functions

Instead of treating binary and unary operators as special, they can be turned into external functions. This will simplify the runtime quite a bit.

One problem is that when overriding external functions, the type checker makes wrong assumptions.

The runtime type is not guaranteed, so it might be acceptable to just let the type checker make wrong assumptions and get errors at runtime when something is wrong.

Another solution is to make a type error if one declares a function with same name and incompatible type as the one assumed by the type checker.

Another solution is to add smarter type inference such that the type checker can handle all the cases where the output type depends on the type of the input.

One problem is that && and || are lazy, which means they do not evaluate the right argument always.

A solution to the lazy problem is to add support for making external functions lazy, e.g. by specifying a default value to return, if the argument is evaluated to that value. This requires lazy functions to return same type as the argument which has a default value.


Xml app:mcv attributes aren't compiling

Hi, I'm new to Android so I don't know if it's a bug or if I'm missing something.
I followed the configuration septs from the README.md and I got the following error:

The attributes with the app:mcv_* aren't compiling.
<com.prolificinteractive.materialcalendarview.MaterialCalendarView
    android:id="@+id/calendarView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    app:mcv_showOtherDates="boolean"
    app:mcv_arrowColor="color"
    app:mcv_selectionColor="color"
    app:mcv_headerTextAppearance="style"
    app:mcv_dateTextAppearance="style"
    app:mcv_weekDayTextAppearance="style"
    app:mcv_weekDayLabels="array"
    app:mcv_monthLabels="array"
    app:mcv_tileSize="dimension"
    app:mcv_firstDayOfWeek="enum"
    />

I tried with compileSdkVersion 21/22and buildToolsVersion "21.1.2/22.0.1".
If I remove the app:mcv_* it work just fine.
<com.prolificinteractive.materialcalendarview.MaterialCalendarView
    android:id="@+id/calendarView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    />

What am I missing?

Well you need o change the value, for example:
app:mcv_showOtherDates="boolean"
should be app:mcv_showOtherDates="true" or app:mcv_showOtherDates="false"
also don't forget to add xmlns:app="http://schemas.android.com/apk/res-auto"
in your layout

@NeoDigi is correct, the values in the README are the fields' types.

 I'm embarrassed :(
What was I doing...  I wasn't looking to the attributes' values.
Thanks @NeoDigi and @dandc87 and sorry for wasting your time.