Initial telemetry implementation

This implements basic telemetry, as outlined in rust-lang-nursery/multirust-rs#254

Telemetry can be enabled/disabled with rustup telemetry on|off
Telemetry configuration is stored in ~/.multirust/telemetry
Telemetry is stored in ~/.multirust/telemetry-YYYY-MM-DD

Thanks for the quick turnaround @peschkaj!
Here are some initial impressions:
First, telemetry will need to be in the multirust library, not multirust-cli so it will be available to other clients, e.g. IDEs. I'd suggest just taken the functionality you've implemented here and just lowering it by one 'layer', so that telemetry is measured in e.g. Toolchain::add_component etc.
This is going to sound mean, but I'd like you to switch from serde to rustc-serialize for the serialization, both so we don't add more nightly dependencies, but also because serde still breaks a lot. rustc-serialize should work fine for our purpose.
On where telemetry 'lives', I'd say you've got the right idea by putting the TelemetryEvent enum in utils - telemetry may be needed from several rustup crates and utils has no dependencies. I'd further suggest putting all telemetry stuff in its own telemetry module; that includes the logic for dealing with filesystem, so your 3 function on Cfg would just just small pass-troughs to functions in utils::telemetry.
I'll also go and leave some individual comments on the patch.

Many thanks, none of it sounds mean at all.
I was worried about the serde dependency and what you say makes sense. I
think serde may be a leftover from when I was attempting to record
timestamps as an ISO8601 string before I punted and just used seconds since
epoch.
On Thu, Apr 7, 2016 at 1:44 PM Brian Anderson<EMAIL_ADDRESS>wrote:

Thanks for the quick turnaround @peschkaj https://github.com/peschkaj!
Here are some initial impressions:
First, telemetry will need to be in the multirust library, not
multirust-cli so it will be available to other clients, e.g. IDEs. I'd
suggest just taken the functionality you've implemented here and just
lowering it by one 'layer', so that telemetry is measured in e.g.
Toolchain::add_component etc.
This is going to sound mean, but I'd like you to switch from serde to
rustc-serialize for the serialization, both so we don't add more nightly
dependencies, but also because serde still breaks a lot. rustc-serialize
should work fine for our purpose.
On where telemetry 'lives', I'd say you've got the right idea by putting
the TelemetryEvent enum in utils - telemetry may be needed from several
rustup crates and utils has no dependencies. I'd further suggest putting
all telemetry stuff in its own telemetry module; that includes the logic
for dealing with filesystem, so your 3 function on Cfg would just just
small pass-troughs to functions in utils::telemetry.
I'll also go and leave some individual comments on the patch.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/rust-lang-nursery/multirust-rs/pull/289#issuecomment-207080489

--
Jeremiah Peschka

OK, I've given lots of feedback on what I'd consider "architectural" issues. Let's get the basic organization squared away and move from there.

Thanks for the quick and thorough review! I'll get on this.

OK, I left a lot of feedback and requests for change, but it's all heading in the right direction. Looking good.

:umbrella: The latest upstream changes (presumably 221bf75) made this pull request unmergeable. Please resolve the merge conflicts.

On further review, I think I've addressed the main issues from the last code review, all tests pass, and the only outstanding item is the loss of formatting when we pipe stderr on Windows, and this is only when telemetry is on. This may be an unfortunate side effect of piping stderr and using the Windows control sequences. The problem should be eliminated on Windows 10 and newer (see my comment on command.rs).
This also might not be considered that big of an issue, I would assume that many of the people who are willing to generate telemetry are also gather telemetry on an unattended build farm, so they may not care that they're losing formatting.

@peschkaj Looks like I'm not going to get to this until tomorrow. Thanks for your patience.

