feat: manage nested inductive types in deriving

Adds support for handling nested inductive types in derive handlers
This changes the Deriving codebase a fair bit, I'll probably need to split this into multiple PRs.
In particular, the file FromToJson.lean has been refactored a fair bit.
(Will add a more thorough description once the PR is stable)
Closes #2329

WIP

Oh, did I miss that this is ready for review? The label still says WIP.

Whoops, forgot to change that. This is indeed ready for review, I sent Kim some details in DM regarding that PR, but I might as well put it all in here for documentation purposes:
The PR changes a fair amount of things in the Deriving codebase, namely:

The derive handlers for FromJson and ToJson have been refactored to be similar to the other implementations. Their logic has stayed the same, but the content was cut into more functions to make it more readable (i.e the implementation to derive for structs and inductives used to be in one big function with huge if-then-elses, so these were split).
The logic in Util.lean has been modified. Instead of working on inductive types, it now relies on a type NestedOccurence, which represents either base inductives (with the leaf constructor), or a nested occurence in the constructor of another inductive type (as nodes). That way, via an initial traversal the inductive types getting their derivations, we can gather all the different nested occurences appearing in them, to know which functions we need to define in the mutual block to derive the typeclass needed. For example:

inductive Foo (α : Type u) : Type u :=
  | foo : List (Option (Foo α)) → Foo α
deriving DecidableEq

Will generate a mutual block with the definitions:
mutual
  def decEqOptionFoo {α} [DecidableEq α] (x : Option (Foo α)) (x1 : Option (Foo α)) : Decidable (x = x1) := ...
  def decEqListOptionFoo {α} [DecidableEq α] (x : List (Option (Foo α))) (x1 : List (Option (Foo α))) : Decidable (x = x1) := ...
  def decEqFoo {α} [DecidableEq α] (x : Foo α) (x1 : Foo α) : Decidable (x = x1) := ...
end

Because Util.lean has changed, all the derive handlers needed to be adapted to those changes.

When first working on the PR, I was hoping to be able to use these modifications to Util to get rid of usePartial altogether in the derive handlers. However, the modifications made here are insufficient for this.
One further change I would like to make in a subsequent PR would be to change how the functions for nested occurences are derived. Currently, if a nested occurence (i.e Option (Foo A)) needs to be derived, the derive handler will generate the necessary function. However, if such an instance already exists for i.e Option A, using that instance as the function in the mutual block (i.e with A replaced with Foo A) might prove more sensible. In particular, this would allow us to get rid of usePartial in FromJson, ToJson and Repr without changing their current outputs on nested/mutual types. I'm planning on looking into this possibility in the future.
The PR currently passes CI/CL on Lean 4, but fails to compile batteries and mathlib.

For batteries, because I've needed to upstream  Sum.elim from the repo, leading to a duplicate definition
For Mathlib, because their derive handler for ToExpr relies on the lean core deriving mechanism, and would thus need to be adapted to the new API (I am willing to do such a PR)

awaiting-review

Thanks! Maybe worth doing the mathlib adaption on a branch to be sure that it works before we merge?
Would it be too much work to put the JSON refactoring into a PR of it's own, or would that require work that is then thrown away again?

WIP

Thanks! Let me know if you need anything from me

awaiting-review

Thanks! You can push that commit to the branch lean-pr-testing-3160, then this should get the nice builds-mathlib label and when the maintainers update mathlib after a new lean release they'll find your fixes.

Sum.elim isn't an absolute necessity for the PR, it's only used once, I just thought this was the best way to code this function and upstreamed what I needed. I could just make the match by hand.

I think I was wondering whether and why it needs a stage0 update.

Hmm, I remember having some build failures on stage2 without it at some point, but it seems to be working without it now. All the better ! I'll remove it.

Playing around with it a bit I notice that for
inductive Tree where | node : Array Tree → Tree
deriving DecidableEq, BEq

we get
mutual
       set_option match.ignoreUnusedAlts✝ true
       private partial def beqTree✝ (x✝ : @Tree✝) (x✝¹ : @Tree✝) : Bool✝ :=
         let localinst✝ : BEq✝ (@Tree✝) := ⟨beqTree✝⟩;
         match x✝, x✝¹ with
         | @Tree.node a✝, @Tree.node b✝ => a✝ == b✝
         | _, _ => false✝
     end,
     instance : BEq✝ (@Tree✝) :=
       ⟨beqTree✝⟩

but
mutual
       private def decEqListTree✝ (x✝ : @List✝ (@Tree✝)) (x✝¹ : @List✝ (@Tree✝)) : Decidable✝ (x✝ = x✝¹) :=
         match x✝, x✝¹ with
         | @List.nil _, @List.nil _ => isTrue✝ rfl✝
         | List.nil .., List.cons .. => isFalse✝ (by intro h✝; injection h✝)
         | List.cons .., List.nil .. => isFalse✝ (by intro h✝; injection h✝)
         | @List.cons _ a✝ a✝¹, @List.cons _ b✝ b✝¹ =>
           let inst✝ := decEqTree✝ @a✝ @b✝;
           if h✝¹ : @a✝ = @b✝ then by subst h✝¹;
             exact
               let inst✝¹ := decEqListTree✝ @a✝¹ @b✝¹;
               if h✝² : @a✝¹ = @b✝¹ then by subst h✝²; exact isTrue✝¹ rfl✝¹
               else isFalse✝¹ (by intro n✝; injection n✝; contradiction)
           else isFalse✝² (by intro n✝¹; injection n✝¹; contradiction)
       termination_by structural x✝
       private def decEqArrayTree✝ (x✝² : @Array✝ (@Tree✝)) (x✝³ : @Array✝ (@Tree✝)) : Decidable✝ (x✝² = x✝³) :=
         match x✝², x✝³ with
         | @Array.mk _ a✝², @Array.mk _ b✝² =>
           let inst✝² := decEqListTree✝ @a✝² @b✝²;
           if h✝³ : @a✝² = @b✝² then by subst h✝³; exact isTrue✝² rfl✝²
           else isFalse✝³ (by intro n✝²; injection n✝²; contradiction)
       termination_by structural x✝²
       private def decEqTree✝ (x✝⁴ : @Tree✝) (x✝⁵ : @Tree✝) : Decidable✝ (x✝⁴ = x✝⁵) :=
         match x✝⁴, x✝⁵ with
         | @Tree.node a✝³, @Tree.node b✝³ =>
           let inst✝³ := decEqArrayTree✝ @a✝³ @b✝³;
           if h✝⁴ : @a✝³ = @b✝³ then by subst h✝⁴; exact isTrue✝³ rfl✝³
           else isFalse✝⁴ (by intro n✝³; injection n✝³; contradiction)
       termination_by structural x✝⁴
     end,
     instance : DecidableEq✝ (@Tree✝) :=
       decEqTree✝

Where in the code is the decision made to translate them differently?
I’m a bit worried about the latter. While all DecidableEq are logically equivalent, they do differ in their run-time behavior, and this matters whenever someone writes if t1 = t2, right? Otherwise we wouldn’t have a custom implementation for array in https://github.com/leanprover/lean4/blob/e9e858a4484905a0bfe97c4f05c3924ead02eed8/src/Init/Data/Array/DecidableEq.lean#L47-L51.
The author of the Tree type above might reasonable expect that decidable equality on their type uses that Array implementation, and not a naive one via list as generated by the deriving code.
But I also don’t see an easy alternative. partial doesn’t make sense for DecidableEq, I assume. Somehow copying the instance code seems hairy.
Maybe after creating decEqArrayTree we could automatically prove a csimp lemma that connects it to the inferred implementation? For DecidableEq at least that proof is simple (DecidableEq is a subsingleton). Would that work?
Which other instances are not using partial here? It seems that most use partial and hence the “right” instance.

I'm not sure I would call the partial instance the "right" one. Especially if one hopes to prove properties about the BEq instance (I have wanted to implement a LawfulBEq deriving instance for some time), partial makes that impossible so I would prefer to not see it used any more than it already is. Instead, we should have better combinators to make it possible to actually implement a terminating function over nested recursive types which doesn't have to break the Array abstraction.

Where in the code is the decision made to translate them differently?

This is dictated by the withNested argument of mkContext. This differentiation was made to ensure the behaviour of the usual derive handlers wouldn't change. For example, the FromJson and ToJson instances for Array are quite specific, and having them change in nested inductives would break a lot of code, and lead to unreliable derive handlers.

I’m a bit worried about the latter. While all DecidableEq are logically equivalent, they do differ in their run-time behavior, and this matters whenever someone writes if t1 = t2, right?

Right. This is the biggest issue with the current PR IMO, and I plann on tackling this in a later PR if that's acceptable (I have not yet started working on any proof-of-concept for such a PR).

Somehow copying the instance code seems hairy.

This is my initial solution to the problem, but it would impose some challenges (for example, if some instance is defined using some extern binding, how feasable would it be to add that binding to the "new" function as well ?).
I think doing this would be the most reliable solution though, as it would allow most handlers to get rid of partial altogether. Adding some csimp lemmas to the mix as well might solve all the abovementioned issues, but on non-singleton types, proving these csimp lemmas might prove non-trivial..

Which other instances are not using partial here ?

For now, only DecidableEq gets rid of partial.

I'm not sure I would call the partial instance the "right" one.

I agree that it would be ideal to get rid of partial in the derive handlers altogether, any other ideas on how this should be solved are welcome.

but on non-singleton types, proving these csimp lemmas might prove non-trivial..

