Unable to disable trailing slash redirection

Hi,
I can't find a 'knob' to turn to make pagespeed not redirect /hello/world/ to /hello/world
The problem I'm having is that the redirection it does, are wrong in our proxy setup
We have a nginx (without pagespeed) running on a box on :80 and :443 that will send http requests up-stream to our php instances on :81
What we observe is that the trailing slash redirect includes port :81 in the url, which will end up leaking to the end-user.
I can't find a knob to either turn off this redirect, or tell pagespeed to not include the port in the redirection it's doing

Which nginx pagespeed version are you running?
There's a know issue with redirects (which was fixed in 40c05b4, included since v<IP_ADDRESS>-beta).
See https://github.com/pagespeed/ngx_pagespeed/issues/1214#issuecomment-234801778

We use <IP_ADDRESS>-7553

@jippi you could try upgrading to a version that fixes the earlier redirection problem, or cherry-pick the specific fix: https://github.com/pagespeed/ngx_pagespeed/commit/40c05b4a4ff7c8731c6ee23deea82416408dfc73
I think that would solve your problem. The issue only occurs with relative Location: headers in redirects, so if you could write out a fully qualified url when redirecting instead, that should also fix the problem.
This issue aside, I recommend upgrading to at least version <IP_ADDRESS>`:
https://developers.google.com/speed/pagespeed/module/release_notes#release_<IP_ADDRESS>-stable
I'm closing this issue, but please re-open if applying one of the options above did not resolve it.

Hi, we have tried with <IP_ADDRESS>-0 (dotdeb nginx)
A concrete example:
Without pagespeed enabled:
-> curl -I -L https://bownty.fr/c/2184
HTTP/1.1 302 Found
Date: Mon, 08 Aug 2016 09:40:11 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: __cfduid=d483bf3e394ebd638348aab4bdff177561470649211; expires=Tue, 08-Aug-17 09:40:11 GMT; path=/; domain=.bownty.fr; HttpOnly
Set-Cookie: CAKEPHP=o7v5n68fe9nbj3om8n4bt07fn2; expires=Tue, 08-Aug-2017 15:28:57 GMT; Max-Age=31556926; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: location=1673; expires=Tue, 08-Aug-2017 09:40:11 GMT; Max-Age=31536000; path=/
Set-Cookie: overlay=id%3D1%26close%3D0; path=/
Set-Cookie: pubuid=99823; expires=Fri, 07-Aug-2020 09:40:11 GMT; Max-Age=126144000; path=/; HttpOnly
Location: https://bownty.fr/?category=restaurants
X-Bownty-Server: web03
X-Bownty-Upstream: appcluster
X-Bownty-Proxy: web02
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Server: cloudflare-nginx
CF-RAY: 2cf2016249d73d07-CPH

HTTP/1.1 302 Found
Date: Mon, 08 Aug 2016 09:40:11 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: __cfduid=d483bf3e394ebd638348aab4bdff177561470649211; expires=Tue, 08-Aug-17 09:40:11 GMT; path=/; domain=.bownty.fr; HttpOnly
Set-Cookie: location=1673; expires=Tue, 08-Aug-2017 09:40:11 GMT; Max-Age=31536000; path=/
Location: /paris/restaurants
X-Bownty-Server: web01
X-Bownty-Upstream: appcluster
X-Bownty-Proxy: web02
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Server: cloudflare-nginx
CF-RAY: 2cf20162d9d93d07-CPH

HTTP/1.1 200 OK
Date: Mon, 08 Aug 2016 09:40:11 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: __cfduid=d483bf3e394ebd638348aab4bdff177561470649211; expires=Tue, 08-Aug-17 09:40:11 GMT; path=/; domain=.bownty.fr; HttpOnly
Vary: Accept-Encoding
Set-Cookie: CAKEPHP=3o247mrm733sd1iopf85ojmlf6; expires=Tue, 08-Aug-2017 15:28:57 GMT; Max-Age=31556926; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: location=1673; expires=Tue, 08-Aug-2017 09:40:11 GMT; Max-Age=31536000; path=/
Set-Cookie: overlay=id%3D1%26close%3D1; path=/
Set-Cookie: pubuid=5; expires=Fri, 07-Aug-2020 09:40:11 GMT; Max-Age=126144000; path=/; HttpOnly
X-Bownty-Server: web02
X-Bownty-Upstream: appcluster
X-Bownty-Proxy: web02
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Server: cloudflare-nginx
CF-RAY: 2cf2016329da3d07-CPH

With pagespeed enabled:
-> curl -I -L https://bownty.fr/c/2184
HTTP/1.1 302 Moved Temporarily
Date: Mon, 08 Aug 2016 09:41:15 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: __cfduid=d414afdac9ea980431e23d48151ebc2f61470649274; expires=Tue, 08-Aug-17 09:41:14 GMT; path=/; domain=.bownty.fr; HttpOnly
Set-Cookie: CAKEPHP=j3q304l72vd8ransach8u3q316; expires=Tue, 08-Aug-2017 15:30:01 GMT; Max-Age=31556926; path=/; HttpOnly
Pragma: no-cache
Set-Cookie: location=1673; expires=Tue, 08-Aug-2017 09:41:15 GMT; Max-Age=31536000; path=/
Set-Cookie: overlay=id%3D1%26close%3D0; path=/
Set-Cookie: pubuid=99823; expires=Fri, 07-Aug-2020 09:41:15 GMT; Max-Age=126144000; path=/; HttpOnly
Location: https://bownty.fr/?category=restaurants
X-Bownty-Server: web02
X-Page-Speed: <IP_ADDRESS>-0
Cache-Control: max-age=0, no-cache, no-store, must-revalidate
X-Bownty-Upstream: appcluster
X-Bownty-Proxy: web02
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Server: cloudflare-nginx
CF-RAY: 2cf202f0443a3d3d-CPH

HTTP/1.1 302 Moved Temporarily
Date: Mon, 08 Aug 2016 09:41:15 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: __cfduid=d6e2d36a88cd465094d9c65dae6d7ae581470649275; expires=Tue, 08-Aug-17 09:41:15 GMT; path=/; domain=.bownty.fr; HttpOnly
Location: http://bownty.fr:81/paris/restaurants
Set-Cookie: location=1673; expires=Tue, 08-Aug-2017 09:41:15 GMT; Max-Age=31536000; path=/
X-Bownty-Server: web02
X-Page-Speed: <IP_ADDRESS>-0
Cache-Control: max-age=0, no-cache
X-Bownty-Upstream: appcluster
X-Bownty-Proxy: web02
Strict-Transport-Security: max-age=15552000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Server: cloudflare-nginx
CF-RAY: 2cf202f1a43c3d3d-CPH

As you can see, pagespeed tries to be helpful and remove the trailing / from the url, but frustrating enough adds our internal port :81 to the response, causing the end user to get stuck, since :81 are not public to the network
Are there any way to disable this helpful behavior from pagespeed?

cc @oschaaf

@jippi The fix for this is very probably https://github.com/pagespeed/ngx_pagespeed/commit/40c05b4a4ff7c8731c6ee23deea82416408dfc73 which was not yet included in <IP_ADDRESS>-0. Can you try cherry-picking that commit?

@oschaaf currently we use a prebuild nginx package, so don't have the skills to recompile nginx and the module from scratch at this time :(
I was under the impression that 40c05b4 contained the fix, guess not :)
Are the fix not in any stable releases?

@jippi ngx_pagespeed currently only offers beta-releases, but some of those are linked against a stable version of the pagespeed optimization libraries.
Having said that, ngx_pagespeed <IP_ADDRESS>-beta [1] may be a good choice for you if there is a package available, as it is marked stable for mod_pagespeed and contains 40c05b4.
[1] https://developers.google.com/speed/pagespeed/module/release_notes


Add Template Info to README

Formatting tips
Instructions on updating front matter

New Author layout (ex. https://scikit-learn.org/blog/team/jml-interview/)
Featured Image
Cats/Tags

@reshamas I'm not finished yet but could you take a look and let me know if the instructions make sense?
I'm also considering a new section that details the front matter more specifically.

@laurburke The instructions are comprehensive and look great!

To do:  add example on adding image with attribution to CONTRIBUTING.md
Example:

 Photo credit: Chiara Marmo

@reshamas I linked to instructions to Markdown but I agree that certain things, like adding images, should be specifically called out. Are there any other specific "code samples" you would like to have on the template guide?

To add: highlighting text in blog
Read the full interview on Data Umbrella's blog:
  [Data Umbrella Interview: Juan Martín Loyola](https://blog.dataumbrella.org/jmloyola-opensource-experience)

Added! Anything else to add?


corectrl: init at 1.1.1

Motivation for this change
Closes #100157
Things done

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

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

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

@AndersonTorres I just tested this PR and it works great :+1:
As mentioned in my previous comment, I had to add corectrl to my systemPackages in order to register the dbus config.
To be able to launch the helper without root, you'll need a running polkit-authentication-agent. That was not my case since I'm not using a full DE.

For now I will merge it and try to remember making a NixOS service in a future PR.


docs: fix link to commitlintrc.js

Changelog

Fix link to commitlintrc.js in docs

What's the issue this is solving for? clicking on the link in https://github.com/carbon-design-system/carbon-platform/blob/main/docs/CONTRIBUTING.md#:~:text=a value from-,.commitlintrc.js,-Most of these seems to work for me


Fixed typo "degredation"

This change is

http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/2c222ee8d4ceee3f4f134e78124d234c2bbe5546/


Miri can't track pointer through atomic bit-flip, which happens as usize

In haphazard, I maintain a concurrent linked list of things that can be "locked" through a bit flip in the next pointer. The relevant code is here:
https://github.com/jonhoo/haphazard/blob/ba8ffcceba6f0a0b117c0e35d2ab05a6c1bb5233/src/domain.rs#L259-L281
It basically looks like this:
let head_available = AtomicUsize::new(0);

// ...

let avail = hazptrs.head_available.load(Ordering::Acquire);
if avail == core::ptr::null::<HazPtrRecord>() as usize {
    return core::ptr::null_mut();
}
if (avail & LOCK_BIT) == 0 {
    let avail: *const HazPtrRecord = avail as _;

    // The available list is not currently locked.
    // Take the lock by flipping the bit.
    if head_available.compare_exchange_weak(
        avail as usize,
        avail as usize | LOCK_BIT,
        Ordering::AcqRel,
        Ordering::Relaxed,
    ).is_ok() {
        // ...

I would love to run this code through Miri with -Zmiri-tag-raw-pointers (it runs fine without), but then I (as expected) run into "parent tag " due to the int-to-ptr conversion, which matches the README's note saying " You can recognize false positives by <untagged> occurring in the message -- this indicates a pointer that was cast from an integer, so Miri was unable to track this pointer." You can replicate the issue using:

$ env "MIRIFLAGS=-Zmiri-tag-raw-pointers" cargo +nightly miri test --test lib feels_good

    Finished test [unoptimized + debuginfo] target(s) in 0.03s
     Running tests/lib.rs (/home/jon/.cargo-target/miri/x86_64-unknown-linux-gnu/debug/deps/lib-c166183ccbed9275)

running 1 test
test feels_good ... error: Undefined Behavior: trying to reborrow for SharedReadWrite at alloc65366, but parent tag <untagged> does not have an appropriate item in the borrow stack
   --> /home/jon/dev/streams/haphazard/src/domain.rs:310:33
    |
310 |         let mut next = unsafe { &*tail }.available_next.load(Ordering::Relaxed);
    |                                 ^^^^^^ trying to reborrow for SharedReadWrite at alloc65366, but parent tag <untagged> does not have an appropriate item in the borrow stack
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information

    = note: inside `haphazard::Domain::<haphazard::Global>::try_acquire_available_locked::<1_usize>` at /home/jon/dev/streams/haphazard/src/domain.rs:310:33
    = note: inside `haphazard::Domain::<haphazard::Global>::try_acquire_available::<1_usize>` at /home/jon/dev/streams/haphazard/src/domain.rs:284:45
    = note: inside `haphazard::Domain::<haphazard::Global>::acquire_many::<1_usize>` at /home/jon/dev/streams/haphazard/src/domain.rs:217:29
    = note: inside `haphazard::Domain::<haphazard::Global>::acquire` at /home/jon/dev/streams/haphazard/src/domain.rs:211:9
    = note: inside `haphazard::HazardPointer::new_in_domain` at /home/jon/dev/streams/haphazard/src/hazard.rs:54:21
    = note: inside `haphazard::HazardPointer::<'static>::new` at /home/jon/dev/streams/haphazard/src/hazard.rs:41:9