OK, this looks great. I did make two comments about minor changes I'd like to do before landing.
Some thoughts about next steps:
We need to be concerned about the on-disk format and forward-compatibility. Every time we change rustup's metedata format in the future we're going to have to provide an upgrade path. Right now, while we're still iterating a lot, I've been pretty sloppy about it, but soon we're going to need to be really careful about not breaking the metadata on upgrade. This scheme we have now with the "telemetry-on" file and the "telemetry" folder will suite us for now, but will almost certainly change again in the future - this isn't a problem, just something to be aware of. The way data upgrades work presently is that the "version" file contains a number representing the format of the ~/.multirust directory - when we need to make incompatible changes we bump that number, and write some transition code that runs during the rustup self upgrade-data command.
I think we will want to put a similar "version" field inside of our LogMessage type so that later analysis can distinguish exactly what it's looking at (this structure is going to change a lot over time). You can start it at version 1 and just bump every time we make any change.
Telemetry should probably limit the amount of log files it will accumulate to avoid growing without bound. Perhaps a simple way to do this would be to just check whether there are more than e.g. 100 files in the telemetry directory and delete the oldest.
Besides those small concerns, I'd say there are three avenues for further work: analysis, upload, and defining more events. The latter is probably least important - best to get everything working end-to-end to prove it out.
So I'd suggest we start thinking about what it will take to deliver the telemetry logs to us and then for us to analyze them.
Just some ideas:
We can probably start without a server at all, and just ask friends to turn on the telemetry and email them to us. We do though need a way to package up the logs in a convenient form for sending, and this form we should design to be the same whether the logs are sent manually by email or automatically over HTTPS.
To that end I'd suggest that we add functionality to convert the telemetry logs to a tarball, which can be either emailed or uploaded. We might have a rustup telemetry package command that stuffs all the logs into a tarball with a unique name, puts it in the current directory, prints the name of the tarball, then deletes all the old telemetry data.
The tarball will need to have a unique name so I'd suggest a scheme like YYYY-MM-DD-$random-hex-digits.tar.gz. The date helps with sorting and the random number just makes it unique.
With that we can start imagining how to create tooling to turn a big mess of these tarballs into useful information. I think it makes sense to put the analysis in the same crate as the rest of our telemetry code (and we'll probably end up creating a rustup-telemetry crate to hold it all eventually) so that we can share the code between rustup and the hypothetical analysis tools.
Again just spitballing, but we might add another CLI tool called maybe rustup-telemetry-report, in this same repo for doing the later analysis.
OK, that's all the ideas I've got right now. Let me know what you think.

Sounds good. I'll get the fixes together by the end of Monday and respond in more detail tomorrow.
In short, this all sounds like a good plan.
Thanks for the review.

Maybe we can just do all the reporting in rustup itself. Make it useful both for individuals and the group. So perhaps it could draw its data from the users telemetry directory or a directory of tarballs.
Oh, maybe we make the log files and the tarballs have the same naming scheme, and the analysis just works off of a directory of log files and tarballs. That seems pretty clean.

I've got basic implementation of the "must haves" done.
I've started working on the delete files, but when I try the usual test case shenanigans, the proxy'd multirust/rustup directory isn't created. Is there an incantation I should be using for this? An example is at https://gist.github.com/peschkaj/dc1211f3511320da7cfb8f0ef84bfb24

Oh, should add that if we want to hold off on deleting files so we can ship the initial feature, I can pull out the code and then create multiple issues so we can track the new features separately. That does seem like a better fit to me, but I spent 8 hours in aircraft yesterday, so my decision making might be suspect.

Travis appears to be drunk - cp: cannot stat ‘target/i686-unknown-linux-gnu/release/rustup-init’: No such file or directory

I definitely do want to land this before moving on to more features. I think we can land this right now. Just taking another look over it.

The travis failures are due to an upstream change, nbd.

I've started working on the delete files, but when I try the usual test case shenanigans, the proxy'd multirust/rustup directory isn't created. Is there an incantation I should be using for this? An example is at https://gist.github.com/peschkaj/dc1211f3511320da7cfb8f0ef84bfb24

Do you mean that the directory represented in tessts by config.rustupdir isn't created (i.e. what is usually ~/.multirust)? From reading your test case I don't see anything obviously wrong, though I would not expect you to need to write ensure_dir_exists since rustup should create that directory itself. Which line in the test is failing?
Please do file issues about further features so we can continue this discussion there (I'll probably forget to check on this closed PR again).

Thanks @peschkaj!

:+1: happy to help
On Mon, Apr 18, 2016 at 8:57 PM Brian Anderson<EMAIL_ADDRESS>wrote:

Thanks @peschkaj https://github.com/peschkaj!
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/rust-lang-nursery/rustup.rs/pull/289#issuecomment-211659470

--
Jeremiah Peschka

@brson
Now that serde reached 1.0 release and rustc-serialize is deprecated, should rustup switch to serde?


Please help me build the library

I am unfamiliar with Maven. I had this building on my previous laptop but purchased a new one. I cannot get it to build on the new machine, Windows 8.1 - same as the previous machine.
The first goal that creates errors is test-compile. Therefore the command:

mvn test-compile

generates the following errors:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/Dave/Workspaces/xAPI/TinCanJava/src/test/java/com/rusticisoftware/tincan/RemoteLRSTest.java:[24,44] package com.rusticisoftware.tincan.documents does not exist
[ERROR] /C:/Users/Dave/Workspaces/xAPI/TinCanJava/src/test/java/com/rusticisoftware/tincan/RemoteLRSTest.java:[25,44] package com.rusticisoftware.tincan.documents does not exist
[ERROR] /C:/Users/Dave/Workspaces/xAPI/TinCanJava/src/test/java/com/rusticisoftware/tincan/RemoteLRSTest.java:[26,44] package com.rusticisoftware.tincan.documents does not exist
[ERROR] /C:/Users/Dave/Workspaces/xAPI/TinCanJava/src/test/java/com/rusticisoftware/tincan/RemoteLRSTest.java:[24,44] package com.rusticisoftware.tincan.documents does not exist
[ERROR] /C:/Users/Dave/Workspaces/xAPI/TinCanJava/src/test/java/com/rusticisoftware/tincan/RemoteLRSTest.java:[25,44] package com.rusticisoftware.tincan.documents does not exist
[ERROR] /C:/Users/Dave/Workspaces/xAPI/TinCanJava/src/test/java/com/rusticisoftware/tincan/RemoteLRSTest.java:[26,44] package com.rusticisoftware.tincan.documents does not exist
[ERROR] /C:/Users/Dave/Workspaces/xAPI/TinCanJava/src/test/java/com/rusticisoftware/tincan/RemoteLRSTest.java:[379,9] cannot find symbol
symbol:   class StateDocument
location: class com.rusticisoftware.tincan.RemoteLRSTest
...
What follows next is a long list of the Java classes that cannot be found by module RemoteLRSTest.java because it cannot find the package com.rusticisoftware.tincan.documents.
Any help will be greatly appreciated.
Dave Smith

I got this working.
If anyone else is interested, I opened the project in Eclipse and converted the Eclipse project to a Maven project. This actually did not complete successfully within Eclipse; however, after that I am able to build successfully using the command line mvn command.


Two different APIs to call a read only function in smartcontractsapi and transactions

Describe the bug
There are two different APIs to call a read only function:

SmartContractsApi.callReadOnlyFunction(requestParameters: CallReadOnlyFunctionRequest): Promise<ReadOnlyFunctionSuccessResponse>
function callReadOnlyFunction(readOnlyFunctionOptions: ReadOnlyFunctionOptions): Promise<ClarityValue>

It is not bad to have both. However, the signatures should be the same. In particular, the result types and the function arguments:

readOnlyFunctionArgs: ReadOnlyFunctionArgs
functionArgs: ClarityValue[]

Is the bug present in the Blockstack CLI, Gaia hub, Connect or Blockstack Browser?
@stacks/transaction and @stacks/blockchain-api-client

@agraebe Is this still an open issue?

yes, afaik both options still exist

Note that @stacks/blockchain-api-client is not part of this repo. It's a relatively simple API client library auto-generated from OpenAPI spec. It can't (easily) do many useful things like automatically encoding/decoding between js types and Clarity types.
At first glance, I don't think we should blacklist certain OpenAPI endpoints/functions from the auto-generated @stacks/blockchain-api-client lib, and I don't think @stacks/transaction should remove the more developer friendly version of the function.
I'm open to suggestions on how the devx could be improved here.

Probably not actionable here. Could be part of documenting stacks.js


Add comment so zsh detects this as an autocomplete

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


solve the issue #670 Configure similarity index for diffs

Thank you for taking the time to contribute to GitLens! ♥

Description
Solves issue #670.

specifies the -M{x}% parameter in git diff when comparing
adds setting gitlens.views.compare.findRenames
adds info about the settings in README.md

Checklist

[x] I have followed the guidelines in the Contributing document
[x] My changes are based off of the develop branch
[x] My changes follow the coding style of this project
[x] My changes build without any errors or warnings
[x] My changes have been formatted and linted
[x] My changes include any required corresponding changes to the documentation
[x] My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
[x] My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@x13machine Thank you for your contribution! Can you please remove all the formatting changes? Otherwise I can't tell what are required changes vs formatting issues. Thanks!

ok I think I fixed it

@x13machine Thank you so much for your contribution!!


Issue upgrading from 1.13.1 to 1.14.1

Gitea version (or commit ref): 1.13.1 to 1.14.1
Git version: 2.29.2 to 2.31.1
Operating system: OpenSuse Leap 15.2
using package from https://build.opensuse.org/package/show/devel:tools:scm/gitea
using docker (self-made Dockerfile, can provide if necessary)

Database (use [x]):

[ ] PostgreSQL
[x] MySQL
[ ] MSSQL
[ ] SQLite

Can you reproduce the bug at https://try.gitea.io:

[ ] Yes (provide example URL)
[x] No

Log gist:

Description

String localization and interpolation does not seem to work correctly on upgrade to 1.14.1 from 1.13.1.
(Only the latest package is available at the repo, it seems, so I haven't been able to try upgrading to 1.13.7 first. Still working on that.)
The pages normally display in Japanese in my environment
I have reverted back to 1.13.1 for now, but I needed to update the version in the DB to be 156, so I don't know how long-term that solution is.
Screenshots

I executed the statements below to revert the DB schema to the previous values. The only data that seemed to be modified by the upgrade is the comment table, where non-sha data was moved from commit_sha to old_ref, but I'm leaving this as is for now.
alter table `comment` drop column time_id;

alter table hook_task
      drop column typ
    , modify type int after uuid;

alter table oauth2_grant
      drop column `scope`
    , drop column nonce;

alter table project_board drop column sorting;

alter table protected_branch drop column block_on_official_review_requests;

alter table reaction
      modify created_unix bigint after user_id
    , drop key IDX_tmp_recreate__reaction_type
    , add key  IDX_reaction_type (`type`)
    , drop key IDX_tmp_recreate__reaction_issue_id
    , add key  IDX_reaction_issue_id (issue_id)
    , drop key IDX_tmp_recreate__reaction_comment_id
    , add key  IDX_reaction_comment_id (comment_id)
    , drop key IDX_tmp_recreate__reaction_user_id
    , add key  IDX_reaction_user_id (user_id)
    , drop key IDX_tmp_recreate__reaction_original_author_id
    , add key  IDX_reaction_original_author_id (original_author_id)
    , drop key IDX_tmp_recreate__reaction_created_unix
    , add key  IDX_reaction_created_unix (created_unix)
    , ROW_FORMAT = DEFAULT
;

drop table repo_transfer;

alter table review drop column dismissed;

drop table `session`;

alter table topic modify name varchar(25);

drop table user_redirect;

alter table webhook
      drop column `type`
    , modify hook_task_type int after is_active
;

I have also noticed that log files are no longer created where they used to be.
I'm guessing the layout on the filesystem has changed, either here or in the package I am using.

I had been moving a folder in my docker file which no longer needed moving. Sorry for any trouble.

One more remark as the maintainer of the package at openSUSE.
The package specified here is not used by docker in any way. It is a pure rpm package. And I have absolutely nothing to do with the docker container for opensuse. The issue is all completely wrong and irrelevant.
Since I have been using the specified package myself for years, I can say that it works without any errors.


Is there a updated version of quasar or you stopped updating it on 2020 ?

Is there a updated version of quasar or you stopped updating it on 2020 ?

Pretty sure MaxXor is working on another update.

So there is new another version after 1.4.0 ?

Roadmap and the associated discussion.

Pretty sure MaxXor is working on another update.

So there is new another version after 1.4.0 ?

Yes. You can check other issues as evidence that MaxXor is working on 1.5. It's going to take a long time because they need to rework the entire GUI into something more modern.

It's progressing slowly, but not stopped. See also the roadmap linked by @BurntDog .


define default variables to avoid NilClass

Hi,
this update fixes NilClass issue while defining a target. solves issue #128

Hi,
This was a little more complex to solve, I've added more acceptance testing to detect this kind of issues using PR-130
Thanks for your work even though it did not get merged
kind regards,


refactor(main): remove unnecessary parameter

BTW Really awesome work on the last set of PRs. Keep it up and you will probably get asked to join the core team :)


This plugin generated a warning from the characteristic 'Brightness'

Describe the bug
This is the error I now see in the logs, with the new version (and home bridge version)
[25/02/2021, 05:10:47] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 392 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[25/02/2021, 05:40:02] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 392 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[25/02/2021, 06:33:39] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 149 exceeded maximum of 100. See https://git.io/JtMGR for more info.
[25/02/2021, 06:33:39] [@milo526/homebridge-tuya-web] This plugin generated a warning from the characteristic 'Brightness': characteristic was supplied illegal value: number 392 exceeded maximum of 100. See https://git.io/JtMGR for more info.
Steps To Reproduce
No steps, just in the logs..
Plugin Version
Plugin: 1.0.0
Homebridge: 1.3.1
Homebridge Config
{
"name": "TuyaWebPlatform",
"options": {
"username": "514913XXXX",
"password": "XXXXXXXX",
"countryCode": "1",
"platform": "tuya"
},
"defaults": [
{
"device_type": "form"
}
],
"scenes": false,
"platform": "TuyaWebPlatform"
},

Already reported in #158


Update windows-autopilot-requirements-network.md

Added new URLs needed for 19H1.

@greg-lindsay - can you please assist to check, approve and merge the content for this PR?
Thank you.

@greg-lindsay -  I would like to follow up on this. Kindly assist to check, approve and merge the content for this PR?
Thank you.

@greg-lindsay - I would like to follow up on this. Kindly assist to check, approve and merge the content for this PR?
Thank you.

@greg-lindsay - I would like to follow up on this. can you please assist to check, approve and merge the content for this PR?
@kenwith - would you be able to merge the content for this PR? Thanks.

@greg-lindsay - I would like to follow up on this. can you please assist to check, approve and merge the content for this PR? Thanks


Export ConfigExtension type from package

Originally posted by @stijns96 in https://github.com/dcastil/tailwind-merge/discussions/501

Hi @dcastil,
I'm currently waiting for this in my PR. Would be appreciated if you could let me know when we can expect a release.

@stijns96 will do it right now

@dcastil Thanks!


fixed modal is too big in mobile screen

@bilalmirza74 create pull request in this 2-modal-is-too-big-in-mobile-screen branch.


 Nothing broke, so I say let's :fire: it. Please CR @gfiorav

Well done! 🔥  it!


Add onZoomBegin and onZoomEnd props

This adds a onZoomBegin and onZoomEnd props when isZoomed.value changes.
This could be useful to disable simultaneous gestures (e.g. fling to close) or to hide certain elements in the UI (e.g. next image button).
Helps with https://github.com/intergalacticspacehighway/react-native-reanimated-zoom/issues/15

Awesome. Looks good! Thanks @sregg 🥳


Added BraceBetweenPoints and some documentation

Partial implementation of #210
Added BraceBetweenPoints to brace.py
Also added documentation and examples both to the new BraceBetweenPoints as well as the old Brace.

NumperPlane... oof. I'll look into tests for this after I tried sleeping, again.

@leotrs I only now noticed that your suggestion sneakily killed off the wait statement I put into the example. I'm not sure if we have a policy on ending wait statements or not, but I'm personally not a fan of not having them. Whether I make examples or program something new, I find myself more often than not wanting to have a good look at the final state. The examples also just seem noisy when they don't stop briefly at what they're actually meant to show. Although at least the video player in the docs seems to allow easily enough to capture that last frame without a wait statement, so I suppose it's not that much of an issue here.
Do we already have a repo-wide verdict on this?

Oh I didn't mean to be sneaky :sweat_smile: ! We don't have a consensus on this, I was just doing it out of personal preference, so I will lead the final decision to you. I think I originally deleted it because I thought the example's output was a single frame, in which case the wait is unnecessary.

Oh I didn't mean to be sneaky 😅 ! We don't have a consensus on this, I was just doing it out of personal preference, so I will lead the final decision to you. I think I originally deleted it because I thought the example's output was a single frame, in which case the wait is unnecessary.

Well the other example has a wait statement too, and they're both animated, albeit very briefly. But yes, if it would've been a single frame then there definitely shouldn't be a wait statement. I'll re-add it then.

something about the documentation is still failing

What do you mean? All RTD build processes were successful since 1e177cda.

something about the documentation is still failing

What do you mean? All RTD build processes were successful since 1e177cd.

This garbled mess:
point_1 ([Union[:class:`list,:class:numpy.array]]`)

From this code
point_1 : :class:`[Union[:class:`list`,:class:`numpy.array`]]`

To be seen here: https://manimce--693.org.readthedocs.build/en/693/reference/manim.mobject.svg.brace.BraceBetweeenPoints.html#manim.mobject.svg.brace.BraceBetweeenPoints

This garbled mess: [...]

If I had to guess, the correct notation should be
point_1 : Union[:class:`list`, :class:`numpy.array`]

If you would like help by your IDE with writing these kind of things, you might be interested in writing it as a type hint, i.e.,
from typing import Union, Optional

def __init__(self, point_1: Union[list, np.array], point_2: Union[list, np.array], direction: Optional[Union[list, np.array]] = ORIGIN, **kwargs):

Then (theoretically, but I am somewhat sure) the types also show up in the documentation (and you can leave out the part starting at the colon from the   point_1 : ... syntax).
(But again, I might be wrong that it works like that automatically. If so, this would still be the desired behavior, but we should try to get it to work on a separate PR.)

RTD currently has a problem building documentation (unrelated to our project), but when rendering the documentation locally, everything seems good to me:

(direction still has to be fixed.)

I found a pretty terrible type myself as well. I do suppose this is ready for merging now. Since leotrs said the test issue is non blocking I will take care of the tests needed for my submissions later in one swoop.


feat: add aws hybrid notebook

Adding the AWS Hybrid notebook somewhere customer facing. The notebook will train a synthetic model and can also be used to generate some example data. This serves as a sort of "smoke test" for new Gretel Hybrid clusters.

left comments here: https://colab.research.google.com/drive/1YCLFD_r-cPahgBkhU8TMXTCGSt3J1Ybs#scrollTo=VvvGcKMoj6xw


feat: specify features and target when creating a TaggedTable

Closes #27 .
Summary of Changes

Screenshots (if necessary)

Testing Instructions

🦙 MegaLinter status: ❌ ERROR

Descriptor
Linter
Files
Fixed
Errors
Elapsed time

✅ PYTHON
black
4
2
0
1.25s

✅ PYTHON
flake8
4

0
0.47s

✅ PYTHON
isort
4
4
0
0.24s

❌ PYTHON
mypy
4

1
1.83s

❌ PYTHON
pylint
4

6
2.97s

✅ REPOSITORY
git_diff
yes

no
0.03s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff
MegaLinter is graciously provided by

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

v0.7.0
GitHub release

Your semantic-release bot :package::rocket:


Make UART futures Send

This is a quick fix to make Uart futures implement Send.
Previously they were !Send, because pointer to the data register was held across an await point. Simple rearrange fixes the issue.

Ah, I'm using the FuturesExt::boxed() from futures, which enforces the Send.
I guess I could just manually box them, but is there a reason for futures not to be Send?

Ah, I'm using the FuturesExt::boxed() from futures, which enforces the Send.

Huh, no idea why that requires Send. You can box manually just fine without Send.

is there a reason for futures not to be Send?

For most drivers, none! It's nice to make futures Send if we can. Some drivers can't Send safely, such as the ones using PeripheralMutex, but they're very few.

An alternative would be to make dma::write(...) accept a newtype (maybe struct DmaAddress(*mut u32) ?), which wraps the raw pointer and implements the Send itself. Then you could call await directly on DMA methods.

The workaround is fine, I wouldn't make it more complicated with newtypes. It's just that it was unexpected to me that it was necessary! :) Could you add a comment explaining it? then we're good to go


The resource's created time is not matched

Describe the bug
资源库里显示的文件上传的月份不对，有一个月的误差。四月上传的会显示在三月，现在上传一个图片，还是显示在四月。
Steps to reproduce
上传文件，点击资源库，刚上传的文件显示在4月里。
The version of Memos you're using
21.0 和 22.0 都有这个问题，估计以前的也有
Screenshots or additional context
No response

Unable to reproduce. Maybe you can take a look for the time zone where your service is located, or provide a real data from your database.

See screenshot. I uploaded a image (download.jpg) on your demo website (0.22.1) 2 minutes ago. It shows in April.

It works right on my side. So it's probably related to the time zone of your browser/OS.

It has been a long term issue, related to the timezone configuration, for those who are located in North America, it will result in such a weird 1 month offset.

Let me provide more information on how to replicate this bug.
If we choose the timezone of a computer to be Shanghai or Hong Kong, it will show the correct month - July.
If we choose another timezone, say New York or Toronto, and refresh the page, it will show the wrong month - June.


Use a mock for tests

Currently, the tests seem to require a valid API token and is actually making requests against the Logz.io API. This makes it non-trivial to contribute to the project as it requires to have an Enterprise account just for running the tests. I suggest to use a mock for the tests and complement with integration tests which can do real requests against the API if desired.

development branch for introducing mocks for testing - release_1_2_mocks

@pengux - agree - which functions would you mock?  the ones that make the API HTTP calls?  or some higher level of abstraction?

@jonboydell The whole API can be mocked with a simple HTTP server and httptest which just return fixed test data. The mock can be set to expect a specific request and return the appropriate response for it. This way, the one writing the test can for example inject invalid/valid responses to test against.

thanks @pengux - i thought you meant a mock as in https://github.com/golang/mock - i'm not au fait with httptest will look into it

@jonboydell I think something like https://github.com/jarcoal/httpmock is more suitable for mocking APIs

@pengux - didn't see that till just now, have already implemented httptest across the Users part of the lib - going to stick with that for Users but might use the other lib for Endpoints and Alerts and then upgrade - BTW - I am<EMAIL_ADDRESS>- I'd prefer email over Slack ATM, if it doesn't work we can use Slack, but unless you pay for it, it deletes the chat history after 24 hours :(

framework is now in develop, so closing this issue - improvements to test coverage to be tracked as individual issues...


[es] Merge the dev-es branch into main branch

Describe your changes
This PR will merge dev-es updated branch into main branch
Related issue number or link (ex: resolves #issue-number)
N/A
Checklist before opening this PR (put x in the checkboxes)

[x] This PR does not contain plagiarism

don’t copy other people’s work unless you are quoting and contributing it to them.

[x] I have signed off on all commits

signing off (ex: git commit -s) is to affirm that commits comply DCO. If you are working locally, you could add an alias to your gitconfig by running git config --global alias.ci "commit -s".

@seokho-son not sure why/how we passed two commits not signed well on DCO. Could you/we use squash and merge option to fix this?

I think you should be able to do it on the dev-es branch yourself :) You can see how to do it here: https://github.com/cncf/glossary/pull/2962/checks?check_run_id=22000165768. If you have any issues you can ping us again and we assist. @ramrodo

Anyway, to merge this type PR, admin(some of maintainers) needs to mege.
Let me merge to expedite localization efforts.


initial attempt to hack in Cancancan support to Controllers

The cancancan gem relies upon lots of ActionController, ActiveSupport, ActiveModel, and ActiveRecord internals to do its job. To get basic permissions working I had to pull in a lot more code from ActionController. Even with this additional code the before_action hooks did not setup correctly for the controller actions. To fix this, a direct call to authorize :method_name, self is required in each method right now.
Ultimately I think we could get this to work but it would be a lot of work.
Plus, these permissions/abilities would only work with Controller actions. They would never work with the existing command structure.
@digitalextremist Wanted you to see this too.
While integrating this gem is feasible I do not think it is practical.
Can we use this PR to discuss alternate approaches? My acl branch already works... :)

Found a recently abandoned gem by the name of authority which looks like it might be the more generic solution we need. See here:  https://github.com/nathanl/authority
Scroll to the "Controller" section where it mentions that it will load Rails-specific code if it needs to but can be used as a general authorizer framework for Plain Old Ruby Objects. We could fork it.

This is unworkable. Closing.


Solve

problem description
As descripted in README.md, I add the two script to my index.html, but it still doesn't work.
Then I look at the console of the browser, it print the lof that pdfobject can't be found, so I guess it may because of the miss of the target js source file. I parse the pdfobject on my browser, it did give me an 404 error. So it can be determined that it's the miss of the source file that lead to the error.
How to fix it?
just go to the homepage of the pdfobject, and find the cdn link on left side bar. Copy the link and replace the src attribute of pdfobject, then it can work properly.
Just like:
<!-- pdf-render -->
<script<EMAIL_ADDRESS><script src="//unpkg.com/docsify-pdf-embed-plugin/src/docsify-pdf-embed.js"></script>


'tokio-runtime-worker' panicked at 'Could not get tendermint status: serde parse error

Attempt starting new install, running latest rust nightly rustc 1.63.0-nightly (50b00252a 2022-06-06) immediately panics and fails.
$ nomic start
Configuring node for state sync...
Getting bootstrap state for Tendermint light client...
thread 'tokio-runtime-worker' panicked at 'Could not get tendermint status: serde parse error

Caused by:
    expected value at line 1 column 1

Location:
    /home/sv/.cargo/registry/src/github.com-1ecc6299db9ec823/flex-error-0.4.4/src/tracer_impl/eyre.rs:10:9', src/bin/nomic.rs:316:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
App Error: panic

Full Backtrace details:
$ bash -c "RUST_BACKTRACE=full nomic start"
Configuring node for state sync...
Getting bootstrap state for Tendermint light client...
thread 'tokio-runtime-worker' panicked at 'Could not get tendermint status: serde parse error

Caused by:
    expected value at line 1 column 1

Location:
    /home/sv/.cargo/registry/src/github.com-1ecc6299db9ec823/flex-error-0.4.4/src/tracer_impl/eyre.rs:10:9

Stack backtrace:
   0: core::ops::function::Fn::call
   1: eyre::capture_handler
   2: eyre::error::<impl eyre::Report>::msg
   3: <flex_error::source::DisplayOnly<E> as flex_error::source::ErrorSource<Tracer>>::error_details
   4: tendermint_rpc::error::Error::serde
   5: tendermint_rpc::response::Response::from_string
   6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   8: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   9: std::thread::local::LocalKey<T>::with
  10: futures_executor::local_pool::block_on
  11: nomic::configure_for_statesync
  12: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  13: tokio::runtime::task::core::CoreStage<T>::poll
  14: tokio::runtime::task::harness::Harness<T,S>::poll
  15: tokio::runtime::blocking::pool::Inner::run
  16: std::sys_common::backtrace::__rust_begin_short_backtrace
  17: core::ops::function::FnOnce::call_once{{vtable.shim}}
  18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/alloc/src/boxed.rs:1951:9
  19: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/alloc/src/boxed.rs:1951:9
  20: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/sys/unix/thread.rs:108:17
  21: start_thread
  22: clone
', src/bin/nomic.rs:316:14
stack backtrace:
   0:     0x55f5efc1f75d - std::backtrace_rs::backtrace::libunwind::trace::h2a8892c156585d66
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55f5efc1f75d - std::backtrace_rs::backtrace::trace_unsynchronized::h918c401bc86eed40
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55f5efc1f75d - std::sys_common::backtrace::_print_fmt::h2a52b4cb52dc84fb
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x55f5efc1f75d - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h2f5ce3ea50e5b1d6
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x55f5efc4696c - core::fmt::write::h48a5b18f44037270
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/core/src/fmt/mod.rs:1196:17
   5:     0x55f5efc18fe1 - std::io::Write::write_fmt::h1d1b08935a2fcf4b
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/io/mod.rs:1654:15
   6:     0x55f5efc20d95 - std::sys_common::backtrace::_print::h46d4f4f2d0dbcce0
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x55f5efc20d95 - std::sys_common::backtrace::print::h8334e6fa27a1dde4
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x55f5efc20d95 - std::panicking::default_hook::{{closure}}::hc13c7ff820b0fe22
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/panicking.rs:295:22
   9:     0x55f5efc20ab6 - std::panicking::default_hook::h100ba67c99329739
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/panicking.rs:314:9
  10:     0x55f5efc21326 - std::panicking::rust_panic_with_hook::h0a6a04da5fd1d45f
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/panicking.rs:698:17
  11:     0x55f5efc21217 - std::panicking::begin_panic_handler::{{closure}}::h55242fd43a581580
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/panicking.rs:588:13
  12:     0x55f5efc1fc14 - std::sys_common::backtrace::__rust_end_short_backtrace::h53771d999c075964
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/sys_common/backtrace.rs:138:18
  13:     0x55f5efc20f49 - rust_begin_unwind
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/panicking.rs:584:5
  14:     0x55f5eeb94443 - core::panicking::panic_fmt::h1a17f733294f4ffb
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/core/src/panicking.rs:142:14
  15:     0x55f5eeb94533 - core::result::unwrap_failed::hb96e0128b0d3cf3e
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/core/src/result.rs:1805:5
  16:     0x55f5eec7c115 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hbfc4ca37d2e0ea4a
  17:     0x55f5eed605c1 - std::thread::local::LocalKey<T>::with::h945f017f0fd77ee0
  18:     0x55f5eef32a6d - futures_executor::local_pool::block_on::hb7ad54143a7dd4e8
  19:     0x55f5eed11635 - nomic::configure_for_statesync::h11e4b4aded29ea15
  20:     0x55f5eeeea44f - <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll::h73e38f3b64471900
  21:     0x55f5eece05eb - tokio::runtime::task::core::CoreStage<T>::poll::h4f7f935d64693a23
  22:     0x55f5eede6260 - tokio::runtime::task::harness::Harness<T,S>::poll::h6bb64ff469403bed
  23:     0x55f5efb92805 - tokio::runtime::blocking::pool::Inner::run::h9653a3b10a6ee03e
  24:     0x55f5efb974c7 - std::sys_common::backtrace::__rust_begin_short_backtrace::h43b8945bc4261c99
  25:     0x55f5efb9a3ea - core::ops::function::FnOnce::call_once{{vtable.shim}}::had19396efb2580cd
  26:     0x55f5efc26e23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha070fd431c3387e9
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/alloc/src/boxed.rs:1951:9
  27:     0x55f5efc26e23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd87ab2d0201316b5
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/alloc/src/boxed.rs:1951:9
  28:     0x55f5efc26e23 - std::sys::unix::thread::Thread::new::thread_start::ha32118aaa6c8a9be
                               at /rustc/50b00252aeb77b10db04d65dc9e12ce758def4b5/library/std/src/sys/unix/thread.rs:108:17
  29:     0x7fc7edb82609 - start_thread
  30:     0x7fc7ed753133 - clone
  31:                0x0 - <unknown>
App Error: panic

It looks like the Polkachu node is down, which is being used for bootstrapping the light client. For now, you can simply comment out line 225 in src/bin/nomic.rs.

ahhhhhhh wonderful :D

I saw the code comments and will try to solve... rust amatur here, though

ahhhhhhh wonderful :D
Matt, is it possible to add additional nodes to that bootstrap step so that we could have.... let's say... 100 nodes to bootstrap from?

 It currently fails if any of them are offline or serve conflicting results, but this could be made to just assume some threshold (e.g. 90%) agrees.

Since this issue, the boostrap mechanism has been made more resilient (it will succeed if up to 50% of the bootstrap nodes are reachable), and the next step is to just get validators to add themselves to the list.


Fix number to string for whitehall port

This feels very wrong. Ports are not strings.
But I understand your pain so merge away and we can deal with it if we move to Puppet 4.


Windows: new insider icon in small resolution is indistinguishable from stable version

As we learned, in small resolution, the new logo looses its border to the right and as such you cannot distinguish the application from stable.
One suggestion is to go back to the green color for insiders.

Verified that we have a green insider icon


Startup crash with Redix 1.2.2 using :inet6 in socket opts

We run our application at Fly.io, and so all our networking is IPv6. As such we do (something like) the following:
{:ok, conn} = Redix.start_link(redix_url, name: :my_redix, socket_opts: [:inet6], sync_connect: true)

After upgrading to Redix 1.2.2 and with the introduction of NimbleOptions, Redix now fails to start with the following error:
%NimbleOptions.ValidationError{
  message: "invalid value for :socket_opts option: expected keyword list, got: [:inet6]",
  key: :socket_opts,
  value: [:inet6],
  keys_path: []
}

Are we holding it wrong? Is there another way to specify IPv6 that NimbleOptions won't complain about?

The ipv6 option doesn't work for me with the same error even with version 1.0


Server Upgrades

Coverage increased (+0.6%) to 95.077% when pulling 85d7c7729ca051eca0771572435c967a071e690a on dev into d3a391a8ac2e580bd519a02ff6f3570d2180989b on master.


Built-in postgres deployment broken

Hello, due to the combination of this two changes:

https://github.com/openobserve/openobserve-helm-chart/commit/679eee6dfb22be2ca7bdd96267a85b8878d3b788
https://github.com/openobserve/openobserve-helm-chart/commit/92ae06aaf45e95a91f3243449e913ea27db1cfe8

Built-in postgres no longer works, as the DSN for postgres is empty. The generated value in configmap gets overriden by the empty value in secret which lacks the generated condition branch.

A little bit more detail, this lnie:
https://github.com/openobserve/openobserve-helm-chart/blob/5637901c241c9a9f2199441b2bd81b6b2a7eced0/charts/openobserve/templates/configmap.yaml#L70
does not do anything at this point, it adds a value to configmap, but that value is not considered due to secret priority.

cd charts/openobserve/
helm -n openobserve -f test_values.yaml template o2 . > o2.yaml

Do you get ZO_META_POSTGRES_DSN blank?

I got the issue.


Look at whether or not "Download offset" setting is necessary

The "Download offset" setting may not be necessary.

Doesn't seem like it's necessary. Will have to make a dev branch with the field removed to confirm that it doesn't effect fetch job behavior to remove it.


database/sql: add support for named input parameters

Named input parameters are supported by a number of larger database servers and simulated in some database clients for protocol's that only support positional arguments.
TDS is MS SQL Server's wire protocol and directly supports named parameters.
Postgres' v3 wire protocol doesn't support named parameters but some clients simulate it through replacement.
In SQL this may look like:
select d.Name, d.Age
from app.Dancer as d
where d.ID = :DancerID;

or
select d.Name, d.Age
from app.Dancer as d
where d.ID = @DancerID;

In small to medium cases positional placeholders work fine. In larger tables positional indexes become hard to use, bug prone, and possibly impossible to use.
One of my clients uses JDE, their table structure can be viewed here: http://www.jdetables.com/
Yes, it is bad, but I've gotta deal with it. I have another client that uses a similarly "enterprise" solution that has huge wide tables. Now try to imagine updating or inserting into those tables, or executing proc with 30-50 parameters. Named parameters gives me a chance to not get an index off by one.
The other area where I keenly feel the need for named parameters is when I dynamically assemble SQL, but still want to pass in input parameters so I don't need to manually escape everything. Two examples:

When creating a specific RPC for a search or filter I often need to filter in particular cases. There are two ways to do this:
a.

select * from data.Account as a
where
  (len(:InputValue) <> 0 and :InputValue like a.Name)
  or (len(:inputValue = 0 and a.Name = 'BOB')

I use this method often. However sometimes in complex cases performance can drop off due when it chooses the wrong query plan. When that starts to happen I do the next option:
b.
sql := &bytes.Buffer{}
sql.WriteString(`select * from data.Account as a where 1=1 `)
if len(inputValue) != 0 {
  sql.WriteString(` and :InputValue like a.Name `)
} else {
  sql.WriteString(` and a.Name = 'BOB' `)
}

When you start to construct the SQL, it becomes harder to determine the positions all the parameters should be in and makes the code more complex, though not impossible if you push input parameter values into an array as you push sql fragments in.

While truly it is a variant of 1b, when creating a more generic application framework the work-around presented in there becomes more difficult. I sometimes define both the name of the parameter I want to pass in, tie it to the client, and if present construct SQL to the desired effect. I realize that is vague, but I don't have a ready open source solution I can show.

It might be useful to know what other packages are doing.

JDBC (Java API for working with databases) doesn't support named parameters. Usually this functionality is provided by libraries or frameworks (e.g. Spring, Hibernate, etc).
Python DB API 2.0 supports a few param styles (including named parameters) but the style that is used selected by a driver.

I'm not a fan or ODBC or JDBC. I'm aware they don't support named parameters even when the underlying database protocols do, then when the higher abstractions add back in parameters through substitution we get even more inefficiencies.

Over the years I have both added and removed parameters from this call, each time it is a counting game.
All that to say, I would prefer to survey database protocols rather then other abstractions.

For your information,
JDBC supports named parameters (for callable statement):
http://docs.oracle.com/javase/7/docs/api/java/sql/CallableStatement.html#setObject(java.lang.String, java.lang.Object)

@kardianos, I agree that surveying database protocols is necessary. If named parameters are not supported by a database protocol than either database/sql or driver package would have to parse supplied SQL to implement placeholder replacement correctly.
For example postgresql protocol supports positional parameters only (e.g. $1, $2, etc). pq driver for go also uses this syntax. ? placeholder syntax is not supported because fair amount of work is required to implement this functionality properly. See discussion of https://github.com/lib/pq/issues/233 for more details.
@gwenn, callable statements are for stored procedures only. It is much easier to add support for named parameters in this case as most databases provide a way to get information about a stored procedure including parameter names and types.

@kostya-sh Regarding adding named parameters, you hit the nail on the head. Named parameters for drivers needs to be optional, if it was supported. However sometimes you don't need a full SQL parser for things like this correctly. For example MS SQL Server has a "go" keyword that isn't part of T-SQL, but is rather a common client extension that separates out SQL batches. Supporting that required a simpler parser: https://bitbucket.org/kardianos/rdb/src/3240fb22ca61727b4604fae0c541737c1e1e26eb/ms/batch/batch_test.go?at=default
But you are correct, it would be non-trivial to do correctly even in the best of cases. I don't deny that.

I could see a few ways to make this work.

We could have an `DB.QueryCtx(ctx, query, ...Param)
We could just accept a new special Param type into the existing methods
We could alternate DB.Query(query, "ID", 5, "Name", "Dreaming"), but I don't think that could work as that would be API breaking (different meaning, no way to differentiate).

Driver interfaces would need to be updated as well. Having a Param type would solve specifying an input type and specifying output parameters as well.
@bradfitz If methods were added to support the context param, I would support (1). Any opinion on this?

How about?
db.Query(quesry,sql.NamedParam{"ID",5},sql.NamedParam{"Name","Dreaming"}).

Query's args are ...interface{}, so we can pass a type the encapsulates the named param.

So (2) in the above options. I'd also like to include type information as well as Out bool for output parameter.
I think having a Param or NamedParam type is the best option. My concern with re-using the existing method is how to support existing drivers, or telling them apart. I guess if the driver doesn't support the new interface and the query args contained a Param type, then it could just error out, backend not supported.

@kardianos Doh! sorry. Mentally glossed over #2 somehow. :-(
Another option is to only support this on prepared statements, which the ValueConvertor interface may be able to already do for us with some extentions / docs / guidance ? Not sure as I'm not too familiar with it or how its used.

@freeformz That is how postgresql proto works, but other systems like TDS (ms sql server) can specify named param types for batch queries as well as prepared statements and trans. Most postgresql drivers do value substitution for non prepared statements when used with named parameters.
Hmm, I'm not sure how the ValueConverter would help in this case.

@karalabe K.
Re: ValueConverter, I was reading through the Stmt code and maybe I just misunderstood what it's doing and how it works. Never mind.
Query could check args to see if any of them are sql.NamesParams and if so then assert for a NamedQueryer interface that looks like this:
type NamedQueryer interface {
        NamedQuery(query string, args []Value, namedArgs []NamedValue) (Rows, error)
}

Stmt would also need to handle named params as well right? And it handles args in a very different way (the code I was reading).

How would package references work out?
sql -> sql/driver
impl -> sql/driver
impl -> sql
sql/driver !-> sql
As such NamedValue or Param could be a concrete type, but it would need to satisfy an interface that was defined in sql/driver.

I'll need to look at those particulars in a bit. I'll see if I can get a complete conceptual model of how the driver code operates.

I was using sql.NamedParam and driver.NamedValue to differentiate.

You're one step ahead of me :).

How about?
db.Query(quesry,sql.NamedParam{"ID",5},sql.NamedParam{"Name","Dreaming"}).

The only problem with that is it wouldn't pass go vet checks, due to use of unkeyed struct literals.
What about a variation of that, where we have:
type NamedParam struct {
   Name  string
   Value interface{}
}

func Param(name string, value interface{}) NamedParam {
   return NamedParam{name, value}
}

So then callers are shorter and look like:
   db.Query(query, sql.Param("ID", 5), sql.Param("Name", "Dreaming"))

@bradfitz
That would be alright by me. I would prefer a shorter name then NamedParam for the struct. Here is an example from one of my procs:
   ... query text ...
		rdb.Param{Name: "@Approve", Type: rdb.Bool, Value: approve},
		rdb.Param{Name: "@Comment", Type: rdb.Text, Value: comment},
		rdb.Param{Name: "@QueueType", Type: rdb.Integer, Value: NotifyReport},
		rdb.Param{Name: "@Account", Type: rdb.Integer, Value: userInfo.ID},
		rdb.Param{Name: "@Now", Type: rdb.Time, Value: time.Now().UTC()},
		rdb.Param{Name: "@Today", Type: rdb.TypeDate, Value: time.Now()},

Specifying the placeholder in the name may also be important as different systems accept different ones. (In the v1 of rdb, I just had the name, no placeholder and let the driver append it. I think that was a mistake.)

Type can be important, I've run into text vs varchar issues, or Date vs Timestamp issues, Decimal precision param issues.

@kardianos, note that the type in my example had a long name, but the function to create them was short. Is that okay?

@bradfitz Noted.
In ADO.NET there is both an overloaded function to generate a param and you can use a struct literal (in go parlance) to specify it. Often none of the overloads do what I want so I use a combination of function + struct literal (it is an interesting C# syntax that allows that). From that experience I tend to shy away from function helpers in this context.
What I would recommend is to not include a function helper. If an application wants to it can specify a helper function in the data access that meets the particular need. I would prefer just sql.Param as a name, rather than sql.NamedParam, but the preference is small.
I've haven't referenced this directly in this issue thus far, but I also think it important to have an optional type in the NamedParam struct as well, default value TypeUnknown.
How do you feel about including type information in the NamedParam type? Possibly Length, Precision, and Scale as well.

I would prefer just sql.Param as a name, rather than sql.NamedParam, but the preference is small.

See my comment above about go vet. It would be very wordy at use sites.

How do you feel about including type information in the NamedParam type?

I don't think we should include any type information. A Go interface value already conveys the type information. If a user wants to signify a certain type, they can use a Go type with that value.

@bradfitz
I understand. This could be an issue. In many instances, though not all, it makes a difference if a driver sends a parameter as a text, varchar, or nvarchar. Sometimes for it maters for compatibility and sometimes for performance.
If this isn't an option, while I can still work to put in multiple result sets in database/sql, I will need to work on a different interface for my own uses. I'm not trying to be difficult, it is just the constraints I face; it isn't worth trying to fight the rdbms. Maybe there is a middle ground with a driver defined type like:
Query("select * from dbo.Locus where Name = @Locus", sql.Param("Locus", mydriver.Text("HLA A"))) I'm not sure. I'm not sure yet how that would play with the rest of the pipeline.

It would be very wordy at use sites.

I'm okay with wordy. I'm not okay with "can't do". SQL just is wordy.

I'm fine with driver-defined types for the weird cases.

I think it would be very useful to collect use cases where specifying parameter types is necessary.
@kardianos you mentioned about a few issues with types. Can you provide more details?
This issue about named parameters though, I think the discussion about types can be moved to #12383.

FWIW: lib/pq has some driver defined types for array handling and a helper function https://godoc.org/github.com/lib/pq#Array

I don't think named input parameter binding is problem, you can use named input parameter in you statement string as long as your database support it. The underlying driver doesn't need to know the name, it can just treat named binding as positional binding and let the database server handle it. For example, go-oci8 support named bind with database/sql, and it just use a positional binding under the hood. Note that placeholder can be numbered, named or not.
The only problem I can see is portability across database. For that you will also need a uniformed named placeholder format, which will inevitably need to do string substitution in the driver if the database doesn't support named binding or use a different format. This can already be done in a third-party helper library like sqlx now.
As for output parameter binding, there are three problems now as I can see:

We can use a pointer to value as a argument supplied to Exec() and Query() for value output parameter, and database drivers can infer the database type from value type then doing the binding and store back the result in the pointer. The problem here is that, in database/sql, all args are converted to database/sql/driver.Value then pass to the underlying database driver, and Value doesn't allow a pointer type, and will even do a auto-dereference with the default converter or use database/sql/driver.IsValue() to check that for custom Valuer. This can be work aroud in the driver by implement a custom ColumnConverter on *Stmt, but that doesn't work for all situation. A better solution will be create a OutputValue type as a pointer, and implement the Valuer interface, then modify database/sql/driver.IsValue() to accept that.

For output ref cursor, we can't just use a pointer for drivers to infer its type, we will need a special type here. This special type could be merge with the above OutputValue type. Note that ref cursor's result will be return as a result set and doesn't need to store in the argument passed to Query().

Finally, some output parameter could have no placeholder in the statement. For example, when calling a function (not stored procedure) with return values, the return values will not have placeholder in our call statement. Another example will be something like SELECT id, CURSOR(SELECT * FROM table_2) FROM table_1 where id=100;, the cursor here is a output parameter without placeholder. For this problem, we could put extra arguments after those with placeholder in Exec() and Query(). The problem is that the database may not numbered the parameters in this order, but caller can always arrange the arguments' order base on which database they use.

For database specific types, I think is better leave to database drivers and modify database/sql/driver.IsValue() to accept them. I will add some comment in #12383.

Wire protocols that support named parameters should send those names to the database. If for nothing else error messages from the DB will be much easier to understand. I personally don't want to use a database that forces named parameters into indexed parameters if the wire protocol supports it.
RE driver types: yes, defining DB types on the driver seems to be the way people are leaning, though I think it hurts the possibility of more generic uses. Did you see https://github.com/golang/go/issues/12381#issuecomment-239873863 ? It looks like this is possible today. (I still need to investigate all the way myself.)
Output values and cursors are probably not something I personally would want to tackle with the database/sql API. Feel free to open a specific proposal / send a change request on thoses.

@kardianos Note that the named placeholders are still in the statement text that we send to database, we just bind it by position, database will have to parse placeholders anyway, so it will have both name and index infomation. So for error messages, database could still use placeholder names if it want to support that.
Yes, I saw the pq support for PostgreSQL array type. But it just convert the array to a Go string, because as a input paramater, PostgreSQL's array could just be represented by {elem1, elem2, ...}. So that is a little hack now. For underlying problem for cunstom types now and my thoughts about common database types, you can see https://github.com/golang/go/issues/12383#issuecomment-246662927.

@noblehng I'm not understanding what you are saying then. You are not suggesting modifying the SQL string sent to the server that is provided by the user.
How would you bind the following parameters by index?
PARAMS:
    IN bigint :ID = 3;
    IN decimal :Amount = 34.56;

SQL:
IF :ID is null begin
    insert into app.Invoice (Amount) values (:Amount);
    set :ID = LASTVAL();
end

update app.Invoice set
    Amount = :Amount,
    TimeUpdated = GETDATE()
where
    ID = :ID;

You just provide the string as is, and provide the args, because the args are indexed, so the driver can infer  its position then do a positional binding. No string substitution on the driver side, database server can handle it. You can see how go-oci8 do it.

@noblehng I don't understand what you are saying. Are you saying you would send :ID up three times to positionally bind it? I'm afraid we might be talking about different things. This issue is about being able to do:
db.Exec(`
IF :ID is null begin
    insert into app.Invoice (Amount) values (:Amount);
    set :ID = LASTVAL();
end

update app.Invoice set
    Amount = :Amount,
    TimeUpdated = GETDATE()
where
    ID = :ID;`, sql.Param(":ID", id), sql.Param(":Amount", amount))

Is that what you were addressing?

@kardianos ：ID will be sent only once as the first position, your database's sql syntax parser will understand :ID and :Amount are the only placeholders, and following :ID and :Amount are just reference with the same value.
Note that, '?',':name', ':number', '@name', $number are both just text input from a sql syntax parser's standpoint. The only different is what is allow for the first character of a placeholder to differ them with other identifiers in the same statement. While parsing placeholders, a parser will also indexing them, so it can easily map a number to a text fragment in the statement.
If your database doesn't support mapping index to name yet, you can still easily workaround it by using custom type (which not supported yet in the stdlib), and no need to add a special api in database/sql.
Your example will just be:
id, amount := 100, 100
db.Exec(`
IF :ID is null begin
    insert into app.Invoice (Amount) values (:Amount);
    set :ID = LASTVAL();
end

update app.Invoice set
    Amount = :Amount,
    TimeUpdated = GETDATE()
where
    ID = :ID;`, id, amount)

and database driver will bind the value of id to position 1 and the value of amount to position 2.

This issue is about mapping an explicit Name to Value in the parameter list.
So when you have 50 parameters (not an exaggeration), they stay sane. Thus key is the sql.Param(name, value) construct (or similar pairing) is key.

I don't see my example is harder to parse for human eyes though. Variable id and amount maps to :ID and :Amount, and database server will use :ID and :Amount for error messages.
And as I said, you can always use custom type for more syntax surgar if you want, which will not further improve error messages from database servers, maybe it could improve driver error messages if driver also does some sql parsing.

The driver should not do SQL parsing.
Yes, two parameters are easy. I hate counting indexes past 10, and I have to interact with some wide tables and procs with long input params. It gets hairy past 25 input parameters and unmanageable past 40.

You shold read my example above, you don't need to counting indexes this way. What needs to counting the index is the database driver, and that doesn't need to do sql parsing or string substitution. What really need to parse the sql is your database server, and it is nature for it to do the name<->index mapping.

@noblehng I don't understand what you are saying. I'm sorry. Your example doesn't have a Name to Value association like sql.Param("ID", 5), so it doesn't seem to relate to this issue.

@kardianos In my example, :ID<->var id<->100. It even surpport syntax highlighting well, and if under a IDE, hover over id should display its value as 100.
I just look at MSSQL's wire protocol, so now I understand why one whould want special support for that. For infomation I write it down here, note that I could be wrong.
In short, MSSQL's MS-TDS doesn't really support binded by position, actually it doesn't have a bind command. Parameters are just send alongside the statement text with a RPC call, its structure is something like:
type Param struct {
	Name         string
	StatusFlags  uint8
	TypeInfos    []TypeInfo
	ValueBytes   []byte
}

So it can't bind at database server that have all the infomation from parsing the statement, it must doing the binding from the client side. Even for positional binding, it will need to parse the statement text to get the placeholder and doing the binding in driver, by assign parsed results to Param.Name, under current stdlib interface. You can see that in a mssql driver for Go here.
In my opinion, this is a corner case or a quirk of MSSQL, and it could well be solved by driver custom types. I will stop here and welcome others' opinion.

@noblehng This bug is not about how the driver works, whether it uses bind or directly send the named params. It is about adding user facing API to the sql package.
var (
    PersonID int64 = 42
    AccountID int64 = 42
)
// Make query more complex, add about 10 to 20 additional params, many just bigints.
// First was:
db.ExecContext(ctx, 'select Person  = :Person, Account = :Account;`, PersonID, AccountID)
// Then changed to:
db.ExecContext(ctx, 'select Account  = :Account, Person = :Person;`, PersonID, AccountID)

// But would still work if:
db.ExecContext(ctx,
    `select Account  = :Account, Person = :Person;`,
    sql.Param("Person", PersonID),
    sql.Param("Account", AccountID)
)

I don't care how the driver works, if it uses something similar to TDS wire proto or something like postgresql that uses bind. The TDS wire protocol will use index of the param if the name is omitted.

@kardianos Thanks, now I can see your reason is to want to just change the query string without changing the the parameter order. Because from your other examples, I didn't notice this before.


wsl: 检测到 localhost 代理配置，但未镜像到 WSL。NAT 模式下的 WSL 不支持 localhost 代理。

Windows Version
OS 名称:          Microsoft Windows 11 专业版 OS 版本:          10.0.22631 暂缺 Build 22631
WSL Version
<IP_ADDRESS>
Are you using WSL 1 or WSL 2?

[X] WSL 2
[ ] WSL 1

Kernel Version
<IP_ADDRESS>-2
Distro Version
Ubuntu-22.04
Other Software
No response
Repro Steps
set the windows internet proxy localhost:port. then u will get this problem.
what important most is I want wsl use my windows http proxy.
Expected Behavior
wsl use my windows http proxy.
Actual Behavior
when I open wsl, it will prompt this below.
wsl: 检测到 localhost 代理配置，但未镜像到 WSL。NAT 模式下的 WSL 不支持 localhost 代理。
Diagnostic Logs
No response

Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.
If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here
Once completed please upload the output files to this Github issue.
Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to<EMAIL_ADDRESS>with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
View similar issues
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!
Open similar issues:

windows11 wsl2，The WSL_PAC_URL configuration does not take effect (#11998),  similarity score: 0.72

Closed similar issues:

autoProxy=true doesn't works well on WSL2 preview <IP_ADDRESS> (#10583),  similarity score: 0.73
config networkingMode=mirrored doesn't apply to wsl2 (#11228),  similarity score: 0.72
WSL2 cannot connect to localhost when the service is running on Windows (#5211),  similarity score: 0.72
WSL cannot use proxy with networkingMode=mirrored (#10794),  similarity score: 0.71

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

/question


[Vue] Does not provide an export named 'FloatingFocusManager

The Vue package does not provide an export named 'FloatingFocusManager'.
Steps to reproduce the behavior:

Create a vue project and attempt to import the 'FloatingFocusManager'

import {
  useFloating,
  autoUpdate,
  flip,
  offset,
  shift,
  useRole,
  useDismiss,
  useInteractions,
  useListNavigation,
  useTypeahead,
  FloatingPortal,
  FloatingFocusManager,
  FloatingOverlay,
} from "@floating-ui/vue";

Those modules listed/collapsed under React in the navbar are exclusive to React. There is no Vue equivalent currently, which only provides positioning features (equivalent to @floating-ui/react-dom).


Make fp8 scaling factors scalar

The original design of Fp8 scaling factors is of shape (1,) which could result in a fusion pattern of convert->bitcast->convert if bf16 is used as wider type. The fused kernel is run on GPU with block and grid of size <<<1,1,1,>>> which is inefficient. Since cublasLt Fp8 gemm only takes Fp32 typed scales, this change could avoid the above issue with the help of SimplifyFPConversions pass.   @levskaya @kaixih

Hey @wenscarl, sorry it took so long.
I approved it but you have some errors.


Questionnaire/Survey Delete - Server Error 500 - Master branch

Bug description
When trying to delete an existing survey/questionnaire getting Server Error 500.
My existing questionnaire has a Text box, a question on radio button, and a question with multiple choices.
Steps to reproduce
Steps to reproduce the behavior:

Go to 'Questionnaire / Survey, create new if required'
Click on 'Select the questionnaire and select the delete questionnaire'
See error 'Server Error 500'

Expected behavior
The questionnaire should get deleted.
Deployment method (select with an X)

[ ] Kubernetes
[ ] Docker
[x] setup.bash / legacy-setup.bash

Environment information

Operating System: [Ubuntu 18.04]
DefectDojo Commit Message: Master Branch

Screenshots (optional)

Console logs (optional)
Popen(['git', 'cat-file', '--batch-check'], cwd=/opt/dojo/django-DefectDojo, universal_newlines=False, shell=None, istream=)
[pid: 13401|app: 0|req: 16/92] <IP_ADDRESS> () {54 vars in 1069 bytes} [Fri May 29 22:42:27 2020] GET /survey/10/edit => generated 25343 bytes in 32 msecs (HTTP/1.1 200) 8 headers in 514 bytes (1 switches on core 0)
Internal Server Error: /survey/10/delete
Traceback (most recent call last):
File "/opt/dojo/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/opt/dojo/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/opt/dojo/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/dojo/lib/python3.6/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/opt/dojo/lib/python3.6/site-packages/defectDojo_engagement_survey/views.py", line 289, in delete_survey
collector.collect([survey])
File "/opt/dojo/lib/python3.6/site-packages/django/contrib/admin/utils.py", line 181, in collect
return super().collect(objs, source_attr=source_attr, **kwargs)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/deletion.py", line 224, in collect
field.remote_field.on_delete(self, field, sub_objs, self.using)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/deletion.py", line 16, in CASCADE
source_attr=field.name, nullable=field.null)
File "/opt/dojo/lib/python3.6/site-packages/django/contrib/admin/utils.py", line 181, in collect
return super().collect(objs, source_attr=source_attr, **kwargs)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/deletion.py", line 224, in collect
field.remote_field.on_delete(self, field, sub_objs, self.using)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/deletion.py", line 16, in CASCADE
source_attr=field.name, nullable=field.null)
File "/opt/dojo/lib/python3.6/site-packages/django/contrib/admin/utils.py", line 181, in collect
return super().collect(objs, source_attr=source_attr, **kwargs)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/deletion.py", line 220, in collect
sub_objs = self.related_objects(related, batch)
File "/opt/dojo/lib/python3.6/site-packages/django/contrib/admin/utils.py", line 186, in related_objects
qs = super().related_objects(related, objs)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/deletion.py", line 236, in related_objects
**{"%s__in" % related.field.name: objs}
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/query.py", line 892, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/query.py", line 910, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1290, in add_q
clause, _ = self._add_q(q_object, self.used_aliases)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1318, in _add_q
split_subq=split_subq, simple_col=simple_col,
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1224, in build_filter
self.check_related_objects(join_info.final_field, value, join_info.opts)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1087, in check_related_objects
self.check_query_object_type(v, opts, field)
File "/opt/dojo/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1067, in check_query_object_type
(value, opts.object_name))
ValueError: Cannot query "TextAnswer object (5)": Must be "ChoiceAnswer" instance.
[pid: 13409|app: 0|req: 9/93] <IP_ADDRESS> () {54 vars in 1081 bytes} [Fri May 29 22:42:29 2020] GET /survey/10/delete => generated 27 bytes in 98 msecs (HTTP/1.1 500) 6 headers in 192 bytes (1 switches on core 0)
Popen(['git', 'cat-file', '--batch-check'], cwd=/opt/dojo/django-DefectDojo, universal_newlines=False, shell=None, istream=)

I wen to admin dashboard and have deleted all the questions, choices, answers, and engagements from there. I have to delete each question at a time to resolve this issue.

Fixed in later versions.


bytesize nf-core modules patch

I would like an ok from @ewels, also so I know he agrees to give the talk 😉


[WIP] cleanup of linear/svc

Codecov Report

Merging #140 into master will decrease coverage by 0.09%.
The diff coverage is 88.52%.

@@            Coverage Diff             @@
##           master     #140      +/-   ##
==========================================
- Coverage   93.26%   93.16%   -0.10%
==========================================
  Files          16       17       +1
  Lines        1040     1098      +58
  Branches      174      188      +14
==========================================
+ Hits          970     1023      +53
- Misses         42       45       +3
- Partials       28       30       +2

Flag
Coverage Δ

#unittests
93.16% <88.52%> (-0.10%)
:arrow_down:

Impacted Files
Coverage Δ

...ngbird/ml/operator_converters/linear_classifier.py
87.71% <87.71%> (ø)

hummingbird/ml/operator_converters/__init__.py
100.00% <100.00%> (ø)

hummingbird/ml/supported.py
89.47% <100.00%> (+0.58%)
:arrow_up:

...rd/ml/operator_converters/_tree_implementations.py
98.09% <0.00%> (-0.02%)
:arrow_down:

hummingbird/ml/_container.py
74.41% <0.00%> (+4.65%)
:arrow_up:

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 6d9bca6...ce2a544. Read the comment docs.

I think it's ready, PTAL @interesaaat
(to be merged  after #145 )


broker crashed with exception "java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code"

BUG REPORT

Please describe the issue you observed:
broker crashed with exception "java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code"

Please tell us about your environment:
jdk 1.8
rocketmq-4.5.2

Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):

hs_err_pid15797.zip

hs_err_pid15797.log

@leonirvanel you can try to solve this problem by executing the os.sh script below the bin dir  and try to get the coredump file by executing ‘ulimit -c unlimited’ as prompted above.


How to subtract music available in Pulseaudio stream!

Playing music is probably a normal operation. I can't see any way to subtract the music playing from the mic stream.
It is available in as Snapcastclient playback.stream. So with some level and latency settings it should be possible to subtract the music playing from the recorded mic stream!?
I am a retired radiation engineer, but not so skilled and focused anymore, any tips?

I'm using https://github.com/dr-ni/aec_cmdline. Also tried https://github.com/voice-engine/ec but with aec_cmdline I've better results.

@danielk117 would you mind sharing how you achieved this? Thank you very much!

I hope this helps you.
script/run --name $HOSTNAME --uri 'tcp://<IP_ADDRESS>:10700' --mic-command '/path/to/script' --snd-command 'aplay -D notify -r 22050 -c 1 -f S16_LE -t raw'

My mic-command script:
#!/bin/sh

arecord -D mic_downmix -f S16_LE -c 2 -r 16000 -t raw | aec_cmdline

My mic_downmix device is based on https://github.com/SaneBow/alsa-aec. Channel 0 for the microphone and channel 1 with your playback (loopback). This is the complex part, as it depends on your hardware...

Thank you so much, @danielk117


[WIP]enable force cluster upgrade

Why are these changes needed?
This is a patch to bug #155. I added reconcile logic so that in case of following fields updated, we will rebuild the cluster.

head template container amount
head template container image
head template container resources
worker template container amount
worker template container image
worker template container resources

Related issue number
#155
Checks

[X] I've made sure the tests are passing.
Testing Strategy

[X] Unit tests
[X] Manual tests
[ ] This PR is not tested :(

@Jeffwan you can take a look at this and I believe we still need to use filter functions in the near future. I am thinking comparing different revisions on RayParams is the best solution since we are parsing and giving them as arguments to pods which needs a lot of efforts to compare if we want to do it in the reconcile logic.

BTW, What does the container amounts mean?

BTW, What does the container amount mean? you mean the total number of the containers in one pod template?

yes

Overall looks good to me. Since this is not tricky pattern, let's wait for more feedbacks.

I've been meaning to take a look at this PR but haven't gotten the chance yet.
I think enabling in-place updates (and documenting what is and isn't possible to update) is very important.
@wilsonwang371 @Jeffwan how's this PR going? Can we merge an initial version across the finish line?

Thanks @wilsonwang371 !!

It's safe to merge especially protected by the feature flag. Let's merge it and give it a try.


test-branch/execute-job/wrong-commit-sha-on-pr/3aae294b-91d1-4ddc-9886-0f8199e5ba06

PR for testing 00503148bff5dc28085c133b675fa4f45c7501af

/canonical/self-hosted-runners/run-workflows 931ad21dd9ace68aaa0a7d341e94de96ad93fa6b


FirebaseUI not compatible with "Theme.MaterialComponents.*" styling

Welcome to FirebaseUI and thanks for submitting an issue!
Please take a look at open issues, as well as resolved issues, to see if your issue is either already being addressed, or has been solved by someone else.
If not, please feel free to fill in the following info so we can help faster!
Step 1: Are you in the right place?

For issues or feature requests related to the code in this repository file a GitHub issue.
For general technical questions, post a question on StackOverflow tagged appropriately.
For general Firebase discussion, use the firebase-talk google group
For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel

Step 2: Describe your environment

Android device: Pixel 3 AVD
Android OS version: 10.0 (API29)
Google Play Services version: 4.3.4
Firebase/Play Services SDK version: 26.1.0
FirebaseUI version: 7.0.0

Step 3: Describe the problem:
when changing the application theme's parent to "Theme.MaterialComponents.*", All buttons in FirebaseUI change style to default, primary colored, no icon buttons.

Go to styles.xml locate that style and set parent="Theme.MaterialComponents.NoActionBar" for it.
Start FirebaseUI sign-in screen.

Observed Results:

Provider's buttons are now primary colored, no icon, simple buttons. see image in:
https://stackoverflow.com/questions/65745954/theme-materialcomponents-style-ruins-firebase-authui-layout

Expected Results:

Provider's buttons customized for each provider like shown in FirebaseUI docs:
https://firebase.google.com/docs/auth/android/firebaseui

Relevant Code:
  <style name="AppTheme" parent="Theme.MaterialComponents.NoActionBar">
      ...
  </style>

startActivityForResult(
  AuthUI.getInstance().createSignInIntentBuilder()
      .setAvailableProviders(providers)
      .build(),
  RC_SIGN_IN
)

@OmerLevy1248 thanks for reporting! This is a pretty complex issue, I am not sure if it's possible for us to make your theme work without breaking existing themes. I'll have to investigate.

@OmerLevy1248 thanks for reporting! This is a pretty complex issue, I am not sure if it's possible for us to make your theme work without breaking existing themes. I'll have to investigate.

Hi @samtstern! I am a newbie to android, so maybe this is not good practice, but:
As I understand it from material.io (and tried in my own code), changing all Button tags to the literal androidx.appcompat.widget.AppCompatButton tag (instead of leaving it up to the auto-inflation), should solve it to everyone using MaterialComponents based themes. If this is the expected element in all cases, I don't see a reason it should break other themes. Again, maybe I don't see the hole picture here, so maybe it's not that simple. Anyway, thanks for the very quick response!

Hi @samtstern! I am a newbie to android, so maybe this is not good practice, but:
As I understand it from material.io (and tried in my own code), changing all Button tags to the literal androidx.appcompat.widget.AppCompatButton tag (instead of leaving it up to the auto-inflation), should solve it to everyone using MaterialComponents based themes. If this is the expected element in all cases, I don't see a reason it should break other themes. Again, maybe I don't see the hole picture here, so maybe it's not that simple. Anyway, thanks for the very quick response!

@OmerLevy1248 I spoke with the material team about this and I'm now looking into a Material Components version of FirebaseUI as v8.0.0.  However after speaking with them it's clear this has to be a breaking change.  Right now we assume Theme.AppCompat.* and after that we will need to take Theme.MaterialComponents.*.  These two themes are somewhat compatible but not completely.
So in the short term there's nothing we can do but we now have a plan to fix this in the medium to long term.  Here's a great guide discussing the migration:
https://medium.com/androiddevelopers/migrating-to-material-components-for-android-ec6757795351

@OmerLevy1248 I spoke with the material team about this and I'm now looking into a Material Components version of FirebaseUI as v8.0.0.  However after speaking with them it's clear this has to be a breaking change.  Right now we assume Theme.AppCompat.* and after that we will need to take Theme.MaterialComponents.*.  These two themes are somewhat compatible but not completely.
So in the short term there's nothing we can do but we now have a plan to fix this in the medium to long term.  Here's a great guide discussing the migration:
https://medium.com/androiddevelopers/migrating-to-material-components-for-android-ec6757795351

I see. Thanks a lot! I'll be waiting:)

I see. Thanks a lot! I'll be waiting:)

This has been implemented and released in version 8.0.0

Amazing, thank you very much!


D3D12 Bindless Compute PSO replay crash

Description
Since yesterday, I've been getting a crash when I click on a ComputePSO Dispatch in D3D12. The shader uses ResourceDescriptorHeap[] to access resources. If I don't access resources through ResourceDescriptorHeap[], no crash occurs.

I happen to have an old capture (captured prior to when the error occurred), and tried to view the same Dispatch pass, but the crash also occurred there. It seems that the crash isn't dependent on the RenderDoc version or capture.
On my secondary machine everything works fine with the latest stable RenderDoc builds (v1.26 & v1.27)
I dipped my toe into RenderDoc's source to hopefully identify the issue(all code references are from the latest v1.x branch):

IDxcValidator outputs validation warnings and errors in ~ProgramEditor() (dxil_bytecode_editor.cpp, line 103)

dxil_bytecode_editor.cpp( 188) - Warning - DXIL validation failed: error: Validator version in metadata (1.7) is not supported; maximum: (1.6).
dxil_bytecode_editor.cpp( 188) - Warning - error: Named metadata '<null>' is unknown.
dxil_bytecode_editor.cpp( 188) - Warning - Function: dx.op.binary.i32: error: External function 'dx.op.binary.i32' is unused.
dxil_bytecode_editor.cpp( 188) - Warning - Validation failed.

The "error: Named metadata '<null>' is unknown" caught my attention. When looking into which functions add entries to m_NamedMeta, there is a helper function (ProgramEditor::CreateNamedMetadata()) that adds entries without setting the name
Setting the name resolved the issue for me locally, and the validation error is also gone:

(dxil_bytecode_editor.cpp, line 352)
NamedMetadata *ProgramEditor::CreateNamedMetadata(const rdcstr &name)
{
  for(NamedMetadata *m : m_NamedMeta)
    if(m->name == name)
      return m;

  m_NamedMeta.push_back(new(alloc) NamedMetadata);

  // <edit
  m_NamedMeta.back()->name = name;
  // edit>
  return m_NamedMeta.back();
}

I'm unsure if this is a proper fix, or just luck. The opcode injection is pretty involved.
Steps to reproduce

Create a bindless Compute PSO with a shader that accesses resources through ResourceDescriptorHeap[]
Take a capture and replay
Click on the Compute PSO Dispatch

I can provide a capture if necessary
Environment

RenderDoc version: v1.24, v1.26, v1.27 and local build
Operating System: Windows 11 (Nvidia driver version: 536.40, latest as of writing)
Graphics API: D3D12 (with DX12 Agility (tried with 600 & 610), Nvidia RTX 3070 and AMD RX 580)

I do have a test that accesses resources through ResourceDescriptorHeap[] which doesn't hit this issue, but looking at it I suspect that's because there are some normal cbuffers used so the dx.resources metadata exists already.
Your investigation looks bang on to me and the fix is easily correct, the bug definitely present before. Since this works for you I'm happy to commit it without a direct repro. In future I might need to expand the test cases to include a "pure" direct heap access shader with no normal resources at all to stress this path.


adapt API usage for latest google speech library

This works for google @google-cloud/speech version 2.0.0

Thanks for the contribution! Does v2 not allow you to use a keyfile?

No, unfortunately that doesn't work anymore.
see https://cloud.google.com/speech-to-text/docs/reference/libraries#setting_up_authentication

Oh, yes, that's true. I will try the next days.


(WIP)optimize: upgrade the Druid version

Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews

Codecov Report

Merging #3780 (dcdfb64) into develop (17d298c) will decrease coverage by 0.28%.
The diff coverage is 21.05%.

@@              Coverage Diff              @@
##             develop    #3780      +/-   ##
=============================================
- Coverage      40.84%   40.55%   -0.29%
- Complexity      2945     2953       +8
=============================================
  Files            663      665       +2
  Lines          22260    22363     +103
  Branches        2755     2729      -26
=============================================
- Hits            9091     9069      -22
- Misses         12326    12430     +104
- Partials         843      864      +21

Impacted Files
Coverage Δ

.../src/main/java/io/seata/core/constants/DBType.java
0.00% <0.00%> (ø)

...a/sqlparser/druid/mysql/MySQLInsertRecognizer.java
57.14% <0.00%> (-4.77%)
:arrow_down:

...a/sqlparser/druid/mysql/MySQLUpdateRecognizer.java
76.00% <0.00%> (-8.00%)
:arrow_down:

...sqlparser/druid/oracle/OracleInsertRecognizer.java
0.00% <0.00%> (ø)

...sqlparser/druid/oracle/OracleUpdateRecognizer.java
0.00% <0.00%> (ø)

...r/druid/postgresql/PostgresqlInsertRecognizer.java
0.00% <0.00%> (ø)

...r/druid/postgresql/PostgresqlUpdateRecognizer.java
0.00% <0.00%> (ø)

...main/java/io/seata/rm/datasource/util/XAUtils.java
20.00% <100.00%> (ø)

.../java/io/seata/sqlparser/druid/BaseRecognizer.java
89.47% <100.00%> (+1.97%)
:arrow_up:

...obuf/convertor/BranchRegisterRequestConvertor.java
90.47% <0.00%> (-9.53%)
:arrow_down:

... and 27 more


Abnormal behaviour when username and password are empty

Please take a look at login methods.
No exceptions while trying to login with empty credentials.

I can reproduce the problem.  I am working on a solution, and will update the issue.

I've fixed it, and the API will now throw an exception if the user tries to log in with a empty (0 length or string full of spaces) username. Empty passwords are valid and are still allowed.
The fix is in the master branch, and I will release v2.0.3 for this bug shortly.
More detail, if you're interested:
The way the Mikrotik API works internally caused this problem. The user side sends a "/login" command, receives a hash, and then sends a second "/login" command using this hash and the username. This overloading of "/login" would have been fine if the Mikrotik side was prepared to handle the situation where a empty username with a valid hash is received. By handle I don't mean accept a blank username, simply return an error. But what they do if the username is empty, is to just return another hash.
So the fix was quite simple:
        if (username.trim().isEmpty()) {
            throw new ApiConnectionException("API username cannot be empty");
        }

Thank you for reporting this. I hope it resolves the issue for you.
Gideon

Yes, right, thanks!


add PR template to repo

Details:  https://github.com/blog/2111-issue-and-pull-request-templates
Some examples:

https://www.talater.com/open-source-templates/#/

https://gist.github.com/Lordnibbler/11002759

In process...
Just a note that this will be a pull request against master, as that is what will trigger the feature.


How can I use this library without installing through cocoapods

I want to use SwiftValidator without installing using cocoapods. How to do that?

You can clone the repo and use the code just like regular swift files. The core should be easy to reuse for whatever your use case is. The test demonstrate how to call the validations from code without using the validator.
https://github.com/jpotts18/SwiftValidator/blob/master/ValidatorTests/ValidatorTests.swift#L63


[BUG] No metrics data found for AuroraReplicaLag metric

Is there an existing issue for this?

[X] I have searched the existing issues

YACE version
v0.55.0
Config file
apiVersion: v1alpha1
sts-region: eu-central-1
discovery:
  jobs:

   [...]

    # RDS
    - type: AWS/RDS
      regions:
        - eu-central-1
      searchTags:
        - key: environment
          value: <regex>
      dimensionNameRequirements:
        - DBInstanceIdentifier
      metrics:
        - name: CPUUtilization
          statistics:
          - Maximum
        - name: SwapUsage
          statistics:
          - Maximum
        - name: DiskQueueDepth
          statistics:
          - Maximum
        - name: TransactionLogsDiskUsage
          statistics:
          - Maximum
        - name: EBSByteBalance%
          statistics:
          - Maximum
        - name: EBSIOBalance%
          statistics:
          - Maximum
        - name: AuroraReplicaLagMaximum
          statistics:
          - Minimum
        - name: StorageNetworkReceiveThroughput
          statistics:
          - Minimum
        - name: StorageNetworkTransmitThroughput
          statistics:
          - Minimum
        - name: FreeLocalStorage
          statistics:
          - Minimum
        - name: BufferCacheHitRatio
          statistics:
          - Minimum
        - name: CommitLatency
          statistics:
          - Minimum
        - name: CommitThroughput
          statistics:
          - Minimum
        - name: NetworkReceiveThroughput
          statistics:
          - Minimum
        - name: NetworkTransmitThroughput
          statistics:
          - Minimum
        - name: ReadIOPS
          statistics:
          - Minimum
        - name: WriteIOPS
          statistics:
          - Minimum
        - name: ReadLatency
          statistics:
          - Minimum
        - name: WriteLatency
          statistics:
          - Minimum
        - name: ReadThroughput
          statistics:
          - Minimum
        - name: WriteThroughput
          statistics:
          - Minimum
    - type: AWS/RDS
      regions:
        - eu-central-1
      searchTags:
        - key: environment
          value: <regex>
      dimensionNameRequirements:
        - DBClusterIdentifier
        - EngineName
      metrics:
        - name: VolumeBytesUsed
          statistics:
          - Maximum
        - name: VolumeReadIOPs
          statistics:
          - Maximum
        - name: VolumeWriteIOPs
          statistics:
          - Maximum
    - type: AWS/RDS
      regions:
        - eu-central-1
      searchTags:
        - key: environment
          value: <regex>
      dimensionNameRequirements:
        - DBClusterIdentifier
        - Role
      metrics:
        - name: AuroraReplicaLag
          statistics:
          - Average

     [...]

Current Behavior
All my metrics are working except AuroraReplicaLag, with the dimensions DBClusterIdentifier and Role, which throw No metrics data found error. (I tested without tag filter too)
Expected Behavior
I have  AuroraReplicaLag metric with the dimensions DBClusterIdentifier and Role in the AWS Cloudwatch explorer so I expect YACE can find them and export them.
Steps To Reproduce
No response
Anything else?
Maybe I misconfigured something but since my config work for every others metrics I don't think so

So finally my issue was related to this job:
- type: AWS/RDS
      regions:
        - eu-central-1
      searchTags:
        - key: environment
          value: <regex>
      dimensionNameRequirements:
        - DBClusterIdentifier
        - EngineName
      metrics:
        - name: VolumeBytesUsed
          statistics:
          - Maximum
        - name: VolumeReadIOPs
          statistics:
          - Maximum
        - name: VolumeWriteIOPs
          statistics:
          - Maximum

And it was due to an inconsistency in the AWS dimensions naming convention. Indeed, for these metrics, it's DbClusterIdentifier and not DBClusterIdentifier when used in combinaison with EngineName... :roll_eyes:


#no_copy Automatically Removed from Struct On Save

package main

A :: struct #no_copy {}

Save, and #no_copy will be removed.

Fixed.


Consistent scoring rules

We need to port consistent scoring rules for expectiles, quantiles, and huber functionals across. This will be able to be used by threshold weighted scores in the future.

@nicholasloveday can you please give this an appropriate milestone?

Done - I'm hoping to put the pull request up in the next week. Code and tests are complete. I just need to finish off the tutorial.

Okay, thanks. It would be great to get the things tagged for milestone 0.9 ticked off, but the new functionality will be greatly appreciated in due course.