Expose non-replacing insert

By calling put with no_replacement = true, we can provide a version of insert that does not update the value if the key is already present. I can imagine that being a relatively useful method to provide. I'm not sure what to call it though? std::collections::HashMap does not have an equivalent, so we're on our own here.

noreplace comes to mind but that's too cheesy
Perhaps insertifnull

A lot of the APIs which deal with concurrency use try_ for methods that depend on state shared between multiple threads. For example, a lot of the locks have a try_lock() method which returns false if the lock is already held by another thread. Such methods can also be found in places where an operation might not succeed, such as try_from for fallible conversions.
As I assume we have a similar use case for the proposed method (i.e. inserting if no value for the given key is currently stored by a different thread) and it is definitely a case of an operation that might not happen depending on the state of the map, I suggest following this naming scheme and calling the method try_insert.

Oh, wow, yes, try_insert is a great name!

try_insert feels weird compared to the other APIs. For example, we do a try_lock() and it fails, the lock wasn't acquired. Now do a try_insert(), the insert failed but the data is there anyway.
It feels the wrong name to call based on what I usually expect from try, something that can fail. If the data is already there, is it a failure?

The proposal only mentions checking if an entry already exists for the given key. The map may still contain a value different from what you try to insert, so in this case you "failed" to store your provided value in the map. So while there might be data in the map after a such a failed try_insert, it is not generally the data you wanted it to contain. That's how I think of this at least.
We can also discuss whether we should check the already stored value against the given value and what to return in case they match.

Hmmm you are right it makes a lot of sense to use try_insert from considering something else can be there.
Checking the value may have a high cost, but could be necessary to decide what to return.

I don't think we should check for equality of the value.
One alternative is to rename the current insert to upsert, which is a short-form often used for "update or insert", and then call this method insert. But that's probably more confusing, since we then would not match the std API.

I agree that checking for the value is unnecessary. I do think however that this method should return not only information about whether the insert succeeded, but also the previous value in case of failure (which is returned by put anyway). That way, the caller can check himself whether the value blocking his insert matches his value or not if he requires this.
So we could simply propagate the return of put like insert does (in which case the caller knows he was successful if he reads None as previous value), or we could use something like a Result to indicate success. While the Option contains all relevant information, I personally feel it is confusing to obtain None on success and Some on failure, so I'd lean towards the second alternative.

I agree, returning a Result with the old value in Err seems like a good solution.

std::collections::HashMap does not have an equivalent, so we're on our own here.

I think you would use map.entry(key).or_insert(value).

Sorry, yes, I meant as a free-standing method. The Entry API would be great to support, but we have other issues there sadly.

Then what about insert_if_absent as proposed in https://github.com/jonhoo/flurry/issues/12#issuecomment-581074424?
The implementation could just be map.compute_if_absent(key, || value, guard).

I think the implementation is just
self.put(key, value, true, guard)

We don't currently have compute_if_absent (only compute_if_present), but yes, that would also work.
Between insert_if_absent and try_insert, I'm not sure which one I prefer to be honest. I'd be fine with either I think. I'm not a huge fan of the *_if_absent + *_if_present naming, but it does match ConcurrentHashMap, so :man_shrugging:

@jonhoo I'm working on this right now. What exactly does HashMap::put returns?
I think naming the new method try_insert and returning an Result<V, V> or Result<(), V> would be a better approach. Anyway, I'll go with whatever you guys decide.

I believe Result<&T, &T> would be the better return type. That way map.try_insert(key, val, guard) would return Ok(&val) if map doesn't have an entry for key, and Err(&old_value) otherwise.
However, val is consumed by HashMap::put before the function returns, so return a reference to it would require some extra work. So maybe we should just return a Result<(), &T> (to match std's try_whatever type signature)?

I don't think we want to make HashMap::put return Result, since Err(old_value) would imply that the put did not happen, when that is not the case for put. I do think it makes sense for Result to be the return type of try_insert (if that's what we call it), since there Err() there really does mean that the operation didn't do anything. May be worth adding a new (internal-only) enum to provide a more fine-grained return type for HashMap::put — that way we could also have a NotReplaced(T) variant to use when no_replacement = true, which gives back the T.
I'm not entirely sure what the return semantics of HashMap::try_insert should be. My instinct is that the Ok type should be (), and that the Err type should be T; the value that was not inserted. Returning &T with the current value (which caused the try_insert to fail) also makes sense to me though. Perhaps what we really want is
struct TryInsertError {
    current: &T,
    new: T,
}

The names here are inspired by crossbeam_epoch::CompareAndSetError.

This seems to be covered now with #74. Closing the issue.


avoid failure when using tox/sqlite

Current coverage is 79.43% (diff: 100%)

Merging #972 into master will not change coverage

@@             master       #972   diff @@
==========================================
  Files           141        141
  Lines          7264       7264
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
  Hits           5770       5770
  Misses         1494       1494
  Partials          0          0

Powered by Codecov. Last update 37f784c...e9940dc

I fixed this issue: https://github.com/tonioo/modoboa/pull/973.


Add success callback

From private conversation with @hallgren

Suggestion: https://github.com/gustafnk/h-include/pull/9
What do you think @hallgren?

To clarify, the way to set the onSuccess callback is done in JS, like:
var onSuccess = function(){
  // ...
}

var element = document.getElementsByTagName('h-include')[0];
element.onSuccess = onSuccess;

