Add a mutation modifier for in place mutations

Suggestion:  in addition to mut, add nmut to represent "in place mutation".  An in place mutation is one that is allowed to do any write except for those that could invalidate a reference.
Writing to a usize is an in place mutation.  Pushing or popping from a vector is not, as a push could result in the vector's buffer being moved or a pop could result in a reference to the last element being invalidated.  In:
let a = SomeStruct { field1 : 7usize, field2 : Box::new(8usize) }

then a = x is not an in place mutation, because it could invalidate a reference to field2's target.  But a.field1 = 9 would be an in place mutation.
As far as the rules for constructing an &nmut, they can safely be far more relaxed than the rules for making &mut.  It should be safe to write let a = &nmut b.c; let d = &mut (*a).e.f .  No modification to a should be able to invalidate d.  It might even be the case that the rules for &nmut can allow for them to be treated as & (ref consts) as far as when they are allowed to be created.  The following would be fine:
fn main() {
    let nmut a = 7usize;
    let b = &nmut a;
    let c = &nmut a;
    println!("{} {} {}", a, b, c);
    *b = 8;
    println!("{} {} {}", a, b, c);
    *c = 9;
    println!("{} {} {}", a, b, c);
}

Pros:
Less unsafe code.  Many algorithms require multiple mutable references, so some rust programs use unsafe code pointers to change the mutability of a pointer.  Or they an encoding to represent a path into part of a variable, like saving an index into a collection instead of having a reference to the respective element of the collection.  The problem being that these encodings can't be checked at compile time like references.  Also parsing these encodings is slower than just dereferencing a pointer.
More readable code.  Instead of declaring things as immutable but using unsafe code to modify it, just say it for what it is.
Backwards compatible.  This is a conservative extension to the language.  Possibly some &mut inputs into standard library functions could be changed to &nmut, or in place alternatives would have to be added to get the full benefit of this addition, but it doesn't have to be done immediately.
Cons:
Increased complexity to the language.  This a step towards "improving things until they become incomprehensible".  But I think "you can mutate this variable as long as you don't do anything that could invalidate a reference" is pretty easily understandable.
Might need different rules for multi threaded code.  I'm not very familiar with Rust's multi threading mutation rules so someone else would have to comment on this.
Less readable code.  Forcing code to only have 1 source for the mutation of any piece of data makes things more readable.  But on the other hand, when you do actually need 2 references that benefit goes away.
More cases to write out.  Rust already has a problem of programmers having to write
f(v : T) -> T
f_ref(v : &T) -> &T
f_mut(v : &mut T) -> &mut T
for things like iterators or some trait functions like indexing.  Having to add one more, like
fn index_nmut(&nmut self, index: Side) -> &nmut Self::Output {
is making that problem a little more annoying than it already is.  However, that needs to get fixed regardless of whether nmut is introduced or not.
I looked an didn't see this suggested yet, but it wouldn't surprise me if it has.  I am wondering if someone on the verification part of things can say whether this could be introduced without breaking anything.

Could you show an example which is safe with &nmut but unsafe with &mut?

What happens if b and c are sent to different threads?
use crossbeam::scope; // 0.7.3

fn main() {
    let mut a = 5;
    let b = &mut a;
    //let b = &nmut a;
    //let c = &nmut a;
    scope(move |s| {
        let ah = s.spawn(move |_| {
            *b = 10;
        });
        let bh = s.spawn(|_| {
            //*c = 15;
        });

        ah.join().unwrap();
        bh.join().unwrap();
    }).unwrap();

    dbg!(a);
}

Couldn't this be solved with Pin (https://doc.rust-lang.org/std/pin/index.html)?
From the docs:

A Pin<P> ensures that the pointee of any pointer type P has a stable location in memory, meaning it cannot be moved elsewhere and its memory cannot be deallocated until it gets dropped. We say that the pointee is "pinned".

This exact suggestion may be new, but it's extremely similar to a wide range of past suggestions which all boil down to "new/different borrow checker rules/reference types" which on close scrutiny don't enable anything fundamentally new, even if they sound like they should. https://users.rust-lang.org/t/alternative-to-mutability-restriction-in-single-threaded-contexts/40906 is a recent example of someone falling into a similar trap.
Unfortunately there's no easy way to discover this via searching, because most of them boil down to misunderstanding or oversimplifying how/why Rust works today, or not noticing some existing library solutions (like Pin). Case in point: IIUC the only way this &nmut could be sound and actually allow mutation is to essentially reinvent all of the "interior mutability" rules that & references already have (which is the point of kenny's thread question).

&nmut T is no different from &Cell<T>, and given that you can create references to a cell with Cell::from_mut, even if you haven't wrapped the pointee in a cell, there isn't really any benefit to &nmut T.

Thanks for the responses.  I was slow in responding because I wanted to make sure I took a the time to read and understand them and think about them.
I hope this example clarifies things.  Consider if you have a collection and you want to write the first element into the last element. Even though this example is only using a slice, please think of it as using some very complicated container data structure:
struct Person {
    name : String,
    age  : usize,
}

fn replace_first_with_last(party : &mut [Person]) {
    let last = & party[party.len() - 1];
    let first = &mut party[0];
    first.age = last.age;
}

Rust won't accept this code because it has both a &mut and a & (const) to the same variable.  Rust slices have 2 ways of getting around this problem.  The first would be to use indexes, as
fn replace_first_with_last2(party : &mut [Person]) {
    let n = party.len();
    let first = 0;
    let last = n - 1;
    party[first].age = party[last].age;
}

Here it is in effect encoding the 2 first/last references as 3 things:  1 reference to party and 2 codes (the indexes).  This is only feasible with arrays, if the collection was a Tree or a Graph then the codes would have to be entire stacks of indexes.  And worse, it bypasses Rust's compile time safety checks.  What if party instead owned its data instead of being a &mut, then after first and last are created, party shrinks the buffer, causing last to be in effect the encoding of a dangling pointer?  That is:
let mut party = some_vector();
let first = 0;
let last = party.len() - 1;
party.pop().pop().pop();
party[first].age = party[last].age;

Using encodings of references instead of actual references is fundamentally unsafe code, even though the compiler allows it.
The other alternative I'll mention because it is known is
fn replace_first_with_last3(party : &mut [Person]) {
    let (car, cdr) = party.split_at_mut(0);
    let first = &mut car[0];
    let last = & cdr[cdr.len() - 1];
    first.age = last.age;
}

The first problem is that this is just a hack that is available for slices.  It isn't something to expect a Graph or a Tree or a Queue some other complex container to support.  Furthermore it removes access to the original array party, so even later saying "what is the sum of the ages of the people in party" is no longer possible.
What I am proposing is:
fn replace_first_with_last4(length : usize) {
    let nmut party = (0 .. length).map(|e| person(e)).collect::<Box<[Person]>>();
    let first = &nmut party[0];
    let last  = &     party[party.len() - 1];
    first.age = last.age;
    //first.name = "replace".to_owned();  // this would be a compile error
}

(Changing party from a parameter to an owned variable to make the difference more distinct).  Because party is declared as nmut, resizing or reallocating it is not allowed because that could invalidate references.  Similarly first.name couldn't be changed because there could be an outstanding & reference to it's internal &str.  This I think is a necessary safety guaranteeing zero cost abstraction.  And it is much safer than users using unsafe code to bypass mutation or encodings to try to reinvent references.

What happens if b and c are sent to different threads?

As I specifically said in my original post, thread rules would have to be addressed by someone with specific knowledge of Rust's thread requirements, I don't want to comment on that.  Threads require atomic writes and attention being paid to write/read order, which is handled explicitly in single threads.  Worst case scenario is that you just wouldn't allow nmut to be passed between threads until the rules are determined, if ever.  Similar to how RC isn't allowed between threads.

Couldn't this be solved with Pin (https://doc.rust-lang.org/std/pin/index.html)?

I am not terribly familiar with Pins, but it appears 'no'.  First of all, what I am talking about is a compile time safety guarantee.  The examples for Pin all seem to require unsafe code to use it.
Anything that uses unsafe code or requires "don't just my API incorrectly" is not even in the ballpark of what I am proposing.
Second of all, pin doesn't actually guarantee that a write won't invalidate pointers does it?    I expect it either denies both, in which case it is overly restrictive just like &mut, or it allows both in which case it allows for dangling pointers.
What I'm proposing might make 'Pin' obsolete.  Rather than being a hint to the programmer "I intend to not move this" it actually enforces that no moves can be done period while an outstanding &nmut exists.

&nmut T is no different from &Cell<T>, and given that you can create references to a cell with Cell::from_mut, even if you haven't wrapped the pointee in a cell, there isn't really any benefit to &nmut T.

This is very different than a Cell.  First of all, Cell is only defined for Copy data.  Second, Cell panics at runtime, so it is definitely not safe to use.  Like I said above, what I am proposing is a zero cost abstraction compile time safety guarantee.
Third, the purpose of Cells is to represent "internal mutation", not external mutation.  For example, a cell could be used to cache the result of a function call.  Using a cell for external mutation is very bad coding style.  The purpose of cells is so that you can write
let a = Thing::new()
let b = Thing::new()
assert!(a == b)
println!("{}", a.f());
assert!(a == b)

...even f writes to some register of a that is wrapped in a Cell, such as a cache.  A call to f should not modify any call to eq().  It is incorrect to use a cell in a way that violates Leibniz Law https://en.wikipedia.org/wiki/Identity_of_indiscernibles .  That is what is meant by "internal" mutation.  My 2 cents, it is unkind to those who read code to use a Cell to just arbitrarily change a const to a mut for externally visible mutations, they should be alerted of that with unsafe so to make the violation of mutability rules explicit.
It is the purpose of nmuts to change data in a way that changes the effect on function calls on that data.  That is, external mutation.

This exact suggestion may be new, but it's extremely similar to a wide range of past suggestions for "new/different borrow checker rules/reference types" which on close scrutiny don't enable anything fundamentally new, even if they sound like they should. https://users.rust-lang.org/t/alternative-to-mutability-restriction-in-single-threaded-contexts/40906 is a recent example of someone falling into a similar trap.

I am pretty certain that what I am proposing is new in the sense of "does not exist in the compiler and cannot be emulated with crates".  But it probably isn't new in the sense of "I'm not the first person to realize this."  The person you linked to noticed the same problem I did, that Rust denies writes that don't invalidate pointers when it shouldn't.  I strongly dislike his proposal for fixing it, as you seem to also.

I are talking about is that the calling code and the implementing code can each be compiled completely independently of each other, using nothing but the function signature and whatever types/variables are in each scope.

I agree with most of this.  To be fair to that poster, while it is true that Rust only looks at the contract to called functions for verification, it is also true that Rust looks deep into functions to modify those contracts.  For example, in
fn print_this<'a>(x : &'a str) {
  prinln!("{}", x);
}

