feat(NumberTheory/EulerProduct/ExpLog): new file

This is the first PR in a series that will add proofs of the relevant properties of certain functions that are important for the proof of a density version of Dirichlet's Theorem on primes in AP (and, as a corollary, the Prime Number Theorem).
Here we add a short new file with "logarithmic" versions of the Euler product of a completely multiplicative function.
From EulerProducts.

@Ruben-VandeVelde As this PR is blocking the next ones, I'd like to get it merged soon. Maybe we can separate the discussion on the fun_prop attribute and deal with it in a potential new PR? I think otherwise, it should be fine.

Made a Zulip thread for the fun_prop question.

bors r+


Set the termguicolors option

There is still a rather strange set of affected options,
but i think its good to set termguicolors option to true, don't we?

termguicolors is set by (almost) all major themes. We don't need to set it ourselves.

termguicolors is set by (almost) all major themes. We don't need to set it ourselves.

haha, yeah i'm sure, but not in every,
but its not worth adding here tho,
leave it as it is - good


fix mapping values error

change colon to dash

This is not merging cleanly. Probably because of the renames, primarily. Might be cleanest to just make the change again, hopefully you didn't change 747 lines manually. :)

I used a perl command, no worries. I'll resubmit shortly.
On Tuesday, August 30, 2016, Colton Myers<EMAIL_ADDRESS>wrote:

This is not merging cleanly. Probably because of the renames, primarily.
Might be cleanest to just make the change again, hopefully you didn't
change 747 lines manually. :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/HubbleStack/Nova/pull/232#issuecomment-243553932, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AK6sIF6g5GJV-022MxRqoFdigbDzSixiks5qlIYpgaJpZM4JnwLA
.

--
Thanks,
Charles C. Ruffino | SaltStack, Inc
Sales Engineer
+1-714-712-0702 (mobile)
<EMAIL_ADDRESS>Twitter: @CharlesCRuffino
Github: @SaltyCharles
SaltStack, Inc.
3400 North Ashton Blvd., Suite 110 | Lehi, UT 84043
Join us in our growing community - www.saltstack.com/community
http://www.saltstack.com/community
SaltConf16 - i**s over, did you miss it?

*www.saltconf.com


Changed to search_input

Changed text_input to search_input

Closes #182. I've updated the demo project https://github.com/BrooklinJazz/book_search to match this change.

Great work @crismxiex!


Adding pancake sort (CPP)

Hi Dear @yodifm
Great code
Thanks for your contribution......
Show your support on my youtube channel web Pixar(The institute of coding)
like , share , subscribe
youtube - https://youtu.be/5qnQjgdpFPg
telegram-channel - https://t.me/WebPixar
Join our telegram channel for more goodies , swag packs.
And also join a Hackathon - https://devfolio.co/signup?ref=33d4a02bef


Dev 3.1.0 haas

Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Additional context

 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.hongye.jhy seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.

 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.hongye.jhy seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


With file

In the spirit of with_iter and side_effect, I have implemented with_file to handle context management of output files.
For example, you can wrap a file handler in an iterator to log output to a file.
 from more_itertools import consume, with_file
 consume(print(x, file=output) for output in with_file(open("temp.tmp","w")) for x in range(3))

The pull request includes a nose test that passes under versions 2.7.12, 3.2.6, 3.3.6, 3.4.5, 3.5.2.

Thanks for the PR. I'm a little puzzled, because I don't think I understand the use case - could you help me?
From the examples it seems like this aides in doing I/O operations in a comprehension or in an iterable-consuming expression. Is that the goal? Isn't this clearer?
with open('temp.tmp', 'w') as output:
    [print(x, file=output) for x in range(3)]

It seems odd to save a line (not really, with the import) and introduce a strange "iterate over the file handle" concept.
Also, in the test, isn't closing doing the work here?

I like the option of composing lazy expressions.  I really favor with_iter for this reason, as I can assure context management with an expression.  You are probably right about the unorthodox method of resolving the context management.
I came up with this generator while trying to use side_effect to log to a file.  This function isn't as much about saving a line as removing the need to use the with statement, which is more difficult to compose with other expressions.  I couldn't think of a way to properly handle the context management without writing another generator, like
def with_log(handle, seq):
    with handle as log:
        print_log = lambda x: print(x, file=log)
        yield from side_effect(print_log, seq)

which, in this case, defeats the purpose of the side_effect abstraction as I have mostly rewritten the logic.  Maybe I am missing something, is there a way to use side_effect to write to a log file without having to write another generator?
Would adding with_log be a more welcome addition?
As for the test, I somewhat blindly modeled that test after test_with_iter, which also comes with closing.  I can rework the test if needed.

Another solution might be to add an optional parameters file=None to side_effect to allow context management there.  I am imagining using func = partial(func, **{'file':file}) inside a with statement if file is not None.  This way the user could design logging function that, for example, interact with the chunk size and writes to a file.
I will make a couple more pull requests based on these ideas, and you can decide if any of them seem suitable for more_itertools
Regardless, thanks for managing this module, I really appreciate having easy access to tools for explicit side-effects like side_effect and consume.

Thanks for the note. Would this accomplish what you want? Your idea about side_effect inspired this; it seems like a sensible generalization:
def side_effect(
    func,
    iterable,
    chunk_size=None,
    func_args=None,
    func_kwargs=None,
    file_obj=None,
):
    """Invoke *func* on each item in *iterable* (or on each *chunk_size* group
    of items) before yielding the item.

    `func` must be a function that takes an item from the iterable as its first
    argument. Specify subsequent arguments by passing an
    *func_args* (an iterable) and *func_kwargs* (a mapping).
    Any returned values are discarded.

    If *file_obj* is given, it will be closed after iterating. This can be
    useful if the side effect is operating on

    `side_effect` can be used for logging, updating progress bars, or anything
    that is not functionally "pure."

    Emitting a status message:

        >>> from more_itertools import consume
        >>> func = lambda item: print('Received {}'.format(item))
        >>> consume(side_effect(func, range(2)))
        Received 0
        Received 1

    Operating on chunks of items:

        >>> pair_sums = []
        >>> func = lambda chunk: pair_sums.append(sum(chunk))
        >>> list(side_effect(func, [0, 1, 2, 3, 4, 5], 2))
        [0, 1, 2, 3, 4, 5]
        >>> list(pair_sums)
        [1, 5, 9]

    Writing to a file-like object:

        >>> from io import StringIO
        >>> from more_itertools import consume
        >>> f = StringIO()
        >>> consume(
        ...     side_effect(print, [1, 2], func_kwargs={'file': f}, file_obj=f)
        ... )
        >>> f.closed
        True

    """
    func_args = [] if func_args is None else func_args
    func_kwargs = {} if func_kwargs is None else func_kwargs
    try:
        if chunk_size is None:
            for item in iterable:
                func(item, *func_args, **func_kwargs)
                yield item
        else:
            for chunk in chunked(iterable, chunk_size):
                func(chunk, *func_args, **func_kwargs)
                for item in chunk:
                    yield item
    finally:
        if file_obj is not None:
            file_obj.close()

If that works, I'll make a PR for that and we can close this?
Your comment about the tests for with_iter are correct; I think those need some improvement.

That is perfect, thanks.  Thanks for the quick solution and feel free to close this PR whenever.

BTW, the following re-factorization would eliminate the replicated loop.
seq = iterable if chunk_size is None else chunked(iterable, chunk_size)
for item in seq:
    func(item, *func_args, **func_kwargs)
    yield item

Thanks again for the quick turn around!


Small formatting changes

There were some inconsistencies in the documentation headings.
I also added navigation to the usage page because it was getting a bit unwieldy.
Preview here

@andrewpollock huh, you are right. Fixed. Thanks!

@andrewpollock huh, you are right. Fixed. Thanks!

I like being right 😁
But what was I right about?

@andrewpollock huh, you are right. Fixed. Thanks!

I like being right 😁 But what was I right about?

I thought I got all of the pages the first time!


feat: remove emergency_state_traj_{trans/rot}_dev from trajectory_follower

Description
launcher PR for https://github.com/autowarefoundation/autoware.universe/pull/9675
How was this PR tested?
See https://github.com/autowarefoundation/autoware.universe/pull/9675
Notes for reviewers
None.
Effects on system behavior
None.

@rej55 @satoshi-ota @shmpwk
Please approve the PR

@rej55 @satoshi-ota @shmpwk
Please approve the PR.


SASS not working correctly with new builder

Command
build
Is this a regression?

[X] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was
17.0.3
Description
This works in the same version 17.0.3 but with the previous builder. There are 2 main issues and happen with both "application" not the "browser-esbuild".

@use doesn't work with absolute path with neither  builder
With @use component budgets go out of control with several warning and errors.

Minimal Reproduction
-@use with absolute paths on SCSS files and inline
-@use in component styles
Exception or Error
No response
Your Environment
Angular CLI: 17.0.3
Node: 18.16.1
Package Manager: npm 9.5.1
OS: win32 x64

Angular: 17.0.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                              Version
--------------------------------------------------------------
@angular-devkit/architect            0.1700.3
@angular-devkit/build-angular        17.0.3
@angular-devkit/core                 17.0.3
@angular-devkit/schematics           17.0.3
@angular/cdk                         17.0.1
@angular/cli                         17.0.3
@angular/material                    17.0.1
@angular/material-date-fns-adapter   17.0.1
@schematics/angular                  17.0.3
rxjs                                 7.8.1
typescript                           5.2.2
zone.js                              0.14.2

Anything else relevant?
No response

Absolute imports are expected to fail as this used to work due to webpack specific behaviour. Please see: https://github.com/angular/angular-cli/issues/26375
For the component budgets issue, please provide a minimal repro please.
You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

Absolute imports are expected to fail as this used to work due to webpack specific behaviour. Please see: #26375
For the component budgets issue, please provide a minimal repro please.
You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

Thanks so much for the response. I will be doing that this week then. Good to know about absolute paths, that was actually easy to fix with some replace all in the project, my main issue is the budget one because it stops us from deploying. I will try to recreate it on a repo and push it to github. Thanks so much for the quick response, appreciate it!

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.
If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.

