Bug: in-model pager ignores the model event (with where clause, run via callback), reporting incorrect paging information

PHP Version
8.1
CodeIgniter4 Version
4.4.4
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
cli-server (PHP built-in webserver)
Database
SQLite3
What happened?
I have a custom event in a model that applies where clause to every search implemented thus:
protected $beforeFind     = ['restrictToUser'];
    protected function restrictToUser(array $data)
    {
        // in my case the user_id comes from session, hardcode here:
        $this->where($this->table . '.user_id', 3);

        return $data;
    }

When I use it with an in-model pager, the find results apply this event, but the pager does not, resulting in wrong page count and wrong total record number.
Steps to Reproduce
Start with empty project.
Rename env to .env, change these lines in it to the values:
app.baseURL = 'http://localhost:8080/'
database.default.database = ci4
database.default.DBDriver = SQLite3

Add a cli route in app/Config/Routes.php:
$routes->cli('home', 'Home::index');
Add migration for a table:
php spark make:migration CreateTestTable
Replace up() and down() methods with:
public function up()
    {
        $this->forge->addField([
            'id' => [
                'type'           => 'INT',
                'constraint'     => 10,
                'auto_increment' => true,
                'null'           => false,
            ],
            'user_id' => [
                'type'       => 'INT',
                'constraint' => 10,
                'null'       => false,
            ],
            'data' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'null'       => false,
            ],
            'created_at' => [
                'type' => 'DATETIME',
                'null' => true,
            ],
            'updated_at' => [
                'type' => 'DATETIME',
                'null' => true,
            ],
            'deleted_at' => [
                'type' => 'DATETIME',
                'null' => true,
            ],
        ]);

        $this->forge->addKey('id', true);
        $this->forge->createTable('test');
    }

    public function down()
    {
        $this->forge->dropTable('test');
    }

make a seeder:
php spark make:seeder test --suffix
Replace the seeder method run() with this:
public function run()
    {
        $builder = $this->db->table('test');
        $data = [];

        $i = 1;
        while ($i < 100) {

            $user_id = rand(2, 4);
            $data = [
                'user_id'        => $user_id,
                'data'           => 'Some text by user ' . $user_id . ', entry ' . $i,
                'created_at'     => '2024-01-09 12:51:33',
                'updated_at'     => '2024-01-09 12:51:33',
            ];

            $builder->insert($data);

            $i++;
        }
    }

Create model:
php spark make:model TestModel
in model, update the $beforeFind callback thus:
protected $beforeFind     = ['restrictToUser'];
and add event method to model:
    protected function restrictToUser(array $data)
    {
        // in my case the user_id comes from session, hardcode here:
        $this->where($this->table . '.user_id', 3);

        return $data;
    }

Add test code to the Home controller, replace the index() method with:
    public function index()
    {
        $model = model(\App\Models\TestModel::class);
        echo PHP_EOL;

        echo 'Total number of entries in table (should be 99): ' . $model->countAllResults(false);
        echo PHP_EOL . PHP_EOL;

        $list = $model->findAll();
        //$list = $model->where('user_id', 3)->findAll();

        echo 'Number with user_id = 3, using findAll(), event restrictToUser applied (should be ~1/3 of 99): ' . count($list);
        echo PHP_EOL . PHP_EOL;

        echo 'Rerun find with paginate() (squeze all results in one page):' ;
        $list = $model->paginate(101);
        $pager = $model->pager;
        echo '... done.' . PHP_EOL . PHP_EOL;

        echo 'Real number of results, that honours event restrictToUser (should be ~1/3 of 99): ' . count($list);
        echo PHP_EOL . PHP_EOL;

        echo 'pager-reported number, that ignores event restrictToUser  (should be ~1/3 of 99, but is 99): ' . $pager->getTotal();
        echo PHP_EOL . PHP_EOL;

        echo 'Rerun find with  paginate() (10 per page):' ;
        $list = $model->paginate(10);
        $pager = $model->pager;
        echo '... done.' . PHP_EOL . PHP_EOL;

        echo 'Pager-reported number, that ignores event restrictToUser (should be ~1/3 of 99, but is 99): ' . $pager->getTotal();
        echo PHP_EOL . PHP_EOL;

        echo 'Pager-reported page number, that ignores event restrictToUser (should be ~3, but is 10) : ' . $pager->getPageCount();
        echo PHP_EOL . PHP_EOL;

    }

Run the test :
dg@tvenkinys:~/Programavimas/MOK/ci4bugDemo$ php spark migrate

CodeIgniter v4.4.4 Command Line Tool - Server Time: 2024-01-12 08:44:50 UTC+00:00

Running all new migrations...
        Running: (App) 2024-01-10-214032_App\Database\Migrations\CreateTestTable
Migrations complete.
dg@tvenkinys:~/Programavimas/MOK/ci4bugDemo$ php spark db:seed TestSeeder

CodeIgniter v4.4.4 Command Line Tool - Server Time: 2024-01-12 08:45:12 UTC+00:00

Seeded: App\Database\Seeds\TestSeeder

dg@tvenkinys:~/Programavimas/MOK/ci4bugDemo$ php public/index.php home

Total number of entries in table (should be 99): 99

Number with user_id = 3, using findAll(), event restrictToUser applied (should be ~1/3 of 99): 28

Rerun find with paginate() (squeze all results in one page):... done.

Real number of results, that honours event restrictToUser (should be ~1/3 of 99): 28

pager-reported number, that ignores event restrictToUser  (should be ~1/3 of 99, but is 99): 99

Rerun find with  paginate() (10 per page):... done.

Pager-reported number, that ignores event restrictToUser (should be ~1/3 of 99, but is 99): 99

Pager-reported page number, that ignores event restrictToUser (should be ~3, but is 10) : 10

Expected Output
I expect the in-model pager report the same number of entries as returned by the model paginate() method, applying the in-model specified event correctly.
Anything else?
No response

You reset the query with countAllResults().
echo 'total number of entries in table: ' . $model->countAllResults();

Try countAllResults(false).

Ah, countAllResults() does not take care of events, so the result is always wrong.

Ah, countAllResults() does not take care of events, so the result is always wrong.

I assumed that, no problem here. It is the results at this line in output:
pager-reported number, that ignores event restrictToUser ...
and later that are the problem.

My theory of this error after looking in the code of BaseModel.php:
The $beforeFind callbacks are fired in the findAll() method, so, at the very last element of the chain of building sql command.
The method paginate() uses the the findAll() method internally, but only calls it AFTER in initiates the Pager library and adds all the data to it. So, the Pager is initiated before the callback runs within the findAll(), on line 1239:
$this->pager = $pager->store($group, $page, $perPage, $this->countAllResults(false), $segment);

How does that sound?

It seems that we cannot solve this issue easily.
When we generate pagination, we need to:

get all count (countAllResults(false))
get paginated result set (findAll($limit, $offset)) (Note that we limit the result)

Also:
3. $beforeFind callbacks are NOT fired in countAllResults().
4. findAll() resets the query.
If we call findAll($limit, $offset) before countAllResults(false), countAllResults(false) does not work.
Even if we stop findAll() to reset the query (there is no API to do so now), the countAllResults(false) result will be limited and wrong.
So the query order is not wrong in the current code:
https://github.com/codeigniter4/CodeIgniter4/blob/4308c0bb1d2306701d74e83280415ed24c9a3509/system/BaseModel.php#L1228-L1244

I don't know how to fix this issue or if we should not fix it.
Workaround is to override paginate() something like this?
    public function paginate(?int $perPage = null, string $group = 'default', ?int $page = null, int $segment = 0)
    {
        // Fire restrictToUser() manually. // Added
        $this->restrictToUser([]);         // Added

        // Since multiple models may use the Pager, the Pager must be shared.
        $pager = Services::pager();

        if ($segment !== 0) {
            $pager->setSegment($segment, $group);
        }

        $page = $page >= 1 ? $page : $pager->getCurrentPage($group);
        // Store it in the Pager library, so it can be paginated in the views.
        $this->pager = $pager->store($group, $page, $perPage, $this->countAllResults(false), $segment);
        $perPage     = $this->pager->getPerPage($group);
        $offset      = ($pager->getCurrentPage($group) - 1) * $perPage;

        // Disable model events for findAll(). // Added
        $this->allowCallbacks(false);          // Added

        return $this->findAll($perPage, $offset);
    }

I don't know how to fix this issue or if we should not fix it.
Workaround is to override paginate() something like this?

I see; I was looking at the code yesterday and also could not envisage a way to improve it (but thought maybe the more experienced people might). The suggested workaround would work I guess while I only have that single callback; either that or just add the needed where clause manually before the call to pagination (as I do now; it does generate a double WHERE but it works).
I am leaving the issue open, but I am ok with it being closed as WONTFIX if an efficient solution cannot be found. Thanks for investigating, @kenjis!

I wouldn't say it's a bug. Documentation is clear, what methods are affected by the database events: https://codeigniter.com/user_guide/models/model.html#event-parameters
Although this may be inconvenient, just like in the presented case. To make it work, we would have to modify the countAllResults() method, to also respect the beforeFind events. TBH, I'm not convinced that we should since these events are designed to work with different types of queries.

According to the current documentation, it is not a bug. The behavior is expected.
My question is: should countAllResults() respect Model *Find Events?
Because it is also a method to find. But I'm not sure we should or not.

The events only work on model-specific methods and countAllResults is from the query builder. I understand that this is a weird case but no I don't think so. The events were never intended to change the number of results, only modify the results that were found. Filtering should happen after results are returned.

@lonnieezell Model has countAllResults():
https://github.com/codeigniter4/CodeIgniter4/blob/4308c0bb1d2306701d74e83280415ed24c9a3509/system/Model.php#L611