What I mean is that for every Type t, the Type DecidableEq t is a subsingleton (isn't it?) so proving a csimp between the derived and the user defined one should always be trivial?

Would be nice indeed, but I don't really have a good idea. Maybe with https://github.com/leanprover/lean4/issues/4749 and with all functions involved refined using primitive recursion? But that won't help when a user wrote an off standard method.
For the present PR I am hesitant to merge it while we get the unexpected behavior. Maybe the csimp approach would be good enough.
Or, even less ambitious: somehow keep track of which instances were derived and only derive nested instances where all involved type formers have instances that were also derived and where we thus know that they behave like the one we are writing.
Sorry for not thinking of this issue before!

I think the csimp approach is doable. Another, albeit hacky-ish solution, would be to

keep the current derivation
we could make a partial DecidableEq instance using Classical theorems, and link that to the derived implementation using implemented_by to get the correct runtime behaviour

For example, the code generated for the array tree would look like this:
inductive Tree where | node : Array Tree → Tree

noncomputable instance : Inhabited (DecidableEq α) := ⟨Classical.typeDecidableEq _⟩  in
partial def decEqTreePartial (x4 : @Tree) (x5 : @Tree) : Decidable (x4 = x5) :=
  let inst : DecidableEq Tree := decEqTreePartial
  match x4, x5 with
  | @Tree.node a3, @Tree.node b3 =>
    if h4 : @a3 = @b3 then by subst h4; exact isTrue rfl
    else isFalse (by intro n3; injection n3; contradiction)

mutual
  def decEqListTree (x : List Tree) (x1 : List Tree) : Decidable (x = x1) :=
    match x, x1 with
    | @List.nil _, @List.nil _ => isTrue rfl
    | List.nil .., List.cons .. => isFalse (by intro h; injection h)
    | List.cons .., List.nil .. => isFalse (by intro h; injection h)
    | @List.cons _ a a1, @List.cons _ b b1 =>
      let inst := decEqTree a b;
      if h1 : a = b then by subst h1; exact (
          let inst1 := decEqListTree @a1 @b1
          if h2 : a1 = b1 then
            by subst h2; exact isTrue rfl
          else
            isFalse (by intro n; injection n; contradiction)
      )
      else isFalse (by intro n1; injection n1; contradiction)
  termination_by structural x

  def decEqArrayTree (x2 : @Array (@Tree)) (x3 : @Array (@Tree)) : Decidable (x2 = x3) :=
    match x2, x3 with
    | @Array.mk _ a2, @Array.mk _ b2 =>
      let inst2 := decEqListTree @a2 @b2;
      if h3 : @a2 = @b2 then by subst h3; exact isTrue rfl
      else isFalse (by intro n2; injection n2; contradiction)
  termination_by structural x2

  @[implemented_by decEqTreePartial]
  def decEqTree (x4 : Tree) (x5 : Tree) : Decidable (x4 = x5) :=
    match x4, x5 with
    | Tree.node a3, Tree.node b3 =>
      let inst3 := decEqArrayTree a3 b3;
      if h4 : a3 = b3 then by subst h4; exact isTrue rfl
      else isFalse (by intro n3; injection n3; contradiction)
  termination_by structural x4
end

instance : DecidableEq Tree :=
  decEqTree

Sorry, but I'm not getting it. What is the purpose of decEqTreePartial, and how does it help?

decEqTreePartial is "the right" DecidableEq instance in that it provides the expected runtime behaviour for decEqTree, and will use the already defined DecidableEq instances for List and Array in that example

Ah, now I see it, on the laptop the code is easier to understand :-)
And the purpose of
noncomputable local instance : Inhabited (DecidableEq α) := ⟨Classical.typeDecidableEq _⟩  in

is merely to to avoid
failed to compile partial definition 'decEqTreePartial', failed to show that type is inhabited and non empty

right?
Would it be better or worse to omit that and use unsafe instead of partial then? That definition is only used in implementedBy, so we might as well hide it from the kernel completely.
Hmm, not bad overall. Better or worse than this variant?
inductive Tree where | node : Array Tree → Tree

mutual
  def decEqListTree (x : List Tree) (x1 : List Tree) : Decidable (x = x1) :=
    match x, x1 with
    | @List.nil _, @List.nil _ => isTrue rfl
    | List.nil .., List.cons .. => isFalse (by intro h; injection h)
    | List.cons .., List.nil .. => isFalse (by intro h; injection h)
    | @List.cons _ a a1, @List.cons _ b b1 =>
      let inst := decEqTree a b;
      if h1 : a = b then by subst h1; exact (
          let inst1 := decEqListTree @a1 @b1
          if h2 : a1 = b1 then
            by subst h2; exact isTrue rfl
          else
            isFalse (by intro n; injection n; contradiction)
      )
      else isFalse (by intro n1; injection n1; contradiction)
  termination_by structural x

  def decEqArrayTree (x2 : @Array (@Tree)) (x3 : @Array (@Tree)) : Decidable (x2 = x3) :=
    match x2, x3 with
    | @Array.mk _ a2, @Array.mk _ b2 =>
      let inst2 := decEqListTree @a2 @b2;
      if h3 : @a2 = @b2 then by subst h3; exact isTrue rfl
      else isFalse (by intro n2; injection n2; contradiction)
  termination_by structural x2

  def decEqTree (x4 : Tree) (x5 : Tree) : Decidable (x4 = x5) :=
    match x4, x5 with
    | Tree.node a3, Tree.node b3 =>
      let inst3 := decEqArrayTree a3 b3;
      if h4 : a3 = b3 then by subst h4; exact isTrue rfl
      else isFalse (by intro n3; injection n3; contradiction)
  termination_by structural x4
end

instance : DecidableEq Tree :=
  decEqTree

-- now patch up the implementations of any nested derived instance

def realDecEqArrayTree (x2 : @Array (@Tree)) (x3 : @Array (@Tree)) : Decidable (x2 = x3) := inferInstance

@[csimp]
theorem decEqArrayTree_eq : @decEqArrayTree = @realDecEqArrayTree := by
  ext t1 t2; apply Subsingleton.allEq

It's still not perfect in the cases where the nested type has a manually written (maybe more efficient) DecidableEq instance that the user plans to use in kernel reduction (e.g. using by decide).

The local instance is just used to avoid the error message, and using unsafe might just be better indeed.
In both cases, having a non-ideal kernel reduction seems unavoidable sadly. The ultimate solution would still be to use the already existing instance in the mutual block, but that would open another can of worms I don't have the time to get into currently, hence why I'd like to work on that in a follow-up PR.
If we assume that this is a temporary hack, I would tend towards using the unsafe approach instead of the csimp one, simply for ease of implementation, but I'm not against choosing csimp. Any opinion is welcomed.

Either hack is fine with me, if we want a hack at all. I'm not sure if the feature “derivable decidable equality for nested induction” itself is worth introducing hacks and complications for - how pressing is it for our users? I'll also check back with Leo, as the reporter of #2329.

Ah, forgot to report back.
I don’t think we had a good solution either.
The safest bet would be to fail instead of deriving possibly bad nested inductives, with a good error message that points to a github issue where users can complain.
The next safest bet might be an internal attribute that we use to track “this type’s DecidableEq instance is derived”, and do the construction for those types whose instance is itself derived, because for them we know we are generating equivalent code. Not very satisfying, though.

The next safest bet might be an internal attribute that we use to track “this type’s DecidableEq instance is derived”
This would mean that users could derive DecidableEq with no issue for an inductive nested by a List, but would have an error when trying with an Array instead. I don't think this is acceptable

I still believe "specializing" an already existing instance inside our mutual block is the right way to go in the long run, despite the technical challenges it would impose.
In any case, I do not have time to allocate to this anytime soon. Adding to that that the PR needs a rework to get rid of IndTypeFormers and to rely on the already existing IndGroupInst architecture instead, I'm guessing the best choice would be to close the PR ?

It pains me if that’s the conclusion, given the work that went into this PR. Sometimes that’s just how it goes, but still unfortunate.
The refactoring to use IndGroupInst could be done by me – that’s a privilege you have as a volunteer contributor over paid employees :-).
But the other, semantic problem remains, and we might have to park this until we have a better plan.
(Just to double-check: For the instances that use withNested := false and thus the partial translation this PR does not change how it works functionality, does it?)

It pains me if that’s the conclusion, given the work that went into this PR.

I don't hold a negative sentiment WRT closing the PR, better have no code merged than some bad one. It's a learning experience either way, I should not have dived into my design choices before first discussing it with someone, doing so would have helped with seeing these issues earlier.

For the instances that use withNested := false and thus the partial translation this PR does not change how it works functionality, does it?

There shouldn't be any change in the behaviour of handlers that use withNested := false, no.


Issue #110: Improve documentation of fetch_blob_container()

This PR closes #110. I think it's clearest not to describe the function as "impure" and to be more direct about it.

Wikipedia for "pure function" https://en.wikipedia.org/wiki/Pure_function:

the function return values are identical for identical arguments (no variation with local static variables, non-local variables, mutable reference arguments or input streams, i.e., referential transparency), and
the function has no side effects (no mutation of local static variables, non-local variables, mutable reference arguments or input/output streams).

So it looks to me like the LLM summary is correct. Pure functions should have no side effects. It's also mentioned on the link from the Stack exchange that pure functions should be deterministic:

The return value of the pure functions solely depends on its arguments Hence, if you call the pure functions with the same set of arguments, you will always get the same return values.

Hence:

When writing code, I try to make all of my functions pure and isolate any impure behavior into distinct functions with a flag in the docs. I'd prefer to keep that approach here.

If impure behaviour is isolated into functions tagged with "impure" then should we be adding "impure function" to all our MCMC functions? I mean maybe you're doing this with seeds.
So yeah, fun investigation. IMO use of "impure" isn't clarifying once it's already been explicitly mentioned the reason for the impurity. It'd be like "the funciton has property X. Which makes it a member of class A. (Where the features of class A are that members of class A have at least one of properties X, Y, and Z.) Well then of course it's of class A, what additional have I learnt be being told that? Perhaps that "class A!!" should cary a warning, and that's how you see "impure".
If you disagree I'll add it in, no need to type response just thumbs down this.

Perhaps that "class A!!" should cary a warning, and that's how you see "impure".

Yes, it's this.

If impure behaviour is isolated into functions tagged with "impure" then should we be adding "impure function" to all our MCMC functions? I mean maybe you're doing this with seeds.

This is also a great point and, yes, anything depending on global random state would be impure. That's why we've taken pains in this pipeline to seed the PRNG wherever necessary -- making the functions pure.

I've updated this @zsusswein!


AttributeError: 'VectorStoreRetriever' object has no attribute 'args_schema'

System Info

LangChain: 0.0.353
System: Ubuntu 22.04
Python: 3.10.12

Information
I run the code in the quickstart part of the document, code:
from langchain.chat_models import ChatOpenAI
from langchain import hub
from langchain.agents import create_openai_functions_agent
from langchain.agents import AgentExecutor

# Get the prompt to use - you can modify this!
prompt = hub.pull("hwchase17/openai-functions-agent")
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
agent = create_openai_functions_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

However, the Python interpreter told me:
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/tmp/ipykernel_665358/3241410387.py in <module>
      7 prompt = hub.pull("hwchase17/openai-functions-agent")
      8 llm = ChatOpenAI(openai_api_key=openai_api_key, model="gpt-3.5-turbo", temperature=0)
----> 9 agent = create_openai_functions_agent(llm=llm, tools=tools, prompt=prompt)
     10 agent_executor = AgentExecutor(agent, tools, verbose=True)

