rethinking the python wrapper

Hi folks. This PR is aimed at simplifying the interaction with external wrappers. The changes here simply unwind the conditional compilation steps that were called by wrapper generators, removes the associated source code, and suggests renaming of certain parameter declarations to make them a bit more accommodating for automatic wrapping by SWIG.
The main point of this is to remove unnecessary complexity from the core hydraulic library, to keep it as simple as possible, and maintain an uncluttered codebase - which is good for us all.
There may end up being other code that can be stripped out now - I'm just not sure. The new suggested python binding is a SWIG / scikit-build concoction, and can be found here:
https://github.com/OpenWaterAnalytics/epanet-python/tree/dev/owa-epanet
... and the associated package can be installed simply: pip install owa-epanet (pending windows support)
I'm certainly open to philosophical or technical discussion about this PR, by the way.
For what it's worth, my longer strategy is to try to eventually work-in the mods that CitiLogics has made over the years (now carried on by Xylem) to enable real-time simulations via the toolkit so that we can use this community version of EPANET directly - including the great additions made by so many.
Thanks for consideration!

importantly (as evidenced by the above iteration on test-passing), the EN_deleteproject function signature has changed. It is not necessary to pass a pointer by reference (so a double pointer to the project struct) for the free-ing operations to commence. Also, changing this function better supports auto-wrapping. It may be possible to accomplish the same thing using the old function declaration, but I'll just kindly ask if this change makes anyone's lives truly difficult.

Question: If the option to build the project with epanet_py.c has been removed from the CMakeLists.txt file then can epanet_py.c and epanet_py.h be removed from the project?

@samhatchett I have a commit ready to address issue #513 and it would make life much easier if this PR were merged first. Thanks.

@samhatchett - Do you have an idea of what the time frame is for windows support?

@LRossman - sure, lazy consensus can rule here, if there are no other comments.
@pshassett - no idea as I'm not a windows user. My plan is for someone in that world to provide some guidance or a PR. If you are in that world, please feel free to take a look!

@samhatchett - Ok, good to know.  Maybe I can look into that soon.
In the meantime this PR deprecates the epanet_python build, which does already support windows.

@pshassett yep - maybe that wasn't exceptionally clear from the first post ☝ , but that deprecation is in effect what this does. I tried in the description to illuminate that a bit as well as the motivation behind it. Do you have any opinions about this?

@samhatchett I see. My main concern is that now there is no python wrapper that is supportive of windows.  This is not currently an issue of high urgency however should be resolved soon at epanet-python in one way or another.

@samhatchett the new EN_deleteproject signature fails to set the original project pointer to NULL after its memory has been freed. It's the copy of the pointer passed in by value that gets set to NULL, not the original project pointer created with EN_createproject (I just confirmed this with a small test example.) We should either revert back to passing in a double pointer or simply remove the NULL assignment line from the function (in which case it would be up to the client to make sure they don't try to re-use the original project pointer again without setting it to NULL).

thanks for the feedback - yes, I notice that the toolkit can no longer nullify the double pointer. I've seen pretty commonly in C APIs that after destroying/closing/etc some kind of handle, it's the client's responsibility to know it's dirty and not use the handle again.
That said, I'm open to either approach. Anyone have a strong preference for API usage?

Although I think the original EN_deleteproject which used the double pointer to the project was a safer way to handle the free'd pointer, I'm ok with keeping the new version of the function. I can remove the p = NULL; line from it (as it serves no purpose) in my forthcoming PR.

works for me - thanks @LRossman
also, as a bit of background, I was refreshing my memory on some of the original thoughts around the project pointer. I took great inspiration from the SQLite library - here is a snippet demonstrating creation/freeing in that api:
sqlite3 *db;
int rc;
rc = sqlite3_open(f_name, &db);  // reference to pointer to sqlite3 struct
sqlite3_close(db); // just a pointer to sqlite3 struct
db = NULL; // cleanup; db is dirty


alexa app?

this works great, thanks for sharing mate!
is it possible to integrate with the alexa app though?  I can't work out how to do it as it seems to require a real echo to go through the setup.
any pointers would be great
thanks again.

It doesn't require a real echo.  It just takes a little bit to show up in the app.  If you are showing it now, can you please close this issue?

yes, for anyone else experiencing this, it does take a very long time but eventually shows up in the app.  it was next day for me.


OutOfMemory on WEBSPHERE

Hello,
I'm using rythm to generate some html code in my JEE app. After a couple of days in prod, the server runs out of memory.
I analysed the heap dump, and i find out that the object DefaultShutdownService is populating all the heap space. I've got more than 3 134 occurences.
To describe a little what im doing with the engine:
For every request, i call the Rythm.render and after all my process ends i call the Rythm.shutdown.

That's a bit weird, the DefaultShutdownService is implemented as enum, shouldn't have more than one instance per class loader:
enum DefaultShutdownService implements ShutdownService {

    INSTANCE;

    @Override
    public void setShutdown(final Runnable runnable) {
        try {
            Runtime.getRuntime().addShutdownHook(new Thread() {
                @Override
                public void run() {
                    if (runnable != null)
                        runnable.run();
                }
            });
        } catch (Throwable t) {
            // Nothing to do
        }
    }
}

On the other side, application shall not call Rythm.shutdown, instead that should be called by when your servlet container stopped, or reload

That's a bit weird, the DefaultShutdownService is implemented as enum, shouldn't have more than one instance per class loader:
enum DefaultShutdownService implements ShutdownService {

    INSTANCE;

    @Override
    public void setShutdown(final Runnable runnable) {
        try {
            Runtime.getRuntime().addShutdownHook(new Thread() {
                @Override
                public void run() {
                    if (runnable != null)
                        runnable.run();
                }
            });
        } catch (Throwable t) {
            // Nothing to do
        }
    }
}

On the other side, application shall not call Rythm.shutdown, instead that should be called by when your servlet container stopped, or reload

thank you for your answer. I removed the call to rythm.shutdown as you suggested, and im still monitoring the app. It looks good so far.

I too have this problem on Weblogic.
It is because you still have a memory leak because the shutdown hook is never released and that hook has a reference to a thread which have a reference to the contextClassLoader which have a reference to all loaded class for the web application.
Hook -> Thread -> Context Class Loader -> All loaded classes
I see that there are no ways no remove that hook or to override which ShutdownService to use, this is very annoying...

I've taken out the Runtime.addShutdownHook. See https://github.com/greenlaw110/Rythm/blob/master/src/main/java/org/rythmengine/DefaultShutdownService.java


Custom icons in prompt broken

I am desperate, dunno if it's a bug in powerlevel9k or oh-my-zsh, but looks like powerlevel9k. Happened today out of seemingly nowhere (I might have git pulled all my plugins yesterday)
http://i.imgur.com/cZ2wZMC.png

Some additional information - happens only when I have left subsegment separator active.
zshrc here: https://github.com/iScrE4m/djetelina-dotfiles/blob/master/zshrc

@iScrE4m - Okay, this isn't just you. @onaforeignshore just said in the gitter chat that he has the same problem.
To be clear, you are both using:

HEAD of master (i.e., the 0.6.3 tagged release)
custom icons

@onaforeignshore - Also, can you share how you are setting your own icons? Is it similar to how @iScrE4m is doing it, above?

Okay, I know what happened. This is a result of fixing the pw3nage security hole.
The issue is that in order for your custom icon setting to work, the way it is written, P9k must allow for expansion of segment code. This is double-expansion, because it's already been expanded once to create the segment. If we enable double-expansion, it opens users up to exploits where malicious code can be inserted by files in globbed directories (e.g., VCS dirs).
So, this isn't working because of #486, specifically, but that itself is actually not the bug. I think what we need to do is figure out the right way for you to set these icons in a safe manner.
Is there a reason you have these set with the print command instead of just referencing the icon directly?

Not really, I copied this from V1rgul's configuration in https://github.com/bhilburn/powerlevel9k/wiki/Show-Off-Your-Config

Oh, interesting.
@V1rgul - Is your prompt not  broken with v0.6.3?

Changing settings to
POWERLEVEL9K_HOME_SUB_ICON=' '
POWERLEVEL9K_DIR_PATH_SEPARATOR='  '

fixes it (separator unicode seems to be mixed up here) - I think it's fair enough approach.

Roger. Thanks, @iScrE4m!

I set my icons like this: POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=$'\uE0B4'

And it still isn't working for me

I'm using iTerm2 on macOS Sierra 10.12.4

@onaforeignshore - Crap. Can you post a screenshot of what you're seeing? Also, if you check out master instead of using your dev branch, do you still see it?

I checked out master and v0.6.3 and get the same result on both

The alternate fix for this would be to use double quotes or no quotes with call to print_icon, as then it would evaluate that function when those variables are defined and not later.

@onaforeignshore Can you make sure that you don't set (or unset) prompt_subst anywhere?

I checked out v0.6.3 and the only place prompt substitutions are called in my configuration is in the powerlevel9k.zsh-theme file.
My zsh environment is in my dotfiles repo.  My configuration came from another person's configuration that I modified. I have only been using ZSH for a few months, so I am still learning.

Thanks for sticking around to help debug it! Glad we got it figured out. :)

Thanks so much for your debugging and help, @belak! That was tremendously helpful.
Closing this out since both @iScrE4m and @onaforeignshore are all set, now =)

@bhilburn Yeah it's not working in v0.6.3
I didn't encounter the problem because I'm staying in #472 .
It really isn't the best solution since with awesome-terminal-fonts you're subject to codepoints changes :/
We maybe could evaluate the icons at start, after sourcing icons.zsh  ?
Or more simply re-expand the icons only ?


haproxy: Allow DNS changes

Before, HAproxy resolved hostnames once at startup, and kept the same
association for the lifetime of the service, even if the IP changed in
DNS. This is obviously incorrect when load balanced containers get
restarted with new IPs. HAproxy now tries to updates IPs when health
checks to the old IP fail.

Going to submit this PR on the new quilt/haproxy repo.


ghcr.io mirror download is too slow

Domestic network access to the ghcr.io registry to download mirrors is very slow. Can it support the domestic public mirror library?

Thanks for the feedback, this problem does exist, we will support it in the next release.


Fix unicode variable names

Fix #2003

[Current coverage][cc-pull] is 87.17% (diff: 98.07%)

Merging [#2005][cc-pull] into [master][cc-base-branch] will increase coverage by <.01%

@@             master      #2005   diff @@
==========================================
  Files           303        304     +1
  Lines         54127      54168    +41
  Methods           0          0
  Messages          0          0
  Branches       5597       5600     +3
==========================================
+ Hits          47182      47223    +41
  Misses         6027       6027
  Partials        918        918

Powered by Codecov. Last update [dfd8af7...41dd86c][cc-compare]
[cc-base-branch]: https://codecov.io/gh/numba/numba/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/numba/numba/compare/dfd8af7afdca498388757cca272add6980d4a6ff...41dd86c86df11842695bbb78bea96e0fc25ef0d2?src=pr
[cc-pull]: https://codecov.io/gh/numba/numba/pull/2005?src=pr


Make exhbitions main menu link protocol relative and minor formatting.

Thanks, @moltude!  The scheme-relative URL works fine, but the indentation change causes an error. The YAML intentation was intenational, as the elasticsearch property is supposed to be Settings.exhibitions.elasticsearch.  With it un-indented, I get an error deploying the application.  From the Unicorn error log:
NoMethodError: undefined method `host' for nil:NilClass
  /srv/www/frontend/config/initializers/elastictastic.rb:1:in `<top (required)>'

... So this elastictastic gem is grabbing http://ignore-me:9200 and running into an error with it not resolving.

(Restoring the indentation causes the deployment to succeed, and I get the desired https:// link for exhibitions.)

@moltude beware: I've force-pushed the branch and will merge this when tests pass.


"Rendered Markdown" disabled "Markdown Source"

Testing #141346

open notebook
find widget filters
check "Rendered Markdown"
:bug: the "Markdown Source" button is disabled (no matter if it was checked/unchecked before)

This is intentional as we don't have a UX yet for matching both the source and the preview as we can't render both at the same time. An alternative is when clicking on "rendered markdown", we uncheck "markdown source".

matching both the source and the preview as we can't render both at the same time.

I understand that for a single cell but I can have one markdown cell in preview and another in source, right?


Version command

Would like to be able to have the command version that will print the current cli version
Something like
mojito version

Hi @dragosv ! yes you can do mojito -v which shows something like 0.109-SNAPSHOT (git commit id: e054e60bcc7ad0e329ddca0151e25ce665249b93)


Crash with client::get on connection refused

Greetings!  I'm seeing a segmentation fault when attempting to use the following code on a HTTPS URL that is returning a "connection refused" error.
GDB RESULTS:
terminate called after throwing an instance of 'boost::exception_detail::clone_implboost::system::system_error'
what():  Connection refused
[New Thread 0x7ffedeffd700 (LWP 30879)]
(gdb) bt
#0  0x00007fffe8f85428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007fffe8f8702a in __GI_abort () at abort.c:89
#2  0x00007fffe98c884d in __gnu_cxx::__verbose_terminate_handler() ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fffe98c66b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007fffe98c6701 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007fffe98f1d38 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007fffe9bc26ba in start_thread (arg=0x7ffef4ff9700) at pthread_create.c:333
#7  0x00007fffe905741d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
SAMPLE CODE:
boost::network::http::client::response l_httpResponse;
        try
        {
          boost::network::http::client l_httpClient;

          std::string l_url = "http://<IP_ADDRESS>:9001/" // make sure this returns connection refused on a telnet attempt

          boost::network::http::client::request l_httpRequest(l_url);

          l_httpResponse = l_httpClient.get(l_httpRequest);

          l_success = true;
        }
        catch (...)
        {
          l_success = false;
        }

Does it go away if you move the client object l_httpClient outside of the try block?

Hi!  Regarding your question:  The crash does not go away if the client is moved ouside of the try block.  I also tried keeping the Client around eternally (never destroying it) and this did not work either.
One thing I did notice:
on connection refused, the exception is not forwarded back into this thread from cpp-netlib.  Meaning, the code successfully exits the try block, never triggering the catch block.  This seems wrong, yes?  How would one detect a 'connection refused' error without using a try/catch on this operation?
Thanks for any advice or information

I have found a temporary workaround for this issue:

accessing l_httpResponse.status() from within the try () block successfully throws an exception in a connection_refused state, allowing this crash to be avoided.

It seems if you do not access the http response from within the try block, it will exit the block without throwing exceptions in a connection_refused case -- but accessing status() triggers the exception.

This seems WAI. get() is lazy, so the actual connection happens when you access any part of the response.

There's no more synchronous client since 0.12.x if I recall correctly.


[DiSCUSSION] OAL supports generating metrics from events

It's kind of doubtful at the first thought of letting OAL support events, but I lately believe it's helpful for some events to be supported by OAL, especially in Kubernetes events, such that we can have metrics to answer the questions like

How often pods cannot be scheduled? Are they related to capacity errors?
What is the distribution of Pods, Deployments Created / Updated through out the day?
Are there significant amount of "Error" events right now?

@wu-sheng what do you think of this

It makes sense, but within these cases, should we conside whether MAL is a good option? Or is it still reasonable using MAL replace OAL?

I'd rather finish this feature first as it takes very little efforts but brings important features to Event concept in our landscape. Replacing OAL with MAL is architecture optimization after all. I haven't dived too much into replacing OAL with MAL up to now.

I am fine with enhancing the OAL as we have no decision about whether OAL is replaceable or not.


Update README.md and metadata.json for the v7.5.0-preview.1 release

PR Summary
Update README.md and metadata.json for the v7.5.0-preview.1 release

Tests for markdown link and markdown lint passed. The failure in macOS CI is not related to the changes.


How to restart mongodb docker container

Hello There,
Sorry to ask my query here but can someone tell how to restart mongodb since entrypoint.sh has "exec $@" and I am unable to restart container after setting new FCV since its started with PID1
Regards,
SAM

As you've discovered, mongod runs as PID1, so the supported way to restart it is to restart the container.


Recreate the AST with functors

Fixes #98
See the issue for details of why this is useful

Oops, I had messed up the cabal file. Should be OK now.

CI is failing for this and the associated PR on pandoc, so it's hard to evaluate.

OK will fix tests and CPP COMPLETE pragmas.

OK added a JSON deriving option so hopefully the newtypes don't introduced extra fluff. That was what was making the tests fail.

Oh good this does pass now.


March unified

This is a unified branch containing merges for all other outstanding PRs. Please either review/accept/reject each PR individually and reject this one, or review/accept this one and reject all the individual ones. I wanted something I could use for testing (I'm losing track of what's already fixed).
This branch just contains the following:

PR #126
PR #128
PR #129
PR #130
PR #135

@Sepitus-exe, is everything okay? I haven't heard from you in about a week.
No worries if you're just tied up with other things, but I wanted to check in with you.
Just let me know if you'd prefer I maintain my own fork of the project.


Step invoked by output_from/named_output/provides cannot recognized task variable defined in global statement.

Hi Bo,
I have encountered an error where invoking other step by output_from , named_output , and provides will cause the task statement not being able to recognize the global statement. Following error was given
ERROR: [A (A)]: [A]: Failed to execute process
"bash(fr"""touch {_output}\n""", stderr = f'{_output}.stderr',...'{_output}.stdout')\n"
name 'walltime' is not defined
[B]: Exits with 1 pending step (B)

when running
sos run test_global.sos B -J 1 -q csg -c csg.yml

Where test_global.sos is:
[global]
# The output directory for generated files. MUST BE FULL PATH
parameter: cwd = path("./")
# For cluster jobs, number commands to run per job
parameter: job_size = 1
# Wall clock time expected
parameter: walltime = "5h"
# Memory expected
parameter: mem = "16G"
# Number of threads
parameter: numThreads = 8

[A]
output: file = f'{cwd:a}/test_file'
task: trunk_workers = 1, walltime = walltime, mem = mem, cores = numThreads, tags = f'{step_name}_{_output:bn}'
bash: expand= "$[ ]", stderr = f'{_output}.stderr', stdout = f'{_output}.stdout'
    touch $[_output]
[B]
input: output_from("A")
task: trunk_workers = 1, walltime = walltime, mem = mem, cores = numThreads, tags = f'{step_name}_{_output:bn}'
bash: expand= "$[ ]", stderr = f'{_output}.stderr', stdout = f'{_output}.stdout'
    touch $[_input]

However, I was under the impression that this mechanism should work fine previously.
The sos version I am using is the latest. And the pbs version is sos-pbs 0.20.8

Simplifying the test case to
[global]
parameter: mem = "16G"

[A]
output: 'test_file'
task: mem = mem
bash: expand=True
    touch {_output}

[B]
input: output_from("A")
bash:
    touch {_input}.processed

with command error being
> sos run test_task_params.sos B  -s force -q localhost
INFO: Running A:
ERROR: [A (A)]: [A]: Failed to execute process
"'bash(fr"""touch {_output}\n\n""")\n'"
name 'mem' is not defined
[B]: Exits with 1 pending step (B)

Note that the pipeline works without -q localhost.

Could you test if branch issue1457 works?

Could you test if branch issue1457 works?

I am not sure how to install this branch into my cluster. I have been installing sos via pip.

@hsun3163 you clone that branch to your computer, cd to it and install via pip install .

I can successfully run the new testing example you created. But when I try to run my original example, or any other notebook with task statement. I recieved the following error:
ERROR: Failed to parse statement: trunk_workers = 1, walltime = walltime, mem = mem, cores = numThreads, tags = f'{step_name}_{_output:bn}'
 in exec mode

Just pushed another commit. Please try again.

I works now, thank you!

Great. I will create a new release of sos after more testing.

ok. I have just released sos 0.22.7. I have tried to make all sos tests run in the past few days. The problem was that the tests were using subprocess-based sos runs so all file handles will be reclaimed even if sos run failed. I have changed most of the tests to execute_workflow so many tests fail due to an insufficient number of file handlers, apparently caused by (intentionally) failed tests. The entire execution step is complicated so I have not figured out a good way to clean up properly.


[Fix:#27162] - Clear requirements for “Using Source IP” tutorial

Updated pre-requisites section of Using Source IP tutorial to make requirement of a multi-node cluster clear.
Fixes: #27162

/retitle Clear requirements for “Using Source IP” tutorial

I think this is also correct and makes the meaning more obvious
/retitle Clarify requirements for “Using Source IP” tutorial


perf: Make list calls more consistent

This has the added benefit that the list object
is created on the stack and not on the heap

In support of https://github.com/aws/karpenter/issues/3565
Description
I made no pointers to list objects were created before calling the kubeclient list call.
How was this change tested?
Unit tests, also deployed on a live environment to test out the performance.
This change reduces times spent in the UpdateDaemonSet function significantly. It went from 8s spent to not being in the tree anymore.
To create these images I took CPU profiles for 120s
Before:

After:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Can you share the scheduling benchmarks to see if there were any changes on timing performance here? Sharing manual testing and observed performance would also be useful.

Also, do you have any references to client-go best practices around list calls that shows it's preferable to use the real object vs. utilizing the pointer to the object? It's interesting to me that provisioning the same objects, but just referencing it by pointer in a scope of code affects CPU clock cycles so significantly

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

14 of 16 (87.5%)  changed or added relevant lines in 7 files are covered.
3 unchanged lines in 1 file lost coverage.
Overall coverage decreased (-0.04%) to 80.853%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

pkg/controllers/node/controller.go
0
2
0.0%

Files with Coverage Reduction
New Missed Lines
%

pkg/controllers/deprovisioning/controller.go
3
78.16%

Totals

Change from base Build<PHONE_NUMBER>:
-0.04%

Covered Lines:
6541

Relevant Lines:
8090

💛  - Coveralls

@jonathan-innis as I suspected the nodes were hidden and this has no performance impact, will close the PR

@stijndehaes Thanks for the follow-up. This is really good work though! If you find other performance improvements please don't hesitate to open PRs!


Feature proposal: Ability to inline delegate parameters

It would be very nice (albeit difficult to implement) if you could add a way to annotate parameters that are delegates to be inlined whenever applicable.
Such a use case would look like this:
using System;

ReadOnlySpan<int> nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

Console.WriteLine(IndexOf(nums, x => x is 5));

[Inline]
static int IndexOf<T>(ReadOnlySpan<T> span, [Inline] Predicate<T> predicate)
{
    for (var i = 0; i < span.Length; i++)
        if (predicate(span[i]))
            return i;

    return -1;
}

...would compile to...

ReadOnlySpan<int> nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
int indexOf;

for (var i = 0; i < nums.Length; i++)
    if (nums[i] is 5)
    {
        indexOf = i;
        goto AfterIndexOf;
    }

indexOf = -1;

AfterIndexOf:

    Console.WriteLine(indexOf);

There are only two constraints that a delegate must adhere to in order to be inlined.

The delegate must only exist in the execution stack.

You must only use the .Invoke method within the method body.
You cannot cast it to its base types Delegate or object.
You cannot return the delegate, pass the delegate into a type's constructor.
You cannot pass the delegate as an argument into a function that doesn't also annotate [Inline] on that parameter.

The delegate must be statically resolved.

Its target must be null.
It cannot capture any variables.

I believe this can be detected by seeing if a display class is generated, and a cached field is exposed.
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
    public static readonly <>c <>9 = new <>c();

    public static Predicate<int> <>9__0_0; // This line right here!

    internal bool <<Main>$>b__0_0(int x)
    {
        return x == 5;
    }
}

Keep in mind that the display class may reference an existing static function, in which case the class is static and therefore no instance is created, and the method body exists elsewhere:
[CompilerGenerated]
private static class <>O
{
    public static Predicate<int> <0>__IsFive;
}

Open questions:

Should a warning or error be shown if you annotate InlineAttribute on a parameter that is not a delegate?
Should we annotate using a different attribute instead of reusing the existing one?
Should the display class be pruned?
Should inlining occur across multiple variables, e.g.:

using System;

ReadOnlySpan<int> nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

ForEachComplex(
    nums,
    x => x % 2 is 0,
    x => Console.WriteLine($"Even: {x}"),
    x => Console.WriteLine($"Odd: {x}")
);

[Inline]
static void ForEachComplexBranching<T>(
    ReadOnlySpan<T> span,
    [Inline] Predicate<T> predicate,
    [Inline] Action<T> onTrue,
    [Inline] Action<T> onFalse
)
{
    for (var i = 0; i < span.Length; i++)
        if (predicate(span[i]))
            onTrue(span[i]);
        else
            onFalse(span[i]);
}

...can be optimized to...
using System;

ReadOnlySpan<int> nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

for (var i = 0; i < nums.Length; i++)
    if (nums[i] % 2 is 0)
        Console.WriteLine($"Even: {x}");
    else
        Console.WriteLine($"Odd: {x}");

Proposed only for delegates created inplace?

That is true, but it appears in all cases of a branch it starts with an ldsfld and ends with a stsfld instruction, both to a field whose classes is auto-generated. You can delete that range of instructions which means you don't have to worry about the branch.

The first step can be to resolve the predicate call from the delegate argument:
static int IndexOf(ReadOnlySpan<int> span, [ResolveDelegate] Predicate<int> predicate)
{
    for (var i = 0; i < span.Length; i++)
        if (predicate(span[i]))
            return i;

    return -1;
}

will became
{
    for (var i = 0; i < span.Length; i++)
        if (<>c.<>9.<Main>b__0_0(span[i]))
            return i;

    return -1;
}

<>c.<>9.<Main>b__0_0 can be inlined by JIT or InlineMethod if you add the Inline attribute to it:
Console.WriteLine(IndexOf(nums, [Inline] (x) => x is 5));

That'd be excellent! Is there any reason not to implicitly add the InlineAttribute, before passing it to the compile-time inliner? I think for most people if they want to inline the delegate indirection they also want to inline the method too. It's not a must, but I just think having to declare the delegate with Inline every time looks a bit noisy.

The first step is done

see https://github.com/oleg-st/InlineMethod.Fody/blob/master/src/InlineMethod.Tests.AssemblyToProcess/InlineDelegate.cs
Caller and Inlined will become the same.

That is the exact type of feature I wanted to see, I'd be very glad to see this in the next update. Thanks in advance!

Released in 0.8

Could you provide minimal repro code?
Possible bad IL is fixed in master

Just to be clear, I have pulled upstream and it does not appear to pass the test either.

I made some fixes in master

Tests pass for me personally, and adding the assembly has produced valid IL. Thank you very much!
Decompiled source (now correct)
public Animations Change<T>(T value) where T : struct, Enum
{
    Span<DrawableGameComponent> span = this._animations.AsSpan<DrawableGameComponent>();
    ref DrawableGameComponent local1 = ref MemoryMarshal.GetReference<DrawableGameComponent>(span);
    for (ref DrawableGameComponent local2 = ref Unsafe.Add<DrawableGameComponent>(ref local1, span.Length); Unsafe.IsAddressLessThan<DrawableGameComponent>(ref local1, ref local2); local1 = ref Unsafe.Add<DrawableGameComponent>(ref local1, 1))
    {
        if (local1 is Animation<T> animation)
            animation.Change(value);
    }
    return this;
}

Released in 0.8.1

@Emik03 Can we close the issue as resolved?

Is the code incorrect or just not the same as the manually inlined code?

It produces the wrong IL. It effectively did this:
var animations = _animations.AsSpan();
ref var start = ref MemoryMarshal.GetReference(animations);
ref var end = ref Unsafe.Add(ref start, animations.Length);

for (; Unsafe.IsAddressLessThan(ref start, ref end);
    start = ref Unsafe.Add(ref start, 1))
        if (start is Animation<T>
            ((Animation<Animation<T>>)start).Change(); // wrong cast!

You can see the unexpected nested generic call being used in actual's IL_003e.

I think it's fixed in 0.8.2

Awesome, it works for all of my current use cases, thank you once more for the hard work! I'll open a separate issue if I come across any bugs in the future.


Added trace chain of previous exceptions.

Added logging of previous exceptions, which is support by the Rollbar API.
Can this be merged as soon as possible? At the moment the exceptions that we are logging to Rollbar are effectively useless, because they do not show the previous exceptions. In most PHP Frameworks (we're using Zend 2) the framework will catch and re-throw original exceptions, so we're not currently able to track down the original bug without previous exceptions also being logged.

Thanks @lindyhopchris ! We'll review shortly.

Thanks @lindyhopchris ! This is now pushed in version 0.11.0.

Excellent, thanks!


express-pouchdb db.infos() is not a function

In this commit : https://github.com/pouchdb/pouchdb-server/commit/4d22dd4ef7dc3909db355cf10e8d1bc43df1f87d
The file lib/routes/db.js those line is added
var db = req.PouchDB.new(name, utils.makeOpts(req));
db.info(function (err, db) {

I don't know if it is because a new version of pouchDB but, the db variable is actualy a promise so db.info() throw an unhandledPromiseRejection here in a simple project where I try to sync to my database with a client.

I think 4.1.0 is broken -
yarn add express-pouchdb
cat node_modules/express-pouchdb/package.json
----
    "pouchdb-collections": "^6.4.1",
    "pouchdb-find": "^6.4.1",
    "pouchdb-list": "4.1.0",
    "pouchdb-promise": "^6.4.1",
    "pouchdb-replicator": "4.1.0",
    "pouchdb-rewrite": "4.1.0",
    "pouchdb-security": "4.1.0",
---

pouchdb-find should be at 7.0.0
TypeError: db.request is not a function
at find (/node_modules/express-pouchdb/node_modules/pouchdb-find/lib/index.js:52:6)
at PouchDB.<anonymous> (/node_modules/express-pouchdb/node_modules/pouchdb-find/lib/index.js:1373:3


Investigate where the hide this page button should be positioned on mobile

What
Investigate the position of the hide this page button on mobile as part of the hide this page work.
Why
Current the button sits at the bottom of the page as a sticky element, however discussions with the contributors have suggested that this is a problematic position as it interferes with next buttons in services.
This is intended as an investigation with implementation as proof of concept to be potentially used in the research into hide this page being done within the next quarter https://github.com/alphagov/govuk-design-system/issues/2085
Considerations

If the button is sticky, it shouldn't interfere with the user's journey
This blog post published by govuk investigating sticky elements suggests it could be an accessibility risk, something we will have to make a decision about

Who needs to work on this
@christopherthomasdesign @owenatgov @davidc-gds

[x] Investigate positioning options
[x] Roughly test options for usability and accessibility
[x] Implement into current prototype (https://github.com/alphagov/govuk-frontend/pull/2545)

We've made the decision to keep the button sticky but move it to the top of the page on mobile for now. This has been implemented on the draft proposals for both govuk-frontend and the design system.
The reason we've done this, whilst we're conscious of existing research into sticky buttons, is that we want to run this against our own usability and accessibility testing first, in the context of a service that could use it, to discern how much of a risk this decision is to keyboard navigation and non-sighted users.


Shared preferences

[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Field 'sharedPreferences' has not been initialized.
E/flutter ( 7771): #0      sharedPreferences (package:nb_utils/nb_utils.dart)
E/flutter ( 7771): #1      getStringAsync (package:nb_utils/src/utils/shared_pref.dart:68:10)

It looks like you forget to initialize nb_utils library. See below.
`
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await initialize();
runApp(MyApp());
}
`

Thank you. (Solved)


Double fill on hyperliquid_perpetual after stopping strategy v2_funding_rate_arb

Describe the bug
When stop[ping the strategy one position closes right away, the positon on hyperliquid_perpetual throws an error first and then executies twice.
Steps to reproduce

configre v2_funding_rate_arb strategy with one leg on hyperliquid_perpetual
start v2_funding_rate_arb strategy
stop the strategy

Release version
2.1.1
Type of installation
Source
Attach required files
2024-11-14 16:47:02,095 - 1101972 - hummingbot.client.hummingbot_application - INFO - stop command initiated.
2024-11-14 16:47:02,276 - 1101972 - hummingbot.connector.client_order_tracker - INFO - Created MARKET SELL order HummingbotSPLUT626e15c86c24178707925 for 78 to CLOSE a PIXEL-USDT position at NaN.
2024-11-14 16:47:02,332 - 1101972 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp":<PHONE_NUMBER>.2, "type": "OrderType.MARKET", "trading_pair": "PIXEL-USDT", "amount": "78", "price": "NaN", "order_id": "HummingbotSPLUT626e15c86c24178707925", "creation_timestamp":<PHONE_NUMBER>.0, "exchange_order_id": "da4cd740-045f-49b9-a0fa-dae5779d3fe7", "leverage": 10, "position": "CLOSE", "event_name": "SellOrderCreatedEvent", "event_source": "bybit_perpetual"}
2024-11-14 16:47:02,336 - 1101972 - hummingbot.connector.client_order_tracker - INFO - The SELL order HummingbotSPLUT626e15c86c24178707925 amounting to 78/78 PIXEL has been filled at 0.1837 USDT.
2024-11-14 16:47:02,352 - 1101972 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp":<PHONE_NUMBER>.3000002, "order_id": "HummingbotSPLUT626e15c86c24178707925", "trading_pair": "PIXEL-USDT", "trade_type": "TradeType.SELL", "order_type": "OrderType.MARKET", "price": "0.1837", "amount": "78", "trade_fee": {"percent": "0", "percent_token": "USDT", "flat_fees": [{"token": "USDT", "amount": "0.00788073"}]}, "exchange_trade_id": "d919d7a2-6b24-5727-a552-84a7ca444e4d", "exchange_order_id": "da4cd740-045f-49b9-a0fa-dae5779d3fe7", "leverage": 10, "position": "CLOSE", "event_name": "OrderFilledEvent", "event_source": "bybit_perpetual"}
2024-11-14 16:47:02,360 - 1101972 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp":<PHONE_NUMBER>.3000002, "order_id": "HummingbotSPLUT626e15c86c24178707925", "base_asset": "PIXEL", "quote_asset": "USDT", "base_asset_amount": "78", "quote_asset_amount": "14.3286", "order_type": "OrderType.MARKET", "exchange_order_id": "da4cd740-045f-49b9-a0fa-dae5779d3fe7", "event_name": "SellOrderCompletedEvent", "event_source": "bybit_perpetual"}
2024-11-14 16:47:02,360 - 1101972 - hummingbot.connector.client_order_tracker - INFO - SELL order HummingbotSPLUT626e15c86c24178707925 completely filled.
2024-11-14 16:47:03,110 - 1101972 - hummingbot.strategy_v2.executors.position_executor.position_executor - INFO - Waiting for close order to be filled
2024-11-14 16:47:03,112 - 1101972 - hummingbot.strategy_v2.executors.position_executor.position_executor - ERROR - Close order failed 0xa1da86bf0d142e1e515e8b949e9ecb11. Retrying 1/10
2024-11-14 16:47:03,114 - 1101972 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp":<PHONE_NUMBER>.8000002, "order_id": "0xa1da86bf0d142e1e515e8b949e9ecb11", "order_type": "OrderType.MARKET", "event_name": "MarketOrderFailureEvent", "event_source": "hyperliquid_perpetual"}
2024-11-14 16:47:03,114 - 1101972 - hummingbot.connector.client_order_tracker - INFO - Order 0xa1da86bf0d142e1e515e8b949e9ecb11 has failed. Order Update: OrderUpdate(trading_pair='PIXEL-USD', update_timestamp=1731599222.7, new_state=<OrderState.FAILED: 6>, client_order_id='0xa1da86bf0d142e1e515e8b949e9ecb11', exchange_order_id=None, misc_updates=None)
2024-11-14 16:47:03,358 - 1101972 - hummingbot.connector.client_order_tracker - INFO - The BUY order 0xa1da86bf0d142e1e515e8b949e9ecb11 amounting to 78.0/78 PIXEL has been filled at 0.184 USD.
2024-11-14 16:47:03,374 - 1101972 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp":<PHONE_NUMBER>.3000002, "order_id": "0xa1da86bf0d142e1e515e8b949e9ecb11", "trading_pair": "PIXEL-USD", "trade_type": "TradeType.BUY", "order_type": "OrderType.MARKET", "price": "0.184", "amount": "78.0", "trade_fee": {"percent": "0", "percent_token": "USD", "flat_fees": [{"token": "USD", "amount": "0.005023"}]}, "exchange_trade_id": "917617665781235", "exchange_order_id": "47262492601", "leverage": 10, "position": "CLOSE", "event_name": "OrderFilledEvent", "event_source": "hyperliquid_perpetual"}
2024-11-14 16:47:07,372 - 1101972 - hummingbot.connector.client_order_tracker - INFO - Created MARKET BUY order 0x304c14d135b77d3ae22b8dec3bf4dda0 for 78 to CLOSE a PIXEL-USD position at 0.192879999999999995896615700985421426594257354736328125.
2024-11-14 16:47:07,382 - 1101972 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp":<PHONE_NUMBER>.3000002, "type": "OrderType.MARKET", "trading_pair": "PIXEL-USD", "amount": "78", "price": "0.192879999999999995896615700985421426594257354736328125", "order_id": "0x304c14d135b77d3ae22b8dec3bf4dda0", "creation_timestamp":<PHONE_NUMBER>.1000001, "exchange_order_id": "47262527630", "leverage": 10, "position": "CLOSE", "event_name": "BuyOrderCreatedEvent", "event_source": "hyperliquid_perpetual"}
2024-11-14 16:47:07,523 - 1101972 - hummingbot.connector.client_order_tracker - INFO - The BUY order 0x304c14d135b77d3ae22b8dec3bf4dda0 amounting to 78.0/78 PIXEL has been filled at 0.18385 USD.
2024-11-14 16:47:07,540 - 1101972 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp":<PHONE_NUMBER>.4, "order_id": "0x304c14d135b77d3ae22b8dec3bf4dda0", "trading_pair": "PIXEL-USD", "trade_type": "TradeType.BUY", "order_type": "OrderType.MARKET", "price": "0.18385", "amount": "78.0", "trade_fee": {"percent": "0", "percent_token": "USD", "flat_fees": [{"token": "USD", "amount": "0.005019"}]}, "exchange_trade_id": "494627080756408", "exchange_order_id": "47262527630", "leverage": 10, "position": "CLOSE", "event_name": "OrderFilledEvent", "event_source": "hyperliquid_perpetual"}
2024-11-14 16:47:07,548 - 1101972 - hummingbot.core.event.event_reporter - EVENT_LOG - {"timestamp":<PHONE_NUMBER>.4, "order_id": "0x304c14d135b77d3ae22b8dec3bf4dda0", "base_asset": "PIXEL", "quote_asset": "USD", "base_asset_amount": "78.0", "quote_asset_amount": "14.340300", "order_type": "OrderType.MARKET", "exchange_order_id": "47262527630", "event_name": "BuyOrderCompletedEvent", "event_source": "hyperliquid_perpetual"}
2024-11-14 16:47:07,549 - 1101972 - hummingbot.connector.client_order_tracker - INFO - BUY order 0x304c14d135b77d3ae22b8dec3bf4dda0 completely filled.

Looks the same indeed. I retried later yesterday but it got even more messy with lost child orders and duplicate orders.....
20241114.txt
The conf is pretty straight forward. What I did forgot to mention is that I set the clock to 0.1.
markets: {}
candles_config: []
controllers_config: []
config_update_interval: 60
script_file_name: v2_funding_rate_arb.py
leverage: 1
min_funding_rate_profitability: 0.001
connectors:

hyperliquid_perpetual
bybit_perpetual
tokens:
GRASS
MOODENG
position_size_quote: 15
profitability_to_take_profit: 0.005
funding_rate_diff_stop_loss: 0
trade_profitability_condition_to_enter: true

It's not just Hyperliquid. I just tried an OKX - Bybit arb withh the same v2_funding_rate_arb strategy and very messy duplicate executions on Bybit only
20241116.txt
Config:
markets: {}
candles_config: []
controllers_config: []
config_update_interval: 60
script_file_name: v2_funding_rate_arb.py
leverage: 1
min_funding_rate_profitability: 0.00025
connectors:

bybit_perpetual
okx_perpetual
tokens:
IMX
LTC
POL
position_size_quote: 15
profitability_to_take_profit: 0.005
funding_rate_diff_stop_loss: 0
trade_profitability_condition_to_enter: true


Intermittent failure of CamelDevModeTest

Seems CamelMainEventBridge fires events after Quarkus is shutdown and thus the Arc container is null. Hence IllegalArgumentException is thrown here.
[INFO] Running org.apache.camel.quarkus.main.CamelDevModeTest
2020-07-09 15:38:44,916 INFO  [org.apa.cam.qua.mai.dep.CamelMainHotDeploymentProcessor] (build-15) HotDeployment files (camel.main.xml-routes):
2020-07-09 15:38:44,916 INFO  [org.apa.cam.qua.mai.dep.CamelMainHotDeploymentProcessor] (build-15) - /tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:46,104 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (Quarkus Main Thread) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2020-07-09 15:38:46,136 INFO  [org.apa.cam.mai.BaseMainSupport] (Quarkus Main Thread) Auto-configuration summary:
2020-07-09 15:38:46,137 INFO  [org.apa.cam.mai.BaseMainSupport] (Quarkus Main Thread) 	camel.main.xmlRoutes=file:/tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:46,139 INFO  [org.apa.cam.qua.mai.CamelMainRoutesCollector] (Quarkus Main Thread) Loading additional Camel XML routes from: file:/tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:46,247 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-1) is starting
2020-07-09 15:38:46,249 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2020-07-09 15:38:46,253 INFO  [org.apa.cam.imp.eng.InternalRouteStartupManager] (Quarkus Main Thread) Route: r1 started and consuming from: direct://start
2020-07-09 15:38:46,255 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Total 1 routes, of which 1 are started
2020-07-09 15:38:46,255 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-1) started in 0.007 seconds
2020-07-09 15:38:46,341 INFO  [io.quarkus] (Quarkus Main Thread) Quarkus 1.6.0.Final on JVM started in 2.007s. Listening on: http://<IP_ADDRESS>:8080
2020-07-09 15:38:46,341 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2020-07-09 15:38:46,341 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [camel-core, camel-direct, camel-log, camel-main, camel-policy, camel-support-common, camel-timer, camel-xml-io, cdi, resteasy, resteasy-jsonb]
2020-07-09 15:38:48,400 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Timer-0) File change detected: /tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:48,403 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-1) is shutting down
2020-07-09 15:38:48,408 INFO  [org.apa.cam.mai.MainLifecycleStrategy] (Quarkus Main Thread) CamelContext: camel-1 has been shutdown, triggering shutdown of the JVM.
2020-07-09 15:38:48,410 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-1) uptime 2.161 seconds
2020-07-09 15:38:48,410 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-1) is shutdown in 0.007 seconds
2020-07-09 15:38:48,442 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-2) File change detected: /tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:48,457 INFO  [io.quarkus] (Quarkus Main Thread) Quarkus stopped in 0.055s
2020-07-09 15:38:48,555 INFO  [org.apa.cam.qua.mai.dep.CamelMainHotDeploymentProcessor] (build-24) HotDeployment files (camel.main.xml-routes):
2020-07-09 15:38:48,555 INFO  [org.apa.cam.qua.mai.dep.CamelMainHotDeploymentProcessor] (build-24) - /tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:48,828 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (Quarkus Main Thread) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2020-07-09 15:38:48,837 INFO  [org.apa.cam.mai.BaseMainSupport] (Quarkus Main Thread) Auto-configuration summary:
2020-07-09 15:38:48,837 INFO  [org.apa.cam.mai.BaseMainSupport] (Quarkus Main Thread) 	camel.main.xmlRoutes=file:/tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:48,838 INFO  [org.apa.cam.qua.mai.CamelMainRoutesCollector] (Quarkus Main Thread) Loading additional Camel XML routes from: file:/tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:48,840 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-2) is starting
2020-07-09 15:38:48,841 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2020-07-09 15:38:48,841 INFO  [org.apa.cam.imp.eng.InternalRouteStartupManager] (Quarkus Main Thread) Route: r2 started and consuming from: direct://start
2020-07-09 15:38:48,842 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Total 1 routes, of which 1 are started
2020-07-09 15:38:48,842 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-2) started in 0.002 seconds
2020-07-09 15:38:48,856 INFO  [io.quarkus] (Quarkus Main Thread) Quarkus 1.6.0.Final on JVM started in 0.391s. Listening on: http://<IP_ADDRESS>:8080
2020-07-09 15:38:48,856 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2020-07-09 15:38:48,857 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [camel-core, camel-direct, camel-log, camel-main, camel-policy, camel-support-common, camel-timer, camel-xml-io, cdi, resteasy, resteasy-jsonb]
2020-07-09 15:38:48,857 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (Timer-0) Hot replace total time: 0.457s
2020-07-09 15:38:48,857 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-2) is shutting down
2020-07-09 15:38:48,859 INFO  [org.apa.cam.mai.MainLifecycleStrategy] (Quarkus Main Thread) CamelContext: camel-2 has been shutdown, triggering shutdown of the JVM.
2020-07-09 15:38:48,859 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-2) uptime 0.019 seconds
2020-07-09 15:38:48,860 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-2) is shutdown in 0.003 seconds
2020-07-09 15:38:48,860 INFO  [io.quarkus] (Quarkus Main Thread) Quarkus stopped in 0.003s
2020-07-09 15:38:48,861 ERROR [org.apa.cam.qua.mai.CamelMainRuntime] (Thread-265) Failed to start application: java.lang.IllegalArgumentException
	at io.quarkus.arc.impl.ArcContainerImpl.unwrap(ArcContainerImpl.java:697)
	at io.quarkus.arc.impl.EventImpl.createNotifier(EventImpl.java:138)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
	at io.quarkus.arc.impl.EventImpl.getNotifier(EventImpl.java:112)
	at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:69)
	at org.apache.camel.quarkus.main.CamelMainEventBridge.fireEvent(CamelMainEventBridge.java:89)
	at org.apache.camel.quarkus.main.CamelMainEventBridge.afterStop(CamelMainEventBridge.java:85)
	at org.apache.camel.main.MainSupport.afterStop(MainSupport.java:118)
	at org.apache.camel.quarkus.main.CamelMain.runEngine(CamelMain.java:138)
	at org.apache.camel.quarkus.main.CamelMainRuntime.lambda$start$0(CamelMainRuntime.java:50)
	at java.base/java.lang.Thread.run(Thread.java:834)

2020-07-09 15:38:48,944 INFO  [org.apa.cam.qua.mai.dep.CamelMainHotDeploymentProcessor] (build-12) HotDeployment files (camel.main.xml-routes):
2020-07-09 15:38:48,944 INFO  [org.apa.cam.qua.mai.dep.CamelMainHotDeploymentProcessor] (build-12) - /tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:49,207 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (Quarkus Main Thread) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2020-07-09 15:38:49,216 INFO  [org.apa.cam.mai.BaseMainSupport] (Quarkus Main Thread) Auto-configuration summary:
2020-07-09 15:38:49,216 INFO  [org.apa.cam.mai.BaseMainSupport] (Quarkus Main Thread) 	camel.main.xmlRoutes=file:/tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:49,216 INFO  [org.apa.cam.qua.mai.CamelMainRoutesCollector] (Quarkus Main Thread) Loading additional Camel XML routes from: file:/tmp/camel-devmode-9461026744410861234/routes.xml
2020-07-09 15:38:49,219 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-3) is starting
2020-07-09 15:38:49,220 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2020-07-09 15:38:49,221 INFO  [org.apa.cam.imp.eng.InternalRouteStartupManager] (Quarkus Main Thread) Route: r2 started and consuming from: direct://start
2020-07-09 15:38:49,222 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Total 1 routes, of which 1 are started
2020-07-09 15:38:49,222 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-3) started in 0.002 seconds
2020-07-09 15:38:49,224 INFO  [io.quarkus] (Quarkus Main Thread) Quarkus 1.6.0.Final on JVM started in 0.358s. Listening on: http://<IP_ADDRESS>:8080
2020-07-09 15:38:49,225 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2020-07-09 15:38:49,225 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [camel-core, camel-direct, camel-log, camel-main, camel-policy, camel-support-common, camel-timer, camel-xml-io, cdi, resteasy, resteasy-jsonb]
2020-07-09 15:38:49,226 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-2) Hot replace total time: 0.785s
2020-07-09 15:38:49,252 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-3) is shutting down
2020-07-09 15:38:49,254 INFO  [org.apa.cam.mai.MainLifecycleStrategy] (Quarkus Main Thread) CamelContext: camel-3 has been shutdown, triggering shutdown of the JVM.
2020-07-09 15:38:49,255 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-3) uptime 0.034 seconds
2020-07-09 15:38:49,255 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.0 (camel-3) is shutdown in 0.003 seconds
2020-07-09 15:38:49,255 INFO  [io.quarkus] (Quarkus Main Thread) Quarkus stopped in 0.003s
Exception in thread "Thread-289" java.lang.RuntimeException: java.lang.IllegalArgumentException
	at org.apache.camel.quarkus.main.CamelMainRuntime.lambda$start$0(CamelMainRuntime.java:54)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException
	at io.quarkus.arc.impl.ArcContainerImpl.unwrap(ArcContainerImpl.java:697)
	at io.quarkus.arc.impl.EventImpl.createNotifier(EventImpl.java:138)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
	at io.quarkus.arc.impl.EventImpl.getNotifier(EventImpl.java:112)
	at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:69)
	at org.apache.camel.quarkus.main.CamelMainEventBridge.fireEvent(CamelMainEventBridge.java:89)
	at org.apache.camel.quarkus.main.CamelMainEventBridge.afterStop(CamelMainEventBridge.java:85)
	at org.apache.camel.main.MainSupport.afterStop(MainSupport.java:118)
	at org.apache.camel.quarkus.main.CamelMain.runEngine(CamelMain.java:138)
	at org.apache.camel.quarkus.main.CamelMainRuntime.lambda$start$0(CamelMainRuntime.java:50)
	... 1 more
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.903 s <<< FAILURE! - in org.apache.camel.quarkus.main.CamelDevModeTest
[ERROR] testRoutesDiscovery  Time elapsed: 6.867 s  <<< ERROR!
java.lang.RuntimeException: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException

guess we need to guard against the getEvent returning null here: https://github.com/apache/camel-quarkus/blob/master/extensions-core/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEventBridge.java#L89

Seems to be a race condition. Even with the guard it still fails occasionally. The Arc container must be getting nullified between firing the event and the Quarkus bits doing the createNotifier stuff.

I don't think this is fully fixed. I still see the occasional failure locally and the nightly quarkus-master sync job failed:
https://github.com/apache/camel-quarkus/runs/875865498

Do you happen to have a stack trace at hand?

One in how many failures do you see locally?

I am running i=0; while mvn clean test; do echo "success $i"; i=$((i+1)); done and I am at success 25 without any failure.

Seems it's the same issue.
Caused by: java.lang.IllegalArgumentException
	at io.quarkus.arc.impl.ArcContainerImpl.unwrap(ArcContainerImpl.java:697)

One in how many failures do you see locally?

I just ran the build and it failed on the first try. The same thing happened yesterday.
Like I said in our chat on Monday, Quarkus shutdown tasks are executed in reverse order to which they were added.  The Arc shutdown task is added after Camel's, so it runs first. I'm not sure whether the current solution of awaiting camel shutdown actually helps much, because the Arc container shutdown will already be in progress (I think).

Just to make sure: the name of the thread throwing the exception is camel-main?

Just to make sure: the name of the thread throwing the exception is camel-main?

Yes - seems so.

we can disable firing the shutdown events till we have a clear solution, there is still an option to register an handler that does not depend on CDI so if that's really needed, we have a workaround

The Arc shutdown task is added after Camel's, so it runs first.

There are two shutdown tasks added by io.quarkus.arc.runtime.ArcRecorder:

One that calls Arc.shutdown()
And one that calls LifecycleEventRunner.fireShutdownEvent()

I can see the following (IMO correct) ordering of the tasks on shutdown:

LifecycleEventRunner.fireShutdownEvent()
our CamelRuntime.stop()
Arc.shutdown()

I think I know what is the problem. My fix is flawed. Calling CamelMain.ShutdownStrategy.await(long, TimeUnit) does not wait for finishing CamelMain.[beforeStart()|start()|afterStart()]. Let me think of a better fix.

@ppalaga as beforeStart()|start()|afterStart() is invoked as part of Runtime.start(), then it should be completed when the Runtime.start() is completed, isn't it ?

Sorry, I meant CamelMain.[beforeStop()|stop()|afterStop()]


Component: Avatar

Figma
https://www.figma.com/file/xZ0IW0MJO0vnFicmrHiKaY/Components-Post?type=design&node-id=1751%3A54913&mode=design&t=v21xVVGydMFRQiHB-1

added some comments @kaloyanso


Memory leak fixed.

Memory leak fixed. CGPathref was not released, producing an object with a retain count +1.
Fixed some warnings.

thanks for contributing!


Question about R2D2 loss, masking, and episode boundaries

This is the R2D2 loss: https://github.com/deepmind/acme/blob/b9ba5953495c76b20b0d7a2e4b2e7301a828b75c/acme/agents/jax/r2d2/learning.py#L140
I believe the data.discounts specify episode boundaries. Inspecting the loss when data.discounts is 0, I found that there are non-zero loss values that are summed into the overall loss. How come those values not masked out?
E.g. with something like the following:
mask=(data.discounts > 0).astype(jnp.float32)[:-1]
loss = (0.5 * jnp.square(batch_td_error))
loss = loss*mask
batch_loss = loss.sum(0)/(mask.sum(0)+1e-5)

Am I misunderstanding something?

So I found that proper masking is important having td-learning based agents generalize. I compute my mask as follows:
mask=jnp.concatenate((jnp.ones((1, B)), data.discount[:-1]), axis=0)

I found that I need to add ones to the first time-axis to account for discount=0 when episode is done. Consider length-3 episode that terminates after second state. This leads to:
states:      s1  s2 s3
done:        0   1   0
gammas:  1   0   0
mask:        1  1   1


Document how to create a nood pool in a certain AD.

Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description
I don't see anywhere in the docs how you would place a node pool in a specific AD.
I found out if you put placement_ads = ["1"] in the node_pools.${node_name} config it will place the node in the first AD.  So all together it would look like:
worker_pools =   np-ad1 = {
    shape         = "VM.Standard.A1.Flex",
    placement_ads = ["1"]
    ocpus         = 2,
    memory        = 8,
    size          = 3,
  }

New or Affected Resource(s)

Potential Terraform Configuration

# Copy-paste any Terraform configurations for how the requested feature may be used.

References

I wish I had come and looked here first than spending over an hour trying to dive through the code of the module trying to figure this out and failing miserably.


update yum version

we need to update the yum image version in the CFTs and upload it to marketplace ECT

PR merged, revision created


[USERSNAP] Bug my wallet of 194 ada is showing up with 372359 voting power. Correct delegation.

Taken at: https://gov.tools/dashboard
Fields:

Add a comment: Bug my wallet of 194 ada is showing up with 372359 voting power. Correct delegation.

Browser: Chrome 129 (Windows 10)
Screen size: 2560x1440
Open #135 in Usersnap
Powered by Usersnap.

I don't know if we can investigate this without seeing the user's wallet balance, stake keys etc. @Ryun1?


Set the "debugger typealias" bit on synthesized typealiases.

LLDB creates typealiases that involve archetypes that weren't introduced
in the enclosing context, which violates some of Swift's AST invariants.
Mark such typealiases as "debugger typealiases" so the Swift frontend
can tip-toe around them when needed.
We'll eventually want to rework the LLDB <-> Swift frontend
interaction here, but this allows us to tighten up AST verification in
the Swift frontend without breaking LLDB.

This adopts the bit introduced in https://github.com/apple/swift/pull/15527.

@swift-ci please test and merge


"is_online" not working.

As i understand it, "is_online" could be used to detect presence!? My client (smartphone) is permanetely online even if i deactivate the WiFi.

@MikeEcho0815 As mentioned on the configuration page, you have to also enable the update of last_seen_by_uap and last_seen_by_usw to get is_online working.

@MikeEcho0815 I just noticed that the hint on the configuration page was wrong and mentioned the wrong states. It has been corrected with v0.5.2. Maybe this is why is_online was not working for you.

@braindead1 OKay, i added the right datapoints. I'll give it a try.

I've tested it with the right datapoints and it works as expected

Same here! Thank you!


queryRaw returns incorrect type for sum of bigints

Bug description
When running queryRaw and summing bigint fields, I expect the result to be a bigint. But its type is different.
The workaround which can be used for now involves manually casting the result of the sum to bigint.
How to reproduce

Run tihs code:

const x = await prisma.$queryRaw<{value: bigint}[]>`SELECT SUM(1::BIGINT) AS value`

x[0].value is expected to be a bigint, but it is an object instead:

{s: 1, e: 0, d: [1]}

Workaround we can use for now is to cast the sum to bigint:

const x = await prisma.$queryRaw<{value: bigint}[]>`SELECT SUM(1::BIGINT)::BIGINT AS value`

Expected behavior
No response
Prisma information
Does not depend on any prisma schema
Environment & setup

OS: Ubuntu 22.04
Database: PostgreSQL
Node.js version: 16.15.0

Prisma Version
4.4

Hi there! I wasn't able to reproduce this, if you have any further information or a minimal reproduction where this error occurs, that would help a lot!
-- MacOs; Prisma v4.6.1; repo

Getting the same bug. My opened issue link: https://github.com/prisma/prisma/issues/18407

Hi there! I wasn't able to reproduce this, if you have any further information or a minimal reproduction where this error occurs, that would help a lot!
-- MacOs; Prisma v4.6.1; repo

You seem to be not using NodeJS

@janpio I just missed the link to the repo and thought those "prisma:client" lines were some sort of REPL :)
So it is "1", when printed as string, but:
  const b = await prisma.$queryRaw<{value: bigint}[]>`SELECT SUM(1::BIGINT) AS value`
  const x = await prisma.$queryRaw<{value: bigint}[]>`SELECT SUM(1::BIGINT)::BIGINT AS value`
  const properBigint: bigint = 1n
  console.log(`b (not cast): ${b[0].value}, type is ${typeof b[0].value}, should be ${typeof properBigint}`);
  console.log(`x (cast): ${x[0].value}, type is ${typeof x[0].value}, should be ${typeof properBigint}`);

prints:
b (not cast): 1, type is object, should be bigint
x (cast): 1, type is bigint, should be bigint

and when debugging I can see this:

Seems I have figured out the problem.
Does Prisma uses Decimal JS?
I decided to use it to get rid from floating issue, getting similar picture:

Any progress?

@RomanSkrypnik Not sure how does your issue relate. The expectation is that the raw query would return proper bigint. How could possibly calling toNumber() help with that?

Please, check this issue in Prisma ORM

Where exactly?

@RomanSkrypnik Not sure how does your issue relate. The expectation is that the raw query would return proper bigint. How could possibly calling toNumber() help with that?

Please, check this issue in Prisma ORM

Where exactly?

Under the hood I mean, it's problem of Prisma ORM which seems uses Decimal JS which causes such a bug


templating

While working on the vert.x language bindings for Ceylon, I remembered how awful dealing with templating is. No autocompletion, no syntax highlighting, incorrect line numbers in error messages, etc.
So, just for fun, I quickly implemented a template language into the Ceylon compiler.
The grammar is trivial:

lines beginning with $ contain Ceylon code
other lines contain literal text that will be appended to a StringBuilder
text lines may contain interpolated expressions ${...} as in #7243

For example, this file, hello-template.ceylon, is a Ceylon template:
$ String hello(String* names) {
Hello Templates
===============
$ for (name in names) {
Hello ${name}!
$ }
---------------
$ }

This regular Ceylon code in run.ceylon uses it:
shared void run() => print(hello("C", "Java", "Ceylon"));

Running the program prints:
Hello Templates
===============
Hello C!
Hello Java!
Hello Ceylon!
---------------

Reactions?

You can try this out on the 7258 branch.

I quickly implemented a template language into the Ceylon compiler.

Note: what I mean by that is: this is basically a lexer hack, though it does slightly impact the parser. Other than the custom lexer this is just regular Ceylon code you compile and run as usual.

Interesting. I suppose you can implement standard tags of groovy templates such as if/list easily with Ceylon statements/expressions. Any custom tag too, with just functions. How would you go about declaring custom tags that have a body, such as form here: https://github.com/ceylon/ceylon-herd/blob/master/app/views/Uploads/view.html#L214 ?

@FroMage well I guess you write a function?

I mean in principle you can do stuff like this:
$ list(things, (thing) {
Hello ${thing}
$ });
Though I guess I need to add the two lines of code to make templates work inside an anonymous function.

But if you're looking for structured tags like $tag...$endtag I have not even thought about that problem.

I guess it's trivial to add structured tags. If you just tell me what the syntax should be @FroMage.
I imagine something like $list(things) ... $!list or whatever. Where list()() is a curried function accepting a function.

Or $list{items=things;} ... $!list

Reactions?

OMG!

How would you go about declaring custom tags that have a body

Why not something like this?
$ String form(String url, {String*} body) {
    <form action="${url}">
        ${body}
    </form>
$ }

Used like this:
$ form('/user/update', {
    <button type="submit" class="btn btn-mini"
        title="Do not resolve anything from Maven Central"> Do not resolve anything from Maven Central</button>
$ })

I tend to have a hard time to relate close tags with }) especially in the absence of indentation.
Also note that very often I need to put tags like list or if inline to not generate unwanted spaces and newlines in space-sensitive HTML elements.

Actually, if the lexer considers everything between the new line and the next $ character as a String, we could drop the braces and do this:
$ String form(String url, String body) {
    <form action="${url}">
        ${body}
    </form>
$ }

$ form('/user/update',
    <button type="submit" class="btn btn-mini"
        title="Do not resolve anything from Maven Central"> Do not resolve anything from Maven Central</button>
$ )

or using named parameters:
$ form {
$     url = '/user/update';
$     body =
    <button type="submit" class="btn btn-mini"
        title="Do not resolve anything from Maven Central"> Do not resolve anything from Maven Central</button>
$ ; }

I find the named parameters option less readable though, because of all these dollars.

@bjansen currently the only place it makes sense to have text content is within the body of a function, but of course I could change that and allow it within expressions as well.

(This was an experiment I threw together quickly without much thinking beforehand.)

(This was an experiment I threw together quickly without much thinking beforehand.)

I think it deserves to be more than that and become an actual feature :)

I think it deserves to be more than that and become an actual feature :)

Fine. Then I think we should come up with a nice syntax for the usage side of tags. (Defining a tag seems easy.)

@bjansen your HTML example is almost hard for me to look at, given it's treatment of HTML as "just" plain text w/o escaping to prevent bugs and XSS vulnerabilities!

Reactions?

I have mixed feelings on this.
While built in templating would be nice, the syntax and feature set will probably not be ideal without organic growth over time with real world use. Even if released as experimental and allowing for future breaking changes, my concern is that it further expands Ceylon’s footprint beyond what the community can support.
Perhaps a larger concern is the proposal’s embracement of mixing logic and code with templating, whereas many have found that “logic-less” templates are a much better approach (e.g. String Template and Mustache). Advantages to logic-less templates include a) helping programers avoid creating hard to read and maintain messes, and b) keeping templates simple so that non-programmers can edit them.
You could argue that Ceylon templates are just for “simple” uses, while larger or more complex sites or files should be built with another templating engine. But that sort of reasoning isn’t sound. People keeping using what they know, even as scope and complexity increases. See server side JavaScript.

given it's treatment of HTML as "just" plain text w/o escaping to prevent bugs and XSS vulnerabilities!

You're right that at least in Play 1, template expressions returning a string are escaped (anything within ${}) and are only non-escaped if they return a RawHtml type to wrap the string.

Another option for the tag syntax might be something like

$tag() ... $tag for no arguments,
$tag(a, b, c) ... $tag for positional arguments, and
$tag{ a=a; b=b; c=c; } ... $tag for named arguments.

i.e, $tag with no parameter list indicates a closing tag.

Having auto-completion in templating would be really cool feature.
Just throwing an idea, could we leverage and make Ceylon formatter generic enough so a user could use it to format its generated stuff?

While we’re talking about this - you should all look at Razr template syntax in C#. It is quite neat and I think it is strikingly similar to

sorry for closing, My phone acted up ... :(


how to remove redundancy of schedule configuration for timer-triggered azure web job?

Hi, My timer-triggered azure web job is written with c# web job v3 SDK, and I use TimerTrigger attribute to decorate my timer callback. Problem is, this attribute has to take a schedule parameter in cron or scheduleType format, so i have to duplicate this schedule in both settings.job and TimerTrigger decorator. Is there any mechanism for my c# code to get the schedule from settings.job, so that in my code base i only need to define this schedule in 1 place (settings.job) ?
One work-around I can think of is to maybe define this web job as a continuous job, so that i don't need to config schedule on settings.job, and i only need to hard-code the schedule in c# code. But I feel it's not ideal.
    // timer callback
    public static async Task TimerCallback([TimerTrigger("0 0 */1 * * *")] TimerInfo timerInfo)
    {
        // business logic
    }

Any suggestion would be helpful. Thanks!

Hi
If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure:
https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request
This way we can better track and assist you on this case
Thanks,
Joaquin Vano
Azure App Service


New SteamVR update

With the new SteamVR update, using OpenComposite and OpenXR toolkit when I play my racing sims the menus are not where they are supposed to be.  In Automobilista 2 and in Project Cars 2 the menus are way above my head and behind me.  If I completely turn around and look at the floor I can recenter my view and then the menu will be in front of me, but still way above me where I am having to look up.  The menu and HUD in game are the same.  In Assetto Corsa Competizione the menu doesn't display at all.  The game can't be play.  I am using the Vive Pro 2, Vive Console Beta <IP_ADDRESS> (also tried public non beta, and beta <IP_ADDRESS> same results).  I did try going back to SteamVR to make sure it wasn't something else, and it worked as it should, but performance is horrible of course.  I do not know if this is more of an OpenComposite issue, or with OpenXR Toolkit, so thought I would start here.  Thanks
XR_APILAYER_MBUCCHIA_toolkit.log

Thank you for attaching the log file. I will take a look when I am back from vacation.

Thank you

I think this thread confirms that the issue is not OpenXR Toolkit:
https://steamcommunity.com/app/250820/discussions/3/3808406007543348602/
See possible resolution:

Yes sir, I do believe that is it.  Thank you
On Thursday, July 13, 2023 at 09:04:22 PM CDT, Matthieu Bucchianeri @.***> wrote:
I think this thread confirms that the issue is not OpenXR Toolkit:
https://steamcommunity.com/app/250820/discussions/3/3808406007543348602/
See possible resolution:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

Not an issue of OpenXR Toolkit.


64-bit id support

When working with the GitHub statuses API, it appears that IDs that surpass the 32-bit mark it throws the following exception:
com.fasterxml.jackson.core.JsonParseException: Numeric value (x) out of range of int.
I haven't checked if it goes all the way to the jackson-core project, but the status IDs now generated have gone past<PHONE_NUMBER>, which is the maximum uint value.
It'd be great if we could fix this, and I'd be happy to do the pull request if given some pointers and pairing. Thanks beforehand.

Integer.MAX_VALUE in Java is<PHONE_NUMBER>, to fix this all "id" fields for data transfer objects used by jackson will need to be changed to long.

https://github.com/kohsuke/github-api/blob/master/src/main/java/org/kohsuke/github/GHObject.java#L28 already has long for id, @Raimmaster can you provide a full error message / stacktrace please?

Yes, that's why I said that it even surpassed the maximum uint value. Regardless, the change must be done in both repos, right? Or am I mistaken in that sense?

both repos? no.. https://github.com/kohsuke/github-api/commit/7735edeae87652c1fa8196e7956851a39f5a84d4#diff-94a87075551ce5757abefb5b3537ba80 this change was done 10 days ago are you running github-api-1.90?

Give me a moment. We're working with sonarqube, so apparently it is also using the github-api version you mentioned: https://github.com/SonarSource/sonar-github/blob/master/pom.xml#L93

Sadly, the release has not been updated, and it's using the 1.76 version. https://github.com/SonarSource/sonar-github/releases/tag/1.4-rc1

Thanks, @johnou. I'll focus in updating the sonarcube's dependency version. Hopefully that'll solve it. Closing this for now.


kad: Providers part 7: better types and public API, public addresses & known providers

This PR introduces the following changes:

Introduces a better type ContentProvider without a burden of KademliaPeer.
Simplifies public litep2p content providers API.
Uses PublicAddresses API when advertising local providers.
Adds locally known providers to discovered providers when performing GET_PROVIDERS request.
Emits IncomingProvider event when remote node registers as a provider via ADD_PROVIDER request.

It may be easier to review this PR through individual commits. The commits of interest are:

Introduce ContentProvider type
Use PublicAddresses API
Use locally known providers when performing `KademliaHandle::get_providers() request
Emit IncomingProvider event

All other commits are merge commits from upstream branches.
Builds upon https://github.com/paritytech/litep2p/pull/245.

Will probably need to take a quick look at the first PR in the series after all others are merged into it 🙏

My idea was to merge PRs one-by-one into master. When the first PR is merged, GitHub will automatically set the target branch for the second PR to master, and so on.

Sounds like a plan! 👍


files_upload() initial_comment isn't formatted (regression) when posting a Slack post

Sometime between Oct 20 and Oct 25 2023, text supplied to initial_comment of files_upload() no longer gets formatted.
Unfortunately this was from a CI script and we had an unpinned dependency on slack-sdk, so it would have been grabbing the latest (v3.23.0).  However, I don't see a slack-sdk in this time range, so there is also the possibility of a server regression.  (We didn't change our script code during the time range in question.)
Namely, we have a <!subteam^...> mention and plain URL which are not being formatted, where previously they were.  The mention renders literally, and the URL simply gets wrapped in <> but not linked.
We're using files_upload().  I noticed a recent (server) bug in this area for files_upload_v2().

Hi @belm0, we appreciate your time and effort in reporting this issue. We also apologize for any inconvenience caused by the changes in the platform's behavior.

Sometime between Oct 20 and Oct 25 2023, text supplied to initial_comment of files_upload() no longer gets formatted.

I tried to reproduce the same misbehavior on my end, but files.upload API call works for me without any issues. If you're still experiencing the same, could you please share a minimum working example for us to reproduce the issue?
The following test code does not include an example for usergroup mention but other syntaxes are working well:
import os
import unittest

from integration_tests.env_variable_names import SLACK_SDK_TEST_BOT_TOKEN, SLACK_SDK_TEST_WEB_TEST_CHANNEL_ID
from slack_sdk.web import WebClient

class TestWebClient(unittest.TestCase):
    """Runs integration tests with real Slack API

    https://github.com/slackapi/python-slack-sdk/issues/1429
    """

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_initial_comment(self):
        token = os.environ[SLACK_SDK_TEST_BOT_TOKEN]
        channel = os.environ[SLACK_SDK_TEST_WEB_TEST_CHANNEL_ID]
        client: WebClient = WebClient(token=token)
        current_dir = os.path.dirname(__file__)
        file = f"{current_dir}/../../tests/data/slack_logo.png"
        v1 = client.files_upload(
            channels=[channel],
            file=file,
            filename="slack_logo.png",
            initial_comment=f"Here is the file for <#{channel}> <https://google.com|this is a link>"
        )

        v2 = client.files_upload_v2(
            channel=channel,
            file=file,
            filename="slack_logo.png",
            initial_comment=f"Here is the file for <#{channel}> <https://google.com|this is a link>"
        )

Thank you.  The problem appears related to using the content option, and specifically with filetype='post'.
If I use content and filetype='markdown' then initial_comment is formatted as expected.
If I use content and filetype='post' then initial_comment is not formatted.  (The file content itself is, however.)
        v1 = client.files_upload(
            channels=[channel],
            filename="file.md",
            content="content goes _here_",
            filetype='post',   # vs. 'markdown'
            initial_comment=f"Here is the file for <#{channel}> <https://google.com|this is a link>"
        )

Thanks for your prompt response!
Indeed, this seems to be a regression bug on the platform side. However, I hate say this... but Slack posts are now deprecated in favor of canvas, which is the one currently recommended to use: https://slack.com/help/articles/4426294050451-Slack-feature-retirements
So, please consider going with markdown or anything else that meets your requirements. Sorry for the disruption but I hope this helps clary what's going on.

I see-- markdown should work OK for our case.

Thank you very much for your understanding. Let me close this issue now.


Including xrd as a plugin.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>
Details

0 of 0   changed or added relevant lines in 0 files are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage remained the same at 77.768%

Files with Coverage Reduction
New Missed Lines
%

tests/dataconverter/test_writer.py
1
96.77%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
2599

Relevant Lines:
3342

💛  - Coveralls

Pull Request Test Coverage Report for Build<PHONE_NUMBER>
Details

0 of 0   changed or added relevant lines in 0 files are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage remained the same at 77.768%

Files with Coverage Reduction
New Missed Lines
%

tests/dataconverter/test_writer.py
1
96.77%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
2599

Relevant Lines:
3342

💛  - Coveralls

Pull Request Test Coverage Report for Build<PHONE_NUMBER>
Details

0 of 0   changed or added relevant lines in 0 files are covered.
1 unchanged line in 1 file lost coverage.
Overall coverage remained the same at 77.768%

Files with Coverage Reduction
New Missed Lines
%

tests/dataconverter/test_writer.py
1
96.77%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
2599

Relevant Lines:
3342

💛  - Coveralls

Please also add xrd to the convert extra

Sorry for missing that. I will add it.


add property name to the response's type/format change message

issue: #474

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

Comparison is base (a2470e3) 83.75% compared to head (2b410b9) 83.85%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #477      +/-   ##
==========================================
+ Coverage   83.75%   83.85%   +0.10%
==========================================
  Files         217      225       +8
  Lines       12593    12799     +206
==========================================
+ Hits        10547    10733     +186
- Misses       1668     1683      +15
- Partials      378      383       +5

Flag
Coverage Δ

unittests
83.85% <91.03%> (+0.10%)
:arrow_up:

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

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


State of Dapps blog post

initial draft of the dapps blog post
fix: improve readability with larger font
edit dapp blog post

### Tasks before publishing
- [ ] Update the dependencies in the embedded code sandbox (once Helia 4 is released)
- [x] Update publishing date
- [x] Add link to Uniswap releases pages
- [x] Use dapp consistenly

This is almost ready to go. Once Helia is released, the sandboxes should be updated to the latest release and tested to make sure their still working.


Add support for TOML files

This PR adds support for .toml files.
Following changes were made:

Added toml11 parser
Added new function tomlValueToLuau to both Sourcemap.cpp and Sourcemap.hpp files
Updated readSource function inside WorkspaceFileResolver.cpp and getScriptFilePath function inside Sourcemap.cpp
Added new TEST_CASE to Sourcemap.test.cpp
Updated CMakeLists

Here is a quick demo:
https://github.com/JohnnyMorganz/luau-lsp/assets/78505208/7a275f79-31eb-4d3d-8206-2771c404e698

A bit late for the 1.28.0 release but I added two test cases, one to test all types and the second one to make sure that strings are escaped properly.

I just saw the build test results and unfortunately the order of arrays and objects varies depending on the machine or OS, so we need to parse the Luau and TOML values to compare them directly, rather than comparing strings.

Agh yeah that is annoying. Not sure what the best solution for that would be.
Maybe we could test by loading in actual files + a require and checking what the type system sees. Maybe that is a bit too much to ask right now though (I don't know how easy it is to set that up).
Will give a bit of a think, otherwise maybe we can just leave the tests out for now

Actually I think that I've already found pretty good solution for that - we can use Luau VM.
There is header called lua.h that contains I think all the functions we need. First we have to create new Luau environment with lua_newstate. Then load the table string using lua_load and then iterate over that table with lua_next. And with that we will be able to compare it with the TOML/JSON table with no problems.
I haven't tested anything yet it's just based on what I've seen on the Lua Reference Manual. I will give it a try tomorrow.

This sounds a little bit overkill for the test case tbh, but we can see. I believe we currently have no dependence on Luau.VM, so not sure it's worth introducing one just for this.
If you think this is a worthwhile route, maybe it would be better to just look at the Parser level instead? We already have everything there. You can use Luau.AST to parse the string and extract a LuauAstExprTable to iterate through. (You may need to create a wellformed program to parse though - sticking a "return" before the table may be sufficient)

I believe we currently have no dependence on Luau.VM

Luau has VM built-in. It is located in luau/VM and there is that lua.h header

If you think this is a worthwhile route, maybe it would be better to just look at the Parser level instead? We already have everything there. You can use Luau.AST to parse the string and extract a LuauAstExprTable to iterate through. (You may need to create a wellformed program to parse though - sticking a "return" before the table may be sufficient)

I will look into that tomorrow as well

I looked into the Luau Ast source code today and I'm not really sure where do I start I mean how do I parse the source string. I didn't go in depth as I'm busy with my other projects so do you have any advise how to parse string that we have from the tests?

We already have uses of "parse" in tests - see WorkspaceFileResolver as an example. Our helper function already sets up the SourceModule etc.
You may need to make the string into a well formed program, but stick a return or a local before the table should be sufficient

Got the parser working, however now when I'm iterating over AstExprTable like this:
for (const auto& item : table1->items)
{
    std::cout << "---" << std::endl;

    if (auto key = item.key->as<Luau::AstExprConstantString>())
    {
        std::cout << key->value.data << std::endl;
    }
}

key of the first item is always empty even tho that's the input table:
Luau::AstStatBlock* block = parse(R"(
    local _ = {["1"] = 1, ["2"] = 2, ["3"] = 3, ["4"] = 4}
)");

and the output:
---

---
2
---
3
---
4

Did you encounter a similar issue by any chance?

Hey sorry for the significant delay in taking a look at this. Given there was a significant rewrite of the internals, I went ahead and resolved the merge conflict (and restructured the code slightly)
I've also added the ast-based tests checking as discussed.
Do you mind checking that the requiring still works for you now?

Good job! Everything related to TOML works perfectly!
However, 25 test cases fail on macOS:

22 in MagicFunctions.test.cpp
1 in Rename.test.cpp
2 in WorkspaceFileResolver.test.cpp

But it's unrelated to this PR. If needed I will provide more details.

The test cases have some pre setup (make sure the test binary is running with the CWD set to the repo root).
But if the toml requires work in practice, that's good to know. Let's merge!

Sorry for the misinformation but it doesn't actually work! It worked for me initially because I forgot to remove the symlink to the previous build that worked. Now only click-to-follow feature works but the actual completion does not. Additionally, it throws TypeError: Unknown require error.

Ah dang. I'm a bit busy now but i can try and resolve it next weekend, unless you figure out the cause

I can do that but in a few hours or tomorrow.

Fixed in #634. It was an extremely small issue and as it turned out it also affected JSON.


Minor fixes to Bundling & Minification doc

Corrected spelling mistakes, grammar & punctuation problems, and consistency/styling issues.

@scottaddie,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot


Repo sync for protected CLA branch

The pull request is created from main637798539118488510 to main to fix git push error for protected CLA branch

@ghogen : Thanks for your contribution! The author(s) have been notified to review your proposed change.


📋 [TASK] - POPO Data Object Logic Flagging in LSP

Parent Feature
NA
Task Description
As an AaC Developer, I want to put comment flags within the LSP package for transitioning to the new POPO data object, so that I have an understanding of the scope of the transition.
Acceptance Criteria

[ ] LSP package is reviewed for old dictionary logic and has flagging comments to replace with POPO reference logic

Unresolved questions
No response

Finished reviewing the LSP portion of #714 so this can be closed out.


Make function scripts always succeed instead of always fail

I made a GitHub Actions workflow where one step ran a JS function script, and found it returned an error exit code. Looking at the code, it was hardcoded to always fail. I'm guessing this was not intentional, so here's quick fix for it, so now JS function scripts always succeed (Lume returns success exit code).

Good catch! Thanks


Introduce testing infrastructure

[x] Introduce the FileSystem interface
[x] Introduce OS implementation of the FileSystem interface
[ ] Introduce testing implementation of the FileSystem interface
[ ] Write tests for Bundle and File
[ ] Write tests for existing checks

Won't do as tests in go can work with the OS filesystem directly.


feat: add adaptor

Closes #12.

I have a copy of mplhep that's working with this, so I think it's ready. mplhep still does a lot more than this, but I think this should remain simple and well defined, and the extra stuff can be added by mplhep (at least for now). Eventually, we can see what seems popular and add further support.


Make passwords configurable

Currently the passwords are hardcoded. We should make them configurable. First a global configuration for one password is good enough. In the future it would be good if the global password can be overriden in each service.

The goal should be to offer a feature to remove all passwords from the docker-compose.yml file. One option could be to add the passwords as environment variables with the user deciding how and where to store it.

closed, duplicate to #560


filtering/reconnecting

BEGINRELEASENOTES

Filtering/reconnecting particles is a critical task for dmX. So, in this PR, I'm implementing a basic filtering/reconnect function that given a function that determines if a particle should be filtered out, reconnects the particles again.

ENDRELEASENOTES

Hey @kjvbrt and @tmadlener, could you check my filtering function? As previously discussed, an external function determines whether to filter or not a particle. And then reconnected by using the reconnect function in js/menu/filter.js. I have added a toggle for simplicity but it's temporary.

I am rebasing this to potentially pick up the preview functionality.

Hey @tmadlener @kjvbrt, I started working on more advanced filtering for MonteCarlo Particles (as task for week 1 of the proposal). It's a bit buggy, but I want to share how is it going. Here is a small demo.

Very nice. Since you have the panel now already. Can I ask for one specific filter function which will should be straight forward to implement (from a technical point of view), but will probably require a bit of "leg work" from your side.
The edm4hep::MCParticle has two bitfields: generatorStatus and simulatorStatus. For the simulatorStatus we provide a few bit values that are reserved for a specific meaning:
https://github.com/key4hep/EDM4hep/blob/997ab32b886899253c9bc61adea9a21b57bc5a21/edm4hep.yaml#L294-L301
And then there is also some convenience functionality to check wheter a specifc bit is set:
https://github.com/key4hep/EDM4hep/blob/997ab32b886899253c9bc61adea9a21b57bc5a21/edm4hep.yaml#L306-L321
Would it be possible to have a filter that allows us to toggle these to filter out MCParticles for which specific bits are set? I.e. Have one checkbox / toggle for each bit and combine them into a filter function? IIUC all the filter combiners, etc. are already in place and this would mainly boil down to writing a specific filter for checking the bits in the simulatorStatus bit field.

I have it now. In theory it should work, but the particles from the json example don't seem to have a simulator status from the ones described, so it's a bit difficult to test. Here's an image of the filters now.

Rebasing this again to see if the preview fixes from #22 are picked up.

Preview is working :rocket: However, for me it doesn't show the filter panel. Do I have to enable them somehow?
For testing the filtering, it would be nice to have some unittests for that to see if things work as expected. In these unittests you can just create some dummy MCParticle hierarchy with the values that you want in the end. You could start from the existing json file and just use a few of them and just adapt them to enable testing. This should all be possible without ever having to go to the UI to display them (for testing).

Preview is working 🚀 However, for me it doesn't show the filter panel. ~Do I have to enable them somehow?~ It looks like the preview doesn't publish the status of the PR, but rather the one from the PR. I am not sure why, though.

Yeah, it's strange. I didn't expect this. I'll fix it.

For testing the filtering, it would be nice to have some unittests for that to see if things work as expected. In these unittests you can just create some dummy MCParticle hierarchy with the values that you want in the end. You could start from the existing json file and just use a few of them and just adapt them to enable testing. This should all be possible without ever having to go to the UI to display them (for testing).

Sure! In that case, I will wait for this PR and #20 to be merged, to add testing, because the testing setup is in #20 and this #18 has the function to be tested. So I think that after merging both PRs to main, I should create a separate PR to test filtering, and other PR to fix again PR previews, what do you think?

I am quite happy with this. I think we can merge this, unless @kjvbrt has more comments.

Otherwise it runs nicely. For next PRs we can think of showing only sim/gen status numbers which are used in the file.

I run it again and found that the filter is reset, when I move any of the elements.


STEP-1054: Use Test Repetition for Xcode 13 and above

Checklist

[x] I've read and accepted the Contribution Guidelines
Requires MINOR version update

Context

Xcode 13 supports Test Repetition to retry failing tests.
This feature is already supported by the Xcode Test step. However, that reruns ALL tests, not just the ones that failed.

Changes
Use Xcode 13's Test Repetition feature if "Should retry test on failure?" is enabled.

This only works on Xcode 13+ stacks.
Below Xcode 13, we keep using our own custom logic that reruns all tests in case of failure.
Added E2E tests for this option (both enabled and disabled).
Brokedown runTest function into smaller functions; extracted long parameter lists into structs.

Checks are failing because the new test target is configured incorrectly in the sample. This PR should fix this problem: https://github.com/bitrise-io/sample-swift-project-with-parallel-ui-test/pull/5.

Latest changes LGTM, merging this PR.