CLOUDSTACK-9086: ACS allows to create isolated networks with invalid …

…gateway IP address - Fixed
Problem: There was no check for the network and broadcast IP addresses in the case where we provide the gateway and netmask while creating the isolated network. As a result the provided IP gets assigned to the eth0 interface of the VR.
Fix: Added the necessary checks.

LGTM based on these tests:
nosetests --with-marvin --marvin-config=${marvinCfg} -s -a tags=advanced,required_hardware=true \
component/test_vpc_redundant.py \
component/test_routers_iptables_default_policy.py \
component/test_routers_network_ops.py \
component/test_vpc_router_nics.py \
smoke/test_loadbalance.py \
smoke/test_internal_lb.py \
smoke/test_ssvm.py \
smoke/test_network.py

Result:
Create a redundant VPC with two networks with two VMs in each network ... === TestName: test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | Status : SUCCESS ===
ok
Create a redundant VPC with two networks with two VMs in each network and check default routes ... === TestName: test_02_redundant_VPC_default_routes | Status : SUCCESS ===
ok
Create a redundant VPC with two networks with two VMs in each network ... === TestName: test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | Status : SUCCESS ===
ok
Test iptables default INPUT/FORWARD policy on RouterVM ... === TestName: test_02_routervm_iptables_policies | Status : SUCCESS ===
ok
Test iptables default INPUT/FORWARD policies on VPC router ... === TestName: test_01_single_VPC_iptables_policies | Status : SUCCESS ===
ok
Test redundant router internals ... === TestName: test_01_isolate_network_FW_PF_default_routes_egress_true | Status : SUCCESS ===
ok
Test redundant router internals ... === TestName: test_02_isolate_network_FW_PF_default_routes_egress_false | Status : SUCCESS ===
ok
Test redundant router internals ... === TestName: test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true | Status : SUCCESS ===
ok
Test redundant router internals ... === TestName: test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false | Status : SUCCESS ===
ok
Create a VPC with two networks with one VM in each network and test nics after destroy ... === TestName: test_01_VPC_nics_after_destroy | Status : SUCCESS ===
ok
Create a VPC with two networks with one VM in each network and test default routes ... === TestName: test_02_VPC_default_routes | Status : SUCCESS ===
ok
Check the password file in the Router VM ... === TestName: test_isolate_network_password_server | Status : SUCCESS ===
ok
Check that the /etc/dhcphosts.txt doesn't contain duplicate IPs ... === TestName: test_router_dhcphosts | Status : SUCCESS ===
ok
Test to create Load balancing rule with source NAT ... === TestName: test_01_create_lb_rule_src_nat | Status : SUCCESS ===
ok
Test to create Load balancing rule with non source NAT ... === TestName: test_02_create_lb_rule_non_nat | Status : SUCCESS ===
ok
Test for assign & removing load balancing rule ... === TestName: test_assign_and_removal_lb | Status : SUCCESS ===
ok
Test to verify access to loadbalancer haproxy admin stats page ... === TestName: test02_internallb_haproxy_stats_on_all_interfaces | Status : SUCCESS ===
ok
Test create, assign, remove of an Internal LB with roundrobin http traffic to 3 vm's ... === TestName: test_01_internallb_roundrobin_1VPC_3VM_HTTP_port80 | Status : SUCCESS ===
ok
Test SSVM Internals ... === TestName: test_03_ssvm_internals | Status : SUCCESS ===
ok
Test CPVM Internals ... === TestName: test_04_cpvm_internals | Status : SUCCESS ===
ok
Test stop SSVM ... === TestName: test_05_stop_ssvm | Status : SUCCESS ===
ok
Test stop CPVM ... === TestName: test_06_stop_cpvm | Status : SUCCESS ===
ok
Test reboot SSVM ... === TestName: test_07_reboot_ssvm | Status : SUCCESS ===
ok
Test reboot CPVM ... === TestName: test_08_reboot_cpvm | Status : SUCCESS ===
ok
Test destroy SSVM ... === TestName: test_09_destroy_ssvm | Status : SUCCESS ===
ok
Test destroy CPVM ... === TestName: test_10_destroy_cpvm | Status : SUCCESS ===
ok
Test Remote Access VPN in VPC ... === TestName: test_vpc_remote_access_vpn | Status : SUCCESS ===
ok
Test VPN in VPC ... === TestName: test_vpc_site2site_vpn | Status : SUCCESS ===
ok
Test for port forwarding on source NAT ... === TestName: test_01_port_fwd_on_src_nat | Status : SUCCESS ===
ok
Test for port forwarding on non source NAT ... === TestName: test_02_port_fwd_on_non_src_nat | Status : SUCCESS ===
ok
Test for reboot router ... === TestName: test_reboot_router | Status : SUCCESS ===
ok
Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_1_static_nat_rule | Status : SUCCESS ===
ok
Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_2_nat_rule | Status : SUCCESS ===
ok
Test for Router rules for network rules on acquired public IP ... === TestName: test_network_rules_acquired_public_ip_3_Load_Balancer_Rule | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 34 tests in 16205.787s

OK

And:
nosetests --with-marvin --marvin-config=${marvinCfg} -s -a tags=advanced,required_hardware=false \
smoke/test_routers.py \
smoke/test_network_acl.py \
smoke/test_privategw_acl.py \
smoke/test_reset_vm_on_reboot.py \
smoke/test_vm_life_cycle.py \
smoke/test_vpc_vpn.py \
smoke/test_service_offerings.py \
component/test_vpc_offerings.py \
component/test_vpc_routers.py