To give some context to this issue. :)
I have played around with virtual doms and created a small library that takes a HTML string and updates a DOM element via a virtual dom. => https://github.com/hallgren/krumelur
The thing I would like to do is replace the element.innerHTML = req.responseText with a custom update function.
if (req.status === 200 || req.status === 304) {
  if (element.customUpdate) {
    element.customUpdate(req.responseText);
  }
  else {
    element.innerHTML = req.responseText;
  }
  element.onSuccess && element.onSuccess();

This was just a thought and I´m not sure its in the scope of h-include.

@hallgren Ah, now I get it. Let me think about it.

@gustafnk I created a PR #10 to have something to elaborate upon.

@hallgren 👍

I needed the onSuccess callback anyway and I created the issue for that. The solution is merged to master, so closing this issue.


⚠ Carbubu has degraded performance

In 2587994, Carbubu (https://carbubu.fr) experienced degraded performance:

HTTP code: 200
Response time: 5005 ms

Resolved: Carbubu performance has improved in 994d3e7 after 6 minutes.


Latest code generates following linker errors in my project

I pulled the latest DMF code and now I am getting the following linker errors in my driver project...
1>user_code.obj : error LNK2019: unresolved external symbol _invalid_parameter_noinfo referenced in function memcpy_s
1>user_code.obj : error LNK2019: unresolved external symbol _errno referenced in function memcpy_s
1>DmfK.lib(DmfUtility.obj) : error LNK2019: unresolved external symbol __stdio_common_vswprintf referenced in function _vsnwprintf_l
1>DmfK.lib(DmfCore.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf referenced in function _vsnprintf_l
1>DmfK.lib(Dmf_CrashDump.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf_s referenced in function _vsprintf_s_l

Hi
What version of the compiler are you using?
Are you using EWDK?
Let me investigate this and get back to you later today.
On Wed, Jun 9, 2021, 7:52 AM alkovacs @.***> wrote:

I pulled the latest DMF code and now I am getting the following linker
errors in my driver project...
1>user_code.obj : error LNK2019: unresolved external symbol
_invalid_parameter_noinfo referenced in function memcpy_s
1>user_code.obj : error LNK2019: unresolved external symbol _errno
referenced in function memcpy_s
1>DmfK.lib(DmfUtility.obj) : error LNK2019: unresolved external symbol
__stdio_common_vswprintf referenced in function _vsnwprintf_l
1>DmfK.lib(DmfCore.obj) : error LNK2019: unresolved external symbol
__stdio_common_vsprintf referenced in function _vsnprintf_l
1>DmfK.lib(Dmf_CrashDump.obj) : error LNK2019: unresolved external symbol
__stdio_common_vsprintf_s referenced in function _vsprintf_s_l
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/DMF/issues/166, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHY5IWW5S3DJYFNW2GLTADLTR55ZNANCNFSM46MGOP4Q
.

Microsoft Visual Studio Professional 2019
Version 16.10.0
VisualStudio.16.Release/16.10.0+31321.278
Microsoft .NET Framework
Version 4.8.04084
Installed Version: Professional
Visual C++ 2019   00435-60000-00000-AA343
Microsoft Visual C++ 2019
ASP.NET and Web Tools 2019   16.10.525.31942
ASP.NET and Web Tools 2019
Cookiecutter   16.10.21111.19
Provides tools for finding, instantiating and customizing templates in cookiecutter format.
Debugging Tools for Windows   10.0.20324.1000
Integrates the Windows Debugger functionality (http://go.microsoft.com/fwlink/?linkid=223405) in Visual Studio.
IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info
Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards
Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package
NuGet Package Manager   5.10.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.
Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.
Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake
Windows Driver Kit   10.0.20324.1000
Headers, libraries, and tools needed to develop, debug, and test Windows drivers (msdn.microsoft.com/en-us/windows/hardware/gg487428.aspx)

Hi, so...
There have been issues reported with 16.10. The issues I found are different than what you found above. However, it is possible that you have run in to a similar issue.
The issue that I have found has just been fixed yesterday and release was issued here:
https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes
You can see June 8 release for 16.10.1. Can I trouble you to install that version of Visual Studio and see if it corrects your issue?
This is the issue I found that has been corrected:
https://developercommunity.visualstudio.com/t/compiler-regression-in-16100-with-ewdk/1435981?from=email
I have just built all DMF, DmtTest and DmfSamples without any problem.
If you still have a problem, let me know. You can also send me email at<EMAIL_ADDRESS>Thank you for your report and your patience.

So I think I see what's going on, I updated to 2019 V16.0.1 as you suggested, tried the builds (DMF Debug and My Project Debug) again and my project build failed. I was using the 10.0.20344.0 SDK/DDK . Switched that to 10.0.19041.0 SDK/DDK and my project build failed with, not the same but similar errors. Switched to the 10.0.17763.0 SDK/DDK and everything seems to compile/link fine. BUT, I went back to the 10.0.20344.0 SDK/DDK and the 10.0.19041.0 SDK/DDK, in both cases my project build fails. Then upon switching back to the 0.0.17763.0 SDK/DDK , my project build fails again with just 2 errors (linker) like __stdio_common_vsprintf referenced in function _vsnprintf_l .... Seems something is not being cleaned out in the settings ???

Are you using the SDK/DDK or the EWDK? We always use EWDK here.
We open the EWDK command using command line as Administrator. Then, run LaunchBuildEnv.cmd. Then, switch to BuildEnv and run:
setdevenv
setupbuildenv
setupvsenv
Then, we run VisualStudio from that command line...using a shortcut: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe"
I have not used standard SDK/DDK in years. The EWDK has worked very well.
Can you try that?
It looks to me like you are running into some kind of SDK/DDK issue. I think you will be happier with EWDK. One nice thing about it is that you can easily have multiple versions of EWDK installed and then you can start VS in any version you want.

Right, there is only a single SDK/DDK in the EWDK. That is why it works so
well.
But there are multiple EWDK packages. You just open the command line in the
directory where the package resides (it can be mounted as CD if you want).
I am not sure if the older EWDK packages are still available.  Let me look
and get back to you.
On Thu, Jun 10, 2021, 12:09 PM alkovacs @.***> wrote:

So after installing the EWDK and following the instructions at the
installation link, using VS 2019 16.0.1 , we were able to build the DMF
(Debug) and our Project (Debug) in SDK/DDK version 10.0.19041.0 which is
what was in the
Download the EWDK for Windows 10, version 2004 http://url . Funny now
my post driver build analysis tool no longer runs. So there is ONLY 1
SDK/WDK version available in an EWDK? I did see ddk's for win 7 and 8 , but
none of the newer ones, other than 10.0.19041.0. Is it possible to have
multiple under on EWDK install?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/DMF/issues/166#issuecomment-858930578, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AHY5IWQBNTQN6FK422BYNDDTSEEVTANCNFSM46MGOP4Q
.

Some other information about EWDK:
https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/using-the-enterprise-wdk

Sam, thank you for all of your help in what turned out NOT to be an issue specifically with the DMF, but an environment issue...

Thank you for your patience and for reporting the issue.

Just to add here, I was facing same issue in my driver project. Without making any changes to the SDK and WDK, downgrading from 16.10.1 VS'19 to 16.9.6 helped solve the issue and build was successful.

Hi, soubhikSM,
Do you mean you downgraded from 16.10.1 to 16.9.6? Or from 16.10.0.
16.10.1 is what corrects some known issues (ones I reported), but I am not sure if other issues exist.

Hey samtertzakian , yes I downgraded from 16.10.1 to 16.9.6.
I and a couple of my other teammates faced this same issue with 16.10.1.
.obj : error LNK2019: unresolved external symbol _invalid_parameter_noinfo referenced in function memcpy_s
.obj : error LNK2019: unresolved external symbol _errno referenced in function memcpy_s
.obj : error LNK2019: unresolved external symbol __stdio_common_vsnwprintf_s referenced in function _vsnwprintf_s_l
.obj : error LNK2019: unresolved external symbol __stdio_common_vswprintf referenced in function _vsnwprintf_l
E:<path>\driver\x64\Debug<filename>.sys : fatal error LNK1120: 4 unresolved externals
Done building project ".driver.vcxproj" -- FAILED.
I went through the comments here and finally after having tried lot of other stuff, installing enterprise version 16.9.6 resolved the issue. I did not need to install EWDK.

Hi, soubhikSM,
I left feedback to Visual Studio via the link in upper right corner.
That is how I was able to get a fix for 16.10.0 to 16.10.1 (which corrected the issue in EWDK building).
Apparently, there are other issues.
I will just send them the actual errors and see what they say.
Sorry, there is not much else I can do directly.

Hi
I have just been informed that a fix for these above linker errors is in the Visual Studio Release pipeline. I don't know when it will be released or in which version.
But for now, apparently the work-around is:
Clear the "External Include Directories" field in the project settings.
Or, just use 16.9.x until then.

Thanks for the update samtertzakian. :)


Sample code fails: ImportError: cannot import name 'EntityId' from 'tb_rest_client.models.models_ce'

Running pip3 install tb-rest-client, then running the sample applications after adapting the REST API URL and Tenant Administrator credentials gives the following error message:
user@machine:~/thb-demo# /usr/bin/python3 ./thb-demo.py
Traceback (most recent call last):
  File "./thb-demo.py", line 5, in <module>
    from tb_rest_client.rest_client_ce import *
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/rest_client_ce.py", line 17, in <module>
    from tb_rest_client.rest_client_base import *
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/rest_client_base.py", line 24, in <module>
    from tb_rest_client.api.api_ce import *
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/api/api_ce/__init__.py", line 1, in <module>
    from .o_auth_2_config_template_controller_api import OAuth2ConfigTemplateControllerApi
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/api/api_ce/o_auth_2_config_template_controller_api.py", line 20, in <module>
    from tb_rest_client.api_client import ApiClient
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/api_client.py", line 32, in <module>
    import tb_rest_client.models.models_ce
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/models/models_ce/__init__.py", line 3, in <module>
    from .admin_settings_id import AdminSettingsId
  File "/usr/local/lib/python3.7/dist-packages/tb_rest_client/models/models_ce/admin_settings_id.py", line 17, in <module>
    from . import EntityId
ImportError: cannot import name 'EntityId' from 'tb_rest_client.models.models_ce' (/usr/local/lib/python3.7/dist-packages/tb_rest_client/models/models_ce/__init__.py)

The same issue persists regardless of whether tb_rest_client.rest_client_ce or tb_rest_client.rest_client_pe are imported.

Hi @thunfischbrot, this bug was fixed, please update the rest-client via the master branch.

Hi @thunfischbrot ,
We have released the version 1.3.1 with fix for this point, please update your library and try the new version.


Can't delete vechicles

When I try to remove a vehicle by clicking "Remove vehicle," nothing happens and this error appears in the console:
TypeError: Cannot set property 'options' of undefined
at t.modal.open.resolve.modalOptions (scripts.min.0f37340467.js:19)

Oops, this is a duplicate of #143 .


Tooling to help debug cyclic data issues

Problem Statement
Sometimes there may be cyclic data accidentally stored into SpiceDB and right now it's kind of hard to identify where in the data there is a cycle. It's only really realized with calls like lookup-resources as that will do a full traversal and not short circuit like with check permission.
Solution Brainstorm
It may be useful to include in the --explain feature some kind of highlighting if a particular node in the graph was traversed more than once (or however many time it was traversed), so that the user can more quickly identify a cyclic data problem in their DB.

zed --explain does indeed highlight recursions: https://authzed.com/docs/spicedb/modeling/recursion-and-max-depth#what-do-i-do-about-a-max-depth-error-on-checkpermission

@josephschorr, sure, but that doesn't solve the problem statement. If a lookup-resources request results in a cycle, it can be challenging to identify where in the data the cycle is occurring. There is no equivalent of --explain for lookup-resources.


[Important] TestCase 9A9: new reference file and new rule

After comments from several labs, and counseling from our clinical biologists, it was decided to replace the reference file for case 9A9 with a new one.
All current submissions have been re-evaluated, so do not be afraid if this testcase fails again.
Of course, we are always open for comments, and we will discuss your comments with our clinical biologists.

@bdc-ehealth
I think, there is a problem with the new reference file uploaded for test case 9A9. The XML is not well formed, following attribute value is not correctly escaped:

@frederic-istace ,
In the database, it is correct, but the "raw" display is not as "raw" as it should be. I will file an error to correct this, but you can be sure that the value in the database is correct (it contains the entitity there).

@AlexisVZ-MDS
I have corrected the reference file using the UI of the testserver, but the problem is that the UI causes the file to get corrupt over and over again, because it replaces entities while displaying, but it does not replace them while saving. So each time the test definition gets saved, the reference file is corrupt again. ("<" is replaced by "<" on display, but "<" stays "<" while saving...). I signalled this problem in https://github.com/ehealthplatformstandards/TestServerWebApp/issues/11


Linux Fullscreen fails with "Could not find a suitable graphics mode"

This shows up when using piston_window's default window provider, pistoncore-glutin_window, using glutin 0.3.5 (latest release as of now).
A simple reproduction is just adding .fullscreen(true) to line 13 of this example: https://github.com/PistonDevelopers/piston-examples/blob/master/src/paint.rs
(only the window initialization code matters, I link this example only to simplify getting the dependencies and everything set up)

Oh sorry: tested on x64 Ubuntu 14.10. Not sure what details exactly are relevant.

The error is OsError("Could not find a suitable graphics mode")?

Yep!
Happy to do any debugging that might help.

So the exact problem is just the crappy way glutin handle this.
When you specify dimensions (300, 300), glutin tries to find a fullscreen mode with these dimensions. Since it doesn't find any, it returns an error.
It would be better to make the user choose from all possible window modes.

Aha --  so if there was a way to tell piston_window to not try to set dimensions, this would work?
Alternatively, what's the correct way to query glutin for available full-screen modes?
Alternatively, alternatively, it sounds like fixing this shouldn't be too bad (just have glutin ignore the input dimensions?)

The default (and recommended) way to handle this on wayland (and this is what is currently done in the wayland backend), is to create a buffer with the requested size, and let the wayland server and video driver scale it to the appropriate resolution if needed.
Isn't there some similar behaviour possible on X11 ?
Still it could indeed be good to provide an interface to query the supported output dimensions of a given monitor.

I tried using with_fullscreen() and didn't explicitly set any dimensions because the documentation said it would just use the dimensions of the monitor you give it. I got the same error.

Ok, I found the main issue. There's a "workaround" for this issue: https://github.com/Daggerbot/x11-rs/issues/19. as pointed out in that issue, the hskew is supposed to be there, it's just not in any online documentation, for some reason (yay XServer...). The actual vdisplay values are the correct ones, for my machine anyway.
Another issue is that glutin doesn't seem to be XRandR aware, as it is trying to find a mode that is 5760 wide on my machine, which is the total width of my triple-screen setup.

Changing vsyncstart back to vdisplay (b4346f3) also fixed this for me.
I'm using Arch x64 with libx11 1.6.3-1

For some reason glutin::get_available_monitors() only returns a single monitor with the combined size of both monitors. If I explicitly set the width to half of the returned value from mon.get_dimensions(), the code runs, but instead of displaying a full screen app, the contents of my first screen is duplicated to the second. :-S
(I needed to change my layout with XRandR to get back my two displays again.)

But that is not entirely true. Because the mouse is still on just one monitor and if I move the mouse over to that screen, the focus is on the (now invisible) stuff that was on the second screen.

This is no longer relevant after tomaka/winit#270 and various other improvements.


ING Savings - "Bank could not be recognized"

Downloaded CSV file from ING savings account.
After dropping file

CSV file itself:

When opened in Excel no problem. All data is there.
CSV file for regular ING account worked just fine.

Hi,
Could you upload or send me a part of the contents of the file. Please anonymize the contents of the file.
I need this to find out what the problem is.

A17503272_01-04-2022_07-05-2022.csv
Basically there were nu mutations. The amount is the same for every day.
This is a savingsaccount that is attached to my normal ING Account.
Converting the csv file of the normal account went without problems.

Thank you! I will look at this, in the afternoon!

Hi, I have some additional questions:

Is the column "rekening" your IBAN number or the IBAN of the payee?
Are the mutations in your file catagorized as inflow or outflow? What does the opposite transaction look like? (E.G. 4.00 is outflow and +4.00 is inflow)

Once I know how to handle these problems, I can implement the ING Spaarrekening for you.

Hi, It appears that there are multiple csv formats that can be exported and the  above is just one that contains the the balance level. There is another which contains the direction of travel of money and to whom (csv separated by semicolons):
Alle_rekeningen_21-05-2021_21-05-2022.csv


Mocking Thread.current.thread_variable_get causes stack overflow.

Mocking Thread.current.thread_variable_get used to work with rspec-support <= 3.12.0. With rspec-support >= 3.12.1, it causes a stack overflow.
# frozen_string_literal: true

begin
  require "bundler/inline"
rescue LoadError => e
  $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
  raise e
end

gemfile(true) do
  source "https://rubygems.org"

  gem "rspec", "3.12.0"
  ##gem "rspec-support", "3.12.0" # works
  gem "rspec-support", "3.12.1" # raises SystemStackError
end

puts "Ruby version is: #{RUBY_VERSION}"
require 'rspec/autorun'

RSpec.describe do
  it do
    expect(Thread.current).to receive(:thread_variable_get).with(:test).once.and_return(true)
    expect(Thread.current.thread_variable_get(:test)).to eq true
  end
end

Your environment

Ruby version: 3.3.1
rspec-support version: 3.12.1 or 3.13.0 or 3.13.1 or current main branch (42b18c4ae6850244ede747ec348bfe4b04fa8876)

Analysis
There is infinite recursion between the following steps:

Internal RSpec code calls RSpec::Support.thread_local_data.
RSpec::Support.thread_local_data calls Thread.current.thread_variable_get.
Because Thread.current.thread_variable_get is mocked, RSpec code is called. See 1.

Workaround
Add allow(Thread.current).to receive(:thread_variable_get).with(:__rspec).and_call_original.
The intention of the original code was to mock only Thread.current.thread_variable_get(:test) but not Thread.current.thread_variable_get called with any other arguments. However, I could not find a way to do that.
Proposed solution
If some mocked method is called from internal RSpec code, it should do nothing but delegate to the original method.

Apparently caused by https://github.com/rspec/rspec-support/pull/581
Would you like to try a different approach? Maybe stash the original method like we do for mutexes?

Apparently caused by #581

Yes. I had tracked down the issue to 01eb9b2a97f47202daa4947b5dc1c7046065faa0, but I forgot to mention this in the report. Sorry for that!

Would you like to try a different approach? Maybe stash the original method like we do for mutexes?

If I understood correctly, mutexes use a copy of the stdlib code. Because Thread.current.thread_variable_get is implemented in C, I changed the code to save a reference to the original methods. See #606.


SyntaxWarning errors on downstream dependencies

Version
4.15.0
Describe the bug
When importing botbuilder, i get the following errors.
/usr/local/lib/python3.10/site-packages/recognizers_date_time/date_time/utilities.py:552: SyntaxWarning: 'int' object is not subscriptable; perhaps you missed a comma?
bias = 0[0]

/usr/local/lib/python3.10/site-packages/recognizers_number/number/extractors.py:37: SyntaxWarning: "is" with a literal. Did you mean "=="?
if source is None or len(source.strip()) is 0:

To Reproduce
Importing botbuilder core and schema through teams-ai package.
Expected behavior
Normally, I would make an issue with the corresponding package. But it hasn't been committed to in the last year. I expect the SyntaxWarnings to be filtered out or fixed.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.

Sorry to ping, but is there anything we can do here? @tracyboehrer


Prettier now has a --check option

Messages

:book:
:sparkles: Thanks for your contribution to Shields, @paulmelnikow!

  Generated by :no_entry_sign: dangerJS against a1698bcdeb22903280f467f66f200a92c5e11b1e


added 'bought' and 'fiat' to see the worth of your own cryptocurrency

Thank you for the contribution, I like the feature! 👍🏻


add ollama app

ok we might actualy revive this 🔥  see https://github.com/huggingface/huggingface.js/pull/687#issuecomment-2411824724


Adding remotes for dokku

I was trying to add multiple remotes for my app following your instructions:
You can use the global option --remote to run commands on a different server/app from a remote branch. For more details see heroku's guide for multiple environments for an app.
dokku run rails c --remote=staging
dokku config --remote=staging
However the --remote option doesn't work for me.
I also noticed that in the heroku's guide they add remotes like this:
heroku create --remote staging,
but dokku-cli doesn't seem to have this command. Any help?

The --remote global option is currently not working in run, open, logs commands.
https://github.com/SebastianSzturo/dokku-cli/pull/16 fixes this.
You can use remote option in the run command after https://github.com/SebastianSzturo/dokku-cli/pull/16 merged.


Add CIP-0015 metadata parser

Implement CIP15 metadata parser which will separate all five metadata fields as per the relevant CDDL schema.
$voting_pub_key /= bytes .size 32
$staking_pub_key /= bytes .size 32
$ed25519_signature /= bytes .size 64
$reward_address /= bytes
$nonce /= uint

NOTE: See also https://github.com/cardano-foundation/CIPs/pull/188 update proposal

Please beware that was https://github.com/cardano-foundation/CIPs/pull/188 replaced by https://github.com/cardano-foundation/CIPs/pull/200

@pavlix I have moved the changes relevant to this ticket to https://github.com/txpipe/oura/pull/124, if you could prioritize developing this over the https://github.com/txpipe/oura/issues/84 please.


Hello Microverse pull request

Tasks accomplished on this PR

Created a test.md
Added test.md to gitignore
Added node_modules to gitignore
Set up linters
Customizing README.md file
Added index.html
Added style.css
Adding a license to a repository

Tasks accomplished on this Merge PR

Created a test.md
Added test.md to gitignore
Added node_modules to gitignore
Set up linters
Customizing README.md file
Added index.html
Added style.css
Adding a license to a repository


Implement Dynamic Leaderboards

Develop a leaderboard system that dynamically updates to reflect user scores and rankings based on their interactions and outcomes.

[x] API for Retrieving Leaderboard Data:

[x] Frontend Implementation:

[x] Design a leaderboard page that displays user ranks, scores, and usernames.
[x] Implement asynchronous data fetching to keep the leaderboard updated in real-time.

Basic functions done, need to update

Dynamic Leaderboards completed, works well to catch and show all the data. Also linked to the user page


rtfm framework periodic.rs does not work anymore

Something has regressed on periodic.rs example, it does not print the expected output anymore.

Additionally, on latest cortex-rtic, the example does not compile anymore..

With the recent RTIC b87fca3d21d92018ac4d50b200cf8e77cb577028 version the "foo" is printed 4 times, but the timing interval was not 1 second. This is because the example has been tuned to 12MHz speed on QEMU and zmu does not have timing control as of now


DNS validation is failing unexpectedly

Hello,
I am trying to use script-based DNS validation. Here is the command that I issue:
C:\letsencrypt\wacs.exe --test --notaskscheduler --verbose --target manual --host logs.hourstrackercloud.com --emailaddress<EMAIL_ADDRESS>--accepttos --csr rsa --certificatestore --installation script --script "C:\src\hourstrackercloud\SSL\seq\install-certificate.ps1" --scriptparameters "'{CertCommonName}' '{CertThumbprint}'" --validationmode dns-01 --validation dnsscript --dnscreatescript "C:\src\hourstrackercloud\SSL\seq\dns-create.ps1"
And here is the corresponding verbose log output:
 [INFO] A simple Windows ACMEv2 client (WACS)
 [INFO] Software version <IP_ADDRESS> (RELEASE)
 [INFO] IIS version 10.0
 [INFO] Please report issues at https://github.com/PKISharp/win-acme

 [VERB] Verbose mode logging enabled
 [VERB] Arguments: --test --notaskscheduler --verbose --target manual --host logs.hourstrackercloud.com --emailaddress<EMAIL_ADDRESS>--accepttos --csr rsa --certificatestore --installation script --script C:\src\hourstrackercloud\SSL\seq\install-certificate.ps1 --scriptparameters '{CertCommonName}' '{CertThumbprint}' --validationmode dns-01 --validation dnsscript --dnscreatescript C:\src\hourstrackercloud\SSL\seq\dns-create.ps1
 [DBUG] Config folder: C:\ProgramData\win-acme\acme-staging-v02.api.letsencrypt.org
 [DBUG] Certificate cache: C:\ProgramData\win-acme\acme-staging-v02.api.letsencrypt.org\Certificates
 [VERB] Settings SettingsService {ConfigPath="C:\\ProgramData\\win-acme\\acme-staging-v02.api.letsencrypt.org", CertificatePath="C:\\ProgramData\\win-acme\\acme-staging-v02.api.letsencrypt.org\\Certificates", ClientNames=["win-acme", "win-acme"], RenewalDays=55, HostsPerPage=50, ScheduledTaskRandomDelay=00:00:00, ScheduledTaskStartBoundary=09:00:00, ScheduledTaskExecutionTimeLimit=02:00:00}
 [VERB] Sending e-mails False
 [DBUG] Renewal period: 55 days
 [INFO] Running in mode: Unattended, Test
 [INFO] Target generated using plugin Manual: logs.hourstrackercloud.com
 [VERB] Checking [Manual] logs.hourstrackercloud.com
 [WARN] Proxying via <IP_ADDRESS>:8888
 [DBUG] Loading signer from C:\ProgramData\win-acme\acme-staging-v02.api.letsencrypt.org\Signer_v2
 [DBUG] Send GET request to https://acme-staging-v02.api.letsencrypt.org/directory
 [DBUG] Send HEAD request to https://acme-staging-v02.api.letsencrypt.org/acme/new-nonce
 [DBUG] Loading account information from C:\ProgramData\win-acme\acme-staging-v02.api.letsencrypt.org\Registration_v2
 [DBUG] Send POST request to https://acme-staging-v02.api.letsencrypt.org/acme/new-order
 [DBUG] Send GET request to https://acme-staging-v02.api.letsencrypt.org/acme/authz/BqFo-gtmeRyjrfNeObk72BGN8Yalp5kezNdiIEaBQoQ
 [INFO] Authorize identifier: logs.hourstrackercloud.com
 [INFO] Authorizing logs.hourstrackercloud.com using dns-01 validation (DnsScript)
 [INFO] Script C:\src\hourstrackercloud\SSL\seq\dns-create.ps1 starting with parameters create logs.hourstrackercloud.com _acme-challenge.logs.hourstrackercloud.com J3ihmuFt8tTXzEdiCZ8Mh2LJENXpFXV9WPaF1ohPwP0
 [INFO] Answer should now be available at _acme-challenge.logs.hourstrackercloud.com
 [WARN] Preliminary validation failed, found (null) instead of J3ihmuFt8tTXzEdiCZ8Mh2LJENXpFXV9WPaF1ohPwP0
 [DBUG] Submitting challenge answer
 [DBUG] Send POST request to https://acme-staging-v02.api.letsencrypt.org/acme/challenge/BqFo-gtmeRyjrfNeObk72BGN8Yalp5kezNdiIEaBQoQ/260185519
 [DBUG] Refreshing authorization
 [DBUG] Send GET request to https://acme-staging-v02.api.letsencrypt.org/acme/challenge/BqFo-gtmeRyjrfNeObk72BGN8Yalp5kezNdiIEaBQoQ/260185519
 [EROR] {
  "type": "urn:ietf:params:acme:error:unauthorized",
  "detail": "Incorrect TXT record \"vLPQ4mKwNozS3_nuEzZU1HPnmS6AVAdZtUBFGcBtibg\" found at _acme-challenge.logs.hourstrackercloud.com",
  "status": 403
}
 [EROR] Authorization result: invalid
 [WARN] No delete script configured, validation record remains
 [EROR] Create certificate failed: Authorization failed

 [--test] Quit? (y*/n)

The first issue that I have is that 100% of the time, I always get failure on the preliminary validation:
[WARN] Preliminary validation failed, found (null) instead of J3ihmuFt8tTXzEdiCZ8Mh2LJENXpFXV9WPaF1ohPwP0
Despite changing the DNS server in the configuration file to the authoritative name server for my domain, the code never sees a value there. IMO, changing the DNS shouldn't even be necessary. I believe the code should simply determine the correct name server to use itself and the configuration setting should strictly used as an override.
Here are the nslookup commands that demonstrate that the DNS TXT record was actually successfully created:
C:\>nslookup -q=soa hourstrackercloud.com
Server:  rdns.dynect.net
Address:  <IP_ADDRESS>

Non-authoritative answer:
hourstrackercloud.com
        primary name server = ns71.domaincontrol.com
        responsible mail addr = dns.jomax.net
        serial  =<PHONE_NUMBER>
        refresh = 28800 (8 hours)
        retry   = 7200 (2 hours)
        expire  = 604800 (7 days)
        default TTL = 3600 (1 hour)

hourstrackercloud.com   nameserver = ns72.domaincontrol.com
hourstrackercloud.com   nameserver = ns71.domaincontrol.com

C:\>nslookup -q=txt _acme-challenge.logs.hourstrackercloud.COM ns71.domaincontrol.com
Server:  UnKnown
Address:  <IP_ADDRESS>

_acme-challenge.logs.hourstrackercloud.COM      text =

        "J3ihmuFt8tTXzEdiCZ8Mh2LJENXpFXV9WPaF1ohPwP0"
hourstrackercloud.COM   nameserver = ns71.domaincontrol.COM
hourstrackercloud.COM   nameserver = ns72.domaincontrol.COM

C:\>

The second issue I have is that the actual Let's Encrypt validation always pulls the previous value. I'm not sure why because according to several posts I found (here and here with a reference to the actual code here), Let's Encrypt should be pulling the record from a randomly chosen authoritative name server and should not care if there is more than one TXT record provided that a.) the latest value is in the list and b.) that the list doesn't exceed 512 bytes.
I realize the second issue appears not to be an issue with your tool but the first does. I would appreciate any guidance you can provide.
P.S. I pulled down the code and was unable to compile it to debug it myself. One thing that I think would be super helpful is to enable configuring logging to Seq as an option since you are using Serilog. It would be awesome to getter better, more searchable logging than what the Event Viewer displays.

I think both of the problems come down to the same issue: the DNS updates that your script does do not propagate fast enough. I suspect that if you would add some waiting time into the script, e.g. 1 or 2 minutes, it would allow the name servers to synchronize and thus the records to become publically visible.
It's a good idea to query the name servers directly to help users figure out when this is necessary.
I'd have to look into Seq because I never heard of it, but in any case you can add extra sinks to Serilog by adding a .dll file from Nuget into the program folder and adding it to wacs.exe.config. There is an issue open here somewhere that has an example.

Thanks for your response. I did put in a 5 second delay which sufficiently covered the nslookup calls getting the right result. Of course I can bump that to 1 or 2 minutes. But I'm not sure that will specifically help because unlike the actual Let's Encrpyt verification call, the preliminary verification call never returns a logical result (current or current-1). In fact, I'm not sure where it gets it's information from because as I mentioned, even when I explicitly configure the DNS server to point to the IP of ns71.domaincontrol.com, it never ever yields a value (even an incorrect one). It always returns null.
I'd be happy to debug it and see why but, as I mentioned, I couldn't get the solution to build straight from source. Do you have instructions for building successfully? Should I open a new issue to specifically address this topic?
Regarding Seq, it is written by @nblumhardt, the very same author of Serilog. You should check it out, it's awesome. Thanks for the tip on loading additional sinks, I'll poke around for the issue.

In fact, I'm not sure where it gets it's information from because as I mentioned, even when I explicitly configure the DNS server to point to the IP of ns71.domaincontrol.com, it never ever yields a value (even an incorrect one). It always returns null.

It might be a bug in the library that we're using then. I've tried several ones and this seemed to be the best, but it had issues querying from <IP_ADDRESS> (which already indicates that it's not that great), so I've set an OpenDNS server as the default. Anyway - don't take the preliminary validation too seriously, it's just an informative message that doesn't influence the certificate order process in any way. For more serious checking you might want to try this service: https://unboundtest.com/

I'd be happy to debug it and see why but, as I mentioned, I couldn't get the solution to build straight from source. Do you have instructions for building successfully? Should I open a new issue to specifically address this topic?

I think that's a good idea, you can post there which problem(s) you're running into and I can help to figure out why it's not building.
This is the Serilog issue by the way: #901

Predominantly fixed in https://github.com/PKISharp/win-acme/pull/1054.
I will close this issue pending adoption of https://github.com/PKISharp/win-acme/pull/1058.

@WouterTinus How do you feel about making the code async? I'm not sure how large of an undertaking it would be to convert the entire app but the DNS client work that I'm doing could stand to benefit from utilizing the async APIs. The challenge here is that async spreads like a virus.

E.g.:
        private async Task<IEnumerable<IPAddress>> GetIpAddressesAsync(string rootDomain)
        {
            _log.Debug("Querying name servers for {Domain}", rootDomain);
            var nsResponse = await Default.QueryAsync(rootDomain, QueryType.NS);

            var getNameServerIpTasks = nsResponse.Answers.NsRecords().Select(async nsRecord =>
            {
                var aResponse = await Default.QueryAsync(nsRecord.NSDName, QueryType.A);
                return aResponse.Answers.ARecords().FirstOrDefault()?.Address;
            });

            return await Task.WhenAll(getNameServerIpTasks);
        }

vs.
        private IEnumerable<IPAddress> GetIpAddresses(string rootDomain)
        {
            _log.Debug("Querying name servers for {Domain}", rootDomain);
            var nsResponse = Default.Query(rootDomain, QueryType.NS);

            foreach (var nsRecord in nsResponse.Answers.NsRecords())
            {
                var aResponse = Default.Query(nsRecord.NSDName, QueryType.A);
                yield return aResponse.Answers.ARecords().FirstOrDefault()?.Address;
            }
        }

@WouterTinus How do you feel about making the code async? I'm not sure how large of an undertaking it would be to convert the entire app but the DNS client work that I'm doing could stand to benefit from utilizing the async APIs. The challenge here is that async spreads like a virus.

Good question! My feeling is that in some cases the code could be more elegant with async (the AcmeSharpCore is also an async API that we wrap around in a rather ugly way), but to get any end-user benefit (e.g. the runtime advantage of handling multiple certificate orders and/or validation challenges in parallel) there would have to be some fine-grained locking around certain services, risking whole new classes of potential bugs. I considered it for the 2.0 refactor and decided against it, but I'm not saying it should/will never happen.

Ok, I figured that might be the case. I'll avoid it for now. Running multiple DNS queries synchronously and serially is probably ok for a single renewal scenarios but if multiple renewals are run, this thing will be unnecessarily slow.

I'm going to close this issue now that https://github.com/PKISharp/win-acme/pull/1058 has been merged. Thanks!


Add Streamlit UI for uploading Video and showing images (SIMPLE POC)

Even though the backend processing is already finished with the State Machine, the goal of this ticket is to enable a simple UI to show/illustrate a Frontend to upload the video, and also show the specific scenes with detected faces (similar to the Amazon Prime Video X-Ray functionality)... Of course, in a SIMPLE way.

Feature added by these commits:

05fa26ea97e4f3d62cfdf0d23e05265ba130ba70


Improved docstring for block bc assignment functions

@PipKat I applied your suggestions from https://github.com/ansys/pyaedt/pull/3018
The only one I did not applied was the one regarding the introduction of a link to the Icepak documentation. I'm currently thinking of introducing one or more function that may help an unfamiliar user to build those dictionaries. In this way we can also shorten those explanations which are repeated on several functions (and will be repeated on others) and can potentially become annoying to maintain.

@PipKat I applied your suggestions from #3018
The only one I did not applied was the one regarding the introduction of a link to the Icepak documentation. I'm currently thinking of introducing one or more function that may help an unfamiliar user to build those dictionaries. In this way we can also shorten those explanations which are repeated on several functions (and will be repeated on others) and can potentially become annoying to maintain.

I'm all for avoiding maintenace. Let me know if I can help. We could consider putting the information in one place (in the user guide), and the linking to it where needed in the API doc. This way, the content would only need to be maintained in one place (but links would have to be placed in several places).


Choose your grid page: Cannot read properties of undefined (reading 'split')

This error shows up in the console on the "choose your grid" page, and then clicking on any grid type does not go to the grid – until you reload, because the URL is rewritten correctly.

Can no longer reproduce - will reopen if I see it again.

I saw this on both MacOS Chrome and iOS Firefox when I pushed to main for https://penrosepipes.vercel.app but it disappeared after a little while.
I think it is a caching issue. Evidence: have not seen it on a browser where I was not likely to have old code in the cache.


chore(nexus): update to go 1.21

Description
Go 1.21 includes log/slog in standard library, lets update.
Once you merge this, you will want to:
# update your go install
brew upgrade go
# update your precommit tools
./wandb/nexus/scripts/code-checks.sh install

🤖 Generated by Copilot at dff479e
This pull request updates the Go version to 1.21 for the CircleCI jobs and replaces the golang.org/x/exp/slog package with a customized fork of log/slog for structured logging across the nexus module. This improves the compatibility, customization, and performance of the logging functionality in the nexus module.
Testing
Automated testing

🤖 Generated by Copilot at dff479e

We're breaking free from the slog of the past
We're forging our own log with a custom blast
We're updating our code to the latest version
We're the nexus of metal, we're the log revolution

hmm, there are real errors in pre-commit


fix typo in readme

Fixing small typo in readme.

correct similar typo in https://github.com/santhosh-tekuri/jsonschema/blob/master/doc.go#L39

Codecov Report

Merging #41 (10c444e) into master (396eddf) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #41   +/-   ##
=======================================
  Coverage   91.08%   91.08%
=======================================
  Files          10       10
  Lines        3075     3075
=======================================
  Hits         2801     2801
  Misses        214      214
  Partials       60       60

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 396eddf...10c444e. Read the comment docs.

correct similar typo in https://github.com/santhosh-tekuri/jsonschema/blob/master/doc.go#L39

Changed as well.


"Value too great for base" when upgrading AUR packages

When trying to upgrade my packages (via pacaur Syu), I get the following output:
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: Starting full system upgrade...
 there is nothing to do
:: Starting AUR upgrade...
:: resolving dependencies...
:: looking for inter-conflicts...
/usr/bin/pacaur: line 707: sumk + 0936: value too great for base (error token is "0936")

I haven't booted this system for at least a week or so, so I imagine there could be a fairly large number of AUR packages that need to be upgraded, but I've never had any issue when trying to upgrade my AUR packages after longer periods of time than that, so I'm not sure if there could be any issue related to that.
The output of bash -x pacaur -Syu is here. It's quite long, so I apologize in advance if this isn't usually the case.
Any suggestions about what I can do to fix this? I'm hoping that it's just something on my end, although I don't recall having changed anything since the last time I upgraded my AUR packages.

The error happens when adding repo packages size, to display the total download or install size on the main prompt. It seems very small values keep the initial '0', and as such '08..' and '09..' are computed as octal values. Which of course are non existing numbers in base 8.
I don't know why this happens on your system. Do you see any value that start with 0 with the following command: expac -S '%k\t\t%n? If yes, what is the name of the package on the corresponding package?

No response, closing as 'invalid'. I assume the issue is on your side.


Optimise memory when running imagetracerjs

Hi guys, I'm running imagetracerjs on a cloud function it works well for simple bitmap images. Thanks for the awesome library you wrote. However, it requires more memory for complex ones and needed to allocate a lot of memory for this, more than normal. Just wondering if there's any existing solution for this. Thanks.
var ImageTracer = require('imagetracerjs' );
var PNGReader = require( 'pngjs' ).PNG.sync.read;
var base64Image = 'data:image/png...'

var png = PNGReader(
    Buffer.from(base64Image.replace(/&#x2F/g, '/').slice("data:image/png;base64,".length), "base64")
);

var myImageData = { width:png.width, height:png.height, data:png.data };
var svgString = ImageTracer.imagedataToSVG( myImageData, options );

app.json({
    'svg': svgString
})

Hi,
This is a valid, but a bit ambiguous question.
ImageTracer is not optimized for memory usage, and could be improved. The reason for this was partly to keep things simple. For example, some functions might keep unnecessary references to objects, which could be garbage collected. Garbage collection and automatic memory management might also be different between JavaScript engines.
Can you give me more details? Which function uses too much memory (e. g. Firefox -> F12 -> Memory ) ? What is your input image?

Wait, it's not an issue anymore. I can successfully use this with Firebase cloud function. It runs smoothly now after allocating the memory to 8GB. Thanks for getting back.

Great! :)


License

Hi, I want to start using heatmap.js for commercial project.
The project is redistributed and it's not public ( internal network access only or public access but with authorization&authentication).
As a confirmation: In this case, I can use heatmap.js framework for free or I have to pay "299$-349$ For Companies & Commercial Products" ?
Cheers!

License is MIT: https://github.com/pa7/heatmap.js/blob/master/LICENSE

to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software

So it should be no problem to use the project commercially... I think.


switching from active record to mongoid causing errors

My system is partly done with ActiveRecord and partly done with Mongoid. Initially it was all activerecord and I configured public activity to work with active record. However, now I decided I only want public activity to work with mongoid. So now I go through the mongoid setup and when I add the following in my initializer:
PublicActivity.configure do |config|
config.orm = :mongoid
end
And I try to run rails, I get the following error:
/core/config/initializers/public_activity.rb:1:in <top (required)>': undefined method configure' for PublicActivity:Module (NoMethodError)
Do I need to do something to remove the relationship between public activity and active record?

I think we've changed that to PublicActivity.config.orm = :mongoid, can you try that?

That gives me the following error: /config/initializers/public_activity.rb:1:in <top (required)>': undefined method orm=' for #PublicActivity::Config:0x007f957d9c1070 (NoMethodError)

What version are you using?

@farnoy public_activity (1.4.2)

Try
PublicActivity.configure do |config|
  orm :mongoid
end

@farnoy can public activity work with both mongoid and activerecord simultaneously or is that not supported? Reason I ask is because when I looked online I came across this: https://github.com/pokonski/public_activity/issues/162. Note someone says "it is not possible".

You can probably make it work when you're using one ORM for typical stuff and a second ORM for public activity. However, you can't have associations between ORMs, so for example: you can't track AR models if you're using mongomapper/mongoid for activities.

Right now I decided just to use it with ActiveRecord and not Mongoid, but this issue should be moved to a feature, since it is currently not supported.

If not resolved, I worked out the following:
PublicActivity.config.orm :mongoid


Upgrade to marko v4

We started our switch to marko v4 at work and a change needed to be made to this module to get things working properly.

To be honest, I don't think marko should be bundled into this module. I'm think that some simple, naive templating should be built in as a core part of the module and other templating implementations, such as marko or mustache, should be something that could be added as a plugin. Maybe that's something that can be considered in the future if there are still plans for this module to be maintained.

Published<EMAIL_ADDRESS>


[WIP] Update documentation

The docs could use some updating, and I've started by working on the asynchronous rendering documentation.
I'd like to treat this particular PR as a WIP until #79, #80, and #81 land, so I can try to incorporate some of those changes into the improved documentation.

thanks for your help here! Greatly appreciated!

I think this is out of date. Feel free to reopen a new PR with updated docs


Segues from ColorMatchTabsViewController produces Exception

Report a bug
What did you do?
called self.performSegue(withIdentifier: "addItem", sender: self)  in the protocol method func popoverViewController(_ popoverViewController: PopoverViewController, didSelectItemAt index: Int) PopoverViewControllerDelegate function.
Or initiating a segue by tapping a button on the navigation bar of a ColorMatchTabsViewController
What did you expect to happen?
Segue to another view controller
What happened instead?
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'`
Your Environment

Version of the component: 2.0.1
Swift version: 3
iOS version: 10
Device: All
Xcode version: 8.2.1

Project that demonstrates the bug
Sample project reproduces the bug by adding either a button to the nav bar with a segue, or initiating one

Same problem here.

Same problem too.
I spend a few hours to locate this bug.
It was caused by the overrided method
open override func loadView() { view = MenuView()     } in ColorMatchTabsViewController.
You should add super.loadView() before add your own code like this:
open override func loadView() {         super.loadView()         view = MenuView()     }
After that, everything is ok!


[Bug] Hide Advance ports should still show a port if it's connected

This behavior is unexpected. In this case the promptTemplate feeds into the Task, but when the "Hide advanced ports" is selected it loses visibility to the connection between the two nodes.
Hide advanced port bug.webm

I'm unable to reproduce this one.

Looking at the filter function it does leave intact any connected, dangling or configured ports in place. Would you be able to send me the board that's misbehaving and I'll see if I can find out what's different?

Fixed


Collection list

Looks pretty close to mockup...as always, there may be some minor css adjustments needed.  reworked the mobile slider so it moves by a single image so in the case that it is an odd number of images that should help prevent any possible bugs.  Did Desktop without slider as it appears that there will be pages to cycle through to see collections rather than needing a slider.  Def ready for review and ready for more issues assuming that any possible needed edits are not too drastic.

@mdrisco4 This one also looks like there are merge conflicts. Just an issue with the styled-components.js file!


Support markdown in control descriptions

Control descriptions in the OpenControl catalogs at https://github.com/opencontrol/standards are in Markdown format. The official schema documentation doesn't prescribe this, but it appears to be a common convention.
ssptool should interpret it as such, the same as it does for control narratives (ref #3).

Other notes: currently opencontrol/mdparser.js uses typographer: true; this is probably not appropriate for this use case.
In particular: typographer option turns (c) into © in itemized lists; there may be other issues as well.
Should stick to strict CommonMark + GFM tables.


update for Django 4

hi
I updated for Django 4, and dropped dependency on django-compat; I also dropped support for Django 1, this way.
Bye
a.

Thanks for this :)


OS Support page

Create a page in confluence listing OSs and any known (platform specific) issues.  The page will eventually be exported to the web site.

See: https://feenkcom.atlassian.net/wiki/spaces/central/pages/553943044/Gt+Platform+Support


InflateException of inflating class android.support.design.widget.FloatingActionButton

I try many times but the error also occur,and I cofirm the cause is use your library...

@Bertkiing can you show your build.gradle file?

Ok,I guess you just want this:

Thanks for your reply!

@Bertkiing I'd like to see the dependencies block from the file in the second screenshot.

I'm so sorry for cannot reply to you in time. This is :

Hope to help you.

The latest version of EasyPermissions is targeting support library versions 25.0.0.  Could you try updating your support libraries to some 25.* version and seeing if that helps?  I suspect it will.

Despite my best effort though, I could not achieve the required---update # all libraries to 25.., you can see that

Recently ,I having too much work  so than I cannot help  you absolutely ,  when I am free I will check the problem again.

@Bertkiing 25.4.0 does not exist.  Try 25.1.0

Cool beans! Thanks a billion.

@samtstern, I believe this issue has been resolved.


Not possible to set --worker_gpu=0 with existing checkpoints for transformer model?

I'm use the following options to use an existing model
--data_dir=./t2t/data
--problems=wmt_ende_tokens_32k
--model=transformer
--hparams_set=transformer_base
--output_dir=./t2t/train/base
That failed with:
Cannot assign a device for operation 'save/ShardedFilename_1': Operation was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/cpu:0 ]. Make sure the device specification refers to a valid device.
	 [[Node: save/ShardedFilename_1 = ShardedFilename[_device="/device:GPU:0"](save/StringJoin, save/ShardedFilename_1/shard, save/num_shards)]]

So I added this option:
--worker_gpu=0
Now it fails with:
  ...
  File ".../venv/lib/python3.5/site-packages/tensor2tensor/utils/expert_utils.py", line 211, in __init__
    assert device_names_or_functions
AssertionError

Is a GPU required for all uses of the transformer Tensor2Tensor model?

It used to work on CPU with --worker_gpu=1 and should do that, so this is a bug, I'm investigating.

Could you try this for now: --worker_gpu=0 --locally_shard_to_cpu as a workaround? Does it work?

Yes, --locally_shard_to_cpu got me past that error message. Haven't tested the resulting SavedModel yet, but this is promising.
Thank you!

This should be corrected in 1.1.7, just --worker_gpu=0 should work. Thanks for pointing it out, and please reopen if you see the problem again!


Fixed android arm64v8

For whatever reason the NDK assembler doesn't like the libvpx neon assembly.
The upstream seems to have moved on pretty significantly.

Thanks!


Variable scope in for loop

Hello,
I'm little bit confused about scope of variables.
The following example is a for each loop that set a variable. This loop is copied/pasted 3 times (only the name of the variable is changed : foo1, foo2, foo3).
It seems that foo1 variable is accessible out of loop scope.
This is odd cause, foo2 and foo3 are not accessible (as expected !).
If I delete the first loop, then this is now the foo2 variable which became accessible out of his loop scope.
Is it a bug ? (I'm using v2.3.0 with pebble-spring-boot-starter)
Here is the sample I used to reproduce the behaviour.
`
{% set fooList = range(1, 1) %}
{% for item in fooList %}
{% set foo1 = 'fooValue' %}
{% endfor %}
Foo1 value : {{ foo1 }}
{% for item in fooList %}
{% set foo2 = 'fooValue2' %}
{% endfor %}
Foo2 value : {{ foo2 }}
{% for item in fooList %}
{% set foo3 = 'fooValue3' %}
{% endfor %}
Foo3 value : {{ foo3 }}
`
Thank you.

From Twig: @see Twig doc

Note that loops are scoped in Twig; therefore a variable declared inside a for loop is not accessible outside the loop itself:

{% for item in list %}
    {% set foo = item %}
{% endfor %}

{# foo is NOT available #}

So this is a bug if confirmed


[Suggestion] Dark mode GUI

As with all mods that change GUI, it looks kind of bad with resource packs.
I believe the "dark mode" that a couple of vanilla style resource packs (e.g. Vanilla Tweaks) use and the GUI changing mods that support one, all use the same grey tones.
It would be nice if you added an option in the Mod Menu for enabling a dark mode that changes the mod's GUI to these same colors. It would be applied to all three GUI windows, the latter two would then have a dark grey border instead of the vanilla white/light grey one, the normal inventory GUI window would just have to be adjusted.
Here's a screenshot of the inventory GUI for reference:

These are the hex codes for the grey tones to save you some time if you decide to do it:
Light grey: 6b6b6b
Medium grey: 535353
Dark grey: 333333

Hi there,
I like this suggestion, it's easy to implement so I'll include it in the next release.
Thanks.

Hi there,
I've made assets for dark mode available here. Since there are many different "dark mode" gui resource packs, I've used the colours specific to Vanilla Tweaks > GUI > Dark UI pack.
You can include the aforementioned assets in a resource pack to have PlayerEx in dark mode. This makes more sense than implementing extra textures in the mod and another config option.
Thanks.

@CleverNucleus hey! the gui.png asset you mentioned above is missing the buttons and icons

There i fixed it :)

Hi there @Balakay420,
Thanks for catching that for me, I've now uploaded the fixed gui.png asset.


data preparation

my train.json.gz file is empty，is this supposed to be right？

Yes. The data will be contained in train/content in that case. Please check the https://github.com/facebookresearch/habitat-lab dataset formats.


Set up Travis

Changes Unknown when pulling bcfe63a44511ed4d6844449480c02a0b3c3ac311 on travis into ** on master**.

Changes Unknown when pulling c52799eed99997e6d08811129f419ee6da144fb1 on travis into ** on master**.

Changes Unknown when pulling bd50d983c56a3263c8788d7dfb4e6891b5872d71 on travis into ** on master**.

Changes Unknown when pulling 9348966e22a47db99ebaa739703ba43d54068a02 on travis into ** on master**.

Changes Unknown when pulling e47a0bb17a22125fed6fa06c3b500f303aa7a27b on travis into ** on master**.

Changes Unknown when pulling b974b8a233b02ad0dd82f43e902022009764c15e on travis into ** on master**.


jQuery noConflict Issue

I integrated this in a WordPress site and realized that Aniview will not work unless
!function()
is changed to
!function($)
near the beginning
and
()
is changed to
(jQuery)
near the end in jquery.aniview.min.js.
This is most probably because the jQuery library included with WordPress is set to the noConflict() mode per https://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers.
You might want to make this change in jquery.aniview.js and jquery.aniview.min.js if necessary.

I second this. The lib does not work with WordPress unless you do the change srikat explained. That should be fixed.


Add Support for Scala 2.13

Code seems okay. Need to fix UniDoc and add 2.13 target on CI

Hi Jack
Thanks for reviewing this.

As for several versions of code, that's the standard way to handle sources, when API differs. I did that for a good reason, after getting compile errors just switching the compiler version back and forth. Scala 2.11 and 2.12 are equal, 2.13 is different for those files

That's a standard practice in Scala and is done in many popular FP libs, like ZIO
So I suggest to leave this for now get back to this issue in another PR

Okay, I'll setup CI here for this project  and will see how to fix the issue with UniDoc

As for several versions of code, that's the standard way to handle sources, when API differs. I did that for a good reason, after getting compile errors just switching the compiler version back and forth. Scala 2.11 and 2.12 are equal, 2.13 is different for those files

That's a standard practice in Scala and is done in many popular FP libs, like ZIO
So I suggest to leave this for now get back to this issue in another PR

I don't disagree with the basic principle, I'm only taking issue with the full duplication of files rather than the factoring out of code that needs to differ. For comparison, using the following commands for this analysis:
# To find Scala-version specific, non-test code
find . -name 'scala-2.1*' -exec find {} -name '*.scala' \; | grep -v test | xargs wc -l

# To find non-test Scala code
find . -name '*.scala' | grep -v test | xargs wc -l

Project
Scala-version specific
All non-test Scala

ZIO
1666
47103

This PR
8355
36249

We are a somewhat smaller project with 5x the amount of Scala-version specific code.
From the perspective of version control, I can't see in this diff what changes were necessary in these duplicated files for 2.13. I would much rather do more focused changes, and I'm happy to help with them. I also don't want to do it in follow on PRs because it makes the git history much harder to track; this PR creates a break in the commit history for duplicated files like the Emitter and that complicates tracing the history of things.

Okay, I'll setup CI here for this project and will see how to fix the issue with UniDoc

Thanks for looking at that. Just as a tip, I don't think the issue has anything to do with UniDoc itself. I think there is a bad interaction between the ANTLR and Protobuf SBT plugins. In the most recent commit, a different test failed: https://travis-ci.com/github/freechipsproject/firrtl/jobs/356083778

Closing this to clean the commit history. Follow up is in #1737


Implement home page for jiffyscan with latest bundles and latest user ops

The mobile and desktop designs can be found in the following figma file ( Handout draw board ) - https://www.figma.com/proto/jaKb4u50mZ9K6lCfuGPX4D/jiffyscan.xyz?node-id=1036%3A25168&scaling=min-zoom&page-id=730%3A2701&starting-point-node-id=1036%3A25168&show-proto-sidebar=1
Creating this issue to track what has been completed and what is yet to be implemented for home page.
Note: Skip the metrics for the first interation.

The following API can be used to get the latest user ops - https://api.jiffyscan.xyz/v0/getLatestUserOps
To get all networks user ops - https://api.jiffyscan.xyz/v0/getLatestUserOps
To get a particular networks user ops - https://api.jiffyscan.xyz/v0/getLatestUserOps?network=mainnet
supported network -
mainnet
goerli
optimism-goerli
matic

The API to get the latest bundles is still being developed. Will update it here ASAP

Latest Bundles API is available for the UI to use - https://api.jiffyscan.xyz/v0/getLatestBundles
you can add the following params to the get request too.
network - mainnet, goerli, optimism-goerli, matic
first - number of results to show ( try to keep it below 50 so as to not crash the handler )
skip -  number of results to skip


Quickstart test: fail when server responds with error

closes #749

@janl that worked: https://travis-ci.org/hoodiehq/hoodie/builds/239092845. But it still tries it 60 times instead of stop trying after the first fail.
Maybe there is no workaround for it because for the first few tries the server might not be up yet. I’d say this is good enough now. I’ll put in the workarounds from #758 so that the quickstart test passes again

This is ready for review, ping @hoodiehq/maintainers

man curl again:
       --retry <num>
              If a transient error is returned when curl tries to perform a transfer, it will
              retry this number of times before giving up. Setting the number to 0 makes curl
              do  no retries (which is the default). Transient error means either: a timeout,
              an FTP 4xx response code or an HTTP 5xx response code.

              When curl is about to retry a transfer, it will first wait one second and  then
              for all forthcoming retries it will double the waiting time until it reaches 10
              minutes which then will be the delay between the rest of the retries.  By using
              --retry-delay you disable this exponential backoff algorithm. See also --retry-
              max-time to limit the total time allowed for retries. (Added in 7.12.3)

              If this option is used several times, the last one will be used.

       --retry-delay <seconds>
              Make curl sleep this amount of time before  each  retry  when  a  transfer  has
              failed  with  a  transient error (it changes the default backoff time algorithm
              between retries). This option is only interesting if --retry is also used. Set-
              ting this delay to zero will make curl use the default backoff time.  (Added in
              7.12.3)

              If this option is used several times, the last one will be used.

       --retry-max-time <seconds>
              The retry timer is reset before the first transfer  attempt.  Retries  will  be
              done  as  usual  (see  --retry)  as long as the timer hasn't reached this given
              limit. Notice that if the timer hasn't reached the limit, the request  will  be
              made  and  while performing, it may take longer than this given time period. To
              limit a single request's maximum time, use -m, --max-time.  Set this option  to
              zero to not timeout retries. (Added in 7.12.3)

              If this option is used several times, the last one will be used.

curl --retry 60 http://localhost:8080 fails right away without retrying. Am I doing something wrong?
$ curl --retry 60 http://localhost:8080
curl: (7) Failed to connect to localhost port 8080: Connection refused

If a transient error is returned when curl tries to perform a transfer, it will retry this number of times before giving up.

Transient error means either: a timeout, an FTP 4xx response code or an HTTP 5xx response code.

Together this means these settings won’t apply when the host is not reachable, but only when you get a timeout, or HTTP 5xx response. But not for a connection refused, or 4xx error.

seems like curl can’t handle connection refused errors yet. It was brought up at https://github.com/curl/curl/issues/1036, but was not yet implemented as it seems. Probably that’s why @benwhite-deltas implemented the manual loop :)

@janl I added a change: https://github.com/hoodiehq/hoodie/commit/4ab9daf4a8ad63ed488a7a7afac45d2f883465a9
That way we have the loop that waits until the server starts. Only then we check if the client bundling works. What do you think?

ping @hoodiehq/maintainers this is ready for review


Fix reordering records in a sortable section

Fixes #38

Appends new sortable records to the end of the list
Added factories for testing

Co-authored-by: Tres Henry<EMAIL_ADDRESS>Co-authored-by: Scott Robbin<EMAIL_ADDRESS>

@ohnoimdead This should be good to go. No rush though. Enjoy your vacation, and we'll pick up on this afterward.
On a related note, I added you as a co-author to the PR, which requires us to include our emails in the commit message (which I got from your GitHub profile). Let me know if that's OK, or if you'd prefer to not have that info in there.

Also, southern Italy was beautiful and vacation was very much enjoyed. :D


Cannot Set Popovers width

Issue description

components: Popover
reactstrap version #7.1.0
import method es
react version #16.6.3
bootstrap version #4.3.1

What is happening?
I cannot set the Popover width to anything different than standard.

What should be happening?
I need a way to set Popover width inline in a React Class. I've tried multiple things and nothing seems to change it from the Standard 276px width.

@blazinaj I think you can do something like this
const StyledPopover = styled(Popover)
min-width: 328px;

Like this?
const StyledPopover = styled(Popover)"min-width: 328px;"

I meant backtick, ```

I guess I'm not sure what you mean, StyledPopover as in a different library than in Reactstrap?

StyledPopover is just a variable that you are creating to override some of the css properties that Popover component has, so it can be named to anything you want. It is a wrapper on Popover component.

Hi, may I see you code for this issue? I have same issue. I don't know where I gonna put this
const StyledPopover = styled(Popover)min-width: 328px;

I just figured out, i missed out an important part in my earlier reply, you need to use styled-components library. ( "styled-components": "^2.0.0" include this in your package.json). You are essentially overriding the css properties that are provided by reactstrap.
import React, { Component } from 'react'
import styled from 'styled-components'
import { Popover } from 'reactstrap'

const StyledPopover = styled(Popover)`
      min-width: 328px;
     background-color: #2F3337;
     && .arrow::after {
       border-right-color: #2F3337;
     }
`
const StyledPopoverBody = styled.div`
  background-color: #2F3337;
  color: #FFFFFF;
  h1 {
    font-size: 16px;
  }
  p {
    font-size: 12px;
  }
`

  </StyledPopover>

@pswaroopk Thank  you for the clarification 👍
That seems like a good solution, I'm still curious if there's a way to accomplish it without having to import another library.

Yes, I think it is better to have solution without importing another library.

The styled-components library worked great and solved my problem. I still hope that Reactstrap will try to build in a better styling solution natively so that we don't have to add another dependency. Closing this issue since the problem was solved. Thanks again @pswaroopk

Hi,
Ithink this would fix your issue without styled-components.
/* eslint react/no-multi-comp: 0, react/prop-types: 0 */
import React from 'react';
import { Button, UncontrolledPopover, PopoverHeader, PopoverBody } from 'reactstrap';
import './yours.css'

export default class Example extends React.Component {
  render() {
    return (

        <Button id="PopoverFocus" type="button">
          Launch Popover (Focus)
        </Button>
        <UncontrolledPopover className="popover-container" trigger="focus" placement="bottom" target="PopoverFocus">
          <PopoverHeader>Focus Trigger</PopoverHeader>
          <PopoverBody>Focusing on the trigging element makes this popover appear. Blurring (clicking away) makes it disappear. You cannot select this text as the popover will disappear when you try.</PopoverBody>
        </UncontrolledPopover>
          <PopoverHeader>Click Trigger</PopoverHeader>
          <PopoverBody>Clicking on the triggering element makes this popover appear. Clicking on it again will make it disappear. You can select this text, but clicking away (somewhere other than the triggering element) will not dismiss this popover.</PopoverBody>
        </UncontrolledPopover>

    );
  }
}

And then add this file next to your component.
/* yours.css */
.popover-container>.popover{
	max-width: 1000px;
}

Hi, I think this would fix your issue without styled-components.
/* eslint react/no-multi-comp: 0, react/prop-types: 0 */
import React from 'react';
import { Button, UncontrolledPopover, PopoverHeader, PopoverBody } from 'reactstrap';
import './yours.css'

export default class Example extends React.Component {
  render() {
    return (

        <Button id="PopoverFocus" type="button">
          Launch Popover (Focus)
        </Button>
        <UncontrolledPopover className="popover-container" trigger="focus" placement="bottom" target="PopoverFocus">
          <PopoverHeader>Focus Trigger</PopoverHeader>
          <PopoverBody>Focusing on the trigging element makes this popover appear. Blurring (clicking away) makes it disappear. You cannot select this text as the popover will disappear when you try.</PopoverBody>
        </UncontrolledPopover>

    );
  }
}

And then add this file next to your component.
/* yours.css */
.popover-container>.popover{
	max-width: 1000px;
}

This was helpful, thanks!


Deleguate state management for update on events

Hi,
I would like to implement a module that updates another module on a given condition/event and freezes its outputs the rest of the time.
Since the jax control flow has some limitations (see JAX documentation), it seems to me that to implement this idea, we need a mechanism that allows us to delegate the management of the state of a module to an external module/wrapper.
I show below an example of such a mechanism.
In the manage_state=False mode of my implementation, the state is handled much like RNNCore in haiku..
As the example shows, this mechanism works.
However, this approach will not work easily if the internal module is itself composed of other modules with state.
I wonder if there might be a mechanism in haiku that would allow a given module to "intercept" all the states of its internal modules in order to implement this idea in a more scalable way.
Does anyone have an insight about this?
Do you think it would be interesting to integrate such functionality in Haiku?
Here is my shortand implementation (maybe a bit long for this post, but it makes things explicit):
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from typing import Any, Optional, Sequence

import haiku as hk
import jax
import jax.numpy as np

class DelegateStateCore(hk.Module, metaclass=ABCMeta):
    def __init__(self, manage_state=True, name=None):
        super().__init__(name=name)
        self.manage_state = manage_state

    def delegate_state_management(self):
        """Delegate state management to outer module."""
        self.manage_state = False
        return self

    @abstractmethod
    def initial_state(
        self, shape: Optional[Sequence[int]] = None, dtype: Any = np.float32
    ) -> Any:
        ...

    @abstractmethod
    def initial_output(
        self, shape: Optional[Sequence[int]] = None, dtype: Any = np.float32
    ) -> Any:
        ...

class UpdateOnEvent(hk.Module):
    """Apply module when an event occur otherwise return last computed output.
    If the module has state management, then it will be ask to delegate the state
    management to this module.
    """

    def __init__(self, module, name=None):
        super().__init__(name=name)
        if isinstance(module, DelegateStateCore):
            self.module = module.delegate_state_management()
        else:
            raise TypeError(f"only DelegateStateCore modules are managed")

        self._state_name = self.module.name + "_state"
        self._output_name = self.module.name + "_output"

    def __call__(self, on_event, input):
        prev_state = hk.get_state(
            self._state_name,
            shape=input.shape,
            dtype=input.dtype,
            init=self.module.initial_state,
        )
        prev_output = hk.get_state(
            self._output_name,
            shape=input.shape,
            dtype=input.dtype,
            init=self.module.initial_output,
        )
        res = self.module((input, prev_state))
        output, next_state = res

        def true_fun(operand):
            output, next_state, _, _ = operand
            return output, next_state

        def false_fun(operand):
            _, _, prev_output, prev_state = operand
            return prev_output, prev_state

        operand = (output, next_state, prev_output, prev_state)
        output, next_state = hk.cond(
            pred=on_event,
            true_operand=operand,
            true_fun=true_fun,
            false_operand=operand,
            false_fun=false_fun,
        )
        hk.set_state(self._state_name, next_state)
        hk.set_state(self._output_name, output)
        return output

class MyModule(DelegateStateCore):
    State = namedtuple("MyModuleState", "state")
    Output = namedtuple("MyModuleOutput", "output")

    def initial_state(self, shape, dtype):
        return self.State(np.full(shape, fill_value=0, dtype=dtype))

    def initial_output(self, shape, dtype):
        return self.Output(np.full(shape, fill_value=np.nan, dtype=dtype))

    def __call__(self, x):
        if self.manage_state:
            prev_state = hk.get_state(
                "state", shape=x.shape, dtype=x.dtype, init=self.initial_state
            )
        else:
            x, prev_state = x

        state = prev_state.state
        state = state + x
        output = state * 2

        if self.manage_state:
            hk.set_state("state", self.State(state))
            return self.Output(output)
        else:
            return self.Output(output), self.State(state)

def test_no_wrapping():
    print("test_no_wrapping")

    fun = hk.transform_with_state(lambda x: MyModule()(x))

    seq = hk.PRNGSequence(42)
    x = jax.random.normal(next(seq), shape=(10,))

    params, state = fun.init(next(seq), x)

    for i in range(10):
        output, state = fun.apply(params, state, next(seq), x)
        print(i, output.output[0])
    print("")
    return output

test_no_wrapping()

def test_deleguate_all_event_true():
    print("test_deleguate_all_event_true")
    fun = hk.transform_with_state(lambda event, x: UpdateOnEvent(MyModule())(event, x))

    seq = hk.PRNGSequence(42)
    x = jax.random.normal(next(seq), shape=(10,))

    event = True
    params, state = fun.init(next(seq), event, x)

    for i in range(10):
        output, state = fun.apply(params, state, next(seq), event, x)
        print(i, output.output[0])
    print("")
    return output

test_deleguate_all_event_true()

def test_deleguate_all_event_true():
    print("test_wrapping_some_event_true")
    fun = hk.transform_with_state(lambda event, x: UpdateOnEvent(MyModule())(event, x))

    seq = hk.PRNGSequence(42)
    x = jax.random.normal(next(seq), shape=(10,))

    event = False
    params, state = fun.init(next(seq), event, x)

    for i in range(10):
        if i in [3, 7]:
            event = True
        else:
            event = False
        output, state = fun.apply(params, state, next(seq), event, x)
        print(i, output.output[0])
    print("")
    return output

test_deleguate_all_event_true()

This will print:
test_no_wrapping
0 -3.3304188
1 -6.6608377
2 -9.991257
3 -13.321675
4 -16.652094
5 -19.982513
6 -23.312933
7 -26.643353
8 -29.973772
9 -33.30419

test_deleguate_all_event_true
0 -3.3304188
1 -6.6608377
2 -9.991257
3 -13.321675
4 -16.652094
5 -19.982513
6 -23.312933
7 -26.643353
8 -29.973772
9 -33.30419

test_wrapping_some_event_true
0 nan
1 nan
2 nan
3 -3.3304188
4 -3.3304188
5 -3.3304188
6 -3.3304188
7 -6.6608377
8 -6.6608377
9 -6.6608377

I think I found a way to proceed.
We would need a "setter" version of the method state_dict() :
Here I show a proposal for such a setter function:
def set_params_or_state_dict(
    module_name: str,
    submodules: Set[str],
    which: str,
    state_dict: Mapping[str, jnp.array],
):
    """Returns module parameters or state for the given module or submodules."""
    assert which in ("params", "state")
    frame = base.current_frame()
    for their_module_name, bundle in getattr(frame, which).items():
        if (
            their_module_name == module_name
            or their_module_name.startswith(module_name + "/")
            or their_module_name in submodules
        ):
            for name, value in bundle.items():
                fq_name = their_module_name + "/" + name
                if which == "state":
                    value_dict = value._asdict()
                    value_dict["current"] = state_dict[fq_name]
                    bundle[name] = type(value)(**value_dict)
                else:
                    bundle[name] = state_dict[fq_name]

def set_state_from_dict(self, next_state_dict):
    """Set state keyed by name for this module and submodules."""
    if not base.frame_stack:
        raise ValueError(
            "`module.set_state_from_dict()` must be used as part of an `hk.transform`."
        )
    set_params_or_state_dict(
        self.module_name,
        self._submodules,
        "state",
        next_state_dict,
    )

hk.Module.set_state_from_dict = set_state_from_dict

Then,  a much more generic implementation of the module UpdateOnEvent would be:
from jax.tree_util import tree_map

class UpdateOnEvent(hk.Module):
    """Apply module when an event occur otherwise return last computed output.
    If the module has state management, then it will be ask to delegate the state
    management to this module.
    """

    def __init__(self, module, initial_output_value=np.nan, name=None):
        super().__init__(name=name)
        self.module = module
        self.initial_output_value = initial_output_value

    def __call__(self, on_event, input):
        # state_dict = self.state_dict()

        prev_state_dict = self.module.state_dict()

        output = self.module(input)

        prev_output = hk.get_state(
            "prev_output",
            shape=[],
            init=lambda *_: tree_map(
                lambda x: np.full(x.shape, self.initial_output_value, dtype=x.dtype),
                output,
            ),
        )

        next_state_dict = self.module.state_dict() if prev_state_dict else {}

        def true_fun(operand):
            output, next_state, _, _ = operand
            return output, next_state

        def false_fun(operand):
            _, _, prev_output, prev_state = operand
            return prev_output, prev_state

        operand = (output, next_state_dict, prev_output, prev_state_dict)
        output, next_state_dict = hk.cond(
            pred=on_event,
            true_operand=operand,
            true_fun=true_fun,
            false_operand=operand,
            false_fun=false_fun,
        )

        if next_state_dict:
            self.module.set_state_from_dict(next_state_dict)

        hk.set_state("prev_output", output)
        return output

which would work with any module.
Here is a usage example:
class MyModule(hk.Module):
    def __call__(self, x):
        prev_state = hk.get_state(
            "state",
            shape=x.shape,
            dtype=x.dtype,
            init=lambda shape, dtype: np.full(shape, fill_value=0, dtype=dtype),
        )

        state = prev_state
        state = state + x
        output = state * 2

        hk.set_state("state", state)

        return output

def test_deleguate_all_event_true():
    print("test_wrapping_some_event_true")
    fun = hk.transform_with_state(
        lambda event, x: UpdateOnEvent(MyModule(), initial_output_value=-999)(event, x)
    )

    seq = hk.PRNGSequence(42)
    x = jax.random.normal(next(seq), shape=(10,))

    event = False
    params, state = fun.init(next(seq), event, x)

    for i in range(10):
        if i in [3, 7]:
            event = True
        else:
            event = False
        output, state = fun.apply(params, state, next(seq), event, x)
        print(i, output[0])
    print("")
    return output

test_deleguate_all_event_true()

If you think it could be worth, two things could be done:

integrate the function set_params_or_state_dict() in haiku._src.module  and add the method .set_state_from_dict to hk.Module.
Integrate the new module UpdateOnEvent if you think it is sufficiently generic and in the scope of the library.

To give a little more context, this development is now used in the open-source library WAX-ML available at https://github.com/eserie/wax-ml.
It would be interesting to know if this could be integrated into Haiku or if you would prefer it to be implemented outside of Haiku.

Hi @eserie, I'm glad you were able to implement something to support your use case using Haiku!
In general we try to be very conservative when adding features to Haiku and where it is possible to implement things on top of Haiku it is preferable to do so. If lots of users tell us this is something they need, and your solution ends up getting forked into multiple projects then I think we should reconsider whether to upstream similar functionality.
FYI - your implementation is making use of several private APIs in Haiku, so you may find that future changes to our internals break your implementation (and will require you to update) however you can pin your library to specific versions of Haiku to mitigate this.

Hi @tomhennigan, thanks for your feedback.
I'll be watching for future changes and following your recommendations to pin WAX-ML to a fixed version, which makes sense since Haiku is so far perfect for my use case!
Feel free to contact me if you plan to implement something along these lines so I can anticipate the changes.


Can't reference Self type when using associated refinement

When I try to use an associated refinement in a function spec, Flux does not seem to like it when I pass in a Self.
For example, when I verify:
#[flux_rs::refined_by(powered:bool)]
pub struct MPU<const MIN_REGION_SIZE: usize> {
    #[field(bool[powered])]
    powered: bool,
}

#[flux_rs::assoc(fn enabled(self: Self) -> bool )]
pub trait MyTrait {
    #[flux_rs::sig(fn(self: &strg Self) ensures self: Self{r: <Self as MyTrait>::enabled(r)})]
    fn enable_app_mpu(&mut self);
}

#[flux_rs::assoc(fn enabled(self: Self) -> bool {self.powered} )]
impl<const MIN_REGION_SIZE: usize> MyTrait for MPU<MIN_REGION_SIZE> {
    #[flux_rs::sig(fn(self: &strg Self) ensures self: Self{r: <Self as MyTrait>::enabled(r)})]
    fn enable_app_mpu(&mut self) {
        self.powered = true;
    }
}

I get the error:
error[E0999]: mismatched sorts
   --> src/main.rs:904:90
    |
904 |     #[flux_rs::sig(fn(self: &strg Self) ensures self: Self{r: <Self as MyTrait>::enabled(r)})]
    |                                                                                ^ expected `{impl#0}::sort`, found `MPU`

It seems like Flux is expecting an instance of MyTrait rather than an MPU and does not recognize that MPU implements MyTrait. I'm pretty sure I'm just missing some syntax, but I could use a pointer lol.
On a related note, are there any plans for documentation on associated refinements? They are extremely useful, but a little hard to use due to the weird syntax.

@enjhnsn2 -- this is pesky indeed. I wonder if you can just "inline" the associated predicate here, so in the signature replace Self as MyTrait>::enabled(r) with r.powered ?
#[flux_rs::sig(fn(self: &strg Self) ensures self: Self{r: r.powered })]

Oh yeah, that's a good workaround. It will work in this case because we do normalize the sort of Self. What we don't normalize is the sort of <Self as MyTrait>::enabled

This workaround works great.


Wish to enlarge the randomness of bell ring

Randomness is +/-50% "around" the mean interval specified in the settings. So the need is not really convincing, therefore issue closed.


Linked Jutsu Design

Idea I had for jutsu that could be cool for SC. Linked ones, wherein you must have jutsu 1 on cooldown to use jutsu 2.
For example:
Gaia's Prison
Description: Trap your opponent in an earthy prison.
Power: 3
Effects: Speed Nerf-2 turns, Linked [Atlas' Revenge]
Cooldown: 2 turns
Atlas' Revenge
Description: Crush the earthen prison around your opponent.
Power: 4.2
Effects: Dependant [Gaia's Prison]
Hopefully that makes enough sense you can use the idea.

We actually have this implemented for Genjutsu - I guess the idea would be to do this for all types of jutsu?

I would say yes, it sets up a lot of new design space for techniques, and allows for essentially inverse cooldowns to make sure the combat balance stays fresh

I second the appeal.  Linked jutsus could very well be a way to implement elemental combinations (eg. turn 1 use water, turn 2 use fire, turn 3 a special steam jutsu becomes available).

Yeah, I think it makes sense to make this an explicit connection. Though I think for elemental combos I want to make that its own thing, so less "you can't use jutsu B before jutsu A" but rather "you only get the special interaction if you use Jutsu B after Jutsu A" e.g. water wave => lightning wave = increased damage


Documentation for for IT Pro / Admin to complete provisioning handoff process

Is your feature request related to a problem? Please describe.
As a IT Pro / Admin, I want to have the appropriate level of documentation on how to complete the provisioning process on the behalf of a developer, so that I can understand the provisioning process and the steps required to complete the action.
Describe the solution you'd like
Document the provisioning handoff process for the IT Pro / Admin side of the provisioning handoff process and make this document be referenceable as part of the communication to the IT Pro / Admin when the handoff request is generated.
Additional context
Provisioning Functional Spec 1.20

Blocked awaiting implementation for Handoff Provisioning

Implementation design for the Handoff process is complete documentation is ready for creation.

Looks like Yan Liu isn't available for docs, so we will need to find a doc writer for this.

Admin handoff docs were published for Build. Let's coordinate on any docs re: this for future releases @Dewain27.


Enable build of CertifyingAndWithdrawingPlutus test

Changes

Enable CertifyingAndWithdrawingPlutus test.
Add necessary configuration, data, and script files for enabling the test.
Update cardano-node dependency.
Add cardano-node and cardano-cli as build-tool-depends.

Example output
$ cabal test plutus-example --enable-tests
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - plutus-example-1.33.0 (test:plutus-example-test) (first run)
Preprocessing test suite 'plutus-example-test' for plutus-example-1.33.0..
Building test suite 'plutus-example-test' for plutus-example-1.33.0..
Running 1 test suites...
Test suite plutus-example-test: RUNNING...
plutus-example
  Plutus.Direct.CertifyingAndWithdrawingPlutus: OK (102.33s)
      ✓ Plutus.Direct.CertifyingAndWithdrawingPlutus passed 1 test.
  prop_TxId_Api_Ledger_Plutus_Roundtrip:        OK (0.89s)
      ✓ prop_TxId_Api_Ledger_Plutus_Roundtrip passed 100 tests.
  prop_TxId_Api_Ledger_Roundtrip:               OK (0.92s)
      ✓ prop_TxId_Api_Ledger_Roundtrip passed 100 tests.
  prop_ScriptData_MyCustomRedeemer:             OK (0.38s)
      ✓ prop_ScriptData_MyCustomRedeemer passed 100 tests.
  prop_ScriptData_MyCustomRedeemer_JSON:        OK (0.47s)
      ✓ prop_ScriptData_MyCustomRedeemer_JSON passed 100 tests.

All 5 tests passed (104.99s)
Test suite plutus-example-test: PASS
Test suite logged to:
/Users/jky/wrk/iohk/plutus-apps/dist-newstyle/build/x86_64-osx/ghc-8.10.7/plutus-example-1.33.0/t/plutus-example-test/test/plutus-example-1.33.0-plutus-example-test.log
1 of 1 test suites (1 of 1 test cases) passed.

Work in progress
Currently this PR doesn't build in nix and it involves some dependency version changes that don't track the documented projects in cabal.project, so the PR is not ready for merging.

Does this PR subsume #378?

I have close https://github.com/input-output-hk/plutus-apps/pull/378


improve dependency resolution

[x] include constraints?
[ ] include multiple requirements at once, like pip?
[ ] use JSON API, if available?

Constraints has proven to be the most useful. The rest of these changes could come separately if we find a reason, later.


Only the first page with text - fromhtml

I using fromhtml with the jspdf.debug.js
af5b4e9b-29e0-4421-b10b-cb110d10c47e.pdf

The version Version 1.0.272-git  works but css not working