Switch to an active citations parser dependency to replace pybtex

If pybtex is dead, should we switch to something else instead?
I found this active project for parsing bibtex: https://github.com/sciunto-org/python-bibtexparser
Originally posted by @kratman in https://github.com/pybamm-team/PyBaMM/pull/3645#issuecomment-1864414897

Making changes in the pybtex source code is unquestionably non-trivial because their functionality and packaging both rely on pkg_resources due to the sheer number of console scripts and entry points they provide which make use of this functionality. There are a lot of differences between the features provided by pkg_resources and that by the newer importlib.resources and importlib.metadata modules, however, some migration guides are available. I will still complete my attempt and hope that I can get all the tests passing, but TBH it's not worth pursuing if we can switch to another dependency altogether.
We use sphinxcontrib-bibtex in the documentation for automated citations which relies on pybtex internally and can continue to do so. In programmatic use for PyBaMM we should be fine to keep the functionality of the Citations class and print_citations() as close to the current one as possible. Therefore, both roads work but one will be easier to traverse.

Can you suggest some useful resources that might help. Also if no one is already working on this I would love to !

Hi @prady0t, we currently use pybtex programmatically to convert BibTeX-style citations listed in pybamm/CITATIONS.bib to a compliant text-based citation that can be used for certain functions such as pybamm.print_citations() – please refer to the code in pybamm/citations.py.
We also use sphinxcontrib-bibtex that uses pybtex internally as mentioned above, which can be left unchanged. What we need here is a new BibTeX compliant parser dependency (such as https://github.com/sciunto-org/python-bibtexparser, which would be the best one to go with provided it can give us what we need, but feel free to suggest any better, maintained ones that you can find) and we need to replace the code in citations.py to use this dependency. The workflow and functionality for the Citations class can remain the same.
For example, the Chen2020 parameter set / chemistry:
@article{Chen2020,
  author = {Chen, Chang-Hui and Brosa Planella, Ferran and O'Regan, Kieran and Gastol, Dominika and Widanage, W. Dhammika and Kendrick, Emma},
  title = {{Development of Experimental Techniques for Parameterization of Multi-scale Lithium-ion Battery Models}},
  journal = {Journal of The Electrochemical Society},
  volume = {167},
  number = {8},
  pages = {080534},
  year = {2020},
  publisher = {The Electrochemical Society},
  doi = {10.1149/1945-7111/ab9050},
}

gets converted to UTF-8 plaintext, using pybtex, to:
Chang-Hui Chen, Ferran Brosa Planella, Kieran O’Regan, Dominika Gastol, W. Dhammika Widanage, and Emma Kendrick. "Development of Experimental Techniques for Parameterization of Multi-scale Lithium-ion Battery Models." Journal of the Electrochemical Society 167 (2020): 080534.

which we use further to print citations or create citation tags. The functions in the Citations class are thin wrappers around pybtex's functionality, we want to use python-bibtexparser's API to do the same thing. If it's not possible to entirely replicate our existing features, slight modifications can be suggested as needed. The unit tests for this class and its methods are in tests/unit/test_citations.py, you will need to modify those as well to remove instances where pybtex-related functions are being used.
I will suggest starting with a design for a method that takes in some BibTeX entries first (i.e., modify Citations.read_citations() and Citations._add_citation()), and then saves them to a private attribute inside the __init__ dunder method of the class – before proceeding to the rest of the functionality (adding your own citations, overwriting an existing citation, registering a citation, tagging it, and printing).
Note that pybtex is an optional dependency for us (it is listed as a [cite] extra in pyproject.toml), and so will python-bibtexparser be as such. These guidelines must be followed for working with optional dependencies.
P.S. I will label this as a medium-difficulty issue based on the extent of the tasks required. Maybe we can take (some) ideas from the citations workflow for the Diffrax Python library.

Thanks a lot for the detailed info! This would really be helpful

Can you please explain why do we use citations and how does it help? For example :here. Also how does it register a citation above?

Right, a little bit of background won't hurt – we use this citations workflow for letting researchers using PyBaMM to know what papers they are supposed to cite for their publications as described in the Citing PyBaMM section.
A citation is registered through the pybamm.citations.register() method in the Citations class. It receives an input to a citation key present in CITATIONS.bib, say Chen2020 – pybamm.citations.register("Chen2020") will add it to the _papers_to_cite set, which will be processed further using the _parse_citation method - in the end, the print_citations() method is supposed to collate all the citations converted from BibTeX format to plaintext format and showcase them to the user.
An example of a citation being registered can be found by looking into the __init__ dunder method for any of the classes for the battery models and the solvers (for most of them, AFAIR). You can use the ⌘ + Shift + F key combination to look for those throughout the source code.
This way, the citations class keeps parsing, collecting, and preparing plaintext citations throughout the course of a scientific experiment conducted via PyBaMM's functionality (i.e., please refer to the example Jupyter notebooks).

P.S. I feel in hindsight that the functionality for citation tags (see #2961) made things a bit complicated (citations are now not parsed at runtime, but at the time of printing them) – maybe we can make this data flow more streamlined as we go forward with this dependency replacement and go back to parsing them for correctness at an appropriate position.

I was successfully able to parse using bibtexparser but it comes with some limitations. Referring : article  we cannot convert parsed data to text as done by pybtex.
https://github.com/pybamm-team/PyBaMM/blob/c3def31a04df163769851733657d9b49b3700bca/pybamm/citations.py#L233
But we can make a custom function for converting to desired type of string output. Logic can look something like this :
import bibtexparser
bibtex_str = """
@article{Harris2020,
  title = {{Array programming with NumPy}},
  author = {Harris, Charles R. and Millman, K. Jarrod and van der Walt, St{\'{e}}fan J. and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J. and others},
  journal = {Nature},
  volume = {585},
  number = {7825},
  pages = {357--362},
  year = {2020},
  publisher = {Nature Publishing Group},
  doi = {10.1038/s41586-020-2649-2},
}
@article{Sulzer2021,
  title = {{Python Battery Mathematical Modelling (PyBaMM)}},
  author = {Sulzer, Valentin and Marquis, Scott G. and Timms, Robert and Robinson, Martin and Chapman, S. Jon},
  doi = {10.5334/jors.309},
  journal = {Journal of Open Research Software},
  publisher = {Software Sustainability Institute},
  volume = {9},
  number = {1},
  pages = {14},
  year = {2021}
}
"""
library = bibtexparser.parse_string(bibtex_str)
entries = library.entries
author = str
title = str
journal = str
volume = str
year = str
pages = str
txt_format = str
count = 0
for entry in entries:
    #key = entry.key
    count += 1
    for key, value in entry.items():
        if key == "author":
            author = value
        if key == "title":
            title = value
        if key == "journal":
            journal = value
        if key == "volume":
            volume = value
        if key == "year":
            year = value
        if key == "pages":
            pages = value
    txt_format = f'''[{count}] {author},"{title}" {journal} {volume} ({year}): {pages}'''
    print(txt_format)

Output:
[1] Harris, Charles R. and Millman, K. Jarrod and van der Walt, St{'{e}}fan J. and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J. and others,"{Array programming with NumPy}" Nature 585 (2020): 357--362
[2] Sulzer, Valentin and Marquis, Scott G. and Timms, Robert and Robinson, Martin and Chapman, S. Jon,"{Python Battery Mathematical Modelling (PyBaMM)}" Journal of Open Research Software 9 (2021): 14

Whereas output of pybamm.print_citations() looks like this:
[1] Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, and others. Array programming with NumPy. Nature, 585(7825):357–362, 2020. doi:10.1038/s41586-020-2649-2.
[2] Valentin Sulzer, Scott G. Marquis, Robert Timms, Martin Robinson, and S. Jon Chapman. Python Battery Mathematical Modelling (PyBaMM). Journal of Open Research Software, 9(1):14, 2021. doi:10.5334/jors.309.

Obviously we can change output format as per needed.
P.S. There's another parser mentioned in the article mentioned above, Citeproc-py. We can also maybe look into that (if printing like this is not satisfactory)

Thanks for the article @prady0t, I had a brief look at citeproc-py and while it does look to be full of features, using it doesn't look very promising to me, for two reasons:

It is unmaintained – the last CI run was 8 months ago, and
it claims to support Python 3.7+, but the developers haven't started testing against Python 3.12 yet – which arrived in October, which, in-turn, was less than eight months ago.

Switching to such a dependency would be a step in the wrong direction as we start supporting newer Python versions and dropping older ones every year.
OTOH, python-bibtexparser may be limited in functionality, but the maintainers for it are responsive. We don't need to use all of their features, i.e., the Citations class is just a data processing system of sorts written to work with the .bib data storage format (and a few other quality-of-life features of course). We can ensure that our .bib file is correctly parsed for each paper at the time of writing unit tests. Your attempt with a custom function to convert the BibTeX string looks like a good start and I don't mind the slight variation (having surnames of authors first should be okay) in the output of pybamm.print_citations – but is it possible to extract the DOI or other URLs, since they are currently missing in it? Once you have an initial, working prototype for most of the current functionality in functions like these, we can start constructing a class that provides these functions to the users.
P.S. you should avoid hardcoding the types of fields in a BibTeX entry as much as possible and look at a dynamic parser (the python-bibtexparser documentation mentions that it can perform the validation for you) instead. It will not be scalable, and we are bound to miss a field in some citation or the other (such as the DOIs for NumPy and PyBaMM in this case) which can lead to data loss between the phases of reading and writing (the current Citations class supports the addition of external citations too, not just the ones we reference!).

If we do not use any kind of hardcoding and just print the parsed values as string something like this :
for entry in entries:
    key = entry.key
    count += 1
    for key, value in entry.items():
        txt_format = txt_format + " " + value
    print(f"[{count}] {txt_format}")
    txt_format = ' '

We gat this output :
[1]   article Harris2020 {Array programming with NumPy} Harris, Charles R. and Millman, K. Jarrod and van der Walt, St{'{e}}fan J. and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J. and others Nature 585 7825<PHONE_NUMBER> Nature Publishing Group 10.1038/s41586-020-2649-2
[2]   article Sulzer2021 {Python Battery Mathematical Modelling (PyBaMM)} Sulzer, Valentin and Marquis, Scott G. and Timms, Robert and Robinson, Martin and Chapman, S. Jon 10.5334/jors.309 Journal of Open Research Software Software Sustainability Institute 9 1 14 2021

It does print all values without data loss but their sequence depends upon bibtex entry.(Notice how title comes before names) We can somewhat fine tune the output by applying conditions like :
        if key != "ID" and key != "ENTRYTYPE":
            txt_format = txt_format + " " + value

will result in output :
[1]   {Array programming with NumPy} Harris, Charles R. and Millman, K. Jarrod and van der Walt, St{'{e}}fan J. and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J. and others Nature 585 7825<PHONE_NUMBER> Nature Publishing Group 10.1038/s41586-020-2649-2
[2]   {Python Battery Mathematical Modelling (PyBaMM)} Sulzer, Valentin and Marquis, Scott G. and Timms, Robert and Robinson, Martin and Chapman, S. Jon 10.5334/jors.309 Journal of Open Research Software Software Sustainability Institute 9 1 14 2021

Is this approach good enough?
I'm also able to extract all links and DOI with this approach.  I am looking into middlewares now. It might provide better output.
Rest I was able to modify all functions inside citations.py to use bibtexparser dependency now and everything's working as before! I just have to modify test cases and the output format mentioned above.

Looks great to me :) I do wonder if we can use the middlewares – it would be great to incorporate them if they can provide better outputs. We are not in a rush at this time about this (already patched up on our end temporarily and wewl won't add or another Python version soon), so I advise taking up as much time as you need for this for the new design.
This approach might just work – though the output format is a bit clunky as you mentioned; could we try and aim to match the current Pybtex output in this fashion (the names of the authors first, followed by the paper, where it was published, etc. and the rest of the fields) as close as it is possible? We will have to test this approach across all the papers currently listed in the .bib file in the unit tests. I would recommend testing against the BibTeX for a few external battery modelling papers that we don't implement (and other general, popular papers in science) as well to enhance test coverage.
Are you currently able to parse a single @article entry from CITATIONS.bib (i.e., for the citations.register functionality)? We might need to use a bit of regex or some complex parsing for that (see the linecache standard module for Python), but as long as it doesn't cause regressions and gets tested properly, we should be fine with that.

Yes  I am. All models are able to register respective citations and they are later printed when print_citations() is called. The  only change is in the format of the parse data (stored in value of _all_citations dict). Example :
model1 = pybamm.lithium_ion.SPM()

nc.print_citations()

Gives this output:
[[Field(key=`title`, value=`{An asymptotic derivation of a single particle model with electrolyte}`, start_line=268), Field(key=`author`, value=`Marquis, Scott G. and Sulzer, Valentin and Timms, Robert and Please, Colin P. and Chapman, S. Jon`, start_line=269), Field(key=`journal`, value=`Journal of The Electrochemical Society`, start_line=270), Field(key=`volume`, value=`166`, start_line=271), Field(key=`number`, value=`15`, start_line=272), Field(key=`pages`, value=`A3693--A3706`, start_line=273), Field(key=`year`, value=`2019`, start_line=274), Field(key=`publisher`, value=`The Electrochemical Society`, start_line=275), Field(key=`doi`, value=`10.1149/2.0341915jes`, start_line=276)], [Field(key=`title`, value=`{Array programming with NumPy}`, start_line=166), Field(key=`author`, value=`Harris, Charles R. and Millman, K. Jarrod and van der Walt, St{\'{e}}fan J. and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J. and others`, start_line=167), Field(key=`journal`, value=`Nature`, start_line=168), Field(key=`volume`, value=`585`, start_line=169), Field(key=`number`, value=`7825`, start_line=170), Field(key=`pages`, value=`357--362`, start_line=171), Field(key=`year`, value=`2020`, start_line=172), Field(key=`publisher`, value=`Nature Publishing Group`, start_line=173), Field(key=`doi`, value=`10.1038/s41586-020-2649-2`, start_line=174)], [Field(key=`title`, value=`{Python Battery Mathematical Modelling (PyBaMM)}`, start_line=481), Field(key=`author`, value=`Sulzer, Valentin and Marquis, Scott G. and Timms, Robert and Robinson, Martin and Chapman, S. Jon`, start_line=482), Field(key=`doi`, value=`10.5334/jors.309`, start_line=483), Field(key=`journal`, value=`Journal of Open Research Software`, start_line=484), Field(key=`publisher`, value=`Software Sustainability Institute`, start_line=485), Field(key=`volume`, value=`9`, start_line=486), Field(key=`number`, value=`1`, start_line=487), Field(key=`pages`, value=`14`, start_line=488), Field(key=`year`, value=`2021`, start_line=489)]]

Citations registered:

Sulzer2021 was cited due to the use of Citations
Harris2020 was cited due to the use of Citations
Marquis2019 was cited due to the use of SPM

I've not added function of string formatting in citations.py yet hence this output. But that's just a matter of copy paste. Is this a good progress?

Yes, this looks good – thanks for sharing. Once you are ready with the string formatting, feel free to raise a PR! We can go forward with further discussions there, or here itself if you don't wish to raise a PR just yet.

@agriyakhetarpal I've drafted a PR so that we can see progress.


ClickUp icon error

Application version: 2.5.0
OS: Windows 11

Steps to Reproduce:

Go to "+" and search ClickUp
See that the application icon does not appear.

Screenshots

the icon is PNG instead of SVG


Spring Cloud Stream Message Based Job Executor Implementation

MessageBasedJobExecutor uses Spring Cloud Stream to emit scheduled jobs as messages into job manager producer channel. Job message payload contains scheduled job id;
The job manager producer channel destination is scoped by runtime bundle's service name in order to restrict handling of job messages within the same group its of instances.
Job message producer uses transaction listener to synchronize sending with Activiti engine transactions.
The job message consumer dynamically creates input channel and binds it to job message producer channel destination to receive job messages. The job consumer must use job handler consumer group for input binding. If there are multiple job consumer instances bound with the same group name, then job messages are load-balanced across those consumer instances so that each message sent by a job message producer is consumed by only a single consumer instance within job message handler group
When job message handler receives job message from input channel, it tries to find existing job entity by job id and delegates job execution to ExecuteAsyncRunnable.
In case exception is raised during job execution, the job handler throws ActivitiException to reject job message. The failed message will be redelivered to retry with configured number of retries.
The following BPMN executions are covered:

Depends on https://github.com/Activiti/Activiti/pull/2826
Tests Coverage:

[x] Async Task Job Execution
[x] Intermediate Timer Catch Event
[x] Start Timer Event
[x] Boundary Timer Catch Event
[x] Externalized Message Job Consumer Properties
[x] Spring Transaction synchronization
[x] Multiple Runtime Bundle Replicas
[x] Spring Application Events support
[x] Job message headers

@igdianov @erdemedeiros @ryandawsonuk @daisuke-yoshimoto we need to be careful with this.
I totally agree that we need this but the infrastructure (kubernetes) is already providing a Job/Timers infrastructure. Also https://cloud.google.com/knative/ is the way to go forward for connectors and related out of process jobs/timers execution. While I agree that implementing using Spring Cloud Streams is a good idea for now, we should rely on the infrastructure for such tasks.
@igdianov I don't see a separated (scalable, out of processs) consumer , which makes me think that we just implemented a local version for now. Is that a correct assumption?

@Salaboy Let's discuss the uses cases to better understand the scope.
This message based job manager just helps to  distribute job execution among instances of the same runtime bundle via message broker queue worker load balancing.

@igdianov
The Activiti Engine has a setting named isMessageQueueMode, and it seems that the default asynchronous job implementation divides behaviors by that setting. Does this fix consider the setting of isMessageQueueMode?
https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/main/java/org/activiti/engine/impl/asyncexecutor/ResetExpiredJobsCmd.java#L36
https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/main/java/org/activiti/engine/impl/asyncexecutor/DefaultAsyncJobExecutor.java#L107
https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/main/java/org/activiti/engine/impl/asyncexecutor/DefaultAsyncJobExecutor.java#L179

@erdemedeiros I had created a separate IT module with multiple Rb replicas to assure job message distribution and execution against shared H2 database instance. The separate IT test module is needed to isolate multiple replicas IT test from Rb Starter test classes classpath conflicts.

@erdemedeiros I had refactored JobMessageProducer to use Spring TransactionSynchronization handler to synchronize sending of the job messages with resolved message channel. This should minimize the chances of the infrastructure failures. I also implemented publishing application events on job message success and failure with tests.
Question: do we need to add message headers with Rb metadata for job messages?

@erdemedeiros I have added message headers to job messages. This PR is ready to be merged.

Fixes https://github.com/Activiti/Activiti/issues/2863


operator [O] debezium-operator (2.5.1)

This PR contains a security fix removing leaked credentials. The leaked credentials were since revoked and this PR just sanitises the affected files.

/merge possible

/merge possible

/merge possible


update(data/zh): update helm installation

What type of PR is this?

/kind content

Any specific area of the project related to this PR?

/area documentation

What this PR does / why we need it:
Which issue(s) this PR fixes:
The current installation may not work, need to update helm repo
Fixes #
Special notes for your reviewer:

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
To complete the pull request process, please assign leogr
You can assign the PR to them by writing /assign @leogr in a comment when ready.
The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.
:memo: Please follow instructions in the contributing guide to update your commits with the DCO
Full details of the Developer Certificate of Origin can be found at developercertificate.org.
The list of commits missing DCO signoff:

8c145eb fix: update helm install

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

Welcome @ysicing! It looks like this is your first PR to falcosecurity/falco-website 🎉

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.
:memo: Please follow instructions in the contributing guide to update your commits with the DCO
Full details of the Developer Certificate of Origin can be found at developercertificate.org.
The list of commits missing DCO signoff:

ce9ba6d Update content/zh/docs/installation.md

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

Thank you for adding https://github.com/falcosecurity/falco-website/pull/308/commits/ce9ba6d0a94ce2439d0248d28f0c6244f9b19505 but I have noticed the commit sign-off is missing, could you add that, please?

@leogr  ok, added

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: leogr
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [leogr]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

LGTM label has been added.  Git tree hash: 5800d70ae5227f0fc62e30128cd190c3dbf83c9d


Hi, for a project it would be great to be able to extract the start and end dates of all iterations. Is that possible with this Python API? Thanks for your help. Best regards.

Yes, there is a function in the WorkClient class which allows to do that.

Establish connection like described in the readme

Get work_client
work_client = connection.clients.get_work_client()

Need to create an instance of the Team Context class. Necessary Information for that are the project- and team name or project id and team id
team = TeamContext(project= "Test, project_id= None, team= "Test", team_id= None)

Use function get_team_iterations
iterations = work_client.get_team_iterations(team)

Print all dates and names of iterations
for result in iterations:  print("Sprint Name: ", end = '')  print(result.name)  print("Start Date: ", end = '')  print(result.attributes.start_date)  print("Finish date: ", end = '')  print(result.attributes.finish_date, "\n", "\n")

Hope it helps!


Monerium xERC20 POC

Problem
Create a xERC20 POC for monerium tokens.
Home token: https://goerli.etherscan.io/address/0x83B844180f66Bbc3BE2E97C6179035AF91c4Cce8
Reference links:
https://github.com/monerium/smart-contracts/blob/main/contracts/PolygonPosTokenFrontend.sol
Supported Testnet chains:

OP
Arb

in progress, testing is going on.

All the transactions for testing can be found here:
https://testnet.connextscan.io/address/0xa2Ee8DCd2A8A3A54Cf37F6590E5108BbE502B006
Cloned their contracts for goerli, arb, op testnets.
Goerli Address: 0x6984384D6abE16221769BD9400de72b8F4Aa572C
Arb Address: 0x7E9D498a970B7786ea923Fb8643FBbF62Efa5037
Op address: 0xf5f1424dD3B78f64B18A085C8D7AEa5E124bf168


Add signing tx with redemption key & External Key

looks like TransactionFinalized only allows you to sign with a PrivateKey but I need to sign with a PrivateRedeemKey
The added a new function to do this which mirrors the behavior of the old API
https://github.com/input-output-hk/js-cardano-wasm/blob/master/wallet-wasm/src/lib.rs#L1355
Also in the hardware wallet case, we do not have access to the private key at all. Instead, we receive the PublicKey and the TransactionSignature from the device.

super seeded by #62


Fixed wrong service tags.

The @no_elements and @has_elements conditions are not working due the wrong tag name.

I have merged this PR to the master branch. Thank you!


Receiving "The provider for the source IQueryable doesn't implement IAsyncQueryProvider" when using IncludeOptimized().

Attempting to execute a query with an asynchronous method like FirstOrDefaultAsync() or ToListAsync() seems to be broken.  For example:
var claims = await _dbContext.Claims.IncludeOptimized(x => x.Fees).ToListAsync();

Produces the error:

System.InvalidOperationException: 'The provider for the source IQueryable doesn't implement IAsyncQueryProvider. Only providers that implement IAsyncQueryProvider can be used for Entity Framework asynchronous operations.'

Hello @TylerDM ,
The latest version for .NET Core 3.x should contain this fix.
Let us know if everything works as expected.
Best Regards,
Jon

I'm not receiving any errors.  I'll check more in detail later but given the nature of the issue it's likely resolved.  Thank you.

I think this issue should be re-opened. The exact same error occurs on 3.0.35 when using FirstOrDefaultAsync instead of ToListAsync
EFPlusRepro.zip

Hello @mgraf1 ,
The latest version should have it fixed.
If you still have the issue, please let us know.
Best Regards,
Jon

The same issue happened to me while trying to test my method containing AnyAsync() method.
Microsoft.EntityFrameworkCore.InMemory, version: 8.0.8

Hello @Frixs ,
After looking at it, we didn't succeed in reproducing this.
Do you think you could create a runnable project with the issue? It doesn’t need to be your project, just a new solution with the minimum code to reproduce the issue. You can send it in private here<EMAIL_ADDRESS>Best Regards,
Jon


Feature: Summary generated in chat window.

First of all, thank you for you application, and for making it open-source!
Completions is truly an amazing feature, but it would be awesome if I could forward the processed output to the chat window (new chat for example) instead of typing it back to where it was selected. For summaries, or text/code analysis that would be much more convenient, plus I would have an access to history of those summaries (or other pre-defined text processing results)

Hi @piv-pav, thanks for the message. I was thinking of exactly the same thing. I will implemented ability to do this. Thank you for using Enchanted!

Implemented in next release ✅


TableGateway do not find colum that exists

I have this code.
$table = $this->getDb()->wubookRoomsTable;
$query = 'SHOW COLUMNS FROM ' . $table->getTable();
$resultSet = Db::getAdapter()->query($query)->execute();
foreach ($resultSet as $r) {
    \Zend\Debug\Debug::dump($r);
}
$resultSet = $table->select(array('idRoomType' => $this->id));

The dump is the following
array(6) {
  ["Field"] => string(2) "id"
  ["Type"] => string(19) "bigint(20) unsigned"
  ["Null"] => string(2) "NO"
  ["Key"] => string(3) "PRI"
  ["Default"] => NULL
  ["Extra"] => string(14) "auto_increment"
}
array(6) {
  ["Field"] => string(10) "idRoomType"
  ["Type"] => string(7) "int(11)"
  ["Null"] => string(2) "NO"
  ["Key"] => string(3) "UNI"
  ["Default"] => NULL
  ["Extra"] => string(0) ""
}
array(6) {
  ["Field"] => string(8) "idWubook"
  ["Type"] => string(19) "bigint(20) unsigned"
  ["Null"] => string(3) "YES"
  ["Key"] => string(3) "UNI"
  ["Default"] => NULL
  ["Extra"] => string(0) ""
}

And I get this Exception:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'idRoomType' in 'where clause'

As you can see from the dump, the idRoomType column exists.

This issue has been closed as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


How to Using smoothScrollToPosition in recyclerview of firebase/firestore?

In the main activity, I use a query to get the Firestore document using firestoreRecyclerOption I have specified an adapter.
This code..
        CollectionReference chatref=db.collection("chat");
        Query query=chatref.document(email)
        .collection(account_mail).orderBy("time",Query.Direction.ASCENDING);

        FirestoreRecyclerOptions<chat> options=new FirestoreRecyclerOptions.Builder<chat>()
                .setQuery(query,chat.class)
                .build();
        adapter= new chattingAdapter(options,email);

        recyclerView=findViewById(R.id.chat_recycler_view);
        recyclerView.setHasFixedSize(true);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapter);
        System.out.println(recyclerView.getAdapter().getItemCount());  //result >0
        recyclerView.smoothScrollToPosition(recyclerView.getAdapter().getItemCount()); //no action

The last two lines don't work.
The result is 0 and scrolltoposition does not work. (It does not work even if you enter an arbitrary number)
However, multiple recyclerview results are displayed on the screen.

@SungJun9212 you need to start the adapter:
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/README.md#firestorerecycleradapter-lifecycle
adapter.startListening();

This will begin asynchronously loading the documents.  You can't expect getItemCount() to immediately be > 0.  It will take some time.
So you need to subscribe to data events:
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/README.md#data-and-error-events
In the onDataChanged callback it is safe to do smoothScrollToPosition


Close #LGVISIUM-84: Added possibility to pass the AWS Credentials in an .env file or as environment variables

I implemented the changes required by test users to make it possible to use environment variables to specify the AWS credentials to the API. The credentials can also be specified in an .env file now.
The create_pngs path also now directly returns the file path within the S3 bucket without specifying the bucket URL.

@stijnvermeeren-swisstopo thank you very much for your review. I addressed your comment and replied to the questions. Regarding the naming of the field that contains the naming and locations of the created PNG files after calling the API, I opened a ticket for that on Jira, as we need to sync with Geowerkstatt.

@stijnvermeeren-swisstopo Yes, indeed, the README was not included in my commit. I also addressed the comment you made. Thank you for your patience.


Potential access restrictions

There is potential problem I expect due to US export restrictions in effect after 20 March 2024.
This means it is possible that I will no longer be able to access GitHub after that date.
For this project it probably means goodbye, I might move it to another platform but haven't decided which one yet (well, there is basically only two to choose from that is not EU or US based).

A new date seems to be September 12.
These sanctions however is a bit vague to interpret so who knows.


TDI-36288: Clean code

Please, don't merge the pull request. I would like also separate classes for packages.


test-branch/execute-job/fork-branch/0465f2db-671c-4b1b-91e4-2192bcfa876e

PR for testing 546851ea8593d2a45a2ec2278845262b3a94d665

padding /canonical/self-hosted-runners/run-workflows 546851ea8593d2a45a2ec2278845262b3a94d665 padding


Can't collect files tab

Once I open VS code and I click on the files placed in the sidebar, rather than opening multiple files tab it replaces the single file tab I am currently on with the new one. I can't easily have more tabs of multiple files.
Also visually, next to the file name I have now the path of the file, which wasn't there before.

As you can see above this is what I mean with file tab, before if I clicked on other files I would accumulate tabs. Now does not happen anymore.
Haven't installed any new extention.
Anyone having the same issue?

For some reason showTabs was set to false, without me doing any changes.


Can you upgrade this plugin to make it compatible with IntelliJ IDEA 2024.2.x

Intellij version:
IntelliJ IDEA 2024.2 (Community Edition)
Build #IC-242.20224.300, built on August 6, 2024
Runtime version: 21.0.3+13-b509.4 aarch64 (JCEF 122.1.9)

@tommilata thank you to check this, it's a very usefull tool ;-)

Hi all, thanks for reminding me and sorry to keep you waiting, I've been busy with life lately.
I've pushed a new release now, it should be in the marketplace within a few working days.

This is done now.


Javascript error on version 1.13

Who knows if this helps at all, but I thought you might want it.

Hey, thanks for the bug report. I realize I had an issue with the build script, I updated the files for the 1.13 update.

Closing due to age and a planned rework


[QUERY] Obtaining an access token from AuthorizedClientServiceOAuth2AuthorizedClientManager returns null

Query/Question
Hi guys, I'd like to ask you for help, since we're not able to find out what our exact problem is...
We have two spring boot applications (appA and appB), both serving as web application and resource server. The frontends are already integrated with Azure AD, so the SSO in browser works fine. Since the backends also need to communicate with each other (using just basic auth with a technical user until now), we're trying to switch also the backend authentication to Azure AD as well. However we're currently struggling with obtaining the access token from the AuthorizedClientServiceOAuth2AuthorizedClientManager - it always returns null (we need to use this one because we don't always have a request context in the backend process, however we do always have a SecurityContext - either it comes directly from a user frontend interaction or we create it ourselves eg from a jwt token that comes as a kafka message header).
Here's the defintion of our OAuth2AuthorizedClientManager:
  @Bean
  public OAuth2AuthorizedClientManager authorizedClientManager
      (ClientRegistrationRepository clients) {
    OAuth2AuthorizedClientService service =
        new InMemoryOAuth2AuthorizedClientService(clients);
    AuthorizedClientServiceOAuth2AuthorizedClientManager manager =
        new AuthorizedClientServiceOAuth2AuthorizedClientManager(clients, service);
    OAuth2AuthorizedClientProvider authorizedClientProvider =
        OAuth2AuthorizedClientProviderBuilder.builder()
            .clientCredentials()
            .build();
    manager.setAuthorizedClientProvider(authorizedClientProvider);
    return manager;
  }

Here's the call to obtain a new access token (the SecurityContextHolder contains the correct principal, which is the user logged in in the browser or the user that inititiated the asynchronous kafka reponse); however the "authorize" property is always null after calling the authorize method):
  private OAuth2AccessToken getAccessToken() {
    OAuth2AuthorizeRequest request = OAuth2AuthorizeRequest.withClientRegistrationId("appB")
        .principal(SecurityContextHolder.getContext().getAuthentication()).build();
    OAuth2AccessToken accessToken = null;
    OAuth2AuthorizedClient authorize = authorizedClientManager.authorize(request);
    if (authorize != null) {
      accessToken = authorize.getAccessToken();
    }
    return accessToken;
  }

The exposed scopes configured in Azure Portal (I cannot personally check the Azure Portal configuration but I was assured that also the corresponding application permissions have been configured as "Delegated"):
api://appA/rest
api://appB/rest

Properties of appA:
spring.cloud.azure.active-directory.enabled=true
spring.cloud.azure.active-directory.profile.tenant-id=${SPRING_CLOUD_AZURE_ACTIVE_DIRECTORY_PROFILE_TENANT_ID}
spring.cloud.azure.active-directory.credential.client-id=${SPRING_CLOUD_AZURE_ACTIVE_DIRECTORY_CREDENTIAL_CLIENT_ID}
spring.cloud.azure.active-directory.credential.client-secret=${SPRING_CLOUD_AZURE_ACTIVE_DIRECTORY_CREDENTIAL_CLIENT_SECRET}
spring.cloud.azure.active-directory.application-type=web_application_and_resource_server
spring.cloud.azure.active-directory.app-id-uri=api://appA
spring.cloud.azure.active-directory.authorization-clients.appB.scopes=api://appB/rest
spring.cloud.azure.active-directory.authorization-clients.appB.authorizationGrantType=azure_delegated
spring.cloud.azure.active-directory.authorization-clients.graph.scopes=https://graph.microsoft.com/User.Read
spring.cloud.azure.active-directory.authorization-clients.graph.authorizationGrantType=azure_delegated

Properties of appB:
spring.cloud.azure.active-directory.enabled=true
spring.cloud.azure.active-directory.profile.tenant-id=${SPRING_CLOUD_AZURE_ACTIVE_DIRECTORY_PROFILE_TENANT_ID}
spring.cloud.azure.active-directory.credential.client-id=${SPRING_CLOUD_AZURE_ACTIVE_DIRECTORY_CREDENTIAL_CLIENT_ID}
spring.cloud.azure.active-directory.credential.client-secret=${SPRING_CLOUD_AZURE_ACTIVE_DIRECTORY_CREDENTIAL_CLIENT_SECRET}
spring.cloud.azure.active-directory.application-type=web_application_and_resource_server
spring.cloud.azure.active-directory.app-id-uri=api://appB

I assume the problem is that the InMemoryOAuth2AuthorizedClientService.authorizedClients collection is empty when InMemoryOAuth2AuthorizedClientService.loadAuthorizedClient gets called. So the the first question probably is, why is the authorizedClients collection empty? Are the properties not configured correctly? Or is it a configuration problem in Azure Portal?
I'm generally not sure if I'm injecting the OAuth2AuthorizedClientManager properly or what the problem could be. Should I use maybe some other bean as OAuth2AuthorizedClientService instead of InMemoryOAuth2AuthorizedClientService? Does anyone please have an idea? Would highly appreciate any help or assistance, thanks a lot :)
Why is this not a Bug or a feature Request?
This is neither a bug, nor a feature request... Just a question :)
Setup (please complete the following information if applicable):

Library/Libraries: spring-boot 2.7.8, spring-cloud-azure 4.4.1

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

[x] Query Added
[x] Setup information Added

Hi, we have a small update. The first problem was that we were setting apparently a wrong authorizedClientProvider for client credentials, which of course cannot work with azure_delegated authorizationGrantType. Now we are trying to set the AadAzureDelegatedOAuth2AuthorizedClientProvider:
@Bean
  public OAuth2AuthorizedClientManager authorizedClientManager(
      ClientRegistrationRepository clients,
      OAuth2AuthorizedClientService service,
      OAuth2AuthorizedClientRepository authorizedClients,
      RefreshTokenOAuth2AuthorizedClientProvider refreshTokenProvider) {
    AuthorizedClientServiceOAuth2AuthorizedClientManager manager =
        new AuthorizedClientServiceOAuth2AuthorizedClientManager(clients, service);

    manager.setAuthorizedClientProvider(new AadAzureDelegatedOAuth2AuthorizedClientProvider(refreshTokenProvider, authorizedClients));

    return manager;
  }

Now the problem is that the AadAzureDelegatedOAuth2AuthorizedClientProvider fails on the getHttpServletRequestOrDefault(context) method saying that the "request cannot be null" (because even getDefaultHttpServletRequest() returns null). As I mentioned, we don't have a request context here. But why is it trying to find one?

Hi @Netyyyy, thanks for your reply! Maybe it would be easier for us to solve the problem, if there were any working code examples of how to use/define the AuthorizedClientServiceOAuth2AuthorizedClientManager in combination with azure_delegated grant type in order to obtain an access token. Is there please something like that documented somewhere? We were unfortunately unable to find such code example online.

Hi @Netyyyy / guys , here's our updated situation, I'm asking for help, I still have no clue what is the problem here...
Bean definition:
  @Bean
  public OAuth2AuthorizedClientService auth2AuthorizedClientService(
      ClientRegistrationRepository clientRegistrationRepository) {
    return new InMemoryOAuth2AuthorizedClientService(clientRegistrationRepository);
  }

  @Bean
  public OAuth2AuthorizedClientManager authorizedClientManager(
      ClientRegistrationRepository clients,
      OAuth2AuthorizedClientService service,
      RefreshTokenOAuth2AuthorizedClientProvider refreshTokenProvider) {

    AuthorizedClientServiceOAuth2AuthorizedClientManager manager =
        new AuthorizedClientServiceOAuth2AuthorizedClientManager(clients, service);

    OAuth2AuthorizedClientRepository authorizedClients =
        new AuthenticatedPrincipalOAuth2AuthorizedClientRepository(service);

    manager.setAuthorizedClientProvider(
        new AadAzureDelegatedOAuth2AuthorizedClientProvider(refreshTokenProvider, authorizedClients));

    return manager;
  }

Obtaining the access token is the same as in my very first comment:
  private OAuth2AccessToken getAccessToken() {
    OAuth2AuthorizeRequest request = OAuth2AuthorizeRequest.withClientRegistrationId("appB")
        .principal(SecurityContextHolder.getContext().getAuthentication()).build();
    OAuth2AccessToken accessToken = null;
    OAuth2AuthorizedClient authorize = authorizedClientManager.authorize(request);
    if (authorize != null) {
      accessToken = authorize.getAccessToken();
    }
    return accessToken;
  }

Currently it fails on line 142 in AuthorizedClientServiceOAuth2AuthorizedClientManager.authorize:
try {
	authorizedClient = this.authorizedClientProvider.authorize(authorizationContext);
}

...which calls:

AadAzureDelegatedOAuth2AuthorizedClientProvider.authorize, then...
AuthenticatedPrincipalOAuth2AuthorizedClientRepository.loadAuthorizedClient, and here this.isPrincipalAuthenticated(principal) == true so it goes to...
InMemoryOAuth2AuthorizedClientService.loadAuthorizedClient - and here the authorizedClients collection is empty, so only null can be returned and therefore...
AadAzureDelegatedOAuth2AuthorizedClientProvider.authorize throws [client_authorization_required] Authorization required for Client Registration Id: azure on line 92.

Apparently we're missing something, because AuthenticatedPrincipalOAuth2AuthorizedClientRepository.saveAuthorizedClient gets never called, so no authorizedClients are saved into the InMemoryOAuth2AuthorizedClientService.authorizedClients collection . But how/where to implement this? Please help, we are out of ideas :)


Make haproxy heath check ip and routing listen ip configurable

This allows haproxy and routing-api to bind to specific interfaces (i.e. localhost) instead of all interfaces.
Corresponding routing-api PR: https://github.com/cloudfoundry-incubator/routing-api/pull/9
@mdelillo @aemengo

Hello @mdelillo
Why is this necessary? Please share your use cases.

Hey @shalako, this is something necessary for PCF Dev. We are only exposing necessary services (such as gorouter) outside of our VM for security reasons. This will also be useful for future work on small-footprint CF.

Closing because of lack of consistency between this PR and the gorouter status port configuration.


A sample unit test

As you expected, here's a PR to go with the one in the main repo.

Nice, thanks!

So this runs for me now, which is very exciting in itself :) But it fails.. Let me know if there's anything I can do to help getting it to pass. Once everything is working smoothly I'd like to add this to the Travis config so that these tests run automatically.


Check if egress network policies can be used on user pods

While introducing network policies would be a good thing in general at the RenkuLab chart level, network policies would be most needed to separate user pods from core RenkuLab pods (like the databases, etc). This could definitely be achieved by adding an ingress network policy to all the core RenkuLab pods, but it might also be achieved more easily by adding an appropriate egress network policy to the user pods.

See here: https://github.com/SwissDataScienceCenter/renku/pull/1541
However I think this should maybe be moved to the the renku-notebooks repo under: https://github.com/SwissDataScienceCenter/renku-notebooks/tree/master/helm-chart/renku-notebooks/templates. Not sure why I added my code to the renku repo.


Weird import conflict with xarray and typing-extensions on Python 3.8

One of our CI builds suddenly started failing with this stack trace:
tests/util/test_logging.py:1: in <module>
    import dirty_equals
venv38/lib64/python3.8/site-packages/dirty_equals/__init__.py:38: in <module>
    from ._sequence import Contains, HasLen, IsList, IsListOrTuple, IsTuple
venv38/lib64/python3.8/site-packages/dirty_equals/_sequence.py:215: in <module>
    class IsList(IsListOrTuple[List[Any]]):
/usr/lib64/python3.8/typing.py:258: in inner
    return cached(*args, **kwds)
/usr/lib64/python3.8/typing.py:895: in __class_getitem__
    return _GenericAlias(cls, params)
/usr/lib64/python3.8/typing.py:669: in __init__
    self.__parameters__ = _collect_type_vars(params)
venv38/lib64/python3.8/site-packages/typing_extensions.py:2994: in _collect_type_vars
    enforce_default_ordering = _has_generic_or_protocol_as_origin()
venv38/lib64/python3.8/site-packages/typing_extensions.py:2961: in _has_generic_or_protocol_as_origin
    return frame.f_locals.get("origin") in (
venv38/lib64/python3.8/site-packages/dirty_equals/_base.py:20: in __eq__
    return self() == other
venv38/lib64/python3.8/site-packages/dirty_equals/_sequence.py:181: in __init__
    length=_length_repr(self.length),
E   NameError: name '_length_repr' is not defined

After some rabbit hole crawling I could zoom in on a minimal reproduction procedure.
The problem started with the release of typing-extensions 4.12.1 (June 1st, 2024) and happens when xarray is imported before dirty_equals.
Example in a fresh docker run --rm -it python:3.8 /bin/bash container:
root@0a0f1606b929:/# pip install xarray dirty-equals typing-extensions
...
Successfully installed dirty-equals-0.7.1.post0 numpy-1.24.4 packaging-24.0 pandas-2.0.3 python-dateutil-2.9.0.post0 pytz-2024.1 six-1.16.0 typing-extensions-4.12.1 tzdata-2024.1 xarray-2023.1.0
...

root@0a0f1606b929:/# python
>>> import xarray
>>> import dirty_equals
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/site-packages/dirty_equals/__init__.py", line 38, in <module>
    from ._sequence import Contains, HasLen, IsList, IsListOrTuple, IsTuple
  File "/usr/local/lib/python3.8/site-packages/dirty_equals/_sequence.py", line 215, in <module>
    class IsList(IsListOrTuple[List[Any]]):
  File "/usr/local/lib/python3.8/typing.py", line 258, in inner
    return cached(*args, **kwds)
  File "/usr/local/lib/python3.8/typing.py", line 898, in __class_getitem__
    return _GenericAlias(cls, params)
  File "/usr/local/lib/python3.8/typing.py", line 672, in __init__
    self.__parameters__ = _collect_type_vars(params)
  File "/usr/local/lib/python3.8/site-packages/typing_extensions.py", line 2994, in _collect_type_vars
    enforce_default_ordering = _has_generic_or_protocol_as_origin()
  File "/usr/local/lib/python3.8/site-packages/typing_extensions.py", line 2961, in _has_generic_or_protocol_as_origin
    return frame.f_locals.get("origin") in (
  File "/usr/local/lib/python3.8/site-packages/dirty_equals/_base.py", line 20, in __eq__
    return self() == other
  File "/usr/local/lib/python3.8/site-packages/dirty_equals/_sequence.py", line 181, in __init__
    length=_length_repr(self.length),
NameError: name '_length_repr' is not defined

Possible workarounds:

pin down typing-extensions<4.12.1
use python 3.9 or higher
import dirty_equals before xarray

To give a bit more info about how the NameError occurs from current https://github.com/samuelcolvin/dirty-equals/blob/2c85486b29492977f82c850eadf1afc0e2a9434e/dirty_equals/_sequence.py:
IsListOrTuple.__init__ at line 87 calls _length_repr which is defined at line 257. Nothing out of the ordrinary.
But this line 215 in between:
https://github.com/samuelcolvin/dirty-equals/blob/2c85486b29492977f82c850eadf1afc0e2a9434e/dirty_equals/_sequence.py#L215
seems to trigger an instantiation of IsListOrTuple on Python 3.8 when xarray is already imported and typing-extensions 4.12.1 is installed. The instantiation doesn't work as _length_repr isn't defined yet causing the NameError

This issue seems to be resolved with recent typing-extensions 4.12.2 release.


Rename master to main ?

I've searched existing issues and couldn't find a duplicate.

[X] I confirm this is not a duplicate.

Is your feature request related to a problem? Please describe.
See https://sfconservancy.org/news/2020/jun/23/gitbranchname/
My thought is, if you want to change it, better do it now, then later on.
Describe the solution you'd like
Rename master to main.

I see no reason to name it main

Just wanted to ask because some projects do it later on and then something breaks.
Btw, I personally don't care what the central branch is called, just don't call it "zentraler-git-zweig"


1

@manasabalagoni Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@manasabalagoni please use your own fork to test Github's features.


Update build version and release blog post for v3.3.0

What type of PR is this:
/kind feature
/area documentation

What does this PR do / why we need it:
Which issue(s) this PR fixes:

Fixes #6261
PR acceptance criteria:

[ ] Unit test

[ ] Integration test

[x] Documentation

How to test changes / Special notes to the reviewer:

@valaparthvi can you rebase your PR as https://github.com/redhat-developer/odo/pull/6356 PR is now merged

Since this is a doc-only PR, I think we can safely override the non-passing checks.

I was thinking the same, in that case.
/lgtm

/override Kubernetes-Integration-Tests/Kubernetes-Integration-Tests
/override ci/prow/v4.11-integration-e2e
Doc-only PR.


downloaded files verus shown downloadbale amout huge difference

I noticed recently that there is a huge difference between the shown available "files" and the onces which are dowloaded at the end
37700 "likes" to be downloaded but 980 only done
522 likes to be downloaded but only 191 done
?

Do you mean the two columns in the blog list?
Normally it indicates plenty duplicates/reblogs in a blog. Or, if you enabled the setting "global duplicate check", you already have downloaded these posts/files with another blog. In both cases, you should also see a high number under "duplicates found" in the blog details.


Fix py for-loop conversion when using three range arguments

Fixes https://github.com/microsoft/pxt-microbit/issues/4403

Looks good. Add some description to the PR for future reference.


Failed to minify the code from this file

When i use npm run build the following is recurred but when i use npm start the build is working fine.
Failed to minify the code from this file:
    ./node_modules/autobind-decorator/src/index.js:7

the code at that line number is:
let fn = descriptor.value;
.
help me to solve this error issue.
thank you

We'll need a reproducing demo please.

@gowdruNikhil I got the same issue. I use<EMAIL_ADDRESS>which has autobind-decorator "^2.1.0", but the autobind-decorator author published the versions 2.2.0 and 2.2.1 four days ago. So now npm install or yarn install with no lock file is installing<EMAIL_ADDRESS>in my case.
I can't tell why this<EMAIL_ADDRESS>cannot be minified (and if it's the same for the 2.2.0). I use Yarn so I just changed the autobind-decorator "^2.1.0" dependecy of<EMAIL_ADDRESS>for autobind-decorator "2.1.0" in my yarn.lock and the build is back to normal.

I have the same error when run 'yarn build'. I've tried what @khelkun suggested but it doesn't work for me. I've also tried to edit autobind-decorator to 2.1.1 but it also doesn't work.
$ yarn build
yarn run v1.12.3
$ node scripts/build.js

><EMAIL_ADDRESS>build /path/myapp/client
> react-scripts build

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:

 	./node_modules/autobind-decorator/src/index.js:7

Read more here: http://bit.ly/2tRViJ9

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR<EMAIL_ADDRESS>build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the<EMAIL_ADDRESS>build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /path/.npm/_logs/2018-11-15T22_23_20_735Z-debug.log
✨  Done in 11.02s.

Here's my package.json:
"scripts": {
    "server": "node server.js",
    "client": "node scripts/start-client.js",
    "start": "concurrently \"nodemon server.js\" \"npm run client\"",
    "build": "node scripts/build.js"
  },

My build.js and start-client.js inside ./scripts:
// build.js
const args = ["run build"];
const opts = { stdio: "inherit", cwd: "client", shell: true };
require("child_process").spawn("npm", args, opts);

// start-client.js
const args = ["start"];
const opts = { stdio: "inherit", cwd: "client", shell: true };
require("child_process").spawn("npm", args, opts);

@nguyendviet
Do you have a 'yarn.lock' file in your create-react-app project?
Do you 'yarn install --pure-lockfile'?
Anyway please check your autobind-decorator version with the following command:
cat node_modules/autobind-decorator/package.json | grep version
By the way I don't see a 2.1 1 autobind-decorator version on npm, there's only a 2.1.0

Thank you @khelkun . The issue is actually not related to create-react-app, it was autobind-decorator.


Create New Post not worked

When I created a new post I get this message (" Social app has stopped, open app again ")
Can anyone please check and let me know?

Hi @mahireid !
You described general application crash. We need more details to help you. Could you provide logs with this error?

@mahireid if you still have the error feel free to reopen this issue.

I'm also experiencing the same error...Don't know what to do


Add bulletin board to into the wild projects

@mesaugat  @kabirbaidhya dai, please review this PR.
Can't add-in reviewers as well. May be due to no access in repo.


Code and explain every Topic in separate file

Solidity managed Code for Practice with code and explanation of every topic in a separate folder.


Separate arg collection from proving/verification

Description
Summary of changes
Nargo currently doesn't have a good separation between loading values from Prover.toml/Verifier.toml and using these to build/verify proofs. This PR splits the relevant functions in two so that we load all the inputs and then pass them to a different function in order to validate and process them.
No changes to functionality should exist except some error messages have been modified to no longer refer to the toml files. We also no longer write public inputs to Verifier.toml if proof generation fails.
Dependency additions / changes
N/A
Test additions / changes
N/A
Checklist

[x] I have tested the changes locally.
[x] I have formatted the changes with Prettier and/or cargo fmt with default settings.
[x] I have linked this PR to the issue(s) that it resolves.
[x] I have reviewed the changes on GitHub, line by line.
[x] I have ensured all changes are covered in the description.

Additional context
N/A

I reordered some of the functions to be in a more logical flow but in hindsight this just complicates review so I'll reverse that which should make the changes clearer. Making this PR draft until then.
My aim with this PR is to separate the loading/storing of values from the toml files from argument validation and proof generation.
Looking at solve_witness currently it does the steps:

load inputs from prover.toml
perform simple validation on these inputs
solve the witness
write public inputs to verifier.toml
check the constraints are satisfied

(Note that we're interweaving I/O and proof generation.)
Whereas I feel it should only do:

perform simple validation on inputs
solve the witness
check the constraints are satisfied

This version of solve_witness can then be wrapped in another function which performs the I/O. We're separating the I/O from the proving so it's easier to support different file types or even pass in values directly from rust without needing to write temporary files.

Ok, this should be a much cleaner diff now.

Separating IO is useful as we may then be able to compile nargo as wasm library!

I've taken the opportunity to reword errors a bit in general. Rather than just holding plain error strings, errors hold the relevant data and the message is formatted in errors.rs.

Separating IO is useful as we may then be able to compile nargo as wasm library!

Let's do it when we need it then, doing stuff because it might help one day is rarely a good idea in term of software development.

Separating IO is useful as we may then be able to compile nargo as wasm library!

Let's do it when we need it then, doing stuff because it might help one day is rarely a good idea in term of software development.

I agree that refactoring for a future usecase is rarely good.
In this case, it is something we can use now, instead of compiling noir to wasm. Moreover, separating IO from non-IO is good practice because unit tests are easier to write for components that do not require IO

In this case, it is something we can use now, instead of compiling noir to wasm. Moreover, separating IO from non-IO is good practice because unit tests are easier to write for components that do not require IO

Point taken if you want to use it now.
For the unit tests, I agree in theory, but here the real meat is backend.solve(), which was already in the same function. I don't think we will ever have a pertinent unit test for the new solve_witness.
If we want unit tests, we should have tests for the solve and tests for the ABI checks. The new function solve_witness() makes it impossible to do because some checks are done just before and some checks are done inside.

I think a better route would be to define a new error type AbiError which covers all possible errors for abi encoding arguments.

I am fine with this as well.

Sorry, I managed to invalidate the review fixing an issue I introduced in 876d5a6. It should be final and ready to go now.

@guipublic Do you feel these are blockers for merging this PR?
I'm asking as I've got a branch waiting for this one to go in which standardises much of the ABI encoding/decoding logic so we can replace the entirety of process_abi_with_input and process_abi_with_verifier_input with abi.encode() (deduplicating the code highlighted above and more) so I'm wary of making extra changes here which will be undone soon after.
diff: https://github.com/TomAFrench/noir/compare/separate-arg-collection-from-proving...TomAFrench:noir:abi-refactor?expand=1

@guipublic Do you feel these are blockers for merging this PR?
(...)
No it is not a blocker, indeed, if you are going to change this in another PR, it does not make sense to do it here as well, I am approving this PR then.

Let's keep the remaining points for the next PR.

Thanks :)
Fixed some merge conflicts caused by #539


Filter out kubernetes/k3s system services from port forwarding

This should focus on just end user workloads
Note, we could have a checkbox to add the system ones back in. If we do that it could be off by default.

Merged via PR https://github.com/rancher-sandbox/rd/pull/163


chore(test): migrate to vitest v2

Migrated to vitest v2.
Details of changes

install vitest v2 via bun
modified the test method to match the vitest spec changes
fix tsc error

The author should do the following, if applicable

[ ] Add tests
[x] Run tests
[x] bun run format:fix && bun run lint:fix to format the code
[ ] Add TSDoc/JSDoc to document the code

@yasuaki640
Thank you!! Let's go with it.


Read configuration from file

Supporting at least JSON and YAML (maybe ini by somehow wrapping configparser?), configuration should be read from file or string / buffer.
Should consider #2 carefully: supplying the defaults as a dict but reading user overrides from file sounds a little tricky but would be really nice to have.

This could quite easily be done by including one last check before raising the ConfigurationError in get(). If __init__ makes sure to store a reference to a (recursive?) Configuration instance, a delegate call to self._fallback.get(path, as_type=as_type) could make this work.


The hours (duration, when present) are not displayed in the preview pane on the right.

Explain the bug
The hours (duration, when present) are not displayed in the preview pane on the right. However, they are displayed correctly on the "miniplayer" at the top of this pane.
Screenshots

System Information

OS Version: Edizione	Windows 10 Home
Versione	20H2
Build OS	19042.867
Windows Feature Experience Pack 120.2212.551.0
App version: v<IP_ADDRESS>

Thanks for opening this issue. This has been fixed in #4431, and will be rolled out in the next update.


Lollipop Bottom Nav Bar Overlays App When Moving Action Bar

When compiling for API 21 using build tools 21.1 and deploying to the latest Lollipop dev build (LPX13D), app content goes behind the bottom navigation bar. I cannot duplicate in Kit Kat. I've tried both using the SlidingFragmentActivity and doing everything manually myself. If I set it to to SlidingMenu.SLIDING_CONTENT rather than SlidingMenu.SLIDING_WINDOW, the issue goes away.
You can see what I refer to here:
Nexus 4 running Kit Kat:

Nexus 5 running Lollipop:

That is the same page in Kit Kat and Lollipop. The page is only a ScrollView with text in it and no Java whatsoever save for initializing the menu. Both devices are scrolled to the bottom and the Lollipop version is hidden behind the navigation bar at the bottom.
If I don't enable the SlidingMenu (by not calling attachToActivity()), this issue does not arise.

Does any one know how to use this Sliding Menu with latest app compact V21 ??
I badly require this in my project..
plz do reply fast & expecting +eve response...

Hello Akshay,
I'm not sure what problems you might be having, but I'm using it with appcompat 21.0.3.  I'm using it as a library module and made these changes.  It works fine for me!
build.gradle file of library:

apply plugin: 'com.android.library'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
}

changes to SlidingMenu.java:

/*
    fixed bug when used in lollipop
     */

	/* (non-Javadoc)
	 * @see android.view.ViewGroup#fitSystemWindows(android.graphics.Rect)
	 */
	@SuppressLint("NewApi")
	@Override
	protected boolean fitSystemWindows(Rect insets) {
        if (mActionbarOverlay) return true;

        setMyPadding(insets);
		return true;
	}

    @Override
    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public WindowInsets onApplyWindowInsets(WindowInsets insets) {
        if (mActionbarOverlay) return insets.consumeSystemWindowInsets();

        Rect rect = new Rect(
                insets.getSystemWindowInsetLeft(),
                insets.getSystemWindowInsetTop(),
                insets.getSystemWindowInsetRight(),
                insets.getSystemWindowInsetBottom()
        );

        setMyPadding(rect);

        return insets.consumeSystemWindowInsets();
    }

    private void setMyPadding(Rect rect) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            WindowManager manager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
            switch (manager.getDefaultDisplay().getRotation()) {
                case Surface.ROTATION_90:
                    rect.right += getNavBarWidth();
                    break;
                case Surface.ROTATION_180:
                    rect.top += getNavBarHeight();
                    break;
                case Surface.ROTATION_270:
                    rect.left += getNavBarWidth();
                    break;
                default:
                    rect.bottom += getNavBarHeight();
            }
        }

        setPadding(
                rect.left, rect.top, rect.right, rect.bottom
        );
    }

    private int getNavBarWidth() {
        return getNavBarDimen("navigation_bar_width");
    }

    private int getNavBarHeight() {
        return getNavBarDimen("navigation_bar_height");
    }

    private int getNavBarDimen(String resourceString) {
        Resources r = getResources();
        int id = r.getIdentifier(resourceString, "dimen", "android");
        if (id > 0) {
            return r.getDimensionPixelSize(id);
        } else {
            return 0;
        }
    }

    /*
    END BUG FIX
     */

thanks for positive & quick response...
But can u provide me lib. jar or Source code that u have made changes ?
With AppCompat Styles not ABS style ...
On Thu, Jan 8, 2015 at 4:16 AM, pheebner<EMAIL_ADDRESS>wrote:

Hello Akshay,
I'm not sure what problems you might be having, but I'm using it with
appcompat 21.0.3. I'm using it as a library module and made these changes.
It works fine for me!
build.gradle file of library:
apply plugin: 'com.android.library'
repositories {
mavenCentral()
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
    minSdkVersion 11
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
lintOptions {
    abortOnError false
}

}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
changes to SlidingMenu.java:
/*
fixed bug when used in lollipop
*/
/* (non-Javadoc)
 * @see android.view.ViewGroup#fitSystemWindows(android.graphics.Rect)
 */
@SuppressLint("NewApi")
@Override
protected boolean fitSystemWindows(Rect insets) {
    if (mActionbarOverlay) return true;

    setMyPadding(insets);
    return true;
}

@Override
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
    if (mActionbarOverlay) return insets.consumeSystemWindowInsets();

    Rect rect = new Rect(
            insets.getSystemWindowInsetLeft(),
            insets.getSystemWindowInsetTop(),
            insets.getSystemWindowInsetRight(),
            insets.getSystemWindowInsetBottom()
    );

    setMyPadding(rect);

    return insets.consumeSystemWindowInsets();
}

private void setMyPadding(Rect rect) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        WindowManager manager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
        switch (manager.getDefaultDisplay().getRotation()) {
            case Surface.ROTATION_90:
                rect.right += getNavBarWidth();
                break;
            case Surface.ROTATION_180:
                rect.top += getNavBarHeight();
                break;
            case Surface.ROTATION_270:
                rect.left += getNavBarWidth();
                break;
            default:
                rect.bottom += getNavBarHeight();
        }
    }

    setPadding(
            rect.left, rect.top, rect.right, rect.bottom
    );
}