Rust will silently add a for <'a> to the function signature.  What is wrong with his proposal is that it was yet another hidden piece of meta information that the compiler tags to variables that we just have to hope it does right and a casual programmer can't possibly "see" what is happening if the compiler correctly or incorrectly disagrees with him.
What I am proposing is explicit, not inferred by the compiler.  If something is nmut, then only writes to Copy parts of it are allowed.  mut can be downgraded to nmut.  Multiple nmuts and consts references to a variable are no problem.  Etc.

Unfortunately there's no easy way to discover this via searching, because most of them boil down to misunderstanding or oversimplifying how/why Rust works today

This is entirely possible.  The Rust system is really complex and some gotcha might exist.

is to essentially reinvent all of the "interior mutability" rules that & references already have

The entire point of Rust, as advertised, is zero cost safety abstractions.  Not being able to implement an algorithm correctly because Rust's mutation rules are too strict is a huge cost.  Both in terms of time to make a work around and in terms of runtime to use that work around.
It is a fact that programmers are using unsafe code to violate rust's overly restrictive mutation rules.  Code that can panic is not safe code either.  I saw this video after I originally posted this:  https://www.youtube.com/watch?v=enLUX1TtNyE about Actix being split between the maintainer wanting to use unsafe blocks and contributers wanting to use pancking alternatives instead.  I haven't looked at the source code, but it is possible that more correct mutation rules could have avoided this fight.
I think this proposal would reduce a tremendous amount of unsafe and panicking code in Rust with straight forward shallow compile time checks.  And it is backwards compatible and can be implemented progressively.  Again thanks for comments.

Code that can panic is not safe code either

Let's get this out of the way first, Rust has a very specific definition of safe, programs must be "memory safe". Panicking cannot corrupt memory, so it is safe, even if it is not desirable, in the same way that leaking is undesirable, but cannot corrupt memory so it's safe (Box::leak is safe).

This is very different than a Cell. First of all, Cell is only defined for Copy data. Second, Cell panics at runtime, so it is definitely not safe to use. Like I said above, what I am proposing is a zero cost abstraction compile time safety guarantee.

Wrong on both counts, Cell can be used with any type, and none of Cell's methods panic. To use Cell with types that aren't Copy you can use Cell::replace. If you're type implements Default then you can also use Cell::take to extract the value from the Cell.

Like I said above, what I am proposing is a zero cost abstraction compile time safety guarantee.

Like Cell. Cell has exactly zero cost over not using Cell. It just prevents bad behavior at compile time by disallowing references to the wrapped value.

Third, the purpose of Cells is to represent "internal mutation", not external mutation. For example, a cell could be used to cache the result of a function call. Using a cell for external mutation is very bad coding style. The purpose of cells is so that you can write