I was able to produce a reproduction repo for this budget issue, and it would seem the difference is the setting of "sourceMap": true in the build configuration. In branch esbuild, the size of app.component.scss is listed as 22.77 kB; in the branch esbuild-with-sourcemap (which only has one line changed, the enabling of source maps), the size of the same file is listed as 104.69 kB.
https://github.com/HiReception/angular-esbuild-bug-demo
Hopefully this can point to the root cause of the issue; I would prefer if we could continue to use source maps in production for other reasons, and it doesn't seem like this setting should have an impact on the budget assessment system.


Improve statement string builder

Currently statements are built by using a series of append operations on StringBuilder. This is not exactly ideal since it is very vulnerable to bugs and mistakes. Look into a better, safer method.

StringBuilder is not too bad, except it's not thread-safe. Do you have any idea in mind?

I've been spending some time thinking about this and i've come up with the following...
Instead of appending to a single centralized StringBuilder in the constructor, we store the needed arguments into local variables and then compose it together with a call to either toString or build.
Here's an example:
public class SelectBuilder implements SegmentBuilder {

  private final String[] fields;

  public SelectBuilder(String...fields) {
    this.fields = fields;
  }

  public SelectFromBuilder from(String table) {
    return new SelectFromBuilder(this, table);
  }

  @Override
  public String build() {
    return join(" ", "SELECT", join(",", fields));
  }
}

public class SelectFromBuilder implements SegmentBuilder {
  private SelectBuilder prefix;
  private String[] tables;

  public SelectFromBuilder(SelectBuilder prefix, String...tables) {
    this.prefix = prefix;
    this.tables = tables;
  }

  @Override
  public String build() {
    return join(" ", prefix.build(), "FROM", join(",", tables));
  }
}

I've been spending some time thinking about this and i've come up with the following...
Instead of appending to a single centralized StringBuilder in the constructor, we store the needed arguments into local variables and then compose it together with a call to either toString or build.
The below example features a SelectBuilder and a SelectFromBuilder. Both implement SegmentBuilder which is just an interface with a build method.
public class SelectBuilder implements SegmentBuilder {
  private final String[] fields;

  public SelectBuilder(String...fields) {
    this.fields = fields;
  }

  public SelectFromBuilder from(String table) {
    return new SelectFromBuilder(this, table);
  }

  @Override
  public String build() {
    return join(" ", "SELECT", join(",", fields));
  }
}

public class SelectFromBuilder implements SegmentBuilder {
  private SelectBuilder prefix;
  private String[] tables;

  public SelectFromBuilder(SelectBuilder prefix, String...tables) {
    this.prefix = prefix;
    this.tables = tables;
  }

  @Override
  public String build() {
    return join(" ", prefix.build(), "FROM", join(",", tables));
  }
}

The join method is simply a helper method to concatenate strings together on a delimiter. The order in which the statement is built will occur in reverse order. So instead of creating the statement starting from "SELECT", it will start at the end and should append it's parent (i.e. prefix) to itself as shown in the build function of SelectFromBuilder.
We would use the following like so...
public class SQLiteQueryBuilder {
  public static SelectBuilder select(String... fields) {
    return new SelectBuilder(fields);
  }
}

If you can't find any possible issues with this, I'll start working on it.

@alexfu, the new approach discards inheritance and uses composition instead, which is a better design. Apart from that, honestly I don't see much benefit from this. Please elaborate more if possible.
If you insist to go ahead, then I will wait for your commits as my code will depend on it.
Cheers, Steven


try to fix #106

I suppose we need to provide function to support approve sign for chaincode level and channel level.
this PR is just a draft as POC.

@bestbeforetoday , if there no further comments for this PR, I would like to merge it early next week.


In React pages, imported Markdown does not highlight code blocks

Have you read the Contributing Guidelines on issues?

[X] I have read the Contributing Guidelines on issues.

Prerequisites

[X] I'm using the latest version of Docusaurus.
[X] I have tried the npm run clear or yarn clear command.
[X] I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
[X] I have tried creating a repro with https://new.docusaurus.io.
[X] I have read the console error message carefully (if applicable).

Description
when write content in pages using feature Importing Markdown with tabs code inside, code is not right highlighted.
Reproducible demo
https://codesandbox.io/s/priceless-moon-5e2ptf?file=/src/pages/index.js
Steps to reproduce
import markdown mdx file with <Tabs>
Expected behavior
code blocks render colored rightly.
Actual behavior
code rendered all white/black without any highlights.
Your environment

Public source code:
Public site URL:
Docusaurus version used:
Environment name and version (e.g. Chrome 89, Node.js 16.4):
Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

[ ] I'd be willing to fix this bug myself.

I can reproduce and can confirm it's not a Prism config thing. The minimum repro is:
<!-- @site/src/components/_test.md -->

```yaml
apiVersion: operator.tigera.io/v1
kind: Installation
  # Configures Calico.
metadata:
  name: default
```

// src/pages/index.tsx
+ import Test from<EMAIL_ADDRESS>
  export default function Home(): JSX.Element {
    const {siteConfig} = useDocusaurusContext();
    return (
      <Layout
        title={`Hello from ${siteConfig.title}`}
        description="Description will go into a meta tag in <head />">
        <HomepageHeader />
        <main>
+         <Test />
          <HomepageFeatures />
        </main>
      </Layout>
    );
  }

This renders a plain text block. The exact same import works in a Markdown page.

Ah, this is because the triple-backtick-to-code-block conversion is done through an MDXProvider layer which is currently undocumented. You would need to add the wrapper around imported Markdown yourself.
+ import MDXContent from "@theme/MDXContent";
+ import Test from<EMAIL_ADDRESS>
  export default function Home(): JSX.Element {
    const {siteConfig} = useDocusaurusContext();
    return (
      <Layout
        title={`Hello from ${siteConfig.title}`}
        description="Description will go into a meta tag in <head />">
        <HomepageHeader />
        <main>
+         <MDXContent>
+           <Test />
+         </MDXContent>
          <HomepageFeatures />
        </main>
      </Layout>
    );
  }

@slorber Do you think we should do anything about this? It looks working as intended to me and just requires some documentation.

@slorber Do you think we should do anything about this? It looks working as intended to me and just requires some documentation.

