Electrum won't connect to EPS anymore

I had EPS and Electrum working for a while. Everything was working fine, however the Electrum stopped connecting to EPS. Already tried to reinstall both Electrum and EPS, and the problem persists.
I connect Electrum to EPS by Tor. Tor is running on both machines, server and client. EPS is configured to listen to <IP_ADDRESS>:50002 and on the server the Tor is listening port 50002 and routing the connection to <IP_ADDRESS>:50002, so it's configured right.
EPS log shows it's listening:
Apr 16 10:05:45 node electrum-personal-server[29658]: INFO:2020-04-16 10:05:45,616: Obtaining bitcoin addresses to monitor . . .
Apr 16 10:07:46 node electrum-personal-server[29658]: INFO:2020-04-16 10:07:46,259: Obtained list of addresses to monitor in<PHONE_NUMBER>1425476sec
Apr 16 10:07:46 node electrum-personal-server[29658]: INFO:2020-04-16 10:07:46,260: Building history with 8000 addresses . . .
Apr 16 10:07:49 node electrum-personal-server[29658]: INFO:2020-04-16 10:07:49,550: Found 400 txes. History built in 2.6385152339935303sec
Apr 16 10:07:49 node electrum-personal-server[29658]: INFO:2020-04-16 10:07:49,551: Starting electrum server
Apr 16 10:07:49 node electrum-personal-server[29658]: INFO:2020-04-16 10:07:49,700: Listening for Electrum Wallet on ('<IP_ADDRESS>', 50002)

However Electrum can't connect to it:
20200416T131257.241344Z |     INFO | network | connecting to xxxxxx.onion:50002:t as new interface
20200416T131259.347902Z |     INFO | interface.[xxxxxx.onion:50002] | disconnecting due to: CancelledError()
20200416T131259.349079Z |     INFO | network | couldn't launch iface xxxxxx.onion:50002:t -- CancelledError()

On another server I have Electrs running over Tor as well and Electrum connects fine. I'm not sure what's causing this issue

Thanks for the issue.
Do this: run electrum with the command line argument -v, then go the Qt console and type network.debug = True. Then you should get lots more debug information on the command line. Hopefully that will provide more clues.

This is the log from Electrum:
I/n | network | network: retrying connections
I/n | network | connecting to xxxxxxx.onion:50002:t as new interface
D/i | interface.[xxxxxxxx.onion:50002] | <-- ('server.version', ['electrum/3.3.8', '1.4']) {} (id: 1)
I/i | interface.[xxxxxxxxx.onion:50002] | disconnecting due to: CancelledError()
I/n | network | couldn't launch iface xxxxxxxxx.onion:50002:t -- CancelledError()

I'm getting the same, running EPS version 0.1.6. Bitcoin version <IP_ADDRESS> and Electrum version 4.1.5.
Electrum shows red dot for network connection.
EPS logging:
INFO:2022-01-09 23:07:09,916: Obtaining bitcoin addresses to monitor . . .
INFO:2022-01-09 23:07:22,583: Obtained list of addresses to monitor in 12.708663940429688sec
INFO:2022-01-09 23:07:22,584: Building history with 2000 addresses . . .
INFO:2022-01-09 23:07:22,792: Found xx txes. History built in 0.14480090141296387sec
INFO:2022-01-09 23:07:22,978: Starting electrum server
INFO:2022-01-09 23:07:22,978: Listening for Electrum Wallet on ('<IP_ADDRESS>', 50002)
INFO:2022-01-09 23:07:25,477: Electrum connected from ('<IP_ADDRESS>', 53104)
INFO:2022-01-09 23:07:25,479: Electrum wallet disconnected
INFO:2022-01-09 23:07:27,826: Electrum connected from ('<IP_ADDRESS>', 53106)
INFO:2022-01-09 23:07:27,827: Electrum wallet disconnected
INFO:2022-01-09 23:07:32,638: Electrum connected from ('<IP_ADDRESS>', 53108)
INFO:2022-01-09 23:07:32,639: Electrum wallet disconnected
INFO:2022-01-09 23:07:41,071: Electrum connected from ('<IP_ADDRESS>', 53110)
INFO:2022-01-09 23:07:41,071: Electrum wallet disconnected

electrum -v logging:
I | simple_config.SimpleConfig | electrum directory /home/test/.electrum
I | logging | Electrum version: 4.1.5 - https://electrum.org - https://github.com/spesmilo/electrum
I | logging | Python version: 3.8.12 (default, Aug 31 2021, 01:23:42) [GCC]. On platform: Linux-5.15.12-1-default-x86_64-with-glibc2.34
I | logging | Logging to file: None
I | logging | Log filters: verbosity '*', verbosity_shortcuts ''
I/p | plugin.Plugins | registering hardware bitbox02: ('hardware', 'bitbox02', 'BitBox02')
I/p | plugin.Plugins | registering hardware coldcard: ('hardware', 'coldcard', 'Coldcard Wallet')
I/p | plugin.Plugins | registering hardware digitalbitbox: ('hardware', 'digitalbitbox', 'Digital Bitbox wallet')
I/p | plugin.Plugins | registering hardware keepkey: ('hardware', 'keepkey', 'KeepKey wallet')
I/p | plugin.Plugins | registering hardware ledger: ('hardware', 'ledger', 'Ledger wallet')
I/p | plugin.Plugins | registering hardware safe_t: ('hardware', 'safe_t', 'Safe-T mini wallet')
I/p | plugin.Plugins | registering hardware trezor: ('hardware', 'trezor', 'Trezor wallet')
I/p | plugin.Plugins | registering wallet type ('2fa', 'trustedcoin')
D | util.profiler | Plugins.__init__ 0.0068
I/n | network | blockchains [0]
I | exchange_rate.FxThread | using exchange CoinGecko
D | util.profiler | Daemon.__init__ 0.0012
I | daemon.Daemon | launching GUI: qt
I/n | network | starting network
I/n | network | setting proxy None
I | daemon.Daemon | starting taskgroup.
I/n | network | connecting to <IP_ADDRESS>:50002:s as new interface
I/n | network | starting taskgroup.
I/i | interface.[<IP_ADDRESS>:50002] | disconnecting due to GracefulDisconnect("server violated protocol-version-negotiation. we asked for '1.4', they sent 1.4")
I/n | network | couldn't launch iface <IP_ADDRESS>:50002:s -- CancelledError()
I | gui.qt.history_list | could not import electrum.plot. This feature needs matplotlib to be installed.
I | gui.qt.ElectrumGui | Qt GUI starting up... Qt=5.15.2, PyQt=5.15.6
D | util.profiler | ElectrumGui.__init__ 0.0564
I | storage.WalletStorage | wallet path /home/test/.electrum/wallets/watch
I | storage.WalletStorage | wallet path /home/test/.electrum/wallets/watch
I/n | network | connecting to <IP_ADDRESS>:50002:s as new interface
I/i | interface.[<IP_ADDRESS>:50002] | disconnecting due to GracefulDisconnect("server violated protocol-version-negotiation. we asked for '1.4', they sent 1.4")
I/n | network | couldn't launch iface <IP_ADDRESS>:50002:s -- CancelledError()
I/n | network | connecting to <IP_ADDRESS>:50002:s as new interface
I/i | interface.[<IP_ADDRESS>:50002] | disconnecting due to GracefulDisconnect("server violated protocol-version-negotiation. we asked for '1.4', they sent 1.4")
I/n | network | couldn't launch iface <IP_ADDRESS>:50002:s -- CancelledError()
D | util.profiler | WalletDB._load_transactions 0.0122
D | util.profiler | AddressSynchronizer.load_local_history 0.0006
D | util.profiler | AddressSynchronizer.check_history 0.0010
D | util.profiler | AddressList.update 0.0000
D | util.profiler | Deterministic_Wallet.try_detecting_internal_addresses_corruption 0.0113
D | util.profiler | ElectrumWindow.load_wallet 0.0251
I | gui.qt.history_list.HistoryModel | refreshing... reason: update_tabs
D | util.profiler | Abstract_Wallet.get_full_history 0.0057
D | util.profiler | HistoryModel.refresh 0.0118
D | util.profiler | AddressList.update 0.0000
I | gui.qt.update_checker.UpdateCheckThread | valid sig for version announcement '4.1.5' from address '13xjmVAB1EATPP8RshTE8S8sNwwSUM9p1P'
I | gui.qt.ElectrumGui | starting Qt main loop
I/n | network | connecting to <IP_ADDRESS>:50002:s as new interface
I/i | interface.[<IP_ADDRESS>:50002] | disconnecting due to GracefulDisconnect("server violated protocol-version-negotiation. we asked for '1.4', they sent 1.4")
I/n | network | couldn't launch iface <IP_ADDRESS>:50002:s -- CancelledError()
I/n | network | connecting to <IP_ADDRESS>:50002:s as new interface
I/i | interface.[<IP_ADDRESS>:50002] | disconnecting due to GracefulDisconnect("server violated protocol-version-negotiation. we asked for '1.4', they sent 1.4")
I/n | network | couldn't launch iface <IP_ADDRESS>:50002:s -- CancelledError()
I/n | network | connecting to <IP_ADDRESS>:50002:s as new interface
I/i | interface.[<IP_ADDRESS>:50002] | disconnecting due to GracefulDisconnect("server violated protocol-version-negotiation. we asked for '1.4', they sent 1.4")
I/n | network | couldn't launch iface <IP_ADDRESS>:50002:s -- CancelledError()
I/n | network | connecting to <IP_ADDRESS>:50002:s as new interface
I/i | interface.[<IP_ADDRESS>:50002] | disconnecting due to GracefulDisconnect("server violated protocol-version-negotiation. we asked for '1.4', they sent 1.4")
I/n | network | couldn't launch iface <IP_ADDRESS>:50002:s -- CancelledError()
I | gui.qt.main_window.[watch] | close_wallet /home/test/.electrum/wallets/watch
I | storage.WalletStorage | saved /home/test/.electrum/wallets/watch
D | util.profiler | WalletDB._write 0.0554
I | daemon.Daemon | on_stop() entered. initiating shutdown
I | gui.qt.ElectrumGui | closing GUI
I | daemon.Daemon | stopping all wallets
I | daemon.Daemon | stopping network and taskgroup
I/n | network | stopping network
I | daemon.Daemon | taskgroup stopped.
I/n | network | taskgroup stopped.
I | daemon.Daemon | removing lockfile
I | daemon.Daemon | stopped
I/p | plugin.Plugins | stopped

Firewall is turned off.

Thanks for the report @realSConway

SOLVED (at my end): upgraded EPS version 0.2.2 (I was on 0.1.6)


boards: nucleo_wb55rg: Add link to reference manual

This was missing from board documentation.
Signed-off-by: Erwan Gouriou<EMAIL_ADDRESS>