private int getNavBarWidth() {
    return getNavBarDimen("navigation_bar_width");
}

private int getNavBarHeight() {
    return getNavBarDimen("navigation_bar_height");
}

private int getNavBarDimen(String resourceString) {
    Resources r = getResources();
    int id = r.getIdentifier(resourceString, "dimen", "android");
    if (id > 0) {
        return r.getDimensionPixelSize(id);
    } else {
        return 0;
    }
}

/*
END BUG FIX
 */

—
Reply to this email directly or view it on GitHub
https://github.com/jfeinstein10/SlidingMenu/issues/680#issuecomment-69106464
.

Can u provide me lib. jar or Source code that u have made changes ?
Waiting for positive response ..!!!!

This solution works best as in doesn't need to change the lib source code.

However when I use this Lib. with Theme.AppCompat.Light.DarkActionBar theme
Sliding Menu Work Perfectly in 4.1.2 & above.
But With Using Theme.AppCompat theme & ToolBar i.e. no ActionBar then there
is a problem i got
It Slides ToolBar also...
What Could be the Reason ?
Expecting +ve & quick response...!!!

This http://stackoverflow.com/a/27535016/795245 solution works best as
in doesn't need to change the lib source code.
—
Reply to this email directly or view it on GitHub
https://github.com/jfeinstein10/SlidingMenu/issues/680#issuecomment-70675372
.