note: inside `feels_good` at tests/lib.rs:106:17
   --> tests/lib.rs:106:17
    |
106 |     let mut h = HazardPointer::new();
    |                 ^^^^^^^^^^^^^^^^^^^^
note: inside closure at tests/lib.rs:77:1
   --> tests/lib.rs:77:1
    |
76  |   #[test]
    |   ------- in this procedural macro expansion
77  | / fn feels_good() {
78  | |     let drops_42 = Arc::new(AtomicUsize::new(0));
79  | |
80  | |     let x = AtomicPtr::new(Box::into_raw(Box::new((
...   |
160 | |     assert_eq!(drops_9001.load(Ordering::SeqCst), 1);
161 | | }
    | |_^
    = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)

Is there any way for me to "help" Miri realize what's going on here? For reference, the pointer stores happen here:
https://github.com/jonhoo/haphazard/blob/ba8ffcceba6f0a0b117c0e35d2ab05a6c1bb5233/src/domain.rs#L320-L322
and here
https://github.com/jonhoo/haphazard/blob/ba8ffcceba6f0a0b117c0e35d2ab05a6c1bb5233/src/domain.rs#L337-L350

For non-atomic pointer manipulation, a solution exists, see this discussion. At least as far as Miri provenance tracking is concerned, that basically handles the cases Oli mentioned:
/// Converts 'addr' to a pointer using the provenance of 'prov'.
fn int_to_ptr_with_provenance<T>(addr: usize, prov: *const T) -> *const T {
  // Nowhere in this function do we cast an integer to a pointer!
  let ptr = prov.cast::<u8>();
  ptr.wrapping_add(addr.wrapping_sub(ptr as usize)).cast()
}

let addr = ptr as usize;
// do bit-level stuff with addr to compute new_addr
let new_ptr = int_to_ptr_with_provenance(new_addr, ptr);

This code never casts an integer to a pointer and this avoids all the problems associated with that operation.
However, that is likely not enough for atomic pointer manipulation. I'll take a look at this example later to understand what is needed.

Hmm, I think I could probably apply that to the code that's there today, since it does non atomic manipulation and then compare_exchanges it back. Will do that once I get a chance! However the next optimization I had planned for that piece of code was to swap the compare exchange for a fetch_or to do the bit flip atomically, which would then run afoul of the limitation.

Yes, fetch_or is exactly the concern (as @thomcc keeps mentioning whenever I propose int_to_ptr_with_provenance ;).
Basically we'd need fetch_or on AtomicPtr to even make this expressible.

Maybe at least for now an option is to "polyfill" such a fetch_or on Miri by doing a compare_exchange loop instead? Clearly that's not a proper solution though.

Yeah, it's a good idea — I'll take a look at making that change in haphazard for the time being with a link back to this :)

Yes, fetch_or is exactly the concern (as @thomcc keeps mentioning whenever I propose int_to_ptr_with_provenance ;).

I will never log off
So, at one point I considered trying to mock up what the API would look like for a small family of AtomicB32/AtomicB64/AtomicB128, where the B represents bytes, since at the time it was being discussed by LLVM. My hope was if it was relatively clean in the end, I could run it by Ralf and mock up a pre-RFC, or something.
Unfortunately, largely I came to the conclusion it wasn't really viable. That it would just be a lot easier to find a way to either allow pointer->integer conversions, to make the atomic types generic, or to just make the existing atomic types behave this way, even if it means that they have provenance now.
That said, the main motivation for this exploration was "how can I CAS a #[repr(C)] struct { aba_counter: usize, ptr: *mut T }?", rather than this issue. And in fact, making them generic makes the problem in this issue slightly harder to design the API, since IMO it becomes a bit less reasonable to add bitwise operations, given that pointers don't support them[^ptrbitop]?
I also have some... reasonably strong feelings about turning the current pointer->integer->pointer casts[^pcasts] into UB being a stability break too (and I think stability is more important than allowing aggressive optimizations around pointers).

All that said, I suppose it wouldn't be hard to mock up what adding atomic ops directly to AtomicPtr would look like, as an unstable API. This might require new intrinsics for them, although perhaps the functions are enough, and miri could detect that e.g. the atomic_or intrinsic is being used on a pointer type. It may require additional changes to the other backends, I don't know.
That said, something here is probably needed to keep miri working when we integrate parking_lot into libstd, or more broadly improve our lock impls. For example, https://github.com/Amanieu/parking_lot/blob/master/core/src/word_lock.rs[^wordlock] does bitor on an AtomicUsize that holds a pointer, and this kind of MCS-style construction is not uncommon in synchronization primitives.
[^ptrbitop]: Recently, It's been discussed that perhaps they should. I think this would be... interesting.
[^pcasts]: Hell, I almost feel that way about pointer->integer transmutes, and much of the discussion about transmutes was around "what if we just made them be the same as casts", which I guess seems like it's no longer on the table.
[^wordlock]: It's possible we would just use a system lock instead in the libstd integration, since this lock isn't exposed, although I'd be unsurprised if a construction like this doesnt show up in one of the synch primitives we use in the non-parking_lot case, for example the condvar

I also have some... reasonably strong feelings about turning the current pointer->integer->pointer casts2 into UB being a stability break too (and personally I think stability is more important3 than allowing aggressive optimizations around pointers, but I know many others disagree with me here, or disagree that it is actually a violation of our stability rules).

I absolutely hear you. I view this as exploring possibilities.
However, this isn't just about "aggressive optimizations around pointers". If we want to do any optimizations at all based on our reference types (anything that goes beyond what you could do without any alias restrictions), including whatever LLVM already does with the noalias that we emit, I am now convinced we have to either

drop ptr2int2ptr roundtrips, or
make the aliasing model horrendously complicated by having some kind of "speculative provenance" that tracks all possible "provenance guesses" on an int2ptr cast and how they would play out in terms of which pointers get invalidated when, or
accept counter-intuitive behavior such as https://github.com/rust-lang/unsafe-code-guidelines/issues/273

I admit we lack data on how useful these optimizations are in practice.

I implemented the suggested workaround, and documented what we'd need to do for fetch_or, in https://github.com/jonhoo/haphazard/commit/00425287f774670a38cfc4f26cb09ca2cc2ed36b. Thanks!

FWIW here's a convenient wrapper around that cast function that has been proposed several times on Zulip:
fn int_to_ptr_with_provenance<T>(addr: usize, prov: *const T) -> *const T {
    // Nowhere in this function do we cast an integer to a pointer!
    let ptr = prov.cast::<u8>();
    ptr.wrapping_add(addr.wrapping_sub(ptr as usize)).cast()
}

fn ptr_map_addr<T>(ptr: *const T, f: impl FnOnce(usize) -> usize) -> *const T {
    int_to_ptr_with_provenance(f(ptr as usize), ptr)
}

let x = 12u16;
let tagged_x = ptr_map_addr(&x, |addr| addr | 0x1);

Basically we need a way to modify bits of a pointer as long as they only affect things that are not part of the base address. We used to have some of that in miri, but never exposed it to users. In addition to the existing offset method on pointers we need a way to read/write only the bits that the alignment of the pointee says must be zero if we had a reference instead of a pointer.

I actually don't think that we necessarily need the "are not part of the base address" restriction. This restriction is important in C because in C people expect that if they figure out the pointer's address - no matter how - it's ok to use it for an int->ptr cast. But in Rust I don't think that will necessarily be a huge concern, because the rules are sort of more complicated already

I hope this will be resolved by https://github.com/rust-lang/miri/issues/2133.

@RalfJung I'm not sure I completely see how #2133 fixes this? Specifically, if I use AtomicPtr::fetch_or, for example, I think that'll still lose provenance, and there won't be anywhere to recover the provenance from since the AtomicPtr is the only places that actually holds the pointer over time.

There is no AtomicPtr::fetch_or?

https://github.com/rust-lang/rust/pull/96935 is suggesting to add some more operations to AtomicPtr, and they are all provenance-preserving.

Ah, sorry, yes, I was thinking of AtomicUsize::fetch_or with a pointer being stored in there, but that obviously won't work anyway. Thanks for the pointer (heh) to that PR — I'll keep an eye on it!

If you use proper casts to go from a ptr to usize and back, this will actually work now in Miri. But it might miss some bugs since the alias tracking has to get somewhat approximate.


Permit parse reverse proxy headers

Via created a new optional variable : keycloak_quarkus_proxy_headers
Fix enhancement #183
see https://www.keycloak.org/server/reverseproxy about the official keycloak documentation

you welcome.
It's possible to release a new version (lastest is 2.1.0 done the 28 february), so it's can easily deploy on production server ?


Questions about the parameter "loggerFactory" of AddRabbitHelper

@Revazashvili Hi Levan,
I have a question about the parameter "loggerFactory" of AddRabbitHelper, at this version, AddRabbitHelper() is defined like the code below:
public static IServiceCollection AddRabbitHelper(this IServiceCollection services, Action<RabbitConfigurationBuilder> builder, Func<IServiceCollection, ILogger>? loggerFactory = null)
{
    var rabbitConfigBuilder = new RabbitConfigurationBuilder();
    builder.Invoke(rabbitConfigBuilder);
    var rabbitConfig = rabbitConfigBuilder.Build();

    services.AddSingleton<IRabbitHelper>(_ => new RabbitHelper(rabbitConfig, GetLogger(services, loggerFactory)));
    return services;
}

The type of loggerFactory is Func<IServiceCollection, ILogger>?, but when I am using this function in my project, I felt a little wired, usually, we inject a ILogger at Program.cs, not create a new ILogger and pass it into AddRabbitHelper(), how about change the type of loggerFactory to Func<IServiceCollection, ILogger>?? The code might like this:
public static IServiceCollection AddRabbitHelper(this IServiceCollection services, Action<RabbitConfigurationBuilder> builder, Func<IServiceProvider, ILogger>? loggerFactory = null)
{
    var rabbitConfigBuilder = new RabbitConfigurationBuilder();
    builder.Invoke(rabbitConfigBuilder);
    var rabbitConfig = rabbitConfigBuilder.Build();

    services.AddSingleton<IRabbitHelper>(provider => new RabbitHelper(rabbitConfig, GetLogger(provider, loggerFactory)));
    return services;
}

private static ILogger GetLogger(IServiceProvider provider, Func<IServiceProvider, ILogger>? loggerFactory)
{
    return loggerFactory != null ? loggerFactory(provider) : provider.GetRequiredService<ILogger>();
}

Now we can get ILogger from serviceProvider without creating it again while calling AddRabbitHelper().

Hi,
if you want to change last parameter type of AddRabbitHelper, from Func<IServiceCollection, ILogger>? to Func< IServiceProvider, ILogger>? I'm okay with that, but in this method that you provided:
private static ILogger GetLogger(IServiceProvider provider, Func<IServiceProvider, ILogger>? loggerFactory)
{
    return loggerFactory != null ? loggerFactory(provider) : provider.GetRequiredService<ILogger>();
}

is slight problem, how do you know that provider.GetRequiredService method call will return service and not throw exception, how do you that there is logger injected in DI Container?

in my GetLogger method implementation
private static ILogger GetLogger(IServiceCollection services, Func<IServiceCollection, ILogger>? loggerFactory = null)
{
    var logger = loggerFactory is null ? NullLogger : loggerFactory(services);

    return logger;
}

reason why I return NullLogger is that you client of library does not want to provide custom logger factory means that there is no need for logging, but for classes that inject ILogger where must be some implementation, NullLogger is perfect one, you don't have to check null variable all the time and also logs are emited as library client wanted.

Okey, I decided not to change it. NullLogger is a good solution when no ILogger injected.


Fix initialization of visual server in all platforms

Avoid leaking an extra instance when using threads. Also fix threaded loading issues on Android and iOS.
Fix #21609.
Likely fix #17086 too.

Thanks!

Now that Godot 3.1 has been released, we only plan to cherry-pick critical bug fixes to the 3.0 branch, unless there is very strong support in favor of a specific non-critical issue. Removing cherrypick label for 3.0.


⚠ LT Consulting has degraded performance

In e347377, LT Consulting (https://ltconsulting.com.au) experienced degraded performance:

HTTP code: 500
Response time: 17620 ms

Resolved: LT Consulting performance has improved in c84dfe9 after 6 minutes.


api: Implement /users/me/alert_words.

Testing plan: lint and mypy checks passed locally. Ran all the possible combinations of the example.

@YagoGG: Thanks for working on this! Happy to merge! :)


186581572 Import Plotted Function Adorment from Codap

PT Story: https://www.pivotaltracker.com/story/show/186581572
This PR brings the plotted function adornment from CODAP into CLUE.
For now, the function is hard coded to y = x^2, and a plotted function adornment is automatically added to every graph when it is created. These will be changed in future work.

@tejal-shah Yes this should be merged into plot-variables, not master. I think @kswenson is planning on taking a look at this PR today so it would be best to wait for his 👍 before merging.

@tejal-shah This PR has been accepted by everyone now, so I'm going to merge it and deliver the PT story.


Docs link 404

This page on service principals links at the top to create a service principal in the portal. It points to a dead link:
https://docs.microsoft.com/en-us/powershell/azure/resource-group-create-service-principal-portal?view=azurermps-4.3.1
Should probably be:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal
I notice in this markdown file 404'd doc gets referenced a relative path, /azure/azure-resource-manager/resource-group-create-service-principal-portal, but the powershell docs sit under https://docs.microsoft.com/en-us/powershell, so the relative URL has an extra "/powershell" that shouldn't be there.

Hi @alexeldeib  - thank you for pointing this out!  @sdwheeler  - seems like a simple fix.  Did you want to make the update, or should I?

@alexeldeib @TaraMeyer - I will investigate

@alexeldeib - I am not seeing the problem you described. I looked at the published article and the link works for me.

Looks like however the relative URLs were constructed works fine now, sorry for the trouble!


Can't train against GPT-J

I am having trouble running your code to train GPT-J
I can't seem to find the proper value for model_name_or_path and base_model_path.
I have tried EleutherAI/gpt-j-6B for either of them but the program errors out.
Can you please provide the sample command line arguments for vanilla GPT-J?

in train.sh you will find this
--model_name_or_path ""   - it's dir where we store pretreined prefix tensors, if this field is empty - it will init new prefix
--base_model_path "/export/data/gptj/j6b_ckpt" - here is path to GPT-J checkpoint. When I did this scripts, this model still have not been distributed through Huggingface, and was only exposed on the EleutherAI share folder.
Seems this is:
https://mystic.the-eye.eu/public/AI/GPT-J-6B/step_383500_slim.tar.zstd
or you can try full checkpoint:
https://mystic.the-eye.eu/public/AI/GPT-J-6B/step_383500.tar.zstd
Better this code should be rewrited to load model through HF, but currently it's going through this function:
https://github.com/exelents/soft-prompt-tuning/blob/main/gptj_utils.py#L23

Fixed in https://github.com/exelents/soft-prompt-tuning/pull/3


Strongly typed wrappers around primitives

Hi,
Have you considered creating a functionality similar to JsonConverter from JSON.NET which would enable to read/write primitives like string to a strongly-typed wrap? This could be useful for instance, to get strongly typed identifiers on the server side in the request, without additional mappings between the request and the message concumed by the service itself.
I was looking through the Jil code, and considered following scenario:

add either new fields to JilDirectiveAttribute or create a PrimitiveConvertableAttribute that could be added on the wrap type pointing to methods to ConvertFromPrimitive and ConvertToPrimitive
change the InlineSerializer.Build to check for the PrimitiveConvertableAttribute and properly dispatch the build according to the type returned/accepted by the two convert methods.

This would result in passing the parsed primitive value to the method and using the result for the assignment. On the other hand, when serializing, the primitive value extraction, then writing the primitive would work.
What do you think about it? Is it worth a pull request? :-)

I would review a pull request that added this functionality to [JilDirective].

Great, will do.

As you can see, I've sketched the serializer/writer part for this classes. The aim is simple: let's not blow Jil out of proportion with converters, but still, enable strong typing serialized objects with classes wrapping for instance identifiers.
Looking forward to hearing from you. If you like the design, I'd finish the deserializer part.
Any thoughts more than welcome!

A suggestion is to support structure primitive wrappers aswell as classes. Structure wrappers prevent allocations.

Ok. Will do :-)
Beside that, do you see this approach valid and will it get merged when
done?
Any comments about style of introducing this?
Looking forward to hearing from you
12 paź 2015 00:11 "Jan"<EMAIL_ADDRESS>napisał(a):

