Using scipy.optimize.minimize with structured objects

Is there a way to use scipy's optimizers (through the scipy.optimize.minimize) together with structured objects? In it's vanilla state it only works with 1D numpy arrays. I tried playing with the unflatten_optimizer function with no results.
My use case is optimising a neural net which uses autograd functionality, and going through optimizers to see which one works best. So if I want to do e.g. BFGS line search what is my best option?
Thanks!

I'm not sure about scipy's optimizers, but there are plenty of optimizers in autograd proper - see here.  You can define e.g., a fully connected network as in the JAX README and optimize using one of those.

@vkorotkine is autograd well integrated with scipy minimize now?

@vkorotkine is autograd well integrated with scipy minimize now?

Not as far as I know. I got around it by defining my own unflatten_optimizer, see below. The difference is that it also takes in the function itself, not just the gradient, to pass onto the optimizer. .You can then define your own optimizer, similar to how they did in misc.optimizers for adam and use scipy.minimize inside of that.
Sorry for bad formatting, the `` seems to only have codified the bottom part. Hope that helps. Cheers
``
`def my_unflatten_optimizer(optimize):
"""Takes an optimizer that operates on flat 1D numpy arrays and returns a
wrapped version that handles trees of nested containers (lists/tuples/dicts)
with arrays/scalars at the leaves."""
@wraps(optimize)
def _optimize(fun, grad, x0, callback=None, *args, **kwargs):
_x0, unflatten = flatten(x0)
_fun = lambda x: flatten(fun(unflatten(x)))[0]
_grad = lambda x: flatten(grad(unflatten(x)))[0]
    if callback:
        _callback = lambda x: callback(unflatten(x))
    else:
        _callback = None
    result=optimize(_fun, _grad, _x0, _callback, *args, **kwargs)
    return unflatten(result.x), result.fun, result.func_values
    #return unflatten(optimize(_fun, _grad, _x0, _callback, *argss, **kwargs))

return _optimize`

@vkorotkine i wrapped optimizer with unflatten but it still crashes if im using for example BFGS it calls line search. Several variables must be cast to float in order for it to work. It's a pity it was not properly integrated with scipy.optimize. Would you atleast verify it's accuracy in terms of gradient approximations? Is it worth integrating code with scipy, should i invest time?


types(message): add message type 16 and 17

MERGE WHEN https://github.com/discord/discord-api-docs/pull/1779 IS MERGED
Ref: https://github.com/discord/discord-api-docs/pull/1779

LGTM

LGTM


Setting timeout for artwork wait time

When displaying artwork in my player with an url from the web, it happens some times that the image is not displayed.
We should add a wait time to wait for the artwork to resolve.

Which platform does this happen?

It happen on Android

The artwork loads in a separated thread, and it is updated as soon as the image is downloaded and resized.
Can you describe what doesn't work?

I don't really understand why some times it appear and some times not. When I change the information in the track, it seems to update the image but when I stop it and replay my track the image is not displayed.

@moduval Did you find a work around for this issue?

Is this still an issue in 1.0.0?

I'll be closing this issue for inactivity. If you are still experience this problem, feel free to reopen the issue.


Moved general semantic conventions markdown to a topic folder.

Part of https://github.com/open-telemetry/semantic-conventions/issues/137
Depends on https://github.com/open-telemetry/semantic-conventions/pull/141

Overall Looks good.
One change needed though - Can you update "Logging" codeowners (tigran) so that the new "general" event/log semantic conventions will ping him for review?

Done.


Camera2D causing RigidBody2D to not move

Godot version
4.0.3.stable.mono
System information
Windows 11, gl_compatibility
Issue description
When I disable the camera of my car (this._camera.Enabled = false;), it moves OK. When I enable it:
this._camera.Enabled = this.IsMainPlayer;
// this._camera.Enabled = false;

both in the _Ready and _Process methods, the car does not move. I also ran GD.Print(this.Position.X); to observe the position logs and I can see its value changes in a very unusual way — it basically doesn't move.
NOTE: to reproduce the car movement working, you must comment exactly like this:
// THIS!!!!!!!

// this._camera.Enabled = this.IsMainPlayer;
this._camera.Enabled = false;

// NOT THIS!!!!!!!

this._camera.Enabled = this.IsMainPlayer;
this._camera.Enabled = false;

in both _Ready and _Process, otherwise the movement won't work. Looks redundant, but yes.
Steps to reproduce

Add a Camera2D to a RigidBody2D
Set cam.Enabled = true
Use the directionals to move the RigidBody2D

Minimal reproduction project
https://github.com/hydroper/carknockonline_csharp

The car is the AutomobileEntity (in src/entities/AutomobileEntity.tscn)
The main scene is src/screens/game/GameScreen.tscn

Here's an attempt on GDScript (I didn't port everything from the C# version). This works, but the C# version above doesn't. You can hold left arrow to move to the left:
cko.zip

Can you confirm this only occurs in C#? Otherwise you need to follow this:

If your issue is not Mono-specific, please upload a minimal reproduction project written in GDScript or VisualScript. This will make it easier for contributors to reproduce the issue locally as not everyone has a Mono setup available.

@AThousandShips I'm a bit lazy to go ahead and write something in GDScript, but I'll see if I can try a basic thing.

I mean these are the instructions for making a bug report, and you're just shooting yourself in the foot because few contributors will be able to help you

@AThousandShips Right; I've wrote a bit on GDScript and it the Camera2D works as expected. I'm guessing something is wrong with the C# support?
Since I'm not finding anyway to fix it, I guess I might try to move to GDScript.

I tested the C# project. Couldn't replicate the issue, the player wasn't moving regardless of camera enabled in the GameScreen scene.
I could make the player move by commenting out some of the _Process code (in particular the rotation tween) and setting RawSpeed to always return the SpeedOf result, so this seems code behavior, not an engine issue. Won't delve too much more in this issue because I didn't properly setup my C# environment, I was editing code in Godot itself.

@henriquelalves About the camera being enabled or not, did you consider this:
// THIS!!!!!!!

// this._camera.Enabled = this.IsMainPlayer;
this._camera.Enabled = false;

// NOT THIS!!!!!!!

this._camera.Enabled = this.IsMainPlayer;
this._camera.Enabled = false;

? Because the latter somehow does not work. If you do it exactly that way in both _Ready and _Process, the movement works.

I'm rewritting the exact same code it in GDScript and will return soon telling how it goes.

I believe I tested both cases, but I'm not sure I tested this in _Ready AND in _Process, maybe just in one of them.

The setting the camera and clearing it is probably not safe here, it does update some details and could cause weird effects, setting and clearing it is not the same as never setting it

@henriquelalves It looks like according to what you said, the rotation is what is breaking the camera. Why?
I didn't need to change the raw_speed to make the camera work.

I've commented the self.rotation_degrees = ... everywhere and did this at the end of _process:
# self.rotation_degrees = self._rotation_tween.current_rotation if self._rotation_tween.is_running() else TurnDirectionf.angle(self._turn_dir)
self.move_forward(delta)
# self.rotation_degrees = self._rotation_tween.current_rotation if self._rotation_tween.is_running() else TurnDirectionf.angle(self._turn_dir)
# self._rotation_tween.process(delta)
self.rotation_degrees += 1

And, yes, it's not my tweener the problem!

I've put a constant ROTATION_ENABLED. Just toggle it on or off instead of doing the above comments

Cleaner issue:
https://github.com/godotengine/godot/issues/77950


Logo

Just adding the logo to the top bar, includes an updated copy function in the Gruntfile for image assets within src

One concern that I have with this one is that it increases the height of the topbar, taking up precious screen reality for the sake of branding. I suggest we limit the icon height to keep the topbar height to a minimum.

Good point! I wonder if we can look into ways of actually removing the top bar entirely? Let's close this and I'll do some UX thinking.

Yeah, if we go full bore with the sidebar, then I can see the topbar only residing over the layerlist (similar to the way the "Add/Remove" menus are placed at the bottom.


WRKLDS-1239: Prepare 5.1.0 release

The first time we use a buffer for skipped releases to maintain a reachable to-be-added-patch-releases in the future so opm index add is happy to accept the patch releases for all existing index bundle images.

/override ci/prow/e2e-aws-operator


Multiple call

Is there any way to make request with multiple commands and get all responses?

There currently isn't, no, but I could add it.
Is there any specific reason why you can't use multiple API calls tough?

It's faster and that's what I need, 'cause I have limited PHP processes and execute time.

This is going to be in the next release 😃

Great :-)

Implemented in https://github.com/Valandur/Web-API/releases/tag/v2.0, but that is still an alpha release so please use with caution. Parts of the API also changed.

I'm going to close this as v2 is now a stable release. Thanks for the input.


Mono project export

Just a WIP, but worth being merged at this point.
TODO (not in this PR):