The purpose of Cell (and anything built on top of UnsafeCell) is shared mutation, which is exactly what you are proposing. (what does "internal mutation" even mean? If you are referencing the term internal mutability, that's a pretty ill-defined term so I wouldn't touch it with a 10 foot pole).
There is nothing wrong with using Cell if you need shared mutability, it's just that you usually don't need shared mutability. (I think it would be helpful if you read Rust a Unique Perspective to better understand how Rust's references work)

What I am proposing is:
fn replace_first_with_last4(length : usize) {
    let nmut party = (0 .. length).map(|e| person(e)).collect::<Box<[Person]>>();
    let first = &nmut party[0];
    let last  = &     party[party.len() - 1];
    first.age = last.age;
    //first.name = "replace".to_owned();  // this would be a compile error
}

Why does the first.name = ... fail to compile? Also, what happens if length == 1.
then first and last would alias.

What I am proposing is explicit, not inferred by the compiler. If something is nmut, then only writes to Copy parts of it are allowed.

Ahh this is why, so this is more restrictive than &Cell<_>. Why not just use &Cell<_> then?

My 2 cents, it is unkind to those who read code to use a Cell to just arbitrarily change a const to a mut for externally visible mutations, they should be alerted of that with unsafe so to make the violation of mutability rules explicit.

This shows a fundemental misunderstanding of what references are in Rust. The mutability rules for references are just safe defaults. Nothing more than that. Yes, if you are using shared mutability through Cell or otherwise, you should make that known in the documentation, but that's not a reason to add a whole new reference type. &nmut doesn't fundamentally add anything new over the current situation.

Multiple nmuts and consts references to a variable are no problem. Etc.

So would this be fine?
let mut x = 0;
let nmut_x = &nmut x;
let const_x = &x;
*nmut_x = 1;
assert_eq!(*const_x, 0);

If not, why? And why are slices treated differently?

I agree with most of this. To be fair to that poster, while it is true that Rust only looks at the contract to called functions for verification, it is also true that Rust looks deep into functions to modify those contracts. For example, in

Nope, lifetime elision only looks at the function signature, not the function body. If you are only given the function signature, and the type definitions involved, you can figure out all elided lifetimes.

I am not terribly familiar with Pins, but it appears 'no'. First of all, what I am talking about is a compile time safety guarantee. The examples for Pin all seem to require unsafe code to use it.
Anything that uses unsafe code or requires "safe as long as you just don't use my API incorrectly" is not even in the ballpark of what I am proposing.
Second of all, pin doesn't actually guarantee that a write won't invalidate pointers does it?  I expect it either denies both, in which case it is overly restrictive just like &mut, or it allows both in which case it allows for dangling pointers.

I agree with you here, Pin seems to have different goals than &nmut. Pin is about guaranteed immovability, wheresas &nmut is about shared mutation.

about Actix being split between the maintainer wanting to use unsafe blocks and contributors wanting to use panicking alternatives instead.

That's off topic, because Actix had a number of different reasons for using unsafe blocks, and many of them would not have been changed by adding a &nmut.

I started reading your response and got to this point:

Because party is declared as nmut, resizing or reallocating it is not allowed because that could invalidate references.

These concepts don't exist to the compiler. One of your motivations for this feature was to make it easier to work with more complex and user-defined types (ie. not just slices) but there's no way for the compiler to know what "resizing" means to a BTreeMap.
You can implement the Index however you want, and that could include invalidating references.
Also, as others have said, what you are trying to achieve is already possible by using interior mutability, eg. the Cell type.

For completeness, your example written with Cell:
use std::cell::Cell;

struct Person {
    name: String,
    age: Cell<usize>,
}

fn replace_first_with_last(party: &[Person]) {
    if let (Some(f), Some(l)) = (party.first(), party.last()) {
        f.age.set(l.age.get())
    }
}

For completeness, your example written with Cell:

Here is why I disagree with this suggestion:
(1) This requires being the maintainer of the crate defining the Person struture to change age from usize to Cell<usize>.  That is often not the case.  nmut doesn't have this restriction.
(2) Now it impossible to have a constant version of Person anywhere.  In order to understand code, you'd have to look into the body of every single function that uses Person to see if it is mutated.  This version of replace_first_with_last is an example of a "secret" modification of a & variable.  Below I talk about how nmut rules can be chosen to deny these secret modifications.
(3) This violates the Open-Closed Principle.    Sometimes violating O-C is unavoidable, but here it is completely avoidable with nmut and the need for mutable references is far too common for a language to force you to violate O-C.

To use Cell with types that aren't Copy you can use Cell::replace

Replace with what?  into_inner requires ownership, take requires Default (and if you used it for something like a BTree it would at least temporarily invalidate the tree) and rewrites the entire data structure when possibly only a single small modification was needed, and get requires Copy.  The nightly function update looks promising, but that only lets you rebuild the Cell in terms of itself.  So for the example, even update wouldn't allow you to replace the first age with the last age.

This is very different than a Cell. First of all, Cell is only defined for Copy data. Second, Cell panics at runtime, so it is definitely not safe to use.

Wrong on both counts, Cell can be used with any type, and none of Cell's methods panic.

My memory of where the Copy requirement is in Cell was off, but my point was correct.  To get a reference to cell data it has to be Copy, and to do so with RefCell requires a panic check specifically to prevent multiple references.

Why not just use &Cell<_> then?

Can you implement my example in a way that doesn't take advantage of the specific type (not Copy, not Default, not owned, not one that you are the maintainer of) ?

Why does the first.name = ... fail to compile?

Because name is a std::string::String which does not implement Copy.

I started reading your response and got to this point:

Because party is declared as nmut, resizing or reallocating it is not allowed because that could invalidate references.

These concepts don't exist to the compiler. One of your motivations for this feature was to make it easier to work with more complex and user-defined types (ie. not just slices) but there's no way for the compiler to know what "resizing" means to a BTreeMap.

Depends on if you are using unsafe blocks or not.
If you are not using unsafe blocks, then the compiler can easily enforce that only Copy parts of an nmut (or &nmut) are written to.  And that is how the compiler would know whether you are doing something that could invalidate a pointer, such as resizing.  All compile time verification works like this: if all the parts are verified, then the composition of the parts are verified.  I'm not suggesting anything different.  Example:  if someone tried to implement a linked list using only safe code, and tried to implement List<T>::push(&nmut self, new : T) it would be compile-time impossible because at some point push would have to modify a non Copy value like a Box.  But List<T>::index_nmut(&nmut self, index : usize) -> &nmut T would allow you to get as many in-place-writable references to the nth-data as you want, no compiler restriction.
For unsafe code blocks, they'd have to be careful around nmuts.  It would be possible to write unsafe code that would break nmut rules; for example, because Vec::pop only needs to modify a Copy part of the vector (decrementing the length), it would be possible to define it as Vec::pop(&nmut self), but that would be mistake in the API not catchable by the compiler.  And it is only possible because of the unsafe blocks Vec uses to operate on its buffer.
I'm not suggesting something the compiler couldn't do, to the best of my knowledge.

The purpose of Cell

From the docs

In this example, you can see that Cell<T> enables mutation inside an immutable struct. In other words, it enables "interior mutability".

And all the examples are of interior mutability, like cache and the counters in RC.  Formally, interior mutation refers to a write that doesn't change the output of functions satisfying the Indiscernibility of the Identity.  Informally, it means you could have implemented the function without doing a mutation, but for whatever reason (optimization) you do otherwise.
Maybe Cell was intended from the start to be a way to a way to share mutable pointers.  The std::cell docs suggest maybe so.  But I think that a library that lets you modify the target of a & is something that should only be used when that modification is of no functional consequence (interior mutation), and that using it as a substitute for &mut is, in my opinion, kinda stinky.  Technically works in some cases but not pretty when it does.

So would this be fine?
let mut x = 0;
let nmut_x = &nmut x;
let const_x = &x;
*nmut_x = 1;
assert_eq!(*const_x, 0);

Well in the first line you'd have to declare x as let nmut x = 0;, so that the second line wouldn't hide x from the third line.
But I think your main point was aliasing, and it is a good point.  What I said before didn't explicitly deny having both a & and a &nmut to the same data, but that is something that could be done the same way it is done for &mut.
This allows for shared references using &nmut that still enforces the "& doesn't change" rule.  Which is something that Cell does not do: when cells are introduced to a type, you can no longer trust that & are constant.  And that is fundamentally new, and a major help for code readibility.

(I think it would be helpful if you read Rust a Unique Perspective

Hmm, what he says about optimization, I've specifically heard a contradictory claim from someone at a Rust Conf speaking on that subject.  I myself don't know who is right, and it is definitely important; I think I'll open a stack exchange question on it as it is a bit off topic of this discussion.

Let's get this out of the way first, Rust has a very specific definition of safe, programs must be "memory safe". Panicking cannot corrupt memory, so it is safe, even if it is not desirable, in the same way that leaking is undesirable, but cannot corrupt memory so it's safe (Box::leak is safe).

That is the standard that is used when defining whether a library function is tagged as unsafe.
Rust has a lot of great features, but it has exactly 1 feature that makes it worth being a new language.  That is the compile time verified reference system.  It verifies, for code that doesn't use unsafe, that references are not pointing to invalid data, not double freed, and not leaked with no runtime overhead.  And it does that without invaliding the entire program, e.g. panicing.  That is why Rust, the language itself, can be advertised as safer than C/C++.  The compiler's verifier doesn't verify other things (like array indexing or unsafe blocks), which is why library functions have to allow panicing code to be labeled safe, otherwise almost every library function would be labeled unsafe.
But one of the sacrifices made to obtain those claims is that only 1 reference at a time has rights to mutate.  I think allowing another kind of reference, one that allows for multiple mutating references to the same data but can only modify Copy data is a natural improvement.

(1) This requires being the maintainer of the crate defining the Person struture to change age from usize to Cell. That is often not the case. nmut doesn't have this restriction.

Not necessarily, you can convert a &mut T to a &Cell<T> using Cell::from_mut. This way you can temporarily share references as needed, but you function still needs to be marked &mut. Yes, if you want shared mutability across multiple functions, then you will need to change the type, but that's nothing new. That just means that your type requires shared access, so you design should reflect that.
In any case, adding a new reference type is a huge change, and there doesn't seem to be enough motivation to justify this change.
On a separate note: if &Cell<T> allowed for field projection, we could write something like this:
use std::cell::Cell;

struct Person {
    name: String,
    age: usize,
}

fn replace_first_with_last(party: &mut [Person]) {
    let party = Cell::from_mut(party).as_slice_of_cells();
    if let (Some(f), Some(l)) = (party.first(), party.last()) {
        // imaginary Cell::project
        Cell::project(f, Person.age).set(Cell::project(l, Person.age).get())
    }
}

Which wouldn't be too bad. I guess there could be sugar on top of this to make it nicer.
Right now the best we can do is some tricky unsafe code with the nightly feature raw_ref_op
#![feature(raw_ref_op)]

use std::cell::Cell;

struct Person {
    name: String,
    age: usize,
}

impl Person {
    fn age_nmut(this: &Cell<Self>) -> &Cell<usize> {
        unsafe { &*((&raw (*this.as_ptr()).age) as *const Cell<usize>) }
    }
}

fn replace_first_with_last(party: &mut [Person]) {
    let party = Cell::from_mut(party).as_slice_of_cells();
    if let (Some(f), Some(l)) = (party.first(), party.last()) {
    Person::age_nmut(f).set(Person::age_nmut(l).get());
    }
}

Given this, I don't see how &nmut T is fundamentally different from &Cell<T>.

I released a crate cell-project that exposes a safe interface for this pattern.
use std::cell::Cell;
use cell_project::cell_project as cp;

struct Person {
    name: String,
    age: usize,
}

fn replace_first_with_last(party: &mut [Person]) {
    let party = Cell::from_mut(party).as_slice_of_cells();
    if let (Some(f), Some(l)) = (party.first(), party.last()) {
        cp!(Person, f.age).set(cp!(Person, l.age).get());
    }
}

You can use extension traits to make this ergonomic
pub trait PersonExt {
    fn age_nmut(&self) -> &Cell<usize>;
}

impl PersonExt for Cell<Person> {
    fn age_nmut(&self) -> &Cell<usize> {
        project!(Person, self.age)
    }
}

fn replace_first_with_last(party: &mut [Person]) {
    let party = Cell::from_mut(party).as_slice_of_cells();
    if let (Some(f), Some(l)) = (party.first(), party.last()) {
        f.age_nmut().set(l.age_nmut().get());
    }
}

I'm going to close this because, as was mentioned above,

adding a new reference type is a huge change

Lang absolutely expects that new things will be done with library types if at all possible -- see Pin, for example.  Feel free to open something new if you have a situation that cannot be handled that way.

(closing because this didn't actually get closed 8 days ago)


Is it possible to use node --inspect with sails console?

Is there a way to run sails console with the native node debugger (node --inspect)?

@alxndrsn Yes, Sails actually has its own similar sails inspect but it's also compatible with the standard node inspect as well.

@johnabrams7 I'm aware of sails inspect, but can it be used at the same time as sails console?

Aha, got it:
node --inspect $(which sails) console


modifier keys+shift inserts  or  into buffer

How to reproduce: be in normal mode, mash any combination of ctrl, alt, super, and shift and odd text gets inserted into the current buffer similar to https://github.com/onivim/oni2/issues/360

Looks like ctrl changes what is inserted, but this only happens if some combination of super and or alt is included in the action

On insert mode, pressing $mod+shift inserts <D-SHIFT>. (It only inserts HIFT> on normal mode).
I am running the packaged AppImage of Oni2 on Archlinux using i3 as window manager, and the "mod" key refers to the "windows" key on my keyboard.
Let me know if you need any extra info to reproduce.

I opened a PR here to fix this, if you can build from git you can check if it works :)
https://github.com/onivim/oni2/pull/637


failing to computer the log_{base} of a number

Salutations!
it seems that anytime I try to use 'gulp run' I get this error:
C:\Users\17clinen\Desktop\agar.io-clone-master\agar.io-clone>gulp run
[12:30:02] Using gulpfile ~\Desktop\agar.io-clone-master\agar.io-clone\gulpfile.
js
[12:30:02] Starting 'lint'...
[12:30:02] Starting 'move-client'...
[12:30:03] Finished 'lint' after 935 ms
[12:30:03] Starting 'build-server'...
[12:30:03] Starting 'test'...
[12:30:03] Finished 'test' after 2.03 ms
[12:30:03] Starting 'todo'...
[12:30:03] Finished 'todo' after 2.01 ms
util.js
#massToRadius
√ should return non-zero radius on zero input
√ should convert masses to a circle radius
#validNick
√ should allow empty player nicknames
[12:30:03] Finished 'build-server' after 276 ms
√ should allow ascii character nicknames
√ should disallow unicode-dependent alphabets
√ should disallow spaces in nicknames
#log
1) should compute the log_{base} of a number
#getDistance
√ should return a positive number
7 passing (35ms)
1 failing

util.js #log should compute the log_{base} of a number:
AssertionError: expected 2.0000000000000004 to deeply equal 2

expected - actual

-2.0000000000000004
+2
at Context. (C:\Users\17clinen\Desktop\agar.io-clone-master\aga
r.io-clone\test\util.js:86:31)
at callFn (C:\Users\17clinen\Desktop\agar.io-clone-master\agar.io-clone\no
de_modules\mocha\lib\runnable.js:326:21)
at Test.Runnable.run (C:\Users\17clinen\Desktop\agar.io-clone-master\agar.
io-clone\node_modules\mocha\lib\runnable.js:319:7)
at Runner.runTest (C:\Users\17clinen\Desktop\agar.io-clone-master\agar.io-
clone\node_modules\mocha\lib\runner.js:422:10)
at C:\Users\17clinen\Desktop\agar.io-clone-master\agar.io-clone\node_modul
es\mocha\lib\runner.js:528:12
at next (C:\Users\17clinen\Desktop\agar.io-clone-master\agar.io-clone\node
_modules\mocha\lib\runner.js:342:14)
at C:\Users\17clinen\Desktop\agar.io-clone-master\agar.io-clone\node_modul
es\mocha\lib\runner.js:352:7
at next (C:\Users\17clinen\Desktop\agar.io-clone-master\agar.io-clone\node
_modules\mocha\lib\runner.js:284:14)
at Immediate. (C:\Users\17clinen\Desktop\agar.io-clone-master\a
gar.io-clone\node_modules\mocha\lib\runner.js:320:5)

events.js:160
throw er; // Unhandled 'error' event
^
Error: 1 test failed.
Can anyone help? I can't seem to find a solution.
-Cheers
Noah C

Hi Noah,
There seems to be a precision problem in src/server/lib/util.js in the log method.
For now I've used this to round the numbers up to 5 decimal points and be able to run the project:
// overwrite Math.log function
exports.log = (function () {
var log = Math.log;
return function (n, base) {
var rough = log(n) / (base ? log(base) : 1);
return (Math.round(rough * 1e5) / 1e5);
};
})();
However I think a real solution should be proposed to take place.

Ran into same problem

Ran into the same issue also. Do we have something in common? I'm running on an ARM chipset.

Thinkpad X240 on an 64bit arch distro here and I have the same problem. Good to see the jokes about rounding errors kept in high regard ;)

[Intel Core i5-6200U on 64bit arch]
I have the same problem, and Roeefl's solution worked.
(But not sure if this would trigger any another problems)


ball speed is tied to refresh rate

is there a way to make the ball slower on higher refresh rate? ball jumps like crazy
pets speed are working fine though

I am having the same problem - I have a high refresh rate monitor and the ball zooms around the screen ridiculously fast compared to a lower refresh rate monitor

https://github.com/tonybaloney/vscode-pets/blob/master/src/panel/main.ts#L222-L225
According to MDN, regular refresh rates will be 60fps (so the pre-programming velocity calculation is correct), but for higher rates this increases.
There isn't anything in the code to do this right now, https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame

Hi, I experienced this issue as well and I unfortunately don't have the time to contribute with a pull request right now, but I can help with an insight.
If you want to normalize the velocity of an object between different monitor refresh rates, the trick is to tie the velocity to the difference in real time between frames:
let previousFrameTime;
let id;