A suggestion is to support structure primitive wrappers aswell as classes.
Structure wrappers prevent allocations.
—
Reply to this email directly or view it on GitHub
https://github.com/kevin-montrose/Jil/issues/173#issuecomment-147250701.


Incorrect count for: "unit_of_measurement: h"

System Health details
Core 2023.12.4
Supervisor 2023.12.0
Operating System 11.2
Interfejs użytkownika 20231208.2
Checklist

[X] I have enabled debug logging for my installation.
[X] I have filled out the issue template to the best of my ability.
[X] This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
[X] This issue is not a duplicate issue of currently previous issues..

Describe the issue
When selecting the unit of measurement "h", it counts hours incorrectly.

Manually (not using ha-measureit) works fine:

Reproduction steps
Time meter.
Template: {{is_state('binary_sensor.sm_g991b', 'off')}}
Debug logs
n/a

Diagnostics dump
No response

But did you also set the value template to divide the value by 3600?

Can you tell me what to enter in the "Value template"?
I don't know how to react to the result.
Can you give an example?
Thanks

{{ (states('sensor.my,sensor_day') | float / 3600) | round(2) }}

Still counts in seconds...
Below is the recording.
I used templates:
{{ is_state('switch.kitchen_light_left', 'on') }}
{{ (states('sensor.my,sensor_day') | float / 3600) | round(2) }}
and units: h
https://github.com/danieldotnl/ha-measureit/assets/114701129/780bb75c-8a65-46f3-ab6e-ba53d664d4f4

Sorry, you are right. I just copied the reply from the forum without testing.
Couple of remarks:

the right value_template should be something like {{ value | float / 3600 }}. It should not get the state from the states function as this contains the previous value of the sensor.
Even with the right template, it might not do what you expect, and because this is the behaviour when assigning the device_class 'duration'. Device classes influence how the frontend displays data. And I think it does a nice job when you just keep it in seconds. When the value is low, it displays seconds or minutes and when higher, it changes into hours.
If you really want a specific format, I think you should create a new config without the device_class (I just found a bug that updating the device_class in the options menu doesn't work). You can then do something like mentioned in this thread.

Hope this helps!!

Hi, can u pls enter here how can i change measuring from seconds to hours ? im total programming noob, so i would appreciate to have a code for that. thanks

It doesn't work in the current version. I'm working on a new one.
When measuring in hours, what format would you expect/what would the sensor state look like?

24h format, so for example 14:37h  ;-) thanks

