One of the host and path combination failed to get programmed as backend in  haproxy.

server version - V0.27.0-rc3
Steps to reproduce the problem:
Created LB with 4 services , with the following host/path definitions:
    service_link1 = {"serviceId": services[0].id,
                     "ports": ["80:www.abc1.com/service1.html",
                               "80:www.abc2.com/service2.html"]}
    service_link2 = {"serviceId": services[1].id,
                     "ports": ["80:www.abc1.com/service1.html",
                               "80:www.abc2.com/service2.html"]}
    service_link3 = {"serviceId": services[2].id,
                     "ports": ["80:www.abc3.com/service1.html",
                               "80:www.abc4.com/service2.html"]}
    service_link4 = {"serviceId": services[3].id,
                     "ports": ["80:www.abc3.com/service1.html",
                               "80:www.abc4.com/service2.html"]}

one of the host/path definitions for "www.abc2.com/service2.html" failed to get programmed in haproxy.

| 37 | NULL   | serviceConsumeMap | 2278c1c0-c9ed-455a-a19a-722b54cfb242 | NULL        | active  | 2015-07-13 23:51:59 | NULL                | NULL                | {"fields":{"ports":["80:www.abc3.com/service1.html","80:www.abc4.com/service2.html"]}} |        171 |                 170 |          5 |
| 38 | NULL   | serviceConsumeMap | 006a48ee-324c-489f-b1f7-7dbd81cabccd | NULL        | active  | 2015-07-13 23:51:59 | NULL                | NULL                | {"fields":{"ports":["80:www.abc3.com/service1.html","80:www.abc4.com/service2.html"]}} |        171 |                 169 |          5 |
| 39 | NULL   | serviceConsumeMap | 2ddba3a4-64a2-4adf-a3a2-1d15beec655f | NULL        | active  | 2015-07-13 23:51:59 | NULL                | NULL                | {"fields":{"ports":["80:www.abc1.com/service1.html","80:www.abc2.com/service2.html"]}} |        171 |                 168 |          5 |
| 40 | NULL   | serviceConsumeMap | f2f0db8d-e4a9-48ba-9ccb-5b6ab07c5fe2 | NULL        | active  | 2015-07-13 23:51:59 | NULL                | NULL                | {"fields":{"ports":["80:www.abc1.com/service1.html","80:www.abc2.com/service2.html"]}} |        171 |                 167 |          5 |
+----+--------+-------------------+--------------------------------------+-------------+---------+---------------------+---------------------+---------------------+----------------------------------------------------------------------------------------+------------+---------------------+------------+

Also the host - www.abc3.com/service1.html which should have 4 servers but has 8 servers:

Tested with server version - V0.27.0-rc4
Created LB with 4 services with the same host/path definitions as before.
All the host/path combinations get programmed correctly on the haproxy.


[Bug] Running test_conv2d.py got error output in Ethos-N78 platform.

