Added support for fractional units

Fixes #753
Added support for fractional units by making the regex pattern support digits before a decimal point and converting num to a float instead of an int on line 150.
What this changes
Before this fix, parse("in 0.5 hours") would return the time 5 hours in the future instead of 0.5 hours in the future.
With this fix, parsing fractional units are no longer parsed incorrectly.
Tests
>>> parse("now")
datetime.datetime(2021, 2, 7, 18, 50, 10, 107501)
>>> parse("in 0.5 hours")
datetime.datetime(2021, 2, 7, 19, 20, 15, 773800)
>>> parse("in 3.75 hours")
datetime.datetime(2021, 2, 7, 22, 35, 20, 463238)
>>> parse("2.5 hours ago")
datetime.datetime(2021, 2, 7, 16, 20, 29, 614937)

HI @DenverCoder1, thank you for this PR.
Could you add those tests you mention in the description in the project tests? Thanks!

@Gallaecio Added some tests for fractional units. Also added some support for numbers with commas instead of periods. Adding comma support was not as simple because of the way the Dictionary splits the strings.

I see you’ve had to modify the per-language Python files. Those are not meant to be modified manually, and are instead generated from other files in the repository. See https://dateparser.readthedocs.io/en/latest/contributing.html#guidelines-for-editing-translation-data . On the bright side, it may mean that you just need to edit the script that generates them.

@Gallaecio
I see. So I should update write_complete_data.py and the yaml files then rerun write_complete_data.py?

The JSON files are not meant to be modified (they come from http://cldr.unicode.org/), so this may be not as trivial as I had hoped.

The JSON files are not meant to be modified (they come from http://cldr.unicode.org), so this may be not as trivial as I had hoped.

I didn't need to modify the JSON, only had to change the way it is converted in write_complete_data.py.

Looking at https://github.com/scrapinghub/dateparser/pull/859 maybe it’s just a matter or reopening.

Hi @DenverCoder1 @Gallaecio  Thank you for the PR.
I like the approach, however, I'm don't want to merge this as-is, because not all the locale/regions accept both (period and comma) as decimal separator. This could lead to some errors.
For example, if we have 1.500 s we don't know if it's 1 point 5 seconds or 1 thousand 500 seconds. In UK and US, they normally use comma (,) as a thousand separator, while in Spanish we usually use the period (.) as a thousand separator.
I tried with this code, and this is what I got:
>>> datetime.now() - dateparser.parse('1,5000 s', languages=['en'])
datetime.timedelta(0, 4999, 995131)

>>> datetime.now() - dateparser.parse('1.5000 s', languages=['en'])
datetime.timedelta(0, 1, 496419)

>>> datetime.now() - dateparser.parse('1,5000 s', languages=['es'])
datetime.timedelta(0, 4999, 996924)

>>> datetime.now() - dateparser.parse('1.5000 s', languages=['es'])
datetime.timedelta(0, 1, 496970)

I personally think that the decimal/comma separator should be configured by default by locale and we should probably be able to configure it manually using the settings, so this approach wouldn't probably work.
Let me know what you think / your ideas :)

I think you have a point, but I also imagine that those examples are interpreted as 5000 with master. If so, I imagine this change would not break anything that is parsed fine at the moment, but only extend support for fractional numbers without thousand separators.
Given that, I would not mind merging as is and creating 2 separate tickets (1) for restricting supported decimal separators based on locale (we can hopefully use data from CLDR to choose the right ones) and (2) for supporting thousand separators.
But yes, we could also aim to solve all of that in this patch. I’m just worried about the extra time that could require.

@Gallaecio @noviluni What's the status on this? I don't think I have the time now to try making it locale-based as suggested. I agree that it could be made a separate PR.
As of now, it will make things such as "2.5 hours", etc. parse correctly when right now they don't ("2.5" gets treated as "5").
To make it work with periods only required a couple simple changes. Making it work with commas as well was a bit more complicated due to the way the parser ignores commas, but it should also be working properly with these changes.
If there's a worry that parsing commas as decimal points could break things, that part could be removed for now until the locale settings are in place, or if not, it could be merged as is.
Let me know if there's anything else needed from me.

Could I ask the status of this PR?
It's approved almost a year ago but still not get merged?

We usually follow a 2-maintainer-approval policy before merging. The next step is for another maintainer to have a look. However, most (all?) dateparser maintainers are also maintainers of many other open source libraries, and our time is limited.

Would love to get some more visibility on this! ♥

Updating the base branch will take some extra work due to some changes in the language data.
#1079 specifically has caused some issues since they changed the CLDR data instead of the supplementary yaml. I can open a separate PR to fix that.

All languages should be working again now.
Note: The fix in #1090 is also incorporated in this PR.


Feature request : custom_targeting

Thank you so much @wjaykim for this lib !
Can you please add custom_targeting for GAMBannerAd ?
https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting#custom_targeting
https://developers.google.com/admob/ios/api/reference/Classes/GAMRequest
Until now I was using sbugert/react-native-admob with this commit to support custom targeting on iOS & Android.
Maybe this work can help :
https://github.com/manuhook/react-native-admob/commit/48a9dfa400f08e1f00d618a970ce4ef6df013b6a
Thank again !

Hi, I'll add the options in the future release. Thank you for suggesting.

Hi, thank you for your answer. It is now implemented on our project, you will have a PR soon !


How do I make Multicasting by one-to-many transmissions

I'm figuring a way to broadcast media packet one-to-many to subscribers via UDP after setting up DTLS with SCTP or do i need to loop individual Peerconnection to write rtcp packet every time when available from publisher

You need to loop each PeerConnection and write a RTCP Packet.
Each PeerConnection has its own crypto state. If something like EKT was available you could do as you describe though! https://groups.google.com/g/discuss-webrtc/c/w_r09j88Y_8


Move to CMake-based build

NOTE: based on #11. Review/merge that one first.
build.bat is great for windows, terrible for everyone else that wants to use it. CMake is (arguably) considered the industry standard at this point, and it makes integration with just about any project or workflow a breeze.
This is going to be easier to maintain than a separate build.bat/build.sh and be more accurate in terms of how to build things, too.

I don't use make systems, they overcomplicate things.
- Casey

I mean... Thats not objectively true. Can you justify your statement?

Of course it is not objectively true. It is subjectively true. He says "I don't use", not that you should not use it.
 It cannot be easier that that.
With cmake? You need run cmake (after figuring out correct arguments for cmake to specify your desired buildsystem), then you need to run build system (after figuring out how to install it), and only then you get exe (in some weird folder). Also a ton of useless files are generated during this process.
And anyways building is not actually needed if you want to use meow_hash - this is header-only library. build.bat is only for internal testing/benchmarking.

 It cannot be easier that that.

It's not about easy. It's about making it compatible with people that are trying to help you develop your project.
However, right now it appears the maintainer isn't interest in public contributions.

With cmake? You need run cmake

$ mkdir build && cd build
$ cmake ..

after figuring out correct arguments for cmake to specify your desired buildsystem

This is what README's are for.

then you need to run build system

$ make

or
$ cmake --build=.

after figuring out how to install it

# mac
$ brew install cmake

# ubuntu
$ sudo apt install cmake

# fedora
$ yum install cmake

# arch
$ pacman -S cmake

On windows there an installer and a GUI for those that don't want to use the command line: https://cmake.org/runningcmake/

and only then you get exe (in some weird folder)

It's literally in the directory you run cmake in. You can run it in the same directory directly after building.
$ meow_collidecheck.exe

Also a ton of useless files are generated during this process.

They're not useless otherwise they wouldn't be generated. Putting them in build/ (which is the best practice) is called an "out of source" build which means you're not going to accidentally commit project files, build scripts, or artifacts.
This is proper native development when writing OSS software.*

And anyways building is not actually needed if you want to use meow_hash - this is header-only library.

No, you're right. If you want to easily include meow tests into a larger project, though, now you are at the mercy of an arbitrarily written build.bat or build.sh and random shell scripts are not easily integrated with larger build systems.
Again, this really comes down to the maintainer not being interested in PRs.

build.bat is only for internal testing/benchmarking.

And now you have to support build.bat and build.sh, and others have to support it if they want to integrate tests into their system.

I'm sure somebody who will be required to read through and understand the instructions similar to what you posted above will be capable of running gcc -whateverargs file.cpp on command-line. And as said above - it is not really required for meow_hash users.

So windows users get a bat script but linux/mac users are forced to run individual commands?
That's terrible. That's unmaintainable. Further, I don't use gcc. What now? I have to research vectorization flags each time I want to use meow?
None of this makes any sense for hosting your code on Github.

You hardcoded non-windows flags in cmake anyway. Its the same thing as you are asking me now. What if I don't want those or my compiler doesn't support them? Do I have to research how to hack/override them with my flags into your cmake script?

You hardcoded non-windows flags in cmake anyway.

Yes, for a specific platform. Not for windows users.

Its the same thing as you are asking me now.

How do you figure? It's entirely different, did you read my "wall of text" or did you assume there was nothing interesting in it?

What if I don't want those or my compiler doesn't support them?

Then you add more checks to the cmake configuration to determine if they do.

Do I have to research how to hack/override them with my flags into your cmake script?

No, unless you use a niche compiler that isn't gcc, clang, or msvc. CMake has the ability to check for a compiler ID and make decisions accordingly.

My point is you hardcoded decision results in cmake, which will work only for gcc/clang based compilers.
Not sure what you mean about vectorization flags above to use meow. You need to use them anyway in your caller code. Because meow public API returns SIMD types. So it completely is irrelevant how bench / example is compiled. Your project that uses meow (not meow build.bat/sh) will need to have them - so you will have it already figured out.
How can you don't see that your answers are add more checks to cmake, or install this or that to run the build. How that is easier than build.bat/sh? All you repeat is "proper development" or something like "not a github way". Why your "proper" way is more proper than what other people are doing? Rhetorical question.
There is really no need for build system for this kind of project. Because there is nothing to build for users of it. If you are contributing to internals of meow_hash then you know how to build single .cpp file executables.

So it completely is irrelevant how bench / example is compiled.

Clang/GCC do not emit certain classes of vectorization instructions by default, nor do they include the intrinsics by default.

How that is easier than build.bat/sh?

It's more proper.

Why your "proper" way is more proper than what other people are doing?

Because it enables other users to use meow and to check its correctness via tests.

Rhetorical question.

No, it's not. Please stop dismissing my arguments because you disagree with them.

There is really no need for build system for this kind of project. Because there is nothing to build for users of it.

Utilities and tests. So yes, there are.

If you are contributing to internals of meow_hash then you know how to build single .cpp file executables.

That's a non-sequitur statement. Of course people know how to build single cpp files, but that has no bearing on contributing to meow. With that argument, there's no need for built.bat in the first place.

What are you talking about? There are no utilities and no tests.
Yes, there is no need for build.bat. I completely agree to you on this one. But there is nothing wrong for Casey having it for his convenience, its his repo. This is the point you are missing, and instead just focusing on something you call "proper" github/opensource way.

There are no utilities and no tests.

meow_example.cpp
meow_bench.cpp
meow_smasher.cpp
meow_collidecheck.cpp (assuming #15 is merged)

And there should be tests.

Please show me where GitHub requires to have buidsystem like you want it and not how author wants it.


Crashlytics: enhance change logs documentation quality

It's not released yet, but it will be at some point, so it's better to fix it now. :)
Thanks

Thanks, @MojtabaHs! Could you please address the merge conflict?


Named functions next to each other inside an object confuses Inch's naming scheme

In file compile-store.js:
module.exports = Reflux.createStore({
  //  ... snip ...
  onCompileSuccess: function(files) {
    this.trigger({loaded: true, files: files})
  }
})

Inch thinks this is:

part of PostProcess, while it is actually declared in a call on the next line,
chained with all its sibling functions that are inside the same object.

Inch gives it this name instead:
PostProcess#module.exports.init.onRequestCompile.file.data.onLoading.loaded.files.onCompileSuccess

Re: [U] PostProcess#module.exports.init.onRequestCompile.file.data.onLoading.loaded.files.onCompileSuccess in mplewis/json-pojo-frontend

Puh, that does not look very good :cry:
I will see if I can figure this one out, since parsing is delegated to JSDoc ...


Add delay to automatic re-assemble

When watching a file, sleep for 100ms before printing success/error message, to provide feedback to the user.

Closed with #40, sorry did not see this before making that PR


Added Exceptions

Just added exceptions to display better error message

I see better code from Rahul over mine, Thank you Rahul for value time & effort in adding your valuable better commit, I see more possibilities in our opensource collaborative work 🙌 ! @Ryrahul


Access to cocorico.local/config.php is forbidden

Q
A

Bug report?
[ ]

Feature request?
[ ]

Support request?
[ x]

When I try to run http://cocorico.local/config.php , I get a "Access forbidden!" message. And running http://cocorico.local/ only gets me to the XAMPP landing page. Where did I go wrong?
This is the modification that I made to the http.conf file:
VirtualHost <IP_ADDRESS>:80>
ServerName cocorico.local
ServerAlias cocorico.local
  #For multiple images uploads
  LimitRequestBody 240000000

  DocumentRoot /var/www/cocorico.local/Symfony/web
  <Directory /var/www/cocorico.local/Symfony/web>
      #For performance and security reasons we should not use htaccess in prod
      AllowOverride Indexes FileInfo AuthConfig
      Order Allow,Deny
      Allow from all
  </Directory>

I also made a change to the hosts file > <IP_ADDRESS>      cocorico.local

Hi @Rex-am-I
Maybe you missed to rename, as described in the installation documentation, the web/.htaccess.dist to web/.htaccess.
But your error related to config.php make think that your IP is maybe not <IP_ADDRESS>. You can check this here web/config.php:18.

I didn't miss the .htaccess renaming step. For good measure, I went and did it again.
And the IP in the web/config.php file is <IP_ADDRESS>
I really need help on this one!

Could you comment in config.php  the lines:

header('HTTP/1.0 403 Forbidden');
exit('This script is only accessible from localhost.');

And dump $_SERVER['REMOTE_ADDR'] .

Feel free to reopen it needed


Fix filtering of encrypted attributes while logging parameters.

Needed to use to_unsafe_h to get the unfiltered hash representation
of the parameters.  Otherwise, ActionDispatch::Http::ParameterFilter.filter
would not be able to traverse the embedded parameters.

Requires PR# https://github.com/ManageIQ/manageiq/pull/12216 to work.

@gtanzillo this was the regression I talked to you about.  Marking as bug euwe/yes, it also depends on @imtayadeway's PR https://github.com/ManageIQ/manageiq/pull/12216 which I also marked as bug euwe/yes.

@abellotti do you know what caused the regression? What's the connection with #12216 ?

@imtayadeway params not seen in posts while running rspecs unless :param signature used as you did in your PR, we did see the parameter objects during normal access. I think regression started when we moved away from req hash to object so a while back.

:+1: LGTM! Good catch! :musical_keyboard:

Euwe Backport details:
$ git log -1
commit efc3ab002e3cbc17dbbff0cb865c4104b9ff0513
Author: Gregg Tanzillo<EMAIL_ADDRESS>Date:   Thu Oct 27 15:26:08 2016 -0400

    Merge pull request #12251 from abellotti/api_param_log_filtering

    Fix filtering of encrypted attributes while logging parameters.
    (cherry picked from commit 07456eac4e8a02c151e190eb3bd55bbe3e2ec86d)


Errors occurring during the execution of the train. py

When I entered the command, the message from the terminal was as follows:
Namespace(L1_weight=0.01, N_voxel_final=262144000, N_voxel_init=262144, TV_weight_app=0.0, TV_weight_density=0.0, add_frames_every=100, alpha_mask_thre=0.0001, batch_size=4096, ckpt=None, config=None, data_dim_color=27, datadir='/data/liuchen/localrf/data/katwijk', density_shift=-5, device='cuda:0', distance_scale=25, downsampling=-1, fea2denseAct='softplus', fea_pe=0, featureC=128, fov=66.0, frame_step=1, logdir='/data/liuchen/localrf/log/katwijk', loss_depth_weight_inital=0.1, loss_flow_weight_inital=1, lr_R_init=0.005, lr_basis=0.001, lr_decay_target_ratio=0.1, lr_exposure_init=0.001, lr_i_init=0, lr_init=0.02, lr_t_init=0.0005, lr_upsample_reset=1, max_drift=1, model_name='TensorVMSplit', nSamples=1000000.0, n_init_frames=5, n_iters_per_frame=600, n_iters_reg=100, n_lamb_sh=[24, 24, 24], n_lamb_sigma=[8, 8, 8], n_max_frames=100, n_overlap=30, pos_pe=0, prog_speedup_factor=1.0, progress_refresh_rate=200, refinement_speedup_factor=1.0, render_from_file='', render_only=0, render_path=1, render_test=1, rm_weight_mask_thre=0.001, shadingMode='MLP_Fea_late_view', skip_TB_images=False, skip_saving_video=False, step_ratio=0.5, subsequence=[0, -1], test_frame_every=10, update_AlphaMask_list=[100, 200, 300], upsamp_list=[100, 150, 200, 250, 300], view_pe=0, vis_every=10000, with_preprocessed_poses=0)
lc_min: tensor([-2., -2., -2.], device='cuda:0')
lc_max: tensor([2., 2., 2.], device='cuda:0')
n_novels: 262144
xyz_max: tensor([2., 2., 2.], device='cuda:0')
xyz_min: tensor([-2., -2., -2.], device='cuda:0')
n_voxels: 262144
Traceback (most recent call last):
File "localTensoRF/train.py", line 661, in
reconstruction(args)
File "localTensoRF/train.py", line 265, in reconstruction
reso_cur = N_to_reso(args.N_voxel_init, aabb)
File "/data/liuchen/localrf/localTensoRF/utils/utils.py", line 205, in N_to_reso
voxel_size = ((xyz_max - xyz_min).prod() / n_voxels).pow(1 / 3)
The above message is followed by a RuntimeError message in the terminal, which is very lengthy, but the following prompt appears in the last part:
extern "C"
launch_bounds(512, 4)
global void reduction_prod_kernel(ReduceJitOp r){
r.run();
}
nvrtc: error: invalid value for --gpu-architecture (-arch)
I print the values of xyz_max and xyz_min to see what the problem is, but I find that they are computable, so I can't find what the problem is. Can you explain what's happening here, please? BTW, my environment configuration is pytorch 1.12.0 + CUDA11.3 and GPU is NVIDIA 4090. Any advice would be appreciated!

This bug is solved by the correct version of CUDA as well as torch. The project needs to run strictly according to the version stated by the author, my previous version was relatively low.


Update Microsoft.Resources tag for SDK Generation

MSFT employees can try out our new experience at OpenAPI Hub  - one location for using our validation tools and finding your workflow.

Changelog
Add a changelog entry for this PR by answering the following questions:

What's the purpose of the update?

[ ] new service onboarding
[ ] new API version
[ ] update existing version for new feature
[ ] update existing version to fix swagger quality issue in s360
[x] Other, please clarify: update readme tag to 2022-03-01-preview for SDK generation

When are you targeting to deploy the new service/feature to public regions? API is already live in public regions. We would like to target SDK generation ASAP
When do you expect to publish the swagger? Already published
If updating an existing version, please select the specific language SDKs and CLIs that must be refreshed after the swagger is published.

[x] SDK of .NET (need service team to ensure code readiness)
[x] SDK of Python
[x] SDK of Java
[x] SDK of Js
[x] SDK of Go
[x] PowerShell
[x] CLI
[x] Terraform
[ ] No refresh required for updates in this PR

Contribution checklist:

[ ] I commit to follow the Breaking Change Policy of "no breaking changes"
[x] I have reviewed the documentation for the workflow.
[x] Validation tools were run on swagger spec(s) and errors have all been fixed in this PR. How to fix?

If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist

Applicability: :warning:
If your changes encompass only the following scenarios, you should SKIP this section, as these scenarios do not require ARM review.

Change to data plane APIs
Adding new properties
All removals

Otherwise your PR may be subject to ARM review requirements. Complete the following:

[ ] Check this box if any of the following apply to the PR so that label "WaitForARMFeedback" will be added automatically to begin ARM API Review. Failure to comply may result in delays to the manifest.

Adding a new service
Adding new API(s)
Adding a new API version
-[ ] To review changes efficiently, ensure you are using OpenAPIHub to initialize the PR for adding a new version. More details, refer to the wiki.

[ ] Ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

[ ] If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist
If any of the following scenarios apply to the PR, request approval from the Breaking Change Review Board as defined in the Breaking Change Policy.

[ ] Removing API(s) in a stable version
[ ] Removing properties in a stable version
[ ] Removing API version(s) in a stable version
[ ] Updating API in a stable or public preview version with Breaking Change Validation errors
[ ] Updating API(s) in public preview over 1 year (refer to Retirement of Previews)

Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.
Please follow the link to find more details on PR review process.

@raych1 Please merge. Thanks!


doesn't work icons

I set the icon and it doesn't work, I restarted HA and cleared the cache, and it still doesn't work.

The Icon path is the directory in which you put the icons.

on PC working thank you so much, on phone i dont see new icon and name, what am I doing wrong?.

The Home Assistant companion app can change its icon from the settings - at least for iOS.
If you use a saved web app thing, I think you need to have the icons working before you save it.


Add cache=600s to streams-api

Will be solved inherited with https://github.com/laravel-streams/streams/issues/60


Add ability to remove non-working etcd member from the cluster

User Story
Related to the cluster repair functionality (#530).
Before being able to join another node to the etcd cluster, the etcd node that is not working must be removed from the cluster.
Acceptance criteria
There is functionality that takes or finds a non-working etcd member and removes it.
Implementation
There are at least two possible approaches:

We can exec into the etcd pod and run the appropriate etcdctl commands to discover a non-working member and then remove it from the cluster.

The problem with this approach is that exec returns terminal output as the output. We would have to parse it, but parsing might be unreliable and hard to accomplish.

Create SSH tunnel and use it to connect to the etcd API.

With this way we can use the API endpoints to communicate with etcd, discover the non-working node, and then remove it. This gives us more flexibility and it's easier to parse the output.

https://github.com/etcd-io/etcd/blob/master/Documentation/v2/members_api.md


[BUG] pydantic computed properties omitted during insert_many operation on Document

Describe the bug
Pydantic V2 have a bug where __iter__ does not include computed property. https://github.com/pydantic/pydantic/issues/8564
This cause the document to omit the computed properties during insert, as Encoder is using __iter__ to get all properties.
To Reproduce
from beanie import Document

class TestModel(Document):
    normal: int

    @pydantic.computed_field
    @property
    def computed(self) -> int:
        return 1

instance = TestModel(normal=42)

assert {field: value for field, value in instance} == instance.model_dump()  # fails

# or
TestModel.insert_many([instance]) # This document in mongo will omit `computed` property.

Expected behavior
Expect all properties to be included during the insert operation.
Additional context
As this issue is still open on pydantic, not sure if we need to wait for a fix from pydantic.

Still an issue though...

Still an issue


Fix BulkLookupContacts

no worries, i should have paid more attention, i thought your change only renamed variables, i missed the bug


Rename config.proto for better discoverability

In the Kuma repository, the import path for config.proto is simply:
import "config.proto";

This is very confusing because there's no obvious relationship between the doc option and a file named config.proto, and the Kuma repository already has 2 different config.proto files.
This would be much more obvious if we could make the import thus:
import "kumadoc/doc.proto";

ping @bartsmykla


Array.filter should be able to refine T|undefined to T

TypeScript Version:  2.6.1
Code
interface EntityType {
  id: number,
  name: string,
}
const ids = [1, 2, 3]
const entities = new Map<number, EntityType>()
let relevantEntities: EntityType[] = []
if (ids) {
  relevantEntities = ids.map(id => entities.get(id)).filter(Boolean)
}

Note that I have tried many variants of the argument to filter (x => !!x, x => x !== undefined, etc). I'm only using Boolean here since it works in Flow
Further note that making the following change allows the error checker to proceed, but only through basically lying about the data:
if (ids) {
  // get(id) becomes get(id)!
  relevantEntities = ids.map(id => entities.get(id)!).filter(Boolean)
}

Expected behavior:
Assignment proceeds without error, since any undefined values produced in the map operation are filtered out.
Actual behavior:
error TS2322: Type '(EntityType | undefined)[]' is not assignable to type 'EntityType[]'.
  Type 'EntityType | undefined' is not assignable to type 'EntityType'.
    Type 'undefined' is not assignable to type 'EntityType'.

This is already possible, you just need to define an explicit user-defined type guard:
function notUndefined<T>(x: T | undefined): x is T {
    return x !== undefined;
}
if (ids) {
    relevantEntities = ids.map(id => entities.get(id)).filter(notUndefined);
}

That only works if you pass the type guard as a function reference and don't, for example, call it with an arrow function. This does not work:
function notUndefined<T>(x: T | undefined): x is T {
    return x !== undefined;
}
if (ids) {
    relevantEntities = ids.map(id => entities.get(id)).filter(id => notUndefined(id));
}

Thanks @RyanCavanaugh - that solution does appear to work as-is.
It is, however, fairly unintuitive (hence my being here in the first place!) and I think it would be immensely helpful if this "just worked" out of the box. I think it's a fairly common pattern, particularly when working with a normalized store of entities (e.g. Redux).
At the very least, having this documented on the Typescript website (rather than digging around in github issues and stackoverflow) would go a long way for the language's usability, even if it's not (currently?) practical to add first-class support into the language.


add esmodule support

Hello, this PR adds es module support (#18) by providing arg --esModule or --es
ex:
nx g @nxazure/func:init my-new-app --esModule
Regards

Hmm.... This does not work with importing library files. Seems like tsconfig-paths does not support esmodules.


add support for SLURM_NPROCS to visit_utils.engine

Description
Resolves #19435
Updates visit_utils.engine to support SLURM_NPROCS env var.
This is important b/c folks want to use the number of tasks requested, which may be different from the number of cores on a node.
Type of change

[x] Bug fix~~
[ ] New feature~~
[ ] Documentation update~~
[ ] Other~~

WHIP### How Has This Been Tested?
Reminders:

Please follow the style guidelines of this project.
Please perform a self-review of your code before submitting a PR and asking others to review it.
Please assign reviewers (see VisIt's PR procedures for more information).

Checklist:

[X] I have commented my code where applicable.~~
[ ] I have updated the release notes.~~
[x] I have made corresponding changes to the documentation.~~
- [ ] I have added debugging support to my changes.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have confirmed new and existing unit tests pass locally with my changes.
- [ ] I have added new baselines for any new tests to the repo.
[x] I have NOT made any changes to protocol or public interfaces in an RC branch.~~

Tested on dane, with allocation using salloc -N 2 -n 40
import visit_utils
>>> import visit_utils
>>> visit_utils.engine.open(method="slurm")
[dane: opening engine]
Running: srun -n 40 /usr/WS1/cyrush/2024.08.build_visit/visit/build/exe/engine_par -dv -host dane56 -port 5600
'dane56.llnl.gov'

vs old:
>>> visit_utils.engine.open(method="slurm")
[dane: opening engine]
Running: srun -n 78 /usr/gapps/visit/3.4.1/linux-x86_64/bin/engine_par -host dane56 -port 5600
srun: error: Unable to create step for job 840058: More processors requested than permitted

New is working as expected.


AttributeError: 'GeneralConditioner' object has no attribute 'tokenize'

have a bug, how can i fix it?

Traceback (most recent call last):
  File "/home/ipfs10/.local/lib/python3.10/site-packages/gradio/routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "/home/ipfs10/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1323, in process_api
    result = await self.call_function(
  File "/home/ipfs10/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1051, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/ipfs10/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/ipfs10/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/home/ipfs10/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/tag_editor_ui/block_load_dataset.py", line 80, in load_files_from_dir
    dte_instance.load_dataset(dir, caption_file_ext, recursive, load_caption_from_filename, replace_new_line, interrogate_method, use_interrogator_names, threshold_booru, threshold_waifu, opts.dataset_editor_use_temp_files, kohya_json_path if use_kohya_metadata else None, opts.dataset_editor_max_res)
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/dataset_tag_editor/dte_logic.py", line 596, in load_dataset
    self.set_tags_by_image_path(img_path, tags)
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/dataset_tag_editor/dte_logic.py", line 92, in set_tags_by_image_path
    self.construct_tag_infos()
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/dataset_tag_editor/dte_logic.py", line 682, in construct_tag_infos
    self.tag_tokens[tag] = clip_tokenizer.tokenize(tag, shared.opts.dataset_editor_use_raw_clip_token)
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/tokenizer/clip_tokenizer.py", line 34, in tokenize
    tokens = shared.sd_model.cond_stage_model.tokenize([text])[0]
  File "/home/ipfs10/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1614, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'GeneralConditioner' object has no attribute 'tokenize'

same

Got this error with sdxl, switched back to 1.5 and it went away.

That did it.
Thanks!

thank you guys help me, I have resolve this error,  have a nice day~


MWPW-139077 - Add New Form Block

This PR adds a new Form block, which utilizes Franklin's forms architecture to produce a form from, and save submissions within, the same Excel document. More info here.
There is a basic "Rules" system in place that allows for classes to be added to a field based on comparisons of text, numbers, or dates. The operator shorthands used here are based off of the Python operator function names. Any recommendations for alternatives are welcome.
The block itself is pretty simple -- just a row with the JSON link for the Excel doc, and a row with either a "thank you" message or a URL to redirect to after submission. You can view the JSON data being used in the URLs below here: https://main--milo--adobecom.hlx.page/drafts/ebartholomew/forms/fresh-form1.json
This is just a jumping off point. Please beat this up/add any suggestions you can think of.

Resolves: MWPW-139077
Test URLs:

Before: https://main--milo--adobecom.hlx.page/drafts/ebartholomew/elan-form3?martech=off
After: https://ebartholomew-form-block--milo--adobecom.hlx.page/drafts/ebartholomew/elan-form3?martech=off

If i try to submit with an empty required field, I do get the error message. But, the submit button stays grayed out even after I add to the required field. I have to refresh the page to get the submit button re-enabled.

I'm seeing the hidden field even though the favorite number hasn't been populated.
Not sure what I did to get that. I might have refreshed the page after the submit button got stuck in the disabled state. See previous comment.

Nit. Maybe add the image(s) to an image folder img. Or serve them out of /libs/

I'm seeing the hidden field even though the favorite number hasn't been populated.
Not sure what I did to get that. I might have refreshed the page after the submit button got stuck in the disabled state. See previous comment.

@rgclayton Yeah, that's actually working as expected (notice the "or empty" in parentheses). I think it's a matter of debate -- do we always want to force the rule comparisons to evaluate to true when the target field is empty? Might be an opportunity for enhancement on how this part works so an author has control over that.
For now though, considering that .hidden is the only class that is handled by the block's CSS, I see your point; makes sense to force true in this case.

Thanks @ryanmparrish

In form.js it looks like you could import and use our createTag util instead of createElement and save some lines adding classes and content in the parameters.

Can't believe I forgot about this. Thanks. Reduced quite a few lines.

In form.css we may want to load those image assets from libs/img/ui similar to other blocks w/ ui icons inserted (carousel, marquee-anchor)

For now I'm going to keep these as base64. They were taken directly from Spectrum, so AFAIK they should already be in the shared library for others to use.

When there is a select w/ 'other' as an option, should another input field appear to add the other?

This should be up to the authors. They have this ability via the "Rules" feature of this block.

The resizable fields may want some max-widths or only Y styles. (You can grab that handle and really throw things around)

Good catch -- I've set it to only allow vertical resizing.

The redirect transition seems a little un-informative. (fields go white and no message of being redirected) - This may be a future UI enhancement thing. IDK, just pointing it out.

I think this would be a good thing to hammer out for the next version of the block. We'd want to establish how it's authored first (currently the final row expects a "thank you" message OR a redirect URL. We'd need to agree on a plan on how to best include both)

@elan-tbx What happens if a milo-based site already has its own form block that pre-dates this form block? Ever since this PR was merged the form block on https://aem-trial.adobe.com/headless no longer works. Is there a confguration that forces custom blocks with the same name to be used? Isn't this a big risk introducing new blocks that may have the same name as custom blocks?

https://github.com/adobe/aem-trials/tree/main/blocks/form


Add support for overridding whether resources are enabled

Add support to override the enabled setting for actions, aliases, rules, sensors.
Order of loading of settings is:

Get value from pack configuration
Override with default value from global.yaml
Override with default value from .yaml
Override with exceptions for specific resource from .yaml.

Looks for override config in /opt/stackstorm/configs/overrides directory (subsequent PR to get this directory created with base examples files in st2-package will be required).
Example files:
/opt/stackstorm/configs/overrides/global.yaml to disable all sensors and aliases
---
sensors:
  defaults:
    enabled: false
aliases:
  defaults:
    enabled: false

/opt/stackstorm/configs/overrides/.yaml to disable all actions exception for .delete_row
---
actions:
  defaults:
    enabled: false
  exceptions:
    delete_row:
      enabled: true

Overrides for packs are only specified in the pack.yaml as did not want to add to global.yaml as then there are two places to potentially configure the same type of override.
Could be extended in future to allow overriding of other metadata, but limiting to enabled parameter to start.
Resolves #3973

Ready for review now, some points:

I was for initial PR aiming to NOT override anything not at top level - so adding on support for overriding action parameters I think should be added as an additional PR - as I think that is an extension. The structure used in the yaml could easily be extended to include paramters, but I think that level of overridding is an enhancement on top of this PR rather than part of this PR.
up for debate whether to a) just allow enabled to be overridden b) allow everything to be overridden that is at the top-level resource, but for most of these I wasn't sure much value - e.g. description, runner_type etc aren't really things I can see any value in overriding - but if want we could either just allow anything to be overridden, or extend set, or allow anything with validation so can detect if they have put in mis-spelt names etc. If we allow more to be overridden will that cause more problems than help, e.g. changing runner_type, entry_points etc really changes the whole action dynamic, and so probably shouldn't be allowed - so I don't think its as simple as just allow everything to be overridden - as if you are changing runner_type for example you should be installing a new version of the pack.

Good stuff!
One concern though as I'm looking at the https://docs.stackstorm.com/reference/pack_configs.html, when the entire pack config is expected to be located in the /opt/stackstorm/configs/<pack>.yaml.
Logically, /opt/stackstorm/configs/<pack>.yaml is already the one config to override the pack settings. Then the new override dir within the config dir feels a bit off compared to the st2 configuration we already had (looking at the RBAC structure as well). The answer on how to configure stuff and where to look at should be a really obvious and a single place to the users. I think multiple configs for a single pack might confuse the people.
With a single config, the advantage seems to me is the design consistency, as we won't need to introduce a new configuration structure /opt/stackstorm/configs/overrides/<pack>.yaml. Additionally, all the deployments like Ansible, Puppet, K8s, or anything custom users created for themselves to manage the pack configs would work. Just plug-and-play by adding a new configuration section.
Talking about the tradeoffs, do you see any advantages with the /overrides/ structure?
What would be the difficulties to rely on the content overrides within the original pack config file?

While it might appear to make sense to have overrides mixed in with the pack config, overrides are both pack config and individual unit config.  They are not well defined which makes them a poor fit in the config/<pack>.yaml because pack config has a well defined schema.  Attempting to maintain override variables inside config/<pack>.yaml puts a burden on the core developer to maintain a list of valid overrides as well as the pack developer to include them in the schema.  This effort yields very little  advantage.  The only override that makes sense in pack config is the global override policy.

The difference between pack configuration and action parameters is that configuration usually contains values which are common to all the resources in the pack, and rarely change.

As stated above, overrides are specific to a unit (action/rule/sensor) and should not be part of pack config.  Overriding unit config can change often as the pack evolves or override needs change with the environment St2 is running in.
This article https://www.redhat.com/sysadmin/etc-configuration-directories sums up the approach of having separate config files which the same principles apply to packs.  Even St2 packs use separate metadata file per unit rather than a single metadata for all units.

Organizing configuration files into directories can make administration easier to manage and to delegate. Files may be organized by package or function and configuration management solutions such as Ansible can even benefit from smaller template files. You may need to standardize on file names and locations, and you may need to update file verification tools, but using a dot d folder to house multiple configuration files can save you a lot of effort.

To summarise: Overrides should not be mixed with pack config data.  They should at least be in a separate directory from config data to avoid name collision: overrides sounds like a very good and clear choice.  I still prefer the mirror the pack structure idea, but if the compromise is to put all unit overrides into a single file, then having them in overrides/<pack>.yaml will be a good solution for easier administration and use by automation tools.

I think its clearer to have overrides separate to config (the directory can be created by the st2-package install - so shouldn't affect any of the deployers - so I don't think there is a problem with needing to change installers). But I think Carlos explanation is really good.
Maybe cleaner to move up to /opt/stackstorm/overrides rather than under configs/overrides - might be even more clearer to users then?

Good points @nzlosh, I'm good as long as we have a good reasoning behind it and consider the corner cases there :+1:
And yeah, I think /opt/stackstorm/overrides/ looks a bit cleaner alternative indeed.
Would appreciate more :eyes: from the @StackStorm/maintainers and @StackStorm/contributors around the feature, syntax, and new functionality in general.

:+1: /opt/stackstorm/overrides
Prior art / maybe something to provide inspiration here
The overrides/<pack>.yaml looks very similar to something else I did.
About enabling/disabling rules/actions/other resources. I needed to enable/disable rules based on which instance of stackstorm one of our packs was installed in. eg no rules in dev, and only datacenter-relevant rules in prod instances.
To accomplish this, I created a pack_resources.yaml file in the root of our pack repos. This file is consumed by a deploy_pack workflow which installs the pack and then runs a manage_resources action that enables the various resources according to pack_resources.yaml.
I made a copy of the relevant actions so I could post them here: https://github.com/cognifloyd/st2-pack-lifecycle
The format is similar the proposed overrides/<pack>.yaml:
<webui_base_url_hostname>:
  <resource_type>:
    - <resource_ref>

I use the webui's hostname to distinguish between different st2 instances: (basically urlparse(st2common.config.cfg.CONF.webui.webui_base_url).hostname).
resource_type is one of rules, policies, sensors, triggers, actions, aliases
resource_ref is either the fully qualified ref (chatops.post_message) or it implicitly uses the pack name of the current pack (post_message). pack_resources.yaml can only enable resources for its own pack, not any other pack.

Here's an example:
st2.example.com:
  rules:
    - autoremediation.disk.foobar

One downside to this approach is that it would not work for packs on the exchange. So, admins still need a way to do configure those packs per installation without modifying the packs.
Also, it only handles enabling resources assuming that they will be disabled by default.
Anywho these are some ideas - maybe pieces could be useful to reuse here.

Some discussions from TSC:

With the proposed implementation, the overrides is NOT a policy. If a user uses the CLI to disable/enable an action then that will have the same affect as now - and will take place until the pack is reloaded or re-installed. Enabling/disabling via the CLI/API still only affects until reload. It wasn't intended to make this a policy - but clear documentation would be required to ensure no-one was mislead
Do we want to have a hierarchical structure to configs, for example instead of /opt/stackstorm/overrides/.yaml we could have /opt/stackstorm//local.yaml
We discussed in https://github.com/StackStorm/st2/issues/3973#issuecomment-962084656 and https://github.com/StackStorm/st2/issues/3973#issuecomment-979488900 the idea of having a full mirrored overrides of the pack, similar to the "local" concept discussed in TSC meetings. So there is some prior discussion already, but would welcome more comments.
Need appropriate logging to show that overrides are taking place (I had moved some logging down from info->debug), but I think it was agreed that we'd need to have something in the reload to indicate overrides were taking place - so probably needs some more clever logging to the INFO level to make it clear. Would need to be visible on pack install, and reload.

Pack configs has the following structure: /opt/stackstorm/configs/packname.yaml and the new overrides would mimick the similar UX with /opt/stackstorm/overrides/packname.yaml.
@punkrokk If we create the dedicated dir for pack in /opt/stackstorm/overrides/packname/ besides of local.yaml what would we need to place there to justify the nested dir structure? Can you provide more details following the TSC discussion today?

Here is the explanation of how splunk does things:
https://docs.splunk.com/Documentation/Splunk/8.2.4/Admin/Wheretofindtheconfigurationfiles

Looks like Splunk uses the following override structure:
$SPLUNK_HOME/etc/system/local/*
$SPLUNK_HOME/etc/system/default/*
$SPLUNK_HOME/etc/apps/A/local/*
$SPLUNK_HOME/etc/apps/A/default/*

That's very different from what we have in st2 considering how pack defaults already shipped by content creators, but an interesting perspective to know.

Proposed output of extra logging, from a reload:
$ st2ctl reload --register-all
Registering content...[flags = --config-file /etc/st2/st2.conf --register-all]
2022-02-07 12:56:43,694 INFO [-] Connecting to database "st2" @ "<IP_ADDRESS>:27017" as user "None".
2022-02-07 12:56:43,704 INFO [-] Successfully connected to database "st2" @ "<IP_ADDRESS>:27017" as user "None".
2022-02-07 12:56:44,254 INFO [-] =========================================================
2022-02-07 12:56:44,254 INFO [-] ############## Registering triggers #####################
2022-02-07 12:56:44,254 INFO [-] =========================================================
2022-02-07 12:56:44,549 INFO [-] Registered 1 triggers.
2022-02-07 12:56:44,549 INFO [-] =========================================================
2022-02-07 12:56:44,549 INFO [-] ############## Registering sensors ######################
2022-02-07 12:56:44,549 INFO [-] =========================================================
2022-02-07 12:56:44,832 INFO [-] Registered 9 sensors.
2022-02-07 12:56:44,832 INFO [-] 7 sensors had their metadata overridden.
2022-02-07 12:56:44,832 INFO [-] =========================================================
2022-02-07 12:56:44,832 INFO [-] ############## Registering runners ######################
2022-02-07 12:56:44,833 INFO [-] =========================================================
2022-02-07 12:56:46,342 INFO [-] Registered 14 runners.
2022-02-07 12:56:46,343 INFO [-] =========================================================
2022-02-07 12:56:46,343 INFO [-] ############## Registering actions ######################
2022-02-07 12:56:46,343 INFO [-] =========================================================
2022-02-07 12:56:51,353 INFO [-] Registered 242 actions.
2022-02-07 12:56:51,353 INFO [-] 5 actions had their metadata overridden.
2022-02-07 12:56:51,354 INFO [-] =========================================================
2022-02-07 12:56:51,354 INFO [-] ############## Registering rules ########################
2022-02-07 12:56:51,354 INFO [-] =========================================================
2022-02-07 12:56:51,706 INFO [-] Registered 10 rules.
2022-02-07 12:56:51,707 INFO [-] 1 rules had their metadata overridden.
2022-02-07 12:56:51,707 INFO [-] =========================================================
2022-02-07 12:56:51,707 INFO [-] ############## Registering aliases ######################
2022-02-07 12:56:51,707 INFO [-] =========================================================
2022-02-07 12:56:53,581 INFO [-] Registered 134 aliases.
2022-02-07 12:56:53,581 INFO [-] 134 aliases had their metadata overridden.
2022-02-07 12:56:53,581 INFO [-] =========================================================
2022-02-07 12:56:53,581 INFO [-] ############## Registering policy types #################
2022-02-07 12:56:53,581 INFO [-] =========================================================
2022-02-07 12:56:53,610 INFO [-] Registered 3 policy types.
2022-02-07 12:56:53,610 INFO [-] =========================================================
2022-02-07 12:56:53,610 INFO [-] ############## Registering policies #####################
2022-02-07 12:56:53,610 INFO [-] =========================================================
2022-02-07 12:56:53,612 INFO [-] Registered 0 policies.
2022-02-07 12:56:53,612 INFO [-] =========================================================
2022-02-07 12:56:53,612 INFO [-] ############## Registering configs ######################
2022-02-07 12:56:53,612 INFO [-] =========================================================
2022-02-07 12:56:53,613 INFO [-] Registered 0 configs.

On st2 pack install, no extra output shown on command line, but output on the register_pack action altered to be:
{
  "runners": 14,
  "rule_types": 2,
  "policy_types": 3,
  "triggers": 0,
  "sensors": 2,
  "sensors(overridden)": 2,
  "actions": 1,
  "rules": 1,
  "aliases": 0,
  "policies": 0,
  "configs": 0
}

whereby it only shows the (overridden) line when any category of resource has had at least 1 resource altered from its on-disk state.
But we could for example, populate the overridden data higher up the chain so that we could put a notice on the st2 pack install command as well.

Although, not fully polished I've added a documentation PR so that we can see how it works.
https://github.com/StackStorm/st2docs/pull/1109

@armab and @cognifloyd I've added code to prevent pack names that match the reserved pack name list - currently only holds "global". Also updated the doc PR in the upgrade notes and pack development to say "global" is reserved, and cannot be used for pack names. See https://github.com/StackStorm/st2docs/pull/1109.
Packnames can contain _ - so if we wanted we could use _global.yml if preferred?
Let us know if that addresses the good spot from @cognifloyd, and any other comments/improvements we might need.

Ooh. I like _global.yaml

Same here, _global.yaml naming reads like a great idea for this special case :+1:

@armab @cognifloyd Renamed, any further thoughts or inputs we want to get on override feature?

I'll merge this and the docs PR once we're satisfied with the docs. 😄 If anyone has additional feedback for this PR, now's the time to add it 😉


Update JS API samples to 4.3

Additional:

fixed a bunch of broken github markdown headers
fixed one broken sample

all good.

Thx!


Close file handle after saving projects

This fixes an issue where auto-discovered projects don't show
up in the projects list the very first time the project function
is run.

Thanks for this one @oskarskog


[Friend's Status][Friends List] System do not display green dot near online friend

Environment: Windows 10, Chrome 116.0.5845.97 (64bit)
Reproducible: always
Build found: 25.08.23
Preconditions
Registered User is logged in.
'My space' page is opened.
User has at least one User's Friend.
User's Friend should be online.
Steps to reproduce

Go to GreenCity
Scroll down to 'My Friends' section.

Actual result
In lower right corner on User's Friend avatar apsent green dot when Friend is online.
Expected result
When a friend is online the system displays a green dot on the right side of a friend’s avatar.
User story and test case links
E.g.: "User story #1002
Test case

Online dot still not appear in 'My friends' section on 'My Space' tab.


Co-prime calculator

Related Issue

Info about Issue or bug

fix #4126
Describe the changes you've made
Added code for calculation of co-prime
Checklist:

[ ] My code follows the style guidelines of this project.
[ ] I have performed a self-review of my own code.
[ ] I have commented my code, particularly in hard-to-understand areas.
[ ] I have made corresponding changes to the documentation.
[ ] My changes generate no new warnings.

Screenshots

Original
Updated

original screenshot
updated screenshot

@sairish2001 please review


Optimize user count retrieval logic in user filter operation to reduce extensive DB calls

Purpose
When listing users with a filter, we observed some queries are executed more times than the final resulted users. This PR will remove those unnecessary db calls by improving the filtering methods.

Properly utilise the single query which uses to list non identity claim filtering by updating caches
Removing finding user domain for users who are not include in the final result. This is done by finding the usernames related to final result and using this usernames, building the user object.

Related PRs

https://github.com/wso2/product-is/issues/20548

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/9972785438

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/9972785438
Status: success


Added Directive "record_interval_size"

This directive is based on "record_max_size"
Unlike the original it does not stop recording, creating a new file on reaching specified size limit.
Essentially, it is a hybrid of "record_interval" and "record_max_size" directives.

Why is this one not merged yet? Need this feature! 😿


Upgrade bindgen in artichoke-backend build.rs to 0.64.0

This upgrade made it over to the nightly builder:

https://github.com/artichoke/docker-artichoke-nightly/pull/147


Failed to build

I am running rustc 1.37.0 (eae3437df 2019-08-13), on Fedora 29, but I am unable to build.
Here's the error:
   Compiling opus-sys v0.1.0 (https://github.com/rust-av/opus-rs#966ce08b)
error: failed to run custom build command for `vpx-sys v0.1.0 (https://github.com/rust-av/vpx-rs#2a509f97)`

Caused by:
  process didn't exit successfully: `/home/are/Tools/avp/target/debug/build/vpx-sys-92c1115ce0fd9917/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(PkgConfig(Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"vpx\" \"vpx >= 1.5.0\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package vpx was not fou
nd in the pkg-config search path.\nPerhaps you should add the directory containing `vpx.pc\'\nto the PKG_CONFIG_PATH environment variable\nPackage \'vpx\', required by \'virtual:world\', not found\nPackage \'vpx\', required by \'virtual:world\', not found\n" } }), State {
 next_error: None })', src/libcore/result.rs:999:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `opus-sys v0.1.0 (https://github.com/rust-av/opus-rs#966ce08b)`

Caused by:
  process didn't exit successfully: `/home/are/Tools/avp/target/debug/build/opus-sys-6d767d1ba017ef27/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(PkgConfig(Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"opus\" \"opus >= 1.3\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package opus was not found in the pkg-config search path.\nPerhaps you should add the directory containing `opus.pc\'\nto the PKG_CONFIG_PATH environment variable\nPackage \'opus\', required by \'virtual:world\', not found\nPackage \'opus\', required by \'virtual:world\', not found\n" } }), State { next_error: None })', src/libcore/result.rs:999:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Sorry, I noticed too late it was a missing opus dependency!

No problem at all :) thank you for trying out tiny player :)


Simplify PyTorchPredictor serde

Description of changes: Simplify the serialization format for PyTorchPredictor. Piggy-backing on the recursive definition of encode and decode here, this PR removes the need for dedicated file encoding the network and the input transform: these can be stored directly together with the rest of the constructor parameters.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup

Alternatively, one could base PyTorchPredictor on RepresentablePredictor and get serde for free, at the cost of having to make the constructor @validated.


Request and Cache Policies

ToDo

[x] Export cache & origin policies
[x] Update with-external-cloudfront example

Fixes #5.

https://github.com/hashicorp/terraform-provider-aws/pull/17336 has been merged.
When will this PR be merged?

Code part is done, it's currently on hold because I want to run some internal tests before merging.
Busy week but I expect to give it the final approvement on Friday.


Prepare scripts to release integration packages and core (part 1)

ATM there is no simple way to publish NPM packages of a certain integration. What we agreed on is that we don't want to rely on lerna anymore as our repo is more like a set of independent monorepos than one big monorepo. We're keeping lerna only for local symlinks
Each integration currently has:

API Client
Composables (depending on API Client)
Theme (depending on Composables)

We should prepare a script (release.js) inside root scripts directory that is responsible for releasing packages related to specific integration.
Propsed API:
node ./scripts/release.js {integration}/{package[optional])

Release all packages for commercetools

node ./scripts/release.js commercetools

Release only commercetools composables

node ./scripts/release.js commercetools/composables

There should be 3 gradations of releases: major (x.0.0) minor (0.x.0), path (0.0.x) all fo them specified as cli argument (required)
For example to release a minor upgrade for all commercetools packages we should write:
node ./scripts/release.js commercetools - minor

Commands: core/comemrcetools/about-you (you can automate it and base on dir structure for everything so it will be {integration}/package-name-without-workspace} (without @vue-stroefront)
Implementation details
Under the hood you should just use some npm client to release the packages (there is a bunch of them on the internet, do your investigation ;>)
You should be cautious about dependencies versioning. When we release a package and bump its version we want to be sure that all its dependants have it upgraded as well.

When I update commercetools-theme I will look at other commercetools-x packages - should I update dependencies reference to them to their newest version?

yup
yup, also (1) doesnt apply to independent integrations (they should be a dependency of anything anyway)
error, always has to be provided. You can also show a list if its not provided so it can be selected
like it was (^ is a default)
Only for pathes, otherwise keep other packages unchanged
what you mean by order rules?

Ad plan: you also have to take care of situation when release fails. In that case everything should come back to its previous state.


py_func does not properly

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
Ubuntu 14.04
TensorFlow installed from (source or binary):
binary
TensorFlow version (use command below):
1.2
Python version:
3.6
Bazel version (if compiling from source):
CUDA/cuDNN version:
Cudnn v5.1
GPU model and memory:
Pascal Titan X
Exact command to reproduce:

import tensorflow as tf
import numpy as np

def fun(x):
    return np.ones([5]), np.ones([5])

aa, b = tf.py_func(fun, [1], tf.uint8)

Describe the problem
The py_func does work properly
Source code / logs
Traceback (most recent call last):
  File "test.py", line 9, in <module>
    a, b = ab
  File "/home/jrmei/lib/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 541, in __iter__
    raise TypeError("'Tensor' object is not iterable.")
TypeError: 'Tensor' object is not iterable.

I met the same problem,
after reshape a tensor,  py_func raise TypeError("'Tensor' object is not iterable.")
how did you solve this problem?

It should be
a, b = tf.py_func(fun, [params], [tf.uint8, tf.uint8])


Potential regression after updating to the latest version

I've noticed different output from LibreTranslate and the latest version of argos-translate for Chinese language.
LibreTranslate uses argostranslate==1.1.4.
I've tested this problem locally and got the same results. It looks like a regression to me. Both versions are using the same model.
Original sentence (in English, translated using GoogleTranslate):
Hi there, this is a Chinese sentence. How are you doing today?

argostranslate==1.3.0
 echo "嗨，这是中文句子。 你今天过得怎么样?" | argos-translate --from-lang zh --to-lang en
Pierre, the Chinese sentence. What you have done today?

LibreTranslate (argostranslate==1.1.4):
This is the Chinese sentence. What is you doing today?

That's strange the only significant change to the translation pipeline since then has been multiple hypotheses but in this case I don't think that would change the way CTranslate2 is called. We may have changed some of the CTranslate2 parameters since then but I'm not sure.
Overall though I don't have any reason to believe that translations have gotten worse.

The behavior changes after a few commits:
https://github.com/rushter/argos-translate/commit/528c63a5861a20938a1d62277a835f2431119d48
https://github.com/rushter/argos-translate/commit/ab57727a7b4a5f34e925f5aeb8739a3a0462cc5f

This is the parameter that changes the behaviour: https://github.com/rushter/argos-translate/blob/03dcbcf53960c9248e699d212e16c2023de90def/argostranslate/translate.py#L395

That makes sense, beam_size would change the output sometimes. I think this should generally improve translations though, just not in this specific case.

Actually maybe the issue is that when num_hypotheses is 1 it reduces beam_size which could make translations worse.

I set a min beam size of 4. Hopefully this improves translations some, speed didn't change noticeably.

https://forum.opennmt.net/t/training-convergence-and-beam-size-impact/3842/4


Develop mock implementation and write evaluation report for django-machina

This issue centers on developing a mock implementation and an evaluation report for the django-machina forum framework for our board games website. The mockup will help the team visualize potential forum layouts, navigation, and interactive elements utilizing the django-machina framework. This will provide the team with a solid understanding of the positives and negatives of implementing a django-machina framework.

To better break down the work necessary to develop the mock implementation, two additional issues have been opened. These issues should be completed before writing the report for django-machina.

Issue #145 to install an example instance of django-machina in the chigame sandbox directory.
Issue #149 to implement a simple mockup of the chigame forum in the django-machina sandbox instance.

Report
This comment will present our analysis of the django-machina forum library.
Background
Django-machina is a full-featured yet very extensible forum framework for Django providing a way to build community-driven websites. Notably, it was built with integration in mind and is designed to be used inside existing Django applications.
Here is a short list of supported features. You can learn more about the project here.

Topic and post editing
Forums tree management
Per-forum permissions
Anonymous posting
Polls and attachments
Moderation and pre-moderation
Forum conversations search

Setup
Installation of django machina within an existing project requires only a simple pip install, several edits to the Django settings file(s), and the addition of one line to the top level urls.py file. Detailed instructions can be found in the project's docs.
Result
This section will demonstrate django-machina in action. Pending completion of the mock implementation in issue #149 .
Extensibility
As has already been mention, django-machina is designed for extensibility and integration with existing projects. The project allows customization through settings, templates and static files, as well as a dynamic class loading system that allows to override or extend its Python classes: class-based views, forms, models, etc. More info is available here.
Responsibility
@joshuamonroe Writing this report, deployment of the django-machina demo to the sandbox ( #145 ), and code review of the mockup.
@Benjoman12  Code review of the demo instance and implementation of the mockup chigame forum in the demo.
@bburgess19 Developing the format of this report in issue ( #100 ).

Report has been completed, see previous comment for breakdown of responsibilities. Closing this issue now.

Report has been completed, see previous comment for breakdown of responsibilities. Closing this issue now.

Issue Score: Excellent
Comments:
Wonderful report!
Excellently formatted, dev contributions written, relevant issues thoroughly linked. Wonderful work!

For future reference, when adding hyperlinks in markdown, it is recommended for readability to not have (particularly short) words be the only place a hyperlink is.
For example doing: "Link here", is not readable, but then doing "link here: https://annas-archive.org/" is obviously a link.
This is to make it easier for people who have any difficulty discerning between hyperlinked text and not. Which could be for color blindness, their eyesight, the contrast on their monitor, the distance someone is from their screen, if they've customized browser settings that change colors.
Thus, in general, err on the side of a verbose full link instead of a single word being a hyperlink.


Update README to include conform example with obj

The documentation doesn't explicitly show that the object that is being validated is also passed to the conform function. We wanted this behavior for password confirmation, and had to go digging through the source to figure out that it worked this way.

Hey @Swaagie any chance this will get merged, or is this project abandoned?


undefined: sha3.SumKeccak256

Description
undefined: sha3.SumKeccak256 in keypair.go
Steps to reproduce
go get github.com/nem-toolchain/nem-toolchain/cmd/nem
go/src/github.com/nem-toolchain/nem-toolchain/pkg/keypair/keypair.go:59:7: undefined: sha3.SumKeccak256
go/src/github.com/nem-toolchain/nem-toolchain/pkg/keypair/keypair.go:69:6: undefined: sha3.SumKeccak256
Go version :
1.9
OS version :
10.13.4

@trungkysis, have you installed nem-toolchain throught go get ?

@r8d8
Yes, i have installed.
Maybe, golang/x/crypto version is deffierent ?
I can not find function sha3.SumKeccak256 in golang/x/crypto.

yeap, we having fork.
Try to run make setup - dep should provide right dependency

@r8d8
It work fine. Thank so much !


Add a license to the project

The plan is for the code to be MIT/BSD licensed, but any distributions will be distributed under a commercial license.
This is due to the GPL/Commercial licensing of PyQt. We have a commercial license of PyQt that will let us distribute w/o having to comply with the GPL license. However, this makes things more complicated for non-distribution users (i.e. those that build the client themselves), as PyQt requires manual building of the commercially-licensed version and they wouldn't be able to use the PyPI package.

Resolved in #99


Investigate replacing rsmt2 with easy-smt

https://github.com/elliottt/easy-smt

Started in https://github.com/avanhatt/wasmtime/pull/45

And finished in #45 🎉


refactor: Migrate from Pipenv to poetry

This moves Pipenv to poetry, and removes Pipfile Pipfile.lock, and other mentions or Pipenv from the repository.
Changes in addition to a direct migration:

Appengine

Removes gcloud appengine related files, as we are now fully on cloud run via building a docker image (With the exception of index.yaml, which is for appengine datastore)
Add a build.sh script for building the docker image similar to other build.sh scripts.
Removed most dependencies in deployment as it's originally only needed for appengine (see the deleted gcp/appengine/deploy.sh)

Python environment

For many of the docker images, pipenv installs to the system python dependencies. This is not really ideal, as even in a docker container, it is good practice to compartmentalise into separate virtualenvs.
For the worker image, I have retained this behaviour, and will leave this migration to a future PR, as it affects a large number of different images based on it, e.g.:

ci
cron
exporter
importer

For other non worker based images, I have switched to using virtualenvs, this includes:

Appengine/Cloud Run
API
Debian (already uses virtualenvs)

TODO/looking for suggestions:
The poetry version is defined in every file that it is installed with ==, is there a way to set the version number for the whole repository in one place?

It looks like we need an intermediary CI that has both poetry and Pipenv installed.


Create dashboard expression for creating table links

A dashboard expression should be created for easy construction of table links. This function should mirror the XSLT version.

Document dashboard expression for creating table links
Add all dashboard functions to the dashboard function picker


Split up math/mix/mat/functor/gradient.hpp into rev and fwd version

We should have two separate headers:
math/rev/mat/functor/gradient.hpp
math/fwd/mat/functor/gradient.hpp

This has already been done in the math lib.


authentication required but no callback set

I'm using an env var to get the path to the SSH private key.
This key is a passphrase-less GitLab deploy key. That key works great when I use it with a classic git clone.
But it doesn't work with RepoBuilder::clone().
Expected result
Repository is cloned.
Actual result
The following error:
authentication required but no callback set; class=Ssh (23)

How to reproduce
pub fn git_credentials_callback(
    _user: &str,
    _user_from_url: Option<&str>,
    _cred: git2::CredentialType,
) -> Result<git2::Cred, git2::Error> {
    match env::var("GPM_SSH_KEY") {
        Ok(k) => {
            debug!("authenticate with private key located in {}", k);

            git2::Cred::ssh_key("git", None, std::path::Path::new(&k), None)
        },
        _ => Err(git2::Error::from_str("unable to get private key from GPM_SSH_KEY")),
    }
}

fn get_or_init_repo(cache : &std::path::Path, remote : &String) -> Result<git2::Repository, git2::Error> {
    let data_url = match Url::parse(remote) {
        Ok(data_url) => data_url,
        Err(e) => panic!("failed to parse url: {}", e),
    };
    let path = cache.deref().join(data_url.host_str().unwrap()).join(&data_url.path()[1..]);

    if path.exists() {
        debug!("use existing repository already in cache {}", path.to_str().unwrap());
        return git2::Repository::open(path);
    }

    let mut callbacks = git2::RemoteCallbacks::new();
    callbacks.credentials(git_credentials_callback);

    let mut opts = git2::FetchOptions::new();
    opts.remote_callbacks(callbacks);
    opts.download_tags(git2::AutotagOption::All);

    let mut builder = git2::build::RepoBuilder::new();
    builder.fetch_options(opts);
    builder.branch("master");

    debug!("start cloning repository {} in {}", remote, path.to_str().unwrap());

    match builder.clone(remote, &path) {
        Ok(r) => {
            debug!("repository cloned");

            Ok(r)
        },
        Err(e) => Err(e)
    }
}

It turns ou _cred contains only git2::CredentialType::USERNAME.
But my git server clearly works with a SSH key when I do a git clone.
Is there a way to make sure the requested credentials are git2::CredentialType::SSH_KEY?

Ok got it working by reading this issue:
The callback is called twice:

first to get the username;
then to get the SSH key.

Here is the right callback implementation:
pub fn git_credentials_callback(
    _user: &str,
    _user_from_url: Option<&str>,
    _cred: git2::CredentialType,
) -> Result<git2::Cred, git2::Error> {
    let user = _user_from_url.unwrap_or("git");

    if _cred.contains(git2::CredentialType::USERNAME) {
        return git2::Cred::username(user);
    }

    // Err(git2::Error::from_str("unable to get private key from GPM_SSH_KEY"))

    match env::var("GPM_SSH_KEY") {
        Ok(k) => {

            debug!("authenticate with user {} and private key located in {}", user, k);
            git2::Cred::ssh_key(user, None, std::path::Path::new(&k), None)
        },
        _ => Err(git2::Error::from_str("unable to get private key from GPM_SSH_KEY")),
    }
}

Maybe it would make sense to extend the documentation for either the callback or the function accepting it.

Certainly! I think the documentation around authenticated clones could definitely use a boost

I'm using callback as:
´´´rust
fn git_credentials_callback(
_url: &str,
username: Option<&str>,
_cred_type: CredentialType,
) -> Result<Cred, Error> {
let public = get_key_path(Some("pub"));
let private = get_key_path(None);
let password = env::var("GIT_PASSWORD")
	.expect("No GIT_PASSWORD environment variable found");

let cred = Cred::ssh_key(
	username.unwrap(),
	Some(public.as_path()),
	private.as_path(),
	Some(&password),
);

let result = cred.unwrap();
println!("{:?}", _cred_type);

return Ok(result);

}
´´´
But it hangs. Prints a bunch of the cred_type, then fails saying could not get response, ´Failed to retrieve list of SSH authentication methods´. Tried to find a solution at google, but always find people saying this auth method should work. An issue of this was quoted here, but did not solve my problem either.
It was working before, not working for some months now. Some said it is about new way to generate ssh keys of github, but already tried old way, same response.

I know that it might be a long shot but is there a way to authenticate with personal access code?


Update screen capture for new docs/Babel 6 release

Cleaner demo of hot reloading and error catching to match gaearon/react-transform-boilerplate#64

Thanks


Populate ip-address object dns_name field with queried reverse DNS pointer record

I would like to know if it's possible to add a DNS query for each IP address found, to resolve it's PTR record and store the result to the dns_name field?

@klaver I have been playing around with the reverse DNS lookups and could use your feedback. I'm at a bit of a crossroad. Without bringing in additional libraries I can gather PTRs in a synchronous fashion. This offers simplicity and does not require existing users to download new libraries when the release is published. However, if PTR lookups fail then it can significantly increase the execution time. I've provided some test results below.
Final PTR results: 9 successes | 11 failures
Total time: 41.916s

Final PTR results: 11 successes | 9 failures
Total time: 30.735s

Final PTR results: 20 successes | 0 failures
Total time: 4.711s

Final PTR results: 0 successes | 20 failures
Total time: 69.648s

Alternatively, I can import an async capable library that allows multiple lookups at the same time. This is faster but also means everyone who updates needs to be certain they install the latest requirements.
Right now I'm leaning towards setting the entire dns name field lookup as an optional setting in settings.py and using only the standard libraries, but I'd love additional feedback. Thanks for your insight!

@synackray I'm aware implementations differ a lot, at my current job every assigned IP address should have a reverse DNS record set, when one or two are missing it woudn't have much impact for us running this script. But I can imagine others might have a different setup where it could couse major delays. Maybe you could implement the synchronous variant for now, and add async somewhere in the future with a new major release?

Thanks so much for the feedback. I've continued to do some testing and will have an update this weekend.

Hi @klaver! I've implemented the PTR lookups into 42-reverse-dns-lookup-ip-addresses. It has passed all of the late branch-level testing, so I will likely be merging it into develop by the end of this weekend. Please feel free to give it a spin and provide feedback.
New settings.py variables needed
POPULATE_DNS_NAME = True  # Perform reverse DNS lookup on all eligible IP addresses and populate DNS name field in NetBox
CUSTOM_DNS_SERVERS = False # Use custom DNS servers defined below
DNS_SERVERS = ["<IP_ADDRESS>", "<IP_ADDRESS>"] # [optional] List of DNS servers to query for PTR records

I've promoted this to the develop branch pending full regression testing. This and a few other recent features will trigger an upcoming major release.

@synackray Thanks! I'll give it a try tonight

@synackray it worked like a charm!

That's what I like to hear! I'll be moving this into master on the upcoming release.


[WIP] Limit /report/explorer from showing nodes with > 1000 children

Purpose or Intent
Prevent massive rendering times on large subtrees by simply not loading them.  A perfectly usable and fast paginated table exists on the same page, and can be used to traverse those large trees, and sorted on.
More details can be found in the individual commits, but essentially we are overwriting the tree rendering methods to bail out early and display a message that the tree is too large to load, and the user should use the table view on the left.
Links

Related PRs

https://github.com/ManageIQ/manageiq/pull/9559
https://github.com/ManageIQ/manageiq/pull/9698

Steps for Testing/QA
Build a large reports subtree (over 1k nodes) and make sure that both ajaxing in the subtree and reloading the page prevent the subtree from being expanded.

@miq-bot add_label performance ui wip

@NickLaMuro what are your current thoughts on this?
Push to remove from the right hand side?
Use ancestry?
Make the nodes lazy to load?
Now that we know more, seems there are options.
(you can throw over the fence to me if you need)

Might still be useful at some point, but https://github.com/ManageIQ/manageiq/pull/11554 reduces the need for this, so closing.


Added Google Analytics for the map only.

Description
Addresses issue #290
Motivation
Testing Guidelines
Release Checklist

[ ] This code has unit tests
[ ] I have a plan to verify that these changes are working as expected after deploy
[ ] I have a plan for how to revert, rollback, or disable these changes if things are not working as expected

Security Checklist
This PR creates, modifies, or deletes:

[ ] API routes: API routes, parameters, or user authorization
[ ] Authentication: Authentication mechanism
[ ] Credentials: Server side credentials, or secrets in configuration / source code
[ ] Cryptography: Encryption, hashing, certificates, signatures, random numbers, etc.
[ ] User data: personal information handling, logs, error messages, etc.

Additional Notes

We should use Firebase for this so this will have to change.
We also have to be quite careful when adding this even just to the map. @s0 or @mdeous knows more.

That being said it would be possible to add a cookie banner that complies with GDPR which would be a huge help.

The above being said we can use Firebase to track the analytics and react to them. We really could use the cookie banner, even if it’s super painful to do just to collect analytics.


[IOTDB-3543] Use raw Java command to start nodes in cluster test

Coverage increased (+0.01%) to 45.909% when pulling 4cc8c3e6974cbddb92d4e4109cead1ea43678210 on bugfix/iotdb-3543 into 703c7f427a473ada5cd741619c27e406769d1f1e on master.


Merge version-1.1.0-dev into master

Creating this PR in advance of QA.  Will discuss all 1.1.0 release or QA issues here.

@samtstern Whoa!!! There were more lines of code changed in this PR than The Big Kahuna. 😄 (Also, all those red Xs on each commit because of cla stuff look so scary 😨)
PS: could you merge #511 before finalizing QA (it removes the lint hack).

@samtstern I also created #512 which fixes the broken documentation for onDataChanged.

@samtstern Oh, wait I just noticed an issue.

@samtstern Nevermind, I just noticed that the buttons in AuthMenthodPickerActivity are no longer positioned at the bottom of the layout leaving a lot of empty space. I don't think there is a way to solve that though since we are using a ScrollView.

@SUPERCILEX yeah that's the one behavior change ... I think it's worth it to un-break landscape (and also help on very small devices) but if you think it's bad I am open to reverting the change.

@puf @SUPERCILEX @mcdonamp @amandle I am going to do a merge/release at 3pm PST since I have found no issues in manual QA.  Respond here if you have some objection.

@samtstern let's merge! :smile: And yeah, we should definitely keep the scroll view to make landscape layout bearable.


Cosmos DB emulator should provide a read-only key

Our Cosmos DB usage assumes a read-only key and read-write key, which we use for different functions as a guard against unauthenticated users modifying the DB. Unfortunately we have no way to run tests validating that functionality that using the emulator as far as I can tell, the emulator portal only shows a single key.
Describe the solution you'd like
The emulator should expose read-write and read-only keys, and show them in the portal.
Thanks for considering!
Note: I filed this at https://github.com/Azure/azure-cosmos-dotnet-v3/issues/2794 and was told to instead file it here, counterintuitive as it seems.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 109ed3f8-faf1-92b9-bf50-4be52e9099d4
Version Independent ID: ebc5326a-46da-6bc1-1f47-01a8e16d11fb
Content: Install and develop locally with Azure Cosmos DB Emulator
Content Source: articles/cosmos-db/local-emulator.md
Service: cosmos-db
GitHub Login: @StefArroyo
Microsoft Alias: esarroyo

@palenshus Thank you for the feedback. We are actively investigating and will get back to you soon.

+1 on this.  Would be good for testing scenarios to be able to have a read-only key.


Wrong variable color in PHPStorm

Hi Sven!
It seems like the default color for a variable in PHP differs from other languages.
The color in the picture seen below is most probably the default color of Jetbrains its own Darcula theme.

I just made a fresh installation of the current PHPStorm 2020.1 along with the Nord plugin today.
It seems that by default the inheritance in PHP for variables is disabled. When enabling manually or just enabling and then disabling again, the color for the variable correctly turns to white and stays like that.
Edit:
This is also true for constants and parameters.

Hi Mario :wave:, thanks again for another contribution :+1:
Looks like this is also related to #120 (#121) again. The theme must be changed to use explicit color definitions instead of relaying on color inheritances for languages that are especially bundled with PhpStorm. I'll quickly install a trial version and check which syntax highlighting plugins require additional support.

I've submitted #153, let me know if there are styles you might think that can be improved. Since I've never used PHP it's possible that if "misinterpreted" some of the syntax elements, e.g. I'm not sure if the Query(...) on lines 38-40 are constructors or class instantiators. Also on line 37 there's $$def which the syntax plugin calls a "Variable variable" and on line 35 a "magic" attribute (some kind of special class field?).

You always inspire me with your quality of work, great documentation and thoughtfulness. I already started to make better git messages myself since reading yours, by including a title and description instead of writing only a short one-liner :).
I'm also not working that often with PHP nowadays but the above picture does look good to me. The colors are adjusted to be similar like in Go for example.

The new Query(...) part is the call of a constructor
Line 37 is a variable variable name. I think it's whether confusing and only saw it very seldom in real projects - and where I saw them were pretty old ones. You can basically change the name of a variable dynamically.
Line 35: Magic methods are methods which are pre-occupied by PHP like __toString()

Thanks for the compliments 😊
I see it that way, the history and changes of a Git repository should tell the project's story and should also be the main persistence layer for it. The probability is very low for GitHub (and that would also be a disaster), but when there are some problems with the database and issues/PRs are lost, some parts of the story of a project are also gone. There have been many projects, including really large and popular ones, whose repositor(y/ies) were suddenly gone (reasons like argues between maintainers, too much stress etc.) and so all documentation through issues/PRs was gone (when GitHub popup warns before deleting a repository they really mean it that way regarding the "permanent data loss" section). Writing the project's change reasons right into commits ensures the story is safe: even if you deleted your local repository, someone else has a clone of it like e.g. in my case a simple service running on my private servers that mirrors repositories.
 Also if you like the idea maybe you like to check out MichaelMure/git-bug, a fantastic project of an “Distributed, offline-first bug tracker embedded in Git, with bridges“ (written in Go 💙)
Anyway, drifted away from the topic again 😃
I'll merge the PR and review some other PRs and issues that might also be included in the next release version before deploying it to the JetBrains plugin registry.
Thanks again for your feedback, also learned something about PHP again (tried their docs, but in my opinion they need a full refactor).

Thank you for the git-bug suggestion, it seems pretty interesting and since it has a terminal UI and I'm a terminal guy and since it's written in Go, it seems even more interesting to me. Will definitely check it out :).

@mariojackson The change is now available in the freshly shipped version 0.12.0 that is also shipped to the JetBrains Plugin Registry. The update is currently processed and should be available within the next 24h from Nord's plugin page.

Nice! Thank you Sven!


Ability to view actual HTTP POST request details

What new or enhanced feature are you proposing?
This is similar to Issue #124 except that I'd like to view POST or request details on the webpage rather than the email.
Instead of limiting it, I'd rather have it show everything included in the request. Ideally, this would create a namevaluecollection to simply display all form fields and their submitted values.
What goal would this enhancement help you achieve?
I'd be able to inspect bad HTTP requests so I can see if people are inputting "invalid" data that is really valid.

Reported by kamran.ayub on 2010-03-27 16:24:18

We are using elmah on most of our web projects and I would find it very useful for the error email to contain the RAW request body.
We do not use traditional form posts as I am posting JSON in the request body to the server.
Most of the generated errors are for POST actions (asp.net MVC) and without the request body it's very difficult to debug. Since we also run a web farm going to the elmah.ad page can be tricky.
Any thoughts?

@MarkPerryBV Have a look at my answer to a similar question on StackOverflow: “Elmah: How to get JSON HTTP request body from error report?”
I'm quoting it here for reference and search-ability:

ELMAH so far only logs the context or information that is peripheral to the request and which can be conveniently captured in a standard way. Forms are arguably a special treatment because ASP.NET already does the job of decoding and memorizing request entities when the MIME type is application/x-www-form-urlencoded. JSON requests on the other hand are prolematic because at the time an exception occurs, the input stream (HttpRequest.InputStream) may have been partially or completely consumed by a JSON decoder. ELMAH would not be able to get a second crack at it for the purpose of logging. You will therefore have to make sure that you buffer the input stream or text before passing it through any JSON decoder and stash it away somewhere like HttpContext.Items. You could then try to recover the buffered data and attach it to an outgoing mail at the time of en error. ELMAH currently does not support attaching arbitrary data to a logged error. There is however the ErrorLogModule that has a Logged event and which supplies the Id of the logged error. This could be used to store the input data elsewhere (perhaps in another table if you are using a back-end database for the error logs) but tie it back to the logged error by maintaining an association via the Id.

I think what I might try is adding an ActionFilter to my MVC controller actions which stores a copy of the RequestBody in HttpContext.Items to be able to attach to the Error Email as advised.

@MarkPerryBV Would be awesome if you can share your findings/solution once your attempt comes to a conclusion.


can not use numpy.max as funtion parameter

_
import numpy as np
from numba import typeof, types, njit, jit

@njit()
def as_rolling_apply(fun, array, w):
    r = np.empty(array.shape)
    r.fill(np.nan)
    for i in range(w - 1, array.shape[0]):
        for j in range(array.shape[1]):
            r[i][j] = fun(array[(i-w+1):i+1, j])
    return r

arrayUse = np.random.random([250,3000])
as_rolling_apply(np.max, arrayUse, 5)

_
when I use np.max as the first parameter, I get the Error
>   File "<ipython-input-13-dc6174d8fde4>", line 1, in <module>
>     as_rolling_apply(np.max, arrayUse, 5)
>
>   File "C:\ProgramData\Anaconda2\envs\py_36\lib\site-packages\numba\core\dispatcher.py", line 401, in _compile_for_args
>     error_rewrite(e, 'typing')
>
>   File "C:\ProgramData\Anaconda2\envs\py_36\lib\site-packages\numba\core\dispatcher.py", line 344, in error_rewrite
>     reraise(type(e), e, None)
>
>   File "C:\ProgramData\Anaconda2\envs\py_36\lib\site-packages\numba\core\utils.py", line 79, in reraise
>     raise value.with_traceback(tb)
>
> TypingError: non-precise type pyobject
> [1] During: typing of argument at ***.py (40)

@kukuwa thank for asking about this on the Numba issue tracker. I have looked into this and looking at the debug output when trying to compile this function I see:
 arg.array := array(float64, 2d, C),
 arg.fun := pyobject,
 arg.w := int64,

So, what I think is happening is that Numba is unable to accept the np.max function pointer.
A potential workaround might be, to wrap the np.max call in a Numba function and then pass that in as an argument:
import numpy as np
from numba import njit

@njit
def mymax(a):
    return np.max(a)

@njit()
def as_rolling_apply(fun, array, w):
    r = np.empty(array.shape)
    r.fill(np.nan)
    for i in range(w - 1, array.shape[0]):
        for j in range(array.shape[1]):
            r[i][j] = fun(array[(i - w + 1) : i + 1, j])
    return r

arrayUse = np.random.random([250,3000])
print(as_rolling_apply(mymax, arrayUse, 5))

I am labelling this as a feature request for now, but I am not even sure that what you are asking for can be implemented. Perhaps @stuartarchibald or @sklam can comment on that?

I think it can be done from a technical view point, it's just not supported yet. The suggested work around is the current best way to do this. Pretty sure that this is also a duplicate issue, if I find the other one I'll xref it and close.


Smarter choice of write_empty_chunks

Right now, we are setting write_empty_chunks=False in to_zarr, to support the parsing of sparse datasets - see https://zarr.readthedocs.io/en/stable/tutorial.html#empty-chunks.
In principle it would be better to set it to True, when the dataset is mostly non-zero, to save some overhead.
This issue is just a reminder, but it requires no immediate action.

Let us look at this snippet
import zarr
import dask.array as da
import glob

array = da.arange(1000)
output = zarr.create(shape=(1000,), chunks=(10,),
                     store=da.core.get_mapper("array.zarr"))

# Processing by regions
for region in [(slice(0, 20),), (slice(100, 120),)]:
    array[region].to_zarr(url=output, region=region, compute=True)

# This processing produced only four chunks
for f in sorted(glob.glob("array.zarr/*")):
    print(f"One chunk found at {f}")
print()

# Re-load the array and store the array
new_array = da.from_zarr("array.zarr")
for write_empty_chunks in [True, False]:
    print(f"{write_empty_chunks=}")
    fname = f"new_array_{int(write_empty_chunks)}.zarr"
    new_array.to_zarr(fname, write_empty_chunks=write_empty_chunks)
    num_chunks = len(glob.glob(f"{fname}/*"))
    print(f"Number of chunks on disk: {num_chunks}")
    print()

with output
One chunk found at array.zarr/0
One chunk found at array.zarr/1
One chunk found at array.zarr/10
One chunk found at array.zarr/11

write_empty_chunks=True
Number of chunks on disk: 100

write_empty_chunks=False
Number of chunks on disk: 4

Note 1 (per-region processing and writing is safe)
Whenever an array is processed/written by iterating over regions (as we do in several tasks), this choice is not so relevant any more - because there is never a general call of full_processed_array.to_zarr(), but rather more specialized calls to processed_region.to_zarr(..., region=region).
Note 2 (applying to_zarr to a full array requires `write_empty_chunks=False)
In this case we do need to explicitly set this flag.

This will be closed by https://github.com/fractal-analytics-platform/fractal-tasks-core/pull/148/commits/8c20751c4ee3811f880636288e7a6893f9b7d9f0 as part of #162.
Note that the only task that required a change was maximum_intensity_projection, which currently is not ROI-based (see #115) and thus required setting write_empty_chunks=False. In other tasks, I simply removed old FIXMEs.


fix: revert changed const in peertest utils

What was wrong?
Reverts a change in #1514 that introduced a flaky test
How was it fixed?
changed const
To-Do

[ ] Clean up commit history and use conventional commits.

thread 'validation::tests::test_validate_light_client_finality_update' panicked at trin-beacon/src/validation.rs:452:14:
called `Result::unwrap_err()` on an `Ok` value: ValidationResult { valid_for_storing: true, additional_content_to_propagate: None }