What am I doing wrong here?

Hi,
I'm programming agains the JSON interface and try to encrypt a file with these settings, but that always fails. Do you know what I'm doing wrong?
{
  "inputFile": "TestFiles\test.pdf",
  "outputFile": "C:\3eb6fc52-800f-4c32-a5fb-9ad1709d5260\output_encryption_256_bit.pdf",
  "linearize": "",
  "encrypt": {
    "256bit": {
      "accessibility": "y",
      "annotate": "y",
      "assemble": "y",
      "extract": "y",
      "form": "y",
      "modifyOther": "y",
      "modify": "all",
      "print": "full",
      "cleartextMetadata": "y"
    },
    "userPassword": "user",
    "ownerPassword": "owner"
  }
}

Is it also possible to write something back to the console when something goes wrong so that I have a clue why it is failing. The only thing I now have is an exit code but that does not point me to the place where it is failing.

It seems to be failing on the cleartextMetadata property, but the manual says that this is an option of the 256 bit encryption

Also have a question about the related options --> https://qpdf.readthedocs.io/en/stable/cli.html?highlight=ranges#id13
Do they only work when encrypting or can these also be used without it?

One thing is that  you will need to quote your backslashes (C:\\whatever) or use forward slashes (C:/whatever) which should work fine. I'll read the rest and reply when I get a chance -- I'm in meetings and appointments most of the day.

The double \ were in the JSON, I just removed them for readability.

It also seems that this is not correct in the manual
--modify=[y|n]	restrict document modification
--print=[y|n]	restrict printing
It expects an enum instead of a y or n value

It's not wrong. The table header shows that as 40-bit only. The enum is for 128-bit and 256-bit.

The value should be the empty string, not "y". It's confusing, but this is based on the CLI, and from the CLI, it's --cleartext-metadata, not --cleartext-metadata=y. If I run qpdf --job-json-file=yourfile.json, I see
qpdf: error with job-json file /tmp/a.json: .encrypt.256bit.cleartextMetadata: value must be the empty string
Run qpdf--job-json-help for information on the file format.

For help:
  qpdf --help=usage       usage information
  qpdf --help=topic       help on a topic
  qpdf --help=--option    help on an option
  qpdf --help             general help and a topic list

As far as I know, this would go to the console.

The double \ were in the JSON, I just removed them for readability.

Noted, but it doesn't improve readability to replace a syntactically correct json with a syntactically incorrect json. :-)

Sorry for all the little messages. I believe I have answered your question. Please let me know if I have not answered something that you asked or if you have follow-up questions. Thanks!

Is it possible to add a callback option the the qpdfjob_run_from_json method so that I can get back what is output in stdout en stderr so that I can get back error messages and things like that.
I tried to capture the console output from C# but this far I have no luck getting anything back.

I also see this in the QPDFJob class, is there a way to set them from the API?
// Override streams that errors and output go to. Defaults are
// std::cout and std::cerr. Pass nullptr to use the default.
QPDF_DLL
void setOutputStreams(std::ostream* out_stream, std::ostream* err_stream);

In C# I can do something like this that calls into the QPDF dll
        var instance = QPdfApi.Native.Init();
        var result = QPdfApi.Native.RunFromJSON(json);
        var warning = QPdfApi.Native.MoreWarnings(instance);
        var hasError = QPdfApi.Native.HasError(instance);
        if (hasError)
        {
            var error = QPdfApi.Native.GetErrorFullText(instance);
        }

But hasError always gives me a false but I guess that is because the pointer I have got from Init is not the same as where the RunFromJSON (that calls qpdfjob_run_from_json) point to

The qpdf-c.h and qpdfjob-c.h APIs are disjointed. Being able to trap stdout, etc., is definitely on the roadmap. Sorry if the qpdfjob API seems bare. It is really just a json wrapper around passing command-line arguments and is just slightly tighter integration than communicating with qpdf as a subprocess. So right now it doesn't really do enough for a full qpdf wrapper into another language except for stuff that could be done with the CLI. Your questions are helpful in letting me know what the priorities should be though. A few of the other items I'd like to consider are

Making sure json output can replace all the calls that currently print information to stdout (--check, --show-object, --show-linearization`, etc.)
Custom progress reporter
Some kind of interface for replacing objects (maybe)
Possibly json output mode instead of stdout/stderr
Job chaining -- essentially the ability to do something that would cover multiple qpdf commands, though you can often combine multiple operations

This is not terribly high priority. There are two big things in front of it: JSON v2 (full bidirectional serialization/deserialization between PDF and JSON) and a higher-level document manipulation API that I will probably reimplement much of QPDFJob on top of. This in turn clears the way for supporting many more document-level features in page splitting, which are by far the most requested features.

So that I understand it correctly
Making sure json output can replace all the calls that currently print information to stdout (--check, --show-object, --show-linearization`, etc.)
So at the moment these commands sent nothing to the console?

Is it possible for you to add this as a temporary solution so that I can get the output from qpdf. I tried every possible solution in C# but am not able to get the output from the console.
https://stackoverflow.com/questions/2513312/nunit-does-not-capture-output-of-stdcerr

@Sicos1977 You are asking for capture of stdout/stderr? How would you want the feature to work? What I had in mind was that it would be possible to pass in a function that would take (char const* data, unsigned int len, QPDF_BOOL error) that would be called for errors. It's not a quick change as it would potentially touch every place in the code where an error or output might be generated, and it's not something I would release before qpdf 11 because I have made major code changes that are ABI breaking that would make it very hard for me to release anything in the 10.x series. I'm not committing to the exact specification above, but that's the general idea of what I had in mind. I will have to make something that is possible to implement and that can work well with the C and C++ API.

The problem I have now that most methods works, but for example the Check method dumps all the information to the console (stdout) and errors are going to (stderr). For some reason visual studio 2022 can capture them but what every I try myself to capture both those streams I always end up with an empty string.
I tried all different kind of solution I found with Google but so far no luck. The only quick solution that I found is the one that is mentioned on stackoverflow. I tried to add it myself but I even can't get the code to build on my Windows 11 system.
What they mention on stack trace is to replace the output en error stream and then they get the output like this.
public static class Redirector
{
    // PRIVATE ------------------------------------------------------------
    private const String LibraryName = "MyCpp.dll";

    [DllImport(LibraryName, CharSet = CharSet.Ansi)]
    private static extern IntPtr getCerr();

    // PUBLIC -------------------------------------------------------------
    [DllImport(LibraryName, CharSet = CharSet.Ansi)]
    public static extern bool Redirect();

    [DllImport(LibraryName, CharSet = CharSet.Ansi)]
    public static extern void Revert();

    [DllImport(LibraryName, CharSet = CharSet.Ansi)]
    internal static extern void freeCharPtr(IntPtr ptr);

    public static string GetCerr()
    {
        IntPtr temp = getCerr();
        string result = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(temp);
        freeCharPtr(temp);
        return result;
    }
}

That seems to be a quick temporary fix before implementing a solid solution. I'm still looking if I can get the output another way but I have no idea how Visual Studio manages to capture it.

Can you tell me with what tool qpdf is written? I tried to search for a project file in the sources but did not find any that I know.

@jberkenbilt : I don't know if this message is also for Windows users
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
  message(FATAL_ERROR "
Please build with cmake in a subdirectory, e.g.
 mkdir build
 cmake ..
 cmake --build .
Please remove CMakeCache.txt and the CMakeFiles directories.")
endif()

But on Windows it needs to be
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
  message(FATAL_ERROR "
Please build with cmake in a subdirectory, e.g.
 md build
 cd build
 cmake ..
 cmake --build .
Please remove CMakeCache.txt and the CMakeFiles directories.")
endif()

When switching to release mode it builds without any problems... so it has something todo with debug mode.

It's in the docs -- the external-libs release with qpdf only supports release mode. Debugging runtimes are not redistributable. If you need debugging versions, you will have to obtain debugging versions of the external libraries or build them yourself. For debugging purposes, you can get by with native crypto. qpdf's native crypto implementation is at functional parity and has no known vulnerabilities, but it isn't as performant as the external libraries and is considered a security risk because it won't benefit from security fixes in the external libraries which get more scrutiny than qpdf. (There may come a day when qpdf will require external crypto if I ever implement digital signature support, which I hope to do.)

At the moment I'm trying to add a new method to the library to see if I can make my C# code work with that. I tried to return a parameter by reference.
int
qpdfjob_run_from_json_with_result(char const* json, char const*& cout_result, char const*& cerr_result)
{
    std::streambuf* old_cout_stream_buf = std::cout.rdbuf();
    std::streambuf* old_cerr_stream_buf = std::cerr.rdbuf();

    std::ostringstream stream_cout;
    std::cout.rdbuf(stream_cout.rdbuf());
    std::ostringstream stream_cerr;
    std::cerr.rdbuf(stream_cerr.rdbuf());

    QPDFJob j;
    try {

        j.initializeFromJson(json);
        j.run();

    }
    catch (std::exception& e) {
        std::cerr << "qpdfjob json: " << e.what() << std::endl;
        return QPDFJob::EXIT_ERROR;
    }

    const std::string& cout_tmp = stream_cout.str();
    cout_result = cout_tmp.c_str();
    const std::string& cerr_tmp = stream_cout.str();
    cerr_result = cerr_tmp.c_str();

    std::cout.rdbuf(old_cout_stream_buf);
    std::cerr.rdbuf(old_cerr_stream_buf);

    return j.getExitCode();
}

    QPDF_DLL
    int qpdfjob_run_from_json_with_result(char const* json, char const*& cout_result, char const*& cerr_result);

It gives a compile error and after searching on Google I did read that references are not supported in C so I think that is the reason.
Do you have soms tips about how to do this and otherwise I try to make some other solution tomorrow because it is already 10PM overhere.
What I hope to achieve is that I can return the result from cout and cerr this way as a quick fix until a better solution is made.

C has pointers but not references, so this would have to be char const** cout_result. I doubt I would accept a pull request that does this though. I don't think the qpdf library should provide a solution that allocates and copies a potentially very large amount of memory, which could happen if someone wants to write a PDF file to stdout, and I'd have to give this some more thought before committing to a specific API.
That said, implementing such functionality from C++ would be fairly easy. Using QPDFJob::setOutputStreams takes std::ostream*. It would be possible to pass pointers to std::ostringstream objects. You could write a function something like this (not tested):
#include <qpdf/QPDFJob.hh>
#include <qpdf/QUtil.hh>
#include <sstream>

extern "C" int
qpdfjob_run_from_json_with_result(
    char const* json, char const** cout_result, char const** cerr_result)
{
    int result = 0;
    std::ostringstream cout;
    std::ostringstream cerr;
    QPDFJob j;
    j.setOutputStreams(&cout, &cerr);
    try {
        j.initializeFromJson(json);
        j.run();
        result = j.getExitCode();
    } catch (std::exception& e) {
        std::cerr << "qpdfjob json: " << e.what() << std::endl;
        result = QPDFJob::EXIT_ERROR;
    }
    *cout_result = QUtil::copy_string(cout.str());
    *cerr_result = QUtil::copy_string(cerr.str());
    return result;
}

cout_result and cerr_result would be initialized to dynamically allocated memory that would have to be freed with delete[] so you might have to write something like
extern "C" void
free_string(char const* str)
{
    delete[] str;
}

to which you would have to pass the cout_result and cerr_result pointers. Note that you would pass the address of the pointers to the first function and the pointers themselves to the second function. It would also be possible to allocate the string with malloc by adding a new `QUtil`` method along with the other three styles of string copiers.
I'm not totally opposed to this, but I'd rather come up with an interface that would be safer and more responsive than put this in the library. But maybe it can get you unstuck.

Thanks you are a life safer, that was exactly what I needed. I agree that it is better to have somethink like the way how Ghostscript does it but that is way to difficult for me to implement it myself. What I said... it is yearssss ago since I have written something in C or C++ and yes I can read and somewhat understand wat qpdf is doing but it would take me forever to implement something.

For the moment this will do fine.

I now implemented it like this
int
qpdfjob_run_from_json_with_result(char const* json, char const** cout_result, char const** cerr_result)
{
    int result = 0;

    std::ostringstream cout;
    std::ostringstream cerr;
    QPDFJob j;

    j.setOutputStreams(&cout, &cerr);

    try {
        j.initializeFromJson(json);
        j.run();
        result = j.getExitCode();
    }
    catch (std::exception& e) {
        std::cerr << "qpdfjob json: " << e.what() << std::endl;
        result = QPDFJob::EXIT_ERROR;
    }

    *cout_result = QUtil::copy_string(cout.str());
    *cerr_result = QUtil::copy_string(cerr.str());
    return result;
}

void
qpdfjob_run_from_json_with_result_free_string(char const* str)
{
    delete[] str;
}

Releasing the memory with free_string seems not needed in C# there is a method that does the same called Marshal.FreeCoTaskmem
In C# my method now looks like this and is working fine.
    #region Run
    /// <summary>
    ///     Runs the job with the given parameters
    /// </summary>
    /// <returns>
    ///     <see cref="ExitCodes" />
    /// </returns>
    public ExitCodes Run(out string output)
    {
        var settings = new JsonSerializerSettings
        {
            DefaultValueHandling = DefaultValueHandling.Ignore,
            Formatting = Formatting.Indented
        };

        settings.Converters.Add(new StringEnumConverter());

        var json = JsonConvert.SerializeObject(this, settings);

        var result = QPdfApi.Native.RunFromJSONWithResult(json, out var outPointer, out var errorPointer);

        var outResult = Marshal.PtrToStringAnsi(outPointer);
        var errorResult = Marshal.PtrToStringAnsi(errorPointer);

        Marshal.FreeCoTaskMem(outPointer);
        Marshal.FreeCoTaskMem(errorPointer);

        //output = builder.ToString();

        output = string.Empty;

        return result;
    }
    #endregion

The only things that I seem to be missing are the warnings. But that will be something to look into for tomorrow... already to late here.

Is there a reason that the exception details do not get into the cerr stream? Is that because of pointers?

It's because the exception should be cerr, not std::cerr.

Yes that solved it... now I understand it was writing the error to the default cerr stream instead of the one I needed to get it returned.

Really have to get used to the way C and C++ is doing its things compared to C# :-)

In spite of having worked in a wide range of languages, I have never used C#.

In spite of having worked in a wide range of languages, I have never used C#.

There are just to many programming languages and ways to solve the same problem.
I gave it up years ago to get good in every kind of programming language and did stick with c#

The only things that I seem to be missing are the warnings. But that will be something to look into for tomorrow... already to late here.

Do you also have some hints for me about how to get these warnings into cerr or cout?
I see that this code produces those errors but have no idea how they end up in the console in the end
            if (length != h_length) {
                errors.push_back(
                    "shared object " + QUtil::int_to_string(i) +
                    " length mismatch: hint table = " +
                    QUtil::int_to_string(h_length) +
                    "; computed = " + QUtil::int_to_string(length));
            }

I manged to get them by adding the last line in the code below
void
QPDFJob::run()
{
    checkConfiguration();
    std::shared_ptr<QPDF> pdf_ph;
    try {
        pdf_ph = processFile(m->infilename.get(), m->password.get(), true);
    } catch (QPDFExc& e) {
        if ((e.getErrorCode() == qpdf_e_password) &&
            (m->check_is_encrypted || m->check_requires_password)) {
            // Allow --is-encrypted and --requires-password to
            // work when an incorrect password is supplied.
            this->m->encryption_status =
                qpdf_es_encrypted | qpdf_es_password_incorrect;
            return;
        }
        throw e;
    }
    QPDF& pdf = *pdf_ph;

    pdf.setOutputStreams(this->m->cout, this->m->cerr);

How does this exactly work --> https://qpdf.readthedocs.io/en/stable/cli.html?highlight=ranges#option-show-object
Are there a fixed kind of object that I can put in an enum or can it be anything?

Yes, good catch on the output streams. I think this is the correct fix, but I will want to add some tests.
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc
index b8d91b69..af7a7c38 100644
--- a/libqpdf/QPDFJob.cc
+++ b/libqpdf/QPDFJob.cc
@@ -703,6 +703,7 @@ QPDFJob::getEncryptionStatus()
 void
 QPDFJob::setQPDFOptions(QPDF& pdf)
 {
+    pdf.setOutputStreams(this->m->cout, this->m->cerr);
     if (m->ignore_xref_streams) {
         pdf.setIgnoreXRefStreams(true);
     }

How does this exactly work --> https://qpdf.readthedocs.io/en/stable/cli.html?highlight=ranges#option-show-object
Are there a fixed kind of object that I can put in an enum or can it be anything?

It is either trailer or a numeric object or object,generation to name an object in the PDF. This is a basic aspect of PDF structure. A good tip for understand how things are to be used is to look for them in the test suite. qpdf's test suite is extremely thorough and should exercise the full functionality of the library and CLI.

If you are curious about what I'm doing in C#, here you can find what I have made so far .. the most options are in the Job class --> https://github.com/Sicos1977/QPdfNet/blob/main/QPdfNet/Job.cs
The more advanced options I still have to add because that requires me to build classes for them. You can see some examples overhere that I already made to encrypt PDF's --> https://github.com/Sicos1977/QPdfNet/tree/main/QPdfNet
Another thing wat I think is missing is the NoWarn option in the qpdfJob class.. When I set it I still get the warnings so I think this option is not passed to the PDF object

A fix for the not passing cout/cerr is in CI. I'm not sure what you mean about NoWarn. As far as I can recall, there is no such option for QPDFJob other than just as part of the regular config. Are you saying config()->noWarn() doesn't work? That option only disables warnings about the PDF. It doesn't disable usage warnings, etc.

What I mean is this. When I run my test.pdf file I now get the following:
This is the output with WARNING: lines

With the .NoWarn option I would expect for those lines to disapear... or am I making a wrong assumption?

--no-warn
Suppress writing of warnings to stderr. If warnings were detected and suppressed, qpdf will still exit with exit code 3. To completely ignore warnings, also specify --warning-exit-0. Use with caution as qpdf is not always successful in recovering from situations that cause warnings to be issued.

WarningExit0 works as expected (_warningExit0)

These are linearization warnings. Most likely the issue is that linearization warnings aren't treated in the same way, in spite of the WARNING prefix, because linearization checks are only run when specifically requested (via --check or --check-linearization or perhaps --show-linearization) and are otherwise ignored. Combining --check with ``-no-warnseems like an odd usage pattern. All linearization errors are considered warnings since qpdf doesn't depend on correct linearization tables for any operation, so combining--checkwith--no-warn` would always suppress any useful information from linearization checks. The linearization checks follow probably the oldest code path in qpdf that hasn't been updated. It would be good to rewrite it, but it's low priority.

I have no problems with it that the warnings don't go away but just was making unit tests and ran into that issue. Since I never used qpdf before with those options I didn't know what to expect... so I was wondering if I did something wrong.

Is it possible to add a section on the qpdf github page so that they know there will be C# wrapper for it?
For example a section... Other language bindings ... or something like that.
https://github.com/Sicos1977/QPdfNet

Do you have an example somehere how the json will look like for the pages option?
https://qpdf.readthedocs.io/en/stable/cli.html#option-pages

Nevermind... have to read :-) ... guess that is part of the pages option :-)
{
  "inputFile": "infile.pdf",
  "outputFile": "outfile.pdf",
  "pages": [
    {
      "file": "."
    },
    {
      "file": "other.pdf",
      "password": "x",
      "range": "1-5"
    }
  ],
  "encrypt": {
    "userPassword": "user",
    "ownerPassword": "owner",
    "256bit": {
      "print": "low"
    }
  },
  "objectStreams": "generate"
}

At the moment I'm making unit test and want to say how well your json implementation works... very nice work that you did here.

As you unit test, keep in mind that things like the exact wordings of qpdf messages may change from version to version. They are fairly stable, but if I were to do something like clean up the linearization warnings or change the internal error message API (which I intend to do before qpdf 11) and clarify/reword messages, these things could change. As always with writing wrappers, you should try to make sure your unit tests are testing your wrapper rather than testing qpdf through your wrapper. Having some dependency on qpdf will be unavoidable, but you will want to try to see if you can minimize the impact of new qpdf versions on your tests.
Regarding mentioning your project from the qpdf docs, what I've done is to create a wiki page and listed it there. I'd consider mentioning it in the manual if it becomes a mature, fully-featured C# interface for qpdf the way pikepdf is for Python, but I don't think that's actually a goal. In any case, I have added a link to the wiki page, so people reading the section in the qpdf manual about using qpdf from other languages can discover it.

Thanks, that is a good solution adding a wiki page. I'll just want to avoid that people try to reinvent the same wheel more then once because I know how much work it can be to write something "simple" as a wrapper around another library.
I also don't mind if there are some breaking changes in the json interface, that is something you sometimes can't avoid and that is because I'm making unit test to make sure that I detect breaking changes before releasing a new package.
It is also not a problem if the versions get somewhat out of sync because I include a compiled version of qpdf in the .net package that I'm going to release on nuget (because I also modified the json interface somewhat to get back everything from cout and cerr) so that people just have to install the package in there C# ide and have everything they need.
I also want to include some more advanced options in the C# nuget package but the current to be released package is a good starting point for most people if they want to do the basic things. Making wrappers from C# to C++ sometimes can be very difficult because of the different object types you have between both programming languages. I find is sometimes very difficult to marshal object from C# to C++ because of the ways interfaces are made in both languages, very often they are simular but makes it a hell of a job to make them work without crashing,