Does this require backporting?

@erwango @galak ^^

Does this require backporting?

No, I think this board port is new in 2.0 timeframe.


[QUESTION] Authentication for StreamingResponse

Description
I followed the excellent guide to implement oauth authentication (with JWT) from the docs.
However, when I'm linking directly to files in the browser (files are returned with starlette.responses.StreamingResponse), it is not possible to set the headers and the Bearer token.
Is it possible to authenticate in some other way, for example by using query string parameters or short lived temporary tokens?
Additional context
My workaround is to handle it in the front end as described in this Stack Overflow post https://stackoverflow.com/a/43133108

In general, you should avoid relying solely on query parameters for authentication as urls may not be well secured (e.g., could show up in link history in a shared browser).
Depending on your security requirements, if you don't want to make use of a front-end trick like the one you linked, you could

Create a short-term link with an expiration (this should be possible using pyjwt or itsdangerous) -- the signed claims could be passed as a query or path parameter
Optionally, restrict the link to a single (or small number) of uses, if you also control the file sharing.

Separately, I'm not very knowledgeable about browsers, but might it be possible to use a cookie for this use case? If a set cookie can be read from the browser even when just a link is clicked, then you should be able to use the usual token-based auth without a problem.

Thank you for your answer.
I will investigate the proposed solutions and see what will work.

As @dmontagu says, a short-lived URL would work. That would be especially useful if you want users to be able to share the link for someone else to download the file with a short expiration.
On the other side, yep, you could set a cookie with the token in the same response with the token in JSON (during login).
Then you would create a dependency that checks for a bearer token OR a cookie.


feat: Generate new standard non-security compose file with UI included

Removed all stand-alone UI files, commands and options
closes
Signed-off-by: lenny<EMAIL_ADDRESS>PR Checklist
Please check if your PR fulfills the following requirements:

[ ] Tests for the changes have been added (for bug fixes / features)
[ ] Docs have been added / updated (for bug fixes / features)

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-examples/blob/master/.github/CONTRIBUTING.md.
What is the current behavior?
UI is a stand-alone compose file that must be run separately after running the main compose file. Both must be run with the -p edgex option so the UI compose can find the edgex network.
Issue Number:  #134
What is the new behavior?
New standard non-security compose file with UI included is now generated. This compose is only one that needs to be started.
Does this PR introduce a breaking change?

[ ] Yes
[x] No

Specific Instructions
Are there any specific instructions or things that should be known prior to reviewing?
Other information

recheck


Optionally capture source code representations for all traits.

The current macro expansion implementation for @Test and @Suite checks for known patterns corresponding to tags (i.e. the .tags() trait) and injects additional code to capture the source code of each tag.
This change generalizes that logic by adding a requirement to the Trait protocol that the macro expansion calls for all traits. It passes the source code of the trait expression as well as the source code of each argument to the trait (if it's a function call.) The macro expansion thus no longer needs to recognize the Tag.List trait type specifically.
The source code representations are captured as autoclosures to avoid evaluating them if not needed. The default implementation of the requirement ignores them, so for a typical trait there is no effect. Tag.List implements the requirement and maps the argument source code representations to its tags.
This change also removes the overload of .tags() that takes a sequence as it makes expressions like .tags(foo) ambiguous.
Checklist:

[x] Code and documentation should follow the style of the Style Guide.
[x] If public symbols are renamed or modified, DocC references should be updated.

@swift-ci please test

@swift-ci please test

@swift-ci please test

@swift-ci please test

@swift-ci please test

Rebased.

Rebased.

@swift-ci please test

@swift-ci please test

@swift-ci please test macOS


Fix fill_builder_info

close https://github.com/huggingface/datasets-server/issues/1374

Codecov Report
Patch coverage has no change and project coverage change: +2.16 :tada:

Comparison is base (6865d8f) 89.46% compared to head (52e40d8) 91.62%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1375      +/-   ##
==========================================
+ Coverage   89.46%   91.62%   +2.16%
==========================================
  Files         151       70      -81
  Lines        7518     4347    -3171
==========================================
- Hits         6726     3983    -2743
+ Misses        792      364     -428

Flag
Coverage Δ

jobs_cache_maintenance
?

jobs_mongodb_migration
?

services_admin
?

services_api
?

services_worker
91.62% <0.00%> (-0.03%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

.../src/worker/job_runners/config/parquet_and_info.py
79.67% <0.00%> (-0.26%)
:arrow_down:

... and 81 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


crowdsec: 1.4.2 -> 1.4.3

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/crowdsecurity/crowdsec/releases.
meta.description for crowdsec is: "CrowdSec is a free, open-source and collaborative IPS"
meta.homepage for crowdsec is: "https://crowdsec.net/"
meta.changelog for crowdsec is: "https://github.com/crowdsecurity/crowdsec/releases/tag/v1.4.3"
Updates performed

Version update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact

Checks done (click to expand)

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.4.3 with grep in /nix/store/8jflicl95jljfm4hrrm9njg4kk0mqrv2-crowdsec-1.4.3
found 1.4.3 in filename of file in /nix/store/8jflicl95jljfm4hrrm9njg4kk0mqrv2-crowdsec-1.4.3

Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

First fifty rebuilds by attrpath
crowdsec

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/8jflicl95jljfm4hrrm9njg4kk0mqrv2-crowdsec-1.4.3 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A crowdsec https://github.com/r-ryantm/nixpkgs/archive/3e1ee6897bb7cf1f5b084dd576bf197070711d16.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/8jflicl95jljfm4hrrm9njg4kk0mqrv2-crowdsec-1.4.3
ls -la /nix/store/8jflicl95jljfm4hrrm9njg4kk0mqrv2-crowdsec-1.4.3/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

crowdsec

Maintainer pings
cc @06kellyjac @urandom2 for testing.

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/prs-already-reviewed/2617/717


Feature: Add simple array validation rules

Detailed description
Most current rules don't seem to support a property (object) containing an array.
Context
Given the following:
security:
  - A
    - aaa
  - B
    - bbb

I would like to check if the security property contains at least one of A, B or C
I thought or might do it, but it turns out most of the rules don't quite support this array structure.

Is this not described properly? too wide? or could already be achieved somehow?

Not completely sure, but when #239 is merged you can try with using $key as a parameter and make a regex for it. Not the most beautiful way but it might work.
I created the following rule to make sure an oauth2 security scheme is defined:

  {
       "name":"security-scheme-oauth2",
       "object": "securityScheme",
       "enabled": true,
       "description": "must define an oauth2 security scheme",
       "pattern": { "property": "type", "value": "oauth2" }
   }

You might want to anchor that regex value, just in case.

It's been merged, so you can pull and try with master, or use docker run wework/speccy:nightly lint foo.yaml.


scrcpy snap not found on debian 10/buster

[x ] I have read the FAQ.
[x ] I have searched in existing issues.

Environment

OS: [e.g. Debian, Windows, macOS...]
scrcpy version: [e.g. 1.12.1]
installation method: [e.g. manual build, apt, snap, brew, Windows release...]
device model:
Android version: [e.g. 10]

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
$ uname -srm
Linux 5.4.0-0.bpo.4-amd64 x86_64
$ snap list
Name    Version    Rev   Tracking       Publisher   Notes
core    16-2.45.2  9665  latest/stable  canonical✓  core
core18  20200724   1885  latest/stable  canonical✓  base
scrcpy  v1.15.1    238   latest/stable  sisco311    -
Describe the bug
A clear and concise description of what the bug is.
I installed scrcpy via snap, but it doesn't seem to be in my $PATH. I rebooted and it's still not found
On errors, please provide the output of the console (and adb logcat if relevant).
$ scrcpy
bash: scrcpy: command not found
$ whereis scrcpy
scrcpy:
$ which scrcpy
$

Please do not post screenshots of your terminal, just post the content as text instead.

Posting to scrcpy-snap instead.


added docs on withEnv & withGlobalEnv

fixes #293

Codecov Report

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

@@           Coverage Diff           @@
##           master     #295   +/-   ##
=======================================
  Coverage   76.04%   76.04%
=======================================
  Files          38       38
  Lines         981      981
  Branches      233      233
=======================================
  Hits          746      746
  Misses        122      122
  Partials      113      113

Continue to review full report at Codecov.

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

Can you update the CHANGELOG to include your change?

Otherwise, looks great, thanks!


feat(CategoryTheory/Abelian/GrothendieckAxioms): introduce Grothendieck categories

Define Grothendieck categories, i.e. AB5 categories with a separator, in a new separate file and prove that they are complete and cocomplete.
In order to facilitate the proof, the new lemma hasLimits_of_hasColimits_of_hasSeparator (a variant of hasLimits_of_hasColimits_of_isSeparating) and its dual is introduced in AdjointFunctorTheorems.lean.

Could you expand a little bit the PR description (your top comment above) in order to relate more completely the content of the PR (which was expanded a little bit in the process)?


Demo - typology interdicted but light not red

The transaction was blocked, but there were no red typology lights.  I would expect at least one.

Typology 095 in the database shows that the result score exceeded the interdictionthreshold, and the typology 095 light should have been red.  The typology score in the UI showed null

The evaluation status in the database is ALRT, so it is correct that the transaction was blocked

Tested and confirmed that all rule and typology lights are now consistently RAG


Code Standard

To enable easier collaboration, would you like to implement a linter and a code standard for this project? Do you have a standard that you prefer? Standard is easy and doesn't require configuration. But there are others that you may prefer.
At minimum, it would remind me to put ; at the end of every line! 🙂
I could submit a pull request to implement this, if you're open to it.

Closing this issue now as there is a related pull request which should be merged soon.


Bug: display editor is empty if we did not access details of related views before

console error: model is not defined
const getWidgetViewModel = useCallback(
(viewId: number) => {
const viewModel = formedViews[viewId].model

console error: model is not defined
webapp/app/containers/Display/Editor/SlideLayerList.tsx line:118
const getWidgetViewModel = useCallback(
(viewId: number) => {
const viewModel = formedViews[viewId].model

Please provide reproduction steps to check it as a bug or not.

maybe some thing wrong with my dev env.
modify webpack to put index.html and share.html to build dir, and others to build/dist.
then use npm run the web ui and proxy /api to intellij which run the server.
in this way,  it report the error.
if i change nothing, it wont happen.

OK, I will close the PR. If you find new problem with it, please reopen this issue and leave your comment.


invalid driver name when building in xcode

I have a project that builds and runs fine when executed from bazel, but fails with the below error when the generated project is run in xcode:
error: Unexpected error in driver invocation: invalid driver name: swiftc_stub

I ran into this and added added a user defined build setting SWIFT_USE_INTEGRATED_DRIVER=NO in the generated project to get past it.  It looks like it's related to Xcode 14 deprecations.  I haven't figure out how to add it to xchammer though.
https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes#Deprecations


Observe changes to turbo-frame[disabled]

When a Turbo Frame declares the [disabled] attribute, prevent any
navigation.
Once removed, if a Turbo Frame's [loading="eager"] and [src] exists,
navigate the frame.

Great find and fix.


rasa data validate error, schema issue

rasa data validate fails on the Sara/rasa-demo config.yml with the error: You have provided an invalid key token_pattern for component 'CountVectorsFeaturizer' in your pipeline. Valid options for 'CountVectorsFeaturizer' are:
Sara uses token_pattern here.
The docs do not state that CountVectorsFeaturizer supports token_pattern but it looks like this is supported in the code.
Rasa version: 2.2.2

Hi @rgstephens, we decided not to expose this parameter as we're trying to keep tokenization-related parameters in the tokenizers. The Sara parameters are actually the default for "analyzer":"word". I'll make a new issue on the Sara repo to change this.

similar error throws on command rasa train on docker image rasa/rasa:2.4.0-full but instead of token_pattern its model_confidence.

@adamfeher64 can you share your config file?


Find a guide should filter all guides not just getting started ones

I think it would be great if https://spring.io/guides could be modified to make the "Find a guide" textbox filtering all guides not just getting started ones. I found currently behavior pretty confusing while trying to reach the Kotlin tutorial:

Find a guide textbox position and label makes not obvious that it filters only getting started ones
I type Kotlin
I see "No result found"
I have to scroll down to see the Kotlin tutorial

Closing in favour of #1033


Fix eslint

Codecov Report
Patch and project coverage have no change.

Comparison is base (ef445ab) 100.00% compared to head (089e4be) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #17   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            4         4
  Lines          331       331
  Branches        64        64
=========================================
  Hits           331       331

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


Python API: comparison operators and returning NotImplemented

Currently, if you a perform an (in-)equality comparison of a python wrapped clingo object with another object of a different type the behaviour is to return that the objects are not equal.
For example, looking at the Symbol object and comparing with a non-Symbol object, the following works:
  func = clingo.Function("somefunc",[])
  assert  func != 3          # assertion passes

However, from what I can gather this is not considered good idiomatic python behaviour. Instead I think the correct thing to do is to return NotImplemented.  The reason is that by returning NotImplemented the python interpreter can try different ways of satisfying the comparison; such as reversing the comparison.
To makes things concrete...  The following is not exactly what I'm doing but gives the right idea:
class Wrapper(object):
    def __init__(self, symbol):
        self._symbol=symbol
   def  __eq__(self, other):
       if isinstance(other,Wrapper):
            return self._symbol == other._symbol
       elif type(other) == clingo.Symbol:
            return self._symbol == other
       else:
           return NotImplemented

func = clingo.Function("somefunc",[])
wfunc = Wrapper(Function("somefunc",[]))

assert wfunc == func        # this holds
assert func != wfunc        # but so does this!

The two asserts above show the resulting unintuitive behaviour (note: I'm assuming the __ne__ operator defined appropriately). The reason is that the first assert calls the Wrapper equality operator while the second calls the inbuilt Symbol equality operator. However, if the Symbol operator was changed to return NotImplemented then, from what I've read, the python interpreter would be smart enough to try the reverse comparison, and would then call the Wrapper equality operator.
From what I can see making the change would be in libpyclingo/pyclingo.cc, line 910 and would be a matter of returning Py_NotImplemented (or the macro Py_RETURN_NOTIMPLEMENTED). This may also be a better return value for the ordered comparison operators which current generate an "unorderable types" error.
I'm happy to try and make this change and create a pull request, but wasn't sure if you'd agree that this was the correct behaviour.

The objects in the clingo API have been designed with the idea in mind that comparisons across different types are not necessary. Because I am not a fan of this. But this does not mean we cannot implement your request. There is no harm in offering this functionality. We might have to replace the whole block from line 910 to 923 with Py_RETURN_NOTIMPLEMENTED. I have to consult my Python book before doing this. :wink:

Great, thanks. Have a look at it and see what you think. I tested it out and it seems to work as expected, but I'm also not sure if it would cause some unintended behaviour changes.


adding responsiveness in mobile view

Hello , the issue #95  is done by me as you assigned me this issue, thanks for your corporation.pls assign level tag.
https://github.com/user-attachments/assets/6efb7de5-5e95-4221-83e2-89f87cf26401

Also, resolve the conflicts


Needs means of deploying the Job Execution Runtime

As a user
I want infrastructure as code
So it can be invoke to achieve deployment of the runtime to the specified env

GIVEN there exists declared deployments
WHEN invoked
THEN relevant artifacts are build
AND deployed to a target environment

basing this on prefect is not 'the way'... gonna try flask3 + celery.

celery job state diagram:

would be nice to select and submit jobs via a flask3 API and let celery handle execution.

will focus effort for this ticket on an 'ability to run containers with docker-compose'


feat: port Analysis.InnerProductSpace.Spectrum

[x] depends on: #4920

This PR/issue depends on:

leanprover-community/mathlib4#4920
By Dependent Issues (🤖). Happy coding!

This PR/issue depends on:

leanprover-community/mathlib4#4920
By Dependent Issues (🤖). Happy coding!

Thanks :tada:
bors merge


sputils.list does not pass tests

When I run npm test I get these warnings:

I can't repro by using npm test but if I use jscs directly, I get the errors too. I'll update the jscs rc to ignore this tag (even though it does exist http://usejsdoc.org/tags-memberof.html)

@mirontoli was it fixed for you? Otherwise reopen, please :smiley:


Store all Intermittent Files into Configured Storage

Store all intermittent files (including files generated by query generator or any other script) into configured storage - s3/azure/on-premise

This issue is not covered in v5.0  To be analysed

This is addressed in cQube v5.0


Verify password token : key does not exist?

https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/490c554e23343eec0736b06e59b2108fdd057fdc/{{cookiecutter.project_slug}}/backend/app/app/utils.py#L104
Shouldn't it be "sub" instead of "email"?

Yep, I think this is fixed here: https://github.com/tiangolo/full-stack-fastapi-postgresql/pull/172
I have to review a lot of PRs and revamp this repo, but first I want to finish things in SQLModel, I made it for this repo. Hopefully soon! 🤞

Sorry for the long delay! 🙈  I wanted to personally address each issue/PR and they piled up through time, but now I'm checking each one in order.


Unable to adjust the color for "Cancel" and "Ok" button in datePicker dialog

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Use case
I have default date picker and I can see, there are number of params I can pass but there is an issue related to the color scheme for "Ok" and "Cancel" button.
I can't see anywhere to pass the button theme. Always it is taking the same style that have been provided for default TextButton.
For example, I am changing the theme for TextButton, and would like to have a different color for both buttons in DatePicker, I am not able to do that because it is using the same theme from TextButton.

In below example:  if I am changing the theme for TextButton, I can see the buttons looks quite weird.
import 'package:flutter/material.dart';
void main() {
  runApp(const MyApp());
}
class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
        textButtonTheme: TextButtonThemeData(
          style: ButtonStyle(
            backgroundColor: MaterialStateProperty.resolveWith((states) => Colors.red)
          )
        ),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
  void _incrementCounter() {
    showDatePicker(
      context: context,
      initialDate: DateTime.now(),
      firstDate: DateTime(1995),
      lastDate: DateTime(2050),
    );
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'DatePicker',
        child: const Icon(Icons.date_range_rounded),
      ),
    );
  }
}

it totally looks weird.
Proposal
I would like to propose and contribute(Open a pull request) in improving the theme for datePicker and here are 2 approaches:

Provide the separate color material property in DatePickerThemeData, where user can adjust the theme for the dialog's action buttons
Where user can pass the cancelText in Future<DateTime?> showDatePicker();, user should be allowed to pass the respective color for text and background

@TahaTesser might be able to help, he knows everything about date picker

Hi @muhammadmateen027
This looks like a valid issue however your proposals would more properties to DatePickerThemeData and be inconsistent with how nested components are themed in the framework.
Some widget themes are a InheritedTheme, instead of InheritedWidget. This allows capturing themes from previous route to the next route e.g new page or a dialog. InheritedTheme.capture or InheritedTheme.captureAll are used to capture themes from the widgets in a new route then InheritedTheme.wrap is used to pass captured themes to a particular widget.
For instance, it'll be quite to pass local theme to a new page, using InheritedTheme you can pass all the local themes from page one to the next pages. Likewise, widget likes popup and menu bar uses captured themes to style scrollbar for instance or any other widget.
You can see DatePickerTheme is a already a InheritedTheme.
https://github.com/flutter/flutter/blob/9cd3d0d9ff05768afa249e036acc66e8abe93bff/packages/flutter/lib/src/material/date_picker_theme.dart#L527
Instead of using global ThemeData.textButtonTheme to customise date picker text buttons aka action buttons. We should be able be to wrap TextButtonTheme to the widget opens date picker, in your FAB. However this is not currently working since the date picker doesn't used captured themes.
To fix this you will need to look into how PopupMenu and MenuBar currently use captured themes to customise its nested widget like scrollbar and implement the same in the date_picker.dart.
Here is an example where a local ScrollbarTheme is inherited by PopupMenu and MenuBar and I also added DatePicker to showcase this problem.

code sample
import 'package:flutter/material.dart';

enum SampleItem { itemOne, itemTwo, itemThree }

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
        scrollbarTheme: const ScrollbarThemeData(
          thumbColor: MaterialStatePropertyAll<Color?>(Colors.red),
        ),
        textButtonTheme: const TextButtonThemeData(
          style: ButtonStyle(
            backgroundColor: MaterialStatePropertyAll<Color?>(Colors.red),
          ),
        ),
      ),
      home: const Example(),
    );
  }
}

class Example extends StatelessWidget {
  const Example({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Nested component themes sample'),
      ),
      body: Center(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: <Widget>[
            const SizedBox(height: 20),
            ScrollbarTheme(
              data: const ScrollbarThemeData(
                thumbColor: MaterialStatePropertyAll<Color?>(Colors.green),
              ),
              child: MenuBar(
                children: <Widget>[
                  SubmenuButton(
                    menuStyle: const MenuStyle(
                      maximumSize: MaterialStatePropertyAll<Size?>(
                        Size.fromHeight(
                          600,
                        ),
                      ),
                    ),
                    menuChildren: <Widget>[
                      for (int i = 0; i < 10; i++)
                        MenuItemButton(
                          style: const ButtonStyle(
                            minimumSize: MaterialStatePropertyAll<Size>(
                                Size.fromHeight(200)),
                          ),
                          onPressed: () => print('pressed item $i'),
                          child: Text(
                            'MenuBar Item $i',
                          ),
                        ),
                    ],
                    child: const Text(
                      'MenuBar',
                    ),
                  ),
                ],
              ),
            ),
            const SizedBox(height: 20),
            ScrollbarTheme(
              data: const ScrollbarThemeData(
                thumbColor: MaterialStatePropertyAll<Color?>(Colors.green),
              ),
              child: PopupMenuButton<SampleItem>(
                child: const Text('Show PopupMenu'),
                onSelected: (SampleItem item) {},
                itemBuilder: (BuildContext context) =>
                    <PopupMenuEntry<SampleItem>>[
                  for (int i = 0; i < 10; i++)
                    PopupMenuItem<SampleItem>(
                      height: 200,
                      value: SampleItem.itemOne,
                      child: Text('Popup Item $i'),
                    ),
                ],
              ),
            ),
            const SizedBox(height: 20),
            TextButtonTheme(
              data: const TextButtonThemeData(
                style: ButtonStyle(
                  backgroundColor: MaterialStatePropertyAll<Color?>(Colors.green),
                ),
              ),
              child: FilledButton(
                onPressed: () {
                  showDatePicker(
                    context: context,
                    initialDate: DateTime.now(),
                    firstDate: DateTime(1995),
                    lastDate: DateTime(2050),
                  );
                },
                child: const Text('Date Picker'),
              ),
            ),
          ],
        ),
      ),
      bottomSheet: BottomAppBar(
          child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: <Widget>[
          // RichText Widget with "Expected Results:" in black and "Green Scrollbar" in green.
          RichText(
            text: const TextSpan(
              text: 'Expected Results: ',
              style: TextStyle(color: Colors.black),
              children: <TextSpan>[
                TextSpan(
                  text: 'Green',
                  style: TextStyle(color: Colors.green),
                ),
              ],
            ),
          ),
          // RichText Widget with "Expected Results:" in black and "Red Scrollbar" in red.
          RichText(
            text: const TextSpan(
              text: 'Actual Results: ',
              style: TextStyle(color: Colors.black),
              children: <TextSpan>[
                TextSpan(
                  text: 'Red',
                  style: TextStyle(color: Colors.red),
                ),
              ],
            ),
          ),
        ],
      )),
    );
  }
}

If it is too complicated for you, let me know.

@TahaTesser and @bernaferrari, while this works, it forces you to wrap widgets with a local Theme that is different from the overall ambient app theme.
To me, the entire point with theming, is to be able to define a global theme for your app and not have to touch widget styling any further in your app, unless it needs a one off different style.
Wrapping a part of the widget tree, with a Theme where certain UI components gets another theme, just to be able to style it to match the global desired style, is a bit of kludge and workaround for a deficiency in component (UI widget) theming and (component property) styling.
I agree with @muhammadmateen027, this is a another theming and styling feature gap in the DatePicker.
If you are making a one off styled version of component, that needs to be different (for whatever reasons) from your already globally themed styled in your app, then this pattern is correct and should be used, otherwise it is just a kludge. If I have 10 date pickers in my app, I need to do this for every one of them. Naturally I would then create a wrapper widget that does it, but still a kludge to fix a feature gap, and it is not true theming in my book.
This said, DatePicker is not the only case that suffers from similar theming feature gaps. We still have many variant widgets that cannot be themed without breaking their style and not being able to customize them, like eg these:

https://github.com/flutter/flutter/issues/123829
https://github.com/flutter/flutter/issues/118063
https://github.com/flutter/flutter/issues/107946
https://github.com/flutter/flutter/issues/108539
https://github.com/flutter/flutter/issues/115827

@TahaTesser and @bernaferrari, while this works, it forces you to wrap widgets with a local Theme that is different from the overall ambient app theme.

Widgets like popup menu and date picker are much fewer than regular widget like buttons or chips
You can also use re-use a widget a with local theme. I think using local theme for such widgets is cleaner than adding more properties to style nested widgets to an already big date picker theme.
IMO variant themes is a bit different than styling nested widgets like TextButtons in a date picker or a dialog or scrollbar in a popup menu. More complex widgets we get, that use other widgets inside them, global theming for every nested widget would get more complex and verbose.  Local themes are nice way to style such complex widgets instead of making global theme bigger and cover styling nested widgets in each of them.
Solution I suggested https://github.com/flutter/flutter/issues/127739#issuecomment-1566802619 just uses the already InheritedTheme type DatePickerTheme.  Without adding more properties to style nested widgets to date picker theme.
With that being said, i also understand  the appeal to style entire app from global themes.

Yes @TahaTesser, the solution is fine as quick fix workaround.
However, as soon as you are forced to wrap built-in components with local themes (be it a component theme or Theme) to get them to follow a desired global style, you end up in a mixed bag situation. Which then makes you contemplate that maybe I should not theme my app at all, since I cannot do it with a global theme anyway.
Enough such cases will trigger walking the path of building custom wrappers to style needed components, based on whatever way you come up with to control that (colors might still be global theme/extension derived).
This is sadly a very common approach for "custom" design languages in used by dev shops and teams. Sometimes because of theming limitations, and sometimes because they have not even bothered to try to reach their design goals via theming.
I have written about why these kind of wrappers are also a bad idea. Yes it works, but it requires that everybody working on the app knows about them and knows when to use those wrappers in a project using a "custom design language", based on custom styled wrappers. You can no longer just drop in SDK widgets and get the desired themed design.
Local theme wrapping for the global style, kind of defeats the purpose of having a theme.

Yes the linked variant issues are a bit different, but it is another example of where you need wrappers to be able to style them, because their theming breaks down their intended styling. In some cases you can get away with using widget properties, but you would probably make "styled" wrappers anyway for convenience.

Hi everyone!
Turns out showDatePicker (and showTiemPicker) already support Inherited.wrap but the local theme didn't work because of the context. You can use either of these functions in a Builder and a local theme to customize TextButtons.
This is applicable to any other widgets that push to a new route like PopUpMenuButton. As explained in https://github.com/flutter/flutter/issues/127739#issuecomment-1566802619
Here you can see I CAN  adjust the colors of the Cancel and Ok buttons in the date picker dialog.

Preview

Code sample

expand to view the code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Example(),
    );
  }
}

class Example extends StatelessWidget {
  const Example({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Sample'),
      ),
      body: Center(
        child: TextButtonTheme(
          data: TextButtonThemeData(
            style: TextButton.styleFrom(
              foregroundColor: Colors.amber[700],
              textStyle: const TextStyle(
                fontWeight: FontWeight.bold,
                fontStyle: FontStyle.italic,
              ),
            ),
          ),
          child: Builder(builder: (BuildContext context) {
            return FilledButton(
              onPressed: () async {
                final Future<DateTime?> selectedDate = showDatePicker(
                  context: context,
                  initialDate: DateTime.now(),
                  firstDate: DateTime(2018),
                  lastDate: DateTime(2030),
                );

                print(selectedDate);
              },
              child: const Text('Open DatePicker'),
            );
          }),
        ),
      ),
    );
  }
}

This should solve this issue and you can customize the both Cancel and Ok buttons just for the date picker.
Coming to the discussion in https://github.com/flutter/flutter/issues/127739#issuecomment-1568286467, this proposal will need a separate issue as it applies to multiple widgets and is wider in scope. Not effects this issue as it is solved in the code sample above.

I just found action style properties exist in the time picker theme but they were not working so i fixed them in https://github.com/flutter/flutter/pull/132843
I think it's reasonable to add them to the date picker theme for consistency and easy of use.
I also plan to fix InheritedTheme issues in a separate issue in the coming weeks.


 a11y

<rocket-navigation> has a click listener, but doesn't have interactive semantics:
    this.addEventListener('click', ev => {
      if (ev.target.classList.contains('anchor')) {
        this.dispatchEvent(new Event('close-overlay', { bubbles: true }));
      }
    });

possible solutions:

add listeners to <a> children instead of the parent

why would this be a warning? 🤔
event delegation is so much more performant and simpler to maintain then individual event listener...
can you link some details to this rule or post a screenshot of the a11y result or how to reproduce it - I'm a little baffled 😱

This report comes from by Firefox' accessibility inspector Fire up FF Developer Edition, load a rocket page (in desktop resolution) and then load any page. Switch to the accessibility view (right click an element and inspect accessibility properties) Then click the dropdown in a11y panel and scan for keyboard issues.
The error is reported on the <rocket-navigation> element.

The specific error reported is Clickable elements must be focusable and should have interactive semantics

If an element can be clicked with a pointing device, such as a mouse, then it should also be focusable using the keyboard, and the user should be able to do something by interacting with it.
An element is clickable if it has an onclick event handler defined. You can make it focusable by adding a tabindex=0 attribute value to it. You can make it operable with the keyboard by defining an onkeydown event handler; in most cases, the action taken by event handler should be the same for both types of events.

aXe doesn't seem to report this specific error.


phpPackages: set meta.mainProgram

Description of changes
Continuation of #185618
Set meta.mainProgram to be able to use lib.getExe on them.
Explicitly set the value for deployer since the binary name is different from the pname.

Things done

Built on platform(s)

[ ] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
22.11 Release Notes (or backporting 22.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

Since I don't use deployer but knew about it, I think I did check all PHP packages at that time. I am not sure about the ones added afterwards, if any.


get_sources.sh couldn't get things from c8s

...but c8 worked:
$ get_sources.sh -b c8s
Retrieving https://git.centos.org/sources/gnome-settings-daemon/c8s/92145a7a5714ebf3aeb90baaacb7e6955335731b
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found

$ get_sources.sh -b c8
Retrieving https://git.centos.org/sources/gnome-settings-daemon/c8/92145a7a5714ebf3aeb90baaacb7e6955335731b
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1339k  100 1339k    0     0   947k      0  0:00:01  0:00:01 --:--:--  948k

and the script tried to run get_sources forever

we need to pull all remote branches, this is now fixed in the onboarding script


var ObjectId = require('mongodb')   (MongoDB Driver stopped working)

Sails version: v0.11.5
Node version: v6.9.1
NPM version: 3.10.7
Operating system: Heroku Hosting

MongoDB driver stopped working abruptly, while it used to work before the way it is. It used to work this way
var ObjectId = require('mongodb')
Now it throws this error:
Sending 500 ("Server Error") response: TypeError: Argument must be a string at TypeError (native) at Buffer.write (buffer.js:761:21) at serializeObjectId (/app/node_modules/sails-mongo/node_modules/bson/lib/bson/parser/serializer.js:242:10) at serializeInto (/app/node_modules/sails-mongo/node_modules/bson/lib/bson/parser/serializer.js:699:17) at BSON.serialize (/app/node_modules/sails-mongo/node_modules/bson/lib/bson/bson.js:47:27) at Query.toBin (/app/node_modules/sails-mongo/node_modules/mongodb-core/lib/connection/commands.js:143:25) at Cursor._find (/app/node_modules/sails-mongo/node_modules/mongodb-core/lib/cursor.js:339:36) at nextFunction (/app/node_modules/sails-mongo/node_modules/mongodb-core/lib/cursor.js:670:10) at Cursor.next [as _next] (/app/node_modules/sails-mongo/node_modules/mongodb-core/lib/cursor.js:773:3) at fetchDocs (/app/node_modules/sails-mongo/node_modules/mongodb/lib/cursor.js:845:10) at toArray (/app/node_modules/sails-mongo/node_modules/mongodb/lib/cursor.js:872:3) at Cursor.toArray (/app/node_modules/sails-mongo/node_modules/mongodb/lib/cursor.js:825:44) at /app/api/controllers/ProfileController.js:87:12 at bound.native (/app/node_modules/sails-mongo/lib/adapter.js:245:7) at bound.self.(anonymous function) (/app/node_modules/waterline/lib/waterline/query/adapters.js:35:29) at bound [as native] (/app/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21) at Object.find_one (/app/api/controllers/ProfileController.js:73:9) at bound (/app/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21) at routeTargetFnWrapper (/app/node_modules/sails/lib/router/bind.js:179:5) at callbacks (/app/node_modules/express/lib/router/index.js:164:37) at param (/app/node_modules/express/lib/router/index.js:138:11) at pass (/app/node_modules/express/lib/router/index.js:145:5) TypeError: Argument must be a string at TypeError (native) at Buffer.write (buffer.js:761:21) at serializeObjectId (/app/node_modules/sails-mongo/node_modules/bson/lib/bson/parser/serializer.js:242:10) at serializeInto (/app/node_modules/sails-mongo/node_modules/bson/lib/bson/parser/serializer.js:699:17) at BSON.serialize (/app/node_modules/sails-mongo/node_modules/bson/lib/bson/bson.js:47:27) at Query.toBin (/app/node_modules/sails-mongo/node_modules/mongodb-core/lib/connection/commands.js:143:25) at Cursor._find (/app/node_modules/sails-mongo/node_modules/mongodb-core/lib/cursor.js:339:36) at nextFunction (/app/node_modules/sails-mongo/node_modules/mongodb-core/lib/cursor.js:670:10) at Cursor.next [as _next] (/app/node_modules/sails-mongo/node_modules/mongodb-core/lib/cursor.js:773:3) at fetchDocs (/app/node_modules/sails-mongo/node_modules/mongodb/lib/cursor.js:845:10) at toArray (/app/node_modules/sails-mongo/node_modules/mongodb/lib/cursor.js:872:3) at Cursor.toArray (/app/node_modules/sails-mongo/node_modules/mongodb/lib/cursor.js:825:44) at /app/api/controllers/ProfileController.js:87:12 at bound.native (/app/node_modules/sails-mongo/lib/adapter.js:245:7) at bound.self.(anonymous function) (/app/node_modules/waterline/lib/waterline/query/adapters.js:35:29) at bound [as native] (/app/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21) at Object.find_one (/app/api/controllers/ProfileController.js:73:9) at bound (/app/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21) at routeTargetFnWrapper (/app/node_modules/sails/lib/router/bind.js:179:5) at callbacks (/app/node_modules/express/lib/router/index.js:164:37) at param (/app/node_modules/express/lib/router/index.js:138:11) at pass (/app/node_modules/express/lib/router/index.js:145:5)
I used many mongodb driver versions, and all of them won't work, the current version is: 2.2.16

Hey @super-iterator<EMAIL_ADDRESS>did bump the mongo client dependency, so I wonder if maybe there's some kind of unexpected compatibility issue with that usage...  What version of sails-mongo are you using?  Also, could you provide an example of the code where you're calling a Waterline method?

Hello @mikermcneil ,
sails-mongo version is "^0.11.2"
This is the code where the exception happens at:
Profile.native(function (err,collection) {
mongo_result = collection.find( query , projection ).limit(10);  \\ Exception happens here
.... the rest of code ...
Appreciated!

Hello @mikermcneil,
Any updates regarding this issue?
Best,

@super-iterator your require should be
var ObjectId = require('mongodb').ObjectID;

if you do:
var ObjectId = require('mongodb');

you are requiring the mongodb module, not just the ObjectID class

@super-iterator take a look this pull request that I made some time ago, if you just need the native objectID then you can remove the mongo dependency.

@Josebaseba Loved it! didn't know about it.

@luislobo @Josebaseba 🙇

@super-iterator @luislobo @Josebaseba btw would love to get y'all's thoughts on this re: Sails v1.  The latest is all online now (I believe we've got the latest tagged on npm, so you can do npm install sails@edge -g, then generate a new app and do sails-mongo@beta.
Relevant docs:

https://github.com/balderdashy/sails-docs/commit/d4146956a1b947cb787b444649af7183d8d39a4f
http://next.sailsjs.com/documentation/reference/waterline-orm/datastores/manager

(There's backwards compatibility for .native() baked in as well, it just logs a warning)

@mikermcneil it looks good to me! But please check this issue that I opened a few days ago: https://github.com/balderdashy/sails-mongo/issues/448 it looks like in the new sails-mongo we loose the functionality of getting the native mongo objectId.
We should think a way to make this private method: https://github.com/balderdashy/sails-mongo/blob/master/helpers/private/query/parse-object-id.js public from anywhere.

@mikermcneil I've created a project that uses both sails-mongo and sails-mysql, User is in mysql, Product is in mongo, so far, so good! everything populates and works :P
https://github.com/luislobo/test-sails-1.0.0-22
sails> User.find().populate('bestFriend').populate('favoriteProducts').exec(console.log)
undefined
sails> undefined [ RowDataPacket {
    createdAt:<PHONE_NUMBER>437,
    updatedAt:<PHONE_NUMBER>437,
    id: 1,
    luckyNumber: 12381,
    bestFriend: null,
    favoriteProducts: [] },
  RowDataPacket {
    createdAt:<PHONE_NUMBER>506,
    updatedAt:<PHONE_NUMBER>506,
    id: 3,
    luckyNumber: 121,
    bestFriend: null,
    favoriteProducts: [] },
  RowDataPacket {
    createdAt:<PHONE_NUMBER>337,
    updatedAt:<PHONE_NUMBER>337,
    id: 4,
    luckyNumber: 523,
    bestFriend:
     RowDataPacket {
       createdAt:<PHONE_NUMBER>437,
       updatedAt:<PHONE_NUMBER>437,
       id: 1,
       luckyNumber: 12381,
       bestFriend: null },
    favoriteProducts: [] },
  RowDataPacket {
    createdAt:<PHONE_NUMBER>930,
    updatedAt:<PHONE_NUMBER>930,
    id: 6,
    luckyNumber: 52123,
    bestFriend:
     RowDataPacket {
       createdAt:<PHONE_NUMBER>337,
       updatedAt:<PHONE_NUMBER>337,
       id: 4,
       luckyNumber: 523,
       bestFriend: 1 },
    favoriteProducts: [] },
  RowDataPacket {
    createdAt:<PHONE_NUMBER>863,
    updatedAt:<PHONE_NUMBER>863,
    id: 8,
    luckyNumber: 412,
    bestFriend:
     RowDataPacket {
       createdAt:<PHONE_NUMBER>506,
       updatedAt:<PHONE_NUMBER>506,
       id: 3,
       luckyNumber: 121,
       bestFriend: null },
    favoriteProducts: [ [Object], [Object] ] } ]

👍  sweet, thanks @luislobo!
@Josebaseba Alright, you can now get access to the underlying client library by doing e.g.:
Product.getDatastore().driver.mongodb;

Or if mongo is your default datastore:
sails.getDatastore().driver.mongodb;

Or if it's not your default datastore, but you don't want to have to think about which model it is:
sails.getDatastore('productInfoDb').driver.mongodb;

So to build an object id instance for a native query, you might do:
var ObjectID = Product.getDatastore().driver.mongodb.ObjectID;
var objectId = new ObjectID(id);

@Josebaseba @luislobo If ObjectID casting is something you're doing pretty frequently in apps using Mongo (like in >3 different files), I think it makes sense to make it a little easier.  But otherwise, in the interest of time, simplicity, and keeping stuff in core as lightweight as possible, I'd say we leave it at that.  As it is, this way we can copy the same approach for other adapters (using the npm package name of the underlying library as the name of the key: e.g. driver.mysql, driver.pg, driver.redis, driver.nedb, etc.) and you get access to all the database-specific goodies:
sails> Activity.getDatastore().driver.mongodb
{ [Function]
  MongoError: { [Function: MongoError] create: [Function] },
  Admin:
   { [Function]
     define:
      { name: 'Admin',
        object: [Circular],
        stream: false,
        instrumentations: [Object] } },
  MongoClient:
   { [Function: MongoClient]
     define:
      { name: 'MongoClient',
        object: [Circular],
        stream: false,
        instrumentations: [Object] },
     connect: [Circular] },
  Db:
   { [Function]
     super_:
      { [Function: EventEmitter]
        EventEmitter: [Circular],
        usingDomains: true,
        defaultMaxListeners: 10,
        init: [Function],
        listenerCount: [Function] },
     define:
      { name: 'Db',
        object: [Circular],
        stream: false,
        instrumentations: [Object] },
     SYSTEM_NAMESPACE_COLLECTION: 'system.namespaces',
     SYSTEM_INDEX_COLLECTION: 'system.indexes',
     SYSTEM_PROFILE_COLLECTION: 'system.profile',
     SYSTEM_USER_COLLECTION: 'system.users',
     SYSTEM_COMMAND_COLLECTION: '$cmd',
     SYSTEM_JS_COLLECTION: 'system.js' },
  Collection:
   { [Function]
     define:
      { name: 'Collection',
        object: [Circular],
        stream: false,
        instrumentations: [Object] } },
  Server:
   { [Function]
     super_:
      { [Function: EventEmitter]
        EventEmitter: [Circular],
        usingDomains: true,
        defaultMaxListeners: 10,
        init: [Function],
        listenerCount: [Function] },
     define:
      { name: 'Server',
        object: [Circular],
        stream: false,
        instrumentations: [Object] } },
  ReplSet:
   { [Function]
     super_:
      { [Function: EventEmitter]
        EventEmitter: [Circular],
        usingDomains: true,
        defaultMaxListeners: 10,
        init: [Function],
        listenerCount: [Function] },
     define:
      { name: 'ReplSet',
        object: [Circular],
        stream: false,
        instrumentations: [Object] } },
  Mongos:
   { [Function]
     define:
      { name: 'Mongos',
        object: [Circular],
        stream: false,
        instrumentations: [Object] },
     super_:
      { [Function: EventEmitter]
        EventEmitter: [Circular],
        usingDomains: true,
        defaultMaxListeners: 10,
        init: [Function],
        listenerCount: [Function] } },
  ReadPreference:
   { [Function]
     isValid: [Function],
     PRIMARY: 'primary',
     PRIMARY_PREFERRED: 'primaryPreferred',
     SECONDARY: 'secondary',
     SECONDARY_PREFERRED: 'secondaryPreferred',
     NEAREST: 'nearest' },
  GridStore:
   { [Function: GridStore]
     define:
      { name: 'Gridstore',
        object: [Circular],
        stream: true,
        instrumentations: [Object] },
     DEFAULT_ROOT_COLLECTION: 'fs',
     DEFAULT_CONTENT_TYPE: 'binary/octet-stream',
     IO_SEEK_SET: 0,
     IO_SEEK_CUR: 1,
     IO_SEEK_END: 2,
     exist: [Function],
     list: [Function],
     read: [Function],
     readlines: [Function],
     unlink: [Function] },
  Chunk: { [Function] DEFAULT_CHUNK_SIZE: 261120 },
  Logger:
   { [Function]
     reset: [Function],
     currentLogger: [Function],
     setCurrentLogger: [Function],
     filter: [Function],
     setLevel: [Function] },
  Cursor:
   { [Function]
     super_:
      { [Function: Readable]
        ReadableState: [Function: ReadableState],
        super_: [Object],
        _fromList: [Function: fromList] },
     define:
      { name: 'Cursor',
        object: [Circular],
        stream: true,
        instrumentations: [Object] },
     INIT: 0,
     OPEN: 1,
     CLOSED: 2,
     GET_MORE: 3 },
  GridFSBucket:
   { [Function: GridFSBucket]
     super_:
      { [Function: EventEmitter]
        EventEmitter: [Circular],
        usingDomains: true,
        defaultMaxListeners: 10,
        init: [Function],
        listenerCount: [Function] } },
  CoreServer:
   { [Function]
     super_:
      { [Function: EventEmitter]
        EventEmitter: [Circular],
        usingDomains: true,
        defaultMaxListeners: 10,
        init: [Function],
        listenerCount: [Function] },
     enableServerAccounting: [Function],
     disableServerAccounting: [Function],
     servers: [Function] },
  CoreConnection:
   { [Function]
     super_:
      { [Function: EventEmitter]
        EventEmitter: [Circular],
        usingDomains: true,
        defaultMaxListeners: 10,
        init: [Function],
        listenerCount: [Function] },
     enableConnectionAccounting: [Function],
     disableConnectionAccounting: [Function],
     connections: [Function] },
  Binary:
   { [Function: Binary]
     BUFFER_SIZE: 256,
     SUBTYPE_DEFAULT: 0,
     SUBTYPE_FUNCTION: 1,
     SUBTYPE_BYTE_ARRAY: 2,
     SUBTYPE_UUID_OLD: 3,
     SUBTYPE_UUID: 4,
     SUBTYPE_MD5: 5,
     SUBTYPE_USER_DEFINED: 128,
     Binary: [Circular] },
  Code: { [Function: Code] Code: [Circular] },
  Map: { [Function: Map] Map: [Circular] },
  DBRef: { [Function: DBRef] DBRef: [Circular] },
  Double: { [Function: Double] Double: [Circular] },
  Int32: { [Function] Int32: [Circular] },
  Long:
   { [Function: Long]
     fromInt: [Function],
     fromNumber: [Function],
     fromBits: [Function],
     fromString: [Function],
     INT_CACHE_: { '0': [Object], '1': [Object], '-1': [Object] },
     TWO_PWR_16_DBL_: 65536,
     TWO_PWR_24_DBL_: 16777216,
     TWO_PWR_32_DBL_:<PHONE_NUMBER>,
     TWO_PWR_31_DBL_:<PHONE_NUMBER>,
     TWO_PWR_48_DBL_:<PHONE_NUMBER>10656,
     TWO_PWR_64_DBL_:<PHONE_NUMBER>3709552000,
     TWO_PWR_63_DBL_:<PHONE_NUMBER>854776000,
     ZERO: Long { _bsontype: 'Long', low_: 0, high_: 0 },
     ONE: Long { _bsontype: 'Long', low_: 1, high_: 0 },
     NEG_ONE: Long { _bsontype: 'Long', low_: -1, high_: -1 },
     MAX_VALUE: Long { _bsontype: 'Long', low_: -1, high_:<PHONE_NUMBER> },
     MIN_VALUE: Long { _bsontype: 'Long', low_: 0, high_: -2147483648 },
     TWO_PWR_24_: Long { _bsontype: 'Long', low_: 16777216, high_: 0 },
     Long: [Circular] },
  MinKey: { [Function: MinKey] MinKey: [Circular] },
  MaxKey: { [Function: MaxKey] MaxKey: [Circular] },
  ObjectID:
   { [Function: ObjectID]
     index: 10967605,
     createPk: [Function: createPk],
     createFromTime: [Function: createFromTime],
     createFromHexString: [Function: createFromHexString],
     isValid: [Function: isValid],
     ObjectID: [Circular],
     ObjectId: [Circular] },
  ObjectId:
   { [Function: ObjectID]
     index: 10967605,
     createPk: [Function: createPk],
     createFromTime: [Function: createFromTime],
     createFromHexString: [Function: createFromHexString],
     isValid: [Function: isValid],
     ObjectID: [Circular],
     ObjectId: [Circular] },
  Symbol: { [Function: Symbol] Symbol: [Circular] },
  Timestamp:
   { [Function: Timestamp]
     fromInt: [Function],
     fromNumber: [Function],
     fromBits: [Function],
     fromString: [Function],
     INT_CACHE_: { '0': [Object], '1': [Object], '-1': [Object] },
     TWO_PWR_16_DBL_: 65536,
     TWO_PWR_24_DBL_: 16777216,
     TWO_PWR_32_DBL_:<PHONE_NUMBER>,
     TWO_PWR_31_DBL_:<PHONE_NUMBER>,
     TWO_PWR_48_DBL_:<PHONE_NUMBER>10656,
     TWO_PWR_64_DBL_:<PHONE_NUMBER>3709552000,
     TWO_PWR_63_DBL_:<PHONE_NUMBER>854776000,
     ZERO: Timestamp { _bsontype: 'Timestamp', low_: 0, high_: 0 },
     ONE: Timestamp { _bsontype: 'Timestamp', low_: 1, high_: 0 },
     NEG_ONE: Timestamp { _bsontype: 'Timestamp', low_: -1, high_: -1 },
     MAX_VALUE: Timestamp { _bsontype: 'Timestamp', low_: -1, high_:<PHONE_NUMBER> },
     MIN_VALUE: Timestamp { _bsontype: 'Timestamp', low_: 0, high_: -2147483648 },
     TWO_PWR_24_: Timestamp { _bsontype: 'Timestamp', low_: 16777216, high_: 0 },
     Timestamp: [Circular] },
  Decimal128: { [Function] fromString: [Function], Decimal128: [Circular] },
  connect: [Circular],
  instrument: [Function] }

@mikermcneil I think that is just perfect. I don't think there is a need to actually have a specific method since we have access to all the thing. I would just add some samples in sails-mongo so that it's clear for anyone.
The only thing is that the mongo variable is already in sails-mongo, so you might want to add a deprecation notice if someone uses that or just build the mongo variable with the objectid object as it is right now, but, with a deprecation message, and remove it later.

@mikermcneil 👍 👍 👍  it looks perfect, thanks!


Cannot connect to remote node public IP

How safe is it to use Zap to connect to my LND server via public IP?
I can connect to my LND backend via its private LAN IP# (10.x.x.x address), make payment to invoice, etc., but when I try to my public IP# (confirmed port forwarded using tcpdump), it gives a failure error (with no further details) in Zap. The configuration from zapconnect doesn’t work unless I edit the IP address to be the internal (behind NAT) LAN ip#, which is always how I’ve (successfully) used Zap so far, but I want to make it more mobile now, obviously, so I can use it places other than home. I have the externalip set correctly in lnd.conf.

Any ideas? How do I debug this? I don’t see any log entries in lnd’s log file despite it having listening port and occasionally an open tcp connection that Zap says doesn’t work for it.

I use a VPN.  I think it will be more secure than opening a port to LND and then you have the added benefit of access to your internal network from your phone.
I use Asuswrt-merlin on my router as the VPN server, and OpenVPN on my iPhone.  This way you can give Zap your internal IP address (no port forwarding) once you connect.  And it will be as secure as your VPN.  I use RSA 2048, SHA-512 and AES-256-CBC as that's the best I could get from OpenVPN on the iPhone.
Downside is that you have to connect to the VPN (in settings or OpenVPN) as I could not get the connect on demand to work.

How safe is it to use Zap to connect to my LND server via public IP?

By default, when you use zapconnect to connect your mobile device to your lnd node, it will share the admin.macaroon with your mobile wallet. This macaroon has full admin rights over the node.
Exposing the gRPC interface to the internet does carry some risk, in that a user with access to that interface will be able to fully control the node if they have the correct macaroon (such as the admin macaroon that is now stored on your phone).
You can mitigate this risk by only sharing relevant macaroons with users that you trust, and revoking macaroons if you suspect they have been compromised.
@Ulmo you will need to add tlsextraip  and/or tlsextradomain to your lnd.conf (see https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf#L27-L33) and then regenerate your ssl certs before you can connect to it via it's external address.

MrFelton, thank you.  That worked perfectly.
Resipsa2917, that's the solution I was originally going to use theoretically, but I didn't know what programs to use.  I can start to look into VPN types that I could use.

right now it's not possible.
i've been playing around with tor the last few days. but running tor on iOS is hard.
I don't know if i'll ever get it to work, but i'm trying.


Add license attribute

https://docs.npmjs.com/files/package.json#license
http://npm1k.org/

Thanks!

Released in https://github.com/jfhbrook/node-ecstatic/releases/tag/0.8.0


Thank you.

Request Description
I just wanted to say thank you.
It's one thing to port a mod over to the newest version, which is already great. It's another thing to take on the responsibility of updating a mod "more reliably". It's all I've ever wanted for this mod; it's always been crazy to me that mods like Sodium and Iris are immediately updated, but CIT (which is the foundation of so many packs) just doesn't get ported half the time.
So thank you. Have a great day.

❤


scala2 Derive intermediate enum fix

fixes https://github.com/zio/zio-schema/issues/747

There is inconsistent behaviour for EnumN derivation between Scala 2 and 3 when dealing with nested sealed trait hierarchies

actually gonna try and write a custom unit test for this


👩🎓 Extract abstract part for JATS frontmatter

Blocks tagged with part: 'abstract' are now respected by JATS export and moved appropriately to <article-meta><abstract>.
Resolves #560

Nice, this is awesome.

Looks like there is a required order to front-stub that currently fails.

The article-version has to be among the first elements.

This isn't strictly part of this change, but it is now more evident and causes the agu-myst-lite template to fail!


chore(deps): updated wascap,nats,nkeys,wasmbus,ctl

Feature or Problem
Updates some conflicting dependencies and brings in latest improvements from some of our most used crates.
Related Issues
Resolves #665 #666 #667 #668 #669
Release Information
0.19.0
Consumer Impact

Testing

Built on platform(s)

[ ] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[x] aarch64-darwin
[ ] x86_64-windows

Tested on platform(s)

[ ] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin
[ ] x86_64-windows

Unit Test(s)

Acceptance or Integration

Manual Verification

Removed bump to 0.18.2 because #643 is a breaking change that warrants 0.19.0


No Language Button.

[x] I confirm that this is an issue rather than a question.

Bug report
Hello Guys, the Language Button on the following Site "https://docs.hyperion-project.org" is unusable on Smartphone when the phone is in Portrait Orientation.
In Landscape i can See the Language Button.
Tested on following device:
iPhone 11 Pro
iOS 15.1
Two Screenshots from me:
Portrait Orientation:

Landscape Orientation:

Steps to reproduce
Go on https://docs.hyperion-project.org with an Smartphone, then you can see it.
What is expected?
What is actually happening?
System

Hi @DJ-Haegi
I would ask you to open an issue at https://github.com/hyperion-project/hyperion.docs in the future if you have problems with the doc.
About your issue. Have you ever clicked on the menu, there should be the language button.
Thank you very much.

Hi @DJ-Haegi
I would ask you to open an issue at https://github.com/hyperion-project/hyperion.docs in the future if you have problems with the doc.
About your issue. Have you ever clicked on the menu, there should be the language button.
Thank you very much.

I'm so sorry, before i have not seen the Language Button in the Menu. Thx for the fast answer.


could not find schema for SecretProviderClass"

/home/jenkins/kubeconform -summary '-output=json' dep.yaml
{
"resources": [
{
"filename": "dep.yaml",
"kind": "SecretProviderClass",
"name": "n-jenkins",
"version": "secrets-store.csi.x-k8s.io/v1alpha1",
"status": "statusError",
"msg": "could not find schema for SecretProviderClass"
}
],
"summary": {
"valid": 4,
"invalid": 0,
"errors": 1,
"skipped": 0
}
}

This is expected behaviour since the schema repository cannot cover all possible schemas. You can however add your own OpenAPI schemas with the parameter: -schema-location "crdSchemas/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json" where crdSchemas would contain the individual JSON schemas, for example secretproviderclass_v1.json for the SecretProviderClass schema.
You can get the schema JSON directly from deployed CRDs from your cluster, e.g.:
kubectl get crd/secretproviderclasses.secrets-store.csi.x-k8s.io -o json | jq '.spec.versions[]?.schema.openAPIV3Schema'

As @savf suggested, or you could also use this repository which collects the most common CRDs: https://github.com/datreeio/CRDs-catalog !


R.equals is slow

equals is at the core of a lot of functions and it's fairly slow as indicated by this test.

See the discussion starting with this comment:
https://github.com/ramda/ramda/issues/1500#issuecomment-334496399

See also #1518, which could help a lot in some cases.

One thing that is easy to spot is that _equals is doing way to much for two non-equal primitive values. e.g. here's what apparently happens for R.equals(true, false);

R.identical(true, false)
-- continue since they are the identical --
Run R.type for both
-- continue since they are the identical --
switch on the (equal) type. Get to the Boolean case
Run typeof on both
-- continue since they are the identical --
return identical(true.valueOf(), false.valueOf())

I'll PR a fix for that once #2338 is merged (it touches the same code).

ping @asaf-romano: Closing the issue for now, but hoping you'll have time for a PR.

Thank you @asaf-romano!


md-autocomplete required validation is not there

Bug, feature request, or proposal:
What is the expected behavior?
There is no required attribute/field in autocomplete component, so i am unable to add required validation on autocomplete.
What is the current behavior?
There is no required attribute in autocomplete component.
What are the steps to reproduce?
Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?

The autocomplete component is supposed to be used with an , so add your validation code there.

@CDDelta's comment probably had html in it, so
The autocomplete doesn't concern itself with the underlying input's validators. Either use Validators.required on your form control or make the <input /> required.

I think what he wants is something like md-require-match that is present in Autocomplete's AngularJs Material.
Related to #3334?

Closing as duplicate of #3334


Add Callable function to override default language

refs #182

exactly!

(waiting for CI) and I'll merge

@docteurklein could you merge this pull request or explain me what i should modify or adapt ?

thanks :)

You welcome
Le 2015-03-23 09:25, Florian Klein a écrit :

thanks :)
--
Reply to this email directly or view it on GitHub [1].

Links:
[1]
https://github.com/KnpLabs/DoctrineBehaviors/pull/191#issuecomment-84882334

This is nice, but can you add some documentation or a code sample about how to override the default locale? We get nl_NL as default locale, but we never make use of the full country locale anywhere. Did assume this was set to en as this is our framework fallback locale, but the TranslatorSubscriber thinks different about it.

@jerome-fix @Rvanlaak  As I see, listeners are called, but finally locale gets determined as en, while it is set to ru in my config (in Translatable currentLocale is finally null and defaultLocale is en)

Working solution is:
/**
     * @ORM\PostUpdate
     * @ORM\PostPersist
     */
    public function updateSlug(LifecycleEventArgs $eventArgs)
    {
        $translatable = $this->getTranslatable();
        $em = $eventArgs->getEntityManager();
        $repo = $em->getRepository(get_class($translatable));
        //reload translatable to have current locale set
        $id = $translatable->getId();
        $em->detach($translatable);
        $translatable = $repo->find($id);

        $oldSlug = $translatable->getSlug();
        $translatable->generateSlug();

        if ($oldSlug !== $translatable->getSlug()) {
            $repo->updateSlug($translatable);
        }
    }

But I think it is quite cumbersome, maybe anyone can suggest better solution?

Conclusion is: locale setting does not work for newly created objects. But this can be fixed by adding subscription to prePersist lifecycle callback. @docteurklein what do you think? I can make a PR for it.


Convert annotations provided by the new parser to IR

Pull Request Description
Builds on top of #3780 and converts the new Tree.Annotated to IR.
[ci no changelog needed]
Checklist
Please include the following checklist in your PR:

All code has been tested:

[x] Unit tests have been written where possible.

Looks like it handles:

normalize x = @Builtin_Method "File.normalize"

but it doesn't handle self! That's something I solve in other PR.


fix: corrupt table data for accent stripping function in LibGPIToolBox

The table keys themselves should now appear as expected when viewed and saved with utf-8.

#62  👈
working-trunk

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @juemrami and the rest of your teammates on  Graphite


Add key to autoexpand snippets instead of having two separate tables

I'm currently trying to replicate my latex snippets using lua snip that I've previously had in ultisnips. Ultisnips has the snippet options, where you can simply append an A after your snippet to have it automatically expand.
I've been using this for snippets like
snippet lr "left right parenthesis" i
\left( $1 \right)$0
endsnippet

snippet () "left right parenthesis" iA
\left( $1 \right)$0
endsnippet

In luasnip, when loading these from a lua file, I have to place them in completely different parts of the document, since they have to be returned in 2 separate tables, which feels kind of clunky.
I could, since the snippets are just lua code, add a bunch of table appending, extending, and manipulation code, but I feel like it shouldn't be to hard to just add it as an option to the snippet node, although I haven't looked at the code behind autosnippets yet.
Thanks for the cool library :grin:.

I have to place them in completely different parts of the document, since they have to be returned in 2 separate tables, which feels kind of clunky

feel like it shouldn't be to hard to just add it as an option to the snippet node

Hmmm, that's true.
The reason they have to be defined in separate tables is just an artifact of the way autosnippets were added to luasnip before add_snippets, which was done through a separate table ls.autosnippets.
But now, with add_snippets, this limitation is gone, and not having any restraints on where snippets are defined is good, so I guess this should be added :+1:
It should be enough to add autosnippet as another option in the first table passed to the snippet, similar to regTrig, I feel like usage would be a tad nicer with a separate autosnippet-function, but that can easily be implemented on top of the option.

Yeah, that sounds exactly like what I had in mind :).
Maintaining backwards compatibility should be simple enough as well, if thats desirable, by just adding the autotrigger = true to the second table returned by the snippets file.

Right that would work... though I'm not sure the current approach needs to be removed, I don't think the implementation would need to be more complicated for supporting both

@L3MON4D3 Did you already start working on this?
Right now I've got exams, but after that (takes a while, ~end of the month) I'd look into this, if you're fine with that.
(I know lua well, but not the vim api, but I think this task should be doable after reading your code)

Oh, no I have not :sweat_smile:
I'm pretty busy right now, and there's other luasnip-related stuff I wanna get to before this, so you're very welcome to get on this :D
If you have any questions feel free to ask, I'll help where I can :)

Alright, happy to help ;)
I'm gonna write when something comes up.
Eventually I think implementing this is the easy part, setting up the environment (e.g.  running the tests) is the hard part (but only needed to be done once, after that contributing becomes much easier ^^)

Setting tests up should (:grimacing: xD) be as straightforward as running make test, let me know if it's more involved than this, maybe I can make it easier.
But this is definitely true for most projects :+1:

See #508 for setup troubles. But for starting to code and thinking this through, I don't need to run the tests.
So back to this issue. I see there are two places where such a change makes sense:

In lua/luasnip/init.lua -> function add_snippets() we could filter out snippets which have a key autotriggered set to true
Advantage: Easy to implement + nice code
Disadvantage: Additional loop over the snippets (in addition to the one in lua/luasnip/session/snippet_collection.lua -> function add_snippets()) and one or two additional tables
In lua/luasnip/session/snippet_collection.lua -> function add_snippets() decide directly before inserting the snippet whether its an autosnippet or not.
Advantage: No additional loop and no additional tables
Disadvantage: The code might get a bit ugly, since on each snippet<->autosnippet switch, the internal tables prio_snip_table and ft_table have to be updated
Advantage: No additional memory and no additional loop is needed (only some lookups for switching the above mentioned tables)

I have no experience how performance critical this part of the codebase is (of course I can imagine, especially the startup of nvim shouldn't be delayed...).
As some sort of "proof of concept" (and to test a few things), I implemented approach 1) in this branch (we can of course still follow approach 2).
Any opinions on this topic?

Oh, I'm in favor of adding this in snippet_collection, the add_snippets in init.lua is (in my mind :sweat_smile:) more for providing a slightly more ergonomic interface to snippet_collection (and to actually call refresh_notify, which is used by eg. cmp_luasnip to update its internal list of snippet-items :wink:)
And I agree, as is, that would become even more ugly.
I think the cleanest way to do add_snippets would be to:

first loop: determine which priorities occur in the snippets for this ft, set snip.priority, (potentially) set snip.autotriggered
create required tables (for the priorities found in 1.)
second loop: actually add snippets

What do you think?
Concerning performance, you can use luajits builtin profiler and flamegraph to do before-after-comparisons.
But, concerning startup at least, all of this can just be wrapped via vim.schedule/is lazy_loaded already, hopefully.

Oh of course (maybe, write a comment then with what function serves what purpose to make it clear when someone reads the code base).
So you'd collect the priorities (for autotriggered/normal) in some sort of set and create the required tables afterwards? That's how I understand 2., or did you mean to create these tables in this first loop? (the latter seems to be more straight forward and I don't think there is much gained by creating two new sets to determine afterwards what tables to create)
So at the moment, I'd set ft_table and prio_snip_table up for autotrig/normal snippets, and later (in the loop) add the snippet to the corresponding table (still keeping all in one loop). But I also think I don't quite get what you're describing.
According to your comment, you want to make the table-checks outside, but I think that's not possible as they depend on the snippet priority (thus they need to happen inside the context where the snippet is known aka inside the loop).

Oh of course (maybe, write a comment then with what function serves what purpose to make it clear when someone reads the code base).

Yes, some parts are severly lacking when it comes to comments :sweat_smile:

So you'd collect the priorities (for autotriggered/normal) in some sort of set and create the required tables afterwards? That's how I understand 2., or did you mean to create these tables in this first loop? (the latter seems to be more straight forward and I don't think there is much gained by creating two new sets to determine afterwards what tables to create)

Creating sets seems a bit more clean to me since the ifs in the loop are avoided, but that's not all that important.
Here's what I had in mind:
function M.add_snippets(snippets, opts)
	for ft, ft_snippets in pairs(snippets) do
		local prios = {
			autosnippets = {},
			snippets = {}
		}
		local types = {
			autosnippets = false,
			snippets = false
		}

		for _, snip in ipairs(ft_snippets) do
			snip.priority = opts.override_priority
				or (snip.priority ~= -1 and snip.priority)
				or opts.default_priority
				or 1000

			-- prefer more specific option I guess.
			-- snip.autotriggered may not acutally default to nil, that will
			-- cause problems with snippetProxy.
			snip.autotriggered = snip.autotriggered ~= nil and snip.autotriggered or opts.type == "autosnippets"

			snip.id = current_id
			current_id = current_id + 1

			types[snip.autotriggered and "autosnippets" or "snippets"] = true
			prios[snip.autotriggered and "autosnippets" or "snippets"][snip.priority] = true
		end

		for _, typename in ipairs({"autosnippets", "snippets"}) do
			-- only create table if there are snippets for it.
			if types[typename] then
				if not by_ft[typename][ft] then
					by_ft[typename][ft] = {}
				end

				local prio_snippet_table = by_prio[typename]
				for prio, _ in pairs(prios[typename]) do
					if not prio_snippet_table[prio] then
						prio_snippet_table[prio] = {
							[ft] = {}
						}
					elseif not prio_snippet_table[prio][ft] then
						prio_snippet_table[prio][ft] = {}
					end
				end
			end
		end

		for _, snip in ipairs(ft_snippets) do
			table.insert(by_prio[snip.autotriggered and "autosnippets" or "snippets"][snip.priority][ft], snip)
			table.insert(by_ft[snip.autotriggered and "autosnippets" or "snippets"][ft], snip)
			by_id[snip.id] = snip
		end
	end

	if opts.key then
		if by_key[opts.key] then
			invalidate_snippets(by_key[opts.key])
		end
		by_key[opts.key] = snippets
	end
end

I think that's pretty readable because we have the three, in themselves closed, steps, and it's not too hard to see what's going on in each (at least I think so, as the one who wrote it :P  Do you agree?)
(ofc. a few more comments on what's going on are missing :] )

Yes knowing the structure (all the by_... tables) in which the snippet has to be stored, I think it is readable.

snip.autotriggered may not acutally default to nil, that will cause problems with snippetProxy.
With this change, snip.autotriggered should always be true or false, never nil (the boolean refers only to the snippet setting which is shadowed by the setting in add_snippets(_, opt), at least in your implementation. Might be confusing when someone tries to add a S(autotrig=false) with add_anippets(autotrig=true), thus this has to be documented).

Hm, now after all you coded this (this wasn't the plan ^^). How are we gonna to proceed now? (not that much experience with contributing to open source)
I write a lot here what has to be/should be done, but no worries, I can also code ^^
Disclaimer: No solution for this problem/part of the code (in my opinion) but maybe a nice thought in general
Thought came to me using an idiom as described here might be worth it here too (moving the table creation part to lua's metamethod ``). The big disadvantage with this is that if tab.key ... can't be used to check if this key is unset (as it will always assign and return a new empty table).

Yes knowing the structure (all the by_... tables) in which the snippet has to be stored, I think it is readable.

Okay, nice :)

snip.autotriggered may not acutally default to nil, that will cause problems with snippetProxy.

With this change, snip.autotriggered should always be true or false, never nil (the boolean refers only to the snippet setting which is shadowed by the setting in add_snippets(_, opt), at least in your implementation. Might be confusing when someone tries to add a S(autotrig=false) with add_anippets(autotrig=true), thus this has to be documented).

I'm not sure if how I wrote it there is actually the best way, we could also handle it similar to priority, eg. default autotriggered to -1 (so we know when it wasn't set in the snippet-constructor), and add_snippet's type provides the default for snippets where autotriggered is unset.

Hm, now after all you coded this (this wasn't the plan ^^).

Sorry :sweat_smile:
I mainly wanted to get across how I imagined it, but yeah, I should've stuck to pseudocode.

How are we gonna to proceed now? (not that much experience with contributing to open source) I write a lot here what has to be/should be done, but no worries, I can also code ^^ (just a bit uncertain with some design decisions if its not my code in the first place)

Well, the code is just the end-product, deciding what goes where is the hard part, and with that you definitely contributed :)
Go ahead and change it, this is just to illustrate what I had in mind.

Disclaimer: No solution for this problem/part of the code (in my opinion) but maybe a nice thought in general Thought came to me using an idiom as described here might be worth it here too (moving the table creation part to lua's metamethod ``). The big disadvantage with this is that if tab.key ... can't be used to check if this key is unset (as it will always assign and return a new empty table).

Hmmm, that's interesting, looks like it would lead to a much cleaner add_snippets... Seems too good to be true actually, would you do benchmarks to make sure it doesn't perform much worse if you decide to go with it?
(Also, I think rawget can still be used to check if some key is unset)
Oh, could you open a PR for this? That's a bit more comfortable when reviewing code

I'm not sure if how I wrote it there is actually the best way, we could also handle it similar to priority, eg. default autotriggered to -1 (so we know when it wasn't set in the snippet-constructor), and add_snippet's type provides the default for snippets where autotriggered is unset.

Why not. But 3 values, -1 = unset, 1 = set to true, 0 = set to false should be enough (just an example mapping). I see no need to be able to check how the key was set (on snippet creation or due to the add function).

I mainly wanted to get across how I imagined it, but yeah, I should've stuck to pseudocode.

^^ No harm done, I just felt bad, as you said, you'd wanted to do other stuff first, and then I came up with various things ^^

Hmmm, that's interesting, looks like it would lead to a much cleaner add_snippets...

Well that's for sure (I think).

Seems too good to be true actually, would you do benchmarks to make sure it doesn't perform much worse if you decide to go with it?

Yes, but this will take time (or not if I want to distract myself from other work ^^).

(Also, I think rawget can still be used to check if some key is unset)

Oh didn't thought of that

Oh, could you open a PR for this? That's a bit more comfortable when reviewing code

Yes, I'll use the your code from above for now, and try some things with these autotables. (And it should be a draft PR of course)
The posts keep getting longer with more and more discussion ^^

Why not. But 3 values, -1 = unset, 1 = set to true, 0 = set to false should be enough (just an example mapping). I see no need to be able to check how the key was set (on snippet creation or due to the add function).

:+1:

^^ No harm done, I just felt bad, as you said, you'd wanted to do other stuff first, and then I came up with various things ^^

Oh, no worries about that :D

Yes, but this will take time (or not if I want to distract myself from other work ^^).

xD

Yes, I'll use the your code from above for now, and try some things with these autotables. (And it should be a draft PR of course)

:+1:

The posts keep getting longer with more and more discussion ^^

Yeeeah, that's good though :D
Better to discuss before than after merging it :P

Why not. But 3 values, -1 = unset, 1 = set to true, 0 = set to false should be enough (just an example mapping). I see no need to be able to check how the key was set (on snippet creation or due to the add function).

:+1:

^^ No harm done, I just felt bad, as you said, you'd wanted to do other stuff first, and then I came up with various things ^^

Oh, no worries about that :D

Yes, but this will take time (or not if I want to distract myself from other work ^^).

xD

Yes, I'll use the your code from above for now, and try some things with these autotables. (And it should be a draft PR of course)

:+1:

The posts keep getting longer with more and more discussion ^^

Yeeeah, that's good though :D
Better to discuss before than after merging it :P


Documentation updates

This PR updates the documentation to resolve issue #604 and #631:

The docstring description for the updfcn and outfcn parameters for NonlinearIOSystem has been updated to reflect the fact that the param argument is required (issue #631; see also discussion #630).

The sphinx documentation for classes has been modified so that the __call__ method is now included in the documentation when it exists (issue #604).  This required updating the sphinx conf.py file to allow special member functions to be included.  I also put information in the class docstrings for transfer functions and state space systems about calling these objects to get the frequency response.

The docstrings for classes yave been updated so that the sphinx documentation is now more uniform.  The documentation for constructor arguments and attributes are now included in the class documentation and the __init__ docstring is suppressed in the sphinx-generated documentation (prior to this, it was sometimes in the class docstring and comes in the __init__ docstring).  This change also allows the unwanted documentation of the deprecated input, output, and state attributes to be omitted (part of issue #604).

Various other PEP8 and consistency issues were addressed.

These changes required some refactoring the code, in particular in the use of the property decorator. I also changed some of the internal class attributes to be hidden attributes (names starting with underscore) since otherwise they show up in the documentation.
The best way to see the impact of these changes is to look at the compiled documentation.  You can find a version here.

Coverage increased (+0.03%) to 89.658% when pulling bf2472f7f78ab748d41ed032ced9cc8f33bcfc11 on murrayrm:docstring_updates into 9f27293483c54ab7f90b34a100baba7587e9d36d on python-control:master.


Histogram display

I see that in your code you do the plotting within your code but I thought we were plotting the histogram on the front-end using recharts? Right now I have code written to take in simply three arrays (one for each color channel) of 2 lists (x and y values for the plot). I dont think I can take your histogram plots the way you have them presented right now for display. Or am I missing something here?

Good catch. I will update my code today

Fixed this by adding a function named "output_histogram_data"