[~/.local/lib/python3.10/site-packages/langchain/agents/openai_functions_agent/base.py](https://vscode-remote+ssh-002dremote-002b158-002e132-002e9-002e210.vscode-resource.vscode-cdn.net/home/iot/Documents/langchain/~/.local/lib/python3.10/site-packages/langchain/agents/openai_functions_agent/base.py) in create_openai_functions_agent(llm, tools, prompt)
    285         )
    286     llm_with_tools = llm.bind(
--> 287         functions=[format_tool_to_openai_function(t) for t in tools]
    288     )
    289     agent = (

[~/.local/lib/python3.10/site-packages/langchain/agents/openai_functions_agent/base.py](https://vscode-remote+ssh-002dremote-002b158-002e132-002e9-002e210.vscode-resource.vscode-cdn.net/home/iot/Documents/langchain/~/.local/lib/python3.10/site-packages/langchain/agents/openai_functions_agent/base.py) in <listcomp>(.0)
    285         )
    286     llm_with_tools = llm.bind(
--> 287         functions=[format_tool_to_openai_function(t) for t in tools]
    288     )
    289     agent = (

[~/.local/lib/python3.10/site-packages/langchain_community/tools/convert_to_openai.py](https://vscode-remote+ssh-002dremote-002b158-002e132-002e9-002e210.vscode-resource.vscode-cdn.net/home/iot/Documents/langchain/~/.local/lib/python3.10/site-packages/langchain_community/tools/convert_to_openai.py) in format_tool_to_openai_function(tool)
     10 def format_tool_to_openai_function(tool: BaseTool) -> FunctionDescription:
     11     """Format tool into the OpenAI function API."""
---> 12     if tool.args_schema:
     13         return convert_pydantic_to_openai_function(
     14             tool.args_schema, name=tool.name, description=tool.description

AttributeError: 'VectorStoreRetriever' object has no attribute 'args_schema'

It seems that some packages have version incompatibility.

[X] The official example notebooks/scripts
[ ] My own modified scripts

Related Components

[ ] LLMs/Chat Models
[ ] Embedding Models
[ ] Prompts / Prompt Templates / Prompt Selectors
[ ] Output Parsers
[ ] Document Loaders
[ ] Vector Stores / Retrievers
[ ] Memory
[X] Agents / Agent Executors
[X] Tools / Toolkits
[ ] Chains
[ ] Callbacks/Tracing
[ ] Async

Reproduction

Directly run the following code:

from langchain.chat_models import ChatOpenAI
from langchain import hub
from langchain.agents import create_openai_functions_agent
from langchain.agents import AgentExecutor

# Get the prompt to use - you can modify this!
prompt = hub.pull("hwchase17/openai-functions-agent")
llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
agent = create_openai_functions_agent(llm, tools, prompt)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

Expected behavior
It should run successfully without any error report.

@lemingshen The error stack indicates that your tool does not have an args_schema attribute. And tool is your customized code.
You should try to post how your tools are defined in order to determine if there is a problem with the initialization of tools.


r2: list() max objects

cc @markdembo
Clarify how list() works in a Workers binding.

Superseded by 16374


Sales Reports VAT

Please verify that this feature request has NOT been suggested before.

[X] I checked and didn't find a similar feature request

Problem statement
Currently the customers/suppliers/manufacturers do not have a field indicating the VAT number nor VAT %. could this be added
and can we then use it in the sales report?
Suggested solution
add 2 additional field to customer details: VAT.Nr and VAT %.
add order.customer.vat to be used in rendering reports.
Describe alternatives you've considered
?
Examples of other systems
No response
Do you want to develop this?

[ ] I want to develop this.

Adding a VAT number for the customer is straightforward - it's just a number, and doesn't have any immediate implications. I put it in the description field for companies, but that's just because I thought it was handy.
VAT-% and so on is definitely more complicated. Not only will it depend on customers, it might depend on what you are selling as well, ie be different per sales order line.
Customers, sales orders, sales order lines all have metadata activated. I would suggest this is something that could be put in the metadata fields, by a plugin.

Sounds good thank you.
we need to print the VAT number on the invoices.
as for the VAT per part. true. this would actually imply that a part gets a VAT% since depending on the good these might very.
but also the customers/suppliers/manufacturer have a VAT%. typically when selling within the same country you need to charge VAT. but under some circumstance the buyer might be free from VAT. but whenever sending to other countries thats when we do not need add VAT and hence the VAT% could be 0 i guess.
Customer setting would in my case overwrite the part.vat.

The point is that it's very hard to get this right, in general. What you describe is valid in the EU - what about outside? If VAT functionality is a part of the core, it needs to be use-able for all cases.
A plugin is much more flexible, and can be used by those who require it / adapted to fit local regulations.

InvenTree does not include proper business accounting functionality. So I would really question if it makes sense to create full invoices from it.
@SchrodingersGat I think we should discuss putting this on the roadmap. It suggests that we will - at some point - implement tax support. From my experience with this area I can tell you 2 things:

Getting it right every time is very hard
Getting it wrong makes your life as a business and individually very hard

Although we are MIT licensed and do not have any warranty to fear I think including even adding a percentage puts us in an ethical liability to get it right. Without anyone with proper tax/accounting knowledge on the core team, we should stay away from taxes or proper accounting as far as possible IMO.

@matmair I would tend to agree - we either get it perfect of explicity don't do it. My preference would strongly be to allow easy ingress / egress of order data to other systems which support finance / accounting operations, and focus on the stock management side.
I have recently been discussing this topic with regard to GST in Australia. Implementing a generic system which works "everywhere" would be exceptionally difficult.

Hi All,
for now i just created two templates one fo export (excl VAT) and one including VAT.
closing this issue


Expired verifications causes primary key conflict when attempting to verify

If there are any expired verifications for a user, the system still attempts to insert a new one if the user requests verification.  This causes a primary key conflict.
I fixed this by adding this code in GetPendingVerificationForUser to first delete any expired verifications for the user.  Not sure if this is the best approach - if so, please add to baseline.  If not, please tell me a better way to fix it :)
    private async Task<Verification> GetPendingVerificationForUser(IUser user)
    {
        // first get any expires ones
        var expiredVerifications =
        await (from v in this.db.Verification.Include(o => o.User).Include(o => o.User.Roles)
            where v.UserId == user.UserId && v.RedeemedAt == null &&
            v.IssuedAt <= DateTime.UtcNow.AddMinutes(-30)
            select v).ToListAsync();

        // and delete them
        foreach (var verification in expiredVerifications)
        {
            this.db.Verification.Remove(verification);
            this.db.SaveChanges();
        }

hi @bjammin, thanks for all the recent feedback!
no for above code - the underlying cause is incorrect instructions in the ef scaffolding code.
it was accidentally setting the 'user id' field as the primary key, rather than the 'code field' (which is a guid string).
easily fixed!

this one has actually highlighted a bigger issue which I need to think about for a bit =S
how you supply dates when writing ef queries varies depending on the target provider (postgres or mssql). pgsql ef provider expects a local datetime as input. mssql ef provider expects a utc datetime as input.
once you scaffold out a solution, you tie it to one particular ef provider, and it's not a problem going forwards. all the code you write will be consistent in it's use of local or utc when writing queries.
but 'system' code has to be agnostic about what ef provider it is querying. i will have to do some research, and think about what is appropriate. probably just an extension method :)
if you have any thoughts, let me know!

coded a fix. will include in deployment for next release.


Compilation problems (type mismatch, wrong parameter types) under Eclipse

I've imported the titan-core maven module in my Eclipse workspace. There are few compilation issues that blocks the compilation of the project:
The method encode(long) in the type LongEncoding is not applicable for the arguments (Short)	GraphDatabaseConfiguration.java	/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/configuration	line 1495	Java Problem

The method getPowerOf2(long) in the type NumberUtil is not applicable for the arguments (Integer)	ConsistentKeyIDAuthority.java	/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/idmanagement	line 103	Java Problem

The method getPowerOf2(long) in the type NumberUtil is not applicable for the arguments (Integer)	VertexIDAssigner.java	/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner	line 73	Java Problem

Type mismatch: cannot convert from element type Object to TitanEdge	IndexRepairJob.java	/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/olap/job	line 155	Java Problem

Type mismatch: cannot convert from element type Object to TitanRelation	IndexRepairJob.java	/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/olap/job	line 125	Java Problem

Type mismatch: cannot convert from Integer to long	Backend.java	/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage	line 255	Java Problem

Type mismatch: cannot convert from Integer to long	ConsistentKeyIDAuthority.java	/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/idmanagement	line 103	Java Problem

Type mismatch: cannot convert from Integer to long	VertexIDAssigner.java	/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner	line 73	Java Problem

Type mismatch: cannot convert from Integer to long	VertexIDAssigner.java	/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/database/idassigner	line 84	Java Problem

Type mismatch: cannot convert from Object to boolean	TitanSchemaVertex.java	/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/types/vertices	line 163	Java Problem

Type mismatch: cannot convert from Short to long	GraphDatabaseConfiguration.java	/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/configuration	line 1495	Java Problem

There is probably a configuration parameter that I'm missing somewhere. Ideas ?
The project compiles and install fine via command-line+Maven.
Java version:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

Mac OSX 10.11, Eclipse Version: Mars.1 Release (4.5.1).
Current Git commit:
89c0a2b30e798a13e098949c219730b228bcc82a

I don't know of any of anyone using the Eclipse on the Titan core dev team, so i'm not sure that anyone can assist you with this one.  You might try to bring it up on the mailing list - perhaps an eclipse user will have some ideas there.


CSV file output failing because of str vs. unicode

On Mac OS X Yosemite (10.10.5) with Python 2.7.10:
I get the following error when I try to output CSV's into separate files fbcap -f csv -d <output dir> <input file>. This happens with both my personal archive file and the sample test file.
Traceback (most recent call last):
  File "/Users/andrew/dev/auto-chat/venv/bin/fbcap", line 11, in <module>
    sys.exit(main())
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/fbchat_archive_parser/main.py", line 188, in main
    app.run()
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/clip.py", line 652, in run
    self.invoke(self.parse(tokens))
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/clip.py", line 634, in invoke
    self._main.invoke(parsed)
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/clip.py", line 519, in invoke
    self._callback(**{k: v for k, v in iteritems(parsed) if k not in self._subcommands})
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/fbchat_archive_parser/main.py", line 131, in fbcap
    write(format, fbch, directory or sys.stdout)
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/fbchat_archive_parser/writers/__init__.py", line 40, in write
    write_to_dir(selected_writer(), stream_or_dir, data)
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/fbchat_archive_parser/writers/__init__.py", line 68, in write_to_dir
    writer.write_thread(thread, stream=thread_file)
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/fbchat_archive_parser/writers/csv.py", line 56, in write_thread
    writer = self.get_writer(stream, True)
  File "/Users/andrew/dev/auto-chat/venv/lib/python2.7/site-packages/fbchat_archive_parser/writers/csv.py", line 45, in get_writer
    w.writeheader()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/csv.py", line 141, in writeheader
    self.writerow(header)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/csv.py", line 152, in writerow
    return self.writer.writerow(self._dict_to_list(rowdict))
TypeError: must be unicode, not str

I did some hunting but could not find the root of the problem. I think it is something to do with TextIOWrapper's UTF-8 encoding (writers/__init__.py:67-68) and the csv.py library in Python 2?

Hey there, thanks for reporting this! You're right in that the issue is with the TextIOWrapper, which is configured in the writing-to-directory case to be in UTF-8 mode. The solution is to extract the underlying byte-only stream and write to that instead. Python 2's CSV library can only work reliably with raw media files.
Fixed in version 0.9.post18


Add font-awesome icons from version 4.4.0 to 4.6.0

Hey there, I added some recent fontawesome icons that were missing.

Bump! @f

Bump again - this could now actually be updated to 4.7.0

I surely won't care for that anymore, as this was never merged…


Add Support for FastAPI latest version

FastAPI Contrib version:
FastAPI version: 0.45.0
Python version: 3.7
Operating System: Linux

Description
pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches fastapi==0.42.0,==0.45.0
What I Did
Trying to use lib with FastAPI 0.45.0 and up

Support for the latest (for now) FastAPI & Pydantic version is out now in v0.2.4


Fix some issues with instanced scenes

There are some issues with instanced subscenes that have been reported for Godot 2.1, e.g., #12765 and #12139, and that seem to be present in current master as well.
To reproduce some of them with the attached project:

Open scene Rectangles-Duplicate-01.tscn.
Move ColorRect3 between the other two color rectangles in the scene tree, so that the colors are yellow, blue, red.
Save the scene. Close it and reopen it. The blue rectangle is again on the bottom of the list (i.e., yellow, red, blue).
Move ColorRect3 back into the middle position. Run the scene. The colors in the executable are yellow, red, blue.

Duplicate the VBoxContainer node. The blue color rectangle disappears from the copy.

 All changes made to the node disappear. Arguably this might be the intended behavior, but since there is no feedback about this in the editor (the changes remain until the scene is reloaded) and since the editable status itself behaves in some unexpected ways (e.g., since the editable nodes are stored with their node paths, renaming an editable node turns editing mode off), this behavior seems rather unfriendly to users.

The revised pull requests fixes the first two issues for my use cases, but not the last one.
It's still very rough, and the patch currently greatly increases the size of the scene files because I'm saving way too many nodes. This could be fixed with some more work. But I'd be happy to talk to someone more familiar with the Godot codebase whether there is a better way to address the problem, since the solution in the PR seems rather heavy handed to me.
InstancingBugs.zip

Honestly, I think fixing this is worth it only if the fix is only a couple lines at much, otherwise adding a lot of complexity for an use case that is extremely rare is undesired. An alternative could be for the editor to simply not allow you to put custom nodes in the middle.

Still, why not simply save the position of the node? not quite sure why the solution needs to be so complex.

Thank you for your comments.
I'm not so sure whether this is so rare as use case. For example, I have quite a few reusable scenes for the UI of a game I'm currently developing, and it's pretty useful to be able to customize them with additional components that you place inside the existing HBoxes/VBoxes. But perhaps that's just me abusing node instancing.
I actually started out saving the positions of the nodes, but then dealing with reordered instanced nodes became slightly tricky. But since the name-based approach became more complicated than I wanted as well, I should probably try that again.

well, i mean rare as in, we didn't really get much complaint about it. I'm fine with fixing and your use case makes sense,  but I'm sure there has to be a simpler way as it's pretty much just saving an extra index for nodes in this situation

OK, when it's acceptable to ignore reordering of instanced nodes it is not so difficult to get a relatively simple fix for duplication. In that case, recreating the order takes just two lines of code, the rest of the commit handles picking up user-created nodes that are not immediate children of the root.
For packed scenes I guess the way to go would be to add an index field to NodeData and to use that to move the nodes to the correct position when inserting them. This would probably cover the most frequent cases without introducing a lot of complexity.

yeah if the base scene is reordered, I think it's expected that instances will not automatically fix

haven't checked much, but is there any reason why position needs to be moved after the node is added? as it's in order and the original scene is loaded beforehand, i would think that moving it right ater adding it might work the same

In _duplicate(), each move_child() follows immediately after its corresponding add_child() (in line 2211 for the add in 2209, and in line 2236 for 2231). and they implicitly make use of the fact that the children are added in order and the instanced nodes are already present.
The first add/move combination is for immediate children of node, the second is for non-instanced children of instanced nodes that are not immediately below node, so only one add/move pair should be executed per node.

@reduz says the PR seems perfect now, but it needs a rebase to fix merge conflicts.

Rebased on current master.
Thank you @akien-mga and @reduz for the repeated feedback on this PR and the time and effort you invest into PRs in general.

This looks like it adds a get_node_index method to the public API.
@hoelzl Would you be willing to add some documentation for that?  It would help us engine users.  :)

This broke binary compatibility with existing scenes, sorry I should have realized it sooner.

Fixing on my own so i don't have to revert

yeah. this breaks compatibility. I needed to reimport all assets to work again...

@brainsick Yes, I can add documentation, but will wait for @reduz' s changes to see whether get_node_index remains in its current form.

@volzhs don't reimport, as the resulting reimport will be broken, i just commited a fix

@hoelzl i didn't change the API, only how it's encoded

@reduz sadly... I didn't notice this problem. I already did. :cry:
need to try again now...

@hoelzl Thank you!  I felt silly even asking as it seems so obvious what it does given the context, but it's a discover-ability issue for me and users who rely on the documentation.


Document Telegraf setup for collecting metrics from AWS services

Some users find it hard to discover which AWS services can be monitored by Telegraf and how to configure that monitoring.
Metrics from AWS services can be collected via the AWS CloudWatch plugin in most cases or by setting up a file plugin to ingest S3 logs in some other cases (ELB logs, DynamoDB). The final configuration is not obvious. I'd like to suggest that we add the following to the Telegraf docs.

Separate configuration pages for AWS services that explain how to set up monitoring of those services, e.g. a Telegraf config and examples of AWS IAM permissions required and the metrics returned when monitoring different services.
An overview page for AWS monitoring using Telegraf that lists all the AWS services that can be monitored by Telegraf.
AWS service configuration pages should also be included in the main plugin list.

URL for relevant page?
I think we should use Datadog's AWS page as an example of which AWS services Telegraf can monitor. https://www.datadoghq.com/aws-monitoring/
What products and version are you using?
Telegraf
Where did you look before opening the issue?
(Telegraf plugin list)[http://docs.influxdata.com/telegraf/v1.11/plugins/plugin-list/]
We may also want to link to dashboards for each service when available.

We have something similar to this for the Jolokia plugin, which can also be quite hard to configure. https://github.com/influxdata/telegraf/tree/master/plugins/inputs/jolokia2/examples
Perhaps we can generalize this pattern and hook it into docs.influxdata.com.

I agree there’s definitely value in generalizing the pattern. There are a bunch of plugins where specific configurations for different services would be helpful, especially for anything that requires parsing logs or JSON messages.

I need to do this for billing information on AWS, so maybe I can help @pierwill @noramullen1


'CanMakePhoneCall' is returning true for Nexus 7/10 devices

Nexus 7/10 Tablet doesn,t support calling .
But still the check returns true

Got the same issue, seems to be relative to the fact that the check on CanMakePhoneCall is on the Dial intent but without parameter. A check on the intent with a Uri "tel:0000000000" (with a fake number) seems to work.


Add TokenAuthentation step for Ray cluster SDK OAuth Authentication tests

Issue link

closes https://issues.redhat.com/browse/RHOAIENG-4753
What changes have been made

Added TokenAuthentation step for Ray cluster SDK OAuth Authentication test
Verification steps

Test TestRayClusterSDKOauth in Openshift cluster
Checks

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

[ ] Unit tests
[ ] Manual tests
[ ] Testing is not required for this change

Was able to run successfully on a rosa/hypershift cluster. Looks good to me.
/approve


Depositor is not able to see or edit works in-review after submission

Expected behavior
In my Hyku demo repo, in an admin set with one-step deposit workflow, the admin set manager granted the depositor role to User Y. User Y deposited a work to the admin set. After review, the work was returned to the depositor, User Y, for changes.
User Y receives a notification about the request for changes. The link in the notification leads to the in-review page for the Work, where it should be possible for the depositor to edit the work and its files.
When logged in and viewing the dashboard, under the Repository Contents menu, User Y should see the Collections and Works sections, with their deposited works in the admin set in which they have the depositor role listed on the Works page. And User Y should be able to edit an in-review work from the Works page
User Y should receive notifications for activity related to their works in an admin set
Actual behavior
These are the things that are wrong:

User Y cannot see or take any action to edit the work (description, release/visibility, relationships, files) from the work view page (only accessible from link in notification)
Works in the admin set are not listed on Repository Contents > Works while they are in-review

The first issue that is wrong is https://github.com/projecthydra-labs/hyrax/issues/920
The second issue has to do with issue https://github.com/projecthydra-labs/hyrax/issues/855


#897: Settings variables as table instead of list in the docs

fixes #897

The diff and updating the docs is a bit cumbersome if we always have to use the exact right amount of dashes in the .rST files. Is there an "easier-to-update" way of providing a table layout? I think the readability would probably be better with the table!

@aleksihakli Sorry, didnt get your point. Are you worried that the table might be broken?

I am a bit concerned that updating the content from a list to a table might prove to be a bit complex in the long run. The code and git diffs will be easy-to-read-hard-to-update for a table, if we change the format from the current easy-to-update-hard-to-read list.
I think the proposed table could prove to be be better for the users of the documentation, but am trying to take the maintainers into account as well.
I'm not sure if this is a real concern though, so if you think the table is better we can give it a try?

Actually, I have no strong feeling about the table. I just realised that the current version of the docs is really hard to read and to quickly get the required information. I'm open to suggestions 🙂

Hey @GitRon this is how it currently looks with the table:
https://django-axes.readthedocs.io/en/latest/4_configuration.html

I wonder if there is an option of widening the text element for better readability with the table? Otherwise browsing the documentation might prove to be a bit challenging with the styling.

I think it's an improvement, just the asterisk is shown in a wrong way...

The table is a bit challenging to slide sideways to show the description text per configuration variable at the moment, did you try the RTD site out?

Yeah, I struggle with this quite often myself. But if you have only that much space, what can we do? I think, after all, it is still more readable than before and the defaults are more explicit.


Revert "[build-preset] Temporarily disable swift-testing until CI is ready"

Reverts swiftlang/swift#75822
Now CI is ready.

@swift-ci Please smoke test


Add typst-algorithms

A library with functions for writing pseudocode and line-numbered codeblocks

Thanks for the awesome contribution, @platformer !


No sound

WebTorrent version: Latest
Node.js version: ?
Browser name/version (if using WebTorrent in the browser):

I have no sound in a Windows version. I am using a Windows 10. What do I need to do to fix the issue?
Thank you!

see https://github.com/feross/webtorrent-desktop/pull/424

If you want Dolby surround sound (AC3) support in WebTorrent, please star this Chromium issue: https://bugs.chromium.org/p/chromium/issues/detail?id=611517


Share event with other open planner member

Be able to add edit mode for an event to another Open planner member

This will not be done before 1 or 2 years. It need some work. The work arround is to use a shared account as stated in the login page "Use a single account per event or organization as OpenPlanner don't have a role system yet."
If someone want to help do it, let me know!


add associations comparison in isChanged method

The isChanged method (in EmbeddedDocumentSerializer) compared only fields, not associations.

Closed in favor of #138


Multiple automated master nodes (e.g. in autoscaling group)

See issue https://github.com/kubernetes/kubeadm/issues/184 - same issue as kubeadm.
I would like to be able to use bootkube to bootstrap a cluster (if it didn't exist) and to join a cluster if it does.
I'm having trouble working out how to use bootkube in an automated fashion if the master resources are all created on a single node only.
Can anyone help as the direction seems to pertain to a manual only tool for single master nodes.

Similar discussion about documenting multi-master setups: https://github.com/kubernetes-incubator/bootkube/issues/311
Bootkube itself should only be used once on the very first node. It is not used to "join" nodes -- all that should require is running kubelet with a kubeconfig which can securely contact an api-server.
The general process would be to have two auto-scaling groups, one for masters and one for workers. The only difference in their user-data would likely be the --node-labels=master=true on the kubelet (so the node registers itself as a master). Note that this label will change soon: https://github.com/kubernetes-incubator/bootkube/issues/246
Then you can scale deployments to spread them across these master nodes (kubectl scale deployment kube-scheduler --namespace=kube-system --replicas=X). These components will automatically be spread across nodes soon as well: https://github.com/kubernetes-incubator/bootkube/issues/166
I'm going to close this as a duplicate of https://github.com/kubernetes-incubator/bootkube/issues/311, however - as we do need to better document this process - and should try and keep discussion centralized. But there isn't really much restricting you to a single master at this point - it's just a matter of adding more nodes and making sure your "master" nodes are behind a load-balancer or DNS.


joystck/buttons: Always protect the open list by critical section

Summary
it's wrong to protect by au_exclsem in some case and remove ao_closing
Impact
Testing

I found a similar issue in drivers/input/button_upper.c

I found a similar issue in drivers/input/button_upper.c

Yes, I will fix button_upper too.

Please fix
 Error: input/djoystick.c:608:32: error: variable 'priv' set but not used [-Werror=unused-but-set-variable]
  608 |   FAR struct djoy_upperhalf_s *priv;

Please fix
 Error: input/djoystick.c:608:32: error: variable 'priv' set but not used [-Werror=unused-but-set-variable]
  608 |   FAR struct djoy_upperhalf_s *priv;

Done.

Done.


QUESTION: how to configure new Hydra project?

Hello,
first of all thanks a lot for the great repo you have created. It's very inspiring.
I'm trying to use Hydra to build my main branch, but I'm not able to create a working Hydra project in the Hydra webpage.
Could you please share which are the correct values for  "Declarative spec file" (.hydra.json?) ,  "Declarative input type" (Git checkout?) and "Declarative input value"  fields on the new Hydra project form?
Thanks
Tommaso

Hi!
Thank you for your kind words <3
Yeah Hydra is not super intuitive. You're ALMOST there, you just gotta specify the branch/ref, like so:

Hi!
Thanks for the help. I found the problem.
I'm using a private repo and I thought I was able to fully read it since a manually configured jobset was working. I then find out that the "Git checkout" plugin doesn't support reading from private repo.
The way to make this working with a private repo is to create a new public repo with only the .hydra.json file. Hydra can read the file and then can access the flake uri defined in the json file that is in the private repo.
Note: to make Hydra access a private you need to add a personal github token to the nix.conf file of the machine running hydra server. I did this creating the file "hosts/common/optional/gh-token.nix" with the following content and including it in the file "hosts/ws01/services/default.nix" that defines the service for my machine "ws01"
{config, ...}: {
  nix.extraOptions = '' !include ${config.sops.templates."nix-extra-config".path} '' ;
  nix.checkConfig = false;
  sops.templates."nix-extra-config" = {
    content = ''
      access-tokens = github.com=${config.sops.placeholder.github-token}
    '';
  };
  sops.secrets.github-token = {
    sopsFile = ../secrets.yaml;
  };
}

Hi @Tommixe thanks for this, but I am guessing this assumes your private repo is still on GitHub. Is that correct?
I am trying to use a private repo on gitea.

Hello,
Yes the repo is in Github. Anyway I'm still struggling with it. The jobset creation and first evaluation worked well, but any new commit (on both repos) doesn't trigger the evaluation. I didn't have time yet to figure out which is the problem.

I finally make it work. The github token secrets has to be readable by hydra user, otherwise hydra always evaluate the latest cached flake url.
{config, ...}: {
  nix.extraOptions = '' !include ${config.sops.templates."nix-extra-config".path} '' ;
  nix.checkConfig = false;
  users.groups.nix-access-tokens = { };
  sops.templates."nix-extra-config" = {
    content = ''
      access-tokens = github.com=${config.sops.placeholder.github-token}
    '';
    group = config.users.groups.nix-access-tokens.name;
    mode = "0440";
  };
  #users.groups.nix-access-tokens.gid = config.ids.gids.nix-access-tokens;
  sops.secrets.github-token = {
    sopsFile = ../secrets.yaml;
    restartUnits = ["nix-daemon.service"];
  };
}

and in hydra defalut.nix
{ pkgs, lib, config, outputs, inputs, ... }:
let
  hydraUser = config.users.users.hydra.name;
  hydraGroup = config.users.users.hydra.group;
  tokenGroup = config.users.groups.nix-access-tokens.name;

 ...

  users.users = {
    hydra.extraGroups = [ tokenGroup ] ;
    hydra-queue-runner.extraGroups = [ hydraGroup ];
    hydra-www.extraGroups = [ hydraGroup ];
  };

 ...


Add blacklist to config to exclude project paths that match a regex pattern

Closes https://github.com/mehcode/atom-project-plus/issues/82

Ping! This is the main issue preventing me from using the plugin.


Enhance Http proxy test about the OLM

Release Note
NONE

The test passed locally. Can you rerun failed pipelines if there is no ongoing issue with the CI on 1.8 branch?

@squakez do you know why we are getting
Error:  Failed to execute goal on project camel-k-runtime-builder: Could not resolve dependencies for project org.apache.camel.k:camel-k-runtime-builder:jar:1.0.0: The following artifacts could not be resolved: org.apache.camel.k:camel-k-kamelet-reify:jar:1.12.0, org.apache.camel.k:camel-k-kamelet-reify-deployment:jar:1.12.0: Could not find artifact org.apache.camel.k:camel-k-kamelet-reify:jar:1.12.0 in staging (https://repository.apache.org/content/repositories/orgapachecamel-1411/) -> [Help 1]

from the CI?

Can you please rebase? let's see if that is enough to fix

Please rebase, the underlying tekton problem should have been fixed in the release-1.8.x branch.

Merging as errors appears to be related to #3191


TAVOSS-TR:spring-boot

Version of the project
2.4.3
Tech Stack
Application [A]
Project details
Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss. It takes an opinionated view of the Spring platform so that new and existing users can quickly get to the bits they need.
Languages used
Java, Kotlin, HTML, Shell, JavaScript, Groovy
Domain
Technology
Industry
All
Open Source Project type
Community led
Repo URL
https://github.com/spring-projects/spring-boot
Sub-project repo URL
No response
Webpage
https://spring.io/projects/spring-boot
License
Apache-2.0
Other license
No response
Reason , why we must track this project.
No response

Spring boot is a framework.
Change A to L&F.
Technology domain - TD-U-ApD
Technology Domain composition - TD-C-Ms


No such file or directory Book.txt

Hi, I have an error in comments_spec.rb, I ran this test only and retrieve this error:

  1) commenting as an account's owner rejecting a note
     Failure/Error: lines = File.readlines("Book.txt")

     Errno::ENOENT:
       No such file or directory @ rb_sysopen - Book.txt
     # ./app/workers/book_worker.rb:15:in `readlines'
     # ./app/workers/book_worker.rb:15:in `block in perform'
     # ./app/workers/book_worker.rb:14:in `chdir'
     # ./app/workers/book_worker.rb:14:in `perform'
     # ./spec/support/book_helpers.rb:12:in `create_book!'
     # ./spec/features/comments_spec.rb:6:in `block (2 levels) in <top (required)>'
     # ./spec/rails_helper.rb:40:in `block (3 levels) in <top (required)>'
     # /home/victor/.rvm/gems/ruby-2.3.3/gems/database_cleaner-1.5.3/lib/database_cleaner/generic/base.rb:16:in `cleaning'
     # /home/victor/.rvm/gems/ruby-2.3.3/gems/database_cleaner-1.5.3/lib/database_cleaner/base.rb:98:in `cleaning'
     # /home/victor/.rvm/gems/ruby-2.3.3/gems/database_cleaner-1.5.3/lib/database_cleaner/configuration.rb:86:in `block (2 levels) in cleaning'
     # /home/victor/.rvm/gems/ruby-2.3.3/gems/database_cleaner-1.5.3/lib/database_cleaner/configuration.rb:87:in `cleaning'
     # ./spec/rails_helper.rb:39:in `block (2 levels) in <top (required)>'

Finished in 12.79 seconds (files took 4.73 seconds to load)
3 examples, 1 failure

Failed examples:

rspec ./spec/features/comments_spec.rb:49 # commenting as an account's owner rejecting a note

Could you help me please?

This issue might happen if you didn't check out the submodules:
git submodule update --init

Nope, I executed this command and issue persist, my comments_spec.rb looks like:

describe 'commenting' do
  let!(:account) { FactoryGirl.create(:account) }
  let!(:reviewer) { create_user! }
  let!(:book) { create_book! }
  let!(:chapter) { book.chapters.first }
  let!(:element) { chapter.elements.first }
  let!(:note) { element.notes.create(:user => reviewer, :text => "My favourite element.", :number => 1) }
  let!(:comment_text) { "This is a typical comment" }

  def assert_comment_form_blank!
    expect(find("#comment_text").text).to be_blank
  end

  def assert_comment_present!
    within("#comments") do
      expect(page).to have_content(comment_text)
    end
  end

  context "as an account's owner" do
    before do
      login_as(account.owner)
      set_subdomain(account.subdomain)
      visit book_note_url(book, note)
      fill_in "comment_text", :with => comment_text
    end

    it "a normal comment" do
      click_button "Leave Comment"
      within(".flash_notice") do
        expect(page).to have_content("Comment has been created.")
      end
      assert_comment_form_blank!
      assert_comment_present!
    end

    it "accepting a note" do
      click_button "Accept"
      within(".flash_notice") do
        expect(page).to have_content("Note state changed to Accepted")
      end
      expect(note.reload.state).to eq('accepted')
      assert_comment_form_blank!
      assert_comment_present!
    end

    it "rejecting a note" do
      click_button "Reject"
      within(".flash_notice") do
        expect(page).to have_content("Note state changed to Rejected")
      end
      expect(note.reload.state).to eq('rejected')
      assert_comment_form_blank!
      assert_comment_present!
    end
  end
end


Please restore link to VARS scripts for canadian grid measurements

On:
atlas/VARS_Stn-M_Image_Archive/howto/measurements.html
please restore link halfway down the page to point to:
vars-queryparsing-1.1.5
which I think is the latest version.
thanks!

Links are restored. Note that the Documentation page at //Atlas/VARS_Stn-M_Image_Archive/Documentation.html has links to all the downloadable applications now.


Add support for duplicating operators and nodes

To support creating multiple copies of operators and nodes, for example for handling multiple identical cameras.
Proposed in the meeting on Wednesday.

Can you give an example of dataflow where the operators or nodes would be cloned? Even just as documentation?

I feel that this feature adds a bit of complexity for the sake of not repeating the parameters of the nodes.
But with the same parameters, how are we going to specify which webcam each node should record in the code? And, maybe the input or the output should be different for each duplicated node.
I am not entirely convinced by this feature, and I would prefer to postpone it until we have a real use case. Open for discussion if you don't agree.

But with the same parameters, how are we going to specify which webcam each node should record in the code?

Good point. I guess we could pass the ID to node/operator so that they can match on it.

And, maybe the input or the output should be different for each duplicated node.

Yeah, in that case duplication would not work. So in its current form it's only useful for identical clones. Note that the outputs of the clones can still be used individually since the node_id is part of the input mappings. So the object detection could also depend on e.g. webcam-3/image in the above example.

I am not entirely convinced by this feature, and I would prefer to postpone it until we have a real use case. Open for discussion if you don't agree.

Yeah, we can of course postpone it or look for a different design. How about we discuss this with @heyong4725 in our next meeting?

We discussed this today and decided to postpone this feature. Our fear is that this adds too much complexity to the YAML file for a very specific use-case.


error 404 when trying to access the docs

Hi,
the link given in the readme:
https://armmbed.github.io/cmsis-pack-manager/
seems to be broken:
error 404 returned.
Thanks & Regards,
Fred

Follow-up:
I cloned the cmsis-pack-manager github and did:
pip install cmsis-pack-manager
Then I tried:
python pack_manager.py
But this does not display any help and the documentation link seems to be broken.
Is it the proper way of using the pack manager ? (I see there are commands and subcommands but at the moment I do not know how to launch it, even the help text is not displayed).
Probably my way of calling the tool is very wrong ?
Thanks & Regards,
Fred

Follow-up:
I cloned the cmsis-pack-manager github and did:
pip install cmsis-pack-manager
Then I tried:
python pack_manager.py
But this does not display any help and the documentation link seems to be broken.
Is it the proper way of using the pack manager ? (I see there are commands and subcommands but at the moment I do not know how to launch it, even the help text is not displayed).
Probably my way of calling the tool is very wrong ?
Thanks & Regards,
Fred

The documentation should be available at this URL: https://pyocd.github.io/cmsis-pack-manager/
The README.md suggests using python setup.py bdist_wheel to build the package. The build-wheels.sh script should be helpful on how to build and install this way for Mac and Linux.

The documentation should be available at this URL: https://pyocd.github.io/cmsis-pack-manager/
The README.md suggests using python setup.py bdist_wheel to build the package. The build-wheels.sh script should be helpful on how to build and install this way for Mac and Linux.

Hi @fred-r
I've successfully recently built using python setup.py bdist_wheel.
The docs on the GitHub pages site are unfortunately very out of date; they are for the pre-Rust-based version of CPM. We should either regenerate and update the docs site or completely remove them.

Hi @fred-r
I've successfully recently built using python setup.py bdist_wheel.
The docs on the GitHub pages site are unfortunately very out of date; they are for the pre-Rust-based version of CPM. We should either regenerate and update the docs site or completely remove them.

Hi @flit,
the command you indicate does not work for me.
First, I installed the requirements:
$ pip install -r setup_requirements.txt
Requirement already satisfied: milksnake>=0.1.2 in c:\users\frq09468\appdata\local\programs\python\python37\lib\site-packages (from -r setup_requirements.txt (line 1)) (0.1.5)
Collecting pytest-runner
Downloading pytest_runner-5.2-py2.py3-none-any.whl (6.8 kB)
Requirement already satisfied: setuptools>=40.0 in c:\users\frq09468\appdata\local\programs\python\python37\lib\site-packages (from -r setup_requirements.txt (line 3)) (51.1.2)
Collecting setuptools_scm!=1.5.3,!=1.5.4
Downloading setuptools_scm-5.0.1-py2.py3-none-any.whl (28 kB)
Collecting setuptools_scm_git_archive
Downloading setuptools_scm_git_archive-1.1-py2.py3-none-any.whl (3.3 kB)
Requirement already satisfied: cffi>=1.6.0 in c:\users\frq09468\appdata\local\programs\python\python37\lib\site-packages (from milksnake>=0.1.2->-r setup_requirements.txt (line 1)) (1.14.4)
Requirement already satisfied: pycparser in c:\users\frq09468\appdata\local\programs\python\python37\lib\site-packages (from cffi>=1.6.0->milksnake>=0.1.2->-r setup_requirements.txt (line 1)) (2.20)
Installing collected packages: pytest-runner, setuptools-scm, setuptools-scm-git-archive
Successfully installed pytest-runner-5.2 setuptools-scm-5.0.1 setuptools-scm-git-archive-1.1
Then I try the setup.py:
$ python setup.py bdist_wheel .
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
As you can see the 'bdist_wheel' command is indicated as invalid.
Thanks & Regards,
Fred

Hi @flit,
the command you indicate does not work for me.
First, I installed the requirements:
$ pip install -r setup_requirements.txt
Requirement already satisfied: milksnake>=0.1.2 in c:\users\frq09468\appdata\local\programs\python\python37\lib\site-packages (from -r setup_requirements.txt (line 1)) (0.1.5)
Collecting pytest-runner
Downloading pytest_runner-5.2-py2.py3-none-any.whl (6.8 kB)
Requirement already satisfied: setuptools>=40.0 in c:\users\frq09468\appdata\local\programs\python\python37\lib\site-packages (from -r setup_requirements.txt (line 3)) (51.1.2)
Collecting setuptools_scm!=1.5.3,!=1.5.4
Downloading setuptools_scm-5.0.1-py2.py3-none-any.whl (28 kB)
Collecting setuptools_scm_git_archive
Downloading setuptools_scm_git_archive-1.1-py2.py3-none-any.whl (3.3 kB)
Requirement already satisfied: cffi>=1.6.0 in c:\users\frq09468\appdata\local\programs\python\python37\lib\site-packages (from milksnake>=0.1.2->-r setup_requirements.txt (line 1)) (1.14.4)
Requirement already satisfied: pycparser in c:\users\frq09468\appdata\local\programs\python\python37\lib\site-packages (from cffi>=1.6.0->milksnake>=0.1.2->-r setup_requirements.txt (line 1)) (2.20)
Installing collected packages: pytest-runner, setuptools-scm, setuptools-scm-git-archive
Successfully installed pytest-runner-5.2 setuptools-scm-5.0.1 setuptools-scm-git-archive-1.1
Then I try the setup.py:
$ python setup.py bdist_wheel .
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
As you can see the 'bdist_wheel' command is indicated as invalid.
Thanks & Regards,
Fred

You need to install wheel support with pip install wheel. (Sorry, it's often installed by default.)

You need to install wheel support with pip install wheel. (Sorry, it's often installed by default.)

Hi,
thanks for the hint.
It is better now but still failing:
$ python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
copying cmsis_pack_manager_version.py -> build\lib\cmsis_pack_manager
error: [WinError 2] The system cannot find the file specified
Thanks & Regards,
Fred

Hi,
thanks for the hint.
It is better now but still failing:
$ python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
copying cmsis_pack_manager_version.py -> build\lib\cmsis_pack_manager
error: [WinError 2] The system cannot find the file specified
Thanks & Regards,
Fred

Do you have Rust installed (the CPM backend is built in Rust)? See https://rustup.rs. Sincere apologies if this wasn't clear in the Readme!

Do you have Rust installed (the CPM backend is built in Rust)? See https://rustup.rs. Sincere apologies if this wasn't clear in the Readme!

Ok, my bad, the readme is quite clear about it.
Sorry for any incovenience.
Thanks & Regards,
Fred

Ok, my bad, the readme is quite clear about it.
Sorry for any incovenience.
Thanks & Regards,
Fred

Closing this issue as the docs URL in the readme was fixed.

Closing this issue as the docs URL in the readme was fixed.


0.3.1 RC1

I'd like to push this version, which is compatible with python 2 and 3, all tests are passing, it includes the CRF model I contributed, and it works with the latest AD3.
Version number: pystruct was in version 0.2.5, with a mention of 0.3 in the CHANGELOG. So I'm proposing 0.3.1

lol sounds like I was being very consistent. You can also do 0.4 but either is good.

maybe squash and merge for a nicer history?

Squashing is tricky...
Tried to squash in my fork, but got conflicts (!) (on setup.py)
I do not dare to squash in this repo...
I could do a new fork from pystruct master, prepare 0.3 there, do 1 commit and make a new pull request.
Not so elegant but it will work for sure...
Any other idea or info??
Thanks

Squashing leads me in dealing with several conflicts. So no squashing. But a new PR from another repo (for the exact same code)


IPv6 compatibility fix

based upon https://github.com/xetorthio/jedis/issues/982

@smagellan can you please add a test for this?

@smagellan can you also take into consideration the changes in this PR https://github.com/xetorthio/jedis/pull/1099 ?

@marcosnils Ok, I will introduce test.
I can't realize your comment on PR #1099. Should I include changeset into my PR? Please confirm or correct if I was wrong.

I can't realize your comment on PR #1099. Should I include changeset into my PR? Please confirm or correct if I was wrong.

@smagellan Just wanted to make sure that changes proposed in #1099 still apply with this PR as well.Maybe @allanwax can make a quick review and leave his comments here.

@smagellan can u please check https://github.com/xetorthio/jedis/issues/1344 ?

LGTM. Swall we merge this right away independently of redis current IPv6 issue?
@HeartSaVioR @xetorthio @mp911de @smadasu ?

It's been a while since I looked at this and the stuff I checked into
git last year was never merged due to formatting issues.  I also can't
find the code that needs to be examined.  I'm not really a git person.
However, from what I code fragments I've seen in the posts, extracting
the last index of ':' is the proper way to go.  In addition, because of
ipv6, I am reposting fragments of the changes that I think should also
be inserted.
public class HostAndPort {
public static final String LOCALHOST_STR ;
static {
    try {
        LOCALHOST_STR = InetAddress.getLocalHost().getAddress();
    }
    catch (Exception e) {
        LOCALHOST_STR = "localhost";
    }
}

This fragment will make sure that the value of local host is whatever
the actual machine's IPV4/V6 address is versus "localhost".
private String convertHost(String host) {
if (host.equals("<IP_ADDRESS>") || host.startsWith("localhost") ||
host.equals("<IP_ADDRESS>") || host.startsWith("169.254"))
return LOCALHOST_STR;
else if (host.startsWith("::1") ||
host.startsWith("0:0:0:0:0:0:0:1"))
return LOCALHOST_STR;
    return host;
}

This fragment does additional checks for IPV4/V6.  '::1' is not the only
way to reference localhost in IPV6.
The code I checked into git has additional functionality.
If someone can send me the code in question, I can look further or the
git reference to clone from.
Allan Wax
On 7/11/2016 3:53 AM, Marcos Nils wrote:

I can't realize your comment on PR #1099
<https://github.com/xetorthio/jedis/pull/1099>. Should I include
changeset into my PR? Please confirm or correct if I was wrong.

@smagellan https://github.com/smagellan Just wanted to make sure that
changes proposed in #1099 https://github.com/xetorthio/jedis/pull/1099
still apply with this PR as well.Maybe @allanwax
https://github.com/allanwax can make a quick review and leave his
comments here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/xetorthio/jedis/pull/1342#issuecomment-231702952,
or mute the thread
https://github.com/notifications/unsubscribe/AIEV_g9X0IDYxyd2lg6pZIylJYZlFmfcks5qUiC3gaJpZM4JHPtE.

@smagellan can you please squash and add a nice commit text?
Also why do you think redis IPv6 support has an issue? As far as I understand it seems like it always appends a color and the port to the host. So the parsing in this PR seems to be totally fine. Am I missing something?

@xetorthio Done.
Yep, redis's answer can be handled without problems. But rfc5952 recommends another IPv6 formatting ('bracketized') approach, e.g. [2001:db8::1]:80.

Are you you pushed it after squashing? I can still see all the commits.

@xetorthio Can you please check again?

I can still see 4 commits instead of 1

@xetorthio I squashed it again

Now it is perfect! Thanks!
I think this is ready to be merged!

LGTM!.

Merged to master and 2.9 respectively.
Thx!.

@marcosnils @smagellan this is breaking functionality for me. getLocalhostQuietly() now uses localAddress = InetAddress.getLocalHost().getHostAddress();, which resolves 'localhost' to the host's external ip.
This breaks connections to the Redis Sentinel (v3.2.2) on my localhost, since only loopback connections are allowed.
Would it be possible to fix this forward to resolve loopback? Or was there some need to resolve the external ip?

@tonyghita, can you please open separate issue for this problem?

Will do!

@smagellan I've created an issue for this at https://github.com/xetorthio/jedis/issues/1367


Update README With Keyword Information

See https://github.com/jupyterlab/jupyterlab/issues/1113

LGTM. Thanks @ClaytonPassmore. Leaving for others to merge.

@jasongrout does this look okay?

Looks great!


Feature: Add security schemes, headers, cookies, form and files in OpenAPI schema

Discussed in https://github.com/aws-powertools/powertools-lambda-python/discussions/3609

Originally posted by gregggilbert-ivadolabs January 10, 2024
Adding API Key authorization in a Swagger template is pretty straightforward. One simple need to add to the template:
components:
  securitySchemes:
    ApiKeyAuth:        # arbitrary name for the security scheme
      type: apiKey
      in: header       # can be "header", "query" or "cookie"
      name: X-API-KEY  # name of the header, query parameter or cookie
# 2) Apply the API key globally to all operations
security:
  - ApiKeyAuth: []     # use the same name as under securitySchemes

How can this be achieved with PowerTools' automatic Swagger documentation generation?
app.enable_swagger() doesn't offer any way to add content to the Swagger template.

Closing this issue in favor of #3661, #3662 and #3663/


Could not find a version that satisfies the requirement

Thanks for your great work.
Could you share your own default conda channels? I have trouble in installing the satisfied version.

I pushed a commit a few hours ago that removed a spurious entry (https://github.com/hturki/suds/commit/4ab59cd2d5cc7192d03fb020544fe264ecf92040) - are you still running into issues after that commit?

Yes, I use your latest code.

could you share your error trace? I just tried out the latest commit on a fresh machine, and it seemed to install properly

ERROR: Could not find a version that satisfies the requirement comm==0.1.3 (from versions: 0.0.1, 0.1.0, 0.1.1, 0.1.2)
ERROR: No matching distribution found for comm==0.1.3
And there are quite a lot of modules like this.

what OS architecture are you using? I've mainly tested this out on CentOS 7, but this also worked on a fresh Ubuntu 20 install. I'm not using any custom channels or anything - I literally just spun up a fresh Ubuntu 20 instance in the cloud and things installed as expected.

ERROR: Could not find a version that satisfies the requirement comm==0.1.3 (from versions: 0.0.1, 0.1.0, 0.1.1, 0.1.2) ERROR: No matching distribution found for comm==0.1.3 And there are quite a lot of modules like this.

Hi, I have the same problem, did you solve it?

@hturki Sorry for the late reply, it seems the default channel in China doesn't contain the latest version of modules. I've solved this problem by changing the default channel.  Thanks for your great work which helped me a lot.   @tb2-sy Maybe you're also in China mainland and I suggest you use the official channel: https://pypi.org/simple.

@Quantum-matrix great that you solved it. if this works for you, then you can close the issue?

@tb2-sy I noticed that you're also working on reproducing the result. Can we get in touch with WeChat?


Missing license

Currently in the prerequisites listed in the following URL (https://docs.microsoft.com/en-us/power-platform/guidance/coe/setup#prerequisites) the current licenses are referred to:
Quote:
"Power Apps per user or per app or Power Automate per user or per flow license or a combination of these licenses."
To install the CoE core components, the service account used should also be sufficiently licensed for MS Teams, or you are not able to register the component.
This is reflected in the following error captured from dev tools:
{"code":"Forbidden","message":"Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them.","innerError"....}
If any error is received on configuring the connection(s) used by the CoE the import of the solution cannot continue.
Can the full list of required licenses outside of just Power Platform licenses be updated in the documentation?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 3f619bbe-9303-8583-2cb9-a287811cec13
Version Independent ID: 8e256e0c-38fa-f2ca-58db-550bb6e9802a
Content: Set up the CoE Starter Kit - Power Platform
Content Source: power-platform/guidance/coe/setup.md
Service: power-platform
GitHub Login: @manuelap-msft
Microsoft Alias: mapichle

This has been added now.


Adds Char#swapcase and String#swapcase instance methods.

To compliment #upcase and #downcase.
Examples:
"a".swapcase # => "A"
"Cats".swapcase # => "cATS"

What are the usecases?
Also, I'd call it swap_case. It's not the same kind of name as upcase.

Mmh, I haven't used swapcase in Ruby yet and never missed in Crystal, so I'm curious about its usecases :)

Then again, even Python has a swapcase method (named like this too), so it's OK

I was just porting some Ruby code to Crystal that used swapcase to randomize character cases in randomly-generated strings. Thought it would be nice to have it for compatibility.
The name is for Ruby compatibility (http://ruby-doc.org/core-2.2.0/String.html#method-i-swapcase).

Can you link/show the Ruby code?

https://gist.githubusercontent.com/lpar/1031933/raw/f575fb142cc9e53a9bece2fd1e4467c63177e080/pwgen.rb

Well, there's no need for swapcase in that example. The source text is guaranteed to be downcased and the comment right above it even says that the intent is to upcase a letter, so using upcase is just fine here.

Yes, obviously the linked code isn't great code, that's not really the point. There are so many different ways to write that we could go on all day about it.
In porting the concept over I just happened to notice that a simple Ruby function wasn't available in Crystal and took the few minutes to add it. People are coming to Crystal from Ruby and I thought it would be nice to have that additional singular point of compatibility.
Feel free to accept or reject, it's your language, I don't feel strongly either way.

I also can't find a strong use case for this. Searching in Google and GitHub I found two use cases:

Matching a password as is and with swapcase, in case the user had caps lock on (well, let's say a "use case")
Use in competitions that ask a user to implement a swapcase function. In Ruby and Python one uses swapcase and that's it, problem solved.

Given that the implementation is trivial (at least seeing the string as ASCII) and that it's unlikely to change in the future, I wouldn't mind including it in the standard library. At least it doesn't bother.

A note: the linked code mutates a String, so that will anyway fail to compile and you'll have to do it in a different way... though maybe it would be nice to have a String method to replace a char or a string at a given position/range with another char/string/object. Ruby uses []= for that, maybe we can add a replace_at(index, value) and replace_at(range, value), or maybe just reuse the sub name?

sub should be okay.

👍

Is it unicode aware?

Since #3560 is merged this PR should take care of passing Unicode::CaseOptions.

I don't think there's a strong use case for this, so I'm closing this.


[FR] - CLI build cmd to calculate total collateral amount

Internal/External
Internal   if an IOHK staff member.
Area
Plutus    Related to Plutus Scripts (Alonzo).
Describe the feature you'd like
From my understanding, the purpose of this feature is to embed the collateral amount in the transaction body HW wallet visibility.
It would be a UX improvement for the build transaction cmd to not require providing the Ada amount when using --tx-total-collateral. It could be a toggle flag e.g. --tx-total-included and probably disabled by default because it may not always be useful to include.
Describe alternatives you've considered
build-raw can be left as is for testing purposes.
Additional context / screenshots
Node Version: d0b0fa1

Before we build this feature we would like to wait for feedback on the current behavior.


mjml2html is not a function

When trying out MJML4 with the node example provided
import { mjml2html } from 'mjml'

/*
  Compile an mjml string
*/
const htmlOutput = mjml2html(`
  <mjml>
    <mj-body>
      <mj-section>
        <mj-column>
          <mj-text>
            Hello World!
          </mj-text>
        </mj-column>
      </mj-section>
    </mj-body>
  </mjml>
`)

/*
  Print the responsive HTML generated and MJML errors if any
*/
console.log(htmlOutput)

I get the following message:
const htmlOutput = mjml_1.mjml2html(`
TypeError: mjml_1.mjml2html is not a function

Is the naming changed?

how would this work with gulp-mjml ?

The current master branch of gulp-mjml has a fix for this issue. I've installed it like so:
    "gulp-mjml"<EMAIL_ADDRESS>

It has been released on npm too so no need to use the git package 👌

Oh great, not sure why I didn't realise that!

FWIW, I had to use
import mjml2html from "mjml";

with the allowSyntheticDefaultImports property of my tsconfig.json set to true

Let try using like this
const mjml2html = require('mjml').default;

        var html = `
        <mjml>
          <mj-body>
            <mj-section>
              <mj-column>
                <mj-text>
                  Hello World!
                </mj-text>
              </mj-column>
            </mj-section>
          </mj-body>
        </mjml>`

        console.log('mjml2html', mjml2html);

        var outputHtml = mjml2html(html, {beautify: true});
        console.log('outputHtml',outputHtml);

import * as mjml2html from 'mjml' worked for my typescript project :) Thank you @ruudboon

import * as mjml2html from 'mjml' worked for my typescript project :) Thank you @ruudboon

It worked but I didn't have any type support in Webstorm using this method

I resolved the issue by importing it like this: import mjml2html from 'mjml';, and I added the esModuleInterop: true property to the ts.config.json file.

I resolved the issue by importing it like this: import mjml2html from 'mjml';, and I added the esModuleInterop: true property to the ts.config.json file.

Hi ! I'm having this error when y try to mock the function using Jest.
How could i mock the mjml2mjml function importing: import * as mjml2html from 'mjml'

I am having great issues using it on Netlify functions (and I think it might be a Netlify related thing really)
But I had to the following as the only thing that would work:
import * as mjml2html from "mjml";
mjml2html.default(`<mjml>....)


Update index.js

fork practise

fork practise

have fun practicing forks! but going to close this for now

you can also fork the repo and do PRs to your own fork so i dont get notified


Do bold/underline/reverse/italic work in all output modes besides TB_OUTPUT_TRUECOLOR?

The code seems to indicate the answer is "yes":
https://github.com/termbox/termbox2/blob/4ac33796ccb5276436fc269ade9ffbe36e205c51/termbox.h#L2806-L2826
But the docs only mention all four modifiers under TB_OUTPUT_NORMAL:
/* Sets the termbox output mode. Termbox has three output modes:
 * 1. TB_OUTPUT_NORMAL     => [1..8]
 *    This mode provides 8 different colors:
 *      TB_BLACK, TB_RED, TB_GREEN, TB_YELLOW,
 *      TB_BLUE, TB_MAGENTA, TB_CYAN, TB_WHITE
 *    Colors may be bitwise OR'd with attributes:
 *      TB_BOLD, TB_UNDERLINE, TB_REVERSE, TB_ITALIC
 *
 *    Example usage:
 *      tb_set_cell(x, y, '@', TB_BLACK | TB_BOLD, TB_RED);
 *
 * 2. TB_OUTPUT_256        => [0..255]
 *    In this mode you get 256 distinct colors:
 *      0x00 - 0x07: the 8 colors as in TB_OUTPUT_NORMAL
 *      0x08 - 0x0f: TB_<color> | TB_BOLD
 *      0x10 - 0xe7: 216 different colors
 *      0xe8 - 0xff: 24 different shades of grey
 *
 *    Example usage:
 *      tb_set_cell(x, y, '@', 184, 240);
 *      tb_set_cell(x, y, '@', 0xb8, 0xf0);
 *
 * 3. TB_OUTPUT_216        => [0..216]
 *    This mode supports the 3rd range of TB_OUTPUT_256 only, but you don't need
 *    to provide an offset.
 *
 * 4. TB_OUTPUT_GRAYSCALE  => [0..23]
 *    This mode supports the 4th range of TB_OUTPUT_256 only, but you dont need
 *    to provide an offset.
 *
 * 5. TB_OUTPUT_TRUECOLOR  => [0x000000..0xffffff]
 *    This mode provides 24-bit color on supported terminals. The format is
 *    0xRRGGBB.
 *
 * If mode is TB_OUTPUT_CURRENT, the function returns the current output mode.
 *
 * The default output mode is TB_OUTPUT_NORMAL.
 */

Furthermore (if they are valid in other modes), it's unclear to me why in TB_OUTPUT_256, the ranges 0x08 - 0x0f would just be equivalent to bold versions of the 8 basic colors. It seems like you can then get, for example, bold red in two ways:

0x0102
0x0008

So that's confusing :)
Thanks for the help!

Hey, thanks for pointing this out. I agree it is confusing.
Bold, underline, etc are separate escape codes from colors, so any terminal with those caps should be able to apply them in any color mode. The only reason we don't support bold etc in TB_OUTPUT_TRUECOLOR is because the TB_BOLD flags would collide with 24-bit colors. We could address this by introducing TB_TRUECOLOR_BOLD which would occupy the upper 8 bits of a 32-bit int so as to not intefere with 24-bit colors. (See https://github.com/termbox/termbox2/issues/16.)
As for how this actually appears to end users, the results may differ depending on terminal emulator. On my setup (xfce4-terminal, xterm-256color compatible), the range 0x08 - 0x0f in TB_OUTPUT_256 produces "bright" colors, not bold. You can pair both dull and bright red with bold:

xfce4-terminal also has an option to "Show bold text in bright colors" which I have enabled, so I guess that doesn't apply to 256-color mode. I'm curious how other terminal emulators handle it.
If you'd like, feel free to submit a PR to change the comment about 0x08 - 0x0f to something less misleading like:
0x08 - 0x0f: bright versions of the above

Great, thanks for the explanation! Sure, I'll submit that PR - it'll just be what you've written above, though; it sounds fine to me.


Error in fetchAndSave(using userInfo:, container:, error:, completion:)

Hey,
I stumbled upon an error that probably occurs during the transformation from iCloud to CoreData.
It happens during the initial fetchAndSave call during application start.
Error Message: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for ordered to-many relationship: property = "transactions"; desired type = NSOrderedSet; given type = __NSArrayM; value = (
"<CKReference: 0x1c002d560; recordID=<CKRecordID: 0x1c0229200; recordName=3606B38D-FB8F-49FC-B77C-5FC419B56BDA, zoneID=CloudCore:defaultOwner>>"
).'
I have a Type - Entity, which has a to-many relationship to a Transaction - Entity, called transactions.
It seems to get an array value from fetchAndSave but is expecting an NSSet. I changed the value to an NSOrderedSet in CoreData, but it didn't help.
Any idea what could cause this error ?

I think I fixed that error, you may check it in 1.0.1 version.


Make the SlimBot plugin based

Hey @edisonchee !
It will be awesome if you plan to implement a way to write some useful plugins for the but, like what Telebot is doing, but not so complex and buggy!
Awesome botgram!

hello @mehrunrasoli, thank you for your compliments!
I've not thought about adding a plugin system for fear of bloating up its core functionality. If there are a lot of requests for it, we can work on it together. :)


TOML Configuration File

The API server configuration is currently just hardcoded in cmd/api/main.go. Make the server accept TOML configuration files instead.

The TOML-configuration feature is being worked on in the toml-config branch now.


Use SSL every request

I think we always should use SSL.

LGTM

Some tests failed with https on the sandbox :astonished:

https://www.pivotaltracker.com/n/projects/969040/stories/94757548


There is no way to add related RFCs to list of RFCs for the group

Description
In the IPsecME WG, we have lots of old RFCs created by IPsec WG and those are still very relevant to the IPsecWG work. I would like to be able to add those as "Individual documents" through https://datatracker.ietf.org/wg/ipsecme/documents/manage/ link and make them so they appear in the RFCs section of the https://datatracker.ietf.org/group/ipsecme/documents/ page.
It is also annoying that I need to try to find the draft name to add the RFC to the list, i.e., I need to find out what was the draft name of the RFC4301 (draft-ietf-ipsec-rfc2401bis) before I can add that as additional document. It would be much better to be able to type in the RFC numbers directly.
Actually it would be even better to be able to add all RFCs matching RFC430[123456789] regexp...
Code of Conduct

[X] I agree to follow the IETF's Code of Conduct

I just tried this and it seems to work for me?

Lars Eggert writes:

I just tried this and it seems to work for me?

Which of the items worked for you?
At least in the IPsecME
https://datatracker.ietf.org/wg/ipsecme/documents/ the added documents
are not listed as Related RFCs, but are listed in the Related
Internet-Drafts section (see RFC4301 for example).
Also when I go to the manage document list
https://datatracker.ietf.org/group/ipsecme/documents/manage/, and try
to add Individual document there I can't type 4301 to the search item,
as it will not find any document with that name. I need to type in
2401bis to find the draft-ietf-ipsec-rfc2401bis document which was
then published as RFC4301.
So what did work for you? I tested with datatracker and all of the
things I complained about are still not working...
@.***

Ah, so one issue is that there is no "Related RFCs" section - is that what you suggest be added?
For the second, I had tried with "1122" and that finds RFC1122. Odd.

Lars Eggert writes:

Ah, so one issue is that there is no "Related RFCs" section - is that what you
suggest be added?

Yes.
And also perhaps we should have one more search rule types, similar
where we have "All I-Ds with particular text/regular expression in the
name", we could have "All RFCs with particular text/regular expression
in name", but adding the RFCs manually was just one time thing, so
perhaps that is not needed, as this is something that does not need to
be automatically updated when there are new documents.

For the second, I had tried with "1122" and that finds RFC1122. Odd.

I guess that is because the RFC1122 is so old, that no draft
information is provided for it.
RFCs before around RFC 1550 (year 1993) do not seem to have draft
names in the datatracker, thus then it finds them by rfc numbers,
rfcs after that are only found using the draft name (if it is stored
in the datatracker, there seems to be some later RFCs too which do not
have draft names in datatracker).
@.***

The underlying issue is that SearchableDocumentsField operates on Document and not DocAlias, but my database-fu isn't up to making that change.

And DocAlias will get refactored (if not removed) when we make RFCs first class documents. I suggest putting this behind that.


signal: Remove configurable assignment of signal numbers

Summary
And replace NuttX special SIGWORK with SIGIO.
Please reference the issue here for more information: https://github.com/apache/nuttx/issues/8898
Impact
Kconfig change only
Testing
need https://github.com/apache/nuttx-apps/pull/1683 to pass CI.

We need to remove
#ifndef CONFIG_SIG_INT
#  define SIGINT 10
#else
#  define SIGINT CONFIG_SIG_INT
#endif

in apps/system/cu/cu_main.c

@pkarashchenko it's here: https://github.com/apache/nuttx-apps/pull/1683

Sorry it took me so long to merge this.  I thought it was waiting for clean CI result.  I just noticed your comment.