However when I use this Lib. with Theme.AppCompat.Light.DarkActionBar theme
Sliding Menu Work Perfectly in 4.1.2 & above.
But With Using Theme.AppCompat theme & ToolBar i.e. no ActionBar then there
is a problem i got
It Slides ToolBar also...
What Could be the Reason ?
Expecting +ve & quick response...!!!

are you calling setSupportActionBar(yourtoolbar) from your activity after setContentView ?

no..
On Fri, Jan 23, 2015 at 6:42 PM, Amine Bezzarga<EMAIL_ADDRESS>wrote:

are you calling setSupportActionBar(yourtoolbar) from your activity after
setContentView ?
—
Reply to this email directly or view it on GitHub
https://github.com/jfeinstein10/SlidingMenu/issues/680#issuecomment-71191028
.

why ?
how to achieve this ?
On Sat, Jan 24, 2015 at 11:02 AM, akshay patel<EMAIL_ADDRESS>wrote:

no..
On Fri, Jan 23, 2015 at 6:42 PM, Amine Bezzarga<EMAIL_ADDRESS>wrote:

are you calling setSupportActionBar(yourtoolbar) from your activity after
setContentView ?
—
Reply to this email directly or view it on GitHub
https://github.com/jfeinstein10/SlidingMenu/issues/680#issuecomment-71191028
.

