consider introduce ToT approch in langchain🐱🐱

Feature request
https://arxiv.org/pdf/2305.10601.pdf
Motivation
Language models are increasingly being deployed for general problem-solving across a wide range of tasks, but are still confined to token-level, left-to-right decision-making processes during inference. This means they can fall short in tasks that require exploration, strategic lookahead, or where initial decisions play a pivotal role. To surmount these challenges, there is a new framework for language model inference, “Tree of Thoughts” (ToT), which generalizes over the popular “Chain of Thought” approach to prompting language models and enables exploration over coherent units of text (“thoughts”) that serve as intermediate steps toward problem-solving. ToT allows LMs to perform deliberate decision-making by considering multiple different reasoning paths and self-evaluating choices to decide the next course of action, as well as looking ahead or backtracking when necessary to make global choices.
Your contribution
maybe, not sure😥

Seems to me one of the most, if not THE most powerful method of querying an LLM so far. The results from the paper are just staggering. I definitely vote for this to get implemented. 👍

Also, this paper:
https://arxiv.org/pdf/2305.08291.pdf

If this will get implemented here, one idea of improving this concept even further would be the introduction of a hierarchy of trees. The first level would contain a tree of rough, big steps, then each leaf of the tree would then be composed of smaller steps  (a sub-tree). It's kind of a recursive idea: trees within trees within trees up to the granularity that a single LLM can handle.
So you would first decompose the problem into larger, more general steps / trees (level one), then take each of those general steps and decompose them further into more specific, detailed steps (level two), and so on, until you reach a level of granularity that the language model can handle effectively.
With this approach, maybe even larger, more complex problems could be solved.

If this will get implemented here, one idea of improving this concept even further would be the introduction of a hierarchy of trees. The first level would contain a tree of rough, big steps, then each leaf of the tree would then be composed of smaller steps (a sub-tree). It's kind of a recursive idea: trees within trees within trees up to the granularity that a single LLM can handle.
So you would first decompose the problem into larger, more general steps / trees (level one), then take each of those general steps and decompose them further into more specific, detailed steps (level two), and so on, until you reach a level of granularity that the language model can handle effectively.
With this approach, maybe even larger, more complex problems could be solved.

Ive been trying to get a dynamic tree structure that includes checking for prompt injection and 'sanitizing' user prompts when and where possible. theres no exact agent schema that is good for langchain to do this out of the box, but i'm using a combination of the authoriarian dialogue and planner chains to try and accomplish it

I started working on ToT described in the second paper mentioned here by @whatworksdigital. I'm not ready to open a pull request but you're welcome to take a look and tell me if I'm on the right track.
https://github.com/vadimgu/langchain/blob/ToT/langchain/chains/tot/base.py

I'm having trouble finding a test-case scenario for testing and demo. Can someone advise me on this?

I was looking into ToT but I really don't think that this would be the silver bullet we're after.  Consider that you want your agent/chain to act as a general assistant and  be able conversationally to recognize what it has to do and use the tools provided I believe that usage of ToT will not remove much of the detailed context you need to give it in order to explain what is the thought it needs to do. I am now thinking about constructing something like the Thought/Action/Action Input but some how to create a state machine of possible actions and for each action I will have details tools and and possible next states and leave the LLM to figure out what paths it needs to take across the branches of the SM tree and implement one or another task, essential taking out a little bit of it creativity but specifying a stricter tree of paths so it can do less bad improvisations. But I am still thinking about.

I'm having trouble finding a test-case scenario for testing and demo. Can someone advise me on this?

Hi @vadimgu, first of all, really looking forward to seeing your ToT implementation when you get it going. Thank you.
Secondly, and I don't know if this helps, or if I'm just stating the obvious, but the paper mentioned testing it on Soduko puzzles but didn't provide much detail.

Maybe I am also stating the obvious, but the second paper has an associated GitHub page:
"Our implementation of the ToT-based Sudoku solver is available on GitHub: https://github.com/jieyilong/tree-of-thought-puzzle-solver."

I finally was able to use a 4x4 sudoku just like in the paper.

With a rule-based checker, the ToT software can be viewed as a hybrid system which allows explicitly encoding prior knowledge (e.g. the Sudoku rules) into a neural network powered system.

A Sudoku puzzle is a problem that is well-suited for the ToT method. However, I don't thin that the ToT method is a one-size-fits-all solution for all types of problems.

Here is another repository that implements Tree of Thought(s).
https://github.com/kyegomez/tree-of-thoughts

Here is another repository that implements Tree of Thought(s).
https://github.com/kyegomez/tree-of-thoughts

Thanks. I started implementing in LangchainJS, bist still not quite familiar with the architecture. Will share if succeed. My thoughts so far:
Thought Generator Executor with its own prompt and parser.
Thought Evaluation Executor with its own prompt and parser.
Orcherstrating Executor

Here is another repository that implements Tree of Thought(s).
https://github.com/kyegomez/tree-of-thoughts

Thanks. I started implementing in LangchainJS, bist still not quite familiar with the architecture. Will share if succeed. My thoughts so far: Thought Generator Executor with its own prompt and parser. Thought Evaluation Executor with its own prompt and parser. Orcherstrating Executor

The backtracking itself probably should be done by a simple classic algorithm.

Here is another repository that implements Tree of Thought(s).
https://github.com/kyegomez/tree-of-thoughts

Thanks. I started implementing in LangchainJS, bist still not quite familiar with the architecture. Will share if succeed. My thoughts so far: Thought Generator Executor with its own prompt and parser. Thought Evaluation Executor with its own prompt and parser. Orcherstrating Executor

The backtracking itself probably should be done by a simple classic algorithm.

I was thinking actually to change my code to generate the whole tree first internally in the Executor and then to apply an algorithm on the already generated data and also provide the whole generated tree as public if the dev would like to apply their own algorithm

Here is another repository that implements Tree of Thought(s).
https://github.com/kyegomez/tree-of-thoughts

Thanks. I started implementing in LangchainJS, bist still not quite familiar with the architecture. Will share if succeed. My thoughts so far: Thought Generator Executor with its own prompt and parser. Thought Evaluation Executor with its own prompt and parser. Orcherstrating Executor

The backtracking itself probably should be done by a simple classic algorithm.

I was thinking actually to change my code to generate the whole tree first internally in the Executor and then to apply an algorithm on the already generated data and also provide the whole generated tree as public if the dev would like to apply their own algorithm

That might lead to too many branches. Not sure. If you look at the tree plot in the paper, they seem to abandon leafs that are not likely to lead to results. So there seems to be some pruning at every stage. Not sure. It’s a search algorithm BY two LLMs. One generates the leaves and the other one evaluates them. Breath first or depth first.

I finally was able to use a 4x4 sudoku just like in the paper.

With a rule-based checker, the ToT software can be viewed as a hybrid system which allows explicitly encoding prior knowledge (e.g. the Sudoku rules) into a neural network powered system.

A Sudoku puzzle is a problem that is well-suited for the ToT method. However, I don't think that the ToT method is a one-size-fits-all solution for all types of problems.

Can you provide me with an example where you used your TOT approach, please. I'm quite keen to test it and also contribute to this feature.

any update info? thanks!

I continue working on ToT. I had to add the concept of a thought generation strategy in order to overcome the issue of generating the same output. These strategies ensure that the language model generates diverse and non-repeating thoughts, which are crucial for problem-solving tasks that require exploration and strategic lookahead.

Sample thoughts from a Chain-of-Thought (CoT) prompt.

This strategy works better when the thought space is rich, such as when each thought is a paragraph. Independent and identically distributed samples lead to diversity, which helps to avoid repetition.

Propose thoughts using a "propose prompt".

This strategy works better when the thought space is more constrained, such as when each thought is just a word or a line. Proposing different thoughts in the same prompt completion helps to avoid duplication.
I'm testing it all and will be updating the PR in a few days.

I continue working on ToT. I had to add the concept of a thought generation strategy in order to overcome the issue of generating the same output. These strategies ensure that the language model generates diverse and non-repeating thoughts, which are crucial for problem-solving tasks that require exploration and strategic lookahead.

Sample thoughts from a Chain-of-Thought (CoT) prompt.
This strategy works better when the thought space is rich, such as when each thought is a paragraph. Independent and identically distributed samples lead to diversity, which helps to avoid repetition.

Propose thoughts using a "propose prompt".
This strategy works better when the thought space is more constrained, such as when each thought is just a word or a line. Proposing different thoughts in the same prompt completion helps to avoid duplication.

I'm testing it all and will be updating the PR in a few days.

Would it be a good idea to generalize that any node in any data structure of thoughts can itself be another thought strategy  - the thought strategy could be a langchain primitive and could be used to give agents different ways to explore problem and solution spaces at the individual node level and would be recursively evaluated with some configurable depth limit so each node has a computable output. With this model each of your chain of thought strategies could just be high level variants of thought strategies.

@vadimgu I checked your repo. It's nice ! Are you blocked ? would you like some help ?

@fabricehong Thanks reaching out an offering your help. If you have the time, I would be grateful if you could review my pull request. Additionally, if you have any specific areas or aspects you would like to focus on, please let me know.
I find the ToT (or my implementation of ToT) being very difficult to use and I struggle to find an interesting use case.

I forked your repo and will try to adapt it to a personal use case. After that I'll be able to make a more valuable review. I sent you a mail in case we need to discuss
Cheers

landed in #5167!


feat: cache github actions

Description
This PR helps to cache all the github actions and significantly reduce the time required to install dependencies.
Fixes #2447
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

[ ] New feature (non-breaking change which adds functionality)
[x] Optimization (back-end change that speeds up the code)
[ ] Bug fix (non-breaking change which fixes an issue)

Key checklist:

[x] No style issues: $ pre-commit run (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
[x] All tests pass: $ python run-tests.py --all
[x] The documentation builds: $ python run-tests.py --doctest

You can run unit and doctests together at once, using $ python run-tests.py --quick.
Further checks:

[x] Code is commented, particularly in hard-to-understand areas
[x] Tests added that prove fix is effective or that feature works

Thank you for taking this up, @deepeshaburse! I took a quick look over the changes -
We primarily wanted to cache non-pythonic macOS and Linux dependencies (as mentioned in the issue) -
https://github.com/pybamm-team/PyBaMM/blob/f1b53d4e3881c71f93e08484357329de6c9137f8/.github/workflows/test_on_push.yml#L58-L77
which I think this PR is not meant for? (Or are you planning to push some more commits to this PR?)
Caching Python packages will also definitely result in a speed-up, and this PR can very well target caching only pythonic dependencies!

I checked workflows and building process and it took under 10 mins to setup dependencies every time. Thought the issue would get solved by this PR. But I misunderstood the issue. Would you prefer me to make a separate PR for those changes or just commit changes to this one? Thanks for the review!

You can push commits to this PR itself, should be okay to have all the cache stuff in one PR.

@deepeshaburse these might help -

https://github.com/awalsh128/cache-apt-pkgs-action for the ubuntu dependencies (apt)
https://stackoverflow.com/a/65056232/14746647 for the MacOS dependences (brew)

The first one looks straight forward, but you might have to experiment a bit with the MacOS one.

@deepeshaburse any progress with this?

Hi @Saransh-cpp, I'll get back on this, somehow missed your comment where you gave the resources for reference. I wasn't sure of how to move forward previously.

Hi @deepeshaburse, let us know if you require some help on this!

Hi @Saransh-cpp, I'm not able to find time to fix this. Please unassign this issue, I don't want to squat on an issue that someone else could maybe solve. Sorry for the inconvenience!

I may pick up from where they left off and start trying for the remaining apt and brew dependencies. It seems like there isn't a reliable solution for brew so the best bet is to cache either the Brewfile or its related folders (/usr/local/Homebrew).

Thanks for working on this, @deepeshaburse!
@agriyakhetarpal you can take over. cherry-pick-ing the commits of this PR in a new PR should include (and acknowledge) the already made contributions. I'll close this PR.


RHBPMS - 2449 - XStream marshaller can't be configured with NameCoder, RHBPMS-2569 - addJaxbClasses method should be deprecated

@etirelli in case you find a bit of time would be good to have your opinion on these two (skip the optaplanner as that is only to fix the tests... an attempt)

@psiroky @ge0ffrey could you please take a look at this commit as it seems it fixed the issue with optaplanner tests failing recently in kie server https://github.com/droolsjbpm/droolsjbpm-integration/pull/629/commits/bb6692fd38682dab02f7c666836d531af729806f

Looks ok - I presume that the XStream implementation still registers the Score Converters out-of-the-box? Score is an optaplanner class, much like String and Joda's LocalDate, etc. Users shouldn't need to add annotations to make it xstream nicely through the specialized ScoreXStreamConverters.

@ge0ffrey all stays as it was, it was just split into separate methods so the can be overloaded by custom implementation.
Thanks for review @ge0ffrey

+1 - the custom implementation will need to register those ScoreXStreamConverters itself (and it might register alternative implementations).

+1, I like the approach.

thanks @etirelli @ge0ffrey merged manually


Feature request: Execution Plan Viewer

🚀 Feature Request
Motivation
The execution plan holds all the information required for the engine server (legend-engine) to execute a query. With this viewer, we plan to shed some light on the context of the execution plan and showcase to the user the steps taken to execute their queries to provide the data in the shape they want it.
Since the execution plan holds various types of nodes for different types of queries and data sources, it is not feasible to inaugurate a user interface covering all use cases. For this reason, this feature will be implemented in steps. We will cover basic relational, model-to-model cases in the beginning and lead up to more advanced use cases. For the nodes not supported we will default to a basic JSON string viewer.
Implementation
As mentioned above we will tackle the viewer through phases. When creating the viewer for each phase, the steps will be similar to adding support for a new packageable element except there is no need for transformation as the execution plan viewer is a readonly UI for now. Therefore to add support please follow the below steps.

[x] Add V1_ExecutionPlan models (#248)
[x] Add V1 serializer/de-serializer support to convert from/to raw JSON and V1_ExecutionPlan Models (#248)
[x] Add metamodel ExecutionPlan models (#248)
[x] Add Execution Plan builder converting V1_ExecutionPlan protocol to ExecutionPlan metamodel (and potentially vice versa so we can do more testing) (#248)
[ ] Use the metamodel ExecutionPlan to create a viewer. Using the metamodel execution plan will provide you with the compiled metamodel graph to be able to quickly find referenced elements in the graph such as classes, mappings, and runtimes.
[ ] For each node, we should be able to view both in JSON mode and form mode

Phase 1 - Relational Mapping - Simple Projection with H2 Database
Execution Plan
See Attached Execution Plan Json
ExecutionPlan_Phase_1.txt
Pure Grammar
Database model::Test
(
 Table FirmTable
 (
   id INTEGER PRIMARY KEY,
   Legal_name VARCHAR(200)
 )
 Table PersonTable
 (
   id INTEGER PRIMARY KEY,
   firm_id INTEGER,
   firstName VARCHAR(200),
   lastName VARCHAR(200)
 )

 Join FirmPerson(PersonTable.firm_id = FirmTable.id)
)

###Pure
Profile model::MyExtension
{
 stereotypes: [important];
 tags: [doc];
}

Enum model::IncType
{
 Corp,
 LLC
}

Class <<model::MyExtension.important>> {model::MyExtension.doc = 'This is a model of a firm'} model::Firm extends model::LegalEntity
[
 validName: $this.legalName->startsWith('_')
]
{
 employees: model::Person[1..*];
 incType: model::IncType[1];
 employeeSize() {$this.employees->count()}: Number[1];
}

Class model::LegalEntity
{
 legalName: String[1];
}

Class model::Person
{
 firstName: String[1];
 lastName: String[1];
}

###Mapping
Mapping model::NewMapping
(
 *model::Firm: Relational
 {
   ~primaryKey
   (
     [model::Test]FirmTable.id
   )
   ~mainTable [model::Test]FirmTable
   legalName: concat([model::Test]FirmTable.Legal_name, '_LTD'),
   employees[model_Person]: [model::Test]@FirmPerson
 }
 *model::Person: Relational
 {
   ~primaryKey
   (
     [model::Test]PersonTable.id
   )
   ~mainTable [model::Test]PersonTable
   firstName: [model::Test]PersonTable.firstName,
   lastName: [model::Test]PersonTable.lastName
 }

 MappingTests
 [
   test_1
   (
     query: |model::Firm.all()->project([x|$x.legalName, x|$x.employeeSize, x|$x.employees.firstName, x|$x.employees.lastName], ['Legal Name', 'Employee Size', 'Employees/First Name', 'Employees/Last Name']);
     data:
     [
       <Relational, SQL, model::Test,
         'Drop table if exists FirmTable;\n'+
         'Drop table if exists PersonTable;\n'+
         'Create Table FirmTable(id INT, Legal_Name VARCHAR(200));\n'+
         'Create Table PersonTable(id INT, firm_id INT, lastName VARCHAR(200), firstName VARCHAR(200));\n'+
         'Insert into FirmTable (id, Legal_Name) values (1, \'FirmX\');\n'+
         'Insert into PersonTable (id, firm_id, lastName, firstName) values (1, 1, \'John\', \'Doe\');\n'
       >
     ];
     assert: '{"columns":["Legal Name","Employee Size","Employees/First Name","Employees/Last Name"],"rows":[{"values":["FirmX_LTD",1,"Doe","John"]}]}';
   )
 ]
)

🚒


Update dev_box

Updating to

UWP Workload
Azure workload
Windows Template Studio
disabling hyper-v and WSL since choco would throw errors

Thanks Clint!  I'll test it.  If more people can try this as well and provide feedback that is much appreciated.

i do believe we should add Code back in and i would like to do for future scripts break stuff apart so you can pick and choose.

Would also like to see common scripts so you can pick an choose.  Otherwise we're going to have a lot of duplication across this repo.
https://github.com/Microsoft/windows-dev-box-setup-scripts/issues/2

damn it, if continue to do stuff, it looks like it is pulling that diff

reset this now ....


Add Netlify / Cypress integration

https://github.com/cypress-io/netlify-plugin-cypress
https://glebbahmutov.com/blog/test-netlify/

I'd like to add Percy, I have setup an account.
https://docs.percy.io/docs/cypress


nvidia geforce/nforce drivers problems clash

Godot version:
godot engine 3.1 rc3
OS/device including version:
windows 7 x64
nividia nforce 430a/geforce 6150se
Issue description:

Steps to reproduce:
just import or create new proyect and edit
Minimal reproduction project:

update: installing the oficial video card drivers of nvidia and not windows update drivers. fix the problem

Closing then, as the problem comes from nvidia.


#define ⇒ enum?

Would you like to replace more defines for constant values by enumerations to stress their relationships?

ENTRY_ERROR_…
VMM_…

Would love too. You up for providing a PR? Both of those files are compiled by both C++ (GCC, Clang) but also by the OS driver compilers (i.e. GCC, Visual Studio), so keep a couple things in mind:

The enums need to compile in all of the different environments
They need to remain 64bit ints (we type cast based on the compiler).

But yeah, anything to remove more macros is a plus 😄

I gave this a shot and there are two issues that I ran into.

GCC/G++ wants to use "int" for enums, so 0x8xxxxxxxxxxxxxxxLL.... does not work as it's really defined as 64bit int. To fix this issue we would need to redefine the error codes which I don't want to do at the moment
GCC/Nmake specifically don't like the use of LL literals in the kernel which makes it difficult to set the error codes the way they are. Currently we use a cast to get around this which we cannot use in an enum definition

#define makes the most sense for now until we can come up with a better solution to works across all of the compilers for both userspace and the kernel. That being said... if there are any other uses of #define that we can get rid of, I would love to entertain possible solutions.


Make it easier to scale the databases associated with the pipeline

I need to come back and fill in what this actually means.

Oh hey we did this!


Precalculated hashes

Hi tessil,
we are working on a research database which uses radix clustering. Here, we first hash a value, determine a partition accordingly, and then create a hash table for each partition.
Since we already calculated a hash for the partitioning, I was wondering why there is no insert method that supports precalculated hashes.
Am I overseeing something or has there just not been a reason to implement yet?
Besides that, I really dig your work here on GitHub. Keep it up!

Hello,
The main reason is mainly, as you said, that there was no reason to implement it. I didn't have the need for it in my projects and nobody asked for it.
The second reason is that when I added the precalculated hash for lookup functions, I didn't add it to the insert functions because it's a bit more dangerous. If the user provides a wrong hash for the value, the map may end up in an undefined state, a value may end up in a bucket where it doesn't belong.
Though I will see if I can add it and leave the responsibility to the user to provide the correct hash.
I'm currently in holiday for the next few weeks so I'll not be able to check the issue more deeply and do the implementation before my return.

Hi,
First of all thank you very much for your project and excellent support.
It was me that requested precalculated hash support for lookup some time
ago. I am happy to inform that we had excellent experience with that
feature and that is why I submitted P0920 proposal for the next ISO C++
Committee meeting (http://wg21.link/p0920 - the link should become active
in a few days fron now).
Also just FYI, based on your excellent work I submitted a
http://wg21.link/P0919 that was already accepted for C++20.
Thank you very much for your continous support for the C++ Community!
Best
Mat
niedz., 16 wrz 2018, 13:20 użytkownik Thibaut<EMAIL_ADDRESS>napisał:

Hi,
I created a branch with the changes by adding the following methods:

std::pair<iterator, bool> insert(const value_type& value,
std::size_t precalculated_hash)
std::pair<iterator, bool> insert(value_type&& value, std::size_t
precalculated_hash)
template<class P, typename
std::enable_if<std::is_constructible<value_type, P&&>::value>::type* =
nullptr> std::pair<iterator, bool> insert(P&& value, std::size_t
precalculated_hash)

To avoid some conflicts with template void insert(InputIt
first, InputIt last), I had to add some restrictions on InputIt.
I have to think a bit to see if I'll merge this change to the master as
I'd like to avoid too much API bloat. But you can already try and see if
there is some performance improvements with the precalculated hash.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/Tessil/hopscotch-map/issues/38#issuecomment-421748033,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAe5lJK7-64gfGZL4eOPrtXqX6uJoOZKks5ubjPwgaJpZM4V78gC
.

Hello,
Thank you very much for your kind words and for the work done for these proposals.
Note that if P0919 is implemented you could do better than the alternative mentioned in section 4 of P0920. The following code could work even in a multi-threaded context without any branching:
template<typename T>
class hash_cache {
public:
    hash_cache(const T& value, std::size_t hash): m_value(value), m_hash(hash) {
    }

    std::size_t hash() const {
        return m_hash;
    }

    friend bool operator==(const T& lhs, const hash_cache& rhs) {
        return lhs == rhs.m_value;
    }

    friend bool operator==(const hash_cache& lhs, const T& rhs) {
        return lhs.m_value == rhs;
    }

private:
    const T& m_value;
    std::size_t m_hash;
};

template<typename T>
class hash {
public:
    using transparent_key_equal = std::equal_to<>;

    std::size_t operator()(const hash_cache<T>& v) const {
        return v.hash();
    }

    // For insertions or normal lookups
    std::size_t operator()(const T& v) const {
        return std::hash<T>()(v);
    }
};

int main() {
    const std::string str = "Potential long string.";
    const std::size_t hash_value = std::hash<std::string>()(str);

    std::unordered_map<std::string, int, hash<std::string>> map;
    map.find(hash_cache<std::string>(str, hash_value));
}

It's not as clean and easy as having the extra hash parameter, but it can be an interesting option if the proposal doesn't go through.

Hi,
Even though I think it is an abuse of transparent lookup, it is so
interesting and out-of-the-box that I like it ;-)
Thanks!
Mat
wt., 9 paź 2018 o 21:11 użytkownik Thibaut<EMAIL_ADDRESS>napisał:

Hello,
Thank you very much for your kind words and for the work done for these
proposals.
Note that if P0919 is implemented you could do better than the alternative
mentioned in section 4 of P0920. The following code could work even in a
multi-threaded context without any branching:
templateclass hash_cache {public:
hash_cache(const T& value, std::size_t hash): m_value(value), m_hash(hash) {
}
std::size_t hash() const {
    return m_hash;
}

friend bool operator==(const T& lhs, const hash_cache& rhs) {
    return lhs == rhs.m_value;
}

friend bool operator==(const hash_cache& lhs, const T& rhs) {
    return lhs.m_value == rhs;
}
private:
const T& m_value;
std::size_t m_hash;

};
templateclass hash {public:
using transparent_key_equal = std::equal_to<>;
std::size_t operator()(const hash_cache<T>& v) const {
    return v.hash();
}

// For insertions or normal lookups
std::size_t operator()(const T& v) const {
    return std::hash<T>()(v);
}

};
int main() {
const std::string str = "Potential long string.";
const std::size_t hash_value = std::hashstd::string()(str);
std::unordered_map<std::string, int, hash<std::string>> map;
map.find(hash_cache<std::string>(str, hash_value));

}
It's not as clean and easy as having the extra hash parameter, but it can
be an interesting option if the proposal doesn't go through.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Tessil/hopscotch-map/issues/38#issuecomment-428314606,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAe5lGQhgCfdJK2ExC1uI1h4oO29Y1K7ks5ujPTVgaJpZM4V78gC
.

I'll close the issue for now but if someone really need to possibility to use precalculated hashes for insertion, feel free to comment, I may reconsider the possibility to add it in the master branch.


Remove matomo

Building of the newest buildkit tag is broken without this and I just tested this PR and everything builds as expected.


[StyleCop] Fix all the warnings on TemplateManager.Tests

Add trailing comma
Fix spacing

Replaced with #1499


Update logging.md

Proposed changes that explain how to use dependency injection using ILogger in the different classes with Azure Application Insights.
Summary
Describe your changes here.
Fixes #Issue_Number (if available)

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

Hi @ravi16a87
I understand the reasoning for this pull request, but I believe it is better suited in the Azure repo instead.
I'm going to close this PR, but please consider proposing changes similar to this in the Azure Application Insights docs. https://github.com/MicrosoftDocs/azure-docs

Hi @IEvangelist , Thank you for your time. I appreciate your comments.


Minified image doesn't retain the platform information from the original image

From Fredrik Svensson on Slack:

I'm using multiarch/qemu-user-static to generate/run armhf images on an amd64 host.
So the original image has platform=linux/arm/v7 but the generated image gets platform=linux/amd64.
docker-slim works fine, the image is possible to run although docker complains the architecture is wrong
when running on the armhf device. Is  there some way to set platform for the image as you can do
with docker build --platform=linux/arm/v7?

Hi, @kcq
Any update here? We are having same issues as well! :)


OpenAPI handler: Passing API Key via query parameters + generate sdk issues

Is there a way to pass API Key via query parameters without having to create a resolver myself?
Here is a sandbox as example: https://codesandbox.io/s/angry-goldwasser-qsen0
If you run the example graphql query from above, you'll get a 401 (unauthorized) because qs parameters are not being added to the REST request.
In the same sandbox, if you try to generate the sdk by running yarn generate-sdk ./out.ts you get the error bellow.
I didn't investigate the issue in detail, but could be related to something similar to this post.
TypeError: Cannot read property 'length' of undefined
    at hasConditionalDirectives (/sandbox/node_modules/@graphql-codegen/visitor-plugin-common/index.cjs.js:479:20)
    at transformed._processor.transformPrimitiveFields.Array.from.map.field (/sandbox/node_modules/@graphql-codegen/visitor-plugin-common/index.cjs.js:2597:32)
    at Array.map (<anonymous>)
    at SelectionSetToObject.buildSelectionSetString (/sandbox/node_modules/@graphql-codegen/visitor-plugin-common/index.cjs.js:2596:112)
    at getPossibleTypes.reduce (/sandbox/node_modules/@graphql-codegen/visitor-plugin-common/index.cjs.js:2527:41)
    at Array.reduce (<anonymous>)
    at SelectionSetToObject._buildGroupedSelections (/sandbox/node_modules/@graphql-codegen/visitor-plugin-common/index.cjs.js:2517:80)
    at SelectionSetToObject.transformSelectionSet (/sandbox/node_modules/@graphql-codegen/visitor-plugin-common/index.cjs.js:2637:30)
    at SelectionSetToObject.buildSelectionSetString (/sandbox/node_modules/@graphql-codegen/visitor-plugin-common/index.cjs.js:2590:89)
    at getPossibleTypes.reduce (/sandbox/node_modules/@graphql-codegen/visitor-plugin-common/index.cjs.js:2527:41)

@coradinibr Generating SDK without operations is still experimental so does the error remain when you provide your own operations for SDK(this would be more consistent for production usages)?

@ardatan, in the sandbox I provided, the Open Weather OpenAPI file has a get(200,404) operation defined (not custom).
As extra validation to your point, I created a mocked json schema and added a custom operation as test, then tried to generate the sdk again. Same error! Easy to reproduce by forking the example provided in graphql-mesh page here + add your custom operation, then try run generate-sdk.
Providing own operations for production makes total sense, but I can envision use cases where respecting the OpenAPI schema as defined by the downstream service won't be unsafe by any means.
[IMPORTANT]
I think this github issue should be split in 2 independent issues, but I guess would be better to have someone more knowledgeable to reproduce the sdk issue before creating a new issue. Thanks!

Is this issue still remaining?
We recently released a new version of OpenAPI handler including a lot of new features and improvements.
I think you can pass additional query parameters with queryParams or headers with operationHeaders.
See the migration guide and the docs;
https://www.graphql-mesh.com/docs/migration/openapi-0.31-0.32
Closing this issue for now. We can reopen it later if the issue still happens.

Can anyone provide an example of passing an API_KEY using the .meshrc.yaml file using either the queryParams or operationHeaders, nothing I've tried to date works and I end up with Failed to generate the schema GraphQLError: Enum "HTTPMethod" cannot represent value: "SERVERS". In the previous version which had the header directive it was straightforward and simple, but I can't use the above directive to pass a simple API key...

@rmccorkl Please create a new issue with a reproduction on CodeSandbox or StackBlitz.


Prefer Cayuga over Alemany in SF

Beta tester feedback:

Consider routing on Cayuga instead of Alemany where appropriate. Not sure there's really a heuristic here besides local knowledge, but fairly chill side street with sharrows arguably beats fast dangerous street with unprotected sometimes-disappearing bike lane

Example origin/destination pair:

Something like 1 South Van Ness -> 92 Ottawa Ave (bike only routing, with transit is obviously going to use the 14 on Mission). Personally, I'd take Cayuga there instead of Alemany, though obviously that's a personal preference and others might do something else. They were talking about making Cayuga a slow street but it's been in perpetual limbo

Alemany between Lyell and Ottawa is a highway=primary, cycleway=lane while Cayuga is highway=residential, but no cycleway value set. For one block approaching Geneva, Alemany's bike lane used to disappear, which the router did notice (since this screenshot was taken, SFMTA restriped that block and filled the gap):

Cayuga has little traffic in my experience, but I don't know how our router would programmatically know that. I'm not sure if preferring highway=residential, cycleway unset, over highway=primary, cycleway=lane, would be the right call.
~If Cayuga were a Slow Street, motor_vehicle=destination might make us prefer it.~ Update: as of 2024, Cayuga is a Slow Street, but Slow Streets are no longer officially restricted to local traffic only.
We could consider programming in the SFMTA Recommended Bike Routes map in some way, which includes Cayuga as recommended; this seems to only be able as a PDF, not GeoJSON or similar in DataSF, though we could ask SFMTA for a machine-readable version.

Alemany has the following relevant tags:

cycleway:right=lane
highway=primary
maxspeed=35 mph

Since there's tags describing cycling infrastructure, the cycling infrastructure penalty takes precedence over the highway penalty. lane receives a penalty of PREFER (2.0).
Cayuga has the following relevant tags:

highway=residential
maxspeed=25 mph
motor_vehicle=destination

There's no tags describing cycling infrastructure, but there are tags describing the road, so the highway penalty takes precedence. highway=residential receives a penalty of SLIGHT_PREFER (2.5).
For a potential solution, I don't think we should always prefer ways based solely on cycling infrastructure. For example, we could use a hybrid mechanism to penalize a road like Alemany. For example, if a way has mediocre cycling infra but is on a major thoroughfare then it should be assessed a higher penalty, and vice versa; if a way has sharrows but limits cars, then it could be rewarded with a lower penalty.

Hybrid mechanism sounds good.
I'm not confident that there's a general rule here. Some residential streets might still have fast traffic. Preferring residential streets might have the side effect of more difficult crossings (busy arterial at 2-way stop) which we don't take into account..


useDateRangePicker commits selection when updating popover placement

🐛 Bug Report
A bit of background...I'm attempting to create a DateRangePickerField that appears as two conjoined fields rather than a single field with two values inside.  When selecting a date range via the picker we want the calendar popover to shift its alignment to the edge of the field being selected.  So when selecting the startDate (!state.anchorDate) we align bottom start and when selecting the endDate (state.anchorDate !== null) we align bottom end.
Video of desired behavior:
https://user-images.githubusercontent.com/6694194/216640373-88344f3e-48a8-4483-bc2f-e93b1c5f6644.mov
This technically works, meaning the placement is indeed updated when state.anchorDate changes.  However, this results in the popover moving during pointerDown and thus the pointer is over a different element on pointerUp so it seems the hook is treating this as if the user did a drag selection on the range.  The popover is immediately closed and the field is populated with a range despite the user only pressing on a startDate.
I've managed to work around it by waiting to update placement after a 150ms timeout but that feels like a magic number and fragile.
🤔 Expected Behavior
I'd expect to be able to update placement without it being treated as a drag.
😯 Current Behavior
Updating placement is treated as a drag.
💁 Possible Solution
Not sure!

🔦 Context
See video
💻 Code Sample
I've updated the Tailwind example to reproduce the issue.
https://codesandbox.io/s/loving-cohen-sb0iyf?file=/src/RangeCalendar.js

You could treat both inputs as one single one so that the popover doesn't jump positions. Sounds like you've already considered this to some extent from your opening sentence. I think this would probably be recommended anyways though for users who prefer reduced motion anyways. People with low sight or tunnel vision may have a difficult time tracking where the popover has gone.
Your demo is a little misleading though in the video and would appear to contradict your opening sentence. There is a drop down button only on the second date's field. This leads to it feeling more like a single input. To make it two, you'd need a drop down on each, which could also solve your problem, because then the first one could select one date and close, then they can choose to open the second one or not if you allow open ended ranges.
You could also make the calendar a two month view to make selecting a range easier and reduce the need to move it.

Hey thanks for the response! I understand there are some design decisions we can make to work this out (and we probably will) but just wanted to confirm that you feel this is expected behavior? Regardless of whether the design is appropriate for the use case I did find the behavior unexpected.

I'm not sure what else we would do. For a range we allow press and drag to select. This means that we need to set the start anchor on press down, and the end date would be on press up. Following that, I think our behavior is expected. I think it's more unexpected that the calendar shifted out from under the user. Open to other thoughts if you have ideas on how to differentiate between the cases.

Closing and if it's still a problem or you have additional information we can reopen.

Closing and if it's still a problem or you provide additional information we can reopen.


Test delegate tokens

We don't currently allow access to libhdfs3's hdfsGetDelegationToken although we do allow passing a token to the client initialisation.

Presumably this is only relevant to kerberos security - let's keep note but not do anything until a need case arises.


Takes longer to load the content in the app

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Open app
Tap search

Expected Result:
Search should load immediately
Actual Result:
Takes longer up to 3 seconds to load.
it's because account has a  lot of content, but still, 3000ms is not great.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:

Which of our officially supported platforms is this issue occurring on?

[x] Android / native
[ ] Android / Chrome
[ ] iOS / native
[ ] iOS / Safari
[ ] MacOS / Chrome / Safari
[ ] MacOS / Desktop

Version Number:
Reproducible in staging?: Needs reproduction (Not able to reproduce for me)
Reproducible in production?: needs reproduction
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: @quinthar
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686617915136649
View all open jobs on GitHub

Cross posted this to expensify open source: https://expensify.slack.com/archives/C01GTK53T8Q/p1687281235653819

Not able to reproduce.

Have bumped this conversation.

Hey, I am able to reproduce that. I am from Margelo and would like to work on this issue (I am already running a performance audit anyways, and the search flow is part of that)

Hey, I am heading OOO shortly, so assigning another bug0 team member to help watch over this issue whilst I am OOO. thank you!

Keeping you assigned as per the SO, Zany!

@hannojg - do you have a PR you can start whipping up?

@zanyrenney - I think you're back on Monday, so I'll unassign myself here. I've bumped @hannojg in slack as well, we're just waiting on the PR to get started.

Thanks @sophiepintoraetz

Hey, it just got harder for me to reproduce this reliably, but I have it on my plate for this week (I don't have any good proposal yet). Expect a proposal/PR until end of this week 😊

Thanks for the update @hannojg

We just made a bunch of proposals that will help with performance when reading data from onyx and first render times:
https://expensify.slack.com/archives/C01GTK53T8Q/p1688580518417739
I will create issues for those proposals. @zanyrenney I will ping you again once the main issue is up, then we can hold this issue until the other issue is solved.

Awesome, thank you @hannojg
Is there any update on the status of that yet? Thanks!

By tomorrow we should have the issue, will let you know then!

Awesome, thanks @hannojg

Thanks @hannojg - if you are working on this in that issue, should we close this one out? let me know your suggestion please!

I would leave this one open as it better describes the issue, and the issue I mentioned might not be enough to completely get rid of this issue. That's something we have to test once them mentioned issue is solved. So I'd hold this one on hold for the mentioned issue.

Okay, that makes sense, thank you @hannojg

The Onyx change is of larger nature and is still actively being worked on here:

https://github.com/Expensify/react-native-onyx/pull/280

Still on hold for this issue: https://github.com/Expensify/react-native-onyx/pull/280

There are still updates being made to https://github.com/Expensify/react-native-onyx/pull/280

The PR just got merged and we are working on getting it into the app:

https://github.com/Expensify/App/pull/23749

The aforementioned PR fixes the issue, as also reported by testers (David). Video:
(Notice that there is no blocking in opening the search page and it opens right away):
https://github.com/Expensify/App/assets/16821682/322177ab-db20-41c0-a93d-bb721d718bb6

Hey @hannojg would you mind being a bit more clear please?

The aforementioned PR fixes the issue, as also reported by testers (David)

Do you mean the linked PR https://github.com/Expensify/App/pull/23749 fixes this issue? or that now that issue is merged, we can resume work on this? Thanks!

It means that the linked PR https://github.com/Expensify/App/pull/23749 fixed the issue, yes! 😊


Link youtube channel from Github readme

We should have a link to our channel on panel event studies in our Github readme.
https://www.youtube.com/watch?v=hOIB3PwntYg
@rayhuang11 can you look into adding this, please?

Summary: linked YouTube channel main page to GitHub's readme.


Project Announcement Post

Created the announcement post for Galaxy Explorer. Included links to relevant resources/references. Additional posts to come at a later date.

Docs Build status updates of commit 4ca97bb:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

mixed-reality-docs/galaxy-explorer-update.md
:white_check_mark:Succeeded
View

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


Returning empty  token  when the refresh method is called

When the token expires, it tries to refresh the token in the secure storage but replaces it with an empty variable causing it to redirect to the login page. I’ve been on this issue for a while and seek possible solutions including checking the GitHub issues but still unable to get a better solution.
Here is where i defined my helper class
class MyOAuth2Client extends OAuth2Client {
MyOAuth2Client({required String redirectUri, required String customUriScheme})
: super(
authorizeUrl:
'https://$baseurl/connect/authorize', //Your service's authorization url
tokenUrl:
'https://$baseurl/connect/token', //Your service access token url
redirectUri: redirectUri,
revokeUrl: "https://$baseurl/connect/revocation",
customUriScheme: customUriScheme);
}
class MyHelper {
OAuth2Client getClient() {
var client;
client = MyOAuth2Client(
redirectUri: REDIRECT_URL,
customUriScheme: CUSTOM_SCHEME,
);
return client;
}
FlutterSecureStorage _storage = FlutterSecureStorage();
Future authorize() async {
try {
var client = getClient();
await _storage.deleteAll();
  if (client != null) {
    var hlp = toPerformRequest(getClient());

    await hlp.disconnect();

    var result = await hlp.getToken().catchError((onError) async {
      await hlp.disconnect();

      print("error $onError");
    });

    Response user = await hlp.get(USER_INFO);

    UserInfo userinfo = UserInfo.fromJson(jsonDecode(user.body));

    await _storage.write(key: "email", value: userinfo.email);

    await _storage.write(key: "userID", value: userinfo.userID);

    await _storage.write(key: "id", value: userinfo.sub);

    await _storage.write(key: "name", value: userinfo.givenName);

    await _storage.write(key: "tenantId", value: userinfo.tenantId);
  }

} catch (ex) {
  throw (ex.toString());
}

}
OAuth2Helper toPerformRequest(OAuth2Client client) {
String clientId = CLIENT_ID;
String clientSecret = CLIENT_SECRET;
var hlp = OAuth2Helper(client,
    clientId: clientId,
    clientSecret: clientSecret,
    scopes: [ 'openid', 'profile', 'offline_access']);
return hlp;

}
logout() async {
String clientId = CLIENT_ID;
String clientSecret = CLIENT_SECRET;
var hlp = OAuth2Helper(getClient(),
clientId: clientId,
clientSecret: clientSecret,
scopes: [ 'openid', 'profile', 'offline_access']);
await hlp.disconnect();

await hlp.removeAllTokens();
await _storage.deleteAll();

}
get(
String url, {
Map<String, String>? data,
}) async {
try {
var hlp = toPerformRequest(getClient());
  await hlp.getToken();
  var token = await hlp.getTokenFromStorage();

//the token gets printed here until it expires an  no longer able to get another token form storage
print(token?.accessToken.toString());
var response =
await hlp.get("$baseurl$url", headers: data);
return jsonDecode(response.body);
} on SocketException {
throw Failure('No Internet connection 😑');
} on HttpException {
throw Failure("Couldn't find the post 😱");
} on FormatException {
throw Failure("Bad response format 👎");
} on TimeoutException {
throw Failure('Connection Timeout: Check your internet connection');
} on Failure catch (e) {
throw Failure(e.message);
}
}
post(
String url,
dynamic data,
) async {
try {
var hlp = toPerformRequest(getClient());
await hlp.getToken();
  var decodeBody = jsonEncode(data);

  var response = await hlp.post(
    "$baseurl$url",
    headers: {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
    },
    body: decodeBody,
  );
  return jsonDecode(response.body);
} on SocketException {
  throw Failure('No Internet connection 😑');
} on HttpException {
  throw Failure("Couldn't find the post 😱");
} on FormatException {
  throw Failure("Bad response format 👎");
} on TimeoutException {
  throw Failure('Connection Timeout: Check your internet connection');
} on Failure catch (e) {
  throw Failure(e.message);
}

}
}
This is from the helper class, At this point when the token expires , its suppose to refresh,  but instead its calling the fetchToken() method which means it has previously try to refresh the token and it replaced it with an empty token
/// Returns a previously required token, if any, or requires a new one.
///
/// If a token already exists but is expired, a new token is generated through the refresh_token grant.
Future<AccessTokenResponse?> getToken() async {
_validateAuthorizationParams();
var tknResp = await getTokenFromStorage();

// [At this point when the token expires , its suppose to refresh,  but instead its calling the fetchToken() method which means it has previously try to refresh the token and it replaced it with an empty token  ]
if (tknResp != null) {
if (tknResp.refreshNeeded()) {
//The access token is expired
if (tknResp.refreshToken != null) {
tknResp = await refreshToken(tknResp.refreshToken!);
} else {
//No refresh token, fetch a new token
tknResp = await fetchToken();
}
}
} else {
tknResp = await fetchToken();
}
if (!tknResp.isValid()) {
  throw Exception(
      'Provider error ${tknResp.httpStatusCode}: ${tknResp.error}: ${tknResp.errorDescription}');
}

if (!tknResp.isBearer()) {
  throw Exception('Only Bearer tokens are currently supported');
}

return tknResp;

}

Hi @Mubaola23,
it's not clear to me how you are using your helper class, but there's something weird with your code.
For example, you don't need to call getToken() each time you instantiate the OAuthHelper: the helper retrieves it from the storage or from the server as soon as it is needed (i.e. before a get or post request).
Furthermore I don't understand why you are calling disconnect() in the authorize method. Calling it will delete both the access and the refresh token from the storage, after that it will invoke the token revocation endpoint (that should in turn clear the access and refresh tokens on the server).
I'll try to review and comment your code below, let me know if I misunderstood anything...
class MyOAuth2Client extends OAuth2Client {
  MyOAuth2Client({required String redirectUri, required String customUriScheme})
      : super(
            authorizeUrl:
                'https://$baseurl/connect/authorize', //Your service's authorization url
            tokenUrl:
                'https://$baseurl/connect/token', //Your service access token url
            redirectUri: redirectUri,
            revokeUrl: "https://$baseurl/connect/revocation",
            customUriScheme: customUriScheme);
}

class MyHelper {
  OAuth2Client getClient() {
    var client;
    client = MyOAuth2Client(
      redirectUri: REDIRECT_URL,
      customUriScheme: CUSTOM_SCHEME,
    );
    return client;
  }

  FlutterSecureStorage _storage = FlutterSecureStorage();

  Future authorize() async {
    try {
      var client = getClient();
      await _storage.deleteAll();

      if (client != null) {

        // ###No harm here, but you already have the client instantiated, you should pass it to the helper...###
        //var hlp = toPerformRequest(getClient());
        var hlp = toPerformRequest(client);

        // ### No need to disconnect and retrieving the token.... ###
/*
        await hlp.disconnect();

        var result = await hlp.getToken().catchError((onError) async {
          await hlp.disconnect();

          print("error $onError");
        });
*/
        Response user = await hlp.get(USER_INFO);

        UserInfo userinfo = UserInfo.fromJson(jsonDecode(user.body));

        await _storage.write(key: "email", value: userinfo.email);

        await _storage.write(key: "userID", value: userinfo.userID);

        await _storage.write(key: "id", value: userinfo.sub);

        await _storage.write(key: "name", value: userinfo.givenName);

        await _storage.write(key: "tenantId", value: userinfo.tenantId);
      }
    } catch (ex) {
      throw (ex.toString());
    }
  }

  OAuth2Helper toPerformRequest(OAuth2Client client) {
    String clientId = CLIENT_ID;
    String clientSecret = CLIENT_SECRET;

    var hlp = OAuth2Helper(client,
        clientId: clientId,
        clientSecret: clientSecret,
        scopes: ['openid', 'profile', 'offline_access']);
    return hlp;
  }

  logout() async {
/*
    String clientId = CLIENT_ID;
    String clientSecret = CLIENT_SECRET;
    var hlp = OAuth2Helper(getClient(),
        clientId: clientId,
        clientSecret: clientSecret,
        scopes: ['openid', 'profile', 'offline_access']);
*/
    var hlp = toPerformRequest(getClient());

    await hlp.disconnect();

    // ### Why are you removing all tokens in the storage? ###
    //await hlp.removeAllTokens();

    await _storage.deleteAll();
  }

  get(
    String url, {
    Map<String, String>? data,
  }) async {
    try {
      var hlp = toPerformRequest(getClient());

      // ### Again, no need to retrieve the token... ###
      //await hlp.getToken();

      // ### Does the token expire on its own or due to the calls to the disconnect method? ###
      var token = await hlp.getTokenFromStorage();
//the token gets printed here until it expires an no longer able to get another token form storage
      print(token?.accessToken.toString());

      var response = await hlp.get("$baseurl$url", headers: data);
      return jsonDecode(response.body);
    } on SocketException {
      throw Failure('No Internet connection expressionless');
    } on HttpException {
      throw Failure("Couldn't find the post scream");
    } on FormatException {
      throw Failure("Bad response format -1");
    } on TimeoutException {
      throw Failure('Connection Timeout: Check your internet connection');
    } on Failure catch (e) {
      throw Failure(e.message);
    }
  }

  post(
    String url,
    dynamic data,
  ) async {
    try {
      var hlp = toPerformRequest(getClient());
      // ### Again, no need to retrieve the token... ###
     //await hlp.getToken();

      var decodeBody = jsonEncode(data);

      var response = await hlp.post(
        "$baseurl$url",
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json',
        },
        body: decodeBody,
      );
      return jsonDecode(response.body);
    } on SocketException {
      throw Failure('No Internet connection 😑');
    } on HttpException {
      throw Failure("Couldn't find the post 😱");
    } on FormatException {
      throw Failure("Bad response format 👎");
    } on TimeoutException {
      throw Failure('Connection Timeout: Check your internet connection');
    } on Failure catch (e) {
      throw Failure(e.message);
    }
  }
}

I'm using the disconnect in the authorize  method in order to empty the storage if at all there's token stored already before it  authorizes the user.
I will effect these corrections and see if it solves the issue.
Thank you for taking time to review the code.

I made the corrections you suggested and here is what i have. When the token expires, it  prints the previous token unlike before but redirects back to the login page( whereby  it's suppose to refresh the token )
I/flutter ( 9737): eyJhbGciOiJSUzI1NiIsImtpZCI6IjgyODUxRDU4Mzc2ODE3RUEzOTMyM0VGRTBEQzlENDZGQUJERENENDVSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6ImdvVWRXRGRvRi1vNU1qNy1EY25VYjZ2ZHpVVSJ9.eyJuYmYiOjE2NTA1MzU0MDgsImV4cCI6MTY1MDUzNzIwOCwiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS5vbmRnby5uZyIsImNsaWVudF9pZCI6Im9uRGdvQXBwQ2xpZW50Iiwic3ViIjoiNjI0MmUyZGZlNzUyNmNhbCIsImdpdmVuX25hbWUiOiJkYXlvIiwiZmFtaWx5X25hbWUiOiJvbmRnbyIsInJvbGUiOiJvbkRnb1VzZXIiLCJlbWFpbCI6ImRheW8zQGdtYWlsLmNvbSIsImVtYWlsX3ZlcmlmaWVkIjoidHJ1ZSIsImFkZHJlc3MiOiIgIiwib25EZ29JZCI6ImRlbW8tb25EZ28tMTAwMDA0MCIsInRlbmIiwidGVuYW50TmFtZSI6Ik9OREdPIExpbWl0ZWQiLCJzaWQiOiIwQzA4RjBBRTEwN0ZGNTcxQ0M0QjFENEVDMURDRkY0RCIsImlhdCI6MTY1MDUzNTQwOCwic2NvcGUiOlsib3BlbmlkIiwicHJvZmlsZSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJwd2QiXX0.DHrGOp9ZOFCqCW97tpNNuB5ze3IAXAP6tbuDW-yZewxdm_11PctqkhTVYtA0iay2mg8nkWP2yPCYZBcnf7ZrYrgbKCRhl4A54G5OjXDZQMtrcdLtmDu6Uct3RQWkQcENJuwQY3MEsivbZhzpa8Lfp5GDXkWgexwgTgAvHVraZNdkenQkLAsCHj
D/ViewRootImpl@213c661MainActivity: MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager( 9737): prepareNavigationBarInfo() DecorView@5eaa44f[MainActivity]
D/InputMethodManager( 9737): getNavigationBarColor() -855310
D/SurfaceView( 9737): onWindowVisibilityChanged(8) false io.flutter.embedding.android.FlutterSurfaceView{f70762f V.E...... ........ 0,0-720,1494} of ViewRootImpl@213c661[MainActivity]
D/SurfaceView( 9737): surfaceDestroyed callback.size 1 #2 io.flutter.embedding.android.FlutterSurfaceView{f70762f V.E...... ........ 0,0-720,1494}
W/libEGL  ( 9737): EGLNativeWindowType 0xc5b44008 disconnect failed
D/SurfaceView( 9737): remove() io.flutter.embedding.android.FlutterSurfaceView{f70762f V.E...... ........ 0,0-720,1494} Surface(name=SurfaceView - ng.ondgo.ondgoapp/ng.ondgo.ondgoapp.MainActivity@f70762f@8)/@0x12104fe
W/libEGL  ( 9737): EGLNativeWindowType 0xc5c8ff48 disconnect failed
D/ViewRootImpl@213c661MainActivity: Relayout returned: old=(0,0,720,1520) new=(0,0,720,1520) req=(720,1520)8 dur=36 res=0x5 s={false 0} ch=true
D/InputTransport( 9737): Input channel destroyed: 'ClientS', fd=95
D/ViewRootImpl@213c661MainActivity: stopped(true) old=false
D/SurfaceView( 9737): windowStopped(true) false io.flutter.embedding.android.FlutterSurfaceView{f70762f V.E...... ........ 0,0-720,1494} of ViewRootImpl@213c661[MainActivity]

@Mubaola23, are you sure the server provides a refresh endpoint? If so, can it be that the refresh endpoint url is different than the  access token url? Usually they are the same, but they can differ.
In this case, you can set the refresh token endopoint url by passing the refreshUrl property to the client constructor.
For example:
class MyOAuth2Client extends OAuth2Client {
  MyOAuth2Client({required String redirectUri, required String customUriScheme})
      : super(
            authorizeUrl:
                'https://$baseurl/connect/authorize', //Your service's authorization url
            tokenUrl:
                'https://$baseurl/connect/token', //Your service access token url
            refreshUrl: 'https://$baseurl/connect/refresh', //***Just a made up url, you should check the server docs...
            redirectUri: redirectUri,
            revokeUrl: "https://$baseurl/connect/revocation",
            customUriScheme: customUriScheme);
}

But first of all, can you verify if actually a refresh token exists before the access token expires?
For example:
 get(
    String url, {
    Map<String, String>? data,
  }) async {
    try {
      var hlp = toPerformRequest(getClient());

      var token = await hlp.getTokenFromStorage();
      print(token?.accessToken.toString());
      print(token?.refreshToken.toString());

      ...
  }

Yes ,  I was able to print the refresh token along with the access token
Access Token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjgyODUxRDU4Mzc2ODE3RUEzOTMyM0VGRTBEQzlENDZGQUJERENENDVSUzI1NiIsInR5cCI6ImF0K2p3dCIsIng1dCI6ImY1MDYxOTkxMiwic2NvcGUiOlsib3BlbmlkIiwicHJvZmlsZSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJwd2QiXX0.Vqz21ZUuyvHhoE9sBRuZAr8FJxH8VJX0s__h9wRfPS8xl3B9Zlew73B2_eGgHigCtBd4fzZ_0M6X7ymmT5OW-oosfZ866RYhC1CXti1Hk0vZ2l0W78tginYdrxd5Z66_VuYVSVf_Nader7RMRrseKudKUGFtcIvV6_PmXYjG
I/flutter ( 3440): Refresh Token :2A245D099FD4C628571264BBDDE5C673F90A689483541B
I

Hi @Mubaola23, I managed to replicate your issue, now I need to understand what's going on and how to solve it...
I'll let you know as soon as possible, thank you for taking the time to report your problem!

Hi @okrad , thank you for taking time to look into this issue, i'll look forward to a reply from you.

Hi @Mubaola23, can you try out the new version?

Ok, i will update the version and try it out.

That's quite strange...
If you are presented the login page this could mean one of two things:

The refresh token is itself expired
There's no refresh token

In all of these cases, the client is forced to fetch a new token by means of the appropriate oauth flow.
The state parameter error is even stranger... Can you understand if it Is a server generated error or a client side one?
One thing you could try is to clear the token storage by calling the OAuth2Helper.removeAllTokens method.


OmniSci read_csv does not fallback to Pandas when file is a URL

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): probably irrelevant, observed on Ubuntu 18.05
Modin version (modin.__version__): unreleased; observed on my fork at https://github.com/vnlitvinov/modin/tree/omnisci-on-cloud but I think it would surface on any OmniSci-enabled Modin
Python version: 3.7.8
Code we can use to reproduce:

import os
os.environ['MODIN_ENGINE'] = 'Ray'
os.environ['MODIN_BACKEND'] = 'Omnisci'

import modin.experimental.pandas as pd

df = pd.read_csv('https://foo.org/file.csv')

Describe the problem

Modin does not understand that the file is not local, here's the traceback:
Traceback (most recent call last):
  File "a.py", line 7, in <module>
    df = pd.read_csv('https://foo.org/file.csv')
  File "/src/modin/modin/pandas/io.py", line 112, in parser_func
    return _read(**kwargs)
  File "/src/modin/modin/pandas/io.py", line 127, in _read
    pd_obj = EngineDispatcher.read_csv(**kwargs)
  File "/src/modin/modin/data_management/dispatcher.py", line 115, in read_csv
    return cls.__engine._read_csv(**kwargs)
  File "/src/modin/modin/data_management/factories.py", line 87, in _read_csv
    return cls.io_cls.read_csv(**kwargs)
  File "/src/modin/modin/experimental/engines/omnisci_on_ray/io.py", line 181, in read_csv
    convert_options=co,
  File "pyarrow/_csv.pyx", line 573, in pyarrow._csv.read_csv
  File "pyarrow/_csv.pyx", line 512, in pyarrow._csv._get_reader
  File "pyarrow/io.pxi", line 1432, in pyarrow.lib.get_input_stream
  File "pyarrow/io.pxi", line 1399, in pyarrow.lib._get_native_file
  File "pyarrow/io.pxi", line 828, in pyarrow.lib.OSFile.__cinit__
  File "pyarrow/io.pxi", line 838, in pyarrow.lib.OSFile._open_readable
  File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
  File "pyarrow/error.pxi", line 97, in pyarrow.lib.check_status
FileNotFoundError: [Errno 2] Failed to open local file 'https://foo.org/file.csv'. Detail: [errno 2] No such file or directory

Expected behaviour
For this particular code example expected behaviour would probably be failing to find a file (as URL given in the example is most likely invalid). I've observed the same issue with existing file, and expected behaviour there would be reading it, even if through falling back to Pandas.

cc @amyskov @ienkovich @dchigarev

The reproducer works on master.


ARROW-14606: [CI] PYARROW_TEST_S3_REGION other than us-east-1 breaks tests

Pass the specified region to the test.

This is changing the intent of the test: see https://issues.apache.org/jira/browse/ARROW-11235

Thanks for the review @pitrou. IIUC the original intent was to ensure that fs ends up being valid which will still be true iff the provided test region is correct. Ensuring that tests pass while changing regions reduces maintenance burden. Maybe I'm missing something?

The test is checking that S3FileSystem(anonymous=True) is correctly able to infer a region. Your change makes this idiom untested.

Got it. Thanks again @pitrou , will find another way to solve this. Closing.


feat: Set LoopOffset

Took a sip of Kool-Aid in the process by creating a Lua nvim config.

For https://github.com/charmbracelet/vhs/pull/113

Thanks!


TestFlight (Onboarding) not working

I will take a look at it. Meanwhile if you send me your email, I will invite you.
Sent with GitHawk

<EMAIL_ADDRESS>Thank you

I will keep the issue open so we can fix it. Thanks.
Sent with GitHawk

issue still exists, i tried yesterday and issue still exist. If you can send me invite

I will take some time out to take a look at this today.
Sent with GitHawk

@CaptainYukinoshitaHachiman, @askari01 this issue is fixed now. Please try again. Feel free to reopen it if Onboarding still doesn't work.
Thanks.

Seems to be fixed now 👍


Next Release

Codecov Report

Merging #165 (8d416d0) into main (532813d) will increase coverage by 1.11%.
The diff coverage is 20.68%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
@@            Coverage Diff             @@
##             main     #165      +/-   ##
==========================================
+ Coverage   48.07%   49.19%   +1.11%
==========================================
  Files         132      135       +3
  Lines        4728     4891     +163
==========================================
+ Hits         2273     2406     +133
- Misses       2455     2485      +30

Impacted Files
Coverage Δ

src/fullctl/django/admin.py
69.07% <ø> (ø)

src/fullctl/django/auth.py
42.30% <0.00%> (-1.12%)
:arrow_down:

src/fullctl/django/autocomplete/devicectl.py
0.00% <0.00%> (ø)

src/fullctl/django/context_processors.py
89.18% <ø> (ø)

...c/fullctl/django/rest/urls/service_bridge_proxy.py
51.28% <0.00%> (-2.78%)
:arrow_down:

src/fullctl/graph/mrtg/mock.py
0.00% <0.00%> (ø)

src/fullctl/graph/mrtg/rrd.py
0.00% <0.00%> (ø)

src/fullctl/service_bridge/devicectl.py
0.00% <0.00%> (ø)

src/fullctl/django/views/__init__.py
41.37% <25.00%> (-1.22%)
:arrow_down:

src/fullctl/django/middleware.py
52.38% <29.41%> (-9.33%)
:arrow_down:

... and 5 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Critical Error starting service tier with extension installed including pageextension object

Description
Only tested for Business Central CU3 (13.3.27233.0). On-prem issue.
Service tier won't start after restart and no other service tier will start from the same on-prem database.
An extension has been installed with pageextension to a standard page in the action section. An action has been added to an existing group. When restarting service tier the following error occurs: Metadata error from pageextension with action group not found.
Possible Metadata/symbol error.
To Reproduce
Tested on standard BC-onprem installation and reproducable in Docker container.

Added extension with pageextension adding action last in standard action group
Edit standard object in C/SIDE: adding new action group before extended action group and compile object
2.a. (It is possible to open object)
Restart service tier
Error occurs: service tier won't start see event log.

It is possible hereafter to revert changes to C/SIDE object (deleting the action group) and service tier will now restart without errors.
Event Log
TimeGenerated : 20-03-2019 10:35:58
EntryType     : Error
Message       : Server instance: NAV
                Category: Extensions
                ClientSessionId: 00000000-0000-0000-0000-000000000000
                ClientActivityId: cf192cee-020e-4c83-8386-bec40c74fbb6
                ServerSessionUniqueId: 00000000-0000-0000-0000-000000000000
                ServerActivityId: af87ecdd-3d32-4e55-a609-fd6a0dbfdf30
                EventTime: 03/20/2019 09:35:58
                Message (NavAppObjectMetadataException): RootException: NavAppO
                bjectMetadataException
                An error occurred while applying changes from the 'Extension by Publisher <IP_ADDRESS>' app to the applicati
                on object of type 'PageExtension' with the ID '50100'. The er
                ror was: InvalidOperationException - Metadata delta application
                 failed due to the following error(s): The metadata object Docu
                ments was not found.
                ExceptionStackTrace:
                   at Microsoft.Dynamics.Nav.Apps.MetadataDeltas.RuntimeDeltaAp
                plicationAdapter.HandleException(Exception ex, ApplicationObjec
                tId objectId, DeltaAdapterContext deltaAdapterContext)
                   at Microsoft.Dynamics.Nav.Apps.MetadataDeltas.DeltaApplicati
                onAdapterBase`2.PerformDeltaApplicationWithErrorHandling(Applic
                ationObjectId objectId, TDelta deltas, Action applicationAction
                )
                   at Microsoft.Dynamics.Nav.Apps.MetadataDeltas.DeltaApplicati
                onAdapterBase`2.ApplyDeltas(ApplicationObjectId objectId, Objec
                t subject, IEnumerable`1 deltas, DeltaRuleEnforcer ruleEnforcer
                , PerformanceLog performanceLog)
                   at Microsoft.Dynamics.Nav.Apps.MetadataDeltas.MetadataRuntim
                eDeltaApplicator.ApplyDeltas(ApplicationObjectId objectId, Obje
                ct subject, IEnumerable`1 deltas, PerformanceLog performanceLog
                , IDeltaValidationFilter[] filters)
                   at Microsoft.Dynamics.Nav.Runtime.NCLApplicationObjectExtens
                ion`1.ApplyRuntimeDeltas(TSubject subject, PerformanceLog perfo
                rmanceLog)
                   at Microsoft.Dynamics.Nav.Runtime.NCLMetaApplicationObject.A
                pplyExtensionObjects[T](IEnumerable`1 extensions, T subject)
                   at Microsoft.Dynamics.Nav.Runtime.NCLMetaForm.LoadMetadata()
                   at Microsoft.Dynamics.Nav.Runtime.NCLMetaApplicationObject.P
                opulate()
                   at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.InitializeAppG
                roupModifiedObject(NavAppGroup appGroup, NavAppGroupObjectMetad
                ataSummary modifiedSummary)
                   at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.InitializeModi
                fiedBaseObjects(NavAppGroup appGroup, InitializeAppGroupProfile
                r profiler, IReadOnlyList`1 baseObjectsModifiedBySomething)
                   at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.InitializeAppG
                roup(NavAppGroup appGroup)
                CallerStackTrace:
                   at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.InitializeAppG
                roup(NavAppGroup appGroup)
                   at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.InitializeAppG
                roup(NavAppGroup appGroup)
                   at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppGroupUpdater.Up
                dateGroupForChangedTenant(NavTenant tenant)
                   at Microsoft.Dynamics.Nav.Runtime.NavTenantCollection.Initia
                lizeAppsForTenant(NavTenant tenant)
                   at Microsoft.Dynamics.Nav.Runtime.NavTenantCollection.Initia
                lizeTenant(NavTenant tenant, NavTenantSettings tenantSettings,
                Boolean overwriteTenantIdInDatabase, Boolean verifyDatabaseConn
                ection, Boolean ensureDatabaseExclusiveState)
                   at Microsoft.Dynamics.Nav.Runtime.NavTenantCollection.AddTen
                ant(NavTenantMountingParameters mountingParameters)
                   at Microsoft.Dynamics.Nav.Runtime.NavTenantCollection.MountD
                efaultTenant(String databaseServerName, String databaseName, St
                ring databaseUserName, ProtectedDatabasePassword databasePasswo
                rd, EncryptionProvider encryptionProvider, AzureKeyVaultSetting
                s azureKeyVaultSettings, Boolean verifyServerInstanceKey)
                   at Microsoft.Dynamics.Nav.Runtime.NavTenantCollection.AddSin
                gleLegacyTenant(String databaseServerName, String databaseName,
                 String databaseUserName, ProtectedDatabasePassword databasePas
                sword, EncryptionProvider encryptionProvider, AzureKeyVaultSett
                ings azureKeyVaultSettings)
                   at Microsoft.Dynamics.Nav.Runtime.NavTenantCollection.Config
                ureTenants(ServerUserSettings settings, String encryptionKey)
                   at Microsoft.Dynamics.Nav.Runtime.NavTaskFactory.<>c__Displa
                yClass11_0.<StartNewTask>b__0()
                   at System.Threading.Tasks.Task.Execute()
                   at System.Threading.ExecutionContext.RunInternal(ExecutionCo
                ntext executionContext, ContextCallback callback, Object state,
                 Boolean preserveSyncCtx)
                   at System.Threading.ExecutionContext.Run(ExecutionContext ex
                ecutionContext, ContextCallback callback, Object state, Boolean
                 preserveSyncCtx)
                   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task&
                currentTaskSlot)
                   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPrevent
                DoubleExecution)
                   at System.Threading.ExecutionContext.RunInternal(ExecutionCo
                ntext executionContext, ContextCallback callback, Object state,
                 Boolean preserveSyncCtx)
                   at System.Threading.ExecutionContext.Run(ExecutionContext ex
                ecutionContext, ContextCallback callback, Object state, Boolean
                 preserveSyncCtx)
                   at System.Threading.ExecutionContext.Run(ExecutionContext ex
                ecutionContext, ContextCallback callback, Object state)
                   at System.Threading.ThreadHelper.ThreadStart(Object obj)

                ProcessId: 6460
                Tag: 000009W
                ThreadId: 12
                CounterInformation:

Hi @JakobAaen, can you reproduce it using the latest developer preview and the new Base Application on AL? If yes, please open another issue and reference this one.
Closing now this issue as this GitHub repository is dedicated to handling issues and feedback for the latest Developer Preview releases of the AL development tools for Dynamics 365 Business Central.
You can open Support Request to CSS through PartnerSource portal or contact your Service Account Manager (SAM) in the local subsidiary to understand what is included in your contract as of support incident and PAH (Partner Advisory Hours). Your SAM might also step by step direct you how to open a support request or how to get credentials if this is the first time for you / your company.
For more details please read:
https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/
https://github.com/Microsoft/AL/wiki/Frequently-Asked-Questions#i-found-an-issue-on-nav-2018-what-do-i-do


fix link to public model garden

remove internal https://pantheon.corp.google.com/vertex-ai/model-garden link and replace it with public link to model garden
an alternative link might be https://cloud.google.com/vertex-ai/generative-ai/docs/model-garden/explore-models

cheers

thanks!


Convert trained model .h5 to TFLite

Hey there, I am trying to convert the .h5 to tflite for Edge TPU compatibility but I am stuck with this error which doesn't allow me to load the model for conversion:
TypeError: ('Keyword argument not understood:', 'freeze')
In my knowledge this error occurs because this implementation uses a batch norm layer that is identical to that of Keras but with one extra Boolean parameter called freeze that controls the freezing.  Keras then return an error back saying that it doesn't know the argument. Is there an other way to do this. This is what I am trying to do:
model= tf.keras.models.load_model('/path/to/.h5')
tflite_converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = tflite_converter.convert()
open("tf_lite_model.tflite", "wb").write(tflite_model)

Also I am not even sure batch norm is compatible with Edge TPU's. If that's not the case I would need to unfold this layer or merge it to a convolution layer. Thanks in advance !

@geekzain
I am also trying to convert trained model .h5 to tflite. I fixed your issue by passing the custom_objects in tf.lite.TFLiteConverter.from_keras_model. However, I got another runtimeerror about some unresolved ops in tflite in inference when calling interpreter.allocate_tensor().
What I did as follows.
`
from tensorflow import keras
import tensorflow as tf
import layers as layers_new
import initializers
import losses
import efficientnet
custom_objects = {
'BatchNormalization': layers_new.BatchNormalization,
'swish' : efficientnet.get_swish(backend=keras.backend,layers=keras.layers,models=keras.models,utils=keras.utils),
'FixedDropout' : efficientnet.get_dropout(backend=keras.backend,layers=keras.layers,models=keras.models,utils=keras.utils),
'wBiFPNAdd' : layers_new.wBiFPNAdd,
'PriorProbability' : initializers.PriorProbability,
'RegressBoxes' : layers_new.RegressBoxes,
'FilterDetections' : layers_new.FilterDetections,
'ClipBoxes' : layers_new.ClipBoxes,
'_smooth_l1' : losses.smooth_l1(),
'_focal' : losses.focal(),
}
input_shapes = {'input_2':[None,768,768,3],'input_5':[None,184140,4]}
tf.enable_control_flow_v2()
converter = tf.lite.TFLiteConverter.from_keras_model_file('E:/object_detection/EfficientDet-region_anchor_opt_mbconv-head-ckpts/inference_ckpts/ckpts_B0_image-size-768/mbconv-se-head_1e-5_unfreeze-backbone_freeze-bn/csv_04_0.6736_0.7484.h5',
custom_objects=custom_objects,
input_shapes=input_shapes,
)
converter.allow_custom_ops=True
tflite_model = converter.convert()
open("E:/object_detection/EfficientDet-region_anchor_opt_mbconv-head-ckpts/tflites/ckpts_B0_image-size-768/mbconv-se-head_1e-5_unfreeze-backbone_freeze-bn/csv_04_0.6736_0.7484.tflite", "wb").write(tflite_model)
interpreter = tf.lite.Interpreter(model_path="E:/object_detection/EfficientDet-region_anchor_opt_mbconv-head-ckpts/tflites/ckpts_B0_image-size-768/mbconv-se-head_1e-5_unfreeze-backbone_freeze-bn/csv_04_0.6736_0.7484.tflite")
interpreter.allocate_tensors()`

https://github.com/tensorflow/tensorflow/issues/28485#issuecomment-574453673

If you have made any progress, can you share there?

@geekzain The Ideal for EdgeTPU would be to have the new lite backbones. See https://blog.tensorflow.org/2020/03/higher-accuracy-on-vision-models-with-efficientnet-lite.html?m=1

@bhack Oh that's awesome ! I am glad to see more and more upcoming support for edge computing. Do you have any idea if this is already implemented for object detection?

@geekzain You can track https://github.com/google/automl/issues/11


How do I get 'No Results' to display when no results found

I'm trying to understand how to show the No Results text to display, as it displays in the demo here:
https://darrenjennings.github.io/vue-autosuggest/
The code I'm using at the moment is very similar to your Codepen example from here: https://codesandbox.io/s/mjqrk7v2rx
I would assume I would check the array length of the results, and conditionally render a paragraph if the array is empty? But I'm sure there's a more elegant way and just wanted to check with you.
Thanks

I would say that it is not as easy as expected.
Let me explain: If you have pre-filled suggestions and you use a computed method to filter them, you could easily achieve this. In this case, you could use the after-suggestions slot and check with v-if if the result of your computed method is returning results or not (if not, you could add your custom message inside it).
The problem comes when you are fetching your suggestions from an endpoint; In this case, you are populating your suggestions, instead of filtering them, every time the user changes the input value. In this scenario, you couldn't use the after-suggestions slot because when there are no suggestions, this slot is not rendered. In this case, the only way that I've found to add a "No results" message is based on the after-input slot.
I'm not sure if I'm missing something, but I would say that there are no more alternatives.

Digging more into the code I've found a better solution based on the shouldRenderSuggestions method. Now I could render the after-suggestions slot with the "No results" message although there are no suggestions available.

@vlledo shouldRenderSuggestions is the way to go here as you point out. Glad you got it working, as a "no results" message was the main reason I added this prop.


Change icon name to prevent duplicate import

Feature request 🚀

[ ] I will create Pull Request
[x] It's just a suggestion

Expected

Change Icons name from @geist-ui/icons difference from components import from @geist-ui/core to prevent duplicate import. For example, add suffix Icon to current Icon components.
Add Copy Icon name on icon docs section

Examples

Programme (Optional)
Others (Optional)
Here is my case, I have to change the icon name to prevent duplicate import

Yes, it is true that you need to use as to name. This doesn't seem to have a huge impact, and I use it the same way 🤣


math: Pow(x,y) optimization for cases: constant integer y.

math.Pow(x,y) optimization for cases: constant integer y. For example:

... math.Pow(length, 2)...
... math.Pow(length, 3.0)...

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

$ go version
go version go1.11.4 linux/amd64

Does this issue reproduce with the latest release?
yes for go 1.6
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/konstantin/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/konstantin/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build700464290=/tmp/go-build -gno-record-gcc-switches"

What did you do?
package main

import (
        "math"
        "testing"
)

func BenchmarkMathPow(b *testing.B) {
        x := 42.0
        for i := 0; i < b.N; i++ {
                _ = math.Pow(x, 2.0)
        }
}

func BenchmarkInline(b *testing.B) {
        x := 42.0
        for i := 0; i < b.N; i++ {
                _ = x * x
        }
}

What did you expect to see?
same or preliminary same performance between that 2 cases.
What did you see instead?
run benchmark
> go test -bench=.
goos: linux
goarch: amd64
pkg: tmp
BenchmarkMathPow-4   	30000000	        49.6 ns/op
BenchmarkInline-4<PHONE_NUMBER>	         0.68 ns/op
PASS
ok  	tmp	2.992s

Different more 70 times.
Note
Changing function pow in math/pow.go is not enough for solving performance problem.

func BenchmarkPowModify(b *testing.B) {
	x := 42.0
	for i := 0; i < b.N; i++ {
		_ = pow(x, 2.0)
	}
}

func pow(x, y float64) float64 {
	switch {
	case y == 0 || x == 1:
		return 1

// changes for cases with integer `y`.
	case float64(int8(y)) == y:
		if y < 0 {
			return 1.0 / pow(x, -y)
		}
		n := int(y)
		r := 1.0
		for i := 0; i < n; i++ {
			r *= x
		}
		return r

	case math.IsNaN(x) || math.IsNaN(y):
		return math.NaN()

... other like in file math/pow.go ....

result is better, but not the best:
BenchmarkMathPow-4     	30000000	        49.6 ns/op
BenchmarkPowModify-4   	200000000	         7.56 ns/op
BenchmarkInline-4<PHONE_NUMBER>	         0.69 ns/op
PASS
ok  	tmp	5.268s

Have we any optimization place for change AST from function expressions math.Pow with parameter y = 2 to expression x*x? (Like I understood ssa is not a right place).

Note that for:
func BenchmarkInline(b *testing.B) {
        x := 42.0
        for i := 0; i < b.N; i++ {
                _ = x * x
        }
}

The newer Go Gc compilers are smart enough to infer that the loop body computation is never used and optimize the loop body away. Therefore this is likely benchmarking an empty loop.
https://godbolt.org/z/ot9w2G
To avoid dead code elimination and constant folding something like this might be better:
var sink float64
var x = 42.0

func BenchmarkInline(b *testing.B) {
        for i := 0; i < b.N; i++ {
                sink = x * x
        }
}

https://godbolt.org/z/Nt9OWg

Dear @martisch ,
After changing BenchmarkInline as in your example for go1.11.4 on my laptop result is same 0.7...1.03 ns/op. So, I checked.
About your questions:

in my practice of FE(finite element) modeling, I use y = 2 or y = 3. In practice of gonum : y=7... So value is not big, so I check for y=-127...127 - that is enough for my tasks. If in my tasks need more, then after approve that design of code, you can modify for more y value.
present implementation of math.Pow and that PR have identical result.

I agree with your point, if y > 3, but for cases y = 2 and y = 3 it is ok by myself.
Now, I found any optimization for math library with constants, for example if we have code like that :
a := math.Max(b,12.7)

no need all checks of y in function math.Max

After changing BenchmarkInline as in your example for go1.11.4 on my laptop result is same
present implementation of math.Pow and that PR have identical result.
Thanks for checking and clarification.

no need all checks of y in function math.Max
Yes and the compiler with better inlining support could determine that generally (also outside of the math package) and only use and inline the checks that are relevant. There are also examples where this would help in the strings package e.g. Count with string to count of length 1. Its something that can be handled better generally without the need for hardcoded AST optimizations.

I'm watching the changes here. If we're going to do this may I recommend using a simple better method? For background, the choices are:
celeste:power7 mtj$ go test -v -bench=.
=== RUN   TestSanityPowerM
--- PASS: TestSanityPowerM (0.03s)
=== RUN   TestSanityPowerBinary
--- PASS: TestSanityPowerBinary (0.03s)
goos: darwin
goarch: amd64
pkg: power7
BenchmarkPowerMath-8          	30000000	        52.9 ns/op
BenchmarkPowerBinary-8        	200000000	         9.09 ns/op
BenchmarkPowerM-8             	300000000	         5.33 ns/op
BenchmarkPowerMathFixed-8     	50000000	        34.9 ns/op
BenchmarkPowerBinaryFixed-8   	200000000	         7.08 ns/op
BenchmarkPowerMFixed-8        	300000000	         4.95 ns/op
BenchmarkPowerMDirect124-8<PHONE_NUMBER>	         2.56 ns/op
The math lib approach, which benchmarks for me at an average of 52.9 ns/op across a range of exponents.
The iterative method under review, which is ~37s for the specific case of x**124 and 24-40ns generally.
The well-known binary powering method (below) which is 9.09 ns/op in general and 7.08 ns/op for the x**124 case.
The tricky set of auto-generated magic optimal powering trees as generated by my program (and Knuth's, and lots of other people's). With this you get 5.33 ns/op overall and 4.95 ns/op for the specific case of x**124. (The direct case does not apply here; it is for the situation where you know what the exponent is at compile time and call the specific routine directly. This would only happen if exponentiation were an operator in Go, which it is not.)
The universal solution for powering using the binary powering algorithm is as follows. I suggest that you incorporate this into your inner loop.
// Compute a**b using binary powering algorithm
// See Donald Knuth, The Art of Computer Programming, Volume 2, Section 4.6.3
func PowerBinary(a float64, b int) (p float64) {
for p = 1; b > 0; b >>= 1 {
if b&1 != 0 {
p *= a
}
a *= a
}
return
}
The tricky version, which was decided here long ago as "too much code for the problem's importance and saving 2-3 ns/call over the binary method" looks like this...
// PowerM124 computes x**124 with 9 multiplications (version 311 of 315)
func PowerM124(x1 float64) float64 {
x2 := x1 * x1
x3 := x2 * x1
x6 := x3 * x3
x7 := x6 * x1
x12 := x6 * x6
x19 := x12 * x7
x31 := x19 * x12
x62 := x31 * x31
x124 := x62 * x62
return x124
}
...and has a companion dispatcher...
// PowerM computes x**y using minimal multiplications
func PowerM(x float64, y int) float64 {
if 1 <= y && y <= 256 {
return callPowerMy
}
return math.Pow(x, float64(y))
}
var callPowerM = []func(float64) float64{
nil,
PowerM1,
PowerM2,
PowerM3,
PowerM4,
PowerM5,
PowerM6,
PowerM7,
PowerM8,
...
If this decision is ever changed, I have the optimal code for all the powers in the range 2..256 and the program to generate them arbitrarily. My suggestion here is simply to use the binary powering algorithm precisely as shown above. It's rounding error, and other aspects are fine.
9 ns is quite a bit less than 30 ns which in turn is less than 52 ns.

Dear @martisch ,
Yes, if we choose AST hardcoding way - it also not clear for other go tool like debug or ...
As I understood - you also agree with point - "we have not default way for that optimization".
Dear @MichaelTJones ,
I agree with any optimization )). As I understood we can use your design also for [-256 , -1] with little modifications. If you want, then you prepare PR with your design detail analyze.
One more think about present design of function math.Pow, we have that part:
...
 	case y == 0.5:
 		return Sqrt(x)
 	case y == -0.5:
 		return 1 / Sqrt(x)
...

I think we can optimize that part too, for example after switch add:
// optimization for cases:
// y = 1/(2^r) , where integer value r = 1 ... 127 ...
if n := int8(1.0/y); n%2 == 0 && float64(n) == 1.0/y{
   // we have
   // y = 0.5      n = 2
   // y = 0.25     n = 4
   // ...

   // convert `n` to `r` if possible. if not possible then default alorithm(example n = 6, y=0.16666... it is not 1/(2^r))

   // calculation
   result := x
   for i:= 0;i<r;i++{
      result = math.Sqrt(result)
   }
   return result
}

But I haven't idea for convert n to r.

/cc @rsc (as an owner for math)

Note that there is already an open issue #25270 for the current Pow(x, y) implementation being inaccurate (including for integer y inputs) because it doesn't perform the intermediate calculations to high enough accuracy.  The standard library functions should ensure accuracy first before optimizing for speed.  Also, I think most of the proposed speed gains are due to avoiding the Frexp and Ldexp calls which may be unnecessary in the original code.

Hello everyone,
What is the current status of this optimisation?
Last comment is in 2019 and I am not sure I understand why the lack of precision of Pow justify the fact we cannot actually improve its speed, with no deterioration of its precision.
I replicated the benchmark and it seems that in 1.21.4 there is still a huge gap between a*a and Pow(a, 2).
Maybe the benchmark I did is wrong, I don't see how.
package main

import (
	"fmt"
	"math"
	"time"
)

func compute_square_with_pow(a float64) float64 {
	return math.Pow(a, 2)
}

func compute_square(a float64) float64 {
	return a * a
}

func main() {
	length :=<PHONE_NUMBER> // Adjust the length as needed for your benchmark

	// Benchmark compute_square_with_pow
	start := time.Now()
	for i := 0; i < length; i++ {
		compute_square_with_pow(2.5)
	}
	durationWithPow := time.Since(start)
	fmt.Printf("compute_square_with_pow took %v\n", durationWithPow)

	// Benchmark compute_square
	start = time.Now()
	for i := 0; i < length; i++ {
		compute_square(2.5)
	}
	duration := time.Since(start)
	fmt.Printf("compute_square took %v\n", duration)

	// Comparing the results and calculating relative difference
	var relativeDifference float64
	if duration < durationWithPow {
		absoluteDifference := durationWithPow - duration
		relativeDifference = (absoluteDifference.Seconds() / durationWithPow.Seconds()) * 100
		fmt.Printf("Direct multiplication is faster by %v (relative difference: %.2f%%)\n", absoluteDifference, relativeDifference)
	} else if duration > durationWithPow {
		absoluteDifference := duration - durationWithPow
		relativeDifference = (absoluteDifference.Seconds() / duration.Seconds()) * 100
		fmt.Printf("math.Pow is faster by %v (relative difference: %.2f%%)\n", absoluteDifference, relativeDifference)
	} else {
		fmt.Println("Both methods took the same amount of time")
	}
}

go run test/basics/power_optimisation.go
compute_square_with_pow took 11.365080585s
compute_square took 193.561528ms
Direct multiplication is faster by 11.171519057s (relative difference: 98.30%)


How to connect to obsidian as a server?

Hey,
It is working fine when I enable "Open at Startup" option, but what if I want to connect to obsidian after closing that instance of nvim?
I thought something like 'nvim --server localhost:` would work , but not working for me after closing the instance. Is it close the port after disconnecting?
Thanks for this very handy plugin

Hi @Archie-2021,
It's actually Neovim acting as the server not Obsidian. So you'd need to use the --listen flag rather than --server. I was alil confused by this at first :sweat_smile: but I understand it as:

nvim --listen <PORT/SOCKET> => make this neovim instance listen on this port/socket.
nvim --server <PORT/SOCKET> => send a message to the neovim instance listening at the given port/socket.

I can add a command to the plugin so you can re-open the instance within obsidian to streamline this process (or if you want to have a go be my guest :slightly_smiling_face:).

Hi @Archie-2021,
It's actually Neovim acting as the server not Obsidian. So you'd need to use the --listen flag rather than --server. I was alil confused by this at first 😅 but I understand it as:

nvim --listen <PORT/SOCKET> => make this neovim instance listen on this port/socket.
nvim --server <PORT/SOCKET> => send a message/connect to the neovim instance listening at the given port/socket.

I can add a command to the plugin so you can re-open the instance within obsidian to streamline this process ~(or if you want to have a go be my guest 🙂)~, I ended up adding the command myself after writing since it was only a couple lines so I can get the release out incase others have a similar issue to yourself 😅.

It is confusing how it works.
Yeah I appreciate if you add the command to obsidian, that would make life so much easier.
I will play around with this feature tho as it seems interesting.
Thanks

No worries, if there's nothing else i'll close this issue 🙂

No worries, if there's nothing else i'll close this issue 🙂

Yeah I think I am good on this issue. Thanks

@TheseusGrey
Hey,
I thought not creating a new issue because it is related.
This new command you added opens neovim correctly, but need a update of active Obsidian file to activate and show. I think this doesn't happen we launch nvim at start up.
Thanks

Hi Archie,
Thanks for the feedback. I'll re-open this issue for it and get a new release out when I have time 🙂

New release is out, now it should open the active file in Obsidian as a neovim buffer when you run the command.
If there's any issues just let me know, otherwise I'll mark this as closed :slightly_smiling_face:

Works like a charm now, thank you


Current argument in function signature preview of jedi-vim not properly highlighted

Jedi-vim is a popular Vim plugin for python programming.
One of its features is a live preview of the signature of the function that is being currently typed. Current position in the argument list is highlighted, but in nord-vim this is not visible. That's because jedi-vim assumes that TabLine and CursorLine groups are highlighted differently, but they aren't in nord-vim.
From https://github.com/davidhalter/jedi-vim/blob/master/after/syntax/python.vim:
    if exists('g:colors_name')
        hi def link jediFunction CursorLine
        hi def link jediFat TabLine
    else
        hi jediFunction term=NONE cterm=NONE ctermfg=6 guifg=Black gui=NONE ctermbg=0 guibg=Grey
        hi jediFat term=bold,underline cterm=bold,underline gui=bold,underline ctermbg=0 guibg=#555555
    endif

Either TabLine and CursorLine should be highlighted differently, or the plugin-specific jediFunction and jediFat overridden (jediFat is the one that should stand out more).

I'll test it next weekend, but as far as I've seen your suggestion with overriding the methods sounds like a clean solution. Changing the TabLine or CursorLine would break many other plugins that rely on this groups.

I've tested the auto completion feature today and for me the list looks fine.
The currently selected entry has a lighter background and the font using the main accent theme color nord8.

Can you please post a screenshot of your view, your .vimrc config and maybe some example code so I can try to reproduce it.
And by the way, this plugin is awesome! 😄
I'll definitely use it for my Python projects, thanks :+1:

Yeah, this display is alright, I meant something different. I'll provide the screenshots.
Here is the function call signature prompt in the default theme:

Meanwhile in nord:

Thanks, this looks definitely worng 😆
I'll fix it as soon as I've got some freetime for it 😄

Implemented optimized styles for the jediFunction and jediFat groups.
BeforeAfter