spec: clarify when calling recover stops a panic

What version of Go are you using (go version)?

go version go1.13 linux/amd64

Does this issue reproduce with the latest release?
Yes
What did you do?
package main

import "fmt"

func demo() {
	defer func() {
		defer func() {
			// recover panic 2
			fmt.Println("panic", recover(), "is recovered")
		}()

		// recover panic 1
		defer fmt.Println(" (done).")
		defer recover()
		defer fmt.Print("To recover panic 1 ...")

		defer fmt.Println("now, two active panics coexist")
		panic(2) // If this line is commented out, then the program will not crash.
	}()
	panic(1)
}

func main() {
	demo()
}

What did you expect to see?
Not crash.
What did you see instead?
Crashes.

If this is the intended behavior, then the descriptions in the spec doesn't cover this case.

@danscales

Tentatively milestoning for 1.14, on the theory that it maybe fixed alongside #34481, but feel free to re-milestone if that is not realistic.

@go101, personally I would expect this program to crash with panic 1.
(Since both of the recover calls are within nested defer statements, I would expect them to only cover panics that originate within the call to the deferred function.)

By spec for the explanations for recover mechanism, the following program has no differences from the above one. But the following one exits without crashing.
package main

import "fmt"

func demo() {
	defer func() {
		// recover panic 1
		defer fmt.Println(" (done).")
		defer recover()
		defer fmt.Print("To recover panic 1 ...")

		defer func() {
			// recover panic 2
			fmt.Println("panic", recover(), "is recovered")
		}()

		defer fmt.Println("now, two active panics coexist")
		panic(2) // If this line is comment out, then the program will not panic.
	}()
	panic(1)
}

func main() {
	demo()
}

Yes, the Go language spec is very vague and imprecise on panic/recover and I am hoping to fix it:
https://go-review.googlesource.com/c/go/+/189377
but there's not quite consensus yet.
I don't think there is any disagreement on the behavior of your example (unlike the abort behavior mentioned in #29226 ).  A recover only recovers a panic if it is called directly in a defer function that is directly invoked as part of the panicking process of that panic.  A recover does not apply and returns nil if it is not called directly in a defer function or if it is called from a defer that was not directly invoked by the panic sequence of the panic (i.e. is nested inside some other defer or function called by the defer).
Your second example seems to be a special little bug/quirk of doing 'defer recover()'.  The detection mechanism in the implementation considers that recover is called directly in the containing function, so that recover does apply.  Note that recover does not happen if you do
  defer func() {
    recover()
  }