function animate(currentFrameTime) {
  id = requestAnimationFrame(animate);

  // Math.min is used here to prevent the time difference being too large in case the user
  // switches to another window for some time and then returns back to it
  const differenceInTime = Math.min(1000, currentFrameTime - previousFrameTime);

  // convert to seconds (it just makes calculations more convenient)
  const deltaTime = differenceInTime / 1000;

  // move the ball by { x, y } velocity per second
  ball.position.x += ball.velocity.x * deltaTime;
  ball.position.y += ball.velocity.y * deltaTime;

  // draw the ball here

  previousFrameTime = currentFrameTime;
}

function startAnimating() {
  previousFrameTime = performance.now();
  animate(previousFrameTime);
}

function stopAnimating() {
  cancelAnimationFrame(id);
}

The Math.min trick above is enough to prevent things like the ball clipping through boundary checks with large enough time difference, but a more accurate approach is to use an iteration loop that breaks down large time differences into multiple fixed time updates per frame:
let timeStep = 1 / 60; // update at 60 frames per second
let accumulatedLag = 0;
let previousFrameTime;
let id;

function animate(currentFrameTime) {
  id = requestAnimationFrame(animate);

  const differenceInTime = Math.min(1000, currentFrameTime - previousFrameTime);

  const deltaTime = differenceInTime / 1000;

  // keep track of how much time has elapsed so that any lagged time carries over
  accumulatedLag += deltaTime;

  // this results in 0->n updates per frame, depending on how
  // much the simulation has lagged behind
  while (accumulatedLag >= timeStep) {
    accumulatedLag -= timeStep;

    ball.position.x += ball.velocity.x * timeStep;
    ball.position.y += ball.velocity.y * timeStep;
  }

  // draw the ball here

  previousFrameTime = currentFrameTime;
}

function startAnimating() {
  previousFrameTime = performance.now();
  animate(previousFrameTime);
}

function stopAnimating() {
  cancelAnimationFrame(id);
}

In the game dev world, this is known as a "Fixed Timestep". It's really only useful for physics and collisions and it does sometimes cause jitter, which means the logic has to keep track of oldPosition and the drawing code needs to interpolate between the oldPosition and the current position to smooth the jitter out.
I think vscode-pets is simple enough to get away with just the Math.min trick and doesn't need a Fixed Timestep - though the number passed to Math.min may need a few minutes of trial/error tweaking to get a satisfactory result. I just figured I'd include a demonstration of a Fixed Timestep loop as it's a logical next step if this project ever grows to the point of needing it.

Was fixed in #167


Building task with output named anything but "image" fails at exporting the built tarball.

This works:
      - task:       build-base
        privileged: true
        config:
          platform: linux
          image_resource:
            type: registry-image
            source:
              repository: vito/oci-build-task

          params:
            TARGET:                  main
            CONTEXT: .
            DOCKERFILE:              git-resource/base_images/debian-base/Dockerfile
            BUILD_ARG_APT_CACHE_URL: http://<IP_ADDRESS>:3142
            BUILD_ARG_ROOTFS_FILE:   ./built_roots/base/rootfs.tar

          inputs:
            - name: git-resource
            - name: built_roots

          outputs:
            - name: image

          run:
            path: build

Output:
#2 [internal] load .dockerignore
#2 DONE 0.0s

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 489B done
#1 DONE 1.6s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 2.6s

#3 [internal] load build context
#3 transferring context: 119.25MB 0.8s done
#3 DONE 1.8s

#4 [build 1/2] ADD ./built_roots/base/rootfs.tar /
#4 DONE 2.9s

#5 [build 2/2] RUN printf "Acquire::http { Proxy "%s"; }; " "http://10.10.1...
#5 1.125 Get:1 http://deb.debian.org/debian buster InRelease [121 kB]
#5 1.126 Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
#5 1.134 Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
#5 1.221 Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [266 kB]
#5 1.307 Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
#5 1.402 Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [7848 B]
#5 2.184 Fetched 8420 kB in 1s (7886 kB/s)
#5 2.184 Reading package lists...
#5 2.612
#5 2.612 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#5 2.612
#5 2.620 Reading package lists...
#5 3.040 Building dependency tree...
#5 3.130 Reading state information...
#5 3.208 The following additional packages will be installed:
#5 3.208   libssl1.1 openssl
#5 3.222 The following NEW packages will be installed:
#5 3.222   ca-certificates dumb-init libssl1.1 openssl
#5 3.238 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
#5 3.238 Need to get 2560 kB of archives.
#5 3.238 After this operation, 6115 kB of additional disk space will be used.
#5 3.238 Get:1 http://security.debian.org/debian-security buster/updates/main amd64 libssl1.1 amd64 1.1.1d-0+deb10u4 [1538 kB]
#5 3.238 Get:2 http://deb.debian.org/debian buster-updates/main amd64 ca-certificates all 20200601~deb10u2 [166 kB]
#5 3.240 Get:3 http://deb.debian.org/debian buster/main amd64 dumb-init amd64 1.2.2-1.1 [13.6 kB]
#5 3.250 Get:4 http://security.debian.org/debian-security buster/updates/main amd64 openssl amd64 1.1.1d-0+deb10u4 [843 kB]
#5 4.093 debconf: delaying package configuration, since apt-utils is not installed
#5 4.111 Fetched 2560 kB in 0s (120 MB/s)
#5 4.759 Selecting previously unselected package libssl1.1:amd64.
(Reading database ... 6677 files and directories currently installed.)
#5 4.769 Preparing to unpack .../libssl1.1_1.1.1d-0+deb10u4_amd64.deb ...
#5 5.042 Unpacking libssl1.1:amd64 (1.1.1d-0+deb10u4) ...
#5 5.842 Selecting previously unselected package openssl.
#5 5.844 Preparing to unpack .../openssl_1.1.1d-0+deb10u4_amd64.deb ...
#5 5.933 Unpacking openssl (1.1.1d-0+deb10u4) ...
#5 6.975 Selecting previously unselected package ca-certificates.
#5 6.977 Preparing to unpack .../ca-certificates_20200601~deb10u2_all.deb ...
#5 7.058 Unpacking ca-certificates (20200601~deb10u2) ...
#5 8.117 Selecting previously unselected package dumb-init.
#5 8.119 Preparing to unpack .../dumb-init_1.2.2-1.1_amd64.deb ...
#5 8.183 Unpacking dumb-init (1.2.2-1.1) ...
#5 9.015 Setting up dumb-init (1.2.2-1.1) ...
#5 9.508 Setting up libssl1.1:amd64 (1.1.1d-0+deb10u4) ...
#5 10.26 debconf: unable to initialize frontend: Dialog
#5 10.26 debconf: (TERM is not set, so the dialog frontend is not usable.)
#5 10.26 debconf: falling back to frontend: Readline
#5 10.26 debconf: unable to initialize frontend: Readline
#5 10.26 debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
#5 10.26 debconf: falling back to frontend: Teletype
#5 11.55 Setting up openssl (1.1.1d-0+deb10u4) ...
#5 12.47 Setting up ca-certificates (20200601~deb10u2) ...
#5 12.85 debconf: unable to initialize frontend: Dialog
#5 12.85 debconf: (TERM is not set, so the dialog frontend is not usable.)
#5 12.85 debconf: falling back to frontend: Readline
#5 12.85 debconf: unable to initialize frontend: Readline
#5 12.85 debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
#5 12.85 debconf: falling back to frontend: Teletype
#5 13.14 Updating certificates in /etc/ssl/certs...
#5 13.59 137 added, 0 removed; done.
#5 14.53 Processing triggers for libc-bin (2.28-10) ...
#5 14.91 Processing triggers for ca-certificates (20200601~deb10u2) ...
#5 15.14 Updating certificates in /etc/ssl/certs...
#5 15.51 0 added, 0 removed; done.
#5 15.51 Running hooks in /etc/ca-certificates/update.d...
#5 15.51 done.
#5 15.86 Reading package lists...
#5 16.29 Building dependency tree...
#5 16.40 Reading state information...
#5 16.50 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#5 DONE 17.4s

#6 [main 1/1] COPY --from=build / /
#6 DONE 3.2s

#7 exporting to oci image format
#7 exporting layers
#7 exporting layers 8.4s done
#7 exporting manifest sha256:79c0e05d1dc08376d0272c8a6e6370b6535644b2a1e5795c74769ce4a20c4d70
#7 exporting manifest sha256:79c0e05d1dc08376d0272c8a6e6370b6535644b2a1e5795c74769ce4a20c4d70 0.7s done
#7 exporting config sha256:87c8335f99eab45b7282223a29e2c9b2966510aad198916c782033842bbc33b4
#7 exporting config sha256:87c8335f99eab45b7282223a29e2c9b2966510aad198916c782033842bbc33b4 1.1s done
#7 sending tarball
#7 sending tarball 0.3s done
#7 DONE 11.8s

This does not:
      - task:       build-base
        privileged: true
        config:
          platform: linux
          image_resource:
            type: registry-image
            source:
              repository: vito/oci-build-task

          params:
            TARGET:                  main
            CONTEXT: .
            DOCKERFILE:              git-resource/base_images/debian-base/Dockerfile
            BUILD_ARG_APT_CACHE_URL: http://<IP_ADDRESS>:3142
            BUILD_ARG_ROOTFS_FILE:   ./built_roots/base/rootfs.tar

          inputs:
            - name: git-resource
            - name: built_roots

          outputs:
            - name: image_base

          run:
            path: build

Output:
selected worker: work-01
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 ...

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 489B done
#1 DONE 1.7s

#2 [internal] load .dockerignore
#2 DONE 2.3s

#3 [internal] load build context
#3 transferring context: 119.25MB 0.7s done
#3 DONE 3.7s

#4 [build 1/2] ADD ./built_roots/base/rootfs.tar /
#4 DONE 2.7s

