SA4023: this comparison is always true (staticcheck)

🐞 Bug Report
Affected Services [REQUIRED]
edgex-security-bootstrapper
Is this a regression?
No
Description and Minimal Reproduction [REQUIRED]
staticcheck is correctly reporting that err != nil will always be true.
The called function either returns an error, or never returns at all.
🔥 Exception or Error

$ make lint
internal/security/bootstrapper/command/listen/command.go:86:76: SA4023: this comparison is always true (staticcheck)
	if err := tcpServer.StartListener(c.tcpPort, c.loggingClient, c.tcpHost); err != nil {
	                                                                          ^
internal/security/bootstrapper/tcp/listener.go:42:26: SA4023(related information): (*github.com/edgexfoundry/edgex-go/internal/security/bootstrapper/tcp.TcpServer).StartListener never returns a nil interface value (staticcheck)
func (tcpSrv *TcpServer) StartListener(port int, lc logger.LoggingClient, host string) error {
                         ^
internal/security/bootstrapper/command/gate/command.go:135:54: SA4023: this comparison is always true (staticcheck)
	if err := tcpServer.StartListener(portNum, lc, ""); err != nil {
	                                                    ^
make: *** [Makefile:155: lint] Error 1

Invoking code (listen/command.go):

	// block and listening forever until internal error
	if err := tcpServer.StartListener(c.tcpPort, c.loggingClient, c.tcpHost); err != nil {
		return interfaces.StatusCodeExitWithError, err
	}

Target code (listen.go, returns error or never returns)

// StartListener instantiates a new listener on port and optional host if it is not empty
// returns error if failed to create a listener on the port number
func (tcpSrv *TcpServer) StartListener(port int, lc logger.LoggingClient, host string) error {
	lc.Debugf("Starting listener on port %d ...", port)

	trimmedHost := strings.TrimSpace(host)
	doneSrv := net.JoinHostPort(trimmedHost, strconv.Itoa(port))

	listener, err := net.Listen("tcp", doneSrv)
	if err != nil {
		// nolint: staticcheck
		return fmt.Errorf("Failed to create TCP listener: %v", err)
	}

	defer func() {
		_ = listener.Close()
	}()

	lc.Infof("Security bootstrapper starts listening on tcp://%s", doneSrv)
	for {
		conn, err := listener.Accept()
		if err != nil {
			lc.Errorf("found error when accepting connection: %v ! retry again in one second", err)
			time.Sleep(time.Second)
			continue
		}

		lc.Infof("Accepted connection on %s", doneSrv)

		// once reached here, the connection is established, and consider the semaphore on this port is raised
		go func(c *net.Conn) {
			defer func() {
				_ = (*c).Close()
			}()

			if err := handleConnection(*c); err != nil {
				lc.Warnf("failed to write through connection on %s: %v", doneSrv, err)
			}

			// intended process listener is done
			lc.Debugf("connection on port %d is done", port)
		}(&conn)
	}
}

🌍  Your Environment
Deployment Environment:  Ubuntu 22.04, golang 1.20.2, golangci-lint 1.51.2
EdgeX Version [REQUIRED]: main branch
Anything else relevant?

While I think staticcheck was on to something, as a result of golangci-lint cache clean I can no longer reproduce the issue.  Closing.


chore(package): update npm-pkgbuild to version 5.2.9

:tada: This PR is included in version 1.14.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


fix(s3): Fix S3 secret env var population. Added S3 endpoint support

Fixes the use of global.s3.aws.accessKeyId and properly assign it to the API & Worker's env vars.
Also added the endpoint support for S3 compatible services like MinIO.

thanks for your contribution @Siebjee , looks good to me, good catch!


CORE-19738 Hash merkle proof id

Store the merkle proof id as a hash of
<transactionId>;<groupIndex>;<leafIndexes>. The same structure was used before this change, but would easily go over the columns size limit when storing filtered transactions.
Using the hash gives us predictable ids as it is based on computed data rather than any randomisation and also keeps the ids shorter.
As the id contained the leaf indexes which were parsed when read from the database, the content still needed to be preserved in a readable format; a column has been added for leaf_indexes to preserve this data.

build e2e


AST: Make GenericSignature and GenericEnvironment SubstitutionMaps in…

…terchangable
SubstitutionMap::lookupConformance() would map archetypes out
of context to compute a conformance path. Do the same thing
in SubstitutionMap::lookupSubstitution().
The DenseMap of replacement types in a SubstitutionMap now
always has GenericTypeParamTypes as keys.
This simplifies some code and brings us one step closer to
a more efficient representation of SubstitutionMaps.

@swift-ci Please smoke test

@DougGregor I couldn't resist.

Nice! Where's my flat array storage? :)


Mark discussion threads as read upon viewing

The read status of the discussion thread object and row is immediately set to true upon row click, pending the response from the PATCH request. This provides immediate feedback to the user, though it might possibly be reverted later if the server returns an error for some reason or the request takes too long or times out.
Fixes https://openedx.atlassian.net/browse/MA-1158

@1zaman Out of curiosity, is there a ticket associated with this?

:+1:

:+1:

@BenjiLee: Looks like someone found and edited in the ticket number in the description, but I was relying on setting it as my branch name. Since our current policy is to have a JIRA ticket associated with each task, I think we can use this convention to have a predictable branch naming scheme. Looks like you guys are already adding the ticket numbers in your pull request branches, with namespace and/or description added, but I think we could probably dispense with those.
If we keep to this naming convention, we could even elect to keep our branches alive after merging, since they would be a useful pointer (similar to tags, but mutable in the case the ticket is reopened). I guess it's not standard to keep so many long-lived branches though, so that's up to you guys if you want to do it.
cc @miankhalid, @bguertin

Added a check for unread status before doing the read operations.

@bguertin, @miankhalid, ready for final review.

:+1: the refactored tasks need some auto-formatting .. cuz they look really ugly currently.

Done.

—
Reply to this email directly or view it on GitHub https://github.com/edx/edx-app-android/pull/527#issuecomment-172505278.

@1zaman We probably do not want a branch for every ticket. As you mentioned, adding the JIRA ticket in the PR description should be tracked by JIRA and available on the actual ticket itself. If that's not working for you, let me know and we'll try to figure that out.

@bguertin, @miankhalid: I'll be on leave until 26th. Feel free to make any necessary changes and fixes, and then merge this.

@bguertin, does this look fine now?

:+1: Looks good

@@            master    #527   diff @@
======================================
  Files          470     471     +1
  Stmts        21828   21841    +13
  Branches      3167    3164     -3
  Methods          0       0
======================================
- Hit           2951    2947     -4
- Partial        377     378     +1
- Missed       18500   18516    +16

Review entire Coverage Diff as of d7441cb

Powered by Codecov. Updated on successful CI builds.


Avadino

I'm not sure why thewillofone.txt is in this request. What? Whatever.

thewillofone.txt is in because you probably created this branch off of the branch thewillofone.txt was committed to.

Take a look at the comments, finish cleaning up, and resubmit.  @zbright will review after.


Dependency upgrades

Builds for cats-1.0.0-RC2.  If this gets released, we can keep validating more projects downstream without reasoning about eviction.
If this doesn't get released, can bump again next week to cats-1.0.0.

Codecov Report

Merging #223 into master will decrease coverage by 0.11%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #223      +/-   ##
==========================================
- Coverage   97.64%   97.53%   -0.12%
==========================================
  Files          24       24
  Lines         892      892
  Branches       60       60
==========================================
- Hits          871      870       -1
- Misses         21       22       +1

Impacted Files
Coverage Δ

.../src/main/scala/io/iteratee/monix/TaskModule.scala
0% <0%> (-50%)
:arrow_down:

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 6a9aeb7...989653e. Read the comment docs.

Thanks @rossabaker! I'm planning a release this morning.


Add support for nested prompts

Is your feature request related to a problem? Please describe.
I'd like to include zero or more custom PyPI source URLs and optional authentication credentials in a generated Python project (the credentials would be processed by a Copier task after successful project generation). If I were only trying to add zero or one of those PyPIs, I could handle it with the currently available prompt types, but with zero or more it's more involved. Handling multiple repeated prompts is a separate topic I've raised in #750 already. If that proposal gets accepted, I believe it would be necessary to support nested prompts for this use case whose answers are gathered in a Python dict. But nested prompts might also be useful on their own in order to group related answers.
Describe the solution you'd like
I imagine a solution could look like this (where the multiple field is taken from the proposal in #750):
pypi_sources:
  type: struct  # or `dict`/`map`/`nested`/...
  help: Add custom PyPI sources
  fields:
    url:
      type: str
      help: URL
    auth:
      type: bool
      help: Requires authentication?
      default: yes
    auth_username:
      type: str
      help: Username
      when: "{% if pypi_sources|last|attr('auth') %}true{% endif %}"
    auth_password:
      type: str
      help: Password
      when: "{% if pypi_sources|last|attr('auth') %}true{% endif %}"
      secret: true
  multiple: true

The answers of the nested prompts would be gathered in a Python dict. The validation expression, when present, would be executed after every input with the current dict of answers. For validating each field independently, the field must be selected explicitly to avoid possible name collisions in the accessible Jinja context, e.g. pypi_sources|last|attr('url') for validating the just entered URL. This way, complex validation logic that depends on previously entered answers would be possible, too.
Deep nesting would be possible but should probably be avoided to keep the questionnaire simple. Regarding UX, perhaps the nesting could be visualized using Unicode art similar to how the tree tool prints filesystem trees:
🎤 Add custom PyPI sources
├─┬─ 🎤 URL
│ │     https://gitlab.com/api/v4/groups/<group_id_1>/-/packages/pypi/simple
│ ├─ 🎤 Requires authentication?
│ │     Yes
│ ├─ 🎤 Username
│ │     sisp
│ └─ 🎤 Password
│       ********
└─┬─ 🎤 URL
  │     https://gitlab.com/api/v4/groups/<group_id_2>/-/packages/pypi/simple
  └─ 🎤 Requires authentication?
        [Y/n]

Describe alternatives you've considered
Alternatively, a type: yaml or type: json prompt could be used, but the flow would not be guided, so the UX would be worse. Also, validation logic would be more complex.
Additional context
I'd be happy to work on a PR if this proposal gets accepted.

nested sounds better.

This should involve changes in the way the questionary is asked and the answers are processed. Probably needs changes across msny files.
@sisp you didn't specify how thw user exits the loop.

This should involve changes in the way the questionary is asked and the answers are processed. Probably needs changes across msny files.

I also believe this change isn't light, otherwise I would have added this feature already. We'd need a way to traverse a questions tree in depth-first order. I think it would be easier if a question could trigger its corresponding prompt rather than looping over the questions in main.py and triggering the prompting there. Then, a nested question class could act as a container type that delegates asking/prompting to its children (i.e. actual questions or other container types).
All of this might be much easier once the single Question class has been replaced by a union of Pydantic models of the different question types which would make the whole copier.yml parsing much simpler and ease nested ask() method calls as well. Sorry if it sounds a bit confusing what I'm talking about now. :slightly_frowning_face: I've been thinking about this issue, #750, and an internal refactoring of the copier.yml parsing using extensive Pydantic modeling for nearly a year by now with some test implementations which revealed that Pydantic v1 was missing a bit, but now that Pydantic v2 is out which seems to have what was missing, this is getting in reach.
That said, feel free to explore a way to add nested prompts without all I've said, @v3ss0n, because I'm not able to give a definitive timeline on the Pydantic PR.

@sisp you didn't specify how thw user exits the loop.

I think this question is only relevant to #750. Do you meant that issue?

El mar., 11 jul. 2023 7:45, Sigurd Spieckermann @.***>
escribió:

This should involve changes in the way the questionary is asked and the
answers are processed. Probably needs changes across msny files.
I also believe this change isn't light, otherwise I would have added this
feature already. We'd need a way to traverse a questions tree in
depth-first order. I think it would be easier if a question could trigger
its corresponding prompt rather than looping over the questions
https://github.com/copier-org/copier/blob/75b893108be0eb51495e38e4618e7eed04edeb30/copier/main.py#L423-L462
in main.py and triggering the prompting there
https://github.com/copier-org/copier/blob/75b893108be0eb51495e38e4618e7eed04edeb30/copier/main.py#L451-L459.
Then, a nested question class could act as a container type that delegates
asking/prompting to its children (i.e. actual questions or other container
types).

Maybe it's easier if you think about it like a sub-questionary. You could
reuse most of the questionary logic, but just  recursively.

I think this question is only relevant to #750
https://github.com/copier-org/copier/issues/750. Do you mean that issue?

In the example above, pypi_sources is a loop, isn't it? How do you end the
loop?

In the example above, pypi_sources is a loop, isn't it? How do you end the loop?

Ah, yes. It would be handled by #750. I'd say a confirm/boolean question gets asked, asking whether a user would like to answer one more instance of the repeated question. The answer to this confirm/boolean question wouldn't get recorded though, it would merely determine whether the questionnaire should move on to the next question or repeat the same question.


fix for flogo issue #273

What kind of change does this PR introduce? (check one with "x")
[x] Bugfix
[] Feature
[] Code style update (formatting, local variables)
[] Refactoring (no functional changes, no api changes)
[] Other... Please describe:

Fixes: TIBCOSoftware/flogo#273
What is the current behavior?
What is the new behavior?

Tested and fix validated ! Many thanks guys !


chore: add CODEOWNERS

Problem
we would like to loop more people to keep eyes on backport PRs.
Summary of Changes
introduce code owner mechanism
After The Merge

[x] backport to v1.17, v1.18
[ ] turn on the protection

this just specifies that the corresponding teams own all of the code, actual protection is out-of-band in github branch protection rules?

yeah, as Joe mentioned. however there is a fun fact that it is a "or" condition. basically, if one of the team members approves, then we pass the codeowners rule. I will increase the approval counts to do the trick.

ref: https://github.com/orgs/community/discussions/22522#discussioncomment-3237158

yeah, as Joe mentioned. however there is a fun fact that it is a "or" condition. basically, if one of the team members approves, then we pass the codeowners rule. I will increase the approval counts to do the trick.

ref: https://github.com/orgs/community/discussions/22522#discussioncomment-3237158

that's annoying... i guess we have to manage this socially or do something like, "programmatically manage our fine grain approvals, then signal branch protection approval with a service account," if we want to logically AND approval classes?

looks like these two teams will be added as reviewers to all PRs. 🫠. let me check if I can do something. (However, I guess it shouldn't bother us because I bet all of us have turned on all activities notification for agave :trollface: )
ref: https://github.com/orgs/community/discussions/35673


fix(cookies): Handle cookie encoding exception

Fix #1114

Codecov Report

Merging #1183 (a51c11b) into main (6aa1aef) will decrease coverage by 0.51%.
The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main    #1183      +/-   ##
==========================================
- Coverage   58.01%   57.49%   -0.52%
==========================================
  Files          74       74
  Lines        2427     2428       +1
  Branches       79       67      -12
==========================================
- Hits         1408     1396      -12
- Misses       1019     1032      +13

Impacted Files
Coverage Δ

zio-http/src/main/scala/zhttp/http/Cookie.scala
62.50% <75.00%> (-9.95%)
:arrow_down:

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 6aa1aef...a51c11b. Read the comment docs.

fixed by https://github.com/dream11/zio-http/pull/1266


Windows support

Hello I tried installing suplemon on Cygwin and native windows 7 and in the latter case I get a stacktrace for curses not being there. I installed unicurses but I still having the same issue. In cygwin it installs fine but within the editor I get an error saying
0 [main] python3.4m 9024 child_info_fork::abort: address space needed by 'grp.cpython-34m.dll' (0x3F0000) is already occupied
Any plans on supporting windows natively?

Cool to hear you've been trying it on Windows. Unfortunately I don't have a Windows machine to test at the moment. Originally I haven't planned to support Windows, since I feel the command line isn't used that much (correct me if I'm wrong). Suplemon was mainly created to make editing on remote unix servers easy and powerful. I'm interested in what kind of use case you have on Windows?
If Python 3 and curses can run on Windows, Suplemon should work too. The error looks like it might not be related to Suplemon directly. Can you get normal Python 3 scripts to run properly?

As a heads up, Microsoft provides test VMs for Internet Explorer. I have found them as great sources for testing programs on Windows as well =)
https://dev.modern.ie/tools/vms/linux/
Native Windows isn't too friendly so I recommend using Chocolatey and Cmder:
https://chocolatey.org/
http://cmder.net/
There's also a CI for Windows: AppVeyor
http://www.appveyor.com/

It works for me using Python 2.7.10 (without having to manually install ncurses)
python2 suplemon.py
Apparently crashes if you open a file with non-ASCII characters. Also some hotkeys won't work, for example the F1-F7 keys, Ctrl+Arrow or Alt+Arrow. At least F8-F11 and Ctrl+ seem to work just fine.

Closing this since the initial error doesn't seem specific to Suplemon, and unfortunately I'm not planning native to do Windows support.


feat: grandfather current static analysis failures

Description of the change
We want to begin using static analysis to improve the code base, but we don't want to go back through the 760+ current issues before doing so. This commit uses the Psalm baseline functionality to grandfather in the current failures and adds psalm static analysis to the test cycle. This will catch future issues in the code, while allowing for gradual remediation of historical issues.
Type of change

[ ] Bug fix (non-breaking change that fixes an issue)
[X] New feature (non-breaking change that adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Maintenance
[ ] New release

Related issues
Checklists
Development

[X] Lint rules pass locally
[X] The code changed/added as part of this pull request has been covered with tests
[X] All tests related to the changed code pass in development

Code review

[ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
[ ] "Ready for review" label attached to the PR and reviewers assigned
[ ] Issue from task tracker has a link to this pull request
[ ] Changes have been reviewed by at least one other engineer

We want to begin using static analysis to improve the code base, but we don't want to go back through the 760+ current issues before doing so. This commit uses the Psalm baseline functionality to grandfather in the current failures and adds psalm static analysis to the test cycle. This will catch future issues in the code, while allowing for gradual remediation of historical issues.

I would expect to see the result of the report before approving the silent quality degradation.

@bxsx, do you mean you want to see the baseline as set in this PR, or that you want to see the baseline every time the CI runs?
For the first scenario, that information is available in the file psalm.baseline. I've also reproduced it here from a run without the baseline:
ERROR: AssignmentToVoid - src/Rollbar.php:110:9 - Cannot assign $result to type void (see https://psalm.dev/121)
        $result = self::$logger->log($level, $toLog, (array)$extra);

ERROR: ParamNameMismatch - src/RollbarLogger.php:92:33 - Argument 2 of Rollbar\RollbarLogger::log has wrong name $toLog, expecting $message as defined by Psr\Log\LoggerInterface::log (see https://psalm.dev/230)
    public function log($level, $toLog, array $context = array())

ERROR: UndefinedDocblockClass - src/Senders/FluentSender.php:17:13 - Docblock-defined class, interface or enum named Fluent\Logger\FluentLogger does not exist (see https://psalm.dev/200)
     * @var FluentLogger FluentLogger instance

ERROR: UndefinedDocblockClass - src/Senders/FluentSender.php:19:5 - Docblock-defined class, interface or enum named Fluent\Logger\FluentLogger does not exist (see https://psalm.dev/200)
    /**
     * @var FluentLogger FluentLogger instance
     */
    private $fluentLogger = null;

ERROR: UndefinedClass - src/Senders/FluentSender.php:29:27 - Class, interface or enum named Fluent\Logger\FluentLogger does not exist (see https://psalm.dev/019)
    private $fluentPort = FluentLogger::DEFAULT_LISTEN_PORT;

ERROR: UndefinedDocblockClass - src/Senders/FluentSender.php:80:20 - Docblock-defined class, interface or enum named Fluent\Logger\FluentLogger does not exist (see https://psalm.dev/200)
        $success = $this->fluentLogger->post($this->fluentTag, $scrubbedPayload);

ERROR: UndefinedClass - src/Senders/FluentSender.php:109:35 - Class, interface or enum named Fluent\Logger\FluentLogger does not exist (see https://psalm.dev/019)
        $this->fluentLogger = new FluentLogger($this->fluentHost, $this->fluentPort);

For the second scenario, Psalm does not seem to provide a way to show the baseline while also ignoring it. Consequently, to show this on each one we'd have to either:

Run psalm twice. Once ignoring baseline and the exit code, then again respecting the baseline and the exit code.
Write a psalm plugin to manipulate the Pslam engine into outputting the baseline errors it finds
Write a quick script to convert psalm.baseline XML into a more pleasant format.

Finally, I'll clarify there's no quality degradation: we're merely accepting the current state. Any code changes that introduce new violations will appear as errors, thus preventing us from worsening the code. However, it does make sense that unless someone comes around later and fixes these, they'll be "dark" forever.

What worries me the most is the pitfall of the aforementioned darkness. I wonder if we could add additional reporting to the CI pipeline. Can we run --update-baseline or something similar in the CI pipeline to track eventual progression? This would be much more reliable than backlogging such errors.

Oh, ok. You already provided the answer to this too :)
So how about using --update-baseline instead of manipulating with the psalm engine?

So how about using --update-baseline instead of manipulating with the psalm engine?

Yes, @bxsx. Here's what the additional output looks like:
------------------------------
3 errors fixed

In synthetic tests (n=100), running with --update-baseline required on average 412% more wall time (4.1s vs 0.8s) and 280% more CPU time (0.744s vs 0.196s).
Finally, to clarify, the baseline file is a committed artifact so --update-baseline doesn't automatically self-heal our repository: its display is simply an indicator of potential progress, not actual progress.
Personally, I'm uncertain of its value, so for now I'm merging this PR. We can easily add --update-baseline in a subsequent PR if you'd like.


Need to support base64 in the hash functions

Was testing this with Azure REST API

I will look into this one in the upcoming days. The request seems valid, but I might change the way it is implemented slightly, as I'd like to avoid adding a new parameter to existing functions.

Please do.  I need this functionality to be able to use Azure REST API

Would it be possible to add a few tests? I need some code to confirm I get the behavior right of the functionality you are requesting.

Possible, sure.  Let's try to find time...

;-) I know the feeling. Unfortunately I cannot check in new code without test coverage and I'm a little short on time myself. I hope you do find the time, then I'll prioritize this request and hopefully make it in time for the February release.

Almost there. With test and all. But I'm not very fond of having to specify the key encoding in the function. Could you not convert the encoding of the key from Base64 to UTF8 before calling? Or does that not fly?

I will upload my suggestion, then you can improve on that if it does not fulfill all your needs :-)

I've addressed most requests through pull request #50. Please verify that the changes cover your needs. If not, please make a new request and add the code you need (incl. tests), and I'll look into it once more.
I wish you a merry Christmas and a very happy new year!


Update descriptor.py (AKSW-12240)

Changing default args

@raghav-akridata Hope you have tested the working of these featurizers.

Yes I've sanity checked, here's  the JIRA issue for that.


Where are logs stored when a UDF panics?

I have a UDF that panics and I want to look at the logs.
Where are the logs stored on worker nodes? The documentation does not mention it.
I use the docker image to deploy a single instance of arroyo

I found that the worker node logs the panic message to stderr


Additional multiline option

Multi line option 3 allows for:
from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)

Though with flake8 we can set up the hang-closing = true option with allows for:
from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
    )  <- mind here the 4 spaces

Having both options activated conflicts either with one or another. Is it possible to add to isort another multiline option that would allow for the ) to be indented?
Thanks.

While I don't have the bandwith to add support for this requested feature myself, I will accept a pull request that adds it. The correct place to add this functionality is here: https://github.com/timothycrosley/isort/blob/develop/isort/wrap_modes.py#L46

Thanks for you encouragement, please see PR #1097.

Closed by #1097


current url

Hello,
How can I get the current url?
try: Flight::route ();

https://flightphp.com/learn#requests
$url = Flight::request()->query['url'];
or
$url = Flight::request()->query->url;

magikstm thank you very much for the reply.
This framework is incredible. I am flying with this framework.
It is much better than F3 and Lumen. Super intuitive.

what difference is there with:
Flight::router()->current ();


Windows: rm command is not avaible

This cannot run on windows:
npm ERR<EMAIL_ADDRESS>cleanup: `rm -rf compiled/src` npm ERR! Exit status 1
Windows command: rmdir /Q /S compiled\src
Steps to reproduce: running npm start on windows

Windows is not supported at the moment.


fix: broken json

We def need to check which special characters break the json parser, but at least this is for the break line issue


Inconsistent component default/spacer padding

We've been running into consistency issues using Bootstrap 4beta2's default spacing.
Most of the components ($table-cell-padding, $card-spacer-y, $alert-padding-y, etc.) use a padding: .75rem. However, the $spacers don't include that value. It's not possible to use a built in padding class to match the components, which is very weird.
For example, putting a table into a card:

My Header

      Label
      Value

Results in HTML that looks like this:

The .card-header class is using a hard-coded 1.25rem padding (from $card-spacer-x), while the table cell is using hard-coded .75rem (from $table-cell-padding).
I would expect to be able to have some kind of pl-? (left) or pt-? (top) class that matches these components default, since it's in so many places. However, there aren't any Bootstrap-defined classes that you can use to get that .card-header padding to match all of the default component paddings. I realize we can make our own class, but it seems like an oversight and an actual issue to note.

i think card-body should be around the table, then at least the border of the table lines up

Anyone reconsidered https://github.com/twbs/bootstrap/issues/3737 for V4 (or better yet a 3x patch)?


Sky Textures Pop In/Out When Switching Biomes

The fade in/out works perfectly if stationary in a single biome based off of the time of day, however if you have a setup that involves various sky textures for different biomes it introduces a jarring pop in and out effect each time you cross into a new biome. Is there a way to address this that does not involve editing tons of configuration files for each new sky instance?

Closing, for desired effect transition speed should be <0.1 to more slowly fade in/out.


Fix debug printf statements for D

Separated from #5500.

@WalterBright Ping!

Auto-merge toggled on

Thanks!


Question: Support for non SSm versions

Just found this project yesterday (AMAZING, LOVE IT :heart: ) and after successfully patching my font, I realised that mine aren't SSm version, and that the ligatures in this project for non-SSm version are only the light ones :(.
Am I doing something wrong? If not, is the support for non-SSm coming soon? I saw the poll and I know I'm a minority, but I'd love to have to buy yet another font.

@LuRsT Hi, yes. The only non-SSm version is the Light weight for now. Which one are you using?
It takes a couple of hours to add the ligatures to a given font, and I've been pretty busy lately. That's why I've asked for help.
Anyway, let me know and I'll see if I can squeeze in some time.

@kiliman I've also been busy lately, but I could help out with adding some of the necessary ligs.  Let me know if you would like the help.

@kiliman @markypython Thanks for the speedy reply, I'm excited that they are in the roadmap. I'd be glad to help if I knew what it entailed to create the ligatures needed for the other font weights.
As for the one I use, I like to use Book

:pray:

@markypython Were you planning on working on Operator Mono Book? If not, I'll take care of it this weekend.

@kiliman I'm on vacation right now and won't be back till next week.  If you have time this weekend to work on the font that's fine.  I just wanted to offer in case you didn't have time.

@kiliman, let me know if I can help with anything at all

Finally added Operator Mono Book/Book Italic ligatures. Enjoy!
Fixed in 4e50610989c51453cd57297cba153b855a34f8af


Fusion Storage Block version 6.3 and 8.0 driver support for hotpot

What this PR does / why we need it:
Please see #621 for details. @wisererik @xxwjj @leonwanghui please take a look at this pr.
Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #621
Special notes for your reviewer:
This pr will be divided into 3 phases.
In the first phase:  The volume creation and deletion, storage pool query function will be committed.
In the second phase: Implement TerminateConnection and InitializeConnection function of fusion storage.
In the third phase: Implement ExtendVolume, CreateSnapshot, PullSnapshot, DeleteSnapshot functions.

Coverage decreased (-0.8%) to 38.574% when pulling f7ab4d3ff7d9bbc998b1399eecade179e72ab9ea on jackhaibo:fusionstorage into 9b1632b1365e665338131e7d0ce4e1a7348da3cd on opensds:development.

Coverage decreased (-0.8%) to 38.574% when pulling f7ab4d3ff7d9bbc998b1399eecade179e72ab9ea on jackhaibo:fusionstorage into 9b1632b1365e665338131e7d0ce4e1a7348da3cd on opensds:development.


update minor notes in readme and remove ghpages from default task

Allo, @hownowbrowncow, I love this project. Added a few updates to the docs so that others might be able to build/use more easily!
I also ran into some issues where I'd run gulp and it'd run the clean:ghpages task and end up deleting the whole folder, resulting in a massive diff. I figured maybe we should leave that part out unless building it for the gh-pages branch.
Finally, I added a very simple http-server module for use when wanting to run it locally.
Obviously I am no expert myself, just wanting to contribute!

Alright, hope those tweaks I made make sense, I was having issues building on my machine without including the changes.


Only allow application/x-www-form-urlencoded?

Is there a particular reason (e.g. the oauth specs) why the library only allows application/x-www-form-urlencoded requests? In the interests of consistency in my API, I'd prefer to allow JSON requests too.

This looks really unnecessary, because it restricts the whole thing to the bodyParser.urlencoded middleware, as compared to for example Passport.js, which doesn't test for this and just deals with req.body instead.
If there's a need to prevent any empty req.body objects from passing through, why is this not just testing the req.body object itself?
The checks using req.is should be removed altogether IMHO.

+1 I am building RESTful API and don't really need x-www-form-urlencoded

Yep sorry, just following the spec, there is a work-around here: https://github.com/thomseddon/node-oauth2-server/issues/92#issuecomment-50263592

@thomseddon from my reading of the spec it looked like x-www-form-urlencoded was just one option, not the requirement.


Really weird behaviour, perhaps caching?

I'm using nanosql in my project to create a library that I then include into a different project.
When I do the tests on my library everything works fine. But when I include it into the other project there's this really weird issue. The setup is as follows:

I use react-nanosql to react to onChange
I have a table TABLE with COLUMN with a single row
Within onChange I use a select query to get the new value
The COLUMN value in that row starts of with 0

When I update the row, I can see a console.log showing that COLUMN has been changed to 1
The event passed into onChange is showing the same, with query.state being complete
But the select within the onChange is showing the old value! It still shows 0!
This is where it gets really weird.
If the mode is set to TEMP everything works.
If the mode is set to PERM, but I'm testing just my library everything works.
The only time this doesn't work, is when I use the library within the other project, and the mode is PERM.
This is very hairy.
PS. The other project uses redux-persist with localforage

Ok, so I think I'm getting close.
Running a query like this
nsql("Community").query('select').exec().then(q => console.log(q))
works fine
But running with a where clause
nsql("Community").query('select').where(['communityId', '=', "mqpni5abyjr69boge5om4t3fbc"]).exec().then(q => console.log(q))
gives me the stale value

I tried setting cache:false, but the database wouldn't let me
.config({
mode: DB_MODE || 'PERM',
cache: false
})
then, if I log the database constant to console, the _config property only has {mode: "PERM"}

I'm starting to suspect that something weird is going on in the build process.
Chrome connects to the database, but Firefox doesn't until I manually run in the browser's console nsql().connect()
Then firefox works as expected, without the issue.

Nope, that was not a solution. Just got too tired and put the db into TEMP mode by accident

Set the mode to "LS" and let me know what happens.  It's possible the other libraries are messing about with the contents of IndexedDB.

Sounds good. I will when I get the chance tomorrow.

PS. One error that I kept thinking was coming from improper Promise setup, actually comes from your library.
If I externalize nano-sql from my project, and let the other project include it, I get this error
No plugins, nothing to do!
that seems to be coming from https://github.com/ClickSimply/Nano-SQL/blob/ddacd48f55ad503363ece1c786589661d9b658d2/src/query/std-query.ts#L661
Is it possible to connect to the DB too early?
is it proper to connect to the db without specifying a table (nSQL().connect())?

Setting the value to LS worked wonderfully.
I have to run, but I'm going to investigate further because this is might not be a solution if both localForage/reduxPersist and nanoSQL decide to use LS.
Will keep you updated.

We might need to open two issues for this. 😃
Re: No plugins error
This normally happens when you try to do a query before the database is connected, the next version will be a little bit more clear about that.
The .connect() should be called AFTER your data models, actions/views, and config have been called.  So yes, definitely possible to call it too early.
Calling connect with nSQL().connect().. is just fine and should work without any problems.
Re: The IndexedDB Problem
Using LS refers to localstorage and there's really no way for libraries to conflict with localstorage unless they use the same storage key for different items.  NanoSQL uses a combination of the database ID, table and primary key of the row for each localstorage key, the chances of conflict are very low.  You do need to be careful that none of the libraries call localStorage.clear() because that destroys everything in localstorage anybody put there.  You won't find localStorage.clear() anywhere in the nanoSQL source code so it shouldn't be a problem on this end.
As far as the issue you were having originally, I suspect localForage and nanoSQL are conflicting on the indexedDB code somehow.

Re: No plugins error
Yeah, I don't know exactly what causes it, other than calling bindNSQL before connecting, but it would be very nice if the error message specified that this was a nano-sql error.
Re: The IndexedDB Problem
I don't know how I missed this...
I managed to replicate the problem outside of the other project.
And as far as I can tell, this is a nano-sql issue.
I've tried all kinds of possible configurations for the web, with cache on and off, as well as all possibilities of WSQL, PERM, IDB, IDB_WW. The only thing that works as expected is LS. Clearing databases does nothing.
If I set the mode to IDB (or any other except LS) this is what happens.
I upsert a value. The upsert exec logs affected rows with the right new value.
The nano-sql-react onChange method, gets an event parameter which, again, logs the right new value.
BUT, the select query within the onChange method shows the stale value.
I also check the db directly in dev tools and I can see the right value there. (though I can't check the value if I pause the debugger within onChange)
Now if I change the mode to LS and do nothing else, all the values behave as expected.
PS. Thank you for your help. :)

I can also run a function from console which will log the value.
If I run it after all the updates have propagated, and I can clearly see the new value in the database, it will give me the stale value.
Something else to mention. The pattern is like this (on chrome)
Update -> get (stale) -> Update -> get (fresh) -> Update -> get (stale) -> Update -> get (fresh)
Firefox follows the same pattern, except that sometimes it gives me a fresh value two times in a row.
PS. all of this happens with cache turned on or off.
The way I turn the cache off is by setting .config({cache: false}) on both the particular table (nSQL(TABLE).config) and on the global instance (nSQL().config). The reason I do that is because if I set cache to false only on the table model, then when I call .getConfig() on it, it does not show that cache is set to false.

Re: No plugins error
I just pushed v1.4.0 of the React HOC, the components will now wait for nanosql to connect before they render.  This should resolve your not connected issue, so just update your dependencies.
Re: The IndexedDB Problem
Just pushed v1.5.1 of nanoSQL, rewrote the IndexedDB code to remove the webworker and eval code for safer execution and also added a bunch of tests to the IndexedDB code.  Give it a try with the newest version and let me know what you experience.

Nope. Didn't help.
I made a build that replicates the issue for you based on my code.
https://drive.google.com/open?id=1q71jRBdZZIesLVmdj1Iw6rv7dbt22sUe
The console logs a bunch of things, so that might be a bit confusing, sorry.
To reproduce do: (in Chrome, Firefox behaves similarly, but not identical)

Click button send, on the left. You will see the "Balance" change, but not the "Community Pot".
To confirm that it is not a UI issue, in console type getBalance(). It will log the wrong value. (it prints 11, but should be 12)
Go to "Application" tab in dev tools, and open the "Community" table. You can confirm that the "balance" is in the database is indeed different. (it will be 12)

Files you want to take a look at:
If in Chrome, you will be able to find these in "Sources" tab

webpack:///./src/db/CommunityTable.js -- this is where the table is defined, as well as the selects and upserts
webpack:///./test/visual/visualTests.jsx -- this is the entry point for these tests.

I hope this helps.
PS. One observation that I failed to make is that the "Community" table is perhaps the only table that this happens to. As you will notice, in the UI, the "Balance" updates every time, which means that "AgentWalletTable" does not experience this issue.

Interesting, somehow the cache isn't getting invalidated correctly.
On top of that the cache: false wasn't working.
Just pushed v1.5.2, the cache: false will work now but that's kind of moot, I wasn't able to figure out why the cache wasn't invalidating so it's been disabled entirely for now.   When I have more time I'll figure out why the cache invalidation isn't working and turn it back on.
Thanks for helping out with the example!

Marking this as resolved, feel free to re open it if this issue comes up again.

Sounds good. Thanks.

Hi Scott,
This issue seems to be back when using nano-sql-react
I deleted all nano-sql related packages, and installed from scratch all the latest versions.
I have to leave on Saturday, so I can't afford to dive deep into the issue.


Grunt integration

Integration with grunt has been requested. Should be fairly easy. Probably split out the to-be-exported commands from main.js to a new commands.js and maybe move everything that needs it from src/ to lib/.

Moved to https://crosswalk-project.org/jira/browse/XWALK-3831


Angular support

May you add angular support to this plugin?

To be honest I am not into angular.js that much, but I can try. I will have a look at it after the exams of my university courses have ended.

Please have a look at the implementation. If this works for you, it will make it to master.

will try it soon, thanks


feat: add Link component for external (built) css

Motivation
For example, you may want to use TailwindCSS for styling HonoX components. Currently, it is possible to develop using the <link /> tag, but the build result does not contain a unique value such as a file hash, which can lead to unintended caching.
This PR addresses such a use case.
Example
As an example, we are considering the following use cases:
// _renderer.tsx
import { jsxRenderer } from "hono/jsx-renderer";
import { Script, Link } from "honox/server";

export default jsxRenderer(() => {
  return (
    <html lang="en">
      <head>
        <Link href="/app/globals.css" rel="stylesheet" />
      </head>
      <body class="bg-white">
        {/* omitted... */}
      </body>
    </html>
  );
});

// vite.config.ts
import { defineConfig } from "vite";

export default defineConfig(({ mode }) => {
  if (mode === "client") {
    return {
      build: {
        rollupOptions: {
          input: ["/app/globals.css"],
          output: {
            assetFileNames: "static/assets/[name].[hash].[ext]",
          },
        },
      },
      /* omitted... */
    };
  } else {
    return {
      /* omitted... */
    };
  }
});

Hi @mika-f
This is a super cool feature! I'd like to merge it, but I've left one comment. Check it!

Hey @ryuapp @bruceharrison1984 !
What do you think of this feature? Will it resolve #90, though we still need to add a path to the CSS file in vite.config.ts?

Great work. I like this feature because this simplifies a renderer file.

Will it resolve https://github.com/honojs/honox/issues/90, though we still need to add a path to the CSS file in vite.config.ts?

Partially solve it.
The reason I'm asking for #90 is because I'm looking for a simple way to import CSS.
I would be even happier if this feature could be used with zero configuration.

@ryuapp
Thank you for the comment.

I would be even happier if this feature could be used with zero configuration.

Yeah, I also think so. I'm not sure how we can implement it. But for example, if we can write the following, it will be great:
import tailwind from '@hono/vite-tailwind-css'

export default defineConfig(({ mode }) => {
  return {
    plugins: [honox(), pages(), tailwind()]
  }
})

@mika-f
Looks good! I'll merge this and release the new version which includes this change later. Thank you for your contribution!


Momentum Optimizer: Now supports Nesterov flag

This PR adds support for Nesterov Accelerated Gradient to Momentum Optimizer
Reference: http://proceedings.mlr.press/v28/sutskever13.pdf
Fixes #728

This change is

Adding screenshot here:

Review status: 0 of 3 files reviewed at latest revision, all discussions resolved, some commit checks failed.

src/optimizers/momentum_optimizer.ts, line 59 at r1 (raw file):

      tidy(() => {
        let newValue: Variable;

this should just be Tensor

src/optimizers/momentum_optimizer.ts, line 62 at r1 (raw file):

        const newAccumulation = this.m.mul(accumulation).add(gradient);
        if (this.useNesterov) {
          newValue =

I don't quite follow this math here, it looks like we need to compute gradients at the "look a head", instead of the current position, or you can make it look like vanilla SGD as karpathy says here:
http://cs231n.github.io/neural-networks-3/
v_prev = v # back this up
v = mu * v - learning_rate * dx # velocity update stays the same
x += -mu * v_prev + (1 + mu) * v # position update changes form

This looks similar, but not exactly the same. Am I misunderstanding?

src/optimizers/momentum_optimizer.ts, line 102 at r1 (raw file):

        const oldVelocity = this.variableVelocitiesGraph.get(node.output);

        let variable: Variable;

This should be a Tensor

Comments from Reviewable

@nsthorat I'm not sure. Doing the math below:
Equations shared in this article:
v_prev = v
v = mu * v - lr * dx
x += -mu * v_prev + (1 + mu) * v
=> x += -mu * v_prev + (1 + mu) * (mu * v_prev - lr * dx)
=> x += -mu * v_prev + mu * v_prev - lr * dx + mu^2 * v_prev - lr * dx * mu
=> x += - lr * dx + mu^2 * v_prev - lr * dx * mu
=> x +=  mu^2 * v_prev - (1 + mu) * lr * dx

Equations implemented:
temp = mu * v_prev + dx
=> x += -lr * (dx + temp * mu)
=> x += -lr * dx - lr * temp * mu
=> x += -lr * dx - lr * (mu * v_prev + dx) * mu
=> x += -lr * dx - mu^2 * lr * v_prev - lr * mu * dx
=> x += mu^2 * v_prev * lr - (1 + mu) * lr * dx

The only difference I see is lr multiplied in first term. I had actually double checked with Tensorflow implementation and fixed this. Could you please check the same as well?

Sorry for the delay. LGTM, I also looked at TF implementation and this looks identical.

Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.

Comments from Reviewable


Vulkan: GPUParticles2D interpolation not implemented yet (unlike in GPUParticles3D)

Related to https://github.com/godotengine/godot/issues/51318.
Godot version
4.0.dev (5efe80f30)
System information
Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)
Issue description
GPUParticles2D doesn't have an Interpolate property available. This helps make particles feel smoother without using too much GPU time, especially when attractors and collision are enabled. The effect is more noticeable on high refresh rate monitors, but now that GPUParticles simulation occurs at 30 Hz by default, interpolation is needed on 60 Hz monitors too to ensure smooth visuals.
Steps to reproduce

Add a GPUParticles2D node.
Notice how there's no Interpolate property in the inspector.

Minimal reproduction project
N/A

Is it only missing the interpolation property or also the implementation for the property in 2D?

Is it only missing the interpolation property or also the implementation for the property in 2D?

I think both the implementation and the property are missing, but I'm not 100% sure.

So it looks like it only the property was missing as after just adding it, switching it off and on changes the behavior:
https://user-images.githubusercontent.com/25117425/156371120-43e309d2-e7d7-43c3-a1fc-678af7b08081.mp4


Feature Proposal: built-in way to inject Preset into sys.modules?

Nice package! I've been using something similar with Sacred and was wondering if I could use something similar to change a package's defaults. And then I stumbled across this!
So I'm thinking about changing the defaults of librosa program-wide, but seeing as I need to wrap it, I need to import everything through wherever I define the Preset.
This is only a minor inconvenience so it's not a big deal, but I was wondering if there would be a way to tap into python's import system to override it everywhere.
import librosa
from presets import patch_preset

def patch_preset(module):
    import sys
    sys.modules[module.__name__] = Preset(module)

patch_preset(librosa)

# testing
del librosa
import librosa
print(librosa) # it's a Patch
import librosa.display # ModuleNotFoundError: No module named 'librosa.display'; 'librosa' is not a package

It doesn't quite work because it breaks subsequent imports of submodules, which makes sense, so I think we'd have to extend Python's Module class (I believe I've seen it under ast? but the docs are lousy) so that it can still read a Patch as a module.
Anyways, I'm not saying that we have to do anything about this, but I thought it could be a cool/convenient feature.
Bonus: I wonder if we could use Python's Import Hooks to do something like this:
# __init__.py
from presets import librosa # overrides sys.modules
librosa.update(...)

# some_scripy.py
import librosa # Preset

not even sure if that's a good idea. but it's an idea 🤷♀
I think awkward thing is that, if the Preset replacement is called after anywhere else imports the package, then they'd be using the original module reference. So maybe explicit is better.

I've been playing around and you still have to be concerned about import order.
from presets import Preset
import librosa
import librosa.display

librosa = Preset(librosa)
librosa.display
# <presets.Preset at 0x7f94d0dc0da0>
librosa
# <presets.Preset at 0x7f950c332630>

from presets import Preset
import librosa

librosa = Preset(librosa)
import librosa.display
librosa.display
# <module 'librosa.display' from '/home/cusp/bs3639/.conda/envs/a/lib/python3.6/site-packages/librosa/display.py'>
librosa
# <module 'librosa' from '/home/cusp/bs3639/.conda/envs/a/lib/python3.6/site-packages/librosa/__init__.py'>

So you need to make sure that you import all of the submodules before creating a Preset

but I was wondering if there would be a way to tap into python's import system to override it everywhere.

Hmmmm, dangerous territory!  I see where you're coming from, but hacking in sys.modules makes me nervous.

Bonus: I wonder if we could use Python's Import Hooks to do something like this:

That would be super cool!  I never thought of it, but it does seem a bit cleaner syntactically than the current setup.  I was also thinking about patching into importlib directly so you could do
librosa = presets.import_lib('librosa')

but that's not quite as elegant as your proposal.  I don't think it needs to hack sys.modules to work as you describe, but that might also be the only way to have global effects.

So you need to make sure that you import all of the submodules before creating a Preset

I didn't realize that was a problem, but it's definitely worth documenting.  Care to open a PR?

This works for me!!
import sys
import importlib
from importlib.machinery import ModuleSpec
from presets import Preset

from ast import Module

class Preset(Preset, Module):
    def __repr__(self):
        return f'<Preset \n\tof={self._module} \n\tdefaults={self._defaults}>'

class PresetsFinder(importlib.abc.MetaPathFinder):

    def __init__(self, *a, **kw):
        super().__init__(*a, **kw)
        self.preset_modules = {} # tracks modules that we've wrapped
        self._already_matched_preset = None # prevents circular calls

    def is_preset(self, parts):
        '''Checks if a module path (split on '.') has been implicitly loaded already.'''
        parts = tuple(parts)
        # if 'librosa' in parts:
        #     print(parts, self.preset_modules)
        # find any matches (match starting at beginning, obvs)
        return next((name for name in self.preset_modules
                     if name == parts[:len(name)]), None)

    def find_spec(self, fullname, path, target=None):
        # if 'librosa' in fullname:
        #     print('find_spec', fullname, path, target)
        parts = tuple(fullname.split('.'))

        if parts:
            # i.e. from presets import librosa  <<<<
            explicit_preset_import = parts[0] == 'presets'
            # i.e. from presets import librosa
            #      import librosa.display       <<<<
            preset_parent = self.is_preset(parts)
            implicit_preset_import = (
                not explicit_preset_import
                and self.is_preset(parts))

            if explicit_preset_import:
                parts = parts[1:] # cut off 'presets'

        if parts and not self._already_matched_preset == parts and (
                explicit_preset_import or preset_parent):
            # prevent inf recursion, get module the normal way
            self._already_matched_preset = parts
            spec = importlib.util.find_spec('.'.join(parts))
            self._already_matched_preset = None

            if spec:

                # share dispatch and defaults between the same package
                if explicit_preset_import and not preset_parent:
                    preset_parent = parts
                    self.preset_modules[preset_parent] = {}, {} # dispatch, defaults
                dispatch, defaults = self.preset_modules[preset_parent]

                # monkey patch in the Preset call
                # I didn't want to create my own loader, because I
                # wanted it to reuse whatever the logic of the original loader
                # used, and just tack this on at the end.
                #
                # There has to be a better way to do this, but it seems like
                # this gets the job done.
                _create_module = spec.loader.create_module
                def create_module(spec):
                    spec.loader.create_module = _create_module # replace method to avoid infinite recursion
                    module = importlib.util.module_from_spec(spec)
                    module = Preset(module, dispatch, defaults)
                    return module
                spec.loader.create_module = create_module

            return spec

sys.meta_path.insert(0, PresetsFinder())

if __name__ == '__main__':
    # import librosa
    # print(111, librosa)
    # from librosa import display
    # print(222, librosa)
    # import librosa
    # print(333, librosa)
    # import numpy
    # print(555, librosa)
    from presets import librosa
    # print(444, librosa)
    # import librosa
    # print(555, librosa)
    # import librosa.display
    # print(666, librosa.display)
    # print(66666, librosa)
    librosa['n_fft'] = 2**14
    import librosa.display
    print(librosa.display['n_fft'])


stderr Error: No such file or directory (os error 2) Directory Issues

Having Issues getting it to work with my asset directory -
Error: No such file or directory (os error 2)
at ChildProcess.exithandler (child_process.js:383:12)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.emit (domain.js:475:12)
at maybeClose (internal/child_process.js:1058:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Socket.emit (events.js:400:28)
at Socket.emit (domain.js:475:12)
at Pipe.<anonymous> (net.js:686:12) {

killed: false,
code: 1,
signal: null,
what is the best way to find the directory path to input into my .env for ex mine is
NFT_COLLECTION_PATH=/nft-vending-machine-main/assets/losangeles-hacker-house

Fixed the above error by just moving the repo to my desktop- but now getting this error
stderr Error: RPC response error -32002: Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.
Must be an issue with the RPC

Thanks for the suggestion! I will try devent first. Quick ? @mattdeco  do I need to deploy my assets to candy-machine before I try this out or can my assets just get deployed right from the nft-vending-machine? The json file you use in your demo already as assets deployed to arweave it seems with the URI -

@walter-grace The intention is that both the NFT images and off-chain JSON metadata are deployed ahead of time to arweave or another hosting solution. The vending machine reads the -nft.json files to get the on-chain JSON metadata for a given NFT, then mints it and sends it to the customer's wallet address.
Also, the vending machine creates standard master edition Solana NFTs -- they don't come out of a candy machine and thus don't have the properties of an NFT that did (such as having the candy machine program as a mint authority).


Refactor sm2_id - addendum

A few pieces were missing.
Most of all, test/evp_extra_test.c is changed so any EVP_PKEY_CTX_set1_if() is now done after EVP_DIgestSignInit() / EVP_DigestVerifyInit().
Also, EVP_PKEY_is_a() is added, to be able to check key types with provider side keys.

Docs added

Why locating EVP_PKEY_CTX_set1_id after the init functions is necessary?

Why locating EVP_PKEY_CTX_set1_id after the init functions is necessary?

It follows the pattern of every other stuff you can set with an EVP_PKEY_CTX (EVP_PKEY_CTX_set1_id was an ugly duckling in that regard)
The keymgmt to be used is figured out with the init function, so before that, there isn't necessarily a backend to send the ID to.

The second point can possibly be refactored so the keymgmt is figured out when creating the EVP_PKEY_CTX...  that shouldn't even be very hard, I cannot remember for the moment why we do that so late.

Let me get back to that second point in form of another PR

@InfoHunter, #11343 may remove the need to reorder the EVP_PKEY_CTX_set1_id() calls.

Great, I will look into this tomorrow

This is superceded by #11343.  Closing


home-assistant: support starline component

Motivation for this change
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[x] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
21.11 Release Notes (or backporting 21.05 Relase 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

[x] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 128508 run on x86_64-linux 1

3 packages built:

home-assistant
python38Packages.starline
python39Packages.starline


change default output to directory of source file instead of working dir...

...ectory
@yilongli please review
@pdaian @grosu FYI

Modify the documentation as well?

@yilongli please re-review

lgtm

Race conditions... @yilongli when will rv-predict be ready to try?

Jenkins: test this please

when @traiansf revives the asynchronous logging and implements an online prediction algorithm?


Tests failing with LOAD_INTERRUPTED

These are failing consistently in the lab:
Chrome 90.0.4430.225 (Chromecast 1.56.500000) Player Load Graph without media source loading ignores media source path FAILED
        Unhandled promise rejection: shaka.util.Error {
          "severity": 2,
          "category": 7,
          "code": 7000,
          "data": [],
          "handled": false,
          "message": "Shaka Error PLAYER.LOAD_INTERRUPTED ()"
        } thrown
        Failed: Unhandled rejection in Promise: shaka.util.Error {
          "severity": 2,
          "category": 7,
          "code": 7000,
          "data": [],
	  "handled": false,
	  "message": "Shaka Error PLAYER.LOAD_INTERRUPTED ()"
	}
	Error: Failed: Unhandled rejection in Promise: shaka.util.Error {
	  "severity": 2,
	  "category": 7,
	  "code": 7000,
	  "data": [],
	  "handled": false,
	  "message": "Shaka Error PLAYER.LOAD_INTERRUPTED ()"
	}
	    at <Jasmine>
	    at failOnError (test/test/boot.js:82:3 <- test/test/boot.js:102:3)
	    at test/test/boot.js:94:5 <- test/test/boot.js:115:5

Safari 3.0 (Tizen 3.0) Player unloading unloads properly after DRM error FAILED
        Shaka Error 7000
        error properties: shaka.util.Error {
          "severity": 2,
          "category": 7,
          "code": 7000,
          "data": [],
          "handled": false
        }
        Error: Shaka Error 7000
            at Error (native)
            at new P (dist/shaka-player.ui.js:77:311)
            at ya.eval [as h] (dist/shaka-player.ui.js:537:450)
            at Ba (dist/shaka-player.ui.js:21:299)
	    at Ca.next (dist/shaka-player.ui.js:22:91)
	    at b (dist/shaka-player.ui.js:22:330)
	    at run (node_modules/@babel/polyfill/dist/polyfill.js:4536:22)
	    at node_modules/@babel/polyfill/dist/polyfill.js:4553:30
	    at MutationObserver.flush (node_modules/@babel/polyfill/dist/polyfill.js:1665:9)

These are both caused by tests that either don't await their results or that await Promises that are meant to be interrupted.  The fact that the second test doesn't always fail on all platforms the way it is written means it is only testing the right thing on systems that are slow like our 2017 Tizen.


feature/#1 - testing on docker image with ansible installed

reduce the test time from
-----> Kitchen is finished. (11m8.25s)

to
-----> Kitchen is finished. (5m17.63s)

the stable image ansible/centos7-ansible:stable has ansible 2.0.2 installed


ConnectionError

Streamlit:
ConnectionError: HTTPConnectionPool(host='<IP_ADDRESS>', port=60808): Max retries exceeded with url: /chat (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000021E253D4460>: Failed to establish a new connection: [WinError 10061] Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение'))
Gradio:
Traceback (most recent call last):
File "webui\omni_gradio.py", line 15, in
from inference import OmniInference
ModuleNotFoundError: No module named 'inference'
Doesn't work both.

emmm , it seems that your code doesn't run on our project as base folder

i'm just idiot! =)
Please specify in the text that two applications need to be launched - a server (server.py) and a client (streamlit or gradio) separately and simultaneously. =)


Error Running App in iOS on Mac

Hello! I have problems building and running the app form my Mac in iOS
Environment
  React Native Environment Info:
    System:
      OS: macOS 10.14
      CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 2.66 GB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.11.0 - /usr/local/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
    IDEs:
      Android Studio: 3.2 AI-181.55<IP_ADDRESS>14246
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.57.2 => 0.57.2

Description:
Step 1:
react-native init AwesomeProject
cd AwesomeProject
react-native run-ios

Error:

** BUILD FAILED **

The following build commands failed:
	CompileC /Users/alexbel/WebstormProjects/RNProject2/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/fast-dtoa.o /Users/alexbel/WebstormProjects/RNProject2/node_modules/react-native/third-party/double-conversion-1.1.6/src/fast-dtoa.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
	CompileC /Users/alexbel/WebstormProjects/RNProject2/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/strtod.o /Users/alexbel/WebstormProjects/RNProject2/node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
	CompileC /Users/alexbel/WebstormProjects/RNProject2/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/double-conversion.o /Users/alexbel/WebstormProjects/RNProject2/node_modules/react-native/third-party/double-conversion-1.1.6/src/double-conversion.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
	CompileC /Users/alexbel/WebstormProjects/RNProject2/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/diy-fp.o /Users/alexbel/WebstormProjects/RNProject2/node_modules/react-native/third-party/double-conversion-1.1.6/src/diy-fp.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
	CompileC /Users/alexbel/WebstormProjects/RNProject2/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/fixed-dtoa.o /Users/alexbel/WebstormProjects/RNProject2/node_modules/react-native/third-party/double-conversion-1.1.6/src/fixed-dtoa.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
	CompileC /Users/alexbel/WebstormProjects/RNProject2/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/cached-powers.o /Users/alexbel/WebstormProjects/RNProject2/node_modules/react-native/third-party/double-conversion-1.1.6/src/cached-powers.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
	CompileC /Users/alexbel/WebstormProjects/RNProject2/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/bignum.o /Users/alexbel/WebstormProjects/RNProject2/node_modules/react-native/third-party/double-conversion-1.1.6/src/bignum.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(7 failures)

Installing build/Build/Products/Debug-iphonesimulator/RNProject2.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/RNProject2.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/RNProject2.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Step 2:

Open Project in Xcode
Run (Error In Signing)
Sign the project [to fix the Xcode Error]
Run Again (Running Metro Bundler on port 8081. terminal window appears + Build Succeed)
App Launches With Error [Red Screen]

Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module `./../react-transform-hmr/lib/index.js` from `/Users/alexbel/WebstormProjects/RNProject2/App.js`: The module `./../react-transform-hmr/lib/index.js` could not be found from `/Users/alexbel/WebstormProjects/RNProject2/App.js`. Indeed, none of these files exist:
  * `/Users/alexbel/WebstormProjects/react-transform-hmr/lib/index.js(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/alexbel/WebstormProjects/react-transform-hmr/lib/index.js/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)` (null))

__38-[RCTCxxBridge loadSource:onProgress:]_block_invoke.248
    RCTCxxBridge.mm:429
___ZL36attemptAsynchronousLoadOfBundleAtURLP5NSURLU13block_pointerFvP18RCTLoadingProgressEU13block_pointerFvP7NSErrorP9RCTSourceE_block_invoke.118
__80-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]_block_invoke
-[RCTMultipartStreamReader emitChunk:headers:callback:done:]
-[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:]
-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]
__88-[NSURLSession delegate_streamTask:didBecomeInputStream:outputStream:completionHandler:]_block_invoke
__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
-[NSBlockOperation main]
-[__NSOperationInternal _start:]
__NSOQSchedule_f
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_continuation_pop
_dispatch_async_redirect_invoke
_dispatch_root_queue_drain
_dispatch_worker_thread2
_pthread_wqthread
start_wqthread

Questions

Why I can't run the project without signing?
Why this error Appears? & How to solve it?

Thanks

same problem (with react-native 0.57.2) , downgrade the react-native version (0.57.1)
rm -rm node_modules
in package.json
  "dependencies": {     "react": "16.5.0",     "react-native": "0.57.1"   },   "devDependencies": {     "babel-jest": "23.6.0",     "jest": "23.6.0",     "metro-react-native-babel-preset": "0.48.0",     "react-test-renderer": "16.5.0"   },
grettings

In terminal perform,
react-native start --reset-cache
and then
react-native run-ios or react-native run-android
in new terminal window works for me.

yarn add @babel/runtime | npm install @babel/runtime --save

You don't need to add the babel runtime... react-native run-ios is broken in general #21741

Duplicate of #21490


xiaoice config dosen't work: No module named 'muskit.layers.conformer.swish'

    from muskit.layers.conformer.swish import Swish
ModuleNotFoundError: No module named 'muskit.layers.conformer.swish

To reproduce:
CUDA_VISIBLE_DEVICES="0" ./run.sh  --stage 6 --stop-stage 6 --train_config conf/tuning/train_xiaoice.yaml

in ofuton_p's recipe.

The bug is fixed at https://github.com/SJTMusicTeam/Muskits/pull/129


Add rust-toolchain

This makes it easier to not incorrectly make.

What exactly does this do? Is it a hint for some tooling? Anyway, please squash commits.

What exactly does this do?

The rust-toolchain file overrides rustup's default toolchain when invoking cargo, rustc, and friends. This is helpful when working on projects that use multiple rust versions.

please squash commits
👍 will do


Change from using variables to using resources

Instead of using variables, the IAM creds can be provided as resources. If the resource definition/schema is created in the admin workspace, it should be shared to all workspaces, so individual IAM resources can be shared with the session token and the secret key being secret, and the key id and role name being readable.

Done as of v1.1.0


Document the contents & shapes of the NetCDF files that nowcasting_dataset outputs?

The Pydantic models in the data_sources/<modality>/<modality>_model.py files (where <modality> is one of {datetime, metadata, gsp, nwp, pv, satellite, sun, topographic}) describe the contents of the batches (and, hence, the contents of the NetCDF files).  (For example, see satellite_model.py).
But it might be nice to aggregate all that documentation together into a single human-readable page somewhere?  So it's really quick and easy for users to get an overview (and to see the detail) of precisely what nowcasting_dataset outputs to disk?
I guess the ideal situation would be to automatically extract the description fields from the pydantic models?  I wonder if sphinx can do that?!
Related to #222

The 'data_sources' are now basically 'xr.Datasets', with a few pydantic features.
Perhaps a good start is just to write a descirption in eahc of the data_sources/<modality>/<modality>_model.py files


Keyboard navigation triggers popovers to appear from behind settings overlay.

If a user uses Tab to move the keyboard focus in either the personal or organization settings overlay, then eventually the focused element moves behind the overlay to the main display (that's grayed out in the background) and as a result popovers in the left sidebar start appearing over the overlay when those elements are focused. See screenshot below.
CZO thread
As discussed in the linked CZO thread, the bug isn't the popovers, but rather that the keyboard focus is moving behind the overlays at all.

@zulipbot claim

Hy @oly-baby . Are you still working on this?... If not, i would love to pick it up

You can work on it

alright. I would work on it

@zulipbot claim

@zulipbot abandon

@zulipbot claim

@zulipbot claim

@zulipbot claim


Change NewCounter to MustNewConstMetric for some metrics

Change NewCounter to MustNewConstMetric for some metrics. https://godoc.org/github.com/prometheus/client_golang/prometheus#MustNewConstMetric. NewCounter.Set is already deprecated.
# go test
PASS
ok  	_/opt/prometheus/apache_exporter	0.012s

ping @neezgee

Merged. Thanks for good code!


ESSearchCriteria - change nested with long path instead of nested term filters

Spring clean-up. Abandoning. Busy Machines commons shall rise again from its ashes.


Multiple sources, selecting old value (bug?)

I see that on some values, the selected value is the oldest of the two, for example:
"speedThroughWater": {
	"meta": {
		"units": "m/s",
		"description": "Vessel speed through the water"
	},
	"value": 4.156712164144859,
	"$source": "Main GPS.II",
	"timestamp": "2018-06-10T02:18:36.151Z",
	"sentence": "VHW",
	"values": {
		"Nexus.II": {
			"value": 0,
			"sentence": "VHW",
			"timestamp": "2018-06-11T05:58:32.510Z"
		},
		"Main GPS.II": {
			"value": 4.156712164144859,
			"timestamp": "2018-06-10T02:18:36.151Z",
			"sentence": "VHW"
		}
	}
}

Where does the data & the timestamps come from? Can you provide a log file that reproduces this issue?

Unfortunately, the logging was switched off before this occured. Closing and will open a new one if it happens again

Hmm. On second thought could be a bug related to deltacache. Ping @sbender9.


feat: support for diesel @ 2.2

Motivation
I noticed there were some comment notes in the repo indicating a desire for diesel support. I had implemented something similar using a newtype pattern in my own project, so I figured I'd attempt to contribute it back upstream.
Solution
This PR implements the required traits for the generic uint types to work out of the box with diesel. The implementation closely matches the sqlx feature implementation in this repo. I have an example repo illustrating simple usage (schema, querying, inserting) @ https://github.com/sinasab/diesel_uint_test/.
PR Checklist

[ ] Added Tests
[x] Added Documentation
[x] Updated the changelog

why does it merge if clippy fails -_-


CIF-1108 - Update WCM core components to 2.7.0

Description
The code scanning check in Cloudmanager (AMS) currently fails, because of an older (2.5.0) version of the WCM Core components which are embedded in the archetype all package. The issue was fixed in 2.7.0.
How Has This Been Tested?

Manually checked the CIF components that depend on WCM components.

Types of changes

[X] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

[X] I have signed the Adobe Open Source CLA.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[X] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes and the overall coverage did not decrease.
[X] All unit tests pass on CircleCi.
[X] I ran all tests locally and they pass.

Verifed manually with sample project built from issue/CIF-1108 branch.


Upgrade to ZIO 2.0.3

Taking this one

Created a zio ticket - https://github.com/zio/zio/issues/7531


Mean vs Sum

Hi,
Quick q: Why would you take the mean here?
https://github.com/ku2482/rltorch/blob/7819af49d95bfa268e00413a7606564b0e7286a7/rltorch/agent/sac_discrete/base.py#L58
If you set alpha to zero, it should match (expected) q-learning. Hence instead of mean() it should be sum(dim=1), since you already have the probabilities, this gives you the expected next q value. Or what am I missing here?

Hi @NikEyX, thank you for pointing it out!!
Actually, you're right, it's a bug.
I fixed it and pushed in Sac-Discrete repo.
I don't maintain this repo, so please send PR if you want.
Anyway, thank you very much!!


python/pytorch-tensor-shape bug

Does this issue occur when all extensions are disabled?: Yes/No

版本: 1.67.2 (user setup)
提交: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
日期: 2022-05-17T18:15:52.058Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: <IP_ADDRESS>-electron.0
OS: Windows_NT x64 10.0.19044
Steps to Reproduce:
1.shape error when debug my pytorch code.

Please file this on the vscode-python and include more details because it's not obvious what the error is


fix: allow dirty metrics shutdown

this PR introduces an expiring context to the metrics finalizer in kademlia. as noted by @ldeffenb the shutdown takes too long and we should not wait indefinitely there. this is a stopgap solution until we come up with a better persistence solution that doesn't burden the shed abstraction with too much IO with regards to these metrics. We also need metrics pruning, since this can just burden other components with statestore size at some point.

This change is

I'm not sure I would have gone with as short as 5 seconds, but this will certainly solve the issue for those folks complaining about there Docker-based nodes not terminating.  With this, their node will actually exit allowing the implementation of detection and auto-restart of the failed node, especially those failing due to swap-endpoint glitches.

I'm not sure I would have gone with as short as 5 seconds, but this will certainly solve the issue for those folks complaining about there Docker-based nodes not terminating. With this, their node will actually exit allowing the implementation of detection and auto-restart of the failed node, especially those failing due to swap-endpoint glitches.

we need to be cautious with restart times. kubernetes, for example, will kill a process that cannot terminate within a 30s timeout. so 5s might even be too permissive depending on the performance of the node's statestore. so if a process got a SIGQUIT or SIGTERM and does not exit in time will be killed (and with it the risk for all sorts of inconsistencies)

Copy that and understood.  I'm assuming that's only when kubernetes is directing the termination and not when the process is shutting itself down from inside?  But you are correct, it's better to have the process miss persisting the peer metrics than to have the carpet pulled out from under it!

I'm assuming that's only when kubernetes is directing the termination

That is correct and can happen for a variety of reasons (pod rescheduling on a different node, or a simple upgrade to a new docker version). When the node shuts down it might actually kill it too; I think that the readiness and health endpoints are some of the first things to shut down when the node is brought down (we take down the APIs first so that new requests don't come in).


the rouge only work when sentence number of the hyp and the ref are the same?

hello~~
in your code file: rouge.py
there
`def get_scores(self, hyps, refs, avg=False, ignore_empty=False):
if isinstance(hyps, six.string_types):
hyps, refs = [hyps], [refs]
    if ignore_empty:
        # Filter out hyps of 0 length
        hyps_and_refs = zip(hyps, refs)
        hyps_and_refs = [_ for _ in hyps_and_refs
                         if len(_[0]) > 0
                         and len(_[1]) > 0]
        hyps, refs = zip(*hyps_and_refs)

    assert(isinstance(hyps, type(refs)))
    **assert(len(hyps) == len(refs))`**

it means the num of sentences must the same in the hyp and the ref?
i come to this when my hyp and ref are list of str like: hyp=[''this is a example","this is another example"],ref=[''this is a example","this is another example","this is last example"], which invoke the assert error.
maybe i misunderstand the format needed for the hyp and ref?
Thanks!

sorry for annoying u, i understand by that for different numbers of sentence we  can just join then by the delimiter "." , than do the rouge calculation,sorry again
by the way,the outcome is nearly the official script functions except the rouge_L some far from~~
thanks~~


[AutoComplete] Add maxSearchResults property

Picking up from #3262

@vishalvijay lost the credit of this PR :grin:.

My bad? It's from mbrookes:aotocomplete-maxsearch.

@mbrookes Could you rebase?

Uh, sure. I should have closed the other one. :smile:

@mbrookes That's better like this :smile:.

How's going shipping this feature? 😉


Organization issues

When adding a contributor to an org:

The list is not sorted, which makes it difficult to scan.
The list is not de-duped - are there multiple orgs with the same name?
We should auto complete existing orgs in the new org box, to limit slight misspellings/accidental dupes.

There aren't accidental duplicates; if you type in the name of an org that already exists, it quietly uses the already existing one rather than creating a new one. We could autocomplete as well, I suppose, but autocompleting while typing is a bit awkward. I'll look into it.

Autocompletion and sorting in https://github.com/MeasureOSS/Measure/commit/01736b880f897aa7e75a525c2fe07f1f71e20709. Not closed yet because there still may be ways to create duplicates which aren't yet identified.

I don't think there are ways to create duplicates, now. Leaving open for the team to confirm that they're happy with the way it works before closing.

Will verify. What's the recommended path for removing existing dupes?

Haven't been able to create duplicates since https://github.com/MeasureOSS/Measure/commit/01736b880f897aa7e75a525c2fe07f1f71e20709.


Subaru: Crosstrek Hybrid support

@martinl got a test route for me?

It appears there are no similar messages on bus 0 to the cruise active status. Most common bits are quite a bit off:
hex(msg)='0x361', bit_mismatches=981 of 3720 (26.37%), byt_idx=1, bit_idx=2
hex(msg)='0x1f9', bit_mismatches=1476 of 6009 (24.56%), byt_idx=5, bit_idx=7
hex(msg)='0x1f9', bit_mismatches=1002 of 6009 (16.67%), byt_idx=5, bit_idx=6
hex(msg)='0x244', bit_mismatches=1589 of 10190 (15.59%), byt_idx=4, bit_idx=3
Searched bus: 0

On bus 2, it gets a bit interesting. There's of course the bit on 0x321 which is what I'm comparing (ES_DashStatus), but also 0x220 which is (ES_Brake):
ex(msg)='0x321', bit_mismatches=864 of 2423 (35.66%), byt_idx=5, bit_idx=2
hex(msg)='0x220', bit_mismatches=56 of 4800 (1.17%), byt_idx=0, bit_idx=0
hex(msg)='0x220', bit_mismatches=56 of 4800 (1.17%), byt_idx=4, bit_idx=0
hex(msg)='0x321', bit_mismatches=9 of 2423 (0.37%), byt_idx=4, bit_idx=3
Searched bus: 2

However I checked both signals on older ICE cars, and they proved to be inaccurate, specifically:

ES_DashStatus->Cruise_Activated on Forester 2019 goes low when at a standstill
ES_DashStatus->Cruise_Activated on Subaru Impreza 2019 goes low when user is actuating the gas pedal while ACC stays engaged
ES_Brake->Cruise_Activated on Subaru Forester 2019 stays high after user disengaged with the brake at a standstill

There's no other similar signals to ES_DashStatus->Cruise_Activated, so we'll have to verify that the signal on the hybrids don't have these problems on the ICE cars.

This is also missing the hybrid signals for gas and brake: https://github.com/ClockeNessMnstr/openpilot/blob/crosstrek-pid/selfdrive/car/subaru/carstate.py#L23

There is also ES_Status (0x222) Cruise_Activated, I'll check if it behaves differently

On Crosstrek ICE, ES_Status Cruise_Activated is identical to CruiseControl Cruise_Activated signal, I tested with 3 cases above - stopping behind lead car / hold (standstill), disengage using brake while in standstill, gas press while engaged
8de015561e1ea4a0|2022-12-10--14-08-26

I checked Crosstrek Hybrid dbc and it does not have ES_Status message. I'll find the signal once I find someone who can provide route for Crosstrek Hybrid

crosstrek hybrid route: 31d10447d8c7dc19|2023-08-17--07-30-31--0

I'll just merge the hybrid cars behind dashcam, we still need a good cruise_activated bit. Would be helpful to get a forester hybrid route so I can see if they are the same

Can you merge https://github.com/commaai/openpilot/pull/24770 after this? Make sure to leave a comment at least of what is required to un-dashcam

Make sure to request a final review before merging


chore: add cli-wrapper.js as workaround for pnpm install warning

fix #58
alternative: add a prepare script to packages/webcrack/package.json
to run build before install
  "scripts": {
    "prepare": "npm run build",

publishconfig feels wrong
there should be no difference between local build and published build

Thanks!

mmkay. as expected:
webcrack $ pnpm install
webcrack $ cd apps/playground
webcrack/apps/playground $ npx webcrack
node:internal/modules/esm/resolve:263
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'webcrack/packages/webcrack/dist/cli.js' imported from webcrack/packages/webcrack/src/cli-wrapper.js
  code: 'ERR_MODULE_NOT_FOUND',

... in case someone in the future trips over this error
the error could be prettier with a try/catch, but meh


Write doc strings for most important gates/circuits

The most important functions and classes in pyqtorch.modules should get a doc string.
A doc string should look like below
def zero_state(
    n_qubits: int,
    batch_size: int = 1,
    device: str | torch.device = "cpu",
    dtype: torch.dtype = torch.cdouble,
) -> torch.Tensor:
    """Describe what function does.

    Arguments:
        n_qubits: __description__
        ...

    Returns:
        torch.Tensor: __description__

    Examples:
    ```python exec="on" source="above" result="json"
    from import pyqtorch.modules as pyq

    state = pyq.zero_state(n_qubits=2)
    print(str(state)) # markdown-exec: hide
    ```
    """

Where optionally we could include examples that are run during the docs build process (see exec=on arguments inside the code block) which would ensure that the examples work and can be directly copy pasted by users to play with them. In order to enable these runable examples we have to add the markdown-exec plugin to the mkdocs.yml.

very nice  codebase,  I'll  give this a shot and start  working on this now  :)

hey, thanks a lot and welcome! have fun solving the issue :)

hey  @dominikandreasseitz  ,
just a query , do you want the docstrings & example to   appear  before the function  or  inside the function  or after the function

Hi @dominikandreasseitz
Just checking  , For  modules ,documentation that is generated by mkdocs from the docstring from the docs folder ,  Is  this expected output ?  https://drive.google.com/file/d/11N4TCD4wIvp_E56DcD3PpIznuUl_d6qV/view?usp=sharing
Also when I run  pytest or   hatch -e docs run mkdocs build --clean --strict   it all shows success ,
I am not sure  if it's supposed to show more  additional info or not eg print the output of running the example  due to  this line  under Examples
  python exec="on" source="above" result="json"
Thanks

hi @prilcool , thats looks great! submit a PR once you are satisfied so i can build the documentation myself too and hav a look at it. then we can iteratively improve it :) thanks!


Fix no newline error for PPP

Codecov Report

Merging #167 (62b6854) into master (f7c541c) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #167   +/-   ##
=========================================
  Coverage     67.25%   67.25%
  Complexity      706      706
=========================================
  Files           114      114
  Lines          2446     2446
  Branches        287      287
=========================================
  Hits           1645     1645
  Misses          713      713
  Partials         88       88

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 c112767...62b6854. Read the comment docs.


Merge pull request #1 from akveo/master

pull

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Other information:

update


Allow #ruby for Ruby version comment style on LeadingCommentSpace

This PR removes the offense for comments that starts with #ruby as this style is
a valid syntax to write Ruby versions in Gemfile that can be used with bundler, RVM, and others.
Example:
  # Specific version (comment) will be used by RVM
  #ruby=2.7.0
  #ruby-gemset=myproject
  ruby '~> 2.7.0'

Before submitting the PR make sure the following are checked:

[x] Wrote good commit messages.
[x] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[x] Squashed related commits together.
[x] Added tests.
[x] Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
[x] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
[x] Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

I'm fine with adding this, but with a related configuration option. I don't want to introduce a performance penalty for people who are not using this. The description of the cop should also be expanded to reflect this.

Thanks @bbatsov,
How about a configuration option like this one:
config/default.yml:
AllowGemfileRubyComment: false

All done 👍

[x] Branch rebased to master tip
[x] Added AllowGemfileRubyComment  config option disabled by default
[x] Updated test cases with new config option
[x] Added documentation
[x] All CI checks passing

If anything seems wrong or something has to be changed, please let me know.

Thanks!


Is this available on Swift UI?

Hi @Haibo-Zhou, no idea, I think you should be able to wrap it with UIViewControllerRepresentable.


57NoQMMWe3nciM7mwDihoBPfGuG4zDA9DWuJHeiApump

https://github.com/ai16z/eliza/blob/aed6ef15d3511dcd2b8f85871e79421b06d8080b/packages/core/src/actions/pumpfun.ts#L304
this example token is created on pumpfun

https://pump.fun/57NoQMMWe3nciM7mwDihoBPfGuG4zDA9DWuJHeiApump


Migrate swf config

Still need to update README. Will take care of it in the morning

/test all

Why is the gitlab database name a variable? I think it would be better to make it static.

Why is the gitlab database name a variable? I think it would be better to make it static.

To allow the database names to be configured if needed. The RDS folks had issues with what we had hard coded before because they couldn't have hyphens in the dbname. So I made it configurable and default to a new name without hyphens at the software factory level. Didn't know if there would be any other weird limitations to different provisioned databases that may need to be able to configure a name that works for them.

/test all


Add letter spacing for Android versions >= Lollipop (5.0).

Thanks for submitting a PR! Please read these instructions carefully:

[x] Explain the motivation for making this change.
[x] Provide a test plan demonstrating that the code is solid.
[x] Match the code formatting of the rest of the codebase.
[x] Target the master branch, NOT a "stable" branch.

Motivation (required)
What existing problem does the pull request solve?
This PR makes enables lineSpacing on Android.  It is based on https://github.com/facebook/react-native/pull/9420, differing only with respect to minor library import references.
We have merged this into Airbnb's react-native fork: https://github.com/airbnb/react-native/pull/13
Test Plan (required)
Android fonts on Airbnb app

Android fonts specific use cases:

Next Steps
Sign the CLA, if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all tests pass on both Travis and Circle CI. PRs that break tests are unlikely to be merged.
For more info, see the "Pull Requests" section of our "Contributing" guidelines.

There's another similar PR for letter spacing, we might want to merge our efforts here to get it merged https://github.com/facebook/react-native/pull/13199

Hi @ide: thanks for taking a look at this PR.
I made the changes that you suggested and also added an example to the explorer. I based it off https://github.com/facebook/react-native/blob/bd004568d3e006b61391417fc405e9483996dc81/RNTester/js/TextExample.ios.js#L387
I'm getting a CI error on travis: 'React/RCTBridge+Private.h' file not found  Do you know how I can resolve this?

@zezhouliu @ide
Guys, what can community do to help you get this PR merged?
What is the primary PR for this issue now, this one or #13199?

👍

@zezhouliu thanks for this PR ! Can you resolve the merge conflicts ?
@ide it seems that the changes you requested have been address is there still something ?

@zezhouliu Have you had a chance to update this? I was just working on my own version of this and realised you've already done the hard yards..

Some issues with this PR as it stands (from the drive-by perspective of a RN user interested in this feature; I'm not a maintainer, or even a contributor yet - I can pretty much only semi-confidently read the RN source code at the moment, but I have spent time tinkering with letter spacing elsewhere):

It appears to need a non-trivial update to be mergeable, in light of 6114f863c3aed826355530bcf404ee5aed2f927b in which a lot of the Text implementation has shifted.
It seems to assume font sizes are ints (easily fixable in itself).
It seems to hardcode an assumption that a ReactTextUpdate only has a single font size, which may be at odds with Text nodes being nestable etc. Presumably a correct implementation would instead wrap the content in a custom Span that uses Paint.getTextSize() to normalise a letter spacing value stored in points (DIP/SP depending on allowFontScaling) and pass it into
Paint.setLetterSpacing(float).
I am personally not sold on the points-to-em conversion formula (paraphrased for clarity):
1 + (letterSpacingPoints - fontSizeDIP) / fontSizeDIP - even putting aside DIP vs SP (allowFontScaling mentioned above), why doesn't it work out to 0 if letterSpacing is 0? But I could be missing something here.

@zezhouliu Want to close this to keep the focus on #17398?

#17398 landed.


NotIn QuerySet function

this function
StatusNotIn(status types.TXStatus, statusRest ...types.TXStatus)
has to be used like this:
StatusNotIn(types.CompletedTXStatuses[0], types.CompletedTXStatuses[1:]...)
as for me, better way is
StatusNotIn(types.CompletedTXStatuses...)

Same as the xxxIn() functions

what's the purpose of the first argument in InMethod?
if there's no spicial purpose, could I take a pull request to close this issue?

First argument is required to be sure there is at least one argument passed in the function.
Previously each method was checked by Compiler that the arguments list is not empty and sql query is valid. Now this check is not works.
Yes, this limitation makes the interface less beautiful, but go-queryset is positioned as "Safe for use" and this is OK.

You could try to make "unsafe" versions of this function. Where user understands he must check the list of elements before call. Or try to add an error into the query and decline request invocation with this error.
But I think it is not necessary.

You could save information about empty list error in queryBuilder object and return error after call of execution

No, commonly users are too lazy to check the array length =)
I'm not sure this enhancement is really needed.
I think current interface is OK and its positive sides neutralize inconveniences.

Just because users are lazy, so we warp the error check in the function. 😄

@jqs7 @derElektrobesen @grechkin-pogrebnyakov thank you!
I like the idea of error saving if len(args) == 0 and returning then. Pull requests are welcome, I can do it myself in 1-3 weeks.

Cool !!! @jirfag
how about:
func (qs UserQuerySet) IDIn(ID ...uint) UserQuerySet {
	if len(ID) == 0 {
		qs.db.AddError(errors.New("must at least pass one ID in IDIn"))
		return qs.w(qs.db)
	}
	return qs.w(qs.db.Where("id IN (?)", ID))
}

if the code above is ok, i'll make a pull request right now 😋