Support \operatorname

We should support this so you can do, e.g., \operatorname{span} (see #144). Its implementation is subtler than it may appear:
http://tex.stackexchange.com/a/84308/9

amsopn is the relevant package here, so texdoc amsopn will provide relevant implementation details. \operatorname builds on the more elementary \qopname.
\DeclareRobustCommand{\operatorname}{%
    \@ifstar{\qopname\newmcodes@ m}%
            {\qopname\newmcodes@ o}}%

In the interior of the \mathop we need a null object (we choose a zero kern for minimum waste of main mem) in order to guard against the case where #3 is a single letter; TEX will seize it and center it on the math axis if there is nothing else inside the \mathop atom.

\DeclareRobustCommand{\qopname}[3]{%
    \mathop{#1\kern\z@\operator@font#3}%
    \csname n#2limits@\endcsname}

This command \qopname is in turn used by many definitions, including the \limsup from #111. They tend to have \relax in place of #1. #2 would either be o for \nolimits@ which is \nolimits but eats any \limits that might follow, or it would be m for \nmlimits@ which is \displaylimits, i.e. limits above and below in display mode, but to the right in inline mode.
If we can get our macro expansion to support this kind of command, we'd have access to a lot of built-in definitions with almost no additional work.

amsopn is the relevant package here, so texdoc amsopn will provide relevant implementation details. \operatorname builds on the more elementary \qopname.
\DeclareRobustCommand{\operatorname}{%
    \@ifstar{\qopname\newmcodes@ m}%
            {\qopname\newmcodes@ o}}%

In the interior of the \mathop we need a null object (we choose a zero kern for minimum waste of main mem) in order to guard against the case where #3 is a single letter; TEX will seize it and center it on the math axis if there is nothing else inside the \mathop atom.

\DeclareRobustCommand{\qopname}[3]{%
    \mathop{#1\kern\z@\operator@font#3}%
    \csname n#2limits@\endcsname}

This command \qopname is in turn used by many definitions, including the \limsup from #111. They tend to have \relax in place of #1. #2 would either be o for \nolimits@ which is \nolimits but eats any \limits that might follow, or it would be m for \nmlimits@ which is \displaylimits, i.e. limits above and below in display mode, but to the right in inline mode.
If we can get our macro expansion to support this kind of command, we'd have access to a lot of built-in definitions with almost no additional work.

I think the following code would work for \operatorname:
//////////////////////////////////////////////////////////////////////
// amsopn.dtx

//   \operatorname
// \mathop{#1\kern\z@\operator@font#3}\csname n#2limits@\endcsname}
defineMacro("\\operatorname", "\\mathop{\\text{#1}}\\nolimits");

//////////////////////////////////////////////////////////////////////

That macro gets the spacing correct; it avoids centering a single character; it deals with hyphens correctly.

I'm not really up to creating any Screenshotter tests, but I think the code is ready if someone wants to take it on.

@kevinbarabash, Do you think that this \operatorname macro needs Screenshotter tests? If not, then I could just submit the PR.

I think a screenshot test would be useful in particular so it's easy to run texcmp to compare.  I'm particularly curious about the use of \text -- does \operator@font really switch to text mode, or just a roman font?  E.g., what happens to spaces or math-only operators inside \operatorname?  (Maybe \text should just be \mathrm.)
\def\operator@font{\mathgroup\symoperators}

The purpose of the \text is to prevent a hyphen from turning into a minus. In other words, I'm using \text as a hack to replace<EMAIL_ADDRESS>If \mathrm were to replace \text the screenshot above would render as:

Ah, I see, that makes sense.  What about spaces (do/should they appear in output?) and math-only commands (not sure KaTeX enforces those)?

Well, there are math operators, such as lim sup, that do contain a space, so I suppose we want \operatorname to enable a space. I really hadn't thought much about math-only commands.

lim sup should be lim,sup if I remember correctly.

Image from quicklatex.com for \limsup x

What I meant was, "what does LaTeX do with spaces in \operatorname?"  Unfortunately, the answer is that \operatorname eats spaces, as if in math mode.  So it's not exactly \text mode, but partially...
It still might be worth defining \operatorname in the way you suggest, as a temporary solution, given that it works in most cases...

I very much agree. This macro is meant to be a quick hack, done in time to be included in the next release. It can improved in several ways.

Last evening, I wrote another version of \operatorname. It was a non-macro version written in functions.js that passed a string to groupTypes.op. That version had an improved MathML output and in that version, I could easily delete the spaces. But groupTypes.op will need some remedial work. When I pass a hyphen to it, it returns a minus, complete with operator spacing.
If I can't fix the hyphen problem quickly, is that other version still preferable to this macro?

Okay, new option. This code eats spaces, and it has better MathML output than the macro version. Here's the output:

from: \( \operatorname{g}(z) + 5\operatorname{g}z + \operatorname{gam-ma}(z) + \operatorname{gam ma}(z) \)
The code in functions.js is augmented by:
// \operatorname. No limits, not symbols.
defineFunction("\\operatorname", {
    numArgs: 1,
}, function (context, args) {
    const argArray = args[0].value;
    let opName = "\\";
    for (let i = 0; i < argArray.length; i++) {
        opName += argArray[i].value;
    }
    opName = opName.replace(/\\s/g, "");
    return {
        type: "op",
        limits: false,
        symbol: false,
        body: opName,
    };
});

In buildHtml.groupTypes.op, the line:
output.push(buildCommon.mathsym(group.value.body[i], group.mode));

is replaced by:
output.push(buildCommon.mathsym(group.value.body[i], "text"));

I don't do Screenshotter, but anyone is welcome to make this PR.

I don't do Screenshotter, but anyone is welcome to make this PR.

This makes me sad.  I wish that Screenshotter wasn't a barrier to entry for contributors.  There appears to be a way to run multiple builds on travis with different environment variables.  travis-ci has a way to upload contents of a folder to S3 that I'm investigating.
https://docs.travis-ci.com/user/deployment/s3/

I’m seeing open-source development for the first time and it seems as though the whole process may be held back because it doesn’t have a really good way to put those teams together.

It can definitely be slower than having a dedicated team of people who are being paid to work on a project.

If you find a way to make Screenshotter easier, that’s great, but if you want to do something really brilliant, figure out a way to identify and build a team on demand.

My goals are definitely less lofty than figuring building an on demand team.  I'd like to make KaTeX easier to contribute to and hopefully I can generalize things I learn to other open source projects.

@kevinbarabash I have prepared a PR to support \operatorname, but I am once again having trouble making a commit. I get the error message:

Commit failed - exit code 1 received, with output: 'error: cannot spawn .git/hooks/pre-commit: No such file or directory'

I have tried:

npm install
npm update
deleting the file pre-commit from the hooks folder.
deleting all the files in the hooks folder.

Frustration waxes. Patience wanes. Any suggestions would be welcome.

@ronkok you can skip commit hooks by doing git commit -n.  If we can't figure out why this isn't working on windows we may just disable the hooks.  The various checks get run on travis-ci anyways.  The intent was to save when creating or updating a PR by running the checks locally first.  People can do this manually anyways.
I'm surprised that deleting pre-commit from the hooks folder didn't fix this though.

git commit -n will fix short term.  Be sure to delete pre-commit from .git/hooks not hooks.

Success. Thank you once more.

Having operatorname is great! Are there any plans to add support for operatorname* to enable proper limits in display mode?

Yep. I'll turn in a PR sometime in the next few days.

Thank you very much! Looking forward to that!


corrected spelling of the word "latest"

Earlier simple 'latest' word was written as "lasest', which has no meaning.

Spam

Is lasest a correct word ?

this project is closed and not planned to development it , the project has moved to https://mspcontrol.org/. Find another repository to be counted toward Hacktoberfest

Okay, thank you.


[Bug]: Special chars like \n not escaped

Your minimal.lua config
-- Same as the provided minimal.lua config
Error messages
N/A
Log output
N/A
Health check output
N/A
Describe the bug
Special characters, e.g. \n in the LLM output is not escaped and is inserted as an actual line break in the buffer after applying changes. For example, when I ask CodeCompanion (Claude 3.5 Sonnet backend) to write a bash script for me, it generates:
    if [ "$format" = "json" ]; then
        json_output="{\n"
        json_output+="  \"total_arguments\": $#,\n"
        json_output+="  \"arguments\": [\n"
     ...

However after applying the change to the source buffer using @editor, it becomes:
    if [ "$format" = "json" ]; then
        json_output="{
"
        json_output+="  \"total_arguments\": $#,
"
        json_output+="  \"arguments\": [
"

I noticed that \n is deliberately "unescaped" here https://github.com/olimorris/codecompanion.nvim/blob/efe90f61b05f6c11009dc7af204ad0e201578552/lua/codecompanion/helpers/tools/editor.lua#L15
which might be the cause of the issue. Can you provide an option to disable it or can we improve the prompt to let LLMs use actual new lines instead of \n in the genarated code so that we don't need this trick?
Reproduce the bug
No response
Final checks

[X] I have made sure this issue exists in the latest version of the plugin
[X] I have tested with the minimal.lua file from above and have shared this
[X] I have shared the contents of the log file

Please can you share how I can recreate this. What was your prompt to the LLM? What file did you ask the LLM to edit? What was the language/filetype? What was the debug log trace?
Please share the minimal.lua file. It can't be the same as the default if you're using Anthropic. I know this seems tedious but I don't have much in the way of free time to not rule out people's config in any issues.

Sure, it is quite easy to reproduce. Just let LLM generate something that contains \n and the bug can be steadily reproduced.
Screen recording:
https://github.com/user-attachments/assets/5d500345-586b-43a5-9060-c88b07053e01
Minimal config:
---@diagnostic disable: missing-fields

--NOTE: Set config path to enable the copilot adapter to work.
--It will search the follwoing paths for the for copilot token:
--  - "$CODECOMPANION_TOKEN_PATH/github-copilot/hosts.json"
--  - "$CODECOMPANION_TOKEN_PATH/github-copilot/apps.json"
vim.env["CODECOMPANION_TOKEN_PATH"] = vim.fn.expand("~/.config")

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

-- Your CodeCompanion setup
local plugins = {
  {
    "olimorris/codecompanion.nvim",
    dependencies = {
      { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
      { "nvim-lua/plenary.nvim" },
      { "hrsh7th/nvim-cmp" },
      { "stevearc/dressing.nvim", opts = {} },
      { "nvim-telescope/telescope.nvim" },
    },
    opts = {
      --Refer to: https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/config.lua
      strategies = {
        --NOTE: Change the adapter as required
        chat = { adapter = "anthropic" },
        inline = { adapter = "copilot" },
      },
      opts = {
        log_level = "DEBUG",
      },
    },
  },
}

require("lazy.minit").repro({ spec = plugins })

-- Setup Tree-sitter
local ts_status, treesitter = pcall(require, "nvim-treesitter.configs")
if ts_status then
  treesitter.setup({
    ensure_installed = { "lua", "markdown", "markdown_inline", "yaml" },
    highlight = { enable = true },
  })
end

-- Setup completion
local cmp_status, cmp = pcall(require, "cmp")
if cmp_status then
  cmp.setup({
    mapping = cmp.mapping.preset.insert({
      ["<C-b>"] = cmp.mapping.scroll_docs(-4),
      ["<C-f>"] = cmp.mapping.scroll_docs(4),
      ["<C-Space>"] = cmp.mapping.complete(),
      ["<C-e>"] = cmp.mapping.abort(),
      ["<CR>"] = cmp.mapping.confirm({ select = true }),
      -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
    }),
  })
end

Log:
[DEBUG] 2024-10-24 17:30:34
Calling tool: helpers.tools.editor
[DEBUG] 2024-10-24 17:30:34
Variable found: buffer
[DEBUG] 2024-10-24 17:30:34
Settings:
{
  env = {
    api_key = "ANTHROPIC_API_KEY"
  },
  features = {
    text = true,
    tokens = true,
    vision = true
  },
  handlers = {
    chat_output = <function 1>,
    form_messages = <function 2>,
    form_parameters = <function 3>,
    inline_output = <function 4>,
    on_exit = <function 5>,
    tokens = <function 6>
  },
  headers = {
    ["anthropic-beta"] = "prompt-caching-2024-07-31",
    ["anthropic-version"] = "2023-06-01",
    ["content-type"] = "application/json",
    ["x-api-key"] = "${api_key}"
  },
  name = "anthropic",
  opts = {
    cache_breakpoints = 4,
    cache_over = 300,
    stream = true
  },
  parameters = {
    max_tokens = 4096,
    model = "claude-3-5-sonnet-20241022",
    stream = true,
    temperature = 0
  },
  roles = {
    llm = "assistant",
    user = "user"
  },
  schema = {
    max_tokens = {
      default = 4096,
      desc = "The maximum number of tokens to generate before stopping. This parameter only specifies the absolute maximum number of tokens to generate. Different models have different maximum values for this parameter.",
      mapping = "parameters",
      optional = true,
      order = 2,
      type = "number",
      validate = <function 7>
    },
    model = {
      choices = { "claude-3-5-sonnet-20241022", "claude-3-opus-20240229", "claude-3-haiku-20240307", "claude-2.1" },
      default = "claude-3-5-sonnet-20241022",
      desc = "The model that will complete your prompt. See https://docs.anthropic.com/claude/docs/models-overview for additional details and options.",
      mapping = "parameters",
      order = 1,
      type = "enum"
    },
    stop_sequences = {
      desc = "Sequences where the API will stop generating further tokens",
      mapping = "parameters",
      optional = true,
      order = 6,
      subtype = {
        type = "string"
      },
      type = "list",
      validate = <function 8>
    },
    temperature = {
      default = 0,
      desc = "Amount of randomness injected into the response. Ranges from 0.0 to 1.0. Use temperature closer to 0.0 for analytical / multiple choice, and closer to 1.0 for creative and generative tasks. Note that even with temperature of 0.0, the results will not be fully deterministic.",
      mapping = "parameters",
      optional = true,
      order = 3,
      type = "number",
      validate = <function 9>
    },
    top_k = {
      desc = "Only sample from the top K options for each subsequent token. Use top_k to remove long tail low probability responses",
      mapping = "parameters",
      optional = true,
      order = 5,
      type = "number",
      validate = <function 10>
    },
    top_p = {
      desc = "Computes the cumulative distribution over all the options for each subsequent token in decreasing probability order and cuts it off once it reaches a particular probability specified by top_p",
      mapping = "parameters",
      optional = true,
      order = 4,
      type = "number",
      validate = <function 11>
    }
  },
  url = "https://api.anthropic.com/v1/messages",
  <metatable> = {
    __index = {
      extend = <function 12>,
      get_default_settings = <function 13>,
      get_env_vars = <function 14>,
      map_roles = <function 15>,
      map_schema_to_params = <function 16>,
      new = <function 17>,
      resolve = <function 18>,
      set_env_vars = <function 19>
    }
  }
}
[DEBUG] 2024-10-24 17:30:34
Messages:
{ {
    content = "You are an AI programming assistant named \"CodeCompanion\".\nYou are currently plugged in to the Neovim text editor on a user's machine.\n\nYour core tasks include:\n- Answering general programming questions.\n- Explaining how the code in a Neovim buffer works.\n- Reviewing the selected code in a Neovim buffer.\n- Generating unit tests for the selected code.\n- Proposing fixes for problems in the selected code.\n- Scaffolding code for a new workspace.\n- Finding relevant code to the user's query.\n- Proposing fixes for test failures.\n- Answering questions about Neovim.\n- Running tools.\n\nYou must:\n- Follow the user's requirements carefully and to the letter.\n- Keep your answers short and impersonal, especially if the user responds with context outside of your tasks.\n- Minimize other prose.\n- Use Markdown formatting in your answers.\n- Include the programming language name at the start of the Markdown code blocks.\n- Avoid line numbers in code blocks.\n- Avoid wrapping the whole response in triple backticks.\n- Only return code that's relevant to the task at hand. You may not need to return all of the code that the user has shared.\n\nWhen given a task:\n1. Think step-by-step and describe your plan for what to build in pseudocode, written out in great detail, unless asked not to do so.\n2. Output the code in a single code block, being careful to only return relevant code.\n3. You should always generate short suggestions for the next user turns that are relevant to the conversation.\n4. You can only give one reply for each conversation turn.",
    id = 232375990,
    opts = {
      visible = false
    },
    role = "system"
  }, {
    content = 'Generate a line of C code in the buffer to print "Hello, world!" with a newline.',
    id = -2088763941,
    opts = {
      visible = true
    },
    role = "user"
  }, {
    content = "## Tools\n\nYou now have access to tools:\n- These enable you to assist the user with specific tasks\n- The user will outline which specific tools you have access to in due course\n- You trigger a tool by following a specific XML schema which is defined for each tool\n\nYou must:\n- Only use the tool when prompted by the user, despite having access to it\n- Follow the specific tool's schema, which will be provided\n- Respond with the schema in XML format\n- Ensure the schema is in a markdown code block that is designated as XML\n- Ensure any output you're intending to execute will be able to parsed as valid XML\n\nPoints to note:\n- The user detects that you've triggered a tool by using Tree-sitter to parse your markdown response\n- It will only ever parse the last XML code block in your response\n- If your response doesn't follow the tool's schema, the tool will not execute\n- Tools should not alter your core tasks and how you respond to a user",
    id = -148728358,
    opts = {
      tag = "tool",
      visible = false
    },
    role = "system"
  }, {
    content = "### Editor Tool\n\n1. **Purpose**: Update the contents of a Neovim buffer\n\n2. **Usage**: Return an XML markdown code block for add, update, or delete operations.\n\n3. **Key Points**:\n  - **Only use when prompted** by user (e.g., \"can you update the code?\")\n  - Ensure XML is **valid and follows the schema**\n  - **Include indentation** in your code\n  - **Don't escape** special characters\n  - **Keep the CDATA** section wrapping the code, the code could contain characters reserved by XML.\n\n4. **Actions**:\n\na) Add:\n\n```xml\n<tools>\n  <tool name=\"editor\">\n    <action type=\"add\">\n      <code><![CDATA[    print('Hello World')]]></code>\n      <line>203</line>\n      <buffer>1</buffer>\n    </action>\n  </tool>\n</tools>\n```\n\nb) Update:\n\n```xml\n<tools>\n  <tool name=\"editor\">\n    <action type=\"update\">\n      <start_line>199</start_line>\n      <buffer>10</buffer>\n      <code><![CDATA[   function M.capitalize()]]></code>\n      <end_line>199</end_line>\n    </action>\n  </tool>\n</tools>\n```\n\nc) Delete:\n\n```xml\n<tools>\n  <tool name=\"editor\">\n    <action type=\"delete\">\n      <start_line>10</start_line>\n      <end_line>15</end_line>\n      <buffer>14</buffer>\n    </action>\n  </tool>\n</tools>\n```\n\n5. **Multiple Actions**: Combine actions in one response if needed:\n\n```xml\n<tools>\n  <tool name=\"editor\">\n    <action type=\"delete\">\n      <start_line>13</start_line>\n      <end_line>13</end_line>\n      <buffer>5</buffer>\n    </action>\n    <action type=\"add\">\n      <code><![CDATA[function M.hello_world()]]></code>\n      <line>20</line>\n      <buffer>5</buffer>\n    </action>\n  </tool>\n</tools>\n```\n\n6. **Note**:\n  - For the delete action, the <start_line> and <end_line> tags are inclusive\n  - The update action first deletes the range in <start_line> and <end_line> (inclusively) and then adds new code from the <start_line>\n  - Account for comment blocks and indentation in your code\n  - If the user supplies no context, it can be assumed that they would like you to update the buffer with the code from your last response\n\nRemember: Minimize explanations unless prompted. Focus on generating correct XML.",
    id = -852241040,
    opts = {
      tag = "tool",
      visible = false
    },
    role = "system"
  }, {
    content = "Buffer ID: 1\nName: test.c\nPath: /home/zeng/Scratches/test.c\nFiletype: c\nContent:\n```c\n1:  #include <stdio.h>\n2:  #include <stdlib.h>\n3:  \n4:  int main(void) {\n5:      return 0;\n6:  }\n```\n",
    id = -361423923,
    opts = {
      tag = "variable",
      visible = false
    },
    role = "user"
  } }
[INFO] 2024-10-24 17:30:34
Chat request started
[DEBUG] 2024-10-24 17:30:34
Request:
{ "-sSL", "-D", "/run/user/1000/plenary_curl_b9c14a5b.headers", "--compressed", "-X", "POST", "-H", "X-Api-Key: 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", "-H", "Anthropic-Beta: prompt-caching-2024-07-31", "-H", "Anthropic-Version: 2023-06-01", "-H", "Content-Type: application/json", "--data-raw", "{\"max_tokens\":4096,\"model\":\"claude-3-5-sonnet-20241022\",\"messages\":[{\"role\":\"user\",\"content\":\"Generate a line of C code in the buffer to print \\\"Hello, world!\\\" with a newline. Buffer ID: 1\\nName: test.c\\nPath: \\/home\\/zeng\\/Scratches\\/test.c\\nFiletype: c\\nContent:\\n```c\\n1:  #include <stdio.h>\\n2:  #include <stdlib.h>\\n3:  \\n4:  int main(void) {\\n5:      return 0;\\n6:  }\\n```\\n\"}],\"system\":[{\"type\":\"text\",\"cache_control\":{\"type\":\"ephemeral\"},\"text\":\"You are an AI programming assistant named \\\"CodeCompanion\\\".\\nYou are currently plugged in to the Neovim text editor on a user's machine.\\n\\nYour core tasks include:\\n- Answering general programming questions.\\n- Explaining how the code in a Neovim buffer works.\\n- Reviewing the selected code in a Neovim buffer.\\n- Generating unit tests for the selected code.\\n- Proposing fixes for problems in the selected code.\\n- Scaffolding code for a new workspace.\\n- Finding relevant code to the user's query.\\n- Proposing fixes for test failures.\\n- Answering questions about Neovim.\\n- Running tools.\\n\\nYou must:\\n- Follow the user's requirements carefully and to the letter.\\n- Keep your answers short and impersonal, especially if the user responds with context outside of your tasks.\\n- Minimize other prose.\\n- Use Markdown formatting in your answers.\\n- Include the programming language name at the start of the Markdown code blocks.\\n- Avoid line numbers in code blocks.\\n- Avoid wrapping the whole response in triple backticks.\\n- Only return code that's relevant to the task at hand. You may not need to return all of the code that the user has shared.\\n\\nWhen given a task:\\n1. Think step-by-step and describe your plan for what to build in pseudocode, written out in great detail, unless asked not to do so.\\n2. Output the code in a single code block, being careful to only return relevant code.\\n3. You should always generate short suggestions for the next user turns that are relevant to the conversation.\\n4. You can only give one reply for each conversation turn.\"},{\"type\":\"text\",\"cache_control\":{\"type\":\"ephemeral\"},\"text\":\"## Tools\\n\\nYou now have access to tools:\\n- These enable you to assist the user with specific tasks\\n- The user will outline which specific tools you have access to in due course\\n- You trigger a tool by following a specific XML schema which is defined for each tool\\n\\nYou must:\\n- Only use the tool when prompted by the user, despite having access to it\\n- Follow the specific tool's schema, which will be provided\\n- Respond with the schema in XML format\\n- Ensure the schema is in a markdown code block that is designated as XML\\n- Ensure any output you're intending to execute will be able to parsed as valid XML\\n\\nPoints to note:\\n- The user detects that you've triggered a tool by using Tree-sitter to parse your markdown response\\n- It will only ever parse the last XML code block in your response\\n- If your response doesn't follow the tool's schema, the tool will not execute\\n- Tools should not alter your core tasks and how you respond to a user\"},{\"type\":\"text\",\"cache_control\":{\"type\":\"ephemeral\"},\"text\":\"### Editor Tool\\n\\n1. **Purpose**: Update the contents of a Neovim buffer\\n\\n2. **Usage**: Return an XML markdown code block for add, update, or delete operations.\\n\\n3. **Key Points**:\\n  - **Only use when prompted** by user (e.g., \\\"can you update the code?\\\")\\n  - Ensure XML is **valid and follows the schema**\\n  - **Include indentation** in your code\\n  - **Don't escape** special characters\\n  - **Keep the CDATA** section wrapping the code, the code could contain characters reserved by XML.\\n\\n4. **Actions**:\\n\\na) Add:\\n\\n```xml\\n<tools>\\n  <tool name=\\\"editor\\\">\\n    <action type=\\\"add\\\">\\n      <code><![CDATA[    print('Hello World')]]><\\/code>\\n      <line>203<\\/line>\\n      <buffer>1<\\/buffer>\\n    <\\/action>\\n  <\\/tool>\\n<\\/tools>\\n```\\n\\nb) Update:\\n\\n```xml\\n<tools>\\n  <tool name=\\\"editor\\\">\\n    <action type=\\\"update\\\">\\n      <start_line>199<\\/start_line>\\n      <buffer>10<\\/buffer>\\n      <code><![CDATA[   function M.capitalize()]]><\\/code>\\n      <end_line>199<\\/end_line>\\n    <\\/action>\\n  <\\/tool>\\n<\\/tools>\\n```\\n\\nc) Delete:\\n\\n```xml\\n<tools>\\n  <tool name=\\\"editor\\\">\\n    <action type=\\\"delete\\\">\\n      <start_line>10<\\/start_line>\\n      <end_line>15<\\/end_line>\\n      <buffer>14<\\/buffer>\\n    <\\/action>\\n  <\\/tool>\\n<\\/tools>\\n```\\n\\n5. **Multiple Actions**: Combine actions in one response if needed:\\n\\n```xml\\n<tools>\\n  <tool name=\\\"editor\\\">\\n    <action type=\\\"delete\\\">\\n      <start_line>13<\\/start_line>\\n      <end_line>13<\\/end_line>\\n      <buffer>5<\\/buffer>\\n    <\\/action>\\n    <action type=\\\"add\\\">\\n      <code><![CDATA[function M.hello_world()]]><\\/code>\\n      <line>20<\\/line>\\n      <buffer>5<\\/buffer>\\n    <\\/action>\\n  <\\/tool>\\n<\\/tools>\\n```\\n\\n6. **Note**:\\n  - For the delete action, the <start_line> and <end_line> tags are inclusive\\n  - The update action first deletes the range in <start_line> and <end_line> (inclusively) and then adds new code from the <start_line>\\n  - Account for comment blocks and indentation in your code\\n  - If the user supplies no context, it can be assumed that they would like you to update the buffer with the code from your last response\\n\\nRemember: Minimize explanations unless prompted. Focus on generating correct XML.\"}],\"stream\":true,\"temperature\":0}", "--no-buffer", "https://api.anthropic.com/v1/messages" }
[DEBUG] 2024-10-24 17:30:38
Tool detected: { '<tools>\n  <tool name="editor">\n    <action type="add">\n      <![CDATA[    printf("Hello, world!\\n");]]>\n      <line>5</line>\n      <buffer>1</buffer>\n    </action>\n  </tool>\n</tools>\n' }
[DEBUG] 2024-10-24 17:30:38
Calling tool: helpers.tools.editor
[DEBUG] 2024-10-24 17:30:38
Agent started
[DEBUG] 2024-10-24 17:30:38
Running cmd: function: 0x760d5ee739e8
[DEBUG] 2024-10-24 17:30:38
Editor tool request: { "\n      ", "\n      ", "\n      ", "\n    ",
  _attr = {
    type = "add"
  },
  buffer = "1",
  code = '    printf("Hello, world!\\n");',
  line = "5"
}
[INFO] 2024-10-24 17:30:38
Chat request completed
[DEBUG] 2024-10-24 17:30:38
Agent finished

Ahhhh gotcha.
Could you try improving the system prompt in the tool to get this to work? It may be as simple as asking it to put actual line breaks and not special characters.

Sure it will give it a try later (or tomorrow). I am not an expert in prompt engineering, so there's a high chance that you can fix this better & faster than me though.


It is better to update 'Range' to 'range' on the 'Optional parameters' part of the 'Shared Access Signature' dialog

Storage Explorer Version: 1.29.0-dev
Build Number: 20230324.2
Branch: main
Platform/OS: Windows 10/Linux Ubuntu 22.04/MacOS Ventura 13.2.1 (Apple M1 Pro)
Architecture: ia32/x64
How Found: From running test cases
Regression From: Not a regression
Steps to Reproduce

Expand one storage account -> Blob Containers.
Create a blob container -> Right click the blob container.
Click 'Get Shared Access Signature...'.
Observe the 'Optional parameters' part.

Expected Experience
It is better to show 'IP Address range'.
Actual Experience
Show 'IP Address Range'.

Verified this issue on the build main 20230331.5. Fixed. So, we are going to close it.


TypeError: Cannot read property 'callee' of null

Version 7.20.5 seems to crash when tsx file has a function with the name createElement
yarn eslint
yarn run v1.22.4
$ node --max_old_space_size=8000 node_modules/eslint/bin/eslint.js --quiet -f compact --ext .ts,.tsx -o eslint-errors.txt src/

Oops! Something went wrong! :(

ESLint: 7.5.0

TypeError: Cannot read property 'callee' of null
Occurred while linting src\faq\components\Test.tsx:7
    at Object.isDestructuredFromPragmaImport (node_modules\eslint-plugin-react\lib\util\Components.js:348:33)
    at Object.isCreateElement (node_modules\eslint-plugin-react\lib\util\Components.js:393:16)
    at Object.isReturningJSX (node_modules\eslint-plugin-react\lib\util\Components.js:467:47)
    at Object.isReturningJSXOrNull (node_modules\eslint-plugin-react\lib\util\Components.js:503:20)
    at Object.getStatelessComponent (node_modules\eslint-plugin-react\lib\util\Components.js:699:64)
    at Object.getParentStatelessComponent (node_modules\eslint-plugin-react\lib\util\Components.js:728:42)
    at Object.getParentComponent (node_modules\eslint-plugin-react\lib\util\Components.js:623:18)
    at Object.ArrowFunctionExpression (node_modules\eslint-plugin-react\lib\util\Components.js:916:31)
    at updatedRuleInstructions.<computed> (node_modules\eslint-plugin-react\lib\util\Components.js:970:43)
    at node_modules\eslint\lib\linter\safe-emitter.js:45:58

Component
import * as React from 'react';

interface Props {
    text: string;
}

export const Test: React.FC<Props> = (props: Props) => {
    const createElement = (text: string) => {
        return (
            <div>
                {text}
            </div>
        );
    };

    return <>{createElement(props.text)}</>;
};

What happens with v7.20.5?

So, specifically, this is likely because React.createElement is what jsx syntax uses.

Also, do you have any idea what linting rule is being applied?

Got a fix anyways.

Can you link the fix PR to this issue @ljharb.

@jbizkit there was no fix PR; it was just the commit, which is linked in the closing message.

@ljharb Can we get a new patch release cut that has this fix in it? We've had to revert to a previous version due to this bug.

Yes, I'll cut one soon.


fix: Route to appsettings correctly

Description
This PR routes to the correct tab in settings page when LUIS key or region missing error message is clicked
Task Item
Refs #6848
CC @pavolum

Coverage increased (+0.001%) to 51.159% when pulling f21a736797ce00a8293f5e15cc02351aafbc74b7 on fix/appsettings-json into 06c0d6e85098e2cde72a94eafef75a409b5cde3e on main.


How can I use the detection part?

Do you mean how to run detection baseline code? See tutorial/3-detection.ipynb.


Cleaner Report resource deletion conditions

Is your feature request related to a problem? Please describe.
I'm looking for a way to expire objects based on a set of predefined conditions that can easily be applied to multiple Cleaner objects.
Describe the solution you'd like
Something native, TTL/expiration options exposed in the CRDs that the operator could decide when to delete objects. The options that would be nice (imo) are

TTL/occurences counter (relative to when object added to report)
Duration (relative to when object added to report)
Timestamp (absolute)

type ResourceDeleteConditions struct {
	// +kubebuilder:validation:Optional
	Occurrences int `json:"occurrences,omitempty"`

	// +kubebuilder:validation:Optional
	Timestamp *metav1.Time`json:"timestamp,omitempty"`

	// +kubebuilder:validation:Optional
	Duration *metav1.Duration`json:"duration,omitempty"`
}

TTL/Occurrences Counter: Configure a max counter in the cleaner. Objects that get written to the Report would have their own counter recorded used later to determine when the object can be deleted.
Every subsequent Cleaner run, the counter would be incremented by 1 if the resource still exists in the report. If the specific resources counter > the resourceDeleteConditions then the object would be deleted.
apiVersion: apps.projectsveltos.io/v1alpha1
kind: Report
metadata:
  name: cleaner-with-report
spec:
  action: Delete
  resourceDeleteConditions:
    occurrences: 30
  resourceInfo:
  - message: '. time: 2024-04-04 13:25:00.621990728 +0000 UTC m=+227862.774595097'
    firstOccurrence: "2024-04-02T00:25:03Z"
    occurrences: 20
    resource:
      apiVersion: apps/v1
      kind: Deployment
      name: example
      namespace: example

Duration: Record the firstOccurrence timestamp in the resource info, once the duration has elapsed after subsequent runs the object is eligible for deletion and will be removed.
apiVersion: apps.projectsveltos.io/v1alpha1
kind: Report
metadata:
  name: cleaner-with-report
spec:
  action: Delete
  resourceDeleteConditions:
    duration: "720h0m0s"
  resourceInfo:
  - message: '. time: 2024-04-04 13:25:00.621990728 +0000 UTC m=+227862.774595097'
    firstOccurrence: "2024-04-02T00:25:03Z"
    occurrences: 20
    resource:
      apiVersion: apps/v1
      kind: Deployment
      name: example
      namespace: example

Timestamp: Absolute, after the given timestamp the objects in the report are deleted.
apiVersion: apps.projectsveltos.io/v1alpha1
kind: Report
metadata:
  name: cleaner-with-report
spec:
  action: Delete
  resourceDeleteConditions:
    timestamp: "2024-04-30T00:00:00Z" # <- if the current time is past and the object is still in the report, it should be deleted.
  resourceInfo:
  - message: '. time: 2024-04-03 13:25:00.621990728 +0000 UTC m=+227862.774595097'
    firstOccurrence: "2024-04-02T00:25:03Z"
    occurrences: 20
    resource:
      apiVersion: apps/v1
      kind: Deployment
      name: example
      namespace: example

In the proposed solution it would be possible to combine the conditions as well, where any conditions set must pass for the object in the report to be deleted.
Describe alternatives you've considered
Building in the logic to each Cleaner resource and replicating that to multiple Cleaner objects. There are some related examples here but are based on object age or pre-defined annotations on objects which cover a different set of needs than what I am looking for. Technically you could probably create a transform Cleaner to apply metadata to the object such as firstOccurrence or counter and then use that information in a separate Cleaner to delete resources based on duration or # of occurrences but it would be much more tedious and prone to errors.
I think conditional deletion is probably a pretty common use case, people often want some time to verify whether objects should really be deleted so they might use Scan first and when they are confident they may create a new cleaner or modify the existing to Delete. However when doing so there is no guarantee that the same set of objects as last run would be deleted and different ones may be in the next run. This would give the user an automated way to track & remove resources after specific time related conditions pass.
Additional context
I was thinking since the Cleaner Report already tracks objects, it would be relatively simple to store a bit of additional information in the resource list that can be used to determine when the object should be deleted.

Thank you for the detailed description @ctrought
I like the timestamp idea as it requires no annotations/labels to be added to any objects:

Create a Cleaner instance with timestamp in the ResourceDeleteConditions;
Any resource which ends up being in a Report will be automatically deleted if current time is past timestamp.

I understand the TTL as well:

Create a Cleaner instance with TTL in the ResourceDeleteConditions;
Any resource which ends up being in a Report will be automatically deleted if it surpassed its specified time-to-live

I am not sure I get the use case for Occurrences. Or better there are scenarios where I can think of using (i.e, a deployment whose active replica is 0 while replicas is not, and it is in that state for many days for instance) but I also think those cases can be taken care (every time an object is a match, active replicas == 0 & != replicas, add an annotation or increment it then have another condition that deletes object is annotation value is higher than X).
The reason I am saying this is because Cleaner currently does not keep track of past actions (yes it generates a reports but it does not pull past reports to make a call on what it should do).
So I am in favour of implementing what you suggested but limiting it to Timestamp and TTL. What do you think?
Thank you

Hi @gianlucam76 , thanks for your feedback! I'm sorry I may not have been clear with my explanation behind the intention behind the proposed conditions for my personal use case.
TTL/Occurrences:
In the context of the original ask, TTL & Occurrences are the same thing but I just wasn't sure what it should be called. Technically, speaking a TTL could be either a counter or a timestamp that limits the life of something and just depends on how it's implemented for the specific use case. The delete condition I am interested would rely on a counter that would either increase or decrease by 1 each time the resource is observed in the report (ie. if decreasing once it hits 0 the object is deleted, or if it were implemented as increasing from 1 once the counter hits the defined limit in the Cleaner it would get deleted).
Duration:
There are two ways I guess one could look at this one. It could be interpreted as the duration of the object itself based on the creation date (ie. how long is it allowed to exist for), but the other way would be the duration the object exists in the report for (ie. relative to the time the object first appeared in scan). I think you were probably thinking of the former (lifespan of object) while I was originally thinking of the latter (duration of object in Cleaner Report). I think they are both valid use cases for DeleteResourceCondition though.
The rationale for enabling a condition for duration in report, would be similar to a TTL/occurrences counter in that it will let the resource appear in the report for a period of time before it gets deleted, and the time it lets the object live in the report for is always relative to when it was first added to the report. The way I see it, this lets you use one Cleaner instance that can run forever to handle the cleanup of objects but also gives a grace period to spot and correct any resources that one may not wish to be removed.

The reason I am saying this is because Cleaner currently does not keep track of past actions (yes it generates a reports but it does not pull past reports to make a call on what it should do).

Yep makes sense, it does not re-use data from an old report today. The proposal for the TTL/occurrences (counter) and duration/age might require new fields added to the Reports ResourceInfo, those being

occurrences (counter of the number of times resource appears in report)
firstOccurrence (the timestamp the resource first appeared in the report)

type ResourceInfo struct {
	// Resource identify a Kubernetes resource
	Resource corev1.ObjectReference `json:"resource,omitempty"`

	// FullResource contains full resources before
	// before Cleaner took an action on it
	// +optional
	FullResource []byte `json:"fullResource,omitempty"`

	// Message is an optional field.
	// +optional
	Message string `json:"message,omitempty"`

	// +kubebuilder:validation:Optional
	Occurrences int `json:"occurrences,omitempty"`

	// +kubebuilder:validation:Optional
	FirstOccurrence *metav1.Time`json:"firstTimestamp,omitempty"`
}

This would let Cleaner keep a basic history of the resource in the report. It would also require the way the report is generated to be changed slightly (but I don't think too much hopefully). Rather than overwriting the old report entirely, generateReportSpec could check an existing report (if it exists) and check to see if the resources in the new report are also in the existing report. If any resources are in the existing report, we copy the TTL counter/occurrences number and increment by one (or decrease, whichever method is preferred) and also retain the FirstOccurrence timestamp.
The naming for the conditions is important to remove any ambiguity, so any user would know the different between a TTL counter vs timestamp, etc. Hopefully I am not misinterpreting your own ideas but in summary I think there could probably be 4 different conditions?

TTL Timestamp (ie. Delete all resources after X timestamp)
TTL Counter (ie. Delete all resources once the TTL counter per resource exceeds the defined threshold)
Object age in cluster
Object age in report

Conditions 2 and 4 are dependent on metadata that would need to be tracked in the Cleaner Report. The rough idea would be something like below. The exact name of metadata fields may depend on what the DeleteResourceConditions are named.
// pass in a ref to existing report if it exists
func generateReportSpec(resources []ResourceResult, cleaner *appsv1alpha1.Cleaner, existingReport *appsv1alpha1.Report) *appsv1alpha1.ReportSpec {
	reportSpec := appsv1alpha1.ReportSpec{}
	reportSpec.Action = cleaner.Spec.Action
	message := fmt.Sprintf(". time: %v", time.Now())
	time := metav1.NewTime(time.Now())

	reportSpec.ResourceInfo = make([]appsv1alpha1.ResourceInfo, len(resources))
	for i := range resources {

		resourceInfo := appsv1alpha1.ResourceInfo{
			Resource: corev1.ObjectReference{
				Namespace:  resources[i].Resource.GetNamespace(),
				Name:       resources[i].Resource.GetName(),
				Kind:       resources[i].Resource.GetKind(),
				APIVersion: resources[i].Resource.GetAPIVersion(),
			},
			Message:         resources[i].Message + message,
			FirstOccurrence: time,
			Occurrences:     1,
		}

		// retain metadata for resource if it exists in an existing report
		if len(existingReport.Spec.ResourceInfo) > 0 {
			existingResource := getResourceInfoFromReport(resourceInfo.Resource, existingReport)
			if existingResource.Resource.Name != "" {
				resourceInfo.FirstOccurrence = existingResource.FirstOccurrence
				resourceInfo.Occurrences = existingResource.Occurrences + 1
			}
		}

		reportSpec.ResourceInfo[i] = resourceInfo
	}

	return &reportSpec
}

The updated report in-cluster would then have the necessary metadata saved for the DeleteResourceConditions to be handled. This also means these 2 DeleteResourceConditions require a Report to be generated so it can be referred to later on.
I can help draft a PR if you'd like, but let me know your thoughts on everything above.


Voronoi (Thiessen) Polygons -- invalid results

This issue was imported from CodePlex
pbduda wrote 2010-09-30 at 22:42
I'm using DotSpatial.Analysis.Voronoi.VoronoiPolygons, and it is producing invalid results for some cases. I've attached an example point shapefile and an image of the results I'm getting.
Shade1974 wrote 2010-09-30 at 23:04
The code is not stable for the full range of double values. What I don't remember is what the stable range of values should be. Some people have had luck transforming the coordinates to a different scale range, (probably larger values) and re-trying the
algorithm, and then transforming the resulting voronoi output back. You could probably use a projection to accomplish this fairly easily. It may not help, but it helped some in the past.
pbduda wrote 2010-10-01 at 17:59
Ah yes, I should have mentioned that I did transform the coordinates to a different scale range already. That transformation cured a lot of ills, but not this one. So this is a different and ongoing problem.
With regard to the coordinate transformation solution, do we know what the valid range of coordinates is? It seems we should code that into the Dot Spatial Voronoi algorithm; ie if the coordinates are out of range automatically convert them. There's no need
for each Dot Spatial user to be writing code to do that conversion.
Shade1974 wrote 2010-10-01 at 22:12
That's a good suggestion. Since it is more of a feature request, I will post it as a separate issue. Thanks.
pbduda wrote 2010-10-05 at 01:02
That sounds like the right move, but just to be clear, the original problem shown in the zip file remains as an open issue.

Just tried to reproduce. Something wrong.


Horizontal wheel pans CaptureWindow instead of zooming

Do I need a special mouse to test this? How do I trigger horizontal wheel events?

Many modern mice have a wheel that can be pushed left or right, but you can also hold Alt while scrolling vertically.


CI TEST - DO NOT MERGE

PR is added to the queue for testing as 1. task. (3c47c55)

Test (Success) 50505116 build is completed (3c47c55)
See https://github.com/ThaliTester/TestResults/tree/505051163c47c55_CI_TEST_-_DO_NOT_MERGE_vjrantal/ for the logs

Test 505051163c47c55(3c47c55) has failed
See https://github.com/ThaliTester/TestResults/tree/505051163c47c55_CI_TEST_-_DO_NOT_MERGE_vjrantal/ for the fail logs


Dev: few necessary changes

Codecov Report

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

@@         Coverage Diff          @@
##           master   #24   +/-   ##
====================================
  Coverage       0%    0%
====================================
  Files           8     7    -1
  Lines         103   101    -2
====================================
+ Misses        103   101    -2

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 902819e...06fd092. Read the comment docs.


Stormwind's Carrier Flagship can't be trained because it requires "Default string"

Closed by https://github.com/AzerothWarsLR/WarcraftLegacies/commit/bad2fdb96b0f4eb0e5786254e80595d6e7a38ae5


Feature user permissions

Module for the creation of "staff" permission and his grant to other user from staff members

@EugenioCorso @CorsoGabriele Code looks fine to me. Do we have some tests?

Needs to be rebased against new master

@EugenioCorso @CorsoGabriele
Automated tests cannot even run due to this:
fare/grant_staff/api.py:1 at module level:

        D100: Missing docstring in public module

fare/grant_staff/api.py:10 in public function `grant_staff_permission`:

        D205: 1 blank line required between summary line and description (found 0)

fare/grant_staff/api.py:10 in public function `grant_staff_permission`:

        D208: Docstring is over-indented

fare/grant_staff/api.py:10 in public function `grant_staff_permission`:

        D210: No whitespaces allowed surrounding docstring text

fare/grant_staff/api.py:10 in public function `grant_staff_permission`:

        D400: First line should end with a period (not 'r')

tests/conftest.py:31 in public function `app`:

        D202: No blank lines allowed after function docstring (found 1)

tests/conftest.py:78 in public function `users`:

        D202: No blank lines allowed after function docstring (found 1)

See https://travis-ci.org/open-education-polito/fare-invenio/jobs/650879485?utm_medium=notification
Could you please fix and push? I am interested to see the tests results in order to proceed with the debugging. Thanks!

@libremente i have fixed the issues, now the automated tests should work. Notice that 'test_simple_flow' in the test_api_simple_flow.py will always fail because of the permission's modification we made in fare/records/config.py so it should be removed

Also, @EugenioCorso please rebase against new master, thanks!

@libremente i have fixed the issues, now the automated tests should work. Notice that 'test_simple_flow' in the test_api_simple_flow.py will always fail because of the permission's modification we made in fare/records/config.py so it should be removed

@EugenioCorso if it should be removed then please go on in this PR and remove it, thanks

Please rebase and mark the PR as ready for review @EugenioCorso


Export config xml - add new export-plugin-config goal

We are no longer need this new goal.  We will generate the export-plugin-config.xml in install-server goal


Add steps to import model to h2oGPT

This PR adds some info about importing a model to h2oGPT.
Partially resolves: https://github.com/h2oai/h2o-llmstudio/issues/485

@sherenem  Feel free to squah and merge


Is require() wasting memory?

We're about to start using webpack on a huge (megabytes of JS) project. On a project of that scale, memory use and waste really starts to matter and I was wondering about Webpack. So I dove into the webpack_require function. For reference, here is the code I would like to discuss:
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;
/******/
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}

What I notice is that once a module's wrapper function has been executed, we'll have the module object cached (makes sense, for the require call). However we also still have the wrapper function (modules[moduleId]) which will never ever get executed again, because of the if-statement at the start of the function. So why are we keeping it around? It seems we could reclaim memory by simply assigning undefined to modules[moduleId].
Am I missing something or is this a really easy opportunity to reclaim memory?

Have you done a retains heap analysis on this to see how much memory this structure actually retains? It seems like there could be some savings by clearing this, but I'm not sure exactly how much since any closures, etc will be referenced by the installedModules object.

Sure, and that's fine. I don't expect the module object and all its references to disappear. But the original function definition should still be taking up space I reckon. The JS engine won't be able to deduce (easily) that the function will never be called again. We'll do some tests, see what we can measure.

Yes, the memory will be populated by the functions, and not garbage collected because the object is...

In active use.
Part of a parent which is frequently accessed.

Your idea of undefine'ing it seems fine with me. However, this should only happen if the function doesn't fail, imho.
You can send a PR to modify the function.
But I would assume you do a memory usage test first. Because these wrappers arent that huge, really. So make sure if it is worth the efford. Thanks. :)

You're right, they're not big. But I'm working on a game with literally hundreds (we may have reached thousands by now) of required files. You can imagine RAM use is sensitive here :)
We'll try to do a test, and see what comes out of it. Even a 0.1% improvement would be worth it on a project like this given that it's just a one-liner with no (imho) drawbacks.

A game compiled by webpack?
… You seriously should let us know of a beta, it’d be nice to link to something like that as a usecase :)
Anyway BTT:
When you have some results, post them here. Then, you can try to remove the function by setting it to NULL or undefined and re-test. See if that changed something and how much.

I will see if I can announce what this is all about :) What I can say for now, is that it's for tablets, and it's probably the biggest (in terms of content) game to hit the app stores .. pretty much ever.
We'll give it a shot, do some heap dumps, diff them, and see if there's any benefit. Thanks.

So I made some Heap Snapshot of this huge game in Chrome ;)
(Yes, I'm working with @ronkorving)
We have a total of 920 modules.
Here some basic result on startup of the game/app:

Snapshots from 2 to 5 have been made with vanilla webpack.
While Snapshots from 6 to 8 have been made by simply adding a modules[moduleId] = undefined; after the function call.
Seems we clearly get about 400KB of RAM freed
Made an other test by going a little bit farther in the game (1-4 vanilla, 5-8 setting undefined).
And again we can see some gain in memory.

The difference might not be huge compare to the total used but for a big game like this one, it can make a huge difference.

However we also still have the wrapper function (modules[moduleId]) which will never ever get executed again

That sadly not true. It can be executed multiple in this cases:

HMR: You are hot updating a module and this module is in the dispose chain but wasn't updated.
require.cache: The node.js API allows to manually delete modules from the cache. So to be compatible we must offer this.

But you can do the cleanup manually:
// after bootstraping you app
Object.keys(require.cache).forEach(function(id) {
  // delete __webpack_modules__[id];
  // or
  __webpack_modules__[id] = wasRemoved;
});

function wasRemoved() {
  throw new Error("This module function was removed for memory reasons. You can't require it again.");
}


Add player_monoids support

Much simpler #17 to have a chance this gets merged soon.

Remove deprecated depends.text & description.txt
Add player_monoids support for sitting
Add player_monoids to mod dependencies

Technically speaking, the dependency is not needed at all. minetest.get_modpath can also be used on mods that are yet not loaded.

But it's helpful to see which mods support player_monoids w/o reading (or grepping) the code.

Yes, it is helpful up to the point when there's circular dependencies. In either case, I suppose this is yet not a problem.


Use eslint-plugin-svelte / fix peer dependency issue

npm install was failing because of peer dependency issues (eslint-plugin-svelte3 wanted svelte3 whereas we're using svelte4). I solved by just switching to eslint-plugin-svelte, which seems to be recommended and works.
Before:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving<EMAIL_ADDRESS>npm ERR! Found<EMAIL_ADDRESS>npm ERR! node_modules/svelte
npm ERR!   dev<EMAIL_ADDRESS>from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer<EMAIL_ADDRESS>from<EMAIL_ADDRESS>npm ERR! node_modules/eslint-plugin-svelte3
npm ERR!   dev<EMAIL_ADDRESS>from the root project

I should have used pnpm install, oops.


Connot read serial-number

basic read  serial-number  0x7283 0x00
[1673256155.527357][68074:68079] CHIP:TOO: Sending command to node 0x7283
[1673256155.527568][68074:68079] CHIP:CSM: FindOrEstablishSession: PeerId = [1:0000000000007283]
[1673256155.527583][68074:68079] CHIP:CSM: FindOrEstablishSession: No existing OperationalSessionSetup instance found
[1673256155.527602][68074:68079] CHIP:CTL: Found an existing secure session to [1:0000000000007283]!
[1673256155.527612][68074:68079] CHIP:CTL: OperationalSessionSetup[1:0000000000007283]: State change 1 --> 5
[1673256155.527639][68074:68079] CHIP:TOO:      cluster 0x0000_0028, attribute: 0x0000_000F, endpoint 0
[1673256155.527651][68074:68079] CHIP:TOO: Sending ReadAttribute to:
[1673256155.527663][68074:68079] CHIP:DMG: SendReadRequest ReadClient[0x7fa13000e580]: Sending Read Request
[1673256155.527815][68074:68079] CHIP:EM: <<< [E:6436i M:10625817] (S) Msg TX to 1:0000000000007283 [13D9] --- Type 0001:02 (IM:ReadRequest)
[1673256155.527837][68074:68079] CHIP:IN: (S) Sending msg 10625817 on secure session with LSID: 42613
[1673256155.527946][68074:68079] CHIP:DMG: MoveToState ReadClient[0x7fa13000e580]: Moving to [AwaitingIn]
[1673256155.669595][68074:68079] CHIP:EM: >>> [E:6436i M:71438956 (Ack:10625817)] (S) Msg RX from 1:0000000000007283 [13D9] --- Type 0001:05 (IM:ReportData)
[1673256155.669634][68074:68079] CHIP:EM: Found matching exchange: 6436i, Delegate: 0x7fa13000e590
[1673256155.669655][68074:68079] CHIP:EM: Rxd Ack; Removing MessageCounter:10625817 from Retrans Table on exchange 6436i
[1673256155.669694][68074:68079] CHIP:DMG: ReportDataMessage =
[1673256155.669706][68074:68079] CHIP:DMG: {
[1673256155.669714][68074:68079] CHIP:DMG:      AttributeReportIBs =
[1673256155.669726][68074:68079] CHIP:DMG:      [
[1673256155.669733][68074:68079] CHIP:DMG:              AttributeReportIB =
[1673256155.669745][68074:68079] CHIP:DMG:              {
[1673256155.669754][68074:68079] CHIP:DMG:                      AttributeStatusIB =
[1673256155.669773][68074:68079] CHIP:DMG:                      {
[1673256155.669782][68074:68079] CHIP:DMG:                              AttributePathIB =
[1673256155.669793][68074:68079] CHIP:DMG:                              {
[1673256155.669803][68074:68079] CHIP:DMG:                                      Endpoint = 0x0,
[1673256155.669811][68074:68079] CHIP:DMG:                                      Cluster = 0x28,
[1673256155.669826][68074:68079] CHIP:DMG:                                      Attribute = 0x0000_000F,
[1673256155.669835][68074:68079] CHIP:DMG:                              }
[1673256155.669847][68074:68079] CHIP:DMG:
[1673256155.669861][68074:68079] CHIP:DMG:                              StatusIB =
[1673256155.669872][68074:68079] CHIP:DMG:                              {
[1673256155.669885][68074:68079] CHIP:DMG:                                      status = 0x86 (UNSUPPORTED_ATTRIBUTE),
[1673256155.669895][68074:68079] CHIP:DMG:                              },
[1673256155.669904][68074:68079] CHIP:DMG:
[1673256155.669913][68074:68079] CHIP:DMG:                      },
[1673256155.669927][68074:68079] CHIP:DMG:
[1673256155.669933][68074:68079] CHIP:DMG:              },
[1673256155.669946][68074:68079] CHIP:DMG:
[1673256155.669953][68074:68079] CHIP:DMG:      ],
[1673256155.669963][68074:68079] CHIP:DMG:
[1673256155.669972][68074:68079] CHIP:DMG:      SuppressResponse = true,
[1673256155.669981][68074:68079] CHIP:DMG:      InteractionModelRevision = 1
[1673256155.669986][68074:68079] CHIP:DMG: }
[1673256155.670056][68074:68079] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE)
[1673256155.670130][68074:68079] CHIP:EM: <<< [E:6436i M:10625818 (Ack:71438956)] (S) Msg TX to 1:0000000000007283 [13D9] --- Type 0000:10 (SecureChannel:StandaloneAck)
[1673256155.670146][68074:68079] CHIP:IN: (S) Sending msg 10625818 on secure session with LSID: 42613
[1673256155.670221][68074:68079] CHIP:EM: Flushed pending ack for MessageCounter:71438956 on exchange 6436i
[1673256155.670239][68074:68074] CHIP:TOO: Run command failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE)
[1673256176.005910][68074:68078] CHIP:DL: Got IP address on interface: wlp0s20f3 IP: <IP_ADDRESS>
[1673256176.006090][68074:68079] CHIP:DL: HandlePlatformSpecificBLEEvent 32770
[1673256286.597302][68074:68078] CHIP:DL: Got IP address on interface: wlp0s20f3 IP: <IP_ADDRESS>
[1673256286.597465][68074:68079] CHIP:DL: HandlePlatformSpecificBLEEvent 32770

@shun-dgut As per the Matter specification, SerialNumber is an optional attribute in the Basic Information Cluster. We add only the mandatory ones by default. If you want the SerialNumber, you can add the attribute using the data model APIs

Thanks，Can you tell me where to add it？

@shun-dgut You have to create serialNumber attribute here using create_serial_number API. Same as we created Node Label.

If you set serial number here^ it will not reflect as serial_number attribute is handled internally in connectedhomeip see here
You can set serial number using mfg-tool for that you will need to enable some configs through idf.py menuconfig.

Enabled ESP32 Factory Data Provider [Component config → CHIP Device Layer → Commissioning options → Use ESP32 Factory Data Provider]
Enabled ESP32 Device Instance Info Provider [Component config → CHIP Device Layer → Commissioning options → Use ESP32 Device Instance Info Provider]
Enabled Attestation - Factory [ Component config → ESP Matter → DAC Provider options → Attestation - Factory] { Since we are generating a custom partition using mfg_tool it needs to use proper DAC certificates }

Then flash bin generated via mfg-tool.
Then you will see serial_number set by you.

How about an option in mfg_tool to set the serial_number to the ESP32 chip's internal MAC address?

@jonsmirl mfg_tool generates binaries and do not interact with the device to fetch the mac address.
This utility generates "N" partitions, (default is 1) so either we would need N devices connected to the host and script has to provide N ports from where to read the mac address.
And serial number is an optional attribute

I think we can use https://github.com/project-chip/connectedhomeip/blob/master/scripts/tools/generate_esp32_chip_factory_bin.py for such purpose

@shun-dgut Please close the issue if it works fine

Closing. Please feel free to re-open if you are unable to generate and read the serial number


set manage_home to false

Is there a way to have manage_home set to false?
I don't want created users to get a copy of /etc/skel

Right now, the recipe as is does not parse a manage_home attribute within the databag. It does look to see if the home directory is set which if set to "/dev/null" will set manage_home to false. This probably isn't sufficient for your needs, but let us know.

I also noticed that I need to create the user home directory when manage_home is set to false.
But I've tried different ways to get+set users primary group as owner for the users home folder. But it always fails cause the resource is evaluated at the start of the chef run before the user is created.
Does anyway have a smart way to exclude some resources from being evaluated before they actually are executed?

So I added a PR, can someone help with the whole gid ownership thing?

When manage_home is set to false it means that you don't want chef to set up the directory as per the user resource documentation.
It sounds like you are looking for lazy evaluation of attributes .

Yes, that worked, will update the PR

Ok, Lazy Evaluation added and README fixed. PR updated.

Ok I feel I'm done with the "code" part. But some tests are failing, but I'll write about that in the PR.

closing this issue as because it's become stale.


Add missing method pages for Qiskit 0.19 to Qiskit 0.33

Part of fixing https://github.com/Qiskit/documentation/issues/542. We will regenerate Qiskit 0.32 and 0.34-0.43 in a follow up PR because we are still getting the original source docs for those.
Every version was generated like this: npm run gen-api -- -p qiskit -v 0.31.0 --historical -a "".
Note that this also brings in a recent change that results in removing some blank lines we had before.

This PR made me realize that the approach we took in https://github.com/Qiskit/documentation/pull/543 is not the best one. This PR regresses the UX quite a bit:

The method pages don't ever mention the class, so they're very confusing what the page refers to. We'd need to fix this, which takes time
It results in the user having to hop around the page a bunch
It bloats the left-side bar and makes the specific API version slower to load since there are so many pages.

Instead, the new plan is to revert https://github.com/Qiskit/documentation/pull/543 and figure out why it wasn't consistently working. Fix those edge cases. Concurrently, fix our redirect logic so that methods always go to their parent class.


Migrate to just includes.

I just closed the issue #27 on startingpoint and am moving it now here.

just seems to be very slow in updating currently. I have a tested solution, though.

Aliasing alias just='just --unstable' works (mostly) perfectly and just does not nag about it.
The only problem is that the default recipe in main.just errors out.
default:
   @just --list

This can be easily fixed by adding the --unstable flag to the command.

These are the two changes I'm proposing;

Replace the entirety of ublue-os-just.sh  with alias just='just --unstable'
Make the default recipe in main.justdefault:
    @just --unstable --list

Furthermore, instruct users to create a ~/.justfile with the following contents (maybe with a cat EOF command to make it extra easy).
!include /usr/share/ublue-os/just/main.just
!include /usr/share/ublue-os/just/nvidia.just
# only enable when using a custom image
# !include /usr/share/ublue-os/just/custom.just

The current system is functional, but still feels more of a hack compared to this. I'm also positive the PR for just making it possible to use a environment variable to set the unstable mode won't be merged in a while, as the latest commit touching on the project's code is from January and development seems sluggish there. Not to even say about when the ìnclude directive would be made stable.

Oh nice catch! Yeah let's do this, I put a help wanted tag on it!

Sure, I'll probably PR this in today.


Same Training Memory for different size models of RTMDet?

📚 The doc issue
Why do different size models of RTMDet have the same Training Memory (GB): 7.6 in https://github.com/open-mmlab/mmdetection/blob/3.x/configs/rtmdet/metafile.yml
Suggest a potential alternative/fix
No response

Sorry, forgot to update the memory info of RTMDet. I'll update it later.

Sorry, forgot to update the memory info of RTMDet. I'll update it later.

Get it. Thanks for your reply.

Solved in https://github.com/open-mmlab/mmdetection/pull/9098


raft: Remove the applied argument to newRaft and RestartNode.

I added this but no longer need it; it is never used with any value
but zero.

@bdarnell If we remove the applied index, the stateful application need to make sure each command is idempotent.
raft will recover from the latest snapshot and apply to the commit index. The stateful application might have applied some entries between snapshot index and the commit index before restart.

OK. I thought you were cautious about adding this in the first place, and neither of us has used it yet, so I thought we could get rid of it. But if it's still useful it's fine to keep it around.

@bdarnell I am cautious. As we have added it and raft interface is not fixed. How about keeping it there for a while?

OK


Using Torchmetrics with torch.compile in Pytorch 2.0

🐛 Bug
I have been trying to get torchmetrics to work smoothly with torch.compile in Pytorch 2.0. However, I got this warning after running through a few training steps:
torch._dynamo.convert_frame: [WARNING] torch._dynamo hit config.cache_size_limit (64)
   function: '<graph break in wrapped_func>' (pyt_tf2/lib/python3.9/site-packages/torchmetrics/metric.py:386)
   reasons:  self._update_count == 0
to diagnose recompilation issues, see https://pytorch.org/docs/master/dynamo/troubleshooting.html.

I've seen some explanation:
https://github.com/lucidrains/vit-pytorch/issues/262

TorchDynamo will convert and cache the Python bytecode, and the compiled functions will be stored in the cache. When the next check finds that the function needs to be recompiled, the function will be recompiled and cached. However, if the number of recompilations exceeds the maximum value set (64), the function will no longer be cached or recompiled. As mentioned above, the loss calculation and post-processing parts of the object detection algorithm are also dynamically calculated, and these functions need to be recompiled every time.

I understand that this warning means that although the compilation is giving up, the metric should still work correctly. However, possible speed up can be gained by addressing this warning
To Reproduce
Train any NN model with pytorch 2.0's torch.compile, torchmetrics and pytorch-lightning
class DummyClassifierPLWrapper(LightningModule):
    def __init__(
        self,
        num_classes: int,
        num_filters=6,
        training_config: Dict[str, Any] = default_training_config,
    ):
        super().__init__()
        self.model = DummyClassifier(num_classes)
        self.lr = training_config["lr"]
        self.milestones = training_config["milestones"]
        self.decay_rate = training_config["decay_rate"]

        self.train_acc = MulticlassAccuracy(num_classes=num_classes)
        self.val_acc = MulticlassAccuracy(num_classes=num_classes)
        self.test_acc = MulticlassAccuracy(num_classes=num_classes)

    def forward(self, x):
        return self.model(x)

    def training_step(self, batch, batch_idx):
        x, y = batch
        y_hat = self.model(x)
        loss = torch.nn.functional.cross_entropy(y_hat, y)
        with torch.no_grad():
            self.train_acc.update(y_hat, y)
        self.log("train_loss", loss, prog_bar=True)
        self.log("train_acc", self.train_acc, on_step=True, on_epoch=True, prog_bar=True)
        return loss
    ........

Expected behavior
The training run shouldn't see a "graph break" warning.
Environment

TorchMetrics version (and how you installed TM, e.g. conda, pip, build from source): using pip, version 0.11.4
Python & PyTorch Version (e.g., 1.0): Python 3.9, Pytorch 2.0.1, Pytorch-Lightning 2.0.2
Any other relevant information such as OS (e.g., Linux): Ubuntu 22.04, Nvidia-driver 530.30.02, Cuda 12.1, Cudnn <IP_ADDRESS>-1+cuda12.1

Hi @ductai199x, thanks for reporting this issue.
Would it be possible for you to provide a fully reproducible example to make the debugging process easier?

Hi @SkafteNicki, I have a short reproducible example:
import torch
import torch.nn as nn
import torch.nn.functional as F
import tqdm
from torch.utils.data import DataLoader, Dataset
from torchmetrics.classification import MulticlassAccuracy

class BoringModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.ln = nn.Linear(20, 5)
        self.accuracy = MulticlassAccuracy(5)

    def forward(self, x, y):
        y_hat = self.ln(x)
        return self.accuracy(y_hat, y)

class BoringDataset(Dataset):
    def __init__(self):
        self.X = torch.rand(1000, 20)
        self.y = torch.randint(0, 5, (1000,))

    def __getitem__(self, idx):
        return {"x": self.X[idx], "y": self.y[idx]}

    def __len__(self):
        return len(self.X)

model = BoringModel().to("cuda")
model = torch.compile(model)

data = DataLoader(BoringDataset(), batch_size=32)

torch._dynamo.config.verbose=True

for _ in range(5):
    for batch in tqdm.tqdm(data):
        o = model(**{k: v.to("cuda") for k, v in batch.items()})

At the end of the first epoch, it fails in this method:
def _wrap_update(self, update: Callable) -> Callable:
        @functools.wraps(update)
        def wrapped_func(*args: Any, **kwargs: Any) -> None:
            self._computed = None
            self._update_count += 1
            with torch.set_grad_enabled(self._enable_grad):
                try:
                    update(*args, **kwargs)
                except RuntimeError as err:
                    if "Expected all tensors to be on" in str(err):
                        raise RuntimeError(
                            "Encountered different devices in metric calculation (see stacktrace for details)."
                            " This could be due to the metric class not being on the same device as input."
                            f" Instead of `metric={self.__class__.__name__}(...)` try to do"
                            f" `metric={self.__class__.__name__}(...).to(device)` where"
                            " device corresponds to the device of the input."
                        ) from err
                    raise err

            if self.compute_on_cpu:
                self._move_list_states_to_cpu()

        return wrapped_func

Hi @stancld, thanks for the reproducibly example.
After looking at the traceback:

It seems setattr is the sinner, meaning that self._update_count += 1 statement is causing the recompile.
I found this recently opened issue https://github.com/pytorch/pytorch/issues/101168 that mentions that setattr is not yet supported.
I therefore assume there is nothing we can do before dynamo has wider support.

It seems like while the issue linked above is fixed, there are other unsupported operations. This is an exception thrown by trying to compile my model with into a single graph:
torch._dynamo.exc.Unsupported: call_method GetAttrVariable(UserDefinedObjectVariable(Signature), parameters) values [] {}

from user code:
   File "/path/to/my/code/simple.py", line 77, in training_step
    loss = self.train_metrics.update_and_loss(batch)
  File "/path/to/my/code/metrics.py", line 336, in update_and_loss
    self.update(nmll.detach(), batch["species"])
  File "/path/to/my/code/.venv/lib/python3.12/site-packages/torchmetrics/collections.py", line 229, in update
    m_kwargs = m._filter_kwargs(**kwargs)
  File "/path/to/my/code/.venv/lib/python3.12/site-packages/torchmetrics/metric.py", line 936, in _filter_kwargs
    exists_var_keyword = any(v.kind == inspect.Parameter.VAR_KEYWORD for v in _sign_params.values())

Some software versions:
pytorch-lightning==2.4.0
torch==2.4.1
torch-scatter==2.1.2
torchdata==0.8.0
torchmetrics==1.4.2
torchvision==0.19.1

I do not have the time to produce a minimal reproducible example, but I guess this should happen with any typical torchmetrics code.


Remove keepalive methods from net2 RFC

Issues came up in the implementation of these methods that caused us to
back off from implementing keepalive functionality for now.
r? @alexcrichton

Yeah these didn't make their way into libstd, and we can continue to work them out in net2 for now, so let's merge and consider re-RFC-ing before adding them to libstd.


feat: improve fallback logic

Features:

Add NewDefaultNativeStore()
Export DynamicStore and DynamicStore.IsAuthConfigured

Refactors:

storeWithFallbacks.Put() will fallback to the next store on ErrPlaintextPutDisabled
storeWithFallbacks.Delete() will delete the credentials in every store

TODOs:

Improve naming and comments
Add more unit tests

Fixes: #71

Codecov Report

Merging #73 (c9e5bc5) into main (97227b1) will decrease coverage by 2.11%.
The diff coverage is 61.29%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
- Coverage   81.13%   79.02%   -2.11%
==========================================
  Files           6        6
  Lines         371      391      +20
==========================================
+ Hits          301      309       +8
- Misses         48       59      +11
- Partials       22       23       +1

Impacted Files
Coverage Δ

native_store.go
68.18% <0.00%> (-8.75%)
:arrow_down:

store.go
73.19% <73.07%> (-3.64%)
:arrow_down:

Will mark this PR as ready for review once I complete the unit tests.

One usage of this change: https://github.com/notaryproject/notation/pull/712/files


Plan aggregates to utilize shard-projections if on single node

This fixes a performance regression introduced by switching to the
LogicalPlanner
Aggregations running on a single node should also utilize shard-level
projections to benefit from additional parallelism.

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@9465e4e). Click here to learn what that means.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master    #6433   +/-   ##
=========================================
  Coverage          ?   82.78%
  Complexity        ?    12934
=========================================
  Files             ?     1485
  Lines             ?    48220
  Branches          ?     5846
=========================================
  Hits              ?    39917
  Misses            ?     5544
  Partials          ?     2759

Impacted Files
Coverage Δ
Complexity Δ

...java/io/crate/planner/operators/HashAggregate.java
95.52% <100%> (ø)
15 <0> (?)

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 9465e4e...d2e50f5. Read the comment docs.


Provide Collector APIKit for metrics and traces, maybe alarms

For SRE purpose, they will develop an ecosystem around the APM/Tracing system. So they need more than UI, they need APIKit for acessing all metrics, traces, alarms with some conditions from the collector.
This is a whole proposal for @sky-walking team

I assume this feature wil be provided by GraphQL-style Collector-QUERY APIs


What is current state of light plugins?

Hello guys, I'm completely lost. What is current state of the light plugins? Is it possible to achive something like this https://pixijs.io/pixi-lights/demo/index.html in pixi v5?
Thank you very much.

@bigtimebuddy We can always transfer issues within the PixiJS organization :)

Did not know that! Thanks @SukantPal. I don't see that on the GH app. Will check it out on desktop.

So what I observed:

plugin works with pixi v4
port to v5 is in the hands of a nondeterministic god #41
after all, maybe like me, you don't need full-blown lights for your 2d game, try to check masks this https://pixijs.io/examples/#/masks/filter.js


No support for backup and restore

Describe the bug
After using a Google account to restore a backup of a device. If you have shortcuts created via "Add to homescreen" they won't work after the restore.
To Reproduce
Steps to reproduce the behavior:
Open kiwi browser and visit any webpage.
Press the three dots and select "Add to homescreen"
Ensure your device is backed up to Google e.g use Google one app or settings.
Then on a factory reset device (or new) restore the backup via your Google account.
All icons should restore but shortcuts created via kiwi browser won't open - a prompt is shown saying "Couldn't restore shortcut because app doesn't support backup and restore". These shortcuts are also greyed out.
Expected behavior
A clear and concise description of what you expected to happen.
Shortcut is restored and can be used
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):