#5 [build 2/2] RUN printf "Acquire::http { Proxy "%s"; }; " "http://10.10.1...
#5 1.128 Get:1 http://deb.debian.org/debian buster InRelease [121 kB]
#5 1.130 Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
#5 1.139 Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
#5 1.236 Get:4 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
#5 1.333 Get:5 http://deb.debian.org/debian buster-updates/main amd64 Packages [7848 B]
#5 1.401 Get:6 http://security.debian.org/debian-security buster/updates/main amd64 Packages [266 kB]
#5 2.159 Fetched 8420 kB in 1s (8093 kB/s)
#5 2.159 Reading package lists...
#5 2.580
#5 2.580 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#5 2.580
#5 2.587 Reading package lists...
#5 3.013 Building dependency tree...
#5 3.104 Reading state information...
#5 3.178 The following additional packages will be installed:
#5 3.178   libssl1.1 openssl
#5 3.195 The following NEW packages will be installed:
#5 3.196   ca-certificates dumb-init libssl1.1 openssl
#5 3.215 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
#5 3.215 Need to get 2560 kB of archives.
#5 3.215 After this operation, 6115 kB of additional disk space will be used.
#5 3.215 Get:1 http://security.debian.org/debian-security buster/updates/main amd64 libssl1.1 amd64 1.1.1d-0+deb10u4 [1538 kB]
#5 3.215 Get:2 http://deb.debian.org/debian buster-updates/main amd64 ca-certificates all 20200601~deb10u2 [166 kB]
#5 3.216 Get:3 http://deb.debian.org/debian buster/main amd64 dumb-init amd64 1.2.2-1.1 [13.6 kB]
#5 3.230 Get:4 http://security.debian.org/debian-security buster/updates/main amd64 openssl amd64 1.1.1d-0+deb10u4 [843 kB]
#5 3.762 debconf: delaying package configuration, since apt-utils is not installed
#5 3.779 Fetched 2560 kB in 0s (116 MB/s)
#5 4.173 Selecting previously unselected package libssl1.1:amd64.
(Reading database ... 6677 files and directories currently installed.)
#5 4.183 Preparing to unpack .../libssl1.1_1.1.1d-0+deb10u4_amd64.deb ...
#5 4.557 Unpacking libssl1.1:amd64 (1.1.1d-0+deb10u4) ...
#5 5.724 Selecting previously unselected package openssl.
#5 5.726 Preparing to unpack .../openssl_1.1.1d-0+deb10u4_amd64.deb ...
#5 5.898 Unpacking openssl (1.1.1d-0+deb10u4) ...
#5 7.835 Selecting previously unselected package ca-certificates.
#5 7.835 Preparing to unpack .../ca-certificates_20200601~deb10u2_all.deb ...
#5 8.057 Unpacking ca-certificates (20200601~deb10u2) ...
#5 9.442 Selecting previously unselected package dumb-init.
#5 9.446 Preparing to unpack .../dumb-init_1.2.2-1.1_amd64.deb ...
#5 9.542 Unpacking dumb-init (1.2.2-1.1) ...
#5 10.45 Setting up dumb-init (1.2.2-1.1) ...
#5 11.02 Setting up libssl1.1:amd64 (1.1.1d-0+deb10u4) ...
#5 11.51 debconf: unable to initialize frontend: Dialog
#5 11.51 debconf: (TERM is not set, so the dialog frontend is not usable.)
#5 11.51 debconf: falling back to frontend: Readline
#5 11.51 debconf: unable to initialize frontend: Readline
#5 11.51 debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
#5 11.51 debconf: falling back to frontend: Teletype
#5 12.41 Setting up openssl (1.1.1d-0+deb10u4) ...
#5 13.31 Setting up ca-certificates (20200601~deb10u2) ...
#5 13.53 debconf: unable to initialize frontend: Dialog
#5 13.53 debconf: (TERM is not set, so the dialog frontend is not usable.)
#5 13.53 debconf: falling back to frontend: Readline
#5 13.53 debconf: unable to initialize frontend: Readline
#5 13.53 debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
#5 13.53 debconf: falling back to frontend: Teletype
#5 13.82 Updating certificates in /etc/ssl/certs...
#5 14.28 137 added, 0 removed; done.
#5 15.08 Processing triggers for libc-bin (2.28-10) ...
#5 15.54 Processing triggers for ca-certificates (20200601~deb10u2) ...
#5 15.76 Updating certificates in /etc/ssl/certs...
#5 16.15 0 added, 0 removed; done.
#5 16.15 Running hooks in /etc/ca-certificates/update.d...
#5 16.15 done.
#5 16.60 Reading package lists...
#5 17.03 Building dependency tree...
#5 17.12 Reading state information...
#5 17.21 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#5 DONE 18.5s

#6 [main 1/1] COPY --from=build / /
#6 DONE 3.0s

TL;DR:
Changing outputs from:
          outputs:
            - name: image

to
          outputs:
            - name: image_base

results in no execution of the "exporting to oci image format" step

changing output to this:
          outputs:
            - name: image/image_base
              path: image

Makes it actually output the data to the expected folders.
The other variants result in no output to the folders, no digest, no tarball.

I am facing the same question

This will limit the number of oci-build-tasks we can run in a job. If we also want to do two puts, we have to di it in two separate jobs...

FWIW you can always use output_mapping at the step level to rename the output.
It would look something like
- task: build-base
    privileged: true
    config:
            ...
    output_mapping:
        image: some-other-name

There's also a RFC trying to address the interface for input/output of prototypes (aka reusable tasks like this one).

FWIW you can always use output_mapping at the step level to rename the output.
It would look something like
- task: build-base
    privileged: true
    config:
            ...
    output_mapping:
        image: some-other-name

thank you very much. Your comment solved my problem

Chiming in late, but output_mapping is the expected approach. I've updated the README to mention it more clearly. PRs for further clarity welcome!


feat(3208): Stats of the whole Basilisk marketplace

Thank you for your contribution to the KodaDot NFT gallery.
👇 _ Let's make a quick check before the contribution.
PR type

[ ] Bugfix
[x] Feature
[ ] Refactoring

What's new?

[x] PR closes #3208, closes #3255
[x] Requires deployment of new snekk @vikiival
[x] New screen for stats about BSX marketplace

Before submitting Pull Request, please make sure:

[x] My contribution builds clean without any errors or warnings
[x] I've merged recent default branch -- main and I've no conflicts
[x] I've tried to respect high code quality standards
[x] I've didn't break any original functionality
[x] I've posted a screenshot of demonstrated change in this PR

Optional

[ ] I've tested it at </rmrk/collection/26902bc2f7c20c546a-1FVG7>
[ ] I've tested PR on mobile and everything seems works
[ ] I found edge cases
[ ] I've written some unit tests 🧪

Had issue bounty label?

[ ] Fill up your KSM address: Payout

Community participation

[x] Are you at KodaDot Discord?

Screenshot

[x] My fix has changed something on UI; a screenshot is best to understand changes for others.

What i would do is
export function countOf(value: SomethingWithCount) {
  return value.count || value.totalCount
}

then in vue you can use
this.buys = countOf(buys)

Let's add one more column with relative time

Link to NFT
Let's rename it to "Item"

Let's add one more column with relative time, like we have in history

added relative time, not the same way as history, since history relative time is currently broken on BSX

#3280

Let's rename it to "Item"\

done


Remove tools dependencies

This pull request changes the Gopkg.toml file so that dep will not scan the
tools directory for dependencies. This has the positive effect of
removing from the vendor directory all the dependencies of those
tools, which aren't really dependencies of this project.

@ironcladlou, @moolitayer this is an attempt to address #15. Adding the ignored parameter to the Gopkg.toml file does make dep ignore the tools directory, so that the dependencies aren't added, as @ironcladlou suggested.
If I then revert the change that I used to remove the *_test.go files of the tools directory:
git revert 09e5d167ccdfe6636f4fd9280475d025a60f5fb3

Then make works correctly, but make check still tries to build those tests, and fails:
tools/junitreport/pkg/builder/flat/test_suites_builder.go:4:2: cannot find package "github.com/openshift/origin/tools/junitreport/pkg/api" in any of:
	/files/projects/openshift/autoheal/_output/local/go/src/github.com/openshift/autoheal/vendor/github.com/openshift/origin/tools/junitreport/pkg/api (vendor tree)
	/usr/lib/golang/src/github.com/openshift/origin/tools/junitreport/pkg/api (from $GOROOT)
	/files/projects/openshift/autoheal/_output/local/go/src/github.com/openshift/origin/tools/junitreport/pkg/api (from $GOPATH)

Any suggestion?


Pex fails when used in conjunction with Pytorch

The following code:
import torch
import torch.utils.data

class Test(torch.utils.data.Dataset):
    def __len__(self):
        return 10

    def __getitem__(self, idx):
        return torch.randn(5, 5)

if __name__ == '__main__':
  n_workers = 4
  data = Test()
  train_loader = torch.utils.data.DataLoader(data, batch_size=2, num_workers=n_workers)

  for item in train_loader:
    print(item)
    break

Runs fine with a python interpreter with pytorch and numpy installed:
$ python test.py

(0 ,.,.) =
 -0.4520 -1.2118  0.3244  0.7276 -0.8220
  1.9171  0.9921  0.5206  0.2886 -0.3736
  1.3648  1.0917  0.1983  0.0402 -1.2338
  0.3155 -0.6425  0.3849 -0.4376  1.2371
  0.5352 -0.3482  1.4171  0.4569 -0.3687

(1 ,.,.) =
  0.1180 -1.0528  0.6809  0.2318 -2.2028
  0.1399  0.5150 -0.5507 -0.7639 -0.8540
  1.9070  0.8260  0.8660 -0.1029 -0.1823
 -2.3825 -2.0044  1.1457 -0.9469 -0.4882
 -0.3794  0.6706 -0.8183 -0.4942 -1.7503
[torch.FloatTensor of size 2x5x5]

But fails with pex:
$ pex torch numpy -- test.py
Traceback (most recent call last):
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.bootstrap/_pex/pex.py", line 367, in execute
    self._wrap_coverage(self._wrap_profiling, self._execute)
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.bootstrap/_pex/pex.py", line 293, in _wrap_coverage
    runner(*args)
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.bootstrap/_pex/pex.py", line 325, in _wrap_profiling
    runner(*args)
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.bootstrap/_pex/pex.py", line 413, in _execute
    return self.execute_interpreter()
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.bootstrap/_pex/pex.py", line 423, in execute_interpreter
    self.execute_content(name, content)
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.bootstrap/_pex/pex.py", line 453, in execute_content
    exec_function(ast, globals())
  File "<exec_function>", line 4, in exec_function
  File "test_dl.py", line 18, in <module>
    for item in train_loader:
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.deps/torch-0.4.0-cp27-none-macosx_10_6_x86_64.whl/torch/utils/data/dataloader.py", line 286, in __next__
    return self._process_next_batch(batch)
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.deps/torch-0.4.0-cp27-none-macosx_10_6_x86_64.whl/torch/utils/data/dataloader.py", line 307, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.deps/torch-0.4.0-cp27-none-macosx_10_6_x86_64.whl/torch/utils/data/dataloader.py", line 57, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.deps/torch-0.4.0-cp27-none-macosx_10_6_x86_64.whl/torch/utils/data/dataloader.py", line 113, in default_collate
    storage = batch[0].storage()._new_shared(numel)
  File "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.deps/torch-0.4.0-cp27-none-macosx_10_6_x86_64.whl/torch/storage.py", line 114, in _new_shared
    return cls._new_using_filename(size)
RuntimeError: error executing torch_shm_manager at "/private/var/folders/b5/hgpy98310bg_g3hfqngl759m0000gn/T/tmpxYzeas/.deps/torch-0.4.0-cp27-none-macosx_10_6_x86_64.whl/torch/lib/torch_shm_manager" at /Users/soumith/code/builder/wheel/pytorch-src/torch/lib/libshm/core.cpp:125