Not sure what to do.
We could technically create a global MDX provider at the top of the tree.
At the same time, we probably want to keep and encourage usage of MDXContent as close as possible to the actual MDX content (as it was requested by someone in https://github.com/facebook/docusaurus/pull/6842 + https://github.com/facebook/docusaurus/discussions/5468#discussioncomment-1912419). Not having a default provider helped surface this issue instead of being fail-safe.
So I would probably just add some doc for this specific edge case

Same as what I thought. Would write some docs tonight.


Delete feature modal style is not updated

Context
When deleting a feature the confirmation modal window style still shows tiny texts.
Steps to Reproduce

Delete a feature

Current Result
Text is small
Expected result
Text should be bigger as decided las week
Browser and version
Chrome

fixed in 10124-geom-panel


Deprecate previous project

Update the previous sound-of-text repository to indicate that it is deprecated.
Also, copy all relevant issues into this repo.

Done.


Document a proper way to debug applications bundled by webpack

From @adamziel on November 19, 2015 12:12
As far as I understand, right now the recommended way to debug are source maps in this mode:
eval - Each module is executed with eval and
There are a number of problems with using source maps in development:

Only some stacktraces are mapped using a source maps. Other are looking like this: at eval (eval at <anonymous>  http://localhost:8082/js/app.js:2004:2), <anonymous>:43:67). Also, tracebacks produced by console.error, console.trace etc are not mapped - and this is a big deal if you happen to use library that does it, e.g. almost any Promise library.
It tends to be slow in big bundles

I am aware of sourcemapped-stacktrace - this is both slow, and error-prone.
One way of approaching it would be (optionally) eliminate source-maps from the process altogether and  add an option for webpack to behave similar to require.js: somehow tell it to split code at every single module.
Since there would be no more single giant source-mapped bundle, and the code would live in a module with name same as the source file, and with the same line structure (e.g. babel has a --retain-lines option), chrome would consistently construct actually useful tracebacks.
Honestly guys I hope I am just missing something and there is an actual solution that I just didn't find :-)
Copied from original issue: webpack/webpack#1646

From @adamziel on November 19, 2015 16:21
Similar issues:
https://github.com/webpack/webpack/issues/740
https://github.com/webpack/webpack/issues/1360
Related chrome issue:
https://code.google.com/p/chromium/issues/detail?id=376409

From @adamziel on November 19, 2015 16:33
Related firefox issue: https://bugzilla.mozilla.org/show_bug.cgi?id=583083

From @sokra on November 20, 2015 7:59
That's something browser vendors have to solve. SourceMaps are made for this.

Chrome guys pushed it to here and now you are trying to push it back?  Sigh.  What is a poor working dev to do to get beyond frustration over this?

@sjatkins Isn't this a correct place for a documentation task? Feel free to re-open as a bug at the main repo if you believe this is something to be fixed at webpack core.

What really is the issue here? If using eval as a devtool doesn't work for you, there are other options. Those are also documented.


Support (or suggested workaround) for syntactic macros (macropy/mcpy)

Syntactic macros implemented in macropy (or a simplified version mcpy) allows code transformations after parsing the code and before compiling it.
One of the transformations allows to process code inside a with block:
with MACRO_NAME:
    code to transform

When trying to meassure the coverage of such a code the first and last line are skipped (not always both, depends on the tool, macropy or mcpy, but always at least one).
One solution for this is to just exclude these lines from coverage. I can do it and is ok.
But I was wondering if there is a better solution.
Here is the simplest example I could find:
try_mymacros.py (the script you run)
import macropy.activate
import application

mymacros.py (an empty macro, it doesn't matter what the macro does)
from macropy.core.macros import Macros

macros = Macros()

@macros.block
def document(tree, **kw):
    return tree

application.py (the important code)
from mymacros import macros, document

with document:  # <--- Not covered?
    a = 1
    """ docu b """  # <--- Not covered?

print()

Note that removing the print() statement the docstring is reported as covered.
Also note that removing both the print() and a = 1 all the code is reported as covered.
I created two examples with makefiles and more information as testbed for this issue:

Example using macropy
Example using mcpy

I would like to see this, too. I'd like to use macros more in Python (only when actually appropriate!), but tooling support is needed.
Based on my work on unpythonic, my semi-educated guess about why this could happen is that in MacroPy, the macro expander compiles the with statement away. It depends on each individual macro whether the expanded code contains any AST nodes that contain the line number of that with statement.
The default approach, which works for many (but not all) macros, is to just not care about this in the macro implementation, and let MacroPy fix up (as a postprocessing step) the missing mandatory information, particularly the line number. It's pretty good at that, but sometimes it misses, and you end up with a compile error until you (the macro author) figure out where it's going wrong, and manually ast.copy_location some line number into the offending nodes.
I haven't tried mcpy, but as of 2020, to me it seems dead?
On a side note, there is no longer strictly a need to write a wrapper script separately for each macro-enabled Python program using MacroPy. There's a generic macropy3 bootstrapper in the separate add-on imacropy, which performs this role.
(Disclaimer: I'm the author of imacropy and unpythonic, so this is 50% a shameless plug and, on the imacropy part, hopefully 50% a genuinely helpful suggestion.)

The default approach, which works for many (but not all) macros, is to just not care about this in the macro implementation, and let MacroPy fix up (as a postprocessing step) the missing mandatory information, particularly the line number. It's pretty good at that, but sometimes it misses, and you end up with a compile error until you (the macro author) figure out where it's going wrong, and manually ast.copy_location some line number into the offending nodes.

I think the problem is more complex. The same macros show different coverage according to the Python version. I was using Python 3.7.3, when switched to 3.8.5 the decoration macros started to show the decorator as not covered. I was able to fix it by adding line information to the AST. But when I tried to do the same with the with macros I found things aren't that easy. I tried various things to report AST elements that covered the with, most failed. One bizarre way that worked was:

Adding the correct line number to all the AST elements in the body of the with and
Inserting a dummy Expr (a call to id()) at the second line of the with body with the line information of the original with sentence (with +  body) to this line. Note that mcpy does it for all the AST elements in the body, but this doesn't work, the with line is reported as covered, but not the last line of the body.

I also learned that the .coverage file generated using Python 3.7 + Coverage 4.5.2 can't be analyzed on a system using Python 3.8 + Coverage 4.5.2 (Debian stable vs Debian testing). You get some bizarre things, like decorator lines reported as uncovered.
I know nothing about Coverage internals, but the problems seems to be related to it.

I haven't tried mcpy, but as of 2020, to me it seems dead?

May be, but when I tried to migrate my two macros (yes, just 2) to MacroPy I found two problems:

The way that decorator macros works on classes is different, and IMHO less interesting. On MCPY you get the AST for the class (ClassDef) parsed, but not fully "analyzed" (fuzzy term, don't know what exactly is the difference). So I can add code to be executed before the class, in particular an import needed for the rest of the macro and that contains the class parent. Using MacroPy the class gets "analyzed" and I get an error about the unknown parent. Of course it can be solved, but then the macro is less effective, the user must manually add the import.
After adapting all I found that MacroPy made my script three times slower. The performace penalty is huge.  I was hopping it to be the other way round because with MCPY you must avoid getting CPython cache files for the files that uses macros, but MacroPy claims to support CPython.
MCPY is really small, in fact as small that I finally incorporated it to my project (so I can do the above mentioned trick to make Coverage report the real coverage)
MCPY is simpler. No need for wrapper script (thanks for the imacropy hint), you can enable and disable it any time you want and no need for "macro" in the file containing the macros.

The speed penalty made me abandon the idea of migrating to MacroPy. I prefer spending a little bit more time writing the macros.

That's interesting. Thanks for the additional details!

What I do know is that if you repurpose with blocks to let the user control the operation of your block macro (so that within the lexical extent of a use site of your block macro, with blocks matching some pattern are essentially commands for it) and compile those away, those lines won't get reported as covered. That's no major surprise, though. An example of this is the code splicer let_syntax (AST transformers, tests).
The only other coverage issue I've had specifically with block macros is the with line being reported as not covered, so our codebases may be doing something differently. OTOH, we also have different Python and Coverage versions - I'm running my coverage analyses on Python 3.6.9 with Coverage 5.2.1.
Another coverage oddity I've encountered, in code using MacroPy, is that the module docstring of a module that uses macros is reported as not covered. I think MacroPy might be doing something here, but I'd need to re-read the import handler in its source to be sure.
Regarding mcpy:

Sounds nice.

Hmm, interesting. I think about two years ago @azazel75 was planning something related to making MacroPy faster, but I don't know whether he found the time to do it, and if the experiment panned out or not.

Small and vendorable sounds nice. In that case its maintenance status doesn't really matter (in the local sense, that is; globally, the community would obviously benefit from centralized maintenance), as long as it's not too difficult to update yourself when something eventually breaks.

I think MacroPy's macro registry (@macros.expr et al.) is a feature. For example in unpythonic, quite a few macros come in both expr and block variants, so being able to give these the same name is very useful. This problem arises because Python makes a distinction between statements and expressions, and Python's expression sublanguage is missing some features the full language has, so at least if you're doing anything language-extension-ish, you'll often end up needing both variants.

Is there any material on mcpy, e.g. a user manual or similar? I have a ton of questions, but I don't want to derail the discussion here further. :)

Is there any material on mcpy, e.g. a user manual or similar? I have a ton of questions, but I don't want to derail the discussion here further. :)

None that I'm aware. But the code is much simpler than MacroPy, you should be able to fully understand all its functionality. I don't have much experience with Python and was able to understand how to modify it ;-)

Thanks. I actually just read through all of mcpy's source code, and... wow. That's compact and elegant.
Doing so also answered my most pressing questions. Right now I can't just drop in mcpy to compare coverage results with it vs. MacroPy, because mcpy - being minimalistic by design - is missing a couple of features my macro code depends on.
Summary of findings (as of September 2020, in case someone ends up reading this much later):

No support for the new AST node types added in Pythons 3.6 and 3.8; could likely be added in a couple of hours.

Looking at GTS, for 3.6 that's AnnAssign, Constant, FormattedValue, JoinedStr, and for 3.8, NamedExpr. Also, with 3.8, supporting Constant becomes mandatory, because the parser no longer generates instances of the old Num, Str et al. node types.

No q (quasiquote), hq (hygienic quasiquote), gen_sym (make a guaranteed-unused lexical identifier), or AST walkers. All of these are important for advanced use.

Walkers help local pattern-matching such as in let_syntax that I mentioned. This is different from just recursing with the macro expander, since the patterns are not independent macros, but rather just data - a pun on the code-data duality.

No expose_unhygienic, but maybe not a problem, it's not very pythonic anyway.
Explicit manual recursion inside macro invocations, vs. MacroPy's automatic two-pass (outside-in, then inside-out).

mcpy does feel like the core of a next-gen Python macro expander, though!

In the evenings during the last few weeks, I've been investigating this, by extending mcpy. The problem is, macro expanders for Python haven't cared about getting the corner cases of AST line numbering right - and those line numbers are what Coverage.py relies on. So it seems my hunch was right - the issue is not in Coverage.py, but in the macro expander (whichever one you pick). There's simply no AST node in the output having the line number of the source line that's being reported as not covered.
So, on that note, I'd like to introduce mcpyrate, a third-generation macro expander for Python, which should give correct coverage.
It has the features that were missing from mcpy 2.0.0, plus some more, including bytecode caching with macro-dependency analysis, to speed up loading when the source code hasn't changed. There's a REPL, plus an IPython extension, where it's possible to import, define and use macros in an interactive session. There's no need for a per-project wrapper script. The killer feature macropy.tracing.show_expanded has become mcpyrate.debug.step_expansion, showing also intermediate steps. Also, by default, quasiquotes prevent macro expansion in the quoted code, and macro names can be hygienically unquoted.
I've been running my development on 3.6 and PyPy3; support for 3.7 and 3.8 is already done, but I still need to write automated tests and set up a CI workflow to actually test on those platforms. So it's not completely release-ready yet, but getting there.
In any case, at least in my own private tests, I'm getting correct coverage with Coverage.py, with mcpyrate as the macro expander. (I hope to clean up and publish test cases soon.)
It's almost drop-in compatible with mcpy 2.0.0 (with small differences, all mentioned in the README); so if you want, maybe try it and see if you get correct coverage?

Just for the records: mcpyrate solves the problems in a clean way.
The needed extra nodes are added automatically in a consistent way. You just need to manually add line numbers for newly created nodes. The module fills line numbers in a coherent way.
Using it I got correct coverage information.
In addition it supports Python cache files. Thanks to it I'm getting almost the same performance than using mcpy (which is simpler but doesn't support cache files). This is around 3 times faster than macropy

mcpyrate is now on PyPI. Enjoy.

Just for the record, mcpyrate has been production-ready (and as mentioned above, on PyPI) for over a year now. All sorts of advanced features such as multi-phase compilation and dialects (full-module source and AST transformations) have been added in the meantime. Version 3.6.0, released today, supports Python 3.6 through 3.10.
My opinion regarding coverage reporting for macro-enabled code is still that Coverage.py itself needs no changes. Rather, it is up to the macro expander and the authors of macros to populate the source location info in the AST correctly.
That is, when doing so is possible; there is at least one unavoidable philosophical issue. I think this is just something one needs to keep in mind when working with macros.
So for me, with mcpyrate, the issue is "solved enough".
How about you, @set-soft ? @nedbat ? If you have the time, I'd like to hear your opinions on this.

Hi @Technologicat !
For my use mcpyrate is working with Coverage.py.
The only annoying thing I have is with pytest, some times I need to do a touch *.py of my sources. For normal uses I don't need it, but when running the tests something interferes. I tried deleting all the Python caches and generating them again, but pytest does something else. In my case reseting the time stamps solves the problem. Not sure what pytest is doing.


torchaudio.transforms.Spectrogram with power=1 can easily NaN

🐛 Bug
If you use STFT through Spectrogram, with power=1, you can easily get a NaN. If your spectrogram square magnitude underflows to zero, you end up taking backprop of sqrt(0), which leads to a NaN.
To Reproduce
Steps to reproduce the behavior:

Use torchaudio.transforms.Spectrogram, set power=1, do a backward pass.

Expected behavior
There should be a configurable epsilon to clamp the input to sqrt, otherwise users have to use torch.stft directly or use other workarounds (such as power=2).

Hi @gibiansky
Thanks for the report. I think I got the gist, but could you illustrate the fix?
Is it here?
https://github.com/pytorch/audio/blob/0076ab073d1ee6160efbc239e075196b35ed850b/torchaudio/functional.py#L95

Not quite.
Here is the issue. Using torchaudio.transforms.Spectrogram with power=1 is equivalent to:
stft = torch.sftf(waveform, n_fft, hop_length, win_length, ...)
norm_sq = stft.pow(2.).sum(-1)
result = norm_sq.sqrt()

Let's suppose your waveform is zero, and so your norm_sq is zero. Then you take the square root of that, and you get zero. However, during the backward pass, the sqrt of zero is mathematically undefined at one, and torch.sqrt gradient is NaN.
I want to be able to do this:
stft = torch.sftf(waveform, n_fft, hop_length, win_length, ...)
norm_sq = stft.pow(2.).sum(-1)
result = (1e-9 + norm_sq).sqrt()

This ensures that we cannot get NaN on backward pass.
Here is a related issue also caused by sqrt of zero backward pass:
https://github.com/pytorch/pytorch/issues/43211
https://github.com/pytorch/pytorch/issues/37323
I think perhaps this has been fixed in norm(), but computing the norm by hand still causes the issue, because it wasn't fixed for sqrt:
https://github.com/pytorch/pytorch/blob/201ba139115adeecae4f094a9c9790200e53ff99/tools/autograd/templates/Functions.cpp#L115

In fact, the issue is caused by the line below the one you linked, @mthrok. Due to the torch.norm bug linked in the code, you implemented complex_norm, but complex_norm uses sqrt directly, and so it has poor backward pass behaviour (NaN) when the input is zero (unlike torch.norm, which special-cases zero inputs).
With regards to fixing it, I can see that it might be a bit tough; the core issue is torch.sqrt and torch.norm. torch.norm behaves well on backward pass but is slow on CPU compared to implementing norm yourself. But the implemented complex_norm returns NaN instead of a zero subgradient at input zero, which causes problems.
My original suggestion, adding a tiny epsilon, isn't great either, because it's not really doing the right mathematical operation anymore and can fail for float16 (as in one of the things I linked).
I would recommend (a) switching complex_norm to check the device, and use torch.norm if we're on GPU and (b) changing complex_norm to torch.norm ASAP.

@gibiansky Thanks for the detailed explanation.
@anjali411 If we migrate to ComplexTensor type, can the backward pass of abs() handle zero <-> NaN issue mentioned above??

@anjali411 If we migrate to ComplexTensor type, can the backward pass of abs() handle zero <-> NaN issue mentioned above??
yeah here's a sample code to show that:

>>> x=torch.zeros(2, 3, dtype=torch.cfloat, requires_grad=True)
>>> y=x.abs()
>>> y.sum().backward()
>>> x.grad
tensor([[0.+0.j, 0.+0.j, 0.+0.j],
        [0.+0.j, 0.+0.j, 0.+0.j]])

>>> x1=torch.zeros(2, 3, dtype=torch.float, requires_grad=True)
>>> y1=x1.sqrt()
>>> y1.sum().backward()
>>> x1.grad
tensor([[inf, inf, inf],
        [inf, inf, inf]])

@anjali411 Thanks!
@gibiansky Do you think this approach is sufficient for the issue you are facing?

I am unfortunately somewhat new to PyTorch (I have been using it for all of three days at this point) so I may be missing subtleties, but at least on the surface level it seems like this would solve my issue neatly.

@gibiansky I made a PR #1013 . Could you take a look at the test to see if it is solving the issue? I checked that the test fails before applying the patch, but passes after.

Yes, I believe that is correct. Thank you!

Not quite.
Here is the issue. Using torchaudio.transforms.Spectrogram with power=1 is equivalent to:
stft = torch.sftf(waveform, n_fft, hop_length, win_length, ...)
norm_sq = stft.pow(2.).sum(-1)
result = norm_sq.sqrt()

Let's suppose your waveform is zero, and so your norm_sq is zero. Then you take the square root of that, and you get zero. However, during the backward pass, the sqrt of zero is mathematically undefined at one, and torch.sqrt gradient is NaN.
I want to be able to do this:
stft = torch.sftf(waveform, n_fft, hop_length, win_length, ...)
norm_sq = stft.pow(2.).sum(-1)
result = (1e-9 + norm_sq).sqrt()

This ensures that we cannot get NaN on backward pass.
Here is a related issue also caused by sqrt of zero backward pass:
pytorch/pytorch#43211 pytorch/pytorch#37323
I think perhaps this has been fixed in norm(), but computing the norm by hand still causes the issue, because it wasn't fixed for sqrt:
https://github.com/pytorch/pytorch/blob/201ba139115adeecae4f094a9c9790200e53ff99/tools/autograd/templates/Functions.cpp#L115

@gibiansky could you briefly explain what is this for? Many thanks in advance!
norm_sq = stft.pow(2.).sum(-1)
result = norm_sq.sqrt()


treewide (darwin): fix or enable darwin build for many packages (7)

Motivation for this change
See #114976 for details.
Things done

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

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

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[x] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 117011 run on x86_64-darwin 1

11 packages built:

asc-key-to-qr-code-gif
bash-supergenpass
gt5
pdfcrack
philter
pixiecore
pixiewps
redir
rshijack
shc
surfraw


wrapper update with fixes

Adds required wrappers for batched ntt/ecntt
Cleanup
Fixed tests
Removed wip and danksharding-related stuff, drafts and stubs

is there any reason why the wrappers for EC-NTT in rust bindings are removed?
Or maybe any plan to add it?

indeed - it will be added back!
@LeonHibnik @jeremyfelder @vhnatyk please share estimated timeline and workarounds

@alxiong we'll add them, we just weren't aware of any users, thanks for letting us know!

we just weren't aware of any users

e.g. fast-danksharding which depends on a much older version of icicle (before it was cleaned up) uses ecntt_batch, see here

@alxiong yea that's true, we were going to reintroduce EC NTT for a new danksharding version should it be developed.


Support screen resizing

Asciimatics does not detect when the screen resizes and so hits curses errors as it tries to access invalid co-ordinates.  It should detect the resizing and recalculate the screen/effects.

Implemented in V1.1.0


Update XML to not embed quote in PATH on windows

Remove the unsupported commend in lua script

Fixes #4335
Signed-off-by: Jhon Honce<EMAIL_ADDRESS>

LGTM

@giuseppe @vrothberg @mheon @TomSweeneyRedHat @baude PTAL

/lgtm


Make alternative sox installation into a block in README

Considering the fact that we are now patching libsox and the process of building libsox has been stabilized, we should stop relying on external libsox.

Indeed. I removed the instructions to build against external sox then.


Failed to get input tensor data!

Hi, there! I change the resolution of input to 512x512, then we I run the model, it shows
2023-01-04 12:19:42.029 ERROR image_segmentation/segmentation_postprocessor.cpp@78: Failed to get input tensor data!
What is the reason of it?
Thank you

The network requires a specific input format.
For example if you look at the model card, using PeopleSemSegNet states that it requires "Color Images of resolution 960 X 544 X 3" as the input.


Fixing issue of not scanning on Android devices

E/ImageError(11754): Getting Image failed
E/ImageError(11754): java.lang.IllegalArgumentException
E/flutter (11754): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null)
E/flutter (11754): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
E/flutter (11754): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
E/flutter (11754): <asynchronous suspension>
E/flutter (11754): #2      TextRecognizer.processImage (package:google_mlkit_text_recognition/src/text_recognizer.dart:23:20)
E/flutter (11754): <asynchronous suspension>
E/flutter (11754): #3      ScalableOCRState.processImage (package:flutter_scalable_ocr/flutter_scalable_ocr.dart:356:28)
E/flutter (11754): <asynchronous suspension>

@tminhvu hi, thanks for the PR, just quick question do we need the final TextRecognizer _textRecognizer = TextRecognizer(script: TextRecognitionScript.latin); part, since I would like the package to recognize all available languages? Tnx

@tminhvu hi, thanks for the PR, just quick question do we need the final TextRecognizer _textRecognizer = TextRecognizer(script: TextRecognitionScript.latin); part, since I would like the package to recognize all available languages? Tnx

So sorry for the late reply. But I think latin is the default value for script and removing mine wouldn't affect much.


OpenAssetIO

@foundrytom FYI for next year

Hi @elliotcmorris - seeing if you are good to do the annual review uring the 10 July meeting - let us know.

Approved via LFX TAC votes for renewal.


TractableBufferStock-Interactive

@llorracc says here: https://github.com/econ-ark/HARK/pull/472#issuecomment-582010196

While we're at it, though, let's change the name of
"TractableBufferStockQuickDemo" to "TractableBufferStock-Interactive" or
something like that.  (Open it and you'll see why).

TractableBufferStock-Interactive already exists in DemARK


Stuck on waiting for traffic

What version of million are you using?
latest
Are you using an SSR adapter? If so, which one?
No
What package manager are you using?
pnpm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug

Stuck on waiting for traffic
What's the expected result?
Not to be stuck?
Link to Minimal Reproducible Example
https://github.com
Participation

[ ] I am willing to submit a pull request for this issue.

Same problem here. Linux with vscode installed with snap.


Zetia/fix ssl secret flag

This checklist is used to make sure that common guidelines for a pull request are followed.

For new extensions:

[ ] My extension description/summary conforms to the Extension Summary Guidelines.

About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify src/index.json.

@zetiaatgithub , can you investigate the test failure and fix it.  It's one of the AzureML tests that is failing


In an existing SvelteKit project, is it possible to prevent 'unplugin-svelte-components' from automatically adding imports for declared components? Removing import statements in an existing project can be quite cumbersome.

In an existing SvelteKit project, is it possible to prevent 'unplugin-svelte-components' from automatically adding imports for declared components? Removing import statements in an existing project can be quite cumbersome.

Hi @muweigg, sorry for the delay.
Well currently the only way you could achieve that is by adding <!-- unplugin-svelte-components disabled --> inside the file, with that  unplugin-svelte-components will ignore that file
<!-- unplugin-svelte-components disabled -->
<script>
import Counter from "../../Shared/Counter.svelte"
</script>

<Counter />

If you have updated to version 0.2.9 or above, you can ignore the above solution. This plugin will now automatically ignore pre-defined components in imports declarations.
I am closing this issue. Please feel free to reopen it if you are still experiencing problems.


Stone type making

andesite, driorite and lime (tho lime might just be limesand, then it's not really a stone

[ ] andesite
[ ] driorite
[ ] lime

By products from ore processing

Remove diorite a d granite from the chain and remove/keep them as decorative only

Andesite will stay as worldgen

Lime will be renamed sandlime and thus processed from sand


Fixed file size calculation for some files

In testing, I have had several files report a file size of 0, where others show the bytes as expected.
This PR is based on https://github.com/anacronw/multer-s3/pull/191.

Here is the AWS documentation.


Add support for toVersionString on result.os and result.ua

ua-parser results had a toVersionString function on os and ua. Add the missing support.

@shane-tomlinson, I'm pretty sure it's better to be added directly to the uap-ref-impl as it's a reference implementation and at least some of the implementations (PHP, Go, Ruby) already implemented toString and toVersionString analogues

Thanks @fedot, I'll open a version there.


Added more slang

I had time to contribute some more.
Added the following:
ifyp
imu
wywh
ssdd
omdb
soml
rtbl

Hi @danitacodes why did you close your PR?

Hi! I didn't sync before I made changes. The codebase is different now. Each one has its own db file. So, I have to redo.

Oh, okay. Feel free to try again when you can :+1:


Implement an optional promise based interface

I don't know how possible this would be, because I can't remember if anything is returned after running something like serf.members(cb). it would be great to have the option of doing both of the following as if nothing is returned it wouldn't break the existing API (obviously this wouldn't work for the streams):
Standard
serf.members((err, members) => {
    console.log(members);
});

With promises method
serf.members()
.then(members => {
    console.log(members);
})
.catch(err => {
    throw err;
});

With await/async
let members = await serf.members();

Is this something that would relatively easy to implement or is it architecturally a bit of a pain?

Nothing is returned from the command methods except for the three streaming commands (stream, monitor and query). Looks pretty easy to do.


ocamlPackages.{h2, hpack}: init at 0.8.0

Motivation for this change
Dependencies of git-paf 3.4.0.
Mostly based on https://github.com/anmonteiro/nix-overlays/blob/master/ocaml/h2/default.nix. I want to add the other h2-* packages as well, but not motivated currently since this also entails packaging all gluten-* packages.
@anmonteiro I'd be happy to add you as maintainer as well if you want to.
Things done

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

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

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

@ofborg build ocamlPackages.h2 ocaml-ng.ocamlPackages_4_12.h2

@sternenseemann thanks for doing this one! Happy to be included in the maintainers list.


generator: Handle symlinks when copying from a container

docker cp tries to avoid creating simlinks which would break out
of the directory it is creating.   In #88, when copying
/usr/lib/x86_64-linux-gnu from a running container, a symlink
pointing back 4 layers is rejected:
invalid symlink: <dest>/usr/lib/x86_64-linux-gnu/hdf5/serial/include" -> "../../../../include/hdf5/serial"

The intended target of the symlink is in <dest>/usr/include which is
outside the path being copied.    The error message is generated
here:
https://github.com/moby/moby/blob/dd146571ea458082c499c647ba36580bb7277131/pkg/archive/archive.go#L753

Symlinks which point inside the directory tree being copied do not cause errors:
<dest>/usr/lib/x86_64-linux-gnu/libxcb-render.so.0 -> libxcb-render.so.0.0.0

The "hdf5 include" error does not occur if we copy the whole of the /usr directory from the container, making the symlink no longer break out of the copied directory:
% docker cp <container>:/usr <dest>
Successfully copied 3.24GB to <dest>

This commit avoids the error by asking docker cp' to print a 'tar' stream to standard output and piping it to a local tarprocess. The localtar` does not complain about creating potential dangling symlinks.
The performance of piping to 'tar' should be similar to using "normal" docker cp because dockerd always sends a tar stream
to the docker CLI.   In the normal case, docker cp unarchives
the tar stream, using the library which checks for symlinks which
break out of the tree.  In the "tar stream" case, docker cp just
prints the stream to standard output.
Co-authored-by: @t089
Fixes #88

@swift-ci test


Prevent dev users from deleting the SourceData table and other important things

We already have protections on the assets bucket, and the DeleteTable permission should be denied all resources. It clearly isn't, which is a bug.

Closing as done.


[DealabsBridge] Follow site changes

Changed some CSS class to follow the website changes (again)

Thanks a lot !


Install Salt using Salt bootstrap script

Official bootstrap script written in Powershell is used.
CM_OPTIONS are passed as arguments (see README.md).
PS: the old way of installing Salt was limited and no longer works.

I'll look at getting this merged after the holidays when I have access to my saltstack boxes to test. That ok?

Hey @rominf, let me know if you don't have time to incorporate these changes and I'll work on integrating them into your PR. Now that I can help maintain this repo, PRs like this that fix busted functionality are high on my priority list.
Thanks for your patience, good sir!

Hey @arizvisa, thanks for asking about the time. Indeed, I'm a little bit busy right now. Feel free to do whatever you want with that PR :)

Ok. I'll see what I can do.

I noticed that each of the configuration management tools have a way of passing options to them (CHEF_OPTIONS, PUPPET_OPTIONS, etc.), so I ended up extending your CM_OPTIONS enhancement that you added for Salt to all of them.
I also added the changes to explicitly specify the SaltStack version since you can't ever be sure if a current version of SaltStack is a broken release or not.
These have been consolidated into PR #201. As a result I'm marking this as superseded and will close this PR once #201 gets merged. Thanks for your contribution good sir!

Ok. PR #201 with your changes has been merged. Thanks for your contribution!


drivers: can: mcp251xfd: Use macro to set TDCO

Use CAN_CALC_TDCO() macro to set TDCO. There is a minor change how the tdco is calculated. In the macro the SYNC segement is taken into account while it wasn't used before.
Fixes #73821.

Bulk changing the milestone from everything which did not make it to the v3.7.0 freeze deadline
and which is not labeled as a bug or documentation (or does not appear clearly as only containing
a bug fix or a documentation change).
If you disagree about this change please add the milestone again.
Please note that until rc2 only PRs containing bug fixes, docs and tests can be merged.
After that and until release only bug fixes and docs changes.
Exceptions require approval by the release team and a vote by the TSC.
https://docs.zephyrproject.org/latest/project/release_process.html#stabilization-phase

@aescolar This is a stabilization fix. I'd like it to be considered for v3.7.0.


[bug ]Scriptor has a verbal spell incompatibility with Minecraft Comes Alive Reborn's chat AI

Mod Version (e.g. Fabric 0.3.4): Quilt 0.6.1
What you expect to happen:
When I say a villager's name the chat AI generates a response.
What actually happens:
Villager does not respond.

Have you tested this functionality in-game without Scriptor installed? This functionality appears to work identically with and without Scriptor installed.

Cannot replicate this issue, cannot get other users to replicate it, no response here or on Discord. Closing this issue, please feel free to reopen if you are still experiencing problems.


Pinch to zoom

Thanks for the intro to Azimutt today, @loicknuchel.
On Mac, it's quite common to pinch to zoom on the trackpad and works in apps like Figma and Excalidraw. I'd love to see the same on Azimutt.
Thanks!

Hey @willlma
Late answer but answer anyway :wink:
Indeed I have it in mind but I don't know really how to handle it with Elm and as I don't have a Mac, it's quite hard to experiment.
I'm keeping it in mind but to be honest our current priority is improving the distribution (heroku plugin & docker install coming soon)


version banner triggers on both software and data even if there is a new version of software only

fixed, had wrong conditional in pages/data/v0.2/BannerVersions.vue


Hide the Background option for.. type: "freedraw";

How can i hide the Background color option for.. type: "freedraw";
i checked the docs but i didn't find my answer.
Thank you!

@mtrud there is no way to hide the background option right now. What you can do is when the appState.activeTool.type is freedraw you can add a class to the parent to hide the background via CSS.
Actually we might want to hide the background/fill options unless the shape with freedraw is a closed one where bg, fill are useful. @dwelle thoughts ?

Actually we might want to hide the background/fill options unless the shape with freedraw is a closed one where bg, fill are useful. @dwelle thoughts ?

If we are going to implement https://github.com/excalidraw/excalidraw/issues/4359 then no.
But we should allow and spec out the sidebar/tool behavior customization.


Passing a configurations object throws an error

I'm trying to integrate this library into a an MDL project I'm building but the configuration doesn't seem to work.
 enableCal: function(__feild){
        var $element = $(__feild);

        var picker = new MaterialDatePicker({
            el: $element,
            openedBy: 'onclick'
        });

       $element.on('focus', function(){
            picker.open();
        });

}

When I run this in the browser I get:
index.js:207 Uncaught TypeError: this.options.el.setAttribute is not a function
    at DateTimePicker.set

Any ideas?

Okay, i've tried a different approach and I'm not getting any errors, but not it doesn't fire any more.
            var picker = new MaterialDatePicker({
                el: $element,
                openedBy: 'focus',
                container: document.body,
            }).on('submit', function (val) {
                $element.val(val.format("DD/MM/YY"));
            });

Hi, thanks for the issue. It looks like you're using a jQuery selection for el. It should be a vanilla DOM Element.
For example,
var picker = new MaterialDatePicker({
  el: $element[0]
});

Okay, thanks for letting me know. Perhaps you want to update your documentation to reflect this.
I appreciate the feedback.

The docs don't mention jQuery, and the docs have an example with document.querySelector. How could I update them to make that clearer?

I added a note, hopefully that will help.

Thanks so much


Placeholder-plugin

Hi,
i am using ui-tinymce. i am want to show a placeholder if the ng-model is empty. Is there any plugin which supports my requirement.
Thanks in advance..

Please use stackoverlow or other forums for support.

finally good solution ;D


Bump amd-name-resolver version to enable parallel babel transpile

Thank you!

parallel babel transpile

WHAT?! How did I miss this?! Time to go crawl some changelogs...anyway, much excite. This is awesome!


snag the roman numerals as numbers in the preface

See

This will need some work (see #23)

Done: see https://github.com/STAT325-S24/HistoryAmherstCollege/commit/64a0b117f0ea91cef39975a8f0bd68017dbf8912 and  screenshot:


add system design eng files

Hi @SilverNarcissus @VenkatDatta @HTHou , I noticed that the author opened another PR #936 and fix your review comments in the new PR. Would you like to check and review the new PR ... ? I will close this old one.


Wrap long labels in deployment dialog

For accessibility let's opt for wrapping of long labels that are prone to getting cut off in the deployment dialog as opposed to providing hover-over tool tips

Things look admittedly cramped but not nearly as bad as they used to with 22p environment font!

And here it is with default (9p) environment font:

Just noticed that the extended options shift a bit between my 2 displays?!?? (look at alignment of checkboxes below the horizontal separator compared to the screenshot above which was taken on a different monitor)


Problem with filter query Paramater

Hi....
Whenever i try to do a search i don't get back any result. After some research i have discovered that the issue has to do with the paramater fq=id:book_* that is added on each query i make. I know that "book" comes from the entity that am searching (which is named book) but what i don't understand is why it adds that in the first place and why the prefix "book_"
When i check the solr logs i see this
q=:&json.nl=flat&omitHeader=true&fl=&start=0&fq=id:book_&rows=10&wt=json
And whenever i try that in the browser with out including "fq=id:book" or changing it to "fq=id:" then i get back the results fine.
What can i do to get the results desired?
Thanks for your help

An collection/index can contain more then one type of documents, e.g.: Books and Authors. Each document has a field id which is unique. If you index a book and author entity with the same id, then one entity will be overwritten. To avoid that all ids are prefixed with their type.
In your query q=:&json.nl=flat&omitHeader=true&fl=&start=0&fq=id:book_&rows=10&wt=json is the q-parameter wrong. The value must be something like q=*:*.
Change fq=id:book to fq=id:book_* and you will get some documents.

In my case the problem was not about the q paramater but rather the fq
parameter.
No matter what i did the query that was being sent to Solr always have this
fq=id:book_*
I never sent that anywhere but it was always there regardles of what i did.
I know it comes from the core configuration (since what am searching for
is a book. I suspect if in the core configuration i had say 'mybook' it
would still add fq=id:mybook_).
So my question of why it always adds a query filter and how i can either
tell it not to add it or add something else (e.g. fq=id:).
On 11/14/2016 11:05 AM, Florian Semm wrote:

An collection/index can contain more then one type of documents, e.g.:
Books and Authors. Each document has a field |id| which is unique. If
you index a book and author entity with the same id, then one entity
will be overwritten. To avoid that all ids are prefixed with their type.
In your query
|q=:&json.nl=flat&omitHeader=true&fl=&start=0&fq=id:book_&rows=10&wt=json|
is the q-parameter wrong. The value must be something like |q=:|.
Change |fq=id:book| to |fq=id:book_*| and you will get some documents.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/floriansemm/SolrBundle/issues/148#issuecomment-260271700,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMbcapWzEiGB3s7dhRrIHPoi8nOhlDL_ks5q-BZYgaJpZM4KwKUC.

the fq id:mybook_* was in an old version of this bundle part of the q. Filter queries are made to restrict a subset of documents.
To remove the filter query:
$query = $this->solr->createQuery('Your:Entity');
$query->removeFilterQuery('id');
$result = $query->getResult();


merge contour issue

Hi Dear. I want to use detector.merge_contours method to merge overlapped contours. but it gives an error "ValueError: too many values to unpack (expected 2)" at  this line: cont_i, disk_i = all_contours[i]. thank you for your help. can you give insight that how does merge contour work? what are cont_i disk_i  s? thanks

Hi, first you should output the all_contours[i] to make sure that it has 2
elements, first is contour and the other is disk. Here disk is a sequence
of disk with (center, radius), see in the original paper. And contour is
the contour points array after drawing the disks in an all-zero mat (than
as the input of cv2.findContour).
The main idea of merge_contours is that if one contour "steps into" the
other one, they should be one contiguous text instance e.g. word "hello"
and "world" are often annotated as a single text instance. We use function
stride to judge if one instance "step into" another one: From the first or
the last disk's center, we step in the direction of the textsnake by 0.3
times of the radius. if this point is in another contour, they are
overlapped.
Hope this can help you.
On Wed, Sep 11, 2019 at 6:13 PM johnSmith1990<EMAIL_ADDRESS>wrote:

Hi Dear. I want to use detector.merge_contours method to merge overlapped
contours. but it gives an error "ValueError: too many values to unpack
(expected 2)" at this line: cont_i, disk_i = all_contours[i]. thank you
for your help. can you give insight that how does merge contour work? what
are cont_i disk_i s? thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/princewang1994/TextSnake.pytorch/issues/31?email_source=notifications&email_token=ADZMHI5BVJBXEUIBWMNJBHLQJDAGFA5CNFSM4IVSAFJKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKVQ4VQ,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADZMHIZ56ASL5ISOPLITBG3QJDAGFANCNFSM4IVSAFJA
.

thank for your reply. but i am confused.  this line : contours, output = detector.detect(image) gives list of contours and each of them is an array not 2 output. here is output : https://ibb.co/ZVZPVMF

thanks. I got it.


I found that it would automatically scroll several times the first time

I obtained the data list through the backend interface, and when binding the card swiper, I found that it would automatically scroll several times the first time before stopping at the index position. This is why and how to avoid this problem, so that it should not automatically scroll a few times and directly locate at the index position the first time
when loop =  true;
This is the log of index changes that I output，
Finally locate at index=2
I/flutter (23982): spwiere index , 0
I/flutter (23982): spwiere index , 0
I/flutter (23982): spwiere index , 4
I/flutter (23982): spwiere index , 4
I/flutter (23982): spwiere index , 1
I/flutter (23982): spwiere index , 1
I/flutter (23982): spwiere index , 4
I/flutter (23982): spwiere index , 2
I/flutter (23982): spwiere index , 5
I/flutter (23982): spwiere index , 5
I/flutter (23982): spwiere index , 2
I/flutter (23982): spwiere index , 5
I/flutter (23982): spwiere index , 0
I/flutter (23982): spwiere index , 3
I/flutter (23982): spwiere index , 3
I/flutter (23982): spwiere index , 5
I/flutter (23982): spwiere index , 4
I/flutter (23982): spwiere index , 0
I/flutter (23982): spwiere index , 5
I/flutter (23982): spwiere index , 2
I/flutter (23982): spwiere index , 5
I/flutter (23982): spwiere index , 0
I/flutter (23982): spwiere index , 1
I/flutter (23982): spwiere index , 5
I/flutter (23982): spwiere index , 2
I/flutter (23982): spwiere index , 3
I/flutter (23982): spwiere index , 4
I/flutter (23982): spwiere index , 5
I/flutter (23982): spwiere index , 0

I also encountered continuous scrolling when loading for the first time,
I load the component by checking if the data source is empty
hope to help you

Same problem, did you find a solution?

我第一次加载时也遇到了连续滚动的情况， 我通过检查数据源是否为空来加载组件 希望对你有帮助

按你的办法解决了,谢谢

Same problem, did you find a solution?

when the data is not null,load the widget,problem solved.

Same problem here when putting Swiper inside a Sliver widget any solution ?

Same problem here when putting Swiper inside a Sliver widget any solution ?

When the data is empty, this problem occurs. My solution is to not display the component when the data is empty. Once the data is obtained, the component can be displayed. You can use a ternary expression to check this.

遇到同样问题，首次打开，swiper那里来回跳

我尝试了各种种方案，感觉可能和使用getx有关系。但是也没定位问题。
最后无奈换了个插件。
---- 回复的原邮件 ----
| 发件人 | @.> |
| 日期 | 2024年03月26日 16:11 |
| 收件人 | @.> |
| 抄送至 | Jason<EMAIL_ADDRESS>|
| 主题 | Re: [TheAnkurPanchani/card_swiper] I found that it would automatically scroll several times the first time (Issue #73) |
遇到同样问题，首次打开，swiper那里来回跳
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>


UI is unusable on phone

The UI does not work well at all on mobile phones / embedded Dapp browsers.

Fixed by #20


type 'Request' is not a subtype of type 'Request'

Describe the bug
a bug with use GetConnect:
error message is :
type 'Request<dynamic>' is not a subtype of type 'Request<ResponseData>' in type cast
**Reproduction code
  @override
  void onInit() {
    super.onInit();
    httpClient.baseUrl = appBaseUrl;
    httpClient.addRequestModifier<dynamic>(
        (request) => request..headers['content-type'] = 'application/json');

    httpClient.addRequestModifier<dynamic>((request) async {
      return request.copyWith();
    });
}

Expected behavior
I can normal send request.
I suggest that Request must not bind with response type , so i can build Request myself;
Flutter Version:
Flutter (Channel stable, 2.2.3, on Mac OS X 10.15.7 19H524 darwin-x64,
locale zh-Hans-CN)
Getx Version:
get: ^4.3.0

Hi @geekcarl ,
This is what I am doing and it is working fine, maybe you can give it a try.
Notes the  vs .
 client.httpClient.addRequestModifier<void>((request) async {
      request.headers.addAll({
        if (App.useLocalTimezoneInHttp)
          "timezoneoffset": "${DateTime.now().timeZoneOffset.inHours}",
        if (Get.locale != null)
          "languagecode":
              "${Get.locale!.languageCode}_${Get.locale!.countryCode}",
        if (App.settings.apiKey().isNotNullOrEmpty)
          "appkey": App.settings.apiKey(),
      });

      await _cookie.loadForRequest(request);
      return request;
    });


[BUG] Running apalache without parameters leaves (empty) detailed.log behind

 /workspaces/ewd998 (main ✗) $ ls detailed.log
ls: cannot access 'detailed.log': No such file or directory
/workspaces/ewd998 (main ✗) $ tools/apalache/bin/apalache-mc >/dev/null
/workspaces/ewd998 (main ✗) $ ls detailed.log
detailed.log

What behavior would you expect? A non-empty log or no log?

I'd prefer no log (like I'd prefer TLC to not create states/)

This was closed a few days ago


Annotations for "Towards Better Semantic Understanding of Mobile Interfaces"

In the Paper https://arxiv.org/abs/2210.02663 a footnote mentions that the dataset can be downloaded from https://github.com/google-research-datasets/rico-semantics .
However the link is dead and the Repository with the corresponding code only mentions downloading the annotations in order to be processed.
Is this a WIP or just an oversight and can we expect updates regarding this dataset?

Correct URL is https://github.com/google-research-datasets/rico_semantics


Interested in using facade approach instead?

I found this repo after getting frustrated with gmqtt.
I really appreciate the type hints and wanting to be like paho client as much as possible but found the approach you took lead to some undesirable traits like 3 connect methods and the access of protected members.
Would you be interested in altering this repo to use a facade instead (I would be willing to contribute / write it with you)?
We no longer have to contend with:
- self.connect(...)
- self.connect_async(...)
- self.asyncio_connect(...)
and can instead offer only:
- def connect(...) -> None
- async def wait_connected() -> None
The documentation can be simplified to not require parts like:

The classic Paho connect() is blocking. Paho connect_async() is not blocking, but returns before the connect is complete. Use asyncio_connect() to wait for connect to complete without blocking. This function also throws exception on connect failure. Please note that asyncio_connect() cannot be used together with on_connect /on_connect_fail (use asyncio_add_on_connect_listener and asyncio_add_on_connect_fail_listener instead of on_connect and on_connect_fail).

We could add in missing type hints (paho is missing a fair amount).
To help explain further here is a bit of code:
import logging

from paho.mqtt.client import MQTT_CLEAN_START_FIRST_ONLY, Client

__all__ = ["AsyncClient"]

class _SyncClient(Client):
    """Exposes some protected values for AsyncClient

    This will help us avoid lines like:
    - self._asyncio_listeners._on_connect_forwarder,  # pylint: disable=protected-access
    - self._asyncio_listeners._on_connect_fail_forwarder,  # pylint: disable=protected-access
    """

    pass

class AsyncClient:
    """Facade around Paho Sync Client

    We pass through only the properties and methods that make sense and fix
    / add in type hints where they didn't exist before.
    """

    def __init__(self) -> None:
        self._client = _SyncClient()

    # we can add in missing type hints at the same time
    def enable_logger(self, logger: logging.Logger = None) -> None:
        self._client.enable_logger(logger)

    def disable_logger(self) -> None:
        self._client.disable_logger()

    # more missing type hints
    def username_pw_set(self, username: str, password: str = None) -> None:
        self._client.username_pw_set(username, password)

I know that the approach brings some issues like you explain. But going down the facade road probably brings other issues along the way. One goal was to keep the transition from Paho simple be not taking away anything. A facade implementation has to implement facade for a lot of functions to meet that goal. If a facade approach should be followed, then i think that should be by creating a new facade class and keep the exising.
Have your tried asyncio-mqtt? That package can also be a nice alternative if you need async mqtt.


[Feature] Add ability to edit the Note in Goal Detail Screen

Add ability to edit the Note in Goal Detail Screen

Hi! You can edit notes and all other properties by clicking on this pencil icon in the goal card, i don't see a point of adding same thing in multiple screen for no good reason, goal detail screen is supposed to be read-only imo, although I'll probably add ability to delete specific translations there in future updates. Thanks!


Many "dirs" with movies, how to add?

I have at least 4 hdds with movies, I would like to add them to streama, how do i do?

mklink /D "SOURCE_PATH" "TRAGET_PATH"

mklink /D "SOURCE_PATH" "TRAGET_PATH"

Hello :)
I did this already, I just don't understand where to put the path, is it in the second directory? in admin?
Because I can't validate there.
By the way GREAT WORK.
A last question, how much time do i need to wait until the tMDB let me add more movies?

you can do 40 requests every 10 seconds so if it gives an error, add what it found then wait a few seconds and run again
and an example would be run cmd as admin and do
mklink /D "C:/Users" "D:/" if im not mistaken
^              ^
source            target

Well It did not work :(

if i was on win 10 id give you the exact command buuut im not atm, just play with it.. should work

I still did not find a solution. :(

Did you manage to resolve your issue?
If not, check out comment on 844.


Use IDocumentStore.BulkInsert inside a TransactionScope?

Discussed in https://github.com/JasperFx/marten/discussions/2148

Originally posted by youqingz March 30, 2022
I can use IDocumentSession to enlist an ambient transaction inside a TransactionScope, but I also would like to use IDocumentStore.BulkInsert for some of the operations for performance reasons, but seems like it is not supported at the moment?

Closed by #2303


While scrolling or use the up/down arrows on the keyboard, the amount changes

When the cursor is on the "Amount" active field on the send screen, and you are scrolling or tap up/down arrows on the keyboard, the amount changes.
Steps to reproduce:

Launch the Bridges DApp from My DApp Store.
Press the "BEAM TO ETHEREUM" button.
Paste the copied ETHEREUM BRIDGE address.
Tap on the "Amount" active field and scroll or use up/down arrows on your keyboard.
Expected result: the amount doesn't change.
Actual result: the amount changes.

The same situation is also on the https://bridges-dappnet.web.app/send

checked


Core .NET SDK docs are missing

After #5133 was merged, the core .NET SDK API ref documentation was also removed. To keep parity with the other languages we support, we should regenerate the Pulumi .NET SDK docs.
To keep with the look and feel of our other API ref docs, we should use our current API ref theme and layout; however, that may require a fair amount of engineering work. An interim short-term solution would be to bring back the DocFX-generated version (using a scaled down docfx.json file) and host it on our site as we did previously.

Closed via:

https://github.com/pulumi/pulumi-hugo/pull/52
https://github.com/pulumi/docs/pull/5751


Allow user to easily set custom colors for tags and columns

I have just discovered this extension and it is great! I transferred my personal board from Trello to VScode and I am loving it, but one thing I miss is being able to easily set custom colors for different tags and columns. I don't know much about js but this go maybe go on the index.md file as another YAML entry for each. Awesome job on the extension and the CLI tool!
Edit: I know it can be done editing the css file, I would just like to know if this can be done more easily for the general user

Hi @pita-g, thanks for the suggestion! It would certainly be possible to add some configuration options for column/tag colors in the index.md YAML - something like:
columnDisplaySettings:
  Backlog:
    colour: #00ff00
  Todo:
    colour: #ff0000
    # (maybe some other settings for each column as well, like the ability to expand/collapse columns or set the font size...)
tagDisplaySettings:
  MyCustomTag:
    foreground: #eee
    background: #333

These settings would override anything defined in board.css. My only (slight) concern is that this could lead to ambiguity; if a user has created a board.css and defined column/tag display settings inside their index.md, they might wonder why their CSS file isn't working properly... however this is the type of issue that can be mitigated with good documentation :wink:
I'll think about the best way to achieve it and might include this feature in the next update.

That sounds great, thank you!


Support drop sequence statement

Drop for sequence DROP SEQUENCE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

20 of 22 (90.91%)  changed or added relevant lines in 3 files are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage increased (+0.02%) to 85.838%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

src/parser.rs
2
4
50.0%

Files with Coverage Reduction
New Missed Lines
%

src/parser.rs
1
83.4%

Totals

Change from base Build<PHONE_NUMBER>:
0.02%

Covered Lines:
10540

Relevant Lines:
12279

💛  - Coveralls


chore(main): release 1.6.1

:robot: I have created a release beep boop
1.6.1 (2024-11-28)
Bug Fixes

align fix & href link (8c7678f)
remove dynamic import & connections (54eacb4)
speed info (54d3364)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

v1.6.1
:sunflower:


Fix pr commands targetBranch option

BTW, can we release a new NuGet package?

BTW, can we release a new NuGet package?

Thanks for the reminder, updated. Also published on github packages. More to do here. Also need to update readme in repo and nuget listings to include config details and other improvements.


Flush server after TestOperationIsolation

  * (M) compliance/compliance.go - Add flushServer deferred call to `TestOperationIsolation` since it installs a NHG and NH.

Apologies, duplicate debugging. @bstoll fixed this.


fix(ts): add ts and tsx to manifest script to support typescript, see #49

I'm not sure if this is enough to make fbt works on typescript react codebases

I'm fine with this change, but we should probably parameterize anything going forward.  maybe an exts CLI option or something

any eta on merging this PR? would love to start using FBT but waiting for the typescript support

@barakd, it's been there since February... was this comment for something else?
https://github.com/facebookincubator/fbt/blob/master/transform/babel-plugin-fbt/bin/manifest.js#L79


Removes the image from the 'failed workflow' embed

It's way too large relative to the amount of information it provides!!

Just don’t make failing commits smh.


Update ThechiveRipperTest.java

Category
This change is exactly one of the following (please change [ ] to [x]) to indicate which:

[x] a bug fix (Fix #1264)
[ ] a new Ripper
[ ] a refactoring
[ ] a style change/fix
[ ] a new feature

Description
Re-enabled a test that was previously failing
Testing
Required verification:

[ ] I've verified that there are no regressions in mvn test (there are no new failures or errors).
[ ] I've verified that this change works as intended.

[ ] Downloads all relevant content.
[ ] Downloads content from multiple pages (as necessary or appropriate).
[ ] Saves content at reasonable file names (e.g. page titles or content IDs) to help easily browse downloaded content.

[ ] I've verified that this change did not break existing functionality (especially in the Ripper I modified).

Optional but recommended:

[ ] I've added a unit test to cover my change.

Coverage increased (+0.2%) to 42.662% when pulling a7023cc54bee83ebfba0de37dffdd4ed0b2c3222 on cyian-1756-re-enable-test into 9ac28ad5d3fbb30b744da22b643c23a1cafc1a04 on master.


Proposal: SqlFragmenExpression accepting a formattable string as a ctor argument

At this moment SqlFragmentExpression accepts only a string which covers most use cases, but the case with string interpolation. This leads to nasty errors when an argument format depends on the current culture. Yep, this can be fixed on the provider size by FormattableString.Invariant or via some SqlFormattableFragmentExpression, but wouldn't it be better to introduce this on the EF Core side and make life easier for provider maintainers?
public SqlFragmentExpression(FormattableString sql)
    : this(FormattableString.Invariant(sql)) { }

/cc @roji @austindrenski

@YohDeadfall The use of FormattableString in other APIs is to allow parameters to not be in the resulting string at all, but instead to be used as database parameters. This is very different from the use suggested here, and is not an API approach that we want to take. (It would have some of the issues of the other APIs--such as it being hard to determine when the string overload starts being used, but without any of the benefits.)
Provider code must generate string literals such that they are as expected by the database. In practice this means never using the current culture, which in turn usually means that it is more convenient to use string.Format rather than string interpolation. That's why we rarely use interpolation inside EF Core unless it's only for values that are already strings.

@ajcvickers I'm talking about things which happens in providers and which should be used internally, not for parameter substitution. For example take a look at npgsql/Npgsql.EntityFrameworkCore.PostgreSQL#847.
string.Format perfectly suits the goal, but not sure about it usability. So I would like to hear other provider developers too since I'm not an expert and only fix some EF related code (:

@YohDeadfall I understand that. We don't want to be in the business of doing this.

One more thing to add - our usage of SqlFragmentExpression here may be a bit questionable, it's meant mainly as a shortcut to avoid creating a new expression type. It could be argued that once a complex fragment needs to be generated (as here), providers should in any case just have a new expression type and render that as usual. Not really sure, just adding some thoughts.

Can you guys elaborate, how would you like to render this new ctor or new expression type when printing out SQL?

Like in this PR, but without explicit call to FormattableString.Invariant:
interval = new SqlFragmentExpression($"INTERVAL '{amountToAdd} {datePart}'");
// instead of
interval = new SqlFragmentExpression(FormattableString.Invariant($"INTERVAL '{amountToAdd} {datePart}'"));

@YohDeadfall - My question is how would you print it out in SQL. Suppose you added SqlFormattableFragmentExpression as custom expression. When you are visiting it in DefaultQuerySqlGenerator, what would it output to SQL?

It should work as SqlFragmentExpression. Nothing more than implementation of this proposal on our side.
public class SqlFormattableFragmentExpression : SqlFragmentExpression
{
    public SqlFormattableFragmentExpression(FormattableString sql)
        : base(FormattableString.Invariant(sql)) { }
}

If that's the case then, neither option is good. Custom expression type is too much work for seemingly minor task. And adding new ctor has it's own issue. (see https://github.com/aspnet/EntityFrameworkCore/issues/10996 for more details).
Best practice would be to just avoid interpolated string. But if you are insistent on using it then just define an extension method which would generate SqlFragmentExpression with culture invariant string.


Kitchen tests fail on Centos 5.1

The current tests only seem to be failing on Centos-5.1 with the following yum cache error:
           ================================================================================
           Error executing action `create` on resource 'yum_repository[epel]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           execute[yum-makecache-epel] (/tmp/kitchen/cache/cookbooks/yum/providers/repository.rb line 53) had an error:
 Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
           ---- Begin output of yum -q makecache --disablerepo=* --enablerepo=epel ----
           STDOUT:
           STDERR: Traceback (most recent call last):
             File "/usr/bin/yum", line 29, in ?
               yummain.user_main(sys.argv[1:], exit_code=True)

Basically... yum can't update because of a broken certificate.

EPEL's SSL certificates do not use the out of date CA certificates on old versions of CentOS. Install the CentOS 5.x updated copy of 'certificate-ca' package, or as a workaround disable SSL verification fo the yum-epel repository.
This needs to go in the 'yum-epel' cookbook.

Looks like a yumcookbook issue? Close?

It's not even a yum cookbook issue: it's a "maintain your OS security components" issue, especially SSL related packages.  But yeah, I'd close it and maybe make sure yum-epel has a note about this.

Sorry, meant yum-epel, not yum


Example and description for @requestpart

The requirement is a user will upload files to spring boot (ReST request) using angular. The ReST interface store the file into gitlab for further processing. Using @RequestPart annotation, content with a different name will be retrieved from a request and placed into Gitlab. The ReST implementation as follows:
@ApiOperation(value = "Upload java files into Gitlab")
@RequestMapping(method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE,
 produces = "application/json")
@ApiResponses(value = { @ApiResponse(code = 200, response = CustomResponse.class, message = "Success"),
        @ApiResponse(code = 400, response = ErrorResponse.class, message = "Bad Request"),
        @ApiResponse(code = 500, response = ErrorResponse.class, message = "Internal Server Error") })

public CustomResponse uploadJava(
        @ApiParam(value = "Interface", required = true)
        @RequestPart(name = "interface", required = true) final MultipartFile interfaceClass,
        @ApiParam(value = "Java Class", required = false)
        @RequestPart(name = "javaClass", required = false) final MultipartFile javaClass) {
    return null;

When I access the Swagger UI, couldn't find description and example
I found the following in github forum stating that it will resolve the above issue
@Parameter( description = "This is the configuration", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE))
But it didn't.
My question is,

How to add description and example for the above. (Similar to RequestParam)
How to set content type for each file.

Swagger dependency in my project:
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-boot-starter</artifactId>
        <version>3.0.0</version>
    </dependency>

This is a bug. Thanks for reporting the details

Hello, I have a similar problem.
We provide a method in our API that can accept in FormData file and json at once. After some manipulation, we handled to map json directly to Class. Everything works fine but FirmwareModel is not parsed by swagger. This parameter just not exists for Swager. So documentation is not correct and we cant make tests directly from swagger ui.
    fun create(@RequestPart(value = "firmware") firmware: FirmwareModel,
               @RequestPart(value = "file") file: MultipartFile): ResponseEntity<Void> {
        firmwareService.createFirmware(firmware, file, securityService.getUser())
        return ResponseEntity(HttpStatus.OK)
    }

Also, we tried to add it with @ApiImplicitParams. But when we provide paramType="form" - we have the same result. By the way, when paramType is "body" for example - it works, but it not correct of course.
@ApiImplicitParams(
        ApiImplicitParam(name = "firmware", required = true, dataType = "com.mysite.FirmwareModel", paramType = "body")
)

Duplicate of #3464


Added scroll tracking code for budget 2017

Trello card
HMT want tracking in place to see whether people are reading the budget, and which areas are most popular.

This update is no longer valid so I'm closing the issue


Native Image Support

Is your feature request related to a problem? Please describe.
Currently we are trying to add this library to a Micronaut GraalVM Application and we're getting errors like:
org.graalvm.compiler.debug.GraalError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of net.logstash.logback.pattern.AbstractJsonPatternParser$LayoutValueGetter are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use --trace-object-instantiation=net.logstash.logback.pattern.AbstractJsonPatternParser$LayoutValueGetter.

This happens for all Static Classes
Describe the solution you'd like
Is there any way of adding a native-image.properties to make GraalVM Image possible?
Describe alternatives you've considered
Creating a custom serializer
Additional context
Micronaut 3.6.0 with AOT + GraalVM

Hi Luis,
Your are not the first to report issues using the project with GraalVM. Unfortunately I have no experience at all with GraalVM and I'm a bit puzzled about where to start looking at... I found a quick "howto" on the net and used it to build a sample application hoping I could reproduce your problem. Unfortunately I could not reproduce your problem: I could build and execute my sample app without any problem.
Here is what I tried:

I wrote a small application with a single "main" that logs a couple of lines
build it using the org.graalvm.buildtools:native-maven-plugin (version 0.9.13) and the following configuration:

<plugin>
	<groupId>org.graalvm.buildtools</groupId>
	<artifactId>native-maven-plugin</artifactId>
	<version>0.9.13</version>
	<extensions>true</extensions>
	<executions>
		<execution>
			<id>build-native</id>
			<goals>
				<goal>build</goal>
			</goals>
			<phase>package</phase>
		</execution>
	</executions>
	<configuration>
		<mainClass>${mainClass}</mainClass>
		<buildArgs>
			<arg>--allow-incomplete-classpath</arg>
			<arg>--initialize-at-build-time</arg>
			<arg>-H:IncludeResources=.*\.xml$</arg>
		</buildArgs>
	</configuration>
</plugin>

Your error message refers to the AbstractJsonPatternParser so I configured logback to make use of the "pattern" JsonProvider. Here is the encoder I used:
<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
    <providers>
        <timestamp/>
        <pattern>
            <pattern>{ "level": "%level", "message": "%message" }</pattern>
        </pattern>
    </providers>
</encoder>

I compiled the application with mvn package and got a working executable in the target folder. I could launch the app without problem and got my logs printed on the console in JSON format as expected.
Since I could not reproduce the problem myself, it would be nice if you could provide one yourself. Also don't hesitate to give me some more insight if you have some ideas about where the problem is and what could be a solution. Thx.

I will try that. In the meanwhile to reproduce the issue you can just use this pre-configured Micronaut app and add the Encoder
cc @msailes @sdelamo