Please upgrade to v0.5.4 and read the rewritten README after formatting time sensors.


pkgs/os-specific/linux/virtio_vmmci: init at 0.4.0

virtio_vmmci  (OpenBSD VMM Control Interface) is another (153923) kernel module that expands helps running Linux on OpenBSD's hypervisor.
Motivation for this change
Similar to 153923, this modules is used by NixOS hosts running inside OpenBSD's vmm. This one teaches Linux how to handle shutdown requests from OpenBSD (and a few other things).
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[x] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
22.05 Release Notes (or backporting 21.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

Let me quickly test all of this by spinning a NixOS VM with this kernel module inside a vmm(4) host, and I'll merge this PR.

vmm_clock which landed https://github.com/NixOS/nixpkgs/pull/153923 will be helpful inside vmm too :D - Thanks for looking!!

@GrahamcOfBorg build

@GrahamcOfBorg build linuxPackages.virtio_vmmci

Both my local testing and @GrahamcOfBorg were positive, merging :) Thanks so much for your work!

Yay! Thank you!!


Type guard can be broken by function call

This code currently type checks:
function foo(x:number|string) {
    function blah() {
        x = 'hello';
    }
    if (typeof x === 'number') {
        blah();
        needs_number(x);
    }
}

function needs_number(x:number) {
    console.log(typeof x); // string
}

The assignment to x in blah() bypasses the "... provided no part of the 'if' statement contains assignments to the variable or parameter." condition for type guards (section 4.24).
This may be deliberate, but it could be fixed by changing the condition to "... provided no part of the 'if' statement nor any other function body contains assignments to the variable or parameter." and similarly for ?:, && and ||. This would require that the variable not be global.
Examples:
function foo(x:string|number) {
    if (typeof x === 'number') {
        needs_number(x); // safe
    }
    blah(x);
}

function foo(x:string|number) {
    if (typeof x === 'number') {
        needs_number(x); // unsafe because of assignment in bar()
    }
    function bar() {
        x = ...;
    }
}

function foo(x:string|number) {
    function boo() {
        if (typeof x === 'number') {
            needs_number(x); // unsafe because of assignment in foo()
        }
    }
    x = ...;
}

This is a known limitation. Without being overly conservative it is practically impossible to detect all assignments to a variable. For example, your mutating blah method might not be called directly, but rather through a number of indirections through calls to other methods, some of which might be conditional and depend on flow of your program. Plus you might alias functions using function objects. We could potentially spend an inordinate amount of time doing this analysis and still get it wrong. I think the currently rules are best we can do.

Without being overly conservative (and thus overly restrictive) it is practically impossible to detect all assignments to a variable. For example, your mutating blah method might not be called directly, but rather through a number of indirections through calls to other methods, some of which might be conditional and depend on flow of your program. Plus you might alias functions using function objects. We could potentially spend an inordinate amount of time doing this analysis and still get it wrong.

Changing the condition to "... provided no part of the 'if' statement nor any other function body contains assignments to the variable or parameter." requires no flow analysis whatsoever. It simply applies the existing "is the variable assigned in the 'if' body?" check to the other scopes/function bodies which have access to the variable, nothing more.
The question is: Is this too conservative/restrictive? Would it break any common JS patterns?

Rewriting your example slightly:
function foo(x:number|string) {
    function blah() {
        x = 'hello';
    }
    if (typeof x === 'number') {
        // No mutations of x in this block
        needs_number(x);
    }
    blah();
}

If I understand your proposal correctly, this would now be an error. I definitely think that is too restrictive.

Thanks @ahejlsberg. If that sort of thing is sufficiently common then it may indeed be too restrictive.


Remove version: Netbird.Netbird version <IP_ADDRESS>23577365

Poor formatting, newer versions post 0.20.3 support a simple MSI installer.
Microsoft Reviewers: Open in CodeFlow

URL: - https://github.com/netbirdio/netbird/releases/download/v0.20.3/netbird_installer_0.20.3_windows_amd64.exe
Invalid URI: The URI scheme is not valid.
(Automated message - build 882)

Hi @BiosPlus,
This manifest has the highest version number for this package. Is it available from another location? (This might be in error if the version is switching from semantic to string, or string to semantic.)
(Automated response - build 880.)


readme file generator added

Added Readme.md file generator

Hey, @Bashamega please review this one

sure!

Hey, @Bashamega please check out


Remove message about Object.assign (no longer needed)

Object spread fixed in babel and merged as of 17 February. See here: https://github.com/babel/babel/pull/7034
⚠ I couldn't test this as the example doesn't work in my browser (Geolocation issue) so please check before merging. Apologies if there's an issue with it.

Nope! Sorry. Still: example can be updated with this new info I suspect.

Codecov Report

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

@@           Coverage Diff           @@
##           master     #230   +/-   ##
=======================================
  Coverage   98.36%   98.36%
=======================================
  Files           2        2
  Lines          61       61
  Branches       20       20
=======================================
  Hits           60       60
  Partials        1        1

Continue to review full report at Codecov.

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


Webhook Connector: Replay prevention & HMAC signature format configuration

What do we need to do?

Support replay prevention for HTTP Webhook Connector
Support different formats for HMAC signature

Breakdown

[ ] Support HMAC signature extraction using FEEL expression applied to webhook payload/headers
[ ] Support parsing of replay prevention timestamps
[ ] ... TBD

Why should we do it?
Oftentimes APIs use the same header for HMAC signature and replay prevention purposes. It may look like this:
X-Application-Signature: t=1679672587, v1=<HMAC signature>, where t=<timestamp> is a replay prevention part, and v1=<HMAC signature> is a HMAC signature prefixed by the API version (aka forward compatibility).

This issue was transferred to the connectors-bundle repo.


Auth Email Templates

Create email templates for the authentication functionality
Forgot Password, Reset Password, Register (Admin Invite)

/cib auth-email-templates

Branch 132-auth-email-templates created!


Prevent sidekiq daemon from going into background

Sidekiq has been run as a daemon in app container. When I moved it to the separate container it was still in background mode which caused container to immediately quit.

@lukaszraczylo if you'll just stick the reason for this, as discussed on Hipchat, into the description, I'll merge.


Separate component directory for drivers of devices like sensors

Are there any plans to introduce a separate directory where users can contribute their drivers for external devices like sensors that are very often used which are not part of the core idf but help to start new projects? Or should external device drivers kept left in separate user projects?
For example in esp-open-rtos for ESP8266 there is an extra directory for that purpose which helps a lot to start new projects?

This sounds like https://github.com/espressif/esp-iot-solution

We have some plans for an ESP-IDF package (component) manager, which should facilitate dependency tracking and installation of components developed by Espressif and third parties.
Until we have it, the suggested approach is to publish such components on Github, and create a topic in the "Showcase" section of ESP32.com forum with a brief introduction about the component.


Fix wrong number of arguments when trying to stub methods with rspec

When I try to stub sentence in rspec like
  allow(LiterateRandomizer).to receive(:sentence).and_return 'Thrusting in the place'

it fails with error wrong number of arguments (2 for 1)
This fix solves the problem

Hi @shanebdavis  could you please look at this PR? Thank you!


PlotScatterHighlight HighlightPointNearest Issue

Hi,
I have an issue that visually it appears that the mouse is closer to a point but is highlighting another point because of the way the calculation is made and doesn't take into account the axis scale. Looking into the method HighlightPointNearest the formula is only looking at the actual coordinates of the points (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y) and not looking how the points are drawn on the screen.
Note how visually the mouse appears closure to (2, 200) point

As I move the mouse vertically the highlighted point eventually moves from (1, 100) to (2, 200)

Is there way to factor in the pixel location or the scale of the X and Y axis when different so that the point is highlighting correctly?
Sample Project

TestHighlight.zip

MainWindow.xaml.cs
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    ScottPlot.PlottableScatterHighlight sphTest;
    PlottableVLine vLine;
    PlottableHLine hLine;

    public MainWindow()
    {
        InitializeComponent();

        double[] xs = new double[] { 1, 2 };
        double[] ys = new double[] { 100, 200 };

        sphTest = pltTest.plt.PlotScatterHighlight(xs, ys, lineWidth: 0, color: System.Drawing.Color.Blue, markerSize: 10);

        vLine = pltTest.plt.PlotVLine(1, color: System.Drawing.Color.Red, lineStyle: LineStyle.Dash);
        hLine = pltTest.plt.PlotHLine(100, color: System.Drawing.Color.Red, lineStyle: LineStyle.Dash);

        pltTest.Render();
    }

    private void pltTest_MouseMove(object sender, MouseEventArgs e)
    {

        (double mouseX, double mouseY) = pltTest.GetMouseCoordinates();
        sphTest.HighlightClear();

        var (x, y, index) = sphTest.HighlightPointNearest(mouseX, mouseY);

        int pixelX = (int)e.MouseDevice.GetPosition(pltTest).X;
        int pixelY = (int)e.MouseDevice.GetPosition(pltTest).Y;

        (double coordinateX, double coordinateY) = pltTest.GetMouseCoordinates();

        XPixelLabel.Content = $"{pixelX:0.000}";
        YPixelLabel.Content = $"{pixelY:0.000}";

        XCoordinateLabel.Content = $"{coordinateX:0.00000000}";
        YCoordinateLabel.Content = $"{coordinateY:0.00000000}";

        vLine.position = coordinateX;
        hLine.position = coordinateY;

        pltTest.Render(skipIfCurrentlyRendering: true);
    }
}

Hi @olofszymczak, thanks for sharing your question! I modified your original post to include source code as text.
The problem you are running into is that the HighlightPointNearest() methods use coordinate space, not pixel space, to determine distance between points. Unfortunately there's not an easy way to identify the nearest point using pixel space.

details: Pixel space is only calculated when a Render() method is called (passing-in dimensions for the image), the layout is calculated, then unit/pixel relationships are briefly calculated (based on that layout) and used only inside the Render() method then discarded. In short, all plot types are unaware of the "pixels per unit" because that value is not stored. It may be possible to store something like LastRenderPixelsPerUnitX and LastRenderPixelsPerUnitY, but that is only partially useful because those values might be different on the next render if the plot is resized or a change in tick label length causes the layout to be resized then the pixel space will change.

Would your problem be solved by calling HighlightPointNearestX() instead of HighlightPointNearest()? This would always highlight the point nearest the cursor on the X axis, which might be the effect you're looking for. Since it only has to search 1d space to find the nearest point, this method would be faster too.
I hope this helps!
Scott

Hi @olofszymczak, thanks for sharing your question! I modified your original post to include source code as text.
The problem you are running into is that the HighlightPointNearest() methods use coordinate space, not pixel space, to determine distance between points. Unfortunately there's not an easy way to identify the nearest point using pixel space.

details: Pixel space is only calculated when a Render() method is called (passing-in dimensions for the image), the layout is calculated, then unit/pixel relationships are briefly calculated (based on that layout) and used only inside the Render() method then discarded. In short, all plot types are unaware of the "pixels per unit" because that value is not stored. It may be possible to store something like LastRenderPixelsPerUnitX and LastRenderPixelsPerUnitY, but that is only partially useful because those values might be different on the next render if the plot is resized or a change in tick label length causes the layout to be resized then the pixel space will change.

Would your problem be solved by calling HighlightPointNearestX() instead of HighlightPointNearest()? This would always highlight the point nearest the cursor on the X axis, which might be the effect you're looking for. Since it only has to search 1d space to find the nearest point, this method would be faster too.
I hope this helps!
Scott

Hi @swharden, I cant just use HighlightPointNearestX() as I am using a larger set of data. The example I provided was to highlight the issue. If there is a way to :

Expose the points that are visible in a list or array that contain the pixel location.
use the pixel values to determine the nearest point to the mouse.
then determine the index to get the actual data (coordinates)

Not sure why you closed this discussion?

Hi @swharden, I cant just use HighlightPointNearestX() as I am using a larger set of data. The example I provided was to highlight the issue. If there is a way to :

Expose the points that are visible in a list or array that contain the pixel location.
use the pixel values to determine the nearest point to the mouse.
then determine the index to get the actual data (coordinates)

Not sure why you closed this discussion?

Hi @olofszymczak, I closed the issue because I thought HighlightPointNearestX() would solve your issue, but I now realize your demo was intentionally simplistic and this solution does not adequately address your issue.
Unfortunately, the 3-step process you outlined isn't a great solution for this library. Indeed, it sounds reasonable, but the gotcha here is that pixel locations may change on every render, so storing them after one render doesn't give perfect predictive power for the next render. Re-stating the "details" from the comment above, this library is designed to dynamically calculate the layout on every render. This changes the size and location of the data area based on things like tick label sizes on every render. When the data area size changes, pixel/coordinate conversions all change too. Storing lists of pixel positions at the end of a render could result in inaccurate predictions of where those points will be in the next render, and storing pixel state is largely opposed to the design goals of the rest of the library (which intentionally does not store pixel space as state). I recognize this is a bit of a confusing answer, but all that said I want to work with you to come up with some type of a solution for this problem.
I have a few ideas how this might be possible, but they're pretty complex, require modifying the core library, and I think I should implement them and share working example code rather than try to explain how to do it verbally. I'll probably also do this work in the 4.1-beta (master) branch (pre-release on NuGet) which deprecates the PlotScatterHighlight in favor of simpler solutions.
I'll leave this issue open until I have a better idea about the feasibility of this! Thanks for the follow-up details 👍

Hi @olofszymczak, I closed the issue because I thought HighlightPointNearestX() would solve your issue, but I now realize your demo was intentionally simplistic and this solution does not adequately address your issue.
Unfortunately, the 3-step process you outlined isn't a great solution for this library. Indeed, it sounds reasonable, but the gotcha here is that pixel locations may change on every render, so storing them after one render doesn't give perfect predictive power for the next render. Re-stating the "details" from the comment above, this library is designed to dynamically calculate the layout on every render. This changes the size and location of the data area based on things like tick label sizes on every render. When the data area size changes, pixel/coordinate conversions all change too. Storing lists of pixel positions at the end of a render could result in inaccurate predictions of where those points will be in the next render, and storing pixel state is largely opposed to the design goals of the rest of the library (which intentionally does not store pixel space as state). I recognize this is a bit of a confusing answer, but all that said I want to work with you to come up with some type of a solution for this problem.
I have a few ideas how this might be possible, but they're pretty complex, require modifying the core library, and I think I should implement them and share working example code rather than try to explain how to do it verbally. I'll probably also do this work in the 4.1-beta (master) branch (pre-release on NuGet) which deprecates the PlotScatterHighlight in favor of simpler solutions.
I'll leave this issue open until I have a better idea about the feasibility of this! Thanks for the follow-up details 👍

Thanks,
I looked at the code which calculates the nearest point.
If there where 10000 points and you zoomed in to only show 10 points. It would still loop over all the 10000 points and perform the pointDistanceSquared calculation.
There is room for optimization
public class ScatterPlot
public (double x, double y, int index) GetPointNearest(double x, double y)
{
List<(double x, double y)> points = Xs.Zip(Ys, (first, second) => (first, second)).ToList();
        double pointDistanceSquared(double x1, double y1) => (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);

        double minDistance = pointDistanceSquared(points[0].x, points[0].y);
        int minIndex = 0;
        for (int i = 1; i < points.Count; i++)
        {
            double currDistance = pointDistanceSquared(points[i].x, points[i].y);
            if (currDistance < minDistance)
            {
                minIndex = i;
                minDistance = currDistance;
            }
        }

        return (Xs[minIndex], Ys[minIndex], minIndex);
    }

The array could also be reduced to the Axis Limits as well.
In the following, I am not sure which will be less CPU and memory intensive?
public class ScatterPlotHighlight
Why is a bool[] array used to indicate which point to highlight? the bool array is the size of the data.
protected bool[] isHighlighted;
Why not create a ListHighlightedIndexes and add the index
HighlightedIndexes.Add(index)
Only thing I can think of is the code wanted to highlight a large amount of points but if you only wanted to highlight one point the array seems like a lot of wasted memory..
that way you can skip the following highlighted line
public new void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false)
{
base.Render(dims, bmp, lowQuality);
        if (isHighlighted is null || isHighlighted.Length == 0)
            return;

        using (var gfx = GDI.Graphics(bmp, dims, lowQuality))
        {
            **var highlightedIndexes = Enumerable.Range(0, isHighlighted.Length).Where(x => isHighlighted[x]);**
            foreach (int i in highlightedIndexes)
            {
                PointF pt = new PointF(dims.GetPixelX(Xs[i]), dims.GetPixelY(Ys[i]));
                MarkerTools.DrawMarker(gfx, pt, highlightedShape, highlightedMarkerSize, highlightedColor);
            }
        }
    }

Thanks,
I looked at the code which calculates the nearest point.
If there where 10000 points and you zoomed in to only show 10 points. It would still loop over all the 10000 points and perform the pointDistanceSquared calculation.
There is room for optimization
public class ScatterPlot
public (double x, double y, int index) GetPointNearest(double x, double y)
{
List<(double x, double y)> points = Xs.Zip(Ys, (first, second) => (first, second)).ToList();
        double pointDistanceSquared(double x1, double y1) => (x1 - x) * (x1 - x) + (y1 - y) * (y1 - y);

        double minDistance = pointDistanceSquared(points[0].x, points[0].y);
        int minIndex = 0;
        for (int i = 1; i < points.Count; i++)
        {
            double currDistance = pointDistanceSquared(points[i].x, points[i].y);
            if (currDistance < minDistance)
            {
                minIndex = i;
                minDistance = currDistance;
            }
        }

        return (Xs[minIndex], Ys[minIndex], minIndex);
    }

The array could also be reduced to the Axis Limits as well.
In the following, I am not sure which will be less CPU and memory intensive?
public class ScatterPlotHighlight
Why is a bool[] array used to indicate which point to highlight? the bool array is the size of the data.
protected bool[] isHighlighted;
Why not create a ListHighlightedIndexes and add the index
HighlightedIndexes.Add(index)
Only thing I can think of is the code wanted to highlight a large amount of points but if you only wanted to highlight one point the array seems like a lot of wasted memory..
that way you can skip the following highlighted line
public new void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false)
{
base.Render(dims, bmp, lowQuality);
        if (isHighlighted is null || isHighlighted.Length == 0)
            return;

        using (var gfx = GDI.Graphics(bmp, dims, lowQuality))
        {
            **var highlightedIndexes = Enumerable.Range(0, isHighlighted.Length).Where(x => isHighlighted[x]);**
            foreach (int i in highlightedIndexes)
            {
                PointF pt = new PointF(dims.GetPixelX(Xs[i]), dims.GetPixelY(Ys[i]));
                MarkerTools.DrawMarker(gfx, pt, highlightedShape, highlightedMarkerSize, highlightedColor);
            }
        }
    }

Hi there,
As @swharden write above, main problem is that axis limits available only on Render() call. But HighlightPoint make decission in other place.
To solve this problem, it's possible to move nearest point calclulation to Render().
On HighlightPointNearestWithScales(double x, double y) call, we can just store arguments (x, y), In render loop we will find nearest point to stored coordinates additionaly using scales provided to Render call.
It's possible to make additional interface IHasHiglightablePointsWithScales:
       (double x, double y, int index) HighlightPointNearestWithScales(double x, double y);
        void HighlightClearWithScales();

and implement it for ScatterHighlightable.
@olofszymczak a few counterarguments about the proposed optimizations:

If there where 10000 points and you zoomed in to only show 10 points. It would still loop over all the 10000 points and perform the pointDistanceSquared calculation.
There is room for optimization

ScatterPlot can contain not ordered pairs of x,y. To find visible in current scales points you any way must loop over all points. So it gives nothing.

Why is a bool[] array used to indicate which point to highlight? the bool array is the size of the data.
protected bool[] isHighlighted;
Why not create a ListHighlightedIndexes and add the index
HighlightedIndexes.Add(index)
Only thing I can think of is, when somebody wanted to highlight a large amount of points but if you only wanted to highlight one point the array seems like a lot of wasted memory..

Set highlighPoint on bool array take constant time O(1).
But adding it to list take O(n), where n is current highlighted points count. Because you need to add only unique point. And this is a very common case when you try add an already added one. I think that's why it was done.
In addition, if you evaluate the amount of additional memory, it turns out that you any way have 2 double[n] arrays (xs, ys). So adding additional bool[n] array not such a big problem.

Hi there,
As @swharden write above, main problem is that axis limits available only on Render() call. But HighlightPoint make decission in other place.
To solve this problem, it's possible to move nearest point calclulation to Render().
On HighlightPointNearestWithScales(double x, double y) call, we can just store arguments (x, y), In render loop we will find nearest point to stored coordinates additionaly using scales provided to Render call.
It's possible to make additional interface IHasHiglightablePointsWithScales:
       (double x, double y, int index) HighlightPointNearestWithScales(double x, double y);
        void HighlightClearWithScales();

and implement it for ScatterHighlightable.
@olofszymczak a few counterarguments about the proposed optimizations:

If there where 10000 points and you zoomed in to only show 10 points. It would still loop over all the 10000 points and perform the pointDistanceSquared calculation.
There is room for optimization

ScatterPlot can contain not ordered pairs of x,y. To find visible in current scales points you any way must loop over all points. So it gives nothing.

Why is a bool[] array used to indicate which point to highlight? the bool array is the size of the data.
protected bool[] isHighlighted;
Why not create a ListHighlightedIndexes and add the index
HighlightedIndexes.Add(index)
Only thing I can think of is, when somebody wanted to highlight a large amount of points but if you only wanted to highlight one point the array seems like a lot of wasted memory..

Set highlighPoint on bool array take constant time O(1).
But adding it to list take O(n), where n is current highlighted points count. Because you need to add only unique point. And this is a very common case when you try add an already added one. I think that's why it was done.
In addition, if you evaluate the amount of additional memory, it turns out that you any way have 2 double[n] arrays (xs, ys). So adding additional bool[n] array not such a big problem.

Why is a bool[] array used to indicate which point to highlight? the bool array is the size of the data.
protected bool[] isHighlighted;
Why not create a ListHighlightedIndexes and add the index
HighlightedIndexes.Add(index)
Only thing I can think of is, when somebody wanted to highlight a large amount of points but if you only wanted to highlight one point the array seems like a lot of wasted memory..

You are describing the original implementation. It was changed in https://github.com/Benny121221/ScottPlot/commit/d357830712d4bcfbc44fc4bdc3c9731f33c6b6a6
You are correct, memory usage is generally higher, as the whole bool[] is allocated. So for n points it uses n bytes. Whereas the original implementation stored each highlighted point's index, which means if you have m highlighted points it uses 4m bytes (as the indexes are int32s). Technically this means if you highlighted 25% of the points then they would have the same memory usage, and if you highlighted more than that then the array of bools would actually be faster, but the point of highlighting points is that they stand out, so this is unlikely to happen. Note that both options use a very small amount of memory regardless. For example, I believe there's a demo signal plot with 5 million points. The memory cost of this array is 5 MB. The memory cost of storing the points is 40 MB. The memory cost of 1 HD frame is 8294400 bytes, or about 8.3 MB, and there's at least 1 of these frames at all times (2 if there is double-buffered rendering).
However, if you look at time complexity:

bool[] option is O(1) access, O(1) insert.
Unsorted List<int> is O(n) search, O(1) insert (amortized)
Sorted List<int> is O(log n) search, O(n) insert (List<T> is a dynamic array, aka ArrayList, inserting into the middle of them requires copying)
Unsorted LinkedList<int> is O(n) search, O(1) insert
Sorted LinkedList<int> is O(n) search (binary search is useless on linked lists), O(n) insert (maintaining sorted insertion requires a search)
SortedSet<int> (Red-Black Tree) is O(log n) search, O(log n) insertion
HashSet<int> is O(1) search (amortized), O(1) insertion (amortized)

Now, given that we pay the time complexity cost n times on each render, and the memory cost is negligible, I don't think it makes sense to revert to the previous version, however, a HashSet<int> would actually reduce memory consumption and have the same time complexity.

Why is a bool[] array used to indicate which point to highlight? the bool array is the size of the data.
protected bool[] isHighlighted;
Why not create a ListHighlightedIndexes and add the index
HighlightedIndexes.Add(index)
Only thing I can think of is, when somebody wanted to highlight a large amount of points but if you only wanted to highlight one point the array seems like a lot of wasted memory..

You are describing the original implementation. It was changed in https://github.com/Benny121221/ScottPlot/commit/d357830712d4bcfbc44fc4bdc3c9731f33c6b6a6
You are correct, memory usage is generally higher, as the whole bool[] is allocated. So for n points it uses n bytes. Whereas the original implementation stored each highlighted point's index, which means if you have m highlighted points it uses 4m bytes (as the indexes are int32s). Technically this means if you highlighted 25% of the points then they would have the same memory usage, and if you highlighted more than that then the array of bools would actually be faster, but the point of highlighting points is that they stand out, so this is unlikely to happen. Note that both options use a very small amount of memory regardless. For example, I believe there's a demo signal plot with 5 million points. The memory cost of this array is 5 MB. The memory cost of storing the points is 40 MB. The memory cost of 1 HD frame is 8294400 bytes, or about 8.3 MB, and there's at least 1 of these frames at all times (2 if there is double-buffered rendering).
However, if you look at time complexity:

bool[] option is O(1) access, O(1) insert.
Unsorted List<int> is O(n) search, O(1) insert (amortized)
Sorted List<int> is O(log n) search, O(n) insert (List<T> is a dynamic array, aka ArrayList, inserting into the middle of them requires copying)
Unsorted LinkedList<int> is O(n) search, O(1) insert
Sorted LinkedList<int> is O(n) search (binary search is useless on linked lists), O(n) insert (maintaining sorted insertion requires a search)
SortedSet<int> (Red-Black Tree) is O(log n) search, O(log n) insertion
HashSet<int> is O(1) search (amortized), O(1) insertion (amortized)

Now, given that we pay the time complexity cost n times on each render, and the memory cost is negligible, I don't think it makes sense to revert to the previous version, however, a HashSet<int> would actually reduce memory consumption and have the same time complexity.

As for the problem of getting the closest point, I wonder if one could do something like this:
GetClosest(x,y)
	minDistanceSquared = distanceSquared(GetPixelX(points[0].x), GetPixelY(points[0].y))
	minIndex = 0;

	for i = 1 to n - 1:
		tmp = distanceSquared(GetPixelX(points[i].x), GetPixelY(points[i].y))
		if tmp < minDistanceSquared
			update minIndex and minDistanceSquared

	return points[minIndex]

I think this should address @olofszymczak's concerns, and without requiring the library to hold unnecessary pixel state.

As for the problem of getting the closest point, I wonder if one could do something like this:
GetClosest(x,y)
	minDistanceSquared = distanceSquared(GetPixelX(points[0].x), GetPixelY(points[0].y))
	minIndex = 0;

	for i = 1 to n - 1:
		tmp = distanceSquared(GetPixelX(points[i].x), GetPixelY(points[i].y))
		if tmp < minDistanceSquared
			update minIndex and minDistanceSquared

	return points[minIndex]

I think this should address @olofszymczak's concerns, and without requiring the library to hold unnecessary pixel state.

Hey @Benny121221, I only got to skim this briefly so I apologize if I miss the point here, but I think the core issue that makes this difficult to solve is that GetPixelX() and GetPixelY() are part of the PlotDimensions dims object which is only created inside the Render() method and passed around to the different plottables (it is intentionally never stored). When the user calls HighlightPointNearest(), those pixel dimensions are unavailable.

Hey @Benny121221, I only got to skim this briefly so I apologize if I miss the point here, but I think the core issue that makes this difficult to solve is that GetPixelX() and GetPixelY() are part of the PlotDimensions dims object which is only created inside the Render() method and passed around to the different plottables (it is intentionally never stored). When the user calls HighlightPointNearest(), those pixel dimensions are unavailable.

Hi @olofszymczak, @StendProg, and @bclehmann, this is an interesting discussion! There's a lot to unpack here, and there are multiple ways to solve this problem. I think I found an efficient working solution to the primary issue. A few different topics are addressed here, so I'll mention them separately:
Pixel-Aware GetPointNearest()
I'm still working on the PR, but briefly I modified the code that measures distance between two points so it now optionally incorporates the ratio of scales (pixels per unit) of X and Y axes. See #722 for details.
// Use it like this
double xyRatio = formsPlot1.Plot.XAxis.Dims.PxPerUnit / formsPlot1.Plot.YAxis.Dims.PxPerUnit;
(double x, double y, int index) = MyScatterPlot.GetPointNearest(mouseCoordX, mouseCoordY, xyRatio);

// This is how it works
public (double x, double y, int index) GetPointNearest(double x, double y, double xyRatio = 1)
{
    double pointDistanceSquared(double x1, double y1) =>
        (x1 - x) * (x1 - x) * (xyRatio * xyRatio) + (y1 - y) * (y1 - y);

    /* rest of the function is unchanged */
}

Optimization may be improved
As discussed above, it may be possible to further optimize this method for speed. I haven't benchmarked it, if LINQ and tuples are replaced with discrete statements it may run faster. This is outside the scope of the original issue, but worth considering. I added it as a low-priority triaged task in #716 and I probably won't do it soon, but if someone wants to do this and make a PR I'd be happy to take a look.
ScatterPlotHighlight is Deprecated in ScottPlot 4.1
This plot type was useful for a while, but it has a highly undesirable design: it mixes point distance detection with rendering. This design limits what the user can do. For example, the user could not use this plot type to render something different (like an arrow) as a highlight. Also this plot type cannot be used for Signal plots or other plot types.
In ScottPlot 4.1 a IHasPoints interface was created that has a few GetPointNearest() methods. Plottables where highlight functionality is desired can simply implement this interface. Since it does not control rendering, users can display the highlight however they want.
The recommended way to display a highlighted point is to use AddPoint() to place a point (a scatter plot with a single X/Y value), set its marker shape to filled circle, then set its color and size how you like. When the mouse moves you can find the point nearest the mouse, then change this point's X/Y position and visibility, and request a render. This method is demonstrated verbosely in this WinForms app: Form1.cs

Hi @olofszymczak, @StendProg, and @bclehmann, this is an interesting discussion! There's a lot to unpack here, and there are multiple ways to solve this problem. I think I found an efficient working solution to the primary issue. A few different topics are addressed here, so I'll mention them separately:
Pixel-Aware GetPointNearest()
I'm still working on the PR, but briefly I modified the code that measures distance between two points so it now optionally incorporates the ratio of scales (pixels per unit) of X and Y axes. See #722 for details.
// Use it like this
double xyRatio = formsPlot1.Plot.XAxis.Dims.PxPerUnit / formsPlot1.Plot.YAxis.Dims.PxPerUnit;
(double x, double y, int index) = MyScatterPlot.GetPointNearest(mouseCoordX, mouseCoordY, xyRatio);

// This is how it works
public (double x, double y, int index) GetPointNearest(double x, double y, double xyRatio = 1)
{
    double pointDistanceSquared(double x1, double y1) =>
        (x1 - x) * (x1 - x) * (xyRatio * xyRatio) + (y1 - y) * (y1 - y);

    /* rest of the function is unchanged */
}