Relevant info from the PyTorch guys on what they're doing is here: https://pytorch.org/docs/stable/multiprocessing.html#file-system-file-system

Additional info: the above code was run on Mac and breaks. On Linux PyTorch uses a file_descriptor based sharing system which does work well.
However forced setting of the sharing strategy:
torch.multiprocessing.set_sharing_strategy('file_system')

makes it also fail on linux.
So the conclusion is that something in the file_system strategy of shared memory management is incompatible with pex.
Adding --not-zip-safe doesn't fix the problem.

OK, root cause is torch_shm_manager is not executable in the pex environment. When I build with --not-zip-safe and chmod +x /home/jsirois/.pex/install/torch-0.4.0-cp36-cp36m-manylinux1_x86_64.whl.40da15562268d7f03a1d135a85e2cc9ac9a46e8d/torch-0.4.0-cp36-cp36m-manylinux1_x86_64.whl/torch/lib/torch_shm_manager after running once (so that the torch.pex and its internal wheels are exploded to the filesystem), things work. I ran a quick experiment using python's ZipFile.extractall and reproduced permissions not being preserved (using the unzip binary torch_shm_manager is executable after extraction). Here is the upstream bug: https://bugs.python.org/issue15795
I think we can work around this by subclassing ZipFile :/
And WOW - torch is a ~400MB wheel. That's getting to be the size of a docker image.

To be clear @y0ast, once #528 is in and released in pex 1.4.5, you'll need to --not-zip-safe for torch, it will never work from a zipped up context s it's written.

Thanks @jsirois, nice find!
Thanks for the quick fix too :).
 We've had some discussions with them in the past to make it smaller, but it seems like cutting it down further is either a lot of work or leads to cutting features.


grafana: 9.1.7 -> 9.2.0

Description of changes
Caution: unless I'm blind it wasn't mentioned in the release-notes, but support for direct access to Prometheus datasources doesn't work anymore (i.e. access = "direct"; in the provisioning), see https://github.com/grafana/grafana/commit/f30795b0884dd3485423a12d7d7d0860453967a7.
ChangeLog: https://github.com/grafana/grafana/releases/tag/v9.2.0
Also fixed the test: the default value for the admin email address is now admin@localhost[1].
[1] https://github.com/grafana/grafana/commit/39102c6656a5b7a11ffc8530d1f5c7598ef99038

Things done

Built on platform(s)

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

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[x] Tested, as applicable:

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

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

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

https://nvd.nist.gov/vuln/detail/CVE-2022-31123
https://nvd.nist.gov/vuln/detail/CVE-2022-39229
https://nvd.nist.gov/vuln/detail/CVE-2022-39201
https://nvd.nist.gov/vuln/detail/CVE-2022-31130

There's an 8.5.14 release we can use for 22.05.


Begin updating samples for v0.6.

This PR starts the process of updating samples to use v0.6 libraries and syntax.

Thanks to @bettinaheim's help, this PR should now be ready to go!


Product copy command

New command: 3scale product copy

[x] Command implementation
[x] unittests
[x] integration tests
[x] Documentation

NAME
    copy - Copy product

USAGE
    3scale product copy [opts] -s <source_remote>
    -d <target_remote> <source_product>

DESCRIPTION
    This command makes a copy of the referenced product. Target product will
    be searched by source product system name. System name can be overriden
    with `--target_system_name` option. If a product with the selected
    `system_name` is not found, it will be created.

    Components of the product being copied:

    product configuration

    product settings

    product methods&metrics

    product mapping rules

    product application plans & pricing rules & limits

    product application usage rules

    product policies

    product backends

    product activedocs

@eguzki additions/changes look good :+1: . I left some feedback on the delete backendusage conversation that we were having

ready for review @miguelsorianod


Add support for multi-line headers

Hi, I noticed recently that Typhoeus was failing to parse multi-line headers, which although not very popular exists in the wild ^^
Here is an example of multi-line header which makes Typhoeus fail:
$ curl -I https://hashbang.ca
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 16 Dec 2016 21:30:11 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
Link: <https://hashbang.ca/wp-json/>; rel="https://api.w.org/"
Expires: Fri, 16 Dec 2016 22:30:11 GMT
Cache-Control: max-age=3600
Strict-Transport-Security: max-age=31536000; includeSubDomains
Content-Security-Policy: default-src 'self';
        img-src     * data: 'self';
        style-src   https://platform.twitter.com https://fonts.googleapis.com https://secure.gravatar.com https://gist-assets.github.com https://assets-cdn.github.com 'unsafe-inline' 'self';
        font-src    https://fonts.googleapis.com https://themes.googleusercontent.com https://fonts.gstatic.com data: 'unsafe-inline' 'self';
        script-src  https://syndication.twitter.com https://platform.twitter.com https://api.flattr.com https://secure.gravatar.com https://asciinema.org https://*.github.com 'unsafe-inline' 'unsafe-eval' 'self';
        child-src   https://syndication.twitter.com https://platform.twitter.com https://speakerdeck.com https://www.youtube.com https://api.flattr.com https://*.soundcloud.com https://asciinema.org 'self';
        frame-ancestors https://hashbang.ca https://*.hashbang.ca https://mikedoherty.ca;
        report-uri  https://csp.hashbang.ca;
        referrer no-referrer;
        upgrade-insecure-requests;

And here the error raised: undefined method 'strip' for nil:NilClass
This is because Typhoeus simply split headers by newlines, in this fix I attempt to respect the spec better by splitting the headers on newlines with no space or tab on next line, as this means the same header value continues. I then strip newlines and extra spaces in the parsed value.
I added spec for this and had to hack a bit the raw header strings in the specs as they were actually containing leading spaces everywhere. I would have preferred using the squiggly heredoc syntax but this means the spec would only run on ruby 2.3.1+ so I supposed you would prefer a more compatible version.
I'm using my patched version for updown.io and it's working perfectly on 6000+ different websites.
References:
https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html
http://stackoverflow.com/questions/31237198/is-it-possible-to-include-multiple-crlfs-in-a-http-header-field
http://stackoverflow.com/questions/8627263/multi-line-http-headers-confusion

Thanks a lot @jarthod!

Nice, you're welcome ☺
Will this be in 1.1.3 then ?

Yes!

Great, keep up the good work!
And let me know if you ever want free updown.io credits ;)

Thanks! Seems like a nice product you have there!


fix table frame and grid attributes

Fixes #117.

I'd prefer to keep the existing mapping of CSS classes and just add a rule that handles the value "none".

I just added support for the none value and kept the other CSS classes the way they were as the stylesheet uses them.

Thanks, that's more simple. I must have been coding without thinking enough.

Thanks! I had no idea I had forgotten about the "none" attribute, so I'm very glad you brought this up.

So, is this supposedly working now?  Because when I build my site I still see the top and bottom frame borders even though I specified "none".


Spectral entropy not stable

Hello Raphael,
I analyzed the formula for the spectral entropy.
You provide 2 methods: periodogram and welch
However, periodogram is unstable and leads sometimes to Nan/Infinity due to the log2 computation.
In order to improve this formula, I would advice you to:

add a note for the use of periodogram
add a default value to 1 for the sampling frequency

Best, -MH

Hi @MaxHeuillet!
Ok for the periodogram, could you say a bit more why you think it's unstable and what exactly you would put in the documentation (or please feel free to submit a PR). As for the sampling frequency, why would you put it to 1 Hz? I think it's much better to not use a default value, instead, users should know the sampling frequency of their data.
Thanks,
Raphael

Hello,
In my case, I manipulate many sequential databases and as far as I know, None of them was provided a sampling frequency...
Do you know what is the implication of using the default value = 1 Hz when one doesn't know the sampling frequency?
As for the periodogram method, I just used it and it lead sometimes to Zero Division errors in the np.lg2 implying generation of Nan values, whereas the Welth worked perfectly on all my databases. I read the following:
Welch's method is an improvement on the standard periodogram spectrum estimating method and on Bartlett's method, in that it reduces noise in the estimated power spectra in exchange for reducing the frequency resolution.
I spent time investigating and checking for your function, I felt it would be nice to give a feedback about my experience! :)
Best, -MH

I see! Well, I guess it makes sense to use a default value of 1 then since it is also the default in scipy.signal.periodogram and scipy.signal.welch. But I think an even better solution would be to replace the method=" argument and replace it by something like estimator=scipy.signal.periodogram or scipy.signal.welch together with **kwargs arguments that can be passed directly to the callable function. What do you think? And maybe we could use Welch as the default instead of the periodogram then?
Thanks for the input, I appreciate it!
Raphael


Adjust exporter to continously show events in prometheus, more labels

Have more labels
get all events starting last week until two weeks ahead
provide resources and start and end date

What is missing:

Apply some customization only for scheduled changes, maybe split behaviour here
enable same behaviour for organisational scrape
make change controllable by config


Fix admin Kafka cli regex

Coverage decreased (-0.02%) to 67.271% when pulling 636ed2efd29493402c49d968971d07cbec8f96ea on fix-admin-kafka-cli into 4a5a0d64f4d4d579c8a3b69a88cf102c91d1e599 on master.


WSL --install requires elevtation

what does this mean and how do i give elevation?

That means to run command prompt as administrator. Can you provide which page mentions that requirement?

You need to run it as an administrator.

You should see it here like this:

thank u craigloewen.


Add a check_turn_damage function to mech instrument panel

Mechs should be able to check and see if, during the last round, they were attacked/damaged by another mech or entity. This kind of information is helpful to inform navigation and targeting algorithms. For example:

If the mech was damaged by another mech last turn, the mech can adjust its strategy accordingly
If the mech took damage from collision during the last turn, the mech can make a decision about its navigation strategy

To implement this, I suggest the following:

Modify domaincommon event sourcing rules such that whenever a mech takes damage from anything, metadata about the thing that damaged it be stored in a slot. This slot should only last 1 turn, so this query function should only ever return a value if the damage took place on the previous turn.
Modify the mech SDK to add a check_turn_damage that returns an Option containing the source of, and amount of, damage taken during the last turn. (this can be done by reading the mech state that gets delivered to each mech during its "take turn" cycle).

Maybe change this to last_damage_source() , which returns an option. This could remain as it is until the source of damage changes, and then it's up to the mech to deal with that information as they choose. I'm just having a gut feeling that the "value that disappears after 1 turn" will be both a source of difficult coding for us and potential friction for mech developers/players.
Thoughts @brooksmtownsend ?

Maybe change this to last_damage_source() , which returns an option. This could remain as it is until the source of damage changes, and then it's up to the mech to deal with that information as they choose. I'm just having a gut feeling that the "value that disappears after 1 turn" will be both a source of difficult coding for us and potential friction for mech developers/players.
Thoughts @brooksmtownsend ?

