attach a model (One To One) with user-plugin user model, when update user model it throw Errors

attach a model(company model) to user model  with One To One relationship,when update user it throws a errors,below is the messages:

below is my configuration
Plugin.php settings
    /**
     * Boot method, called right before the request route.
     *
     * @return array
     */
    public function boot()
    {
        Carbon::setLocale('zh');
        UserModel::extend(function ($model) {
            $model->addFillable([
                'b7_mobile',
                'b7_address',
                'b7_enterprise'
            ]);

            $model->hasOne['company'] = ['Buuug7\User\Models\Company', 'table' => 'buuug7_user_companies','key' => 'user_id',];
            $model->hasMany['need'] = ['Buuug7\User\Models\Need', 'table' => 'buuug7_user_needs',];
        });

        UsersController::extendFormFields(function ($widget) {
            if (!$widget->model instanceof UserModel) {
                return;
            }
            $configFile = __DIR__ . '/config/profile_fields.yaml';
            $config = Yaml::parse(File::get($configFile));
            $widget->addTabFields($config);
        });

    }

Company.php model
/**
 * Company Model
 */
class Company extends Model
{
    use \October\Rain\Database\Traits\Validation;
    /**
     * @var string The database table used by the model.
     */
    public $table = 'buuug7_user_companies';
    /**
     * @var array Guarded fields
     */
    protected $guarded = ['*'];
    /**
     * @var array Fillable fields
     */
    protected $fillable = [
        'user_id',
        'name',
        'address',
        'contact_phone',
        'description',
        'detail',
        'status',
        'checked'
    ];
    /*
    * Validation
    */
    public $rules = [
        'name' => 'required',
        'address' => 'required',
        'contact_phone' => 'required',
        'description' => 'required',
        'status' => 'required',
    ];
    /**
     * @var array Relations
     */
    public $belongsTo = [
        'user' => ['RainLab\User\Models\User'],
    ];

migration file
class CreateCompaniesTable extends Migration
{
    public function up()
    {
        Schema::create('buuug7_user_companies', function(Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->integer('user_id')->unsigned();
            $table->string('name')->nullable();
            //$table->string('slug');
            $table->string('address')->nullable();
            $table->string('contact_phone')->nullable();
            //$table->string('logo')->nullable();
            $table->string('description')->nullable();
            $table->longText('detail')->nullable();
            $table->boolean('featured')->default(0);
            $table->boolean('checked')->default(0);
            $table->timestamp('checked_at')->nullable();
            $table->enum('status', ['un_committed','committed','checking', 'passed', 'not_passed'])->default('un_committed');
            $table->text('not_passed_message')->nullable();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('buuug7_user_companies');
    }
}

when update user model,it will be triggered to update belongs to model(company model), but user_id could not get value of user id. i did not how to debug with this error,anyone know how to solve this prolems or where i make a mistake?

You need to set deferred => true on your Company user relation and make the user_id field in your migration nullable(). See http://octobercms.com/docs/database/relations#deferred-binding

@LukeTowers very Thanks for your reply , your solutions is worked for me , i make the user_id in migration nullable  and it work fine, and Thanks again .

As a side note, the error message is telling you what's wrong when it says "The column user_id cannot be null", it's telling you that user_id can't be null due to a database level constraint, but the code is trying to save a null value into user_id. From there, you can determine that you need to make the user_id column nullable() to remove that constraint from the database. Tip for the future @buuug7


Async handling has no support for promises?

My Alexa skill uses promises to make an API request to an external service. Looking at the examples, it seems like done only handles callbacks? It would be great if support for promises could be added if it doesn't exist already. If it does, a comment about it in the readme would be quite helpful. Cheers.

Turns out it is supported but one must not use resolve on the response body.


Derpibooru.org - Problem with showing the content

SORRY I SPEAK SPANISH, I'M GONNA TRY TO BE AS CLEAR AS POSIBLE:
What steps will reproduce the problem?
I made a search in derpibooru.org with the filter "artist:sundown", but the explicit (NSFW) content doesn't show. (I ashamed, don't judge me) anyway...
What is the expected behavior? What do you get instead?
The expected behavior of the program is that it shows me the content, but i get less than a half of the results, instead of the full and the NSFW content.
How often does this problem occur? On which sources?
Always on Derpibooru.org
What version of the program are you using? On what operating system?
v5.5.2, windows 10
Please provide any additional information below
I think this could be because on this site the setting filter EVERYTHING is not available on the program. Only at "PLUS" on rating but doesn't work. I need to log in on site options or what?
There show you some screenshots:
-Here's is the browser search result (1100 Pictures)

-And here the program result (417 Pictures)

You need to be logged in to access NSFW results on derpibooru.
You have to provide your API key in the "password" field of the source settings' "Credentials" tab:

You can find your API key in your account settings on derpibooru.

I love you and you program, I would donate if i could... :(

Sorry, but i have another problem...
(EDITING THIS COMENT WITH THE PROBLEM)

I tried this and it isn't working for me. First off, there is no test button. Also, should the login tab be set to URL? I'm using 6.0.1


added password generator

Related Issue
Closes #288
Description
Added a simple Password generator app
Aesthetic design, Basic colours
Inspired by course of Dr Sahand.
Screenshots

Checklist

[x] My code adheres to the established style guidelines of the project.
[x] I have included comments in areas that may be difficult to understand.
[x] My changes have not introduced any new warnings.
[x] I have conducted a self-review of my code.

Thank you for waiting.
Actually I had my college exams and so I could submit the PR earlier
Please review and Merge
Thanks !

Good work


Panevėžio Ąžuolo progimnazija

@ManWithMustash First stage of verification passed, official domain is azuolo.lt as far as I verified. This is just an informational note. Pull request is still in the review. I appreciate your patience while waiting for the final decision.

@ManWithMustash Pull request merged. Thank you!


opera download error

Please see attached screenshot for error message.
@dinukem @mbonnema can you advice Joel on what to do?

@dinukem @mbonnema do we have a message in place during error or help function that allows community members to email or reach out through github issue tickets?

I just downloaded Opera and attempted to download data for an area.  I am also receiving this no len() error in ArcGIS Pro. I am running ArcGIS Pro version 3.3.2. I have tried multiple data ranges and areas and received the same error.


Make native webView values public instead of private, add factory() functions

It would be nice for extending purposes if the IWebView interface had a public webView field.
In IOSWebView, AndroidWebView, and DesktopWebView the native webView variable (although in iOS it is named wkWebView but could easily be renamed) are private. This limits external extensibility (such as setting additional settings not exposed in your library or for things like setAcceptThirdPartyCookies() which requires access to that variable).
As an additional nice feature, if the following was done it would increase the apparent similarities:
expect class NativeWebView;
actual typealias NativeWebView = WebView; // Android
actual typealias NativeWebView = WKWebView; // iOS
actual typealias NativeWebView = KCEFBrowser; // desktop

It could then be made as a field in IWebView interface. I know that it still would only be interactable from actual code, but it would still help in extensibility. Additionally, make the webView field of WebViewState publicly accessible (but not publicly settable).
An additional nice feature would be allowing custom factory() functions (like the accompanist library allows for). This function would have to return a NativeWebView object (and likely ultimately have to be based on an expect/actual function).
This would allow me to create a subclass of WebView on Android that properly scrolls within a ModalBottomSheet. There are other issues posted for this library that mention the issue (none about a ModalBottomSheet but definitely a common issue). One fix is to use the following:
/** WebView subclass that forces touch event on it to be consumed by it. */
private class WebViewForceScrolling(context: Context): WebView(context) {
    init { ViewCompat.setNestedScrollingEnabled(this, true) }
    @SuppressLint("ClickableViewAccessibility")
    override fun onTouchEvent(event: MotionEvent): Boolean {
        requestDisallowInterceptTouchEvent(event.pointerCount == 1)
        return super.onTouchEvent(event)
    }
}

One issue with the factory() would be gaining access to context on Android (while the other platforms don't need it. But this is solvable in a variety of ways not involving your library at all.

@coderforlife Thanks for your suggestion! I will add it to our feature plan. Feel free to submit a PR for it as well!


Symfony\Component\Console\Exception\LogicException

Hello guys
I just started to get this exception while running Phinx :
PHP Fatal error:  Uncaught Symfony\Component\Console\Exception\LogicException: The command defined in "Phinx\Console\Command\Init" cannot have an empty name. in /var/lib/jenkins/workspace/hqbeds-dev-php7/vendor/symfony/console/Command/Command.php:453
Stack trace:
#0 /var/lib/jenkins/workspace/hqbeds-dev-php7/vendor/robmorgan/phinx/src/Phinx/Console/Command/Init.php(47): Symfony\Component\Console\Command\Command->getName()
#1 /var/lib/jenkins/workspace/hqbeds-dev-php7/vendor/symfony/console/Command/Command.php(77): Phinx\Console\Command\Init->configure()
#2 /var/lib/jenkins/workspace/hqbeds-dev-php7/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php(60): Symfony\Component\Console\Command\Command->__construct()
#3 /var/lib/jenkins/workspace/hqbeds-dev-php7/vendor/robmorgan/phinx/app/phinx.php(36): Phinx\Console\PhinxApplication->__construct()
#4 /var/lib/jenkins/workspace/hqbeds-dev-php7/vendor/robmorgan/phinx/bin/phinx(27): require('/var/lib/jenkin...')
#5 {main}
thrown in /var/lib/jenkins/workspace/hqbeds-dev-php7/vendor/symfony/console/Command/Command.php on line 453
I was using version 0.10.6 when I got the error. I tried upgrading to 0.10.8 , but still the same problem.
My php version is PHP 7.3.7
It was running okay  3 hours ago...
Can anyone help me?

Here broke \Symfony\Component\Console\Command\Command::getName
https://github.com/symfony/console/commit/4510f04e70344d70952566e4262a0b11df39cb10#diff-25a75e093c4a0d5564a36cebbb1384b3R461

I got crazy trying to figure out what is the problem. It's a relief to see that it's not just in my head.
What should we do then? downgrade phinx?
Thanks

Is there a reasonable fix on cake's side?
Can the method be made to return a name?

You have to set ne name of the command in PhinxApplication.php:59
$this->addCommands([
new Command\Init('init'),
new Command\Create('create'),
new Command\Migrate('migrate'),
new Command\Rollback('rollback'),
new Command\Status('status'),
new Command\Breakpoint('breakpoint'),
new Command\Test('test'),
new Command\SeedCreate('seedcreate'),
new Command\SeedRun('seedrun'),
]);

Looks like Symfony's Command::getName() was never intended to return null, but it worked in Phinx because types were not enforced (they were only declared using PHPdocs). It is my understanding that for its version 5 Symfony intends to enforce its type returns.
So preparing a fix for Phinx seems to me to be the best approach, as it immediately solves the issue and prepares for the future. I've created a PR for it, please have a look a leave a comment if you see it fit.

Your PR https://github.com/cakephp/phinx/pull/1588 indeed seems quite future proof
Nice one!

Force the version of symphony/console in your composer.json untill they fix it with
"symfony/console": "v3.4.27"
I did that here...

good idea


Is there a way to use the full label?

For my specific use-case the labels are too long for the shortened version to be used.
[que]

Hi @Margen67!  Thanks for the question.  To make sure I'm understanding your use case, you have multiple labels that all start with que?

I assumed the action was setup on this repo. Oops.
These are the labels in question: https://github.com/xenia-project/game-compatibility/labels

Thanks for sharing the labels.  I see that there would be multiple duplicate labels if only using the first 3 letters of each label.
You're welcome to submit a PR to implement a way to support longer labels.  I chose to only use the first 3 labels for speed of use, but I also don't have as many labels.  The current logic is at https://github.com/adamzolyak/issue-labeler-action/blob/master/helpers.js#L25.


Update Get-SPAppStoreConfiguration.md

Formatting/missing text.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

sharepoint/sharepoint-ps/sharepoint-server/Get-SPAppStoreConfiguration.md
:white_check_mark:Succeeded
View (sharepoint-ps)

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


platformErrorOverrides "Unauthenticated" error type not redirecting to provided route

I may have misunderstood something, but  it appears that the "Unauthenticated" error type doesn't work as documented here.
The explanation below the example route file says that unauthenticated users will redirect to the /login route. When I set up an app like that and navigate to the /profile route, instead of redirecting to the /login route it shows the Microsoft Azure default 404 page.
If I navigate directly to the /login route I am able to log in successfully, and if I try /profile again I can access the page successfully.
You can see the example repository I'm using here.
Thank you.

Hi @chrisbinney, thanks for trying this out!
I took a look at your repository and I believe the confusion is because the platform error overrides does not rerun the route rules, so your override is looking for a login.html file that does not exist.
To get this working for you, I'd suggest adding a 302 redirect to /login for your case. You can just add a line to the unauthenticated platform error override like "statusCode": 301. Please let us know if that fixes the issue.
@craigshoemaker, we should probably make a note of this in our documentation.

Thanks @miwebst!
As you suggested, I added the "statusCode": 301 to the "Unauthenticated" override and that did do the redirect to login! However, if I subsequently try and access the /profile route, it briefly navigates to /.auth/login/done and then back to the root "/". I can't access /profile at all.
It looks as if the the "Unauthenticated" redirect is still occurring even though the user has logged in and has the "authenticated" role.
I've checked the payload from /.auth/me and the user has the "authenticated" role, and I'm not asked to log in again after the first time trying to navigate to /profile.
Is it possible that the authentication state of the user is cached in some way?

Hi @chrisbinney,
I hit the following endpoints in the order listed to get the following results:

Hit /.auth/me --> I was not logged in, so I saw clientPrincipal: null
Hit /profile --> Because I was not logged in, I did not match with the /profile rule. In fact I didn't match with the other two rules either, so got the platform error "Unauthorized". Because there was the "Unauthorized" platform error override provided, I matched with it and redirected to /login. I then matched with the login rule and completed the login flow
Hit /.auth/me --> I was now logged in so saw my appropriate clientPrincipal with an "authenticated" role
Hit /profile --> because I had the authenticated role, I matched with the /profile rule and saw the desired content

This flow seems to behave correctly based on what the platform offers. Are there any questions/concerns about alternate behavior that may be expected?
Thanks for trying out Azure Static Web Apps, and thanks for your patience!

1-3 are the same for me, but for step 4 I get a different result:
When I navigate to /profile, I don't see the desired content. Instead, it redirects to identity.azurestaticapps.net/.auth/login/done and then back to /.
Curiously, if I open the developer tools then navigation seems to work as expected (this is in Chrome btw).
I've attached a video that shows the issue I'm having.
Static Wen App log in issue.zip

So I double checked that everything is working for me from your site even with developer tools not open (both in incognito and non-incognito). However, the fact that everything worked with developer tools open likely means that your developer tools window had "disable cache" checked, and the bad behavior was a result of us caching the old behavior at /purge. After some time now, I would expect the flow to work from any browser now. Is that the case, @chrisbinney?

@miwebst - I updated the route rule in the example to include the 301 redirect.

Thank you for looking into this.
Just checked again and the problem is still there. However, I've tested it in Edge and it works as expected and I'm able to access the content at /profile. I installed a fresh copy of Firefox to test it and I see the issue in that browser too.
Just to see what would happen, I also tried changing the authentication provider to /.auth/login/aad, and I can still see the problem.
So the issue is still there in Chrome and Firefox, but not in Edge and is reproducible for me across different authentication providers.

@miwebst , I just re-read the initial reply and I realized what's happened. In the text of your reply you suggest using a 302 but your example was to add a "statusCode": 301 line to the routes.json file. I worked off the latter. If I change it to a 302, then the browser, of course, doesn't cache as it's a temporary redirect. So that solves the problem.
WFIW In the longer term it seems like a good idea to me for the overrides to work with the routing rules, but this solution works fine.
It'd be a good idea to update the route docs too, as I notice the statusCode in the example has been set to 301, not a 302.
Thank you for your help!

@craigshoemaker we should probably make it 302 as it seems like 301 causes a caching issue. We should also make a note on the platform error overrides doc to make it clear that we will not rerun the routing rules here but are looking for the path to the content to serve.

@miwebst - done

Please be aware that the routes.json is deprecated. Routes, overrides and general configuration of a Azure Static Web Apps are now powered by the staticwebapps.config.json file.


included SVGs not rendering correctly in macOS Preview and some printers

Description
If I include SVGs in my document the resulting PDF has missing elements in some svgs in macOS Preview and while printing with some printers.
Example Code:
#align(right, image(width: 70%, "brokenSVG1.svg"))
#align(center,image(width: 50%, "brokenSVG2.svg"))
Used SVGs:

If opened in Inkscape and every browser they look like they should.
Resulting PDF:
brokenSVGExample.pdf
How it looks in macOS-Preview and after printing (directly from the user interface of the printer, not via macOS):

While the problem here is more on the side of macOS-Preview and the printer, shouldn't typst produce PDFs that are as widely compatible as possible?
Reproduction URL
No response
Operating system
macOS
Typst version

[X] I am using the latest version of Typst

Will look into it.

I know what the issue is, I encountered the same problem with MacOS Preview when building the convert from SVG to PDF. I'm afraid it's hard to fix from our side (we could potentially work around it with some work, but it's still not going to fix the underlying issue, which is Apple's fault for not following the PDF specification, and not ours). However, for now you can work around it easily: Simply open your SVG and remove clip-rule:evenodd; from your SVGs at the very top, then it should work fine in Preview (and hopefully also printers):

I hope that helps.

I would be curious to know what program you used to generate this SVG? I'm surprised that it uses clip-rule:evenodd in the first place.

Thank you, that solved the problem!
I used Affinity Designer 2. Time to open the next bug report, I guess.
I wonder if it could be worth it to implement a workaround in typst. While the macOS preview issue isn't that big of a deal (classic Apple ...), the printer thing is a bit more problematic, because sometimes you are stuck with only one way to print sth out. I'm a teacher and imagine my horror realizing 5 min before class that half of the worksheet is missing with no way of fixing it :D (jay, digitalization in german schools ...). While I know now what the issue is, most people won't. On the other hand, it is of course a lot of effort for such a little thing ...

I used Affinity Designer 2. Time to open the next bug report, I guess.

It's not really a bug from their side, just some not-so-ideal output. I can maybe explain a bit what the problem is (but feel free to skip if you don't care, but might be useful for anyone who wants to tackle the problem in the future).
In SVG, there are two ways to define a clip path: You can use the "even odd" rule and the "non zero winding rule". These rules define which parts of the shape are considered to be on the inside of the shape, and which ones are on the outside. For example, if you have the following SVG:
<svg id="svg1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
    <clipPath id="clip1">
        <path id="path1" d="M 100 15 l 50 160 l -130 -100 l 160 0 l -130 100 z"
              clip-rule="evenodd"/>
    </clipPath>
    <rect id="rect1" x="0" y="0" width="200" height="200" fill="green" clip-path="url(#clip1)"/>
</svg>

It will look like this:

While if you remove the "evenodd", it will default to the non zero winding rule, in which case the result would look like this:

The thing is that PDF also has built-in support for clip paths, but you can only use the non zero winding rule. Because of this, many applications (including for example Latex will simply ignore the rule of the clip path and render it using the non zero winding rule.
As a result of this, if I try embedding the above SVG into Latex, the result is wrong in all viewers. But I guess in practice the clip-rule evenodd isn't used at all, so no one really "cares" (in the case of your SVG it is used, but it actually doesn't produce any different output compared to when you would've used the non zero winding rule, so Latex will render your SVG fine. But the above SVG is not rendered correctly):
latex-out.pdf
For me, correctness was the most important, which is why I made sure that this case is handled as well (with the unfortunate side effect that Preview has a bug and because of this won't display it properly). But it works fine in Chrome, Firefox, Adobe Acrobat, XPDF, and mupdf:
typst-out.pdf
How did I do it? Basically, whenever I encounter a clip path, there are two options: If the clip path is "simple" (e.g. the rule is not evenodd, and there are some other conditions that need to be fulfilled), it is embedded as a normal clip path in PDF. If this is not the case, we fall back to simulating the clip path with soft masks, which is more complex but allows us to preserve the semantics of that feature. As far as I am aware, this is the only way to do it in PDF. But Preview doesn't interpret transformations with soft masks correctly, which is why the output gets messed up.
So an easy solution could be to just ignore the clip path rule in Typst too, which is something I'd like to avoid doing because... well, it's not correct. In my opinion the real issue is that Affinity Designer 2 for some reason decides to explicitly make the clip path use the evenodd rule even though in your case the result is exactly the same as using the non zero winding rule, which is the default, so yeah...
I won't explain the more complex approach to circumventing the problem as this requires some knowledge about how PDF works, but it would basically involve making the SVG converter more integrated with the Typst exporter, which does require some effort and I don't have the time to try working on it right now.

While the macOS preview issue isn't that big of a deal (classic Apple ...), the printer thing is a bit more problematic, because sometimes you are stuck with only one way to print sth out.

Yeah, that's of course very understandable. But I do think that your SVG is an edge case because normally, a program wouldn't change the clip rule to evenodd if it doesn't actually need it... And if it does need it then, well, we are the only one who will produce correct output (I tried a lot of online converters and they all can't handle it correctly).
But I will leave this issue open for now, hopefully it can be fixed in the (near) future, but I don't know when.

Thx for the info! Yes, makes sense.

@LaurenzV how hard would it be to check whether nonzero and evenodd would behave identically and use nonzero in that case even if evenodd is specified?

Not sure to be honest, but it sounds like it would involve a lot of maths to determine whether the paths cross each other and in which way.  😅

@laurmaedje For your information, the more complex approach I was talking about is to write SVGs directly into the page content stream of Typst instead of linking it via an XObject. Because if I remember correctly, the problem was that transformations from the page stream are somehow not correctly applied if a soft mask is invoked inside of the XObject (although I'd have to double check to make sure), however, if we invoke the soft mask directly inside of the page stream, then it should work. This means that it wouldn't work for clip paths inside of other complex clip paths (because then we have the same problem that we need to create a new XObject anyway), but it should at least work for top-level clip paths and soft masks, but not for deeply-nested ones, which I suppose should cover 99.9% percent of the cases.
But for this to work, we'd need some mechanism to allow svg2pdf to store new resources inside of the dictionary that is controlled by Typst (which at some point should exist anyway so that things like color spaces and eventually if we add selectable text to svg2pdf even fonts don't need to be written twice).

Good news, turns out that I remember it wrong and PDF actually does have support for evenodd clip paths. The reason I didn't include it is because it might not work properly with overlapping shapes, but we can at least support it if the clip path contains only a single element (which is the case here). Should be fixed in the next update.


Copy edition from root project

Previously cargo fuzz init would always emit edition=2018 manifests, even if the root project was on 2015 or 2021. This PR makes it initialize the fuzz targets' manifest using the same edition that the root project is using.

CI has already been failing, we need to fix that cc @fitzgen


Running communicates status better than pending

:tada: This PR is included in version 0.7.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Send newHeads event only if store succeded for sure

and the block is available for users to query via RPC

Would it make more sense for the event to be sent by the synchronizer instead of the blockchain?

Would it make more sense for the event to be sent by the synchronizer instead of the blockchain?

Maybe. We could make blockchain just a DB and move all the moving parts to sync.


[bug] additional cmake args after CMAKE_TOOLCHAIN_FILE will clear it

env
ROS2: humble
ubuntu 20.04
I test the bug used the following CMakeLists.txt file
cmake_minimum_required(VERSION 3.12)
project(OpenMPTest)

if(CMAKE_TOOLCHAIN_FILE)
  message(AUTHOR_WARNING TOOLCHAINFILE: ${CMAKE_TOOLCHAIN_FILE})
else()
  message(AUTHOR_WARNING TOOLCHAINFILE: ${CMAKE_TOOLCHAIN_FILE})
endif()

if(COUT_INFO)
  message(AUTHOR_WARNING COUT_INFO: ON)
else()
  message(AUTHOR_WARNING COUT_INFO: OFF)
endif()
find_package(OpenMP REQUIRED)
find_package(backward_ros REQUIRED)

colcon
when I typed the command:
colcon build --cmake-force-configure --cmake-args -DCMAKE_VERBOSE_MAKEFILE=ON --cmake-args -DCMAKE_TOOLCHAIN_FILE="/root/cross_compile/cmake-toolchains/generic_linux.cmake"

it will output:
Starting >>> OpenMPTest
[2.695s] WARNING:colcon.colcon_cmake.task.cmake.build:Could not run installation step for package 'OpenMPTest' because it has no 'install' target
--- stderr: OpenMPTest
CMake Warning (dev) at CMakeLists.txt:6 (message):
  TOOLCHAINFILE:/root/cross_compile/cmake-toolchains/generic_linux.cmake
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:14 (message):
  COUT_INFO:OFF
This warning is for project developers.  Use -Wno-dev to suppress it.

---
Finished <<< OpenMPTest [2.37s]

Summary: 1 package finished [2.50s]
  1 package had stderr output: OpenMPTest

When I typed the command:
colcon build --cmake-force-configure --cmake-args -DCMAKE_VERBOSE_MAKEFILE=ON --cmake-args -DCMAKE_TOOLCHAIN_FILE="/root/cross_compile/cmake-toolchains/generic_linux.cmake" --cmake-args -DCOUT_INFO=ON

it will output:
Starting >>> OpenMPTest
[2.673s] WARNING:colcon.colcon_cmake.task.cmake.build:Could not run installation step for package 'OpenMPTest' because it has no 'install' target
--- stderr: OpenMPTest
CMake Warning (dev) at CMakeLists.txt:8 (message):
  TOOLCHAINFILE:
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:12 (message):
  COUT_INFO:ON
This warning is for project developers.  Use -Wno-dev to suppress it.

---
Finished <<< OpenMPTest [2.34s]

Summary: 1 package finished [2.48s]
  1 package had stderr output: OpenMPTest

cmake
When I typed the command:
cmake -DCMAKE_TOOLCHAIN_FILE="/root/cross_compile/cmake-toolchains/generic_linux.cmake"

it will output:
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:6 (message):
  TOOLCHAINFILE:/root/cross_compile/cmake-toolchains/generic_linux.cmake
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:14 (message):
  COUT_INFO:OFF
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Found backward_ros: 1.0.1 (/root/sysroot/opt/ros3rd/share/backward_ros/cmake)
-- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter
-- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR)
-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR)
-- BACKWARD_HAS_UNWIND=1
-- BACKWARD_HAS_BACKTRACE=0
-- BACKWARD_HAS_BACKTRACE_SYMBOL=1
-- BACKWARD_HAS_DW=0
-- BACKWARD_HAS_BFD=0
-- Could NOT find Backward (missing: BACKWARD_LIBRARIES)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/huangruixin/ws/src/OpenMPTest

When I typed the command:
cmake -DCMAKE_TOOLCHAIN_FILE="/root/cross_compile/cmake-toolchains/generic_linux.cmake" -DCOUT_INFO=ON

it will output:
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:6 (message):
  TOOLCHAINFILE:/root/cross_compile/cmake-toolchains/generic_linux.cmake
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:12 (message):
  COUT_INFO:ON
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Found backward_ros: 1.0.1 (/root/sysroot/opt/ros3rd/share/backward_ros/cmake)
-- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter
-- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR)
-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR)
-- BACKWARD_HAS_UNWIND=1
-- BACKWARD_HAS_BACKTRACE=0
-- BACKWARD_HAS_BACKTRACE_SYMBOL=1
-- BACKWARD_HAS_DW=0
-- BACKWARD_HAS_BFD=0
-- Could NOT find Backward (missing: BACKWARD_LIBRARIES)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/huangruixin/ws/src/OpenMPTest