Result:
Test router internal advanced zone ... === TestName: test_02_router_internal_adv | Status : SUCCESS ===
ok
Test restart network ... === TestName: test_03_restart_network_cleanup | Status : SUCCESS ===
ok
Test router basic setup ... === TestName: test_05_router_basic | Status : SUCCESS ===
ok
Test router advanced setup ... === TestName: test_06_router_advanced | Status : SUCCESS ===
ok
Test stop router ... === TestName: test_07_stop_router | Status : SUCCESS ===
ok
Test start router ... === TestName: test_08_start_router | Status : SUCCESS ===
ok
Test reboot router ... === TestName: test_09_reboot_router | Status : SUCCESS ===
ok
test_privategw_acl (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_privategw_acl | Status : SUCCESS ===
ok
Test reset virtual machine on reboot ... === TestName: test_01_reset_vm_on_reboot | Status : SUCCESS ===
ok
Test advanced zone virtual router ... === TestName: test_advZoneVirtualRouter | Status : SUCCESS ===
ok
Test Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS ===
ok
Test Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS ===
ok
Test Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS ===
ok
Test Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS ===
ok
Test Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS ===
ok
Test destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS ===
ok
Test recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS ===
ok
Test migrate VM ... === TestName: test_08_migrate_vm | Status : SUCCESS ===
ok
Test destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS ===
ok
Test to create service offering ... === TestName: test_01_create_service_offering | Status : SUCCESS ===
ok
Test to update existing service offering ... === TestName: test_02_edit_service_offering | Status : SUCCESS ===
ok
Test to delete service offering ... === TestName: test_03_delete_service_offering | Status : SUCCESS ===
ok
Test for delete account ... === TestName: test_delete_account | Status : SUCCESS ===
ok
Test for Associate/Disassociate public IP address for admin account ... === TestName: test_public_ip_admin_account | Status : SUCCESS ===
ok
Test for Associate/Disassociate public IP address for user account ... === TestName: test_public_ip_user_account | Status : SUCCESS ===
ok
Test for release public IP address ... === TestName: test_releaseIP | Status : SUCCESS ===
ok
Test create VPC offering ... === TestName: test_01_create_vpc_offering | Status : SUCCESS ===
ok
Test VPC offering without load balancing service ... === TestName: test_03_vpc_off_without_lb | Status : SUCCESS ===
ok
Test VPC offering without static NAT service ... === TestName: test_04_vpc_off_without_static_nat | Status : SUCCESS ===
ok
Test VPC offering without port forwarding service ... === TestName: test_05_vpc_off_without_pf | Status : SUCCESS ===
ok
Test VPC offering with invalid services ... === TestName: test_06_vpc_off_invalid_services | Status : SUCCESS ===
ok
Test update VPC offering ... === TestName: test_07_update_vpc_off | Status : SUCCESS ===
ok
Test list VPC offering ... === TestName: test_08_list_vpc_off | Status : SUCCESS ===
test_09_create_redundant_vpc_offering (integration.component.test_vpc_offerings.TestVPCOffering) ... === TestName: test_09_create_redundant_vpc_offering | Status : SUCCESS ===
ok
Test start/stop of router after addition of one guest network ... === TestName: test_01_start_stop_router_after_addition_of_one_guest_network | Status : SUCCESS ===
ok
Test reboot of router after addition of one guest network ... === TestName: test_02_reboot_router_after_addition_of_one_guest_network | Status : SUCCESS ===
ok
Test to change service offering of router after addition of one guest network ... === TestName: test_04_chg_srv_off_router_after_addition_of_one_guest_network | Status : SUCCESS ===
ok
Test destroy of router after addition of one guest network ... === TestName: test_05_destroy_router_after_addition_of_one_guest_network | Status : SUCCESS ===
ok
Test to stop and start router after creation of VPC ... === TestName: test_01_stop_start_router_after_creating_vpc | Status : SUCCESS ===
ok
Test to reboot the router after creating a VPC ... === TestName: test_02_reboot_router_after_creating_vpc | Status : SUCCESS ===
ok
Tests to change service offering of the Router after ... === TestName: test_04_change_service_offerring_vpc | Status : SUCCESS ===
ok
Test to destroy the router after creating a VPC ... === TestName: test_05_destroy_router_after_creating_vpc | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 42 tests in 8062.366s

OK

Haven't tested the actual functionality, this just shows you didn't break anything else.

@kansal can you address some of the issues Daan has mentioned, if you can fix them today I help can review and merge this. Thanks.

cc @bhaisaab @DaanHoogland . Added test cases and made some minor changes to the function. Please have a look.

LGTM
I will run a test build on this
also github reports conflicts on this branch, did you fork this of master? and when? It may need a rebase to merge with adjacent changes.

Not sure if it is related but
Running com.cloud.utils.net.NetUtilsTest
2015-12-07 11:33:08,471 INFO  [utils.net.NetUtils] (main:) Invalid value of cidr <IP_ADDRESS>/50
2015-12-07 11:33:08,480 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::1
2015-12-07 11:33:08,480 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::2
2015-12-07 11:33:08,483 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::1
2015-12-07 11:33:08,488 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::1
2015-12-07 11:33:08,490 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::1
2015-12-07 11:33:08,492 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::99d6:578:c6d0:4d1e
2015-12-07 11:33:08,497 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::c2ad:5357:a636:5465
2015-12-07 11:33:08,500 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::f54c:4cd1:fafc:6d08
2015-12-07 11:33:08,509 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::54d1:5897:eba:aced
2015-12-07 11:33:08,511 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::a924:8a89:5af3:2039
2015-12-07 11:33:08,512 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::1442:6ab4:8a7f:1495
2015-12-07 11:33:08,518 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::e319:8c5f:b31c:eda1
2015-12-07 11:33:08,520 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::e380:62c1:5705:769f
2015-12-07 11:33:08,521 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::a764:8dd3:1f33:bc29
2015-12-07 11:33:08,522 INFO  [utils.net.NetUtilsTest] (main:) IP is 1234:5678::9b2d:3bd9:7c1c:3df1
2015-12-07 11:33:08,564 ERROR [utils.net.NetUtils] (main:) Failed to convert a string to an IPv6 address
java.lang.IllegalArgumentException: can not parse []
	at com.googlecode.ipv6.IPv6Address.tryParseStringArrayIntoLongArray(IPv6Address.java:94)
	at com.googlecode.ipv6.IPv6Address.fromString(IPv6Address.java:80)
	at com.cloud.utils.net.NetUtils.countIp6InRange(NetUtils.java:1317)
	at com.cloud.utils.net.NetUtilsTest.testCountIp6InRangeWithNullStart(NetUtilsTest.java:152)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Tests run: 40, Failures: 3, Errors: 0, Skipped: 0, Time elapsed: 0.143 sec <<< FAILURE! - in com.cloud.utils.net.NetUtilsTest
test31BitPrefixEnd(com.cloud.utils.net.NetUtilsTest)  Time elapsed: 0.019 sec  <<< FAILURE!
java.lang.AssertionError: Check if the subnetUtils.setInclusiveHostCount(true) has been called.
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at com.cloud.utils.net.NetUtilsTest.test31BitPrefixEnd(NetUtilsTest.java:362)

test31BitPrefixFail(com.cloud.utils.net.NetUtilsTest)  Time elapsed: 0.001 sec  <<< FAILURE!
java.lang.AssertionError: Out of the range. Why did it return true?
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at org.junit.Assert.assertFalse(Assert.java:64)
	at com.cloud.utils.net.NetUtilsTest.test31BitPrefixFail(NetUtilsTest.java:372)

test31BitPrefixStart(com.cloud.utils.net.NetUtilsTest)  Time elapsed: 0.001 sec  <<< FAILURE!
java.lang.AssertionError: Check if the subnetUtils.setInclusiveHostCount(true) has been called.
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at com.cloud.utils.net.NetUtilsTest.test31BitPrefixStart(NetUtilsTest.java:352)

Results :

Failed tests:
  NetUtilsTest.test31BitPrefixEnd:362 Check if the subnetUtils.setInclusiveHostCount(true) has been called.
  NetUtilsTest.test31BitPrefixFail:372 Out of the range. Why did it return true?
  NetUtilsTest.test31BitPrefixStart:352 Check if the subnetUtils.setInclusiveHostCount(true) has been called.

@DaanHoogland I see a test case in the NetUtilsTest.java class' testIsSameIpRange() function.
assertFalse(NetUtils.isSameIpRange(cidrFirst, "<IP_ADDRESS>/50"));
I think this is the one causing the problem?

it is the NetUtilsTest.test31BitPrefix...() family of tests that are failing


Error when using v3.0.0-alpha1 of gradle plugin

I tried updating to v3.0.0-alpha1 of gradle plugin to try new performance tools but get following error....am seeing same error on another project (also after updating plugin) so curious if anyone has found solution to this?
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> java.lang.NoClassDefFoundError (no error message)

Just updated to alpha2 and not seeing this issue any more.


Consider using a separate session for every child process

Currently, every process we start is on the same process group as the parent process, and that means a Ctrl-C in the terminal will cause a SIGINT to be sent to every process we start, but our parent process also has logic to detect a SIGINT and forward it to every child, so by default every child ends up receiving two SIGINTs, unless one adds a (start_new_session=True item to open_in_process()s subprocess_kwargs` dict, like we do in trinity)[https://github.com/ethereum/trinity/pull/1666]
As [Piper suggested)[https://github.com/ethereum/trinity/pull/1666#pullrequestreview-393853338], though, we might want to have that as the default behaviour here

Can we even go as far as detecting this property of the child process and disabling the SIGINT behavior in the cases where the child process gets it automatically?


Bump up joda-time version to resolve issue with JDK 8u60

The issue is described here:
https://discuss.gradle.org/t/fetching-artifacts-from-s3-backed-repository-fails-with-jdk8u60/11298
https://issues.gradle.org/browse/GRADLE-3338
Simply bumping up the version of joda-time has worked for me.

Thanks @jasonxh would you mind signing the CLA? http://gradle.org/contributor-license-agreement/

Thanks @big-guy. I've signed the CLA

@jasonxh Since we're doing another RC for 2.7, this has been backported and will be released in 2.7.


AddUsing tweak doesn't traverse same-level anon namespaces

a.cc:
namespace ns { struct Foo; struct Bar; }
namespace { using ns::Foo; }

void foo() { ns::^Foo *f; ns::^Bar *b; }

Triggering action on first point should only drop the qualifier and second one should insert the using decl into the anon namespace.

I use clangd every day and very interest in it. I would like to contribute to clangd.
I've fixed this issue and added test cases, but I'm not sure if my fix is a best practice, will submit my patch later.

https://reviews.llvm.org/D156441


Outdated content / link.

Ansible's site says that the contrib version of the azure_rm.py script referred to in the link here is deprecated and that people should prefer the new one they provide.
I think the examples need to be updated for that.

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

ID: d2b8e92b-a339-3869-9c78-e99cb04b94ee
Version Independent ID: f26cb51b-3a0f-ff82-1b92-03084b52fd56
Content: Use Ansible to manage your Azure dynamic inventories
Content Source: articles/ansible/ansible-manage-azure-dynamic-inventories.md
Service: ansible
GitHub Login: @TomArcher
Microsoft Alias: tarcher

hello @johnwhumphreys
thanks for the feedback, I have assigned this to the author for any possible update
best

Thank you for the prompt response; I look forward to the updated documentation as I’ve had trouble finding alternate sources online (that are complete).

On Dec 28, 2018, at 5:47 PM, Diego Ramirez<EMAIL_ADDRESS>wrote:
hello @johnwhumphreys
thanks for the feedback, I have assigned this to the author for any possible update
best
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.


Failed to apply :id constraints to member action.

I wan the :id property accept dots inside url, for example, http://dev:3000/admin/namespace~model/a.b.c can be routing correctly to the rails main controller.
However, the following statement in rails application doesn't work for my case,
mount RailsAdmin::Engine => '/admin', :as => 'rails_admin', constraints: { id: /[\w+.]+/ }
Meanwhile, if I modify the source code in "RailsAdmin::Engine.routes.draw" to be this one,
RailsAdmin::Config::Actions.all(:member).each { |action| match "/#{action.route_fragment}", action: action.action_name, as: action.action_name, via: action.http_methods, id: /[\w+.]+/ }
It works correctly. Anyone has a better solution to apply this change on the rails application routes?

This is rather a question on Rails routing, not an issue of RailsAdmin.


First-class support for systems of equations

@siwelwerd has a solution for masterit-tbil-la -- maybe worth bringing upstream?

See https://github.com/StevenClontz/masterit-tbil-la/blob/51ba26fa5d0998b469d46463097da49c1f68cffb/common.sage#L115
It takes a matrix as an argument, because that's what we always have handy in linear algebra. Not sure how general you want to go here.
Also PreTeXt is really finicky with these, so right now the PreText code has to look like
    <md alignment="alignat">                 <xsl:attribute name="alignat-columns"><xsl:value-of select="alignCols"/></xsl:attribute>               <xsl:for-each select="system/*">                 <mrow><xsl:value-of select="."/></mrow>               </xsl:for-each>     </md>
I am wondering if the better way is to have the template not be purely valid PreText, but allow for a tag like
<system><xsl:value-of select="system-name"></system>. But I think this would require writing a pretext.xsl file to handle the  and turn it into valid PreTeXt (as above).

I think the most portable solution is to rig up something that works inside LaTeX displaymath mode, e.g. \[ \begin{foo}...\end{foo} \], just like a matrix is \[\begin{matrix}...\end{matrix}\]. Then we'd simply represent it as <me><xsl:value-of select="system"/></me>, which is valid PreTeXt.
Perhaps a matrix that doesn't have brackets could be used? \begin{matrix} x & + & y & = & 1 \\ ... \end{matrix}

Closed in 41a2e576fc0cf83e97d1f5e2bba6482192bfe97d -- I gave @siwelwerd coauthor credit as it was modified from masterit-tbil-la/common.sage.
The system is built as a matrix, so usage is simple: <me><xsl:value-of select="system"/></me>.
Drew - you could exchange your custom Sage object's _latex_ method to call this function.

Place for improvement: reduce spacing between columns (in a way that works locally, in LaTeX, MathJaX, CodeCogs, etc.).


UnsafeGuaranteedPeephole should handle virtual_method calls

Make the peephole stronger to handle retain(self), apply(self), release(self)
pairs inbetween unsafeGuaranteed pairs.
rdar://30948468

@swift-ci Please test


[Issue]: Not compatible with tags

Plugin Version
v0.0.2
Logseq Version
v0.9.2
What browsers are you seeing the problem on?
MacOS
What happened?
As the title suggests, if I have a block like this '#test some text', the imported entry in things is empty, then, same thing happened for in-line tags, anything after the #tag is not sent to things either, also the block link misses.
Also, it seems that the graph name logseq://graph/logseq? is hard coded as "logseq" instead of the current graph.

Should be fixed in latest version.

It works now! Thanks for responding and fixing this so quickly!

Hi, I also wanted to ask about a new feature,  any plan to support keyboard shortcuts and/or add an entry in the command palette in Logseq (command+shift+P)?

Hi, I also wanted to ask about a new feature, any plan to support keyboard shortcuts and/or add an entry in the command palette in Logseq (command+shift+P)?

Do create a new issue for this. Thanks!


feat: fastly compute service to perform assignments (FF-3552)

Motivation
Eppo is launching a server-based assignment service hosted on the Fastly Compute platform. This is an edge-product that makes
Design details available in the internal doc.
PR goals

Create a service that is able to respond to POST /assignments with a subjectKey and subjectAttributes and return assignments for active allocations.

PR non-goals
This work does not include integration testing or CICD integration beyond compilation. This functionality will be added before a 1.0.0 release in the coming weeks.
Description

Service responds to requests on GET /health and POST /assignments?apiKey - the apiKey format is re-used for legacy reasons although the marketing copy is SDK Key.
The incoming apiKey is converted to a hash and used to look up items in the attached KV store. An external process populates the KV store on Flag changes.
The handler performs assignment across all available flags in series and returns the ones with success evaluation. Any errors in evaluation are logged and the flags are not included in the response.

@sameerank I'm going to merge this PR even though we still have some feedback from Oleksii and improvements I pointed out in the comments; the do_log issue is most pressing to figure out.


Fetch

Why do commits from previous branches appear here? Can I do get rebase -i origin/master and remove them without interfering with anything?


chore: release 1.2.115

:robot: I have created a release *beep* *boop*
1.2.115 (2022-06-15)
Bug Fixes

bundles: cleanup --final-repo param usage in bundles (4d77117)
docs: add info about published rock-solid images (9b09593)
final-repo: service values .Values.werf.repo should use --final-repo instead of --repo (e0562f6)
helm: fix werf panic and helm plugins with error codes (a39a1a0)

This PR was generated with Release Please. See documentation.

:robot: Release is at https://github.com/werf/werf/releases/tag/v1.2.115 :sunflower:


[REQUEST]Function to decode HS256 algorithm

Sir,
Kindly include to decode HS256 algorithm in new update of Openbullet, please.
Regards.
jaygit

Do you really need to decode it?
I bet you only need it for JWT - in that case just parse the part between the 2 dots and do a FUNCTION Base64Decode on it

Decoding HMAC SHA-512? Right, cause one can do that ^_^


Improve Footer Section

Footer section is not aligned properly and does not look good . I can make it look good  .

assign this issue to me.

@subhashis2204 actually I am getting an error in my terminal when I am running the code . How can I fix the issue

Okay noted. I guess this is due to the azure storage api key. I will get back to you when I resolve this.  I guess this is due to the azure storage api key. I will get back to you when I resolve this. Give me some time.
no problem will wait until then.

Okay noted. I guess this is due to the azure storage api key. I will get back to you when I resolve this. Give me some time.

@subhashis2204 actually I am getting an error in my terminal when I am running the code . How can I fix the error

@subhashis2204 is it sovled???????????///

hey @parthpathakpp1 I have reaslized what is the problem. This project uses some third party services like azure, sendgrid mail and mongodb atlas db to work properly. You are getting this error since you don't have the api keys of those services in your local. So when you are running the project you are getting this error because node is searching for those keys.
The way for fixing this is to either acquire all api keys. Or what you could do is go the views/partials/footer section and just edit the EJS file as a normal html file and check it. Keep the pattern same. Once you are done raise a PR. I will review it and if it is fine I would merge it. :)

hey @parthpathakpp1 I have reaslized what is the problem. This project uses some third party services like azure, sendgrid mail and mongodb atlas db to work properly. You are getting this error since you don't have the api keys of those services in your local. So when you are running the project you are getting this error because node is searching for those keys.
The way for fixing this is to either acquire all api keys. Or what you could do is go the views/partials/footer section and just edit the EJS file as a normal html file and check it. Keep the pattern same. Once you are done raise a PR. I will review it and if it is fine I would merge it. :)

ok @subhashis2204

@subhashis2204 I raised a PR for this . Please check https://github.com/subhashis2204/project-annapurna/pull/46


Fixes for integration tests and go modules

Breaking down https://github.com/giantswarm/chart-operator/pull/542 which has got a bit big.

Minor changes. Going with a ping.


SP5,Avalonia: Can not update as code, and can not interactive and update until right click

Bug Report
Issue: (Bug description goes here)

can not update on some sp5 view
can not interactive

Reproducing: (What do others have to do to reproduce the bug?)
100% in avalonia

There is the reproduce project
AvaloniaApplication3.zip
System Details

ScottPlot Version: 5.0 latest
Operating System: Windows 11
Application Type: Avalonia
.NET Version: NET7/8

Hi @heartacker,
That zip contains a lot of files! Is it possible to create a smaller reproducible code example demonstrating the issue? Alternatively a little video using https://www.screentogif.com/ may be helpful.
If there aren't any updates on this issue in several days I'll close it, but I'm happy to re-open it whenever progress is made toward a solution 👍
MainView.axaml.cs
using Avalonia.Controls;
using ScottPlot;
using System;

namespace AvaloniaApplication3.Views;

public partial class MainView : UserControl
{
    public MainView()
    {
        InitializeComponent();
    }

    private void Button_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
    {
        Random rd = new Random();
        var len = rd.NextDouble() * 1000;
        double[] sin = Generate.Sin((int)len, 2);
        double[] cos = Generate.Cos((int)len);

        a10.Plot.Clear();
        a11.Plot.Clear();
        a20.Plot.Clear();

        a10.Plot.Add.Signal(sin);
        a11.Plot.Add.Signal(cos);

        a20.Plot.Add.Signal(sin);
        a20.Plot.Add.Signal(cos);

        a10.Plot.AutoScale();
        a11.Plot.AutoScale();
        a20.Plot.AutoScale();

        a10.Refresh();
        a11.Refresh();
        a20.Refresh();

    }
}

Note that this code does work on WinForms

using ScottPlot;

namespace SP5SandboxWinForms;

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        formsPlot1.Plot.Clear();
        formsPlot2.Plot.Clear();
        formsPlot3.Plot.Clear();

        formsPlot1.Plot.Add.Signal(Generate.Sin(1000, phase: Random.Shared.NextDouble()));
        formsPlot2.Plot.Add.Signal(Generate.Sin(1000, phase: Random.Shared.NextDouble()));
        formsPlot3.Plot.Add.Signal(Generate.Sin(1000, phase: Random.Shared.NextDouble()));

        formsPlot1.Plot.Add.Signal(Generate.Sin(1000, phase: Random.Shared.NextDouble()));
        formsPlot2.Plot.Add.Signal(Generate.Sin(1000, phase: Random.Shared.NextDouble()));
        formsPlot3.Plot.Add.Signal(Generate.Sin(1000, phase: Random.Shared.NextDouble()));

        formsPlot1.Plot.AutoScale();
        formsPlot2.Plot.AutoScale();
        formsPlot3.Plot.AutoScale();

        formsPlot1.Refresh();
        formsPlot2.Refresh();
        formsPlot3.Refresh();
    }
}

Hi @heartacker,
That zip contains a lot of files! Is it possible to create a smaller reproducible code example demonstrating the issue? Alternatively a little video using https://www.screentogif.com/ may be helpful.
If there aren't any updates on this issue in several days I'll close it, but I'm happy to re-open it whenever progress is made toward a solution 👍
MainView.axaml.cs
using Avalonia.Controls;
using ScottPlot;
using System;

namespace AvaloniaApplication3.Views;

public partial class MainView : UserControl
{
    public MainView()
    {
        InitializeComponent();
    }

    private void Button_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
    {
        Random rd = new Random();
        var len = rd.NextDouble() * 1000;
        double[] sin = Generate.Sin((int)len, 2);
        double[] cos = Generate.Cos((int)len);

        a10.Plot.Clear();
        a11.Plot.Clear();
        a20.Plot.Clear();

        a10.Plot.Add.Signal(sin);
        a11.Plot.Add.Signal(cos);

        a20.Plot.Add.Signal(sin);
        a20.Plot.Add.Signal(cos);

        a10.Plot.AutoScale();
        a11.Plot.AutoScale();
        a20.Plot.AutoScale();

        a10.Refresh();
        a11.Refresh();
        a20.Refresh();

    }
}

hi you can download the zip file and  build
the desktop app
this is the reproduct demo
there is only one windows view

@swharden hi, this is gif,
as shown

right click
resize window

can only trigger updating

@swharden is this a bug?
can you point me out if easy to fix

Hi @heartacker, I've been working a lot over the last few days on this issue. The core problem here is that OpenGL causes issues when it's used to display multiple controls in the same window. I'm working toward a solution in #3008 and #3006 and will share what I find later today in #3009. I'm pretty sure this will fix the issue described here, but I welcome your feedback once it's complete!
I'll follow-up later today or tomorrow 👍

Hi @heartacker, I think this issue has been resolved and I'm going to publish a new NuGet package today so you can check it out. If the issue persists, we can re-open this issue 👍

Hi @heartacker, I think this issue has been resolved and I'm going to publish a new NuGet package today so you can check it out. If the issue persists, we can re-open this issue 👍

Can't wait to try it.


Formatter changes order of comments.

class Foo:
    # comment 1
    @abstractmethod
    def foo(self) -> None: ...
    @abstractmethod
    def bar(self) -> None: ...
    # comment 2

    # comment 3
    def baz(self) -> None:
        return None
    # comment 4

becomes
class Foo:
    # comment 1
    @abstractmethod
    def foo(self) -> None: ...
    @abstractmethod
    def bar(self) -> None: ...

    # comment 3
    # comment 2
    def baz(self) -> None:
        return None

    # comment 4

[ruff-playground]

Comments 2 and 3 get swapped.
An extra space is inserted after def bar. Since these are stubs, no space should be inserted. (for instance, comment 1/2 can be  # region/#endregion). But this is just my opinion.

You're good at finding comment reordering bugs and thank you so much at taking the time to report them!
Uhh, the second one is really bad. Let me have a look.

To make it worse, this is not even related to classes nor does it require decorators. https://play.ruff.rs/2bcde006-72e6-409f-9fa9-659ef78d7944

I would suspect this is somehow related to special logic for formatting stub implementations https://github.com/astral-sh/ruff/issues/8357

Yeah, that's a great observation. The issue is that, for stubs, we don't write extra empty lines between the comment and the next function, which drips over the formatting.

@randolf-scholz thanks for debugging this together. The fix turned out to be not that bad :)


Fixed local dev server link

I'm not a project approver but this looks good to me, so I filed https://github.com/tenable/terrascan/issues/1384 to try to get the devs attention to approve and merge this.


[Upbit] Add

add upbit exchanges.

@water0126 hello is you do support of trades services wrappers for make orders?


Disable Templating

Hey there 😺,
I've noticed that the README says, that Templating is optional. I am therefore guessing that it can be disabled. If that is the case, how?
Thank you for your help!

Templating cannot be disabled. You can simply not use variables in your dotfiles to obtain that.  Bombadil will still symlink a copy of your dotfile though.
I am planning to implement an option to directly symlink files without copy but it is not there yet. :)

Alright, thank you for clarifying! Love this project so far keep the work up!💪


Issues in the Class Scheduling example (class-scheduling.rs)

First of all, I want to say I think this example code is extremely valuable. Many details of using the library are non-obvious after reading the documentation, and a "hello world" example would definitely not be enough. It's also helpful to be able to compare the Rust code with the Python equivalent from the official documentation.
These two bugs don't cause obvious failures when running the code unmodified, because get_available_classes() is unlikely to be called, and transaction conflicts are rare, but they show up immediately if you reduce the class count and seat count both to 2:

get_available_classes() unpacks the keys as single strings, but they are tuples of two strings (subspace prefix and class name) so it will always fail
The Transaction::get() calls are passing snapshot=true, so the transactions don't get canceled and retried if there is a conflict, and the class counts are not atomically decremented; you end up with too many students per class.

This relates to #71 and #72:

Example code uses get_range() instead of get_ranges_keyvalues(), which is not recommended, and it's confusing (what does the iteration=1_024 parameter do?)

Also:

main() function does not drop(_guard) as advised elsewhere.
Code uses Subspace in some places, and just tuples in other places, which is confusing when comparing with the Python version.
Issue with the logic for the switch operation: if the student is already in the new class, signup_trx returns Ok(()), but the old class is still "ditched". Would it be good to use this as an example of how to cancel a transaction?
There are a couple of code comments that I guess relate to internals of the library (or an early version of it?) and don't make much sense to someone new to the project.

The Transaction::get() snapshot=true issue is by far the most serious, since it could cause hard-to-spot bugs if someone copies and pastes into their own code.

The other big issue is that it is running most of the code using futures::executor instead of Tokio, even though Tokio runs the main() function.
It scared me when I finally noticed that, because I thought it meant that the library is not fully compatible with Tokio, but I think it can be fixed easily (unless there are other factors I'm not aware of).
Perhaps in the past the asyn functions for updating the database were returning non-Send futures, which necessitated this as a workaround?
The code is using Database::transact_boxed_local() instead of transact_boxed(), which would make sense if the closure being executed returns a non-Send future. But if that was the case with earlier versions of the library, it is no longer true -- ditch_trx, signup_trx, and switch_classes_body return Send futures now.
After changing the code to use transact_boxed(), and avoiding storing/passing rand::thread_rng() (which obviously is not Send!), all the futures are Send, so it is compatible with the multithreaded executor.
Can now change:
    threads.push((
        i,
        thread::spawn(move || {
            futures::executor::block_on(simulate_students(i, ops_per_student));
        }),
    ));

To:
    threads.push((
        i,
        tokio::task::spawn(simulate_students(i, ops_per_student))
    ));

(and update related code to use tokio::task::JoinHandle instead of thread::JoinHandle)

Thanks for the issue!
You are right, the class-cheduling needs to be rewritten. Efforts are mainly tracked by #59. Would you like to start working on it?
I don't have much time to work on this, as I'm debugging #74 for now.

Yes, I should be able to fix the issues I listed above.
Note that the 0.7.0 documentation links to the examples folder, so for now it's important for the examples to work with just the 0.7.0 API (which might prevent #59 from being done until after the next release).

I created a Gist of the updated code here, because it looks like the code in the PR will include changes that are not compatible with 0.7.0:
https://gist.github.com/kaiavintr/d0ec26f380a7dce7c5aa15e5e70ac93a


Animal Trainer Animal Companions not implemented.

It looks like Animal Trainer ACs (ATAC) are not currently implemented correctly in pf2e-animal-companions.
ATACs lose their species skill and replace it with training in performance.
ATACs have a unique Mature Companion feature that makes them expert in performance.

The repository for that module is at https://github.com/TikaelSol/PF2e-Animal-Companions


keep comment with target method

@codeclimate/review @pbrisbin This PR fixes the placement of a comment that I'd separated from target method.

LGTM


[component] Support form

Current Behavior

Desired Behavior

Implementation

Acceptance Tests

Mockups

Contributor Guide

🎨 Wireframes and designs for Layer5 site in Figma (open invite)

can you please assign me this issue. I want to implement it

This will use the rjsf scehma so not required for another custom form


title_view in PM::TableScreen doesn't work

Hi!
I am trying to style a PM::TableScreen according to my client design specs.
The title_view command isn't working, I generated a new view using potion create view.
LineListScreen.rb
class LineListScreen < PM::TableScreen
  title_view Title.new
  refreshable
  searchable placeholder: "Search"
  stylesheet LineListScreenStylesheet
  include API

  def on_load
    @table_data = []
    load_async
  end

  def load_async
    get_lines do
      @lines = Line.all.to_a
      @table_data = [{
        cells: @lines.map do |line|
          {
            title: line.name,
            subtitle: "phone number"
          }
        end
      }]
      stop_refreshing
      update_table_data
    end
  end

  def on_refresh
    load_async
  end

  def table_data
    @table_data
  end

end

Title.rb
class Title < UIView

  def on_load
    apply_style :title

    append UILabel, :virtualq
  end

end

LineListScreenStylesheet.rb
class LineListScreenStylesheet < ApplicationStylesheet

  include TitleStylesheet

  def setup

  end

  def root_view(st)
    # st.superview.superview.frame = {l: 0, t: 0, w: 375, h: 648}
    # st.superview.superview.background_color = color.virtualq
    st.background_color = color.vq_gray
    # mp st
  end
end

TitleStylesheet.rb
module TitleStylesheet

  def title(st)
    st.frame = {l: 0, t: 0, w: 375, h: 64}
    st.background_color = color.virtualq
    # Style overall view here
    mp st
  end

  def virtualq(st)
    st.frame = {l: 0, t: 0, w: 375, h: 64}
    st.text_alignment = :center
    st.text = "virtualQ"
    st.background_color = color.virtualq
    st.font = font.medium_small
    mp st
  end

end

As far as I can tell, Title.rb's on_load never gets called. The TitleStylesheet also never gets called.
Am I doing it wrong?

hi @jsilverMDX can you try to change your LineListScreen to be like this?
class LineListScreen < PM::TableScreen
  title_view build!(Title)
....

by doing this, you will use RMQ to build the view, which will call rmq_build which should enforce that on_load is fired.  Otherwise, like you said, there really is nothing to tell a view to fire on_load (from what I recall...)

thanks @squidpunch
I tried it and get the following
2015-06-11 13:06:13.603 virtualq-potion[91599:4134849] *** Terminating app due to uncaught exception 'NoMethodError', reason: 'undefined method `build!' for LineListScreen:Class (NoMethodError)

interesting, its probably because this is a class level method so it doesnt know how to use build at that level (and might be troublesome because it might not know the stylesheet etc

I will see if there is a way to make this work smoother

but before that, how about this as a work around - does this work?
class LineListScreen < PM::TableScreen
title_view Title.new
...
  def on_load
    self.navigationItem.titleView.on_load
    # or you may you could even set the title view here with
    # self.class.title_view build!(Title)
    ....
  end

I'd definitely consider this just a work around, and will see if we can make this work as we would expect instead of having to do it in this round about way...

Yeah, you always want to use append, create, or build to build views. If you don't, non of the stylesheet system will work. We should change title_view in PM::TableScreen to do that.
For now, just set your title view in the onload. I didn't look it up, but something like:
title_view = create(Title, :title)

yeah I'd probably use the example @twerth gave for now until we can get this patched up.
I think you'd want to remove the title_view from the top, and add self.class.title_view create!(Title)
This should play nicely and fire the on_load for you.

title_view is a PM::Screen thing -- and yeah, we should detect if RMQ is present and use build!.

title_view = create(Title, :title)
self.navigationItem.titleView = title_view.get

I was able to load Title view using this code.
But the result is not exactly perfect, there's an offet. I am not sure why.
http://cl.ly/image/2a1D0O0H2U3V
Interestingly, when I tried using title_image, a similar sort of thing happened with the offset.
Am I doing something wrong in here?
module TitleStylesheet

  def title(st)
    st.frame = {l: 0, t: 0, w: 375, h: 64}
    st.background_color = color.virtualq
    # Style overall view here
    mp st
  end

  def virtualq(st)
    st.frame = {l: 0, t: 0, w: 375, h: 64}
    st.text_alignment = :center
    st.text = "virtualQ"
    st.background_color = color.virtualq
    st.font = font.medium_small
    mp st
  end

end

Your cloudapp URL doesn't work

Sorry about that.
http://cl.ly/image/41030v1d3O3e

@jsilverMDX if I can squeeze in sometime soon I will see if I can figure out what's going on here (sorry for the delay...)

@squidpunch thanks! much appreciated :+1:

@jsilverMDX I was able to recreate this, but I wonder if it's actually a bug on any of the gems side..
Googling around a bit and it looks like this is just something like the UINavigationBar trying to position this view "properly"  I think by default they don't think you want to go behind the status bar etc
I am guessing that you want to do a goldish background with the text in the center (that fills to the top including the status bar, etc)
I think you might want to try and handle this without a custom view (or at least one that doesnt do the background color) maybe with navigationBar.barTintColor or backgroundImageForBarMetrics to cover the background colors.

that seemed to work well.
what I did exactly:
  def setup
    # setup navigation bar
    text_attrs = {NSFontAttributeName => font.medium_small, NSForegroundColorAttributeName => color.vq_black}
    self.controller.navigationItem.navigationBar.barTintColor = color.virtualq
    UINavigationBar.appearance.setTitleTextAttributes(text_attrs)
  end

in a stylesheet file. works well. it might be nicer to add some ruby abstraction for this though.

Just out of curiosity, how would I "pull" the table view up a little bit? The design calls for some orange background... http://cl.ly/image/360w472m2n1H and I'm not really sure how to pull it up and dye that orange. I was able to pull stuff up with RMQ in sort of an ugly way... but could never figure out how to apply the color. Thanks for all the help so far! Right now, the list goes all the way down. http://cl.ly/image/3F2U3H1j342t But we're getting closer! :+1:

someone may have a different way to tackle this, but I think what I'd end up doing is the following.
1 - use a regular screen (instead of a table screen)
2 - append a UITableView to it that has a height of X units shorter than the screen
3 - append the footer view that is X units high, below the table
this keeps the footer at the bottom of the screen.  Another option is tableFooterView but as that implies, its the footer of the table - so if you only have 1 item, the footer would not be at the bottom of the screen, and with many items the footer would be below the fold.

I'm not sure if it will work, but you can try contentInset.

I actually wouldn't mind adding another screen type, like PM::PartialTableScreen, that allows you to place the table as a subview anywhere but otherwise acts as a normal screen. Wouldn't be hard to do.

Heads up if you head that way.
iOS wants your table view to actually live in a UITableViewController because of focus control with your UITextFields and the keyboard.
UITableViewController is a silent workhorse.  When your field gains first responder, the table scrolls to the right place to display.
It takes into account:

the size of the field
any UITabBarController tab bars
any UINavigationController navigation bars
any UINavigationController toolbars
the keyboard size
any inputAccessoryViews attached to the keyboard

You can try your luck with UIScrollView’s scrollRectToVisible:animated: but that way lies madness.
I went there.  I was sobbing in the fetal position for days.

@jamonholmgren that does sound like it would work. I will try some of these suggestions later as well just for fun. The main thing that sells me with PM::TableScreen is the ability to easily drop in a lot of stuff I need like "searchable", "refreshable" really easily and all of the other syntactic sugar. @skellock that doesn't sound good. Probably better if we stick to the UITableViewController based screen for now. Especially because functionality is more important to us right now than design, thankfully. I would rather just use RMQ to "nip" the table up a little bit and just drop something orange behind it. If that would work.

@skellock makes valid points for sure, it totally depends on what your table is doing - I actually have used this pattern in my app quite a bit (a table view inside a UIViewController) etc.
@jamonholmgren I like that idea :+1:
but yeah there are definitely some things to consider depending on what you are doing with your table view.

Ya ignore what I said if you don't have NSResponder-based fields.   Sorry to sound preachy or doom & gloomy.
Another potential option is you're inside a UINavigationController is adding your own custom toolbar subclass.
class DockingToolbar < UIToolbar

  attr_accessor :height

  def sizeThatFits(size)
    super_size = super
    super_size.height = @height || 100
    super_size
  end

end

And inject that sucker in:
navigation_controller.toolbar = DockingToolbar.new

Now at this point, it's important to remember your toolbar lives outside your screen, so as you push & pop, that thing is going to linger there.
Each screen can opt-out to this toolbar tho by hooking
def will_appear
  navigation_controller.setToolbarHidden true, animated: false
end

What's neat is here is:  the transition animation of UINavigationController does the right thing.  It actually looks like the toolbar is part of the screen.

In our app, our client uses this bottom area very frequently as if it were a fixed toolbar.  I also swap UIButtons in & out of this area per-screen too.
But in your case, if you can find a better way and not have to write the above code, you should.
It took me 6 attempts to get that solution and I still feel like there still could be a better way.
Good luck champion!

definitely wasnt trying to steer you away from @skellock's tips.  I might have to bug him more often for solutions on my own problems :)

Here's an API idea. Using RedPotion so I have RMQ available.
class MyScreen < PM::PartialTableScreen
  title "Normal title"
  stylesheet MyScreenStylesheet

  def table_data
    [{ cells: [{ title: "Normal table_data" }] }]
  end

  def on_load
    self.view # => UIView
    self.table_view # => UITableView
    find(:table_view) # => UITableView
  end
end

class MyScreenStylesheet < ApplicationStylesheet
  def table_view(st)
    st.frame = { top: 100, height: 200, centered: :horizontal }
  end
end

@skellock, I tried it, and the code ran. but I wasn't able to add the toolbar to the screen. Don't know why.
@jamonholmgren it's not a bad idea, it gets the job done using a predictable api.
Ideally I'd like to just add maybe one more view under the table view, turn it orange, and just call code to change the frame of the TableView. is that possible? but I agree with Jamon that it is confusing to get a table view screen generated which is hard to style. if you guys need to take your time on this, that's fine, I can move on. it's not a blocker at all. thanks.

Good deal @jsilverMDX . Thanks for your input on this.

@twerth just an update. I tried "rmq(UIScrollView).get.contentInset = UIEdgeInsetsMake(0, 0, 19, 30)" in console, and while it ran, nothing seemed to happen.

Closing due to inactivity.


Crash on startup. Possibly lack of Baubles (not available for 1.11)

http://pastebin.com/SzxFbU2A
Forge <IP_ADDRESS>8
Convenient 1.0.12 build 16
The rest: http://i.imgur.com/nyMjn9T.png

My API folder was meant to be compiled into the mod but wasn't. I'll have to look into gradle a bit but it should be fixed in the next build.

I might release a quick and dirty fix tomorrow evening(UTC+1). Because I have already worked on some new features locally I gotta tie up some loose ends first. However, I should be able to do it easily after school tomorrow. For now I'll go to bed(11.39pm)

thank you for getting to the bottom of this :)

The latest build(v.1.0.13-build20) shouldn't throw any errors now. Tested in a clean Minecraft instance as well as with Baubles and JEI and should work for now. However, JEI integration for the Tome of Transmutation doesn't seem to be working as documented in #4. And no, I unfortunately will not maintain 1.10.2 anymore because of lack of time.
Anyways, I want to thank both of you for reporting the bug and I hope you have a nice day!


Cannot use React HTML Helper - MVC 4 ReactJS.Net Tutorial

When trying to use the @Html.React helper method, I get the following error:
Error	CS0119	'HtmlHelperExtensions.React(HtmlHelper, string, T, string, string, bool, bool, string, Action<Exception, string, string>)' is a method, which is not valid in the given context	ReactExamplePractice	D:\ReactExProject\ReactExamplePractice\ReactExamplePractice\Views\Shared_Layout.cshtml
Granted, I am writing in a layout file, deviating slightly from the tutorial, but I wouldn't think that would matter. I am following the tutorial here:
https://reactjs.net/getting-started/tutorial_aspnet4.html
I have a Stack Overflow on this, and I've tried digging through what renders HTML helpers, and can't find anything valid that would help me here. I've tried ensuring that references such as System.Web.Optimization was being used, along with React.Web.Mvc, etc.
Am I actually missing something? Or can something be updated per the aspnet4 tutorial? Does anyone have a working example of THIS tutorial (rather than the ASP.NET Core) tutorial that I can actually compare with to be sure it isn't something that I did wrong?
Is there perhaps a code break or something to also be aware of? I was able to follow the asp.net MVC 4 tutorial up to the very last optimization section with success after fixing some mistakes I made. Here, though, I feel I am stuck. I CAN use the tutorial source code to run the ASP.NET CORE tutorial, even though I am trying to follow that one and find that after following a suggestion to alter my Startup.cs file per @ShikiGami.
Can anyone tell me what I'm doing wrong??? I'm willing to provide my whole project for review if needed.

Have you looked at the mvc4 sample in this repo?
On Tue, Sep 18, 2018 at 20:20, kojakangas<EMAIL_ADDRESS>wrote:

When trying to use the @Html.React helper method, I get the following
error:
Error CS0119 'HtmlHelperExtensions.React(HtmlHelper, string, T, string,
string, bool, bool, string, Action<Exception, string, string>)' is a
method, which is not valid in the given context ReactExamplePractice
D:\ReactExProject\ReactExamplePractice\ReactExamplePractice\Views\Shared_Layout.cshtml
Granted, I am writing in a layout file, deviating slightly from the
tutorial, but I wouldn't think that would matter. I am following the
tutorial here:
https://reactjs.net/getting-started/tutorial_aspnet4.html
I have a Stack Overflow on this, and I've tried digging through what
renders HTML helpers, and can't find anything valid that would help me
here. I've tried ensuring that references such as System.Web.Optimization
was being used, along with React.Web.Mvc, etc.
Am I actually missing something? Or can something be updated per the
aspnet4 tutorial? Does anyone have a working example of THIS tutorial
(rather than the ASP.NET Core) tutorial that I can actually compare with
to be sure it isn't something that I did wrong?
Is there perhaps a code break or something to also be aware of? I was able
to follow the asp.net MVC 4 tutorial up to the very last optimization
section with success after fixing some mistakes I made. Here, though, I
feel I am stuck. I CAN use the tutorial source code to run the ASP.NET
CORE tutorial, even though I am trying to follow that one and find that
after following a suggestion to alter my Startup.cs file per @ShikiGami
https://github.com/ShikiGami.
Can anyone tell me what I'm doing wrong??? I'm willing to provide my whole
project for review if needed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/reactjs/React.NET/issues/599, or mute the thread
https://github.com/notifications/unsubscribe-auth/AA5hFuiD8n6mdrKGATADrVWvhrpeezeQks5ucbgHgaJpZM4WvVsD
.

Hi Dustin,
No? It looks like the tutorial-code was written with ASP.NET Core in mind. Is there really a way I can compare? If it means anything, I'm using Visual Studio 2017. I know this site has said that the coding experience would be similar in 2017, but I'm still not convinced. Where's the first place to start in comparison here?

Can you give this project a look?
https://github.com/reactjs/React.NET/tree/master/src/React.Sample.Mvc4
On Wed, Sep 19, 2018 at 04:57, kojakangas<EMAIL_ADDRESS>wrote:

Hi Dustin,
No? It looks like the tutorial-code was written with ASP.NET Core in
mind. Is there really a way I can compare? If it means anything, I'm using
Visual Studio 2017. I know this site has said that the coding experience
would be similar in 2017, but I'm still not convinced. Where's the first
place to start in comparison here?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/reactjs/React.NET/issues/599#issuecomment-422774337,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA5hFkm0wBeWw8_2YZJ3uhD6xff1HKc3ks5ucjEvgaJpZM4WvVsD
.

Hi Dustin,
Looking at that seemed helpful, but I noticed something else - when following all of the steps of the tutorial, and ensuring that my Tutorial.jsx file would load in ReactConfig.cs, the HTML helpers would NOT be loadable. However, as soon as I closed my solution to open another one, and then opened the tutorial solution I have, the HTML helpers were in fact detected!
There's just one final thing. I can make the @Html.React like helper calls, but it appears nothing is mapping to the CommentBox being rendered by the server in my cshtml file. Can I get an idea on how I would pass the CommentBox from my Tutorial.jsx file? I've read about using the export method, but I can't use export default (default being a reserved keyword) and I'm not entirely sure I got down pat the export method for a component in the jsx file. If you feel I need to dig elsewhere, I understand.

I feel like I'm getting a step closer?
But it seems that even though I forgot to pass the comment model from the server, I fixed that in the Index ActionResult method per the tutorial, only to find that the CommentBox initially renders, but then does not retrieve divs from the server correctly afterward:
Warning: Expected server HTML to contain a matching
 in
.
I'm not sure what's really wrong at this point, can you fill me in? I have the following relevant files, I think:
Tutorial.jsx
//import React from 'react'
class CommentBox extends React.Component {
    constructor(props) {
        super(props);
        this.state = { data: this.props.initialData };
        this.handleCommentSubmit = this.handleCommentSubmit.bind(this);
    }
    loadCommentsFromServer() {
        const xhr = new XMLHttpRequest();
        xhr.open('get', this.props.url, true);
        xhr.onload = () => {
            const data = JSON.parse(xhr.responseText);
            this.setState({ data: data });
        };
        xhr.send();
    }
    handleCommentSubmit(comment) {
        const comments = this.state.data;
        // Optimistically set an id on the new comment. It will be replaced by an
        // id generated by the server. In a production application you would likely
        // use a more robust system for ID generation.
        comment.Id = comments.length + 1;
        const newComments = comments.concat([comment]);
        this.setState({ data: newComments });
        const data = new FormData();
        data.append('Author', comment.Author);
        data.append('Text', comment.Text);
        const xhr = new XMLHttpRequest();
        xhr.open('post', this.props.submitUrl, true);
        xhr.onload = () => this.loadCommentsFromServer();
        xhr.send(data);
    }
    componentDidMount() {
        window.setInterval(() => this.loadCommentsFromServer(), this.props.pollInterval);
    }
    render() {
        return (

Comments

                <CommentList data={this.state.data} />
                <CommentForm onCommentSubmit={this.handleCommentSubmit} />

        );
    }
}

class CommentList extends React.Component {
    render() {
        const commentNodes = this.props.data.map(comment => (
            <Comment author={comment.Author} key={comment.Id}>
                {comment.Text}
                </Comment>
            ));
        return (

                {commentNodes}

        );
    }
}

class CommentForm extends React.Component {
    constructor(props) {
        super(props);
        this.state = { author: '', text: '' };
        this.handleAuthorChange = this.handleAuthorChange.bind(this);
        this.handleTextChange = this.handleTextChange.bind(this);
        this.handleSubmit = this.handleSubmit.bind(this);
    }
    handleAuthorChange(e) {
        this.setState({ author: e.target.value });
    }
    handleTextChange(e) {
        this.setState({ text: e.target.value });
    }
    handleSubmit(e) {
        e.preventDefault();
        const author = this.state.author.trim();
        const text = this.state.text.trim();
        if (!text || !author) {
            return;
        }
        this.props.onCommentSubmit({Author: author, Text: text});
        this.setState({ author: '', text: '' });
    }
    render() {
        return (
            <form className="commentForm" onSubmit={this.handleSubmit}>
                <input
                    type="text"
                    placeholder="Your name"
                    value={this.state.author}
                    onChange={this.handleAuthorChange}
                />
                <input
                    type="text"
                    placeholder="Say something..."
                    value={this.state.text}
                    onChange={this.handleTextChange}
                />
                <input type="submit" value="Post" />
            </form>
        );
    }
}

class Comment extends React.Component {
    rawMarkup() {
        const md = new (global.Remarkable || window.Remarkable)();
        const rawMarkup = md.render(this.props.children.toString());
        return { __html: rawMarkup };
    }
    render() {
        return (

                    {this.props.author}

        );
    }
}

//module.exports = CommentBox

//const data = [
//    { Id: 1, Author: "Daniel Lo Nigro", Text: "Hello ReactJS.NET World!" },
//    { Id: 2, Author: "Pete Hunt", Text: "This is one comment" },
//    { Id: 3, Author: "Jordan Walke", Text: "This is *another* comment" }
//];

//ReactDOM.render(
//    <CommentBox url="/comments" submitUrl="/comments/new" pollInterval={2000}/>,
//    document.getElementById('content')
//);

Index file:
@model IEnumerable<ReactExamplePractice.Models.CommentModel>
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<EMAIL_ADDRESS>- My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

                <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#collapsibleNavbar">

                </button>
                @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })

                        @Html.ActionLink("Home", "Index", "Home", new { @class = "nav-link" })

                        @Html.ActionLink("About", "About", "Home", new { @class = "nav-link" })

                        @Html.ActionLink("Contact", "Contact", "Home", new { @class = "nav-link" })

        @Html.React("CommentBox", new
  {
    initialData = Model,
    url = Url.Action("Comments"),
    submitUrl = Url.Action("AddComment"),
    pollInterval = 2000
  })

        @RenderBody()

© @DateTime.Now.Year - My ASP.NET Application

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")

    @RenderSection("scripts", required: false)
    @Html.ReactInitJavaScript();

RouteConfig.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace ReactExamplePractice
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Comments",
                url: "comments",
                defaults: new { controller = "Home", action = "Comments" }
            );

            routes.MapRoute(
                name: "NewComment",
                url: "comments/new",
                defaults: new { controller = "Home", action = "AddComment" }
                );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}

HomeController.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.UI;
using React;
using ReactExamplePractice.Models;

namespace ReactExamplePractice.Controllers
{
    public class HomeController : Controller
    {
        private static readonly IList<CommentModel> _comments;

        static HomeController()
        {
            _comments = new List<CommentModel>
            {
                new CommentModel
                {
                    Id = 1,
                    Author = "Daniel Lo Nigro",
                    Text = "Hello ReactJS.NET World!"
                },
                new CommentModel
                {
                    Id = 2,
                    Author = "Pete Hunt",
                    Text = "This is one comment"
                },
                new CommentModel
                {
                    Id = 3,
                    Author = "Jordan Walke",
                    Text = "This is *another* comment"
                },
            };
        }

        [OutputCache(Location = OutputCacheLocation.None)]
        public ActionResult Comments()
        {
            return Json(_comments, JsonRequestBehavior.AllowGet);
        }

        [HttpPost]
        public ActionResult AddComment(CommentModel comment)
        {
            //Create the fake ID for the comment
            comment.Id = _comments.Count + 1;
            _comments.Add(comment);
            return Content("Success :)");
        }

        public ActionResult Index()
        {
            return View(_comments);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}

Any insights on this are appreciated!

OK, @dustinsoftware . I think I see the issue.
An interesting thing happens when I decide to render the React elements with "serverOnly" enabled:
@Html.React("CommentBox", new
  {
    initialData = Model,
    url = Url.Action("Comments"),
    submitUrl = Url.Action("AddComment"),
    pollInterval = 1000000,
  }, serverOnly:true)

Which is, the markup comes over JUST fine, but of course never updates, and I can't submit comments. This tells me that not only is the client component essential for the whole process to work, but it leaves this one question: how can I, in fact, ensure that the data being polled from the server as the client comes back the same as the data initially rendered by the server? The JSON coming from the server when it's being polled is correct and maps correctly when I revert to purely client side rendering.
It just seems that the data doesn't match when it initially renders from the server with the @Html.React helper. @Html.InitJavaScript() doesn't appear to completely help with this, either. Does @Html.React NOT render with JSON data to map initially?
How can I complete this missing gap?

@dustinsoftware
Even more interesting. When I print out the data being passed instead of the mapped data to comments like below:
class CommentList extends React.Component {
    render() {
        const commentNodes = this.props.data.map(comment => (
            <Comment author={comment.Author} key={comment.Id}>
                {comment.Text}
            </Comment>
        ));
        return (

                {this.props.data.toString()}

        );
    }
}

I see the following output on my page:
[object Object],[object Object],[object Object]
I definitely think the data being passed from the server is not the same as it would be if I just rendered client side. Any idea why that might be?

Turns out it was actually an issue with the Remarkable library from the tutorial. That section should be updated according to the previous post here:

Thanks so much for reporting this. I updated the tutorial in 5fc0b5129e7526a32a2c427b65eb882115cc6d19 so others don't get confused as well.


NUTS sampler broken

Summary:
It appears that the NUTS sampler is failing on a simple problem with a known solution.
Description:
I am sampling a 2D Gaussian with known parameters and not getting back the right variances or correlation coefficient.
Reproducible Steps:
I have put a test script in both python and R below. (Thank you to @wlattner for the R test!)
Here is the STAN model I am using
parameters {
  vector[2] z;
}

model {
  matrix[2,2] sigma;
  vector[2] mu;

  mu[1] <- 0.0;
  mu[2] <- 3.0;
  sigma[1][1] <- 1.0 * 1.0;
  sigma[1][2] <- 0.5 * 1.0 * 2.0;
  sigma[2][1] <- 0.5 * 1.0 * 2.0;
  sigma[2][2] <- 2.0 * 2.0;

  z ~ multi_normal(mu, sigma);
}

Current Output:
Here is an example output from the script. You can see the standard deviations and correlation coefficient are wrong. These are very long chains and so they should converge to the proper parameters with high precision.
pystan version: <IP_ADDRESS>
algorithm: NUTS
Inference for Stan model: TWOD_Gaussian_c1141a5e1a103986068b426ecd9ef5d2.
4 chains, each with iter=100000; warmup=10000; thin=1;
post-warmup draws per chain=90000, total post-warmup draws=360000.

       mean se_mean     sd   2.5%    25%    50%    75%  97.5%  n_eff   Rhat
z[0]-5.1e-4  1.9e-3   0.95  -1.89  -0.61 7.7e-4   0.61   1.88 235552    1.0
z[1]    3.0  3.9e-3    1.9  -0.77   1.77    3.0   4.23   6.77 234959    1.0
lp__  -1.48  2.3e-3   0.96  -4.09  -1.84  -1.18   -0.8  -0.57 179274    1.0

Samples were drawn using NUTS at Fri Dec 16 21:23:49 2016.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at
convergence, Rhat=1).
mean  : [ -5.08802129e-04   2.99765183e+00]
stddev: [ 0.94632959  1.89621228]
corr  : 0.44350873785

Expected Output:
I ran this example with standard HMC and it worked great.
pystan version: <IP_ADDRESS>
algorithm: HMC
Inference for Stan model: TWOD_Gaussian_c1141a5e1a103986068b426ecd9ef5d2.
4 chains, each with iter=1000000; warmup=100000; thin=1;
post-warmup draws per chain=900000, total post-warmup draws=3600000.

       mean se_mean     sd   2.5%    25%    50%    75%  97.5%  n_eff   Rhat
z[0] 6.7e-5  5.2e-4   0.99  -1.95  -0.67-1.8e-4   0.67   1.95  3.6e6    1.0
z[1]    3.0  1.1e-3   1.99  -0.92   1.66    3.0   4.34   6.91  3.6e6    1.0
lp__  -1.54  6.8e-3    1.0  -4.25  -1.92  -1.23  -0.83  -0.57  21903    1.0

Samples were drawn using HMC at Fri Dec 16 22:05:39 2016.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at
convergence, Rhat=1).
mean  : [  6.70100193e-05   2.99954982e+00]
stddev: [ 0.9930585   1.99452777]
corr  : 0.494629550818

Additional Information:
I have tested every version since 2.9.0 and only the NUTS sampler in 2.9.0 works properly. There were major changes to the NUTS sampler starting in v2.10.0. @bob-carpenter and @betanalpha worked on those. The tests of each version are attached, results.txt.
The python test script
#!/usr/bin/env python
import numpy as np
import pystan

# Define the model.
MU_X = 0.0
MU_Y = 3.0
SIGMA_X = 1.0
SIGMA_Y = 2.0
RHO = 0.5

stan_model = """\
parameters {{
  vector[2] z;
}}

model {{
  matrix[2,2] sigma;
  vector[2] mu;

  mu[1] <- {MU_X};
  mu[2] <- {MU_Y};
  sigma[1][1] <- {SIGMA_X} * {SIGMA_X};
  sigma[1][2] <- {RHO} * {SIGMA_X} * {SIGMA_Y};
  sigma[2][1] <- {RHO} * {SIGMA_X} * {SIGMA_Y};
  sigma[2][2] <- {SIGMA_Y} * {SIGMA_Y};

  z ~ multi_normal(mu, sigma);
}}""".format(MU_X=MU_X, MU_Y=MU_Y, SIGMA_X=SIGMA_X, SIGMA_Y=SIGMA_Y, RHO=RHO)
print("STAN model:\n\n%s" % stan_model)

# Compile it.
model = pystan.StanModel(model_code=stan_model, model_name='TWOD_Gaussian', verbose=True)

# Sample
alg = 'NUTS'
rng = np.random.RandomState(seed=5678)
fit = model.sampling(warmup=100000,
                     iter=1000000,
                     verbose=True,
                     n_jobs=4,
                     chains=4,
                     seed=rng,
                     algorithm=alg)

# Print stats.
print(' ')
print("pystan version:", pystan.__version__)
print('algorithm:', alg)
print(fit)
z = fit.extract()['z']
print("mean  :", np.mean(z, axis=0))
print("stddev:", np.std(z, axis=0))
print("corr  :", np.corrcoef(z.T)[0, 1])

The R test script
library(rstan)

rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())

stan_model <- "
data {
  real mu_x;
  real mu_y;
  real sigma_x;
  real sigma_y;
  real rho;
}

transformed data {
  vector[2] mu;
  matrix[2, 2] sigma;

  mu[1] <- mu_x;
  mu[2] <- mu_y;

  sigma[1][1] <- sigma_x * sigma_x;
  sigma[1][2] <- rho * sigma_x * sigma_y;
  sigma[2][1] <- rho * sigma_x * sigma_y;
  sigma[2][2] <- sigma_y * sigma_y;
}

parameters {
  vector[2] z;
}

model {
  z ~ multi_normal(mu, sigma);
}
"

stan_data <- list(
  mu_x = 0.0,
  mu_y = 3.0,
  sigma_x = 1.0,
  sigma_y = 2.0,
  rho = 0.5
)

fit <- stan(model_code = stan_model, data = stan_data, seed = 5678,
            algorithm = "NUTS", warmup = 100000, iter = 1000000, chains = 4,
            verbose = TRUE)
print(fit)

z <- extract(fit, pars = c("z"))[["z"]]
cat("",
  "mean  :", apply(z, 2, mean), "\n",
  "stddev:", apply(z, 2, sd), "\n",
  "corr  :", cor(z[, 1], z[, 2]), "\n",
  "\n",
  "stan version:", stan_version(), "\n"
)

Current Version:
v2.13.1

I'd suggest reading the Stan manual for examples of how to fit multivariate models.  Short answer is that you need to declare the mean and covariance matrix as parameters.  And you need to measure calibration with posterior coverage, not point estimates.  The Cholesky factor parameterization is much more efficient.

Sorry --- read that too quickly.  You're only trying to make multivariate draws, which should work as coded.

There is a small bug in sampler but your results do not demonstrate that.  The problem is that you can't argue that expectations are off without quantifying how off they can be due to typical MCMC standard error.  To properly demonstrate the issue we need a model that computes the variances and correlation in the generated quantities,
transformed data {
  vector[2] mu;
  real sigma1;
  real sigma2;
  real rho;

  matrix[2,2] Sigma;

  mu[1] = 0.0;
  mu[2] = 3.0;

  rho = 0.75;
  sigma1 = 1.0;
  sigma2 = 2.0;

  Sigma[1][1] = sigma1 * sigma1;
  Sigma[1][2] = rho * sigma1 * sigma2;
  Sigma[2][1] = rho * sigma1 * sigma2;
  Sigma[2][2] = sigma2 * sigma2;
}

parameters {
  vector[2] z;
}

model {
  z ~ multi_normal(mu, Sigma);
}

generated quantities {
  real var1;
  real var2;
  real corr;

  var1 = square(z[1] - mu[1]);
  var2 = square(z[2] - mu[2]);
  corr = (z[1] - mu[1]) * (z[2] - mu[2]) / (sigma1 * sigma2);
}

and then check to see how far the MCMC expectations are off relative to the MCMC standard error,
Inference for Stan model: gauss_model
1 chains: each with iter=(100000); warmup=(0); thin=(1); 100000 iterations saved.

For each parameter, N_Eff is a crude measure of effective sample size,
and R_hat is the potential scale reduction factor on split chains (at
convergence, R_hat=1).

You can see that we're off by 10 or so MCMC standard errors, which quantifies this is a nontrivial problem.

The problem is that the No-U-Turn criterion should flip whenever we integrate backwards in time but the abstraction to rho that was introduced in v2.9.0 did not take the sign into account.  A fix is on the way.

OK. I am just trying to help! :)
Thanks for checking and the fix!

Thanks --- you've been immensely helpful.
We really really appreciate bug reports.  Especially ones
with reproducible test cases.  We have in fact verified it's
a bug and a serious one as Stan's giving the wrong answers (only
by a little bit, but nevertheless measurably wrong).
Michael's going over all the code and math with a fine-toothed
comb to try to find the issue and now I'm getting involved in
the search.

+1 to what @bob-carpenter said. Thank you, @beckermr, for writing a clear bug report with a reproducible test case.

@beckermr: if you email me the size of your t-shirt, Stan branded T will be promptly mailed to you.

Awesome! Thank you!

Hello every one
I would like to ask about one things is that how I put the stan program file in working directory of R language....


Use tracefiles for coverage

This is to avoid .cov files cluttering the src directory.
I'm opening this PR to test how it runs in the CI and whether the coverage information is correctly submitted to Codecov

For clarification: This uses a single tracefile.info when testing locally (via make test or by running test() in the development REPL). On CI, the more traditional --code-coverage="user" is still used, which produces .cov files in the src folder. I got the impression the julia-actions/julia-processcoverage works better with (only with?) .cov files. Also, we don't really care about "littering" on the CI system.

I recommend not using --code-coverage="user" but instead use the --code-coverage=@{path to repo} because user tests all non-Base code, including stdlibs. @ path approach will be much faster

I forgot to mention it won't work on 1.6, so you may want to pass user or @ in via a matrix or something

Yeah, I've been trying that, but Github apparently doesn't allow using matrix values either inside the shell: or if: values for a step.

Well, splitting it into two jobs (test and testnocov) does the trick.
I'm going to get rid of macOS testing, too. It fails (hangs) about 10% of the time, and it's really not necessary. First, I'm developing on macOS, so it's getting plenty of testing. Second, I've never seen something work on Linux and fail on macOS.


Change SQLBrian_Parameters by Web

Enable the web portal to modify the system parameters

This is going to require user authorisation


[VEN-558]Feature/swap

Description
This PR introduces a new feature with Venus, allowing users to swap tokens and supply,repay in one transaction.
Resolves # VEN-558
Checklist

[ ] I have updated the documentation to account for the changes in the code.
[ ] If I added new functionality, I added tests covering it.
[ ] If I fixed a bug, I added a test preventing this bug from silently reappearing again.
[ ] My contribution follows Venus contribution guidelines.

can we have a mainnet fork test for USDT token swap?


Code generate nan at step 1 while reproducing inference process with the instructions in README.md

I tried both datasets in the provided benchmark folder, but both encountered nan outputs.

@esflfei You may ignore this nan message; it is just a Pearson correlation score for affinity prediction because the energy model does not predict affinity value. Therefore, such a message is useless and can be ignored.

谢谢，已收到。                    姜绍飞

But I continue to process the step2&3&4 and finally got the results with nan. I find that some of the energy in round0.csv are 99999999.9. I replace them with 0 and run step4, but the results are still nan.

@esflfei The energy showing 9999 is probably due to the ligand being far from the binding site. This may be the result of the ligand’s force field minimized conformation. Typically, the program will also display the 21st structure for reference, showing the input ligand and binding site as a complex structure along with the related energy.
This ensemble result is simply a basic calculation of the correlation between the predicted pIC50 value and the actual pIC50 value. Because your input CSV (Posebuster, in this case) does not have a pIC50 label, it is normal for it to display a "nan" message.
Anyway, thanks for pointing out the confusing messages in the program, we will discard such messages if the program exit normally.

thanks a lot


⚠ Bofrost.at has degraded performance

In 95af01a, Bofrost.at (https://www.bofrost.at) experienced degraded performance:

HTTP code: 200
Response time: 1576 ms

Resolved: Bofrost.at performance has improved in d3dc797.


Gitlab cannot search by Namespace/Project anymore

Please see : https://gitlab.com/gitlab-org/gitlab-ce/issues/40446
now the only correct way to get a project with the api is by using the id :
api/v4/projects/{:id}
https://docs.gitlab.com/ce/api/projects.html#get-single-project

I am not able to reproduce any issues with Drone fetching a repository. I executed the following test and it fetched the repository as expected:
package main

import (
	"log"
	"testing"

	"github.com/drone/drone/model"
	"github.com/drone/drone/remote/gitlab"
	"github.com/kr/pretty"
)

func main() {
	opts := gitlab.Opts{
		URL: "https://gitlab.com",
	}
	remote, err := gitlab.New(opts)
	if err != nil {
		log.Fatalln(err)
	}
	user := &model.User{
		Token: "",
	}
	repo, err := remote.Repo(user, "gitlab-org", "gitlab-ce")
	if err != nil {
		log.Fatalln(err)
	}
	pretty.Print(repo)
}

if you read https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md#1023-2017-11-30
you'll see at https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md#performance-3-changes-1 :
Drastically improve project search performance by no longer searching namespace name.
and sorry when it comes to bug report i don't see why i should use "user support", this a clearly a breaking change in gitlab implementation and clearly your responsibility to adapt to it.

Drastically improve project search performance by no longer searching namespace name.

The official documentation states that URL-encoded path of the project can be used with the  api/v4/projects/{:id} endpoint. I am unable to reproduce any issues when using the url-encoded path with the endpoint. So at this time, there appears to be absolutely nothing to fix.
If you disagree, send a pull request. That simple.


A sub-operation cannot trigger a sub-sub operation

Describe the bug
While an operation workflow can trigger a sub-operation, this behavior is not recursive: currently a sub-operation cannot trigger a sub-operation.  And this is even more confusing as the sub-sub operation is accepted by tedge_agent but is not working leading to a main operation instance that never terminate.
See this comment: https://github.com/thin-edge/thin-edge.io/pull/2792#issuecomment-2073641045
To Reproduce
See the system "Invoke sub-operation from a sub-operation" added by this PR: https://github.com/thin-edge/thin-edge.io/pull/2853. This test

defines 3 operation workflows:  grand_parent  operation triggers a parent operation that triggers a child operation.
and triggers a grand_parent command

Expected behavior

The 3 commands should be launched in turn
Starting the grand_parent  operation
Starting the parent  operation, pausing the grand_parent operation
Starting the child  operation, pausing the parent operation
Ending the child  operation, resuming the parent operation
Ending the parent  operation, resuming the grand_parent operation
Ending the grand_parent operation

Current behavior
The 3 commands are launched in turn as expected;
but the parent operation doesn't resume when the child operation ends.
Screenshots
[te/device/main///cmd/gp_command/test-sub-sub] {"status":"init", "output_file":"/tmp/test-sub-sub.json"}
[te/device/main///cmd/gp_command/test-sub-sub] {"output_file":"/tmp/test-sub-sub.json","status":"awaiting_completion"}
[te/device/main///cmd/super_command/sub:gp_command:test-sub-sub] {"status":"init"}
[te/device/main///cmd/super_command/sub:gp_command:test-sub-sub] {"status":"executing","y":"some y value"}
[te/device/main///cmd/super_command/sub:gp_command:test-sub-sub] {"status":"awaiting_completion","y":"some y value"}
[te/device/main///cmd/sub_command/sub:super_command:sub:gp_command:test-sub-sub] {"status":"init","x":"some x value","y":"some y value"}
[te/device/main///cmd/sub_command/sub:super_command:sub:gp_command:test-sub-sub] {"status":"executing","x":"some x value","y":"some y value"}
[te/device/main///cmd/sub_command/sub:super_command:sub:gp_command:test-sub-sub] {"status":"successful","x":"some x value","x_bis":"some x value","y":"some y value","y_bis":"some y value"}

Environment (please complete the following information):

OS [incl. version]
Hardware [incl. revision]
System-Architecture [e.g. result of "uname -a"]
thin-edge.io version [e.g. 0.1.0]

Additional context

QA has thoroughly checked the bug and here are the results:

[x] Test for ticket exists in the test suite.
tests/RobotFramework/tests/tedge_agent/workflows/custom_operation.robot
[x] Review of Test added in the PR https://github.com/thin-edge/thin-edge.io/pull/2853
[x] QA has tested the bug and it's not reproducable anymore


Fix confusing result of listing service

When a node was down, and the tasks on the node have been migrated to
other nodes, the result of listing service is a bit confusing like
following, the Replicas is 3/2. It means the number of running tasks
is three while the number of replicas is two. To avoid the confusion,
we should not count the tasks whose hosting node is not ready as
running tasks.
$ swarmctl service ls
ID                         Name         Image           Replicas
--                         ----         -----           --------
974qragx7kjotucroesg17hcx  busybox-top  busybox:latest  3/2

Signed-off-by: Jin Xu<EMAIL_ADDRESS>V2: ported from docker swarm client based on suggestion from
@aaronlehmann

Current coverage is 54.77% (diff: 100%)

Merging #1256 into master will increase coverage by 0.04%

@@             master      #1256   diff @@
==========================================
  Files            78         78
  Lines         12422      12422
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
+ Hits           6799       6804     +5
+ Misses         4679       4673     -6
- Partials        944        945     +1

Powered by Codecov. Last update e56300f...4b98b9f

LGTM

Superseded by #1270. Closing it.


0.26.1 compilation fails at Arch Linux

Trying to build <IP_ADDRESS> package in a clear build chroot environment at Arch Linux and I get following failure:
Using /usr/bin/llvm-config [version=6.0.1]
g++ -c -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt  -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/usr/include -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fPIC  -D_FORTIFY_SOURCE=2  -c -o src/ext/sigfault.o src/ext/sigfault.c
ar -rcs src/ext/libcrystal.a src/ext/sigfault.o
./bin/crystal build --release --no-debug --release --link-flags="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"  -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
Using /usr/bin/llvm-config [version=6.0.1]
./bin/crystal docs -b https://crystal-lang.org/api/latest src/docs_main.cr
Using compiled compiler at `.build/crystal'
Unhandled exception: fcntl() failed: Bad file descriptor (Errno)
  from ???
  from ???
  from __crystal_main
  from main
  from __libc_start_main
  from _start
  from ???
make: *** [Makefile:97: docs] Error 1

Almost definitely a duplicate of #6624
My apologies :(

@anatol it seems a fix landed in Master, @Timbus asked if you could retest using master branch (or @Timbus can you offer specific commit point?)
I guess we won't get an official 0.26.1 but at least we might get 0.26.2

I prefer to test a fix commit alone rather than master with many changes. If the fix is going to work then I can release 0.26.1 package to Arch repos.

I guess the fix commit is here: https://github.com/crystal-lang/crystal/commit/b697de03deed7647a7bebe0e0987cb660854bdac
You could possibly apply that as a patch, or check it out at that commit. Would recommend you try building master first and making sure it has been fixed.

Thanks for the pointer.
master branch builds fine, and 0.26.1 release with the patch above also builds fine. I just pushed 0.26.1 package to Arch [testing] repo. @bararchy please verify that it works as expected.

@anatol The testing package works great for me and the team, we tested on 6 different systems and compiled 9 internal + external projects.

FWIW, I'm seeing the same result:

Unhandled exception: fcntl() failed: Bad file descriptor (Errno)
from ???
from ???
from __crystal_main
...etc...

When I tried to build crystal 0.26.1 on macOS 10.11.6 (El Capitan) using homebrew.  I have not tried with the fix.   (I had not noticed this PR until about 10 minutes ago...).


Support Nushell when resolving the shell environment

Does this issue occur when all extensions are disabled?: Yes/No

VS Code Version:
Version: 1.73.1
Commit:<PHONE_NUMBER>f055b99068d3688932416f2346dd3b
Date: 2022-11-09T03:54:53.913Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: <IP_ADDRESS>-electron.0
OS: Linux x64 5.19.0-21-generic
Sandboxed: No

OS Version: Ubuntu 22.10 (Lubuntu)
Steps to Reproduce:

Add /home/emilyseville7cfg/.cargo/bin/nu to /etc/shells
Do sudo chsh --shell /home/emilyseville7cfg/.cargo/bin/nu
Relogin to apply changes
Start VS Code
Obtain Unable to resolve your shell environment: Unexpected exit code from spawned shell (code 1, signal null) error

I think a simple fix would be to use -i -l -c or -il -c instead of -ilc as Nushell doesn't support passing parameters to batched flags at the moment.

Feel free to submit a PR, given it works.

Fixed by https://github.com/microsoft/vscode/pull/169861

This bug has been fixed in the latest release of VS Code Insiders!
@EmilySeville7cfg, you can help us out by commenting /verified if things are now working as expected.
cc @lramos15, the bot is not jumping in?

This bug has been fixed in the latest release of VS Code Insiders!
@EmilySeville7cfg, you can help us out by commenting /verified if things are now working as expected.
If things still don't seem right, please ensure you're on version 07d6f5b35fac559504dec65e3073d796b2d25a55 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.
Happy Coding!

cc @lramos15, the bot is not jumping in?

Was missing the insiders-released label

I think the question is: why was the insiders-released label missing? Is that automation broken?

Command syntax seems to be different still:
2023-01-27 12:49:30.642 [trace] resolveShellEnv(): running (macOS/Linux)
2023-01-27 12:49:30.642 [trace] getUnixShellEnvironment#runAsNode undefined
2023-01-27 12:49:30.642 [trace] getUnixShellEnvironment#noAttach undefined
2023-01-27 12:49:30.642 [trace] getUnixShellEnvironment#env {"MallocNanoZone":"0","USER":"chrmarti","COMMAND_MODE":"unix2003","__CFBundleIdentifier":"com.microsoft.VSCodeInsiders","PATH":"/usr/bin:/bin:/usr/sbin:/sbin","LOGNAME":"chrmarti","DISPLAY":"/private/tmp/com.apple.launchd.u1oLSmpBVB/org.xquartz:0","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.JAXfjjzswm/Listeners","HOME":"/Users/chrmarti","SHELL":"/opt/homebrew/bin/nu","TMPDIR":"/var/folders/hj/vvzp2ffx69gbfmkhf5tckppm0000gn/T/","__CF_USER_TEXT_ENCODING":"0x1F5:0x0:0x0","XPC_SERVICE_NAME":"application.com.microsoft.VSCodeInsiders.27533220.27533226","XPC_FLAGS":"0x0","ORIGINAL_XDG_CURRENT_DESKTOP":"undefined","VSCODE_CWD":"/","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"availableLanguages\":{},\"_languagePackSupport\":true}","VSCODE_CODE_CACHE_PATH":"/Users/chrmarti/Library/Application Support/Code - Insiders/CachedData/acbbdaa41a459aab86072e8d97255cd2ea1d9529","VSCODE_IPC_HOOK":"/Users/chrmarti/Library/Application Support/Code - Insiders/1.75.0-insider-main.sock","VSCODE_PID":"7784","ELECTRON_RUN_AS_NODE":"1","ELECTRON_NO_ATTACH_CONSOLE":"1","VSCODE_RESOLVING_ENVIRONMENT":"1"}
2023-01-27 12:49:30.642 [trace] getUnixShellEnvironment#shell /opt/homebrew/bin/nu
2023-01-27 12:49:30.643 [trace] getUnixShellEnvironment#spawn ["-i","-l","-c"] '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron' --ms-enable-electron-run-as-node -p '"c3f372261f8a" + JSON.stringify(process.env) + "c3f372261f8a"'
2023-01-27 12:49:31.363 [trace] getUnixShellEnvironment#raw
2023-01-27 12:49:31.363 [trace] getUnixShellEnvironment#stderr Error: ]8;;https://docs.rs/nu-parser/0.74.0/nu_parser/enum.ParseError.html#variant.Expected\nu::parser::parse_mismatch (link)]8;;\

  × Parse mismatch during operation.
   ╭─[source:1:1]
 1 │ '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron' --ms-enable-electron-run-as-node -p '"c3f372261f8a" + JSON.stringify(process.env) + "c3f372261f8a"'
   ·                                                                           ────────────────┬───────────────
   ·                                                                                ╰── expected operator
   ╰────

2023-01-27 12:49:31.410 [trace] resolveShellEnv(): running (macOS/Linux)
2023-01-27 12:49:31.410 [error] Unable to resolve your shell environment: Unexpected exit code from spawned shell (code 1, signal null)

@lramos15 I think the question is: why was the insiders-released label missing? Is that automation broken?

@lramos15 I think the question is: why was the insiders-released label missing? Is that automation broken?

It's only added if it's closed by a commit. Manual comments of "Fixed by x" don't work there is a command though closedWith <commit> which will do it. Maybe there's room for semantic improvement 🤷

Remember to pull this off the release notes if it's not going out this month

https://github.com/microsoft/vscode-docs/commit/b209532a49e2c4c0c34d33a930c9e3d6349400a6

any progress?

@EmilySeville7cfg, you can help us out by commenting /verified if things are now working as expected.

I'll check it tomorrow.

It's strange, but this issue is still reproducible with this config:
    "terminal.integrated.automationProfile.linux": {
        "path": "/home/emilyseville7cfg/.local/bin/nu"
    },

Nushell starts successfully (doens't fail) but VS Code still shows this annoying error.

Version: 1.77.3
Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710
Date: 2023-04-12T09:16:52.732Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: <IP_ADDRESS>-electron.0
OS: Linux x64 5.15.0-71-generic
Sandboxed: No

The same, here is what VS Code version I use:
Version: 1.78.2
Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
Date: 2023-05-10T14:47:05.613Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: <IP_ADDRESS>-electron.0
OS: Linux x64 5.19.0-41-generic snap
Sandboxed: No

@EmilySeville7cfg @avalonx it looks like the fix was released on the insider channel and it has not been released on the stable channel yet. I have verified on the insider build (https://code.visualstudio.com/insiders/) that nushell environment resolution seems to work.