Agreed, 1 turn at a time might get complicated. I'm a fan of the last_damage_source() option. If we're including the source and amount of damage in the result, we could also include the turn that the damage occurred on for more information. I'm not exactly sure how that would be useful but while we're adding the feature it might assist some mech designs

Yeah if we include the turn when the damage occurred we should also expose the current turn through the instruments trait.


Menu design

BrassBolt suggested:

Drive
Settings

Sound ON/OFF
Sleep ON/OFF
About
(at the very end) Bootloader mode

Sleep probably needs a time setting, perhaps a wakeup method setting, and we might have a sound pitch setting.

Settings

Version Info
Sound: ON/OFF
Drive
UF2

Need to look into sleep some more.


cannot connect

I have the api key installed and am using the demo I pulled off Git.  I keep getting the following error:
{"No connection could be made because the target machine actively refused it <IP_ADDRESS>:443"}
stack trace  =  at System.Net.HttpWebRequest.GetResponse()
at RestSharp.Http.GetRawResponse(HttpWebRequest request)
at RestSharp.Http.GetResponse(HttpWebRequest request)

Hi @dwhittlesey,
The HelloSignTestApp program defaults to our internal "staging" environment, which is probably what is happening in your case. If you specify "prod" as the first argument when running the program, it will connect to api.hellosign.com instead. Sorry for the confusion.
So, running the program should look something like:
HelloSignTestApp.exe prod


useless if-else branch

line 64-67
      if this.status == 200:
        contWrapper(this.status, this.responseText)
      else:
        contWrapper(this.status, this.responseText)

https://github.com/pragmagic/karax/blob/master/karax/kajax.nim

It's my code, fixed. You can use my forking, enhanced inline style ,input value, sessionstorage and websocket. https://github.com/gogolxdong/karax . I also noticed you are in Shenzhen, we have a QQ group 469329878, welcome to discuss Karax further.


Add an "assigntome" slack command

Stack from ghstack (oldest at bottom):

-> #148
#147

Add an /assigntome command that can be used by any GitHub user on
issue to assign the issue to themselves.
Assigning an issue does not remove previous assignees.
Fixes: #141
Signed-off-by: Andrea Frittoli<EMAIL_ADDRESS>

/land all PRs in the stack approved and passing CI


backup result is mistake, not is I expect  v1.6

Environment:
os : centOs 5.6
influxdb version : 1.6
area : china

original
database : test
measurement : test
data : "2000-01-01T06:00:00Z" ~ "2000-01-30T06:00:00Z"   In total 30 items。

result
database : test2
measurement : test
data: "2000-01-01T06:00:00Z" ~ "2000-01-16T06:00:00Z"   In total 16 items。

The commond I used :
influxd backup -portable -db test -start 2000-01-10T06:00:00Z  /home/bkTest
influxd restore -portable -db test -newdb test2 /home/bkTest/

question:
start 2000-01-10T06:00:00Z  , It should be "2000-01-10T06:00:00Z " ~ "2000-01-30T06:00:00Z ", but it is "2000-01-01T06:00:00Z" ~ "2000-01-16T06:00:00Z"  。

This is first time I  oppen an issue , Is there anything to notice?

Discover : if commond use both start and end , this problem won't appear . So why only use start can cause error ？


Fix babel module resolver support

The old way never worked for me. This new code is tested and it works

#53 is probably a duplicate of this

However this does not support the regex stuff that is in babel-plugin-module-resolver.  It would really be fantastic if babel-plugin-module-resolver export some utility functions that we would use. I looked into this for a min but it looks like there getRealName module would need some customization.

Closing this PR, as there has been no response for awhile. And any active maintainer is clueless about this.
Please reply here anyone if you can answer any questions above.


replace math/Vector with something from vecmath

Does commons collections or vecmath have something that alread does what the Vector class does?

Yes. Looks like it can be replaced with  GVector.https://download.java.net/media/java3d/javadoc/1.4.0/javax/vecmath/GVector.html

It is similar, but does not work exactly the same way. Some methods I need like distanceTo and normalizedDot are not supported. Also not immutable. Keeping the version that I have.
Wontfix.


[Concept] Minor Improvement in Strike/Complaint Record System

Idea: Making it friendly for users, utilizing two prefixes that will record a log of a user. Notably strike being a concrete use for actual punishment for actual rule breaking and complaint being used for notes of possible and/or gray areas of unsatisfactory actions from the user.

>strike {id}
+reason {msg}

>complaint {id}
+reason {msg}

if [strike] then
add "[STRIKE]" + {msg}
else
"[COMPLAINT]" + {msg}

Ensure that organized and well-visible "types" within the record log of a user. -also to somehow check how to possibly save and receive the two different types from the same column data.
Possible use of strike column from the data without having to make a new column.

Idea: Making it friendly for users, utilizing two prefixes that will record a log of a user. Notably strike being a concrete use for actual punishment for actual rule breaking and complaint being used for notes of possible and/or gray areas of unsatisfactory actions from the user.
>strike {id}
+reason {msg}

>complaint {id}
+reason {msg}

if [strike] then
add "[STRIKE]" + {msg}
else
"[COMPLAINT]" + {msg}

Ensure that organized and well-visible "types" within the record log of a user. -also to somehow check how to possibly save and receive the two different types from the same column data.
Possible use of strike column from the data without having to make a new column.

@Velmex About the strike & complaint command, they were merged post v6.0.0 patch. In other words, strike now acts just like complaint command but without an automated penalty-action.
Also, speaking of your idea about adding new "+reason" prefix, I thought a simple "+" sign itself would be just obvious enough for user to notice that prefix is used to register a new strike entry.
Nonetheless, I always wanted to improve the user experience whenever possible, so I'll consider to put this in the next updates. Thanks for the suggestion, Vez!

@klerikdust I talked it over with him, however, we think that possibly make use of the alias. Basically depending on if you use complaint or strike determines how the message is saved. When he says prefix he's not referring to the "+" he's referring to ">strike". so if you wanna record an actual strike it would have strike in bold print and if you just want to make a note and not have it count as a strike you use the alias and "complaint" is added in bold to the reason string.


Can't find unidock_ad4 after compiling from sources by came

Hi,
I am a bit confused that the README file said "Executable unidock supports vina and vinardo scoring functions, and unidock_ad4 supports ad4 scoring function."
But after I compiled from sources by cmake, only unidock exists not unidock_ad4 .

Hi @Dead-fisher ,
Sorry about the inconvenience. I'll fix it.

@YNYuan Would you update the status of this bug, and check if the linked PR is necessary? Thanks.

@yanze039 @caic99 From v1.1.1, unidock has supported ad4 scoring function (need to create maps first, see) and unidock_ad4 has been deprecated.


Communications: Rearrange the plus icon in sort-by menu

Checklist
General

[ ] I tested all changes and their related features with all corresponding user types on a test server.
[ ] This is a small issue that I tested locally and was confirmed by another developer on a test server.
[x] Language: I followed the guidelines for inclusive, diversity-sensitive, and appreciative language.
[x] I chose a title conforming to the naming conventions for pull requests.

Client

[x] I followed the coding and design guidelines and ensured that the layout is responsive.
[x] Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
[x] I added multiple screenshots/screencasts of my UI changes.
[x] I translated all newly inserted strings into English and German.

Motivation and Context
Closes #6198
Description
Modified the i18n files for English and German, moving the ➕ emoji to the end of the string.
Steps for Testing
Prerequisites:

1 Course

Go to communications of a course
Click on sort-by

Review Progress

Code Review

[ ] Review 1
[ ] Review 2

Manual Tests

[ ] Test 1
[ ] Test 2

Screenshots

Codecov Report

Merging #6346 (a960a24) into develop (f86c014) will increase coverage by 0.00%.
The diff coverage is n/a.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6346   +/-   ##
==========================================
  Coverage      80.31%   80.31%
  Complexity     13010    13010
==========================================
  Files           2305     2305
  Lines          89246    89246
  Branches       13186    13186
==========================================
+ Hits           71680    71681    +1
  Misses          9744     9744
+ Partials        7822     7821    -1

see 1 file with indirect coverage changes

Flag
Coverage Δ

client
76.47% <ø> (+<0.01%)
:arrow_up:

server
84.60% <ø> (ø)

Continue to review full report in Codecov by Sentry.

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


Crash in main thread on trace record

Me again.
On Ubuntu, when I attempt to record a trace, I get an error. Specifically,
When I issue this command:
./appetizer trace record --device abc123 mytrace.trace
I get this error:
]Crash in main_thread Exception AttributeError: "GeteventReader instance has no attribute 'proc'" in <bound method GeteventReader.__del__ of <droidrep.GeteventTools.GeteventReader instance at 0x7f5f8af28098>> ignored
I should mention the context here. I am trying to run the appetizer executable without it on my PATH. Also, I am using the adb standalone program (available here), not the Android SDK, which is in the same directory and also not on the PATH.
This error does not seem to exist on Windows and I do not know about Mac yet, will update. Help is appreciated.

I have figured out the source of the issue. The adb still needs to be on the PATH on the linux version, although not on Windows.


[yaml-cpp] Update to 0.8.0

[X] Changes comply with the maintainer guide
[X] SHA512s are updated for each updated download
[X] The "supports" clause reflects platforms that may be fixed by this new version
[X] Any fixed CI baseline entries are removed from that file.
[X] Any patches that are no longer applied are deleted from the port's directory.
[X] The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
[X] Only one version is added to each modified port's versions file.

A few additional tweaks were made to the portfile, notably:

The install location for the CMake configs and pkg-config files were moved from share to lib, so moving the pc files manually is no longer needed.
YAML_CPP_DLL is no longer used in dll.h, instead replaced with YAML_CPP_STATIC_DEFINE. The inline patch was updated as such. Moreover, it was extended to non-Windows platforms as it also applies to them.

Three ports are failing:

opencolorio
jaeger-client-cpp
rtabmap

The first issue from upgrading to 0.8.0 was broken CMake configs, PATH_VARS were used to load the targets, breaking when vcpkg_cmake_config_fixup was used.
The patch added in 7900bdf is a copy of what was submitted upstream in https://github.com/jbeder/yaml-cpp/pull/1212.
The remaining build failures come from a change in the CMake target name from yaml-cpp to yaml-cpp::yaml-cpp.

The patches to fix the new target name were relatively trivial:

jaeger-tracing-client-cpp and opencolorio needed their dependency patches to be updated.
rtabmap needed a new patch to fix the target used for yaml-cpp.

OpenColorIO and rtabmap have been notified and provided a patch.
On the other hand, the Jaeger Tracing Client repo is archived.

Please do not change the line breaks in the ports/jaeger-client-cpp/fix-CMakeLists.patch file. We want to keep the modifications as concise as possible.