I think the first thing in both these bugs are to get agreement on the spec - both specifying the current behavior that people depend on and/or would generally agree on, and also the behavior (like the abort behavior in #29226 ) that has been there for a while, but has never been specified and people might like to change.

Yes, this is a little quirk. There is not a way to verify whether or not the recovered value is really 1.
Whatever, I think the behaviors of the above programs should be consistent.

The difference between the two programs has to do with the behavior of defer recover().  The question is simply whether recover is being called by a deferred function.  When you write defer recover() in a normal function, it is not (a deferred call to recover is not a case in which recover is called by a deferred function).  But when defer recover() occurs within a function that is itself deferred, then it is.
So, in the first program, the defer recover() sees the panic(2), but since it is not called from a deferred function, it does not stop the panic.  That panic continues until the "recover panic 2" deferred function, which recovers it.  And nothing recovers the panic(1), so the program crashes.
In the second program, the panic(2) is recovered.  Then we run the defer recover() in a deferred function.  In this case recover is called from a deferred function--the outer deferred function, not the defer recover() function--so that catches panic(1).  And the program succeeds.

@ianlancetaylor
Thanks for the clarification.
Your explanation makes me more believe that each goroutine maintains a panic stack. Only the top panic in the stack may be recovered, and top recoverable panic must not be created in runtime.Goexit() calls.
So my current understanding is like this:
Assume the frame depth of the entry call of a goroutine is 1, in the execution of the goroutine, when a function call ends and the frame depth becomes smaller than the size of the panic stack, then the top panic will collapse down (to replace to below panic) until the size of stack is the same as frame depth.

Is the understanding right?

@ianlancetaylor
By your above explanation, I think the current new panic explanations in https://go-review.googlesource.com/c/go/+/189377 still needs a little adjustment.

Sorry, I don't really understand your frame depth discussion.
I encourage you to comment on the CL where you think it needs adjustment.

I think this is a really interesting test case. Thanks for reporting it, @go101.
On my phone, so I haven't looked at the Go spec wording or @danscales's suggestion recently, so I'm not sure the right behaviour. From memory though, I can see arguments either way.

Thanks for all the examples and discussion.  I missed that there was a defer recover() even in the first example.  @ianlancetaylor  gives a very good explanation of the current behavior of defer recover().  Overall, the meaning of defer recover() isn't intuitively obvious and its actual behavior with the current implementation is confusing.  So, we are thinking about banning the use of defer recover() (since it seems likely to be only useful for test code).  Instead of defer recover(), you should always at least use defer func() { recover() }() (and of course, it is always recommended to look at the return code of recover()).
With respect to talking about (and spec'ing out) the behavior of panic/recover/recursive panics, it will be best not to use defer recover(), since that will just create more cases that tend to confuse the other issues.

Are we okay breaking Go 1 compat here?

There are two changes we can make without breaking compatibility:

We can make defer recover() a vet error, which would catch most uses during testing.
We can make defer recover() a compile-time error in projects whose go.mod files specify go 1.14 or higher, since ~no such project exists yet.

That use of defer recover() in fuse is a bug, right?  It is in effect a no-op.

That use of defer recover() in fuse is a bug, right? It is in effect a no-op.

I believe so.

Personally, I think the cost of either vet and ban defer recover() is higher than making a little more explanations in spec, not only for compatibility problems, but also for sometimes defer recover() is desired (just the second example above, it is a have-to).

On the other hand, for consistency, it is not bad idea to ban discarding returns of built-in functions. Currently, only the returns of copy and recover can be discarded.

5 years have passed now. Should the spec be made more precise?
Is it good to add a line in the spec: Only the newest unrecovered recoverable panic can be recovered..

CC @griesemer

Marked for 1.24. Low priority.

Some observations:
For the purpose of recovering a panic, whether recover() is called as part of a defer or not doesn't matter: as long as recover() is called directly by the deferred function, it will recover a panic. Per the spec:

The return value of recover is nil when the goroutine is not panicking or recover was not called directly by a deferred function. Conversely, if a goroutine is panicking and recover was called directly by a deferred function, the return value of recover is guaranteed not to be nil.

... and in that case that panic is recovered and the panicking stops.
Note that in defer recover(), recover() is called directly the same way it is called directly in an assignment r := recover(). The point of directly is that the recover() call itself is not within another enclosing function.
Consider the following example of 4 functions a, b, c, d (playground).
Each of these functions is called via protect which simply reports any panics that propagated out of these functions.
Furthermore, a helper function trace is used to document (print) what recover returns.
package main

import "fmt"

func main() {
	protect("protect of a", a)
	protect("protect of b", b)
	protect("protect of c", c)
	protect("protect of d", d)
}

func a() {
	defer func() {
		r := recover() // recovers panic 1
		trace("recover in deferred function of a", r)
	}()
	panic(1)
}

func b() {
	defer func() {
		defer recover() // recovers panic 2
	}()
	panic(2)
}

func c() {
	defer func() {
		r := recover() // recovers panic 3
		trace("recover in deferred function of c", r)
		defer recover() // panic 3 is already recovered - this doesn't do anything!
		panic(4)        // there's no recovery for this panic in c, it is propagated up
	}()
	panic(3)
}

func d() {
	defer func() {
		r1 := recover() // recovers panic 4
		trace("recover in deferred function of d", r1)
		defer func() {
			r2 := recover() // recovers panic 5
			trace("recover in deferred function of deferred function of d", r2)
		}()
		panic(5)
	}()
	panic(4)
}

func trace[P any](msg string, x P) P {
	fmt.Println(msg+":", x)
	return x
}

func protect(msg string, f func()) {
	defer func() {
		trace(msg, recover())
	}()
	f()
}

Running this code produces:
recover in deferred function of a: 1
protect of a: <nil>
protect of b: <nil>
recover in deferred function of c: 3
protect of c: 4
recover in deferred function of d: 4
recover in deferred function of deferred function of d: 5
protect of d: <nil>

For a, we have the standard scenario: a panic is recovered via the deferred function.
For b, we have the same scenario, but this time the recover() call itself is deferred. Since no panic propagates out of b (protect of b reports nil), the defer recover() successfully recovered panic 2.
For c, the first recover recovers panic 3, but the 2nd recover, even though deferred doesn't do anything - panic 4 must be recovered via a deferred function that does the recovering. As a result, panic 4 is propagated out and caught by the protect call.
For d, we have the same as in c but now panic 5 is recovered properly.

In short, I believe this is working as intended and the spec is actually already covering this case.
When it comes to clarifications, we may want to be a bit more precisely explain what "calling directly" means, to avoid confusions around defer recover().

It looks, none of the 4 cases cover the case in the first comment?

@zigo101 Hm, you are correct, I missed explaining your case, which is essentially like this (playground):
func main() {
	defer func() {
		defer func() {
			recover() // recovers panic 2
		}()

		defer recover() // <<< deferred recover does not recover panic 1
		panic(2)
	}()
	panic(1)
}

Panic 2 is raised before the deferred recover is executed and we now have two panics. The deferred recover cannot recover panic 2 (by definition of recover) and it doesn't "see" panic 1 anymore.
I agree that this should probably be explained in the spec.


API doc

Hi, I need to create a simple application using BLE112.
I need to create a simple script that:
Discovery Mode -> Accept connection from another device -> Read a file and send datas read to a device which made a connection
I don't know where can I found the API doc to use your library.
I want to run this script on my raspberry pi, thanks for the help.

Hi @dlion,
The API Reference Guide from Bluegiga is under the User Guides section of the Bluegiga product pages for devices that support BGAPI.
https://www.bluegiga.com/en-US/products/bled112-bluetooth-smart-dongle/#documentation
I also recommend reading through the Bluetooth Smart Knowledge Base articles:
https://bluegiga.zendesk.com/forums/21316731-Bluetooth-Smart
If you have support questions, refer to the Community Forum (now Silabs.com since they bought Bluegiga):
http://community.silabs.com/t5/Wireless/bd-p/4


DateDataParser - return detected language

PR for issue https://github.com/scrapinghub/dateparser/issues/210
Added language field to dictionary returned by get_date_data method
>>> DateDataParser().get_date_data('11 Setembro 2015')
{'date_obj': datetime.datetime(2015, 9, 11, 0, 0), 'period': 'day', 'language': 'pt'}

Current coverage is 94.43% (diff: 84.61%)

Merging #225 into master will decrease coverage by 0.02%

@@             master       #225   diff @@
==========================================
  Files            30         30
  Lines          2669       2677     +8
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
+ Hits           2521       2528     +7
- Misses          148        149     +1
  Partials          0          0

Powered by Codecov. Last update 66939ef...ec0a1fc


PydanticDeprecatedSince20 warning is emitted on import of Schema

When doing
from ninja_schema import Schema

the following warning is emitted:
[...]/3.11.6/lib/python3.11/site-packages/pydantic/_migration.py:290: UserWarning: `pydantic.utils:is_valid_field` has been removed. We are importing from `pydantic.v1.utils:is_valid_field` instead.See the migration guide for more details: https://docs.pydantic.dev/latest/migration/

This is because is_valid_field is imported in pydanticutils/__init__.py.
Although the code still does the right thing, I would prefer it not to be alerted with warnings on software startup.
I found no easy way to fix it because the functionality moved to _internal/_fields.py:is_valid_field_name() in pydantic V2, which should not be used by other packages.
Versions:
ninja-schema==0.13.5
pydantic==2.5.2
python==3.11.6

@dzonecat let me look into this


Hidden Fields validate on submit

Hi @aldeed ,
I have an autoform that has the functionality of show/hide fields depends on the user selection like this.
My problem is why is it that the hidden fields are validated on submission? The fields that are hidden are a relationship from other collection which has a selection.
Here some of my code snippet
clientType: {
    type: String,
    label: "Client Type",
    allowedValues: [
      'Principal',
      'Dependent-Children',
      'Dependent-Spouse',
      'Dependent-Sibling',
      'Dependent-Parent'
    ],
    autoform: {
      type: "select",
      options: function(){
        return [
          {label:'Principal', value: "Principal"},
          {label:'Dependent-Children', value: 'Dependent-Children'},
          {label:'Dependent-Spouse', value:'Dependent-Spouse'},
          {label:'Dependent-Parent', value: 'Dependent-Parent'}
        ];
      },
      afFormGroup: {
        'formgroup-class': 'col-xs-6 col-sm-4'
      }
    }
  },
  childrenId: orion.attribute('hasMany', {
      label: "Dependent-Children",
      optional: true,
      autoform: {
        afFormGroup: {
          'formgroup-class': 'col-xs-6 col-sm-4'
        }
      }
    },
    {
      collection: Enrollments,
      titleField: 'children.name',
      additionalFields:['_id'],
      publicationName: 'childrenClaim',
      filter: function(userId) {
        var user = Meteor.users.findOne({"_id": userId},{fields: {profile: 1}});
        var admin = Roles.userHasRole(userId, "admin");
        var hq = Roles.userHasRole(userId, 'HQ');
        var branch = Roles.userHasRole(userId, 'Branch');
        var insurer = Roles.userHasRole(userId, 'insurer');
        if ( admin ) {
          console.log( "Hello Admin" );
          return {};
        } else if ( hq ) {
          console.log( "Hello HQ" );
          return { company: user.profile.company };
        } else if ( branch ) {
          console.log( "Hello Branch" );
          return { createdBy: userId };
        } else if ( insurer ) {
          console.log( "Hello Insurer" );
          return { insurer: user.profile.insurer };
        }
      }
    }),

Here's on the template:
{{> afQuickField name="clientType" options="allowed" noselect=true template="bootstrap3-inline"}}
      {{#if afFieldValueIs name="clientType" value="Dependent-Children"}}
           {{> afQuickField name="childrenId"}}
       {{/if}}
       {{#if afFieldValueIs name="clientType" value="Dependent-Spouse"}}
           {{> afQuickField name="spouseId"}}
       {{/if}}
       {{#if afFieldValueIs name="clientType" value="Dependent-Parent"}}
           {{> afQuickField name="parentId"}}
       {{/if}}
       {{#if afFieldValueIs name="clientType" value="Dependent-Sibling"}}
           {{> afQuickField name="siblingId"}}
       {{/if}}

As you can see, on the client-type key, if the user select the Dependent-Children, the childrenId key will appear, I have the same code for parent, spouse and siblings. But during submission all the hidden fields are validated even if I set the field as optional.
How do i bypass the validation?
Thanks,
Marvin

In the schema:
someElem:
{
  label: 'some.elem',
  ...
  optional: function() {
    // logic basedon data from field values
  }
}

Thanks @marktomm for the response!
Actually, i don't have the problem on hiding the fields.
All the fields on the autoform options function are actually hidden, see below:
clientType: {
    type: String,
    label: "Client Type",
    allowedValues: [
      'Principal',
      'Dependent-Children',
      'Dependent-Spouse',
      'Dependent-Sibling',
      'Dependent-Parent'
    ],
    autoform: {
      type: "select",
      options: function(){
        return [
          {label:'Principal', value: "Principal"},
          {label:'Dependent-Children', value: 'Dependent-Children'},
          {label:'Dependent-Spouse', value:'Dependent-Spouse'},
          {label:'Dependent-Parent', value: 'Dependent-Parent'}
        ];
      },
      afFormGroup: {
        'formgroup-class': 'col-xs-6 col-sm-4'
      }
    }
  },

the above schema will complement to the below:
{{#if afFieldValueIs name="clientType" value="Dependent-Children"}}
           {{> afQuickField name="childrenId"}} // Dependent-Children
       {{/if}}
       {{#if afFieldValueIs name="clientType" value="Dependent-Spouse"}}
           {{> afQuickField name="spouseId"}} // Dependent-Spouse
       {{/if}}
       {{#if afFieldValueIs name="clientType" value="Dependent-Parent"}}
           {{> afQuickField name="parentId"}} // Dependent-Spouse
       {{/if}}
       {{#if afFieldValueIs name="clientType" value="Dependent-Sibling"}}
           {{> afQuickField name="siblingId"}} // Dependent-Sibling
       {{/if}}

on my form all above fields are hidden except when the user select like Dependent-Children then the children will appear with all the children from the principal Id.
My issue is, after I hit submit button, i think the hidden fields that are not selected is being validated. my proof of this is, when I removed the options function, the form will submit.
How do i bypass the validation of the hidden unselected fields?
From your suggestion, i have to put an optional function outside autoform? Something like
option: function () {
  if (not selected) {
    return true;
  }
}

Thanks,

Sry mb you haven't noticed, option/options/optional are different parameters (and idt that 'option' is valid).
I suggested giving spouseId,parentId and siblingId 'optional' parameter, which can be a function, f.ex.:
siblingId:
{
  type: String
  label: 'Sibling Id',
  ...
  optional: function() {
    // if 'clientType' value is not 'Dependent-Sibling', return true, otherwise false
  }
}

Now if you would choose something other than 'Dependent-Sibling' in the form, then optional parameter for 'siblingId' would reutrn true and on insert/update/etc the value of 'siblingId' would be undefined or empty string and  (by default) empty values are not inserted into the collection and since 'siblingId' would be optional, no error will occur.
Another thing I can suggest is to use type=normal for the form itself and do all the validation manually in the onSubmit hook.
https://github.com/aldeed/meteor-autoform#normal
https://github.com/aldeed/meteor-autoform#callbackshooks

Thanks @marktomm for the insights!
I will close this issue as I've debugged my code, there's no problem on my form validation, I have another function that's causing this issue.
Thanks.


"Understanding Galaxy History System" tutorial refers to an outdated UI

Release testing 23.0
screenshots and associated descriptions need updated for the new UI
this pertains to this tutorial:
https://github.com/galaxyproject/training-material/blob/main/topics/galaxy-interface/tutorials/history/tutorial.md

Could you, please, provide a more specific description? You don't have to itemize repetitive stuff, but a list of UI elements that are no longer current would be helpful here. Same for associated descriptions: does this relate to the entire tutorial (in which case everything needs to be rewritten), or does that affect specific parts or even steps in the instructions?

I'm going through and updating this one, it's .. a lot of screenshots that need to be changed.

I'm going through and updating this one, it's .. a lot of screenshots that need to be changed.

I can imagine :s. I mean honestly I don't think it's necessarily vital and users could probably get by, I just brought it up as per the guidelines in our meetings, and I guess updated screenshots was one of them. Thanks!


Inconsistent Klumpy score info

Some Klumpy score rules mouseover info displayed in a game replay are not consistent with the rules stated in the game’s main page (which are consistent with the game itself AFAIK). Here are the erroneous ones:

I have removed the info mouseovers while the rules are being finalized.


Allow user to set the aux field when creating a note

What should be done?
Currently, when a user calls the create_note procedure, we set the aux field to 0.
https://github.com/0xPolygonMiden/miden-base/blob/727916915ddb9a237ffb975a1f7cc2f9f69139dc/miden-lib/asm/miden/kernels/tx/tx.masm#L287
We want to allow aux to be a Felt value that the user can set.
How should it be done?

the create_note procedure needs one additional input aux in three files tx.masm, api.masm, kernel::tx::tx.masm.
the contracts and note scripts that use create_note need to be adjusted.
check if we need some validation rule for the aux field, if so we need a new error in miden-lib/src/transaction/errors.rs
there is probably an event in the Host that needs to read the aux field now as well. Not sure if anything needs to be adjusted
all tests and mock-structures that use create_note or send_asset and distribute (which uses create_note under the hood) need to be adjusted
we need to add a test for the aux field and check if a created OutputNote has the correct aux field

When is this task done?
When there is a new test, where a user can create a note with the aux field that passes together with all the old tests.
Additional context
No response

Closed by #752.


Dataset_id (1/2): ensure that non-distributed datasets are loaded correctly

This PR addresses an issue with the way andata.CorrData loads common datasets.
Typically, any dataset with a "freq" axis in a distributed container/group will also itself be distributed. In the edge case where a group contains a common dataset with a "freq" axis, each rank will only load the local frequencies, as would happen with all the distributed datasets, but these slices will be loaded into a common dataset container. This PR introduces a way to handle this case for specific datasets.
Note: an earlier PR attempted to fix this issue in a different way, but this solution is better

This seems like a fine way to resolve this, but it looks like adding "dataset_id" to _DIST_DSETS the way "frac_lost" is would be sufficient. Is there a reason not to do that?

Yeah, that would resolve this issue. The deeper problem is that dataset_id is a unicode type, so if it's distributed it won't get converted to a bytestring in memh5 when saving to .h5 and will throw an error (since hdf5 can't handle unicode types). This approach is needed to let us make dataset_id a common dataset instead of a distributed one. It does seem like a slightly convoluted solution, but I can't come up with another way to fix the underlying issue unless we are able to convert distributed array types before saving.

I see, yeah I guess short of adding that functionality to mpiarray there isn't another obvious way to do this, and this is going to remain a convoluted structure anyways...

I guess ultimately I'm not clear why we can't just fix the restriction in the MPIArray output.

I guess ultimately I'm not clear why we can't just fix the restriction in the MPIArray output.

I might have fundamentally misunderstood the issue. Is the restriction for the type conversion just in MPIArray? Because in that case I agree that the change should be made there, which I can do, and which would also simplify some stuff in memh5.

@jrs65 This should implement the changes that we talked about on Friday now.


Update oas_apivideo.yaml

Proposing to add a few more details to the watermarking docs
removing a typo in the webhooks page

⚛👋 Hello there! Welcome. Please follow the steps below to tell us about your contribution.

Copy the correct template for your contribution

🐛 Are you fixing a bug? Copy the template from https://github.com/apivideo/.github/tree/main/PULL_REQUEST_TEMPLATE/bug_fix.md
📈 Are you improving performance? Copy the template from https://github.com/apivideo/.github/tree/main/PULL_REQUEST_TEMPLATE/performance_improvement.md
📝 Are you updating documentation? Copy the template from https://github.com/apivideo/.github/tree/main/PULL_REQUEST_TEMPLATE/documentation.md
💻 Are you changing functionality? Copy the template from https://github.com/apivideo/.github/tree/main/PULL_REQUEST_TEMPLATE/feature_change.md

Replace this text with the contents of the template
Fill in all sections of the template
Click "Create pull request"

@olivierapivideo leaving this here for review for when you are back


Why normal black = bright white?

Is it expected to have normal black (ansi 0) the same color with bright white (ansi 15) and why is that?

I'm currently working with https://github.com/rivo/tview and the hello world example shows nothing in this theme.

This is after I change the bright white (ansi 15) to follow the normal white (ansi 7)

Is it expected to have normal black (ansi 0) the same color with bright white (ansi 15) and why is that?

It def. isn't expected and hence is a huge oversight on our end. We're currently in the progress of adapting palette colours to be better suitable with the ANSI standards and thus prevent issues like this from happening. We're hoping to release this accross terminals soon.


Solaris: fix std.datetime:LocalTime.utcToTZ issue.

Patch by @nykytenko, originally submitted at https://github.com/dlang/phobos/pull/5016.

LDC on Solaris work fine at now. We ported one relatively large project from linux to SmartOS and it working in production perfectly ~ 3 months. All critical bugs that I found, I fixed in earlier comments.
When you plan to move to newer D version? This bug is not time critical for us, but logs printed with only UTC time and it's uncomfortably.

Awesome :)

Merging, because it will be a while before we'll be at 2.073 ("three"!)

I've added this to release-1.1.0 too.


[YAML] Add JDBC branding transforms

This PR adds default Read/Write transforms for various JDBC flavors that abstracts out driver management.

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

[ ] Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
[ ] Update CHANGES.md with noteworthy changes.
[ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

R: @robertwb


factory function not recognize 1 as amount of objects

Trying to make a test with random number of factory objects
// Create n references
$references = factory(Reference::class, mt_rand(1,5))->make();

When I iterate on objects I getting true
// Iterate on references
foreach($references as $reference){
  dump($reference);
}

Result: true
I suppose that calling factory function with the second argument as a number, the factory should return a Collection of that amount of elements.

This is not really an issue.


How to use your code to get x,y,w,h of each window

Hi,
Thanks so much for sharing your nice code
I was wondering if I can extract the center of each rectangular and width and height of the rectangular using your code?How to use your code to get x,y,w,h of each window ?
Best regards,
Mohammad

Hi Mohammad,
Thanks for your questions.
For a window defined by x, y, w, h, the center will be (x + w/2, y + h/2).
To get each window as an (x, y, w, h) tuple, I would suggest starting at line 68 in the code and making the following modifications.
windows = {} # Window tuples (x, y, w, h)
wid = 0 # Window ID

for _ in trange(iterations):
        if h > min_height and w > min_width:
            hw, hh = w // 2, h // 2

            # Original Image Integral Image bounding box
            tl = I[y+hh, x+hw] + I[y, x] - I[y, x+hw] - I[y+hh, x]          # Top Left
            tr = I[y+hh, x+w] + I[y, x+hw] - I[y, x+w] - I[y+hh, x+hw]      # Top Right
            bl = I[y+h, x+hw] + I[y+hh, x] - I[y+hh, x+hw] - I[y+h, x]      # Bottom Left
            br = I[y+h, x+w] + I[y+hh, x+hw] - I[y+hh, x+w] - I[y+h, x+hw]  # Bottom Right
            # Squared Grayscale Image Integral Image bounding box
            tls = Isq[y+hh, x+hw] + Isq[y, x] - Isq[y, x+hw] - Isq[y+hh, x]
            trs = Isq[y+hh, x+w] + Isq[y, x+hw] - Isq[y, x+w] - Isq[y+hh, x+hw]
            bls = Isq[y+h, x+hw] + Isq[y+hh, x] - Isq[y+hh, x+hw] - Isq[y+h, x]
            brs = Isq[y+h, x+w] + Isq[y+hh, x+hw] - Isq[y+hh, x+w] - Isq[y+h, x+hw]
            # Grayscale Image Integral Image bounding box
            tlg = Ig[y+hh, x+hw] + Ig[y, x] - Ig[y, x+hw] - Ig[y+hh, x]
            trg = Ig[y+hh, x+w] + Ig[y, x+hw] - Ig[y, x+w] - Ig[y+hh, x+hw]
            blg = Ig[y+h, x+hw] + Ig[y+hh, x] - Ig[y+hh, x+hw] - Ig[y+h, x]
            brg = Ig[y+h, x+w] + Ig[y+hh, x+hw] - Ig[y+hh, x+w] - Ig[y+h, x+hw]

            tlw, tlh = hw, hh
            trw, trh = w - hw, hh
            blw, blh = hw, h - hh
            brw, brh = w - hw, h - hh

            edited[y:y+hh, x:x+hw] = tl / (tlw * tlh)
            edited[y:y+hh, x+hw:x+w] = tr / (trw * trh)
            edited[y+hh:y+h, x:x+hw] = bl / (blw * blh)
            edited[y+hh:y+h, x+hw:x+w] = br / (brw * brh)

            if set_border:
                border(edited[y:y+hh, x:x+hw])
                border(edited[y:y+hh, x+hw:x+w])
                border(edited[y+hh:y+h, x:x+hw])
                border(edited[y+hh:y+h, x+hw:x+w])

            heapq.heappush(quadrants, (-error(tlg, tls, tlw * tlh), x, y, tlw, tlh, wid+0))
            heapq.heappush(quadrants, (-error(trg, trs, trw * trh), x + hw, y, trw, trh, wid+1))
            heapq.heappush(quadrants, (-error(blg, bls, blw * blh), x, y + hh, blw, blh, wid+2))
            heapq.heappush(quadrants, (-error(brg, brs, brw * brh), x + hw, y + hh, brw, brh, wid+3))

            windows[wid+0] = (x, y, tlw, tlh)
            windows[wid+1] = (x + hw, y, trw, trh)
            windows[wid+2] = (x, y + hh, blw, blh)
            windows[wid+3] = (x + hw, y + hh, brw, brh)

            wid += 4

        if quadrants:
            _, x, y, w, h, uid = heapq.heappop(quadrants)
            del windows[uid] # Remove a splitted window
        else:
            break

windows = list(windows.values()) # This will store all windows in the final image as (x, y, w, h) tuples.

Thanks so much for your nice reponse!


Licenses list

added a licenses.json file generated by deps-by-license

lots of things here shouldnt have made it into the PR. should literally only be one commit. I'll try again later


How to speed up sat cp using strategies (counting elements in list and adding counts)

I have a list of IntVars and want to count elements in it. Afterwards I want to add those counts.
Therefore I create a BoolVar for each element and possible element I want to count.
In my case:

without counting it takes 6 seconds
with counting each element it takes 10 seconds
adding all element counts to one total count takes 95 seconds

I also tried to add some redundant constraints which seems to make it even worse.
Are there some in-builds to do it, like count it without creating bools?
Example to show what I am doing in principle:
from ortools.sat.python import cp_model
from ortools.sat import sat_parameters_pb2
from timeit import default_timer as timer

##########################################
#Helper functions
def negate_boundary_interval(bounds):
    #max/min values from https://github.com/google/or-tools/blob/b535ae2ab1980a76ad808e309eab4a587ff25d92/ortools/sat/python/cp_model.py
    INT_MIN = -9223372036854775808
    INT_MAX =<PHONE_NUMBER>854775807

    def checkbounds(a,b):
        return a <= b

    def cap_int_64(v):
        """Restrict v within [INT_MIN..INT_MAX] range."""
        if v > INT_MAX:
            return INT_MAX
        if v < INT_MIN:
            return INT_MIN
        return v

    res = []
    #check beginning
    a = INT_MIN
    b = bounds[0]-1
    if checkbounds(a,b):
        res += [cap_int_64(a),cap_int_64(b)]
    for i in range(1,len(bounds)-1,2):
        a = bounds[i]+1
        b = bounds[i+1]-1
        if checkbounds(a,b):
            res += [cap_int_64(a),cap_int_64(b)]
    #check end
    a = bounds[len(bounds)-1]+1
    b = INT_MAX
    if checkbounds(a,b):
        res += [cap_int_64(a),cap_int_64(b)]
    return res

def negate_boundary_integer_expression(bid):
    return cp_model.BoundIntegerExpression(bid.Expression(),negate_boundary_interval(bid.Bounds()))

def expr_to_bool(expr,model):
    eq = model.NewBoolVar("")
    if isinstance(expr,cp_model.IntVar):
        expr = expr >= 1
    elif isinstance(expr,cp_model.BoundIntegerExpression):
        pass
    else:
        raise ValueError("unsupported type {}".format(type(e)))
    model.Add(expr).OnlyEnforceIf(eq)
    model.Add(negate_boundary_integer_expression(expr)).OnlyEnforceIf(eq.Not())
    return eq

def exprs_to_bool(exprs,model):
    eqs = []
    for e in exprs:
        eq = expr_to_bool(e,model)
        eqs.append(eq)
    return eqs

#Helper functions end
##########################################

model = cp_model.CpModel()
jobs = []
for dt in range(0,24*4):
    jobs.append(model.NewIntVar(0,3,""))
counts = []

for c in range(3):
    c_count = model.NewIntVar(0,24*4,"")
    bools = exprs_to_bool([j==c for j in jobs],model)
    model.Add(c_count==sum(bools))
    counts.append((c_count,bools))

total_count = model.NewIntVar(0,24*4,"")
model.Add(total_count==sum([c[0] for c in counts]))

#makes it even slower?
#for i in range(len(jobs)):
#    model.AddBoolXOr([counts[c][1][i] for c in range(len(counts))])

solver = cp_model.CpSolver()
solver.parameters = sat_parameters_pb2.SatParameters(num_search_workers=3)
t = timer()
state = solver.Solve(model)
state,timer()-t

If I just add the intvar total_count without the constraint that it is the sum it is even slower(300 seconds). If I add another intvar foo it just needs 10 seconds?! :confused:
Therefore I think it is because of the selection type used but I am not sure how AddDecisionStrategy works.

What happens if I have multiple cp_model.CHOOSE_FIRST. The first one in the model creation order is chosen?
By default all variables are added to a selection:

Are all variables by default in one selection or has each one its own?
Are they removed from the default selection if they are set in one selection manually?

What happens if one variable is in multiple selections? Is the first selection of a variable used? (I found it for another cp solver but I am unsure about cp sat)

For the list element counting DecisionStrategyProto::CHOOSE_LAST might be quite fast.
https://github.com/google/or-tools/blob/507cfbea267358e7cfea752e3ac8d14cf08a93f6/ortools/sat/cp_model.proto
Although I am not sure how to implement it in the integer_search.
Thank you :)

Here is my version:
from ortools.sat.python import cp_model
from ortools.sat import sat_parameters_pb2
from timeit import default_timer as timer

def add_count_eq(vars, value, count, model):
    boolvars = []
    for var in vars:
        boolvar = model.NewBoolVar('')
        model.Add(var == value).OnlyEnforceIf(boolvar)
        model.Add(var != value).OnlyEnforceIf(boolvar.Not())
        boolvars.append(boolvar)
    model.Add(count == sum(boolvars))

model = cp_model.CpModel()
jobs = []
for dt in range(0,24*4):
    jobs.append(model.NewIntVar(0,3,""))
counts = []

for c in range(3):
    c_count = model.NewIntVar(0,24*4,"")
    add_count_eq(jobs, c, c_count, model)
    counts.append(c_count)

total_count = model.NewIntVar(0,24*4,"")
model.Add(total_count==sum(counts))

solver = cp_model.CpSolver()
solver.parameters.num_search_workers = 1
t = timer()
state = solver.Solve(model)
print(state,timer()-t)

It outputs:
(2, 0.057016849517822266)

@lperron Thank you. The problem I think I have is, that the list with the numbers is linked to some other constraints, which causes really inefficient branching. I couldn't figure a way out for a small slow working example.
I tried to improve it using DecisionStrategys but I am unsure how they work.
How I think they work:

If more then one strategy is added, the variables of the first strategy are set first.
If a variable is added to more then one strategy it is set using the first strategy in which it occures
In each strategy each variables is assigned a value where the best (+random) variable is chosen using its value
If 'assign_all_variablesis set, variables with no strategy are added to a strategy usingFirstUnassignedVarAtItsMinHeuristic`, which is solved last.
If multiprocessing is enabled, the strategies are still calculated in order, but some parameters are changed so it explores the search space by changing more or less random variable assignments.
The best way to calculate group of variables in order is to create strategies for each group and add them in the correct order.

If that's the case my helper functions are rather bad and overwriting operators make no sense (#810), as I can't use strategies on the created variables.
Thank you for your help

@lperron Thank you, I also checked C++ src, but I haven't understood how the sat combined with the cp solver works in detail yet. Are there any papers about the implemented solver?

https://people.eng.unimelb.edu.au/pstuckey/PPDP2013.pdf
Laurent Perron | Operations Research |<EMAIL_ADDRESS>| (33) 1 42 68 53
00
Le jeu. 30 août 2018 à 14:48, Phibedy<EMAIL_ADDRESS>a écrit :

@lperron https://github.com/lperron Thank you, I also checked C++ src,
but I haven't understood how the sat combined with the cp solver works in
detail yet. Are there any papers about the implemented solver?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/google/or-tools/issues/830#issuecomment-417307067,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKj17XNLkuWqorIrdYq2860ntkaxpyubks5uV98IgaJpZM4WM8Zb
.

Thank you,
for discrete optimization newbies like me, I found this also quite helpful:

original paper: https://people.eng.unimelb.edu.au/pstuckey/COMP90046/lec/s9_lcg.pdf
lecture from author (section 9): https://people.eng.unimelb.edu.au/pstuckey/COMP90046/lec/

Definitely.


Airdrop Qualified But Cant Join

Hello, I got a Problem.
I did all the stuff to qualify for the airdrop and when I click "See if you Qualify" then I get all the ticks..
But once I click "Become a lucky airdropee" a new Window opens and says "You are not Qualified"..
When I click:  "See if you Qualify"

When I click: "Become a lucky airdropee"

Username: sleepycharlyy

Apparently this means we’ve been banned from the airdrops for some reason, staff isn’t coming forward and giving anyone explanations, they’re closing everyone’s posts that address this issue, you aren’t alone

Username bbqlord on keybase... Same issue here

Are you sure of that? Is there because of they leave all my accounts, and team requested me to create again all accounts (I never get back any data of course but in this cas that means they have got still data about my account they forget) but it was before airdrop announcement 🤔


Cant edit code

When I open a file to edit the code I created, I cannot type any text in the code. A this bar replaces my curser and the only way for it to get out of that mode so I can make changes to my code is by quickly pushing a lot of keys on my keyboard. Same thing happens when I create a new file and copy and past a code from somewhere else. I included a screenshot that has a circle around the bar I was talking about.

Also, When I run the code, it wont let me input any data and says I can't edit in a read only editor. How do I get out of this read only editor mode?

Do you use vim extension?

yes, it's installed

I've also tried opening a new file and just writing a new code and it still isn't letting me type anything and showing that thick bar for the curser

Do you use vim extension?

Try without VIM?

That worked!! thank you!

Ok, thanks for coming back


Unable to Create Story From Template The response is not a valid JSON response.

Bug Description
I´ve tried to use the plugin but it isn´t working. I can neither select a template nor publish a story from scratch.
This error message below pop-ups every time I try to use it:
Unable to Create Story From Template
The response is not a valid JSON response.
This error below pops up every time I try to publish a new story:
Failed to save story
Screenshots

Additional Context

Plugin Version: 1.1.1
WordPress Version: 5.5.3
Operating System: macOS Big Sur
Browser: Chrome
PHP version: 7.4

Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance Criteria

Implementation Brief

Hi there,
Thanks for your report.
Does this still happen with all other plugins disabled?
Is your site behind a Web Application Firewall like Succuri or Cloudflare?

Hi, thanks for answering.
Hmm, I didn't try it because I have contactform7, jetpack, and other native plugins of my website theme running. Should I disable all of them?
About the second question, yes, I am using the extra security mode of Dreamhost. It is not Cloudflare, I guess the name of the WAF is OWASP mod_security.

Hi, I´ve just uninstalled my WAF and now it is working. Thanks.
However, let me know when you guys fix that error because I am not sure if it is a good idea to run a website without WAFs.
Cheers

Glad to hear that helped! An alternative to fully disabling the WAF is to disable it only for certain routes, for example /wp-json/web-stories/v1.
With that said, our next release will include some compatibility improvements in this area. This way you won't need to do any of that.
If there are still issues with our upcoming release and the WAF, please let us know in the support forums.
Thanks!

Great tip! Thanks for the help Pascal.
See you


Controlling the pulse width

Is there a way to set the pulse width. It looks like it's currently about 5us on the nano.

No. The pulse is set to high by the output compare match and set to low in the interrupt.
Changing it configurable, would me

No. The pulse is set to high by the output compare match and set to low in the interrupt.
Changing it configurable, would me

It seems my driver card does not react on a 5us pulse. How would I solve this? Is there not way to make a fixed patch for creating a longer pulse. I can't find in the code where the timer is set to 5 us.


Error: No such command "serve_chat".

I am trying to run the query chat_web_best_weights_training.bat and I am getting the displayed in the screenshot. I have tried all the possible solutions available regarding this but then also it is giving the same error.
My chat_ui.html and all the other python files are in the root directory seq2seq-chatbot.
Tensorflow version is 1.15.0 and flask version is 0.12.4
Please look into the problem. Thankyou!!

try
pip install click==6.7
this resolved my same problem


[Help Wanted]: LanguageServerProtocol.ServerError 8

Before Reporting

[X] I have checked FAQ, and there is no solution to my issue
[X] I have searched the existing issues, and there is no existing issue for my issue

Describe your issue
Until a week or two ago, I had been using Copilot for Xcode without any issues. However, at some point, suggestions just stopped (even Editor/Copilot/Get Suggestions doesn't work).
I've completely uninstalled and re-installed the app, double- and triple-checked permissions, re-installed the language server, signed out and back in multiple times, rebooted multiple times, and much more. I've been at this for many hours today.
Yes, I have a Copilot subscription on GitHub, and indeed, it's still active. In fact, Visual Studio Code on the same machine shows suggestions just fine using the same GitHub account.
The language server shows Copilot.Vim v1.25.0, language server version is 1.94.0, and its status is "OK". On occasion, when I switch away from the Service tab and back, I see a red "The operation couldn't be completed. (LanguageServerProtocol.ServerError 8.)" message.
When I look at the Console log, the only lines that stand out are:
error	16:02:23.026664-0700	CopilotForXcodeExtensionService	stderr: [ERROR] [default] [2024-04-05T23:02:23.026Z] Request Error: (FetchError) unable to get local issuer certificate
error	16:02:23.028335-0700	CopilotForXcodeExtensionService	stderr: [ERROR] [ghostText] [2024-04-05T23:02:23.028Z] Error on ghost text request: (FetchError) unable to get local issuer certificate

Is anyone familiar with this issue? Or are there local certificates that I might be missing. I've looked through issues, the FAQ, the wiki, and more, and I've come up empty.

Are you using a self-signed certificate for any of the GitHub domain names? You can the workaround in #455, which imports certificates in your keychain into Node.

I've finally returned to using the Copilot integration, and it seems to be working now (without changing anything, other than an upgrade to the app).
For what it's worth, I am not using any self-signed certificates, which is why this was confusing to me. But, it's resolved itself, so I'll close this issue. Thanks!


Question about polygon clipping

Hi - great library as always. :+1:
One question - in the readme you mention it could be used for polygon clipping. Can you give a hint to how that might work?  Or did that refer testing whether polygons overlap a clipping area, as opposed to actually doing the clipping?
(My motivation here is wondering whether box-intersect could be useful in frustum-culling a 3D scene, faster than with octrees.)
Thanks!

Hi,
I think that for frustum culling a 3D scene you might be better off just
brute forcing the whole thing (via an O(n) scan of the data) than using
box-intersect (which takes O(n log^3(n)) time.  Octrees would probably be
even slower.
On Sat, Apr 4, 2015 at 10:36 PM, Andy Hall<EMAIL_ADDRESS>wrote:

Hi - great library as always. [image: :+1:]
One question - in the readme you mention it could be used for polygon
clipping. Can you give a hint to how that might work? Or did that refer
testing whether polygons overlap a clipping area, as opposed to actually
doing the clipping?
(My motivation here is wondering whether box-intersect could be useful in
frustum-culling a 3D scene, faster than with octrees.)
Thanks!
—
Reply to this email directly or view it on GitHub
https://github.com/mikolalysenko/box-intersect/issues/2.

Thanks, that makes sense. I'd thought Octrees would in principle be under linear time, but I it depends on having an ideally constructed octree.


Since Windows 2019 20200714.1, the CopyFiles task can fail with EPERM

Describe the bug
This one is a bit complicated:
I have a repository with symlinks, both file symlinks and directory symlinks. To further complicate things, there are also Git submodules involved and some symlinks point into submodules.
Symlinks on Windows (as opposed to Unix) are different in that there are different kinds for files and folders respectively.
I clone the main repository and Git checks out the working tree. By that time, the target of the symlinks is not available yet, because the submodules haven't been cloned yet. This results in Git not being able to correctly create the necessary symlinks: For directory symlinks, Git cannot see that they should point to folders (the Git symlink metadata doesn't carry this information), so Git on Windows guesses "file symlink" -a---l instead of the correct "directory symlink" d----l.
In summary: File symlinks into submodules are correct after the initial clone, Directory symlinks are broken.
This alone should not pose a problem as long as nothing tries to do something with the broken symlinks. Introduce CopyTask@2.
With the image version change from 20200706.1 to 20200714.1, the CopyTask@2 with
  - task: CopyFiles@2
    inputs:
      contents: "full/path/to/com.my-android-app.apk"
      targetFolder: $(build.StagingDirectory)
      flattenFolders: true

consistently fails with ##[error]Unhandled: Failed find: EPERM: operation not permitted, stat 'd:\a\1\s\path\to\unrelated\broken\directory\symlink'
even though nothing in the task comes even close to referencing the broken directory symlink.
Area for Triage:
?
Question, Bug, or Feature?:
Combination of bugs.
 The image is only a vehicle to trigger the combination of issues.


More fixes for out-of-tree build:

Generate version header in the build tree
Generate .res file in the build tree on Windows
Add the $(SRC_PATH) prefix to the .def files on Windows

Except for the detail about //fo vs -fo, these changes look good to me.

@ghismary could you kindly add a commit to fix the detail as mentioned above in comments? Thanks a lot.

I have added the commit to replace the /fo option by -fo.

@ghismary thanks a lot.


Indexation of the library doesn't work

The following exception occurred
{ 	"context": "ExceptionsHandler", 	"level": "error", 	"message": "EACCES: permission denied, scandir '/volume1/Library/Beer'", 	"stack": [ 		"Error: EACCES: permission denied, scandir '/volume1/Library/Beer'" 	], 	"timestamp": "2022-07-17T14:21:29.767Z" }

To fix this error permissions should be assigned to the homelibrary user


IE9 and backspacing

Hello, love this plugin.  I have one issue and that's with people with IE9.  The textarea expands nicely but when you backspace to remove characters or highlight and delete them the textarea does not contract until the user begins typing again.

Hmm this is weird.  I wonder if the propertychange event is not firing when they press backspace.  We could capture the backspace keyup or keypress event instead if we need to do this?  I'll need to wait until I have access to IE9 to test this.
To test this, you could change this line:
textarea.bind("input.expanding propertychange.expanding", resize);
to
textarea.bind("input.expanding propertychange.expanding keyup.expanding", resize);
I'll check this when I get a chance if you can't.

Also, can you tell me if you have the same issue with the demo on this page?
http://www.alistapart.com/articles/expanding-text-areas-made-elegant/


Etcd backup to use its own http transport

https://github.com/rancher/rancher/issues/24347
https://github.com/rancher/rancher/issues/23231

LGTM

@cjellick can you review https://github.com/rancher/rancher/pull/24348/commits/d9375d6324fbe5c19906c5ab25186a2e8fbc91fd. Once approved, I'll remove the vendor commit (as it's no longer needed) before merging the pr

change looks good. one other concern: do you think there's any chance this could either leak or starve connetion resources?
Like, we are creating a new transport per handler execution. Are you relatively confident the underlying connections get cleaned up?
This area confuses me a bit, so I cannot answer that question definitely myself

@cjellick good point. Will see what can be done here


More tweaks

Related: https://github.com/openshiftio/openshift.io/issues/1441

@msrb Your image is available in the registry: docker pull registry.devshift.net/fabric8-analytics/worker-scaler:SNAPSHOT-PR-23


msxh0 smart humidifier not fully supported

2.4.3
Hi, I know it isn't declared as supported, but I'd like to inform that it is seen by your module as an RGB light and it works correctly... it is just missing the "fan" component as the cloud meross component shows.
Having the device I can help you to test if needed.
Thank you for your great work

Hello @pierpa68 ,
Thank you for reporting this. I would really need a device trace captured from meross_lan in order to further investigate the device capabilities and maybe try to implement more functionalities.
You could enable tracing in the Integration configuration entry for the msxh0 and then upload it here so I could have a look at it.
Thank you!

Hi,
thanks for your quick answer. I attach my log here as suggested and hope it can be of any help.
I think the missing function could be the "spray" appearing in the log. Actually it has 2 modes of working: continuous and intermittent (so are called in the cloud version of the Meross integration).
 The 'spray' capability is already supported but due to the way the devices are implemented in code this is not available when the device presents itself as a 'light' entity :(
That should be an easy fix even though I'm a bit busy at the moment. I hope to be able to get back at meross_lan by the end of the month right in time before the new HA release


Is it possible for keybord shortcut remapping to remap second-stroke?

📝 Provide a description of the new feature
What is the expected behavior of the proposed feature?  What is the scenario this would be used?
Like this:

when i type alt+w,q (press alt, press w,release w, press q, release q, release alt), the shortcut will be triggered.

If you'd like to see this feature implemented, add a 👍 reaction to this post.

This is chords.  Tracked in #6976

This is chords.  Tracked in #6976


Wrong generated code for association member variables list if the class is named "A" when in "show files in different tabs" mode

Consider the following Umple code
class A{ } class C{       * -- * A; }
This generates the following code for the Type of the list in the generated code:
`
//------------------------
// MEMBER VARIABLES
//------------------------
//C Associations
private List as;
//------------------------
// CONSTRUCTOR
//------------------------
public C()
{
as = new ArrayList();
}
//------------------------
// INTERFACE
//------------------------
public A getA(int index)
{
A aA = as.get(index);
return aA;
}
public List getAs()
{
List newAs = Collections.unmodifiableList(as);
return newAs;
}
`

This is a duplicate of #970, I think.
Also, when you paste multiline code fragments, use three ` symbols.

This was resolved some time ago


Added @discardableResult to the then statements to silence the unused…

… warnings (that do not dissapear with _ -> Void)
I'm not sure this is the preferred behaviour, but the 'result of .. unused' warnings where irritating me. Trying to silence 'm with .then { _ -> Void in wasn't working either.

Dupes #549, #551, #561, #574, #584 and #595.


[jfp & jfpwor] occasional stall of window focus on mouse over

Not necessarily easy to reproduce ...
here's a picture of my window layout:

With windows as pictured above, and pharo opened full screen , select RowanClientServices and then very slowly move your mouse to the right edge of the Console and over the Browser window (see screen shot below and note the location of the mouse pointer in the grey title bar)

Loop the cursor over the category and method panes, then back up into the gray area ... and click on window to bring it to the top.
now avoid going over any of the popup menus  and move the mouse back over the method pane and note that pane is not activated (no auto-highlighting of the mouse over selection) ... at this point the next click is swallowed and it takes a second click to get window focus ...

The looping over the pane BEFORE activating the window seems to be critical ...
The first several times that I reproduced the  problem, I clicked on the browser window (activating the window) and stayed in the gray area until I navigated back to the project pane (avoiding all other panes) and when I moused over project pane it was not activated ... however, after several times trying to fine tune my description and take pictures, it stopped reproducing ...  the procedure above seems to consistently reproduce ...
In case it matters, the first project I had selected in the console was FileSystemGs and then I clicked on RowanClientServices (even though RemoteServiceReplication is selected in the pictures)... and moved slowly to edge of console pane before activating the underlying package browser ... so the full sequence was select FileSystemGs then do step 2 above ... and so on

JadeiteForPharo ef765d7
PharoGemStoneFFI 3575de4
RemoteServiceReplication 9a3398d
-------
Rowan3Stub 4d2b62bc3


Update readme to use Sampler instead of now deprecated QuantumInstance

Summary
Fixes #278
Replaced QuantumInstance usage by Sampler.
Also updated the main description a little.
Details and comments

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 75.793%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
645

Relevant Lines:
851

💛  - Coveralls


.GPDSC location clarification

The specification https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_generators_pg.html#element_generator only specifies that the .gpdsc is located in the specified absolute path or relative to the workingdir.
This is problematic if multiple contexts for different boards/component-sets use the same generator in the same project.
The output-dirs[gendir] property introduced in the csolution / cproject-yml files should solve this problem since this allows specification in a context aware way.
Ideally both the .gpdsc and the generated files created by the generator should  end up in the user-configurable output-dirs[gendir]-location.
Backwards compatibility
Since not all generators will be aware of the output-dirs[gendir] from the $G parameter, the tools should look for .gpdsc in a few different places:

First look for it in the output-dirs[gendir] folder.
If not in 1, then look according to PDSC specified location which is relative to WorkingDir / Absolute path specified

@slhultgren - you are raising the same generator used by multiple different target-types. How about multiple generators?

Here are proposed tables for paths in the different cases. @ReinhardKeil What do you think?
Where is gendir specified and what is the result?

csolution
cproject
clayer
component
Resulting folder for generated code and primary GPDSC location (look here for GPDSC first but if not found look in "Resulting GPDSC location" in workingDir table below)

n/a
n/a
n/a
referenced by project
$project/gendir-default

n/a
n/a
n/a
referenced by layer
$layer/gendir-default

gendir
n/a
ignored
referenced by project
$solution/gendir

gendir
n/a
ignored
referenced by layer
$solution/gendir

ignored
gendir
ignored
referenced by project
$project/gendir

ignored
gendir
ignored
referenced by layer
$project/gendir

n/a
n/a
gendir
referenced by project
$project/gendir-default

n/a
n/a
gendir
referenced by layer
$layer/gendir

Priority order:

project – most important
solution
layer

gendir-default: ./generated
Where is workingDir specified and what is the result?

  When a company (i.e. MLOps) provider has an own generator, this may create a conflict.  There is not just one *.GPDSC file in such cases.
Have you considered that type of workflows?
I'm still leaning towards a Cclass specific settings as outlined here:
https://github.com/Open-CMSIS-Pack/devtools/blob/main/tools/projmgr/docs/Manual/Proposals - OutofScope.md#rte-dirs
I had not enough time to work on the aspects of multi-core yet with CMSIS-Toolbox 1.5.0 (as this version should fix the existing CubeMX workflow).

clarifying /package/generators element  the workingDir description:

If a  is described in a  file then a relative path in workingDir is relative to the pdsc file
If a  is described in a  file a relative path in workingDir is relative to the gpdsc file
If no workingDir is specified, the project directory is used.

this is either the directory where the cproject.yml or clayer.yml file is located, depending on where the components associated with a generator are listed.
Note: components of a single generator must not be distributed across cproject and clayer files.

Thanks for clarifying the relative workingDir case, makes sense :)

Note: components of a single generator must not be distributed across cproject and clayer files.

Hmm, this seems like a bit problematic, but indeed highlights the issue with placing certain files in the $layer folder (which I don't really like personally)
My belief is that the user is focused on the project. This is where they would expect files to be created. IMO the layer is only a "header-file" that is included by the project. The "build artifacts" and sources are still project focused.
Compare cproject.yml using a clayer.yml with a .c file doing a #include "my_layer.h"

Here is a proposal that could simplify the situation:
Definitions:
“gen-attribute” is the string in the component attribute generator.
“generator-component” is a component that defines a “gen-attribute” generator in the *.PDSC file.
“working-directory” is the directory that is used to save the *.GDPSC file.
All files that are defined by a *.GDPSC file have a relative path based on the file location of the *.GDPSC file.
Practical usage (as it exists today) of working directory:
Usage-Restrictions (should be enforce with tools like packchk).

In PDSC files: the “working-directory” specification must start with $P which makes the directory relative to the project file.
In GDPSC files: the “working-directory” specification must be identical with the specification in the *.PDSC file.

New behavior of working directory (to be implemented)
Suggestion remove request to define a “working-directory” in PDSC/GDPSC files.
The default “working-directory” is the RTE directory of the “generator-component”.
Behavior of $P/%P in PDSC/GDPSC files
The parameter $P/%P refers to the project YML input file which is:

“*.cproject.yml” if the related “generator-components” are in the cproject.yml file.
“*.clayer.yml” if the related “generator-components” are in the cproject.yml file.

Extending YML input files:

gendir: overwrites the “working-directory” for all “generator-components”.  (I guess this is already implemented).

rte: overrides the default path or the RTE directory for specific Cclass name, example:
rte:
  - Device: <working-directory for Cclass Device>
  - Board: <working-directory for Cclass Device>

Verification by csolution tool:

csolution verifies consistency of “working-directory”
For a given context, all “generator-components” that have the same “gen-attribute” must refer to the same “working-
directory”. csolution reports and error when this is violated.

csolution verifies consistency of “RTE-directory”
For a given context, all “components” of the same Cclass must refer to the same RTE directory.

Some comments on the proposal from https://github.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/issues/207#issuecomment-1457954649

The execution directory and output directory are two separate things potentially. (exec_dir != output dir)

workingDir → execution directory, this is where the generator potentially expects to read some exe-relative files, like dlls or other hard-coded relative paths
output directory → where the generator will create files such as the .gpdsc

$P is currently defined as "current project folder", is the new %P the resolving to current project file name e.g. 'test.cproject.yml'?
Changing the default working-dir to RTE folder will potentially break existing generators. I think the default working dir should be kept in the project directory as the current specification states.

The default values of gendir and rtedir to be either layer relative or project relative depending on where the component is specified seems hard to use in practice:

The requirement that all components of the same Cclass must refer to the same RTE directory effectively makes layers very hard to use in a proper project with default values. E.g. if the cproject uses a Device:startup, then no layer can use ANY Device component since the "Device-rtedir" will be inconsistent for project-components and layer-components.

The requirement that a generator may only have a single output folder seems like a subtle but major limitation for the usage of generated components between layers and cprojects, since the generator may then only be used either in the cproject OR in the clayer.

These seem like big hard-to-explain-limitations why certain combinations of default values and components/layers won't work.
Effectively in both of these cases, the user will be forced to use an explicit rtedir and gendir to force the files to be placed in ONLY the project.
My vote will always be to simplify and completely remove the layer-specific rtedir/gendir outputs, and say that regardless of where the components are specified, only the outputdirs from the csolution/cproject are relevant.
IMO the simplest rules would be to say (like in https://github.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/issues/207#issuecomment-1448251245):
1. A generator is launched in the workingDir

1.1. workingDir can be specified in the .pdsc like today. If left unspecified, the project directory will be used.

2. Output from the generator (which includes the gpdsc) is expected at 3 potential locations:
	Location 1 most important: "csolution/cproject-gendir"
        Location 2: gpdscloc according to the pdsc, if the pdsc specifies it
        Location 3: least important: workingDir according to pdsc if the pdsc specifies it
        Location 4: default to search in the cproject.yml-folder
        If the gpdsc is found in any location, the next locations will not be searched.
        This way newer generators that are gendir aware can start using it, while old generators will still behave like before.

2.1. Potential <generator> sections in .gpdsc have no impact

3. Whether a component is used from the cproject or clayer makes no difference, the rtefiles and generated files are always centered around the "csolution/cproject gendir/rtedir" values.

@slhultgren thanks for your feedback. Let's discuss today what is written below:
Execution Directory:
Issue 626 discusses this problem already (suggests a PATH environment variable). I understand that a CubeMX team is working on a proposal. It should be relative easy to query the execution directory within the tool. When I remember correctly this is retrieved by GetModuleFileName or similar calls within the program itself.
Working Directory:
The definition of $P needs to change in documentation as explained above as this is the current way the tools are working.

Changing the default working-dir to RTE folder will potentially break existing generators.

Yes, I agree. However, my analysis of current pack implementations makes me believe that this will work. It needs however verification.

The default values of gendir and rtedir to be either layer relative or project relative depending on where the component is specified seems hard to use in practice.

Agreed to some extend. However using gendir: or rte: as explained above provides options. Unfortunately I have no idea for a golden default behavior, but I am open for suggestions. My current suggestion is: let's try it in practice on non-trivial examples
that we currently developing as part of the reference application framework. As we agreed to support CubeMX, this could be tested using the CubeMX tool.
If we discover during these tests that other options are required, i.e. your suggested default behavior, we can change the csolution tool accordingly.

Note: If a future Cube2 tool needs a special mode, let's also discuss it.  We could add a flag for that, but I believe gendir: or rte: provides enough options for exploration.

Consider to change the name of Working Directory to Generator Output Directory

I did review my proposal to remove the Working Directory.  Unfortunately, this does not work for CubeMX for multi-processor projects or trustzone enabled projects.  Here more then one cproject.yml share the same generator settings.
I still would recommend to rename the directory to Generator Output Directory.  We could make this directory configurable a csolution.yml level.  Default when not specified is as described under https://github.com/Open-CMSIS-Pack/Open-CMSIS-Pack-Spec/issues/207#issuecomment-1457954649

This is the revised proposal for the generators element
workingDir is the default directory where generated files are stored. By default the directory is relative to the csolution.yml file (uses csolution.yml as base directory).  Using the prefix $P makes the directory relative to the cproject.yml or clayer.yml that defines the component(s) with the related generator-id.  workingDir cannot be an absolute path.
workingDir can be overwritten by using gendirs: node in csolution.yml, cproject.yml, clayer.yml. workingDir is not required, in this case an explicit gendirs: node must be specified.
gpdsc is the name of the GPDSC file that the generator creates and updates.
When using the csolution tool, the cbuild.yml file contains the generators: node that contains the GDPSC filename and the working-dir: as shown below:
generators:
   Cube2:
      working-dir: ../CubeFiles          # from `gendirs:` or if not specified from  PDSD file element <generators>
      gpdsc: MyPackName.gpdsc     # from PDSC file element <generators>

  command:

Examples that use STM32CubeMX:

stm32l4_blinky.zip is a simple project that stores the Cube configuration in .\RTE\Device<device-name>
stm32u5_blinky.zip is a TrustZone example that uses the directory ..\Boards to store the Cube configuration.

This is mostly part of the cbuild.yml today, what remains is perhaps just to clarify the purpose of these properties in the cbuild.yml.
Today working-dir in cbuild.yml is the execution directory. This should be dropped.
The gendir: property should be added for the generator in the cbuild.yml and is strictly the generator output directory. This should be added
The result would then be something like
generators:
   <generator id>:
      # from `gendirs:` or if not specified from PDSC file element <generators>.
      # The place where generator should create all files
      gendir: ../CubeFiles

      # from PDSC file element <generators>. Should be created inside the working-dir above
      gpdsc: MyPackName.gpdsc

Then perhaps we could drop the gendir from the output-dirs in the cbuild.yml.

@slhultgren it looks like we are now aligned. I reflected it in the csolution documentation with this commit:
https://github.com/ReinhardKeil/devtools/commit/74f669351f8313bca4e3e4be0b01f04f92ab21e9
Before I make a pull request, could you please review.
Have a nice weekend.

@slhultgren I suggest to close this item as https://github.com/Open-CMSIS-Pack/devtools/issues/832 covers this now.

Replaced by https://github.com/Open-CMSIS-Pack/devtools/issues/880 - suggest to continue discussion there


Update 903 schema for OC3: Activity

In returns from before the 21-22 FY return, the following codes were acceptable values for the field Activity in the OC3 return: "F3", "P3".
We need to update the schema to allow these as legal values, preferably so that they are acceptable for returns before 2022 and not acceptable for returns from 2022 onwards.

Fixed in issue #187


Starting from console it takes my one/only console away. Start on boot solution???

I'm trying to get rid of my GUI/monitor and just use a serial port/terminal to control my server. Starting my hotspot takes over the console and I still need to talk to the server. This may be linux 101 that I don't understand.
Here is the batch I use to start the hotspot:
#!/bin/bash
echo "_password_" | sudo -S iptables -F
sudo iptables -t nat -F
sudo iptables-restore < /home/bob/iptables.save
sudo nmcli nm wifi off
sudo rfkill unblock wlan
sudo create_ap wlan0 eth0 TimeBandit

I wouldn't mind using systemd to start on boot but I don't think it does shell scripts???

I found SCREEN. It takes care of my immediate question. Still pretty clumsy but I don't have to have an extra monitor setting on my navstation. I need to figure out how to make that batch file run at boot.

Simple linux bash skills solve this problem.
nohup
command +space+&
2>&1 /dev/null
you can google them

and
control+z
bg


TeamfightEvent sometimes renders no heroes on losing side

steps to reproduce:

go to https://www.opendota.com/matches/3557630134/story
Scroll to the bottom to see this:

Logging out the TeamfightEvent props reveals that some heroes have deaths set to zero, so that the deaths variable only contains the winning team heroes (relevant line: https://github.com/odota/ui/blob/d4076333a26471cd3ebc2958e3fb584cd025b362/src/components/Match/MatchStory.jsx#L567)
Not sure exactly where the data is coming from so I can't trace it further, but that's probably a good place to start.

@mdiller shouldn't it say "for no heroes"?

So it looks like the reason why this is happening is I only accounted for the winning team having no deaths. I didn't realize you could win a teamfight when four of your players died and none of theirs did lol.
Guess I'll make a new string for when that happens.

I'm guessing it was gold from the buildings, or maybe a hero died weirdly (shared kill credit?) and doesn't get picked up

I'm really not sure what happened (https://www.opendota.com/matches/3557630134/teamfights)
Looks like some kind of fountain farming, but if someone wants to look at the replay maybe we can get some answers :)

Hmmm yeah maybe. I'm tempted to watch the replay and look. I thought I've been in some one sided games but heres this game with 139 - 5 kills at 43 minutes in.

probably the dark willow fountain camped the dire team, killed 4 heroes, got killed by the fountain, and gave a ton of gold to everyone on dire.  I'm not sure why the death doesn't show up on the teamfight log though

Hmmmm yeah maybe, that'd make sense. I'm going to check the replay.

What a strange game.
This happened near the end of the game, and the entire radiant team is afk in dire's fountain, killing anyone who spawns instantly.
Ancient Apparition (on dire's team) is farming in middle lane for the whole "teamfight." his farming plus the gold he gets from his three disconnected teammates means he gains about 1400 gold during the fight. That gold gain is more than the gold the radiant team got for killing four of his teammates as they spawned, and so i guess technically he "won" the "teamfight"

Looks like they went to the fountain at 30 minutes in and didn't leave until the end of the game

The second one was pretty much the same thing except the AA took radiant mid rax and t3 so its a bigger gold swing to his team

The AA ended up just pushing and winning the game because I guess the radiant just didn't care?

https://www.youtube.com/watch?v=6DGNZnfKYnU
I just noticed that dire won haha

lol yeah


prepared API [1/3]

some api change, please be niceź

Current dependencies on/for this PR:

main

PR #1  (this PR)

This comment was auto-generated by Graphite and will continue to be automatically updated while this PR remains open.


[BUG] -

Internal/External
External
Area
Other   Submitting transaction with cardano-submit-api
Summary
A transaction created with cardano-cli 1.32.1 on another computer can be send to a cardano-submit-api 1.33.0 running on a server with cardano-node 1.33.0, but when sending an identical transaction to the same server after upgrading cardano-submit-api and cardano-node to 1.34.0-rc3 (git revision 54155a28dbdb9a17e4ffe52b68f6c58af54ff83b), sending the transaction fails.
The message in the cardano-submit-api log is (I tried 2 times, and a few times yesterday):
Feb 28 16:10:04 <hostname> bash[92594]: MuxError (MuxIOException writev: resource vanished (Broken pipe)) "(sendAll errored)"
Feb 28 16:12:16 <hostname> bash[92594]: MuxError (MuxIOException writev: resource vanished (Broken pipe)) "(sendAll errored)"

After downgrading the cardano-node and the cardano-submit-api to 1.33.0, submitting the same transaction file is working as expected.
Steps to reproduce
Steps to reproduce the behavior:

Create the transaction:
 ADDRESS=$(cat wallet/dev_wallet-1.addr)
 DSTADDRESS=$(cat wallet/dev_wallet-1.addr)
 CARDANO_NODE_SOCKET_PATH=/run/cardano-node-testnet.socket

 TRANS=$(cardano-cli query utxo $TESTNET --address $ADDRESS | tail -n1)
 UTXO=$(echo ${TRANS} | awk '{print $1}')
 ID=$(echo ${TRANS} | awk '{print $2}')
 TXIN=${UTXO}#${ID}

 cardano-cli transaction build \
 --testnet-magic<PHONE_NUMBER> \
 --alonzo-era \
 --tx-in ${TXIN} \
 --change-address ${DSTADDRESS} \
 --out-file tx.raw

Sign the transaction:
 cardano-cli transaction sign \
 --tx-body-file tx.raw \
 --signing-key-file wallet/dev_wallet-1.skey \
 --testnet-magic<PHONE_NUMBER> \
 --out-file tx.signed

Encode the transaction as cbor file:
jq .cborHex tx.signed  | xxd -r -p > tx.signed.cbor

Submit the transaction:
 API_HOST=<hostname>
 API_PORT=80
 TXID=$(cardano-cli transaction txid  --tx-file tx.signed)

 curl -H "Content-Type: application/cbor" \
 --data-binary @tx.signed.cbor \
 -X POST \
 http://${API_HOST}:${API_PORT}/api/submit/tx

The following error message is displayed at the console:
Something went wrong

and on the logs of the submi-api, the messages mentioned above.
Expected behavior
The following messages were displayed when submitting the same file with the same command after downgrading to 1.33.0:
At the console:
"8347016ebf0f45a8cce982cf3619163f372f0324a23ac6706d3163d9b033d3b3"

In the logs:
Feb 28 16:19:24 <hostname> bash[95607]: [cardano-tx-submit:Info:15] [2022-02-28 14:19:24.84 UTC] txSubmitPost: successfully submitted transaction 8347016ebf0f45a8

System info (please complete the following information):

OS Name: Debian (server)

OS Version 10.11

Node version (output of cardano-node --version) (on the server. same version for cardano-submit-api):
cardano-node 1.33.0 - linux-x86_64 - ghc-8.10
git rev 54155a28dbdb9a17e4ffe52b68f6c58af54ff83b

CLI version  (output of cardano-cli --version) (on the workstation, where the transaction was created):
cardano-cli 1.32.1 - linux-x86_64 - ghc-8.10
git rev 4f65fb9a27aa7e3a1873ab4211e412af780a3648

Same error with cardano-cli 1.34.0-rc3 on the workstation (and with the transaction created on the server, but signed on the workstation and submitted from the workstation):
cardano-cli 1.33.0 - linux-x86_64 - ghc-8.10
git rev 54155a28dbdb9a17e4ffe52b68f6c58af54ff83b

Cannot reproduce running both node and submit-api on tag 1.33.0-rc3:
node/submit-api:
git log -n 1
Wed Feb 23 12:37:23 2022 +0100 54155a28d (HEAD, tag: 1.34.0-rc3) Revert bump to ledger and consensus versions.  [Nicholas Clarke]
run following in separate terminals:
nix run .#testnet/node
nix run .#testnet/submit-api

run CLI in terminal with older 1.32.1:
cardano-node
  homepage: https://cardano.org
  url: https://github.com/input-output-hk/cardano-node/archive/4f65fb9a27aa7e3a1873ab4211e412af780a3648.tar.gz
  owner: input-output-hk
  branch: refs/tags/1.32.1
  url_template: https://github.com/<owner>/<repo>/archive/<rev>.tar.gz
  repo: cardano-node
  type: tarball
  sha256: 00k9fqrm0gphjji23x0nc9z6bqh8bqrncgivn3mi3csacjzicrrx
  description: The core component that is used to participate in a Cardano decentralised blockchain.
  rev: 4f65fb9a27aa7e3a1873ab4211e412af780a3648

cardano-cli --version
cardano-cli 1.32.1 - linux-x86_64 - ghc-8.10
git rev 4f65fb9a27aa7e3a1873ab4211e412af780a3648

cardano-cli transaction build --testnet-magic<PHONE_NUMBER> --alonzo-era --tx-in 2079ae787eef5999ff63904f50a9b0f2cf77da6015086b5db75b817a8a69c0f3#0 --change-address addr_test1vrd26p8d9dlknc4fhevzudcfzuul5qm2znquytugqcw583czzqrpm --out-file tx-test.txbody
Estimated transaction fee: Lovelace 164093

cardano-cli transaction sign --tx-body-file tx-test.txbody --out-file tx-test.txsigned --signing-key-file shelley/rich-utxo.skey

xxd -r -p <<< $(jq .cborHex tx-test.txsigned) > tx.signed.cbor

curl -i --header "Content-Type: application/cbor" -X POST http://localhost:8090/api/submit/tx --data-binary @tx.signed.cbor
HTTP/1.1 202 Accepted
Transfer-Encoding: chunked
Date: Mon, 28 Feb 2022 16:02:51 GMT
Server: Warp/3.3.18
Content-Type: application/json;charset=utf-8

"892a17e27554a18148e7a4c71c6def70c3dc9873f0a56678b2ff9521a20e6bf3"%

After doing some more tests on this relay and on another one, it turns out that the bug manifests only when p2p is enabled.
I was running this testnet relay with p2p enabled. After observing that the same transaction is working on my second relay, and then again on the first relay it is not working, I disabled p2p in the config file, restarted the services (cardano-node and cardano-submit-api) and the same transaction could be submitted. Obviously it manifests only when p2p is enabled on the cardano-node.

It is a duplicate of #3568, which was fixed in input-output-hk/ouroboros-network#3606 but it is not included in 1.34.0-rc3.  Please reopen if you can reproduce this using master.

The submitapi needs to work in the next version. Freeloaderz.io depends on it. We are a coalition of 60+ pools server thousands of transactions every day and awarded Catalyst Fund8 for expansion


I need to serve to <IP_ADDRESS>

I can not serve to host <IP_ADDRESS>.
Is that possible to implement a easy way to change constant.PF_SERVICE_HOST to another value?
Today if you change _constant.PF_SERVICE_HOST, it will be overwritten to <IP_ADDRESS> before the server starts.

@engrogerio ，Thanks for reporting the issue.
May I double confirm the scenario you mentioned above is local prompt flow service (pf service start) or prompt flow serve (pf flow serve)?  And may I ask how do you change the PF_SERVICE_HOST, do you modify the corresponding source code?

My code starts the trace :
@trace
def chat(question: str = "What's the capital of France?") -> str:
    """Flow entry function."""

    if "OPENAI_API_KEY" not in os.environ and "AZURE_OPENAI_API_KEY" not in os.environ:
        # load environment variables from .env file
        load_dotenv()
    prompty = Prompty.load(source=BASE_DIR / "chat.prompty")
    # trigger a llm call with the prompty obj
    output = prompty(question=question)
    return output

I changed the PF_SERVICE_HOST like:
constants_file_path = os.path.abspath(promptflow.constants.__file__)
command = f'sudo chmod 755 {constants_file_path}'
exit_status = os.system(command)

search_and_replace(constants_file_path, 'PF_SERVICE_HOST = "<IP_ADDRESS>"', 'PF_SERVICE_HOST = "<IP_ADDRESS>"')

My scenario is: I am using promptflow on a Posit Connect deployed application.

Hi, @engrogerio ,  you may need change your code to os.path.abspath(promptflow._sdk._constants.__file__) if you want to change PF_SERVICE_HOST in the source code. Btw,  we will support config host in the future.

Add config pfs host feature and will release it in the next public version.

Hey, @YingChen1996. I want to be able to serve the /ui/traces page on <IP_ADDRESS> port 23333. Is that possible with this changes?


Combine repositories or provide similar examples

Core Library
MSAL.js v2 (@azure/msal-browser)
Core Library Version
2.14.1
Wrapper Library
MSAL Angular (@azure/msal-angular)
Wrapper Library Version
^2.1.2
Description
I submitted an issue on : https://github.com/Azure-Samples/ms-identity-javascript-angular-tutorial/issues/180
It's regarding using a role guard in Angular, that uses the MSAL lib to get Azure AD roles.
But that sample repo is using a very old Angular version and is not maintained as much as this repository it seems.
So question now, can both be combined somehow?
So that we get more up to date samples...
MSAL Configuration
No response
Relevant Code Snippets
No response
Identity Provider
No response
Source
External (Customer)

@Depechie Thanks for the feedback. We'll make sure your question is answered. cc @derisen
We maintain samples both inside of this repository and in the Azure Samples organization, such as the one you are using. While I don't think we will combine those samples into this repository, we'll make sure to keep those samples up to date.

@Depechie apologies, we had it in the backlog but didn't get a chance so far. We'll double down on updating them.


Integrate with machine learning library [4-8h] #4

Add activity for drawing numbers [8-16h] #13

@jogrimst this is the first version with the TensorFlow model

The model I use here is not perfectly trained, so the accuracy will be better in the end
I uncommented the FinalActivity, so you get a Toast to check, which number has been detected
The model is included as an asset and therefore no need to copy it to the sdcard
This is only a SNAPSHOT version :)

@sladomic I was not able to compile and test the app.

@jogrimst  travis failed too..will check tomorrow :)

@jogrimst I think I'll open a new pull request but not before Thursday. One for here and one fore numeracy


Unable to authenticate within the scope of an Azure Container Registry

Describe the bug
Given the command
az login --scope https://<my ACR name>.azurecr.io/.default --tenant <tenant id>

I receive the following error after performing the browser login:
Authentication failed

invalid_resource: AADSTS500011: The resource principal named https://<my ACR name>.azurecr.io was not found in the tenant named <my tenant name>. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: c3ce5dd8-5846-48bd-b973-7d37aa7f8300 Correlation ID: a9a9d4e9-e675-43a2-96ba-302115800e59 Timestamp: 2024-11-29 06:54:41Z. (https://login.microsoftonline.com/error?code=500011)

You can log an issue at [Azure CLI GitHub Repository](https://github.com/azure/azure-cli/issues) and we will assist you in resolving it.

The ACR name exists and it's part of the tenant whose id I am supplying.
Related command
az login --scope https://.azurecr.io/.default --tenant
Errors
Authentication failed

invalid_resource: AADSTS500011: The resource principal named https://<my ACR name>.azurecr.io was not found in the tenant named <my tenant name>. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: c3ce5dd8-5846-48bd-b973-7d37aa7f8300 Correlation ID: a9a9d4e9-e675-43a2-96ba-302115800e59 Timestamp: 2024-11-29 06:54:41Z. (https://login.microsoftonline.com/error?code=500011)

You can log an issue at [Azure CLI GitHub Repository](https://github.com/azure/azure-cli/issues) and we will assist you in resolving it.

Issue script & Debug output
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x1026da5c0>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 3.301 seconds (init: 0.123, invoke: 3.178)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 4294 in cache file under /Users/adascalu/.azure/telemetry/20241129090219906
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/cli/telemetry/__init__.py /Users/adascalu/.azure /Users/adascalu/.azure/telemetry/20241129090219906"
telemetry.process: Return from creating process 63658
telemetry.main: Finish creating telemetry upload process.

Expected behavior
successful login
Environment Summary
azure-cli                         2.67.0
core                              2.67.0
telemetry                          1.1.0
Extensions:
account                            0.2.5
alb                                1.0.0
storage-preview                  1.0.0b1
Dependencies:
msal                              1.31.0
azure-mgmt-resource               23.1.1
Python location '/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/bin/python'
Extensions directory '/Users/adascalu/.azure/cliextensions'
Python (Darwin) 3.12.7 (main, Oct  1 2024, 02:05:46) [Clang 16.0.0 (clang-16<IP_ADDRESS>)]
Additional context
No response

Thank you for opening this issue, we will look into it.

@andrei-dascalu, are you following any documentation or did you receive any error message that tells you to run az login --scope https://<my ACR name>.azurecr.io/.default --tenant <tenant id>?


Fix RuntimeError. torch 1.12

PyTorch 1.12
RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript (most recent call last):
  File "/xxxxx/efficientdet-pytorch/effdet/loss.py", line 210, in loss_fn
        cls_losses.append(cls_loss.sum())   # FIXME reference code added a clamp here at some point ...clamp(0, 2))

        box_losses.append(_box_loss(
                          ~~~~~~~~~ <--- HERE
            box_outputs[l].permute(0, 2, 3, 1).float(),
            box_targets_at_level,
  File "/xxxxx/efficientdet-pytorch/effdet/loss.py", line 134, in _box_loss
    normalizer = num_positives * 4.0
    mask = box_targets != 0.0
    box_loss = huber_loss(box_outputs, box_targets, weights=mask, delta=delta, size_average=False)
               ~~~~~~~~~~ <--- HERE
    return box_loss / normalizer
  File "/xxxxx/efficientdet-pytorch/effdet/loss.py", line 97, in huber_loss
    loss = 0.5 * quadratic.pow(2) + delta * linear
    if weights is not None:
        loss *= weights
        ~~~~~~~~~~~~~~~ <--- HERE
    if size_average:
        return loss.mean()
RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.

@rwightman , can you pay attention to this fix?


Issues with Image Builder: How to get support

If you are seeing issues with AIB, please refer to the troubleshooting documentation, and if you still need assistance, please select right product and support topic, doing this will mean it the Azure VM Image Builder support team seeing it.
Selecting the case product:
Product Family: Azure
Product: Virtual Machine Running Windows
Support Topic: Management
Support Subtopic: Issues with Azure Image Builder
This is important so it gets routed to the right AIB support team.
Thanks!

@danielsollondon When I try to open an issue on https://support.serviceshub.microsoft.com/ and select "Azure" and "Virtual Machine Running Windows" I am redirected to https://portal.azure.com/#create/Microsoft.Support where the selections you list above are not present. Is there another location to be able to log issues?

@danielsollondon I'm not sure how to get my issue resolved but I'd like to share some awareness, I currently have two image templates that are stuck in a "cancelling" state even though there are no other resources attached to it.
The IT_ resource group that was made during the pipeline process wouldn't respond to the remove-AzImageBuilderTemplate command because the image template provisioning state was stuck in "cancelling". Since nothing else was working, I tried to see what would happen if I deleted those resources manually and the image template still won't delete. This is all on my $150 dev account so there is no support plan attached to it - is there a way to get these image templates to come out of the "cancelling" state?


add docs for bulk sigs and contract orders

Motivation
It'd be useful to have an entry point for engineers who want to take advantage of the new big features in 1.2.
Solution
Add some docs on bulk order creation and contract orders.
EDIT: Easier to review here https://github.com/ProjectOpenSea/seaport/blob/dan/2023/02/add-bulk-sig-contract-order-docs/docs/SeaportDocumentation.md#contract-orders

Codecov Report
Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (39bea72) compared to base (791bdcf).
Patch has no changes to coverable lines.

: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             @@
##              main      #968    +/-   ##
==========================================
  Coverage   100.00%   100.00%
==========================================
  Files           46        46
  Lines         2650      2412   -238
  Branches       396       354    -42
==========================================
- Hits          2650      2412   -238

Flag
Coverage Δ

foundry
?

production
100.00% <ø> (ø)

reference
100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


Errors.

ABP Opera addon - not working filters
only uBlock help he run
hostsMan - this source is not compatible
http://skrinshoter.ru/s/050619/tLG1vHaW?a
not work  comments on
https://3dnews.ru/
https://3dnews.ru/988455
Energized Ultimate Protection
keweonDNS changed in the settings of the router, and even in the system using DnsJumper
but the DNS security check failed on the site, although I’m sure that the DNS has changed

Can you help with the log for those broken comments?

I can confirm that neither ABP or Opera can use the lists at the time of writing due to the absence of [Adblock Plus n.n] headers. This is currently being worked on at last.


[tool_crash] FileSystemException: Creation failed, OS Error: No such file or directory, errno = 2

Command
flutter doctor

Steps to Reproduce

...
...
...

Logs
FileSystemException: Creation failed, OS Error: No such file or directory, errno = 2
#0      _Directory.createSync (dart:io/directory_impl.dart:133:7)
#1      ForwardingDirectory.createSync (package:file/src/forwarding/forwarding_directory.dart:20:16)
#2      ErrorHandlingDirectory.createSync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:433:22)
#3      _runSync (package:flutter_tools/src/base/error_handling_io.dart:597:14)
#4      ErrorHandlingDirectory.createSync (package:flutter_tools/src/base/error_handling_io.dart:432:12)
#5      EngineCachedArtifact.updateInner (package:flutter_tools/src/cache.dart:918:19)
<asynchronous suspension>
#6      CachedArtifact.update (package:flutter_tools/src/cache.dart:812:5)
<asynchronous suspension>
#7      Cache.updateAll (package:flutter_tools/src/cache.dart:681:9)
<asynchronous suspension>
#8      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1293:7)
<asynchronous suspension>
#9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1183:27)
<asynchronous suspension>
#10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#12     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>

[✓] Flutter (Channel stable, 3.0.3, on macOS 11.6 20G165 darwin-x64, locale de-DE)
    • Flutter version 3.0.3 at /Applications/Coding/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 676cefaaff (22 hours ago), 2022-06-22 11:34:49 -0700
    • Engine revision ffe7b86a1e
    • Dart version 2.17.5
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/lorenzo/Library/Android/sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: /Applications/Coding/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Coding/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/Coding/IntelliJ IDEA.app
    • Flutter plugin version 65.1.4
    • Dart plugin version 213.5744.122

[✓] VS Code (version 1.56.1)
    • VS Code at /Applications/Coding/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • macOS (desktop) •

Closing this issue as a duplicate of https://github.com/flutter/flutter/issues/65242