Add render_block method

Related:

#2944

Issue
Twig has a built-in way to render blocks from a twig file instead of the entire file. Timber does not have this implemented.
Twig for Developers - Documentation - Twig PHP
Solution
Add two new methods that leverage pre-existing methods.

Timber::render_block
Timber::compile_block

By adding an additional parameter called $block_name to the render method of the Loader class and to the compile function of the Timber class we can use the current compile function.
If a $block_name is passed and exists within the template provided, then twigs renderBlock is used.
Impact
The primary goal of this change is to address a feature request as mentioned in #2944.
This article highlights some of the general ideas that inspired this feature addition: </> htmx ~ Template Fragments
Usage Changes
Considerations

Potentially a seperate compile method could be used, but I am unsure of where this would be applicable past the current filters that are already in place for the current compile method.
It may be worth throwing an error instead of continuing if the block  is not found found in a template or returning false.
As discussed in #2944 it would be a good idea to add some documentation.
The two primary uses that I have found and would be benefiting from are in hypermedia systems (htmx) uses and for reducing files.
Examples -
HTMX/AJAX/FETCH:
Rendering post block in pagination instead of splitting this into a seperate file.
File Reduction:
Instead of something like toast-success.twig, toast-fail.twig, toast-info.twig all of these could live in a toast.twig file and render each block from there.
Testing

Not included, but would be caught by other unit tests.

coverage: 87.894% (-0.08%) from 87.972%
when pulling db9b4792b9c7057365f8671a663acec64a789a7f on JacobPrice:2.x-render_block
into d56177f5c6a133d2b02b14b212e10c6176087ea7 on timber:2.x.

Hi @JacobPrice ,
Love the addition. We discussed this during our 2.3.0 release meeting and we would like to add some guides on how to use this in the wild as well. This is a pretty big feature that could use some guidence on how/when to use this.
Maybe you and @jasalt can work on a guide on how to use this functionality together? Jarkko came up with some examples of using a similar use case via https://github.com/timber/timber/discussions/3044 and maybe that can be used in conjunction with your code?

Thank's for considering @levdbas. Looking at the render_block implementation, I could give it a go if @JacobPrice can provide some rough examples or instructions, relating to some common use case, how would you see that?
I could use it in some of my projects and supply tutorial/doc improvements, edit suggestions, or code examples that I might see generally useful. Practically I'm mostly interested in having some general HTMX user interface patterns working like endless scroll, active search, pop up carts for web store themes and such with Timber themes, and maybe also plugins.
I added an update just now on some further experiments I had with the same technique I mentioned at https://github.com/timber/timber/discussions/3044, related to multi-language production site project from which I extracted that initial example from while it was in progress. Quite happy already how it works with that plugin already but sure I would be happy to improve.

@Levdbas I will work on putting something together for this. It's a feature that would largely be a preference, as it allows for less code separation, which in some cases may be beneficial.
Another thing that may be worth adding would be a render_block twig function. That would allow for this function to be used inside of a twig file, which sounds odd, but in practice seems to feel nice.
This is a simplistic example:
<!DOCTYPE html>

    {{ render_block(toast_type, 'toasts.twig', {message: toast_message}) }}

    {# ... Content ... #}

{# toasts.twig #}
{% set common_classes = 'top-0 left-0 w-full p-4' %}

{% block error %}

{{ message }}

{% endblock %}

{% block warning %}

{{ message }}

{% endblock %}

{% block success %}

{{ message }}

{% endblock %}

{% block info %}

{{ message }}

{% endblock %}

Ah Gotcha @JacobPrice , this looks great. But with the changes made a render_block function in twig files is not available yet, right?
Things that, in my opinion, are still needed in this PR:

[ ] Unit tests to test this new functionality, if you need help with that, let me know!
[ ] further documentation inside the function doc block on how to use this. You can use this example to further enhance the documentation by including examples in multiple languages
[ ] check if the function also works as intended inside twig files as you show in your example

Thanks for all your work on this so far. This is a great feature!
In addition to the points that @Levdbas listed, I would like to propose we switch the naming from "block" to "twig_block".
I feel like having methods named render_block or compile_block could lead to confusion with the methods that WordPress provides for the block editor. There’s a WordPress function called render_block().
If people see code like the following in Twig, they might think it’s an implementation that renders a WordPress block, if they don’t know about Twig blocks yet.
{{ render_block(toast_type, 'toasts.twig', {message: toast_message}) }}

Yes, there’s no functionality to handle WordPress blocks through Twig templates in Timber, but there might be in the future.
I would like it much better if we could add the disambiguation and use render_twig_block instead:
{{ render_twig_block(toast_type, 'toasts.twig', {message: toast_message}) }}

I would use:

render_twig_block instead of render_block
compile_twig_block instead of compile_block
Each time we write about Twig blocks, we should call them "Twig blocks" instead of just "blocks".


Update package explorer screenshot

Summary
Update package explorer screenshot
Fixes #18778
Preview
✔ Source Link

How come it has a red theme?

How come it has a red theme?

That's my windows theme. That shouldn't be a problem, right?

How come it has a red theme?

That's my windows theme. That shouldn't be a problem, right?

Screenshots should use the default theme - https://review.docs.microsoft.com/en-us/help/contribute/contribute-how-to-create-screenshot?branch=master#create-screenshots.


Update aws-core, http-client-spi, ... to 2.20.101

About this PR
📦 Updates

software.amazon.awssdk:aws-core
software.amazon.awssdk:http-client-spi
software.amazon.awssdk:netty-nio-client

from 2.20.97 to 2.20.101
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

⚙ Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "software.amazon.awssdk" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "software.amazon.awssdk" }
}]

labels: library-update, early-semver-patch, semver-spec-patch, commit-count:1

Superseded by #1215.


Clicking a link prevent navigate to the page

Hi
I need to prevent that clicking on a link, it navigates to the url. I just want it opens the submenu.
I'm using version 3.0.4 with this code:

     Menu 1

Test

Test

     Menu 2

Test

Test

   $("#metismenu").metisMenu({
     preventDefault: true
   });

For example: if I click "Menu 1" it navigates to the page /about instead I just want it opens the submenu. preventDefault: true seems to not working
Some help?

What is your project structure?

Hi @onokumus
it's this one: https://github.com/roots/sage
HTML code is inside /resources/views/partials/header.blade.php
JS code is inside /resources/assets/scripts/routes/common.js
Let me know if I answerd

I don't see metisMenu in this repository.

That's the third-party boilerplate I'm using, it's not mine. The code is placed where I said before.
Let me know if helps

Hi @onokumus have you seen the bug in the codepen? Let me know, thanks


log4net console output not shown in output window

I'd like to be able to see the output from the log4net ConsoleAppender in the resharper test output window when running tests, but the output screen remains blank. I read at https://devnet.jetbrains.com/thread/274354 that it's the responsibility of the plugin to support that.

If you're using xunit 2, then the output won't get captured, due to running tests concurrently - you can't tell which test a piece of output belongs to. See the docs for more details.

Closing this. If there are any more questions, please reopen, or log a new issue.

Summed up, there is no way to capture output from the SUT (which of course cannot use ITestOutputHelper)?
This is a rather heavy restriction ... is there a way to set xunit to "serialized mode" and capture output that way?
This would REALLY help debugging, e.g. I'm currently developing graph algorithms, where nice output can show problems very fast while using the debugger UI leads to massive amount of breakpoint hits...

No, there's no way of doing this. It might be worth suggesting something on the main xunit repo.

In case someone else also stumbles into this thread: https://github.com/xunit/xunit/issues/1038


Configuration of custom environment

Hi! When I customize my environment in the MARLlib, I find it difficult to understand the concepts in the env_config file, e.g. mask_flag, global_state_flag, opp_action_in_cc and agent_level_batch_update, and how they work.
It is better to provide some information about how to set the env config.

Hi. Sorry for the confusion. The mask_flag indicates whether there is a mask available for the action. The global_state_flag is used to indicate whether the natural state is provided for use, such as in SMAC, compared to cases where we need to produce it ourselves, as in MPE. opp_action_in_cc is used to include the actions of other agents in the centralized value function, such as the critic of MAPPO. agent_level_batch_update is a switch that toggles between batch-based RL updates or minibatch-based RL updates.


Kokoro should run on PRs

It looks like the default Kokoro configs don't work for a private repository. Are you folks alright having no CI until this is made public? There is a way to add Kokoro to a private repo but the secrets propagation takes a few days.
@dpcollins-google @anguillanneuf

Internal cl/341844961 fixed it after the repo became public.


Renaming Context results in an error

Expected Behavior
It should compile without error.
Actual Behavior
See repro.
Steps to Reproduce the Problem

Check out the repo.
Make the following changes to examples/models/books/src/lib.rs: https://gist.github.com/banool/94c75ccecaa0cc06d050ce7fc6b4a82d.
Try to run examples/poem/subscription

You will get errors like this:
error[E0277]: the trait bound `&ContextBase<'_, &Positioned<async_graphql::async_graphql_parser::types::Field>>: InputType` is not satisfied
   --> models/books/src/lib.rs:38:1
    |
38  | #[Object]
    | ^^^^^^^^^ the trait `InputType` is not implemented for `&ContextBase<'_, &Positioned<async_graphql::async_graphql_parser::types::Field>>`
    |
    = help: the following other types implement trait `InputType`:
              Arc<T>
              Arc<[T]>
              Arc<str>
              BTreeMap<K, V>
              BTreeSet<T>
              Box<T>
              Box<[T]>
              Box<str>
            and 40 others
note: required by a bound in `ContextBase::<'a, &'a Positioned<async_graphql::async_graphql_parser::types::Field>>::param_value`
   --> /Users/dport/github/async-graphql/src/context.rs:624:27
    |