Compare
By comparing the following two keywords, it can be observed that the issue lies with colcon rather than cmake.

TOOLCHAINFILE:XXX
COUT_INFO:XXX

The syntax of the invocation should be:
colcon build --cmake-force-configure --cmake-args -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_TOOLCHAIN_FILE="/root/cross_compile/cmake-toolchains/generic_linux.cmake" -DCOUT_INFO=ON

You should not specify --cmake-args multiple times like this.

Wow, thanks a lot.
But there is a natural use case for colcon --cmake-args -DCMAKE_TOOLCHAIN_FILE=fixed.cmake --packages-select <package> [--cmake-args *[*]], where the final cmake-args is optional and placed at the end for convenience of modification. Is it worth supporting this usage?


2247 Global Configuration and Pipeline Support

Configure the plugin globally - no need to add it to individual builds.

LGTM


The SUID sandbox helper binary was found, but is not configured correctly

I followed the tutorial I installed electron npm install --save-dev electron npm install and when I did npm start it showed me this:

<EMAIL_ADDRESS>start /home/MYUSER/Desktop/Dev/Sources/electron-quick-start-master
electron .

[15135:0722/124637.533693:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/MYUSER/Desktop/Dev/Sources/electron-quick-start-master/node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.

node v10.16.0
npm 6.9.0

I fixed it with setting "start": "electron . --no-sandbox" in package.json
I don't recommend doing this for suspecious/untrusted source codes


On macOS build universal arm64 and x86_64

On macOS, we now build libopentime and libopentimelineio as universal (both arm64 and x86_64)

Nice! FYI, you will have to modify the CI to output universal2 tagged wheels. See https://cibuildwheel.readthedocs.io/en/1.x/options/#archs. This can be done here: https://github.com/PixarAnimationStudios/OpenTimelineIO/blob/main/.github/workflows/python-package.yml#L117.
I just don't know if it's going to work for Python less than 3.8.

@JeanChristopheMorinPerso I assume you mean, after this change lands, we can update the CI for universal tagged builds?

Also, why 3.8 specifically? 3.7.x was when M1 support appeared?

I guess wheel support could be added later...
As for why 3.8+, see https://cibuildwheel.readthedocs.io/en/stable/faq/#universal2
More specifically:

Only CPython 3.8 and newer support universal2 and arm64 wheels.

But the whole section is worth a read.

I guess wheel support could be added later...

The triple dots were because I wasn't sure of the end result of having universal libs while having "non aware" wheels. But thinking about it more, all the tests are passing on all platforms and python versions. So everything will be fine.
Also I realize the tone of my initial comment kind of sounded like an order or authoritive. I'm really sorry for that. Thanks @meshula for pointing it out (kind of indirectly, but still).
The idea behind my comment was more to remind that it's something we shouldn't forget to do before the next release.

No need to be sorry, there wasn't a tone problem, I was just looking for clarification :) I wanted to know if (1) we can land this change and it won't disrupt wheels (I understand from your comment that it won't) and (2) if the update to the wheel CI can be a second change (I understand from your comment that we can do it as a second step).


fix(orchestrator): remove average duration from workflow table and overview page

Due to performance limitations, backend API cannot return the average duration.
This is a follow up on https://github.com/redhat-developer/rhdh-plugins/pull/84/files

@mareklibra PTAL

@mareklibra PTAL


soc: xtensa: linker: Update linker scripts for C++ build

When we link in crtbegin.o for C++ exception support we end up pulling
in the .tm_clone_table section.  We need to update the linker scripts
to handle this.  soc/xtensa/sample_controller/linker.ld was already
updated, this fixes the others.
Signed-off-by: Kumar Gala<EMAIL_ADDRESS>

Fixes build issues found in nightly build:
https://buildkite.com/zephyr/zephyr-daily/builds/346


font-testing links

Excellent, thanks Dave.

This repo needs some serious love.  I have a collection of links that I need to move here.


ID read from NFC is different from the ID put into the NFC

I am using the TagWriter to write '00000001' text into NFC card, however when i am using the element14 NXP card to read the data, the text based ID i read is 'DB1493AE'.  Is there a conversion, how to fix this?

hi, @svvitale  do you know why ?

Hi, @helxsz, sorry for not getting back to you sooner.  Which block are you writing into?  Also, the write_block() method only supports writing 4 bytes at a time.

Closing since I haven't heard back in a couple months.  Please let me know if you're still encountering the issue and would like further help.


Mantle is not even working in my level

Not sure if there is an issue or not, Same download as my buddy from github same setup but his works and mine does not?  it worked one time but when I played again it didnt.  Debug shows it as a possibility to mantle but character does not.

I can't say anything without details. Mantling should by default work with the WorldStatic, WorldDynamic and Destructible object types.


Use setAttribute to preserve cursor position.

Fixes https://github.com/vuejs/vuex/issues/162
textarea works different and we need to set it as before.
Same issue is also present on v2.0. @yyx990803 should I open PR for 2.0 too?

setAttribute actually doesn't do anything, as the value attribute is only used to indicate the initial value. The proper fix I think is checking if the input's value is already the same as the desired value and skip it if yes.

Thanks for quick and useful feedback. I changed it now and it fixes problem with vuex too.
There seem to be some lint issues though.

I fixed the lint issue earlier - can you try rebasing your branch?

Fix is now in one commit on top of dev branch.


Fix CI

This PR fix various issues preventing the test suite to pass.

After hours waiting for Travis-CI to launch the jobs, this seems to be ready for review :tada:!


Update tapir-core to 1.11.10

About this PR
📦 Updates com.softwaremill.sttp.tapir:tapir-core from 1.11.9 to 1.11.10
📜 GitHub Release Notes - Version Diff
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

⚙ Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "com.softwaremill.sttp.tapir", artifactId = "tapir-core" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "com.softwaremill.sttp.tapir", artifactId = "tapir-core" }
}]

labels: library-update, early-semver-patch, semver-spec-patch, version-scheme:early-semver, commit-count:1

Superseded with https://github.com/jwojnowski/humanoid/pull/78


feat: Add karpenter on fargate example

What does this PR do?

Add an example that demonstrates how to create a cluster using Fargate profiles in which to run Karpenter and other add-ons. More specifically how to implement the Run the Karpenter controller on EKS Fargate best practice and provide a demo application so customers can test this use case using the EKS blueprints.
This example also uses spot instances, SQS for the interruption queue and an ALB deployed by the AWS Load Balancer Controller (running on Fargate) to access the demo app (running on worker nodes deployed by Karpenter).
The demo app deployment is also using nodeSelector, topologySpreadConstraints, and podAntiAffinity to demonstrate how Karpenter handles these types of constraints.
Motivation

Resolves #1159

More

[X] Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
[X] Yes, I have added a new example under examples to support my PR
[ ] Yes, I have created another PR for add-ons under add-ons repo (if applicable)
[ ] Yes, I have updated the docs for this feature
[X] Yes, I ran pre-commit run -a with this PR

Note: Not all the PRs require a new example and/or doc page. In general:

Use an existing example when possible to demonstrate a new addons usage
A new docs page under docs/add-ons/* is required for new a new addon

For Moderators

[ ] E2E Test successfully complete before merge?

Additional Notes

please see the updated https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/main/examples/karpenter

please see the updated https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/main/examples/karpenter

What do you want to with this PR then? My goal was to provide a more complete example to customers who wants to deploy workloads on EKS cluster that are using Karpenter and Fargate. If you think this repo is not the right place to provide that kind of example I can close this PR.

the current example for Karpenter is already configured for running on Fargate. If there are additional features/questions related to this pattern, please feel free to open a new issue describing the solution you would like to see or have answered
Ref: https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/main/examples/karpenter

I'm not sure why you are closing this PR since https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/main/examples/karpenter does not provide the following items:

A default Karpenter provisioner using Bottlerocket AMI and a mix of spot and on-demand instances
A demo application to demonstrates how Karpenter scales nodes based on workload constraints like nodeSelector, topologySpreadConstraints, and podAntiAffinity
Other add-ons like aws-load-balancer-controller and external-dns running on fargate or nodes provisionned by Karpenter to demonstrate how a cluster can operate without any managed node groups

Should I assume that you are not interested in providing this type of example to customers within this repo?

I would recommend checking out this draft PR that lays out some upcoming changes to EKS Blueprints and specifically this section


fix(resolve): revert ensure exports has precedence over mainFields (#11234)

This reverts commit d6eb4f24a463777200506c03fd55d8fa4e1ea394.
ecosystem-ci had a fail from histoire  and bisect pointed at that commit. lets see if undoing helps.
note this is going to fail svelte tests as we have to undo an optimization based on the commit to revert.

Description

Additional context

What is the purpose of this pull request?

[x] Bug fix
[ ] New Feature
[ ] Documentation update
[ ] Other

Before submitting the PR, please make sure you do the following

[ ] Read the Contributing Guidelines.
[ ] Read the Pull Request Guidelines and follow the Commit Convention.
[ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
[ ] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
[ ] Ideally, include relevant tests that fail without this PR but pass with it.

/ecosystem-ci run histoire

Thanks for helping us go through the more stable route for the ecosystem here @dominikg


[WIP] Windows port

TODO

[x] convert command-line arguments to UTF-8
[ ] print string as UTF-8

Nice work!


Fix the Subscription procmacro to work on Rust 2021 by adding the missing required dyn keywords in the generated output

Fixed #663
This gets the Subscription procmacro working on Rust 2021, which is when the dyn keyword is now hard required.  The generated code was missing instances of the dyn keyword.

Think I found a fix, adding it to the main injected stream type, hold on...

And all tests in my big project and in async-graphql are successful with --all-features, sec while I commit and update this...

And done, this should be ready for testing/merge if someone else can confirm as well.  Tested on both 2018 and 2021.

Thanks! 😁


Build random sampling data loader for glitches and waveforms

Build a data loader for training that can sample from a dataset of glitches (#9 ) and dataset of waveforms (#10 ) as well as randomly time-slid background

As a very rough blueprint, I can imagine building something like the following, which will be fully random so it's sort of up to you to determine how long you want an "epoch" to be (i.e. it doesn't move sequentially through the data). It's way less than optimal (way too much looping, but not quite sure how to efficiently sample kernels from a 1D timeseries), and is missing the injection portion, but hopefully this should be somewhere to start a discussion.
from typing import Optional

import h5py
import numpy as np
import torch

class RandomWaveformDataset:
    def __init__(
        self,
        hanford_background: str,
        livingston_background: str,
        kernel_length: float,
        sample_rate: float,
        batch_size: int,
        batches_per_epoch: int,
        waveform_dataset: Optional[str] = None,
        waveform_frac: float = 0,
        glitch_dataset: Optional[str] = None,
        glitch_frac: float = 0,
        device: torch.device = "cuda"
    ) -> None:
        # sanity check our fractions
        assert 0 <= waveform_frac <= 1
        assert 0 <= glitch_frac <= 1

        # this one actually won't be sufficient:
        # e.g. if they add up to 0.99 but our batch
        # size is 32, they still won't leave any room
        # for background
        assert (waveform_frac + glitch_frac) <= 1

        # load in the background data
        # TODO: maybe these are gwf and we resample?
        with h5py.File(hanford_background, "r") as f:
            self.hanford_background = f["whatever"][:]

            # move everything onto the GPU up front so that
            # we don't have to pay for transfer time later.
            # If our datasets are on the scale of ~GBs this
            # shouldn't be a problem, esp. for the current
            # size of BBHNet. For the rest of these I'll
            # just do this in one fell swoop
            self.hanford_background = torch.Tensor(
                self.hanford_background
            ).to(device)
        with h5py.File(livingston_background, "r") as f:
            self.livingston_background = torch.Tensor(
                f["whatever"][:]
            ).to(device)

        # ensure that we have the same amount of
        # data from both detectors
        assert len(self.hanford_background) == len(self.livingston_background)

        # load in any waveforms if we specified them
        # TODO: what will the actual field name be?
        # TODO: will these need to be resampled?
        if waveform_dataset is not None:
            assert waveform_frac > 0
            with h5py.File(waveform_dataset, "r") as f:
                # should have shape:
                # (num_waveforms, 2, sample_rate * num_seconds)
                # where 2 is for each detector and num_seconds
                # is however long we had bilby make the waveforms
                self.waveforms = torch.Tensor(f["waveforms"][:]).to(device)
        else:
            assert waveform_frac == 0
            self.waveforms = None

        # load in any glitches if we specified them
        # TODO: what will the actual field name be?
        # TODO: will these need to be resampled?
        if glitch_dataset is not None:
            assert glitch_frac > 0
            with h5py.File(glitch_dataset, "r") as f:
                self.hanford_glitches = f["hanford"][:]
                self.livingston_glitches = f["livingston"]
        else:
            assert glitch_frac = 0
            self.glitches = None

        # TODO: do we want to use these as max fractions
        # and sample the actual number randomly at loading time?
        self.num_waveforms = int(self.waveform_frac * batch_size)
        self.num_glitches = int(self.glitch_frac * batch_size)

        self.kernel_size = int(kernel_length * sample_rate)
        self.batch_size = batch_size
        self.batches_per_epoch = batches_per_epoch

    def __iter__(self):
        self._batch_idx = 0
        return self

    def sample_from_array(self, array, N):
        # do this all with numpy for now to avoid data transfer
        # sample a bunch of indices of samples to grab
        idx = np.random.choice(len(array), size=N, replace=False)

        # for each index, grab a random kernel-sized
        # stretch of the sampled timeseries
        # TODO: is there a good way to do this with array ops?
        samples = []
        for i in idx:
            start = np.random.randint(array.shape[-1] - self.kernel_size)
            stop = start + self.kernel_size
            if len(array.shape) == 2:
                samples.append(array[i, start: stop])
            else:
                samples.append(array[i, :, start: stop])

        # return the list of samples
        return samples

    def sample_from_background(self, independent: bool = True):
        hanford_start = np.random.choice(
            len(self.hanford_background) - self.kernel_size,
            size=self.batch_size,
            replace=False
        )
        if independent:
            livingston_start = np.random.choice(
                len(self.livingstonn_background) - self.kernel_size,
                size=self.batch_size,
                replace=False
            )
        else:
            livingston_start = hanford_start

        # TODO: is there a good way to do this with array ops?
        X = []
        for h_idx, l_idx in zip(hanford_start, livingston_start):
            hanford = self.hanford_background[h_idx: h_idx + self.kernel_size]
            livingston = self.livingston_background[
                l_idx: l_idx + self.kernel_size
            ]
            X.append([hanford, livingston])

        # TODO: not sure torch will like that you're
        # cat-ing lists of lists. Will stack work?
        return torch.cat(X, axis=0)

    def inject_waveforms(self, background, waveforms):
        # TODO: what does this look like?
        raise NotImplementedError

    def __next__(self):
        if self._batch_idx >= self.batches_per_epoch:
            raise StopIteration

        # create an array of all background
        X = self.sample_from_background(independent=True)

        # replace some of this data with glitches if
        # we have glitch data to use
        if self.glitches is not None:
            # break up the number of glitches randomly
            # between hanford and livingston
            num_hanford = np.random.randint(self.num_glitches)
            num_livingston = self.num_glitches - num_hanford

            # replace the hanford channel of the
            # existing background data with some
            # sampled hanford glitches
            hanford_glitches = self.sample_from_array(
                self.hanford_glitches, num_hanford
            )
            X[:num_hanford, 0] = torch.stack(hanford_glitches)

            # replace the livingston channel of the existing
            # background data with some sampled livingston
            # glitches
            livingston_glitches = self.sample_from_array(
                self.livingston_glitches, num_livingston
            )
            X[num_hanford:self.num_glitches, 1] = torch.stack(
                livingston_glitches
            )

        # inject waveforms into the background if we have
        # generated waveforms to sample from
        if self.waveforms is not None:
            waveforms = self.sample_from_array(
                self.waveforms, self.num_waveforms
            )
            self.inject_waveforms(X[-num_waveforms:], waveforms)

        # create a target tensor, marking all
        # the glitch data as 0.
        y = torch.zeros((self.batch_size,))
        y[-self.num_waveforms:] = 1
        return X, y

[ ] Investigate current injection timing breakdown to see what can be done online vs. during dataset generation (#10)
[ ] Fill out inject_data method
[ ] Compute PSDs at initialization for whitening
[ ] Look into how to perform whitening using tensor ops to keep things on GPU
[ ] Restrict sampling of t0s waveforms and glitches to 1s before trigger (glitches should be 1s on either side of trigger #9 )
[ ] Fill out picture of validation data loader (fixed waveforms, injected at even intervals, monitor glitch FAR separately)

@wbenoit26 @EthanMarx I'll start a PR with a branch that implements this in a bbhnet.data lib without the injection functionality, including some tests, and one of you can build in that functionality in a separate PR once we figure out #17 and #19


Upgrade Arm GNU Toolchain and GCC to version 13

Fixes #49

Upgrades:

arm gnu toolchain 12.2 -> 13.3
gcc/g++ 12 -> 13
catch2 3.1.0 -> 3.3.0
clang-tidy-cache

Catch2 needed to be upgraded to work with gcc 13 and gcov was also fixed to its version from gcc 13 to avoid ambiguous versions.
Currently throws errors when building cobc sw.

IWYU only added support for clang 18 in version 0.22.

This PR and the related issue are only about upgrading the GNU ARM toolchain and GCC, not about the clang tools, so I reset that part.
The build errors are not from GCC but from clang-tidy, and can be fixed by adding the command line option --extra-arg=-fsized-deallocation to clang-tidy.


fix: support determining build info on more GitHub Actions events

There are several GitHub Actions events that don't include a commit SHA in the event payload fields that are currently parsed by Reviewdog. For example, the release event only includes a target_commitish field that does not contain a commit hash. This renders Reviewdog less suitable for use in workflows triggered by such events.
To improve on the situation, let Reviewdog parse the GITHUB_SHA environment variable to fetch a commit SHA if the already available methods fail. As explained in the GitHub docs, this environment variable is a useful last resort for other event types.

[x] Updated Unreleased section in CHANGELOG or it's not notable changes.

I've just noticed that this PR would resolve #873 too!

Hi, @AlexTMjugador! We merged your PR to reviewdog! 🐶
Thank you for your contribution! ✨
We just invited you to join the @reviewdog organization on GitHub.
Accept the invite by visiting https://github.com/orgs/reviewdog/invitation.
By joining the team, you'll be a part of reviewdog community and can help the maintenance of reviewdog.
Thanks again!


[Run] Option to keep PT Run open permanently

I'd like to have the powertoys run search bar open centrally on the desktop wall paper permanently. it works fine for me and i love it, want more of it, and want to stop explaining the hotkey to family.

sorry, no plans currently to do this.  Would need to be done via a desk band.  https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/cc144099(v=vs.85)#:~:text=A desk band is basically a way to,and it will appear as a normal window.

I'd love to see this as well


Address getting cut off on facility profile

Overview
The full address of this facility (and maybe others) is being cut off: https://openapparel.org/facilities/LK2019085651YA4
Expected Behavior
We should easily be able to view the whole facility name and address.
Actual Behavior
The bottom line of the address is cut off. It seems to be related to long names and addresses going beyond a certain number of lines.
Steps to Reproduce
https://openapparel.org/facilities/LK2019085651YA4
https://openapparel.org/facilities/LK2019083BPWQY0
Demo

Additional context
cc @katieashaw

@lederer Could you please recommend a fix for this?

👍   Deleting the max-height declaration from .panel-header oughta do it.
https://github.com/open-apparel-registry/open-apparel-registry/blob/9adbf77caed1add5dc0789b80ba19c3cf9124418/src/app/src/styles/css/Map.css#L35

@jwalgran If this is a quick fix and can be snuck into the next sprint, that would be great!


Requests for groups connected

Connects RequestView/RequestList/Request with backend, gives functionality for requesting to join groups, accepting requests, and rejecting requests.

Code looks great! Waiting for staging heroku to build to test it out :)

All the functionality works! Requested to join, rejected and accepted.

The interface can be improved a bit probably. The user and group are a bit squished together.
Great work 👏🏻

All the functionality works! Requested to join, rejected and accepted.

The interface can be improved a bit probably. The user and group are a bit squished together.
Great work 👏🏻

How far apart do you think these should be and/or what else is wrong


Display TOTP QR Code on installation failed

When it fails installation, then it does not display TOTP QR code on its views.
This is a little inconvenience. So I've fixed it. Thanks.

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

[x] I acknowledge that all my contributions will be made under the project's license.

Thanks very much, this looks great!

Just released this fix in version 2.2.1. Thanks again!


Unable to perform simple image registration

Hi,
I am using SimpleITK-SimpleElastix since SimpleITK-2.2.1 seem to give an error of module 'SimpleITK' has no attribute 'ElastixImageFilter' when trying selx = sitk.ElastixImageFilter(). Anyway, I am trying to register an MR from TCIA to the SRI24 atlas.
>>> import SimpleITK as sitk
>>> print(sitk.Version())
SimpleITK Version: 2.0.0rc2.dev908-g8244e (ITK 5.1)
Compiled: Mar  3 2021 16:40:05
>>> fixed_image = sitk.ReadImage("C:/Projects/SimpleReg/atlases/sri24/image.nii.gz", sitk.sitkFloat32)
>>> moving_image = sitk.ReadImage("C:/Projects/SimpleReg/data/tcia_aaac_t1ce.nii.gz", sitk.sitkFloat32)
>>> selx = sitk.ElastixImageFilter()
>>> selx.SetLogToConsole(True)
<SimpleITK.SimpleITK.ElastixImageFilter; proxy of <Swig Object of type 'itk::simple::ElastixImageFilter::Self *' at 0x000001E0B03BF690> >
>>> parameterMap = sitk.GetDefaultParameterMap("rigid")
>>> parameterMap["MaximumNumberOfIterations"] = ["1024"]
>>> sitk.PrintParameterMap(parameterMap)
ParameterObject (000001E0AF906110)
  RTTI typeinfo:   class elastix::ParameterObject
  Reference Count: 1
  Modified Time: 1130
  Debug: Off
  Object Name:
  Observers:
    none
ParameterMap 0:
  (AutomaticParameterEstimation "true")
  (AutomaticScalesEstimation "true")
  (CheckNumberOfSamples "true")
  (DefaultPixelValue 0)
  (FinalBSplineInterpolationOrder 3)
  (FixedImagePyramid "FixedSmoothingImagePyramid")
  (ImageSampler "RandomCoordinate")
  (Interpolator "LinearInterpolator")
  (MaximumNumberOfIterations 1024)
  (MaximumNumberOfSamplingAttempts 8)
  (Metric "AdvancedMattesMutualInformation")
  (MovingImagePyramid "MovingSmoothingImagePyramid")
  (NewSamplesEveryIteration "true")
  (NumberOfResolutions 4)
  (NumberOfSamplesForExactGradient 4096)
  (NumberOfSpatialSamples 2048)
  (Optimizer "AdaptiveStochasticGradientDescent")
  (Registration "MultiResolutionRegistration")
  (ResampleInterpolator "FinalBSplineInterpolator")
  (Resampler "DefaultResampler")
  (ResultImageFormat "nii")
  (Transform "EulerTransform")
  (WriteIterationInfo "false")
  (WriteResultImage "true")
>>> selx.SetParameterMap(parameterMap)
<SimpleITK.SimpleITK.ElastixImageFilter; proxy of <Swig Object of type 'itk::simple::ElastixImageFilter::Self *' at 0x000001E0B0057150> >
>>> selx.SetFixedImage(fixed_image)
<SimpleITK.SimpleITK.ElastixImageFilter; proxy of <Swig Object of type 'itk::simple::ElastixImageFilter::Self *' at 0x000001E0B03BF4B0> >
>>> selx.SetMovingImage(moving_image)
<SimpleITK.SimpleITK.ElastixImageFilter; proxy of <Swig Object of type 'itk::simple::ElastixImageFilter::Self *' at 0x000001E0B03BF5A0> >
>>> selx.Execute()
Installing all components.
InstallingComponents was successful.

ELASTIX version: 5.000
Command line options from ElastixBase:
-fMask    unspecified, so no fixed mask used
-mMask    unspecified, so no moving mask used
-out      ./
-priority unspecified, so NORMAL process priority
-threads  unspecified, so all available threads are used
WARNING: The parameter "UseDirectionCosines", requested at entry number 0, does not exist at all.
  The default value "true" is used instead.

WARNING: The option "UseDirectionCosines" was not found in your parameter file.
  From elastix 4.8 it defaults to true!
This may change the behavior of your registrations considerably.

Command line options from TransformBase:
-t0       unspecified, so no initial transform used

Reading images...
Reading images took 0 ms.

WARNING: the fixed pyramid schedule is not fully specified!
  A default pyramid schedule is used.
WARNING: the moving pyramid schedule is not fully specified!
  A default pyramid schedule is used.
WARNING: The parameter "AutomaticTransformInitialization", requested at entry number 0, does not exist at all.
  The default value "false" is used instead.
WARNING: The parameter "AutomaticTransformInitializationMethod", requested at entry number 0, does not exist at all.
  The default value "GeometricalCenter" is used instead.
Transform parameters are initialized as: [0, 0, 0, 0, 0, 0]
Scales are estimated automatically.
Scales for transform parameters are: [6916.916666666667, 6916.916666666667, 9583.833333333334, 1, 1, 1]
Initialization of all components (before registration) took: 8 ms.
Preparation of the image pyramids took: 344 ms.

Resolution: 0
WARNING: The parameter "ShowExactMetricValue", requested at entry number 0, does not exist at all.
  The default value "false" is used instead.
WARNING: The parameter "UseMultiThreadingForMetrics", requested at entry number 0, does not exist at all.
  The default value "true" is used instead.
Setting the fixed masks took: 0 ms.
Setting the moving masks took: 0 ms.
WARNING: The parameter "FixedImageBSplineInterpolationOrder", requested at entry number 0, does not exist at all.
  The default value "1" is used instead.
WARNING: The parameter "UseRandomSampleRegion", requested at entry number 0, does not exist at all.
  The default value "false" is used instead.
WARNING: The parameter "NumberOfHistogramBins", requested at entry number 0, does not exist at all.
  The default value "32" is used instead.
WARNING: The parameter "NumberOfFixedHistogramBins", requested at entry number 0, does not exist at all.
  The default value "32" is used instead.
WARNING: The parameter "NumberOfMovingHistogramBins", requested at entry number 0, does not exist at all.
  The default value "32" is used instead.
WARNING: The parameter "FixedLimitRangeRatio", requested at entry number 0, does not exist at all.
  The default value "0.01" is used instead.
WARNING: The parameter "MovingLimitRangeRatio", requested at entry number 0, does not exist at all.
  The default value "0.01" is used instead.
WARNING: The parameter "FixedKernelBSplineOrder", requested at entry number 0, does not exist at all.
  The default value "0" is used instead.
WARNING: The parameter "MovingKernelBSplineOrder", requested at entry number 0, does not exist at all.
  The default value "3" is used instead.
WARNING: The parameter "UseFastAndLowMemoryVersion", requested at entry number 0, does not exist at all.
  The default value "true" is used instead.
WARNING: The parameter "UseJacobianPreconditioning", requested at entry number 0, does not exist at all.
  The default value "false" is used instead.
WARNING: The parameter "FiniteDifferenceDerivative", requested at entry number 0, does not exist at all.
  The default value "false" is used instead.
WARNING: The parameter "SP_A", requested at entry number 0, does not exist at all.
  The default value "20" is used instead.

WARNING: You have set MaximumNumberOfSamplingAttempts to 8.
  This functionality is known to cause problems (stack overflow) for large values.
  If elastix stops or segfaults for no obvious reason, reduce this value.
  You may select the RandomSparseMask image sampler to fix mask-related problems.

WARNING: The parameter "SigmoidInitialTime", requested at entry number 0, does not exist at all.
  The default value "0" is used instead.
WARNING: The parameter "MaxBandCovSize", requested at entry number 0, does not exist at all.
  The default value "192" is used instead.
WARNING: The parameter "NumberOfBandStructureSamples", requested at entry number 0, does not exist at all.
  The default value "10" is used instead.
WARNING: The parameter "UseAdaptiveStepSizes", requested at entry number 0, does not exist at all.
  The default value "true" is used instead.
WARNING: The parameter "UseConstantStep", requested at entry number 0, does not exist at all.
  The default value "false" is used instead.
WARNING: The parameter "MaximumStepLengthRatio", requested at entry number 0, does not exist at all.
  The default value "1" is used instead.
WARNING: The parameter "MaximumStepLength", requested at entry number 0, does not exist at all.
  The default value "0.988281" is used instead.
WARNING: The parameter "NumberOfGradientMeasurements", requested at entry number 0, does not exist at all.
  The default value "0" is used instead.
WARNING: The parameter "NumberOfJacobianMeasurements", requested at entry number 0, does not exist at all.
  The default value "1000" is used instead.
WARNING: The parameter "SigmoidScaleFactor", requested at entry number 0, does not exist at all.
  The default value "0.1" is used instead.
Elastix initialization of all components (for this resolution) took: 7 ms.
  Computing the fixed image extrema took 9 ms.
  Computing the moving image extrema took 1 ms.
Initialization of AdvancedMattesMutualInformation metric took: 12 ms.
Starting automatic parameter estimation for AdaptiveStochasticGradientDescent ...
WARNING: The parameter "ASGDParameterEstimationMethod", requested at entry number 0, does not exist at all.
  The default value "Original" is used instead.
  Computing JacobianTerms ...
  Computing the Jacobian terms took 0.001097s
  NumberOfGradientMeasurements to estimate sigma_i: 6
  Sampling gradients ...
Time spent in resolution 0 (ITK initialization and iterating): 0.016 s.
Stopping condition: Error in metric.
Settings of AdaptiveStochasticGradientDescent in resolution 0:
( SP_a 1.000000 )
( SP_A 20.000000 )
( SP_alpha 0.602000 )
( SigmoidMax 1.000000 )
( SigmoidMin -0.800000 )
( SigmoidScale 0.000000 )

itk::ExceptionObject (000000D40E9EBA88)
Location: "ElastixTemplate - Run()"
File: c:\dafne\simpleelastix\build\elastix\common\costfunctions\itkAdvancedImageToImageMetric.hxx
Line: 1007
Description: itk::ERROR: AdvancedMattesMutualInformationMetric(000001E0B16D1CF0): Too many samples map outside moving image buffer: 0 / 4332

Error occurred during actual registration.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Projects\SimpleReg\venv\lib\site-packages\SimpleITK\SimpleITK.py", line 11130, in Execute
    return _SimpleITK.ElastixImageFilter_Execute(self)
RuntimeError: Exception thrown in SimpleITK ElastixImageFilter_Execute: C:\dafne\SimpleElastix\Code\Elastix\src\sitkElastixImageFilterImpl.cxx:259:
sitk::ERROR:
itk::ExceptionObject (000000D40E9EBEC0)
Location: "unknown"
File: c:\dafne\simpleelastix\build\elastix\core\main\elxElastixFilter.hxx
Line: 253
Description: itk::ERROR: ElastixFilter(000001E0AF9A1920): Internal elastix error: See elastix log (use LogToConsoleOn() or LogToFileOn()).

Unsure what exactly I am doing wrong, here. Any help will be appreciated! Thanks.

Hello @sarthakpati,
In the past SimpleElastix was an independent project that was based on SimpleITK but the authors continued to use the SimpleITK naming even though it was not part of SimpleITK. More recently, SimpleElastix was officially integrated into SimpleITK in release 2.2.0. You are using SimpleITK 2.0.0 release candidate 2, so not surprising the that the Elastix components are missing.
To use SimpleElastix in SimpleITK you will need to compile SimpleITK on your own. Instructions are available here. When configuring with CMake you will need to turn the SimpleITK_USE_ELASTIX parameter on.

Hello @sarthakpati
We currently have no plans for including SimpleElastix as part of the SimpleITK binary distributions. If you need this add-on you will need to compile it on your own.
With respect to the specific error you are getting "Too many samples map outside moving image buffer", this often happens when initialization was not done properly and the overlap between the initially aligned images is not large. The warnings you are getting also indicate issues with initialization. Compilation is not the issue here, you need to configure the registration appropriately. I would advise asking about SimpleElastix registration on the ITK discourse, possibly someone from the community will be able to help you.


Generate random DNS id's

DNS id generated should be random, see https://datatracker.ietf.org/doc/html/rfc5452#section-4.3. One additional thing that needs to be confirmed is whether we need to handle collisions

collisions should be handled too.
the call to nextId is not thread safe, does this pr handle this?

@Claudenw Pinging

The old code wasn't thread safe either - why do we need to worry about this code being thread safe?
To make the old code thread safe, we'd need to use an AtomicInteger or something like that.

I'm not an expert but any idea why the value is a short. If we used a type like int or long, the risk of collisions reduces.

I'm not an expert but any idea why the value is a short. If we used a type like int or long, the risk of collisions reduces.

It has to be according to the standard, see https://datatracker.ietf.org/doc/html/rfc5452#section-4.3. The generated ID's fill a octet (i.e. 2 byte) range which in Java/Scala is a Short.
Actually this new implementation is strictly better than the current one because the current one only used 1 byte range since it just incremented from 0 and Short.MaxValue + 1 doesn't overflow into Short.MinValue.

The collision can happen in DnsClient.scala, if there are two flight queries with same id.

The collision can happen in DnsClient.scala, if there are two flight queries with same id.
And i was.submited a pr in akka for this, but can be done with a fsm like thing too.

If this is regarding it not being thread safe we can solve this separately. Let's fix one problem at a time, the RC is on our doorstep.
On another note CI is failing because the tests need to be updated. I'll do this in a bit.

Do we know what changing pekko.io.dns.resolver to use inet-address instead of async-dns?

Do we know what happens if we change pekko.io.dns.resolver to use inet-address instead of async-dns?

On the top of my head this uses a completely separate implementation from Java stdlib so it shouldn't be an issue.

Do we know what happens if we change pekko.io.dns.resolver to use inet-address instead of async-dns?

Java lib based one may be slower and blocking？

Do we know what happens if we change pekko.io.dns.resolver to use inet-address instead of async-dns?

Java lib based one may be slower and blocking？

From what @raboof said, the reason why the async-dns was implemented in the first place is that there are caching issues with the java implementation.

I raised https://github.com/apache/incubator-pekko/issues/373 for the lower priority issue of tracking ids

So I have just updated the tests and rebased/force pushed the changes. The reason why the tests are failing is that they assumed the nextId was incrementally increasing and hence checking against raw id's. I have updated the tests so that we don't test against the id's but the properties for the id, i.e. typically speaking the test expects an initial id from the dnsClient1 i.e.
val firstId = dnsClient1.expectMsgPF() {
  case q4: Question4 if q4.name == "cats.com" =>
    q4.id
}

and then that secondId is being reused in later on, such as
val secondId = dnsClient2.expectMsgPF() {
  case q4: Question4 if q4.name == "cats.com" && q4.id != firstId =>
    q4.id
}

i.e. in this specific case we can't test for hardcoded id's but we can still make sure that the secondId is not the same as the firstId.

So I just checked systemd-resolved and it does appear to handle hash collisions, it does this by tracking the state of current transactions (see https://github.com/systemd/systemd/blob/main/src/resolve/resolved-dns-transaction.c#L195-L196). Will work on this now.

Lets wait a bit before merging this, I think I was wrong in what I said before about collisions and we do need to handle this.

It looks like a singleton actor instance to me - so receive should only be processing one message at a time.

nextId can be called concurrently, so I think two thread can get the same result. idIncrement and idIndex should be protected with AtomicLong

So having gone through the codebase, nextId() is only called in a receive block (indirectly) which means that its only going to be called in a single threaded context (this is something that actor guarantees).
Did I miss something?

IIRC, it can be called from the recover of the future。

@mdedetrich I don't really mind how this is implemented. If exposing the map state outside of the actor makes this easier to implement, then I suggest that we do that.
We can always change that afterwards.

@mdedetrich What do you think about my PR？I think that's correct too.

@mdedetrich What do you think about my PR？I think it's correct too.

Which one?

@mdedetrich I don't really mind how this is implemented. If exposing the map state outside of the actor makes this easier to implement, then I suggest that we do that.
We can always change that afterwards.

I don't think that would fly in general, I mean it breaks one of the core principles of actors and it would open a whole can of worms

@mdedetrich I don't really mind how this is implemented. If exposing the map state outside of the actor makes this easier to implement, then I suggest that we do that.
We can always change that afterwards.

I don't think that would fly in general, I mean it breaks one of the core principles of actors and it would open a whole can of worms

https://github.com/akka/akka/pull/31912

@He-Pin https://github.com/akka/akka/pull/31912 looks like a viable approach. Is there any way that a unit test could be developed?

@pjfanning I think that can be tested, but I will not have much time before weekend.

@He-Pin akka/akka#31912 looks like a viable approach. Is there any way that a unit test could be developed?

So I had a look at this in more detail and I don't think this would solve the specific problem we are dealing with here. Unless I misunderstood, this is solving the issue where you can have multiple in flight requests with the same id where as I am dealing with the issue where we don't want to generate multiple ids by checking in flight transactions.
While the difference is subtle its somewhat critical here, the solution in https://github.com/akka/akka/pull/31912 involves putting guards around inflightRequests within DnsClient itself where as the problem we have is that we have an external AsyncDnsResolver actor that needs to access the state of `DnsClient.
If inflightTransactions was hypothetically inside of AsyncDnsResolver we wouldn't even be having this issue  and the solution would be done by now and this is what I alluded to when I made this earlier statement

Initially I thought it would have been possible to just have a currentIds collection inside of AsyncDnsResolver, adding id's is easy since nextId() is also defined inside of AsyncDnsResolver, the problematic part is removing the id's. If you check occurrences of inflightRequests -=  you can see there are 3 cases where id's are removed (i.e. dropped requests, failed UDP packets etc etc) and only in one of those cases (specifically DropRequest) does AsyncDnsResolver have context of this.

A hypothetical solution to this issue would be to reverse the problem, i.e. for the other cases where inflightRequests -= <ID> occurs in Actors outside of AsyncDnsResolver, those actors could send a message to AsyncDnsResolver stating that an id has been dropped but the problem here is this would create a cyclic dependency because the relationship is currently the opposite way around, i.e. AsyncDnsResolver keeps track of the other actors (such as DnsClient) and not the other way around (DnsClient does not have any actor references to AsyncDnsResolver)

@mdedetrich Yes, that why I had https://github.com/apache/incubator-pekko/pull/288 and https://github.com/akka/akka/pull/31912 for this. This  PR can move faster with a smaller scope I think.
$work time, sorry not makes me clear.

@mdedetrich Yes, that why I had #288 and akka/akka#31912 for this. This PR can move faster with a smaller scope I think.
$work time, sorry not makes me clear.

I still think the issue is the same, i.e. requestIdGen in https://github.com/apache/incubator-pekko/pull/288/files#diff-4891e059729a403d92d62966e039a3f9b6aa24fbc7562e1ed9daa280c46328d5R97 would need to access inFlightTransactions in DnsClient actor, but sure lets wait till the weekend when you have time to look at this properly.

This is just my view but if we can get a solution working that cycles through a large set of possible ids without a collision (like the latest one based on UniqueRandomShortProvider) that that should be enough for Pekko 1.0.0. A solution where we keep track of all in-flight ids might be nice but it would appear to be more expensive than the UniqueRandomShortProvider solution.

So just to clarify this a bit more, the current solution in this PR is not ideal and both @pjfanning, @Claudenw and myself have an improvement however I am holding off adding this due to what @IainHull posted here https://github.com/apache/incubator-pekko/pull/371#discussion_r1224490114 since it may be a waste of time.
Hopefully the legal hurdles will be overcome and we can discuss and review that solution comprehensively.

I've created a label to track all the issues and PRs related to async DNS resolution. I think we need to prioritise work on solving the Akka-related CVE and not necessarily fix everything that is wrong.
I've created 3 issues to track 3 problems and created a label to link them and the PRs.
https://github.com/apache/incubator-pekko/labels/async-dns-resolver
This PR relates to #384

@mdedetrich In recent Netty PR:
refs: https://github.com/netty/netty/pull/13439/

So I just rebased the PR with @Claudenw 's latest algorithm and one thing we can say, according to benchmarks its pretty damn fast
[info] Benchmark                                        Mode  Cnt   Score    Error   Units
[info] IdGeneratorBanchmark.measureEnhancedDoubleHash  thrpt    3  ≈ 10⁻⁴           ops/ns
[info] IdGeneratorBanchmark.measureSecureRandom        thrpt    3   0,001 ±  0,001  ops/ns
[info] IdGeneratorBanchmark.measureThreadLocalRandom   thrpt    3   2,286 ±  0,453  ops/ns

So I just rebased the PR with @Claudenw 's latest algorithm and one thing we can say, according to benchmarks its pretty damn fast
[info] Benchmark                                        Mode  Cnt   Score    Error   Units
[info] IdGeneratorBanchmark.measureEnhancedDoubleHash  thrpt    3  ≈ 10⁻⁴           ops/ns
[info] IdGeneratorBanchmark.measureSecureRandom        thrpt    3   0,001 ±  0,001  ops/ns
[info] IdGeneratorBanchmark.measureThreadLocalRandom   thrpt    3   2,286 ±  0,453  ops/ns

Isn't 10e-4 a small number meaning poor performance?

Isn't 10^-4 a small number meaning poor performance?

Ah its in throughput mode, in this case something seems to be up.

If we can get the performance into the same ballpark as 'secure-random' then this generator is a useful addition. I would default to 'secure-random' though (unless the EnhancedDoubleHash was made to be faster than secure-random).
One useful aspect of EnhancedDoubleHash is that it would depend much less on the entropy settings of the device that the code was running on. SecureRandom can be very fast on some hardware but can be very slow in low entropy environments. Low entropy environments can be improved using tools like haveged.

If we can get the performance into the same ballpark as 'secure-random' then this generator is a useful addition. I would default to 'secure-random' though (unless the EnhancedDoubleHash was made to be faster than secure-random).

So I don't know whats going on here, but I am having a suspicion that the reason for its slowness is all of the collision detection that was added ontop. When I was discussing with @Claudenw I was contemplating reverting the algorithm to the original simple version that had no buffers because even if there are collisions we can now handle them

So here is a benchmark of the version that has no buffer to keep track of collisions or rollover detection
[info] Benchmark                                        Mode  Cnt  Score    Error   Units
[info] IdGeneratorBanchmark.measureEnhancedDoubleHash  thrpt    3  1,105 ±  1,203  ops/ns
[info] IdGeneratorBanchmark.measureSecureRandom        thrpt    3  0,001 ±  0,001  ops/ns
[info] IdGeneratorBanchmark.measureThreadLocalRandom   thrpt    3  2,345 ±  0,602  ops/ns

So its significantly faster than SecureRandom and only approx twice as slow thread local random

So here are the results when using a simple faster version with the  synchronized block
[info] Benchmark                                        Mode  Cnt  Score    Error   Units
[info] IdGeneratorBanchmark.measureEnhancedDoubleHash  thrpt    3  0,009 ±  0,012  ops/ns
[info] IdGeneratorBanchmark.measureSecureRandom        thrpt    3  0,001 ±  0,001  ops/ns
[info] IdGeneratorBanchmark.measureThreadLocalRandom   thrpt    3  2,312 ±  0,531  ops/ns

While its still faster than secure random its now much slower than thread local random, i.e. performance impact was significant. Rewriting the algorithm with AtomicLong/volatile can likely mitigate this greatly

So as @pjfanning pointed out, the current benchmarks are somewhat misleading in that they are run over 8 threads which is the complete worst case scenario for synchronized especially when taking into account that in almost every case the calls will from the same thread, only when recoverWith in the Future block gets hit can we get multiple calls.
If we modify benchmark to just use single thread then here is the non synchronized version
[info] IdGeneratorBanchmark.measureEnhancedDoubleHash  thrpt    3  0,441 ±  0,031  ops/ns
[info] IdGeneratorBanchmark.measureSecureRandom        thrpt    3  0,001 ±  0,001  ops/ns
[info] IdGeneratorBanchmark.measureThreadLocalRandom   thrpt    3  0,313 ±  0,034  ops/ns

and synchronized version
[info] IdGeneratorBanchmark.measureEnhancedDoubleHash  thrpt    3  0,380 ±  0,008  ops/ns
[info] IdGeneratorBanchmark.measureSecureRandom        thrpt    3  0,001 ±  0,001  ops/ns
[info] IdGeneratorBanchmark.measureThreadLocalRandom   thrpt    3  0,312 ±  0,053  ops/ns

@alexandru I suggested to @mdedetrich to use a Semaphore instead. It seems a little faster in the microbenchmark but you can set a timeout on the acquire as well.

@alexandru Thanks for the reply
So to provide some context on how, why and where the concurrency in this specific circumstance matters the code we are dealing with is entirely inside an Actor receive block which is actually normally meant to be guaranteed to be thread safe (i.e. single thread), the reason why we need to make nextId() thread safe is because there is a recoverWith on a Future which ends up transitively calling nextId() within an ExecutionContext. This ExecutionContext is configurable and hence parameterised, its using the Akka default dispatcher which iirc is a ForkJoinPool.
I have strong suspicion that we should be optimising for our happy case, because as you can infer from the usage of recoverWith this is probably not going to happen that often so while the usage of synchronized is typically ill advised, as you pointed out it is heavily optimized/uses assumptions that mirror the case we are dealing with.
The thing is (and this is a general statement and not strictly about this concurrency issue at hand), its hard for us to get some real data on this and there are many variables at play. For example there are actually 3 versions of @Claudenw algorithm, each with different guarantees of how we want to handle collisions. The "simple" version doesn't handle collisions at all which with initial impressions appears might be the best solution because its going to get handled by the duplicate id changes merged at https://github.com/apache/incubator-pekko/pull/385. However if we get lots of collisions/transactions then one of his variants which mitigate collisions might end up overall being faster.
And while we have a concurrency issue at hand, at the same time we are dealing with random numbers here which means we don't care about "wrong" answers, only if we get duplicates that we can't detect which might open up for some interesting optimisations.
Nonetheless we are trying to work out these concurrency issues and very much appreciate your experience here (if you have some extra time to spare let me know and we can co-ordinate).

I tried a solution with an AtomicReference around the state but its performance was slower than the synchronization and Semaphore locking variants. Approximately in SecureRandom territory in the 8 threads microbenchmark.
  private val state = {
    val (index, increment) = {
      val r = new SecureRandom()
      (r.nextLong, r.nextLong())
    }
    new AtomicReference(Array(index, increment, 1))
  }

  @tailrec
  final def nextId(): Short = {
    val array = state.get()
    var index = array(0)
    var increment = array(1)
    var count = array(2)
    val result = (0xFFFFFFFF & index).asInstanceOf[Short]
    index -= increment

    // Incorporate the counter into the increment to create a
    // tetrahedral number additional term.
    increment -= {
      count += 1
      count - 1
    }
    if (state.compareAndSet(array, Array(index, increment, count))) {
      result
    } else {
      nextId()
    }
  }

I tried a solution with an AtomicReference around the state but its performance was slower than the synchronization and Semaphore locking variants. Approximately in SecureRandom territory in the 8 threads microbenchmark.

This isn't too surprising, I suspect that if you wanted to get any tangible benefits of AtomicLong/volatile you would need to use it on the individual variables (i.e. index/counter etc etc) where its needed which is hard to do correctly

I tried a solution with an AtomicReference around the state but its performance was slower than the synchronization and Semaphore locking variants. Approximately in SecureRandom territory in the 8 threads microbenchmark.

This isn't too surprising, I suspect that if you wanted to get any tangible benefits of AtomicLong/volatile you would need to use it on the individual variables (i.e. index/counter etc etc) where its needed which is hard to do correctly

Unfortunately, the 3 numbers in the state are all important. And they should be updated together, so I find it hard to see any solution based on AtomicLongs or AtomicReferences.
Using the Semaphore locking has the best result in my testing. Could we just go with that for RC1? We are very likely to need an RC2 so there is time for someone to find a better solution.

Unfortunately, the 3 numbers in the state are all important. And they should be updated together, so I find it hard to see any solution based on AtomicLongs or AtomicReferences.

Ordinarily yes, but we aren't looking for complete correctness here but I can't think of any way to abuse this atm

Using the Semaphore locking has the best result in my testing. Could we just go with that for RC1? We are very likely to need an RC2 so there is time for someone to find a better solution.

Fine with me unless there are some other real objections.

So I have just pushed the branch using the simple version of enhanced double hash with the synchronized keyword. Here are the benchmarks
[info] IdGeneratorBanchmark.measureEnhancedDoubleHash                 thrpt    3  0,377 ±  0,032  ops/ns
[info] IdGeneratorBanchmark.measureSecureRandom                       thrpt    3  0,001 ±  0,001  ops/ns
[info] IdGeneratorBanchmark.measureThreadLocalRandom                  thrpt    3  0,308 ±  0,057  ops/ns
[info] IdGeneratorBanchmark.multipleThreadsMeasureEnhancedDoubleHash  thrpt    3  0,025 ±  0,013  ops/ns
[info] IdGeneratorBanchmark.multipleThreadsMeasureSecureRandom        thrpt    3  0,001 ±  0,001  ops/ns
[info] IdGeneratorBanchmark.multipleThreadsMeasureThreadLocalRandom   thrpt    3  0,609 ±  0,014  ops/ns

Note that I have modified the benchmarks to be more indicative of what we are actually testing in reality, i.e. the original benchmarks designated 8 threads however its unlikely in reality that we will have more than 8 threads hitting the nextId() function at once with such high contention, so instead I set the default to just a single thread but added another set of benchmarks for multiple threads.
@pjfanning @IainHull Let me know if I may have missed something

@mdedetrich this PR is showing a Merge Conflict in GitHub

Fixed

@mdedetrich Sorry for the delay getting back, this looks good.

@IainHull Note that I made a ticket for anyone that wants to further improve performance of double enhanced hasher https://github.com/apache/incubator-pekko/issues/411


Implement options as array of hashes so order is preserved

Fixes https://tickets.puppetlabs.com/browse/MODULES-1317. See also the
discussion in PR #171.
Frontend, backend and listen options are specified via the
haproxy::frontend::options, haproxy:backend::options and
haproxy::listen::options parameters. Until now this options
parameter was a hash, which means it had to be sorted before processing
it in the _options.erb template fragment (since Ruby 1.8.x has
non-deterministic hash key ordering).
This clashes with the fact that in HAProxy's configuration order matters.
With this change we allow the options parameter to be either a hash,
like before, or an array of hashes, where each hash represents a
frontend, backend or listen option and its value. This way the order in
which options will appear in the final configuration file can be
controlled entirely by the user.
This change is completely backwards compatible and contains updated spec
tests and documentation.

@jweisner this might interest you, please test if you get the chance.


respect aspect ratio of elsewhere pics

This is just amateur hour:

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7790237-respect-aspect-ratio-of-elsewhere-pics?utm_campaign=plugin&utm_content=tracker%2F85909&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F85909&utm_medium=issues&utm_source=github).

+1 https://gratipay.freshdesk.com/helpdesk/tickets/1862

+1 https://twitter.com/kellyrued/status/582916641924710401


check settings

Hey!
Great job on this role.
Just one question: what happens if you want to update the settings of an existing windows_exporter?
So for example I had
windows_exporter_options: 'ENABLED_COLLECTORS="os,service,system"'
but now I want perhaps
windows_exporter_options: 'ENABLED_COLLECTORS="os,service,process,system"'
(or change the port maybe, etc.??)
As with the current logic that would lead to
is exporter installed -> yes -> skip install (regardless of the settings)

is there a way maybe to check the settings of exporter, and if it is not in the desired state, reinstall it?
for the time being - since my company just tests exporter on a few machines - I  just put a sloppy workaround in, to reinstall exporter if it finds it...but that is not feasible for production, as it would mean each  Ansible-run reinstalls it...

Seems like win_package does not recoginize any changed arguments as a reason to reinstall the msi package, even if you remove any condition of the job for the win_package module.
If we include any "force" option the role would not be idempotent-by-design anymore.
Maybe we have to address this first in https://github.com/ansible-collections/ansible.windows ?


Format project

Is there any specific reason why docker-base-images is not formatted? @talex5

I don't use ocamlformat on my own projects, but someone else should probably take over as maintainer here anyway.
(I don't understand why anyone wants to have their formatting automatically removed, but some people seem to like it. I find it a huge nuisance, and the changes it makes almost always make the code worse than it was, in my opinion.)

We'd like to autoformat, but we will do it fresh.


docs: update guidelines for docstrings

Summary of Changes
Update guidelines for docstrings. It's no longer recommended to include type hints for parameters/results in docstrings.

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

v0.5.0
GitHub release

Your semantic-release bot :package::rocket: