Routing

Hi,
i have a question, how kan i make a routing like this
seo url: abc-def-eeee-eeee this must goto the pagecontroller action front
I did this:
$router->add('[^a-zA-Z0-9-]+/', ['controller' => 'pages', 'action' => 'front']);
Also i have this kind of routings:
$router->add('chalets/prices', ['controller' => 'chalets', 'action' => 'showAllPrices']);
$router->add('chalets/prices-[^a-zA-Z-]+/', ['controller' => 'chalets', 'action' => 'showChaletPrices']);
Seo url: chalets/prices of chalets/prices-all or chaletname
Evertything goes to  chalets/prices i todd it is gona to chalets/showAllPrices thats is wat 1 want.
For blog i did this
$router->add('blog/[^a-zA-Z0-9-]+/', ['controller' => 'blog', 'action' => 'front']);
Working perfect!
I hope you can help me with the chalets routing issue
Thx

Define generic routes before registering actuals
$router->add('{controller}/{action}');
$router->add('chalets/{[^a-zA-Z0-9-]+/}/{action}', , ['namespace' => '<NAMESPACE_OF_your_chalets_controller']);

#22
Duplicate of #22

Hi cagcak,
Thanks for your reaction ;)
i'am not sure it is the same like #22 because in the action method i have mij routings vars.
I do this...
$router->add('chalets/price-{[^a-zA-Z0-9-]+/}/', ['action' => 'showChaletPrices',]);
The seo url is "chalets/price-the-name-of-the-chalet" then the action must be showChaletPrices
So i do not need the namespave because the controller is right, only i want a other action
The scripts wants to: ChaletsController->priceChaletAlmblick() OR  ChaletsController->priceChaletBelleNovaFrance()
How do i get the script to: ChaletsController->showChaletPrices
thx anyway

I think you are trying to make any route matches in child urls. But in
https://github.com/daveh/php-mvc/blob/dc047dfa7a5b99ceadcc18c4b3f31e5e1a45cd37/Core/Router.php#L33
routes are converted from string to regex.
It might need major changes in core router. Instead you may want to use add manually by automated for:
$router->add('parent-url/child-url/{controller}/{action}/{id:\d+}');
like below:
function addRouteToEnd($route, $controller, $action)
{
  $router = public/index.php
  $lines = file($router);
  $counter = 0;
  while ($counter < 2) {
    array_pop($lines); # removes the last element from an array
    $counter++;
  }
  $deleteDispatch = implode('', $lines);
  $addRoute = "";
  $addRoute .= "\$router->add('" . $route . "', ['controller' => '". $controller ."', 'action' => '".$action."']);\n";
  $addRoute .= "\n\$router->dispatch(\$_SERVER['QUERY_STRING']);";
  file_put_contents($router, array($deleteDispatch, $addRoute), LOCK_EX);
}

This method simply adds routes as lines into index.php you may use in your controller as a helper function:
addRouteToEnd('parent-url/child-url', 'ChildControllerFolder' .'\\'. ChildController, 'showSomething');
then after calling, it will appear in routing table as
$router->add('parent-url/child-url', ['controller' => 'ChildControllerFolder\ChildController', 'action' => 'showSomething']);
I hope it helps something.

I assume you didnt forget to add 'Action' suffix at the end

cagcak what you mean?

Controller classes contain methods that are the actions. To create an action, add the Action suffix to the method name. The sample controller in App/Controllers/Home.php has a sample index action.

When i do call the method in the controller Chalets to showChaletPricesAction it's still not working.
I think it is not posseble with this router and i must changed in the core.

please infrom me if that regex route work

Hello. I have a question about routing too. Can you help me?
I have a file filled with urls, controllers and actions (like this ), so can I loop through this file to add routes with $router->add() function? Thanks in advance and sorry for my English:)

Hi @qwersk,
yes, that would work, as long as you created the router object first, before you required the routes.php file. You could also use a foreach loop instead of a simple for loop:
foreach ($routes as $route => $result) {
   $router->add($url, ['controller' => $controller, 'action' => $action]);
}

Cheers,
Dave

@telemoes how you replaced the original router by AltoRouter? Can you explain or share your code with us?

@telemoes ok great, please do!

Hi
I want to route  to a controller's action with some parameters like Laravel:
Route::get('myRequest/{par1}/{par2}/{par3}', 'SomeController@SomeAction');
and in Controller:
public function SomeAction($par1,$par2,$par3,)
{
$id = $par1;
$gsID = $par2;
.... and so on for all your variables.
}
l wrote a route like this:
$router->add('{controller}/{action}/{name:[a-z]+}');
and in Home controller  the action is:
public function HelloName($name){
    $temp=["name"=>$name];
    View::renderTemplate('Home/index2.html',$temp);
}

when I get the route I get this error:
Uncaught exception: 'ArgumentCountError'
Message: 'Too few arguments to function App\Controllers\Home::HelloName(), 0 passed in ......\Core\Router.php on line 137 and exactly 1 expected'
could you help me where is wrong/

Hi,
the router doesn't work like that in this framework (at least not yet - I'm working on an update). If you add a route like this:
$router->add('{controller}/{action}/{id:\d+}');
the controller and action variables will be used to run the action method, and the id variable will be available in that action method in the route_params array, e.g.
$id = $this->route_params['id'];
Action methods don't take any arguments, all route parameters are passed like that.

I change the model a little bit ;)
`namespace App\Core;
use PDO;
use App\Models\Sys_log;
abstract class Model
{
/**
* primaryKey you can overrule this in de model class when you have a other primary key in your DB.
* @var string
*/
protected static $primaryKey = "id";
private   static $db = null;
public    static $queries = [];
public function __get($name)
{
    return $this->$name;
}

public function __set($name, $value)
{
    $this->$name = $value;
}

public function __isset($name)
{
    return array_key_exists($name, $this);
}

/**
 * Get object from $id
 *
 * @param int $id
 * @param boolean $format (false returns object)
 * @return mixed
 */
public static function find($id, $format=false)
{
    // Make model
    $modelName = get_called_class();

    // Get data
    $q = "SELECT * FROM `" . static::TABLE . "` WHERE `" . static::$primaryKey . "` = :id"
        . (static::DELETED === true ? " AND deleted_at IS NULL" : null);
    $stmt = self::$db->prepare($q);
    $stmt->bindParam('id', $id, PDO::PARAM_INT);
    $stmt->execute();
    $object = $stmt->fetchObject($modelName);
    return ($format === false ? $object : (array)$object);
}

/**
 * @param string $q
 * @param array $cols
 * @param bool $all
 * @return bool or Object or array
 */
public static function select($q, $cols=[], $all=false)
{
    self::getDB();
    try {
        $handler = self::$db->prepare($q);
        if ($cols) {
            foreach ($cols as $col => &$val) {
                if ($col != 'primaryKey') {
                    if (is_int($val)) {
                        $handler->bindParam($col, $val, PDO::PARAM_INT);
                    } elseif (is_null($val)) {
                        $handler->bindParam($col, $val, PDO::PARAM_NULL);
                    } elseif (is_bool($val)) {
                        $handler->bindParam($col, $val, PDO::PARAM_BOOL);
                    } else {
                        $handler->bindParam($col, $val, PDO::PARAM_STR);
                    }
                }
            }
        }
        $handler->execute();
        if ($all !== false) {
            $items = $handler->fetchAll(PDO::FETCH_ASSOC);
        } else {
            $modelName = get_called_class();
            $items = $handler->fetchObject($modelName);
        }
        self::$queries[] = [
            'query' => $q,
            'vars'  => (is_array($cols) ? implode(", ", $cols) : null),
            'time'  => date('d-m-Y H:i:s'),
        ];
    } catch (PDOException $e)
    {

    }

    return ($items ? $items : false);
}

/**
 * Delete record from DB.
 * @param string $cols
 * @return mixed
 */
public static function delete($cols)
{
    self::getDB();
    $first = true;
    $q = "DELETE FROM `" . static::TABLE . "` WHERE ";
    foreach ($cols as $col => $val) {
        $q .= ($first !== true ? " AND " : null);
        $q .= '`' . $col . '` = :' . $col;
        if ($first === true)
            $first = false;
    }
    $handler = self::$db->prepare($q);
    foreach ($cols as $col => &$val) {
        if (is_int($val)) {
            $handler->bindParam($col, $val, PDO::PARAM_INT);
        } elseif (is_null($val)) {
            $handler->bindParam($col, $val, PDO::PARAM_NULL);
        } elseif (is_bool($val)) {
            $handler->bindParam($col, $val, PDO::PARAM_BOOL);
        } else {
            $handler->bindParam($col, $val, PDO::PARAM_STR);
        }
    }
    $handler->execute();
    return $handler->rowCount();
}

/**
 * Save object to the database
 * @param bool $log
 * @param bool $returnObject
 * @return bool
 */
public function save($log=true, $returnObject=true)
{
    $now = date('Y-m-d H:i:s');
    $insert = false;
    if (!array_key_exists(static::$primaryKey, $this)) {
        $insert = true;
    }

    /**
     * when $insert = true then insert record
     * when $insert = false then update record
     */
    $q = null;
    if ($insert !== false) {
        $q = $this->insert();
        if (static::TIMESTAMPS === true) {
            $this->created_at = $now;
            $this->updated_at = $now;
        }
        if (static::USER === true && !empty(\Login::getUserId())) {
            $this->created_by = \Login::getUserId();
            $this->updated_by = \Login::getUserId();
        }
    } else {
        $q = $this->update();
        if (static::TIMESTAMPS === true) {
            $this->updated_at = $now;
        }
        if (static::USER === true && !empty(\Login::getUserId())) {
            $this->updated_by = \Login::getUserId();
        }
    }

    /**
     *  Run query
     */
    $id = null;
    try {
        $handler = self::$db->prepare($q);
        foreach ($this as $col => &$val) {
            if ($col != 'primaryKey') {
                if (is_int($val)) {
                    $handler->bindParam($col, $val, PDO::PARAM_INT);
                } elseif (is_null($val)) {
                    $handler->bindParam($col, $val, PDO::PARAM_NULL);
                } elseif (is_bool($val)) {
                    $handler->bindParam($col, $val, PDO::PARAM_BOOL);
                } else {
                    $handler->bindParam($col, $val, PDO::PARAM_STR);
                }
            }
        }
        $handler->execute();
        $key = static::$primaryKey;
        if ($insert === true) {
            $this->$key = self::$db->lastInsertId();
        }
        $handler = null;
        self::$queries[] = [
            'query' => $q,
            'time'  => $now,
        ];
        //  Log action
        if ($log === true && !empty(\Login::getUserId())) {
            Sys_log::logAction($this->$key, get_called_class(), ($insert !== false ? 'create' : 'edit'));
        }

        //  Return object
        if ($returnObject === true) {
            return self::find($this->$key);
        } else {
            return true;
        }
    } catch (PDOException $e)
    {

    }
    return false;
}

/**
 * @param array $result
 * @param string $sortByCol
 * @return array
 */
public static function keyBy($result, $sortByCol)
{
    if (empty($result)) {
        return false;
    }
    $array = [];
    foreach ($result as $key => $values)
    {
        if (array_key_exists($sortByCol, $values)) {
            $array[$values[$sortByCol]] = $values;
        }
    }
    return (count($array) ? $array : false);
}

/**
 * create insert query from object
 *
 * @return string
 */
private function insert()
{
    $values = $cols = null;
    $q = "INSERT INTO " . static::TABLE;
    foreach ($this as $col => $val) {
        if ($col != 'primaryKey') {
            $cols .= (strlen($cols) ? ", " : null) . "`" . $col . "`";
            $values .= (strlen($values) ? ", " : null) . ":" . $col;
        }
    }
    if (static::TIMESTAMPS === true) {
        $cols   .= ", `created_at`, `updated_at`";
        $values .= ", :created_at, :updated_at";
    }
    if (static::USER === true && !empty(\Login::getUserId())) {
        $cols   .= ", `created_by`, `updated_by`";
        $values .= ", :created_by, :updated_by";
    }
    $q .= "(" . $cols . ") VALUES (" . $values . ")";
    return $q;
}

/**
 * create update query from object
 *
 * @return string
 */
private function update()
{
    $first = true;
    $q = "UPDATE `" . static::TABLE . "` SET ";
    foreach ($this as $col => $val) {
        if (!in_array($col, ['primaryKey', 'id'])) {
            $q .= ($first !== true ? ", " : null);
            $q .= '`' . $col . '` = :' . $col;
            if ($first === true)
                $first = false;
        }
    }

    $q .= " WHERE `" . static::$primaryKey . "` = :" . static::$primaryKey;
    return $q;
}

/**
 * Get the PDO database connection
 *
 * @return mixed
 */
protected static function getDB()
{
    if (!empty(self::$db)) {
        return;
    }

    $dsn = 'mysql:host=' . getenv('DB_HOST') . ';dbname=' . getenv('DB_DATABASE') . ';charset=utf8';
    self::$db = new PDO($dsn, getenv('DB_USERNAME'), getenv('DB_PASSWORD'));

    // Throw an Exception when an error occurs
    self::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    return self::$db;
}

}`

Cool, thank you for sharing @telemoes!

i think there are something that can beter do you have comments?

A few things, yes - your __isset method is using array_key_exists, but if you want to see if a property exists on an object, (as opposed to a key in an array) you should use property_exists instead.
You've also got a few hardcoded things in there, that might be better passed as parameters, and you're repeating that block where you bind values in more than one method - it might be better to extract that out into a separate method for example.
Other than that, it all seems fine - you've got some good ideas in there to reduce your model code.
Sorry I don't have time for a more in-depth review of your code, I'm working on a major update to the codebase at the moment, and I might add something like this to the code if I think it's a good fit.
Thanks for your continued interest!

Hello, I have a weird routing issue. Below is the full list of routes
$router->add('', ['controller' => 'Home', 'action' => 'index']);
$router->add('home/index', ['controller' => 'Home', 'action' => 'index']);
$router->add('home/contact', ['controller' => 'Home', 'action' => 'contact']);
$router->add('services', ['controller' => 'Services', 'action' => 'index']);

In the views, I set the href attributes of  tags in the following manner:

After the first page load, every link routes directly to the set controller and executes the set action; however, after selecting a link that invokes a controller with/without other parameters, every next route selected now includes the the full url of the previous link clicked (excluding the last parameter) and the full url of the new link clicked.
For example, if the current url in address bar is localhost/php-mvc/home/index, clicking  routes to localhost/php-mvc/home/contact. Now clicking the services link would route to localhost/php-mvc/home/contact/services.
I need a way out. Also, the public folder is located in the root directory of the htdocs folder

@tej-kweku - it's because your links don't start with a slash, so they're relative to the folder they're in. If you start them with a slash:

then they'll be relative to the site's root and will work no matter what the current URL.

@daveh it also includes links that do not begin with backslashes.

'@daveh got it

@daveh Any update on when a new version of the course will come out? Eagerly awaiting.

@alturic Working on it as much as I can, but I am having various setbacks at the moment - no ETA I'm afraid but I'll be doing it as soon as I can! Thank you for your continued interest!


code error running colabfold_batch with custom templates

Hi,
First of all, I'd like to thank you for making freely available your software development.
The following command line:
colabfold_batch --templates --amber --num-relax 1 target.fasta --custom-template-path ./my_template results_dir
ends with the next error code lines:
Traceback (most recent call last):
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/bin/colabfold_batch", line 8, in
sys.exit(main())
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/colabfold/batch.py", line 2046, in main
run(
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/colabfold/batch.py", line 1562, in run
model_runner_and_params = load_models_and_params(
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/colabfold/alphafold/models.py", line 161, in load_models_and_params
params = get_model_haiku_params(
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/colabfold/alphafold/models.py", line 41, in get_model_haiku_params
return utils.flat_params_to_haiku(params, fuse=use_fuse, to_jnp=to_jnp)
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/alphafold/model/utils.py", line 102, in flat_params_to_haiku
P[scope][name] = jnp.array(array) if to_jnp else array
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/jax/_src/numpy/lax_numpy.py", line 2608, in array
out_array: Array = lax_internal._convert_element_type(
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/jax/_src/lax/lax.py", line 559, in _convert_element_type
return convert_element_type_p.bind(operand, new_dtype=new_dtype,
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/jax/_src/core.py", line 387, in bind
return self.bind_with_trace(find_top_trace(args), args, params)
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/jax/_src/core.py", line 391, in bind_with_trace
out = trace.process_primitive(self, map(trace.full_raise, args), params)
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/jax/_src/core.py", line 879, in process_primitive
return primitive.impl(*tracers, **params)
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/jax/_src/dispatch.py", line 86, in apply_primitive
outs = fun(*args)
ValueError: std::bad_cast
Alternatively, using as input an a3m alignment file, some other error lines are shown:
Traceback (most recent call last):
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/colabfold/batch.py", line 1496, in run
= generate_input_feature(query_seqs_unique, query_seqs_cardinality, unpaired_msa, paired_msa,
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/colabfold/batch.py", line 1022, in generate_input_feature
feature_dict = build_monomer_feature(
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/colabfold/batch.py", line 875, in build_monomer_feature
**pipeline.make_sequence_features(
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/alphafold/data/pipeline.py", line 40, in make_sequence_features
features['aatype'] = residue_constants.sequence_to_onehot(
File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/alphafold/common/residue_constants.py", line 580, in sequence_to_onehot
raise ValueError(f'Invalid character in the sequence: {aa_type}')
ValueError: Invalid character in the sequence: -
Please, some advice to fix the issue will be welcome. Thank you very much in advance.

raise ValueError(f'Invalid character in the sequence: {aa_type}')
ValueError: Invalid character in the sequence: -

It says that your input sequence target.fasta may contain an invalid character -. Please check your file first.

raise ValueError(f'Invalid character in the sequence: {aa_type}')
ValueError: Invalid character in the sequence: -

It says that your input sequence target.fasta may contain an invalid character -. Please check your file first.

Thank you for your prompt reply. As I was said, that error is coming from an a3m align file as input, knowing that file format contains '-' character for deletions.
Additonally, what about the code error I was reporting firtstcoming from using as input a fasta file (with no '-' at all, of course)?
Thank you so much in advance for your replies.

Ah, I missed there were two questions in your first comment. Sorry.
But,

File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/jax/_src/dispatch.py", line 86, in apply_primitive
outs = fun(*args)
ValueError: std::bad_cast

I have never encountered such an issue in localcolabfold. I have no idea about what caused this. Please check whether your input fasta is correct or the issue occurs in other fasta files.

Ah, I missed there were two questions in your first comment. Sorry. But,

File "/home/mario/Colabfold/localcolabfold/colabfold-conda/lib/python3.10/site-packages/jax/_src/dispatch.py", line 86, in apply_primitive
outs = fun(*args)
ValueError: std::bad_cast

I have never encountered such an issue in localcolabfold. I have no idea about what caused this. Please check whether your input fasta is correct or the issue occurs with other fasta files.

Unfortunately, the same error occurs with whatever fasta files as input.
Regarding the issue with the a3m file as input, any ideas that could help us to fix it? If you think that checking files I'm using could help, please don't hesitate to say me. I'll be glad to send them you. Thank you very much.


Rework main into examples

main.rs just functioned as a sandbox for trying out features. Almost all of the code in there was good to showcase how to use the library, but the "CLI" part of this crate was kind of useless. So I transformed the code in main.rs into a number of simple examples that can be executed with cargo run --example <name>. I did not keep everything in main.rs, but everything I felt was worth showcasing.

This change is

Review status: 0 of 9 files reviewed at latest revision, 1 unresolved discussion.

examples/add_rules.rs, line 71 at r1 (raw file):

    println!("Added a bunch of rules to the {} anchor.", ANCHOR_NAME);
    println!("Run this command to remove them:");
    println!("sudo pfctl -a {} -f /dev/null", ANCHOR_NAME);

Or sudo pfctl -a {} -F all

Comments from Reviewable

Review status: 0 of 9 files reviewed at latest revision, 2 unresolved discussions.

examples/enable.rs, line 22 at r1 (raw file):

    let mut pf = PfCtl::new().chain_err(|| "Unable to connect to PF")?;

    // Try to enable the firewall. Exuivalent to the CLI command "pfctl -e".

~Exuivalent~ Equivalent

Comments from Reviewable

Review status: 0 of 9 files reviewed at latest revision, 3 unresolved discussions.

examples/transaction.rs, line 61 at r1 (raw file):

    println!("Added a bunch of rules to the {} anchor.", ANCHOR_NAME);
    println!("Run this command to remove them:");
    println!("sudo pfctl -a {} -f /dev/null", ANCHOR_NAME);

-F all can be used to clear all rules

Comments from Reviewable

Review status: 0 of 9 files reviewed at latest revision, 4 unresolved discussions.

src/rule/mod.rs, line 97 at r1 (raw file):

        match (self.keep_state, self.proto) {
            (StatePolicy::None, _)
            | (StatePolicy::Keep, _)

Is it new rustfmt's thing now?

Comments from Reviewable

Reviewed 9 of 9 files at r1.
Review status: all files reviewed at latest revision, 4 unresolved discussions.

Comments from Reviewable

Absolutely loving it!

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

Comments from Reviewable

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

examples/add_rules.rs, line 71 at r1 (raw file):
Previously, pronebird (Andrei Mihailov) wrote…
Or sudo pfctl -a {} -F all

Awesome. Did not know about this. Fixed!

examples/enable.rs, line 22 at r1 (raw file):
Previously, pronebird (Andrei Mihailov) wrote…
~Exuivalent~ Equivalent

Done.

examples/transaction.rs, line 61 at r1 (raw file):
Previously, pronebird (Andrei Mihailov) wrote…
-F all can be used to clear all rules

Done.

src/rule/mod.rs, line 97 at r1 (raw file):
Previously, pronebird (Andrei Mihailov) wrote…
Is it new rustfmt's thing now?

Yup. When upgrading to 0.2.16 it did this change.

Comments from Reviewable

Reviewed 3 of 3 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.

Comments from Reviewable


Create An ISSUE TEMPLATE for this repo!

I see other repositories have an issue template for their repository. Create an issue template that can be used when raising issues here.
Most of all, be creative <3
Read the Docs.
Give a ⭐
Don't break anything. :)

Just asking if what do you think of this issue template here. If you like it, then I can work on this issue. Please assign it to me. thanks

@jfmartinz Yes, that's nice. Nice find. Sure if you would like to give it a go that would be great.

@jfmartinz Yes, that's nice. Nice find. Sure if you would like to give it a go that would be great.

Okay thanks


having to go through the "actions-> ..." stuff is also quite tedious, especially the paste

having to go through the "actions-> ..." stuff is also quite tedious, especially the paste, which is a 2-level action. Having a popup when selecting a document or multiple documents at the mouse-cursor or being able to right-click would be nicer, or maybe just even buttons at the top, since this is functionality you'll use a lot.

Have you considered a Move to action?

Select items
click Move To
pops up a folder browser allowing you to select the destination

Feels a bit more intuitive to me, especially if you are filing a large number of things from the inbox.
Drag and drop is less useful when you have multiple levels of folders.
PS. Love the project - is well on its way to becoming the best DMS out there...

PS. Love the project - is well on its way to becoming the best DMS out there...

Thank  you! It feels great to hear kind words!

Have you considered a Move to action?
Select items
click Move To
pops up a folder browser allowing you to select the destination

It never crossed my mind actually - maybe because it was shadowed by idea of cut/paste. I will open a new ticket to keep an eye on it (it is actually very easy to implement)

Right click menu was added. Will be available since next 2.0 release.
Here is a preview.


Issue with Installing Tink on Windows 10.0

I am trying to install tink on Windows 10, but keep getting an error about a dependent library maybe. "Bezel"
Tried downloading the windows installer for Bezel but it doesn't seem to install properly.

Hi @syedzubeen, Tink Python requires building Tink C++ on Windows which is currently not supported.
I am going to close this issue, please feel free to re-open it should you have any other questions/concerns.


Test and document Python 3.9 support

@amoffat Python 3.9 was released in October 2020. What do we need to update to test and a announce support for 3.9? I'm looking at .travis.yml, tox.ini, sh.py, setup.py and the front page of the docs. Anything else?

Hey Erik, thanks for staying up on this. I think that would cover it. Assuming the tests pass, we should be mostly good to go, code-wise. I like to run the tests on MacOS as well, but if you don't have access to a Mac machine, I can run them.

Hey Erik, thanks for staying up on this. I think that would cover it. Assuming the tests pass, we should be mostly good to go, code-wise. I like to run the tests on MacOS as well, but if you don't have access to a Mac machine, I can run them.


Offset day enabledness with 'Reset Offset'

I'd like to have untill 4am to finish my goals, so I put an 4h offset reset in the settings, but with midnight, the skills change to the next day ones. If I have a skill enabled in both days it resets correctly at 4am.
Would it be possible to either offset "day enabledness" with 'Reset Offset' setting, or make another offset setting for the day enabler check-boxes?

Yeah I think what can fix that is to have a checkbox that will align skill visibility settings with the reset offset. I'll get working on it.

Ok so there's now two checkboxes one for offsetting reset times and another for offsetting track patterns so if both the skill reset and track patterns boxes are checked it will offset days of the week by the same amount as the reset.


Add sunxspec_fitter to doc config

PR Description
Add sunxspec module and file to doc config so can see the built docs

Hi @samaloney.  This looks OK.  But why why are the doc tests failing?

It always seems to fail haven't found the time to track it down - especially as the RTD build works.

Since we are moving forward with a new fitting implementation I don't think its worth the effort to fix all the doc issue.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/fitter.py:docstring of sunkit_spex.sunxspex_fitting.fitter.Fitter:355: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/fitter.py:docstring of sunkit_spex.sunxspex_fitting.fitter.Fitter:353: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/fitter.py:docstring of sunkit_spex.sunxspex_fitting.fitter.Fitter.fit:5: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/fitter.py:docstring of sunkit_spex.sunxspex_fitting.fitter.Fitter.fit:2: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.CustomLoader:7: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.CustomLoader:16: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.NustarLoader:1: CRITICAL: Missing matching underline for section title overline.

----------
pha_file : string
        The PHA file for the spectrum to be loaded.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.NustarLoader:45: WARNING: duplicate object description of sunkit_spex.sunxspex_fitting.instruments.NustarLoader._construction_string, other instance in api/sunkit_spex.sunxspex_fitting.instruments.NustarLoader, use :noindex: for one of them
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.NustarLoader:51: WARNING: duplicate object description of sunkit_spex.sunxspex_fitting.instruments.NustarLoader._loaded_spec_data, other instance in api/sunkit_spex.sunxspex_fitting.instruments.NustarLoader, use :noindex: for one of them
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.RhessiLoader:1: CRITICAL: Missing matching underline for section title overline.

----------
pha_file : string
        The PHA file for the spectrum to be loaded.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.RhessiLoader:204: WARNING: duplicate object description of sunkit_spex.sunxspex_fitting.instruments.RhessiLoader._construction_string, other instance in api/sunkit_spex.sunxspex_fitting.instruments.RhessiLoader, use :noindex: for one of them
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.RhessiLoader:210: WARNING: duplicate object description of sunkit_spex.sunxspex_fitting.instruments.RhessiLoader._loaded_spec_data, other instance in api/sunkit_spex.sunxspex_fitting.instruments.RhessiLoader, use :noindex: for one of them
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/instruments.py:docstring of sunkit_spex.sunxspex_fitting.instruments.StixLoader:1: CRITICAL: Missing matching underline for section title overline.

----------
pha_file : string
        The PHA file for the spectrum to be loaded.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.chi2:1: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.chi2:10: CRITICAL: Unexpected section title.

Parameters
----------
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.chi2:15: CRITICAL: Unexpected section title.

Returns
-------
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.cstat_loglikelihood:6: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.cstat_loglikelihood:21: CRITICAL: Unexpected section title.

Parameters
----------
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.cstat_loglikelihood:26: CRITICAL: Unexpected section title.

Returns
-------
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.gaussian_loglikelihood:1: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.gaussian_loglikelihood:12: CRITICAL: Unexpected section title.

Parameters
----------
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/likelihoods.py:docstring of sunkit_spex.sunxspex_fitting.likelihoods.LogLikelihoods.gaussian_loglikelihood:17: CRITICAL: Unexpected section title.

Returns
-------
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.col2arr_py:16: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.col2arr_py:18: WARNING: Definition list ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:31: WARNING: Definition list ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:40: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:37: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:40: WARNING: Definition list ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:50: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:53: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:50: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:58: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:55: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:64: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:61: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/nu_spec_code.py:docstring of sunkit_spex.sunxspex_fitting.nu_spec_code.vrmf2arr_py:71: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/parameter_handler.py:docstring of sunkit_spex.sunxspex_fitting.parameter_handler.Parameters:52: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/parameter_handler.py:docstring of sunkit_spex.sunxspex_fitting.parameter_handler.Parameters:50: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/parameter_handler.py:docstring of sunkit_spex.sunxspex_fitting.parameter_handler.Parameters:64: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/parameter_handler.py:docstring of sunkit_spex.sunxspex_fitting.parameter_handler.Parameters:62: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/parameter_handler.py:docstring of sunkit_spex.sunxspex_fitting.parameter_handler.Parameters:79: ERROR: Unexpected indentation.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/parameter_handler.py:docstring of sunkit_spex.sunxspex_fitting.parameter_handler.Parameters:77: WARNING: Block quote ends without a blank line; unexpected unindent.
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/__init__.py:docstring of sunkit_spex.sunxspex_fitting:1: WARNING: duplicate object description of sunkit_spex.sunxspex_fitting, other instance in reference/index, use :noindex: for one of them
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/io.py:docstring of sunkit_spex.sunxspex_fitting.io:1: WARNING: duplicate object description of sunkit_spex.sunxspex_fitting.io, other instance in reference/index, use :noindex: for one of them
/Users/sm/Projects/sunkit_spex/sunkit_spex/sunxspex_fitting/photon_models_for_fitting.py:docstring of sunkit_spex.sunxspex_fitting.photon_models_for_fitting:1: WARNING: Inline emphasis start-string without end-string.
/Users/sm/Projects/sunkit_spex/docs/reference/sunxspex_fitter.rst:165:<autosummary>:1: WARNING: Inline strong start-string without end-string.


Add Chips to Search Functionality

Description
Add filter/suggestion chips to the Search Credentials/Badges page. The search functionality should include filter/suggestion chips that help the user find their badges or credentials quicker.

Motivation
Create a smooth search functionality with the option to access previous search results.
Requirements

[ ] Add functionality to "Me" - Search

Open Questions
No response
Are you planning to contribute this in a PR?
Yes

 Add Chips to Search Functionalit


Fix race condition imposed by Map interface

Describe the bug
CacheManagerFactory. CACHE_MAP should have type ConcurrentMap instead of Map.  This would allow the implementation to use the atomic ConcurrentMap.computeIfAbsent method when creating caches instead of Map.get and Map.put.

Thanks @azell, this sound as really good suggestion, I'll implement is ASAP and then put you as reviewer of the PR.
Thanks

@azell please find here the pull request: PR #50

I left a couple of comments in code review.  Please feel free to respond.

Thanks a lot for your suggestions, the changes have been applied. Can you please review the PR?

Deat @azell, the change has been implemented, you can find it on version 1.2.6.
Thanks for contributing


Added checkstyle and codeql.

What this PR changes/adds
Added checkstyle and codeql in workflows.
Example of failing workflow: https://github.com/agera-edc/RegistrationService/runs/7840323571?check_suite_focus=true
Why it does that
To detect checkstyle errors + have codeql running when creating PRs.
Further notes
Same PR as in IdentityHub, the difference is that the path to the suppress file is setup in order to ignore generated resources.
Linked Issue(s)
https://github.com/agera-edc/MinimumViableDataspace/issues/253
Checklist

[x] added appropriate tests?
[x] performed checkstyle check locally?
[x] added/updated copyright headers?
[x] documented public classes/methods?
[x] added/updated relevant documentation?
[x] added relevant details to the changelog? (skip with label no-changelog)
[x] formatted title correctly? (take a look at the CONTRIBUTING and styleguide for details)

FYI there are a few CodeQL warnings, they are not fixed in this PR because they will already be fixed by Iza's PR. After both PRs get merged I will double check that no warning is left.


Support for Zelotes C-12

I'd like to have support for the Zelotes C-12 gaming mouse. It has 9 customizable extra buttons on the side, a "+" and a "-" button to switch between 4 different DPI modes (customizable too I think) and highly customizable LEDs (RGB colors, brightness, blinking). Device drivers are available online but only for Windows. I could dump USB data if needed.
Here's the info from sudo lsusb -vd 12c9:1028:

Bus 003 Device 003: ID 12c9:1028 SOAI USB Gaming Mouse
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x12c9
  idProduct          0x1028
  bcdDevice            2.10
  iManufacturer           1 SOAI
  iProduct                2 USB Gaming Mouse
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x005b
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      71
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      1 Keyboard
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     117
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      32
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               4
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               4
Device Status:     0x0000
  (Bus Powered)

Since this mouse would require writing a new driver, let's close this until someone volunteers to write one. :)

Here's data from a USB sniffing tool: https://gist.github.com/darealshinji/57ec8b50dfa8faf41e170a86469358cf
You can especially see the 64 bytes data packet to change the color and brightness of the lights. But that's all I could figure out. Turning this into an actual driver is beyond my capabilities. Maybe someone with more experience could help me?


vis.js Network & Vue.js - not working properly

Hi,
I am using Vis Network with Vue.js and I created two very simple applications, but none of them is working properly.
1) The first app is here: https://jsfiddle.net/Filip_Z/9k2s3dgj/4/
The problem is that it cannot delete only the first node (with id=0). All of the other nodes can be deleted.

In the browser console there are no errors.
    Vue.component('ovs-network', {
        template: "#mytmp",
        data() {
            return {
                network: null,
                nodes: [
                    { id: 0, label: '0' },
                    { id: 1, label: '1' },
                    { id: 2, label: '2' },
                    { id: 3, label: '3' },
                    { id: 4, label: '4' }
                ],
                edges: [],
                options: {
                    manipulation: {
                        enabled: true,
                        initiallyActive: true,
                        deleteNode: function (deleteData, callback) {
                            callback(deleteData)
                        }
                    }
                },
                container: ''
            }
        },

        mounted() {
            this.container = document.getElementById('mynetwork');
            var data = {
                nodes: this.nodes,
                edges: this.edges
            };
            this.network = new vis.Network(this.container, data, this.options);
        }
    });

    const app = new Vue({
        el: '#app'
    });

2) The second app is here: https://jsfiddle.net/Filip_Z/3ead4r51/1/
The problem is that after applying the setData method, wrong labels are displayed. As you can see in the example, when you click on the button - this Vue method will be executed:
                updateData() {
                    var nodes = [
                        { id: 0, label: '0' },
                        { id: 1, label: '1' },
                        { id: 4, label: '4' }
                    ];

                    this.network.setData({ nodes: nodes, edges: []});
                    console.log('Updated!');
                    this.disabled = true;
                }

So there will be three nodes but, for some reason, all these nodes will have the same label: '4'.

In the browser console there are no errors.
Now, I'm not sure where the problem is (Vue or Vis).

I tried to remove Vue from your examples, and the first one still doesn't work as you expect, so I think it doesn't have anything to do with Vuejs.
Can't remove 0: https://jsfiddle.net/5zfsebqt/
My guess is that vis checks for truthy-ness in the ids, because if you use a string as the id, it works, and you can remove the node:
nodes: [
    { id: '0', label: '0' },
    { id: 1, label: '1' },
    { id: 2, label: '2' },
    { id: 3, label: '3' },
    { id: 4, label: '4' }
]

In the second example, it does actually work when you remove Vue
Updating the nodes works now: https://jsfiddle.net/oagjq7es/1/
but I'm not sure why.

Hope this helps.

Thank your for your interest in this project.
However, your issue is a usage/support question, and the issue tracker is reserved exclusively for bug reports and feature requests (as outlined in our Contributing Guide).
We encourage you to ask it on the forum  , Stack Overflow or on gitter and are happy to help you out there.

@danieldiekmeier Yeah,  the problem in the first example definitely has nothing to do with Vue. As for the second example - I'm also not sure why it doesn't work with Vue... without Vue everything works fine. Anyway, thanks.

FYI, I think this is an issue with vue.js, not simply a usage/support question. This is a possible duplicate of vis.js issue 2567.

@wimrijnders I looked at your issue and your analysis is correct - in short, it is not recommended to put complex objects with prototypal inheritance into Vue's data option (and making them reactive). Moving them out of data is the correct solution.

@yyx990803 Thank you very much for the confirmation, I really really appreciate it. I can use this to close off several issues we have running.
I'm all for a good understanding with maintainers of other projects. I truly hope more of them are as understanding as you. TIL to always be cooperative to other maintainers.
You made my day a little better; have a good one yourself!

@wimrijnders I looked at your issue and your analysis is correct - in short, it is not recommended to put complex objects with prototypal inheritance into Vue's data option (and making them reactive). Moving them out of data is the correct solution.

Temporary method，you can set Vue's data  to  window .
window.data = {
nodes: window.nodesVis,
edges: window.edgesVis,
};
window.network = new vis.Network(window.container, window.data,  window.options);


⚠ SceneTime has degraded performance

In d75a878, SceneTime ($ST) experienced degraded performance:

HTTP code: 200
Response time: 1588 ms

Resolved: SceneTime performance has improved in 9fe61e9 after 6 minutes.


Fix horizontal align of page form save buttons

Short description

This pr fixes the horizontal alignment of the page form save buttons and prevents horizontal scroll for very long page titles

Proposed changes

Specify alignment for the button row
Add overflow: ellipsis to page title
Specify word wrap-all behavior for the page order table to show long titles in multiple lines

Resolved issues

Fixes: #1516

Thanks, that works very well. However, Can you also add this to the forms for events and pois? :)

I added the same styling to the events, pois and push notification forms

Long names can cause some more issues in general, e.g. this is how long event names currently get displayed in the table. Should I open an issue for that?

The pr now additionally includes users, regions and languages


Suggestion - multiple instances, one database

As I understand it a gekko instance can only run one trading method.  At present if I wanted to use 2 trading methods I would have to run 2 completely separate instances of gekko each collecting it's own candle data?
Is it feasible/sensible to have the option of pointing a gekko instance at the database/candle files being generated by another? I suppose this is almost like doing a backtest against the database file but not exiting and continuing to monitor for new live data?? Or is there a plan to allow multiple trading methods to run within one instance?

Currently you just run multiple Gekko instances. Open for pulls!


Update ShadowService's serviceCanary

Shadowservice uses the same servicecanary rule named shadow-service-canary.
Controller update shaow-service-canary rule when ShadowService is changed.

Codecov Report

Merging #110 (fa845b3) into main (6335c01) will decrease coverage by 0.54%.
The diff coverage is 64.58%.

@@            Coverage Diff             @@
##             main     #110      +/-   ##
==========================================
- Coverage   77.50%   76.96%   -0.55%
==========================================
  Files          64       68       +4
  Lines        5308     5582     +274
==========================================
+ Hits         4114     4296     +182
- Misses        953     1043      +90
- Partials      241      243       +2

Impacted Files
Coverage Δ

emctl/cmd/client/command/mesh_install.go
8.87% <0.00%> (-2.25%)
:arrow_down:

emctl/cmd/client/command/mesh_reset.go
20.68% <0.00%> (-6.59%)
:arrow_down:

...ommand/meshinstall/shadowservice/customresource.go
33.33% <33.33%> (ø)

...client/command/meshinstall/shadowservice/deploy.go
45.65% <45.65%> (ø)

emctl/cmd/client/resource/customresource.go
79.36% <88.88%> (+7.14%)
:arrow_up:

...ent/command/meshinstall/shadowservice/rbac_spec.go
90.90% <90.90%> (ø)

...mmand/meshinstall/shadowservice/deployment_spec.go
95.89% <95.89%> (ø)

emctl/cmd/client/command/flags/flags.go
94.87% <100.00%> (+0.35%)
:arrow_up:

...command/meshinstall/meshingress/deployment_spec.go
97.95% <100.00%> (+0.24%)
:arrow_up:

.../client/command/meshinstall/controlpanel/deploy.go
50.70% <0.00%> (-1.41%)
:arrow_down:

... and 1 more

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 245967f...fa845b3. Read the comment docs.


Need to "export" BooleanConstant

in the init.py file

Is this still a problem in the latest release? It looks like we already do this:
https://github.com/oasis-open/cti-python-stix2/blob/master/stix2/__init__.py#L36


HTTP requests best practice

I am making a number of HTTP requests using the Request module. The responses from these requests need to be unzipped and written to a file in the order the URLs were in.
So far I have the following:
function download(urls, path) {
  return new Promise((resolve, reject) => {
    const tmpPath = path + '-tmp';
    const unzip = zlib.createGunzip();
    const output = fs.createWriteStream(tmpPath);

    _(urls)
      .map(request)
      .map(_)
      .parallel(5)
      .pipe(unzip)
      .on('error', (err) => { return reject(err); })
      .pipe(output)
      .on('finish', () => {
        fs.rename(tmpPath, path, (err) => {
          if (err) { return reject(err); }
          return resolve(path);
        });
      })
      .on('error', (err) => { return reject(err); });
  });
}

This works however I have a couple of questions about the implementation.

Is parallel the best option here? I guess there is a trade off between holding more data in memory or calling the URLs in sequence using flatMap. I am after speed so downloading in parallel and using a bit more memory is ok for me.
Is there any way to capture events on the request. If I was using request on its own I would have something like:

request(url)
  .on('response', (response) => {
    if (response.statusCode === 404) {
      return reject(...);
    }
  })
 .on('error', (err) => { return reject(err); });

Is there a way of listening for these events when using Highland?
Any advice greatly received.

Is parallel the best option here? I guess there is a trade off between holding more data in memory or calling the URLs in sequence using flatMap. I am after speed so downloading in parallel and using a bit more memory is ok for me.

Yep. That's the trade off. If you're after download speed, then parallel is the right thing to do here. Tune the parallelism factor as necessary.

Is there a way of listening for these events when using Highland?

Yes, but it's a bit more complicated. By default, doing _(request(url)) will already listen for the error event and propagate it correctly. But if you want to listen to multiple custom events, you'll need to write your own stream generator.
Something like this. Note that I'm not calling reject until fairly late in the pipeline, and I'm using through instead of pipe. It's generally more convenient to keep everything as a Highland stream for as long as possible, since Highland does nice things like error-propagation for you.
In this case, it's also important to call push(error) instead of reject(error) in getUrl, since otherwise, you will have rejected the promise but not stop the stream.
function getUrl(url) {
  return _((push, next) => {
    request(url)
        .on('response', (response) => {
          if (response.statusCode === 200) {
            push(null, _(response));
            push(null, _.nil);
          } else {
            push(new Error('...'));
            push(null, _.nil);
          }
        })
        .on('error', (err) => {
          push(err);
          push(null, _.nil);
        });
  });
}

_(urls)
    .map(getUrl)
    .parallel(5)
    .through(unzip)  // Using through instead of pipe to keep things a Highland stream.
    .stopOnError(reject)  // Stop the steam so that no new URLs are fetched.
    .pipe(output)
    .on('finish', ...)
    .on('error', reject);

Thank you. that is really useful.

If you use superagent rather than request it automatically converts http errors so they can be handled in an .errors block.

Thanks @svozza I will have a look at superagent.

@vqvu should getUrl call next() with the stream returned by request as this is what I need to be passed on. I don't need to pass the response event result down the stream so I omit that bit. I just need to be able to access it to potentially raise an error:
function getUrl(url) {
  return _((push, next) => {
      let data = request(url)
        .on('response', (response) => {
          if (response.statusCode !== 200) {
            push(new Error('...'));
            push(null, _.nil);
          }
        })
        .on('error', (err) => {
          push(err);
          push(null, _.nil);
        });

      next(data);
  });
}

So with this example it all works as expected apart from this part:
if (response.statusCode !== 200) {
  push(new Error('...'));
  push(null, _.nil);
}

I have confirmed this is getting called as I one of my test URLs returns 404, but the error here is not raised. It is generated later on by the unzip part.
Am I using next incorrectly?

Once you've redirected to another stream with next, calling push no longer works. That's why you don't see the 404. The response is an IncomingMessage, so you should be redirecting to that instead.
There was an error in the code that I originally posted. You either want to call flatMap(getUrl) in the pipeline
_(urls)
    .flatMap(getUrl)
    .parallel(5)
    ...

or change getUrl to redirect to the response instead of pushing it
if (response.statusCode === 200) {
  next(_(response));
} else {
  push(new Error('...'));
  push(null, _.nil);
}

Thanks, I will need to look into the difference between using map and flatMap in this instance and try to get my head around it.
One final query I have is that the finish event on the pipe(output) part is still called if there is an error earlier in the pipeline. Is there a way to 'break' out of the pipeline if an error has happened or should I have an external variable to flag an error and then refer to that in the finish event?
let error;

_(urls)
  ...
  .stopOnError(err => error = err;)
  ...
  .pipe(output)
  .on('finish', () => {
    if (error) return reject(error);
    ...
  })

It's probably easiest to just use that error variable.
On Oct 30, 2017 5:26 AM, "David Madden"<EMAIL_ADDRESS>wrote:

Thanks, I will need to look into the difference between using map and
flatMap in this instance and try to get my head around it.
One final query I have is that the finish event on the pipe(output) part
is still called if there is an error earlier in the pipeline. Is there a
way to 'break' out of the pipeline if an error has happened or should I
have an external variable to flag an error and then refer to that in the
finish event?
let error;
_(urls)
...
.stopOnError(err => error = err;)
...
.pipe(output)
.on('finish', () => {
if (error) return reject(error);
...
})
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/caolan/highland/issues/640#issuecomment-340403468,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGIyZeCkR5ejXfyXAiDO91xjKsH757Zwks5sxaRdgaJpZM4QKORb
.

Thanks for your help @vqvu, here are all the bits combined in case it helps anyone else:
function download (urls, path) {
  const tmpPath = path + '-tmp';
  const unzip = zlib.createGunzip();
  const output = fs.createWriteStream(tmpPath);

  const getUrl = url => {
    return _((push, next) => {
      request(url)
        .on('response', resp => {
          if (resp.statusCode === 200) {
            push(null, _(resp));
            push(null, _.nil);
          } else {
            push(new Error('Something went wrong'));
            push(null, _.nil);
          }
        });
    });
  };

  let error;

  return new Promise((resolve, reject) => {
    _(urls)
      .flatMap(getUrl)
      .parallel(5)
      .through(unzip)
      .stopOnError(err => error = err)
      .pipe(output)
      .on('finish', () => {
        console.log('finish');
        if (error) return reject(error);

        fs.rename(tmpPath, path, (err) => {
          if (err) { return reject(err); }
          return resolve(path);
        });
      })
      .on('error', reject);
  });
}


[BugFix] Throw exception when alter materialized view with invalid session variables

Fixes #27110
Fixes #26970
What type of PR is this:

[x] BugFix
[ ] Feature
[ ] Enhancement
[ ] Refactor
[ ] UT
[ ] Doc
[ ] Tool

Does this PR entail a change in behavior?

[ ] Yes, this PR will result in a change in behavior.
[x] No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

[ ] Interface/UI changes: syntax, type conversion, expression evaluation, display information
[ ] Parameter changes: default values, similar parameters but with different default values
[ ] Policy changes: use new policy to replace old one, functionality automatically enabled
[ ] Feature removed
[ ] Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

[x] I have added test cases for my bug fix or my new feature
[ ] This pr needs user documentation (for new or modified features or behaviors)

[ ] I have added documentation for my new feature or new function

Bugfix cherry-pick branch check:

[x] I have checked the version labels which the pr will be auto-backported to the target branch

[x] 3.1
[ ] 3.0
[ ] 2.5
[ ] 2.4

[FE Incremental Coverage Report]
:heart_eyes: pass : 9 / 9 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/catalog/Database.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/alter/AlterMVJobExecutor.java
5
5
100.00%
[]

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)

[FE Incremental Coverage Report]
:heart_eyes: pass : 9 / 9 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/catalog/Database.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/alter/AlterMVJobExecutor.java
5
5
100.00%
[]

[FE Incremental Coverage Report]
:heart_eyes: pass : 9 / 9 (100.00%)
file detail

path
covered_line
new_line
coverage
not_covered_line_detail

:large_blue_circle:
com/starrocks/catalog/Database.java
4
4
100.00%
[]

:large_blue_circle:
com/starrocks/alter/AlterMVJobExecutor.java
5
5
100.00%
[]

[BE Incremental Coverage Report]
:heart_eyes: pass : 0 / 0 (0%)


Datagrid: Various popovers get cut off depending on datagrid size and placement

Describe the bug
This is a list of datagrid issues related to the lack of smart popovers in the datagrid:

Filters: When the datagrid is to short, the filter popover overflows with the rest of the header/table content underneath the footer. This can be worked around by setting a min height on the datagrid.
Hideable Column Toggle: Depending on the height of the datagrid, the list of hideable columns can be shown above the fold
signposts / tooltips in rows can be clipped depending on the location and need to be manually set by the consumer to ensure onscreen and visible placement.

Expected behavior
After development of https://github.com/vmware/clarity/issues/1262#issuecomment-320699953 the issues with these popovers in datagrid should not occur.

One other issue that may already be solved: opening a filter on the first column can fall off the screen if the column is narrow.

Hey Alex, I don't think the issue you describe is already fixed. But, it should be fixed once I develop the fix for this issue.

@hippee-lee do you have it planned for release anytime soon?

Hi @sdurnov - I have one more item that needs to be done for the upcoming v1.0 release and then I will start on the smart popover enhancement that will address these issues.
I hope to start on it by end of this week or early next week.

Hey @JoshuaNitschke - thats one of the things the smart popover fix needs to address. For now, your best bet is to set a min height on the datagrid so that the filter popover doesn't overflow.

@hippee-lee but that won't help with 1st columns filter popup. Btw, this issue is for 2.0 now? Meaning it is planned to be released in half a year? This is bad news :(

Filters: When the datagrid is to short, the filter popover overflows with the rest of the header/table content underneath the footer. This can be worked around by setting a min height on the datagrid.

I don't agree this should be part of an enhancement ticket. I think it should be a bug because it worked in the previous version. You can test this in the Custom Filtering documentation page of v.0.13:
https://vmware.github.io/clarity/documentation/v0.13/datagrid/custom-filtering

The workaround of setting a min-height is not a feasible option for us, because we have filters that contain a datepicker. This means that we'd need a min-height of about 400px.
But another workaround is to set the overflow of the datagrid to visible:
.datagrid {
   overflow: visible;
}

This breaks lot of other things in grid. Like no scrolling.

this was nearly three months ago. has there been any updates on this?

@hachadwick please follow #3374 for the updates

We're having same problem and here's our fix in Clarity v1.1.0:
 // Fixed the horizontal scrolling problem of datagrid clr-datagrid {   overflow: auto;    }
`
// To make sure the filter can be fully displayed
.datagrid {
overflow: visible;
}
.datagrid-table {
position: static;
}
`
Also we added a directive to calculate min width of datagrid:
`
@Directive({
selector: 'clr-datagrid',
})
export class ClrDgMinWidth implements AfertViewInit {
constructor (
@Self() private readonly clrDatagrid: ClrDatagrid,
private readonly elRef: ElementRef,
private readonly renderer: Renderer2,
) { }
ngAfterViewInit () {
const columns = this.clrDatagrid.columns.toArray();
const minWidth = columns.length * 100;
[ '.datagrid', '.datagrid-footer' ].map( selector =>
this.elRef.nativeElement.querySelector(selector),
)
.filter(el => !!el)
.forEach(el => this.renderer.setStyle(el, 'min-widht', ${minWidth}px);
}
}
`

@windsonic is it working as you expect it to do? I see you are setting 'min-widht' on the last line

@windsonic is it working as you expect it to do? I see you are setting 'min-widht' on the last line

Hi Jinnie, I updated my comments. Please take a look.


Error using from_parameter

The code below errors out:
try:
    newsapi = NewsApiClient(api_key='my key')
    everything = newsapi.get_everything(q='bitcoin',from_parameter='2018-08-01',sources='us',language='en',page_size=100)
except Exception as e:
    print(e)

This is what the exception prints:

get_everything() got an unexpected keyword argument 'from_parameter'

I'm using Python3.6 on Ubuntu 16.04.

Looking through the code, I see the real parameter is "from_param". On the NewsAPI.org site they list an example using "from_parameter". This should be updated.  https://newsapi.org/docs/client-libraries/python

Hi @asebold ,
Thanks for pointing this out. As this is not actually an official library, I am not part of the NewsAPI team and do not manage the documentation. @News-API-gh, could you guys take a look at correcting this or if necessary, we can rename the param in the library ?
Thanks,
Matt

I think this issue can be safely closed for now as @News-API-gh already updated their documentation for keyword argument to from_param in the documentation

This is still not working. When I add the from_param I get the newsapi.newsapi_exception.NewsAPIException

This is still not working. When I add the from_param I get the newsapi.newsapi_exception.NewsAPIException

It would be helpful if you could give the traceback you got when trying to run it.

Yes, i found the issue. The news api does not let me filter older news with the free plan. Thank you, you can close the issue. On Mon 8. Jul 2019 at 16:49, Danish<EMAIL_ADDRESS>wrote:
This is still not working. When I add the from_param I get the newsapi.newsapi_exception.NewsAPIException
It would be helpful if you could give the traceback you got when trying to run it.
?You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.

Documentation Updated


Enforce unique test names using eslint. Closes #4124

Enforce unique test names using eslint. Closes #4124

@Jwaegebaert seems like you are having some merge conflicts, could you have a look please?

Merged manually, well done and thank you!


Can't reach Almond UI

Hi everyone,
I am having some trouble getting Almond to work. I have created the almond container with
docker run -d \
--name=almond \
--restart=unless-stopped \
--net=host \
-v /volume1/docker/almond/:/var/lib/almond-server \
-p 3000:3000 \
stanfordoval/almond-server:latest

I have also set up port forwarding routing 3000:3000 on my NAS (TCP/UDP).
The result is that NASip:3000 doesn't lead to the Almond UI. Not sure what I am doing wrong here?

You may want to verify that the container has started successfully by checking the almond logs.

this is my log
yarn run v1.19.1
$ node main.js
Unable to load crypto module: crypto will be disabled: Error: global.Olm is not defined
Frontend initialized in development mode
Failed to load translations: gt.loadTextdomainDirectory is not a function
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Cleaning up
Done in 11.47s.
Uncaught exception: SQLITE_ERROR: no such table: device
Error: SQLITE_ERROR: no such table: device
From previous event:
    at Object.selectAll (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:37:14)
    at _db.withClient (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:38:24)
    at withClient (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:54:12)
    at Object.withClient (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:244:24)
    at SQLDatabase.getAll (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:37:25)
    at SyncDatabase.getAll (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:327:28)
    at DeviceDatabase.start (/opt/almond/node_modules/thingengine-core/lib/devices/database.js:81:41)
    at open (/opt/almond/node_modules/thingengine-core/lib/engine.js:281:31)
    at modules.(anonymous function).start.then (/opt/almond/node_modules/thingengine-core/lib/engine.js:281:50)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
From previous event:
    at Engine.open (/opt/almond/node_modules/thingengine-core/lib/engine.js:310:12)
    at init (/opt/almond/main.js:41:19)
    at main (/opt/almond/main.js:66:19)
    at Object.<anonymous> (/opt/almond/main.js:95:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
yarn run v1.19.1
$ node main.js
Unable to load crypto module: crypto will be disabled: Error: global.Olm is not defined
Frontend initialized in development mode
Failed to load translations: gt.loadTextdomainDirectory is not a function
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Uncaught exception: SQLITE_ERROR: no such table: device
Cleaning up
Error: SQLITE_ERROR: no such table: device
From previous event:
    at Object.selectAll (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:37:14)
    at _db.withClient (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:38:24)
    at withClient (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:54:12)
    at Object.withClient (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:244:24)
    at SQLDatabase.getAll (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:37:25)
    at SyncDatabase.getAll (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:327:28)
    at DeviceDatabase.start (/opt/almond/node_modules/thingengine-core/lib/devices/database.js:81:41)
    at open (/opt/almond/node_modules/thingengine-core/lib/engine.js:281:31)
    at modules.(anonymous function).start.then (/opt/almond/node_modules/thingengine-core/lib/engine.js:281:50)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
From previous event:
    at Engine.open (/opt/almond/node_modules/thingengine-core/lib/engine.js:310:12)
    at init (/opt/almond/main.js:41:19)
    at main (/opt/almond/main.js:66:19)
    at Object.<anonymous> (/opt/almond/main.js:95:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Done in 3.00s.
yarn run v1.19.1
$ node main.js
Unable to load crypto module: crypto will be disabled: Error: global.Olm is not defined
Frontend initialized in development mode
Failed to load translations: gt.loadTextdomainDirectory is not a function
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Using Almond-NNParser at https://almond-nl.stanford.edu/en-US
Uncaught exception: SQLITE_ERROR: no such table: device
Error: SQLITE_ERROR: no such table: device
From previous event:
    at Object.selectAll (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:37:14)
    at _db.withClient (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:38:24)
    at withClient (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:54:12)
Cleaning up
    at Object.withClient (/opt/almond/node_modules/thingengine-core/lib/db/sqlite.js:244:24)
    at SQLDatabase.getAll (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:37:25)
    at SyncDatabase.getAll (/opt/almond/node_modules/thingengine-core/lib/db/syncdb.js:327:28)
    at DeviceDatabase.start (/opt/almond/node_modules/thingengine-core/lib/devices/database.js:81:41)
    at open (/opt/almond/node_modules/thingengine-core/lib/engine.js:281:31)
    at modules.(anonymous function).start.then (/opt/almond/node_modules/thingengine-core/lib/engine.js:281:50)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
From previous event:
    at Engine.open (/opt/almond/node_modules/thingengine-core/lib/engine.js:310:12)
    at init (/opt/almond/main.js:41:19)
    at main (/opt/almond/main.js:66:19)
    at Object.<anonymous> (/opt/almond/main.js:95:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Done in 2.94s.

That's strange, it failed to initialize the database, and then fails to start because the tables are not there.
I would start by wiping the mounted volume where the data is stored. I would then check permissions (incl. SELinux) on the mounted volume: both the directory and all the files need to be writable the user inside the container.

Ok, I'm not sure why this is happening but:
I created the folder from my root account mkdir almond, and checking the permission (ls -la) showed drwxr-xr-x+  2 root root  4096 Jan  6 12:52 almond
Note that all my other (working) containers have the same permission type.
Anyway, I executed chmod -R a+rw ./almond/ which made the permissions like drwxrwxrwx   2 root root  4096 Jan  6 12:52 almond
created the container, and voilà, can finally access the UI. Still, this feels quite weird because I never had to do anything like this for any other container

It is possible that your other containers run their process as the root user in the container. This is usually a bad idea so we don't do that.

I'm not sure tbh? What's the best way to check if that's the case, and why is it a bad idea to run as root? Please note that I am not an expert and I'm mostly learning by making mistakes and messing around with things

The issue is not what user you run the docker command as, but what user is inside the docker. That is, whether there is a USER directive in the Dockerfile, and what value is specifies. This is not something you can control as a user of a container, it's a design decision of the developer who writes the Dockerfile.
(As a user, you can learn the content of a Dockerfile with docker history, but you cannot change it, short of rebuilding the container).
Running as root inside the container is a bad idea for the same reason that running a daemon with root privileges is a bad idea, unless needed: any vulnerability in the daemon code is more easily exploited with elevated privileges.
Anyway, this is more of a general discussion at this point, and not a real issue, so I'm closing this.

Thanks for the help


Global history

As someone who browses the web breadth first, I would be very happy if I could keep a persistent history tree of everything, where new tabs are rooted in their parent tabs' history trees.

Interesting.
I thought about this when first designing the layout, and decided that it would get too cluttered too quickly. Lots of people regularly keep 50+ tabs open, and trying to lay them all out on one page wouldn't be as useful as working withing each tab.
Unless there's a lot of demand, I probably won't change this, although you're welcome to add it as an option yourself and submit a PR.
On a side note, I've been thinking of making a Visual History-esque mobile browser. As someone who browses the web breadth first, how would you like a mobile browser that ditches tabs altogether, and just has connected nodes on a canvas that you can zoom into, out of, and between?

I think the UI should stay almost exactly the same, with an an ellided link
for derived pages going to the parent tab's history tree. At least that's
how I imagined it. My ulterior goal is to archive this to make sense of my
history/browsing habits later.
As for mobile browsing - I tend to avoid it because switching between
things is a bit hard. I can certainly see how a tree UI would help me to
browse like a normal person, and therefore would help me to browse on my
phone, but I doubt I'm a representative example and phone are not very
practical for this mode of information binging ;-)
On 28 June 2016 at 19:09, Joel Gustafson<EMAIL_ADDRESS>wrote:

Interesting.
I thought about this when first designing the layout, and decided that it
would get too cluttered too quickly. Lots of people regularly keep 50+ tabs
open, and trying to lay them all out on one page wouldn't be as useful as
working withing each tab.
Unless there's a lot of demand, I probably won't change this, although
you're welcome to add it as an option yourself and submit a PR.
On a side note, I've been thinking of making a Visual History-esque mobile
browser. As someone who browses the web breadth first, how would you like a
mobile browser that ditches tabs altogether, and just has connected nodes
on a canvas that you can zoom into, out of, and between?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/joeltg/visual_history/issues/4#issuecomment-229133714,
or mute the thread
https://github.com/notifications/unsubscribe/AAA3ouIKWsZjW1biel2N_SILBb_q8QZcks5qQWNxgaJpZM4I_juZ
.


osxfuse failing

~$ brew cask install osxfuse
==> Downloading http://downloads.sourceforge.net/project/osxfuse/osxfuse-2.7.5/osxfuse-2.7.5.dmg
######################################################################## 100.0%
==> Note: running "brew update" may fix sha256 checksum errors
Error: sha256 mismatch
Expected: 9be5cc9c44c2211aacea6a35aea5d47fea82599e981f051f318201a637b43f72
Actual: 818a4b8bbcb50878a8b1b9f71b4274d242ab46bf860c74676e98dec1d0248821
File: /Library/Caches/Homebrew/osxfuse-2.7.5.dmg
To retry an incomplete download, remove the file above.

Care to submit a PR? It isn’t a complex fix, and we’re here to help.

This is due to sourceforge having problems, currently.


Adding rich text node edition

[ x] I agree to follow the Code of Conduct that this project adheres to.
[ x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
(not the same as #711 )

Is your feature request related to a problem? Please describe.
I am using drawio to create decision tree (xml parsed with python) where the node content may be display in a questionnaire, being able to have a richtext editor to update the node content would enable to have nicer looking content in the nodes
Describe the solution you'd like
Either;

clicking on the contextual menu "Edit Rich text" (a bit like edit link) that would show a modal box with rich text editor
on the panel, having a rich text tab

Describe alternatives you've considered
injecting data from HTML files but really not user friendly
Additional context
I seems that there is richtext js lib available such as https://quilljs.com/playground/ , would be great if one could be compatible

Thanks you for the label, is there anyway to do it via a plugin ? (I could check to get devs if it is possible to do it)

text text;html=1 satiable ？

@delcroip I developed a plugin just now. Would you like to try ? https://github.com/dzylikecode/drawio-plugin-markdown
feel free to come up with any suggestion :smile:


Build fails with missing ros-foxy-performance-test-fixture

I have been building the firmware for the ESP32 using instructions on this post: https://discourse.ros.org/t/micro-ros-porting-to-esp32/16101.  When I ran the command
ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32

the build failed with the error message:
...
Successfully installed catkin-pkg-0.4.23 docutils-0.16 empy-3.3.4 lark-parser-0.10.0 python-dateutil-2.8.1
executing command [sudo -H apt-get install -y ros-foxy-performance-test-fixture]
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ros-foxy-performance-test-fixture
ERROR: the following rosdeps failed to install
  apt: command [sudo -H apt-get install -y ros-foxy-performance-test-fixture] failed

Running the command sudo -H apt-get install -y ros-foxy-performance-test-fixture manually showed the same problem.  The zephyr host build also fails in the same way.  I guess that the package ros-foxy-performance-test-fixture has been removed from the ROS servers for some reason.
As I just want to work on my ESP32 board, and I guess the package ros-foxy-performance-test-fixture is not a 'must have', is there someway to temporarily remove the dependency on the package ros-foxy-performance-test-fixture?

Please check if you are updated with this PR: https://github.com/micro-ROS/micro_ros_setup/pull/208
In this PR you can see how to SKIP the installation of these packages because I guess that this can happen with some other.
An explanation for this situation can be found here: https://github.com/ament/ament_cmake/issues/285
If you don't mind I'm closing since this a ROS 2 dependency, please reopen if you can't solve the issue.

Thanks for the super quick reply :-)
Pulling the micro_ros_setup repo to get the new change didn't fix the problem so I stopped and deleted the docker container I'm using.  When I restarted the container and built again, the problem was solved.  There is probably a neater way to do this using ros deps but I'm able to get on with testing code on my ESP32.  Thanks again.

BTW, if you are targetting ESP32, I suggest you trying also the standalone IDF component for micro-ROS: https://github.com/micro-ROS/micro_ros_espidf_component


CRD is left behind when uninstalling Istio

Install / uninstall release-1.0 and you are left with a rbacconfigs.config.istio.io CRD leftover instead of clean state. Steps to reproduce:

Install release-1.0 with:

helm install install/kubernetes/helm/istio --name istio --namespace istio-system

Uninstall it:

helm delete istio --purge

Get leftovers CRDs:

kubectl get crd -n istio-system

NAME                          CREATED AT
rbacconfigs.config.istio.io   2018-07-14T16:39:38Z

Fixed by #7125


[WIP] Bind context to query function provided to resolvers

Why is this WIP @timleslie Looks good - Do you need to test more?

Needs testing and changeset and testing :-)


Default value null does not match type selector in component godrays

core:schema:warn Default value 'null' does not match type 'selector' in component 'godrays'
Get this warning on scene load, even when I seemingly am not using the godray attribute, which I'm assuming you don't have to use?
(Aframe version 0.5.0)

Yes this is ok, won't affect operation. The godrays component needs an entity to act as the center of the radial blur. By default I set it to null and the schema parser whines when the component is registered. I'll see if that can be silenced but doesn't affect operation in any case and you don't have to use godrays.
On a unrelated note how do you use effects with 0.5.0, it's missing the functionality required. Maybe you mean current aframe master?


Proposal to add a more sophisticated eslint ruleset

Hi all,
I have two improvements regarding the eslint ruleset, currently generated by this generator:

I would propose to change the rule config from integers to string. Currently it says:
{
"block-scoped-var": 1
}

Based on the eslint documentation, the 1 can be replaced with warn, which is easier to understand.

And more importantly, I would propose to add some more rules. There are quite important ones missing, from my point of view. For example the eqeqeq rule (link).
And I think as IE11 isn't supported any longer we can add eslint rules that enforce code that can't be executed by IE11 without transpilation. For example the no-var rule (link).

I've provided a PR with a changed ruleset. As this is a very important matter, we should propably discuss the changed rules. Maybe the proposed ruleset is too strict. But it can serve as a basis for a discussion.
I think we have the chance to help developers create more readable, more maintainable source code. So I would really love to have a more sophisticated ruleset. What do you guys think?
Best regards
Lukas

Hi @lboehm,
Thanks for the PR. I am all for the suggested rule changes. Let's hear what the other think about it 🤗

@IObert @vobu @petermuessig Do you guys have any thoughts about a stricter ESLint ruleset in general and the PR in particular?

i'm biased on this: personally, i like to SM me by tightening code-time rulesets (and git commit message, btw) 🤕 😆 .
but i also learned that not all developers are equally pain-resistent.
based on this i'd suggest:

full +1 for refactoring int-style rulesets to their plain counterparts, e.g. blocked-scope-var: 1 → blocked-scope-var: "warn"
+1 for dropping IE11 artifacts. it's 2022 now anyway 😄
ruleset changes:

max-lines: understandable, but reality bites. there are more likely valid use cases for larger controller files than not (think operating the OData v4 model programmatically, ugh). change to warn?
no-var: i'd drop this one as using var instead of let is a style thingie that's ok from my POV
no-plusplus: i use this all the time 😨 and also don't see a reason to enforce this with error. probably warn?
object-shorthand: i'm all for it, but i know that @codewarrior is still hesitant introducing ES6 only codesamples/recommendations until the UI5 codebase goes ES6 only
dot-notation: this i'd recommend to take out as iterating over an array and dynamically calling functions from entries in that array is perfectly fine IMO. think intentionally producing async side effects in message-based architectures: arr.forEach(el => el["asyncFnName"]())
semi should definitely be dropped. it's become a question of team/project rule rather than a necessity. JS is fine with not using ";" anymore, and ASIs help w/ edge cases.

you're probably going to hate me for this, but what about sorting the rules by name? it'll be easier to follow-up long-term...

my €.02, best, v.

Hi @vobu
sorry for the late response, I had a busy time. Thanks a lot for your answer, this really helps.
Here's my response to your comment:

ruleset changes:

max-lines: understandable, but reality bites. there are more likely valid use cases for larger controller files than not (think operating the OData v4 model programmatically, ugh). change to warn?

Done.

no-var: i'd drop this one as using var instead of let is a style thingie that's ok from my POV

I think this is more than just a style thingie, as variables can't be shadowed when using let or const. So I think that's a quite useful rule, but if you still think it should be removed let me know.

no-plusplus: i use this all the time 😨 and also don't see a reason to enforce this with error. probably warn?

Okay, I've gone too far with this one 😃 If you like, we can remove this one completely.

object-shorthand: i'm all for it, but i know that @CodeWarrior is still hesitant introducing ES6 only codesamples/recommendations until the UI5 codebase goes ES6 only

I think customers can switch to ES6, even if SAP is still working on moving SAPUI5 to ES6. So from my perspective this rule would make sense. Nevertheless I've removed it.

dot-notation: this i'd recommend to take out as iterating over an array and dynamically calling functions from entries in that array is perfectly fine IMO. think intentionally producing async side effects in message-based architectures: arr.forEach(el => el["asyncFnName"]())

Removed it.

semi should definitely be dropped. it's become a question of team/project rule rather than a necessity. JS is fine with not using ";" anymore, and ASIs help w/ edge cases.

Removed it.

you're probably going to hate me for this, but what about sorting the rules by name? it'll be easier to follow-up long-term...

Haha no that's alright. I've done it 🙂

I've updated the PR #31, as described above. Please let me know if I should really remove the no-var rule. I didn't touch this one, because of the shadowing mentioned above.
Best regards
Lukas

I commented the PR with some thoughts and I feel the influence of @vobu => semi! Basically, with the UI5 tooling we can allow to write the JS applications in modern JS and due to the skipped support for IE11 we can also use most of the modern JS language features and APIs. So in general, for this purpose it is good to update also the lint rules. One thing which may be problematic is the usage of the template for older releases of SAPUI5 for which still IE11 support is listed in the PAM. Most probably we do not need to support this here and they may use the older version of easy ui5.

@petermuessig Thanks a lot for reviewing 🙂 I will check the Object spread syntax and we'll wait for @matz3 regarding ecma script version. Then I will update the PR.

No problem. Unfortunately, I missed to join the discussion here - sorry, I am always late to the parties. But I will try to chat with @matz3 tomorrow also tackling the object spread topic. Thanks for your work here! 👍

Hi @petermuessig, did you get some information regarding the object spread topic? 🙂

Yes, see my comment in the PR. @matz3 also replied there. We are good to go with ES2020 which is supported by the UI5 tooling >=2.9.x but ES2021 require UI5 Tooling >=3.0.0-alpha.


fix(tauri): mac ipc added to connect-src CSP

Fixes #494 and discovered its also why the auto updater doesn't flag an update is available