Adding the following lines to the SlidingMenu constructors has worked for me. I didn't have to make any other code changes.
if(Build.VERSION.SDK_INT >= 21)
	setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);

@patelakshay13890
In order to prevent your toolbar from sliding along with your content, you can put the following in slidingmenumain.xml inside the SlidingMenu element.
<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:layout_alignParentTop="true"
<EMAIL_ADDRESS>/>

Look at this solution https://stackoverflow.com/questions/27165690/the-getdecorview-method-return-view-include-navigation-bar-view-on-lollipop/27535016#27535016

<style name="Theme" parent="FrameworkRoot.Theme">
    <item name="android:windowDrawsSystemBarBackgrounds">false</item>
</style>

This worked perfectly for me!

I posted this on Stack Overflow too https://stackoverflow.com/questions/28693442/android-lollipop-navigation-bar-overlays-activity-view/28698322#28698322

Is anybody else having an issue with the text selection (for copy/cut/paste) contextual action bar showing up below the Toolbar when using the AppCompat library?

@pheebner solution works, but it creates a gap at bottom for devices with physical navigation bar (e.g. Samsung Note 4).
@moritzm solution works, but as pointed out in StackOverflow thread it takes away colour of status bar as well.
@travisw88 solution works and poses no problems for me so far. I see no problems with both physical and on screen navigation bar for Lollipop devices.

It is still not working on OnePlus One A0001. #723 what should i do???!

I was having a blank space on the top and Den-Rimus solution applied in different way to the topPadding worked for me.

Thanks to all above for posting these solutions. It's a shame and a worry that the library doesn't seem to be receiving updates. I wonder if anyone has a more active fork of this or an alternative library.

@Den-Rimus :: You helped me out brov. resolved my issues.

@Den-Rimus  You are great, my friend... you are the hero :)

great

great, thank you. I use gradle so i've extended SlidingMenu to a custom class and add your fix, works like a charm.

I myself vote for @travisw88 's fix. Mine stroke me in the back giving empty space in the bottom of screen on devices with hardware navigation buttons (and those are lot's of samsungs, HTCs, LGs and so on).

@travisw88
I'm not quite sure how this solution should work - your code hides toolbar till first focus change(basically first tap). Toolbar appears right after and overlap part of the view.
Am I doing something wrong ?

mark. i got the same issue and finally resolved with @travisw88 's code.
btw, @Den-Rimus 's code is fine but i got a blank bottom padding area on device has no navigation bar.
and also the following code has side effects, the custom status bar color will be lost
<item name="android:windowDrawsSystemBarBackgrounds">false</item>

I just added this
if (Build.VERSION.SDK_INT >= 21) {
    setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
}

inside fitSystemWindows(Rect insets) function of SlidingMenu.java
Setting padding by calculating navigation_bar height or width It will not work for devices that have hardware navigation buttons. It actually adds padding that no one want that.

Is there a real solution ? Hidding navigation bar seems a bad fix.

I created demo project with AppCompat for this library and also solve this issue.
https://github.com/Kishanjvaghela/SlidingMenu-AppCompat

did anyone found a solution for this? I don't want to use an hackish workaround :(

It isn't a hackish workaround, it is the solution.  Since the project is no longer being maintained by the author, it is up to you to make such adjustments.  You will need to download the source and import it to your project(s).  SlidingMenu#attachToActivity, in the case statement for SLIDING_WINDOW, line 324 for me, add the following.
// Added to compensate for soft nav keys not sliding in Android 5.0+
if(Build.VERSION.SDK_INT >= 21)
    setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);

I have many places in my current project, where I'm supporting back to SDK 11, where I am having to test SDK versions due to methods being deprecated and replaced.  It's just how it is.

@theBlbDan Yeah sorry, I was referring to the padding as a hackish workaround
Btw I got it working even without downloading the source code of the library, I just added those 2 lines in my BaseActivity class which is extended by all of my other Activities and it worked!

The solution is well earned me
In layout:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fitsSystemWindows="true"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/layout_main"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fitsSystemWindows="true">
In activity:
`
private int getNavigationBarHeight() {
Resources resources = getResources();
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
return resources.getDimensionPixelSize(resourceId);
}
return 0;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
    if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
        boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
        boolean hasHomeKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_HOME);
        findViewById(R.id.layout_main).setPadding(0, 0, 0, (hasBackKey && hasHomeKey) ? 0 : (getNavigationBarHeight()));
    }

`

@Den-Rimus solution worked well but creating extra bottom padding on device which don't support soft nav bar, so added some extra to check soft nav bar on device
if (Build.VERSION.SDK_INT >= 21) {
Resources resources = getContent().getResources();
if(hasNavBar(resources)){
int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) {
bottomPadding += resources.getDimensionPixelSize(resourceId);
}
}
}
public boolean hasNavBar (Resources resources)
{
int id = resources.getIdentifier("config_showNavigationBar", "bool", "android");
return id > 0 && resources.getBoolean(id);
}
This worked perfectly for me!

This is my new attachToActivity sin SlidingMenu.java
public void attachToActivity(Activity activity, int slideStyle) {
	attachToActivity(activity, slideStyle, false);

	// Added to compensate for soft nav keys not sliding in Android 5.0+
	if(slideStyle == SLIDING_WINDOW && Build.VERSION.SDK_INT >= 21)
		setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
}

Thanks to those that discovered the solution

put this in your activity_main view it will do the job
android:layout_marginBottom="?attr/actionBarSize"

The Simple solution that is working for me for now is,
Get Navigation bar height and set padding to root layout of activity in OnCreate() after setContentView.

.....
     int navHeight = getNavHeight();
     if (navHeight > 0) {
         (findViewById(R.id.rlMain)).setPadding(0, 0, 0, navHeight);
     }
.....

private int getNavHeight() {
     if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
         return 0;
     try {
         Resources resources = getResources();
         int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
         if (resourceId > 0) {
             return resources.getDimensionPixelSize(resourceId);
         }
     } catch (Exception ex) {
         return 0;
     }
     return 0;
 }