Make it use the export templates compiled with mono, somehow.
Fix _export_begin not being called with the "Export PCK" option. I used this patch for testing purposes but, as you can see, it doesn't take Debug/Release and the output path into account:@@ -596,6 +596,7 @@ EditorExportPlatform::ExportNotifier::~ExportNotifier() {
 }

 Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func) {
+	ExportNotifier notifier(*this, p_preset, false, "", 0);
 	//figure out paths of files that will be exported
 	Set<String> paths;
 	Vector<String> path_remaps;

@neikeq so just to test I grabbed master and build all the export templates for windows 10 64 bit.
In the https://bitbucket.org/G4MR/godot-breaker/src bin folder you should find the release/debug executables that I ran which gives me errors.

One error I get is mono core api hash mismatch which doesn't seem right because I copied/pasted the generated dll's that were build with my version of mono (latest using vc++ 2017 build tools)

Another error I get is SOMETIMES when I start the game it'll tell me a non existent signal exists from StartGame to BlockDestroyed and other times I could load it up and nothing pops up. When this happens with the below image the start button stops working completely which is strange. In the editor I don't get such error or issue so the signal's are working and used correctly.

https://i.imgur.com/wta4Cb4.png
You can see all the source in that repo if you want to attempt to reproduce. Hope this helps with the ongoing efforts for getting exporting stable. 👍

One error I get is mono core api hash mismatch which doesn't seem right because I copied/pasted the generated dll's that were built with my version of mono (latest using vc++ 2017 build tools)

I think the core API changes between tools=yes and tools=no builds, so you need to regenerate the mono glue for each build.

hmm

Cherry picked into 3.0.3


Add a way to invoke a command specifying optional values by name

Requires:

1 (one) POCO to hold argument values (Application of the attribute automatically sets IsRemainder for that parameter)
All properties in the POCO are an optional parameter (Required parameters should be specified before the POCO parameter)
When invoking, parameters need to be a single word, ending with a colon (:); arguments need to be either a single word or wrapped in quotes

Just had another thought, should we make it such that at least one property needs to be specified in order to make the typeread succeed by default? I'm thinking we could allow modifying that behavior by whether the parameter itself has a default value (= null).

Okay, so I just worked on what that would look like...
aaaaaaaaaaaaaaaaaaand it requires breaking the signature of ReadAsync for that to work.

Now, we're technically still in beta, so it's not strictly speaking a problem, but we do have a good number of people on the nightlies.


get transaction history

Hello guys , i would like to know if is this possible to get all the transacation history of a determined address as seen here for example:
http://omnichest.info/lookupadd.aspx?address=1Po1oWkD2LmodfkBYiAktwh76vkF93LKnh&prop=31
in a json format, so i can track the transactions status of a determined address, thanks alot guys

Hey @tallesdantas,
there is a RPC to list wallet transactions: omni_listtransactions, as well as a call to list all Omni transactions in a specific block: omni_listblocktransactions.

How can i get it trought the url?,  I'm using nodejs,  do you have an example?   Thanks alot

i'm using the rest api of omnichest, i really need this =/ is there an easy way to do this on nodejs?

My bad, you were referring to omnichest.info and not Omni Core.
I pinged @zathras-crypto, who might help.

thanks @dexX7 , i appreciate the help.

Hey guys,
Sorry - been a crazy few days personally (few problems with our new place).
@dexX7 thanks
@tallesdantas it's possible to:

request all the txids for transactions an address has sent:  http://omnichest.info/ask.aspx?api=getsenderhistory&address=1Po1oWkD2LmodfkBYiAktwh76vkF93LKnh

and/or

request all the txids for transactions an address has received: http://omnichest.info/ask.aspx?api=getrecipienthistory&address=1Po1oWkD2LmodfkBYiAktwh76vkF93LKnh

You can then look at transactions you're interested in with http://omnichest.info/ask.aspx?api=gettx&txid=35b192c3262e9ac862d2440c81dbca4fda06812e06334a3d4e559e7360a2a5e1
Substitute addresses/txids as needed.
That's how to get at the data with these generic calls currently in the API, however is a quite inefficient way to monitor an address, as we're asking OmniChest's database to lookup all transactions in its history each time we make the API request.
I often do custom APIs for folks and if you can tell me a bit more about what you want to do perhaps I can prepare a more suitable API call :)
Thanks
Z

@zathras-crypto  thanks sathras , this call "http://omnichest.info/ask.aspx?api=getrecipienthistory&address=" was the one i was needing, i really appreciate the help =D

Aweome, thanks @zathras-crypto.
I think this resolves the issue. @tallesdantas: please feel free to raise a new ticket, if you need anything. :)


Add expand/collapse icon to each tables where rows are expandable

Definition of done
Each table rows that can be expanded should have an expandable/collapsible type of icon that changes whether the row is collapsed or expanded

@belkassaby I only see the expand/collapse where there are ontology term lists. Do you plan to use them elsewhere?

Hello @BethSundberg yes. I was thinking to have that expand wherever a row is expendable with tables such as this one (see the icon on the left side of the row) http://primefaces.org/primeng/table/rowexpansion

Baha,
That choice looks good.
Beth Sundberg
Software Engineer
The Jackson Laboratory
600 Main Street
Bar Harbor, ME 04609
@.*** | she/her
www.jax.org
The Jackson Laboratory: Leading the search for tomorrow's cures
From: Baha El Kassaby @.>
Sent: Monday, January 23, 2023 9:47 AM
To: TheJacksonLaboratory/PhenopacketLab @.>
Cc: Beth Sundberg @.>; Mention @.>
Subject: [EXTERNAL]Re: [TheJacksonLaboratory/PhenopacketLab] Add expand/collapse icon to each tables where rows are expandable (Issue #77)
Hello @BethSundberghttps://github.com/BethSundberg yes. I was thinking to have that expand wherever a row is expendable with tables such as this one (see the icon on the left side of the row) http://primefaces.org/primeng/table/rowexpansion
—
Reply to this email directly, view it on GitHubhttps://github.com/TheJacksonLaboratory/PhenopacketLab/issues/77#issuecomment-1400473652, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACXYSV6TIOUI2DBC3CDVDVDWT2KWDANCNFSM57X5KUFQ.
You are receiving this because you were mentioned.Message ID: @.***>
The information in this email, including attachments, may be confidential and is intended solely for the addressee(s). If you believe you received this email by mistake, please notify the sender by return email as soon as possible.

I like this, it is easier now to close things making the page more readable.


fix: workflow uses multi arch build and push, cache from latest, handle platform args

@ashokponkumar please review !!


Update proc macro dependencies.

Update quote, syn, proc-macro2 to latest versions and fix breaking changes.
This is needed to derive on a struct using const generics, as the super-old syn can't parse const generics.
#[derive(Hash32)]
pub struct LinkID {
    inner: heapless::Vec<u8, 12>,
}

Thanks!

this has been included in hash32-derive v0.1.1


ci(ci): fix typo in cy yml

:tada: This PR is included in version 2.7.3 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


uploadImage: How to insert link tag for files and image tag for images?

Hei,
I have just started using this editor and I am using your build it seems. I am using the following config:
    const easyMDE = new EasyMDE({
        element: document.getElementById('my-text-area'),
        uploadImage:true,
        imageUploadEndpoint: 'uploader.php',
        imagePathAbsolute: true,
        imageMaxSize: 1024 *1024 * 100
    });

The uploader handles the upload, straight forward using $_FILES. Then on success returns JSON:
{
    "status": "success",
    "data": {
        "filePath": "\/my-full-path\/for-uploads-directory\/my-uploaded-file.png"
    }
}

This will insert markup in the editor looking like:
![my-uploaded-file.png](/my-full-path/for-uploads-directory/my-uploaded-file.png)

Here is my question,
as the uploader will insert anything. Say I drag'n'drop a PDF file instead of an image, my uploader saves the PDF file and returns it as if it were an image. Now how could I make it drop the exclamation mark so it becomes a link instead ?
// This would be a perfect insert when uploading a PDF, ZIP file or some none image file.
[my-uploaded-file.pdf](/my-full-path/for-uploads-directory/my-uploaded-file.pdf)

// This works like a charm already, if the file is an image
![my-uploaded-file.png](/my-full-path/for-uploads-directory/my-uploaded-file.png)

What if I added some more data for the returned JSON. However I have no clue how I would access or benefit from this with the Markdown editor. I would like to add name and type, see examples below.
Is there an easy fix for this in the config for easyMDE ?
{
    "status": "success",
    "data": {
        "filePath": "\/my-full-path\/for-uploads-directory\/my-uploaded-file.png",
        "fileName": "uploaded-image",
        "fileType": "image", // image or link
    }
}

> ![uploaded-image](/my-full-path/for-uploads-directory/my-uploaded-file.png)

{
    "status": "success",
    "data": {
        "filePath": "\/my-full-path\/for-uploads-directory\/brochure.pdf",
        "fileName": "PDF file",
        "fileType": "link", // image or link
    }
}

> [PDF file](/my-full-path/for-uploads-directory/brochure.pdf)

For those that might be looking, a basic uploader script for the above setup in PHP could look like this:
uploader.php
// Define the upload directory
$upload_dir = dirname(dirname(__DIR__)) . '/files/markdown/';         // on server
$web_upload_dir = '/files/markdown/';                                 // in browser

// Function to sanitize filename
function sanitize_filename($filename) {
    // Remove any character that isn't a word character, dash, or dot
    $filename = preg_replace('/[^\w\-\.]/', '', $filename);
    // Remove any leading or trailing dots
    $filename = trim($filename, '.');
    return $filename;
}

// Function to generate a unique filename
function generate_unique_filename($upload_dir, $filename) {
    $info = pathinfo($filename);
    $base_name = $info['filename'];
    $extension = isset($info['extension']) ? '.' . $info['extension'] : '';
    $counter = 0;

    while (file_exists($upload_dir . $filename)) {
        $counter++;
        $filename = $base_name . '_' . $counter . $extension;
    }

    return $filename;
}

// Check if a file was uploaded
if (isset($_FILES['image']) && $_FILES['image']['error'] == 0) {
    $original_filename = $_FILES['image']['name'];
    $tmp_name = $_FILES['image']['tmp_name'];

    // Sanitize the filename
    $safe_filename = sanitize_filename($original_filename);

    // Generate a unique filename
    $unique_filename = generate_unique_filename($upload_dir, $safe_filename);

    // Get file information
    $file_info = pathinfo($unique_filename);
    $filename_without_extension = $file_info['filename'];
    $extension = isset($file_info['extension']) ? $file_info['extension'] : '';

    // Attempt to move the uploaded file
    if (move_uploaded_file($tmp_name, $upload_dir . $unique_filename)) {
        // Success
        $response = [
            'status' => 'success',
            'original_filename' => $original_filename, // uploaded filename
            'saved_filename' => $unique_filename,      // dirified filename
            'extension' => $extension,
            'filename_without_extension' => $filename_without_extension,
            'data' => [
                'filePath' => $web_upload_dir . $unique_filename
            ]
        ];

    } else {
        // Failure
        $response = [
            'status' => 'error',
            'message' => 'Failed to move uploaded file.'
        ];
    }

} else {
    // No file uploaded or upload error
    $response = [
        'status' => 'error',
        'message' => 'No file uploaded or upload error occurred.'
    ];
}

// Send JSON response
header('Content-Type: application/json');
echo json_encode($response);


Prepare some more for NumPy 2.0

Seems like it will take some time until it is possible to have all tests passing with NumPy 2.0😐 due to all the dependencies.

Have you tried with ruff? See e.g. https://numpy.org/devdocs/numpy_2_0_migration_guide.html
$ ruff check path/to/code/ --select NPY201

Have you tried with ruff? See e.g. https://numpy.org/devdocs/numpy_2_0_migration_guide.html
$ ruff check path/to/code/ --select NPY201

Yes, nothing to fix.


refactor LLM prompts

The current prompts are written in .rs files. Instead write them into a .md file with placeholders using mustache templates {{}}.
Additional Information

Most of the logic is in infer_type_names

/bounty 20$

/attempt #2701


Added a first prototype of perf live mode

Fixes #59 by introducing live sampling.
Right now, for each sampling event, the callstack will be send as a tcp message.
We could omit this by only sending the hash instead, however this requires some more refactoring of the SamplingProfiler class.
I would add this in a different PR.
Also, this PR requires PR#71 to be merged, as this introduces sending symbols.

Thanks for the feedback. I addressed all the comments.


Extracted IncorrectModuleRegistryCallArityParserError as a seperate function in error-utils.js

Summary
This PR is part of #34872
This PR extracts IncorrectModuleRegistryCallArityParserError exception to throwIfIncorrectModuleRegistryCallArityParserError inside an error-utils.js file.
Changelog
[Internal] [Changed] - Extracted IncorrectModuleRegistryCallArityParserError exception to throwIfIncorrectModuleRegistryCallArityParserError function
Test Plan
Added unit case in error-utils-test.js file
yarn jest react-native-codegen

Amazing job, thank you for working on this. I find that the name of the function is a bit obscure. How do you feel about the rename I'm suggesting in the PR?

Thanks for the review @cipolleschi, Changes suggested by you look good to me.
I have pushed down the changes.


Update issue template to use discussions for questions

https://github.com/PyTorchLightning/pytorch-lightning/blob/master/notebooks/04-transformers-text-classification.ipynb
https://github.com/PyTorchLightning/pytorch-lightning/blob/master/notebooks/06-mnist-tpu-training.ipynb
notebooks too pls.

The slack url for the issue template and readme are different, should they be the same?


CSADigitizer: Wrong time when setting ToA binsize (?)

I've looked a little bit in the code of the ToA / ToT measurement, and something seems off to me.
Looking at: https://github.com/allpix-squared/allpix-squared/blob/2005e9f71f3944c0eecc9b1c54080df0110bd72e/src/modules/CSADigitizer/CSADigitizerModule.cpp#L342
We seem to add the local time, the global time, and the charge in the vector. "charge" in this case can also mean ToT signal (or rather TS2, I'll explain later). Everything is fine there. However, time can also mean the ToA signal in clock cycles. That in itself is also fine, if we know that. However, adding time to pixel_charge.getGlobalTime() doesn't make sense in that case. We add clock cycles to something which is in nanoseconds. Am I missing something, or is this wrong?
A fix could be multiplying the time with the bin size here: https://github.com/allpix-squared/allpix-squared/blob/2005e9f71f3944c0eecc9b1c54080df0110bd72e/src/modules/CSADigitizer/CSADigitizerModule.cpp#L321
Related to this:
I realized that the signal only is the "ToT", but that actually isn't the time over threshold, but rather only the second timestamp (that's why I prefer TS2 / TS1 to avoid misconceptions). A proper ToT would be TS2-TS1. Of course, this would mean that we would need to add some code that handles different clock sizes. One idea would be simply to do TS2_signal * TS2_clk - ToA_signal * ToA_clk, which then wouldn't return the signal in clock cycles but the resulting time from it.
I see that this would drastically change the way how this would work, and this can be relatively easy achieved by analysis after the run. Let me know what you think about this.

Hi @stephanlachnit
there are a few things in this issue, let's address them one-by-one:

"charge is only TS2": I don't think this assessment is correct. If you check the relevant code in get_tot you will see that we start counting clock cycles only after threshold crossing with the additional refinement of starting only at the next clock edge. This calculation I think is correct as it is.
"time means clock cycles": This is intentional. If ToT and/or ToA are enabled, the module is supposed to produce output that mimics what a chip would provide, i.e. just providing a clock cycle count for the two values time and charge. So also here I think the definition as is is correct. Maybe we need to refine the README to explain this in more detail.
"global time definition is odd": This indeed is correct, mixing time with clock cycles is not a nice thing to do. :) So that line should actually readhits.emplace_back(pixel, time, pixel_charge.getGlobalTime() + std::get<2>(arrival), charge, &pixel_charge);