Device: Google Pixel 2XL backed up then restored onto Google Pixel 6
Android Version : 12
Kiwi Browser Version  96.0.4664.46

Additional context
If you cannot remember the URL of these shortcuts you can no longer access them which is quite annoying.

To be honest, I think, this is more of a side effect, this bug as I phrased it above isn't that important. But what's important is to support backup and restore so when you change your device you don't lose your history+ bookmarks etc (I know bookmarks can be exported but who's going to remember to do that...).

Closing and linking this to #122


Farmer's Delight tomato plant bug - MC 1.21 - Mod ver. 4.3.1

When harvesting tomatoes from Farmer's Delight, the ropes that helps extend the plant ends up getting deleted. The plant will end up breaking itself after a block update.
edit: forgot to mention its on NeoForge 21.1.37

Thank you both for reporting, should be fixed in the latest versions


cannot find 'fence_mermaid' in the module 'mermaid2'

Hello,
I encounter this following bug:
INFO    -  Building documentation...

MkDocs encountered as error parsing the configuration file: while constructing a Python object
cannot find 'fence_mermaid' in the module 'mermaid2'
  in "/home/unger/tmp/test/mkdocs-mermaid2/mkdocs-mermaid2-plugin/test/mkdocs.yml", line 24, column 19

Steps to reproduce the bug