I copied some information from the read.me on your GitHub page to my GitHub page, hope you don't mind. If you do then let me know and I will remove it. It is just to point people in the good direction if they are looking for more information about QPDF

No objections -- you don't need my permission to copy from/reference my readme in yours.

Why does the check method needs an output file?
The manual says --> Check the file’s structure as well as encryption, linearization, and encoding of stream data, and write information  about the file to standard output
Is the standard output not just writing to the console?

When using this code in my test project
            var job = new Job();
            var result = job.InputFile(Path.Combine("TestFiles", "withattachment.pdf"))
                .ShowAttachments("20_pages.pdf")
                .Run(out var output);

I would expect that the attachment is written to the redirected output stream but instead it is written to cout. So I suspect that somewhere the redirection of the error and output streams is not set.

I think the problem is in this code
    QPDFEmbeddedFileDocumentHelper efdh(pdf);
    auto fs = efdh.getEmbeddedFile(m->attachment_to_show);
    if (!fs) {
        throw std::runtime_error(
            "attachment " + m->attachment_to_show + " not found");
    }
    auto efs = fs->getEmbeddedFileStream();
    QUtil::binary_stdout();
    Pl_StdioFile out("stdout", stdout);
    efs.pipeStreamData(&out, 0, qpdf_dl_all);

Yes, please create a separate issue for that.

It's not a trivial fix because of FILE* vs. std::ostream. I'll probably have to add a new pipeline.

Okey I did make a new issue

I'm trying to remove an attachment from a PDF file like this
{
  "inputFile": "TestFiles\\withattachment.pdf",
  "outputFile": "test.pdf",
  "removeAttachment": [
    "20_pages.pdf"
  ]
}

But get this error, I guess the json is wrong but what does QPDF expect to get?
qpdfjob json: JSON handler: value at .removeAttachment is not of expected type

When running this json command
{
  "inputFile": "TestFiles\\20_pages.pdf",
  "outputFile": "output.pdf",
  "overlay": {
    "file": "TestFiles\\test.pdf"
  }
}

I would expect all the 20 pages to have the overlay but only the first page has it.
output.pdf

That is all I found with my unit test, for the rest everything is working according to the manual.

It's a bug that removeAttachment doesn't take an array. Thanks for catching that. I guess I don't have any test cases for that specifically. I'll check to see if any other repeatable options are not correct.
The overlay/underlay is working according to expectation, assuming your test.pdf has one page. Perhaps the documentation needs to be clarified? The "to" argument restricts which pages of the output to apply the overlay to but doesn't otherwise change the behavior that overlay stops when the source file runs out of pages unless "repeat" is given.

It's a bug that removeAttachment doesn't take an array. Thanks for catching that. I guess I don't have any test cases for that specifically. I'll check to see if any other repeatable options are not correct.

I made a new issue for this bug.

The overlay/underlay is working according to expectation, assuming your test.pdf has one page. Perhaps the documentation needs to be clarified? The "to" argument restricts which pages of the output to apply the overlay to but doesn't otherwise change the behavior that overlay stops when the source file runs out of pages unless "repeat" is given.

You are right, the test.pdf has only one page.

I just released a first nuget package for C# so that people can use QPDF from C# .NET. You can find it over here --> https://www.nuget.org/packages/QPdfNet/


Add locale to EdgeContext

Adds a locale struct to edgecontext containing a locale code. This will allow non-edge services to provide localized content.
This will be set using the accept-language headers provided by clients.

@fishy @spladug @pacejackson Tagging y'all for review

Thanks for the reviews! What's the process for getting this shipped?


Remove misleading note about dotnet 1.0.1

This is a continuation of #1801. I had to resubmit as a new PR since making my rivate repo public unlinked it from the powershell/powershell repo.

Hi @mwrock, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by Microsoft and real humans are currently evaluating your PR.
TTYL, MSBOT;

LGTM.


Large body of water doesn't show up in TX

Reported to mapzen; https://github.com/tilezen/vector-datasource/issues/1383

This was fixed some time ago.


documentation improvements

See Issue #34

Error is unrelated, but something we need to address anyway. I'll merge.

I don't follow. Which errors are unrelated to what?

Check out the "Checks" tab.

Oh gotcha. I thought you were referring to wrote I wrote in the documentation.


Ticks occasionally broken

As per Cynx#4715 on Discord

Ticks that "work" will have the name of the player above them show up during their initial animation. These will behave normally.
Broken ticks spawn with no name, explode as soon as the animation is done, but still do damage (to enemies only ofc), but will not give credit to the person throwing them if they kill someone.
Broken tick kills do show up in the killfeed with the name of the user being "Tick" in blue, meaning it's on the same team as the person throwing them but clearly not "belonging" to them. i.e.
Tick [Tick Explosion] Enemy
The problem seems to show up more consistently in some servers, but no servers will NEVER have this issue, meaning it's a gamble every time you throw one no matter what server. Sometimes I'll throw 5 ticks in a row and all of them will "break", exploding on wake animation end, other times 4 of them will work just fine, but it's almost never perfect.
To reiterate: I DEFINITELY saw this issue happen in vanilla servers, and I don't remember which vid exactly but I remember uploading something a while back (b4 N*) that illustrated this happened in vanilla.

Found a reliable way to replicate this: seems like it happens when cooking a tick for ~7 seconds and throwing it while mid-air
https://github.com/user-attachments/assets/51028272-beba-4993-9fc9-cfcdc333f713

Seems like this stat is the problem

Either increasing this stat, or setting it to 0 ( like the pulse blade does ) fixes this
https://github.com/user-attachments/assets/306fc2ae-8fdc-4ed3-855e-ab4285a5b0aa


Forking Launcher

Forking Launcher
Status
<< READY FOR REVIEW >>
I will be running this in production at TableCheck for a few weeks in the meantime where we process 100,000+ jobs of all kinds per day (mailers, SMS, payments, search indexing, etc.) across many worker servers.

[x] Test script/delayed_job (daemon mode) in production
[x] Test script/delayed_job (forking mode) in production
[x] Test Rake task (single worker) in production
[x] Test Rake task (forking mode) in production

What does this PR do?
This PR makes two "Launcher" modes for Delayed Job:

Current / default: use the Daemons gem to run as detached background progresses
New: run with new --fork option to fork workers from parent process in the foreground.

"Fork mode" will only fork when using more than one worker, i.e. set by the --number-of-workers or --pools args. If only one worker, it runs a Delayed::Worker in the same process without forking.
This PR is a redux of https://github.com/collectiveidea/delayed_job/pull/615.
Why?
It makes it much easier to use Delayed Job inside containers (Docker, etc.).
Using daemons has several undesirable behaviors when running inside a container:

The parent process spawns a background child process then exits immediately,
which causes the container to shutdown.
The worker processes are detached from the parent, which prevents logging to STDOUT.

The new --fork option solves this by running workers in a foreground process tree.
When using --fork the daemons gem is not required.
Installing
I've added a new Delayed::Command#launch method. My intention is to switch to this in the generator for new installs in the next major version, because really forking should be the default and daemons should be a special option, especially in our increasingly container-based world. Here's what it looks like:
# uses daemonize by default, but allows `--fork` switch to override
Delayed::Command.new(ARGV).daemonize

# uses fork by default, but allows `-d` / `--daemonize` switch to override
Delayed::Command.new(ARGV).launch

Limitations
Fork mode does not yet support restart, stop etc. commands; it is always assumed to be start. You can gracefully stop it with SIGINT or SIGTERM. Commands can be added in a future PR.
About the Refactor
I split off the code in Delayed::Launcher::Daemonized from Delayed::Command. Following the SRP, Delayed::Command is now only responsible for parsing the CLI args, and the Launcher class is responsible for actually running the app. From there, I wrote a Delayed::Launcher::Forking class, but in the end I discovered much of the code can be shared with the Daemonized class, so I extracted out a Delayed::Launcher::Base parent class for both Launcher types.
A nice side effect of this PR is that we can now connect the Rake task to the Launcher rather than to the Worker class, and enable things like multiple workers and pools on Rake. (Rake and script/delayed are now unified; this is something which was always mysterious to me as a long time user.)
Extras
This PR includes #1139 (fix tests) and #1140 (cleanup README.md).
In addition, there are several quality of life improvements added to the Command script:

Command: Add --pools arg as an alias for --pool, and allow pipe-delimited pool definitions
Command: Add --num-worker arg as an alias for -n / --number-of-workers (and deprecate --number-of-workers)
Command: Pool parsing code has been extracted to PoolParser class
Command: Add -v / --verbose switch which sets quiet=false on workers
Command: Add -x switch as alias for --exit-on-complete
Command: Add STDERR warning num-workers less than 1
Command: Add STDERR warning if num-workers and pools both specified (pools overrides num-workers as per existing behavior)
Command: Add STDERR warning if queues and pools both specified (pools overrides queues as per existing behavior)
Command: Add STDERR warning if min-priority is greater than max-priority
Command: Add full RSpec coverage

The Rake script has also been enhanced:

Rake: Uses Forking launcher under the hood
Rake: Add support for NUM_WORKERS and POOLS args
Rake: Validate various parameters same as Command above
Rake: Add full RSpec coverage
Rake: Rename file from delayed/tasks.rb to delayed/tasks.rake to make testing easy. (Rake require_rake_file method doesn't play nice with .rb files)

I'd be happy to split some of these into extra PRs but given the amount of spec coverage I've added it's probably fine to merge as is.

@albus522 can you review the code on this PR? I'd like to ask about the general direction and whether you'd consider merging this.

@albus522 what steps can I take to get this merged?

@albus522 thank you for your feedback.
Can you please take a quick look at PRs #1139 (CI fix) and #1140 (Changelog)? From there I'll be happy to break this one into a series of smaller PRs.

Update: we are now running this branch at (TableCheck)[https://www.tablecheck.com/en/join/] in production, serving 100,000+ jobs per day.

Update: we've now run this branch continually for one month with no issues.

@albus522 if you are unavailable to help get this merged, would it be possible to designate someone else in the Delayed Job community to review? I'll be glad to break this in a series smaller PRs, but I need someone to give me a reasonable amount of attention to do that.

@johnnyshields Will this new fork method also work for JRuby applications? I'm currently converting an app to use JRuby and cannot run script/delayed_job becausedaemonize does not work in JRuby.
If yes, then it would be nice if I can configure the paths for pids and log files using ENV or an external config file. My JRuby app will be packaged using warbler so any writing to files must be done outside the Rails project directory... hence the need for configurability. (Not sure if delayed_job already does this as I'm currently looking into it.)

@hmistry I don't know, you'll have to try it. If JRuby supports fork then yes.

@hmistry you can try this gem: https://github.com/headius/forkjoin.rb
However, if daemonize doesn't work (it uses fork) then this also probably won't work.

@johnnyshields Got it. Thank you I'll take a look at the gem. JRuby doesn't support forking processes so based on what you said, doubt this will work. Sidekiq might be better option however it requires engineering effort... will consider it if we can't find a solution with DJ.

@albus522 do you think you might be able to spend some time on this (or designated someone else to help review)? Since we've added this patch at my company we've cut our AWS bill for Delayed Job by about $5,000 / month (running on Kubernetes). Think lots of folks will benefit from it.

@albus522 pinging on this. Do you think you'll be able to carve out some time to help review this? As stated previously I'm happy to break it into a series of smaller PRs that can be merged in sequence.
We've been using this in production for months and it has been working like a charm.

@albus522 ping on this. We've processed literally billions of jobs by now on this branch and its working without a hitch.

This is super useful for debugging.

@johnnyshields I'm a bit confused, how does one use --fork and have the process in the foreground with --pools? The forking code checks for worker_count > 1 https://github.com/collectiveidea/delayed_job/blob/dfa5561b0f220f0eb08104aee0aec876047ffa86/lib/delayed/launcher/forking.rb#L13 before it attempts to run a loop for the foreground.
But when --pools is passed as an option, setup_workers -> setup_pooled_workers https://github.com/collectiveidea/delayed_job/blob/dfa5561b0f220f0eb08104aee0aec876047ffa86/lib/delayed/launcher/base.rb#L36 never incrementsworker_count only worker_index
In addition because worker_count is never incremented, Delayed::Worker.before_fork is never invoked, causing
$> bin/delayed_job --fork --pools=mailers:2 start
undefined method `each' for nil:NilClass
/Development/delayed_job/lib/delayed/worker.rb:96:in `after_fork'
/Development/delayed_job/lib/delayed/launcher/base.rb:72:in `run_worker'
/Development/delayed_job/lib/delayed/launcher/forking.rb:74:in `block in fork_worker'
/Development/delayed_job/lib/delayed/launcher/forking.rb:74:in `fork'
/Development/delayed_job/lib/delayed/launcher/forking.rb:74:in `fork_worker'
/Development/delayed_job/lib/delayed/launcher/forking.rb:63:in `add_worker'
/Development/delayed_job/lib/delayed/launcher/base.rb:49:in `block (2 levels) in setup_pooled_workers'
/Development/delayed_job/lib/delayed/launcher/base.rb:49:in `times'
/Development/delayed_job/lib/delayed/launcher/base.rb:49:in `block in setup_pooled_workers'
/Development/delayed_job/lib/delayed/launcher/base.rb:47:in `each'
/Development/delayed_job/lib/delayed/launcher/base.rb:47:in `setup_pooled_workers'
/Development/delayed_job/lib/delayed/launcher/base.rb:36:in `setup_workers'
/Development/delayed_job/lib/delayed/launcher/forking.rb:12:in `launch'
/Development/delayed_job/lib/delayed/command.rb:21:in `launch'
/Development/delayed_job/lib/delayed/command.rb:26:in `daemonize'
bin/delayed_job:5:in `<top (required)>'

for each queue passed.

@chtrinh I think I never got around to completing pools and forking together, or else I never tested that. I think all other functionality besides that (queues, etc.) is well-tested. Would be glad to accept a PR to this branch.

@johnnyshields I ended up going a different way. I changed the binstub by appending loop {} to keep the main process running in the foreground and added some Signal traps to control the daemons that were spawned.

I've managed to run delayed_job in a container (on kubernetes) by just calling bin/delayed_job run  instead of start
that way it does not fork into the background. wouldn't this be enough to do the trick?


Fixes raw templates not downloading

Description

This PR fixes an error where raw template files are not being downloaded

Fixes: #2820
Types of changes

[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] New feature (non-breaking change which adds functionality)
[x] Bug fix (non-breaking change which fixes an issue)
[ ] Enhancement (improves an existing feature and functionality)
[ ] Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):
How Has This Been Tested?

This was tested by adding a raw template to be downloaded from the UI

@blueorangutan package

@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

Packaging result: ✔centos7 ✔debian. JID-1097

i think we should procede with the 4.13 version (#3993) only

@Andrija, Can I close this PR as it is a duplicate of #3993 ?


Let us develop the architecture

Task are:

registration with name and surname
to upload/delete images
to find another user and see there photos
to follow someone
to have a list of followers
an opportunity to delete your followers
an opportunity to delete your own account with all its information.
look at photo closely
write/delete a comment to a photo (contain my main photo, text, date, likes)
like/dislike photo/comments  (see like/dislike amount)
change main photo
change nickname
change password
an opportunity to write to admin with subject choosing

I guess all main entities are

Comment
Like
CommentLike
PhotoLike
Message
Photo
Subject
User

Entities will contain next fields:

User (Id, MainPhoto, NickName, Password, ICollection, ICollection followers, ICollection following, IsAdmin)
Photo (Id, Path, User, ICollection, ICollection)
Comment (Id, User, ICollection, text, date)
Like (Id, User, IsLiked)
PhotoLike : Like (+ Photo)
CommentLike : Like (+ Comment)
Subject (Id, Name)
Message (Id, Text, User, Subject, Date)

Main Window

Registration
AskQuestion
Follow (Following and Followers)
MainWindow
PhotoInside
Search
Setting

all them require VM
Dialogs:

MessageBox OK
MessageBox YesNo

Action for the window

Registration

Log In
Sign Up

AskQuestion

SendMessage

Follow

DeleteFollow

MainWindow

GoHome
Follow
ListOfFollowers
ListOfOllowing
StartSearching
AddImage
AskQuestion
Settings
LogOut
Exit
OpenPhoto

PhotoInside

Like
Dislike
WriteComment
DeleteComment
LikeComment
DislikeComment

Search

Search

Setting

LoadNewImage
ApplyChanges

Photo (Id, Path, User, ICollection(Like), ICollection(Comment))

Will "User" be navigation property with UserId? Maybe add it or it is clear? And the same action with the same cases.

PhotoInside

I think we need also the action that makes the photo closely, maybe very closely. I suggest to name it CloselyPhoto.

Will "User" be navigation property with UserId? Maybe add it or it is clear? And the same action with the same cases.

Can you write a full list of properties that this entities would have?

Will "User" be navigation property with UserId? Maybe add it or it is clear? And the same action with the same cases.

Can you write a full list of properties that this entities would have?

I suggest to change on it:

User (Id, MainPhoto, NickName, Password, ICollection(Photo), ICollection(User) followers, FollowerId(User), ICollection(User) following, FollowingId(User), IsAdmin)
Photo (Id, Path, UserId, ICollection(Like), ICollection(Comment))
Comment (Id, UserId, User, PhotoId, ICollection(Like), text, date)
Like (Id, UserId, User, IsLiked)
PhotoLike : Like (+ PhotoId)
CommentLike : Like (+ CommentId)
Subject (Id, Name)
Message (Id, Text, UserId, User, SubjectId, Subject, Date)

ok, will update them later

is it all?


Media Walet: Network Error while activating Pass from Bundle.

Wallet used<EMAIL_ADDRESS>When Activating Pass from Bundle in Deep Link App, for AQP, One Love, user gets “network error”
The flow is Deeplink App  > Select AQP Link > Launch Bundle > Activate Pass  -- Leads to Network Error
For LOTR and  Flash the flow is
Deeplink App > The Flash > Launch Bundle  -- Bundle launches successfully (There is not Activate Pass step)

The above issues need a fix in the backend. Issues opened: https://github.com/qluvio/elv-master/issues/1135

Applied temporary fix: 57fb23cd3c8e7cfb1f67fcace8f9ca5063451b02
increase page limit to 100. This slows down initial load for accounts with a lot of nfts, but avoids this bug on our demo accounts without changes to the BE, or risky changes on the client (like implementing #4 ).
Leaving open so we fix this the "right" way, so even accounts with hundreds of nfts will still work


question: Change contrast of status line for inactive tab in horizontal split?

Super huge apologies if this is in the documentation and I'm missing it.
When I'm working in a horizontal split, I find that the statusline of the inactive top split isn't contrasted enough with my color scheme and so my eye gets confused as to where the top and bottom split are separated.

I'd like to change the background of the inactive statusline to something like "white" so that it's very contrasted.
I can't find anywhere in the docs that shows how to do this. Can someone point me in the right direction? Or have ideas for a different fix?

It depends on the theme you are using. I would just have a look at how your specific theme is built and see if it can be configured.

thanks @chrisbra! Apologies for the dumb questions here, but I'm not sure what I'm looking for so could use a pointer in the right direction :)
In the screenshot I'm using the rigel airline theme but i'm 1. not committed to that theme at all and 2. not sure what to look for in the theme settings. Searching for "horizontal" and "separator" turns up nothing.
I'd be happy to switch to another theme if you can point me in the right direction as to what setting to look for. I took a look through all of the docs for airline and can't figure out what setting might control this separator even in the default theme.

Honestly, I have no idea how https://github.com/farsil/rigel/blob/master/autoload/airline/themes/rigel.vim is doing the colors. Have a look at the inactive section. That should be it, if i recall correctly.
For the default theme dark, have a look here:
https://github.com/vim-airline/vim-airline/blob/master/autoload/airline/themes/dark.vim#L127-L133
Note, this also contains a bit of documentation.
Thanks.

Awesome, I appreciate the tip. Will work on this this weekend.

Okay I believe those settings are what control the color of the innactive status line but as I was trying to over-write that setting I couldn't get it to work. I'd open up vim with the incorrect status line color, but then if I sourced my .vimrc it'd change to the color I was trying to specify (i.e., it wouldn't load at first, but would change colors once sourcing manualy).
Anyway, I tried debugging that for a while and eventually gave up and switched to a different airline theme. So I'll close this issue :)
Thanks for the help!


net stats: many received TCP packets count as "dropped"

Describe the bug
In the network statistics (net stats shell command), many received TCP packets count as both "received" and "dropped" IP packets.
To Reproduce
Steps to reproduce the behavior:

cd samples/net/dhcpv4_client
change some options:

diff --git a/samples/net/dhcpv4_client/prj.conf b/samples/net/dhcpv4_client/prj.conf
index 1be69e9abd..06d471e703 100644
--- a/samples/net/dhcpv4_client/prj.conf
+++ b/samples/net/dhcpv4_client/prj.conf
@@ -12,8 +12,21 @@ CONFIG_INIT_STACKS=y
 CONFIG_NET_MGMT=y
 CONFIG_NET_MGMT_EVENT=y

-CONFIG_NET_LOG=y
 CONFIG_LOG=y

 CONFIG_SLIP_STATISTICS=n
 CONFIG_NET_SHELL=y
+
+CONFIG_SHELL_LOG_BACKEND=y
+
+CONFIG_USE_SEGGER_RTT=y
+CONFIG_SHELL_BACKEND_RTT=y
+
+CONFIG_NET_TCP=y
+CONFIG_SHELL_BACKEND_TELNET=y
+
+CONFIG_NET_STATISTICS=y
+CONFIG_NET_STATISTICS_USER_API=y
+CONFIG_NET_STATISTICS_PER_INTERFACE=y
+CONFIG_NET_STATISTICS_ETHERNET=y
+CONFIG_NET_STATISTICS_ETHERNET_VENDOR=y

west build --board=stm32f769i_disco
connect to RTT shell (or UART, just not telnet)
observe these stats after net stats reset:

Interface 0x20020b18 (Ethernet) [1]
===================================
IPv4 recv      0	sent	0	drop	0	forwarded	0
IP vhlerr      0	hblener	0	lblener	0
IP fragerr     0	chkerr	0	protoer	0
ICMP recv      0	sent	0	drop	0
ICMP typeer    0	chkerr	0
UDP recv       0	sent	0	drop	0
UDP chkerr     0
TCP bytes recv 0	sent	0	resent	0
TCP seg recv   0	sent	0	drop	0
TCP seg resent 0	chkerr	0	ackerr	0
TCP seg rsterr 0	rst	0
TCP conn drop  0	connrst	0
TCP pkt drop   0
Bytes received 0
Bytes sent     0
Processing err 0

open and close a TCP connection to the telnet port using e.g. nc <IP_ADDRESS> 23
observe the following packets on the wire:

10:46:55.849653 IP <IP_ADDRESS>.34754 > <IP_ADDRESS>.23: Flags [S], seq<PHONE_NUMBER>, win 64240, options [mss 1460,sackOK,TS val 659560615 ecr 0,nop,wscale 7], length 0
10:46:55.849898 IP <IP_ADDRESS>.23 > <IP_ADDRESS>.34754: Flags [S.], seq<PHONE_NUMBER>, ack<PHONE_NUMBER>, win 1536, options [mss 1460], length 0
10:46:55.849947 IP <IP_ADDRESS>.34754 > <IP_ADDRESS>.23: Flags [.], ack 1, win 64240, length 0
10:46:56.451774 IP <IP_ADDRESS>.34754 > <IP_ADDRESS>.23: Flags [F.], seq 1, ack 1, win 64240, length 0
10:46:56.451964 IP <IP_ADDRESS>.23 > <IP_ADDRESS>.34754: Flags [F.], seq 1, ack 2, win 1536, length 0
10:46:56.452014 IP <IP_ADDRESS>.34754 > <IP_ADDRESS>.23: Flags [.], ack 2, win 64239, length 0

observe these net stats:

Interface 0x20020b18 (Ethernet) [1]
===================================
IPv4 recv      4	sent	2	drop	4	forwarded	0
IP vhlerr      0	hblener	0	lblener	0
IP fragerr     0	chkerr	0	protoer	0
ICMP recv      0	sent	0	drop	0
ICMP typeer    0	chkerr	0
UDP recv       0	sent	0	drop	0
UDP chkerr     0
TCP bytes recv 0	sent	0	resent	0
TCP seg recv   0	sent	0	drop	0
TCP seg resent 0	chkerr	0	ackerr	0
TCP seg rsterr 0	rst	0
TCP conn drop  0	connrst	0
TCP pkt drop   4
Bytes received 254
Bytes sent     112
Processing err 0

Expected behavior
4 IPv4 packets are received, 2 are sent, none are dropped.
Impact
This makes it harder to analyze network problems, because many legitimate packages are counted as "dropped".
Logs and console output
N/A
Environment (please complete the following information):

OS: Linux
Toolchain: Zephyr SDK
Commit SHA or Version used: v3.2.0, v3.3.0-rc2

@arbrauns Please give https://github.com/zephyrproject-rtos/zephyr/pull/54711 a try.


Tweak ibex_tracer.sv to build with recent versions of Verilator

These currently fail, complaining about accesses to decoded_str and data_accessed. Verilator doesn't trace through far enough to see that these all come from the same always_comb process and can't race with each other.
This PR switches things so that we update those two variables with a non-blocking assignment on a clock negedge, then use them on the following posedge. It satisfies Verilator, and should be equivalent in any sensible system.

Darn. This ain't gonna work. The cunning trick was to use a non-blocking assignment in always_ff blocks to "thread the needle" and find something that was acceptable to several Verilator versions and Verible too.
But it turns out that VCS doesn't allow non-blocking assignments to dynamic types (here: string). That's quite reasonable of VCS, but it scuppers my grand plan! I'll try to come up with another approach, but I'll drop this PR for now.


Docker git user directory security issue (forced and invalid permission)

Git version:  Latest docker image
Operating system:  Linux (docker)

The git user home directory is world wide readable which is invalid permission by default unix security policy. Usually the ~/git points to the real host user directory so starting up the gogs docker mangles its permission inevitable.
diff --git a/docker/s6/gogs/setup b/docker/s6/gogs/setup
index 40bd82b..a99e6b7 100755
--- a/docker/s6/gogs/setup
+++ b/docker/s6/gogs/setup
@@ -20,4 +20,4 @@ ln -sf /data/gogs/data ./data
 ln -sf /data/git /home/git

 chown -R git:git /data /app/gogs ~git/
-chmod 0755 /data /data/gogs ~git/
+chmod 0750 /data /data/gogs ~git/

So this script has two additional bugs:

the "git" user is hardcoded here
the "git" user forced to the "git" group which can be non-existent or not valid for it

Thanks your feedback!
You can propose a PR to dockerfile if you know what can be improved.


Gavazzi

This #153 is a PITA - inconsistent dates and missing data. But that's good, exposed weaknesses in COSORE code.

Codecov Report

Merging #156 into master will increase coverage by 0.09%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #156      +/-   ##
==========================================
+ Coverage   94.08%   94.17%   +0.09%
==========================================
  Files           8        8
  Lines         676      687      +11
==========================================
+ Hits          636      647      +11
  Misses         40       40

Impacted Files
Coverage Δ

R/utils.R
99.52% <100%> (+0.02%)
:arrow_up:

R/parser.R
95.72% <100%> (+0.02%)
:arrow_up:

R/parse-processed.R
100% <100%> (ø)
:arrow_up:

R/qaqc.R
100% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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


URL in path is assuming full folder path

The plugin works great but when my GitHub url opens it is including my mac's user directory as well causing the URL to be malformed.
Plugin creates this:
https://github.com/gdiindy/gdi-intro-js/blob/master/Users/rweis/sites/gdi-intro-js/lib/handson/handson.css#L12-L19
But the correct URL is:
https://github.com/gdiindy/gdi-intro-js/blob/master/lib/handson/handson.css#L12-L19
It seems to be including the full folder path in the URL (/Users/rweis/sites/gdi-intro-js) which is where I cloned the repo to on my machine.
Is this a setting that I am missing?

@robisio - Sorry for the slow response; I was on vacation.
How comfortable are you poking around in python? This is hard for me to troubleshoot without having access to your local repo. I just tried checking out that project and opening that same file and it worked fine for me. See https://github.com/bgreenlee/sublime-github/issues/80#issuecomment-87261418 for an explanation of how the path is created.
Alternatively, if you send me the output of the git commands listed in that comment above, I can try to figure out what's going on.

I'm having the same issue on Windows. I see 404 pages in my browser in two different forms:
"Github: Open File":
Expected browser URL (which I found by navigating Github): https://github.com/A/B/blob/develop/C/D/E/F/G/file.sql
Actual browser URL: https://github.com/A/B/blob/develop/file.sql
Notice the fully qualified path is missing.
"Github: Open Remote URL in Browser":
Expected browser URL: https://github.com/A/B/blob/develop/C/D/E/F/G/file.sql#L158
Actual browser URL: https://github.com/A/B/blob/developC:/localpath/A/C/D/E/F/G/file.sql
Notice the C:\localpath is included.

Another example from a public repo owned by someone else, rather than one owned by my account or my company's.
Github: Open File:
Expected: https://github.com/eczarny/spectacle/blob/master/Spectacle/Resources/Property Lists/HotKeyNames.plist
Actual: https://github.com/eczarny/spectacle/blob/master/HotKeyNames.plist
"Github: Open Remote URL in Browser":
Expected: https://github.com/eczarny/spectacle/blob/master/Spectacle/Resources/Property Lists/HotKeyNames.plist#L17
Actual: https://github.com/eczarny/spectacle/blob/masterC:/github/spectacle/Spectacle/Resources/Property Lists/HotKeyNames.plist#L17

@markschwarz - see my comment above. Could you help w/ some troubleshooting? I don't have access to a Windows machine right now. See https://github.com/bgreenlee/sublime-github/issues/80#issuecomment-87261418

Here are the outputs I get, assuming the Spectacle repo.  I chose that one because it's neither your nor mine, so Github/Sublime can make no assumptions about namespaces.

view.file_name()
'C:\github\spectacle\Spectacle\Resources\Property Lists\HotKeyNames.plist'

=== Output from git in the git shell:
MSchwarz@MSCHWARZ-TPX230 /c/github/spectacle/Spectacle/Resources/Property Lists (master)
$ ls
BlacklistedApplications.plist  Defaults.plist  HotKeyNames.plist  SpecialHotKeyTranslations.plist  Spectacle-Info.plist
MSchwarz@MSCHWARZ-TPX230 /c/github/spectacle/Spectacle/Resources/Property Lists (master)
$ git ls-remote --get-url
git@github.com:eczarny/spectacle.git
MSchwarz@MSCHWARZ-TPX230 /c/github/spectacle/Spectacle/Resources/Property Lists (master)
$ git rev-parse --show-toplevel
c:/github/spectacle
MSchwarz@MSCHWARZ-TPX230 /c/github/spectacle/Spectacle/Resources/Property Lists (master)
$ git rev-parse --abbrev-ref HEAD
master
MSchwarz@MSCHWARZ-TPX230 /c/github/spectacle/Spectacle/Resources/Property Lists (master)
$
== Here's the same output from cmd.exe.  I expect it's the same as Git's shell, but including to make sure there's no translation going on.
c:\github\spectacle\Spectacle\Resources\Property Lists>dir
Volume in drive C is Windows7_OS
Volume Serial Number is D656-87D4
Directory of c:\github\spectacle\Spectacle\Resources\Property Lists
06/02/15  09:31              .
06/02/15  09:31              ..
06/02/15  09:31               350 BlacklistedApplications.plist
06/02/15  09:31             7,765 Defaults.plist
06/02/15  09:31               821 HotKeyNames.plist
06/02/15  09:31             2,515 SpecialHotKeyTranslations.plist
06/02/15  09:31             1,359 Spectacle-Info.plist
5 File(s)         12,810 bytes
2 Dir(s)  22,145,622,016 bytes free
c:\github\spectacle\Spectacle\Resources\Property Lists>git ls-remote --get-url
git@github.com:eczarny/spectacle.git
c:\github\spectacle\Spectacle\Resources\Property Lists>git rev-parse --show-toplevel
c:/github/spectacle
c:\github\spectacle\Spectacle\Resources\Property Lists>git rev-parse --abbrev-ref HEAD
master
c:\github\spectacle\Spectacle\Resources\Property Lists>
=== Other notes:
I found an issue with Logstash the other day where C:\ and c:\ were causing issues with resolving paths.  https://logstash.jira.com/browse/LOGSTASH-430.  This looks to be VERY similar.  It it a simple case issue in the drive letter?

Thanks for the awesome debugging info! I'm sure the case differences was the problem. I just pushed a fix. Give it a try and let me know.

Thanks!  I'm having trouble being sure the change is active.  This is my
first time working with sublime package code.
I followed instructions at
http://docs.sublimetext.info/en/latest/extensibility/packages.html#overriding-packages,
but I think I'm still not seeing the new code.  I faced Package Control
wiping out my files with a package-control.cleanup marker (
https://github.com/wbond/package_control/blob/master/package_control/package_cleanup.py).
I managed to stop that, but now I think it's simply ignoring my new package
in C:\Users\MSchwarz\AppData\Roaming\Sublime Text
3\Packages\sublime-github.sublime-package\sublime_github.py.  I added a
"blah" string to the end of the relative URL, but it's not appending that
string.
What's a quick/sure way to make sure I'm testing your patch?  I'm glad to
read up if there's a doc you like.
Mark
On Tue, Jun 2, 2015 at 1:22 PM, Brad Greenlee<EMAIL_ADDRESS>wrote:

Thanks for the awesome debugging info! I'm sure the case differences was
the problem. I just pushed a fix. Give it a try and let me know.
—
Reply to this email directly or view it on GitHub
https://github.com/bgreenlee/sublime-github/issues/82#issuecomment-108042817
.

Probably the easiest thing to do is set the auto_upgrade_frequency setting in the Package Control settings to 0, and then restart Sublime.
I just pushed a change that adds a VERSION number. To check, open the sublime console (⌃^), and type:
import sublime_github
print(sublime_github.VERSION)

If you get AttributeError: 'module' object has no attribute 'VERSION', you've got a version of sublime-github from before the VERSION was added. The current version is 118.

OK.  I'll give that a shot tonight or in the morning.  Thanks!
On Tue, Jun 2, 2015 at 3:37 PM, Brad Greenlee<EMAIL_ADDRESS>wrote:

Probably the easiest thing to do is set the auto_upgrade_frequency
setting in the Package Control settings
https://packagecontrol.io/docs/settings to 0, and then restart Sublime.
I just pushed a change
https://github.com/bgreenlee/sublime-github/commit/9c7eb8ac99a232913352a140da3b9f408cf90050
that adds a VERSION number. To check, open the sublime console (⌃^), and
type:
import sublime_github
print(sublime_github.VERSION)
If you get AttributeError: 'module' object has no attribute 'VERSION',
you've got a version of sublime-github from before the VERSION was added.
The current version is 118.
—
Reply to this email directly or view it on GitHub
https://github.com/bgreenlee/sublime-github/issues/82#issuecomment-108091189
.

It worked!  Thanks!
It took me about 4 reads through https://packagecontrol.io/docs/customizing_packages#Git-Hg_Clone to figure out that git clone to Packages/Users would not do what I wanted, but git clone to Packages/ would.
I also realized that Github: Open was another package, not this one.  I uninstalled it.
"Github: Open Remote URL in Browser" works well now.
Thanks for the fix!

Package Control will automatically update packages on start. The auto_upgrade_frequency setting controls how often it will check. Default is 6 hours.
Thank you for your help!

Hm, ok.  I didn't see your change come through package control last night when I was testing, which I assume was intentional.  It looks like a pull request into packagecontrol.io is needed to push this change out to everyone.  I'll stay on my Github-cloned version.

I pushed a new tag. I think that's all I need to do to get package control to pick it up.

Yes, I see 1.0.1, now.  Thanks!
[image: Inline image 1]
On Wed, Jun 3, 2015 at 12:54 PM, Brad Greenlee<EMAIL_ADDRESS>wrote:

I pushed a new tag. I think that's all I need to do to get package
control to pick it up.
—
Reply to this email directly or view it on GitHub
https://github.com/bgreenlee/sublime-github/issues/82#issuecomment-108546482
.


Why not bump to version 1.0.0?

I work with a lot of teams who have a lot of small node modules all utilizing esdoc because it is pretty awesome for documentation.
I like to keep them up to date using "^x.y.z" so I can get minor package updates automatically. Then every so often upgrade the major when it changes. However, when a module is a pre release such as esdoc it won't autoupdate. I have to manually update it on every release regardless of if it is just a bug fix or something big. When esdoc does update I don't know if it's a breaking change or not since it is a pre release state.
Is there any reason to keep esdoc below 1.0.0? Since people are using it publicly isn't the right move to use 1.x.y and isn't that correct according to semver?
It would give me more information if I could see the major being bumped vs the minor vs the patch/bug fix.

Yes! It is finally 1.0.0+ this can be closed after all these long hard years :-) Thanks everyone!


Troubles with updating chart

I have dinamic data, which are updating from server every 1 second. And when i tried to push it into chart? i have problem with Xaxis.
http://prntscr.com/aog3ln
now i undestand that ur lib can work only with data with min period a day. I need to get some consultation from u to understand how its work.
pls contact me<EMAIL_ADDRESS>

As you have identified the stock scale does not support intra day yet.
I am not available for private consulting now. we can discuss issues/feature requests here, and usage related questions on gitter. I check on gitter from time to time.


Add BMP loading with key color to LOVE runtime

Related to #14.
LOVE has no support for reading BMP files with a key color. There is a BMP reader implemented in Lua, but it's slow and uses a lot of memory. Adding support directly in LOVE could solve these problems, and it would also remove the need to use libvips.

I don't think we need to do this for now, as the setup we have with vips and the pure-Lua BMP loader seems to work okay.


function called when single item clicked

This is really a awsome framework but, right now I need to add a event when user click every single item in the tree. would you help me on it?
I take a look at the source code and have no idea on how to make it. sorry.
Jerry

I just implemented in 0.0.7 a way to get the clicked value in your controller by listening to $ionTreeList:ItemClicked. Get lastest and add to your controller:
$scope.$on('$ionTreeList:ItemClicked', function(event, item) {
  // process 'item'
  console.log(item);
});

I've updated the example website where you can test it as well.
However, if your problem persists (or this fix doesn't fully fit your solution) don't hesitate to contact/reopen this ticket.
Thank you very much for your reporting.


[5.6] Optimize query builder's pluck() method

Proposed by @vlakoff in https://github.com/laravel/ideas/issues/98 and yesterday acknowledged by Taylor...
This refactors the pluck method (and, to stay DRY, the get method) of Illuminate\Database\Query\Builder to no longer rely on object_get internally. As reported in the aforementioned issue, this can become a bottleneck when looping over a large number of results.
I've inlined Collection::pluck and then Arr::pluck, subsequently throwing away any overly generic code that is not necessary in this use case - because we know the data type of query results. Also, we don't need the other features of object_get, such as dot notation and default values.

Please note there are currently two failing tests. This is because the test case sets up mocks as if the PDO fetch mode were still $PDO::FETCH_COLUMN. As far as I can tell, the fetch mode is now hard-coded to $PDO::FETCH_CLASS, so technically the test case could be considered incorrect.
What's the status of fetch code? It seems as if it cannot be changed in full-stack Laravel, whereas it can be changed when using illuminate/database as a stand-alone package (via Capsule).
So please tell me which is the correct way forward:

Change the tests to return stdClass objects.
Change pluck so that it can deal both with arrays and objects.

Even if the second option is preferred, taking care of this change in the tests may be worthwhile as well, as this would make the mocks more realistic (because full-stack Laravel always returns objects).

Thank you for your work on this. Much appreciated.
Ah ah yes, fetch mode has been removed, see notably #17557. Still, users can modify the fetch mode, so currently your code would break with "array fetch modes".
Off the top of my head:

Support object and array, but check has to be outside the loop. Then possibly 2 code branches, each with its loop.
Trim stuff such as "dot nested access" and "wildcards"

Also, keep in mind the PDO::FETCH_CLASS mode (but actually mapping to a user-defined class, not returning simple stdClass): https://github.com/laravel/ideas/issues/98#issuecomment-227718198.
(as a reminder: at some time, laravel was using PDO::FETCH_CLASS to return stdClass instances. It works, but the proper pick should have been PDO::FETCH_OBJ. I've had fixed that since then.)

Can you provide some benchmarks? I believe this kind of changes does not get merged without some kind of benchmarks.

I will gladly do that once I get some official buy-in. ;)

Okay, I refactored a bit, tests are working.
Benchmark
Table with 10885 rows, 1000 iterations
Old method: 21.29s
New method: 11.56s
So, almost 2x speedup.

Strong +1 for this.
Sure there is a bit of added code, but it's not that much, and it's still very understandable. The DB pluck() method is noticeably slow, and I think such a performance boost is clearly worth it.
Also, would you rerun your benchmark with the unlooped is_null() calls? To prove the benefit ;)

@vlakoff I've taken care of your feedback, thank you!
Updated Benchmark
Table with 10885 rows, 1000 iterations
Old method: 22.13s
New method: 10.71s

@franzliedke @vlakoff$foo === null is faster, and safer, IIRC than is_null($foo) :)

Comparing this bench with the previous one, the is_null() unlooping increased the speedup from 1.84x to 2.07x. Which is good to take, let's optimize completely.

@carusogabriel Indeed. If it were up to me, I would definitely use this. But the Laravel codebase uses is_null() everywhere.

Well, since we're not doing it in a loop, this type of micro-optimization won't have any measurable effect anyway.

@vlakoff Maybe is some topic we can put at laravel/ideas.
@franzliedke Isn't micro, we reduce from 3 opcodes to 1, see:

is_null: https://3v4l.org/IZY4D/vld#output
=== null: https://3v4l.org/pPc5k/vld#output

The difference in opcodes is because of (what I think is called) constant folding.
is_null(foo()) gives similar output to foo() === null. The difference being IS_IDENTICAL versus TYPE_CHECK opcodes. It's highly unlikely that this difference matters at all.

Totally like the PR.
But shouldn't we be cautious and rather target master/5.7 with this?

Replying to mfn:

But shouldn't we be cautious and rather target master/5.7 with this?

The change is supposed to be transparent ;-)
If ever it breaks something, postponing the change to 5.7 wouldn't have made it better. In such a scenario, we would have to fix it asap or revert the change if not quickly fixable. Would be the same for any branch.

edit: Applying it to 5.7, it would have some "beta testing" phase, indeed. But as it's not changing the API, I still think it should be applied the soonest (and fixed the soonest, in worst case scenario).

Optimizing pluck (on our own fork) on a project resulted in a previous ~2-minute process optimizing to around 20 seconds.  Glad to see someone has also encountered this as well and raised attention to it.

Thanks. Sorry for the delay :smile:


.Net: Ollama Support Function Calling

Motivation and Context

Resolves #7442

Rather than merging new code for this support, now that OllamaSharp provides an IChatClient implementation, including function calling, should we start looking at this connector as the first to be on the new plan of just having the IChatCompletionService implementation use M.E.AI internally?

I have thought on that, this connector was supposed to be release a while ago and with the recent merges now is possible to do so, will be updating its internals to use Ollama's sharp internally on the examples and maybe only reduce this release to a simple README.md with examples, for community orientation

Closing this PR as it was superseded by

https://github.com/microsoft/semantic-kernel/pull/9488


[WINDOWS] Focus unstable when the pointer leaves the app

Is there an existing issue for this?

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

Steps to reproduce
Code to reproduce
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: const <Widget>[
            Padding(
              padding: EdgeInsets.all(8.0),
              child: TextField(
                decoration: InputDecoration(hintText: "test"),
              ),
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

Steps to reproduce
1- Change focus using TAB key.
2- When the Floating Action Button is focused, leave the window.
3- When you come back, the focus will jump to the Text Field.
Video showing the bug
https://github.com/flutter/flutter/assets/133365709/99bb47cf-715c-40c4-bcc8-25c39d5bb114
Expected results
Focus should stay where it is even if the user leaves the app.
Actual results
Focus weirdly change when the user leaves the window and come back
Code sample
Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: const <Widget>[
            Padding(
              padding: EdgeInsets.all(8.0),
              child: TextField(
                decoration: InputDecoration(hintText: "test"),
              ),
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {},
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
https://github.com/flutter/flutter/assets/133365709/a0fc623c-92be-4f8e-87b1-202eed9b0b79

Logs
Logs
[Paste your logs here]

Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.7.12, on Microsoft Windows [Version 10.0.19044.2965], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.1)
[√] Android Studio (version 4.0)
[√] Connected device (3 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.

Thanks for the report! But this is a known issue being tracked at https://github.com/flutter/flutter/issues/117627. For more information, it is caused by Tooltip inside FloatingActionButton (see a duplicate issue).
Closing this issue as a duplicate, so please follow up on it for further updates.


Always compares to main branch

Bug report
What is the current behavior?
If I have branches
main -> dev -> myfeature
And I use
on: pull_request

in my GHA, and make a pull request into a dev from myfeature, the contents of myfeature are compared to the contents of main, not to the contents of dev, so the PR summary contains all of the work in main.
What is the expected behavior?
It should compare to the base branch, not the main branch.

Have you merged main into your branch? The commit messages are picked straight from the git log up until the latest tag. If that tag isn't present on the branch, it'll pick up more commits than it should.

Also which repo is this occurring for you on?

This may be solved by #17

Image to clarify what I mean. I’ve not checked if this is solved yet but I think perhaps not since the feature/epic branch wouldn’t have a tag after Commit 2 in this diagram?

I think what will happen at the moment is that:

feature/epic will have commits 1 and 2 in its PR description
feature/sub will have commits 1, 2, 3, and 4 in its PR description
When feature/sub is merged into feature/epic, feature/epic's PR description will then contain commits 1, 2, 3, and 4
When feature/epic is then merged into main, the release notes will contain commits 1, 2, 3, and 4

I guess what we want is the above except that feature/sub should only have commits 3 and 4 in its PR? I think I can update the code to do this.


Release to hex

After fixing #6 and merging #4

The package is already on hex, I guess we can close this issue


Find box position resets after changing tabs

VSCode Version: Code 1.18.1 (929bacba01ef658b873545e26034d1a8067445e9, 2017-11-16T18:32:36.023Z)
OS Version: Windows_NT x64 10.0.16299
Extensions:

Extension
Author (truncated)
Version

gitlens
eam
6.3.0

prettier-vscode
esb
0.26.0

vs-keybindings
ms-
0.1.7

Steps to Reproduce:

Open file in VSCode which has a a string repeated in at least two posisions
Ctrl + F to open find box
Search for a string which exists in at least 2 places
Press enter so you are in a position which is greater than 1 (e.g. find box says 5 of 8)
Change to another tab in VsCode
Go back to the initial tab which has the find box open

Expected: find box should be at the same position as before you change tab (e.g if it was at 5 of 10 before changing tabs, it should still be at 5 of 10 when you go back to that tab)
Actual: find box always resets to position 1 of X after changing tabs
I find this issue to be a huge drain on productivity when switching between tabs as I am constantly loosing my scroll position in files. I believe this issue was not there in previous versions which leads me to believe it is a bug.

Reproduces without extensions: Yes

Can't reproduce it here in v1.19.1 on Windows 10. I can not observe any notable change of the widget position.
Can you share a screen recording? Maybe the window position, size etc. also play a role here.

As we don't have more information for troubleshooting, close it for now but we can reopen whenever we have more infos.


Enhancement Request: uv pip install with explicit venv path

Thanks for uv, it's very impressive! :)
Our build system creates and manages a virtual environment that's used for later parts of the build, and to host editably-installed packages that have console script entry points.
To remove complexity (environment variables, python versions, PATH shenanigans) and potential ambiguity, we try to avoid modally entering the virtual environment via activate, and instead invoke pip via the venv's python:
/path/to/my/venv/bin/python -m pip ...
(We do this on mac/linux and also windows, but I'm just using the non-windows forms here)
Right now, uv pip seems to require running inside of a modally-activated venv. It would be very handy if we could give uv pip an explicit path to the virtual environment directory, similar to how uv venv can be given an explicit python interpreter.

Hi! Thank you :)
You can provide the virtual environment path via the VIRTUAL_ENV variable or, if you run python -m uv, we'll automatically detect the virtual environment (#1504).
We may consider adding this as a CLI option too, I think there are a couple other similar issues about that.

Thanks for the quick response, and sorry I missed the VIRTUAL_ENV variable; if I can set that before spawning uv that'll totally work for us. :)

python -m uv is interesting and I think even nicer; would it be interesting to have an option like --seed for uv venv that also installed uv into the new venv? That would handle bootstrapping pretty elegantly, I think.

Hm it seems like yeah we should probably stub uv into the environment by default so that you can use python -m uv. I'm not exactly sure what that would look like.

If the Python uv package uses uv functionality by bundling the executable, it might be nice to have a venv-creation bootstrap copy-in the uv executable that invoked the venv command. That would be nice for pinning versions etc; for a single-file executable like this, we'd version it by just checking it into git.

Tracking that in https://github.com/astral-sh/uv/issues/1632

Ah and here's the other one for the CLI option, going to close this in favor of those https://github.com/astral-sh/uv/issues/1396


feat : port Algebra.Regular.Pow

Maybe I was lucky with my first port to mathlib4 or maybe I missed everything since no changes at all (except replacing Mathbin by Mathlib) were necessary for this port.
I must have done something wrong though since CI is failing in the check import phase and I don't know how to fix it.
Ok, I found out I need to add the file to Mathlib.lean....

bors r+


No such file or directory: '/Users/danil/OneDrive/...'

Hello Danil
I just did a pip install verstack  and when I try to the the NaNImputer, when I get this message.
Using a Jupyter notebook.
The Factorizer file looks a little messed up to me or am I just "holding it wrong"?
FileNotFoundError                        Traceback (most recent call last)
<ipython-input-21-36b05ef79f67> in <module>
     71
     72
---> 73 from verstack import NaNImputer

FileNotFoundError: [Errno 2] No such file or directory: '/Users/danil/OneDrive/Bell/datasets/_traditional/house_prices (rmsle,Id,SalePrice)/house_prices_train.csv'

Sorry for that. I have forgotten to remove the testing code before publishing a release. Now it's all set. Just pip install --upgrade verstack
New version is 2.0.11.

Thanks for the fix and all the work you've done. Much appreciated.
Prior to trying the latest version I deleted the test harness code you'd accidentally left in the Factorizer class and ran it locally like that - it worked ok EXCEPT, it complained about a dependency mlxtend that was missing. I just pip installed that and it all worked fine. I'm guessing  the problem with mlxtend was that it's not listed as a dependency for this package? I don't know much about python or pip so I'm just taking a guess here but you might want to check that at some stage.
Thanks again for all the hard work you've put into this package!

Good call, thank you. Updated dependencies with mlxtend.


Error while running multithreading (object_detection_multilayer.py)

PicklingError                             Traceback (most recent call last)
 in ()
153     child_process.daemon = False
154
--> 155     main_process.start()
156     child_process.start()
157
~\Anaconda2\envs\tensorflow\lib\multiprocessing\process.py in start(self)
103                'daemonic processes are not allowed to have children'
104         _cleanup()
--> 105         self._popen = self._Popen(self)
106         self._sentinel = self._popen.sentinel
107         _children.add(self)
~\Anaconda2\envs\tensorflow\lib\multiprocessing\context.py in _Popen(process_obj)
210     @staticmethod
211     def _Popen(process_obj):
--> 212         return _default_context.get_context().Process._Popen(process_obj)
213
214 class DefaultContext(BaseContext):
~\Anaconda2\envs\tensorflow\lib\multiprocessing\context.py in _Popen(process_obj)
311         def _Popen(process_obj):
312             from .popen_spawn_win32 import Popen
--> 313             return Popen(process_obj)
314
315     class SpawnContext(BaseContext):
~\Anaconda2\envs\tensorflow\lib\multiprocessing\popen_spawn_win32.py in init(self, process_obj)
64             try:
65                 reduction.dump(prep_data, to_child)
---> 66                 reduction.dump(process_obj, to_child)
67             finally:
68                 context.set_spawning_popen(None)
~\Anaconda2\envs\tensorflow\lib\multiprocessing\reduction.py in dump(obj, file, protocol)
57 def dump(obj, file, protocol=None):
58     '''Replacement for pickle.dump() using ForkingPickler.'''
---> 59     ForkingPickler(file, protocol).dump(obj)
60
61 #
PicklingError: Can't pickle <function main_process at 0x000002D485859840>: it's not the same object as main.main_process
I am running this in a virtual environment with each required dependencies ,any information will  be helpful

Hmm it seems that the main function can't be serialized. Not sure why this is the case. Maybe this due to the virtual environment. But usually when we use the Pool class, it uses queue.Queue to pass tasks to the worker process. And everything that goes through the queue must also be pickable/serializable.

What could be done regarding this, i read all documentation regarding pool and proces but problem still persists .Thanks for ur support

Have you tried to use it on a normal machine yet instead of a virtual environment? I would try to isolate the problem and see where it works and where not...

I was using it in jupyter notebook ,i copied the above code ,and test run  through commandline in default .py format and it now started to work ,but it is barely detecting anything.I don't think  there was any problem due to virtual environment , i am still running it in virtual environment. But i am still unable to understand why it dont work in ipython notebook.

Hmm sorry I can't help you much here as well as I don't know how to replicate the error...


feat: add category tags to boi-package

Add category tags to all boi-package

empty: This template only provides peripheral content, such as build layer configuration
thin: This template adds project structure on top of empty, some 3rd party library integration and some sample code
fat: This template provides more sample code (maybe you don't need) based on thin, or implements some basic business

It is placed in the first position of tags and displayed on the CLI

PR #120


404 NotFound in preload(key, fetcher) causes Uncaught (in promise)

Bug report
Description / Observed Behavior
Using preload https://swr.vercel.app/blog/swr-v2.en-US#preloading-data
When preloading resources that responds with 404 NotFound I see an Uncaught (in promise) error in the console.
When fetching the same resource with useSWR the rejected promise is correctly handled and does not emit a console error.
My code
const fetcher = (url: string) =>
  fetch(url).then((r) => {
    if (!r.ok) throw new Error(`${r.status} fetching ${url}`)
    return r.json()
  })

preload(urlToMissingResource, fetcher)

The output
Uncaught (in promise) Error: 404 fetching /api/en/products/109029_100.json
  | fetcher | @ | resources.ts:34
  | preload | @ | index.mjs:584

Expected Behavior
SWR preload should handle rejected promises and not let "Uncaught (in promise)" be logged to console.
Repro Steps / Code Example
See this CodeSandbox that reproduces the issue.
Displays both the error logging behaviour of preload and the expected silent behaviour of useSWR
Additional Context
SWR version: 2.1.0

I think that this could be resolved in one of two ways:
A)
In swr/_internal/utils/preload.ts add error handling to the fetcher call:
try {
  const req = fetcher(key_)
  if (isPromise(req)) req.catch(() => /* do something? */ ) // for async fetchers
  PRELOAD[key] = req
  return req
} catch (e) { // for sync fetchers
  /* do something? */
}

or
B)
Change the return type of preload from any to Data | Promise<Data> which is what preload actually returns if I read the source correctly.
declare const preload: <Data = any>(key_: Key, fetcher: BareFetcher<Data>) => Data | Promise<Data>;
And add documentation that any error handling must be done at the call-site when calling preload


V0.2.0

Fractal Pattern and CSS Modules
v0.2.0 of redux-devshare and devshare
Tests added for main routes/components

Current coverage is 44.02% (diff: 44.96%)

No coverage report found for master at 1b2d1de.

Powered by Codecov. Last update 1b2d1de...1fce67d


Deploy Problem: Does AlphaFold2 working well at AMD 7002/7003 platform？

We are planning to purchase a GPU node to accelerate AlphaFold2 calculations, but we don’t know whether AMD7002/7003 series CPUs can support AlphaFold2 calculations. Can anyone provide advice, is it better to deploy AlphaFold2 with A100GPU and use AMD7002/7003 series CPU or use Intel Xeon Scalable 3 series instand?

AlphaFold should work well on Intel and AMD CPUs, especially since most of the compute-intensive tasks (i.e. the actual folding) happen on the GPU. The MSA search (Jackhmmer, HHBlits) and relaxation (OpenMM) which run currently on CPU and are CPU intensive should both work well on Intel and AMD CPUs.


[BUG] Attempting recurssive debugging breaks debugger.

Trying to @enter while at the debug> prompt leads to the error "ERROR: unlock count must match lock count", and breaks the active debugging session (e.g. the UI buttons no longer work, unable to exit the debugging prompt).
If recurssive debugging isn't intended to be possible, a graceful error that doesn't disrupt the active debugging session would be helpful.

Fixed by https://github.com/JunoLab/Atom.jl/commit/f073c8bf5f22f357811ca22186a1dd1cd2d6e6c0


Java JRE and JDK

Sample here, using CURL but the URLs and methodology should be similar
https://gist.github.com/P7h/9741922

I've added in Java 8 JDK and JRE. May need another solution for Java

It continually get updates, e.g latest is u121.
The path includes some hashed value such as e9e7ea248e2c4826b92b3f075a80e441 - not sure if this changes over time.

Maybe querying the DOM at runtime: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html (though, that also has an issue if the download page changes over time)
note. This also applies to some other resources that have that patch version in the downloads, such as ORDS. So either just keep updating this as new patches come out, or reference the master version and fetch the latest. In ords for example, at the moment I've set it up to specify the full version with patch.


Ideas for a teams Education Starter kit

With schools shutting down due to COVID-19 there is a real need for schools to be able to deliver educational material remotely.
Let’s collect ideas for a starterkit for Teams education.

What should the outcome look like and how would it be distributed?  Were there thoughts already there?  I took a look at this and this already created by Microsoft and I liked them, but wondered if we could be more specific for Elementary, Middle, or High School?  Thoughts have been bouncing around my head around things the the importance of attendance and continued connection with students to make sure they're OK and not just thinking of this as extra vacation.  Maybe step by step examples on posting a read-only assignment that kids can't accidentally edit.  Maybe consider work that could be completed on a mobile phone as some families wouldn't have a full computer at home, or they may need it for their own remote work.  Take a picture of your math work in a Teams chat for your teacher, etc.

it would offer massive extra value if we could package this Corona Crisis Communication Solution (based on SharePoint, PowerAutomate, PowerApps and Teams) into a Starter Kit which is easier to deploy -and translate it (e.g. to German)  https://techcommunity.microsoft.com/t5/microsoft-teams-blog/coordinate-crisis-communications-using-microsoft-teams-power/ba-p/1216715

As mentioned here, there are several challenges.

Having technical readiness
Meeting federal, state and country laws and regulations
Enabling students and teachers
Establish and drive adoption
Governance

Compared to a regular Teams project we do not have much time to define settings. There should be a very easy guidance or technical supporting function, to setup a tenant, Teams and Users for this new experience. Additionally I’d like to see some user (kids, parents, teachers) guidance.

This could become a book, and perhaps it should after this for the next pandemic (another fun project).  I have a fault where I suggest the six ways you could accomplish something rather than just suggesting the one I think is best.  Not sure if others share that fault, but more for myself here: schools are shutting down or have already shut down and need info fast, so pick one and move forward, then perhaps link to others.
That said.  Are we thinking a document?  A website?  A post or series thereof on TechCommunity?

We could go with a very simple website hosted in this org. I think that’s the beat approach to have many authors contributing to a big picture.
We should link as much content as possible to have the information needed for schools and their stakeholders in one place.

Wanted to start thinking of an outline:
Overview and Why Teams? (because you own it, it does what you need, and you need to move now)
Setting Up A Tenant (is the licensing hurdle too far at this point, should this be assumed or an appendix)
Laws and Regulations (we can't do much here, perhaps note that it should be cleared with local boards in the overview?  Are school boards and American thing or a worldwide thing?)
Enabling Students and Faculty (how do they get it?  what platforms? print and email quickstart templates for both? be ready for mobile and web only)
Establish and Drive Adoption (Set expectations of teachers and students at the school level, all teachers need to buy in, have regularly scheduled staff check-ins to discuss what's working and what's not, establish communication with student families outside of Teams)
Governance (One Team per class?  One channel per subject, or keep it simple? Who can edit documents - don't let kids accidentally edit)
Live and Recorded Lesson Guidance
Assignment Posting Guidance
Homework Submission Guidance
Test taking?  Proctoring will be difficult with larger classes.

I'm biased towards American upper-middle class elementary because where technology is abundant because that's where my kids are.  I'm trying to not let that get in the way but it's tough.

A lot of my thinking is centered around higher ed, mostly because that is the environment I live in most of the time. Probably need to think about whether we want to get into detail on the admin side with stuff like School Data Sync (I suppose no with timing being critical), and at least consider that some in edu have locked down Group creation. If nothing else it may be worth a mention so a teacher doesn’t just give up because they can’t create a Team.

Group creation should be available to the teacher group. (Security group)
There should be a org wide team with moderation.
User should not be able to share content outside their school.
School data sync - out of scope for now.

Display names for users should differ: (Teacher) (Student)


Permission ctd

[ ] I added an entry to CHANGELOG.md if knowledge of this change could be valuable to users.

Here is a brief summary of what I did:

 Admin kann Rechte vergeben

bors merge


[Fluent 2 iOS] DateTimePicker + CalendarView update

Platforms Impacted

[x] iOS
[ ] macOS

Description of changes
DateTimePicker and CalendarView have been updated to match their fluent 2 design.
The navigation bar for DateTimePicker is being set by FluentUIFramework. As of now, I have only added functionality to handle the custom nav bar specs for DateTimePicker. The entire class will be updated separately to use tokens instead of Colors in a separate PR.
Verification
All the changes were tested on the demo app.

Before
After

Pull request checklist
This PR has considered:

[x] Light and Dark appearances
[ ] iOS supported versions (all major versions greater than or equal current target deployment version)
[ ] VoiceOver and Keyboard Accessibility
[ ] Internationalization and Right to Left layouts
[ ] Different resolutions (1x, 2x, 3x)
[ ] Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
[ ] iPad Pointer interaction
[ ] SwiftUI consumption (validation or new demo scenarios needed)
[ ] Objective-C exposure (provide it only if needed)

Microsoft Reviewers: Open in CodeFlow

i understand you might be following the design spec, but it seems bit weird the the previous dates are darker and future dates are lighter?  shouldn't selectable date be darker?

please update readme doc on datetimepicker as well

because there is font change, can you do a quick larger text test?

i understand you might be following the design spec, but it seems bit weird the the previous dates are darker and future dates are lighter? shouldn't selectable date be darker?

I agree, it seemed a bit odd but I just defaulted to implementing what design spec'ed. I'll reach out and see what they think.

because there is font change, can you do a quick larger text test?

The contrast ratio issue found is the same as the issue with the activity indicator. Design suggested we ignore this issue until the FG colors are revisited. I have created a design ticket to track the controls currently affected.