The events were never intended to change the number of results, only modify the results that were found. Filtering should happen after results are returned.

Do you say the following Model callback is kind of a misuse?
    protected function restrictToUser(array $data)
    {
        // in my case the user_id comes from session, hardcode here:
        $this->where($this->table . '.user_id', 3);

        return $data;
    }

Ah, I forgot that was overridden for soft-deletes. Seems I misspoke.
Would I say it's a misuse? No, just not what events were originally thought of. Everything always gets used in creative ways you didn't expect. Part of the fun - seeing how others use your stuff. :)
Thinking of it another way, though, no I wouldn't expect a count() query to use the same event as a find() query, though.

This is Controller function:
`<?php
namespace App\Controllers;
use App\Models\BusinessModel;
use CodeIgniter\RESTful\ResourceController;
use App\Models{
BusinessProfilesModel,
ClientApplicationsModel,
};
use Config{
Database,
Services,
};
class BusinessController extends ResourceController
{
protected $modelName = ClientApplicationsModel::class;
protected $format = 'json';
public function __construct()
{
    // Load the model
    $this->db = Database::connect(); // Forzar la conexión a la base de datos
    $this->pager = Services::pager();
}
public function apps(){
    $model = model(\App\Models\ClientApplicationsModel::class);
    echo PHP_EOL;

    echo 'Total number of entries in table (should be 99): ' . $model->countAllResults(false);
    echo PHP_EOL . PHP_EOL;

    $list = $model->findAll();
    //$list = $model->where('user_id', 3)->findAll();

    echo 'Number with user_id = 3, using findAll(), event restrictToUser applied (should be ~1/3 of 99): ' . count($list);
    echo PHP_EOL . PHP_EOL;

    echo 'Rerun find with paginate() (squeze all results in one page):' ;
    $list = $model->paginate(101);
    $pager = $model->pager;
    echo '... done.' . PHP_EOL . PHP_EOL;

    echo 'Real number of results, that honours event restrictToUser (should be ~1/3 of 99): ' . count($list);
    echo PHP_EOL . PHP_EOL;

    echo 'pager-reported number, that ignores event restrictToUser  (should be ~1/3 of 99, but is 99): ' . $pager->getTotal();
    echo PHP_EOL . PHP_EOL;

    echo 'Rerun find with  paginate() (10 per page):' ;
    $list = $model->paginate(10);
    $pager = $model->pager;
    echo '... done.' . PHP_EOL . PHP_EOL;

    echo 'Pager-reported number, that ignores event restrictToUser (should be ~1/3 of 99, but is 99): ' . $pager->getTotal();
    echo PHP_EOL . PHP_EOL;

    echo 'Pager-reported page number, that ignores event restrictToUser (should be ~3, but is 10) : ' . $pager->getPageCount();
    echo PHP_EOL . PHP_EOL;

}`

Testing
Displayed at 00:34:00am — PHP: 8.3.4 Displayed at 00:34:00am — PHP: 8.3.4 — CodeIgniter: 4.5.4 -- Environment: development
TypeError
CodeIgniter\Database\BaseResult::getResult(): Argument #1 ($type) must be of type string, null given, called in /var/www/business.hexome.cloud/html/system/Model.php on line 287
SYSTEMPATH/Database/BaseResult.php at line 106

 99     /**
100      * Retrieve the results of the query. Typically an array of
101      * individual data rows, which can be either an 'array', an
102      * 'object', or a custom class name.
103      *
104      * @param string $type The row type. Either 'array', 'object', or a class name to use
105      */
106     public function getResult(string $type = 'object'): array
107     {
108         if ($type === 'array') {
109             return $this->getResultArray();
110         }
111
112         if ($type === 'object') {
113             return $this->getResultObject();
[Backtrace](http://business.hexome.cloud/api/business/apps?page=1&limit=10&user_id=04ffb579-5f30-11ef-83a0-7071bcbe887a#backtrace) [Server](http://business.hexome.cloud/api/business/apps?page=1&limit=10&user_id=04ffb579-5f30-11ef-83a0-7071bcbe887a#server) [Request](http://business.hexome.cloud/api/business/apps?page=1&limit=10&user_id=04ffb579-5f30-11ef-83a0-7071bcbe887a#request) [Response](http://business.hexome.cloud/api/business/apps?page=1&limit=10&user_id=04ffb579-5f30-11ef-83a0-7071bcbe887a#response) [Files](http://business.hexome.cloud/api/business/apps?page=1&limit=10&user_id=04ffb579-5f30-11ef-83a0-7071bcbe887a#files) [Memory](http://business.hexome.cloud/api/business/apps?page=1&limit=10&user_id=04ffb579-5f30-11ef-83a0-7071bcbe887a#memory)
SYSTEMPATH/Model.php : 287   —  CodeIgniter\Database\BaseResult->getResult ()

280
281         if ($this->tempUseSoftDeletes) {
282             $builder->where($this->table . '.' . $this->deletedField, null);
283         }
284
285         $results = $builder->limit($limit, $offset)
286             ->get()
287             ->getResult($this->tempReturnType);
288
289         if ($useCast) {
290             foreach ($results as $i => $row) {
291                 $results[$i] = $this->convertToReturnType($row, $returnType);
292             }
293
294             $this->tempReturnType = $returnType;
SYSTEMPATH/BaseModel.php : 676   —  CodeIgniter\Model->doFindAll ()
669
670             if (isset($eventData['returnData']) && $eventData['returnData'] === true) {
671                 return $eventData['data'];
672             }
673         }
674
675         $eventData = [
676             'data'      => $this->doFindAll($limit, $offset),
677             'limit'     => $limit,
678             'offset'    => $offset,
679             'method'    => 'findAll',
680             'singleton' => false,
681         ];
682
683         if ($this->tempAllowCallbacks) {
APPPATH/Controllers/BusinessController.php : 35   —  CodeIgniter\BaseModel->findAll ()
28     public function apps(){
29         $model = model(\App\Models\ClientApplicationsModel::class);
30         echo PHP_EOL;
31
32         echo 'Total number of entries in table (should be 99): ' . $model->countAllResults(false);
33         echo PHP_EOL . PHP_EOL;
34
35         $list = $model->findAll();
36         //$list = $model->where('user_id', 3)->findAll();
37
38         echo 'Number with user_id = 3, using findAll(), event restrictToUser applied (should be ~1/3 of 99): ' . count($list);
39         echo PHP_EOL . PHP_EOL;
40
41         echo 'Rerun find with paginate() (squeze all results in one page):' ;
42         $list = $model->paginate(101);
SYSTEMPATH/CodeIgniter.php : 933   —  App\Controllers\BusinessController->apps ()
926         // This is a Web request or PHP CLI request
927         $params = $this->router->params();
928
929         // The controller method param types may not be string.
930         // So cannot set declare(strict_types=1) in this file.
931         $output = method_exists($class, '_remap')
932             ? $class->_remap($this->method, ...$params)
933             : $class->{$this->method}(...$params);
934
935         $this->benchmark->stop('controller');
936
937         return $output;
938     }
939
940     /**
SYSTEMPATH/CodeIgniter.php : 509   —  CodeIgniter\CodeIgniter->runController ()
502             if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) {
503                 throw PageNotFoundException::forMethodNotFound($this->method);
504             }
505
506             // Is there a "post_controller_constructor" event?
507             Events::trigger('post_controller_constructor');
508
509             $returned = $this->runController($controller);
510         } else {
511             $this->benchmark->stop('controller_constructor');
512             $this->benchmark->stop('controller');
513         }
514
515         // If $returned is a string, then the controller output something,
516         // probably a view, instead of echoing it directly. Send it along
SYSTEMPATH/CodeIgniter.php : 355   —  CodeIgniter\CodeIgniter->handleRequest ()
348         $possibleResponse = $this->runRequiredBeforeFilters($filters);
349
350         // If a ResponseInterface instance is returned then send it back to the client and stop
351         if ($possibleResponse instanceof ResponseInterface) {
352             $this->response = $possibleResponse;
353         } else {
354             try {
355                 $this->response = $this->handleRequest($routes, config(Cache::class), $returnResponse);
356             } catch (DeprecatedRedirectException|ResponsableInterface $e) {
357                 $this->outputBufferingEnd();
358                 if ($e instanceof DeprecatedRedirectException) {
359                     $e = new RedirectException($e->getMessage(), $e->getCode(), $e);
360                 }
361
362                 $this->response = $e->getResponse();
SYSTEMPATH/Boot.php : 325   —  CodeIgniter\CodeIgniter->run ()
318
319     /**
320      * Now that everything is set up, it's time to actually fire
321      * up the engines and make this app do its thang.
322      */
323     protected static function runCodeIgniter(CodeIgniter $app): void
324     {
325         $app->run();
326     }
327
328     protected static function saveConfigCache(FactoriesCache $factoriesCache): void
329     {
330         $factoriesCache->save('config');
331     }
332
SYSTEMPATH/Boot.php : 67   —  CodeIgniter\Boot::runCodeIgniter ()
60         if ($configCacheEnabled) {
61             $factoriesCache = static::loadConfigCache();
62         }
63
64         static::autoloadHelpers();
65
66         $app = static::initializeCodeIgniter();
67         static::runCodeIgniter($app);
68
69         if ($configCacheEnabled) {
70             static::saveConfigCache($factoriesCache);
71         }
72
73         // Exits the application, setting the exit code for CLI-based
74         // applications that might be watching.
FCPATH/index.php : 56   —  CodeIgniter\Boot::bootWeb ()
49 // ^^^ Change this line if you move your application folder
50
51 $paths = new Config\Paths();
52
53 // LOAD THE FRAMEWORK BOOTSTRAP FILE
54 require $paths->systemDirectory . '/Boot.php';
55
56 exit(CodeIgniter\Boot::bootWeb($paths));
57— CodeIgniter: 4.5.4 -- Environment: development
TypeError
CodeIgniter\Database\BaseResult::getResult(): Argument #1 ($type) must be of type string, null given, called in /var/www/business.hexome.cloud/html/system/Model.php on line 287
SYSTEMPATH/Database/BaseResult.php at line 106
99     /**
100      * Retrieve the results of the query. Typically an array of
101      * individual data rows, which can be either an 'array', an
102      * 'object', or a custom class name.
103      *
104      * @param string $type The row type. Either 'array', 'object', or a class name to use
105      */
106     public function getResult(string $type = 'object'): array
107     {
108         if ($type === 'array') {
109             return $this->getResultArray();
110         }
111
112         if ($type === 'object') {
113             return $this->getResultObject();
Backtrace Server Request Response Files Memory
SYSTEMPATH/Model.php : 287   —  CodeIgniter\Database\BaseResult->getResult ()
280
281         if ($this->tempUseSoftDeletes) {
282             $builder->where($this->table . '.' . $this->deletedField, null);
283         }
284
285         $results = $builder->limit($limit, $offset)
286             ->get()
287             ->getResult($this->tempReturnType);
288
289         if ($useCast) {
290             foreach ($results as $i => $row) {
291                 $results[$i] = $this->convertToReturnType($row, $returnType);
292             }
293
294             $this->tempReturnType = $returnType;
SYSTEMPATH/BaseModel.php : 676   —  CodeIgniter\Model->doFindAll ()
669
670             if (isset($eventData['returnData']) && $eventData['returnData'] === true) {
671                 return $eventData['data'];
672             }
673         }
674
675         $eventData = [
676             'data'      => $this->doFindAll($limit, $offset),
677             'limit'     => $limit,
678             'offset'    => $offset,
679             'method'    => 'findAll',
680             'singleton' => false,
681         ];
682
683         if ($this->tempAllowCallbacks) {
APPPATH/Controllers/BusinessController.php : 35   —  CodeIgniter\BaseModel->findAll ()
28     public function apps(){
29         $model = model(\App\Models\ClientApplicationsModel::class);
30         echo PHP_EOL;
31
32         echo 'Total number of entries in table (should be 99): ' . $model->countAllResults(false);
33         echo PHP_EOL . PHP_EOL;
34
35         $list = $model->findAll();
36         //$list = $model->where('user_id', 3)->findAll();
37
38         echo 'Number with user_id = 3, using findAll(), event restrictToUser applied (should be ~1/3 of 99): ' . count($list);
39         echo PHP_EOL . PHP_EOL;
40
41         echo 'Rerun find with paginate() (squeze all results in one page):' ;
42         $list = $model->paginate(101);
SYSTEMPATH/CodeIgniter.php : 933   —  App\Controllers\BusinessController->apps ()
926         // This is a Web request or PHP CLI request
927         $params = $this->router->params();
928
929         // The controller method param types may not be string.
930         // So cannot set declare(strict_types=1) in this file.
931         $output = method_exists($class, '_remap')
932             ? $class->_remap($this->method, ...$params)
933             : $class->{$this->method}(...$params);
934
935         $this->benchmark->stop('controller');
936
937         return $output;
938     }
939
940     /**
SYSTEMPATH/CodeIgniter.php : 509   —  CodeIgniter\CodeIgniter->runController ()
502             if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) {
503                 throw PageNotFoundException::forMethodNotFound($this->method);
504             }
505
506             // Is there a "post_controller_constructor" event?
507             Events::trigger('post_controller_constructor');
508
509             $returned = $this->runController($controller);
510         } else {
511             $this->benchmark->stop('controller_constructor');
512             $this->benchmark->stop('controller');
513         }
514
515         // If $returned is a string, then the controller output something,
516         // probably a view, instead of echoing it directly. Send it along
SYSTEMPATH/CodeIgniter.php : 355   —  CodeIgniter\CodeIgniter->handleRequest ()
348         $possibleResponse = $this->runRequiredBeforeFilters($filters);
349
350         // If a ResponseInterface instance is returned then send it back to the client and stop
351         if ($possibleResponse instanceof ResponseInterface) {
352             $this->response = $possibleResponse;
353         } else {
354             try {
355                 $this->response = $this->handleRequest($routes, config(Cache::class), $returnResponse);
356             } catch (DeprecatedRedirectException|ResponsableInterface $e) {
357                 $this->outputBufferingEnd();
358                 if ($e instanceof DeprecatedRedirectException) {
359                     $e = new RedirectException($e->getMessage(), $e->getCode(), $e);
360                 }
361
362                 $this->response = $e->getResponse();
SYSTEMPATH/Boot.php : 325   —  CodeIgniter\CodeIgniter->run ()
318
319     /**
320      * Now that everything is set up, it's time to actually fire
321      * up the engines and make this app do its thang.
322      */
323     protected static function runCodeIgniter(CodeIgniter $app): void
324     {
325         $app->run();
326     }
327
328     protected static function saveConfigCache(FactoriesCache $factoriesCache): void
329     {
330         $factoriesCache->save('config');
331     }
332
SYSTEMPATH/Boot.php : 67   —  CodeIgniter\Boot::runCodeIgniter ()
60         if ($configCacheEnabled) {
61             $factoriesCache = static::loadConfigCache();
62         }
63
64         static::autoloadHelpers();
65
66         $app = static::initializeCodeIgniter();
67         static::runCodeIgniter($app);
68
69         if ($configCacheEnabled) {
70             static::saveConfigCache($factoriesCache);
71         }
72
73         // Exits the application, setting the exit code for CLI-based
74         // applications that might be watching.
FCPATH/index.php : 56   —  CodeIgniter\Boot::bootWeb ()
49 // ^^^ Change this line if you move your application folder
50
51 $paths = new Config\Paths();
52
53 // LOAD THE FRAMEWORK BOOTSTRAP FILE
54 require $paths->systemDirectory . '/Boot.php';
55
56 exit(CodeIgniter\Boot::bootWeb($paths));
57

To solve this error of deprecate documentation oficial of with bug on:
Displayed at 00:34:00am — PHP: 8.3.4 Displayed at 00:34:00am — PHP: 8.3.4 — CodeIgniter: 4.5.4 -- Environment: development
Simple solve error with CI please use this:
/**
* Retrieves paginated businesses for a specific user using raw SQL.
*
* @param int $page The current page number
* @param int $limit The number of items per page
* @param string $userId The user ID to filter the businesses
* @return array Paginated business data and pagination details
*/
public function getPaginatedResults(int $page, int $limit, string $userId): array
{
// Calculate the offset
$offset = ($page - 1) * $limit;
    // SQL query to get paginated results
    $sql = "SELECT * FROM $this->table WHERE user_id = :user_id: ORDER BY created_at ASC LIMIT :limit: OFFSET :offset:";

    // Execute the query
    $query = $this->db->query($sql, [
        'user_id' => $userId,
        'limit' => $limit,
        'offset' => $offset
    ]);

    // Get the results
    $results = $query->getResult();

    // SQL query to count the total records
    $countSql = "SELECT COUNT(*) as total FROM $this->table WHERE user_id = :user_id:";
    $totalQuery = $this->db->query($countSql, ['user_id' => $userId]);
    $total = $totalQuery->getRow()->total;

    // Build the response with paginated data and pagination details
    return [
        'data' => $results,
        'pagination' => [
            'total' => $total,
            'per_page' => $limit,
            'current_page' => $page,
            'last_page' => ceil($total / $limit),
            'next' => $page < ceil($total / $limit) ? $page + 1 : null,
            'previous' => $page > 1 ? $page - 1 : null,
        ],
    ];
}

use to query please use warning with Validator to restrict access or sql insection to $userId;
To testing in the dev enviroment is:
public function apps()
{
$pager = service('pager');
$page = intval($this->request->getVar('page', FILTER_VALIDATE_INT)) ?: 1;
$limit = intval($this->request->getVar('limit', FILTER_VALIDATE_INT)) ?: 10;
$userId = $this->request->getVar('user_id');
    if (empty($userId)) {
        return $this->fail('User ID is required.', 400);
    }

    if ($page <= 0) {
        return $this->fail('Page number must be greater than 0.', 400);
    }

    if ($limit <= 0) {
        return $this->fail('Limit must be greater than 0.', 400);
    }

    try {
        $result = $this->model->getPaginatedResults($page, $limit, $userId);
        return $this->respond([
            'status' => 200,
            'error' => null,
            'data' => $result['data'],
            'pagination' => $result['pagination'],
        ]);
    } catch (\Exception $e) {
        return $this->fail('Error in querying the database: ' . $e->getMessage(), 500);
    }
}

{   "status": 200,   "error": null,   "data": [     {       "client_id": "50512010-624f-11ef-b9bf-7071bcbe887a"     },     {       "client_id": "5c1a2230-6254-11ef-b9bf-7071bcbe887a"     },     {       "client_id": "620bd04f-6258-11ef-b9bf-7071bcbe887a"     },     {       "client_id": "57f55e69-625c-11ef-b9bf-7071bcbe887a"     }   ],   "pagination": {     "total": "4",     "per_page": 10,     "current_page": 1,     "last_page": 1,     "next": null,     "previous": null   } }


Need DocsSidebarNavbarItem

Description
Need a v2 Docusaurus feature missing so that navigation "tabs" that link to a sidebar can be properly highlighted when we browse a doc of the given sidebar (docs/components/api)
Waiting for https://github.com/facebook/docusaurus/issues/3320

After the Docusaurus upgrade this issue can be marked as "resolved" 👍


Switch to gradle-based directory structure

Forget all those oldies using Eclipse, don't care anymore.

Finished: 5ce1a93aa267b9536a0ee7ec8ad6815c5a3aeccf


chore(system_error_monitor): stop syncing parameter for planning_simulator

…lator
PR Type

Improvement

Related Links

Description

stop to sync system_error_monitor.planning_simulation.param.yaml because it is not used at #252

Review Procedure

Remarks

Pre-Review Checklist for the PR Author
PR Author should check the checkboxes below when creating the PR.

[x] Code follows coding guidelines
[x] Assign PR to reviewer

Checklist for the PR Reviewer
Reviewers should check the checkboxes below before approval.

[ ] Commits are properly organized and messages are according to the guideline
[ ] Code follows coding guidelines
[ ] (Optional) Unit tests have been written for new behavior
[ ] PR title describes the changes

Post-Review Checklist for the PR Author
PR Author should check the checkboxes below before merging.

[ ] All open points are addressed and tracked via issues or tickets
[ ] Write release notes

CI Checks

Build and test for PR: Required to pass before the merge.
Check spelling: NOT required to pass before the merge. It is up to the reviewer(s). See here if you want to add some words to the spell check dictionary.

Fixed the title.

The latter of the sentence was dropped.
stop to sync -> stop syncing


RMSD error about function not implemented

FullAtomModel/CoordsTransform/CoordsTransform.py", line 174, in forward
_FullAtomModel.Coords2CenterGPU_forward( input_coords, output_center, num_atoms)
RuntimeError: "Coords2CenterGPU_forward" not implemented for 'Half'
I am confused by why this happened. It looked like the function is not implemented?

NVM, it was due to mixed-precision training.

Yeah, right now there are no layers that are using half precision.


Starting new Animation in start callback not cancelling existing animation

Is this a bug report?
Yes.
Have you read the Bugs section of the Contributing to React Native Guide?
Yes.
Environment
react-native-cli: 2.0.1
react-native: 0.45.1
Then, specify:

Target Platform (e.g. iOS, Android): Both
Development Operating System (e.g. macOS Sierra, Windows 10): macOS El Capitan

Steps to Reproduce

Start an animation with Animated.timing or any animation
Interrupt animation so that finished is false in start callback
Trigger another animation on same Animated.Value.
Notice the first animation isn't cancelled yet, second animation continues

Expected Behavior
It should have cancelled the first animation before the start callback and then executed the second animation.
Actual Behavior
It executes both at the same time until one of them wins. Requires the use of a setTimeout to allow for executing the second animation.
Reproducible Demo
Snack Demo

I realize this is likely my issue, in that the same code path is being executed, the start callback is being called of the previous toValue: 0 animation, then we are starting a toValue: 1 in a sync callback which then the new toValue: 0 for the second click is started.
This shouldn't be code that is written but it seems like the toValue: 1 in the callback should be stopped before the toValue: 0 of the second click kicks in.

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.


An error occured when "../configure"

fengyanyan@192 shaka-player-embedded % cd foo
fengyanyan@192 foo % ../configure
Loading required submodules...
Downloading GN from cloud storage...
Generating files for boringssl...
Traceback (most recent call last):
File "/Users/fengyanyan/shaka-player-embedded/third_party/boringssl/src/util/bot/go/env.py", line 34, in
new = bootstrap.prepare_go_environ()
File "/Users/fengyanyan/shaka-player-embedded/third_party/boringssl/src/util/bot/go/bootstrap.py", line 266, in prepare_go_environ
bootstrap(logging.INFO)
File "/Users/fengyanyan/shaka-player-embedded/third_party/boringssl/src/util/bot/go/bootstrap.py", line 258, in bootstrap
ensure_toolset_installed(TOOLSET_ROOT)
File "/Users/fengyanyan/shaka-player-embedded/third_party/boringssl/src/util/bot/go/bootstrap.py", line 190, in ensure_toolset_installed
available = get_toolset_url()
File "/Users/fengyanyan/shaka-player-embedded/third_party/boringssl/src/util/bot/go/bootstrap.py", line 79, in get_toolset_url
raise Failure('Unrecognized platform')
bootstrap.Failure: Unrecognized platform
macOS Big Sur 11.6

@fyanyan I've the same issue, did you get rid of it?


Refs: #35568 -- Added support for dict-like objects for format_html_j…

Trac ticket number

ticket-35668
Branch description
Added support for dict-like objects for format_html_join so that it can be used with named arguments. The provided args must be either all named or all positional. Not sure if we should any docs, but I added some tests.
Checklist

[x] This PR targets the main branch.
[x] The commit message is written in past tense, mentions the ticket number, and ends with a period.
[x] I have checked the "Has patch" ticket flag in the Trac system.
[x] I have added or updated relevant tests.
[x] I have added or updated relevant docs, including release notes if applicable.
[x] I have attached screenshots in both light and dark modes for any UI changes.

I see you deleted the checklist from the PR template. Please don’t do that. Copy it back from the description from .github/pull_request_template.md and check off the items as appropriate.

Great, thanks, I’ve marked the ticket as ready for check-in - fellows may still want to make some tweaks though.

I’ve just noticed your commit title doesn't exactly match the project style (colon after “Refs”) and is a bit long. Can you adjust it to the below?
Refs #35568 -- Added mapping support to format_html_join.

Thanks!

Refs #35568 -- Added mapping support to format_html_join.

I pushed tiny tweaks
Just to confirm, this should close ticket-35668 or is more work expected? (Fixed vs Refs)

Good point, this is a “Fixed” and the ticket can be closed after this!


[New Port Request] ncnn[vulkan]

Library name
ncnn
Library description
No response
Source repository URL
https://github.com/Tencent/ncnn/tree/20231027
Project homepage (if different from the source repository)
https://github.com/Tencent/ncnn
Anything else that is useful to know when adding (such as optional features the library may have that should be included)
-DNCNN_VULKAN=ON
-DNCNN_SYSTEM_GLSLANG=ON

Is there any progress on this issue? Pure CPU computing is too slow.


Cu-1tmh3qe Gatherer for OICs

Task linked: CU-1tmh3qe Retrieve the metainformation about the Orders-In-Council

Closed before I could comment. My mistake. changes to make it more generic and not just about statutory instruments are good. OIC fetcher seems pretty good too.

Yeah... the parallel French fact retriever was a bit of a trick to write. Screen-scraping is brittle at the best of times.


@_implementationOnly import _AtomicsShims triggers compiler assertions on 5.9

Under certain unknown circumstances, using Swift Atomics as a dependency triggers a compiler assertion due to the way it imports _AtomicsShims in 5.9.
error: fatal error encountered while reading from module '[...]'; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
<binary format>
^
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
[...]
6.      *** DESERIALIZATION FAILURE ***
[...]
module '_AtomicsShims' was not loaded

I added the @_implementationOnly import to prevent issues when library evolution is enabled:
https://github.com/apple/swift-atomics/issues/104#issuecomment-1736482927
Not sure what we can do here, other than getting rid of this C module as soon as possible.


[WIP] Dapr docs for .NET SDK

A draft of the Dapr docs for the .NET SDK.
Goes alongside corresponding WIP changes in dapr/docs

@hhunter-ms @greenie-msft This is a draft of docs for the new Dapr Pluggable Components .NET SDK. If you have any feedback on structure, please let me know.

@hhunter-ms @greenie-msft I think I've got the pretty good start on these docs; if you have a chance to look them over I'd appreciate it.

@philliphoff sorry for the delay - did a quick consistency/grammar pass. thanks for these docs!


SystemLocaleTestRule failing for the first test ONLY on first run.

Describe the bug
SystemLocaleTestRule does not always work the very first time the Tests run on a device/emulator, silently failing for the very first test ONLY with a SecurityException. Therefore, for that test ONLY is the System Locale not changed.
Environment
The setup in which the bug is reproducible:

Device or Emulator: Device or emulator
API level: any API
AndroidUiTestingUtils version: 1.2.1
Affected Component: SystemLocaleTestRule and ActivityScenarioForActivityRule(systemLocale ="my_locale"), which uses SystemLocaleTestRule internally.

Expected behavior
Must change the SystemLocale for every single test.
Additional context
This is happening because the SystemLocalTestRule is trying to change the system locale before the CHANGE_CONFIGURATION permission is granted.

Fix in 1.2.2


Deduplicate the names for the additional domain names

What this PR does / why we need it:

So far, if there are duplicate domain names defined in the additional domain names, or the same domain name defined in both additional domain names and the domain name, it leads to the error configuration is invalid: duplicate hosts in virtual service. This PR removes the duplicated domain name for both additional domain names and domain names.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #3756
Type of changes
Please delete options that are not relevant.

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update

Feature/Issue validation/testing:
Please describe the tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

[ ] Test A

[ ] Test B

Logs

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Checklist:

[x] Have you added unit/e2e tests that prove your fix is effective or that this feature works?
[x] Has code been commented, particularly in hard-to-understand areas?
[ ] Have you made corresponding changes to the documentation?

Release note:

Re-running failed tests

/rerun-all - rerun all failed workflows.
/rerun-workflow <workflow name> - rerun a specific failed workflow. Only one workflow name can be specified. Multiple /rerun-workflow commands are allowed per comment.

Could you fill in the all the sections in the PR description? like What this PR does / why we need it:, Feature/Issue validation/testing and Release Note?

/lgtm
/approve


Added option to create namespace on CLI passing list of clusters

Motivation
Since with v2 namespace names, we always have to specify which clusters to use, added a CLI parameter to create a namespace, already configured with one or more clusters. Eg:
bin/pulsar-admin namespaces create my-tenant/my-namespace --clusters us-west,us-east

Would be nice to have some tests of the cli part, since that is user facing

retest this please

Would be nice to have some tests of the cli part, since that is user facing

Good point. I'll add that


Could not find the rpm file in install_dir at ./speed-install line 61.

Cloudlinux 6 x64, cPanel latest.

-- Begin opt 'mod_pagespeed (Custom Opt Mod)' --
-- Begin step 'Installing mod_pagespeed' --
!! Starting mod_pagespeed installation !!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Could not find the rpm file in install_dir at ./speed-install line 61.
!! './speed-install' failed with exit code '512' !!
!! Restoring original working apache !!
!! Executing '/usr/local/cpanel/scripts/initsslhttpd' !!
!! Restarting 'httpd' ... !!
!! 'httpd' restart complete. !!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Building global cache for cpanel...Done
here is easyapache build log


Can't load elf file into spike

Problem: Got a load error when I try to load and run the ELF file in the repository into riscv-isa-sim(spike).
Reproduction:

spike --isa=rv64imc -l rv_i/rvi_compute_register_register/rvi_compute_register_register_1

Access exception occurred while loading payload rv_i/rvi_compute_register_register/rvi_compute_register_register_1:
Memory address 0x726000 is invalid

Investigation: The address of 0x726000 is defined in program header and put the .os_data section etc. I don't know what's the purpose of the section.

Following is the result of riscv64-unknown-elf-readelf -a
Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL<PHONE_NUMBER>000000  00000000
<PHONE_NUMBER>000000<PHONE_NUMBER>000000           0     0     0
  [ 1] .text             PROGBITS<PHONE_NUMBER>000000  00001000
<PHONE_NUMBER>0002ec<PHONE_NUMBER>000000  AX       0     0     64
  [ 2] .code             PROGBITS<PHONE_NUMBER>002000  00002000
<PHONE_NUMBER>000348<PHONE_NUMBER>000000  WA       0     0     1
  [ 3] .os_data          PROGBITS<PHONE_NUMBER>726f00  00000f00
<PHONE_NUMBER>000030<PHONE_NUMBER>000000  WA       0     0     1
  [ 4] .riscv.attributes RISCV_ATTRIBUTE<PHONE_NUMBER>000000  00002348
<PHONE_NUMBER>0000b5<PHONE_NUMBER>000000           0     0     1
  [ 5] .symtab           SYMTAB<PHONE_NUMBER>000000  00002400
<PHONE_NUMBER>0010e0<PHONE_NUMBER>000018           6   177     8
  [ 6] .strtab           STRTAB<PHONE_NUMBER>000000  000034e0
<PHONE_NUMBER>000c4b<PHONE_NUMBER>000000           0     0     1
  [ 7] .shstrtab         STRTAB<PHONE_NUMBER>000000  0000412b
<PHONE_NUMBER>000042<PHONE_NUMBER>000000           0     0     1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  D (mbind), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  RISCV_ATTRIBUT 0x0000000000002348 0x0000000000000000 0x0000000000000000
                 0x00000000000000b5 0x0000000000000000  R      0x1
  LOAD           0x0000000000000000 0x0000000000726000 0x0000000000726000
                 0x0000000000000f30 0x0000000000000f30  RW     0x1000
  LOAD           0x0000000000001000 0x0000000080000000 0x0000000080000000
                 0x00000000000002ec 0x00000000000002ec  R E    0x1000
  LOAD           0x0000000000002000 0x0000000080002000 0x0000000080002000
                 0x0000000000000348 0x0000000000000348  RW     0x1000

These tests access the addresses in the entire available virtual (up to 57-bits) and physical (52-bits) address space. We have tweaked memory ranges for Spike internally to allow these tests to run on modified Spike. We should open source the fork of Spike to provide you the changes.

This has been fixed with the latest release and we have also switched to the public version of Spike. Please give it a try to the latest tests.
Please reopen if you see any fails.


Eliminate OS-specific path mangling in favor of os.path(), do not use getcwd()

sphinxval.utils.report defines replace_backslash_with_forward_slash(input_string).  This function should be eliminated in favor of building all paths with os.path functions, which handles OS-specific peculiarities transparently.
All path concatenation should be done with os.path.join() instead of string concatenation.
sphinxval.utils.config contains the following line:
basepath = os.getcwd().split('\\')[-1]

The validation code should not depend on where it was run, so this variable is problematic at the face of it.  report.py is using it in the following fashion:
image_filename = image_filename.replace('output/plots/', config.basepath + '/output/plots/')

It appears the goal of this code is to replace a relative path with an absolute path.  That can be done properly using os.path.abspath().  The above line is a bug as it makes certain assumptions about image_filename that may not be true, given that the path can be configured in a config file.

@lukestegeman this one is for you.

@ktindiana you have work to do on this one.

% find sphinxval -name '*.py' | xargs grep getcwd returns no output, so it looks like that part is done.
But still finding some os-specific path mangling:
% find sphinxval -name '*.py' | xargs grep "'/'"
sphinxval/utils/validation_json_handler.py:    spltpath = filepath.split('/')
sphinxval/utils/validation_json_handler.py:            path = path + entry + '/'
sphinxval/utils/validation_json_handler.py:    if filepath[0] == '/':
sphinxval/utils/validation_json_handler.py:        path = '/' + path
sphinxval/utils/report.py:            plot_string = os.path.relpath(plot_string_, config.reportpath.split('/')[-1] + '/')
sphinxval/utils/report.py:                    plot_string = os.path.relpath(time_profile_plot_string_list[i], config.reportpath.split('/')[-1] + '/')
sphinxval/utils/report.py:            markdown_filename = config.reportpath + '/' + model + '_report' + appendages[j] + '.md'
sphinxval/utils/report.py:        html_filename = config.reportpath + '/' + model + '_report.html'

Looks like sphinxval.utils.jvalidation_json_handler.get_path() is not used anywhere, so that can just be removed.
% find sphinxval -name '*.py' | xargs grep "get_path"
<no output>


Keep table position after viewing variant details and going back to the variant table

Issue: Feature request
In previous versions of VarFish the additional information for a variant was shown directly in the variant table, by clicking on the specific variant. Due to the lager amount of information, this is change, so you are redirected to a new page, by clicking on a variant to see all the additional information. However, using the "back button" from this additional variant information page back to the variant table, leads you directly to the head of the table. This behavior could be annoying, when you evaluation variants from the list, which are not among the first ten variants you can see directly from this view. So, you have to scroll down again and again and again, for every variant you click on, to see the additional information.
It would be great, if the "back button" brings you back to exactly the same position in the table, you view before. Or if this is not possible, at least to a position, where the variant you clicked on, is in top of the table.
Best,
Florian

Should not be too hard, need to store y position and restore it.


AADSTS90100: flowtoken parameter is empty or not valid.

Here is not the best place to post this issue but I don't know where to post.
I'm trying to log in azure Android client with my corporate account but I'm getting this error:
AADSTS90100: flowtoken parameter is empty or not valid.
Could you please help to address this issue?

You might use corporate support ticket for this, app login is working fine

Thanks!

Not a Azure CLI thing

Not a Azure CLI thing

Not a Azure CLI thing

You are using saml federated authentication , In which your organization create a saml assertion and this assertion is encoded and post via https://login.onmicrosoft.com . After the assertion is verified and create a trust relation between your organisation where it process the flow token to kmsi endpoint.
May be your issue is solved by connecting azure aad from your organization to azure portal


Fix: some bugs

Besides fixing some bugs, this commit also contains some new features.
(I failed to emphasize this in the commit message by accident)


Wrong delimiter for decoding .csv files

The delimiter should be , instead of ; here: https://github.com/FZJ-INM1-BDA/siibra-python/blob/e40973b26e2cc62035ddaff542eb86fbda8674fa/siibra/retrieval/requests.py#L55

@man-shu, thank you for your comment. Could you please describe the issue you are having further?

Hi @AhmetNSimsek. Thanks for the prompt response.
The issue is that when I fetch a CSV file, the loaded pandas dataframe is weird because of the wrong delimiter in the decoder:

Hi @man-shu,
could you please share how are you fetching the file with a sample code? I think I can be of better help then.

Sorry, just updated my comment! Accidentally posted it while changing lines...

No problem :)
I understand that when the delimiter is wrong, the file be read incorrectly. Excuse the miscommunication, I meant how do you use siibra to load the csv?
Siibra can handle different delimiters but depends on how you are loading the data. Have you prepared a preconfiguration json?

Here's the code I am using to get output above:
import siibra
from siibra.retrieval.repositories import EbrainsHdgConnector

siibra.fetch_ebrains_token()

dataset_id = "07ab1665-73b0-40c5-800e-557bc319109d"

connector = EbrainsHdgConnector(dataset_id)

db_file = "resulting_smooth_maps/ibc_neurovault.csv"

db = connector.get(db_file)

db

Thank you.
In such a case, you can use the following to adjust some parameters according to the dataset:
import pandas as pd
from io import BytesIO
connector.get(db_file, decode_func=lambda b: pd.read_csv(BytesIO(b), delimiter=","))

decode_func replaces the defaults. Unfortunately, there are usually a few reasons behind using ; as a default delimiter for csv's.
Please let me know if this works for you.

I was using this workaround for now but just thought it might be more intuitive to use , instead of ; as default. Just out of curiosity, in what ways can ; be more useful?

hmm, judging by the commit that introduced the csv decoder, it appears that the deocder was original written to parse 1000 brains data.
Despite its name, there exist csv's in the wild (in this case, most likely the 1000 brain data), which uses other characters, such as ; (and indeed, also   (single white space), \\s+ (column aligned with white space)
But I agree that the decoder should at least recognise ,.

#381 addressed this issue.


API Version Query

Issue on page:        https://github.com/opentelekomcloud-docs/auto-scaling/blob/main/api-ref/source/apis/api_version_query/index.rst
This link is not necessary and leads to wrong part of the page:
Querying an API Version

Hi, can you, please, add some details to your request: there are two child pages, two links, and two API paths: get all available versions and get only one exact version. There exactly is mistake?
Thank you.


Adding ability to get fields via glob patterns for export handler

Currently the Solr stream and export handlers are not able to use glob patterns for fields, similar to how we can for the select handler. For example, passing fl=* or fl=*_bool to the export handler will not work.
In order to be able to use the export handler with a schema having dynamic fields, we will need the ability to support glob patterns. This implementation finds fields in the schema that match the given pattern and only includes them for export if they are both docValues=true and useDocValuesAsStored=true, otherwise they are skipped.

looking at this now; for other reviewers' convenience, it's much clearer to view the diff ignoring whitespace.

Might it be preferable to do this in two passes?:

expanding glob fields to a final list of field names
use the expanded final list of field names in place of fields.

This would allow leaving writers as a pre-sized array and would remove the extra indentation (neither of these being terribly important); but more importantly: with the PR in its current state I think that if two glob patterns match the same field that field might get double-added? There's more than one way to address this, but the two-pass approach is the simplest I can think of, and I like that it yields a minimal diff.

Might it be preferable to do this in two passes?:

expanding glob fields to a final list of field names
use the expanded final list of field names in place of fields.

This would allow leaving writers as a pre-sized array and would remove the extra indentation (neither of these being terribly important); but more importantly: with the PR in its current state I think that if two glob patterns match the same field that field might get double-added? There's more than one way to address this, but the two-pass approach is the simplest I can think of, and I like that it yields a minimal diff.

Yeah, I thought about doing that but didn't want to introduce another loop, it is probably worth it for clarity of code and your point about avoiding dupes. The minimal diff will be nice too depending on if we push this upstream or not. I'll make that change.

😬 sorry i missed this PR until now, just a really minor thing it appears that wildcardMatch can handle both * and ? and glob handling in Solr fl does the same, perhaps we can allow both ? and * in https://github.com/cowpaths/fullstory-solr/pull/90/files#diff-ef9f0e392f110adf48d6ea5bd773b911416bc7937840297937e44e4f97116999R849
Anyway, super minor, I think people usually use * anyway 😓

😬 sorry i missed this PR until now, just a really minor thing it appears that wildcardMatch can handle both * and ? and glob handling in Solr fl does the same, perhaps we can allow both ? and * in https://github.com/cowpaths/fullstory-solr/pull/90/files#diff-ef9f0e392f110adf48d6ea5bd773b911416bc7937840297937e44e4f97116999R849
Anyway, super minor, I think people usually only use * anyway 😓

Np, that's a good thought. I'm going to look to upstream this change anyway so I'll leave as is for now on our fork and work through that as part of upstreaming it.


hop-node: Add config file options to set max gas price for chain signer

Add ability to set maxGasPrice under chains config in config file

What happens if there is no explicit maxGasPrice set in the config. I see the following logs, but what does the program use when actually sending a tx?
2022-01-06T11:36:58.280-08:00 DEBUG [GasBoostSigner] <ethereum> options: {}
2022-01-06T11:36:58.280-08:00 DEBUG [GasBoostSigner] <ethereum> options: {}
2022-01-06T11:36:58.286-08:00 DEBUG [GasBoostSigner] <xdai> options: {}
2022-01-06T11:36:58.287-08:00 DEBUG [GasBoostSigner] <xdai> options: {}
2022-01-06T11:36:58.292-08:00 DEBUG [GasBoostSigner] <polygon> options: {}
2022-01-06T11:36:58.292-08:00 DEBUG [GasBoostSigner] <polygon> options: {}
2022-01-06T11:36:58.296-08:00 DEBUG [GasBoostSigner] <optimism> options: {}
2022-01-06T11:36:58.296-08:00 DEBUG [GasBoostSigner] <optimism> options: {}
2022-01-06T11:36:58.301-08:00 DEBUG [GasBoostSigner] <arbitrum> options: {}
2022-01-06T11:36:58.301-08:00 DEBUG [GasBoostSigner] <arbitrum> options: {}

What happens if there is no explicit maxGasPrice set in the config. I see the following logs, but what does the program use when actually sending a tx?
2022-01-06T11:36:58.280-08:00 DEBUG [GasBoostSigner] <ethereum> options: {}
2022-01-06T11:36:58.280-08:00 DEBUG [GasBoostSigner] <ethereum> options: {}
2022-01-06T11:36:58.286-08:00 DEBUG [GasBoostSigner] <xdai> options: {}
2022-01-06T11:36:58.287-08:00 DEBUG [GasBoostSigner] <xdai> options: {}
2022-01-06T11:36:58.292-08:00 DEBUG [GasBoostSigner] <polygon> options: {}
2022-01-06T11:36:58.292-08:00 DEBUG [GasBoostSigner] <polygon> options: {}
2022-01-06T11:36:58.296-08:00 DEBUG [GasBoostSigner] <optimism> options: {}
2022-01-06T11:36:58.296-08:00 DEBUG [GasBoostSigner] <optimism> options: {}
2022-01-06T11:36:58.301-08:00 DEBUG [GasBoostSigner] <arbitrum> options: {}
2022-01-06T11:36:58.301-08:00 DEBUG [GasBoostSigner] <arbitrum> options: {}

It uses the same default (500) as before

Understood. LGTM 👍


Update go-billy dependency to v4

Requires merging this PR https://github.com/src-d/go-billy-siva/pull/16

go-git v4 is still not released and a branch called v4 exists in the repository (this is selected when using gopkg.in/src-d/go-git.v4). That branch is not up to date and does not contain the fix for HTTP transport (https://github.com/src-d/go-git/pull/657). It also points to go-siva.v3. This causes a problem testing the package as we expect to have go-siva.v4.
Possible solutions:

Download master go-git in vendor directory before doing tests
Update or delete v4 branch form go-git repo to master
Use glide also for testing core-retrieval
Backport go-git fix to v3 and continue using that version

We could just delete the v4 branch. Nothing should break

I've tested deleting the branch in my clone and it does not work as there is no proper release tag. :(
http://gopkg.in/jfontan/go-git.v4

but we have several -rcX in go-git, right?

That's right, there are several release candidates but those are not picked by gopkg.in service.
I've uploaded the branch to this repo. I'm fixing the version to the commit hash in borges until go-git version 4 is released.

Ah, right. Then pushing stuff to v4 it is, I guess


Response's content-type should override produces

Consumes and request header will come in next PR.


Add support  for Immediate notification delivery mode to future cache

Split from #145 (comment).

I implemented the blocking and non-blocking modes to the sync caches, and implemented only non-blocking mode to the future cache. To configure an eviction listener with a mode, I created an enum DeliveryMode with two variants Immediate, meaning blocking, and Queued, meaning non-blocking.
I could not implement non-worker threads version of the immediate/queued modes just because lack of time. So currently both rely on the worker threads.

This issue will cover the Immediate delivery mode in the first paragraph above.
I will open separate issues to implement the "non-worker threads version" in the second paragraph.

(I am thinking to remove the worker threads completely from moka instead of having both worker-threads/non-worker-threads versions")

I started some experiments. It seems implementing Immediate mode to future cache will require the following API changes:

The get method will become an async fn.
The blocking().insert(..) and blocking().invalidate(..) methods will be removed.

We cannot provide it without relying on a specific async runtime (Tokio, async-std, or actix-rt, etc).

The return type of the event listener closure will be changed from () to ListenerFuture. which is Pin<Box<dyn Future<Output = ()> + Send>>:

So, the new signature of the event listener closure will be:

impl Fn(Arc<K>, V, RemovalCause) -> ListenerFuture + Send + Sync + 'static

I started to work on this task again for v0.12.0 release:

#294

On Feb 13, 2023, tatsuya6502 wrote:

I started some experiments in a separate repository. Here is the diff from v0.10.0 tag:

https://gitlab.com/moka-labs/moka-async-runtimes/moka-experiments/-/compare/v0.10.0...async-runtimes

Note that some features are not working now for the future cache:

Queued notification delivery mode is temporary(?) removed.
invalidate_entries_if is temporary removed.
The get method is still a regular fn (not async fn), and does not perform the housekeeping tasks.

v0.12.0 will not have Queued notification delivery mode for future::Cache.

If anybody asks the Queued mode back, we will add it in a future release.

invalidate_entries_if is added back.

It was already done in February 2023 in the above branch.

The get method is now async fn, so it does perform the housekeeping tasks.

It was already done in February 2023 in the above branch.

Closing as completed.
For v0.12.0, we added changed the notification delivery mode for the future cache to the immediate mode:

#294

We removed the queued delivery mode from all cache types (both future and sync) as we removed the thread pool completely from moka crate.


Make centroid_quadratic() more robust

The new centroid_quadratic() function added by #544 appears to raise exceptions in specific edge cases, e.g.:

source falls on the edge;
source falls in a corner;
flux data contains NaNs.

This PR adds a few tests and bugfixes to make the new feature more robust.

(I started working on this because the example posted in #542 didn't work.  Once this PR is merged, we can probably resolve #542.)

FYI, if you a comment in the form Closes #<the-number-of-the-issue> in the pull request, github will do some magics for you:

from the issue page, users can find the pull request that might close the issue.
when the pull request is merged, the issue is automatically closed.

https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords

Thanks @orionlee, I totally should start using that!


Problem removing ssl cipher binding

I am able to associate a customer cipher list using the following task without any issue:
    - name: Netscaler Enforce | SSL vserver SSL cipher binding
      delegate_to: localhost
      citrix_adc_nitro_request:
        nsip: "{{ netscaler_host_ip }}"
        nitro_user: "{{ netscaler_nitro_user }}"
        nitro_pass: "{{ netscaler_nitro_password }}"
        nitro_protocol: "{{ netscaler_nitro_protocol }}"
        validate_certs: "{{ netscaler_validate_certs }}"
        operation: add
        resource: sslvserver_sslcipher_binding
        name: "{{ netscaler_virtual_endpoint }}"
        attributes:
          vservername: "{{ netscaler_virtual_endpoint }}"
          ciphername: "{{ netscaler_sslvserver_cipher }}"

However, this leaves the DEFAULT cipher also tied to the ssl vserver.  I am unable to remove the DEFAULT cipher from the ssl vserver and I have tried two different methods and resources (sslcipher_sslvserver_binding and sslvserver_sslcipher_binding):
    - name: Netscaler Enforce | SSL vserver SSL cipher unbinding
      delegate_to: localhost
      citrix_adc_nitro_request:
        nsip: "{{ netscaler_host_ip }}"
        nitro_user: "{{ netscaler_nitro_user }}"
        nitro_pass: "{{ netscaler_nitro_password }}"
        nitro_protocol: "{{ netscaler_nitro_protocol }}"
        validate_certs: "{{ netscaler_validate_certs }}"
        operation: delete
        resource: sslcipher_sslvserver_binding
        name: "{{ netscaler_virtual_endpoint }}"
        attributes:
          vservername: "{{ netscaler_virtual_endpoint }}"
          ciphergroupname: "{{ item }}"
          cipheroperation: "REM"
      with_items: "{{ existing_wrong_sslcipher_binding }}"

OR
    - name: Netscaler Enforce | SSL vserver SSL cipher unbinding
      delegate_to: localhost
      citrix_adc_nitro_request:
        nsip: "{{ netscaler_host_ip }}"
        nitro_user: "{{ netscaler_nitro_user }}"
        nitro_pass: "{{ netscaler_nitro_password }}"
        nitro_protocol: "{{ netscaler_nitro_protocol }}"
        validate_certs: "{{ netscaler_validate_certs }}"
        operation: delete
        resource: sslvserver_sslcipher_binding
        name: "{{ netscaler_virtual_endpoint }}"
        attributes:
          vservername: "{{ netscaler_virtual_endpoint }}"
          ciphergroupname: "{{ item }}"
      with_items: "{{ existing_wrong_sslcipher_binding }}"

The sanitized output from both tries is below:
Using sslvserver_sslcipher_binding:
TASK [netscaler : Netscaler Enforce | List of sslciphersuite_binding] **********
task path: /etc/ansible/roles/netscaler/tasks/netscaler_enforce.yml:138
Monday 29 June 2020  15:26:06 +0000 (0:00:00.069)       0:01:00.227 ***********
ok: [my-hostname] => {
    "ansible_facts": {
        "existing_sslcipher_binding": [
            "DEFAULT",
            "myteam-strong-ciphers"
        ]
    },
    "changed": false
}

TASK [netscaler : Netscaler Enforce | List of sslciphersuite_binding not matching netscaler_sslvserver_cipher] ***
task path: /etc/ansible/roles/netscaler/tasks/netscaler_enforce.yml:142
Monday 29 June 2020  15:26:06 +0000 (0:00:00.064)       0:01:00.291 ***********
ok: [my-hostname] => {
    "ansible_facts": {
        "existing_wrong_sslcipher_binding": [
            "DEFAULT"
        ]
    },
    "changed": false
}

TASK [netscaler : Netscaler Enforce | SSL vserver SSL cipher binding] **********
task path: /etc/ansible/roles/netscaler/tasks/netscaler_enforce.yml:146
Monday 29 June 2020  15:26:06 +0000 (0:00:00.071)       0:01:00.363 ***********
skipping: [my-hostname] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}

TASK [netscaler : Netscaler Enforce | SSL vserver SSL cipher unbinding] ********
task path: /etc/ansible/roles/netscaler/tasks/netscaler_enforce.yml:162
Monday 29 June 2020  15:26:06 +0000 (0:00:00.062)       0:01:00.425 ***********
Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/citrix_adc_nitro_request.py
Pipelining is enabled.
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: myansible
<localhost> EXEC /bin/sh -c '/usr/bin/python2 && sleep 0'
failed: [my-hostname -> localhost] (item=DEFAULT) => {
    "ansible_loop_var": "item",
    "changed": false,
    "headers": {
        "Content-Type": "application/json",
        "X-NITRO-PASS": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
        "X-NITRO-USER": "mynsroot"
    },
    "http_response_body": "{ \"errorcode\": 1095, \"message\": \"Required argument missing [policyName, eccCurveName]\", \"severity\": \"ERROR\" }",
    "http_response_data": {
        "cache-control": "no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
        "connection": "close",
        "content-length": "109",
        "content-type": "application/json; charset=utf-8",
        "date": "Mon, 29 Jun 2020 22:18:20 GMT",
        "expires": "Thu, 19 Nov 1981 08:52:00 GMT",
        "msg": "HTTP Error 400: Bad Request",
        "pragma": "no-cache",
        "server": "Apache",
        "status": 400,
        "url": "https://<IP_ADDRESS>/nitro/v1/config/sslvserver_sslcipher_binding/my-vserver",
        "x-frame-options": "SAMEORIGIN",
        "x-xss-protection": "1; mode=block"
    },
    "invocation": {
        "module_args": {
            "action": null,
            "args": null,
            "attributes": {
                "ciphername": "DEFAULT",
                "vservername": "my-vserver"
            },
            "expected_nitro_errorcode": [
                0
            ],
            "filter": null,
            "instance_id": null,
            "instance_ip": null,
            "instance_name": null,
            "name": "my-vserver",
            "nitro_auth_token": null,
            "nitro_pass": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "nitro_protocol": "https",
            "nitro_user": "mynsroot",
            "nsip": "<IP_ADDRESS>",
            "operation": "delete",
            "resource": "sslvserver_sslcipher_binding",
            "timeout": 45,
            "validate_certs": false
        }
    },
    "item": "DEFAULT",
    "msg": "NITRO Failure",
    "nitro_errorcode": 1095,
    "nitro_message": "Required argument missing [policyName, eccCurveName]",
    "nitro_severity": "ERROR"
}

Different task instead (sslcipher_sslvserver_binding):
TASK [netscaler : Netscaler Enforce | SSL vserver SSL cipher unbinding] ********
task path: /etc/ansible/roles/netscaler/tasks/netscaler_enforce.yml:150
Monday 29 June 2020  15:36:35 +0000 (0:00:00.062)       0:00:58.630 ***********
Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/netscaler/citrix_adc_nitro_request.py
Pipelining is enabled.
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: myansible
<localhost> EXEC /bin/sh -c '/usr/bin/python2 && sleep 0'
failed: [my-hostname -> localhost] (item=DEFAULT) => {
    "ansible_loop_var": "item",
    "changed": false,
    "headers": {
        "Content-Type": "application/json",
        "X-NITRO-PASS": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
        "X-NITRO-USER": "mynsroot"
    },
    "http_response_body": "{ \"errorcode\": 1091, \"message\": \"Required argument value missing\", \"severity\": \"ERROR\" }",
    "http_response_data": {
        "cache-control": "no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
        "connection": "close",
        "content-length": "88",
        "content-type": "application/json; charset=utf-8",
        "date": "Mon, 29 Jun 2020 22:28:48 GMT",
        "expires": "Thu, 19 Nov 1981 08:52:00 GMT",
        "msg": "HTTP Error 400: Bad Request",
        "pragma": "no-cache",
        "server": "Apache",
        "status": 400,
        "url": "https://<IP_ADDRESS>/nitro/v1/config/sslcipher_sslvserver_binding/my-vserver",
        "x-frame-options": "SAMEORIGIN",
        "x-xss-protection": "1; mode=block"
    },
    "invocation": {
        "module_args": {
            "action": null,
            "args": null,
            "attributes": {
                "ciphergroupname": "DEFAULT",
                "cipheroperation": "REM",
                "vservername": "my-vserver"
            },
            "expected_nitro_errorcode": [
                0
            ],
            "filter": null,
            "instance_id": null,
            "instance_ip": null,
            "instance_name": null,
            "name": "my-vserver",
            "nitro_auth_token": null,
            "nitro_pass": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "nitro_protocol": "https",
            "nitro_user": "mynsroot",
            "nsip": "<IP_ADDRESS>",
            "operation": "delete",
            "resource": "sslcipher_sslvserver_binding",
            "timeout": 45,
            "validate_certs": false
        }
    },
    "item": "DEFAULT",
    "msg": "NITRO Failure",
    "nitro_errorcode": 1091,
    "nitro_message": "Required argument value missing",
    "nitro_severity": "ERROR"
}

Why does the first try say "Required argument missing [policyName, eccCurveName]"?  These two arguments are not documented in the sslvserver_sslcipher_binding resource.  What is the missing argument in the second try?
Thank you for any assistance you can provide.

Brian, have you found a solution for this issue?
FYI, I have just opened requests to add modules to create custom cipher lists and ssl profiles, by the way. Would rather have that than go the citrix_adc_nitro_request route. Had you implemented those on your own as well? Thanks!

@scarroll451, I have written an Ansible role using mostly Nitro REST API calls to handle the SSL ciphersuite creation, binding, unbinding, etc.  I have done it for both the service group (backend) and the virtual server (frontend).  I was tired of dealing with limited Ansible module support for the Citrix Netscaler SSL ciphers so I decided to use straight REST API calls.

Thanks. It's a shame to have us all reinvent the wheel, but perhaps a good exercise at the same time. I am opening RFEs for this and several others using our acct manager - we will see what happens. Thanks for the response!

On Dec 2, 2020, at 12:54 PM, Brian Long<EMAIL_ADDRESS>wrote:

@scarroll451, I have written an Ansible role using mostly Nitro REST API calls to handle the SSL ciphersuite creation, binding, unbinding, etc. I have done it for both the service group (backend) and the virtual server (frontend). I was tired of dealing with limited Ansible module support for the Citrix Netscaler SSL ciphers so I decided to use straight REST API calls.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

You need to use the delete_by_args operation with the citrix_adc_nitro_request module to delete the cipher.
See below for example:
- hosts: citrix_adc

  vars:
    max_clients: 5
  gather_facts: False
  collections:
    - citrix.adc

  tasks:
    - name: Setup binding
      delegate_to: localhost
      citrix_adc_nitro_request:
        nsip: "{{ nsip }}"
        nitro_user: "{{ nitro_user }}"
        nitro_pass: "{{ nitro_pass }}"

        validate_certs: no

        operation: delete_by_args
        resource: sslvserver_sslcipher_binding
        args:
          ciphername: DEFAULT
          vservername: test_ssl

You need to use the delete_by_args operation with the citrix_adc_nitro_request module to delete the cipher.
See below for example:
- hosts: citrix_adc

  vars:
    max_clients: 5
  gather_facts: False
  collections:
    - citrix.adc

  tasks:
    - name: Setup binding
      delegate_to: localhost
      citrix_adc_nitro_request:
        nsip: "{{ nsip }}"
        nitro_user: "{{ nitro_user }}"
        nitro_pass: "{{ nitro_pass }}"

        validate_certs: no

        operation: delete_by_args
        resource: sslvserver_sslcipher_binding
        args:
          ciphername: DEFAULT
          vservername: test_ssl

@brilong  - Could you confirm the above solution resolves your issue ?

@brilong  - Could you confirm the above solution resolves your issue ?


Auditing failures shouldn't cause functional failures

Currently, Inspektr asserts that its arguments not be null.  When these assertions fail, the action being audited fails.
Instead, failure in the audit trail system should not induce failure in the system being audited.  Failure should be logged and control return from the Aspect to the functional code wrapped.
Cf. Issue #13 , which helped but didn't go far enough.
Cf. https://groups.google.com/d/topic/cas-user/e2FRrJj0BFU/discussion

We had this problem in production system... With JASIG CAS server. One error during an @Audit method caused the AuditTrailManagementAspect to catch that original exception, which it should rethrow (and normally would), but as one of the resolvers couldn't actually obtain the correct information, the "executeAuditCode" method blew up with an exception and the original exception was totally forgotten.
I guess that in the methods "handleAuditTrail", we could change it to something more solid in terms of exception reporting.

I just created a pull request with a proposed solution.


Constructors in derived classes

Description 📜
I have explained about constructors in derived classes in c++.
Fixes #3332

Type of change 📝

[x] Documentation (Content Creation in the form of codes or tutorials)

Domain of Contribution 📊

[x] C/#CPP

Checklist ✅

[x] I follow Contributing Guidelines & Code of conduct of this project.
[x] I have performed a self-review of my own code or work.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] My changes generates no new warnings.
[x] I'm GWOC'21 contributor

Screenshots / Gif (Optional) 📸

@Saviour1001 please review my pr


To add working steps of Area and Perimeter of Tetradecagon

Is your feature request related to a problem? Please describe.
To add working steps of Area and Perimeter of Tetradecagon

Hi, I want to work on this issue I will start working on it as soon as I get assigned!! I am a part of GSSoC'21.
Kindly assign this issue to me!
Discord Username : Abhijeet Sinha(P)
Discord Tag: #4018


Enforce requiring API key to initialise notifier

Goal
Avoid instantiating the Notifier in an invalid state (without an API key).
Changeset
Changed

Nullability annotations on API
Gate all required methods in Bugsnag.m with a check to see if the notifier has been initialised, and NOP if not.
Avoid initialising notifier if the supplied API key is nil.
Attempting to set a non-nil API key as nil is ignored

Tests
Added a unit test for API key setter override.
Discussion
Much of the discussion for this changeset took place here: https://github.com/bugsnag/bugsnag-react-native/pull/237
Review

For the submitter, initial self-review:

[ ] Commented on code changes inline explain the reasoning behind the approach
[x] Reviewed the test cases added for completeness and possible points for discussion
[x] A changelog entry was added for the goal of this pull request
[x] Check the scope of the changeset - is everything in the diff required for the pull request?
This pull request is ready for:

[x] Initial review of the intended approach, not yet feature complete
[x] Structural review of the classes, functions, and properties modified
[x] Final review

For the pull request reviewer(s), this changeset has been reviewed for:

[ ] Consistency across platforms for structures or concepts added or modified
[ ] Consistency between the changeset and the goal stated above
[ ] Internal consistency with the rest of the library - is there any overlap between existing interfaces and any which have been added?
[ ] Usage friction - is the proposed change in usage cumbersome or complicated?
[ ] Performance and complexity - are there any cases of unexpected O(n^3) when iterating, recursing, flat mapping, etc?
[ ] Concurrency concerns - if components are accessed asynchronously, what issues will arise
[ ] Thoroughness of added tests and any missing edge cases
[ ] Idiomatic use of the language

By tests I mean, that configuration isValid works as expected and that you can't start bugsnag if that function returns false.

Added a test to BugsnagConfiguration to encapsulate the API key check.

@martin308 good catch with bugsnagStarted - I've altered this so that it checks a boolean property which is set to true when the notifier has been started, rather than checking for nil.
I have addressed all other inline feedback.


Optimize build and test all supported versions

What this PR does / why we need it:
For PRs, we are building containers 3x to test 3 flavors of Kubernetes.  Using artifacts, we should be able to build one time and test as many flavors as we want.
If applicable:

[ ] this PR contains documentation
[ ] this PR contains unit tests
[ ] added code adheres to standard Rust formatting (cargo fmt)
[ ] code builds properly (cargo build)
[ ] code is free of common mistakes (cargo clippy)
[ ] all Akri tests succeed (cargo test)
[ ] inline documentation builds (cargo doc)
[ ] version has been updated appropriately (./version.sh)

Should we test supported rust version too?

Should we test supported rust version too?

i don't think that this PR is the place for that, i think that belongs in rust workflow maybe?


No module named 'custom_components.afvalwijzer.const'

Issue
Starting HA version 2021.10.6, running in docker, receiving the following log error from afvalwijzer (in debug mode)
 File "/config/custom_components/afvalwijzer/sensor.py", line 16, in <module>
    from .const.const import (
ModuleNotFoundError: No module named 'custom_components.afvalwijzer.const'

It appears the afvalwijzer module is not being loaded for whatever reason.
Which version has the issue?
2021.11.02
What was the last working version?
Prior to HA upgrade, previous HA version was at least 1 year old
Anything in the logs that might be useful?
No response
Additional information
No response

I have the feeling it's related to your Docker config. Can you share your Docker run comand  or your Docker Compose content?

Here is my docker-compose. This was not changed when updating the HA version.
HA_Prod:
container_name: homeassistant
restart: unless-stopped
image: homeassistant/home-assistant:stable
network_mode: host
depends_on:
- "influxdb"
volumes:
- /mnt/docker_data/homeassistant_PROD/config:/config
- /etc/localtime:/etc/localtime:ro
user: 1000:999
command: '/config/run'
environment:
- UMASK=007

Thanks, it seems indeed to be looking fine. Can you try to reinstall the component via HACS?
You could also check whether /mnt/docker_data/homeassistant_PROD/config/custom_components/afvalwijzer/const/const.py  exists and has the correct security settings.

I don't use HACS, I do a manual install and I was missing a number of files, once you helped me to realize that I was missing /const/const.py I was able to fix it. Thanks for pointing me in the right direction.


mitmproxy has crashed!

when I run mitmweb, and open <IP_ADDRESS> with chrome, the problem happens.Here is the command I run:
$ ./dev
$ source ../venv.mitmproxy/bin/activate
(venv.mitmproxy)➜  mitmproxy git:(master) ./mitmweb
Warning: You are using mitmdump 0.11.4 with netlib 0.13.1. Most likely, that won't work - please upgrade!
mitmproxy has crashed!
Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy
Traceback (most recent call last):
File "/Users/guliping/work/mitmproxy/libmproxy/proxy/server.py", line 99, in handle
protocol_handler(self.conntype)(self, **conn_kwargs).handle_messages()
File "/Users/guliping/work/mitmproxy/libmproxy/protocol/http.py", line 989, in handle_messages
while self.handle_flow():
File "/Users/guliping/work/mitmproxy/libmproxy/protocol/http.py", line 1052, in handle_flow
wfile=self.c.client_conn.wfile
File "/Users/guliping/work/mitmproxy/libmproxy/protocol/http.py", line 341, in from_stream
req = http.read_request(
AttributeError: 'module' object has no attribute 'read_request'

As it says right there in the log:
Warning: You are using mitmdump 0.11.4 with netlib 0.13.1. Most likely, that won't work - please upgrade!

So, you need to fix that by upgrading mitmproxy to the same version as netlib.


Adding with hash text

Some important word need to be have in the page

[ ] I have read freeCodeCamp's contribution guidelines.
[ ] My pull request has a descriptive title (not a vague title like Update index.md)
[ ] My pull request targets the master branch of freeCodeCamp.
[ ] None of my changes are plagiarized from another source without proper attribution.
[ ] My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.
Closes #XXXXX

Tip 2 of the target text

Closed and Reopened this PR to attempt to resolve a specific Travis build failure.

Thank you for opening this pull request.
This is a standard message notifying you that we’ve reviewed your pull request and have decided not to merge it. We would welcome future pull requests from you.
Thank you and happy coding.