Expected behavior
Running test_conv2d.py can get correct output in Ethos-N78 platform.
Actual behavior
Running test_conv2d.py got error output in Ethos-N78 platform.
Environment
Ubuntu 20.04.4 LTS GCC 9.4.0 TVM 0.10.dev0
Steps to reproduce
~/tvm/tests/python/contrib/test_ethosn$ vi test_conv2d.py
...
print("shape:{}, out_channels:{}, kernel_h:{}, kernel_w:{}".format(shape, out_channels, kernel_h, kernel_w))
print("pad:{}, stride:{}, dilation:{}, qnn_per_channel:{}".format(pad, stride, dilation, qnn_per_channel))
...
if name == "main":
test_conv2d("uint8", False)
~/tvm/tests/python/contrib/test_ethosn$ python3 test_conv2d.py
shape:(1, 17, 20, 26), out_channels:4, kernel_h:3, kernel_w:1
pad:attr, stride:(2, 2), dilation:(1, 1), qnn_per_channel:False
/home/user/tvm/python/tvm/driver/build_module.py:266: UserWarning: target_host parameter is going to be deprecated. Please pass in tvm.target.Target(target, host=target_host) instead.
warnings.warn(
conv2d NHWC layout is not optimized for x86 with autotvm.
conv2d NHWC layout is not optimized for x86 with autotvm.
Traceback (most recent call last):
File "test_conv2d.py", line 354, in
test_conv2d("uint8", False)
File "test_conv2d.py", line 208, in test_conv2d
tei.verify(outputs, dtype, 1)
File "/home/user/tvm/tests/python/contrib/test_ethosn/infrastructure.py", line 244, in verify
tvm.testing.assert_allclose(outs[0].numpy(), outs[1].numpy(), rtol=rtol, atol=atol)
File "/home/user/tvm/python/tvm/testing/utils.py", line 119, in assert_allclose
np.testing.assert_allclose(actual, desired, rtol=rtol, atol=atol, verbose=True)
File "/home/user/.local/lib/python3.8/site-packages/numpy/testing/_private/utils.py", line 1527, in assert_allclose
assert_array_compare(compare, actual, desired, err_msg=str(err_msg),
File "/home/user/.local/lib/python3.8/site-packages/numpy/testing/_private/utils.py", line 844, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Not equal to tolerance rtol=1e-07, atol=1
Mismatched elements: 360 / 360 (100%)
Max absolute difference: 251
Max relative difference: 110.
x: array([[[[ 97,  93,  94,  96],
[103, 101, 100,  98],
[100, 103, 100, 101],...
y: array([[[[ 56, 178, 163,   1],
[  0,   0,   0,   0],
[144, 190, 140,   1],...
Triage
byoc:ethosn

Hi @kychao3074, the output mismatch is a bit deceiving here, it looks as though the inference is actually failing to run on the NPU. Because of this, the runtime returns random values from memory. This should be improved by #13022 (when it is merged) which adds error messages to the runtime, rather than a silent failure.
I would suspect that the tests are being compiled for the wrong NPU variant. You can change the default variant via an environment variable, see: https://github.com/apache/tvm/blob/main/tests/scripts/task_python_ethosn_tests.sh#L30.
(Note that I'm hoping to improve this interface to use the same target string that would be expected for user-facing code here: https://github.com/apache/tvm/pull/13159/files#diff-3db627798cc5ccaa213c7e6773dd76906fc1cc2f861320d5f40e9f9b0fe52650R32, so this method may change in the future)

Hi @lhutton1. Because our Ethos-N78 platform currently uses ethos-n-driver-stack version 22.05, so we just can use TVM version on between 2022/08/02 and 2022/09/28. I will test your #13022 when we update ethos-n-driver-stack version as 22.08.
I saw the get_ethosn_variant() has default ETHOSN_VARIANT_CONFIG as Ethos-N78_1TOPS_2PLE_RATIO in tvm/tests/python/contrib/test_ethosn/infrastructure.py. How can I know which ETHOSN_VARIANT_CONFIG should be used in our Ethos-N78 platform? Or are there other ETHOSN_VARIANT_CONFIG options can let me to set in our Ethos-N78 platform?
Thanks very much for your help!

Hi @lhutton1. We set ETHOSN_VARIANT_CONFIG as Ethos-N78_4TOPS_4PLE_RATIO, then now running test_conv2d.py can get correct output in our Ethos-N78 platform. This bug has got solved.
Thanks very much for your help!

No problem, great to hear! I'll close this issue, feel free to open another if you have any more questions

OK! Thank you so much!


Accept Error: too many open connections

Required information

Distribution: Oracle Enterprise Linux 7.5
Distribution version: 7.5 Kernel 4.1.12-124.18.5.el7uek.x86_64
The output of "lxc info" or if that fails:

Kernel version: 4.1.12-124.18.5.el7uek.x86_64
LXC version: 3.0
LXD version: 3.0
Storage backend in use: ZFS

Issue description
After forming a cluster of 3 nodes, response to all lxc commands became slow and now hangs indefinitely.
Although The containers are running.
I fixed the tcp problem via
sysctl net.ipv4.ip_local_port_range="15000 61000"
sysctl net.ipv4.tcp_fin_timeout=30
But it doesn't solve anything. I couldn't get any hint from  LXD --debug
:: lxd --debug
DBUG[09-06|16:34:40] Connecting to a local LXD over a Unix socket
DBUG[09-06|16:34:40] Sending request to LXD                   etag= method=GET url=http://unix.socket/1.0
INFO[09-06|16:34:40] LXD 3.0.0 is starting in normal mode     path=/var/lib/lxd
WARN[09-06|16:34:40] Error reading default uid/gid map        err="User "root" has no subuids."
WARN[09-06|16:34:40] Only privileged containers will be able to run
WARN[09-06|16:34:40] AppArmor support has been disabled because of lack of kernel support
WARN[09-06|16:34:40] Couldn't find the CGroup pids controller, process limits will be ignored.
INFO[09-06|16:34:40] Initializing local database
INFO[09-06|16:34:40] Initializing database gateway
INFO[09-06|16:34:40] Start database node                      address=<IP_ADDRESS>:8443 id=2
INFO[09-06|16:34:40] Raft: Restored from snapshot 566-592776-1536269107760
INFO[09-06|16:34:40] Raft: Initial configuration (index=418804): [{Suffrage:Voter ID:1 Address:0} {Suffrage:Voter ID:2 Address:<IP_ADDRESS>:8443} {Suffrage:Voter ID:3 Address:<IP_ADDRESS>:8443}]
INFO[09-06|16:34:40] Raft: Node at <IP_ADDRESS>:8443 [Follower] entering Follower state (Leader: "")
INFO[09-06|16:34:40] LXD isn't socket activated
DBUG[09-06|16:34:40] Connecting to a local LXD over a Unix socket
DBUG[09-06|16:34:40] Sending request to LXD                   etag= method=GET url=http://unix.socket/1.0
DBUG[09-06|16:34:40] Detected stale unix socket, deleting
DBUG[09-06|16:34:40] Detected stale unix socket, deleting
INFO[09-06|16:34:40] Starting /dev/lxd handler:
INFO[09-06|16:34:40]  - binding devlxd socket                 socket=/var/lib/lxd/devlxd/sock
INFO[09-06|16:34:40] REST API daemon:
INFO[09-06|16:34:40]  - binding Unix socket                   socket=/var/lib/lxd/unix.socket
INFO[09-06|16:34:40]  - binding TCP socket                    socket=<IP_ADDRESS>:8443
INFO[09-06|16:34:40] Initializing global database
DBUG[09-06|16:34:40] Failed to establish gRPC connection with <IP_ADDRESS>:8443: 503 Service Unavailable
DBUG[09-06|16:34:40] Found cert                               k=0
DBUG[09-06|16:34:40] Failed to establish gRPC connection with <IP_ADDRESS>:8443: 503 Service Unavailable
DBUG[09-06|16:34:41] Found cert                               k=0
INFO[09-06|16:34:41] Raft-http: Establishing new connection with <IP_ADDRESS>:8443
DBUG[09-06|16:34:41] Raft-net: <IP_ADDRESS>:8443 accepted connection from: <IP_ADDRESS>:59996
WARN[09-06|16:34:41] Raft: Skipping application of old log: 592776
DBUG[09-06|16:34:41] Found cert                               k=0
INFO[09-06|16:34:41] Raft-http: Establishing new connection with <IP_ADDRESS>:8443
DBUG[09-06|16:34:41] Raft-net: <IP_ADDRESS>:8443 accepted connection from: <IP_ADDRESS>:59997

Some more logs
Sep 06 16:45:42 lxdhost027-primary-infra-snet1166-ilsb.biobio.tamu.edu lxd[23480]: lvl=warn msg="Raft: Election timeout reached, restarting election" t=2018-09-06T16:45:42-0500
Sep 06 16:45:46 lxdhost027-primary-infra-snet1166-ilsb.biobio.tamu.edu lxd[23480]: lvl=warn msg="Raft: Election timeout reached, restarting election" t=2018-09-06T16:45:46-0500

Please show 'lxc info'

It fails to work

Ok, anyway, looking at the logs above, you're running LXD 3.0.0.
Please upgrade to 3.0.2 and try again, there have been a lot of clustering fixes in both LXD 3.0.1 and 3.0.2 that may very well take care of this issue for you.
You may also want to increase NOFILE for your LXD daemon in whatever init script you're using to start it. In the systemd units we ship in Ubuntu, we bump this to 1048576 which we've found sufficient to handle several thousands of containers.

Did you get to try 3.0.2?


:feet: Update documentation links

Documentation is moving :tada:
Update doc links to new documentation site.
https://access.redhat.com/documentation/en-us/migration_toolkit_for_virtualization -> https://docs.redhat.com/en/documentation/migration_toolkit_for_virtualization

cc:// @RichardHoch

addressed by https://github.com/kubev2v/forklift-console-plugin/pull/1248


⚠ Processors has degraded performance

In 4472273, Processors ($STATUS_URL) experienced degraded performance:

HTTP code: 200
Response time: 46 ms

Resolved: Processors performance has improved in 70d4ba4.


Seems a MONITORINFOF_PRIMARY const/enum is not defined/generated when using PInvoke.GetMonitorInfo() and MONITORINFO struct

Actual behavior
Using this code, including the following generated PInvoke stuff:
var hWnd = PInvoke.GetDesktopWindow();
var hMonitor = PInvoke.MonitorFromWindow(hWnd, MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY);

var mi = new MONITORINFO();
mi.cbSize = (uint)Marshal.SizeOf(mi);
PInvoke.GetMonitorInfo(hMonitor, ref mi);

Console.WriteLine(mi.dwFlags); // Prints "1" to the console.

if (mi.dwFlags == MONITORINFOF_PRIMARY) // Not possible at the moment, in any form.
{
    Console.WriteLine("Hooray!");
}

The MONITORINFO struct contains a dwFlags field. There should be a const/enum or something named MONITORINFOF_PRIMARY, to compare the dwFlags value with.
Some other PInvoke generated functions have those. Example given:
Windows.Win32.Graphics.Gdi.MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY

exists along with
PInvoke.MonitorFromWindow()

function.
In short: There is no MONITORINFOF_PRIMARY const/enum.
Expected behavior
There should be a MONITORINFOF_PRIMARY const/enum.
Repro steps

Use above code
Generate a NativeMethods.txt containing above used function names
Compile
Inspect MONITORINFO.dwFlags and look around for some MONITORINFOF_PRIMARY const/enum
Read MSDN https://learn.microsoft.com/de-de/windows/win32/api/winuser/ns-winuser-monitorinfo

Context

CsWin32 version: 0.3.18-beta
Target Framework: .NET 6
LangVersion: C# 10

The metadata does declare a MONITORINFOF_PRIMARY constant, so if you add that specifically to your NativeMethods.txt file, you'll get what you need.
CsWin32 doesn't auto-generate it because the APIs you're asking for don't directly reference constants -- only enums, structs, and the like.
If you feel we should be using an enum here instead of a uint though, you can open an issue over in the win32metadata repo.

Oh, then i´m sorry!
I didn´t know you can also put in types, structs or consts into the ``NativeMethods.txt file. If it´s mentioned in the documentation i maybe missed that part. Cause of the file name of the.txt` file i assumed you can only put in function names in there. And everyting else, related to that function(s), is resolved/created automatically. My bad.
Thanks a lot for clarifying this and sorry when i wasted your sparse time!

No worries. FYI the docs on NativeMethods.txt and what it can contain are here: https://github.com/microsoft/CsWin32#usage

No worries. FYI the docs on NativeMethods.txt and what it can contain are here: https://github.com/microsoft/CsWin32#usage

Yeah, it seems i missed that part:

The name of a struct, enum, constant or interface to generate. This may be qualified with a namespace but is only recommended in cases of ambiguity, which CsWin32 will prompt where appropriate.

The name „NativeMethods“ missleaded me to „methods/functions only“.
Anyway, all fine and thx for clarifying!


Make githubPullRequests.pullRequestDescription more discoverable

We could have something in the Create webview to suggest this setting
cc @hediet

Can be addressed in conjunciton with https://github.com/microsoft/vscode-pull-request-github/issues/4403 to prevent too many changes to the create view.


Video don't start after return to activity

Make sure to provide the following informations and check:

[  compile "im.ene.toro2:toro-extended:2.1.0"] Toro dependencies

[Samsung | G4 Active | 5.0.1 | clean ] Android manifacture | product name | OS Version | rooted or clean

Logcat (if it was a fatal issue)

In Application class I have Toro.init
In Activty A I have recyclerView with videos
I first start Activty A and everything works
then I click on recyclerView item and start Activty B with full screen video
then on back pressed I return to Activty A, and now my video, which I clicked on, don't start
Moreover if I scroll, and this video wasn't recycled, it will never start again.
Other videos (not clicked videos) works normal
Do you have any ideas why it happens?
Below flow of callbacks.
Activty A: onResume: Toro.register
ToroVideoHolder: onVideoPrepared: VIDEO_1
ToroVideoHolder: onVideoPrepared: VIDEO_2
ToroVideoHolder: onPlaybackStarted: VIDEO_1
ToroVideoHolder: onPlaybackPaused: VIDEO_2
ToroVideoHolder: onPlaybackStarted: VIDEO_1
Activty A: : onPause: Toro.unregister
ToroVideoHolder: onPlaybackPaused: VIDEO_1
Activty  B in
Activty  B out
Activty A: onResume: Toro.register
onPlaybackStarted: VIDEO_1
onVideoPrepared: VIDEO_1
onActivityInactive: VIDEO_1

@iarczi This is a known issue. I made a fixed but the SNAPSHOT contains some break changes. Let me push it to 2.1.1 in few days >.<
Right now one possible work around is: refer to Facebook example, instead of starting new Activity for Full screen player, you can show a DialogFragment on top of current Activity, using the mechanism I used in Facebook example to switch the RecyclerView ...
I personally prefer this approach. Please try it and tell me if you have trouble.

I left it just it is, and can't wait for new version 2.1.1 :)

Hi @eneim, thanks for a nice lib! Unfortunately I have the same problem. Changing Activity to DialogFragment is a little bit problematic for me, so I would rather use the proper fix. Any timeframe for the 2.1.1 version?

I'm updating demo app with some good practice, and documentation. v2.2.0 is on plan to release next week with a few big change that needs migration, but not too much, only the Adapter I think (of course a migration guide will be added too).

Just to make sure - so the fix for activity lifecycle comes next week with 2.2.0?

Yes, right now you can check the current status on 2.2.0-SNAPSHOT and see if it works. Or check out branch dev-v3 and try the demo .

2.20-SNAPSHOT requires some changes on your Adapter, so you are warned ...

@micHar @iarczi Can you check out to see if 2.2.0-SNAPSHOT works for you? This is the closet to next major release. Feedback from you will be taken care for the final release if possible.

In the snapshot, the issue with changing activities has been fixed but there are some other issues introduced unfortunately. Eg.sometimes the video doesn't start at all, it doesn't loop like it used to and sometimes two videos on the list start playing together.

@micHar Can you provide more about your code that re-produces the issue?

Not today unfortunately, I don't have access to my computer.

@micHar FYI I also dealt with those issue in this snapshot (see other issues). So if they are still there for you, please tell me with your code I will take a look :D.

So probably they are fixed and I tried an older version. Will try the new one as soon as possible, because as far as this specific issue is concerned, I think it was fixed. Thanks for your great work @eneim :-)

I pushed latest one this afternoon, so probably it will fix the issue. But feedback is always welcome.

I should have numbered the snapshot release as beta or something, but next time it will be better.

Using 2.2.0 the lifecycle problem is solved (in the old version, activity was destroyed and player set to null)
When I open a new Activity I use Toro.pause() and then on ActivityResult use Toro.resume()
The problem is that now, using 2.2.0, when scroll up, sometimes the previous videos doesn't play but stay in pause.

@developerGM I have acknowledged that issue and working on a fix now. The cause is that I cannot control the way ExoPlayer fires the state change event so I need to think about a workaround.

@eneim yes understand. Thanks
But why with 2.1.0, this problems not happened ?

The part problem of not playing after scrolling back to top is my fault after releasing 2.2.0 (on an atempt to fix the duplicated playback). After fixing it in current local branch, it turns out that the main issue is the state of "prepared" where ExoPlayer doesn't care about that while I want to have a checkpoint of when your video is ready to play. So in short: there is a state that cause the trouble and sadly fixing one of them lead to the other ...

My current thinking is to forget the state of prepared and try to adapt the way ExoPlayer 2 thinks about a Media's state.

so how can solve ? wait a new release ?

I'm thinking of pushing a snapshot to fix the scrollto top issue in a few hour.

this is TOP, thanks. So I can continue to use 2.2.0 that is really stable now. Thanks @eneim for this work

@developerGM You can try 2.2.1-SNAPSHOT now, it should fix the scroll to top issue. The issue #174 is my highest priority now for 2.x.

sorry...this ?
compile 'im.ene.toro2:toro-extended:2.2.1-SNAPSHOT'

One of the following:
compile 'im.ene.toro2:toro-extended:2.2.1-SNAPSHOT'

// or
compile 'im.ene.toro2:toro-ext-exoplayer2:2.2.1-SNAPSHOT'

You will need the snapshot repository in your project level gradle.build.

Ok, I have tested "2.2.1-SNAPSHOT" using ExoPlayerView
This is my Log:
//MyFragment is collapsed
STATE_BUFFERING > VIDEO 0
STATE_READY > VIDEO 0
playWhenReady = false > VIDEO 0

//Open MyFragment with recyclerView, VIDEO 0 starts
STATE_READY > VIDEO 0
playWhenReady = true > VIDEO 0

// scroll down to VIDEO 1 but sometimes not starts
STATE_BUFFERING > VIDEO 1
STATE_BUFFERING > VIDEO 2
STATE_READY > VIDEO 1
playWhenReady = false > VIDEO 1
STATE_READY > VIDEO 2
playWhenReady = false > VIDEO 2

// scroll up to VIDEO 0 but not restarts
STATE_BUFFERING > VIDEO 0
STATE_READY > VIDEO 0
playWhenReady = false > VIDEO 0

@eneim
Now I am testing "2.2.1-SNAPSHOT" with ExoVideoView
in STATE_READY I always have playWhenReady == false;
My cicle is the follow:
- mRecyclerView.setAdapter(adapter)
- Toro.register(mRecyclerView)
- SlideUpPanel in COLLAPSED state...Toro.pause()
- SlideUpPanel in EXPANDED state...Toro.resume()

When I slide up the panel where is mRecyclerView, all videos don't play.

@eneim any news ?

@developerGM sorry it is GTM +9 here so let me warm up a little bit for Monday morning >.<

@eneim ehe yes of course, sorry.

@developerGM What do you mean by "This happen if I use PlayerCallback"?

Also, it is not suggested to dynamically use PlayerCallback, I should have provide the "addCallback" instead of "setCallback" ... But right now if you want to have control to STATE_BUFFERING, you can extend the ExoPlayerViewHelper class, override the playstatechange method there. Also there is extra work need to be done on ViewHolder side too (to apply the change for your custom ViewHelper).

Ok, but I have always the problem that during slidingup my recyclerView, the video doesn't starts again...
I am testing "2.2.1-SNAPSHOT" using ExoPlayerView

@developerGM Ok so let narrow down to your current use case. I will figure out if it is the issue of pause/resume or not. Literally I could not carefully test those, but I think the approach is simple.

Yes, This is the issue that I have using new 2.2.1-SNAPSHOT.
All others are solved now

@developerGM Can you checkout branch "fix/pause-resume" and try the first Example? I can make it works though, but have no idea if it matches your idea.

@eneim In which folder ? I'm in "fix/pause-resume" branch now

@developerGM here (I reuse some class from other places just to verify the behaviour. This contains no fix now).

@eneim Sorry, I think that my previous posts not are clear :)
With last 2.2.1-SNAPSHOT solved:

if I COLLAPSE and EXPAND my panel I use Toro.pause() and Toro.resume() and works perfectly
If I click on my Item (inside recyclerView), I use Toro.pause(), so I can open a new Activity and when come back using Toro.resume(), all works and player restarts

Now, the problem, with last ExoPlayerView is that if I scroll down, the videos play regular but when I scrollUp (come back to previous videos), those videos don't start again.

@developerGM Hmm, I think the issue of not start playing again is what I try to solve with this. You can try example Basic 4 which uses ExoPlayerView (see the list in Sample App).

Ok, I will test the 2 examples. Thanks

Hello @eneim!
I'm facing the exact same issue trying to apply the same use-case as @iarchii 's.
The only difference is that i'm using toro version 3.5.2
Is this still a known unsolved issue?
Here what I'm not understanding after some debugging: after switching Activity the boolean value playWhenReady in onPlayerStateChanged() method switches automatically to false and even explicitly forcing it to true in initialize() method doesn't do the trick, because when the time comes the value is always false.
Any suggestion?

@maxbaldrighi do you have any code that can reproduce the issue? For example: how you switch Activity, code of your current ViewHolder where it doesn't work well.

Sure, I will share with you some code as soon as I manage to put it together.
Thanks!

ViewHolder source:
public class FeedMemoryVideoVHToro extends FeedMemoryViewHolder implements ToroPlayer {

private ExoPlayerViewHelper videoHelper;

private PlayerView mainView;
private ImageView thumbnailView;
private View thumbnailViewLayout;

private View playBtn;
private View progressView;
private TextView progressMessage;

FeedMemoryVideoVHToro(View view, TimelineFragment fragment, OnTimelineFragmentInteractionListener mListener) {
	super(view, fragment, mListener);

	this.mainView = view.findViewById(R.id.video_view);
	thumbnailView = view.findViewById(R.id.video_view_thumbnail);
	thumbnailViewLayout = view.findViewById(R.id.video_view_thumbnail_layout);

	playBtn = view.findViewById(R.id.play_btn);
	progressView = view.findViewById(R.id.progress_layout);
	progressMessage = progressView.findViewById(R.id.progress_message);
	progressMessage.setText(R.string.buffering_video);

	playBtn.setOnClickListener(this);

	super.playBtn = this.playBtn;
}

@NonNull
@Override
public View getPlayerView() {
	return mainView;
}

@NonNull
@Override
public PlaybackInfo getCurrentPlaybackInfo() {
	return videoHelper != null ? videoHelper.getLatestPlaybackInfo() : new PlaybackInfo();
}

@Override
public void initialize(@NonNull Container container, final @NonNull PlaybackInfo playbackInfo) {
	if (videoHelper == null) {
		String uri = "";
		if (mItem != null && Utils.areStringsValid(mItem.getContent()))
			uri = mItem.getContent();

		// call to HLApp.exoConfig to loop videos
		videoHelper = new LoopExoPlayerHelper(this, Uri.parse(uri));
		videoHelper.addEventListener(new Playable.DefaultEventListener() {

			@Override
			public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
				super.onPlayerStateChanged(playWhenReady, playbackState);

				switch (playbackState) {
					case Player.STATE_BUFFERING:
						progressView.setVisibility(View.VISIBLE);
						thumbnailViewLayout.setVisibility(
								(playbackInfo.getResumePosition() == 0) ? View.VISIBLE : View.GONE
						);
						playBtn.setVisibility(View.GONE);
						break;

					case Player.STATE_READY:
						progressView.setVisibility(View.GONE);
						thumbnailViewLayout.setVisibility(playWhenReady ? View.GONE : View.VISIBLE);
						playBtn.setVisibility(playWhenReady ? View.GONE : View.VISIBLE);
						break;
				}
			}
		});
	}
	videoHelper.initialize(container, playbackInfo);

	if (mainView.getPlayer() != null)
		mainView.getPlayer().setPlayWhenReady(true);

	if (canPlayWhenReady) {
		videoHelper.play();
		canPlayWhenReady = false;
	}
}

@Override
public void play() {
	if (videoHelper != null) videoHelper.play();
}

@Override
public void pause() {
	if (videoHelper != null) videoHelper.pause();
}

@Override
public void release() {
	if (videoHelper != null) {
		videoHelper.release();
		videoHelper = null;
	}
}

@Override
public boolean wantsToPlay() {
	return ToroUtil.visibleAreaOffset(this, itemView.getParent()) >= 0.85;
}

@Override
public int getPlayerOrder() {
	return getAdapterPosition();
}

@Override
public boolean isPlaying() {
	return videoHelper != null && videoHelper.isPlaying();
}

public boolean isAutoPlayOn() {
	return (
			getActivity().getUser().feedAutoplayAllowed(getActivity()) &&
					this.fragment != null && this.fragment.isVisibleToUser()
	);
}

private boolean canPlayWhenReady = false;
public void onBindViewHolder(@NonNull Post object) {
	super.onBindViewHolder(object);

	if (!isPlaying() && !isAutoPlayOn()) {
		playBtn.setVisibility(View.VISIBLE);
		progressView.setVisibility(View.GONE);
	}
	else {
		if (isAutoPlayOn()) {
			if (videoHelper != null && !isPlaying())
				videoHelper.play();
			else if (videoHelper == null)
				canPlayWhenReady = true;
		}
	}

	MediaHelper.loadPictureWithGlide(getActivity(), mItem.getVideoThumbnail(), thumbnailView);
}

@Override
public void onClick(View view) {
	if (view.getId() == R.id.play_btn) {
		if (Utils.isStringValid(mItem.getContent()) && videoHelper != null)
			videoHelper.play();
	}

	super.onClick(view);
}

@Override
public boolean onSingleTapConfirmed(MotionEvent e) {

	mListener.saveFullScreenState();

	Intent intent = new Intent(getActivity(), VideoViewActivity.class);
	intent.putExtra(Constants.EXTRA_PARAM_1, mItem.getContent());
	intent.putExtra(Constants.EXTRA_PARAM_2, mItem.getVideoThumbnail());
	intent.putExtra(Constants.EXTRA_PARAM_3, getCurrentPlaybackInfo().getResumePosition());
	mMainView.getContext().startActivity(intent);

	return true;
}

//region == Getters and setters ==

public ExoPlayerViewHelper getVideoHelper() {
	return videoHelper;
}

//endregion

}

consisting in:

Constructor with just some views initialization,
the ToroPlayer interface overridden methods,
the override of onSingleTapConfirmed() triggers the new activity.

As I told you, the initialize() method works perfectly as long as I don't leave the first activity. As soon as I do it on the contrary, in onPlayerStateChanged() callback the value "playWhenReady" is always false, thus not triggering the autoplay.
Manually setting the value, setPlayWhenReady(true).
in onBindViewHolder() I tried using an additional boolean canPlayWhenReady in order to manually start the player, but again, no effect.

@maxbaldrighi will need some time to figure out the cleanest way. Right now, what I do on my demo app is to use startActivityForResult instead. And once the VideoViewActivity need to be finished, it tells the Activity started it about that event, and from there, reset the Container as below:
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == Activity.RESULT_OK && requestCode == RQ_PLAYBACK_INFO && data != null) {
      PlaybackInfo info = data.getParcelableExtra(RESULT_EXTRA_PLAYBACK_INFO);
      int order = data.getIntExtra(RESULT_EXTRA_PLAYER_ORDER, -1);
      if (order >= 0 && container != null) {
        container.setPlayerSelector(PlayerSelector.NONE);
        container.savePlaybackInfo(order, info);
        container.setPlayerSelector(selector);
      }
    }
  }

I will think about your case as well. What I'm working on now is to have the helper detachable, so that you can grab it from VideoViewPlayer, keep the playback smooth. And after coming back to the list, it should be fine. Will push something when I finish the draft.


bug(relay): Relay VMs sitting at 50% CPU constantly

After the incident/outage yesterday I quickly looked at the CPU usage graph on the Relay VMs and saw they were all sitting at 50% CPU usage while prior to the incident they were sitting much lower.  Here's a screenshot.

Maybe fixed with the half-sleep in https://github.com/firezone/firezone/pull/4457/files#diff-c3200f3bb4414a260c930e656ddb673a1ad2a8ee292e508bfebf5dbf670c2b8dR198

Did #4457 make a difference on staging?

It looks like it did.

Awesome!


It does not work LDAP PING

https://msdn.microsoft.com/en-us/library/cc223811.aspx
Ntver option is a byte string. When searching for the form:
conn.search(base='', scope=bonsai.LDAPSearchScope.BASE, filter='(&(DnsDomain=EKB2003.LOCAL)(NtVer=\00\00\00\01))', attrlist=['NETLOGON'])
I get the error:
TypeError: Wrong parameters (base<str|LDAPDN>, scope<int>, filter<str>, attrlist<List>, timeout<float>, attrsonly<bool>, sort_order<List>, page_size<int>, offset<int>, before_count<int>, after_count<int>, est_list_count<int>, attrvalue<object>).
How to fix it?

i am sorry,fixed
filter='(&(DnsDomain=EKB2003.LOCAL)(NtVer=\\00\\00\\00\\01))'

Actually, this issue might be considered as a bug. Every parameter has the right type, clearly. The problem surfaces in the Python/C API side of the type-checking, where the argument parsing function doesn't like strings with null characters inside, thus returns with error.
Nonetheless,  the thrown exception is entirely misleading. If the argument parser accepted byte-likes object along with str and None, then the search method would throw a LDAPError with bad search filter message, which would help you far more where to look for the original error.
I'm going to change the parser's parameters in the next release, hoping that being more permissive doesn't lead to bigger problems.


🌐 Add Spanish translation for docs/es/docs/fastapi-cli.md

From https://github.com/fastapi/fastapi/pull/11703 (updated)

This was covered in another PR, so I'll close this one now, thanks for the effort! :cake: :coffee:


TFRecord integration with Keras API

Since the Keras-2 API is now directly in TensorFlow, I think it would be very useful if there were a mechanism directly in TensorFlow to supply TFRecords to Keras, such as in a call to model.fit(), or with equivalent functionality to flow_from_directory.
One key implementation detail is with the way model.compile() works as detailed in a comment on this topic in keras. As discussed in the same comment, numpy arrays have been determined to be the primary way of interacting with Keras, so this should not be an upstream Keras request because TFRecords currently require TensorFlow, so other backends couldn't be supported easily.
Starter code:
https://github.com/farizrahman4u/keras-contrib/pull/27
Related Keras issues:
https://github.com/fchollet/keras/issues/5356
https://github.com/fchollet/keras/issues/5368
https://github.com/fchollet/keras/issues/5325

Since Keras will work with Estimator API, we can put this integration in tf.estimator.inputs? I think you can actually just ingest your data from TFRecords source to as part of input_fn in Estimator API. Similarly, this will work with Experiment as well.

@terrytangyuan that sounds good, is what you describe forward looking or already integrated?

I don't think it's integrated yet since Keras literally just landed in contrib. I am not in the internal team but @martinwicke knows the plan of things.

Keras just landed in contrib and will undergo some internal refactoring for a bit. The plan is to provide simple ways to:

use Keras inside a model_fn (already the case, Keras layers work fine inside Estimators)
use a compiled Keras Model to create an Estimator
add the ability for a Keras Model to accept an input_fn for its fit() method.

This will take a while but it's on the roadmap (@fchollet you may correct me on the last bullet).

Thanks I saw it was just added, just wasn't sure of the status.
Using Experiment with Keras models does sound good. The other way around may also be useful as an option, where if you already have training code for Model.fit() and an existing TFRecord dataset.

Yes, that would be the "allowing input_fn for Model".

Sounds great! Thanks for clarifying, would it be good to leave this open to follow the progress?

Yes, let's leave this open.

I'm learning as I go but I've been looking into this a bit and here are my first thoughts.
These are from upstream keras, but these two commits/prs take care of a couple of the key parameterizations necessary for TFRecords to work:

tensors feeding models - numpy arrays no longer required, merged some time ago
kwargs passed to session.run - in progress at time of writing

One possible design is to create a TFRecordInput() Keras layer that wraps data_flow_ops.RecordInput which might be able to fit well with the tf_cnn_benchmarks suggested high performance design. Then calls like model.fit() could get their data from those input tensors.
Two possible cases I've considered for loading tensors
Input() or TFRecordInput() case:
Something like these checks in the densenet model for the variable input_tensor might be possible to fold into the Input, or to put on a backend.
model.fit() case:
model.fit is after compile which instantiates the tf graph so this might be untenable. Nonetheless, in an ideal world one could create data_flow_ops.RecordInput(), loading/preprocessing ops, then those tensors could be fed to model.fit(), which could check the input type, and then the tensors could be passed through the keras backend to the TensorFlow backend.
Preprocessing Layers
TensorFlow has preprocessing layers and it might be possible to simply use them to create Keras Preprocessing/Augmentation Layers. However there would ideally be some mechanism by which they can be separated from the Keras model when desired.
Hopefully none of this is too far behind tf's ongoing changes, any suggestions/feedback?

I'm also very interested in using TF Record-files with Keras. I read several issues, that are related to this feature, read the stack-overflow question (https://stackoverflow.com/questions/42184863/how-do-you-make-tensorflow-keras-fast-with-a-tfrecord-dataset) and saw the pull request https://github.com/farizrahman4u/keras-contrib/pull/27
What is the current state of this Feature?
Can I merge the pull request into my local repository, or will the final implementation very different to this?

It will be very different. Implementation has not yet started.

Oh, too bad. When reading the stackoverflow answer, I really thought, that this feature is almost done :-)
I was thinking about using Keras (the first time) for my next project. But since I have over 100GB TFRecord-Files as training data, this seems not to be an good option currently.
However thank you very much for driving this topic. If there was a prototype implementation, I would have tested it with pleasure. But for a full implementation, I think I do not have enough knowledge about Keras at the moment. So I cannot help much. Thus I will check again in some month, if your ideas are implemented. Keep going 👍

I'm in a similar situation to you, netzeband.
I'm sure Andrew will correct me if I'm wrong, however, the code in the PR looks good as a single example on 28x28 single channel images. It doesn't appear that it will work with other datasets unless you change the code in the PR to suit your own dataset. For the code to be pulled into TensorFlow master, it'd need to be genericised and also be ported into Keras for use with Theano, so as not to fork the original Keras code base.
I'm looking at using some of this PR code and modifying it to work with my data, not as part of TensorFlow, but as part of my own project. Unless there's some other way?

@normanheckscher is correct

here to show interest for this feature. thanks @ahundt for fighting the good fight!

Notable progress in upstream Keras https://github.com/fchollet/keras/pull/6928 for model.fit(). Right now there are a few bugs caught by unit tests so I'd appreciate comments/suggestions.

https://github.com/fchollet/keras/pull/6928 unit tests pass

So, what should we do with this issue? Is this relevant or is it covered by recent pull from Keras? @fchollet?

@martinwicke fchollet/keras#6928 integrates TFRecords via yield op support (i.e. RecordInput). The fifo queue way to get records and the new Dataset class may or may not work with Keras after those changes, but if they do an example is probably a good idea.
I'd suggest not closing this until the changes are merged to TensorFlow from upstream Keras. If the other kinds of data input should also be supported this issue might still apply, but a new issue may also be appropriate.

Based on the discussion in Keras Input Tensor API Design Proposal and https://github.com/fchollet/keras/pull/6928#issuecomment-312088200 implementation of https://github.com/tensorflow/tensorflow/issues/10837 will be required for the ideal API design that supports TFRecords (and any data input op) to work.

https://github.com/fchollet/keras/issues/7503 has the latest action plan, pieces of this functionality are being merged into keras upstream

Will be also an interoperability also with tf.contrib.data.Dataset?

Yes, you can use the Dataset API to train Keras models. The standard
tf.keras workflow would likely involve managing data via the Dataset API,
building your model via the Keras API, and training it via the Estimator
API.
On 26 August 2017 at 09:17, bhack<EMAIL_ADDRESS>wrote:

Will be also an interoperability also with tf.contrib.data.Dataset?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/8787#issuecomment-325142623,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AArWb1Cwm7tcXVGhPzsPmOmCG97I-zbqks5scEUcgaJpZM4MsVNC
.

Interested also just found this when trying to move a tf.estimator based model to Keras and realizing the data prep and
training_input_fn = tf.estimator.inputs.pandas_input_fn(x=training_data, y=training_label, batch_size=64, shuffle=True, num_epochs=None)
Would not work to feed Keras, looking forward to it landing, the ability to use the estimator and experiment stuff with Keras is interesting

Checking in to announce my interest as well!

The estimator = model.get_estimator() feature is now available for tf.keras (in TF 1.4).
To train a Keras model from TFRecords, please see this example: https://github.com/fchollet/keras/blob/master/examples/mnist_tfrecord.py

Has anyone tried using tf-records to train a keras model with multiple inputs?


Will Juneteenth will be observed when it falls on a weekend?

This package assumes that Juneteenth will be observed when it falls on a weekend. However, in 2021 Juneteenth was not observed on Friday June 18th, 2021. The next weekend Juneteenth will be in June 2027.

Juneteenth is observed when it falls on weekends.  Tests added  in commit ceb6ca82fe6662423a92b0d9218617ad3a162bf1 doc updated in b33e5d0dc919c8689f499a225c58ffa6035043d8


Aborted (core dumped) in tf.irfftnd/ifftnd/irfftnd

Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
tf 2.16
Custom code
Yes
OS platform and distribution
Linux Ubuntu 22.04.3 LTS (x86_64)
Mobile device
No response
Python version
3.9.13
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
When the fft_length parameter of tf.irfftnd/ifftnd/irfftnd is less than or equal to 0, it will trigger a crash, resulting in Check failed.
Standalone code to reproduce the issue
import tensorflow as tf

input1 = tf.random.normal([10,10,10,10,10], dtype=tf.float32)
input2 = tf.random.normal([10,10,10,10,10], dtype=tf.float32)
input3 = tf.complex(input1,input2)

tf.irfftnd(input3,-3,-3) #crash
# tf.ifftnd(input3,-3,-3) #crash
# tf.irfftnd(input3,-3,-3) #crash

Relevant log output
2024-05-07 07:46:42.396021: F tensorflow/core/framework/tensor_shape.cc:45] Check failed: NDIMS == dims() (1 vs. 0)Asking for tensor of 1 dimensions from a tensor of 0 dimensions
Aborted (core dumped)

Hi @x0w3n ,
Sorry for the delay, I tried to run your code on colab using TF v2.16, nightly and faced the same issue. Please find the gist here for reference.
Thank you!


Cannot sync local dir with Azure Storage Emulator

Which version of the AzCopy was used?
AzCopy 10.2.1
Which platform are you using? (ex: Windows, Mac, Linux)
Windows
What command did you run?
azcopy sync "C:\LocalDir" "http://<IP_ADDRESS>:10000/devstoreaccount1/mycont?%SAS%"
What problem was encountered?
I get a following error:
error parsing the input given by the user. Failed with error Unable to infer the source 'C:\LocalDir' / destination 'http://<IP_ADDRESS>:10000/devstoreaccount1/mycont?%SAS%'.
It occurs because I'm trying to sync my local folder with Azure Blob Storage that runs locally in the emulator and its url doesn't contain anything hinting it's a blob storage. The error message does nothing to explain this.
How can we reproduce the problem in the simplest way?

Make sure you have Azure Storage Emulator installed and initialized.
Create a container called mycont in it, issue an SAS token for it.
Create a C:\LocalDir folder with some files in it.
Try running the above command with SAS supplied.

Have you found a mitigation/solution?
The solution I've found is simply not using sync and settling with copy. This is a poor workaround, because copy seems to always be overwriting all files and overall does not, you know, sync. The crucial difference that allows copy to work is the fact that it supports the --from-to flag, and supplying --from-to LocalBlob helps AzCopy to figure out what I'm trying to do. Again, no guidance on this anywhere in azcopy help or docs. The following command works:
azcopy copy"C:\LocalDir" "http://<IP_ADDRESS>:10000/devstoreaccount1/mycont?%SAS%" --from-to LocalBlob
The same flag doesn't work with sync:
azcopy sync "C:\LocalDir" "http://<IP_ADDRESS>:10000/devstoreaccount1/mycont?%SAS%" --from-to LocalBlob
unknown flag: --from-to
Please add support for the --from-to flag to the sync command as there's no reason for the command not to support it. The sync command is also missing a number of other flags that copy has without any apparent reason, for example, --blob-type.

Hi @rsheptolut, thanks for reaching out!
Sync is indeed missing some flags that copy already has. We have plans to make up the difference.

@zezha-msft Any changes to the status of this in 10.3.x or coming in 10.4?

(Just asking to try to get right milestone tag on this issue, if possible)

I'm very interested in the outcome on this. I need to be able to sync to a local emulator.

Here's the offending code:
func inferArgumentLocation(arg string) common.Location {
  if arg == pipeLocation {
    return common.ELocation.Pipe()
  }
  if startsWith(arg, "http") {
    // Let's try to parse the argument as a URL
    u, err := url.Parse(arg)
    // NOTE: sometimes, a local path can also be parsed as a url. To avoid thinking it's a URL, check Scheme, Host, and Path
    if err == nil && u.Scheme != "" && u.Host != "" {
      // Is the argument a URL to blob storage?
      switch host := strings.ToLower(u.Host); true {
      // Azure Stack does not have the core.windows.net
      case strings.Contains(host, ".blob"):
        return common.ELocation.Blob()
      case strings.Contains(host, ".file"):
        return common.ELocation.File()
      case strings.Contains(host, ".dfs"):
        return common.ELocation.BlobFS()
      case strings.Contains(host, benchmarkSourceHost):
        return common.ELocation.Benchmark()
        // enable targeting an emulator/stack
      case IPv4Regex.MatchString(host):               // <-- BUG here
        return common.ELocation.Unknown()             // <-- This is what gets returned in case of storage emulator URL
      }

      if common.IsS3URL(*u) {
        return common.ELocation.S3()
      }
    }
  }

  return common.ELocation.Local()
}

Source

Sync is indeed missing some flags that copy already has. We have plans to make up the difference.

@zezha-msft Any news on that? We are running into the same problem. Since copy already supports the --fromTo argument, it is weird that sync doesn't -- and that's quite a showstopper regarding e.g. Azurite compatibility.
Shouldn't it be sufficient to modify switch the usage of inferFromTo in sync.go
https://github.com/Azure/azure-storage-azcopy/blob/87cba068b4cb797fb822163905cf6e92a4ec4db4/cmd/sync.go#L145
to validateFromTo as is done in copy.go
https://github.com/Azure/azure-storage-azcopy/blob/87cba068b4cb797fb822163905cf6e92a4ec4db4/cmd/copy.go#L272
?
Internally validateFromTo falls back to inferFromTo anyway if the user didn't specify a --fromTo.

Encountering this bug with Azurite as well - the annoying part is that it mentions to use the --from-to flag, but then when providing the flag indicatesunknown flag: --from-to
Also, want to wish this issue an early 2nd birthday!  🎂

Apologies for not updating this thread sooner. Sync supports the from-to flag starting from v10.13.0 https://github.com/Azure/azure-storage-azcopy/blob/main/ChangeLog.md#version-10130 which was released Oct 2021. This should allow support for syncing a local dir with Azurite. I will go ahead and close this thread for now, but if you are still having any issues, please do re-open this thread or open a new one. Thank you again for your feedback


Readme outdated

All mocks are removed when opening a different page with browser.open unless the option clearRequestMocks is set to false.
The option no longer exists

Also: To filter the requests made by the browser, you can use browser.request.filter., it should be browser.requests (notice missing S)


Update the Polymer Paper Elemet to Version 1.0

I would like test with the newer Polymer version 1.0.
Could you integrate it in your ChromeDevEditor in next release?
Thank you!

you can easily test CDE with polymer version 1.0. go to the polymer site and put the elements you want in a cart then when you download pick bower.json file. drop that into you project and hit bower update.

Easy enough, but just another vote for this (certainly helps when on-ramping new developers). Just clarify: I think the request is to have 1.0 baked into chrome dev "new project" templates.  Assuming that's in the works & that cellx is just putting in a vote for that. If so, ditto!

:+1: Please update paper element versions if it's possible so we can update codelabs on @robdodson 's its-hackademic repo without adding extra steps for students. Thanks

We really do need this. Unfortunately, I won't be able to tinker with Polymer 1.0 until CDE gets updated.

You should update components to Polymer 1.0 in project templates definitely.
Polymer designer should include all components from a current project (custom components should be included too) to match components versions of the project.


faust2sporth not linking

Paul,
I think the script does not make the compiler link the .cpp and the .so files.
I get a .so file instead of the the .sp
I also had to change the paths of the faust headers in sporth.cpp

Faust2Sporth has only been tested on a few Linux machines, so it isn't surprise me that you'd be running into some compiler and path related issues.
Faust2Sporth is supposed to generate a .so file. This is a shared object file, that Sporth can load up as a plugin. See this blog post for more info:
http://paulbatchelor.github.io/blog/posts/2016-06-09-faust2sporth.html

Very interesting. Thank you.

@martinjaroszewicz could you paste here what you changed the faust headers to, and what platform you are using?

In sporth.cpp
#include "faust/gui/UI.h"
#include "faust/audio/dsp.h"
#include "faust/gui/meta.h"

to where they are because I don't know compiler directives
faust/architecture/faust/gui/UI.h
faust/architecture/faust/dsp/dsp.h
faust/architecture/faust/gui/meta.h

Ubuntu 16.04

You're on Linux? Huh. It should have worked without a hitch.
What version of Faust are you running?
I just compiled Faust using the master branch, and the files are in the right places. Running "Faust --version" gives me:

FAUST, DSP to C++ compiler, Version 0.9.81
Copyright (C) 2002-2015, GRAME - Centre National de Creation Musicale. All rights reserved.

Same here. This is strange but not an issue for me.

faust --version
FAUST, DSP to C++ compiler, Version 0.9.81
Copyright (C) 2002-2015, GRAME - Centre National de Creation Musicale. All rights reserved.

Can you see if /usr/local/include/faust exists?
This is what I get when I run "ls /usr/local/include/faust"

au  audio  dsp  gui  libfaust.h  midi  misc.h  osc  sound-file.h  vst

If this folder does exist, it must mean that Ubuntu does not have /usr/local/include in the header search path. I have pushed a changed to the faust2sporth script that explicitly looks for headers in this path so you shouldn't run into this issue anymore.
If that folder does not exist or looks significantly different, it means that something is strange with the Faust installation on Ubuntu, which is an issue I can't really fix on my end.

Yes:
au  audio  dsp  gui  midi  misc.h  osc  sound-file.h  vst

Okay. I made some tweaks to faust2sporth and pushed it to master. It should be fixed now.

dist.cpp:41:29: fatal error: faust/audio/dsp.h: No such file or directory compilation terminated.
I guess the problem is that the dsp.h is in dsp/dsp.h instead of audio/dsp.h

Yup. I looks like I didn't do a full clean of my faust2 files. Once I do that, I get that error. I have pushed that fix. See if things work now.

Perfect!


Add option to disable minimize to tray for gnome users

Tray icons on gnome 3 are deprecated for a long time already and almost all the extensions that add tray functionality are broken on the latest gnome 3 versions and it's a gamble with every gnome 3 update if one will find a working tray icon extension again.
Also see https://github.com/keybase/client/issues/5772
I'm running Arch with gnome 3.34.4 currently and when I close Keybase, it gets minimized to tray and the only way for me to bring it back, is to stop it via systemctl stop --user keybase.gui.service and then start it again.
It would be nice if the client had an option to disable "minimize to tray" and just close it if I hit close, rather than minimizing it to a none existing tray with no way of opening it again (other than closing it).

I just hit this issue after upgrading to Linux Mint, I'm currently running mint 19 Tara Cinnamon 4.0.10
Many years ago I used alltray and it it still in the repositories so will try to remember how it works and post a work around.

No :-( alltray seems to be too old as well, it doesn't work properly for simple apps like gnome-calculator or xed
I have found that it's not necessary to stop keybase before I run another instance, keybase does this it's self.
$ run_keybase %u
**Shutting down Keybase GUI...**
Unmounting /run/user/1000/keybase/kbfs...
Unmounting and shutting down kbfsfuse...
Shutting down keybase service...
Starting via systemd...
run_keybase: Success!

I'm on Arch, with Gnome 3.36.1, and have gnome-shell-extension-topicons-plus-git installed from AUR, but there's no longer a Keybase icon to speak of, so the only way to open Keybase is to run its .desktop file from the launcher.


Add numerical sanity check to cp2k test

Closes #160

I have set the same references and boundaries both for gpu and cpu.
gpu
Mean = -4404.232288847591  (-1.7260723051323787e-08, 7.0019334434651457e-09)
cpu
Mean = -4404.232290105533  (-1.7060044662503173e-08, 7.3283963208809364e-09)
cpu and gpu together
Mean = -4404.232289541480 (-1.7188115373848677e-08, 7.200325612658878e-09)

retest this please


Difference between Native and Wrapper razor components?

You should learn to ask questions. This is a nonsensical question. And this site is for serious issues. Go back to Stackoverflow, where some answers to this question are awaiting you. When you finish reading them, please come here to close this issue.
Have a good day...

@kmuthukumar23 can you please provide more information about your question?

Hi @Eilon ,
thanks for your interest ;)
what i m asked, difference or comparison between pure razor components(blazor) and javascript embedded razor components.


change theme background colour not working

Following this example from https://stackoverflow.com/questions/65033675/how-to-switch-from-light-to-dark-theme-in-ipyvuetify
it doesn't change the coloou.
Is there any other way to do it?
Thanks

A trick is to add an opaque Overlay component as background (z-index=-1) and change its color upon switching the ipyvuetify theme:

import ipyvuetify as v

dark_bg = '#7FFF00'
light_bg = '#7FFF00'

bg = v.Overlay(
    color=dark_bg if v.theme.dark==True else light_bg,
    opacity=1,
    style_='transition:unset',
    z_index=-1
)

def bg_switch(widget, event, data):
    v.theme.dark = not v.theme.dark
    bg.color = dark_bg if v.theme.dark==True else light_bg

btn = v.Btn(children=[v.Icon(children=['mdi-theme-light-dark'])])
btn.on_event('click', bg_switch)

v.Container(children=[bg, btn])

In the code above, you have set dark_bg and light_bg with the same colour...

of course I have but it doesn't change to anything  anyway :)

I misunderstood your question. The Overlay widget in the above code was for solving the issue (at that time) when using ipyvuetify with the Voila lab template (to hide the Voila background colour surrounding the ipyvuetify rendering).
Is your issue about changing the colour of the ipyvuetify dark or light theme?

Yes correct
Thanks

Then, try from the second solution the example which changes the background colour by adding an internal CSS in an HTML style element, but instead of changing .jp-Notebook CSS settings, change .vuetify-styles .theme--dark.v-application CSS settings:
dark_bg = '.vuetify-styles .theme--dark.v-application {background: #7FFF00}'
light_bg = '.vuetify-styles .theme--light.v-application {background: #7FFF00}'

def bg_switch(widget, event, data):
    v.theme.dark = not v.theme.dark
    css.children = [dark_bg] if v.theme.dark==True else [light_bg]

btn = v.Btn(children=[v.Icon(children=['mdi-theme-light-dark'])])
btn.on_event('click',bg_switch)

css = v.Html(tag='style', children=[dark_bg] if v.theme.dark==True else [light_bg])

v.Container(children=[css,btn])


How many tags support working at the same time？

Step 1: What do you want?

Report an issue.
Improve code (and need help).
Suggest a new feature.
Present a new hardware adapter board or wiring.
Want to report my experience or measurement. (Please also add them to the wiki!)

Step 2: Describe your environment

Arduino IDE version or Toolchain: _____
dw1000ng Library version: _____
Arduino device: _____
Used adapter board: _____

Step 3: Describe the problem

Affected file(s) or example(s):

Filename 1
Filename 2

Steps to reproduce (for bugs only):

Observed Results:

What happened?  This could be a description, log output, etc.

Expected Results:

What did you expect to happen?

Relevant Code:
  // TODO(you): code here to reproduce the problem

At the same time, you can perform Two-Way-Ranging with only one Tag.
See APS013 for more information about TWR.

hi @Sonic0 , you can support me . I can add more tag (2-10) with this library .
I'm using Arduino mini + DWM1000


Add support for Smoke Detector

Is your feature request related to a problem? Please describe.
I‘ve connected a Smoke Detector to the Hub and the battery state is available as entity but unfortunately not the state from the Smoke Detector
Describe the solution you'd like
Add entity for Smoke Detector state and if possible for high temperature as the Smoke Detector is also able to detect this

Hello @smartmatic ,
I would be happy to try but I need a diagnostic trace to start with.

Hello @smartmatic , I would be happy to try but I need a diagnostic trace to start with.

Cool :-)
Here are two diagnostics. One from the Hub and one from the smoke detector.
meross_lan-85afbed8c566acb66c26e9cc1680bc96-Smart Hub<PHONE_NUMBER>988326281748e1e984fc79)-41dce56ced9f5ae24c84d8ac3c4aea76.json.txt
meross_lan-85afbed8c566acb66c26e9cc1680bc96-smokeAlarm (280000000A7F)-a928a6d06cbc196039230a463d497f54.json.txt

Well...it's a bit tricky since the only meaningful payload is:
"Appliance.Hub.Sensor.All",
        {
          "all": [
            {
              "id": "280000000A7F",
              "online": {
                "status": 1,
                "lastActiveTime":<PHONE_NUMBER>
              },
              "smokeAlarm": {
                "status": 170,
                "lmtime":<PHONE_NUMBER>,
                "interConn": 0
              }
            }
          ]
        }

This carries some obvious and common info (like device id and online status) and the 'smokeAlarm' field which carries the smoke alarm state. Now, inside 'smokeAlarm', I don't get what 'status' is, nor I don't get 'interConn'.
It also appears this device exposes a kind of a toggle function: this is also unknown to me (maybe you can activate/deactivate the sensor?)
Right now I'm going to implement a bunch of 'plain' switch/sensors in order to interact and report the device state. If you'll be able to clone from the dev branch that would speed up testing else I could anyway publish a 'beta' release in order to ease the download process (no issue at all - just let me know)
I'll be back as soon as the dev code is available ;)

Right now I'm going to implement a bunch of 'plain' switch/sensors in order to interact and report the device state. If you'll be able to clone from the dev branch that would speed up testing else I could anyway publish a 'beta' release in order to ease the download process (no issue at all - just let me know)

What does that exactly mean? How can i do it?
I you like i can create a new diagnostic with a test alarm and hope that it contains more details.

Right now I'm going to implement a bunch of 'plain' switch/sensors in order to interact and report the device state. If you'll be able to clone from the dev branch that would speed up testing else I could anyway publish a 'beta' release in order to ease the download process (no issue at all - just let me know)

What does that exactly mean? How can i do it?
I you like i can create a new diagnostic with a test alarm and hope that it contains more details.

It involves using the command line git commands in order to download to your HA instance the 'dev' branch where I usually post incoming features before actually publishing them through a 'Release'. Since you asked I guess you're not very familiar with command line usage of git so no worries: I'll just publish it so you'll be able to automatically download through HACS advertised updates ;)
The trace with different states could be definitely helpful so we'll be able to eventually guess more on behaviours.
As for the 'status' property I was talking before, since it reports 170 I was wondering if it represents a temperature in tenth of degrees (other meross sensors report temperatures with this scale) and that could be read as a '17° C', could it be the temperature the sensor is reading? I've seen by the manual it also contains a temperature sensor.

@krahabb
I am going to provide a new trace tomorrow

I've just published an 'alpha' in Releases so you should be able to download it and grab the trace with that.
I've already added some features to better manage the smoke detector and tracing with this new release would help determining if the path is correct ;)

@krahabb
I‘ve installed now version 2.5.8
I will send an additional debug trace with this release tomorrow.
I can see the new enteties for the smoke dectector

Awesome!

Here is another Trace with Integration version 2.5.8
During the trace i pushed the test button to simulate smoke detection and to test the device.
I am not sure if this enough to show smoke alarm?
config_entry-meross_lan-85afbed8c566acb66c26e9cc1680bc96.json.txt

Well...I've discovered something but I can't figure out what to do next (we'll discuss this ;)
when the trace started (around 8:32 this morning) the sensor was reporting this timestamp as 'last sensor update' (the field is reported as 'lmtime' inside the protocol/trace):

Friday, April 8, 2022 7:57:13 AM

This could be interpreted in many different ways but usually this is the last time the sensor device sent data to the hub. This could be because the sensor detected and raised an alarm (this could be obvious) but also because of another 'unsolicited' internal update from the sensor not really triggered by an alarm. I guess these sensors keep pushing internal state updates to the hub on a somewhat regular basis: they do so not so frequently to preserve the battery but still they have to do that in some way..at least this is the behaviour of the ms100 temp/humidity sensor I own. Think of the battery level too: the sensor will sometime send the battery level to the hub.
During the tracing, this 'last sensor update' was updated to:

Friday, April 8, 2022 8:32:30 AM
this is likely right after you 'pushed the test button' so it means this was reported to the hub and so it gets reflected to meross_lan but the problem is no other field was changed after this so we still have:
'status' = 170
'interConn' = 0

At this point, I really don't know whats next: I strongly suspect the 'status' field is reporting the alarm state but it didn't change during the trace, even during your test, so I could guess it only changes when an actual alarm is raised and not when you push the button.
In order to refine the reasoning behind that I need to know what happened in the Meross app: did it report/notify you in some way of your test alarm raised? If it did then we're missing some other info but I suspect these would only be discovered when we connect to the hub over MQTT (we would then need to disconnect the hub from the Meross cloud and have it working in our MQTT environment).
Or, since meross_lan by default polls the device every 30 sec, the alarm was 'active' only in between and we missed the reading.
If this is the case, you could lessen the polling period in meross_lan device integration configuration or, let the alarm stay active for more than 30 seconds. Even better, simulate a real alarm (not by burning your house ;) by some way.
I see this is getting a bit troublesome, it would be nice if we could have some other testers around but since the device is pretty new we'll need some time though

P.S.
The beta 2.5.8 provides you a 'switch' for the smoke detector. In the trace it is reported active (on).
Could you see what happens when you turn it off in HA ? Do you see anything changing in the reported state for the smoke detector in the Meross app ? Maybe it works like an 'enable' switch for the whole sensor or for just a part of it ?

@krahabb
I've done some further tests and and my house is not burning because i used a Test Spray :-)
Here is the result for an real smoke alarm
 [         "2022/04/08 - 13:34:14",         "RX",         "http",         "GETACK",         "Appliance.Hub.Sensor.All",         {           "all": [             {               "id": "280000000A7F",               "online": {                 "status": 1,                 "lastActiveTime":<PHONE_NUMBER>               },               "smokeAlarm": {                 "status": 25,                 "lmtime":<PHONE_NUMBER>,                 "interConn": 1               }             }           ]         }       ],
So both states for the sensors changed. I guess InterConn shows a detected alarm as it turned from 0 to 1
Then status changed from 170 to 25.

config_entry-meross_lan-85afbed8c566acb66c26e9cc1680bc96.jso.txt
Furthermore i checked what happend when disabling the switch but I cant see any changes in the meross app.
But functional wise it looks like the sensor is disabled as to that time the smoke sensor does not react after using the test spray. But maybe it was not enough? I will repeat this test to be sure that nothing will happen once the device is switched off.

Good job!
The status going from 170 to 25 is very strange though...we can't figure out if that's a kind of signal level like the amount of smoke or non-smoke on the sensor or, if it carries some status codes about the type of alarm.
If you could also try to overheat and see the reading we could better identify its behaviour since the device should also report overtemperature alarms
Nonetheless this is very promising!
The interConn boolean is very likely representing the alarm state instead: 0 -> all good 1 -> alarm

Good job! The status going from 170 to 25 is very strange though...we can't figure out if that's a kind of signal level like the amount of smoke or non-smoke on the sensor or, if it carries some status codes about the type of alarm. If you could also try to overheat and see the reading we could better identify its behaviour since the device should also report overtemperature alarms Nonetheless this is very promising!
The interConn boolean is very likely representing the alarm state instead: 0 -> all good 1 -> alarm

I tried to test overheating near my oven but it doesn't work. Currently i have no idea how to test it in order to provide this information?

@krahabb
I've started a new test to simulate heat and it has worked. Here ist the log
config_entry-meross_lan-85afbed8c566acb66c26e9cc1680bc96.json.txt
[
"2022/04/10 - 19:02:08",
"RX",
"http",
"GETACK",
"Appliance.Hub.Sensor.All",
{
"all": [
{
"id": "280000000A7F",
"online": {
"status": 1,
"lastActiveTime":<PHONE_NUMBER>
},
"smokeAlarm": {
"status": 24,
"lmtime":<PHONE_NUMBER>,
"interConn": 1
}
}
]
}
],

[
"2022/04/10 - 19:03:38",
"RX",
"http",
"GETACK",
"Appliance.Hub.Sensor.All",
{
"all": [
{
"id": "280000000A7F",
"online": {
"status": 1,
"lastActiveTime":<PHONE_NUMBER>
},
"smokeAlarm": {
"status": 26,
"lmtime":<PHONE_NUMBER>,
"interConn": 0
}
}
]
}
],
My assumption:
state 24: Heat alarm
Interconn: 1 Alarm
After it was recognized i turned off the alarm via the button on the smoke dectector and told the meross app it was a wrong alarm

But after i've done that the smoke detector takes a while until the state changes in app. Looks like the state changes first when the smoke detector cool down.
My assumption:
Interconn: 0 No alarm
state 26: Ssensor still hot but alarm turned of manually
Hope that helps to make a step forward?!

Yes definitely,
I'll review the code/behaviour after these new findings. I'm actually away so I cannot work on it right away but I'll soon get back at coding!
Thank you!

Can you say something about the progress?

Aww..yep..sorry!!!
I fell apart with 'some business' and didn't care too much on meross_lan lately.
At any rate, I was a bit halted on progress anyway since the information we collected are not definitive in my opinion.
The codes you see and your explanations are ok but they look very very strange. I couldn't detect any 'logical' meaning for those values put in 'state' and it would be a bit 'rude' to just plain map them.
You could say: this is what we have so far but then I would hardcode into meross_lan some logic which, as I said, doesn't make a great sense.
Also, I thought that the same behaviour (matching the state value to a 'known' alarm state) could easily be done in automation: they would just be a bit cryptic but the behaviour would be the same: in the end you would use a check against a numeric 'state' property instead of a check against an alphanumeric string representig the alarm.
Let me know what would you expect as a 'reasonable and simple behaviour' for this kind of sensor. At the time, the binary value in interConn already looks like an alarm on/off state indicator.

Some additional info for sensor state:

status
status (muted)
meaning

17
20
temperature sensor error

18
21
smoke sensor error

19
22
battery error

23
-
test alarm

24
26
high temperature alarm

25
27
smoke alarm

170
-
default (no alarm/no error)

If an alarm/error is muted by pressing the device's button, the state first changes to the muted one and after a cool down time the device will check if the cause of the alarm is still present. If yes, alarm will be unmuted again and state switches back to the corresponding unmuted alarm state, otherwise state returns to default.
"interConn" seems more like an "interaction required" flag, but since every alarm requires an interaction... the meaning should be the same.


Introduce lib.updateManyAttrPaths

Motivation for this change
Generalized https://github.com/NixOS/nixpkgs/pull/145952 to multiple updates and creation. I've also had the need for this before, leading me to implementing modifyPaths and nestedListToAttrs. The function in this PR is a generalization of both the PR and the two linked functions.
Things done

Built on platform(s)

[ ] 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

[ ] 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/)
21.11 Release Notes (or backporting 21.05 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

[ ] Fits CONTRIBUTING.md.

this thing is really complex. could it be simplified with a modified comparison? without having checked it too far, this seems like it'd give the exact sort order you want to apply:
if isPrefix a b then false
else if isPrefix b a then true
else lexicalLessThan a b

assuming that the paths are short the first two conditions could be folded into a (then local and renamed) lexicalLessThan variant and probably not lose much performance

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/tweag-nix-dev-update-22/16251/1

@pennae I believe that's pretty much what the lexicalLessThan does here, except that isPrefix is inlined (notably isPrefix doesn't currently exist for lists).
However this will become irrelevant soon, as https://github.com/NixOS/nix/issues/5627 has been merged, which makes this much faster anyways :)

it shouldn't be the same, we'd want to sort [ "a" "b" ] after [ "a" "b" "c" ] (it'd be an easy change to to the nix version though by just flipping the booleans in the first two checks). that way you could run through the sorted list start to finish without further processing and still get the same order of applications you've specified for updateManyAttrPaths, but still have an easy optimization route of finding the end of operations to the current subtree with binary search (while nestedList generation is a linear time operation).
not sure how much difference it'd make in practice, we haven't benchmarked anything. making it more easily understandable does seem like it'd be very helpful though, your documentation makes it look like quite a monster right now :sweat_smile:

@pennae Still not exactly sure what you mean. Here is a sorted list using the current ordering:
[
 [ ]
 [ "a" ]
 [ "a" "x" ]
 [ "a" "y" ]
 [ "b" ]
 [ "b" "x" ]
 [ "b" "y" ]
]

Do you mean to have an ordering like
[
 [ "a" "x" ]
 [ "a" "y" ]
 [ "a" ]
 [ "b" "x" ]
 [ "b" "y" ]
 [ "b" ]
 [ ]
]

instead? So like, sorting as if non-existing elements were larger than any existing ones (in comparison to lexicographic ordering, which treats non-existing elements as if they were smaller than any existing ones).
If so, I don't know how that would simplify anything, it would just inverse some operations

that'd the be the order, yes. thought that might save you a search, but on closer inspection that doesn't seem to actually be the case. ignore everything i said :sweat_smile:

Update: Version 2 of this implementation (now in https://github.com/Infinisil/nixpkgs/tree/updateAttrPaths-v2) was very complex, but used way less memory than version 1, which was based on lib.groupBy. Unfortunately, despite implementing builtin lexical list comparison in Nix with https://github.com/NixOS/nix/issues/5627, version 2 was still a bit slower time-wise.
Considering that we need to change Nix to have better performance anyways, I revisited version 1 and noticed that if we had a builtins.groupBy it might turn out to work really well, so I made https://github.com/NixOS/nix/pull/5715 which does that. Turns out that indeed makes version 1 perform much better, both time-wise and memory-wise!
Here is a plot that shows the CPU time for each of these versions (sample size 100):

And here's a full comparison:

v1-lib
v2
v1-lib

CPU time mean
0.163s
0.204s
0.092s

Memory
343.5MB
97.3MB
59.4MB

Nixpkgs commit
https://github.com/NixOS/nixpkgs/pull/147077/commits/ae4996c0d8b3a81dd8743efce79586f101fdd7cb
https://github.com/Infinisil/nixpkgs/commit/462a63a561296748cbda2ac6b202519d22c3a856
https://github.com/NixOS/nixpkgs/pull/147077/commits/ae4996c0d8b3a81dd8743efce79586f101fdd7cb

Nix commit
https://github.com/nixos/nix/commit/2ff71b021379a2c9bbdcb789a93cdc585b3520ca
https://github.com/nixos/nix/commit/2ff71b021379a2c9bbdcb789a93cdc585b3520ca
https://github.com/NixOS/nix/pull/5715/commits/69d1518512f0a721c6a807613d9306bf35118e13

This was tested by evaluating the following file with NIX_SHOW_STATS=1 nix-instantiate --eval file.nix:

let
  lib = import ./lib;

  basicSet = n: builtins.listToAttrs (map (i: lib.nameValuePair (toString i) i) (lib.range 0 n));

  gen = n: if n == 0 then 0 else {
    l = gen (n - 1);
    r = gen (n - 1);
  };

  m = 12;

  input = gen m;

  genUpdates = n: if n == 0 then []
  else
    [{
      path = [];
      update = old: if builtins.isAttrs old then old // { changed = true; } else old + 1;
    }] ++
    map (u: u // { path = ["l"] ++ u.path; }) (genUpdates (n - 1)) ++
    map (u: u // { path = ["r"] ++ u.path; }) (genUpdates (n - 1));

  updates = genUpdates (m + 1);
  result = lib.attrsets.updateManyAttrPaths updates input;
in builtins.deepSeq result null

I think this is ready now. I added a bunch of tests for this new function, but also for groupBy which was changed to use the builtin version in the future.

I'm using ZFS as my filesystem, and I suspect @GrahamcOfBorg to also use ZFS. The build notably works if I use a tmpfs for the build directory!
$ sudo mkdir /tmpfs
$ sudo mount -t tmpfs -o size=4G,mode=1777 tmpfs /tmpfs
$ sudo TMPDIR=/tmpfs nix-build -A public-inbox
[...]
/nix/store/amxqkdv3ysg87j06anx3sly7ipyfsz6y-perl5.34.0-public-inbox-1.7.0

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/tweag-nix-dev-update-23/16631/1

I think it's looking really good now. One thing I'm not yet sure about though is the name of this function. Which of these (or others) is best?

updateManyAttrPaths (current name)
updateAttrPaths (many is implicit from the Paths)
updateByAttrPaths (but actually it's not updating the attribute paths, but rather the values at these paths, so add By)
updateAttrsByPaths (but then we should probably mirror lib.setAttrByPath like this)

I feel like the last one is maybe the best

Hm, is this doing something that mergePatch can’t? I’ve got an implementation of that here: https://code.tvl.fyi/tree/nix/mergePatch/default.nix?id=4b5271e69851dcbf42794c3a1056a57b80a89041#n1
The advantages about mergePatch are that there is an RFC for it, so I’d expect it to be proven useful in practice.

From what I see updateManyAttrPaths can apply arbitrary update functions, while mergePatch only overrides/removes attrs, so it’s slightly more powerful.
In less serious terms, I had started to implement lenses in nix, which are a full superset of this :)
https://code.tvl.fyi/tree/users/Profpatsch/lens.nix?id=4b5271e69851dcbf42794c3a1056a57b80a89041#n106
But I’m not opposed to merging.

RFC

IETF RFC 7396. Interesting.

so I’d expect it to be proven useful in practice.

I'm a teapot ;)
But yeah, there's a non-zero chance a Nix user may encounter it somewhere.
Both algorithms are useful.
In my experience working with functions like these, you want to use the least powerful function that satisfies your requirements, as it is generally the simplest and fastest. The latter is relevant for lib code like the module system.
So I'm also in favor of having both.

https://code.tvl.fyi/tree/users/Profpatsch/lens.nix?id=4b5271e69851dcbf42794c3a1056a57b80a89041#n106

Profpatsch patching profunctors? :D quite a mouthful

@Profpatsch Your mergePatch looks nice. There are some small differences I want to point out:

mergePatch can't set fields to null, since it uses null to mean removal of an attribute
Since mergePatch isn't based on modification functions, it's easy for information to be accidentally overridden
mergePatch can only do static changes. It can't e.g. rename an attribute unless you access the previous value directly (outside of mergePatch)
Accessing nested old attribute values outside of mergePatch is a bit inefficient, since you need to go through the attribute path again, e.g. the following needs to access old.a.b.c many times:let old = {
  a.b.c.x = 0;
  a.b.c.y = 1;
  a.b.c.z = 2;
}; in mergePatch old {
  a.b.c.x = old.a.b.c.x + 1;
  a.b.c.y = old.a.b.c.y + 1;
  a.b.c.z = old.a.b.c.z + 1;
}

mergePatch is hard to use for dynamic updates, where the attribute paths to update are only determined through some processing. That is because the patch input to mergePatch is a nested attribute set, which is hard to process, since there's no way to indicate when the attribute path nesting ends and the data to process starts. This relates to mapAttrsRecursiveCond, which I think is pretty hard to understand and use properly

Major advantage to mergePatch is that it is much simpler to use for static updates (where it should also be faster), and that it has a proper specification backing it. So I think it would probably also be worthwhile to have it in nixpkgs, but I also think that it can't replace the function from this PR fully.

Yeah, especially the arbitrary functions for updates part is very nice to have. I’d say let’s merge this!

@roberth @Profpatsch Nice! The only thing to discuss is the naming, see https://github.com/NixOS/nixpkgs/pull/147077#issuecomment-1057356279 I'm yet undecided

In addition to addressing your review, I also made my own decision on the naming: updateManyAttrsByPath. This closely resembles the last option updateAttrsByPaths from my suggestions in https://github.com/NixOS/nixpkgs/pull/147077#issuecomment-1057356279, but I chose to keep the Many in there in order to distinguish it from a potential updateAttrByPath (which would be too close to updateAttrsByPath.