Optimization may be improved
As discussed above, it may be possible to further optimize this method for speed. I haven't benchmarked it, if LINQ and tuples are replaced with discrete statements it may run faster. This is outside the scope of the original issue, but worth considering. I added it as a low-priority triaged task in #716 and I probably won't do it soon, but if someone wants to do this and make a PR I'd be happy to take a look.
ScatterPlotHighlight is Deprecated in ScottPlot 4.1
This plot type was useful for a while, but it has a highly undesirable design: it mixes point distance detection with rendering. This design limits what the user can do. For example, the user could not use this plot type to render something different (like an arrow) as a highlight. Also this plot type cannot be used for Signal plots or other plot types.
In ScottPlot 4.1 a IHasPoints interface was created that has a few GetPointNearest() methods. Plottables where highlight functionality is desired can simply implement this interface. Since it does not control rendering, users can display the highlight however they want.
The recommended way to display a highlighted point is to use AddPoint() to place a point (a scatter plot with a single X/Y value), set its marker shape to filled circle, then set its color and size how you like. When the mouse moves you can find the point nearest the mouse, then change this point's X/Y position and visibility, and request a render. This method is demonstrated verbosely in this WinForms app: Form1.cs

@swharden thanks for the solution... tested it on my data set works perfect.

@swharden thanks for the solution... tested it on my data set works perfect.


Use Case and High-Level Description

Is there any document that describe the output of model that human can read? Or please help me a method to understand the output. I found one document on the internet, but I am not sure whether it is correct or not for model in this repo: https://docs.openvino.ai/2021.2/omz_models_public_retinaface_resnet50_retinaface_resnet50.html
My target is run this model in mobile devices. I can covert and get the net_out. I would like to parse net_out to get the score, facial_area, landmarks.  I am not familiar with Python so I don't understand clearly what it does to parse net_out in detect_faces function.

i am not the designer of retinaface model. you might research this from its original research paper. this is just an implementation and it is working. that is all the responsibility of the package.


Processing of "symlinked" files

TRFP fails if the file to process is provided as a symlink if using Mono >6. See #108

[x] Check if the problem still exists
[x] Implement a (most likely) platform-dependent fix

Implemented in 82ff97c6517c0fe2475ec202457ddbdf07dc7afd
Tested on Windows 10 Native and Ubuntu 20.04.5 LTS/Mono <IP_ADDRESS>

Closed in version 1.4.2


Helpful edits to the readme

Hi, there.
Thanks for doing the work to create this integration!
In the Stream Deck section of the readme, the steps jump from downloading your awesome package right to the plugin showing up in the StreamDeck app.
In a show of my genuine appreciation, I've outlined the process to get your code into the Stream Deck app, along with the a link to the official Elgato Developer Docs that I used to successfully install your app.
No offense or expectation for you to include the below.  I've forked your repo and added it there as well in case others find it.
Again, many thanks for your efforts.
🙏🏻, ✌🏻, ❤ & 🤗,
--Shawn

A couple of notes before starting

Note 1: Please refer to the official Elgato Stream Deck documentation to create your own plugin if the below doesn't work for you as that will have the latest and greatest information.

Note 2: The process below was successfully completed on macOS Monterrey 12.0 Beta. The process is similar for Windows systems. Please refer to the Elgato documentation using the link in Note 1 above.

3 - Be sure you've completely QUIT the Stream Deck app before going through the steps below.

Steps
1 - Download ripnet's latest streamdeck-hubitat release
2 - Unzip/Extract the zip file in whatever directory/folder you downloaded the file (~/Downloads in the screenshot)

3 - Open a new Finder window (CMD+N) and use the Shift+CMD+G shortcut key to go to this folder:
`~/Library/Application Support/com.elgato.StreamDeck/Plugins/`

Note the full path to the Stream Deck Plugins Directory

5 - Back in the other Finder window (Downloads) drag and drop the extracted zip folder and all its contents to the Stream Deck Plugins Finder Window. Rename the folder to whatever you want. Be sure to include the .sdPlugin extension

If the embedded GIF doesn't show up here on GitHub, click on this link to view it

6 - Open the Stream Deck app and you should now see the Hubitat plugin at the bottom of the listed plugins in the right column

7 - Continue on with ripnet's readme starting at the *Available Buttons section.

Thanks! I'll get this pulled in shortly!

Finally getting to this. Do you think this is necessary to do when you can simply click on the streamDeckPlugin file which will install it for you?

Let me know your thoughts.


sshd: no hostkeys available -- exiting

In variables.tf I did not set any signer_target_host_key as I did not understand what it is and how to generate, furthermore it seemed optional. My pod tezos-remote-signer-forwarder-mybaker-0 gives me this error:

It's explained here, but yes, the README should be more clear
https://tezos-docs.midl.dev/deploy-remote-signer.html#ssh-endpoint-host-key

For now I commented this line of tezos-remote-signer-forwarder.sh to make it work.

ok, but I am not sure if it will work without the host key. You should generate one, so if your cluster breaks for any reason, and you recreate it, your signer will connect to it as if nothing happened... in the absence of this, it will refuse to connect.
By the way, this is the source code for the docs. Feel free to open PRs, you can do it directly on github.
https://github.com/midl-dev/tezos-suite-docs/

Yes, I will generate a host key. I was wondering if there is a guide to it or is it just a ssh-keygen command to execute on my terminal.

By the way, this is the source code for the docs. Feel free to open PRs, you can do it directly on github.

Thank you, I will.

I didn't write it down, I'd appreciate if you add it to the guide. Something like:
https://serverfault.com/a/471346/80321

Thanks. I did this way, deleted the pod and it worked!
variable "signer_target_host_key" {
  type = string
  default = <<-EOK
-----BEGIN OPENSSH PRIVATE KEY-----
<the key>
-----END OPENSSH PRIVATE KEY-----
EOK
}

@nicolasochem As a side note, it's probably needed to perform a check of non-optional values before Terraform execution.

But the terraform module can also be used as public node only, or baker
without a remote signer, in which case the host key is not mandatory.
On Tue, Nov 10, 2020, 8:04 AM denver-s<EMAIL_ADDRESS>wrote:

@nicolasochem https://github.com/nicolasochem As a side note, it's
probably needed to perform a check of non-optional values before Terraform
execution.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/midl-dev/tezos-on-gke/issues/29#issuecomment-724799071,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAWXC5NKJFVUKDWL2DU3TLSPFQCTANCNFSM4TPUKCKA
.

Mmm I see. Still, I think some kind of checks need to be implemented.


:white_check_mark: test: Add better testing for bundler changes

Description
Add better testing via adding new output types
Testing
Explain the quality checks that have been done on the code changes
Additional Information

[ ] I read the contributing docs (if this is your first contribution)

Your ENS/address:

Current dependencies on/for this PR:

main

PR #450   👈

This comment was auto-generated by Graphite.


animate titles

https://www.npmjs.com/package/react-animate

https://github.com/Jakehp/carcalc/commit/45f2ef5eb9058720f7b8ebd9a3f56c79b1d4829e


Add possibility to fetch calendars through socket notifications

Hello and thank you for wanting to contribute to the MagicMirror² project
Please make sure that you have followed these 4 rules before submitting your Pull Request:

Base your pull requests against the develop branch.

Include these infos in the description:

Does the pull request solve a related issue?
If so, can you reference the issue like this Fixes #<issue_number>?
What does the pull request accomplish? Use a list if needed.
If it includes major visual changes please add screenshots.

Please run npm run lint:prettier before submitting so that
style issues are fixed.

Don't forget to add an entry about your changes to
the CHANGELOG.md file.

Note: Sometimes the development moves very fast. It is highly
recommended that you update your branch of develop before creating a
pull request to send us your changes. This makes everyone's lives
easier (including yours) and helps us out on the development team.
Thanks again and have a nice day!
This pull request adds the possibility to fetch calendars through socket notifications.
This enables development on projects like for example mycroft.
An example being where one would create a calendar event through the voice assistant, for the voice assistant to then call on the calendars to fetch through socket notifications:
self.calendar.add_component(event)
with self.file_system.open(self.CAL_PATH, "wb") as f:
    f.write(self.calendar.to_ical())

self.speak_dialog('event.created', dialog_data)

# Alert MM calendar that there's been an update.
self.bus.emit(Message("RELAY:calendar:FETCH_CALENDAR", {"url": "http://localhost:8080/" + str(self.CAL_MM_REL_PATH)}))

This can all be easily implemented with the MM module MMM-mycroft-bridge created by @oenstrom.
The changes made in this pull request do not affect users that are not interested in using socket notifications to communicate with MagicMirror.

I don't understand the value.  I create cal events thru voice all the time, and they show when the cal refreshes, same as when I do it thru my phone, or PC.
it's unlikely you created a cal event that will occur in the next 10 minutes(default refresh time), except to test.

Codecov Report

Merging #2881 (82fbb7e) into develop (2d15e4f) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop    #2881   +/-   ##
========================================
  Coverage    63.82%   63.82%
========================================
  Files            9        9
  Lines          293      293
========================================
  Hits           187      187
  Misses         106      106

Help us with your feedback. Take ten seconds to tell us how you rate us.

Thanks! Sorry response. Was enjoying a sunny holiday. :)
Would you mind fixing the merge conflicts?

In addition to this PR, would you mind creating a PR on https://github.com/MichMich/MagicMirror-Documentation as well? Thanks!

Unfortunately the automated tests are failing. Any idea if this is caused by your changes?

Sorry that's my bad. Python habits came into play. Fixed what it complained about!


Async CatalogProviderList and CatalogProvider trait

Is your feature request related to a problem or challenge?
My case is to retrive catalog/schema/table through network. Why trait  CatalogProviderList and CatalogProvider are not async?
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response

@lewiszlw this relates to other type of work I need to do in other projects, can I have a look?

@lewiszlw this relates to other type of work I need to do in other projects, can I have a look?

That is our company project, it's closed source.

FWIW I've wondered this as well. My use case is using a database to store catalog/schema/table data, and right now I just make blocking calls, but fetching catalog data does seems like a common use case.

FWIW I've wondered this as well. My use case is using a database to store catalog/schema/table data, and right now I just make blocking calls, but fetching catalog data does seems like a common use case.

Yeah. Maybe it's not a common use case, but making trait async won't hurt normal case I think.


chore: Create maxGroupsSize logic in SlackService

LGTM!  @andriosrobert just make sure to change the PR to "Ready for review" if you want to merge it.

@sandromello still see merging is blocked


New night-partly-cloudy shown during day

Checklist:

[x] I updated to the latest version available
[x] I cleared the cache of my browser

Release with the issue: 6.0.0
Last working release (if known): 5.4.0
Browser and Operating System:
Brave. Windows 11
Description of problem:
the new partly cloudy at night icon shows up for the whole day. maybe because the condition started at night time? (can't see the beginning as I updated 9am) - see screenshot
Additional information:

Can you please share your latitude and longitude settings from your Home Assistant install? It's ok to drop the decimal or round a little for privacy. But the calculation for nighttime uses that info, so I'm curious if maybe yours is just set wrong.

Same problem here:
V5.4.0

V6.0.0

Same problem here.
50.92957
-2.91327
SW England.

Thanks for the reports folks! I'll look at this more on Monday. Feel free to downgrade to v5 in the meantime.
Any further details on if you ever see the daytime partly cloudy condition, and what times that happens would be helpful. Also any detail on which weather integration you're using.
This works for me, so I'm gonna need to dig in more to understand why it doesn't work for y'all. There's clearly a bug somewhere.

haven't seen the daytime cloudy condition since the update. using DWD (Deutscher Wetterdienst) weather integration (found at https://github.com/FL550/dwd_weather)

I have it again today

`
 - datetime: "2024-06-17T13:00:00+00:00"
    condition: partlycloudy
    temperature: 17.3
    pressure: 1011
    cloud_coverage: 48
    wind_speed: 5.58
    wind_bearing: 223
    uv_index: 6.01
    precipitation_probability: 0
    precipitation: 0
    apparent_temperature: 16.8
    dew_point: 11.1
    wind_gust_speed: 11.2
    humidity: 67
`

Same here:


Feature: imagehub datapack auto delete

datapack should keepalive for 5min and should be deleted after that

also, should keep a code for front request

datapack design
In order to shield the inconsistency of crd request under imagehub, decouple crd and request, and provide multiple information granularity queries, a datapack mechanism is designed.
The fulldata aggregates all the crd information of the imagehub, and then fills the returned information to the status in the reconcile according to the query granularity (type) under the spec and the query image name.

May need you to introduce datapack for me

done


Lpfg 636 add course confirmation

Included 'course added' panel on course overview page

Closing and replacing with https://github.com/Civil-Service-Human-Resources/lpg-management/pull/31


I can't use search function if I write more than 2500 words.

Describe the bug
The Search function doesn't work if the input has 2500+ words
PolDance with Loong PolDance with Loong PolDance with Loong PolDance with Loong
PolDance with Loong PolDance with Loong PolDance with Loong PolDance with Loong
PolDance with Loong PolDance with Loong PolDance with Loong PolDance with Loong
PolDance with Loong PolDance with Loong PolDance with Loong PolDance with Loong
PolDance with Loong PolDance with Loong PolDance with Loong PolDance with Loong
PolDance with Loong PolDance with Loong PolDance with Loong PolDance with Loong
PolDance with Loong PolDance with Loong PolDance with Loong PolDance with Loong
PolDance with Loong PolDance with Loong PolDance with Loong PolDance with Loong
more lines omitted...
To Reproduce
Steps to reproduce the behavior:

Go to the default page
Click on activity input
input text 2500+ words
Click on the 'Search' button
See nothing filter, error 502 shows when inspecting

Expected behavior
The input should have a character limit.
Screenshots

Desktop (please complete the following information):

OS: window 11
Browser Chrome
Version 23

The description of activity is capped at 1024 letters. Activity title is capped at 200 letters.
In this case, it is enhancement more than bug because you just want to cap the letter limit in search bar. Generally use case of search bar is not for putting 2000 words in there to find stuffs.

We already limit search bar to only 250. Thank for suggestion.


Project directory creation & user-specific base-path for project directories?

See https://github.com/fractal-analytics-platform/fractal-web/issues/48 for motivation

On the CLI side, we create the project dir before we create a project as well and I assume that's why the project creation endpoint requires an existing directory. We should think about whether the directory can also be created at that moment (not trivial, as it needs to be a user action when the user and server aren't the same).
Also, we should think whether there would be some default base directory where project directories are created, such that the user does not need to specify anything about this directory by default. I'll open a corresponding fractal-server issue.

I've also seen that multiple project can share the same project directory. Given their main usage (a place to put the workflow_000001_job_000001 folders): Do we actually need different project folders? It makes it a bit easier to see which project a workflow belongs to. But the workflow_000001_job_000001 will always be unique (until the server is restarted).
Given that we'll likely still restart the server from time to time, having unique project folders can be useful to avoid having to do cleanup. But already when we'd start auto-creating project directories, the question of when they get cleaned up and what happens when there is a conflict with an existing project directory becomes important.

Agreed, there is a bit of confusion here.
Some general comments first

I'd rather keep the use of sudo confined in the runner component, without relying on it e.g. in the new-project endpoint. This seems logically consistent: creating a project should not require fractal-server to handle anything which is in user-owned directories (note that it currently does -see #555- but that is to be fixed).
The project directory is not being used as its name would suggest, but rather as a temporary folder to store files which are then copied over into fractal-server internal folders (which constitute the only reliable source for the corresponding information). This should rather be called "cache" folder, or something similar.
The project directory is not really related to a project, but it's a container for all job subfolders. There is no real reason to have one such folder per project, because:

The logical separation would be easily achieved by adding the project id in the subfolder name.
We do not expect the user to ever go into those job folders, unless they know about their existence and need some quick debugging info. This also means that it's not a problem if the name is very complex/verbose (see example below).

One possible implementation:

Upon user registration, we also define a "cache" folder for each user (the "cache" name can be replaced with more appropriate ones). The folder may be user-owned and with restricted access. Fractal-server only checks that this attribute is an absolute path, but nothing else (thus avoiding #555).
We drop the project.project_dir attribute.
When submitting a workflow for execution, inside the runner component, we handle the server-side and user-side job folders. The server-side one is trivial to handle. For the user-side one:

We create the cache folder (if missing), making use of sudo mkdir.
We create the job folder, with a name like {timestamp}_project_00012_workflow_123123_job_123123. The timestamp is useful because if you reset the DB you may end up with two repeated folder names. I'd rather avoid calling sudo rm on user's folders - in my view this should be a user's task.

To be decided: how/when is this cache removed/compressed, and by whom? See also https://github.com/fractal-analytics-platform/fractal-server/issues/474.

I like this suggested approach! :) Nice workaround with the time stamp to keep testing easy as well!


less repeated code

I love the eventemitter3, it was written clearly and teached me a lot, but I found some code is repeated in it, so I try to merged some code. After run benchmark, I found the once benchmark is slower than it was, em.. function call is expensive so you inline it, but merge it, code will be more clearly and maintable

Yes, there is some duplicated code and this is done for performance.
Instead of using Function.prototype.call() you can try pass the thisArg as a normal argument to a function. For example:
function _addListener(emitter, event, fn, context, once) {
  // replace all occurences of `this` with `emitter`.
}

and then call it like
EventEmitter.prototype.on = function on(event, fn, context) {
  return _addListener(this, event, fn, context, false);
};

This should have better performance as it avoids the call() overhead.

Thank you for your advice, and using your advice, performance is better but still half of the master version
EventEmitter3(my-fork) x 7,066,182 ops/sec ±3.94% (88 runs sampled)
EventEmitter3(master) x 13,128,453 ops/sec ±3.93% (89 runs sampled)

if there is any tools could help auto inline function before we minify it?

How is performance if you don't minify it?
Can you post the results of npm run benchmark?

performance before I made this commit
performance is better at least for once benchmark

I mean the tools helps inline the repeat invoked function and then minify it, maybe the performance will better

There are some nits in JSDoc comments which can be fixed later.
Is there any performance regression compared to master?

I made a comparison result of the performance, perf-regression.md
as we can see, the perf is almost the same as the master

Thanks.

My pleasure :)


Update golang

This PR contains the following updates:

Package
Type
Update
Change

github.com/google/uuid
require
minor
v1.3.1 -> v1.4.0

github.com/gorilla/websocket
require
patch
v1.5.0 -> v1.5.1

Release Notes

google/uuid (github.com/google/uuid)
v1.4.0
Compare Source
Features

UUIDs slice type with Strings() convenience method (#133) (cd5fbbd)

Fixes

Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior)

gorilla/websocket (github.com/gorilla/websocket)
v1.5.1
Compare Source
What's Changed

Add check for Sec-WebSocket-Key header by @hirasawayuki in https://github.com/gorilla/websocket/pull/752
Changed the method name UnderlyingConn to NetConn by @JWSong in https://github.com/gorilla/websocket/pull/773
remove all versions < 1.16 and add 1.18 by @ChannyClaus in https://github.com/gorilla/websocket/pull/793
Check for and report bad protocol in TLSClientConfig.NextProtos by @ChannyClaus in https://github.com/gorilla/websocket/pull/788
check err before GotConn for trace by @junnplus in https://github.com/gorilla/websocket/pull/798
Update README.md by @coreydaley in https://github.com/gorilla/websocket/pull/839
Correct way to save memory using write buffer pool and freeing net.http default buffers by @FMLS in https://github.com/gorilla/websocket/pull/761
Update go version & add verification/testing tools by @coreydaley in https://github.com/gorilla/websocket/pull/840
update golang.org/x/net by @coreydaley in https://github.com/gorilla/websocket/pull/856
update GitHub workflows by @coreydaley in https://github.com/gorilla/websocket/pull/857

New Contributors

@hirasawayuki made their first contribution in https://github.com/gorilla/websocket/pull/752
@JWSong made their first contribution in https://github.com/gorilla/websocket/pull/773
@ChannyClaus made their first contribution in https://github.com/gorilla/websocket/pull/793
@junnplus made their first contribution in https://github.com/gorilla/websocket/pull/798
@coreydaley made their first contribution in https://github.com/gorilla/websocket/pull/839
@FMLS made their first contribution in https://github.com/gorilla/websocket/pull/761

Full Changelog: https://github.com/gorilla/websocket/compare/v1.5.0...v1.5.1

Configuration
:date: Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
:vertical_traffic_light: Automerge: Disabled by config. Please merge this manually once you are satisfied.
:recycle: Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
:ghost: Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

Edited/Blocked Notification
Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.
You can manually request rebase by checking the rebase/retry box above.
:warning: Warning: custom changes will be lost.


Fixing broken doc

The gif is too small.

Thanks, @amyblais! I'm wondering if removing the "35" scale from the two images in the previous section could be added to this PR? Although they may be that size on purpose for clarity, it is a bit jarring.

@justinegeffen Done!

Interesting - I did a quick Google and found this info; sounds like the scale value doesn't actually impact the size of the image and the image itself is large.
I can look into this and submit a separate PR for it. Otherwise LGTM. :)