Use libbpf and CO-RE BPF to build the BPF probe

Motivation
I have a Ubuntu machine with a fresh install of Ubuntu 22.04 LTS (kernel version 5.15).
The full distro version is ubuntu-generic_5.15.0-27-generic_28
I am trying to deploy Falco on my local Kubernetes cluster, and I keep getting the same error when using the BPF probe:
Runtime error: BPF probe version is b7eb0dd65226a8dc254d228c8d950d07bf3521d2, but running version is 319368f1ad778691164d33d59945e00c5752cd27. Exiting.
This error is caused by the driver-loader container.
From what I understand, this error is because there is no BPF probe that matches my kernel+distro version available for download in the Falco driver registry. A solution would be to compile the BPF probe at deployment time, but that seems to require some tooling present on the node. This is not a viable solution when deploying to many Kubernetes clusters.
Feature
Use libbpf + CO-RE bpf to build the BPF probe. See libbpf repository here.
I am not an expert on BPF, but from what I know using libbpf, the generated vmlinux.h header file (which removes the dependency on kernel headers for compilation) and the bpf_core_read.h header file (which re-aligns on the fly the memory layout of a struct depending on the host's kernel), its possible to build and compile a BPF program once that will work on (almost) any kernel version.
It seems to me that it would make it possible for Falco to build a BPF probe once, and ship it with the driver-loader Docker image. No need for the falco-driver-loader script to run and detect the kernel version and distro version anymore; a single pre-built BPF probe for all distros.
I might be wrong on some details. I am appealing to BPF programmers and experts to correct me if I am wrong. But it seems to me that using libbpf would make it easier to install Falco with the BPF probe on newer kernel.
Alternatives
Like I said, an alternative seems to provision all nodes of a cluster with the necessary tooling to support compiling the BPF probe on the host (or to compile and load the kernel module). But that solution does not scale well in my opinion.
Additional context

Hey @ocampeau, we have a merged proposal for a new eBPF probe with CORE support! The development is a WIP, take a look and let me know what you think! https://github.com/falcosecurity/libs/blob/master/proposals/20220329-modern-bpf-probe.md

Sorry for my late reply. That's seems really nice I'll take a look for sure. Thanks

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Provide feedback via https://github.com/falcosecurity/community.
/close

@poiana: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Provide feedback via https://github.com/falcosecurity/community.
/close

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.


419 Error despite valid token being passed correctly

Laravel Version: 5.7.9
PHP Version: PHP 7.1.17-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: May  5 2018 04:56:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.17-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

Description:
Using an out-of-the-box Laravel setup from laravel new appname, CSRF functionality appears to be broken on v5.7.9 but v5.7.3 works perfectly with the server software listed above.
Steps To Reproduce:
https://stackoverflow.com/questions/52764590/laravel-419-error-verifycsrftoken-issue

Can you create a simple Laravel application that doesn't work for you and upload it to GitHub?

appears to be broken on v5.7.9 but v5.7.3 works perfectly

And can you confirm exactly what version stops working? i..e does v5.7.4 work or not etc?

CsrfCausing419.zip
^ There is the barebones code for the project demonstrating the issue. When you submit the form on the homepage, it returns a 419 error. This happens regardless of whether using ajax submission like in the project (still providing the _token value) or submitting the form the old fashioned way.

The form works for me. Can you reproduce the issue in Homestead?

Heh, I swore it said 5.7.9 when I ran php artisan --version. Anyhow, I have tested in Homestead which works fine. It's just on my ubuntu server with nginx that does not work. Perhaps it's related to the server software or configuration?

What about the versions between 5.7.4 and 5.7.9?

Is there a faster way to check each version than by running laravel new appname --5.7.x and copying all the modified files to the newly created Laravel app? Perhaps a like a laravel upgrade -5.7.x or something similar?

Set a specific version of the laravel/framework package in your composer.json file and run composer update.

Thank you, that was much less painless than I had first anticipated. I started using Laravel earlier this year and I haven't yet had a reason to use composer, which is very nice.
I have done this for 5.7.4 and it began giving me the 419 error on my webserver. I will continue to test the additional versions as time permits, though they probably will all give the 419 if the bug was introduced in 5.7.4 - I guess we'll see soon enough.

5.7.5 confirmed also throws the 419.

@Xerotherm1c Just test your source code and it works fine for me.

Ok not cool, it's no longer working on 5.7.3 for me, including the sites that were working before. I think the apt-get update may have borked it entirely for me.

Did you try delete vendor and install it again?

I just deleted the vendor folder and re-ran composer update with 5.7.3 and uploaded it to my server. Still throwing the 419. Are there any commands I would need to run to reload everything on my server, like php artisan cache:clear or php artisan config:cache?

Maybe you forget delete composer.lock file before run composer update

Maybe you forget delete composer.lock file before run composer update

Well I've been running php artisan --version to verify my version updates are in fact making it to my webserver each time, but I do have a composer.lock file in the folder. I can delete it and try it again if you think that might cause an issue.

Deleting the composer.lock file and retrying did not affect the result - still getting the 419. Also, for what it's worth, composer update is recreating the composer.lock file when I run it.

If you're sure with version, I think the issues from your server, not laravel bug. One more thing why you need to update vendor folder to your server instead of run composer update in your server.

I'm running an nginx server and I listed my packages in a previous comment. Do you have any idea what might be wrong on my end that would cause Laravel's Csrf token system to malfunction?
Are you saying I can just overwrite the vendor folder to change the Laravel version? And do I need to run any commands for the updated version to fully kick in / take effect?

Well using a List Comparison, I compared my webserver's packages to Homestead Vagrant's. Looks like Vagrant is running Xenial Xerus but my webserver is running Bionic Beaver.

I'm closing this - as it is clearly not a Laravel Framework issue, but something with your server setup.
The problem is not with "CSRF" - but with your sessions not persisting (which will cause a by-product of CSRF not working).
Please try asking your question on one of the many great community support areas that will likely give you a better answer more quickly:

Laravel Slack (https://larachat.co/)
Laravel.io Forum (https://laravel.io/forum)
Laracasts Forum (https://laracasts.com/discuss)
StackOverflow (http://stackoverflow.com/questions/tagged/laravel)

If you feel I've closed this issue in error, please provide more information about how this is a framework issue, and I'll reopen the ticket.
Thanks in advance.

Um, is the fact that this doesn't work with Ubuntu's latest LTS not a problem?

It does - I use it myself with no issues. It's something with your setup or config.

Ok so I rebooted my server and I am testing 5.7.3 which is working for me. Not sure why it didn't work previously or if that was unrelated, but 5.7.3 is working. So at this point I have no idea if it's Laravel of my server. If it's working on 5.7.3, then that means my sessions are in fact persisting - at least on 5.7.3, right?

Yes.
Now try the latest version. 5.7.9. Does that work?
If not - go through each version in between and tell us exactly which version breaks, and I'll look into what changed in that version.
To do this go into composer.json and change
- "laravel/framework": "5.7.*",
+ "laravel/framework": "5.7.4",

and keep changing the version until you find the exact spot it breaks.

Yes.
Now try the latest version. 5.7.9. Does that work?
If not - go through each version in between and tell us exactly which version breaks, and I'll look into what changed in that version.
To do this go into composer.json and change
- "laravel/framework": "5.7.*",
+ "laravel/framework": "5.7.4",

and keep changing the version until you find the exact spot it breaks.

Ok, I believe I performed this test correctly when I posted this comment, and the version that starting throwing the 419 was 5.7.4 - can you review my steps that I posted I took to make sure I tested correctly? If not, I can perform the test again tomorrow after I relieve myself of sleep deprivation lol.
Thanks for the help.

These changes were made in 5.7.4: https://github.com/laravel/framework/compare/v5.7.3...v5.7.4
None of them look "suspicious".

Yeah...
It's possible its another package that changes during the version change (due to 'min' requirements).
Are you using a file driver? Try Redis or something else and see how that goes.
But as others have said - we cant replicate, so it is somehow related to your server config.

Yeah...
It's possible its another package that changes during the version change (due to 'min' requirements).
Are you using a file driver? Try Redis or something else and see how that goes.
But as others have said - we cant replicate, so it is somehow related to your server config.

Sorry, can you elaborate on the file driver question? I just have a webserver running nginx where I copied up the Laravel site.

@laurencei is referring to the session.driver config option (https://laravel.com/docs/5.7/session).
You can try a different driver like database or redis.

I have the same problem

419
Sorry, your session has expired. Please refresh and try again.

At least as far as my Homestead vagrant dev box goes, I was able to overcome the 419 with a simple vagrant box update from version '5.1.0' to '6.3.0'. Are there specific packages in this upgrade that might cause the newer Laravel versions to throw a 419 error on older vagrant versions?

@Xerotherm1c Can you reliably reproduce the issue in Homestead? What Laravel version are you using?

I have Laravel 5.7.14, have docker locally and on Prod, both having this issue. Forced to turn-off some routes in VerifyCsrfToken.php. Didn't have it on 5.6.*

Migrated from 5.6 to 5.7. Using @csrf token in 5.7, but with old approach {{ csrf_field() }} doesn't work as well.

You may be onto something with the {{ csrf_field() }} approach causing issues. I've been using @csrf in the project I'm currently working on with absolutely no issues so far.

Migrated from 5.6 to 5.7. Using @csrf token in 5.7, but with old approach {{ csrf_field() }} doesn't work as well.

You may be onto something with the {{ csrf_field() }} approach causing issues. I've been using @csrf in the project I'm currently working on with absolutely no issues so far.

Unfortunately, both of them doesn't work.

I'm also running into this issue locally on Ubuntu Bionic Beaver and it also happened once on a staging server. It happened on a vagrant up this morning.  When it occurred on the server, it was after doing an update to the project and running composer install. I can consistently clear the error when I delete my browser cookies.

I have the same problem.
On Mac High Sierra, Laravel 5.7.9 it's ok
On Staging Server Ubuntu 18.04 Laravel 5.7.15, 419 error.
I'll try to downgrade to 5.7.9 and keep you posted.

@KeitelDOG Do all POST requests fail or only some of them? What session driver are you using?

Still not working on ubuntu after downgrading. @staudenmeir yes for all posts I suppose, I tried Login and Register.  I'm using file session.

Can anyone reproduce this issue on a fresh Laravel installation?

Now I just retry it in my Mac without clearing any browser cache nor cookies and it works. I don't think it's a laravel Issue because the code does not change at all. Could it be a Browser cache, cookie or Browser - Server communication problem that disappears after some times?
This problem happened to me before on a Laravel 5.6 with Apache on Ubuntu 18.04, and the day after I went to debug it but it was working fine. And today same thing.
I suspect some strange behavior from Browser - Server communication that keeps inappropriate data for some times that causes the bad data to be passed. And once the time passes and the inappropriate data get flushed, then it starts to work great again.
If that's the case, I have no idea of what would generate this inappropriate data in browser? new PHP 7+? Chrome Browser?
I used Chrome only when I found the error.

Did anyone experience this issue with a browser other than Chrome?

Reading all the comments - it is clear this is a mixture of different
issues, but all boils down to a session persistence issue.
In most cases the sessions are just not setup correctly, and when a
form is submitted, the lack of session means the CSRF fails, and you
get a 419 error.
You can self diagnose this issue by turning off CSRF, and trying to
login. If you can’t login (because you keep going back to the login
page) - then your sessions are broken and you need to fix that.
If you can login, then you probably have a mis-configured CSRF token
in your form, and you need to fix that.
Any specific issue with Chrome is likely to be a session issue (which
appears as a CSRF issue - but that’s because the session is broken).
But we know that all Chorme versions work with all Laravel versions
out of the box, which means if there is an issue, it is somehow
related to the local config/setup.
The other possibility is a JS related issue, where one browser works
and another doesn’t depending on what your JS code is doing.

@staudenmeir I've experienced the issue in Firefox as well.  I agree with @laurencei that is seems like this stems from a cookie/session issue.  It could be that I hadn't visited the project over the long holiday weekend (about 5 days) - so maybe whatever was saved in my cookie was no longer valid and didn't renew. Hopefully the issue comes back at me so I can try and trace this through.

Also, I can also confirm that when this occurred on the server, I was able to comment out VerifyCsrfToken to get the forms to work (re-enabling brought back the issue).

I did the same thing again this morning in the Staging Server with Ubuntu 18.04. The login session expired cause it asked me login again. And when I did, 419 error again. I will investigate printing the session data and cookie data to see the difference.
@zyglobe if it happens to Firefox also, maybe Laravel sent an outdated cookie or so...
If the problem can't be solved now, I can't upgrade Production yet.

@KeitelDOG Does this occur if you use a different device/browser that had not previously accessed the site before?

I sacrificed whole day trying to figure it out. And I think I've found some good hints.
I break my AuthController@signin and use Codes from VerifyCsrfToken to see output. I added echo and print_r to the Illuminate\Session\Store to debug.
public function signin()
	{
        try {

        	echo 'Request Session Token :
'.request()->session()->token().'
';

	        $token = request()->input('_token');
	        echo '
Request Session Token :
'.$token.'
';
	        \Megalo::addAppLog('_token : '.request()->input('_token'), "VerifyCsrfToken");

	        echo '
Request Session Object array :
';
	        print_r(request()->session());
	        echo '
';

	        clearstatcache();
			echo '
storage/framework/sessions directory permission :
'.substr(sprintf('%o', fileperms(storage_path('framework/sessions'))), -4);
			echo '
';

        	$isMatched = is_string(request()->session()->token()) &&
               is_string($token) &&
               hash_equals(request()->session()->token(), $token);

            if ($isMatched) {

                \Megalo::addAppLog('Verification passed. Tokens Matched', "VerifyCsrfToken");

                foreach (\Megalo::$appLogs as $log) {
		            echo $log["level"]."/".$log["place"]." : ".$log["desc"]."
";
		        }

                return 'OK';
            }
        }catch(Exception $e) {
            echo $e->getMessage().' - '.$e->getFile().' - '.$e->getLine();
        }

        //throw new \Illuminate\Session\TokenMismatchException;
}

And here is the results.
For DEV with SIMILAR BUG with limited permission 440, owner and group (_www => Mac), I get :
Request Session Token :
C0U9SaZBrHUqDESGNytJwAsgFFPL1n0ooBkjA2WF

Request Session Token :
zDx4hMGaw3xNt8cvTrJBMEBj37aoPvqVBsJKfmkD

Request Session Object array :
Illuminate\Session\Store Object ( [id:protected] => WChNe9QnXi7vxcW1LTgB4h8WYvE5y6RXOP91AuKJ [name:protected] => megalobiz_dev_session [attributes:protected] => Array ( [_token] => C0U9SaZBrHUqDESGNytJwAsgFFPL1n0ooBkjA2WF ) [handler:protected] => Illuminate\Session\FileSessionHandler Object ( [files:protected] => Illuminate\Filesystem\Filesystem Object ( ) [path:protected] => /private/var/www/megalobiz/storage/framework/sessions [minutes:protected] => 2592000 ) [started:protected] => 1 )

storage/framework/sessions directory permission :
0440

But for DEV that is working with enough permission 550, owner and group (_www => Mac), I get :
Request Session Token :
zDx4hMGaw3xNt8cvTrJBMEBj37aoPvqVBsJKfmkD

Request Session Token :
zDx4hMGaw3xNt8cvTrJBMEBj37aoPvqVBsJKfmkD

Request Session Object array :
Illuminate\Session\Store Object ( [id:protected] => WChNe9QnXi7vxcW1LTgB4h8WYvE5y6RXOP91AuKJ [name:protected] => megalobiz_dev_session [attributes:protected] => Array ( [_flash] => Array ( [new] => Array ( ) [old] => Array ( ) ) [_previous] => Array ( [url] => http://localhost ) [_token] => zDx4hMGaw3xNt8cvTrJBMEBj37aoPvqVBsJKfmkD [guest_id] => Array ( [0] => Mv2xJEawXImP38gF2gpz0euCX4RQqB_1543601170 ) [last_briefed] => 2018-11-27 01:11:10 ) [handler:protected] => Illuminate\Session\FileSessionHandler Object ( [files:protected] => Illuminate\Filesystem\Filesystem Object ( ) [path:protected] => /private/var/www/megalobiz/storage/framework/sessions [minutes:protected] => 2592000 ) [started:protected] => 1 )

storage/framework/sessions directory permission :
0550
debug/BaseController : Megalo initialized
debug/VerifyCsrfToken : _token : zDx4hMGaw3xNt8cvTrJBMEBj37aoPvqVBsJKfmkD
debug/VerifyCsrfToken : Verification passed. Tokens Matched
OK

THIS IS WAT IS HAPPENING :
With Laravel Code in Illuminate\Session\Store class
    /**
     * Start the session, reading the data from a handler.
     *
     * @return bool
     */
    public function start()
    {
        $this->loadSession();

        if (! $this->has('_token')) {
            $this->regenerateToken();
        }

        return $this->started = true;
    }

    /**
     * Load the session data from the handler.
     *
     * @return void
     */
    protected function loadSession()
    {
        $this->attributes = array_merge($this->attributes, $this->readFromHandler());
    }

    /**
     * Read the session data from the handler.
     *
     * @return array
     */
    protected function readFromHandler()
    {
        print_r($this); // added by me
        echo '

'; // added by me

        if ($data = $this->handler->read($this->getId())) {
            $data = @unserialize($this->prepareForUnserialize($data));

            if ($data !== false && ! is_null($data) && is_array($data)) {
                return $data;
            }
        }

        echo 'session empty in  readFromHandler '.get_class($this->handler).'

'; // added by me

        return [];
    }

So when Session read the File from FileSessionHandler or CookieSessionHandler which implement SessionHandlerInterface with read, write, destroy methods etc., if Session doesn't find the _token attribute, then it regenerates Token, and therefore, when Laravel compares the File Session Token in VerifyCsrfToken with the passed token in request()->input('_token'), it fails.
One reason can be because of limited permission, which can recreate the Bug in Dev, but not this actual bug we're facing.
Another reason is that the passed Token via input can be different or inexistant, so the Token Mismatch Exception will raise.
On Staging Server, here is my Output :
Illuminate\Session\Store Object ( [id:protected] => e4Em43rkBART7BlTgsT7PneLg572RDDFWnvjCVw3 [name:protected] => megalobizstaging_session [attributes:protected] => Array ( ) [handler:protected] => Illuminate\Session\FileSessionHandler Object ( [files:protected] => Illuminate\Filesystem\Filesystem Object ( ) [path:protected] => /var/www/megalobiz/storage/framework/sessions [minutes:protected] => 2592000 ) [started:protected] => )

session empty in readFromHandler Illuminate\Session\FileSessionHandler

Request Session Token :
jJYOEmm920oU5JSQd6h8xfpaj1nugtWG6hPlQgkf

Request Session Token :
4ExdeLOtbTnO9LGW3jDpP2BBMJe9KCTEfMjJJie8

Request Session Object array :
Illuminate\Session\Store Object ( [id:protected] => e4Em43rkBART7BlTgsT7PneLg572RDDFWnvjCVw3 [name:protected] => megalobizstaging_session [attributes:protected] => Array ( [_token] => jJYOEmm920oU5JSQd6h8xfpaj1nugtWG6hPlQgkf ) [handler:protected] => Illuminate\Session\FileSessionHandler Object ( [files:protected] => Illuminate\Filesystem\Filesystem Object ( ) [path:protected] => /var/www/megalobiz/storage/framework/sessions [minutes:protected] => 2592000 ) [started:protected] => 1 )

storage/framework/sessions directory permission :
0777

When Laravel creates a session file, it creates it with permission 644,  -rw-r--r--, that could be the reason why when I tested in Dev, 440 did not work, because execute permission is missing.
@zyglobe I just tested the Staging with my Phone, Chrome browser, and the Session is ok and accessible.
But now I'm stuck because I can't understand why would 644 permission block me vi Mac, and not via Phone. Via Android Phone, the session file is stil with 644.

@KeitelDOG - as I mentioned earlier - what you've described is simply a session persistence issue and has nothing to do with CSRF (but the CSRF error you get is because of the session failure).
Looking at your code above, if you have different permissions, then once again it's nothing to do with Laravel. If you google around, there's a few examples of how to change the user settings for directories; essentially you need to make sure the web user has the right permission to write to the storage folder along with your console user.
It sounds like your web user does not, and therefore sessions are failing.
You could also switch to a different session system, like Redis or Memcache, which is probably better for a production server.

Can anyone reproduce this issue on a fresh Laravel installation?

Yes. Downloaded a laravel version yesterday. The odd thing is I created 2 projects at once. The one project gives the 419 on login, the other doesn't... Same server, same configuration as far as I know... I'll be uploading my projects soon.

I've been using the redis driver all along (so file permission issues, while already set correctly, wouldn't have been the problem).  However, I discovered that I'm dealing with an intermittent redis or predis connection issue (even with read_write_timeout set to -1).
local.ERROR: Error while reading line from the server. [tcp://<IP_ADDRESS>:6379]
Just offering what I found in case someone else stumbles upon this thread with a similar issue/scenario.

RESOLVED
I finally resolved it, so this is NOT a Laravel Bug, but I think Laravel developers could handle this behavior themselves.
It was a problem with the Cookie conflicts between different environment on the same browser. That's why other browsers that access only production didn't have that problem.
To resolve any of the 419 related error :
Check Permission
After making sure your permission is ok for creating and accessing the file as I suggested earlier :

I finally see that it's probably not a Laravel issue. @magusd the are many ways of solving this according to what happened.
I have reproduced this error in so many ways that it started to freaking me out. But at the end, it's a permission access to that file before Laravel accesses it. Here the many Layers that could be denying the permission :

storage/framework/sessions owner or group does not belong to Apache or Nginx User let's say www-data
storage/framework/sessions owner or group belongs to Apache or Nginx User let's say www-data, but does not have read and write permission to either owner or group. You should change permission with chmod and give 6 at least to owner or group.
umask has been changed in your Apache or Nginx settings. Default umask in Apache is 0002 => 0664 which gives read and write permission for owner and group, and read for everyone, for created files with config user www-data, and => 0775 for created directories. Default umask in lastest NGinx is 0022 => 0644 which gives read and write only to owner for created files, and => 0755 for created directories. So that could be some server config has changed and does not give enough permission to read existing sessions files. So you should checkup to.
umask in PHP can be dynamically changed, so if you changed it early in your code to umask(0666); and not changed it back to umask($oldUmask); before Laravel create the session files, then the newly created session file will have permission 0000 with no read access at all.

But I resolved and controlled all of this, but the permission problem persist sometimes. So if Laravel did not messed up with the file permissions just before accessing it, it can't be a Laravel bug for sure.
Maybe the System itself create a strange behavior to limit the permission on some special cases that I cannot catch.
I give up on this cause this doesn't seem a Laravel coding error. Instead thanks to @laurencei I'm already changing to Redis for Staging to test before I apply it to production, this way I won't get anymore Sessions permission access.

Change your ENVIRONMENT Variables
Then I used this configuration in my LOCAL .env file :
APP_NAME=Megalobiz
...
SESSION_COOKIE=mbdck
SESSION_DOMAIN=localhost
...

and this in my STAGING .env file :
APP_NAME=Megalobiz
...
SESSION_COOKIE=mbsck
SESSION_DOMAIN=10X.24X.X.4X
...

APP_NAME doesn't have to be unique. But I heard some places that Laravel had issues with underscore SESSION_COOKIE, so instead of using default :
'cookie' => env(
        'SESSION_COOKIE',
        str_slug(env('APP_NAME', 'Megalobiz'), '_').'_session'
    ),

to produce a session cookie name megalobiz_session, I just add my own and UNIQUE session cookie name SESSION_COOKIE=mbsck from MegaloBiz Staging CooKie. This way the Browser won't get the same cookie name for your LOCAL, STAGING and PRODUCTION environment.
After that I don't know if it's necessary, but I put SESSION_DOMAIN as localhost, IP or domain name if Server is running through DNS.
Clear Cookies
AND FINALLY, after making those changes, *DO NOT FORGET TO CLEAR THE COOKIES on the LOCAL or STAGING or PRODUCTION if you changed the Environment variables because the Browser will keep the old Session Cookie name because it's not expired yet, megalobiz_session in my case.
And I get my new SESSION COOKIE name as mbsck. And I logged in the 1st time 💯
AVOID MAKING THIS IN PRODUCTION
BE CAREFUL NOT TO CHANGE THIS ON YOUR ALREADY RUNNING PRODUCTION SERVER because it will invalidate sessions for all other browsers (Users) that has the old session cookie name not expired and they won't know if they must clear that cookie in their browser. Instead clear your other cookies for other environment and keep your default config for production.

I'm still getting the same error on the other Server with Laravel 5.6, so I went to look for how Chrome Browser handle cookies on request. Chrome is more strict than other browsers.
The answer to the StackOverflow Question Why does the session cookie work when serving from a domain but not when using an IP? explains a lot of important things. He mentioned an HTTP RFC 2019 Document where they state :
4.3.2  Rejecting Cookies

   To prevent possible security or privacy violations, a user agent
   rejects a cookie (shall not store its information) if any of the
   following is true:

   * The value for the Path attribute is not a prefix of the request-
     URI.

   * The value for the Domain attribute contains no embedded dots or
     does not start with a dot.

   * The value for the request-host does not domain-match the Domain
     attribute.

   * The request-host is a FQDN (not IP address) and has the form HD,
     where D is the value of the Domain attribute, and H is a string
     that contains one or more dots.

   Examples:

   * A Set-Cookie from request-host y.x.foo.com for Domain=.foo.com
     would be rejected, because H is y.x and contains a dot.

Kristol & Montulli          Standards Track                     [Page 7]

RFC 2109            HTTP State Management Mechanism        February 1997

   * A Set-Cookie from request-host x.foo.com for Domain=.foo.com would
     be accepted.

   * A Set-Cookie with Domain=.com or Domain=.com., will always be
     rejected, because there is no embedded dot.

   * A Set-Cookie with Domain=ajax.com will be rejected because the
     value for Domain does not begin with a dot.

4.3.3  Cookie Management

   If a user agent receives a Set-Cookie response header whose NAME is
   the same as a pre-existing cookie, and whose Domain and Path
   attribute values exactly (string) match those of a pre-existing
   cookie, the new cookie supersedes the old.  However, if the Set-
   Cookie has a value for Max-Age of zero, the (old and new) cookie is
   discarded.  Otherwise cookies accumulate until they expire (resources
   permitting), at which time they are discarded.

   ...

Those specs would tell browsers to ignore malformed or non-standard Set-Cookie format so that sometimes Chrome just won't send those cookies in the requests to your server.

Today I tested, confirmed and resolved the 419 error (that is not related to file permission) for the 4th times for that same month. Cause it also happen with Redis as the Session Driver.
What I can confirm is that happens :

Specially on Chrome, even on Chrome Mobile for Android
When using multiple environment in the same browser and one of them is IP address, ex : local (localhost) + production (<IP_ADDRESS>). The production is not accessible via DNS yet

And the conflict and error are resolved when :

Using a domain name to access the Servers (except localhost)
waiting a mid day sometimes for Chrome to clear some cache, or clearing cookies of IP address

I tried with IP, error, activate DNS, no error, deactivate DNS, error appears again.
Tested with my 2 Old VPS and 2 New VPS (staging + production) with IPs and 2 domain names.


library is to old !!

Dear Sir
this demo project  use compose library is to old
when i upgrade to
compose_version = '1.0.0-beta04'  <--  now  1.0.0-beta04/1.0.0-beta05/1.0.0-beta06
i get error !!
SimpleTextActivity.kt: (29, 9): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
internal fun ViewGroup.setContent(parent: CompositionContext, content: () -> Unit): Composition defined in androidx.compose.ui.platform

Some examples don't work due to the change of Compose API and need to be updated.

I'm in the process of updating it to the latest version of Compose and also adding more examples. I started this repo when Compose was still in dev-preview-02 iirc. Over the year, I added support for 20+ releases and updated the code and comments through all those releases. This took a toll on me a bit so I decided to wait and let the API's stabilize. I think we are at that point so I'm ready to keep things back up and update it to the latest and greatest!

Sure... totally get it.
Thanks for the reply.

I'm in the process of updating it to the latest version of Compose and also adding more examples. I started this repo when Compose was still in dev-preview-02 iirc. Over the year, I added support for 20+ releases and updated the code and comments through all those releases. This took a toll on me a bit so I decided to wait and let the API's stabilize. I think we are at that point so I'm ready to kick things back up and update it to the latest and greatest!

It looks like you put alot of effort into this. Thanks so much. Sadly it doesnt open on
Android Studio Arctic Fox | 2020.3.1 Beta 4
Build #AI-203.7717.56.2031.7435690, built on June 8, 2021
Runtime version: 11.0.10+0-b96-7249189 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 12
Registry: external.system.auto.import.disabled=true
or
IntelliJ IDEA 2021.1.2 (Community Edition)
Build #IC-211.7442.40, built on June 1, 2021
Runtime version: 11.0.11+9-b1341.57 amd64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2020M
Cores: 12
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: br.com.matheusfm.jsonutils (1.2), mobi.hsz.idea.gitignore (4.1.0), String Manipulation (<IP_ADDRESS>.3), org.jetbrains.kotlin (211-1.5.10-release-891-IJ7142.45), com.squareup.sqldelight (1.5.0)
Kotlin: 211-1.5.10-release-891-IJ7142.45

I've started the upgrade and should be able to push it over the weekend. This is the WIP branch - https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/compare/vinay-latest-compose?expand=1

Very impressive as it took me a few days to update my apps!

Runs fine on my system (Android Studio Arctic Fox | 2020.3.1 Beta 5 Build #AI-203.7717.56.2031.7479365,)

This repo has been upgraded to the latest version of Compose. This shouldn't be an issue anymore 🎉


Splunk Platform Upgrade Readiness App warning on splunklib Py files

Hi,
Currently reviewing Python3 compatibility with the Splunk Platform Upgrade Readiness App, there are several warnings if you include the Python SDK splunklib in a Splunk app:

Example:

While these warnings do not necessary really mean an impact on Python3 compatibility, many customers are going to the steps of validating the Splunk apps compatibility and might contact apps developers for these questions.
Should this be reviewed and fixed ?

Thanks all, we'll be working with the Splunk Platform Upgrade Readiness App team to remove these warnings. Please disregard them at this time.

Seems still the case. Does that mean I can ignore all warnings?

Seems still the case. Does that mean I can ignore all warnings?

@tkoeberl Please continue to ignore the warnings. The Splunk Platform Upgrade Readiness App team is working on this. We will post an update here once the fix is released.

Hello, has there been a fix implemented yet for the these readiness warnings? Or should we still continue to ignore them?

@adilovesgh @tkoeberl The Splunk Platform Upgrade Readiness App is no longer taking new updates and is replaced by the Upgrade Readiness App. The scan of the splunklib is ignored and these warnings should no longer appear in the latest version 3.0.2. Please update to using the latest Upgrade Readiness App.  Closing for now and can be reopened if there are further issues.


Adding user-definable context variable guards

Fitting with the "don't pay for what you don't use" concept, I wanted to have an optional way of injecting some kind of lock/guard around context variables in the registry.
I let the user define how the lock is created since, for me, I use a fiber mutex rather than std::mutex, so I need to be able to define it myself. I'm using the lock in the 'leaf nodes' of the function calls since I can't support recursive mutexes and the end result is the same.
(I'm making this issue since the contribution guidelines don't want immediate PRs. The commit I would PR is here: https://github.com/BrodyHiggerson/entt/commit/8870d6237a3229a076c47619ecaa3c1cc7288cd6)
How I'm using it:
namespace ftl
{
class Fibtex;
} // namespace ftl

namespace detail
{
ftl::Fibtex& GetContextVarFibtex();
} // namespace detail

#ifndef ENTT_REGISTRY_CONTEXT_GUARD
	#define ENTT_REGISTRY_CONTEXT_GUARD()										\
		ftl::LockWrapper wrapper = rtg::Task::LockFibtex(detail::GetContextVarFibtex());\
		std::lock_guard guard(wrapper);
#endif // #ifndef ENTT_REGISTRY_CONTEXT_GUARD

Closing this one, let's continue the discussion in #800 (that is, the PR).👍


Remove explicit parameter sorting from algorithms

As parameters now have a defined order in parameterized circuits, see #5759, the explicit sorting in algorithms that take parameterized circuits, such as vqe and the variational base class, to present these in a known, defined order to a classical optimizer, should be removed.

Is this a bug in current Qiskit about the order of the initial_point in VariationalAlgorithm such as VQE?
https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/algorithms/variational_algorithm.py#L107

@ikkoham calling QuantumCircuit.parameters returns sorted list of parameters now.
This issue suggests that explicit sorting can be removed, e.g. instead of https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/algorithms/variational_algorithm.py#L107
you can only have self._ansatz_params = ansatz.parameters.

@molar-volume Thanks. I understood the issue.
But, isn't the current state until sort is removed creating a bug? So I suggested to label the bug to this issue.

If you do not put ParameterVector in the mix, then the sorting provided in QuantumCircuit is same as https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/algorithms/variational_algorithm.py#L107
So if there is a bug now, this issue would not solve it.
I hope I am not misleading you.
@Cryoris can you confirm please?

There's no bug right now. The point is that VQE used to manually sort the parameters, which is now not necessary anymore, so we want to remove that manual sorting.
Now there's a small problem: If we use the ordering provided by circuits, it differs from the manual sorting VQE did. That means that hardcoded initial_states will produce different results. I don't see a way around that though.
Thanks @molar-volume!

@Cryoris @ikkoham maybe this can be solved with initial_point being dictionary (used in bind_parameters for circuits or operators)

I don't think there are any left, so I'll close this issue 🙂


[Core] in clustered env Documents are loaded on one node only

where keys are loaded. because other nodes have no access to internal key/uri mapping built at keys loading phase.

Fixed


Response Inspector Node text overflow

If my Root Prompt is long enough, the text overflows in the Response Inspector Node.

Ah, this is a CSS issue (missing an overflow-y: auto here). I've found the problem and fixed it; will push it in the next bug fix release.

Fixed in <IP_ADDRESS>!


tsc error 'AxiosHeaders' refers to a value, but is being used as a type here

I'm using tronweb version 6.0.0-beta.4. When i try to use tsc command i get this error
node_modules/tronweb/lib/commonjs/types/Providers.d.ts:2:52 - error TS2749: 'AxiosHeaders' refers to a value, but is being used as a type here. Did you mean 'typeof AxiosHeaders'

here's my tsconfig
{
    "compilerOptions": {
      "rootDir": "src",
      "outDir": "dist",
      "strict": true,
      "target": "es6",
      "module": "Node16",
      "sourceMap": true,
      "esModuleInterop": true,
      "moduleResolution": "node16",
      "typeRoots": [
        "node_modules/@types",
        "src/types"
      ]
    },
    "include": [
      "src/**/*.ts",
      "src/**/*.d.ts"
    ]
  }

Change the moduleResolution to node and it will fix the problem.


Add to deployType Prismic script

As per the retrospective actions:

Put a warning in the deploy tool to warn when deleting fields, including a prompt to publish
Change the deploy tool to update all types in one go

@pollecuttn all actions from the incident retro have been done with this now being in production.

@rcantin-w Great stuff - thanks for the update


Problems importing npm module via webpack in react

I'm trying to import the module in a react project. I'm using the standard react-create-app which uses webpack to import the dependencies.
import React, {Component, PropTypes} from 'react'
import logo from './logo.svg';
import YASQE from 'yasgui-yasqe';
import YASR from 'yasgui-yasr';
import 'yasgui-yasqe/dist/yasqe.css';
import 'yasgui-yasr/dist/yasr.css';
import './App.css';

export class App extends Component {

    constructor(props) {
        super(props);
    }

    componentDidMount() {
        this.yasqe = YASQE.fromTextArea(document.getElementById('yasqe'), {
            sparql: {
                showQueryButton: true,
                endpoint: "http://localhost:4567/api/endpoint/cocktails/sparql",
            },

        });

        this.yasr = YASR(document.getElementById('yasr'),
            {
                outputPlugins: ["error", "boolean", "rawResponse", "table", "pivot", "leaflet"],
                useGoogleCharts: false,
             });

        this.yasqe.options.sparql.callbacks.complete = this.yasr.setResponse;
    }

    render() {
        return (

                    <textarea id='yasqe' style={{width: 400}} autosize={{minRows: 10, maxRows: 10}}/>

        )
    }
}

Following problems:

Module not found: Can't resolve './images/layers-2x.png' in '/Users/MyUser/WebstormProjects/test/node_modules/yasgui-yasr/dist'

I fix this by either adding the corresponding leaflet files in '/Users/MyUser/WebstormProjects/test/node_modules/yasgui-yasr/dist'.

./node_modules/yasgui-yasr/src/gChartLoader.js
Module not found: Can't resolve 'google' in '/Users/Dennis/WebstormProjects/test/node_modules/yasgui-yasr/src'

The problem is the google dependency here. Note that also appears when putting " useGoogleCharts: false,".
I fix this by eliminating the files that define gChart and by commenting the part of code out in main.js and in pivot.js

finally the table component fails to be imported. The problem is the following line:

https://github.com/TriplyDB/YASGUI.YASR/blob/480075c291037f0ebfbea8fc12c0c91138a16306/src/table.js#L3
I change:
require("datatables.net")();
to
require("datatables.net");
Then the module is imported correctly and can be used.
I'm not an expert but I assume these problem arise due to the way webpack is trying to import the npm module. I think fixing this issues makes the library usable via webpack. Note that I do not encounter any issue when importing other npm modules using the default create-react-app setup.

Indeed, I ran into it the same problem with a minimal Webpack setup (no React).
import YASR from 'yasgui-yasr'

gave the following error when running Webpack:
ERROR in ./node_modules/yasgui-yasr/src/gChartLoader.js
Module not found: Error: Can't resolve 'google' in '/Users/danmichael/projects/bibsent/skosmos-stack/query_service/node_modules/yasgui-yasr/src'
 @ ./node_modules/yasgui-yasr/src/gChartLoader.js 10:27-44 28:13-30 45:10-27 57:6-23 69:15-32
 @ ./node_modules/yasgui-yasr/src/main.js
 @ ./src/index.js

ERROR in ./node_modules/yasgui-yasr/src/gchart.js
Module not found: Error: Can't resolve 'google' in '/Users/danmichael/projects/bibsent/skosmos-stack/query_service/node_modules/yasgui-yasr/src'
 @ ./node_modules/yasgui-yasr/src/gchart.js 16:17-34 195:11-28 195:33-50
 @ ./node_modules/yasgui-yasr/src/main.js
 @ ./src/index.js

Webpack supports normal CommonJS require() statements, but in this case "google" is not a package, but a global defined through a browserify shim in package.json). Which is not something Webpack understands.
A quick workaround is to download the google jsapi:
wget -o src/google.js https://www.google.com/jsapi

and add a manual alias in webpack.config.js:
module.exports = {
  resolve: {
    alias: {
      'google': path.join(__dirname, 'src/google.js'),
    }
  }
}

In the long term, it would probably be good to make use of the googlecharts npm package instead. … And right after writing that sentence I noticed that there is a new yasgui repo in the works, so it seems like @LaurensRietveld & co are already working on modernizing the YASGUI package(s) 🎉

See https://triply.cc/docs/yasgui-api#react for a snippet on how to include the new yasgui version in react. That snippet uses Yasgui, but using Yasqe and/or Yasr instead would be very similar.
If there are other issues, let me know in the new Yasgui monorepo: https://github.com/TriplyDB/Yasgui
If you have documentation improvements, please submit a PR here: https://github.com/TriplyDB/Documentation/


Update service-tutorial-invoke-machine-learning-model.md

Changing file location for Automobile price data, as the current link does not work. New Link - https://github.com/MicrosoftLearning/Principles-of-Machine-Learning-Python/blob/master/Module7/Automobile price data _Raw_.csv

@PHenwood : Thanks for your contribution! The author, @davidiseminger, has been notified to review your proposed change.

@PHenwood : Thanks for your contribution! The author, @davidiseminger, has been notified to review your proposed change.

@mgblythe : Thanks for your contribution! The author, @davidiseminger, has been notified to review your proposed change.

@GitHubber17 : Thanks for your contribution! The author, @davidiseminger, has been notified to review your proposed change.

@mgblythe : Thanks for your contribution! The author, @davidiseminger, has been notified to review your proposed change.


Remove the richardmorton user manifest

As they're now absent.

I compared this to PR #8658. Looks good to me +1

:+1: Thanks for taking a look Mahmud!


Repro all regressions to fix before 2.0

Once
#1253
#1233
#1173
Are done, we do 2.0. This PR has all the necessary fails.

@lmiller1990 I think you should be able to close this PR and delete the branch, as the issues are either fixed or not reproducible if I'm not mistaken.

Yep - only one not closed is https://github.com/vuejs/test-utils/issues/1253 but looks like the user found the problem and we can solve it.
We should have a quick meeting and pick a date for 2.0.0. Maybe end of April? I think a nice blog post highlighting the features and goals for Test Utils might be a good thing to do.
My personal goals and vision is stability and reliability.


Conflict when install orion-ml (can't uninstall llvmlite)

Orion version:0.1.7.dev0
Python version: 3.7.9
Operating System: Ubuntu 18.4 LTS

Description
When I tried to install orion-ml using pypi "pip install orion-ml."
There was an error said "ERROR: Cannot uninstall 'llvmlite'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall."
What I Did
I did lost of things, but final solution was manually delete llvmlite files. I went to the site-packages directory and delete all llvmlite files and directories. Because there was an error when pypi tried to remove llvmlite.
But I can't uninstall llvmlite with "pip uninstall llvmlite" There is an error in that command.
So this issue is solved, but you can take a look about llvmlite uninstall. Thanks for amazing library for anomaly detection!

Hi @vkehfdl1, thanks for the note!
I normally recommend creating a separated environment and working from their to avoid any problems.
llvmlite is a dependency of numba which was recently added. Based on the suggestion here https://stackoverflow.com/questions/58766671/cannot-install-librosa-python-how-can-i-uninstall-llvmlite
a solution might be pip install orion-ml --user and hopefully it works!

I ran into exactly the same issue as vkehfdl1.
I found a suggestion to use pip with ignore-installed and it worked for me:
pip install llvmlite --ignore-installed


Presentation Model Garbage Collection

A first version of a garbage collection for presentation models.
The new package that contains the gc isn't referenced in the sources and this request is done for a public review of the gc.
This package contains a first garbage collection implementation for the Dolphin Platform model. As defined by @DolphinModel and @DolphinBean each Dolphin Platform model is a hierarchy of several Dolphin Platform beans. All the beans will automatically be synchronized between server and client. To do so the remoting layer holds a representation of each Dolphin Platform Bean.
When the server controller removes a bean out of the hierarchy the garbage collection should notice this and automatically remove the bean representation from the remoting layer. By doing so the bean will automatically be deleted on the client.
How a bean can be created and removed is defined by the BeanManager.
The current version of the garbage collections don't allow cycles in references.
Some information how the current implementation is working:
The GarbageCollection class is the central point of this implementation. The class provides some methods that must called by the platform whenever a change in the beans has been done:

onBeanCreated(...) must be called for each new bean
onPropertyValueChanged(...) must be called whenever the internal value of a Property changes
onAddedToList(...)must be called whenever a new item was added to an ObservableList
onRemovedFromList(...)must be called whenever a item was removed from an ObservableList

This methods can simply be called be the BeanManager, the PropertyImpl and the ObservableArrayList. Whenever any of the methods is called the gc checks if the modified bean is still referenced by a root bean (the model of a MVC group). This is internally done by reference counting. If the bean isn't referenced anymore it will be added to a "toRemove" list. It will be removed from this list if it will be referenced again.
Whenever the gc() method of the garbage collection is called all the presentation models that are in the "toRemove" list will be removed. The plan is to call this method at the end of each server cycle. This means that whenever a command was handled on the server the server will remove unreferenced beans from the presentation model.

Reviewed 19 of 19 files at r1.
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed.

java-client-javafx/src/test/java/com/canoo/dolphin/client/javafx/FXBinderTest.java, line 3 [r1] (raw file):
why is this import needed in this code change?

java-core/src/main/java/com/canoo/dolphin/impl/IdentitySet.java, line 1 [r1] (raw file):
file header. sigh https://github.com/canoo/dolphin-platform/issues/108

java-server/src/main/java/com/canoo/dolphin/server/impl/gc/GarbageCollection.java, line 33 [r1] (raw file):
s/MVG/MVC/

java-server/src/main/java/com/canoo/dolphin/server/impl/gc/GarbageCollection.java, line 50 [r1] (raw file):
s/onRemove/onRemoveCallback/ or some other name. calling onRemove.onRemove(arg) looks weird

java-server/src/main/java/com/canoo/dolphin/server/impl/gc/GarbageCollection.java, line 76 [r1] (raw file):
use a more specific exception

Comments from the review on Reviewable.io

Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed.

java-client-javafx/src/test/java/com/canoo/dolphin/client/javafx/FXBinderTest.java, line 3 [r1] (raw file):
I moved the MockedProperty class since it's now used on server and client

java-core/src/main/java/com/canoo/dolphin/impl/IdentitySet.java, line 1 [r1] (raw file):
Done, and yes I know :( Hope to find some time for this general infrastructure issues in future. But based on the projects that depend on DP other issues currently have a bigger importance.

java-server/src/main/java/com/canoo/dolphin/server/impl/gc/GarbageCollection.java, line 33 [r1] (raw file):
done

java-server/src/main/java/com/canoo/dolphin/server/impl/gc/GarbageCollection.java, line 50 [r1] (raw file):
done

java-server/src/main/java/com/canoo/dolphin/server/impl/gc/GarbageCollection.java, line 76 [r1] (raw file):
done

Comments from the review on Reviewable.io

@netopyr maybe you find some time for a review. I would love to add this basic API in near future. Based on this we can discuss the general integration.

Are Listeners on DolphinProperties automatically unsubscribed when the Presentation Model is removed?

I need to check / think about this. Maybe there are some constellations that currently don't work.

Normally you don't need to unsubscribe the listeners since you don't use the property anymore. Based on this the property instance will be GC by the JVM and since the property should be the only place that has a reference to the listener it should be removed (by GC), too.

Coverage increased (+4.1%) to 48.395% when pulling 312a156ea25298b5f3ed0b055533d3972f26caca on pm_gc into 46a211c0451f14a419e0b69fe875503eb07efc80 on master.

I updated this branch based on the new structure (merged master) and already added the GC to DP. I added a feature flag that defines if GC should be used. By default GC is not used but it can be simply activated in the dolphin.properties file. I think we should review and merge this branch for the next release. In that case we can test the GC internally.

Coverage increased (+4.1%) to 48.395% when pulling 408d4fbea1d67822c9244ef0d456ab2a31a780cd on pm_gc into 46a211c0451f14a419e0b69fe875503eb07efc80 on master.

Coverage increased (+4.1%) to 48.395% when pulling 6f4253d9bb32e551450a842db6ea0b4b1ee5bb13 on pm_gc into 46a211c0451f14a419e0b69fe875503eb07efc80 on master.

Reviewed 40 of 65 files at r3, 2 of 3 files at r4, 20 of 20 files at r5.
Review status: all files reviewed at latest revision, 11 unresolved discussions.

platform/dolphin-platform-client/src/main/java/com/canoo/dolphin/client/impl/ClientBeanBuilderImpl.java, line 53 [r5] (raw file):

    protected Property create(final Attribute attribute, final PropertyInfo propertyInfo) {
        return new PropertyImpl<>(attribute, propertyInfo);

would it make sense to obtain this instance using a factory?

platform/dolphin-platform-core/src/main/java/com/canoo/dolphin/impl/PlatformConstants.java, line 38 [r5] (raw file):

    String DESTROY_CONTEXT_COMMAND_NAME = DOLPHIN_PLATFORM_PREFIX + "disconnectClientContext";

    String GARBAGE_COLLECTION_COMMAND_NAME = DOLPHIN_PLATFORM_PREFIX + "garbage-collection";

this name has a hyphen - whereas the others use camel case.

platform/dolphin-platform-core/src/main/java/com/canoo/dolphin/impl/PropertyImpl.java, line 106 [r5] (raw file):

    }

    protected void notifyInternalListeners(ValueChangeEvent<T> event) {

is this method needed at all?

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/context/DolphinContext.java, line 99 [r5] (raw file):

    private final DolphinSession dolphinSession;

    private final GarbageCollection garbageCollection;

perhaps it's me but I find the name of this class a bit strange. The act/operation is "garbage collection" performed by a "garbage collector"

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/impl/ServerBeanBuilder.java, line 25 [r5] (raw file):

public interface ServerBeanBuilder extends BeanBuilder {

   <T> T createRootModel(Class<T> beanClass);

missing javadoc

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/impl/ServerBeanRepository.java, line 25 [r5] (raw file):

public interface ServerBeanRepository extends BeanRepository {

    <T> void deleteByGC(T bean);

missing javadoc. needs a better name perhaps

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/impl/gc/GarbageCollection.java, line 64 [r5] (raw file):

    public GarbageCollection(GarbageCollectionCallback onRemoveCallback) {
        this.onRemoveCallback = Assert.requireNonNull(onRemoveCallback, "onRemoveCallback");
        removeOnGC = new IdentityHashMap<>();

assignment could be made at the same time as field definition

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/mbean/beans/DolphinSessionInfo.java, line 41 [r5] (raw file):

        DolphinSession session = dolphinSessionRef.get();
        if(session == null) {
            throw new RuntimeException("Session == null");

throw NPE, ISE, IAE, or a DP exception instead. Or use Assert.requireNonNulltoo

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/mbean/beans/DolphinSessionInfo.java, line 49 [r5] (raw file):

        GarbageCollection garbageCollection = garbageCollectionRef.get();
        if(garbageCollection == null) {
            throw new RuntimeException("GarbageCollection == null");

throw NPE, ISE, IAE, or a DP exception instead. Or use Assert.requireNonNulltoo

platform/dolphin-platform-server/src/test/java/com/canoo/dolphin/server/impl/gc/TestGarbageCollection.java, line 54 [r5] (raw file):

        assertEquals(garbageCollection.getManagedInstancesCount(), 1);
        garbageCollection.gc();
        assertThat(removedObjects, Matchers.hasSize(0));

the code reads better if you use static imports in the case of assertions such as this one

platform/dolphin-platform-server/src/test/java/com/canoo/dolphin/server/impl/gc/TestGarbageCollection.java, line 849 [r5] (raw file):

    private GarbageCollection createGarbageCollection(GarbageCollectionCallback gcConsumer) {
        UnstableFeatureFlags.setUseGc(true);
        return new GarbageCollection(gcConsumer);

does the test turns this feature off at some point?

Comments from Reviewable

Review status: all files reviewed at latest revision, 11 unresolved discussions.

platform/dolphin-platform-core/src/main/java/com/canoo/dolphin/impl/PlatformConstants.java, line 38 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> this name has a hyphen `-` whereas the others use camel case.
done

platform/dolphin-platform-core/src/main/java/com/canoo/dolphin/impl/PropertyImpl.java, line 106 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> is this method needed at all?
yes, it's overwritten when a new property gets created. Same mechanism is already used by the observable lists

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/context/DolphinContext.java, line 99 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> perhaps it's me but I find the name of this class a bit strange. The act/operation is "garbage collection" performed by a "garbage collector"
done

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/impl/ServerBeanBuilder.java, line 25 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> missing javadoc
done

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/impl/ServerBeanRepository.java, line 25 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> missing javadoc. needs a better name perhaps
done

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/mbean/beans/DolphinSessionInfo.java, line 41 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> throw NPE, ISE, IAE, or a DP exception instead. Or use `Assert.requireNonNull`too
done

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/mbean/beans/DolphinSessionInfo.java, line 49 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> throw NPE, ISE, IAE, or a DP exception instead. Or use `Assert.requireNonNull`too
done

Comments from Reviewable

Review status: 27 of 45 files reviewed at latest revision, 11 unresolved discussions.

platform/dolphin-platform-client/src/main/java/com/canoo/dolphin/client/impl/ClientBeanBuilderImpl.java, line 53 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> would it make sense to obtain this instance using a factory?
I don't think so. This class defines does nothing than create the concrete property / list instances. Currently there is no other way than creating this objects. It would make sense if there is another remoting lib next to OD.

platform/dolphin-platform-server/src/main/java/com/canoo/dolphin/server/impl/gc/GarbageCollector.java, line 64 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> assignment could be made at the same time as field definition
done

Comments from Reviewable

Coverage increased (+21.4%) to 65.64% when pulling a3eda33950497f5fa55756279a280205cb22d872 on pm_gc into 46a211c0451f14a419e0b69fe875503eb07efc80 on master.

Review status: 27 of 45 files reviewed at latest revision, 11 unresolved discussions.

platform/dolphin-platform-server/src/test/java/com/canoo/dolphin/server/impl/gc/TestGarbageCollection.java, line 54 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> the code reads better if you use static imports in the case of assertions such as this one
done

platform/dolphin-platform-server/src/test/java/com/canoo/dolphin/server/impl/gc/TestGarbageCollection.java, line 849 [r5] (raw file):
Previously, aalmiray (Andres Almiray) wrote…
> does the test turns this feature off at some point?
done

Comments from Reviewable

refactored the branch based on @aalmiray review. I think the request is ready to merge. Don't know if we should do this before or after the OD merge? @aalmiray ?

Coverage increased (+21.3%) to 65.534% when pulling 61395b283477038c3bf7f1edd9936b4f80b6795c on pm_gc into 46a211c0451f14a419e0b69fe875503eb07efc80 on master.

it should be merged after the OD PR is taken in

Coverage increased (+1.1%) to 65.256% when pulling 176b4670947a5fe1b1d886723993e0c8254df0f2 on pm_gc into d2503bdf5932ed5153674384e371e0099700dd92 on master.

Coverage increased (+1.2%) to 65.307% when pulling 344aca07efc08865e7a423090818e2499ad9e2b4 on pm_gc into d2503bdf5932ed5153674384e371e0099700dd92 on master.


Pointer function arguments

Please fill in this pull request template before submitting
1. This pull request resolves #26
2. Description
This tutorial explains function pointers as arguments in C. It first describes what a function pointer is and then shows how to pass a function pointer as a parameter to a function.
3. Fill in checklist by marking [x]

[X] I've read the CONTRIBUTING.md
[x] I was assigned to this issue
[X] My code is formatted using required linting
[X] I've run my code locally and checked it works

Thanks for the PR :) It will be reviewed in due course.

Adding hacktoberfest-accepted label. Will review and merge later on.


Suggestion: Implement wrapper to avoid crashes on other platforms

I just added the following code in my RN app that runs on iOS and Android:
AndroidKeyboardAdjust.setAdjustPan();

But to make it work on iOS I have to check if AndroidKeyboardAdjust
if (AndroidKeyboardAdjust) {
    AndroidKeyboardAdjust.setAdjustPan();
}

Would be nice to get this wrapped so that
AndroidKeyboardAdjust.setAdjustPan();

just does nothing (without crashing) on iOS.

Or you can check platform:
isAndroid() && AndroidKeyboardAdjust.setAdjustNothing();

@DanielZara Yes, but this still leads in code that nobody should write :-)

@blaues0cke I agree, but we could only endeavor ;)


Fix DeprecationWarning in import_hook

Before contributing, please read our contributing guidelines and code of conduct.
Overview
For Python >=3.4, using find_loader is deprecated, and importing it
generates a DeprecationWarning. Mirroring wrapt's implementation of a
similar construct in its importer.py (on which this code seems modeled),
we can try to use the new find_spec first,  then the old python 2.7
fallback, as before. Since the newrelic python agent only supports 2.7+
and 3.5+, there is no need to keep support for the deprecated
find_loader at all.
The immediate result of this change is that one less DeprecationWarning
is fired at runtime when using the newrelic python agent. There are
still other DeprecationWarnings originating in this file that are not
fixed by this commit.
Testing
The agent includes a suite of tests which should be used to
verify your changes don't break existing functionality. These tests will run with
Github Actions when a pull request is made. More details on running the tests locally can be found
here,
For most contributions it is strongly recommended to add additional tests which
exercise your changes.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

I've added a test case for find_module to help verify that we don't introduce any breaking changes here.
As it turns out, the newrelic python agent doesn't support python 3 below 3.5 at all, so we can completely remove the deprecated branch.

https://github.com/newrelic/newrelic-python-agent/pull/26#discussion_r506561887
Narrowing down the exception scope is a good idea. I haven't run into the ValueError case in the wild, but the code should handle it, given that the documentation states that it can happen. I've updated the code accordingly. Do you think that approach works?

Sounds good! Thanks for getting this merged.


XGBoost: Categorical + SHAP Info

https://xgboost.readthedocs.io/en/stable/tutorials/categorical.html

Right now we're using a Label Encoder for categorical data and that seems to be working out fine, but there may be advantages of using the categorical support directly.


Changed phone field to price indicator

To better suit the representation of eateries, the optional phone field has been repurposed to indicate the price range of the eatery instead.

Codecov Report

Merging #72 (45dc5e3) into master (ec5dba7) will not change coverage.
The diff coverage is 78.57%.

:exclamation: Current head 45dc5e3 differs from pull request most recent head 6d7f4aa.  Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


email to marinemammals when data request made

not been received, Carlos to look at<EMAIL_ADDRESS>

Tested, emailed came to niki.clear@ as the requester but nothing has come through to marinemamamls@
In my request message, I have asked to data custodian to confirm they have received the notification to check whether this step is working.

Another issue:
When a request for data has been approved, the email notification says
"Thank you for your request to access the restricted Cetaceans data records. Your request has been updated.
You can check the status per survey at: https://cetaceans.ices.dk/Download/d594e0d4-de6c-456c-a65f-f7cc07c90370"
However, when I follow the link, it is not obvious on the page what the change has been and there is no option to download data.
https://cetaceans.ices.dk/Download/d594e0d4-de6c-456c-a65f-f7cc07c90370

there is no link to download because the data hasn't been released yet.
Should I try to approve the request?

there is no link to download because the data hasn't been released yet.
Should I try to approve the request?

OK. But why did the system create an email stating "Your request has been updated." Was the request rejected? If the request was rejected, should there be something on the page to stat that?

Hi Niki, sorry.
Just checked and the request was approved :).
So the email is right, the bug is somewhere else, will check that now.

Discover the bug. The user was not a manager of ORCA organization.
Working now: https://cetaceans.ices.dk/Download/d594e0d4-de6c-456c-a65f-f7cc07c90370
Still need to find out how the user was able to approve the request!

An email should have been sent now with a test request. @NikiClear did you get the test email?

yep, that has come through to<EMAIL_ADDRESS>Thanks for checking, think this one can be closed now :)


lsp-mode does not start automatically when using julia-ts-mode

Warning:
 ■  Warning (lsp-mode): Unable to calculate the languageId for buffer ‘PPCA.jl’. Take a look at ‘lsp-language-id-configuration’. The ‘major-mode’ is julia-ts-mode

#c869b2f fixes the warning. lsp not starting automatically may be a configuration issue on my side. Closing for now.


Travis Testing

Test for ES lint complaint for:

NativeBase
NativeBase-KitchenSink
React Native Easy Grid

Not doing this soon


Copy all button copies bottom row as top row

Widget
Coordinate Conversion
Version of widget
Bug or Enhancement
Enhancement
Repo Steps or Enhancement details

Collect points
Use the Copy All Button to copy all
Paste the copied coordinates
Notice that the last coordinate format is now the first format.

I would think that the copy all should honor the order in which my coordinate formats are organized.  If my first Output coordinate is UTM then the first copied line should also be UTM. See screen capture below.

this looks like it was fixed


Reference the right default css theme

The bower file currently references a non-existing file.

Thank you very much for the fix!


Allow running pytest from local host

Running tests should be lightning fast. I was (maybe un-rightely) using the script from scripts/tests-local.sh, which takes care of building fresh containers, starting them and then running the tests.
I will keep this process for automatic tests (probably on git hooks)...
This PR provides a way to run pytest locally during base development
Therefore
$ cookiecutter full-stack-fastapi-postgresql/ --no-input
$ cd base-project
$ docker-compose up -d
$ cd backend/app/
$ pipenv install --dev
...
$ pipenv shell
$ pytest

and tada ! 🎉
================================= test session starts ==================================
platform darwin -- Python 3.7.3, pytest-4.3.0, py-1.7.0, pluggy-0.8.1
rootdir: /Users/emb/git-repos/github/base-project/backend/app, inifile:
plugins: celery-4.2.1
collected 17 items

app/tests/api/api_v1/test_celery.py .                                            [  5%]
app/tests/api/api_v1/test_token.py ..                                            [ 17%]
app/tests/api/api_v1/test_user.py ......                                         [ 52%]
app/tests/crud/test_user.py ........                                             [100%]

============================== 17 passed in 6.16 seconds ===============================

There is however this new .env file that the users should be aware of... but that definitevely worth the price IMHO 👶

Thanks, I'll check it soon.

The problem here is that the .env file will end up in the container too, and it can create problems there.
Apart from requiring another file with variables that the user has to take care of.
Also, you can run more or less the same with:
cookiecutter full-stack-fastapi-postgresql/ --no-input
cd base-project
docker-compose up -d
docker-compose exec backend-tests /tests-start.sh

The benefit is that the tests are being run in an environment equivalent to production, the server is communicating with its own DB, independent of if there are other DBs up in the same port or similar things.
On another note, I plan on including the tests in the same image as the backend, so they can be run separately but they can also run in the same container, this will allow enabling and using code coverage, inside the containers.

You are right, I missed the docker-compose exec backend-tests /tests-start.sh
I am looking forward test coverage (which does not look simple between multiple containers) !

Great, thanks!


[FEATURE] OpenSearch Credentials

Hi, my team and I are trying to implement Flowise for our GenAI projects primarily on AWS environments, and was wondering if you guys have any plans to add Amazon OpenSearch Service (with AWS credentials) as a Vector Store option. The current OpenSearch Vector Store option lacks credentials as an input option, but considering the demand for Amazon OpenSearch for RAG-based projects, I figured the addition will be helpful for not just our team, but for all those trying this out.
Much Thanks!

I just realised I created a duplicate issue. Here is the context I got so far to help work on this issue:
How to add AWS auth is described here.
Enabling AWS authentication should be optional and access key/secret should also be optional to allow for other authentication methods as listed in AWS docs.
I have 3 possible solutions in mind:

Modify currently existing component and its credentials by adding 4 optional settings: AWS Region, AWS Service, AWS Access Key and AWS Secret. If both AWS Region and AWS Service are set, AWS authentication is added to the initialisation of the OpenSearch client (with or without credentials, depending if access key and secret are set). If AWS Region or AWS Service are not set, AWS authentication is not used, leading to the same behaviour as today.

Create a new component called AWS OpenSearch with 2 mandatory settings: AWS Region and AWS Service; and 2 optional settings: AWS Access Key and AWS Secret. It would be a duplicate of the current component, but with AWS authentication always mandatory (with or without credentials, depending if access key and secret are set).

Two types of credentials for the existing component: OpenSearchURL and AWSOpenSearchURL. The first one will stay the same as today. The second one will have the mandatory region and service parameters, and optional access key and secret.

I like option 3.

@danieldabate : The options that you described - which phase of development phase are they in? as of the latest Flowise release, I still can't see a way  to connect to AWS Open Search using the Flowise canvas.

I don't think anyone is working on this at the moment.
You can anyways connect to AWS Open Search using basic credentials (username and password) with the Flowise vector store component that is called Open Search. I don't remember the necessary steps to configure AWS Open Search to do that, but you can probably find it in AWS Docs.


[OSD-16025] Add scrape interval parameter to the prometheus config

Needed for improving performance on hypershift management clusters

Ticket: Increase OBO global scrape interval from 30s to 60s
Epic: OBO Performance Improvements

we have special requirements about commit message format :)
https://github.com/rhobs/observability-operator/blob/main/docs/developer.md#commit-message-convention
You need also to run go fmt ./... and make generate.

Thank you for the suggestions Simon. I merged all the commits into one with the correct message format.


Question: What is the map option meant to show in the component tab?

Looking in the components tab, the list shows the mapping between the component and its domain.
On the other hand, the map appears to show a mapping between the components and the applications consuming them.
Should the map and the list views be consistent on what they are trying to convey? Or maybe there should be an option to see either the component - application  view or/and the component - domain view?
Thanks!

We should update the documentation to clarify.

Hi. I would like to work on this issue if it's available. Can anyone please guide me a little bit as to what is to be done?


Show wizard tooltips in right-side panel

The wizard design includes a right panel where tooltips are shown on hover.
https://www.figma.com/file/NeFvOOb1RT2fcdqZT0vBF2?node-id=108:4436#196906855

This has already been documented, as well as attempts:
https://github.com/ethyca/fides/issues/724


Retrieve user balances on all chains

The FE should be able to be able to know what a user's balances are for Hop-supported tokens on all Hop-supportedchains. This data should be usable throughout the frontend for whatever UI/UX updates might want it.
The UI/UX that will consume this data can be handled at a later time.
Goal

Retrieve a user's balance of Hop-supported tokens from all Hop-supported chains for use on the FE
Expose the balances through a hook and log them to the console for now
Output type:

type TokenBalanceData = {
    userBalance: BigNumber
    userBalanceUsd: number
}

type UserBalances = {
    [chain: string]: {
        [token: string]: TokenBalanceData
    }
}

Considerations

The onchain calls might be heavy/slow. If they are, this should not block the user from using the app.
Multicall is probably the best way to do this, since that is what most wallets/apps use
RPC endpoints:

Since users can bring any RPC they want to the Hop app, this logic should try to gracefully handle arbitrary errors, since there is no RPC error standardization
If it makes sense, possibly ignore the user's RPC endpoint and just use the known, public RPC endpoints. They are still not great (no standard errors, public usage affects performance, etc.), but at least they are consistent.

Resolved with https://github.com/hop-protocol/hop/commit/1b32c4fbfebf242976866ab134b8ac20dfed15ee


feat: playground navigate to container

Description
Add a button to the playground next to the start/stop to redirect the user to a container details page.
Screenshots
https://github.com/projectatomic/ai-studio/assets/42176370/6aa22f50-952a-46ab-9b73-33bc8e52fd73
Related issues
Fixes https://github.com/projectatomic/ai-studio/issues/191
Tests

[x] Write unit tests

cc @slemeur

Code LGTM,  @mairin is there any mockup for this? does it look good for you or have any suggestions?

Just want to say from the UX pov I'm ok with this for now. I have a pending design change but do not want to hold this PR up over it.


Render actionLog

When someone likes your message you receive another message of type "actionLog" that does not have any renderer. I just made those messages render like a text message.
Before

After

thank you!


Make ValidationError unpicklable

Bug
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":
             pydantic version: 1.5.1
            pydantic compiled: False
                 install path: /home/badger/.cache/pypoetry/virtualenvs/antsibull-F3umzYPl-py3.8/lib/python3.8/site-packages/pydantic
               python version: 3.8.3 (default, Feb 26 2020, 00:00:00)  [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
                     platform: Linux-5.6.15-200.fc31.x86_64-x86_64-with-glibc2.2.5
     optional deps. installed: ['typing-extensions']
...

Use case
I'm going to give you two code snippets because it might not be obvious from the simplest case why I would want to do it.
A simple approximation of my use case is here: https://gist.github.com/abadger/bfd55741c281ccb534f7bbc8fe9b6202
I am trying to use pydantic to validate and normalize data from a large number of data sources I need to run each validation separately so that I can know which data sources are providing invalid data. I decided to split it up amongst multiple CPUs by using asyncio's run_in_executor with a ProcessPoolExecutor.  However, when the pydantic.constr validation failed, I would get a BrokenProcessPool error on everything that had been queued but not run rather than a pydantic ValidationError on the specific task which failed.
Root cause
I was able to workaround the problem by catching the pydantic exception and raising a ValueError with all of the information I needed.  This lead me to the root cause: pydantic errors are not unpicklable.  Because of that, the exception raised in the worker process is pickled there and sent back to the parent process.  The parent process attempts to unpickle it, encounters the error, and then gives the generic, unhelpful BrokenProcessPool error and cancels the other pending tasks.
Here's a reproducer for the root cause:
import pickle
from pydantic.errors import StrRegexError

p = pickle.dumps(StrRegexError(pattern='test'))
print(pickle.loads(p))

# Traceback (most recent call last):
#   File "<stdin>", line 1, in <module>
# TypeError: __init__() missing 1 required positional argument: 'pattern'

Looking at the python stdlib bugtracker there are many open bugs with interactions between pickle and exceptions.  I didn't see this one so I added this: https://bugs.python.org/issue40917  Some others that might cause different bugs with pydantics exceptions:

https://bugs.python.org/issue32696
https://bugs.python.org/issue30005

Given so many potential bugs, I'm not sure if this is solvable in pydantic code or has to wait for pickle fixes.  However, if it's not solvable, adding my workaround and an explanation of what's happening to the docs would be nice.  That way searching for pydantic, ProcessPoolExecutor, pickle, multiprocessing might save the next person some time wondering why only a portion of their data was being converted.

Surely as simple as implementing __getstate__ and __setstate__ on ValidatoinError?
If it is that simple, PR welcome to implement it.

I don't believe so.  I did spend a few hours trying to do just that and couldn't get it to work.  Iirc, the problem with that approach is that __setstate__ isn't called until after the object's __init__ is called.  So the error has already occurred and you don't get a chance to fix things.
Reading the pickle docs, it seemed like __getnewargs_ex__ might be a way to get that to work but i failed at getting that to work too.  I'm not sure, though, if i just didn't/don't understand getnewargs or if it turned out that exceptions are specialcased already and that specialcasing was interfering (in one of the python bug reports, ncoghlan noted that there were specialcases in exceptions which perhaps no longer worked with the new ways that picked worked)

My python.org bug from earlier was a duplicate.  I've closed it.  This is the older bug: https://bugs.python.org/issue27015  There's a cpython PR which I confirmed would fix at least the mandatory keyword args.  It is currently awaiting another review from a python core developer: https://github.com/python/cpython/pull/11580

Hi @abadger I just had a look at it and I think I have something working.
I'm opening a PR! Please tell me if it works with your whole example

I have verified that the simplified script in https://gist.github.com/abadger/bfd55741c281ccb534f7bbc8fe9b6202  and my original script are both fixed by  #1630.  Thanks @PrettyWood !


Settings and refactor

Creates a lei-config.ini in the working directory.
Defaults to
# Lei3D config file

# Screen size
width:2560
height:1600
fullscreen:0

fov:55
mousespeed:0.1

# Graphics settings
# shadow quality: 0 - medium, 1 - high
shadowqual:0
# enable/disable screen space reflections
ssr:0

Width and height screen sizes are screen resolutions.
Reads from file once created.
Might wait for more stuff to begin refactor?

Added a preprocessor directive EDITOR that blocks out any code used only in editor mode
Removed initialization and usage of Imgui in game mode
Also disabled logging in game mode

This works great. How is the EDITOR flag being defined when we make a Lei_Editor build?


Add more functionality to where clause

The where clause is compile-time check, it's a great idea. but I think we can make it even more great by add some more functionality to it.

range check: require port is constexpr implicitly

fn foo(port: usize)
    where   port <= 65535,
            port > 1000,
            port in 1000..65536 // or this one, much better
{}

make it general purpose

let foo = 1..500 where _ % 4 == 0 // something like this ( _ maybe better with it )
let foo = 1..100 where it % 2 == 0 //ah much better

Motivation
In 1, it will improving some performent and much easier to optimize code, not letting code jump around
In 2, just let where everywhere, I think people will love it

I think this falls under const-generics, although with a different syntax.

I think this falls under const-generics, although with a different syntax.

I don't think so, with
fn foo(port: usize)
    where   port <= 65535,
            port > 1000,
            port in 1000..65536 // or this one, much better
{}

compile-time range check, you can reduce several jumps(conditional jump) in final generate, just because in order to compile-time range check, you need know the param value on the compile time, don't same with const-generics at all

That is the same as const-generics once it gets extended with where clauses,
fn foo<const port: usize>()
    where   port <= 65535,
            port > 1000,
            port in 1000..65536 // or this one, much better
{}

@KrishnaSannasi in the RFC, I didn't see any about where clause range check thing, my proposal is only relevant to where clause, make it more general purpose

That is true, in the discussion for the RFC, these where clauses were considered and postponed until after we got const generics. Implementing these where clauses is a large effort, and can only be done after const generics, specifically after we stop treating expressions in const generics as black boxes.

Here is an issue that links to other issues about refinement types. They don't us the where syntax, but the ideas are similar to yours. #671
If you are just interested in speed, then it may help to add an assert! at the beginning of the function.
https://gist.github.com/kvark/f067ba974446f7c5ce5bd544fe370186#assert-conditions-beforehand

Sounds like Haskells guard expression, in your examples above just .filter() can be used.

That is the same as const-generics once it gets extended with where clauses,
fn foo<const port: usize>()
    where   port <= 65535,
            port > 1000,
            port in 1000..65536 // or this one, much better
{}

Right now const generics can't do this, but they should be able to once they get extended later.

That's it, we will have this instead, moreover thing you are proposing is actually the same.

This might allow/help tools to do formal verification of code. Even if there are no runtime checks (at least in release mode), e.g. hoare-logic and wp-calculus comes to my mind here: The abs(value: i8) for example could be annotated as:
  fn<I> abs(value: I) -> J
  where
    I: i8 + -127..=127, // abs(-128) is -128, which is wrong
    J: i8 + 0..=127, // the return type is i8, but it is guarantied to be positive
  { … }

and every call of this function could be back traced so that every value, that might end up in this call, is guarantied to be in this range. I have read this pdf and I think, it might be useful to implement this into the language itself in an optional manner, even if the compiler usually ignores these annotations.

This is an interesting idea but I would prefer we get ConstraintKinds first — so that we can declare constraints. Then, a simple bool can become a constraint, and your code is valid if the bool is const.
In Haskell, you typically use the Constraint kind to introduce this. For instance, you can declare a type operator, data a <= b, which kind will be Constraint, so that you can use it in the place of constaints — so-called trait bounds in Rust, in which we currently have bounds and lifetime annotations.

Regarding https://github.com/rust-lang/rfcs/issues/2715#issuecomment-504717048, this syntax conflicts with type ascription when parsing.
macro_rules! x {
    ($i:item) => {}
}
macro_rules! y {
    (fn f() where $e:expr, $f:expr,;) => {}
}
x! {
    fn f()
    where
        A: B + C<D, E>::F,
    ;
}
y! {
    fn f()
    where
        A: B + C < D,
        E > ::F,
    ;
}

This is also why #1932 chose the with keyword. If we could really get a where clause for const generics, I suggest we combine with the syntax of #2920 to get an unambiguous syntax.
where
    const { A: B + C < D },
    const { E > ::F },
    A: B + C<D, E>::F,


Different types of means

pystats_central.py only contains one type of mean - the arithmetic mean. Add more types of means such as the weighted mean and the golden mean

Hi there!
I'm new to OSS, but I suppose that I'll be able to tackle this issue. I see that you are already assigned to it, is there any chance that I can work on it too?
Thank you!

Hi there! I'm new to OSS, but I suppose that I'll be able to tackle this issue. I see that you are already assigned to it, is there any chance that I can work on it too? Thank you!

Sure thing! Knock yourself out.

Perfect!
I made a PR for the weighted_mean function, you might want to check it out and tell me what you think about it.
I'm not quite sure as to what you are referring to when you talk about the golden mean, would you mind telling me more about it? Where can I find some info about it?

Perfect! I made a PR for the weighted_mean function, you might want to check it out and tell me what you think about it. I'm not quite sure as to what you are referring to when you talk about the golden mean, would you mind telling me more about it? Where can I find some info about it?

Great work, Spedi!
I've seen your PR and I'll review it as soon as possible.
Oh, and it's not the "Golden Mean" but the "Geometric Mean". I was under the influence of Aristotle's theories on virtue 😅


Support of LifestyleBoundTo in typed factories.

Hi,
Recently I started experiencing issues with my application, where my root component was using dependencies sharing one other common dependency between them, that was incorrectly registered as Transient.
To fix this I need one instance of this shared dependency per instance of my root component.
That is why LifestyleBoundTo() looks like a solution for me.
Unfortunately I've come across following issue: if somewhere in the dependency tree there is a typed factory resolving that commonly used dependency - it will fail with following exception:

Scope was not available for '...MyClass'. No component higher up in the resolution stack met the criteria specified for scoping the component. This usually indicates a bug in custom scope root selector or means that the component is being resolved in a unforseen context (a.k.a - it's probably a bug in how the dependencies in the application are wired).

Is that mean that typed factories cannot be used inside Bound lifestyle scope?
As a workaround I'm using LifestyleScoped, but that requires me to explicitly create scope each time I want to resolve my service.
Here is the simplified example that throws the exception:
public void LifestyleBoundTo_components_should_be_reused_by_factories_in_runtime()
{
    var container = new WindsorContainer();
    container.AddFacility<TypedFactoryFacility>();
    container.Register(
        Component.For<IMyService>().ImplementedBy<MyService>().LifestyleTransient(),
        Component.For<IMyClass>().ImplementedBy<MyClass>().LifestyleBoundTo<MyService>(),
        Component.For<IMyFactory>().AsFactory()
    );

    var myService = container.Resolve<IMyService>();

    myService.Do();
}

public class MyService : IMyService
{
    private readonly IMyClass _myClass;
    private readonly IMyFactory _myFactory;

    public MyService(IMyClass myClass, IMyFactory myFactory)
    {
        _myClass = myClass; //Direct dependency - resolves fine
        _myFactory = myFactory;
    }

    public void Do()
    {
        var myClass = _myFactory.Create(); //Throws the exception
    }
}

public class MyClass : IMyClass
{
    public MyClass()
    {
        Console.WriteLine("MyClass:ctor");
    }

    public void Do()
    {

    }
}

public interface IMyFactory
{
    IMyClass Create();
}

public interface IMyService
{
    void Do();
}

public interface IMyClass
{
    void Do();
}

I'm guessing this part of documentation describes that this not supported:

ℹ Bound lifestyle introduced coupling: There's one important aspect you need to consider when choosing bound lifestyle. It assumes that repository (in our example) will always be resolved as a dependency of some view model. Sometimes that's OK, sometimes it's not. Make sure you consider it before choosing this lifestyle.


Zulip server bot fixes.

Automated message from Dropbox CLA bot
@vabs22, it looks like you've already signed the Dropbox CLA. Thanks!

@vabs22 can you fix the lint and static analysis errors?

Also, this would be much easier to review if you did each fix in its own commit.

@timabbott okay, I will try to split changes into commits.

@zulipbot claim!

Was trying to see if I can add myself as a reviewer using zulipbot, apparently I can't! @zulipbot abandon

I already somewhat reviewed this while discussing some changes with @vabs22 via PMs (we had already been having a long discussion about this). :)

Codecov Report

Merging #5361 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #5361   +/-   ##
=======================================
  Coverage   86.68%   86.68%
=======================================
  Files         431      431
  Lines       53461    53461
  Branches     2086     2086
=======================================
  Hits        46343    46343
  Misses       7118     7118

Continue to review full report at Codecov.

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

@eeshangarg Thanks for reviewing this. :)
@showell I have incorporated the comments and updated this PR. Please take a look.

@vabs22 Ping on this.  It looks like there's a conflicting file to address.

@showell this PR is ready.


Linting

This isn't absolutely required, but it would be really nice to have this package passed through full linting. I know it can be a bit of a pain, but it can really help encourage best practices. As an example, I use precommit with a config as follows:
repos:
  ## R support
- repo: https://github.com/lorenzwalthert/precommit
  rev: v0.2.2
  hooks:
  - id: style-files
  - id: parsable-R
  - id: no-browser-statement
  - id: lintr
    verbose: true
  - id: roxygenize
  - id: deps-in-desc
  - id: use-tidy-description

A majority of the package has been linted now to the style guide of the tlverse. There is still some things to do but for the most part the coding is aligned with best practices.

Great. The remainder of the formatting warnings can be deferred until such time as you look to post on CRAN or something like that.


Block command line pushes that expose a personal email address

Feature Description
With the use of DEFAULT_KEEP_EMAIL_PRIVATE, any actions done on Gitea web will automatically obscure a user's email address. The same protection is not in place when a user is working locally on a project and committing to the Gitea remote via CLI. If the user is unfamiliar with git, this can lead to them pushing commits to Gitea with their private email address, undermining the email privacy feature. Fixing this later is painful, since the git log is then full of the user's private email address (ask me how I know...)
GitHub has overcome this problem by blocking commits when the author email in the commit matches the email associated with your GitHub account (https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/blocking-command-line-pushes-that-expose-your-personal-email-address). This would be a useful addition to Gitea as well.
Same as DEFAULT_KEEP_EMAIL_PRIVATE, I think this should be globally and user configurable.
Screenshots

This was sort of mentioned in #21273, but not the primary focus of the issue.

Some prior art: https://github.com/go-gitea/gitea/pull/14686
That PR is fairly old and likely doesn't apply cleanly, but there may still be something of value to it. :slightly_smiling_face:

Thank you. I have zero experience with contributing to open source, or working in Go. Generally I have pretty limited coding experience beyond bash. I think with that in mind, me trying to cobble together a solution would not be to the desired quality, but the FR is there if anyone else takes an interest as you did before.


Add generic capabilities type

We have a variety of experimental capabilities that we add using the ServerCapabilities type, but are unable to type them nicely because experimental is typed as any. By adding this generic, it would enable people to reuse this type, without having to hack around the any, without changing how any back-compatibility of existing code works (I think).
Thoughts?

Actually that makes sense now that TS support default values for generics.

Hey @dbaeumer would you mind publishing a new version to npm? Would like to use this in https://www.npmjs.com/package/vscode-base-languageclient

I released new verion as next. However vscode-base-languageclient is not maintained by us.


[Markdown] Exception on empty values

The scenario:

Open Edit View for table record with empty markdown field

Close Edit.

You will receive message:

Try to open List View for this table. You'll receive exception:

Internal Error
Error: Input data should be a String
at MarkdownIt.parse (/home/saltcorn/plugin_packages/markdown-it/lib/index.js:519:11)
at MarkdownIt.render (/home/saltcorn/plugin_packages/markdown-it/lib/index.js:544:36)
at Object.run (/home/saltcorn/plugin_packages/@saltcorn/markdown/markdown.js:18:44)
at Object.key (/usr/lib/node_modules/@saltcorn/cli/node_modules/@saltcorn/data/base-plugin/viewtemplates/viewable_fields.js:160:59)
at /usr/lib/node_modules/@saltcorn/cli/node_modules/@saltcorn/markup/table.js:95:73
at Array.map ()
at /usr/lib/node_modules/@saltcorn/cli/node_modules/@saltcorn/markup/table.js:94:20
at Array.map ()
at /usr/lib/node_modules/@saltcorn/cli/node_modules/@saltcorn/markup/table.js:91:22
at newf (/usr/lib/node_modules/@saltcorn/cli/node_modules/contractis/contract.js:66:45)
at Object.run (/usr/lib/node_modules/@saltcorn/cli/node_modules/@saltcorn/data/base-plugin/viewtemplates/list.js:211:10)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async View.run (/usr/lib/node_modules/@saltcorn/cli/node_modules/@saltcorn/data/models/view.js:141:12)
at async /usr/lib/node_modules/@saltcorn/cli/node_modules/@saltcorn/server/routes/view.js:28:20
A report has been logged and a team of bug-squashing squirrels has been dispatched to deal with the situation.

fixed in updated markdown - you may need to update your plugins