Do you agree?
Did I miss anything?
/Simon

* "charge is only TS2": I don't think this assessment is correct. If you check the relevant code in `get_tot` you will see that [we start counting clock cycles only after threshold crossing](https://github.com/allpix-squared/allpix-squared/blob/2005e9f71f3944c0eecc9b1c54080df0110bd72e/src/modules/CSADigitizer/CSADigitizerModule.cpp#L398-L400) with the additional refinement of starting only at the next clock edge. This calculation I think is correct as it is.

Ah thanks yes of course, sorry for that.

* "time means clock cycles": This is intentional. If ToT and/or ToA are enabled, the module is supposed to produce output that mimics what a chip would provide, i.e. just providing a clock cycle count for the two values `time` and `charge`. So also here I think the definition as is is correct. Maybe we need to refine the README to explain this in more detail.

Yes this makes perfect sense. I guess this was just an idea that came into my mind due to my misunderstanding of the ToT calculation.

* "global time definition is odd": This indeed is correct, mixing time with clock cycles is not a nice thing to do. :) So that line should actually read
  ```c++
  hits.emplace_back(pixel, time, pixel_charge.getGlobalTime() + std::get<2>(arrival), charge, &pixel_charge);
  ```

Glad I'm not entirely stupid, I will open a PR to fix it :)

The other option we have would be to provide also the global timestamp in ToA clock units - I think that would be a bit more consistent, no?

Hm, I'm not sure if that is more useful though. I've only used the global time once, and in this case the actual time was more useful than if it would be in clock cycles (with the DepositionReader, which made me realize I haven't set a time limit in Geant4 and it went 3 mil years in one step). I can imagine that the actual time is also more useful when having larger setups with different kinds of sensors (i.e. different clock speeds), but I no expert here so whatever you prefer.

Agreed, let's leave that in absolute time then.


Can this model replace the visualization/data/template.bvh file with other character skeleton .bvh file without the need for retraining?

Sorry for the late response. You can get a motion in the human-like key-point representation from our model. Converting this representation into bvh file, especially with other skeleton, might involve additional retargeting process. Using other character with the same skeleton topology might work. Otherwise, you might need to modify the retargeting method or retrain the model.


Deprecated variables

Better deprecation of strings.params and strings/structuredStrings.
Works together with https://github.com/SwiftGen/SwiftGenKit/issues/12.

Todo: adapt the strings templates to at least use the new tables variable (just use the first table)

Wait until #24 is merged before merging this.

I've adapted the tests to not use the *-customname.plist contexts anymore, but to generate these variations in code.
We can't delete the files yet though, because we still need to test these in SwiftGenKit (for now), until we can remove deprecated variables everywhere for 5.0.


Convert Global_Defs to custom resource

Description
Converts the hwrp global_defs resource into a custom resource
Issues Resolved
[List any existing issues this PR resolves]
Check List

[ ] All tests pass. See https://github.com/sous-chefs/grafana/blob/master/TESTING.md
[ ] New functionality includes testing.
[ ] New functionality has been documented in the README if applicable

          1 Error

:no_entry_sign:
Please include a CHANGELOG entry.

  Generated by :no_entry_sign: Danger


chore(deps): update dependency @dcos/connection-manager to v0.4.0

This PR contains the following updates:

Package
Type
Update
Change
References

@dcos/connection-manager
dependencies
minor
0.3.1 -> 0.4.0
source

Release Notes

dcos-labs/connection-manager
v0.4.0
Compare Source
Bug Fixes

track connections as peer dependency (6550eb3)

BREAKING CHANGES

The  @dcos/connections package is now tracked as peer dependency which requires an additional installation step. Run npm install @dcos/connections dcos/connection-manager or yarn add @dcos/connections dcos/connection-manager to install the connection manager and connections package.

0.3.1 (2019-06-13)
0.2.2 (2019-02-16)
0.2.1 (2017-12-14)

Renovate configuration
:date: Schedule: At any time (no schedule defined).
:vertical_traffic_light: Automerge: Enabled.
:recycle: Rebasing: Whenever PR becomes conflicted, or if you modify the PR title to begin with "rebase!".
:no_bell: Ignore: Close this PR and you won't be reminded about this update again.

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

This PR has been generated by Renovate Bot.

PR has been edited
:construction_worker: This PR has received other commits, so Renovate will stop updating it to avoid conflicts or other problems. If you wish to abandon your changes and have Renovate start over you may click the "rebase" checkbox in the PR body/description.


[do not merge] Update links to reorganized SmartPy docs

I'm working on a reorganization of the SmartPy docs and these are some changes to update links to the new locations. Don't merge this until the changes come out in the SmartPy docs. Skipping the SmartPy topic because it needs lots of rework.

Stale; closing.


Untenanted domains: 500 INTERNAL SERVER ERROR

Describe the bug
Attempting to access the /db url from a domain not associated with a tenant, e.g. ida.localhost:8000/db/ leads to a 500 INTERNAL SERVER ERROR.
What is going on?
The tenant middleware checks if the origin domain is associated with a tenant, if not, it returns a DisallowedHost exception (tenant_context_middleware.py and tenant_middleware.py) :
        try:
            domain = Domain.objects.select_related('tenant').get(domain=origin)
        except Domain.DoesNotExist:
            return DisallowedHost()

Upstream modules expect a request object, however, and fail with:
AttributeError: 'DisallowedHost' object has no attribute 'status_code'

Possible solution
Return a HttpResponseBadRequest object instead:
- from django.core.exceptions import DisallowedHost
+ from django.http import HttpResponseBadRequest

[...]

- return DisallowedHost()
+ return HttpResponseBadRequest()

To Reproduce
Steps to reproduce the behavior:

Go to ida.localhost:8000/db/
Look at the console

Great, good catch.


Relationships between objects of seperate requests

How do you set relationships in Mantle/Overcoat? This is referring to two separate requests and nothing to do with children in the JSON.

I pulled some "Space" objects with a valid MOC and  they were saved to core data.
I then pulled some "SpaceTool" objects with a valid MOC and they were saved to core data.

Question: How do I bind the SpaceTools to the Space Object? (One to many).
I saw Mantle has a method which I implemented in the Space Mantle class:
@property NSOrderedSet *tools; //.h is NSOrderedSet correct or should I use NSArray?
+ (NSDictionary *)relationshipModelClassesByPropertyKey
{
    return @{ @"tools": [SpaceTool class] };
}

as well as in the SpaceTool Mantle class:
@property Space* space; // .h
+ (NSDictionary *)relationshipModelClassesByPropertyKey
{
    return @{@"space": [Space class]};
}

@Ivandyk; Did you find a way? This is exact the same problem I am struggling with.

Hi Adrian, never did. I ultimately stopped using Overcoat and just used Mantle in combination with MagicalRecord and did everything myself.

@adrianramming What approach did you end up taking? I'm having the same issue. Cheers.


Ability to set number of threads when calling xgboost4j Booster inplace_predict?

Apologies for asking here instead of https://discuss.xgboost.ai, that site seems to be giving a 500 for me for some reason.
I'm looking to understand if we have the ability to set the number of threads a Booster uses, specifically when doing prediction instead of training. I've tried setting it with n_thread, but I've also set it to negative values and it doesn't complain so I'm not sure it's correct. Happy to submit a PR updating the documentation on this once I find the right answer!

Apologies for asking here instead of https://discuss.xgboost.ai/, that site seems to be giving a 500 for me for some reason.

@hcho3 It seems I can't access it either.

I've tried setting it with n_thread, but I've also set it to negative values and it doesn't complain so I'm not sure it's correct.

The parameter name is nthread. Yes, you can set it to a negative value, in which case XGBoost uses all available threads.

Sorry I think I used the one without the underscore. So all I need to do is
booster.setParam("nthread", 1)

To limit the Booster to a single thread? I think I'm struggling to understand the threading model, are those threads created per call to predict?

Yes, you can set the nthread prior to any prediction call, in place predict will pick it up. Please note that setParam is not thread-safe. Set it once before launching your threads.

are those threads created per call to

Those threads are managed by OpenMP. On Linux, it uses the libgomp in GCC. I can't provide a definite answer to how it manages the threads.


Swift Support

Can I use this with swift project?

Hello Can I bump this?

of course

yes you can.


No autobackup after work around

I have applied the workaround for the google issue and was able to perform a manual back up. However, it is still not backing up automatically. I am including a screenshot of the log. It says Backup skipped, no connectivity and I get a NoConnectionException. I do not have the wifi option checked and I definitely had cell service so I am not sure what the problem is. I would appreciate any suggestions.
Please specify the following:

Android version 9
Samsung Galaxy S8
SMS Backup+ <IP_ADDRESS>
Messaging app: Google Messages

Text in image reads:
/storage/emuilated/0/Android/data/com.zego...
(some text scrolled out of view)
type=EVERYBODY}. backupType=INCOMING, debug=true, typesToBackup=[SMS,MMS,CALLLOG]}
12-14 10:20BackupState{currentSynedItems=3, itemsToSync=3, backupType=INCOMING, exception=null, state=FINISHED_BACKUP}
12-14 10:20 Bckup finished
12-14 18:26 Backup requested (incoming)
12-14 18:26 Backup skipped, no connectivity
12-14 18:26 BackupState{currentSyncedItems=0, itemsToSync=0, backupType=INCOMING, exception=com.zegoggles.smssync.service.exception.NoConnnectionException, state=ERROR}
12-14 18:26 Backup finished

This would appear to be a simple case of "connectivity loss".
Questions for research: Does this model of phone or OS version block internet access from background tasks?
@Hippchikk can you also check whether it makes any difference whether mobile data is disabled or wifi is disabled. (Typically, radio connections may be turned down or off to conserve power, and mobile data can be brought back up much more quickly than WiFi as long as the phone is still registered to a cell site.)
Also in your phone's settings, can you check the power optimisation settings and make sure it allows this app to run in the background? And that it's been granted all requested permissions?

no response to follow-up questions


[$500] Chat - Square bracket does not break the link

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Open the app
Open any report
Send link with parameter in circular brackets eg: (google.com/?q=test)
Observe that app properly understands closing circular bracket and breaks the link before it
Now send link with parameter with square brackets
Observe that app does not break the link before closing squar e bracket

Expected Result:
App should not consider brackets as part of link
Actual Result:
App considers closing square bracket as part of link if link as parameter in it
Workaround:
Unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

Version Number: v1.3.75-8
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/115492554/097aabde-d590-4e6c-b1da-e132f3fc1afa
https://github.com/Expensify/App/assets/115492554/b244a14a-4e04-4452-a7a5-ade8a74897ea
https://github.com/Expensify/App/assets/115492554/a6fa04b3-6be8-4cdb-92b6-13cee4c7ac6f
https://github.com/Expensify/App/assets/115492554/4ee8f555-bac9-463d-821a-e32a89fb7672
https://github.com/Expensify/App/assets/115492554/3d894bcd-9144-4c43-9901-90a507b1c3c0
https://github.com/Expensify/App/assets/115492554/73aba282-b580-47a7-bdda-51e12e51338d
https://github.com/Expensify/App/assets/115492554/d25b4edf-ef1c-4ac0-9a3f-b98c90ed1232
Expensify/Expensify Issue URL:
Issue reported by: @Dhanashree-Sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696182736476879
View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~018a9cfe2e1c136177
Upwork Job ID:<PHONE_NUMBER>566304768
Last Price Increase: 2023-10-02

Proposal
Please re-state the problem that we are trying to solve in this issue.
Messages containing URLs with parameters that end in square brackets posted as comments do not have the brackets parsed out. When the message is sent, whomever clicks the link will be taken to a wrong address.
What is the root cause of that problem?
After digging around in the codebase, I found the problem lived in the expensify-common repo which is being used here. More precisely, in this regex that's used to parse and transform plain text messages to HTML, it's escaping square brackets (i.e. allowing them to be part of the query parameter), when they shouldn't be because [ and ] are not allowed in URLs (source) and should be %-encoded.
What changes do you think we should make in order to solve the problem?

URL_PARAM_REGEX should be changed to no longer match [ and ].
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

Contributor details
Your Expensify account email<EMAIL_ADDRESS>Upwork Profile Link: https://www.upwork.com/freelancers/~012d6dbf2e31de0765

Proposal
Please re-state the problem that we are trying to solve in this issue.
Square bracket does not break the link
What is the root cause of that problem?
The root cause of the problem the URL_PARAM_REGEX and URL_FRAGMENT_REGEX in the URL.js file, located in the expensify-common library, doesn't check the last the square brackets. Therefore, it includes the last brackets as part of the link. The constant regex variables are used to create the `URL_WEBSITE_REGEX' which is used to check for website links in comments.
https://github.com/Expensify/expensify-common/blob/ab4895807dd9a26f64bfaee80db15ee2c48a5124/lib/Url.js#L8-L9
What changes do you think we should make in order to solve the problem?

Change the URL_PARAM_REGEX and URL_FRAGMENT_REGEX to include the square brackets. So, I believe using the Negative Lookahead (?!...) and match the square brackets characters. Therefore the URL_PARAM_REGEX and URL_FRAGMENT_REGEX should like something similar to this.
const URL_PARAM_REGEX = `(?:\\?${addEscapedChar('[-\\w$@.+!*()\\/,=%{}:;\\[\\]\\|_|~](?![\[\])')}*)?;

const URL_FRAGMENT_REGEX = `(?:#${addEscapedChar('[-\\w$@.+!*()[\\],=%;\\/:~](?![\[\])')}*)?`;

@Tony-MK
Have you considered some cases involving array queries like the following ?bar[]=1&bar[]=2

Proposal
Please re-state the problem that we are trying to solve in this issue.
App considers closing square bracket as part of link if link as parameter in it
What is the root cause of that problem?
Square bracket is considered to be possible param char of URL(in URL_PARAM_REGEX and URL_FRAGMENT_REGEX), but when url has it as unmatched ending square bracket, it should not be accepted as part of url.
What changes do you think we should make in order to solve the problem?
As we can check on report video, ending parenthesis is not accepted, but square bracket is.
we have already done about ending parenthesis (https://github.com/Expensify/expensify-common/blob/main/lib/ExpensiMark.js#L449C1-L466C14), so we can remove ending square bracket like it.

Proposal
Please re-state the problem that we are trying to solve in this issue.
Chat - Square bracket does not break the link
What is the root cause of that problem?
We only have the logic to break links for one type of bracket i.e. () in ExpensiMark.
//...
for (let i = 0; i < url.length; i++) {
    if (url[i] === '(') {
        unmatchedOpenParentheses++;
    } else if (url[i] === ')') {
        // ...
    }
}
//...

That being said, this bug also occurs when a link is wrapped in curly braces i.e. {}.

What changes do you think we should make in order to solve the problem?

We'll first need to create some additional variables to count how many unmatched opening brackets of each type there are at the beginning of the while loop.
let unmatchedOpeningParentheses = 0;    // Renamed this to something more meaningful
let unmatchedOpeningSquareBrackets = 0;    // Added
let unmatchedOpeningCurlyBraces = 0;    // Added

We'll then add some logic to deal with the two remaining types of brackets - [] and {} - inside the for loop of modifyTextForUrlLinks() method in ExpensiMark below the currently existing logic handling parentheses ().
//...
for (let i = 0; i < url.length; i++) {
    // ... logic for handling parentheses

    if (url[i] === '[') { // <- Checking for square bracket
        unmatchedOpeningSquareBrackets++;
    } else if (url[i] === ']') {
        // Unmatched closing square bracket
        if (unmatchedOpeningSquareBrackets <= 0) {
            const numberOfCharsToRemove = url.length - i;
            match[0] = match[0].substr(0, match[0].length - numberOfCharsToRemove);
            url = url.substr(0, url.length - numberOfCharsToRemove);
            break;
    }
        unmatchedOpeningSquareBrackets--;
    }

   if (url[i] === '{') { // <- Checking for curly brace
       unmatchedOpeningCurlyBraces++;
   } else if (url[i] === '}') {
       // Unmatched closing curly brace
       if (unmatchedOpeningCurlyBraces <= 0) {
           const numberOfCharsToRemove = url.length - i;
           match[0] = match[0].substr(0, match[0].length - numberOfCharsToRemove);
           url = url.substr(0, url.length - numberOfCharsToRemove);
           break;
   }
       unmatchedOpeningCurlyBraces--;
   }
}
//...

Short demo after changes
https://github.com/Expensify/App/assets/79470910/8d63eec6-2c47-4fbd-843f-62a6e0771a92

What alternative solutions did you explore? (Optional)
I tried a couple of times to extract the if statement that checks for each type of bracket into another method for better readability and organization and then call this method in the for loop, but this led to issues.
// An example method
checkBracketType(unmatchedOpeningBrackets, openingBracket, closingBracket, url, match, i) {
   if (url[i] === openingBracket) {
       unmatchedOpeningBrackets++;
   } else if (url[i] === closingBracket) {
       // Unmatched closing bracket
       if (unmatchedOpeningBrackets <= 0) {
           const numberOfCharsToRemove = url.length - i;
           match[0] = match[0].substr(0, match[0].length - numberOfCharsToRemove);
           url = url.substr(0, url.length - numberOfCharsToRemove);
           break; // <- can't break outside of a loop
   }
       unmatchedOpeningBrackets--;
   }
}

The main reason for these issues is the break statement that can only be called directly in the for loop.  I also tried making this function return a boolean value and then use that to decide when the loop breaks, but that didn't work either.
That's how I arrived at my current solution. Given there are only 3 types of brackets, "()[]{}", it should hold up okay the way it is. The solution also works with links wrapped in <> (feel free to test it out).
I didn't see any other way of dealing with that break statement in an external function.

Proposal
Updated
As you can see from the "What Alternative Solutions Did You Explore?" section of my initial proposal, I was actively looking for a better way of writing my solution, so I, by no means,  stole what was suggested in this comment.
It's still good thinking, nonetheless.

Friendly bump @aimane-chnaif to review our proposals.

@aimane-chnaif I'm a bit confused by your comment.
Does it mean you're investigating special characters that should be in a link? Have you started a conversation in Slack about this issue? Should we update our proposals?
Kindly clarify.

Proposal
Please re-state the problem that we are trying to solve in this issue.
Chat - Square bracket does not break the link.
What is the root cause of that problem?
The root cause is that double quote is being allowed in Url.
but according to RFC2396, square bracket is not allowed. instead we should use escaped form. And there are other characters other than square bracket.

Furthermore, current backend uses escaped form for those characters
What changes do you think we should make in order to solve the problem?
in URL_PARAM_REGEX and URL_FRAGMENT_REGEX, we are expected to remove [,],{,},|.
const URL_PARAM_REGEX = `(?:\\?${addEscapedChar('[-\\w$@.+!*()\\/,=%:;_~]')}*)?`;
const URL_FRAGMENT_REGEX = `(?:#${addEscapedChar('[-\\w$@.+!*(),=%;\\/:~]')}*)?`;

also we need some tweaks on auto-test cases to replace those charactors with escaped form.
and we can add following test case for this issue.
    const testString = '[http://google.com/?q=test]\n'
    + '{http://google.com/?q=test}\n'
    + '[http://google.com/?q=test|123';
    const result = '[http://google.com/?q=test]
'
    + '{http://google.com/?q=test}
' +
    + '[http://google.com/?q=test|123';

    expect(parser.replace(testString)).toBe(result);

@aimane-chnaif This pull request removes special characters at the end of a URL that shouldn't be there.

https://github.com/Expensify/expensify-common/pull/575/

It was merged two days ago, but this issue is still reproducible on current staging v1.3.87-1 and production.
Kindly take a look at the PR and let me know if it provides you enough clarity.
I believe the issue we're dealing with here is concerned with matching brackets surrounding a link rather than what special characters are at the end of the URL, but I'd like to hear your thoughts after looking at the merged PR.

Bump @aimane-chnaif. Can you please follow up on the above? Thanks!

Hey @aimane-chnaif, are we still holding?

@aimane-chnaif The PR was merged over 2 weeks ago, and I can still reproduce the bug in dev, staging, and production.

@aimane-chnaif can you please provide an update?

@aimane-chnaif Did you check my proposal ?
here issue is similar to https://github.com/Expensify/App/issues/24367

@aimane-chnaif so in url, we should use escaped form, %7B for { and %7D for }

@aimane-chnaif I'm going to keep my proposal as-is.
It still checks out even after testing with your first and second example.
Kindly take a look and let me know what you think.

Hey, @aimane-chnaif, can you please provide an update? Thanks!

Hey, @aimane-chnaif, can you please provide an update? Thanks!

@aimane-chnaif, can you please confirm if we're not moving forward with the proposals above and should wait for new proposals?

@aimane-chnaif, can you please provide an update?

@aimane-chnaif, can you please provide an update? Should I reassign this issue to another C+? Thanks!

I can take this over if @aimane-chnaif agrees

@situchan
Did you check my alternative solution https://github.com/Expensify/App/issues/28608#issuecomment-1765552016 ?
Here issue is similar to https://github.com/Expensify/App/issues/24367, where you reviewed

@situchan bump

reviewing proposals

Hey @situchan what do you think of the proposals?

Bump @situchan

@situchan Did you check my alternative solution #28608 (comment) ?
Here issue is similar to #24367, where you reviewed

@t109ct I think your alternative solution is similar to @Victor-Nyagudi's main solution

Thanks for your patience. I am still testing various edge cases since this will easily cause regressions

@t109ct did the automated tests pass after applying your link, autolink changes?

Previous C+ said we should not escape [, ]. Thoughts, @situchan?

Previous C+ said we should not escape [, ]. Thoughts, @situchan?

Agree. Need to double confirm with team. Can you also test in all other popular chat platforms?

@situchan @aimane-chnaif
Now backend escapes the chars, Is it ok to have inconsistency with backend ?

If backend escapes, then fine to escape in frontend. We had similar concern in the past regarding email and landed on matching frontend with backend even if backend logic is not perfect

@situchan
your thoughts ?

I am actually thinking if we need to fix this honestly, given the current focus on new releases and features coming to the app this seems like very minor issue the user has easy workaround for.
Additionally we work on live markdown feature which would make this even easier to spot for the user
I think we can close this bug @situchan @isabelastisser

Sounds good. Closing!


Investigate where enrichment information is located now

Related to https://github.com/Esri/site-selector/issues/126
For both Live Work Locate and Site Selector, we need to look into where the enrichment information can be found now.
@LindsayThomas

Closing this issue in favor of https://github.com/Esri/live-work-locate/issues/126 which has updated information.


i want konw if is it fine to put vue-server-renderer/build.js in webpack's produce

What problem does this feature solve?
just wana know if I use vue-ssr, how can i use as react to include server.js in webpack but not only entry-server
What does the proposed API look like?
thanks for answer

Hello @freeozyl80
Thank your for your interest in this project.
However, your issue is a usage/support question, and the issue tracker is reserved exclusively for bug reports and feature requests (as outlined in our Contributing Guide).
We encourage you to ask it on the forum  , Stack Overflow or on our Discord chat and are happy to help you out there.


[RSLC-6] Conversation and message model creation and its associations PART 1

Board:

Ticket #6

Description:
Created the model and its logic associations
Notes:

This PR is only for the model and association creation. The endpoints will go in another PR so that is not that big

Tasks:

[x] Created conversation model
[x] Created conversation_user model  for the through associations
[x] Created message model
[x] Created proper specs

hi @sntgrdr ! I see you're getting this error in the checks:
Error: you must supply a CC_TEST_REPORTER_ID ENV variable or pass it via the -r flag
Usage:
  cc-test-reporter after-build [flags]

you could solve it by adding that secret value in your repo settings in "Secrets and variables - Actions":
let me know if you need some help with that, the secret should be added like this:
CC_TEST_REPORTER_ID

and the value you could get it by entering in codeclimate with your github account.
These are the steps from the rails_api_base readme:
Configuring Code Climate

After adding the project to CC, go to Repo Settings
On the Test Coverage tab, copy the Test Reporter ID
Set the current value of CC_TEST_REPORTER_ID in the circle-ci project env variables

Great info! I couldn't find it before. I'll try it this afternoon and notice you. Thanks!


Support simple way to override/define the client version

As you mentioned in #402, we can/should define the Artemis client version ourselves - normally by using the same version as for the broker.
It would be good to have a simple way to set the client version instead of overriding the dependency management (with all the exclusions) as described in this comment. For example: I don't know what exclusions might be required for an older or future client version.
It would be nice so have the possibility to set for example a Maven property which defines the client version. Also the import of a POM definition, which has the correct configuration per client could be a possibility.

Some notes on this:

We'd want to have at least somewhat of a history for older versions of the driver. Looking at the releases at mvnrepository.com, maybe back to version 2.20.0
Whenever a new version of artemis is released, we need to build a new version of the bom
It would be ideal if the bom were maintained and released by activemq-artemis (github.com), @middagj, @zhfeng do you have contact to the artemis-team? Maybe they are willing to provide the bom.

I think there is https://github.com/apache/activemq-artemis/blob/main/artemis-bom/pom.xml just be added recently. Is it what you are expecting?

Yes, looks like it. I don't have any contacts with Artemis.

Is there any news on the subject? During the last update to Quarkus 3.8.6 and the corresponding Quarkus Artemis extension, we had a relatively high effort because we also updated the broker version on our environments. That's why I'm thinking about leaving the broker version on the current version when we do the next Quarkus update. And then the client version should also match the broker version.

They seems to have published a bom package: https://central.sonatype.com/artifact/org.apache.activemq/artemis-bom/versions. Does this work for you?
I think we should also switch to use the bom.

We have not yet tested this because we are currently still using version 2.32.0. If you say that this is the definition that you can/will use in the future, then I think that would be a viable way for us to overwrite the client version.
If we want to stay on the current version (2.32.0), then we will have to think about something else (maybe something like described in https://github.com/quarkiverse/quarkus-artemis/issues/402#issuecomment-1938274938).

Ah yes, 2.32 is not released. Not reinventing the wheel always have my strong preference. If we publish a bom ourselves for older versions, preferably it should include all Artemis dependencies, and you only have a single shot (if you don't want to subversion the Artemis version).
The workaround and use the Artemis bom when you upgrade Artemis again. I tested it with the integration tests and it works as it should.

After reading you comment (which I didn't understand completely) and checking your changes I'm not really sure how the definition of the client version would look like. Maybe I was also a bit too fast with my last comment, as I didn't check the content of the referenced BOM and I don't have a complete overview of this topic at the moment.
So when I set the dependency management like described in the documentation:
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.quarkus.platform</groupId>
            <artifactId>quarkus-bom</artifactId>
            <version>3.16.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.artemis</groupId>
            <artifactId>quarkus-artemis-bom</artifactId>
            <version>3.6.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

How would I achieve to use a different Artemis client version, like for example 2.33.0? When I would add the following entry in the dependency management, it would define the versions for the Artemis dependencies, but in you quarkus-artemis-bom you would define the dependencies like artemis-core-client again (with the exclusions), but here a different version (defined via ${artemis.version}) is used and your exclusions would not be used, right?
<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>artemis-bom</artifactId>
    <version>${different.artemis.client.version}</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

Or would everything work when I override the property artemis.version and use this also for the artemis-bom? But this would have no effect, like in described in https://github.com/quarkiverse/quarkus-artemis/issues/402#issuecomment-1934725600, right?
Maybe there is a misunderstanding from my site and I have to check our previous discussions and get into the topic again.

I need to double check, but my first impression was that the dependencies are merged so our exclusions and the version from the Artemis bom are combined.
The rest of the comment is more about the older versions for which I would just apply the workaround as in https://github.com/quarkiverse/quarkus-artemis/issues/402#issuecomment-1938274938 until you switch to a newer version.

@all-contributors please add @timonzi for ideas

@timonzi We merged #679. I would like to wait a little bit longer for the release (we updated the artemis-jms library to version 2.38.0, but the corresponding container image hasn't been built yet, I'd like those two versions to match). I'll ping you again as soon as the improvement has been release. It will be avialable in version 3.6.x and 3.5.x.


Select binding enhance test failures in firefox

The enhance binding tests for selects fail in Firefox because when the selected attribute is removed from the selected second option, the value of the select reverts to the first option. Then when the select binds, it sets its value and option state according to the new non-selected state. This seems to only affect Firefox. So my question is, should we a) work around the issue for Firefox, b) say that if the data doesn't match the occupant DOM state then ignore the DOM and go with data (make everything else act like Firefox for these two tests), or c) just disable the tests for Firefox and call it a browser specific corner case?
There's also a decorator teardown test that fails when the whole suite is run, but it doesn't fail when just the decorator module or the single test is run. I suppose that's a browser timing issue, so I'll go with it's safe to ignore.

Just noting that apparently Chrome 50 is changing to match the FF behavior, so this is an issue there too if #2369 doesn't land.

My vote is that #2369 should land for 0.8. Lot's of good things in there. Not sure what the risks (read new bugs) are with #2369? What do others think?


biopoesis, flyted

This pull request was generated by the 'mq' tool
[test]
flake rate: 0.2
logical conflict every: 1000
sleep for: 2100s
close stale after: 24 hours
[pullrequest]
requests per hour: 120
deps=[b,f]

/trunk merge


Complete Python Principles

The course can be found at: https://pythonprinciples.com/

Everyone has completed Python Principles walkthrough.


Implementing Window Icon

Pre-flight Checklist

Please remember that if you are logging a bug for some service that has stopped working or is working incorrectly, please log the bug here
If you are requesting support for a new service in Ferdi, please log it here
Please remember to read the self-help documentation - in case it helps you unblock yourself for issues related to older versions of recipes that were installed on your machine. (These will get automatically upgraded when you upgrade to the newer versions of Ferdi, but to get new recipes between Ferdi releases, this documentation is quite useful.)
Please consider supporting Ferdi!
👉 https://github.com/sponsors/getferdi
👉 https://opencollective.com/getferdi/donate
Please ensure you've completed all of the following.

[x] I have read the Contributing Guidelines for this project.
[x] I agree to follow the Code of Conduct that this project adheres to.
[x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Description of Change

Motivation and Context

Screenshots

Checklist

[x] My pull request is properly named
[ ] The changes respect the code style of the project (npm run prepare-code)
[ ] npm test passes
[ ] I tested/previewed my changes locally

Release Notes

@laur89 @vraravam Can you check this for me, and could I possibly learn more about your debugging / testing workflow for when you try to run new mods. I assume the last command on the contributor's guide works correctly and it is just on my part though I would like to be sure.

@vraravam It is sadly not complete. I was going to use that current icon as a place holder while I use my aesprite trial to potentially write another one. Is there a way you setup that original picture as an alternate I can switch the url to to test the desig?
Also, on ubuntu it is not loading the logo, though the window icon formatting does look better than before. I am not sure why it is not drawing on that I'll have to look into that tomorrow. It may require me analyzing the class design a little further.

@vraravam Also, if you don't mind, what is the typical process / workflow you run of commands to make sure your branch is up to date? I get a bit confused on that sometimes.

A few more resources I'll look at later that may be some leads.
https://github.com/electron/electron-packager/issues/128
https://github.com/jlord/git-it-electron/blob/master/main.js#L29

@vraravam It is sadly not complete. I was going to use that current icon as a place holder while I use my aesprite trial to potentially write another one.
Unfortunately, the designs would need a larger approval process (imo), so, its better to use graphics that are already in use. Changing the icons can be a separate PR. Please start a discussion thread for it - when you are ready with the new icon.

@vraravam Also, if you don't mind, what is the typical process / workflow you run of commands to make sure your branch is up to date? I get a bit confused on that sometimes.

I use the following command to run it in debug mode.

@vraravam I can't seem to figure it out. I tried approaching it differently, but the I fell back to that same implementation we had before the review. Here is another resource I have been looking at. At the top left no icon shows up, yet at the top right the mustache shows up. I am not sure if that is because I set the logo as a png instead of ico image for the electron build.
I have also read that you may have to explicitly set --icon as the image path but am not too familiar with electron to make that decision.
Do you happen to have any resources on learning more about electron? I think that would help.
Reference: https://stackoverflow.com/questions/31529772/how-to-set-app-icon-for-electron-atom-shell-app

@vraravam I am working on a modular component in a separate repository to try and see where the code is required for implementing a window icon in linux's panel icons. The code here works as needed, though the icon does not display on the top left side but does on the top right just fine. Thus, I think this is a deeper issue, and can write that up before continuing the next PR. Please let me know if we can send this to merge, and if you'd like to be attached to the repository on the window icon as I develop it.

thanks @eminokic - could you please share a screenshot? That way, we can also have @mhatvan chime in whether this is ready for merge. (I dont use linux, and so this change does not affect me)

@eminokic - since there's no word from you, should we mark this PR as abandoned?

@eminokic - closing this Pr since there's no response about progress. Thanks for your contributions.


Tests are not building

Trying to run tests with nightly rustc 1.11.0-nightly (bb4a79b08 2016-06-15).
tests/test.rs:405:68: 405:68 error: mismatched types [E0308]
tests/test.rs:405     #[derive(RustcEncodable, RustcDecodable, Serialize, Deserialize, Debug)]
                                                                                ^
tests/test.rs:405:57: 405:68 note: in this expansion of try! (defined in <std macros>)
tests/test.rs:405:57: 405:68 note: in this expansion of #[derive_Deserialize] (defined in tests/test.rs)
tests/test.rs:405:68: 405:68 help: run `rustc --explain E0308` to see a detailed explanation
tests/test.rs:405:68: 405:68 note: expected type `serde::Deserialize`
tests/test.rs:405:68: 405:68 note:    found type `serde::Deserialize`
tests/test.rs:405:57: 405:68 note: the lifetime 'a as defined on the block at 405:56...
tests/test.rs:405     #[derive(RustcEncodable, RustcDecodable, Serialize, Deserialize, Debug)]
                                                                          ^~~~~~~~~~~
tests/test.rs:405:68: 405:68 note: ...does not necessarily outlive the static lifetime

As far as I can tell this error points RefBox's lifetimes.

@0nkery @dtolnay @erickt: could this be a change in the Deserialize codegen?  Could one of the serde maintainers tell us if there were any changes to codegen that would break us like this?

Until this is figured out, I'll be disabling the tests over in https://github.com/TyOverby/bincode/pull/78

So far I have narrowed it down to the following code does not compile:
#[derive(Deserialize)]
struct Message<'a>(RefBox<'a, ()>);

Now I will start looking at the generated code to find the problem.

This failure was correct on Serde's part and a bug in bincode. The code was trying to derive Deserialize for a type containing RefBox<'a, _>, but that does not implement Deserialize because only RefBox<'static, _> implements Deserialize. I have a fix in #79.


Fix Microcart

To display properly the items stored (step 1) and then style it (step 2h

@filrak fixed and ready to style it out!

Thanks @pkarw :)


j: re-implement using mkDerivation

cc @7c6f434c
Built locally in chroot, tested briefly.

Feel free to ping me to add yourself as a maintainer.


[main] Upgrade to latest dependencies

Cron. -knative-sandbox
/cc knative-sandbox/networking-wg-leads
/assign knative-sandbox/networking-wg-leads
Produced via:
./hack/update-deps.sh --upgrade --release v0.22
./hack/update-codegen.sh

Details:
bumping knative.dev/pkg dfeeb18...b558677:
  > b558677 Use TB interface, rather than T pointer when doing test stuff (# 2064)
  > 9bf9eeb rename downstream-test-go to actions-downstream-test (# 2065)
bumping knative.dev/networking ed835c9...8fc278d:
  > 8fc278d rename downstream-test-go to actions-downstream-test (# 374)

/retest


ac-go-live

Docs Build status updates of commit 21e86bf:
:warning: Validation status: warnings

File
Status
Preview URL
Details

ValidatePublishRequest
:warning:Warning

Details

msteams-platform/TOC.yml
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/conversation-basics.md
:white_check_mark:Succeeded
View

ValidatePublishRequest

[Warning] Owner charlesprakash of repository https://github.com/MicrosoftDocs/msteams-docs has lost Admin permission. Please use Transfer Owner via Docs portal https://ops.microsoft.com to assign a new owner.

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit d199dd7:
:warning: Validation status: warnings

File
Status
Preview URL
Details

ValidatePublishRequest
:warning:Warning

Details

.openpublishing.publish.config.json
:white_check_mark:Succeeded

msteams-platform/TOC.yml
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/conversation-basics.md
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/send-proactive-messages.md
:white_check_mark:Succeeded
View

ValidatePublishRequest

[Warning] Owner charlesprakash of repository https://github.com/MicrosoftDocs/msteams-docs has lost Admin permission. Please use Transfer Owner via Docs portal https://ops.microsoft.com to assign a new owner.

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit 16e8169:
:warning: Validation status: warnings

File
Status
Preview URL
Details

ValidatePublishRequest
:warning:Warning

Details

.openpublishing.publish.config.json
:white_check_mark:Succeeded

msteams-platform/TOC.yml
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/authentication/add-authentication.md
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/conversation-basics.md
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/send-proactive-messages.md
:white_check_mark:Succeeded
View

ValidatePublishRequest

[Warning] Owner charlesprakash of repository https://github.com/MicrosoftDocs/msteams-docs has lost Admin permission. Please use Transfer Owner via Docs portal https://ops.microsoft.com to assign a new owner.

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit 34a1587:
:warning: Validation status: warnings

File
Status
Preview URL
Details

ValidatePublishRequest
:warning:Warning

Details

.openpublishing.publish.config.json
:white_check_mark:Succeeded

msteams-platform/TOC.yml
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/authentication/add-authentication.md
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/conversation-basics.md
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/send-proactive-messages.md
:white_check_mark:Succeeded
View

msteams-platform/docfx.json
:white_check_mark:Succeeded

ValidatePublishRequest

[Warning] Owner charlesprakash of repository https://github.com/MicrosoftDocs/msteams-docs has lost Admin permission. Please use Transfer Owner via Docs portal https://ops.microsoft.com to assign a new owner.

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Docs Build status updates of commit 0977b48:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

.markdownlint.json
:white_check_mark:Succeeded

.openpublishing.publish.config.json
:white_check_mark:Succeeded

msteams-platform/TOC.yml
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/AppIcon-01.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/AppIcon-02.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/AppIconOutline-01.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/AppIconOutline-02.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/AppName-01.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/AppName-02.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/LongDescription-01.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/LongDescription-02.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/Screenshot-01.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/ShortDescription-01.png
:white_check_mark:Succeeded
View

msteams-platform/assets/images/store-detail-page/ShortDescription-02.png
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/authentication/add-authentication.md
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/conversation-basics.md
:white_check_mark:Succeeded
View

msteams-platform/bots/how-to/conversations/send-proactive-messages.md
:white_check_mark:Succeeded
View

msteams-platform/concepts/deploy-and-publish/appsource/prepare/detail-page-checklist.md
:white_check_mark:Succeeded
View

msteams-platform/docfx.json
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


⚠ ClamAV has degraded performance

In c5a9881, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 101 ms

Resolved: ClamAV performance has improved in 4c7a2a5 after 5 minutes.


Disable reading from clipyboard.

is it possible to only write and not read?
browser seems to be giving warnings if multiple read instances are there

It is not currently possible with this library, but I do support this idea. 🙂
It's a matter of I don't personally have the time to open the pull request.


When building a list, collect into Vec and then Bump::alloc_slice_clone at the end

One advantage would be that we wouldn't have to store a link anymore with each node.
A disadvantage is that a list is two pointers.

This doesn't seem promising.


Include docs in conda package?

Should we include HTML and PDF versions of the docs in the conda package?

As of 0.2.1, I'm now bundling the HTML docs in $MINICONDA/docs/openforcefield/html/.
We can build the PDF too if you think this would be useful, but it would take more build infrastructure magic to install texlive.

cc: https://github.com/omnia-md/conda-recipes/pull/941


release reusable pipeline

This PR introduces a reusable workflow to release the OHIs.
Usage example:
jobs:
  job_name:
    uses: newrelic/coreint-automation/.github/workflows/trigger_reusable_on_release.yaml@v2
    with:
      tag: ${{ github.event.release.tag_name }}
      integration_name: "integration-name" # without the 'nri-' prefix
    secrets: inherit

Since the required secrets are common for all OHIs, the workflow can be used with inherited secrets (this force us to use the workflow in the same organization).
There are flags to skip testing the package, and setting up the publish schema.

I am testing how the inputs are passed here (In particular that the events.repository is correctly detected)


New Deployment Procedure - Admin consent required

Hi,
i tried to deploy the Industrial-IoT-Solution using the new Deployment program.
I used it without any parameters, so it asked me for information. After providing tenant id and logging in, i was redirected to admin consent, which i cannot give, as i'm not the admin of the AAD.
I'm Owner of the subscription i want to use have sufficient rights to deploy using the old deployment procedure. (Creating, changing app registration etc.)
How is determined, whether admin consent is required? What is the admin consent required for?
Also i couldn't find any documentation of the new deployment procedure. Where do i have to look?
Thank you for your help
Matthias

Hi Matthias,
We are using Microsoft Graph to create/manage Azure resources on behalf of the user. And for that we need to have a application registration which defines authentication flows and permissions it will need. Then it is required that admin of your tenant consents to use of this application within the tenant. This is one-time only action that your tenant admin will have to perform. Only after admin consent is granted deployment application can work in your tenant.
During the application execution, authentication flow will automatically check whether admin consent is granted or not. If not, then after authentication you will be either presented with page to immediately grant the consent (only if you are tenant admin) or to ask your tenant admin to grant consent for use of deployment application (AzureIndustrialIoTDeployment) within the tenant. If you are not admin, you should be able to propagate the request to your tenant admin.
Here is documentation of deployment application, it also includes notes about admin consent: https://github.com/Azure/Industrial-IoT/blob/master/docs/industrial_iot_deployment.md
Some additional resources about Azure AD consent:

Understanding Azure AD application consent experiences
Configure the way end-users consent to an application in Azure Active Directory

Karapet

@mma-mm, I should also mention that currently you would not be able to run Microsoft.Azure.IIoT.Deployment if you are not admin in your tenant, even after admin consent is granted to AzureIndustrialIoTDeployment application. The reason for that is that Microsoft.Azure.IIoT.Deployment does application registration in your tenant, and that is not possible if you are not admin in the tenant. We will add functionality in future to pre-register applications in the tenant and pass application ids to  Microsoft.Azure.IIoT.Deployment, so that it uses them instead of creating new application registration.

@mma-mm, we've introduced separation of deployment flow via Microsoft.Azure.IIoT.Deployment into two stages. First one (RunMode=ApplicationRegistration) performs only AAD application setup and second one (RunMode=ResourceDeployment) performs deployment of Azure resources and microservices. The first step does still require admin permissions, since they are required for registration of AAD applications, but for the second one being an Owner of a subscription would suffice. Would this separation help you in deploying our IIoT solution ?
Please note that in RunMode=ApplicationRegistration application will output definitions of registered applications that should be then used for running in RunMode=ResourceDeployment. You can find more info in Microsoft.Azure.IIoT.Deployment  documentation. For passing output of first step to second one you can use appsettings.json file. Here is how sample appsettings.json should look.

Closing for inactivity - current solution requires a manual step by an administrator to consent.   This cannot be avoided at this point.   We are working on a version that is AAD independent which should help in the future.


Implementing foldMap for foldable

With a foldable it is (or should be) possible to implement foldMap in terms of foldr (what fantasy land calls reduce) and vice versa.
If I have a monoid like this:
function _Add(n) {
  this.n = n;
}
_Add.prototype.empty = function() {
  return new _Add(0);
}
_Add.prototype.concat = function(m) {
  return new _Add(this.n + m.n);
}
function Add(n) {
  return new _Add(n);
}

foldMap should behave like this when given a traversable of numbers and the above constructor function.
assert.deepEqual(foldMap(Add, traversableFromArray([1, 2, 3, 4])), Add(10));

But the straightforward implementation doesn't work:
function foldMap(f, t) {
  t.reduce(f, empty);
  //          ╰── does not work, there is no empty
}

The problem is that foldMap doesn't know how to create an identity element of the monoid inside the passed foldable. The easiest solution would be to do the same as what fantasy land does in a few places and demand an additional argument to help the implementation. In this case if users where required to pass an empty value then the simple implementation would work.
But such an argument results in an inferior API with unfortunate ugliness.
Since the function passed to foldMap is required to return a monoid it is possible, with a bit of clunkiness, to work around the need for an initial empty value. An implementation that satisfies the previous assertion is given below:
    var empty = {};
    function foldMap(f, t) {
      return t.reduce(function(acc, n) {
        return acc === empty ? f(n) : concat(acc, f(n));
      }, empty);
    }

We create a dummy empty value that contains a pointer to an object (which we now will be unique) and uses it inside the function passed to reduce to ignore the initial accumulator value.
This seems to result in the desired foldMap at the cost of elegance in the implementation.
Any thoughts?

The problem with using some arbitrary value for the empty is that now your function doesn't do the right thing for an empty Foldable. Like if you have an empty array or whatever, instead of getting back the right thing, you now get back a plain object.
There are at least two ways to handle this:

Only operate on "non-empty" Foldables--Foldable1 as they're usually called in haskell and friends.
In this case, you can relax the constraint to Semigroup, and since you are guaranteed to have at least one element, you can always have an "initial" value.

Take the Monoid as an argument, as you suggested. Although the api is slightly more cumbersome, it's "The Right Way". Let's not forget that a signature like:
foldMap :: (Foldable f, Monoid m) => (a -> m) -> f a -> m

compiles to something like:
foldMap' :: foldableDict f -> monoidDict m -> (a -> m) -> f a -> m

depending on the compiler. So there's no reason to expect js to have some way to circumvent the need to pass around the second dictionary.

Take the Monoid as an argument, as you suggested. Although the api is slightly more cumbersome, it's "The Right Way". Let's not forget that a signature like:
foldMap :: (Foldable f, Monoid m) => (a -> m) -> f a -> m

compiles to something like:
foldMap' :: foldableDict f -> monoidDict m -> (a -> m) -> f a -> m

depending on the compiler. So there's no reason to expect js to have some way to circumvent the need to pass around the second dictionary.

The problem is that the specification is fuzzy here:

A value which has a Monoid must provide an empty method on itself or its constructor
object.

(emphasis added)
If someone decides to implement empty only on the instances and not on the constructor/dictionary, then passing this to @paldepind's foldMap won't work.  This was discussed (perhaps to death) in #88.

Yeah, this sounds like a duplicate of #88. There is no convincing solution to overcome JavaScript's lack of type inference.

@bergus:
The answer from @joneshf would work fine if the specification simply required that a Monoid must provide an empty method on its constructor object.  It's the ambiguity in the definition that seems to cause a problem.

@CrossEye You mean the solution with the "type dictionary"? I guess passing in _Add.prototype (for the above example) would work quite well, only the problem that you have to pass that in remains.

@bergus, you're right that one can provide _Add or _Add.prototype as appropriate. Authors of libraries which accept values of any FL-compliant type, though, must write things like
typeof x.empty === 'function' ? x : x.constructor

to decide which "dictionary" to provide. I believe this is why @CrossEye suggests the spec should specify one location for empty rather than two.

Ahh I think I'm getting what you're arguing at. I always was under the impression that if we use type dictionaries as arguments, then they are infectious and will pervade the entire codebase anyway. Only if a type is instantiated, the specific dictionary object is required, and can be chosen appropriately (depending on the implementation of that particular data type).
But you're proposing to extract the type dictionary from a given value of an arbitrary instance in library code?! For that, allowing .empty/.of to be found only on the constructor is indeed unfortunate. If we did require them to be instance properties (or inherited from the prototype), then every value itself could be used as the dictionary (if that doesn't leak memory or secure information).
Alternatively, I could envision a new method/property to extract this dictionary from arbitrary instances. Expanding on the above example, it might be
var typedict = getSymbol("fantasyland.typeDictionary")
Add.type = _Add.prototype[typedict] = _Add.prototype;

so that a user could pass in Add.type as a type argument where required, and libraries could extract instance[typedict] from every arbitrary instance to get an object with all the functions/methods for that type.

@bergus: I've been thinking of building an implementation of something very similar to that idea, using the public API of FantasyLand as a purely functional rather than OO-style implementation.  I won't be able to get to it for several weeks, but I'm looking forward to seeing if I can get it to work in a clean manner.  It would still mean passing in either empty or the type into foldMap, but for something like map or concat I could extract the appropriate versions from the instances, just as you say.  I've been thinking about this for some time, and once I clear one other thing of my plate, it's next up.

I'd like to see a rewrite of the spec using explicit dictionaries for everything. My theory is that'd be more useful than the current spec but much less convenient. Definitely happy to do that as Fantasy Land 2 if it actually works, though.

@joneshf

The problem with using some arbitrary value for the empty is that now your function doesn't do the right thing for an empty Foldable. Like if you have an empty array or whatever, instead of getting back the right thing, you now get back a plain object.

Indeed. you're right. That is the catch.
@bergus

Yeah, this sounds like a duplicate of #88.

How? The topic here is "how to implement foldMap". It is only vaguely related to #88.
foldMap could simply require users to pass in the identity element of the monoid in the foldable and then the implementation wouldn't have to worry about finding the empty method (of course then the user would have to know where to find it instead).
@CrossEye

I've been thinking of building an implementation of something very similar to that idea, using the public API of FantasyLand as a purely functional rather than OO-style implementation. I won't be able to get to it for several weeks, but I'm looking forward to seeing if I can get it to work in a clean manner. It would still mean passing in either empty or the type into foldMap, but for something like map or concat I could extract the appropriate versions from the instances, just as you say.

I don't get this: "for something like map or concat I could extract the appropriate versions from the instances". But that is as easy as accessing the map property right?
@puffnfresh
Can you expand on the more useful part? Usefulness and convenience often go hand in hand in my experience.

Useful: we can implement foldMap.
Inconvenient:
someFantasyFoldableLibrary.foldMap(foldableList, monoidNumber, function(a) { return a.length; }, ["hello", "world"]);

Useful: we can implement foldMap.

We can do that today as well:
function foldMap(monoid, f, foldable) {
  return foldable.reduce(function(acc, n) {
    return acc.concat(f(n));
  }, monoid.empty());
}

We can do that today as well:
function foldMap(monoid, f, foldable) {
  return foldable.reduce(function(acc, n) {
    return acc.concat(f(n));
  }, monoid.empty());
}

You can't necessarily do that by the spec, which allows the user to define empty only on instances and not the constructor.  So, while it may work for a subset of FantasyLand-compatible Monoids, it will not work universally.

@paldepind:

I don't get this: "for something like map or concat I could extract the appropriate versions from the instances". But that is as easy as accessing the map property right?

I'm imagining a type registry, perhaps based on a Symbol, as @bergus said, but in any case accessible to Lib.concat so that when a user calls Lib.concat(obj1, obj2) it would scan the Semigroup registry for some type T such that R.is(T, obj1) && R.is(T, obj2). 1  (It would have to be somewhat more sophisticated, as it should find the most specific type, but that's just a detail at the moment).  And then from the type definition, it would take the appropriate version of concat and apply it to obj1 and obj2.  This could be a method on the object, but would not have to be, and my preference would be not to implement it that way.

1 R.is is a Ramda function that just checks if param2 is an instance of the constructor param1: http://ramdajs.com/docs/#is

So a compiler?

You can't necessarily do that by the spec, which allows the user to define empty only on instances and not the constructor. So, while it may work for a subset of FantasyLand-compatible Monoids, it will not work universally.

I think this makes the solution to #88 pretty clear then. If we force these "static" methods to be defined on the constructor, we gain more power.

@CrossEye

You can't necessarily do that by the spec, which allows the user to define empty only on instances and not the constructor. So, while it may work for a subset of FantasyLand-compatible Monoids, it will not work universally.

This flatMap require an object with an empty method so users can either pass the prototype, the constructor or an instance. It doesn't matter to the point I'm trying to make: flatMap can be implemented with the current spec. I really don't want this discussion to be about the constructor issue – it is a separate thing.

I'm imagining a type registry, perhaps based on a Symbol, as @bergus said, but in any case accessible to Lib.concat so that when a user calls Lib.concat(obj1, obj2) it would scan the Semigroup registry for some type T such that R.is(T, obj1) && R.is(T, obj2). 1 (It would have to be somewhat more sophisticated, as it should find the most specific type, but that's just a detail at the moment). And then from the type definition, it would take the appropriate version of concat and apply it to obj1 and obj2. This could be a method on the object, but would not have to be, and my preference would be not to implement it that way.

I still don't get it. What is the advantage of this compared to just using a concat method? You would have to have access to the type information and if you have that you could just as well have the methods themselves. The problem in this case is that for an empty foldable there is no information about the monoid inside it unless explicitly passed. And if you explicitly pass it then just passing the methods would be easier.

I think you've made the solution to #88 pretty clear then. If we force these "static" methods to be defined on the constructor, we gain more power.

That's the conclusion I'd come to, and it's what I'm planning on playing around with, albeit with a somewhat different API.  I expect to keep much of the essence of FantasyLand in my attempt, but we'll see.  At the very least, I expect that things like concat, empty, of, map, etc. will retain their meanings, and I would keep the same names. (I wouldn't choose bind or flatMap instead of chain, etc.)

@paldepind:

This flatMap require an object with an empty method so users can either pass the prototype, the constructor or an instance. It doesn't matter to the point I'm trying to make: flatMap can be implemented with the current spec.

foldMap, surely?
If all the user is supposed to pass in is something that has an emtpy() method, and if it's only going to be used once, might it not be better just for them to pass an/the empty instance directly?  I know you mentioned this above, but that seems cleaner than the suggestion that you can pass any instance or the constructor, so long as whatever you pass has empty() defined on it.
In the end, though, I think to your fundamental question, the answer is yes, you have to supply something more than the function and the Foldable in order to handle the empty case.  This shouldn't be such a surprise:  foldl/foldr do have their foldl1/foldr1 counterparts that don't need that third parameter, but then throw errors if their Foldables are empty.

I still don't get it. What is the advantage of this compared to just using a concat method?

Perhaps there's none.  It seems like a really good idea to me, but I haven't proven it, even to myself yet..  The thought is that I'd rather be programming like this:
    var myMonoidImpl3 = concat(myMonoidImpl1, myMonoidImpl2);
    var maybeSquare = pipe(getNextValue, Maybe.of, map(square))(currentVal);
    var foldMap = curry(function(monoid, fn, foldable) {
      return reduce(function(acc, n) {
        concat(acc, f(n));
      }, empty, foldable);
    });
    var result = foldMap(fn, MyMonoid.empty, myTreeOfMyMonoids)

than like this:
    var myMonoidImpl3 = myMonoidImpl1.concat(myMonoidImpl2);
    var maybeSquare = pipe(getNextValue, Maybe.of, val => val.map(square))(currentVal);
    function foldMap(monoid, f, foldable) {
      return foldable.reduce(function(acc, n) {
        return acc.concat(f(n));
      }, monoid.empty());
    }
    var result = foldMap(MyMonoid, fn, myTreeOfMyMonoids)

Such an implementation would help me work in this preferred manner.  We'll see if I can make it work, make it usable, and make it efficient.  But that API is the goal.

@CrossEye

If all the user is supposed to pass in is something that has an emtpy() method, and if it's only going to be used once, might it not be better just for them to pass an/the empty instance directly? I know you mentioned this above, but that seems cleaner than the suggestion that you can pass any instance or the constructor, so long as whatever you pass has empty() defined on it.

I agree. I think the main counterargument is consistency with other function where you have to pass a dictionary.

Such an implementation would help me work in this preferred manner. We'll see if I can make it work, make it usable, and make it efficient. But that API is the goal.

But you can mostly achieve that just by having functions that invoke the respective methods (like R.invoker)?

I agree. I think the main counterargument is consistency with other function where you have to pass a dictionary.

AFAIK, the only places where that would be necessary is when you need to make reference to of or empty.  All the other FL functions require at least one instance of the type, which can then serve as your dictionary for the remaining relevant functions.  These two are the special cases, and that's why I brought up #88.

Such an implementation would help me work in this preferred manner. We'll see if I can make it work, make it usable, and make it efficient. But that API is the goal.

But you can mostly achieve that just by having functions that invoke the respective methods (like R.invoker)?

I could.  I don't think I'm getting my ideas or my rationale across at all, but its probably because it's still fairly ill-formed for me.  When I get closer to trying it (probably two weeks or so) I'll likely be back asking questions and advice, and I won't be surprised if that advice is simply "Don't do it!"  :smile: