Using Statick to display required formatting changes

I'm not sure if this is the right place to put this sort of question, since I'm not sure if it's an issue with Staick per se, but here goes:
I am trying to get clang-format to work with Statick on an older version of Ubuntu (16.04) in a Docker container, but with a twist: due to work requirements, we don't want clang-format to change any of the files it's working on. This is solved from it being in Docker container, so all changes are discarded, but then I run into the issue that I can't see what changes were made. Currently, Statick just says something along the lines of "Made 1234 formatting changes", which doesn't give me a lot of information. I think that there's an option for clang-format to output changes to the standard output, but when I tried it outside of the container, it just seemed to drop the whole formatted file there. Plus, I'm not sure if that's captured by Statick...
The version of clang-format that I'm currently running (version 8) can output the changes in an XML file, but that's extremely difficult to parse, and I don't think it's documented anywhere how to parse it. Version 10 adds a "-dry-run" flag, but I'm having trouble getting anything beyond version 8 on the container. Seems to not see the repository.
So, I'm sort-of wondering what can be done. In addition to that, I'm not sure how this will affect the message reporting of Statick. Will it display the diffs correctly? There might be a situation where things are mis-aligned in the json file. Maybe.
I'm open to trying other formatters, but I think Uncrustify also just auto-changes the files too. Are there other formatters out there that would be useful to have included in Statick?
Again, I'm sorry if this is the wrong spot.

This is a good spot to ask a question. I'll look into it, probably this afternoon.

I'll explain how the plugin is designed and try to provide a path forward. If I miss anything you were asking about let me know.
The way that we originally designed the clang-format tool plugin was to get any changes the tool would make in XML format. Statick does not change any files in place. We then take that output and create a single issue per file, where the issue lists how many changes the tool would make in that file if it did in-place changes. We use line number 0 for the issue, indicating that the issue applies to the entire file, not any particular line. If we want to see the specific changes the clang-format tool would make then we run that tool outside of Statick. If we are happy with the changes then we run clang-format -i so that the changes are actually written to the file. After that Statick should not report any issues against that file.
The type of output I see from the print_to_console reporting plugin is
Tool clang-format: 2 unique issues
  /home/user/ws/src/pkg/src/x.cpp:0: clang-format:format: 3 replacements [1]
  /home/user/ws/src/pkg/src/y.cpp:0: clang-format:format: 12 replacements [1]

There are cases where a file is consistently formatted throughout, but given a new clang-format configuration there can be hundreds or thousands of lines of diff. This didn't seem useful to report beyond the fact that a single file had formatting differences. I just looked at the raw XML output and got the same feeling as you -- it would be difficult to parse.
The uncrustify tool is very similar to clang-format. I have not looked for other formatting tools for C++, but if you find one and want a plugin for Statick I would happy to look into writing a plugin.
Are you able to get the current output showing how many replacements would be made to a specific file? If that is not the information you are looking for in the output, what did you have in mind for more meaningful output? Does the approach of using Statick to get a pointer to the files that do not follow desired formatting work for you? This would be the approach where you use the clang-format tool outside of Statick to find the actual diffs.

Thank you for the detailed response!
Yes, that's the style of output I was seeing. I was hoping for an output similar to what you get in ROS / ROS 2 when using their linting code. Which, conveniently, I just found! https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/main.py
For reference, what you see from that tool is something like this:
/path/to/file/example.cpp:277:  Line ends in whitespace.  Consider deleting these extra spaces.  [whitespace/end_of_line] [4]

I am not sure how we could go about asking them permission to copy their work, if that's even what we want to do. Your point about there being hundreds or thousands of changes is a good one, I think. Perhaps if this is desired by other people, we could make it some sort of opt-in thing, maybe via a flag.
In the meantime, I could possibly work on whipping up something in-house...

The amen_lint code uses the Apache2 license. I can copy their code into the Statick plugin as long as I leave in their copyright notice. I would also put in a link to their repository and give credit. If I do that, Statick could have a flag for the clang-format plugin that would output an issue per diff or a single issue per file. That flag would default to a single issue per file so that the default behavior of Statick does not change. If that sounds like a good path forward I would be happy to work on that in the next week or so.

That sounds excellent! I think they also do something similar for Uncrustify, just in case other users want similar functionality for that, too.

@jhdcs, I was able to spend some time on this issue and will open a PR soon. When running Statick, If you use the flag --clang-format-issue-per-line the output will look similar to the following snippet (note that I artificially added these formatting issues to the example code). Is this the type of output that you had in mind?
INFO:root:---Reporting---
INFO:root:Running print_to_console reporting plugin...
Tool clang-format: 4 unique issues
  /home/thomas/src/node_example/src/node_example/src/talker.cpp:3: clang-format:format: Replace
- namespace node_example
- {
with
+ namespace node_example
+ {
 [1]
  /home/thomas/src/node_example/src/node_example/src/talker.cpp:10: clang-format:format: Replace
-   cb = boost::bind(&ExampleTalker::configCallback, this, _1, _2);
-   dr_srv_.setCallback(cb);
with
+   cb = boost::bind(&ExampleTalker::configCallback, this, _1, _2);
+   dr_srv_.setCallback(cb);
 [1]
  /home/thomas/src/node_example/src/node_example/src/talker.cpp:17: clang-format:format: Replace
-   // of the node can be run simultaneously while using different parameters.
-         ros::NodeHandle pnh("~");
with
+   // of the node can be run simultaneously while using different parameters.
+   ros::NodeHandle pnh("~");
 [1]
  /home/thomas/src/node_example/src/node_example/src/talker.cpp:40: clang-format:format: Replace
- void ExampleTalker::stop() {
with
+ void ExampleTalker::stop()
+ {
 [1]
4 total unique issues
INFO:root:print_to_console reporting plugin done.

The new per-line output will have more of a diff-style in the issue message that is reported.
The example output you showed before looks like it comes from ament_cpplint.
https://github.com/ament/ament_lint/blob/master/ament_cpplint/ament_cpplint/cpplint.py#L4314

Yes! I think that will work really well, provided it doesn't cause any problems with JSON outputs!

I looked at the output of the print_json and write_jenkins_warnings_ng reporting plugins and it looks valid to me. I did not test the actual output in Jenkins (I don't have a test instance set up) but I don't see anything that would cause problems.

These changes are now available in the latest release, v0.5.3.
https://pypi.org/project/statick/
Let me know if anything needs fixing.


Missing Package Timers

After following the installation instructions for Windows 11 successfully, I executed the joystick example as instructed:
include("examples\\joystick.jl")
And I got the following error message:
ERROR: LoadError: ArgumentError: Package Timers not found in current path:
- Run 'import Pkg; Pkg.add("Timers")' to install the Timers package.
After installing the Timers package as suggested by the error message everything works as expected.
I would suggest adding Timers as a prerequisite for this package so it is added during the initial installation.
Thank you.

Well, the package Timers is already a dependency of this package. But in the example joystick.jl I try to load Timers before loading this package and that must fail. I updated the installation instructions accordingly.
Thanks for reporting, and feel free to ask if you have any questions about how to use this package.


why listen unix socket?

hi:
I was thinking write something like this before,  when I found you work, I think this is really what I want, and I read a little about the code, I am a little confused about the unix socket, I think without the unix socket listener, all the command flags can also be handled. So why listen on an unix socket to handle command?

The unix socket is used to communicate between a running littleboss and a new instance. When you type:
./mybin -littleboss=status
./mybin -littleboss=reload

Both of these processes find the unix socket and communicate with the running littleboss.
There are alternatives, but this seems like the simplest.


Adding Sample App Preview for The library

What i did :

Adding a sample app preview to showcase the library
Fix bugs in the library
some minor changes in the code.

I think this is good .


And a subsection re snap

As per an IRC discussion, just highlighting that, regardless of the Newsboat version (to date), references to /usr/bin will throw error code 127 as command not found, and references to /home will throw 126 as permission denied. But xdg-open is respected, and so offers an option for invoking the default browser without making further configuration changes.
Oh, and I fixed a typo.

Coverage remained the same at 58.712% when pulling 8cb014d3a40bb24a27289ded52a66d54bafc20b6 on jlj77:patch-1 into 5982b31f66e49999ce12d9f67e8db278a891237f on newsboat:master.

Thanks! Here's how it looks when rendered:

The wording looks excellent to me, but I'd change a couple things formatting-wise:

the plus before the command is not necessary in this case. I think you took the cue from the previous paragraphs where the plus connected paragraphs of the list item, but it's not necessary between paragraphs in the ordinary text;
monospace doesn't look that good in the title. I think I fell into that trap too, once, and we ended up deciding against using monospace in titles :) I'd say "Snap", i.e. the technology name, rather than snap the command name;
I'd move this to a separate item dedicated specifically to Snap and browser errors. Someone glancing through the list of questions should easily find the one that relates to Snap, and I don't think the note serves that very well (even though it's visible in the ToC). It's probably best to be as specific as useful; you said in Snap you get error 127? Let's mention this code exactly, to make it easier for the reader to see that this is the relevant item;
finally, it'd be nice if you can keep the length of the lines limited, similarly to what's done to previous lines.

All that makes sense. Let me know what you think of the new wording. I think I implemented all the formatting changes you highlighted.

Oh, it doesn't actually fix #121, because we should probably patch our snap to default to xdg-open. So I unlinked this PR from that issue.


feat: Allows configuration of the Service

Issue:
https://github.com/rancher/rancher/issues/16061
Problem
When deploying to GKE using the chart provided service, the load balancer fails to deploy. I specifically noticed this when running the setup below.

Private GKE cluster
Using the GKE (Google) Ingress  (Not nginx or trafeik.)
Binding the ingress with a static IP address and DNS record already provisioned by terraform using extra annotations (https://cloud.google.com/kubernetes-engine/docs/concepts/ingress-xlb#static_ip_addresses_for_https_load_balancers)
Using Google Managed TLS Certificates using extra annotations (https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs#setting_up_a_google-managed_certificate)
Terminating SSL at load balancer

Basically it seems that Google Managed certificates / GKE ingress can only run with NodePort services. Currently the chart defaults to ClusterIP and doesn't give you any manner of overriding this.
We also had problems applying IAP (Identity Aware Proxy) and service timeouts (google kills connections after 30 seconds by default and this breaks websockets) to our Rancher service. This is because the current rancher service.yaml file does not allow for customisation of service annotations.
Solution
This PR contains a fix to allow the type attribute on the service to be provided by the user and to utilise that if it is passed. If it is not passed, the current behaviour will apply and a ClusterIP will be used.
It also allows a user to pass a block of service annotations to apply to the service. If no service annotations are passed, then the current behaviour will apply an no annotations will be provided for the service.
Testing

Engineering Testing
Manual Testing

Ran the changes above in a local check out of the chart and deployed successfully using a NodePort service type.

Automated Testing
This PR has added helm tests for the feature added.
Regressions Considerations
No regressions should be introduced here since the current behaviours will persist unless specifically overridden.

This is a very welcome change, but it is missing some way to add extra annotations to the Service (like the ingress.extraAnnotations field).
This would make it possible to use Amazon NLB without having to create a new Service manually, and would allow a good workaround for some issues:

https://github.com/rancher/rancher/issues/17963
https://github.com/rancher/rancher/issues/28961

Thanks @oncipriani - I'll add a few extra bits to the PR to make this possible. 👍

@oncipriani hey there! So I have made the additional changes requested to allow the service to be configured using user provided annotations. 👍 😄

@oncipriani @ibuildthecloud - Bump on this please! 😄 👍

Any ideas when this might get merged please? 😄  @oncipriani @ibuildthecloud

This PR requires at least 1 approving review from someone with write
access to the repository. I have already approved it, but I do not
have write access.
Maybe @jiaqiluo could help?
Em qui., 5 de jan. de 2023 às 04:46, Rob Charlwood
@.***> escreveu:

Any ideas when this might get merged please? 😄 @oncipriani @ibuildthecloud
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: @.***>

This PR is still very relevant!

@robcharlwood We will target this PR for our Q2 release and merge after v2.7.2 is released. Thanks for updating this and adding the test.

@robcharlwood We will target this PR for our Q2 release and merge after v2.7.2 is released. Thanks for updating this and adding the test.

Thank you! and my pleasure! Glad I could help!


User Specified Date Feature

Addresses #2070

If anyone can provide input as to why code coverage is dropping so heavily despite the added tests, that would be great!

It looks like a bunch of the ARIMA tests and ARIMA itself isn't covered. I think it might be because ARIMA isn't installed properly and we're skipping these tests. If you click into the tests where Core dependencies is false you can see that the ARIMA tests only have 24% coverage.


Optional authorization store per browser tab/window

In kaufkauflist, a web app I've been developing with this SDK, I had the problem that if I had one authorized browser tab open and then opened another which the second browser tab would overwrite the authorization store the first one was using when it authorized. I guess this is because those tabs were both on the same domain.
Is there a solution to this other than each tab authorizing if the authorization store changed before making a request to pocketbase? That's what kaufkauflist is doing currently. Could you, e.g. having an authorization store for each of those tabs? I didn't find anything like that in the documentation or SDK functions.

In my opinion this should be the expected behavior by the consumers of your app.
What should be the auth state if the user reopen the browser - relogin again?
Should the previous auth state be preserved or the auth state should be valid only until they leave the page(aka. closing the tab/window)?
If you want a temporary/individual auth session per tab, then you can either define a new AuthStore or provide a different localStorage key for each tab:
// define individual localStorage key some randome
// ---
import PocketBase, { LocalAuthStore } from "pocketbase";

const pb = new PocketBase('http://<IP_ADDRESS>:8090', new LocalAuthStore("some_random_key"));

// OR create a custom store that will keep the token only while the tab is open
// ---
import PocketBase, { BaseAuthStore } from 'pocketbase';

class TempAuthStore extends BaseAuthStore {
    save(token, model) {
        super.save(token, model);
    }

    clear() {
        super.clear();
    }
}

const pb = new PocketBase('http://<IP_ADDRESS>:8090', new TempAuthStore());

You can read more about the AuthStore in https://github.com/pocketbase/js-sdk#authstore


Coverflow effect problem in FireFox

I already searched in the issues (here and in the issues of the swiper plugin) but couldn’t find anything related. If there already exists one, please forgive me and point me to the right spot. If you think this is a problem with the swiper lib, I will open the issue there.
I use the Coverflow effect, with a structure like this:
<Swiper {...params}>
    {this.props.albumSlides.map((item, index) =>{
         return (
             <div key={index} >
                 <button href={item.get('link')}></button>
             </div>
         )
    })}
</Swiper>

Unfortunately the button is not clickable, because the div “swiper-wrapper” intercepts the click events. This happens ONLY in firefox.
These are our Swiper params:
const params = {
    effect: 'coverflow',
    loop: false,
    centeredSlides: true,
    slidesPerView: 4,
    initialSlide: 3,
    keyboardControl: true,
    mousewheelControl: true,
    lazyLoading: false,
    slideActiveClass: 'swiper-slide-active',
    preventClicks: true,
    preventClicksPropagation: true,
    slideToClickedSlide: true,
    grabCursor: true,
    lazyLoadingInPrevNext: true,
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev'
    },
    coverflowEffect: {
        rotate: 0,
        stretch: -25,
        depth: 100,
        modifier: 5,
        slideShadows : false,
    },
    breakpoints: {
        // when window width is <= 320px
        320: {
            slidesPerView: 1,
            spaceBetween: 10
        },
        // when window width is <= 480px
        480: {
            slidesPerView: 2,
            spaceBetween: 20
        },
        // when window width is <= 640px
        640: {
            slidesPerView: 2,
            spaceBetween: 20
        },
        1920:{
            slidesPerView: 4,
            spaceBetween: 20
        }
    }
};

Hello @kidjp85 sorry for the late response, too. Ettore is not more working with us so we did not get notified about your reply, unfortunately. I am now taking care of this task and here is the codepen showing the problem: https://codepen.io/polvora_fosforo/pen/zYYELGw
Note, this problem only happens on firefox (tested on chrome, safari, internet explorer, edge and opera, and it works as it should).
This pen i created uses Swiper version 4.0.6 because i wasn't able get any cdn avaliable at https://kidjp85.github.io/doc/get-started/ to work.
Also, please note that I used the same example from https://codepen.io/anon/pen/JqJKRW and it shows the same problem as on our page whereas we are using a slightly different configuration. Will try to simplify the example in the next few days.

Hello, the problem is still not solved.


Optimize includeErrors=true more via buildName() inlining

Gives about +10% with includeErrors option.
Does not change the produced code if includeErrors is disabled.

Codecov Report

Merging #115 into chalker/better-errors3 will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted Files
Coverage Δ

src/index.js
98.85% <100.00%> (+0.01%)
:arrow_up:

src/scope-functions.js
100.00% <100.00%> (ø)


PHP & MySQL docker-compose.yml

something similar to devilbox could be great (a tiny version)

Thanks for the feature request!  Happy to take a look at a PR if you'd like to submit one.

@ThoolooExpress contributed a PHP7 & MariaDB definition! Check it out.


[SPARK-22772][SQL] Use splitExpressionsWithCurrentInputs to split codes in elt

What changes were proposed in this pull request?
In SPARK-22550 which fixes 64KB JVM bytecode limit problem with elt, buildCodeBlocks is used to split codes. However, we should use splitExpressionsWithCurrentInputs because it considers both normal and wholestage codgen (it is not supported yet, so it simply doesn't split the codes).
How was this patch tested?
Existing tests.

Test build #84847 has started for PR 19964 at commit c40488e.

cc @cloud-fan @kiszk @mgaido91

Test build #84848 has started for PR 19964 at commit c677aed.

Test build #84848 has finished for PR 19964 at commit c677aed.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84848/
Test PASSed.

Test build #84847 has finished for PR 19964 at commit c40488e.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84847/
Test PASSed.

Test build #84857 has started for PR 19964 at commit ac41620.

Test build #84859 has started for PR 19964 at commit f6a4a54.

Test build #84860 has started for PR 19964 at commit 1563a46.

Test build #84863 has started for PR 19964 at commit 69aab61.

LGTM, thanks

LGTM

Test build #84857 has finished for PR 19964 at commit ac41620.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84857/
Test PASSed.

Test build #84859 has finished for PR 19964 at commit f6a4a54.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84859/
Test PASSed.

Test build #84860 has finished for PR 19964 at commit 1563a46.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84860/
Test PASSed.

Test build #84863 has finished for PR 19964 at commit 69aab61.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/84863/
Test PASSed.

Thanks! Merged to master.


etcd 2.0.3 fails to start

ETCD_DATA_DIR=/var/lib/etcd etcd results in:
2015/02/14 02:02:19 starter: detect etcd version empty in /var/lib/etcd
2015/02/14 02:02:19 starter: failed to get /etcdURL from http://
2015/02/14 02:02:19 starter: failed to check start version through peers: failed to get version from urls []
2015/02/14 02:02:19 starter: start etcd version 2
2015/02/14 02:02:19 etcd: listen tcp: lookup localhost on [<IP_ADDRESS>]:53: no such host

I have no idea where it's getting that address from.
core@coreos_developer_qemu-592-0-0-20 ~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet <IP_ADDRESS>/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether 52:54:00:12:34:56 brd ff:ff:ff:ff:ff:ff
    inet <IP_ADDRESS>/24 brd <IP_ADDRESS> scope global dynamic eth0
       valid_lft 86111sec preferred_lft 86111sec
    inet6 fe80::5054:ff:fe12:3456/64 scope link
       valid_lft forever preferred_lft forever

core@coreos_developer_qemu-592-0-0-20 ~ $ ip r
default via <IP_ADDRESS> dev eth0  proto dhcp  src <IP_ADDRESS>  metric 1024
<IP_ADDRESS>/24 dev eth0  proto kernel  scope link  src <IP_ADDRESS>
<IP_ADDRESS> dev eth0  proto dhcp  scope link  src <IP_ADDRESS>  metric 1024

@crawford Are you running this on coreos? Is that img has two etcd binaries at the right place?

I think etcd tries to listen on localhost:4001 but fails. Is your system able to parse/lookup localhost?

@xiang90 yes, this is CoreOS.
/ore@coreos_developer_qemu-593-0-0-20 ~ $ ls /usr/libexec/etcd/internal_versions/
1  2

What does etcd: listen tcp: lookup localhost on [<IP_ADDRESS>]:53: no such host mean?
Is it using <IP_ADDRESS> to resolve the hostname?

@crawford Yes, it seems that DNS resolution fails for localhost.

@crawford Do you have an entry in /etc/hosts for localhost?

Yes. Actually /usr/share/baselayout/hosts.
ping localhost works.

@crawford I think this might be a DNS resolver is in Golang.

@crawford
Could we narrow the range down?
I guess this code will print error in your env:
if _, err := net.Listen("tcp", "localhost:4001"); err != nil {
  log.Println(err)
}

@crawford I meet this problem on my CoreOS 593.0.0 machine too. And the net.Listen on localhost:4001 failed with listen tcp: lookup localhost on <IP_ADDRESS>:53: too many redirects.
I guess this is a coreos problem.

The issue is that etcd is statically compiled on CoreOS. If we dynamically compile etcd, it will use libc and follow our nsswitch settings (which allows us to read from /usr/share/baselayout/hosts as well as /etc/hosts).
We need to update the etcd ebuild to compile dynamically.


Add get_conv_outsize and get_deconv_outsize to doc

get_conv_outsize and get_deconv_outsize is useful to check the output size before actual forward computations.
This PR adds them to the docs.

Please fix flake8 error.

@niboshi Thanks for the comment. I fixed it.

@niboshi Could you merge this?

AppVeyor is failing. Please rebase.
Please write some tests.
A change to .gitignore is not relevant, isn't it?

@niboshi Thanks, I fixed those two points.

Please consider the review.
Additionally, please add seealso link to each other.

@niboshi Thanks! Fixed and added seealso links.

Fixed the last point.

Thanks!
Please fix get_conv_outsize as well.
Also
``cover_all`` (bool): Use cover_all option or not.
should be
cover_all (bool): Use ``cover_all`` option or not.

@niboshi Sorry, fixed them!

LGTM!

jenkins, test this please

LGTM!


Conflation PNG inconsistent behavior and does not match with conflation JSON

The PNG has inconsistent behavior, each time running it you get different results which do not align with conflation.json.

@slawler can we turn off the PNG for 0.6.1 release?

Resolved in #195.


LaxBackedScipyTests failing on Ampere GPUs

In the EasyBuild community (https://github.com/easybuilders/easybuild-easyconfigs/issues/14059) we are hitting a few systematic test failures in LaxBackedScipyTests. The specific tests are
jax/test_util.py:146: AssertionError
=========================== short test summary info ============================
FAILED tests/lax_scipy_test.py::LaxBackedScipyTests::testPolar_shape=float32[12,16]_n_zero_sv=4_degeneracy=4_geometric_spectrum=False_max_sv=0.1_method=qdwh_side=left_nonzero_condition_number=100000_seed=10
FAILED tests/lax_scipy_test.py::LaxBackedScipyTests::testPolar_shape=float32[128,128]_n_zero_sv=0_degeneracy=0_geometric_spectrum=False_max_sv=0.1_method=qdwh_side=left_nonzero_condition_number=100000_seed=1
FAILED tests/lax_scipy_test.py::LaxBackedScipyTests::testPolar_shape=float32[128,128]_n_zero_sv=4_degeneracy=4_geometric_spectrum=True_max_sv=10.0_method=qdwh_side=right_nonzero_condition_number=0.1_seed=10
FAILED tests/lax_scipy_test.py::LaxBackedScipyTests::test_spectral_dac_svd_linear_size_=128_seed=1_dtype=float32
========== 4 failed, 13214 passed, 733 skipped in 11961.81s (3:19:21) ==========

Full log from pytest: https://gist.github.com/26bdc466711765fbf690b5dd472682f7
The common factor between the systems with this issue is using Nvidia Ampere GPUs, either A100 or A10.
We can reproduce this issue with AMD EPYC Zen2 and Intel IceLake CPUs. We also tested compiling with gcc-10.2.0 + CUDA 11.1 and gcc-10.3.0 + CUDA 11.3.
The failed tests do not look completely wrong though. We suspect that the tolerances might just be set too high.

cc/@tlu7

@lexming was this resolved?

It seems these pass now! Just ran this on an A100 VM:
(base) mattjj@phawkins-gpu-a100:~/jax$ CUDA_VISIBLE_DEVICES=0 JAX_ENABLE_X64=true TF_DISABLE_MKL=1 pytest tests/lax_scipy_test.py
================================================ test session starts =================================================
platform linux -- Python 3.9.12, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/mattjj/jax, configfile: pytest.ini
plugins: anyio-3.5.0
collected 346 items

tests/lax_scipy_test.py ...............................................ssssssssss............................. [ 24%]
.............................................................................................................. [ 56%]
.............................................................................................................. [ 88%]
....................s.sss.ss............                                                                       [100%]

==================================== 330 passed, 16 skipped in 403.69s (0:06:43) =====================================

Please reopen if something is still amiss.

Oops, maybe those polar tests were just skipped...

So ad6ce74d67920e0b93ddb89df289eda2e7ff83a8 skipped a couple tests. I locally reverted it and tests pass:

So I'll push a PR un-skipping these tests, and I think we'll be good.

For posterity: the skipped tests in qdwh_test.py also work.


Questions regarding group rooms (how to: rejoin? re-create?)

I have a group dm room that was acting oddly. I'd like to completely dis-associate the group room from mx-puppet-discord so that mx-puppet-discord creates it again from scratch. How do I do this? Thanks!

unbridge @_discordpuppet_thatwholemxid:yourserver.com

In which way was it acting oddly, though?

Thanks, I ran unbridge and it said "Unbridged the room!", but when i run listrooms, the room is still displayed in the list.
The oddity with the room:
The room had an odd name (like "__discordpuppet_some_weird_room_name"), and I wanted to give the room a friendlier name, but my matrix user didn't have any kind of administrative access to it. The room was created prior to me properly running setmatrixtoken, so I was hoping to kill and recreate the room entirely so I could confirm whether that's what caused the lack of permissions and odd room name, or if there's some unrelated issue happening.

Okay, after restarting the bridge, it has now created the new room (using the same alias as before). Things are looking overall better, because there's no longer an extra ghost user in the room. However, the room name is still cryptic (#_discordpuppet_<some number>), and my matrix user was not given any admin privileges on the room, so I'm not sure how to give it a nicer name...

Ah, at this point this seems to be a duplicate of https://github.com/matrix-discord/mx-puppet-discord/issues/26
Closing this.

Actually it's a duplicate of #49
Am 9. März 2020 08:22:47 MEZ schrieb Andrew Johnson<EMAIL_ADDRESS>
Ah, at this point this seems to be a duplicate of
https://github.com/matrix-discord/mx-puppet-discord/issues/26
Closing this.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/matrix-discord/mx-puppet-discord/issues/58#issuecomment-596367560


Proposal: Default Casting of Integers to Long Types

Feature Description
I propose that Sparkdantic should by default cast integers to Spark's LongType instead of IntegerType. This change would help prevent issues with integer overflow and make the library more robust for handling large numbers.
Proposed Solution
Introduce an option called safe_casting that, when enabled, would cast integers to LongType. The default value of this option could be True to ensure safety by default.
Example
Here's an example of how this feature could be used:
from pyspark.sql import SparkSession
from sparkdantic import SparkModel

class MyModel(SparkModel):
    my_field: int

# With safe_casting enabled, this would cast 'my_field' to LongType
model = MyModel.spark_schema(safe_casting=True)

Look forward to hearing your thoughts. I am also willing to create a PR for this feature.

Hi @dan1elt0m ,
Thanks for all the contributions and suggestions. I am not opposed to this approach - although this does sound like a breaking change to me since a number of people might rely on the casting of int to IntegerType. Does the ability to override the type also not work well enough for your use cases? I'd be keen to understand your specific use cases where the overflow is a problem

Hey @mitchelllisle,
Thank you for your feedback and for creating this great library. I understand your concern regarding the potential for this change to be breaking for users who rely on the current casting behaviour.
For my usecase, Sparkdantic generates the schema's of many Databricks catalog tables and also generates the schema's for casting dataframes to the required structure before writing to the Databricks catalog. In the catalog, there tens of tables with easily over 50 columns each, which are often nested. Handling these large nested structures by manually setting the overrides to ensure the correct data type casting is impractical and error-prone.  Automating the cast to LongType by default simplifies the workflow, while ensuring data integrity across all tables.
To address the breaking change concern, the safe_casting option could be introduced in a way that maintains backward compatibility. For example, setting safe_casting=True as the default while allowing users to explicitly set safe_casting=False if they need to retain the current IntegerType casting. Ofcourse, this needs to be documented well.

How would you feel about a default of safe_casting=False?

I can live with that

Awesome. We can revisit when it feels right to move to 1.0.0

https://github.com/mitchelllisle/sparkdantic/pull/367

Released in v0.25.0


LOTR's Spears aren't throwable.

Title. I think I put some info about this on Discord iirc, but this isn't caused by other mods.

Fixed, thank you!!


Workaround for this.exec?

Hi! Thanks for postcss and loader for it. It's really awesome. But…
I want to use SugarSS parser with https://github.com/amireh/happypack but it cannot work with this.exec.
Does it really necessary? Or maybe exist any workarounds?

Hi. Thanks for good issue start text 😆
What you mean about this.exec? How it could be fixed? (I didn't use HappyPack).

Here you use this.exec but happypack can't support it.
UPD: oh, I was wrong. You use exec only for postcss-js parser.
Sorry T____T

So, how I could fix it?


Add Admission Webhook Document

This commit introduces documentation that defines OLM support for
Validating and Mutating Admission Webhooks.

/assign @shawn-hurley

Closing this in favor of https://github.com/operator-framework/olm-docs/pull/17


[stable/influxdb] Fix backups to GCS

Is this a new chart

NOTE: We're experiencing a high volume of PRs to this repo and reviews will be delayed. Please host your own chart repository and submit your repository to the Helm Hub instead of this repo to make them discoverable to the community. Here is how to submit new chart repositories to the Helm Hub.

What this PR does / why we need it:
Fix backups to GCS
Which issue this PR fixes
Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Title of the PR starts with chart name (e.g. [stable/mychartname])

/ok-to-test

Please resolve the conflict. Thanks.


Added virtual function code

Virtual Function is OOPs concept of C++
I have wrote a code to convert dollar to rupees using virtual function

Give this repo a star and follow me for follow back 😊


Use yaml serde on update module

Currently update works by simply reading the yaml and cutting where we find a ':'. I ended up using yaml serde on apply module, so it would be nice to implement this.

Serde doesn't seem to work nicely while reading these files, so i'll close this for now.


Add support for nested workspaces

This adds support for nested workspaces (workspaces in workspaces), by updating the logic to fetch workspaces. Rather than looking at the root package.json, it now runs yarn workspaces list --no-private to get a list of all workspaces.

@SocketSecurity ignore<EMAIL_ADDRESS>This is our own.


Close #18: allow additional arguments for chrome

Resolves https://github.com/meteortesting/meteor-browser-tests/issues/18 .
It's a little more complicated than I would have liked because I figured there should be a way to specify multiple arguments, and the way that spawning processes from node works it's not equivalent to have, for example --no-sandbox --version as a single argument versus having --no-sandbox and --version as separate arguments.
I decided to split on whitespace, and support a way for users to escape spaces in the unlikely case that someone actually needs a space inside of a single argument.  Open to suggestions for other ways to do it (or just to do less).

Just because %20 is typical for URL encoding, but foreign on the commandline - do you know if there's any way of escaping the space you want to use in the command? This would be more command-line like ... Or if the system internally not implodes the values by a space anyways - in which case we wouldn't even need to take this step 😅

The system doesn't implode them.  I verified it by comparing
child_process.spawn("ping", ["-c 2",  "<IP_ADDRESS>"], {stdio: "inherit"})

and
child_process.spawn("ping", ["-c 2 <IP_ADDRESS>"], {stdio: "inherit"})

The first works and the second doesn't.
Typically, if you need to include spaces in a command-line argument, you either (a) wrap the argument in quotes or (b) escape them with a slash.  The shell then takes care of parsing that for you, and the program itself doesn't have to do anything.  That would certainly be the ideal behavior.
To comprehend wrapping in quotes, we'd need to either require another library (e.g. some csv parsing library) or copy/paste some code to do it, both of which I was hesitant about.  But if I get approval for including some csv library that should make for a clean and robust solution.
To comprehend slash-escaping, we'd need to parse it ourselves.  We could do something like /\\ , to unescape just \ .  It's not very robust (it would get wrong if we had for example foo\\ bar, where what's being escaped is the slash itself), though, and doing something more robust would make it less clean.
Another alternative would be to support JSON, e.g. TEST_CHROME_ARGS=["--foo", "--bar"], because then we could rely on JSON.parse.  This seems like a decent solution.

Another way would be to replace every occurrence of %25 by % after replacing every occurrence of %20 by a space. This would be a partial version of decodeURIComponent but it would at least work out ...
But I like the JSON approach you have 😃It might also require some escaping, but it's at least more developer-friendly, or what is your opinion on this? I would like to have it as natural to use as possible ...

Yeah, I think JSON would be fine.  Some people might not like it, but nobody would really be hindered by it.  I'll update the PR.

Actually, I don't know.  Exporting JSON is pretty annoying because strings need to be in quotes and the whole things needs to be in quotes because of the brackets.
export TEST_CHROME_ARGS='["--foo", "--bar"]'

I'm up for whatever, but none of the options seem very good.
Really, wanting to have a space in command-line arguments to chrome for your automated tests is an extreme edge case, so maybe it's not so bad to have that involve jumping through some hoops such as unintuitive escaping like %20.


Pydantic dataclass do not generate accurate signatures for FieldInfo

Initial Checks

[X] I confirm that I'm using Pydantic V2

Description
When using FastAPI with Pydantic and creating a query class from Pydantic dataclass which has Query fields,
the generated OpenAPI documentation does not display description on each query.
I found that if we use Pydantic V2 dataclass, generated signatures have incomplete signatures for fields using FieldInfo.
Minimal reproductions are shown below.
Example Code
from pydantic import Field
from pydantic.dataclasses import dataclass
from dataclasses import dataclass as std_dataclass
from pydantic.v1.dataclasses import dataclass as pydantic_dc_v1
import dataclasses
import inspect

@dataclass
class PydanticV2Dataclass:
    x: int
    y: str = 'y'
    z: float = dataclasses.field(default=1.0)
    a: float = dataclasses.field(default_factory=float)
    b: float = Field(default=1.0)
    c: float = Field(default_factory=float)
    d: str | None = Field(default=None)
    e: str = Field(default="e", description="field_e")

@std_dataclass
class StdDataclass:
    x: int
    y: str = 'y'
    z: float = dataclasses.field(default=1.0)
    a: float = dataclasses.field(default_factory=float)
    b: float = Field(default=1.0)
    c: float = Field(default_factory=float)
    d: str | None = Field(default=None)
    e: str = Field(default="e", description="field_e")

@pydantic_dc_v1
class PydanticV1Dataclass:
    x: int
    y: str = 'y'
    z: float = dataclasses.field(default=1.0)
    a: float = dataclasses.field(default_factory=float)
    b: float = Field(default=1.0)
    c: float = Field(default_factory=float)
    d: str | None = Field(default=None)
    e: str = Field(default="e", description="field_e")

print(inspect.signature(Model1)))
# <Signature (x: int, y: str = 'y', z: float = 1.0, a: float = <factory>, b: float = 1.0, c: float = <factory>, d: str | None = None, e: str = 'e') -> None>
print(inspect.signature(Model2))
# <Signature (x: int, y: str = 'y', z: float = 1.0, a: float = <factory>, b: float = FieldInfo(annotation=NoneType, required=False, default=1.0), c: float = FieldInfo(annotation=NoneType, required=False, default_factory=float), d: str | None = FieldInfo(annotation=NoneType, required=False), e: str = FieldInfo(annotation=NoneType, required=False, default='e', description='field_e')) -> None>
print(inspect.signature(Model3))
# <Signature (x: int, y: str = 'y', z: float = 1.0, a: float = <factory>, b: float = FieldInfo(annotation=NoneType, required=False, default=1.0), c: float = FieldInfo(annotation=NoneType, required=False, default_factory=float), d: str | None = FieldInfo(annotation=NoneType, required=False), e: str = FieldInfo(annotation=NoneType, required=False, default='e', description='field_e')) -> None>

Python, Pydantic & OS Version
pydantic version: 2.1.1
        pydantic-core version: 2.4.0
          pydantic-core build: profile=release pgo=false mimalloc=true
                 install path: /Users/y-otosu/.anyenv/envs/pyenv/versions/3.11.2/envs/E-Wallet-Core-API-3112/lib/python3.11/site-packages/pydantic
               python version: 3.11.2 (main, Mar 30 2023, 20:28:31) [Clang 14.0.0 (clang-14<IP_ADDRESS>)]
                     platform: macOS-13.4.1-arm64-arm-64bit
     optional deps. installed: ['email-validator', 'typing-extensions']

Selected Assignee: @adriangb

I would consider the signature to be correct in v2 — it shouldn't include the FieldInfo in the signature for the pydantic dataclasses for the same reason that it doesn't include the dataclasses.Field in the signature for standard dataclasses — we use the value that will be assigned to the attribute if it is not provided as the value displayed in the signature. For standard dataclasses which aren't aware of pydantic.fields.FieldInfo, it will end up being a pydantic.fields.FieldInfo, which explains why that is in the signature there, but for a pydantic dataclass, it will be the value of the default of the FieldInfo.
So I don't think this is a bug.

It seems to me that what you are saying is true 😀. With the design details you commented on in mind, the following section makes it clear to me that FieldInfo is the equivalent of dataclass.field in Pydantic dataclass. Both PR / Issue are unnecessary and will be closed.
https://github.com/pydantic/pydantic/blob/21f08e919b342f444c0a9afcc272e264a9756ba8/pydantic/dataclasses.py#L95


[FLINK-30790] Add DatabaseExtension with TableManaged for testing

What is the purpose of the change
Added DatabaseExtension, basically is a junit extension that start, clean and stop the containers, so only one container for database is started for all tests that use it..
The tests could provide the tables that want the extension to manage with TableManaged.
Brief change log

Add DatabaseExtension and TableManaged
Refactor all tests that use containers to use this
Clean and refactor tests that are extended or duplicate by database tests
Fixed JdbcExactlyOnceSinkE2eTest that creates a lot of instability on tests (mainly with oracle test)

Verifying this change
All tests are maintained (some added) and must be passing
Does this pull request potentially affect one of the following parts:
This don't affect nothing at is pure tests change
Documentation
JavaDocs where apply

@MartijnVisser, @snuyanzin could you help here?

@eskabetxe I see that the CI fails with WARNING: ConnectionID:1 ClientConnectionId: 012104c1-3f1a-4a4b-88af-5f623f5288e9 Prelogin error: host localhost port 32801 Unexpected end of prelogin response after 0 bytes read. https://github.com/apache/flink-connector-jdbc/actions/runs/4806312954/jobs/8553681571?pr=22#step:13:369 - Can that be fixed?

@MartijnVisser all tests pass now

@MartijnVisser any news for merging this?


Validation will always be true

It seem that the validate will always be true since setValue will be set to null, if it is invalid.

Submitted a PR. Hope this gets through. Thanks!

Thanks, @jinjie!


v18.0.0 based off v19.0.0 build process

Checklist

[x] Used a personal fork of the feedstock to propose changes
[ ] Bumped the build number (if the version is unchanged)
[x] Reset the build number to 0 (if the version changed)
[x] Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
[x] Ensured the license file is being packaged.

@carterbox Something puzzling . The build on windows fails:
  "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\bld\coincurve_1706134038942\_h_env\include -ID:\bld\coincurve_1706134038942\_h_env\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -ID:\bld\coincurve_1706134038942\_h_env\Library\include -ID:\bld\coincurve_1706134038942\_h_env\Library\include /d1trimfile:D:\bld\coincurve_1706134038942\work /Tccoincurve\_libsecp256k1.c /Fobuild\temp.win-amd64-cpython-311\Release\coincurve\_libsecp256k1.obj -ID:/bld/coincurve_1706134038942/_h_env/Library/include
  _libsecp256k1.c
  D:\bld\coincurve_1706134038942\_h_env\Library\include\secp256k1.h(234): error C2159: more than one storage class specified
  D:\bld\coincurve_1706134038942\_h_env\Library\include\secp256k1.h(237): error C2159: more than one storage class specified
  D:\bld\coincurve_1706134038942\_h_env\Library\include\secp256k1.h(630): error C2159: more than one storage class specified
  D:\bld\coincurve_1706134038942\_h_env\Library\include\secp256k1.h(633): error C2159: more than one storage class specified
  D:\bld\coincurve_1706134038942\_h_env\Library\include\secp256k1_ecdh.h(30): error C2159: more than one storage class specified
  D:\bld\coincurve_1706134038942\_h_env\Library\include\secp256k1_ecdh.h(34): error C2159: more than one storage class specified
  D:\bld\coincurve_1706134038942\_h_env\Library\include\secp256k1_schnorrsig.h(64): error C2159: more than one storage class specified
  error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe' failed with exit code 2

This seems to be due to the use of extern const xxx in libsecp256k1 that is not supported by VS, but I used the same version to compile libsecp256k1 v0.2.0 in the first place and it did not complain
I can go back and patch the libsecp256k1 v0.2.0 feedstock, but is that the correct solution?


ARROW-8974: [C++] Simplify TransferBitmap

This patch removes "restore_trailing_bits" template parameter of
TransferBitmap class. Trailing bits are now always not clobbered,
which is no harm. It also refines trailing bits processing to keep
the performance influence trivial. Besides, this patch replaces
"invert_bits" boolean parameter with enum to allow explicit naming.

RTools CI failure looks not related
https://github.com/apache/arrow/pull/7373/checks?check_run_id=752286352#step:7:1077
error: failed retrieving file 'mingw-w64-i686-thrift-0.13.0-8000-any.pkg.tar.xz' from dl.bintray.com : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds

s390 ci failure is not related, it says "no space left on device".
appveyor ci failed with many zlib and lz4 runtime errors.

the Appveyor failures are ARROW-9085

Rebased to (hopefully) fix AppVeyor.

Thank you @cyb70289 !


Random sampling broken for Multinomial

from bayespy import nodes
nodes.Multinomial(3, [0.1, 0.9]).random()

---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-28-17ed94d4f545> in <module>()
      1 from bayespy import nodes
----> 2 nodes.Multinomial(3, [0.1, 0.9]).random()

/.../lib/python3.5/site-packages/bayespy/inference/vmp/nodes/expfamily.py in random(self)
    514         Draw a random sample from the distribution.
    515         """
--> 516         return self._distribution.random(*(self.phi), plates=self.plates)

TypeError: random() got an unexpected keyword argument 'plates'

Fixed by https://github.com/bayespy/bayespy/commit/1cb17f474a6ec650c49d116ea8b1b570de6808e0

I'm running into this issue also. I've installing the development version.
The following is code from your example here
`import numpy as np
import pandas as pd
from bayespy.nodes import GaussianARD, Gamma, Categorical, Dirichlet
from bayespy import nodes
import bayespy.plot as bpplt
n_colors = 5
n_bags = 3
n_trials = 20
p_colors = nodes.Dirichlet(n_colors * [0.5], plates=(n_bags,) ).random()
bpplt.hinton(p_colors)
bpplt.pyplot.title("Orignal probability distributions of colors in the bags")
bpplt.pyplot.show()
marbles = nodes.Multinomial(n_trials, p_colors).random()
print(marbles)
`
I get this error:
Traceback (most recent call last):   File "nodacity.py", line 17, in <module>     marbles = nodes.Multinomial(n_trials, p_colors).random()   File "/usr/local/lib/python3.5/site-packages/bayespy/inference/vmp/nodes/expfamily.py", line 516, in random     return self._distribution.random(*(self.phi), plates=self.plates) TypeError: random() got an unexpected keyword argument 'plates'

Are you sure you have the latest develop branch (not master) installed? I think that issue was fixed some time ago. And I'm not able to reproduce it now. What pip freeze | grep bayespy shows?

I think this should force the latest develop branch version:
pip uninstall bayespy
pip install git+https://github.com/bayespy/bayespy.git@develop

So pip freeze | grep bayespy gives me bayespy==0.4.1.dev20160419. I ran the command: pip install https://github.com/bayespy/bayespy/archive/master.zip from here initially. I did the uninstall/install from git you just suggested and my code runs now 👍 :) though I am a little perplexed because pip freeze | grep bayespy still gives me bayespy==0.4.1.dev20160419 which is confusing O.o
Further proof of this:

Daniels-MacBook-Pro:bayespy dshank$ python3 nodacity.py
Traceback (most recent call last):
  File "nodacity.py", line 17, in <module>
    marbles = nodes.Multinomial(n_trials, p_colors).random()
  File "/usr/local/lib/python3.5/site-packages/bayespy/inference/vmp/nodes/expfamily.py", line 516, in random
    return self._distribution.random(*(self.phi), plates=self.plates)
TypeError: random() got an unexpected keyword argument 'plates'
Daniels-MacBook-Pro:bayespy dshank$ vim nodacity.py
Daniels-MacBook-Pro:bayespy dshank$ vim nodacity.py
Daniels-MacBook-Pro:bayespy dshank$ pip3 freeze | grep bayespy
bayespy==0.4.1.dev20160419

The code runs now, so I'm pretty happy. That does seem to be a little strange though.

Thank you for the swift response!

Oohps, there's old instructions in the installation link you gave. Thanks for pointing it out!
And yep, actually that pip+grep command wasn't very useful because the version number is just appended by the date of the installation.. So that definitely is a bit confusing. I wanted to have git commit ID there but I had some problems with that when I tried it long time ago. But yes, confusing, but works as it actually should..

Hey, I seem to be having a related issue going through the same example, this time with Dirichlet and involving 'plats'[sic].
code:

import numpy as np
import pandas as pd
from bayespy.nodes import GaussianARD, Gamma, Categorical, Dirichlet
from bayespy import nodes
from bayespy.inference import VB
import bayespy.plot as bpplt

n_colors = 5
n_bags = 3
n_trials = 20

p_colors = nodes.Dirichlet(n_colors * [0.5], plates=(n_bags,) ).random()

bpplt.hinton(p_colors)
bpplt.pyplot.title("Orignal probability distributions of colors in the bags")
bpplt.pyplot.show()

marbles = nodes.Multinomial(n_trials, p_colors).random()
print(marbles)

theta = nodes.Dirichlet(n_colors * [0.5], plats=(n_bags,))

y = nodes.Multinomial(n_trials, theta)
y.observe(marbles)

Q = VB(y, theta)
Q.update(repeat=1000)

bpplt.hinton(theta)
bpplt.pyplot.title("Learned distribution of colors")
bpplt.pyplot.show()

  File "nodacity.py", line 22, in <module>
    theta = nodes.Dirichlet(n_colors * [0.5], plats=(n_bags,))
  File "/usr/local/lib/python3.5/site-packages/bayespy/inference/vmp/nodes/expfamily.py", line 87, in constructor_decorator
    __init__(self, *args, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/bayespy/inference/vmp/nodes/expfamily.py", line 129, in __init__
    **kwargs)
  File "/usr/local/lib/python3.5/site-packages/bayespy/inference/vmp/nodes/stochastic.py", line 110, in __init__
    **kwargs)
  File "/usr/local/lib/python3.5/site-packages/bayespy/inference/vmp/nodes/node.py", line 219, in wrapper
    return func(self, *parents, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'plats'

Is that a typo?

Just realized it was my typo. My bad!
Looking forward to trying out bayespy.

The example is a Jupyter notebook so you can just use the notebook and run it without copy+pasting anything, if you want. It should be possible to run them in mybinder.org too.


Issue: i want to use langchain callbacks to pass a tool parameter to it?  what should i do?

Issue you'd like to raise.
i'm using openai function call agent , gpt llm offen gives bad tool parameters, i want  to achieve this:  pass certain params to all tools through through some path,  before every tool  get executed, i can check whether the llm produced params is right or directly use the certain params already get
Suggestion:
No response

🤖
Hello @planetb113! 👋
I'm Dosu, a friendly bot here to lend a hand while we wait for a human maintainer. I'm here to help you solve bugs, answer your questions, and make your experience as a contributor as smooth as possible. Let's dive into your issue together!
To use LangChain callbacks to pass certain parameters to all tools and check if the parameters produced by the language model are correct before each tool execution, you can create a custom callback handler that inherits from BaseCallbackHandler and override the on_tool_start method. This method is called before each tool execution and you can use it to check the parameters.
Here is an example of how you can do it:
from langchain_core.callbacks.base import BaseCallbackHandler

class CustomCallbackHandler(BaseCallbackHandler):
    def on_tool_start(self, serialized, input_str, run_id=None, parent_run_id=None, **kwargs):
        # Check the parameters here
        if not self.check_parameters(serialized):
            raise ValueError("Invalid parameters")

        # Call the original method
        super().on_tool_start(serialized, input_str, run_id, parent_run_id, **kwargs)

    def check_parameters(self, serialized):
        # Implement your parameter checking logic here
        pass

Then, you can use your custom callback handler with the CallbackManager:
callback_manager = CallbackManager.configure(
    local_callbacks=CustomCallbackHandler(),
)

In the check_parameters method, you can implement your logic to check the parameters. If the parameters are not correct, you can raise an exception to stop the execution of the tool.
In LangChain, parameters are passed to the tools through the run or arun (for asynchronous execution) methods of the BaseTool class. These methods accept a tool_input parameter, which can be a string or a dictionary, and other optional parameters like verbose, start_color, color, callbacks, tags, metadata, run_name, and other keyword arguments.
The tool_input is parsed by the _parse_input method, which converts the tool input to a Pydantic model if an args_schema is defined for the tool. If the tool_input is a string and an args_schema is defined, the string is validated against the first field of the args_schema. If the tool_input is a dictionary, it is parsed as an object of the args_schema and only the keys present in the tool_input are returned.
The parsed input is then passed to the _run or _arun methods (for asynchronous execution) as arguments. These methods call the function or coroutine defined for the tool with the parsed arguments.
You can find more details in the LangChain core tools and LangChain core callbacks manager source code.
I hope this helps! If you have any other questions, feel free to ask.
Best, Dosu
Sources

libs/core/langchain_core/callbacks/manager.py
libs/langchain/langchain/callbacks/streaming_stdout.py
libs/core/langchain_core/tools.py

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot if i pass a custom argument in the init of my CallbackHandler, how can i make sure i overload an argument of the tool when using the on_tool_start function

🤖
Hello @planetb113! 👋
I'm Dosu, a friendly bot here to lend a hand while we wait for a human maintainer. I'm here to help you solve bugs, answer your questions, and make your experience as a contributor as smooth as possible. Let's dive into your issue together!
To use LangChain callbacks to pass certain parameters to all tools and check if the parameters produced by the language model are correct before each tool execution, you can create a custom callback handler that inherits from BaseCallbackHandler and override the on_tool_start method. This method is called before each tool execution and you can use it to check the parameters.
Here is an example of how you can do it:
from langchain_core.callbacks.base import BaseCallbackHandler

class CustomCallbackHandler(BaseCallbackHandler):
    def on_tool_start(self, serialized, input_str, run_id=None, parent_run_id=None, **kwargs):
        # Check the parameters here
        if not self.check_parameters(serialized):
            raise ValueError("Invalid parameters")

        # Call the original method
        super().on_tool_start(serialized, input_str, run_id, parent_run_id, **kwargs)

    def check_parameters(self, serialized):
        # Implement your parameter checking logic here
        pass

Then, you can use your custom callback handler with the CallbackManager:
callback_manager = CallbackManager.configure(
    local_callbacks=CustomCallbackHandler(),
)

In the check_parameters method, you can implement your logic to check the parameters. If the parameters are not correct, you can raise an exception to stop the execution of the tool.
In LangChain, parameters are passed to the tools through the run or arun (for asynchronous execution) methods of the BaseTool class. These methods accept a tool_input parameter, which can be a string or a dictionary, and other optional parameters like verbose, start_color, color, callbacks, tags, metadata, run_name, and other keyword arguments.
The tool_input is parsed by the _parse_input method, which converts the tool input to a Pydantic model if an args_schema is defined for the tool. If the tool_input is a string and an args_schema is defined, the string is validated against the first field of the args_schema. If the tool_input is a dictionary, it is parsed as an object of the args_schema and only the keys present in the tool_input are returned.
The parsed input is then passed to the _run or _arun methods (for asynchronous execution) as arguments. These methods call the function or coroutine defined for the tool with the parsed arguments.
You can find more details in the LangChain core tools and LangChain core callbacks manager source code.
I hope this helps! If you have any other questions, feel free to ask.
Best, Dosu
Sources

libs/core/langchain_core/callbacks/manager.py
libs/langchain/langchain/callbacks/streaming_stdout.py
libs/core/langchain_core/tools.py

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.

@dosu-bot
if i pass a custom argument in the init of my CallbackHandler, how can i make sure i overload an argument of the tool when using the on_tool_start function

@dosu-bot
if i pass a custom argument in the init of my CallbackHandler, how can i make sure i overload an argument of the tool when using the on_tool_start function


TXT file not opening

Issue Type: Bug
Double click the .xtx file in file explorer (or open via the File -> Open menu in VS code). VS code opens but the file is not opened. Cannot get the file to open at all.
VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:40:02.816Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz (16 x 2304)

GPU Status
2d_canvas: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onoop_rasterization: enabledopengl: enabled_onrasterization: enabledskia_renderer: enabled_onvideo_decode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
15.87GB (8.43GB free)

Process Argv
C:\Users\jacob\curseforge\minecraft\Instances\Fernton\crash-reports\crash-2022-06-28_18.35.40-client.txt --crash-reporter-id 7a4776f3-5a32-4c53-900a-8039df94a63c

Screen Reader
no

VM
0%

Extensions: none
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vscscmwlcmt:30465135
cppdebug:30492333
pylanb8912cf:30515787
vsclangdf:30486550

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.68.1. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!

Please update your VS Code and then provide a gif

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!


Remove quotes around filesystem locations

Removing these quotes allowed my flyway migrations which contained two different folders to run on a linux runner.
Before this change flyway produced an error saying the migration locations weren't found and the migrations didn't run successfully.
Summary of PR changes
PR Requirements

[ ] For major, minor, or breaking changes, at least one of the commit messages contains the appropriate +semver: keywords.

See the Incrementing the Version section of the repository's README.md for more details.

[ ] The action code does not contain sensitive information.

NOTE: If the repo's workflow could not automatically update the README.md, it should be updated manually with the next version.  For javascript actions, if the repo's workflow could not automatically recompile the action it should also be updated manually as part of the PR.

@stevetaggart do you have links to the failed/successful runs before and after this change? And did we double check the action still works on windows runners as well as linux?

Closing after checking with @stevetaggart.  Please feel free to open this back up if you come across the issue again in the future.


strokeDashoffset not synchronize with animation duration

Why is the strokeDashoffset delta is not synchronized with the animation duration. I tried to animate the strokDashoffset but it already finished in the middle of animation and then back to -100%.
http://codepen.io/ariona/pen/xgxMpN

Hi, Rian!
Thanks for the issue, sorry for the inconvenience!
You do it from -100% to 100% so it seems legit for me - it animates from invisible(-100%) to invisible(100%). If you want to keep it visible at the end, you can do animation from invisible(100%) to visible(0%) demo. Notice that in my demo it starts from positive 100% due to Safari's strokedash bug with negative numbers.
Hope it helps! Pretty code btw ;) Please let me know.

Rian,
Just thought maybe you would like to see the stagger wrapper function, it is nice for such effects - demo. There is the second demo with the same effect: demo. Hope they convey the idea of stagger wrapper good enough.
Cheers!

Oh i see, i didn't think about that earlier. Thanks.
That's really cool effect.

@legomushroom any idea to change the stroke position (like, inside, outside & center)?

Rian, SVG doesn't support that. Could be possible when we will implement renderer: SVG/canvas/webgl option.

SVG2 would if it ever gets off the ground... I'll try to find where you can vote on it and post back.

Sarah, you are right. We can't expect it will get any stable among browsers earlier than few years thought. Thinking maybe we can polyfill this.

Yeah, Amelia did mention that they'd be making some polyfills, I had previous asked for one for the mesh gradient (you would do amazing things with that @legomushroom), I'll ask if there was progress made there.


Plugin architecture round 2 WIP

WIP - You can now register any functionality you want. When you register a plugin it stores it in the import library in a namespaced fashion. This allows for things like using manipulators from a one plugin in another, etc.
Edit: Docs now in the gitbook.
Plugin structure.
The structure of a plugin has been simplified, A plugin should look like:
const helloWorldPlugin = {
  name: 'helloWorldPlugin', //Mandatory
  module: helloWorldModule, // Optional
  items: [
    {
      type: 'mixins',
      name: 'evenMoreHelloWorld',
      payload: evenMoreHelloWorld
    },
    {
      type: 'tools',
      name: 'HelloWorldMouseTool',
      payload: HelloWorldMouseTool
    }
  ]
};

Each plugin may have module associated with it, which is plugged directly into the store. After discussions with @dannyrb , we decided to limit a plugin to a single module for now, as any plugin with two different modules should likely be split into multiple plugins.
Each item in the array must have the following structure:
{
  type
  name
  payload
}

Item Types
The types typically employed by plugins are:

base
tools
mixins
manipulators

The core library  has these additional types (a plugin could expand these, but is unlikely to):

drawing
stateManagement
setToolMode

A plugin can define its own arbitrary types, should it need to.
Usage
Registration
The plugin may be registered by calling: cTools.registerPlugin(helloWorldPlugin);.
Upon registration, the plugin's items will be stored in a name-spaced library.
Importing
You may import an item like so:
const evenMorHelloWorld = cornerstoneTools.import('helloWorldPlugin/mixins/evenMoreHelloWorld');
You can also import the whole library as an object, or a object containing all the elements of a certain type:
// The whole plugin as an Object.
const helloWorldPlugin = cornerstoneTools.import('helloWorldPlugin');
// All mixins from the helloWorldPlugin as an Object:
const helloWorldMixins = cornerstoneTools.import('helloWorldPlugins/mixins');

Tools
Third party tools may be easily instantiated as follows:
const HelloWorldMouseTool = cornerstoneTools.import('helloWorldPlugin/tools/HelloWorldMouseTool`);
cTools.addTool(HelloWorldMouseTool);

Mixins
In a tool's constructor, a mixins string array may be passed to super, e.g.:
mixins = [
  `core/mixins/enabledOrDisabledBinaryTool` // A core mixin
  `helloWorldPlugin/mixins/evenMoreHelloWorldMixin` // A  mixin from a plugin
]

The mixin loader in BaseTool is clever enough that the type mixin is optional, and you may instead use:
mixins = [
  `core/enabledOrDisabledBinaryTool`
  `helloWorldPlugin/evenMoreHelloWorldMixin`
]

Additionally, if the namespace is removed entirely, BaseTool will assume its a core library:
mixins = [
  `enabledOrDisabledBinaryTool`
  `helloWorldPlugin/evenMoreHelloWorldMixin`
]

All of the above are valid, just shorthand are available for clarity/DX.
Cross plugin dependencies.
If a tool in one plugin wants to use, e.g. a manipulator from another plugin, it may do so by importing it inside its constructor, e.g.:
class ExampleTool extends BaseTool {
    constructor (name = 'Example') {
      super({
        name,
        supportedInteractionTypes: ['mouse', 'touch'],
      });

      this._myManipulator = cornerstoneTools.import('aDifferentPlugin/manipulators/myManipulator');
    }
  }

This insures it is not fetched until the tools are instantiated. All plugins to be used should be imported right after cornerstoneTools.init();, to ensure cross-dependencies work.

Netlify: Build exceeded maximum allowed runtime

Well.. That stinks. Not sure why this would be taking > 20 minutes to build though.

Much, much cleaner @JamesAPetts. I'm loving it 👍

Hey @dannyrb , going to merge this for now, the registerX issue we can work on nearer the time, I just want to keep the vNext pushing a little bit so we don't get more of the 3-PR's-then-everything-breaks issues. If you have anything else you'd like to change, you know where to DM me!


Recieving an error when attempting to post an entry

Hello,
My apologies, but if anyone has a spare moment to perhaps see where I've gone wrong with my setup.
I have installed indiekit and have logged in and viewed the server status and everything looks fine as far as I can tell. I have been able to authenticate with various different applications but can't seem to post any content.
I have tried to create a new Note and Article with 3 different micropub applications and none have worked. Quill and Micropublish.net both give the error:
TypeError
Cannot read properties of undefined (reading ‘insertOne’)
Status code: undefined
IndiePass on android briefly shows a 500 response message "RangeError" "Invalid time zone ..."
This is my indiekit.config.js
const process = require("node:process");

/**
 * Customise post types.
 */
const postTypes = [
  {
    type: "note",
    name: "Remarks",
    post: {
      path: "/content/notes/{slug}.md",
      url: "/notes/{slug}/",
    }
  },
];

module.exports = {
  /**
   * Set application options
   **/
  application: {
    url: "https://indiekit.trivial.observer",
    port: 3001,
    timeZone: "Europe/London",
    themeColorScheme: "dark"
  },

  /**
   * Add plug-ins.
   */
  plugins: [
    "@indiekit/store-github",
    "@indiekit/preset-hugo",
  ],
  /**
   * Set publication options
   */
  publication: {
    me: "https://trivial.observer",
    postTypes: postTypes,
    timeZone: "Europe/London",
  },

  /**
   * Hugo preset options.
   */
  "@indiekit/preset-hugo": {
      frontMatterFormat: "yaml",
  },

  /**
   * GitHub content store options.
   */
  "@indiekit/store-github": {
    user: "nondeterminischtick",
    repo: "trivialobserver",
    branch: "master",
    token: "[REDACTED]"
  },
};

All that is showing in the output was what I had assumed was an info message
"No database configuration provided
See https://getindiekit.com/configuration/#application-mongodburl-url"
As the docs imply this is only required for more advanced features.
I may set this up to see what happens

Looking at the code, there are 2 places where a database operation is carried out without checking if a database has been configured beforehand, for example:
https://github.com/getindiekit/indiekit/blob/90d9259ef284ebbed934643c25a300babd68a436/packages/endpoint-micropub/lib/post-data.js#L59-L60
Adding a guard around this operation should hopefully fix this issue; am hoping to release Beta 4 soon, and that will ideally contain a fix for this.

Thanks for the info, Paul.


Parse jump and jumpi as keywords in Yul

jump and jumpi should be parsed as keywords inside Yul blocks since they are EVM instructions. Their use is deprecated since 0.5.0, but they remain as reserved keywords.

Closing this as #1154 was merged (why wasn't it closed by GH when merging it?)


(ref)share links and update demo style

Coverage increased (+1.4%) to 96.798% when pulling 37665322e7446abde751fc43544d613b98031668 on dev into eb77d584c6a8f045d3a53167856bbdf25cd61db4 on master.


No possibility to change language

Hello,
I have a problem with version 5.1 (master or dev, clean install) :
When i want switch language of the site, i have an infinite loading icon and no other language in the liste.
I had this problem one time, and in don't know how I have corrected it.
In master :

In dev :

If you had any suggestion...
Thank you !

Are you seeing any errors in the console?

Yes :

I am seeing this error too.  I will look into it.

Let me look into it.  I am finishing something and will try to fix this.
It is probably related to fr translation i accepted a few days ago.

@Tangoso, please try the patch I just uploaded when you can and let us know how it goes.
@madoublet, I don't think the solution I provide here is the correct one. It seems related to JWT authentication after upgrading to their latest version (I also had to add the "use" we spoke about in #325). All I did was avoid a warning message because now there is no value for HTTP_X_AUTH but this may be avoiding the validation completely. Please have a look when you can because I have no idea how JWT works.

Yeah, the solution is fine.  That specific API call can be accessed via the app (authenticated using the token) or via a site (no auth needed).


Remove workerMainCompatibility.html #11306

related #11306
Remove workerMainCompatibility.html and related files.

Coverage increased (+0.001%) to 60.996% when pulling 9fae2eff98ebd764a32214f7c26de643b9263abb on Ikuyadeu:removeworkerMainCompatibility into 31bff72a4d33f4953e3bd24b6b9089764d7e09ac on Microsoft:master.

Sorry I missed

Coverage increased (+0.07%) to 61.068% when pulling 5444e50c5dfff7d93ffd9b03ff99280de7d2de47 on Ikuyadeu:removeworkerMainCompatibility into 31bff72a4d33f4953e3bd24b6b9089764d7e09ac on Microsoft:master.


Update theme build configuration

A couple small updates have been made to the dependencies configuration for the Wordpress Theme.
RespondJS has been removed as a dependency. We are not going to support IE 6-8 any longer.
jQuery has been added as an explicit dependency in bower, to ensure the correct version is used (currently 2.2.x).
With the Bootstrap Theme updated with a new dependencies setup, that updated bootstrap-asu.min.js has been imported.

Ok. This now includes an updated bower config to pull the new 1.x.x releases of the Bootstrap Theme and the corresponding bootstrap-asu assets with update version numbers.

Looks good!


rework on DOM(html,svg) tags

currently its 60k LOC(inline +noinline) (generated) , each tag defined like ..

 @inline
 def caption(
  tabIndex: U[Int] = undefined,
is: U[String] = undefined,
classID: U[String] = undefined,
contentEditable: U[String] = undefined,
role: U[String] = undefined,
style: U[js.Any] = undefined,
hidden: U[Boolean] = undefined,
ref: U[(_ <: dom.html.Element) => _] = undefined,
key: U[String | Int] = undefined,
dir: U[String] = undefined,
id: U[String] = undefined,
.. many more
  @exclude extraAttributes: U[js.Object] = undefined)(children: ReactNode*) : ReactElement  = {
      val props = FunctionMacro()
    if(extraAttributes.isDefined && extraAttributes != null) addJsObjects(props,extraAttributes.get)
    if (developmentMode) React.createElement("caption",props,children :_*)
    else inlineReactElement("caption",props,children :_*)
 }

In above code we used macro to create js.Object from method params which expands to bunch of updateDynamic calls and we have extrraAttributes for unknown props at compile time which will add extra execution time while combing objects ,i think with new @ScalaJSDefined trait changes came in scala.js 0.6.14 we can make it better!
New Proposal :
lets have a global trait with all dom attributes
@ScalaJSDefined
trait DOMProps extends js.Object {
var  tabIndex: U[Int] = undefined,
 var is: U[String] = undefined,
var classID: U[String] = undefined,
var contentEditable: U[String] = undefined,
var role: U[String] = undefined,
var style: U[js.Any] = undefined,
......
}

def caption(props:DOMProps)(children:ReactNode*) = React.createElement("caption",props,children:_*)

//call site
caption(new DOMProps { id = "hello" ; tabIndex = 2})(children)

Pros :
1)we can have type safe DOM tags under 500LOC instead of 30K LOC before
2)no need of macros
3)no extra run time cost
Cons :
1)we need some extra typing new DOM Props{ at call site , but i think its not a big deal

we need some extra typing new DOM Props{ at call site , but i think its not a big deal

I think it is a big deal. At the end of the day (1) we have to write a lot of markup, and (2) it's important that (with some squinting) it has a strong resemblance to the HTML it represents

1)we can have type safe DOM tags under 500LOC instead of 30K LOC before
Isn't it code-generated?
2)no need of macros
I think they're justified
3)no extra run time cost
No reason why macros can't achieve that

What would be really neat is if we could make a general-purpose macro or codegen library that lets you turn any trait into a typesafe name-arguments method. Then it would have wider appeal and the maintenance burden could be spread more widely. DOM would just be a special case of it.

Also I don't like the idea of `vars

I think it is a big deal. At the end of the day (1) we have to write a lot of markup, and (2) it's important that (with some squinting) it has a strong resemblance to the HTML it represents

makes sense :) , i am convinced to ditch my New Proposal .

Isn't it code-generated?

That doesn't mean there is 0 cost, that increases size of the js which is a problem for me.  I should make a small case to generate real numbers, Ill try to do that.
This has much less code and I like the flow.  https://github.com/dispalt/sri-vdom @nafg take a look.

What would be really neat is if we could make a general-purpose macro or codegen library that lets you turn any trait into a typesafe name-arguments method. Then it would have wider appeal and the maintenance burden could be spread more widely. DOM would just be a special case of it.

https://gist.github.com/dispalt/9c7449bfdf4bc2d41c31248b722daf68
I will probably just stick to using my own sri-web component for now, if this doesn't change.

That doesn't mean there is 0 cost, that increases size of the js which is a problem for me. I should make a small case to generate real numbers, Ill try to do that.

you mean production code ?
simple test
@ScalaJSDefined
trait DOMProps extends js.Object {
  var id: js.UndefOr[String] = js.undefined
  var key: js.UndefOr[String] = js.undefined
  var tabIndex: U[Int] = undefined
  var is: U[String] = undefined
  var classID: U[String] = undefined
  var contentEditable: U[String] = undefined
  var role: U[String] = undefined
  var style: U[js.Any] = undefined
  var hidden: U[Boolean] = undefined
  var ref: U[js.Function1[(_ <: dom.html.Element),_]] = undefined
  var dir: U[String] = undefined
  var className: js.UndefOr[String] = js.undefined
}

  @inline
  def div1(props: DOMProps) = React.createElement("div", props)

  @inline
  def div2(id: js.UndefOr[String] = js.undefined,
           key: js.UndefOr[String] = js.undefined,
           tabIndex: U[Int] = undefined,
           is: U[String] = undefined,
           classID: U[String] = undefined,
           contentEditable: U[String] = undefined,
           role: U[String] = undefined,
           style: U[js.Any] = undefined,
           hidden: U[Boolean] = undefined,
           ref: U[(_ <: dom.html.Element) => _] = undefined,
           dir: U[String] = undefined,
           className: js.UndefOr[String] = js.undefined) = {
    val p = js.Dynamic.literal()
    id.foreach(v => p.updateDynamic("id")(v))
    key.foreach(v => p.updateDynamic("key")(v))
    className.foreach(v => p.updateDynamic("className")(v))
    tabIndex.foreach(v => p.updateDynamic("tabIndex")(v))
    is.foreach(v => p.updateDynamic("is")(v))
    classID.foreach(v => p.updateDynamic("classID")(v))
    contentEditable.foreach(v => p.updateDynamic("contentEditable")(v))
    role.foreach(v => p.updateDynamic("role")(v))
    style.foreach(v => p.updateDynamic("style")(v))
    dir.foreach(v => p.updateDynamic("dir")(v))
    ref.foreach(v => p.updateDynamic("ref")(v))
    React.createElement("div", p)
  }

test1 :

 val div1_v = div1(new DOMProps {
      key = "div1_key";
      tabIndex = 4;
    })
    dom.window.console.log(div1_v)
//fullOpt code
var a=new k.Object;a.key="div1_key";a.tabIndex=4;var a=ua.createElement("div",a)

 val div2_v = div2(key = "div2_key", tabIndex = 4)
    dom.window.console.log(div2_v)

//fullOptCode
a=E.createElement("div",{key:"div2_key",tabIndex:4});

test2 :

  val div1_v = div1(new DOMProps {
      key = "div1_key";
      style = js.Dynamic.literal(padding = 10);
      ref = js.defined((e :dom.html.Div) => println(e))
    })
    dom.window.console.log(div1_v)
//fullOptCode
var a=new h.Object;a.key="div1_key";a.style={padding:10};a.ref=function(a){Ma(Na().C.y,a+"\n")};a=Fa.createElement("div",a);Ga().console.log(a);

 val div2_v = div2(key = "div2_key", style = js.Dynamic.literal(padding = 10),ref = (e :dom.html.Div) => println(e))
    dom.window.console.log(div2_v)

//fullOptCode
var a={padding:10},b=Oa(function(a){Ma(Na().C.y,a+"\n")}),c={key:"div2_key"};void 0!==a&&(c.style=a);void 0!==b&&(c.ref=function(a){return function(b){return(0,a.I)(b)}}(b));a=Fa.createElement("div",c);Ga().console.log(a)

test3 :

val div1_v = div1(new DOMProps {
      key = "div1_key";
      style = js.Dynamic.literal(padding = 10);
      className = "sfdf";
      role = "dgsdgf";
      dir = "sadsad"
    })
 dom.window.console.log(div1_v)

//fulOpt
var a=new k.Object;a.key="div1_key";a.style={padding:10};a.className="sfdf";a.role="dgsdgf";a.dir="sadsad";a=ta.createElement("div",a);

val div2_v = div2(key = "div2_key", style = js.Dynamic.literal(padding = 10), className = "sdad", role = "asdas", dir = "sadsad")
    dom.window.console.log(div2_v)

//fullOpt
var a={padding:10},b={key:"div2_key",className:"sdad",role:"asdas"};void 0!==a&&(b.style=a);b.dir="sadsad";a=ta.createElement("div",b);

with current version there is an inconsistent behaviour if we pass a callback/object .
Current fullOpt.js file size is = 10KB
Now i just added your version of vdom and imported import com.dispalt.vdom.prefix_<^._
fullOpt.js file size is = 38KB
val div3_v = <.div(^.key := "div3_key",^.className := "div3_class")
dom.window.console.log(div3_v)
//fullOptCode
var a=ie.Yb,b=(he(),ke()).jc;he();var c=K().Ra,d=new J,g=new le;g.S=b.S;g.n="div3_key";g.Fc=c;b=(he(),ke());0===(512&b.ya.p)&&0===(512&b.ya.p)&&(me||(me=(new ne).a()),b.na=me,c=b.ya,b.ya=(new N).da(c.q,512|c.p));var b=(he(),K().Ra),c=new oe,k=new pe;k.Tb="div3_class";

Now file Size  = 61KB
to be honest i have no idea of whats going on there.
Test Project i used : https://github.com/chandu0101/scalatest-error

I will probably just stick to using my own sri-web component for now, if this doesn't change.

as i said earlier vdom will come in separate project, and we will also provide your version of vdom so that people can choose what ever they want. your version is an easy selling  point for people coming from scalajs-react ;)

So sorry I wasn't clear. The current version, aka 60k sloc, has a real cost.  Hence I used my version.
However, with your new approach I might change over. So my viewpoint is, it's better than the current approach.  If you don't take the new approach, I'll stick with my version.  My only complaint would be lack of immutability, although more verbose is less error prone.
It's hard to test because as you use more tags and thus less code gets eliminated, the combinatorial explosion of the current version will take up more space.  Moving to the Dom version saves code, I just don't know the full extent, because practically it will differ alot from code base to code base.

The current version, aka 60k sloc, has a real cost. Hence I used my version.

can you please elaborate on real cost ? maintenance or compile times or ..
may we will just remove noinline version , i don't think a valid use case for that. then again we still have 30LOC of dev.
@nafg  whats u r take on in consistent behaviour when we pass callback/object attributes  with current approach ? we have extra checks 0!==a&&(b.style=a) and increase in code generated(very little though). New Proposal suffers from none of the above!

because practically it will differ alot from code base to code base.

indeed , but sri version of vdom will beat scalajs-react vdom  interms of performance ,code size and type safety any day! :p

can you please elaborate on real cost ? maintenance or compile times or ..

code size.
I am supporting your proposed new approach, but I am still hesitant on the mutable-ness.

but I am still hesitant on the mutable-ness.

well we can provide two variants ;)

regarding inconsistency with object/function attributes https://github.com/scala-js/scala-js/issues/2714
and now current version output code is small and more performant!(http://stackoverflow.com/a/21436082/986387) than New Proposal , may we should stick with existing one and use our own OptionParam instead of js.UndefOr ?

On Sun, Jan 8, 2017, 4:09 PM Chandra Sekhar Kode<EMAIL_ADDRESS>wrote:

The current version, aka 60k sloc, has a real cost. Hence I used my
version.
can you please elaborate on real cost ? maintenance or compile times or ..
may we will just remove noinline version , i don't think a valid use case
for that. then again we still have 30LOC of dev.
@nafg https://github.com/nafg whats u r take on in consistent behaviour
when we pass callback/object attributes with current approach ? we have
extra checks 0!==a&&(b.style=a) and increase in code generated(very
little though).

I did not understand that. What?
New Proposal suffers from none of the above!

Any reason the macro can't be changed to output whatever you want users to
write without a macro?
because practically it will differ alot from code base to code base.

indeed , but sri version of vdom will beat scalajs-react vdom interms of
performance ,code size and type safety any day! :p
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/chandu0101/sri/issues/56#issuecomment-271179635, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGAUB1va9LoykYP1JvmgKwBmM_JAgNZks5rQVCGgaJpZM4LdpAh
.

Any reason the macro can't be changed to output whatever you want users to
write without a macro

can you please show us an example how can we achieve this ? https://github.com/scala-js/scala-js/issues/2714 i want cool if! section .

here my final thoughts :
Current Approach :
Pros :

Usability

Cons :

Large code base
as we can't provide typesafety for data-* attributes ,it adds up execution time in creating object
Takes more time to publish/download package
4)More time in compile/optimization ,with current HtmlTagsTest SvgTagsTest sbt  "project test" test taking ~30 minutes of time.

New Proposal
Pros:

No magic , easy to define and maintain,easy to extend in user code base(for data-* attributes)
Less code (~500LOC <<<<<<<30KLOC) , easy to publish/download
Faster compile/optimization times!

Cons:

A little verbose at call site

after playing with new approach , i have to admit that usability matters @nafg  :) , to use View with style View( new ViewProps { style = ..})() just killing me :( , I'll stick with current approach with few changes

We will use OptionalaParam type (inline version of js.UndefOr)
primitives comes with few fields defined at first and we will add new ones when user of our library needed them  , this way we can avoid high compile/optimization times

import sri.macros.{
  FunctionObjectMacro,
  exclude,
  rename,
  OptDefault => NoValue,
  OptionalParam => U
}

  @inline
  def View(style: U[js.Any] = NoValue,
           onLayout: U[LayoutEvent => _] = NoValue,
           @exclude extraProps: U[ViewProps] = NoValue,
           @exclude key: String | Int = null,
           @exclude ref: ViewClass.type => Unit = null)(
      children: ReactNode*): ReactElement = {
    val props = FunctionObjectMacro()
    extraProps.foreach(v => { MergeJSObjects(props, v) })
    CreateElementJS(ViewClass, props, key, ref, children.toJSArray)
  }

for 99% of cases we don't need any other props , if user want to pass onMoveShouldSetResponder  to View he/she can use extraProps or submit PR  for that , I recommend sending a PR than using extraProps! that being said i am not using dom primitives div,span,etc in my apps,  I'll add id,className,style for all tags and some one please take care of adding other params used in your apps.

BTW you inline a lot, have you actually tested / benchmarked how much of a
difference it makes in running time (and how it affects download time)?
On Wed, Feb 22, 2017 at 8:39 AM Chandra Sekhar Kode <
<EMAIL_ADDRESS>wrote:

after playing with new approach , i have to admit that usability matters
@nafg https://github.com/nafg :) , to use View with style View( new
ViewProps { style = ..})() just killing me :( , I'll stick with current
approach with few changes

We will use OptionalaParam type (inline version of js.UndefOr)
primitives comes with few fields defined at first and we will add
new ones when user of our library needed them , this way we can avoid high
compile/optimization times

import sri.macros.{
FunctionObjectMacro,
exclude,
rename,
OptDefault => NoValue,
OptionalParam => U
}
@inline
def View(style: U[js.Any] = NoValue,
onLayout: U[LayoutEvent => _] = NoValue,
@exclude extraProps: U[ViewProps] = NoValue,
@exclude key: String | Int = null,
@exclude ref: ViewClass.type => Unit = null)(
children: ReactNode*): ReactElement = {
val props = FunctionObjectMacro()
extraProps.foreach(v => { MergeJSObjects(props, v) })
CreateElementJS(ViewClass, props, key, ref, children.toJSArray)
}
for 99% of cases we don't need any other props , if user want to pass
onMoveShouldSetResponder to View he/she can use extraProps or submit PR
for that , I recommend sending a PR than using extraProps! that being
said i am not using dom primitives div,span,etc in my apps, I'll add
id,className,style for all tags and some one please take care of adding
other params used in your apps.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/chandu0101/sri/issues/56#issuecomment-281671656, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGAUE78K8DQTDmxCK4AWZ8F8faKd7oHks5rfDqrgaJpZM4LdpAh
.

have you actually tested / benchmarked how much of a
difference it makes in running time ?

all primitive components should be inlined in my opinion! that being said no benchmark done with/without ..

and how it affects download time

i didn't understand this part,can you elaborate ...

On Wed, Feb 22, 2017 at 5:04 PM Chandra Sekhar Kode <
<EMAIL_ADDRESS>wrote:

have you actually tested / benchmarked how much of a
difference it makes in running time ?
all primitive components should be inlined in my opinion! that being said
no benchmark done with/without ..

Then I suggest you consider the tradeoffs that are facts, not opinions. For
example how suppose I have a js.UndefOr and I need to convert it to your
thingy?

and how it affects download time
i didn't understand this part,can you elaborate ...

Because by inlining, the JS file is bigger, so it takes longer to load the
page.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/chandu0101/sri/issues/56#issuecomment-281819353, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGAUG3CY-fmJ4rGT__A3v3DEw5mKoiBks5rfLDegaJpZM4LdpAh
.

Because by inlining, the JS file is bigger, so it takes longer to load the
page.

View(style = myStyle)("Child") -> var p = {style : myStyle};React.createElement(ViewClass,p,"child"}  , i think its not much code and when something changed react call re render most of the time we should optimize here,  React suggests  to remove React.createElement also https://github.com/facebook/react/issues/3228


Pasting href text in editor act as a plane text .

How to enable url text link while pasting on editor.? When I copied some text in which href link on it during pasting that text to my ck-editor consider as a plan text but actually hyperlink was their.Help me how to get link inside my editor.

Paste text with URL links is enable by default. Try on plunker https://embed.plnkr.co/8D0aLbgkeM7rRoA9T2jK/


Indexes not updating

As the server runs, the intention is to have the indexes updated as files change on the filesystem.
This is not currently happening.

should be fixed.


Receivce Invitation raised "failed from didexchange service handle: threadID not found"

What I'm trying to do

Run "make run-openapi-demo"
Open Carl agent and Carl router agent
Create Invitation from Carl router
Run ReceiveInvitation from Carl

Expected result
Connection made on Carl agent and wait for accept invitation
Actual result
An Error raised
{"code":2003,"message":"failed from didexchange service handle: threadID not found"}

I had the same problem with receive invitation in Javascript example. There are three fields in created invitation: alias, invitation and invitation_url. When I passed the whole object to receive invitation, I got threadID not found error. Try to pass only invitation property to receive invitation. Worked for me.

Yes, my bad. Previously, using program to extract the invitation part. And forget this when manually testing.
Thank you very much.


Fix errors caused by newline and whitespace in folded string

fixes: #41
Test data:
input: hello \n world
output:
>-
  hello
   world

input: hello \n\n world
output:
>-
  hello

   world

input: hello \n \n world
output:
>-
  hello

   world

input: hello \nstring\n world
output:
>-
  hello

  string
   world

Hi @jonasfj, thanks for the review!
I have pushed a new commit that updates the comment and improves the code by using .split('\n').

Maybe this is a separate issue, but might also be worth considering if we should address it here.
Are there strings that cannot be written as folded string?
Playing around I had a hard time writing  T or \n T

For these conditions, we can use block styles with indication indicators to implement it.
condition 1:
input:  hello
output:
>-3
   hello

condition 2:
input: \n hello
output:
>-3

   hello

condition 3:
input:      \n    \n  hello \n
output:
>-3

    hello

note: Some yaml conversion tools could not correctly parse condition 3, they parsed the output as \n\n hello


Compare this repo to https://github.com/drypy/openxr.py

That project is similar to this one
https://github.com/drypy/openxr.py

I read through most of the code. It's got a well studied basic structure; but very little is implemented. Most of the concepts are already pretty well reflected here.