git clone https://github.com/fralau/mkdocs-mermaid2-plugin

cd mkdocs-mermaid2-plugin
sudo python setup.py install

cd test
python -m mkdocs serve

It seems that mkdocs cannot find fence_mermaid in mermaid2
          format: !!python/name:mermaid2.fence_mermaid

Thanks for your help

This is strange...
In the Python REPL, can you do:
>>> import mermaid2
>>> mermaid2.fence_mermaid
<function fence_mermaid at 0x10e4ab4d0>

Does the function appear?

Thank you @fralau for your quick answer.
Here is the output
% python                                                              20s ~/tmp/test/mkdocs-mermaid2/mkdocs-mermaid2-plugin/test master
Python 3.8.3 (default, May 17 2020, 18:15:42)
[GCC 10.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mermaid2
>>> mermaid2.fence_mermaid
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'mermaid2' has no attribute 'fence_mermaid'
>>>

The mermaid module seems to be found since I get no error in python REPL when I import it.

Here are the versions used when I do
pip install mkdocs-mermaid2-plugin --upgrade :
Defaulting to user installation because normal site-packages is not writeable
Requirement already up-to-date: mkdocs-mermaid2-plugin in /home/unger/.local/lib/python3.8/site-packages (0.1.5.post1)
Requirement already satisfied, skipping upgrade: beautifulsoup4>=4.6.3 in /home/unger/.local/lib/python3.8/site-packages (from mkdocs-mermaid2-plugin) (4.9.1)
Requirement already satisfied, skipping upgrade: setuptools>=18.5 in /usr/lib/python3.8/site-packages (from mkdocs-mermaid2-plugin) (47.1.1)
Requirement already satisfied, skipping upgrade: mkdocs>=1.0.4 in /home/unger/.local/lib/python3.8/site-packages (from mkdocs-mermaid2-plugin) (1.1.2)
Requirement already satisfied, skipping upgrade: soupsieve>1.2 in /home/unger/.local/lib/python3.8/site-packages (from beautifulsoup4>=4.6.3->mkdocs-mermaid2-plugin) (2.0.1)
Requirement already satisfied, skipping upgrade: livereload>=2.5.1 in /home/unger/.local/lib/python3.8/site-packages (from mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (2.6.2)
Requirement already satisfied, skipping upgrade: click>=3.3 in /usr/lib/python3.8/site-packages (from mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (7.1.2)
Requirement already satisfied, skipping upgrade: lunr[languages]==0.5.8 in /home/unger/.local/lib/python3.8/site-packages (from mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (0.5.8)
Requirement already satisfied, skipping upgrade: tornado>=5.0 in /home/unger/.local/lib/python3.8/site-packages (from mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (6.0.4)
Requirement already satisfied, skipping upgrade: Markdown>=3.2.1 in /home/unger/.local/lib/python3.8/site-packages (from mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (3.2.2)
Requirement already satisfied, skipping upgrade: PyYAML>=3.10 in /usr/lib/python3.8/site-packages (from mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (5.3.1)
Requirement already satisfied, skipping upgrade: Jinja2>=2.10.1 in /usr/lib/python3.8/site-packages (from mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (2.11.2)
Requirement already satisfied, skipping upgrade: six in /usr/lib/python3.8/site-packages (from livereload>=2.5.1->mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (1.15.0)
Requirement already satisfied, skipping upgrade: future>=0.16.0 in /usr/lib/python3.8/site-packages (from lunr[languages]==0.5.8->mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (0.18.2)
Requirement already satisfied, skipping upgrade: nltk>=3.2.5; python_version > "2.7" and extra == "languages" in /home/unger/.local/lib/python3.8/site-packages (from lunr[languages]==0.5.8->mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (3.5)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /usr/lib/python3.8/site-packages (from Jinja2>=2.10.1->mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (1.1.1)
Requirement already satisfied, skipping upgrade: joblib in /home/unger/.local/lib/python3.8/site-packages (from nltk>=3.2.5; python_version > "2.7" and extra == "languages"->lunr[languages]==0.5.8->mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (0.15.1)
Requirement already satisfied, skipping upgrade: regex in /home/unger/.local/lib/python3.8/site-packages (from nltk>=3.2.5; python_version > "2.7" and extra == "languages"->lunr[languages]==0.5.8->mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (2020.6.7)
Requirement already satisfied, skipping upgrade: tqdm in /home/unger/.local/lib/python3.8/site-packages (from nltk>=3.2.5; python_version > "2.7" and extra == "languages"->lunr[languages]==0.5.8->mkdocs>=1.0.4->mkdocs-mermaid2-plugin) (4.46.1)

Your installed version 0.1.5 does not correspond to the github version (0.2.1).
My best guess is that you did not actually upgrade to the new version?

Contrarily to https://github.com/fralau/mkdocs-mermaid2-plugin/commit/5ccbe4d6a2a67052c303606cb74d30388b48a843 , mermaid2/__init__.py is empty in my system.
cat /home/unger/.local/lib/python3.8/site-packages/mermaid2/__init__.py

Your installed version 0.1.5 does not correspond to the github version (0.2.1).
My best guess is that you did not actually upgrade to the new version?
Thanks for pointing this me out. How can I install it?
Why pip install mkdocs-mermaid2-plugin --upgrade does not suffice?

Your version does not correspond to that on github.

Not sure. Try to uninstall and reinstall?

It did fixed it. I don't why I had a former version in cache, even if I provided "--upgrade".
Thank you very much for help!

No problem. Happy to help 🙂


Metadata search in comments does not work the first time you open the corresponding dialog

System information:

Operating system (distribution) and version Windows 10
DBeaver version 21.2.0 UE

Steps to reproduce, if exist:

Open Search -> DB Metadata dialog
Set 'Search in comments' checkbox
Search for something. Search in comments won't be performed.

Fixed.

Verified