Please do not change the line breaks in the ports/jaeger-client-cpp/fix-CMakeLists.patch file. We want to keep the modifications as concise as possible.

My apologies, vscode did not show the change of newline character in the diff. It should be fixed now.

Thank you very much for your prompt response and for contributing to vcpkg.

Hey, guys, thanks for working on this! Any forecasts when v0.8.0 will be merged?

Looks like there are some merge conflicts with recent updates, I switched this PR to draft until I find time to resolve them.

Can you finish this work please? @FtZPetruska

Usage test passed with x64-windows.

This resulted in https://github.com/microsoft/vcpkg/issues/35041


Schedule functions 1 more time than the last day

Had an issue where I was running a scheduled function that looks like this:
cron.schedule('30 21 * * Tuesday,Wednesday,Thursday', function(){
      console.log('warning ' + new Date());
});
First day it printed:
warning (date format)
Second day it printed:
warning (date format)
warning (date format)
Third day it printed:
warning (date format)
warning (date format)
warning (date format)
at which point I just stopped it.
If being detailed helps, I run the program on amazon's linux machine and use the command screen to start the program so I can close my SSH terminal and keep it running.

You might be scheduling your cron multiple number of times in the same process. Please make sure that you schedule that only once.

@akprats33 Ah I do have 3 crons scheduled. How would I go about having multiple crons scheduled?

@Gobluebro I've create a cron job like this:
cron.schedule('32,33,34 * * * Tuesday,Wednesday,Thursday', function(){
  console.log('warning ' + new Date());
});

I got this as result:
warning Tue Mar 06 2018 15:32:00 GMT-0300 (-03)
warning Tue Mar 06 2018 15:33:00 GMT-0300 (-03)
warning Tue Mar 06 2018 15:34:00 GMT-0300 (-03)

When you create a scheduled job like '30 21 * * Tuesday,Wednesday,Thursday' it means that your job will perform every Tuesday, Wednesday or Thursday at 21:30.
Have you setted it just once?

@merencia Oh I never thought of doing something like that.
Though my code looks more like this currently
cron.schedule('0 21 * * Tuesday,Wednesday,Thursday', function(){
    console.log('start command' + new Date());
    startfunction();
});

cron.schedule('30 21 * * Tuesday,Wednesday,Thursday', function(){
    console.log('5 minute warning' + new Date());
});

cron.schedule('35 21 * * Tuesday,Wednesday,Thursday', function(){
    console.log('end command' + new Date());
    endfunction();
});

Should I do something more like this?
cron.schedule('0,30,35 * * * Tuesday,Wednesday,Thursday', function(){
   if(Date.getMinutes() == 30)
   {
      console.log('warning ' + new Date());
   }
});

Should I do something more like this?

If you need execute the same task every minute 0, 30 and 35, yes.
About your current code I have a important point:
Node.js is single thread, so if you block your i.o on startfunction for 31 min it'll prevent node-cron to check and run your next task.

Okay thanks for the help! 👍

example of my code :
var cron = require('node-cron');
var moment = require('moment');

var task =  new cron('0 00 16 28-31 * *, function() {
  if (isLastDayOfMonth()) {
    doSomeStuff()
  }
}, null, true, 'America/Los_Angeles');

function isLastDayOfMonth(){
  const currentDay  =  moment().format('YYYY-MM-DD');
  const lastDayOfCurrentMonth  =  moment(date).endOf('month').format('YYYY-MM-DD');

  if (currentDate === lastDayOfCurrentMonth) {
    return true;
  } else {
    return false;
  }
}

function doSomeStuff(){
  // your task here.
}

The cron will be run every 28 - 31 day, and then check whether current day is a last day of current month. And it's work.
I have add in day_of_month function to check it, if user input L, then day_of_month will be set to 28-31


Resolve #649: [HF] Check authorities on custom_operation

The required_auths field on custom_operation was being ignored during authority checking. This commit causes it to be checked correctly, and adds a unit test verifying as much.

@nathanhourt  I would resubmit this PR against https://github.com/bitshares/bitshares-core since this repo is no longer maintained.


Resolved #426 with more careful configuration

This PR essentially implements the expected behaviour described in #426

We'll drop this as we are currently working on v2


Want to use it in SliverPersistentHeader

Description
How can I use this package in CustomScrollView ?
and i want to pin it to the header, So I want to use it Like CustomScrollView -> SliverPersistentHeader -> this package

@fuadmostafij6 thanks for reporting this. I'm working on it. hope I can give you an update as soon as possible.


[Bug] Problems with the FPS of some games

Platform

TV fire stick full HD
Version 0.10.0

Describe the bug
Until a few days ago I was having problems with Evil West, it didn't even work with everything at least, but with this update to change the webview, it's working in 1080p and normal visuals, calm down, but Persona 3 Reload still suffers from problems.  other games like Resident Evil 2 and 3 remake and Plague Tale work perfectly at 1080p.  What still suffers is the recharging of Persona 3, I believe it is not a problem with the fire stick, I know that an update to optimize it would be better.  I used the booster and Death Stranding works without crashes and that's because I live in Brazil with Ping at 100.

Try setting Touch control's availability to Off

Tente definir a disponibilidade do Touch Control como desligado

Ok, I will update you with any improvements I have

Tente definir a disponibilidade do Touch Control como Desligado

hi, I saw if it worked by doing this, it still remains the same way, when I enter the area where persona 3 fights, it only works if I leave it at 720p with low visuals, the other games are working, at least the ones that I tested it as resident and evil west

the device can only handle low bitrate scenes
#41


Pack kodo mechanic doesnt not work in any shape or form

@YakaryBovine

FYI this isn't implemented and bugged; it's just not implemented at all. You can refer to the vJASS version for an idea of how it works. Just start as Frostwolf and train a Pack Building from any structure.


Create middleware vulnerability file

We need to create a middleware vulnerability file in the same that lookup uses it for validation. The file will be called vulnerabilityValidate.js

Fixed wit commit 0e9c8e6910f0c6f4cf468d0f3ef0845c3de6f1b1, but I forgot to add the message while doing commit. Closing manually


[Feature Request] FastAPI integration (if feasible... but probably infeasible)

Hi @leycec , I found an issue and decided to make an issue out of it rather than to put it in the very long hook thread.
 ⚡  /projects/open_source/test_beartype  python -V
Python 3.10.10
 ⚡  /projects/open_source/test_beartype  pip freeze | grep beartype
beartype @ git+https://github.com/beartype/beartype.git@2b8c6823742c29f76ead1222ad08983082792b02

# dada.py

from typing import TypeVar
from collections.abc import Iterator
from fastapi import Depends, FastAPI

Self = TypeVar("Self")

class SomeClass:
    @classmethod
    def my_iterator(cls: type[Self]) -> Iterator[Self]:
        yield cls()

app = FastAPI()

@app.get("/items/", response_model=None)
async def read_items(my_value: SomeClass = Depends(SomeClass.my_iterator)) -> int:
    assert isinstance(my_value, SomeClass)
    return 1

# dodo.py

import beartype.claw
beartype.claw.beartype_packages(["dada"])

from dada import app
from fastapi.testclient import TestClient

test_client = TestClient(app)

test_client.get("/items")

 ✘ ⚡  /projects/open_source/test_beartype  python dodo.py
Traceback (most recent call last):
  File "/projects/open_source/test_beartype/dodo.py", line 11, in <module>
    test_client.get("/items")
  File "/opt/conda/lib/python3.10/site-packages/starlette/testclient.py", line 499, in get
    return super().get(
  File "/opt/conda/lib/python3.10/site-packages/httpx/_client.py", line 1041, in get
    return self.request(
  File "/opt/conda/lib/python3.10/site-packages/starlette/testclient.py", line 465, in request
    return super().request(
  File "/opt/conda/lib/python3.10/site-packages/httpx/_client.py", line 814, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/opt/conda/lib/python3.10/site-packages/httpx/_client.py", line 901, in send
    response = self._send_handling_auth(
  File "/opt/conda/lib/python3.10/site-packages/httpx/_client.py", line 929, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/opt/conda/lib/python3.10/site-packages/httpx/_client.py", line 966, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/opt/conda/lib/python3.10/site-packages/httpx/_client.py", line 1002, in _send_single_request
    response = transport.handle_request(request)
  File "/opt/conda/lib/python3.10/site-packages/starlette/testclient.py", line 342, in handle_request
    raise exc
  File "/opt/conda/lib/python3.10/site-packages/starlette/testclient.py", line 339, in handle_request
    portal.call(self.app, scope, receive, send)
  File "/opt/conda/lib/python3.10/site-packages/anyio/from_thread.py", line 283, in call
    return cast(T_Retval, self.start_task_soon(func, *args).result())
  File "/opt/conda/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/opt/conda/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/opt/conda/lib/python3.10/site-packages/anyio/from_thread.py", line 219, in _call_func
    retval = await retval
  File "/opt/conda/lib/python3.10/site-packages/fastapi/applications.py", line 276, in __call__
    await super().__call__(scope, receive, send)
  File "/opt/conda/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/opt/conda/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/opt/conda/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/opt/conda/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/opt/conda/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/opt/conda/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/opt/conda/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/opt/conda/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "/opt/conda/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "/projects/open_source/test_beartype/dada.py", line 21, in read_items
    assert isinstance(my_value, SomeClass)
AssertionError

If I comment beartype.claw.beartype_packages(["dada"]) then the script works normally.
Thanks for all your work!

Thanks for the clarification! I'll open an issue on their side :)

https://github.com/tiangolo/fastapi/discussions/9885 hopefully it can be fixed on their side

Thanks so much for all that! As always, you persist in greatness.
Incidentally, I've given this some much-needed thought while peddling through the backwoods and leech-infested swamplands of Canada and... we're probably to blame for your beartype.roar.BeartypeDecorHintPep585DeprecationWarning concerns, which you reported elsewhere and I am confusingly discussing here. Specifically, would you mind trying the following as a temporary issue resolution on your end?

Replace beartype.roar.BeartypeDecorHintPep585DeprecationWarning with beartype.roar._roarwarn.BeartypeDecorHintPep585DeprecationWarning. The former is only a "fake" name for that warning; the latter is the actual fully-qualified name of that warning. If you specify the latter rather than the former, it's likely that @beartype will begin working as you expect.

If that does temporarily resolve your issue, would you additionally mind submitting yet another issue? I know exactly how to properly resolve this on our end – but I'd kinda rather not go there unless this is actually our fault.
Annnnnnyway! Thanks so much for all the hard-hitting QA. beartype.claw is within our grasp. Feel the power of the :bear:.

For future readers, the original question was here: https://github.com/beartype/beartype/issues/251
I'll answer there