624 |     pub fn param_value<T: InputType>(
    |                           ^^^^^^^^^ required by this bound in `ContextBase::<'a, &Positioned<Field>>::param_value`
    = note: this error originates in the attribute macro `Object` (in Nightly builds, run with -Z macro-backtrace for more info)

Specifications

Version: 5.0.9

It's not a bug, don't rename Context. 😀

Feels like a footgun, is there a way to make it possible to rename,  or at least make the compiler give a better error message like "please don't rename Context" hahah


False IgnoredReturnValue positive

Expected Behavior
verify(useCase).invoke() should no activate the IgnoredReturnValue rule
Observed Behavior
verify(useCase).invoke() activate the IgnoredReturnValue rule
Steps to Reproduce
In the example, useCase returns a Flow, so the steps are:

Create a test that verify that an interface that returns a Flow is invoked.
Detekt says that you're ignoring the return value.

Context
I have a test in wich I want verify that I'm invoking a method in an interface that returns a Flow.
Your Environment

Version of detekt used: 1.22.0-RC3
Operating System and version: MacOS 12.4

Thanks for the report!
May I ask you @raul19 an executable code snippet, so that it's easier to reproduce this issue?

Hey, awesome Detekt team, Not sure if I should open a new ticket or reopen this one, but this issue is happening when using Detekt 1.22 with TR (./gradlew detektTest)
Meaningless code to just illustrate the issue.
internal class MyUseCase {
    fun execute(): Flow<Int> = flow {
        emit(1)
    }
}

internal class MyUseCaseTest {
    @Test
    fun `test myusecase`() = runTest {
        val mockUseCase = mockk<MyUseCase>()

        verify { mockUseCase.execute() }
    }
}

And the error message

The call execute is returning a value that is ignored. [IgnoredReturnValue]

Thanks for the report!

Not sure if I should open a new issue

Please do that to have the latest info in the top post.

@ahibrahimleague thank you for the detailed report!


set_versions should work cross-module dependencies

set_versions should work cross-module dependencies. E.g., https://github.com/googleapis/google-cloud-java/blob/main/java-asset/pom.xml

@suztomo Do you think it makes sense to have some test to validate that all annotated versions are in fact getting set?


Missing noSuchMethod forwarders when an abstract member is overridden with another abstract member and both classes have user-defined noSuchMethod

Consider the following code:
class A {
  foo(int x);

  noSuchMethod(i) => null;
}

class B extends A {
  foo(int x, [int y]);

  noSuchMethod(i) => null;
}

If I understood the rules for generating noSuchMethod forwarders correctly, both classes should receive implementations for their foo members.  However, fasta currently produces the following (the forwarder is not generated in B):
library;
import self as self;
import "dart:core" as core;

class A extends core::Object {
  synthetic constructor •() → void
    : super core::Object::•()
    ;
  no-such-method-forwarder method foo(core::int x) → dynamic
    return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
  method noSuchMethod(core::Invocation i) → dynamic
    return null;
}
class B extends self::A {
  synthetic constructor •() → void
    : super self::A::•()
    ;
  abstract method foo(core::int x, [core::int y = null]) → dynamic;
  method noSuchMethod(core::Invocation i) → dynamic
    return null;
}

Yes, the crucial point is that generation of a noSuchMethod forwarder is an error when it would override a user-written concrete declaration (such that it must be resolved explicitly by a developer), but it is ok for a noSuchMethod forwarder to override another noSuchMethod forwarder.
Of course, we would only need to generate such a new forwarder in the case where the one that we would then override does not suffice (that is, when it has a signature (like dynamic Function(int)) which is not a correct override of the corresponding member signature in the interface of the class (here: dynamic Function(int, [int]))).


MIPS n32 ABI support, MSA support detection and rename ARCH, ARCHFLAGS

MIPS n32 ABI support, MSA support detection and rename ARCH, ARCHFLAGS
Signed-off-by: Shivraj Patil<EMAIL_ADDRESS>

Hi @sva-img ，
Why do you need to  rename ARCH, ARCHFLAGS?

Hi xianyi,
Existing ARCH and ARCHFLAGS is confusing whether it means architecture flags or archiever flags.
I think, renaming ARCH to AR and ARCHFLAGS to ARFLAGS makes it more clear that these are archiever only flags.
If this looks good, I will resubmit this change in new PR.

@sva-img ,  ARCH and ARCHFLAGS flags come from upstream LAPACK implementation. Thus,   I suggest keep the flags with upstream.

Ok. I have reverted rename change to original in last commit.

@xianyi, Please have a look of combined changes from 'all commits' for better clarity.


Implement textDocument/signatureHelper.

This feature is only triggered when opening a parentheses at a function
call-site. The box disappears as soon as you write the first parameter.
We reuse the completion mechanism to find the method symbol and extract
the parameter lists.

I was unable to get this to work.  I tried duplicating your success step exactly but when I type Predef.assert(
then pause I see no dialog, only a message recorded in the output dialog of vscode
[Error - 3:29:22 PM] Request completionItem/resolve failed.
  Message: Invalid params
  Code: -32602
[object Object]

tailing metaserver.log shows me a request was made, but I don't see any response for it.  Not sure if I am looking in the correct places or not.
15:38:48.997 DEBUG l.core.Connection - Received {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///Users/sdelmore/workspace/language-server/test-workspace/a/src/test/scala/example/UserTest.scala","version":28},"contentChanges":[{"text":"package example\n\nclass UserTest {\n  val user = a.User.apply(name = \"\", 1)\n  user.copy(age = 2)\n  List\n    .apply(1, 2)\n    .map(x => x.+(2))\n  scala.runtime.CharRef.create('a')\n  Predef.assert()\n}\n"}]}}

I just updated my Atom plugin to try this out. And it works!

Although I'm not sure it's supposed to look like this.. 🤔

tailing metaserver.log shows me a request was made, but I don't see any response for it. Not sure if I am looking in the correct places or not.

@ShaneDelmore you see didChange notification, but what you should see instead is something like this:
DEBUG l.core.Connection - Received {"jsonrpc":"2.0","id":40,"method":"textDocument/signatureHelp","params":{"textDocument":{"uri":"file:///Users/laughedelic/dev/laughedelic/language-server/test-workspace/a/src/main/scala/example/User.scala"},"position":{"line":7,"character":13}}}

and response:
INFO  s.m.l.Compiler - Signature help at /Users/laughedelic/dev/laughedelic/language-server/test-workspace/a/src/main/scala/example/User.scala:7:13
DEBUG l.core.MessageWriter - payload: {"jsonrpc":"2.0","result":{"isIncomplete":false,"items":[]},"id":39}
DEBUG l.core.MessageWriter - payload: {"jsonrpc":"2.0","result":{"signatures":[{"label":"apply","documentation":"(name: String, age: Int)a.User","parameters":[{"label":"name","documentation":"name: String"},{"label":"age","documentation":"age: Int"}]}]},"id":40}

check that the VS Code extension refers to the right version of the server (now you have to set it explicitly (i.e. fe14433))
check that you opened test-workspace/a/.  I opened test-workspace/ at first and then things were weird, some stuff worked, other not (probably it's Atom specific).

Here's what I got with some little changes (https://github.com/scalameta/language-server/commit/0749371a49089e38e9239657348e2d5e891e07a2). I think documentation field is only for the scaladoc (which we don't have yet, right?), and label is directly what will be shown in the interface:

(notice that the first parameter is highlighted in bold)
Probably you guys don't care much for Atom, but I think it's useful to see how different clients implement these things to stay unbiased. Here's atom-ide-ui docs for this thing. Some relevant implementation details:

Once activated, all signature help providers (matching the current grammar scope) will continuously be queried for signatures when the cursor location changes, regardless of the value of triggerCharacters.

And here is how it looks in VSCode:

which is quite the same as in Atom :relaxed: except it let's you to check the second alternative (I guess in atom-ide-ui it's just not implemented yet)

Nice! does it highlight the second parameter when you get to it?

No, but it's just not implemented yet as far as I understand. I didn't read the code in details yet, so I'm not sure how exactly it works.

Moreover, it does something weird when you start typing:

@laughedelic that weird behavior is due to the fact that signature helper uses code completions to get the symbols of the methods, it works fine as long as you only invoke it on the trigger character (We need to find a more creative way to handle signature help while you fill out the argument list.

check that the VS Code extension refers to the right version of the server, that you published locally (now you have to set it explicitly (i.e. fe14433))

This will grow tiring very quickly. Is there any chance to use a stable -SNAPSHOT version number outside of CI?

@laughedelic I've fixed the weird behavior for basic cases but to make it handle multiple nested arguments we'll need a slightly more sophisticated solution explained in #52. Now it behaves like this

This will grow tiring very quickly. Is there any chance to use a stable -SNAPSHOT version number outside of CI?

I agree. So did you solve it with a9c4cac?

I've fixed the weird behavior for basic cases

Looks good! 👍

I think I got it working reasonably well now, it tracks the active argument and doesn't return results anymore if you're outside of an argument list! The activeParameter detection is character based so it will count commas inside string literals so that foo(", ", <caret> will say the active argument is 2 when it should be 1. We could use the tokenizer to fix this case, but then we'll have to deal with other problems like unclosed string literals. I think we can leave experiments with that for a future PR!

What about constructors?

@laughedelic great question! I'll take a look, we can try to fallback to the apply member if the symbol we found is not a method

That User(<caret> example @laughedelic crashes :joy:
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
  java.lang.String.<init>(String.java:196)
  scala.tools.nsc.interactive.Global.typeCompletions$1(Global.scala:1217)

I got .apply working too 💃

Lastly, secondary constructors also get some love ❤

Ok, I think this PR is ready to go!

Very nice job! These are super useful when paired with autocompletion! A thing I can see improving (for future PRs) is to pretty print the signature. For instance adding a colon between the param list and the result typ

It works now with User, but I can't make it work with any constructor from the standard lib, like List(), or sys.process.Process().
Also, this looks strange:

(besides different typesetting and no syntax highlighting, which is Atom's fault)
It seems that the first parameter list is missing (and brackets around type parameters too)

@laughedelic I got List(<<1>> working, that one was tricky since there is both an inferred .apply and an inferred type parameter Int. I also added special handling for varargs so that the signature help doesn't disappear on the trailing list of arguments.

Unfortunately, I  couldn't get Process to work, the presentation compiler doesn't have the type information. I suspect it's related to how the .apply methods a mixed into the Process object with a trait.

@laughedelic I am not able to reproduce the missing argument list for map

Gonna merge this since we have #55 using the same testing infrastructure


Open wearable board cannot be detected by laptop and Arduino IDE

Hello, I am trying to use Arduino IDE to upload some new sketch to the open wearable board via Arduino IDE. However, when I try to connect the open wearable board via a USB cable and use Arduino IDE to upload the sketch, I found out that the board cannot be detected and not shown on Arduino IDE when choosing the port. The board is not shown on device manager either. Does anyone have ideas on solving such issue ? Thanks a lot.
Remarks: I followed the Arduino IDE set up steps shown in the repo already and it still does not work

Hello, You have to flash the bootloader first. Also see this issue: https://github.com/OpenEarable/open-earable/issues/75


Send the correct public_updated_at to publishing-api for cbt manual

For: https://trello.com/c/StafARqt/98-manual-has-a-publication-timestamp-that-is-wrong
This manual somehow has a first_published_at that is after it's current
public_updated_at in the publishing-api/content-store.  We don't know
how it happened, but we can fix it with a republish event that sets the
public_updated_at correctly.
There are more notes in the migration.

Looks good 👍


Sampling Rate

Great work!
This is not really an issue, but I just have a question regarding your script.
Is it possible to set the sampling rate with your script? I am writing the data to a text file, and it appears that I am experiencing a delay in the data as I reach the ~350th iterations.
I was hoping by reducing the sampling rate, the delay could be reduced.
Thank you very much.

Thanks!
Good question.  I didn't see anything about sampling rates in the header.  Is there a way to set it with the API?

As far as I see, there is no way in the SDK to specify the sampling rate. You have to reduce the data manually (ie. every second data set, or only every 0.1 second).


FailureApps script_name: nil breaks route generation within mounted engines

Since upgrading to Devise 3.5.2, the Devise::FailureApp from within a Rails engine no longer generates routes with the path it is mounted under.
The breaking change was made in https://github.com/plataformatec/devise/commit/aa675f7f6611de5d40114aa98153f3f0c0b3e8d5, which always passes a script_name (possibly nil) to the url generator. This is problematic because the mount point path is only computed when script_name is not passed to options: https://github.com/rails/rails/blob/v4.2.3/actionpack/lib/action_dispatch/routing/mapper.rb#L631
I'm not sure how to fix this (this is all crazy complicated code), but perhaps there's a better fix for #3643 than forcing path_name to be passed to url_for.

Which Rails version are you using?

Rails 4.2.3.

@jvdp so apparently if we don't set it, there is a infinite loop. If we set it, we break engines.  Do you think this should be fixed in Rails instead?

We're running into this as well, with Rails 4.2.4

FWIW as a test I deleted
      # Rails 4.2 goes into an infinite loop if opts[:script_name] is unset
      if (Rails::VERSION::MAJOR >= 4) && (Rails::VERSION::MINOR >= 2)
        opts[:script_name] = (config.relative_url_root if config.respond_to?(:relative_url_root))
      else
        if config.respond_to?(:relative_url_root) && config.relative_url_root.present?
          opts[:script_name] = config.relative_url_root
        end
      end
``` and I did NOT get an infinite loop, everything worked.

@jvdp @josevalim

@mmitchellg5 hey if that fixes it, great, but doesn't that break a configuration option?
For completeness I think #3738 is a duplicate of this (and #3739 a proposed fix.)

@jvdp sure does, but you can just delete the conditional since apparently rails 4.2.4 does NOT go into an infinite loop without the setting.

I think #3738 may be similar but not exactly the same. I just tried disabling the setting of script_name, and it didn't solve my use case. Warden passes the entire fullpath, leaving it to the callback function to sort things out.

@variousred Also no infinite loop issue in Rails 4.2.4

@josevalim I've submitted PR #3807 that attempts to fix both #3643 and bug it caused above.
Despite suggestions to the contrary, there is definitely a infinite loop in cases where mounted engines change the SCRIPT_NAME env variable to be something other than intended path for a given scope. The '/admin/sidekiq' example in #3643 is a perfect example. I don't know enough about the internals, but it would seem something in 4.2 changed to take the SCRIPT_NAME env variable into account in the absence of a :script_name option being passed in.

Awesome, thanks ofr the PR!

Merged #4081 with a fix for the redirection issue - closing this for now.


Update SC2 for 0.4.3

Updated to 0.4.3 YAML and set things for long async games accessible to new players

I've verified this runs just fine, but I know nothing about the game to comment on option weights.

I'm the game's current maintainer so I know about these new stuff
The idea is to for full game enable all items and do reduction by sets only if a shorter campaign is in
For other settings I've picked the most popular options while still being friendly to new players (therefore no default Brutals)


allow $meta sort on all keys, not just $vector and $vectorize

What this PR does:
Right now we only support vector search on $vector and vectorize search on $vectorize. Tables will allow vector sort on other fields, so this PR makes the sort option more flexible to allow things like sort({ vector: { $meta: [9, 9] } })
Which issue(s) this PR fixes:
Fixes #
Checklist

[ ] Changes manually tested
[ ] Automated Tests added/updated
[ ] Documentation added/updated
[ ] CLA Signed: DataStax CLA

Closing in favor of #258, which includes this PR


Adds an optional custom animation order for AnimatedSprite

fixes #4346

Adds the ability to specify a next frame in FrameObject
When a next frame has been defined for the current frame, the AnimatedSprite will play that frame, instead of the subsequent frame
Adds a callback for when the AnimatedSprite detects and navigates to a 'next' frame
Adds unit tests for AnimatedSprite, including the added 'next-frame' feature
Added 5 32x32 monochromatic images to use for testing purposes

Actually don't merge this yet. I think there's a bug when it will loop instead of going to the next frame.

@griest024: thanks for this feature -- great idea, AnimatedSprite could definitely use some love when playing subsets of textures and having one DisplayObject is useful. The unit-tests are very well thought-out and make validating of PRs much faster, so thank you 👏
I feel like we can improve this API approach though. Creating a pseudo linked-list (i.e. next) with the textures that are passed to the constructor is hard to read and confuses the declarative intention with the FrameObject being about the frame instead of the sequence or playback.
PixiSound has an API which creates sound sprites, which is similar in some ways to this idea, for example. You define sub-sequences of the timeline using from-to markers and reference the sound sprite by alias.
const anim = new PIXI.extras.AnimatedSprite(textures);
anim.addClip('run', 0, 12); // (alias, startFrame, endFrame)
anim.addClip('walk', 13, 20);
anim.play('walk'); // also, maybe anim.gotoAndPlay('walk')?

@bigtimebuddy actually my first instinct was to have named animations like EaselJS but I thought that a breaking change might throw you off the idea.
If you like how EaselJS does it, we can completely rip off their idea and implement that.
Basically we would create a Animation typedef that includes the following fields:

frames: An array of frames to play in order. I think this is preferable to having just a start and end frame since an array wouldn't force the user to have all the textures in the animation passed to the AnimatedSprite sequentially.
next: A string or number representing the animation or frame to play after the animation completes. I'm not sure this can be optional since it might be strange to decide what to play after a named animation.
speed: A number representing how fast each frame is played. 1 is no change.

The EaselJS approach suffers some of the same issues as this PR. It tries to confuse defining clips with choreography of those clips. IMHO, these should be separate methods/systems. There are many cases where you'd want to be able to have more fine control over what animation plays after which, if they loop or play once through, how fast the playback is, if the animation completes or if it's cancelled. These approaches that use "next" field don't scale well or allow for more complexity with regards to playback.
I think I'm still in favor of adding an additional method or methods to AnimatedSprite for defining clips + some alteration to the playback methods. None of these should be breaking changes.
Also, we will not consider breaking changes or minor refactors in v4, since we are in the process of working towards v5 right now. High-value features and bug changes are okay.

Make it into a plugin!

Yeah, plugin might be a better approach here. In general, I think AnimatedSprite is one of the more neglected features of PixiJS and would love to see it overhauled for v5.

Are there any specifications for writing a PIXI plugin? Do I need to call PIXI.use(plugin) or something like that?
@bigtimebuddy You're right, I think just adding a method would be better. Should I write up a proposal for v5 or make changes now for v4?

I'm okay with either approach.
If you want to make some changes to this PR or a new PR for v4 that would be fine although we move slowly here and I'd like some other folks to weigh-in before we merge--so that would take some time and back-and-forth.
If you want to add some crazy new features and functionality, break changes, etc, the plugin option might be the more flexible way forward. If the community digs the plugin, we would definitely consider incorporating ideas for v5, and maybe could use your help with a proposal.
I guess this depends on how much you want to be involved. Long-term make a plugin, short-term make non-breaking changes to AnimatedSprite via PR. Either way, we're grateful for your willingness to help!
To answer your plugin question: renderer, loader and prepare plugins have specific hooks that are needed, but in general a plugin can just be extending a class or adding something to the PIXI global window object. @ivanpopelyshev has created many plugins and would be a good resource for how to set one up from scratch. Also, new sub-systems & classes that extend core PixiJS functionality make for better, more stable plugins than adding prototype methods to existing classes, overriding existing methods, or monkey-patching classes.

@bigtimebuddy I think I'm just going to make a plugin. You can keep up with the development here. Let me know what you want to do about the v5 proposal, I'm interested in helping with development.

@griest024 Sounds good! I will definitely check-out the plugin as you are developing it. You should share your progress on the PixiJS Slack channel to let other people in the PixiJS community know about it. If you aren't already a member of the Slack, email me. Email is on GitHub my profile.
Will be closing this PR. If you want to start on drafting a proposal for v5 related to AnimatedSprite, please just add a new page to the wiki, it's open to edit for all. Otherwise, keep an eye out for info on v5. Usually post on Slack, Twitter, and for specific issues on GitHub.


Better ctrl+click implementation

Hi!
When we click control + object name in sql editor we appear in the object editor and this is ok.
But when object was not loaded into memory, we got an error:

It is ok, because we created table via script and DBEaver dont know about it until object tree reloading.
Could it be possible (in such cases) to run background script to data dictionary, find such objects, add them to the tree (in certain spots) and show object editor like it was loaded into memory "in common way"?
I think UI convenience will be much better.

Ok. Maybe we can refresh metadata during the search process (maybe with the extra option in the Preferences).
Thanks for the report @plotn

The main part of the feature were implemented in the linked PR, however we can't accept this changes due to the found bug #18843. After successful bug resolution this feature request could be handled again.


Update to use TPP fork of Circulation-Web

Description
Update the code in the circulation manager to use the TPP fork of circulation-web. This fork has been pushed to NPM and renamed to circulation-admin. So the changes in this PR reflect both pulling in the new NPM package and renaming the files to reflect the new name of the repo.

It doesn't matter a huge amount since its just changes to comments, but this core PR should go in before this one: https://github.com/ThePalaceProject/circulation-core/pull/2

Updated to pull in the new core commit


Create Ocelot.Provider.Kubernetes on Nuget Feed

Expected Behavior / New Feature
Have Ocelot.Provider.Kubernetes on Nuget Feed
Actual Behavior / Motivation for New Feature
Package doesn't exist, build/release issues:
Pushing Ocelot.Provider.Kubernetes.13.2.0-alpha0030.nupkg to 'https://www.nuget.org/api/v2/package'...
  PUT https://www.nuget.org/api/v2/package/
  Forbidden https://www.nuget.org/api/v2/package/ 195ms
Cake.exe : Response status code does not indicate success: 403 (The specified API key is invalid, has expired, or does not have permission to access the specified package.).
At C:\projects\ocelot-fcfpb\build.ps1:241 char:1
+ &$CAKE_EXE $cakeArguments
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Response status...fied package.).:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

An error occurred when executing task '
ReleasePackagesToUnstableFeed
'.

Steps to Reproduce the Problem

Run the Build on AppVeyor

@TomPallister
please can you add the package over there? Thanks!

I was following the documentation until I noted that the "Ocelot.Provider.Kubernetes" package didn't exist.

Created and released on 13.5.0
@OrihuelaConde @geffzhang


[Easy/Async] Remove future module and pin_project dependency

This PR removes some dead code and unused dependencies that arise from the move to async/await.
Closes #300
Test Plan
CI

bors r+

bors retry


RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False.

Describe the bug
Trying to do an inference on CPU, with a model trained on GPU (Colab). But I get this error:
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
Where I can safely set the map_location?
To Reproduce
      model = get_model(config)
       callbacks = get_callbacks(config)

       trainer = Trainer(callbacks=callbacks, **config.trainer)

       transform_config = config.dataset.transform_config.val if "transform_config" in config.dataset.keys() else None
       dataset = InferenceDataset(
           my_args['input'], image_size=tuple(config.dataset.image_size), transform_config=transform_config
       )
       dataloader = DataLoader(dataset)
       trainer.predict(model=model, dataloaders=[dataloader])

@alevangel, do you set the device to cpu in your config file?

is set to 'auto'.
This is the models/patchcore/config.yaml
dataset:
  name: mvtec #options: [mvtec, btech, folder]
  format: mvtec
  path: ./datasets/PRtg
  task: segmentation
  category: rocks
  image_size: 448
  train_batch_size: 32
  test_batch_size: 1
  num_workers: 8
  transform_config:
    train: null
    val: null
  create_validation_set: false
  tiling:
    apply: false
    tile_size: 64
    stride: null
    remove_border_count: 0
    use_random_tiling: False
    random_tile_count: 16

model:
  name: patchcore
  backbone: wide_resnet50_2
  pre_trained: true
  layers:
    - layer1
    - layer2
    - layer3
  coreset_sampling_ratio: 0.1
  num_neighbors: 9
  normalization_method: min_max # options: [null, min_max, cdf]

metrics:
  image:
    - F1Score
    - AUROC
  pixel:
    - F1Score
    - AUROC
  threshold:
    image_default: 0
    pixel_default: 0
    adaptive: true

visualization:
  show_images: False # show images on the screen
  save_images: True # save images to the file system
  log_images: True # log images to the available loggers (if any)
  image_save_path: null # path to which images will be saved
  mode: full # options: ["full", "simple"]

project:
  seed: 42
  path: ./results

logging:
  logger: [] # options: [tensorboard, wandb, csv] or combinations.
  log_graph: false # Logs the model graph to respective logger.

optimization:
  export_mode: null # options: onnx, openvino

# PL Trainer Args. Don't add extra parameter here.
trainer:
  accelerator: auto # <"cpu", "gpu", "tpu", "ipu", "hpu", "auto">
  accumulate_grad_batches: 1
  amp_backend: native
  auto_lr_find: false
  auto_scale_batch_size: false
  auto_select_gpus: false
  benchmark: false
  check_val_every_n_epoch: 1 # Don't validate before extracting features.
  default_root_dir: null
  detect_anomaly: false
  deterministic: false
  devices: 1
  enable_checkpointing: true
  enable_model_summary: true
  enable_progress_bar: true
  fast_dev_run: false
  gpus: null # Set automatically
  gradient_clip_val: 0
  ipus: null
  limit_predict_batches: 1.0
  limit_test_batches: 1.0
  limit_train_batches: 1.0
  limit_val_batches: 1.0
  log_every_n_steps: 50
  log_gpu_memory: null
  max_epochs: 1
  max_steps: -1
  max_time: null
  min_epochs: null
  min_steps: null
  move_metrics_to_cpu: false
  multiple_trainloader_mode: max_size_cycle
  num_nodes: 1
  num_processes: null
  num_sanity_val_steps: 0
  overfit_batches: 0.0
  plugins: null
  precision: 32
  profiler: null
  reload_dataloaders_every_n_epochs: 0
  replace_sampler_ddp: true
  strategy: null
  sync_batchnorm: false
  tpu_cores: null
  track_grad_norm: -1
  val_check_interval: 1.0 # Don't validate before extracting features.

The error rises from this line:
https://github.com/openvinotoolkit/anomalib/blob/bd369190cdb49f22a22ebd058ea4af46f50aee26/anomalib/utils/callbacks/model_loader.py#L38
Where it attemps to load a model from its weights, but they where trained on GPU I guess

@alevangel, thanks for your suggestion. We could maybe add a fix using map_location=pl_modue.device, which would ensure that model and device is always consistent.


Added tornado implementation alongside config

Implemented a health endpoint alongside a root endpoint, there is also staticfilehandling capability which is currently responding to all other requests if they are not picked up by a specific handler.

Closes #3


Dynamic field omit/removal/exclude

Is their a way to dynamically omit or exclude a field from being output to json.
To give you some context we work with structs and depending on the user type we may not want certain users to see certain fields. It would be nice to simply call a method that adds to an array fields that we would like to exclude before marshaling.

I know you probably have a lot of issues to get to. but if i could get any reply on this, that would be great.
Plus if it doesnt exist I would be more than happy to try to integrate it if would be open to accepting it

@AllenX2018 how to get value of the field? I mean want to exclude from json  depending on value of the field not the name.


docs/specify-pandoc-version

I said in https://github.com/uwdata/living-papers/issues/48 "let me know if you want a PR" but it was easy so I just did it.
Feel free to ignore and close if you don't want it.

Thanks!


Extreme end-user confusion due to keys being mapped inside System Preferences

OS X version: 10.10.5
Karabiner version: 10.22.0
Mac hardware: 27-inch iMac from 2009
Keyboard hardware: Apple Aluminum Keyboard, has numeric keypad.

As a new user of Karabiner, I enabled
For PC Users => Use PC Style Copy Paste
which mapped Control+C to Command_L+C and so on. This mapping does not include Terminal.
I later went into
 => Keyboard => Shortcuts => App Shortcuts
then selected the Terminal application and tried to map the “Copy” menu item to Shift-Control-C. I was mystified to find that every time I typed Shift-Control-C, what appeared on the screen was Command_L+C. Likewise, when I tried to map Paste to Shift-Control-V, I got Command_L+V instead.
I spent quite a bit of time doing web searches to find out why this was happening and found nothing. I figured it was an OS X 10.10 bug.
An experienced user of Karabiner might expect this, in view of the “For PC Users” mapping that I had already enabled. But it never occurred to me that Karabiner's mapping would also be effective inside the Apple keyboard shortcuts window. Finally, after wasting several man-hours, I figured it out.
I think it's unlikely that a user would want to see previously-mapped keys appear in Apple's keyboard shortcut settings window. If feasible, no Karabiner mapping should occur within that window. It can only cause user confusion.
━━━━
Note.  is the Apple logo in Apple's private Unicode. Your web browser might show something else.

Karabiner is a very low level mod, that's why it will effect ANY WHERE on the system.
For your modification adding ModifierFlag::NONE, would help.
You can find more info about it from the doc
https://pqrs.org/osx/karabiner/xml.html.en
search for "ModifierFlag::NONE"
<item>
     <name>Use PC Style Copy/Paste</name>
     <appendix>(Control+C to Command_L+C)</appendix>
     <appendix>(Control+V to Command_L+V)</appendix>
     <appendix>(Control+X to Command_L+X)</appendix>
     <appendix></appendix>
     <appendix>{{ PC_STYLE_BINDINGS_IGNORE_APPS_DESCRIPTION }}</appendix>
     <identifier>private.my.remap.pc_style_copy_paste</identifier>
     <not>{{ PC_STYLE_BINDINGS_IGNORE_APPS }}</not>
     {{ PC_STYLE_BINDINGS_IGNORE_EXTRA }}
     <autogen>
       __KeyToKey__
       KeyCode::C, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL | ModifierFlag::NONE,
       KeyCode::C, ModifierFlag::COMMAND_L,
     </autogen>
     <autogen>
       __KeyToKey__
       KeyCode::V, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL | ModifierFlag::NONE,
       KeyCode::V, ModifierFlag::COMMAND_L,
     </autogen>
     <autogen>
       __KeyToKey__
       KeyCode::X, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL | ModifierFlag::NONE,
       KeyCode::X, ModifierFlag::COMMAND_L,
     </autogen>
   </item>

Above code I took from the Karabiner default code and added the ModifierFlag::NONE, and change the <identifier> so it won't conflct with the default one. Add it to your private.xml and enable it. Let me know if you have any questino.

Also do you want the PC style copy and paste work in "terminal" as well like every where else? if so remove line <not>{{ PC_STYLE_BINDINGS_IGNORE_APPS }}</not>
I recommend as a new user read thru the whole doc once to have an idea what Karabiner can do for you, there are many cool thing you can do
For example:
__SimultaneousKeyPresses__
Press "F", "G" together for "copy"
press "D", "G" together for "paste"
(Those characters are on home row right hand side, easy to press)
or
__DoublePressModifier__
Double tap "Right CMD" twice for "copy"
Double tap "Left CMD" twice for "paste"
(Karabiner is so low level that it can tell the difference between Left or Right Modifier)
or
__KeyOverlaidModifier__
When "Right CMD" tap once act as "copy" and act as "Right CMD" when held with other keys
When "Left CMD" tap once act as "paste" and act as "Left CMD" when held with other keys
is goes on and on, only limited by your imagination. Take a look at the doc and if you need any help feel free to post here, I can help you write out your mod if you have trouble. cheers


Make formatting consistent (Erb vs erb)

This pull request is to make the formatting consistent between erb and Erb.
Also added .project to the .gitignore for those editing in Eclipse.

:+1:

@tas50 Do you have push privs to this repo? If so, can this then get merged?

@ekrupnik I don't have push on this repo.  @odcinek does though.

Thanks Eric!

Sure!


Response from get_exchange_rates() is incorrect oftentimes

If I call client.get_exchange_rates(currency='LTC'), it returns 325.30 at one moment, 1.00 at the next as the corresponding USD value

This is causing issues in Homeassistant to make the package not useful.
I am getting graphs like this:


Some questions

Thank you for sharing the code. How long does it take to train an MVP dataset using VRCNet?

It is not efficient to train our model, and we usually need to spend around 20h to train VRCNet for 2048 points completion.


[Teradata] Comments cannot be added to table, table column, view via UI

System information:

Operating system (distribution) and version Mac
DBeaver version 7.2.5 EA

Connection specification:

Database name and version Teradata

Steps to reproduce, if exist:
Try to add a comment to a table, view, column via UI
Expected: the column is added and can be seen in comment field and in DDL
Actual result: letters cannot be typed in a comment field

Implemented in 7.3.2

Delete comments in table and columns fixed.
Tab "show comments" added to table DDL.


feat: add initial scanner statistics

This just captures some very basic statistics.  I'd like to eventually add bytes read, decode time, and time waiting on I/O to the mix.  However, those will need to wait for https://github.com/lancedb/lance/issues/2977 because those stats will go in the scheduler and we want one scan scheduler to be used in the entire plan first.

Codecov Report
Attention: Patch coverage is 56.73077% with 45 lines in your changes missing coverage. Please review.

Project coverage is 77.60%. Comparing base (9e18322) to head (3a25450).
Report is 4 commits behind head on main.

Files with missing lines
Patch %
Lines

rust/lance/src/dataset/scanner/stats.rs
45.94%
40 Missing :warning:

rust/lance/src/dataset/scanner.rs
80.00%
4 Missing and 1 partial :warning:

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3075      +/-   ##
==========================================
+ Coverage   77.57%   77.60%   +0.03%
==========================================
  Files         240      241       +1
  Lines       78683    79129     +446
  Branches    78683    79129     +446
==========================================
+ Hits        61040    61411     +371
- Misses      14498    14573      +75
  Partials     3145     3145

Flag
Coverage Δ

unittests
77.60% <56.73%> (+0.03%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


can not support centos 7 x86_64 linux kernel 5.x version. except 5.4

I has many machines that are linux kernel 5.x 。 But I find the project(https://github.com/aquasecurity/btfhub-archive) only having centos 7 5.4。so may be incompatible, my program run error.
int tc_ingress(struct __sk_buff *skb)
{
__u32 len = skb->len;
void *data_end = (void *)(__u64)skb->data_end;
void *data = (void *)(__u64)skb->data;
__u32 tc_classid = skb->tc_classid;
char* l2_data_start = data;
char* l2_data_end   = data_end;
unsigned long long int l2_pkt_len = (unsigned long long int)(l2_data_end - l2_data_start);

// if print len, it error, can not running.
// if  print skb->protocol it success
// if print  l2_pkt_len  it success
// if print tc_classid  but the value of tc_classid is 0。it should not 0.

}

Sorry, could you clarify what kernel version you're using, from which distribution ?

I'm closing this as there was no response.


REPLAY-1895 use internalLogger in SR modules

What does this PR do?
A brief description of the change being made with this pull request.
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)

[ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
[ ] Make sure you discussed the feature or bugfix with the maintaining team in an Issue
[ ] Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

Codecov Report

Merging #1574 (5a49661) into develop (0d85e50) will increase coverage by 0.06%.
Report is 2 commits behind head on develop.
The diff coverage is 79.08%.

@@             Coverage Diff             @@
##           develop    #1574      +/-   ##
===========================================
+ Coverage    83.27%   83.33%   +0.06%
===========================================
  Files          437      437
  Lines        14763    14874     +111
  Branches      2223     2225       +2
===========================================
+ Hits         12293    12394     +101
- Misses        1881     1888       +7
- Partials       589      592       +3

Files Changed
Coverage Δ

...sionreplay/internal/net/BatchesToSegmentsMapper.kt
74.23% <43.75%> (-9.56%)
:arrow_down:

...ternal/recorder/callback/RecorderWindowCallback.kt
83.78% <50.00%> (-6.69%)
:arrow_down:

...sessionreplay/internal/recorder/WindowInspector.kt
72.22% <71.43%> (+38.89%)
:arrow_up:

...dog/android/sessionreplay/internal/gson/GsonExt.kt
92.59% <86.67%> (-7.41%)
:arrow_down:

...dog/android/sessionreplay/SessionReplayRecorder.kt
94.67% <100.00%> (+0.46%)
:arrow_up:

...oid/sessionreplay/internal/SessionReplayFeature.kt
100.00% <100.00%> (ø)

...nreplay/internal/async/RecordedDataQueueHandler.kt
97.80% <100.00%> (+9.28%)
:arrow_up:

...lay/internal/domain/SessionReplayRequestFactory.kt
100.00% <100.00%> (ø)

...ssionreplay/internal/processor/MutationResolver.kt
89.22% <100.00%> (+0.50%)
:arrow_up:

...replay/internal/processor/RecordedDataProcessor.kt
95.89% <100.00%> (ø)

... and 2 more

... and 17 files with indirect coverage changes


Aggregation of large volumes of subnets causes null pointer dereference

There is an issue when aggregating a large volume of subnets which causes a null pointer panic
This though does not occur when using Python's standard library to collapse addresses.
Example output:
Converting subnets to Prefixes
Aggregating subnets
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10b2f1a]

goroutine 1 [running]:
github.com/mikioh/ipaddr.aggregateByBF(0xc000694000, 0x19233, 0x19233, 0x1283ef8, 0x1283f08, 0x4, 0x19233, 0x19233)
        /Users/kkirsche/git/go/pkg/mod/github.com/mikioh/ipaddr@v0.0.0-20190404000644-d465c8ab6721/prefix.go:329 +0x69a
github.com/mikioh/ipaddr.Aggregate(0xc000694000, 0x19233, 0x19233, 0x1, 0x1, 0x14)
        /Users/kkirsche/git/go/pkg/mod/github.com/mikioh/ipaddr@v0.0.0-20190404000644-d465c8ab6721/prefix.go:302 +0x103
main.main()
        /Users/kkirsche/git/go/src/github.com/kkirsche/ipaddr-aggregation-error/main.go:27 +0x18a
exit status 2

I've created a repository with a python and a go version showing that one works and one does not.
https://github.com/kkirsche/ipaddr-aggregation-error

Found an alternative library which solved the problem for me:
https://github.com/kkirsche/netaddr-go

I am running into the same problem.
I have attached example code to reproduce the issue.
ipaddr.go.txt


Fork Docker CE builds into separate workflow

Allows testing of CE docker images prior to EE deprecation.

/assign bkatyl

/lgtm


Fix the default-storage-class addon

What this PR does / why we need it:
We started unconditionally deploying the CSI driver in some cases with #1831. This was needed because Kubernetes 1.23 enabled CSIMigration for some providers by default, requiring the CSI driver to be deployed. Namely:

Deploy CSI driver on Azure, AWS, and vSphere clusters if the external CCM is enabled or if the Kubernetes version is >= 1.23
Deploy CSI driver on DigitalOcean, Hetzner, Nutanix, and OpenStack unconditionally

OpenStack has the CSIMigration enabled by default since Kubernetes 1.18
Other providers don't have the in-tree provider, so the CSI driver is required to use volumes

However, we haven't adjusted the default-storage-class addon used to deploy StorageClasses, so it might happen that the StorageClass is not deployed even if it should be deployed.
On top of that, if a cluster is migrated from the in-tree provider to the external CCM, there will be two StorageClasses, and both SCs will be default. This is breaking some workflows, as Kubernetes will fail to create a PV.
The first issue is solved by adjusting the criteria when we deploy the StorageClass.
The second issue (two default StorageClasses) is a more complicated one. We don't want to remove a StorageClass because we don't know is it going to break existing PVCs/PVs. We need to somehow reconcile the old StorageClass (the one that uses the in-tree provider) to remove the default annotation. Right now, we are reconciling only one StorageClass, depending on if the CSI driver is deployed or not.
To solve the issue, we now deploy both StorageClasses unconditionally if the CSI driver is deployed. We are checking if the CSI driver is deployed, and based on that set the default annotation. With this approach, we will have one StorageClass that's not needed, but both StorageClasses are effectively doing the same thing since the CSIMigration will translate all calls from the in-tree provider to the CSI driver.
Does this PR introduce a user-facing change?:
Deploy the StorageClass based on the CSI driver if the CSI driver is deployed
Always deploy the StorageClass based on the in-tree provider. This StorageClass will use the CSI driver if the CSI migration is enabled (default for all providers if the Kubernetes version is >= 1.23 or if the external CCM is used)

/hold
for manual testing

/hold cancel


Shortcut Overlaps with Mojave

macOS version: 10.14
Kap version: 2.2.0
Steps to reproduce
Use the ⇧⌘5 shortcut to start and stop recording.
Current behaviour
MacOS Mojave now has a dedicated screen capture shortcut on  ⇧⌘5.
The shortcut now launches the Mac screen grabber as well as triggering Kap.
Expected behaviour
Kap should default to  ⇧⌘6, or allow user customization.
Workaround
Change the default macOS shortcut away from  ⇧⌘5

You have the ability to customise keyboard shortcuts in the latest Kap Beta (#150), you can get it at getkap.co


Store reference count of 'excinstance' before assert

If the frame is saved for debugging purposes in a profiler or the like, the reference count value of excinstance is not 1.
look at the test code below.
# -*- coding: utf-8 -*-
# test.py

from __future__ import unicode_literals, print_function

import os
import signal
import sys

from couchbase.bucket import Bucket
from couchbase.exceptions import NotFoundError

# Connect to the default bucket on local host
cb = Bucket('couchbase://<IP_ADDRESS>/default')

frames = {}

def signal_handler(signum, frame):
    global frames
    print ('Signal handler called', signum)
    frames.update(sys._current_frames())  # store frames for debugging purpose

signal.signal(signal.SIGPROF, signal_handler)
signal.setitimer(signal.ITIMER_PROF, 0.1, 0.0001)

print ('pid:', os.getpid())
print ('Waiting for a few seconds..')

while True:
    try:
        # Get the document that didn't exist
        item = cb.get('not-exists')
    except NotFoundError:
        pass

OS: Ubuntu 16.04
Python: 2.7
result:
$ python test.py
pid: 23146
Waiting for a few seconds..
Signal handler called 27
python-couchbase: Py_REFCNT(excinstance) == 1 at src/exceptions.c:105. Abort[1]    23146 abort (core dumped)  python test.py

TimeoutError? How to retry the travis-ci build?

I've restarted it for you. There should be a button in the top right if you're signed in.

Thank you!

Did you sign our CLA?

Oh, sorry. I just signed it.

Can you ensure your email in the git commit matches the email you used for Gerrit registration, or can you otherwise close this pull request and re-submit this in gerrit?
You can use e.g.
git config --global user.email<EMAIL_ADDRESS>then recommit the commit (i.e. git commit --amend) and then force push.


Crash on startup

So got my pellet hopper sensor installed started tweaking numbers rebooted and now im in infinite loop
log from control
efault_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/home/pi/pifire/control.py", line 1253, in
pelletdb = ReadPelletDB()
File "/home/pi/pifire/common.py", line 497, in ReadPelletDB
pelletdb_struct = json.loads(json_data_string)
File "/usr/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

tried unplugging sensor but that didnt help either

No sure what happened nuked the pifire folder and restarted

Looks like your pelletdb.json got corrupted somehow.  Maybe try deleting that file (it should get automatically recreated) and rebooting.

Also, if you could tell me which pellet sensor you are using, that might help.
BTW - if you remove the pellet sensor, and still have the system configured to use the hardware pellet sensor it will probably crash.  I really need to incorporate some error checking for these things.

Also, if you could tell me which pellet sensor you are using, that might help.
BTW - if you remove the pellet sensor, and still have the system configured to use the hardware pellet sensor it will probably crash.  I really need to incorporate some error checking for these things.

I'm using the vx one reinstalling got me back up. Next time I will nuke pellet database. File was blank when I looked in it so making more sense

Cool, glad you got it back up and running.  Hopefully the sensor is working OK too.


Try 2 for editor config:

Namespace always file level
Always primary constructor
Inline null checks
Enforce naming
Fix spelling mistakes
simplify default initializations
Add static and readonly where valid
Remove unnecessary usings.
No Functional change

This change is

Codecov Report
Attention: 199 lines in your changes are missing coverage. Please review.

Comparison is base (525950f) 66.63% compared to head (6b268cf) 66.56%.

Files
Patch %
Lines

src/SIL.Machine/Corpora/UsfmParser.cs
28.12%
4 Missing and 19 partials :warning:

...c/SIL.Machine.AspNetCore/Services/S3WriteStream.cs
0.00%
18 Missing :warning:

...achine/FeatureModel/Fluent/FeatureStructBuilder.cs
0.00%
16 Missing :warning:

....Machine.AspNetCore/Services/ClearMLHealthCheck.cs
0.00%
11 Missing :warning:

src/SIL.Machine/FiniteState/Fst.cs
74.28%
9 Missing :warning:

...NetCore/Services/SmtTransferEngineCommitService.cs
0.00%
8 Missing :warning:

...Machine.AspNetCore/Services/ThotSmtModelFactory.cs
0.00%
6 Missing :warning:

...Machine/NgramModeling/ModifiedKneserNeySmoother.cs
0.00%
6 Missing :warning:

.../SIL.Machine.Translation.Thot/ThotSmtParameters.cs
44.44%
5 Missing :warning:

src/SIL.Machine/FeatureModel/FeatureStruct.cs
72.22%
3 Missing and 2 partials :warning:

... and 53 more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #171      +/-   ##
==========================================
- Coverage   66.63%   66.56%   -0.07%
==========================================
  Files         437      437
  Lines       34159    34213      +54
  Branches     4590     4583       -7
==========================================
+ Hits        22762    22775      +13
- Misses      10318    10350      +32
- Partials     1079     1088       +9

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

src/SIL.Machine/Tokenization/LatinWordTokenizer.cs line 27 at r4 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
This is public, so it shouldn't use an underscore. Is one of the rules incorrect?

Added new rule: non-private fields are camelCase.

src/SIL.Machine.Tool/Program.cs line 5 at r4 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
I thought we changed this rule to suggestion.

Removed pragmas.

tests/SIL.Machine.AspNetCore.Tests/Services/ModelCleanupServiceTests.cs line 18 at r4 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
Was it intentional to change these file names? Will it break anything?

There were spelling errors when I wrote them.  They were unintentional.  It will not break anything.

tests/SIL.Machine.Morphology.HermitCrab.Tests/HermitCrabTestBase.cs line 900 at r4 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
You can rename this function.

Done.

tests/SIL.Machine.Morphology.HermitCrab.Tests/HermitCrabTestBase.cs line 12 at r4 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
All of these protected fields should be turned into properties. Also, there is an extra "t" in the variable name.

Should they have the underscore?  Should they be pascal?  I am assuming they would be treated as "non-public fields and properties" as _camelCase?

tests/SIL.Machine.Morphology.HermitCrab.Tests/HermitCrabTestBase.cs line 12 at r4 (raw file):
Previously, johnml1135 (John Lambert) wrote…
Should they have the underscore?  Should they be pascal?  I am assuming they would be treated as "non-public fields and properties" as _camelCase?

I am assuming Pascal.

tests/SIL.Machine.Tests/PhoneticTestsBase.cs line 10 at r4 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
All of these protected fields should be turned into properties.

Done and Pascal.

src/SIL.Machine/Tokenization/LatinWordTokenizer.cs line 27 at r4 (raw file):
Previously, johnml1135 (John Lambert) wrote…
Added new rule: non-private fields are camelCase.

Check that - all public fields are PascalCase.  I believe that is closer to the intention.

tests/SIL.Machine.Morphology.HermitCrab.Tests/HermitCrabTestBase.cs line 900 at r4 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
I would rename it to Character. I should have specified before.

Done

tests/SIL.Machine.Morphology.HermitCrab.Tests/HermitCrabTestBase.cs line 12 at r4 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
Once they are converted to protected properties, they should be treated like public properties, so they can be converted back to pascal case.

Done


Complete JQ Implementation

Ok so I did like half the implementation but it's 3 am and I'm tired.

Rubric For Mini Project 0: JQ
Submission
Canvas
1: The link submitted on Canvas is for the pull request containing the
assignment submission.
0: The link submitted on Canvas is not for the pull request containing the
assignment submission.
Git Branch
1: The branch includes only changes for this assignment.
0: The branch includes commits or changes outside this assignment.
Git Commit Message
1: All commit messages for the branch are reasonably clear.
0: One or more commit messages for the branch are reasonably clear.
GitHub Pull Request
1: The pull request is made to the main branch of the student's fork of the
course repository.
0: The pull request is made to a branch other than main or to a repo that is
not the student's fork of the course repository.
Points
-1 for unrelated files
Submission Score: 3/4
Features
Command Line Interface
For each of the required CLI arguments filter-string, path-to-json, color-output, monochrome-output, sort-keys, indent, and compact-output
0.5: The argument can be correctly parsed and consumed by the rest of the package.
0: The argument is not correctly parsed and propagated to the rest of the package.
Additionally, the command line parsing correctly raises errors to the user when conflicting arguments are inputted.
1.5: Errors are properly determined and bubbled up to the user.
0: Errors are not propagated back to the user.
5/5
Supported Filters
For each of the required filters identity, object-identifier index, array index, array slice, pipe, and array iterator
2: The filter is correctly implemented and properly parses all possible JSON inputs.
1: Minor errors exist in the implement of the filter.
0: Major errors exist in the implementation, or the filter was omitted from the package.
Additionally, comprehensive unit tests are required for each feature:
2: Full unit test coverage is provided (with passing implementations) to exercise a wide varity of use-cases and edge-cases of the filter, ensuring that the output is correct and that errors are properly outputted.
1: Unit tests are present, but lack a significant breadth of cases to fully exercise the filter.
0: Tests are missing, or lack significant assessment of the filter's performance.
Comments
Identity: Correct implementation and unit tests
Object Identifier Index: Correct implementation and unit tests
Array Index: Correct implementation and unit tests
Array Slice: Correct implementation and unit tests
Pipe: Correct Implementation and unit tests
(-4) Array Iterator: Was not implemented and no unit tests
(-2) Not docing points everywhere for this, but as a whole, you test the positive case for each of your tests where you expect current output, but don't test for edge cases or when you expect your filters to fail (ex. when invalid datatypes are given).
Built-In Functions
For each of the required built-in functions add, length, del
2: The built-in function is correctly implemented and properly processes all possible JSON inputs.
1: Minor errors exist in the implementation of the operator.
0: Major errors exist in the implementation, or the function was omitted from the package.
Additionally, comprehensive unit tests are required for each function:
2: Full unit test coverage is provided (with passing implementations) to exercise a wide varity of use-cases and edge-cases of the function, ensuring that the output is correct and that errors are properly outputted.
1: Unit tests are present, but lack a significant breadth of cases to fully exercise the function.
0: Tests are missing, or lack significant assessment of the function's performance.
Comments
(-12) No built-in function was implemented
Formatted Printing
For each of the required formats, colored printing, monochrome printing, sorted keys, indents, and compact output
2: The formatter is correctly implemented and properly displays any JSON object..
1: Minor errors exist in the implementation of the formatter.
0: Major errors exist in the implementation, or the formatter was omitted from the package.
Additionally, unit tests are required for each function:
2: Full unit test coverage is provided (with passing implementations) to ensure that the formatter can correctly handle all expected inputs.
1: Unit tests are present, but lack significant breadth of cases to fully exercise the formatter.
0: Tests are missing, or lack significant assessment of the formatter.
Comments
(-1) Colored Printing: By default, color printing works, but you did not use the JQ_COLORS env variable, nor the actual VT100 escapes, no unit tests
Monochrome Printing: Correct implementation, no unit tests
Sorted Keys: Serde sorts keys by default (for future reference, you can download a separate version of serde that has the feature of preserving order), no unit tests
Indents: Correctly implemented, no unit tests
Compact Output: Correctly implemented, no unit tests
Points
Features Score: 32/61
Code Quality
Design
File/Module organization
2: The program is appropriately split into reasonable files/modules
1: The program is somewhat organized, but there's room for improvement (splits aren't idiomatic, or some modules are still too large, etc.)
0: The program is not split at all
Scalability
5: The code is architected with scalability in mind. If more features needed to be added to the filtering/printing/CLI, they could easily be integrated.
3: The code was architected with some scalaibility in mind. However, significant refactoring would be needed in order to expand the feature set of this tool. (Possible symptoms include not modularizing enough/not effectively using traits + generics).
0: The code is not scalable. The entire package would need to be refactored in order to expand its features.
General Cleanliness
4: The code is effectively documented, especially for sources of user-facing errors. Additionally, function signatures are clear and the code is overall very readable.
2: Attempts at verbose documentation were made, but certain sources of error are unclear OR poor function signatures are used and readers would have slight difficulties while scanning the code.
0: Documentation is severely lacking in several palces and the code is not written in a readable way.
Lint/Format
RustFmt
2: RustFmt produces no warnings when run on the changed files
1: RustFmt produces a few minor warnings when run on the changed files
0: RustFmt produces many warnings when run on the changed files
Clippy
2: Clippy produces no warnings when run on the changed files
1: Clippy produces a few minor warnings when run on the changed files
0: Clippy produces many warnings when run on the changed files
Points
Code Quality Score: 11/15
Scalability: 3/5 - as a whole, I like the separation of logic you made between modules of your application. However, I think there are a few more steps you can take (see comments on PR) to better prepare for added features
General Cleanliness:  2/4 - Code could definitely benefit from some added documentation, especially for how you are parsing the filters
Summary
Add up the point totals here
Total Score: 46/80


Publish latest to NPM again

Last time this grammar has been published to NPM was ~3yrs ago. Since then many improvements have been pushed but they are hard to consume. So, the ask is to publish latest and greatest to NPM

@hendrikvanantwerpen @maxbrunsfeld can you help?

@jrieken New release is out: https://github.com/tree-sitter/tree-sitter-java/releases/tag/v0.20.2. I've also updated the workflows so NPM is automatically released alongside the crate.


Precedence of pipeline operator with list syntax w/o explicit line continuation

Right now, if I compile this code:
f
  * a
    |> b

the resulting Lua is:
return b(f({ -- 2
  a -- 2
})) -- 2

This is the opposite of what I'd expect: based on the indentation, I would've thought it would be parsed as f({ a|> b }), not f({ a }) |> b. If I use an explicit slash:
f
  * a \
    |> b

then it compiles like I'd expect:
return f({ -- 2
  b(a) -- 2
}) -- 3

I'm not sure if this is intentional? But it was certainly rather confusing :sweat_smile:

It is a syntax precedence problem. To support syntax like:
readFile "example.txt"
  |> extract language, {}
  |> parse language
  |> emit
  |> render
  |> print

The multiline pipes are parsed as statements instead of parts of an expression for the moment. So that the newline characters are breaking the expression in the end of function call argument. If we make pipe syntax a higher precedence, the example codes will be parsed as:
readFile("example.txt" |> extract(language, {} |> parse(language |> emit |> render |> print))

That makes sense, but I feel like the indentation is what makes this weirder? Like I'd certainly expect that behavior from, say:
f
  * a
  |> b

which is closer to the example you gave in terms of indentation. The weird part in the original example to me is that it's reaching across multiple levels of indentation.

In the current Yuescript compiler the orignal code:
f
  * a
    |> b

is just seen as:
[expression][newline character]
[advanced indentation][pipe expression]

And there is no rule to tell different [advanced indentation] levels should have different meanings.


Could you support empty selection

Hi,
thank you for this module!
It is possible to provide a selection to set the output to null or an empty string?
Many thanks in advance!
Cheers,
Stefan

@stefanmeschke can you give some use case example for this?


[WFLY-19860] Upgrade WildFly Core to 26.0.1.Final

https://issues.redhat.com/browse/WFLY-19860

Thanks @jamezp


Tabs do not collapse on click, after being opened.

Cannot close on category page: https://flow.coe.hawaii.edu/how-to/

Issue Resolved:
Problem:

Tabs not collapsing on click only on category template (category.html)

Fixed by:

Removing extra script added to category template (2 of the same scripts being called)

View Page:

https://flow.coe.hawaii.edu/how-to/

Thanks @enriquezm!


GA tracking: escaping

Our GA client doesn't correctly escape custom fields, pageviews and possibly other values.
This seems to be the reason for the missing data when doing AdWords linking.
@fauvel could you check all the places in getJs()?
Also when investigating I noticed that when using MP for tracking events the numbers in our database match GA's numbers almost 100%. But when using frontend tracking we have a ~5% discrepancy.
How about switching back to MP, as this was not the reason for the wrong tracking? To see if everything works then - it would give us more precise data!

Ok, I'll implement a fix in GA MP tomorrow!

@njam please review

lgtm!

Tagged 1.128.0


removes suggestion recency time window

Coverage remained the same at 22.876% when pulling d394a4d3d119bca2bebd825f635f483ce61a507c on theseyi:remove-suggestion-time-window into 5c8a029d696a64863d93d938182bc66b60f7101f on linkedin:master.

removes the window we had previously to not render stale annotation suggestions. All suggestions are rendered now, regardless of age even if the policy was very recently modified @cptran777


Separate code into subpackage(s)

To keep things moving quickly, our initial work on dep clustered everything into a single package. That's not ideal for the long term, though. I can imagine at least two discrete subsystems that need separating:

Manifest and Locks, plus the txn writer that works with them.
The analyzer. This is tiny right now, but may get a fair bit bigger over time, especially if we choose to teach it to read data from the existing community tools.

My first instinct is to put these in separate packages, but if we're trying to maintain consistency with how the toolchain does things, it might be better to just put them all in one, non-main subpackage.

It would be nice to work with lock and manifest files programmatically! Moving things out of the main package is something I am looking for.

Yes, it would be really nice to move everything out of the main package. If no one is on it I can work on it tomorrow. I'd only need to know if I should put everything in one non-main subpackage or go for the multi-package approach.

@erizocosmico awesome! i think just one is good to start with. I suspect it'll be as much updating the supporting/CI scripts as it is actually moving code around.

Nice, I'll do it asap.

#178 is merged, so marking this done. We can make a new issue if we want to further subdivide the primary lib package later.


Metrics: WithLatency.sent(long) never called

I'm trying to use a custom CommandLatencyCollector to record metrics regarding the execution time of commands through Lettuce.  I'm finding that the completionLatency argument is invariably a very large number.  Tracking through the code in Lettuce I'm finding that while WithLatency#firstResponse and WithLatency#completed are being called, WithLatency#sent never is, so the value remains the initial value of -1.  The completionLatency argument is calculated from WithLatency#getCompleted - WithLatency#getSent.

Thanks, that's fixed now.


Use 'bvashr' SMT-LIB function instead of bvLshr.

According to http://smtlib.cs.uiowa.edu/logics-all.shtml I think this is meant to be bvashr. Without this change, the following assertion fails:
wire signed [3:0] f_tmp = 4'b1111;
assert (($signed(f_tmp) >>> 1) == 4'b1111);
I want to add a regression test for this but it would be great to get a pointer to where the tests are for smt2 related code.

assert (($signed(f_tmp) >>> 1) == 4'b1111);
According to Verilog rules this is not a signed right shift. The following code would be:
assert (($signed(f_tmp) >>> 1) == 4'sb1111);
And with the latter version the generated SMT2 code also contains an arithmetic right shift.
You patch would introduce a bug as it would use the arithmetic right shift unconditionally, even in cases where the verilog rules tell us to interpret >>> as a logic right shift.

Thank you for the explanation and sorry for the noise.


Push polymorphic discriminator computation to the generator

In the latest implementation of TypeSpecs, we search the CompositeTypeSpec hierarchy for every operation when we need to match a provided value against the CompositeTypeSpec hierarchy. @amarzavery pointed out that we could push much of this computation to the generator.

Please refer to this discussion in the PR for more context.

Is this still a thing?

No.


How to have same format when writing to file as well as terminal?

Hi,
I am writing an application where I want my logger to do 3 things (and how I :

Have different level of logging ✅
Includes timestamp and filename ✅
Ability to write to file as well as to terminal ⚠

I am looking for guidance for point 3. As of now, this is what i am doing to 'hack' around this feature:
logger := log.New()

logFile, err := os.OpenFile("logs.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
    panic(fmt.Sprintf("[Error]: %s", err))
}

mw := io.MultiWriter(os.Stdout, logFile)
logger.SetOutput(mw)

logger.SetFormatter(&log.TextFormatter{
    FullTimestamp: true,
    ForceColors:   true,
})

logger.Debug("Hello from Debug")
logger.Info("Hello from info")

This has  the following outputs:

Terminal:

INFO[2019-11-18T14:19:26Z] Hello from info
WARN[2019-11-18T14:19:26Z] Hello from warn

File

 INFO[2019-11-18T14:19:26Z] Hello from info
WARN[2019-11-18T14:19:26Z] Hello from warn

Any  ideas how I can make the File  output look exactly the same as the Terminal one?
Note: I looked at https://github.com/sirupsen/logrus/issues/784 (which is also referenced in https://github.com/sirupsen/logrus/issues/888 and https://github.com/sirupsen/logrus/issues/780) but #784 changes the formatting to JSON (which  is not what I am looking for)

I think those characters are used for colors. I see you are using ForceColors. If you disable it, I think they will go away.
log.SetFormatter(&log.TextFormatter{
    DisableColors: true,
})

@MinweiShen How can I have colors on terminal but no colors in log file?

@utdrmac You can use two hooks instead of io.MultiWriter. Then you configure the terminal hook to use TextFormatter with DisableColors: true, and the file hook to use TextFormatter with DisableColors: false.

@gguridi Two &writer.Hook hooks? How do I use that for stdout?

@utdrmac Once #1184 is done you will be able to do:
logger.SetOutput(ioutil.Discard) // Send all logs to nowhere by default

logger.AddHook(&Hook{ // Send colored format to stdout
	Writer: os.Stdout,
	LogLevels: []log.Level{
		log.WarnLevel,
	},
	Formatter: &log.TextFormatter{
                 FullTimestamp: true,
		DisableColors:    false,
	},
})

logFile, err := os.OpenFile("logs.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
    panic(fmt.Sprintf("[Error]: %s", err))
}

logger.AddHook(&Hook{ // Send uncolored format to file
	Writer: logFile,
	LogLevels: []log.Level{
		log.InfoLevel,
	},
	Formatter: &log.TextFormatter{
                 FullTimestamp: true,
		DisableColors:    true,
	},
})

If you need the solution right now you can use the logger output for the console and then lsfhook (or another hook for the file output.
logger.SetOutput(os.Stdout) // I think this is the default and not needed.

logger.SetFormatter(&log.TextFormatter{
    FullTimestamp: true,
    ForceColors:   true,
})

logger.AddHook(&lfshook.NewHook(
	lfshook.PathMap{
		logrus.InfoLevel:  "logs.log",
		logrus.ErrorLevel: "logs.log",
                ...
	},
	&log.TextFormatter{
              FullTimestamp: true,
              DisableColors:   true,
        },
)

Is this problem solved? I had the same problem.


Change the name from NetworkInfo to NodeInfo

The existing struct networkInfo had only network information.
We need to know whether the node is Validator or not in order to distinguish between FullNode and Validator.
This is the first work of the work.
Relates #586

It's a self-preview.
There is no problem with the unit test,
but the node address is initialized in the docker test(circle ci)

tests/system/source/main.d(40,21): Error: no property getNetworkInfo for type agora.api.FullNode.API

There was an uncorrected part of the circleCI error in the agora cli part. Modification completed

Ready for review. @linked0 @MukeunKim @AndrejMitrovic @Geod24
I'm happy to receive everyone's review.

Yes to the first commit, but not sure about the second one. First, it doesn't sound like we should rely on our peers to tell us if they are validators or not. Second, that boolean is likely to not be enough. Do you have more commits where you build up on this ?

First, it doesn't sound like we should rely on our peers to tell us if they are validators or not. Second, that boolean is likely to not be enough. Do you have more commits where you build up on this ?

Clearly, the boolean value of the is_valider is running as a Validator for Node.
It is not clear whether this value is a real Validator.
This is simply because it is the set config value of the node.
However, the purpose of this PR should be seen as part of the action to address issue #586.
@Geod24 If you provide more information than boolean value, what additional value would you like to provide?

@TrustHenry's original problem as he described it to me:
#512 splits the Node into two. But there's also the issue of the NetworkManager. It calls getPublicKey on all of the nodes. But only the Validator nodes will implement the getPublicKey API, not FullNode, so this call will fail (probably throw?) when called on a FullNode. To work around that we could add the is_validator flag like Henry did, but there's also the issue of trusting what the node says. The node could lie about is_validator, and the next call to getPublicKey would fail.
So the way things work now:

Node has a quorum set config
Node has a DNS seed or a list of initial nodes to connect to
Node starts, discovers the network, calls getPublicKey on each node. It tries to connect to all the public keys as listed in the quorum set. Then it starts nominating.

There's also a problem with this implementation because getPublicKey can't be trusted. A node could lie about its public key. It would work if we required the node to sign all messages. But to ensure all messages are signed it means /all/ nodes must have a public key, not just the Validators. Do you see the problem?
Maybe a FullNode should also have a PublicKey.

To sign all messages on a node, both Fullnode and Validator require a publickey.
If node sign only the messages that need to be signed, node may not need publickey all of them.
What do you think about signing API messages that only Validaotor provides?

What message need to be signed ?

In an unreliable state, getPublicky is the most basic information for creating a trusted network.
The most important thing is to send a response message from getPublicky along with the message of the signature & publickey.

Public keys don't provide more safety than an IP address. It is trivial and cheap to generate a public key, so nodes can do so at will if they wish to flood the network.

Ah, it would be better to sign with IP address and port.

If another node intercepts the signature information, it is more difficult because it also has to intercept the IP address.

What do you mean by "intercept" ? Even if someone MITM the connection and change the returned PublicKey sent by a validator to its client, they won't be able to generate signed data. But for that, we should just encrypt connections so they can't be intercepted, and that happens at a lower layer.

Ah sorry, I say it's a signature copy, not an intercept.
I am talking about how a node that's not the original node uses the signature by replicating the signature value.

I think we are getting lost here.
Let me recap (the following is a list of successive reasoning, not a list):

Currently, the NetworkInfo relies on all nodes having PublicKey;
This is an issue for non-Validator nodes, because they do not need a PublicKey;
We have two options: Make non-Validators have PublicKey, or change NetworkInfo;
What would be the benefit of having non-Validators have a PublicKey ?
Well, what is the benefit of having Validators have a PublicKey, and does that reasoning apply to non-Validators ?
Validators need a public key because it is their identity. This identity is also stored in the chain;
However, this does not apply to non-Validator: their identity is not stored in the chain, and not tied to the 40k+ stake of BOA;
A PublicKey is easy to generate (it's just a derivation from a random number), so if we don't have Sybil prevention, it's worthless as an identity check;
Hence, non-Validators will not gain anything from having a PublicKey.

Does this make sense ?

@TrustHenry : If you remove the second commit, this will just be a rename and can be merged right away.

I'm ready. removed the second commit


fix for ir_interpreter

Fixes one issue in #4719
Still requires a hack though

Closing in favour of #4735 (not hack or selfids required - the bug was elsewhere).


husky: 0.4.7-1 in 'melodic/distribution.yaml' [bloom]

Increasing version of package(s) in repository husky to 0.4.7-1:

upstream repository: https://github.com/husky/husky.git
release repository: https://github.com/clearpath-gbp/husky-release.git
distro file: melodic/distribution.yaml
bloom version: 0.10.2
previous version for package: 0.4.6-1

husky_base

No changes

husky_bringup

No changes

husky_control

No changes

husky_description
* Add HUSKY_{FRONT|REAR}_BUMPER envars we can use to completely turn off the front & rear bumpers.  This is requested to make integration of the wireless charging docks easier
* Contributors: Chris Iverach-Brereton

husky_desktop

No changes

husky_gazebo

No changes

husky_msgs

No changes

husky_navigation

No changes

husky_robot

No changes

husky_simulator

No changes

husky_viz

No changes

Holding for Melodic sync.


Cannot read property 'downgradeElements' of undefined

I'm having two problems with Storybook, they are very likely to be related.
Reproduce
https://github.com/MechJosh0/storybook-mdl-error
npm install
npm run storybook
Bug 1 CSS/JS not loading on initial view.

Go to localhost:9001 and view our table.Table story module. This will show our React-MDL DataTable component with no CSS or JS. However in the developer tools network tab you can see our material.min.css and material.min.js has been loaded using react-helmet. If you switch to a different story and back, our component will now display correctly.

Bug 2 downgradeElements of undefined

Go to http://localhost:9001/?selectedKind=table.Table&selectedStory=React-MDL%20DataTable&full=0&down=1&left=1, this will display Cannot read property 'downgradeElements' of undefined error. However if you do any changes to the Table component /client/modules/table/components/table.js (ie changed 1 to 2) and cause Storybook to hot-reload the component, it will now display correctly. Hot-reloading will continue to work until you refresh the page again, if you do that then you have to force a hot-reload to hack it to display again.

Both bugs are only producible in Storybook, loading in Meteor is perfectly fine.

Hi @MechJosh0
Thanks for the test repo, it made debugging this issue quite easy.
These bugs happen because the JS files loaded by Helmet is not available when the table gets rendered. It seems helmet is loading js files asynchronously. This can be verified with a console.log statement.
const Table = () => (
  <div>
    {console.log('window.MaterialButton', window.MaterialButton)}
    1
    <Helmet
      link={[
    // ...

Solution
Just import the js file. This will fix these bugs.
import React from 'react';
import {DataTable, TableHeader} from 'react-mdl';
import Helmet from 'react-helmet';
import '../../../../public/lib/getmdl/material.min.js';

Reference:

table.js file

Thanks @mnmtanish for both the solution and the helpful explanation.


Add Active Attributes to LWM2M client

Using wakaama implementation of the LWM2M and fiware IoTAgent.
The scenario I want is LWM2M -> IoTAgent -> Orion
The LWM2M client registers with IoTAgent, But only with lazy attributes. How do I add active attributes for [temperature, humidity], so measures can be transmitted to Orion? Modify some files/code and rebuild client?

LWM2M doesn't have lazy or active attributes. What you probably want it to make some change to IoTAgent (I'm not familiar with it) to observe the desired client resources.

I understand, my concern here is adding temperature and humidity as attributes.  What the LWM2M provision on registering with IoTAgent are mostly device specification attributes (model no, access control owner, etc) it does provision temp and humidity on registering with IoTAgent, please see below:
$curl -X GET \
>   'http://localhost:4041/iot/devices' \
>   -H 'fiware-service: smartGondor' \
>   -H 'fiware-servicepath: /gardens'
{"count":1,"devices":[{"device_id":"raspiSensorTV","service":"smartGondor","service_path":"/gardens","entity_name":"raspiSensorTV:Device","entity_type":"Device","attributes":[],"lazy":[{"object_id":"Short Server ID","name":"Short Server ID","type":"Integer"},{"object_id":"Lifetime","name":"Lifetime","type":"Integer"},{"object_id":"Default Minimum Period","name":"Default Minimum Period","type":"Integer"},{"object_id":"Default Maximum Period","name":"Default Maximum Period","type":"Integer"},{"object_id":"Disable","name":"Disable","type":""},{"object_id":"Disable Timeout","name":"Disable Timeout","type":"Integer"},{"object_id":"Notification Storing When Disabled or Offline","name":"Notification Storing When Disabled or Offline","type":"Boolean"},{"object_id":"Binding","name":"Binding","type":"String"},{"object_id":"Registration Update Trigger","name":"Registration Update Trigger","type":""},{"object_id":"Object ID","name":"Object ID","type":"Integer"},{"object_id":"Object Instance ID","name":"Object Instance ID","type":"Integer"},{"object_id":"ACL","name":"ACL","type":"Integer"},{"object_id":"Access Control Owner","name":"Access Control Owner","type":"Integer"},{"object_id":"Manufacturer","name":"Manufacturer","type":"String"},{"object_id":"Model Number","name":"Model Number","type":"String"},{"object_id":"Serial Number","name":"Serial Number","type":"String"},{"object_id":"Firmware Version","name":"Firmware Version","type":"String"},{"object_id":"Reboot","name":"Reboot","type":""},{"object_id":"Factory Reset","name":"Factory Reset","type":""},{"object_id":"Available Power Sources","name":"Available Power Sources","type":"Integer"},{"object_id":"Power Source Voltage","name":"Power Source Voltage","type":"Integer"},{"object_id":"Power Source Current","name":"Power Source Current","type":"Integer"},{"object_id":"Battery Level","name":"Battery Level","type":"Integer"},{"object_id":"Memory Free","name":"Memory Free","type":"Integer"},{"object_id":"Error Code","name":"Error Code","type":"Integer"},{"object_id":"Reset Error Code","name":"Reset Error Code","type":""},{"object_id":"Current Time","name":"Current Time","type":"Time"},{"object_id":"UTC Offset","name":"UTC Offset","type":"String"},{"object_id":"Timezone","name":"Timezone","type":"String"},{"object_id":"Supported Binding and Modes","name":"Supported Binding and Modes","type":"String"},{"object_id":"Network Bearer","name":"Network Bearer","type":"Integer"},{"object_id":"Available Network Bearer","name":"Available Network Bearer","type":"Integer"},{"object_id":"Radio Signal Strength","name":"Radio Signal Strength","type":"Integer"},{"object_id":"Link Quality","name":"Link Quality","type":"Integer"},{"object_id":"IP Addresses","name":"IP Addresses","type":"String"},{"object_id":"Router IP Addresse","name":"Router IP Addresse","type":"String"},{"object_id":"Link Utilization","name":"Link Utilization","type":"Integer"},{"object_id":"APN","name":"APN","type":"String"},{"object_id":"Cell ID","name":"Cell ID","type":"Integer"},{"object_id":"SMNC","name":"SMNC","type":"Integer"},{"object_id":"SMCC","name":"SMCC","type":"Integer"},{"object_id":"Package","name":"Package","type":"Opaque"},{"object_id":"Package URI","name":"Package URI","type":"String"},{"object_id":"Update","name":"Update","type":""},{"object_id":"State","name":"State","type":"Integer"},{"object_id":"Update Supported Objects","name":"Update Supported Objects","type":"Boolean"},{"object_id":"Update Result","name":"Update Result","type":"Integer"},{"object_id":"Latitude","name":"Latitude","type":"String"},{"object_id":"Longitude","name":"Longitude","type":"String"},{"object_id":"Altitude","name":"Altitude","type":"String"},{"object_id":"Uncertainty","name":"Uncertainty","type":"String"},{"object_id":"Velocity","name":"Velocity","type":"Opaque"},{"object_id":"Timestamp","name":"Timestamp","type":"Time"},{"object_id":"SMS Tx Counter","name":"SMS Tx Counter","type":"Integer"},{"object_id":"SMS Rx Counter","name":"SMS Rx Counter","type":"Integer"},{"object_id":"Tx Data","name":"Tx Data","type":"Integer"},{"object_id":"Rx Data","name":"Rx Data","type":"Integer"},{"object_id":"Max Message Size","name":"Max Message Size","type":"Integer"},{"object_id":"Average Message Size","name":"Average Message Size","type":"Integer"},{"object_id":"StartOrReset","name":"StartOrReset","type":""}],"commands":[],"static_attributes":[]}]}

I think I understand. You would need to add LWM2M objects supporting the desired resources to the client. You probably want objects 3303 and 3304 from http://www.openmobilealliance.org/wp/OMNA/LwM2M/LwM2MRegistry.html.

You need to write the code to implement those objects on your device.

See examples/client/object_*.c files for examples on how to implement a LwM2M Object.

@sbertin-telular @dnav
So adding a temperature variable that should appear as attribute in the iotagent (and measurement observed) requires that bunch of code?

Maybe you are not familiar enough with the LightweightM2M protocol.
I suggest to watch these slides as an introduction: https://www.slideshare.net/zdshelby/oma-lightweightm2-mtutorial
Then this ones for more details: https://www.slideshare.net/OpenMobileAlliance/oma-lwm2m-tutorial-by-arm-to-ietf-ace

@arilwan I think we can close this bug right ?

@sbernard31  yes, closing..