Switch loadSignature to accept string or XML node

@bjrmatos @yaronn Here is what I was referring to in #59. This allows loadSignature to accept a DOM node or XML string, keeping backwards compatibility. The only possible breaking change would be if a caller was using signatureXmlDoc but I would think that should be regarded as private.
Thoughts?

@bjrmatos @brianhartsock I am starting a new job so don't have much time to work on xml-crypto. I have added both of you as collaborators so you can commit directly to the repository. Once there is something stable I can push to npm. I agree to accepting either DOM or string (for backward compatiblity). @bjrmatos - is this aligned with how you see it too?

i think its ok for now before the 1.0 version, in 1.0 the user won't be required to parse anything because xml-crypto will do that work.
@brianhartsock since everybody is ok with this, i think you could merge :)
Thanks for adding us as collaborators @yaronn
i will start to work on 1.0 in two weeks in a new branch so everybody can track the progress

@bjrmatos thanks. I'll merge.
@yaronn what's the process for cutting incremental releases?

I can push it to npm. current version is 0.5.27. should this be 0.5.28 or 0.6.0?

i think this is a new feature so a minor upgrade would be the right IMO
0.6.0 :+1:

when I run "npm test" I get several failing tests - do you also see them failing?

@yaronn I just did a clean clone, npm install; nom test and it passed 181 tests no problem. What tests are you seeing failing?

here is my log. I use ubuntu 14.04 + node 0.12.6 - which ones do you use? possibly this is related to windows vs unix lin breaks or to node version.

<EMAIL_ADDRESS>test /home/ubuntu/xml-crypto
nodeunit ./test/canonicalization-unit-tests.js ./test/c14nWithComments-unit-tests.js ./test/signature-unit-tests.js ./test/saml-response-test.js ./test/signature-integration-tests.js
canonicalization-unit-tests.js
✔ Exclusive canonicalization works on xml with no namespaces
✔ Exclusive canonicalization works on inner xpath
✔ Exclusive canonicalization works on xml with prefixed namespaces defined in output nodes
✔ element used prefixed ns which is also the default
✔ Exclusive canonicalization works on xml with prefixed namespaces defined in output nodes. ns definition is not duplicated on each usage
✔ Exclusive canonicalization works on xml with prefixed namespaces defined in output nodes but before used
✔ Exclusive canonicalization works on xml with prefixed namespaces defined outside output nodes
✔ Exclusive canonicalization works on xml with prefixed namespace defined in inclusive list
✔ Exclusive canonicalization works on xml with multiple prefixed namespaces defined in inclusive list
✔ Exclusive canonicalization works on xml with prefixed namespace defined in inclusive list defined outside output nodes
✔ Exclusive canonicalization works on xml with prefixed namespace defined in inclusive list used on attribute
✔ Exclusive canonicalization works on xml with default namespace inside output nodes
✔ Exclusive canonicalization works on xml with multiple different default namespaces
✔ Exclusive canonicalization works on xml with multiple similar default namespaces
✔ Exclusive canonicalization works on xml with default namespace outside output nodes
✔ Exclusive canonicalization works when prefixed namespace is defined in output nodes not in the parent chain of who needs it
✔ Exclusive canonicalization works on xml with unordered attributes
✖ Exclusive canonicalization sorts upper case attributes before lower case

AssertionError: '' == ''
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at compare (/home/ubuntu/xml-crypto/test/canonicalization-unit-tests.js:14:10)
at Object.module.exports.Exclusive canonicalization sorts upper case attributes before lower case (/home/ubuntu/xml-crypto/test/canonicalization-unit-tests.js:151:5)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
✖ Exclusive canonicalization removes Comments
AssertionError: '' == ''
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at compare (/home/ubuntu/xml-crypto/test/canonicalization-unit-tests.js:14:10)
at Object.module.exports.Exclusive canonicalization removes Comments (/home/ubuntu/xml-crypto/test/canonicalization-unit-tests.js:158:5)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
✔ Exclusive canonicalization works on xml with attributes with different namespace than element
✔ Exclusive canonicalization works on xml with attribute and element values with special characters
✔ Exclusive canonicalization preserves white space in values
✔ Exclusive canonicalization preserves white space bewteen elements
✔ Exclusive canonicalization turns empty element to start-end tag pairs
✔ Exclusive canonicalization preserves empty start-end tag pairs
✔ Exclusive canonicalization with empty default namespace outside output nodes
✔ Exclusive canonicalization with empty default namespace inside output nodes
✔ The XML declaration and document type declaration (DTD) are removed
✔ Attribute value delimiters are set to quotation marks (double quotes)
✔ CDATA sections are replaced with their character content
✔ SignedInfo canonization
✖ Exclusive canonicalization works on complex xml
AssertionError: '             ererer dfdf          erer                                    ' == '             ererer dfdf          erer                                    '
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at compare (/home/ubuntu/xml-crypto/test/canonicalization-unit-tests.js:14:10)
at Object.module.exports.Exclusive canonicalization works on complex xml (/home/ubuntu/xml-crypto/test/canonicalization-unit-tests.js:276:5)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
✔ Multiple Canonicalization with namespace definition outside of signed element
✔ Enveloped-signature canonicalization respects currentnode
✔ The XML canonicalization method processes a node-set by imposing the following additional document order rules on the namespace and attribute nodes of each element:   - An element's namespace and attribute nodes have a document order position greater than the element but less than any child node of the element.     Namespace nodes have a lesser document order position than attribute nodes.   - An element's namespace nodes are sorted lexicographically by local name (the default namespace node, if one exists, has no local name and is therefore lexicographically least).   - An element's attribute nodes are sorted lexicographically with namespace URI as the primary key and local name as the secondary key (an empty namespace URI is lexicographically least).     Lexicographic comparison, which orders strings from least to greatest alphabetically, is based on the UCS codepoint values, which is equivalent to lexicographic ordering based on UTF-8.
✔ saml attributed order (bug #25)
✔ Body Xml Element Canonicalization
c14nWithComments-unit-tests.js
✔ Exclusive canonicalization works on xml with no namespaces
✔ Exclusive canonicalization works on inner xpath
✔ Exclusive canonicalization works on xml with prefixed namespaces defined in output nodes
✔ element used prefixed ns which is also the default
✔ Exclusive canonicalization works on xml with prefixed namespaces defined in output nodes. ns definition is not duplicated on each usage
✔ Exclusive canonicalization works on xml with prefixed namespaces defined in output nodes but before used
✔ Exclusive canonicalization works on xml with prefixed namespaces defined outside output nodes
✔ Exclusive canonicalization works on xml with prefixed namespace defined in inclusive list
✔ Exclusive canonicalization works on xml with multiple prefixed namespaces defined in inclusive list
✔ Exclusive canonicalization works on xml with prefixed namespace defined in inclusive list defined outside output nodes
✔ Exclusive canonicalization works on xml with prefixed namespace defined in inclusive list used on attribute
✔ Exclusive canonicalization works on xml with default namespace inside output nodes
✔ Exclusive canonicalization works on xml with multiple different default namespaces
✔ Exclusive canonicalization works on xml with multiple similar default namespaces
✔ Exclusive canonicalization works on xml with default namespace outside output nodes
✔ Exclusive canonicalization works when prefixed namespace is defined in output nodes not in the parent chain of who needs it
✔ Exclusive canonicalization works on xml with unordered attributes
✖ Exclusive canonicalization sorts upper case attributes before lower case
AssertionError: '' == ''
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at compare (/home/ubuntu/xml-crypto/test/c14nWithComments-unit-tests.js:14:10)
at Object.module.exports.Exclusive canonicalization sorts upper case attributes before lower case (/home/ubuntu/xml-crypto/test/c14nWithComments-unit-tests.js:151:5)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
✖ C14N#WithComments retains Comments
AssertionError: '' == ''
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at compare (/home/ubuntu/xml-crypto/test/c14nWithComments-unit-tests.js:14:10)
at Object.module.exports.C14N#WithComments retains Comments (/home/ubuntu/xml-crypto/test/c14nWithComments-unit-tests.js:158:5)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
✔ Exclusive canonicalization works on xml with attributes with different namespace than element
✔ Exclusive canonicalization works on xml with attribute and element values with special characters
✔ Exclusive canonicalization preserves white space in values
✔ Exclusive canonicalization preserves white space bewteen elements
✔ Exclusive canonicalization turns empty element to start-end tag pairs
✔ Exclusive canonicalization preserves empty start-end tag pairs
✔ Exclusive canonicalization with empty default namespace outside output nodes
✔ Exclusive canonicalization with empty default namespace inside output nodes
✔ The XML declaration and document type declaration (DTD) are removed
✔ Attribute value delimiters are set to quotation marks (double quotes)
✔ CDATA sections are replaced with their character content
✔ SignedInfo canonization
✖ Exclusive canonicalization works on complex xml
AssertionError: '             ererer dfdf          erer                                    ' == '             ererer dfdf          erer                                    '
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at compare (/home/ubuntu/xml-crypto/test/c14nWithComments-unit-tests.js:14:10)
at Object.module.exports.Exclusive canonicalization works on complex xml (/home/ubuntu/xml-crypto/test/c14nWithComments-unit-tests.js:276:5)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
✔ Multiple Canonicalization with namespace definition outside of signed element
✔ Enveloped-signature canonicalization respects currentnode
✔ The XML canonicalization method processes a node-set by imposing the following additional document order rules on the namespace and attribute nodes of each element:   - An element's namespace and attribute nodes have a document order position greater than the element but less than any child node of the element.     Namespace nodes have a lesser document order position than attribute nodes.   - An element's namespace nodes are sorted lexicographically by local name (the default namespace node, if one exists, has no local name and is therefore lexicographically least).   - An element's attribute nodes are sorted lexicographically with namespace URI as the primary key and local name as the secondary key (an empty namespace URI is lexicographically least).     Lexicographic comparison, which orders strings from least to greatest alphabetically, is based on the UCS codepoint values, which is equivalent to lexicographic ordering based on UTF-8.
✔ saml attributed order (bug #25)
signature-unit-tests.js
✔ signer adds increasing id atributes to elements
✔ signer does not duplicate existing id attributes
✔ signer adds custom attributes to the signature root node
✔ signer appends signature to the root node by default
✔ signer appends signature to a reference node
✔ signer prepends signature to a reference node
✔ signer inserts signature before a reference node
✔ signer inserts signature after a reference node
✔ signer creates signature with correct structure
✔ signer creates signature with correct structure (with prefix)
✖ signer creates correct signature values
Assertion Message: wrong signature format
AssertionError: 'b5GCZ2xpP5T7tbLWBTkOl4CYupQ=4Pq/sBri+AyOtxtSFsPSOyylyzk=6I7SDu1iV2YOajTlf+iMLIBfLnE=NejzGB9MDUddKCt3GL2vJhEd5q6NBuhLdQc3W4bJI5q34hk7Hk6zBRoW3OliX+/f7Hpi9y0INYoqMSUfrsAVm3IuPzUETKlI6xiNZo07ULRj1DwxRo6cU66ar1EKUQLRuCZas795FjB8jvUI2lyhcax/00uMJ+Cjf4bwAQ+9gOQ=' == 'b5GCZ2xpP5T7tbLWBTkOl4CYupQ=sFFr3RucdDXp2Fql7V/rknSd1hU=6I7SDu1iV2YOajTlf+iMLIBfLnE=ceOBowkEaH/sIymzAA7ynex/0OOJaP+gcQ8eB/Q4auRZhR2bZFopnatyFncs3xR0U3100YWSatRUwJ7DQfCVqAB2+TTi9Z+YhOlM+Y07l6HO1HcRaM2sBYhmnPM7FHKoWAVSM0ISj3Zbtezo7KBASHkt8nvc2NcdUY5EKSWcgks='
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at Object.module.exports.signer creates correct signature values (/home/ubuntu/xml-crypto/test/signature-unit-tests.js:472:10)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:515:17
✔ correctly loads signature
[ 'invalid signature: for uri #_1 calculated digest is VXQYpqatdF5AY3VXK4arA7kEAAs= but the xml to validate supplies digest K4dI497ZCxzweDIrbndUSmtoezY=' ]
[]
[ 'invalid signature: for uri #_1 calculated digest is VXQYpqatdF5AY3VXK4arA7kEAAs= but the xml to validate supplies digest K4dI497ZCxzweDIrbndUSmtoezY=' ]
[]
✖ verify valid signature
Assertion Message: expected signature to be valid, but it was reported invalid
AssertionError: expected signature to be valid, but it was reported invalid
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at passValidSignature (/home/ubuntu/xml-crypto/test/signature-unit-tests.js:526:8)
at Object.module.exports.verify valid signature (/home/ubuntu/xml-crypto/test/signature-unit-tests.js:485:5)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
Assertion Message: expected signature to be valid, but it was reported invalid
AssertionError: expected signature to be valid, but it was reported invalid
at Object.equal (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/types.js:83:39)
at passValidSignature (/home/ubuntu/xml-crypto/test/signature-unit-tests.js:526:8)
at Object.module.exports.verify valid signature (/home/ubuntu/xml-crypto/test/signature-unit-tests.js:487:5)
at Object. (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:236:16
at Object.exports.runTest (/home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:70:9)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/lib/core.js:118:25
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:513:13
at iterate (/home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:123:13)
at /home/ubuntu/xml-crypto/node_modules/nodeunit/deps/async.js:134:25
[ 'invalid signature: for uri #_1 calculated digest is VXQYpqatdF5AY3VXK4arA7kEAAs= but the xml to validate supplies digest K4dI497ZCxzweDIrbndUSmtoezY=' ]
[ 'invalid signature: for uri #_0 calculated digest is b5GCZ2xpP5T7tbLWBTkOl4CYupQ= but the xml to validate supplies digest b5GCZ2xpP5T7tbLWBTkOl4CPupQ=' ]
[ 'invalid signature: the signature refernces an element with uri #_non_existing but could not find such element in the xml' ]
[ 'invalid signature: for uri #_1 calculated digest is 4xuqQ2zA57EOZLL62gBoIz6Mal8= but the xml to validate supplies digest K4dI497ZCxzweDIrbndUSmtoezY=' ]
[ 'invalid signature: for uri #_2 calculated digest is TUkwwDGRfgW3CORC9RvimMKtFpU= but the xml to validate supplies digest mXRUtj7KJU3kMPLD9R30CGEiWio=' ]
[ 'invalid signature: for uri #_0 calculated digest is 5jkdJLKVpfEiAQ0k5bnvfCQJKks= but the xml to validate supplies digest kapR1Bn68VZxlpAEcUqcpOiL1LQ=' ]
[ 'invalid signature: the signature refernces an element with uri #_non_existing but could not find such element in the xml' ]
[ 'invalid signature: for uri #_1 calculated digest is G5cJQlZ5eDXs5SyVfHjSWWpnXDA= but the xml to validate supplies digest 97gNxHth/Gc2wH4FiTiWJJrLaHI=' ]
✔ fail invalid signature
✔ allow empty reference uri when signing
saml-response-test.js
✔ test validating SAML response
✔ test validating SAML response where a namespace is defined outside the signed element
✔ test validating SAML response WithComments
signature-integration-tests.js
✔ verify signature
✔ verify signature of complex element
✔ empty URI reference should consider the whole document
✔ windows store signature
✔ signature with inclusive namespaces
Harry PottercdiS43aFDQMnb3X8yaIUej3+z9Q=vhWzpQyIYuncHUZV9WectOBLgBCxIYhKWeGzsp3apLTNEfyz/I3nuI9g0u3bx8y4wjluYf/PuWeYDWCkOKFzF/3QKnFeL1634OodTULFF4mWCCytemfFG8iO1LiRxRvY1UOeRooHhOoq838VoUA+rLssoTXNI83dNYngtrh5P5g=
✔ should create single root xml document when signing inner node
FAILURES: 9/181 assertions failed (622ms)

I confirm that is a problem with the node version.
in node v0.10.40 -> everything is ok
in node v0.12.0 -> i have 10 failing tests

I'll revert and fix, sorry guys.

On Jul 23, 2015, at 3:26 PM, BJR Matos<EMAIL_ADDRESS>wrote:
I confirm that is a problem with the node version.
in node v0.10.40 -> everything is ok
in node v0.12.0 -> i have 10 failing tests
—
Reply to this email directly or view it on GitHub.

not sure this is a regression - possibly xml-crypto never worked on 0.12.x
On Thu, Jul 23, 2015 at 11:07 PM, Brian Hartsock<EMAIL_ADDRESS>wrote:

I'll revert and fix, sorry guys.

On Jul 23, 2015, at 3:26 PM, BJR Matos<EMAIL_ADDRESS>wrote:
I confirm that is a problem with the node version.
in node v0.10.40 -> everything is ok
in node v0.12.0 -> i have 10 failing tests
—
Reply to this email directly or view it on GitHub.

—
Reply to this email directly or view it on GitHub
https://github.com/yaronn/xml-crypto/pull/62#issuecomment-124225728.

--
I'm on Twitter (@YaronNaveh http://twitter.com/#!/YaronNaveh)

yes I just confirmed that xml-crypto never worked on node 0.12.x.
seems node 0.12.x has a different behavior than 0.10.40
"A".localeCompare("a")

0.12.x: 1
0.10.40: -32

the above can be fixed by using:
"A".localeCompare("a", 'en', {caseFirst: 'upper'})
but this one yields a different result and no configuration can fix it:
"a".localeCompare("Ab")

0.10.40: 32
0.12.x: -1

So I have rewritten the canonization compare function to not use localeCompare and hopefully now it exhibits the right behavior. Please run the tests on your machine as well just to verify.

all tests passing on node v0.12.7

great! I have published it to npm as 0.6.0.

:clap:

probably not the best place to comment but i've found that xml-crypto is producing incorrect hashes when i sign an xml file with line breaks (at least on windows), will open an issue in the following days with the bug. For now i just remove all line breaks before sign a file :(

yes, someone complained about line breaks a while ago and that was the workaround. might be linux windows thing. probably related to how canonicalization treats line break or even to the xmldom implementation.

it is something to investigate.. i wanna fix this, i will open an issue with a reference to a test-case in the following days to keep track of the bug

:+1:


[BREAKING] Read/write effect labels

Just a little idea. Might be an overkill, but why would finer-grained effects hurt. What do you think?

One issue here is that read, write names might also be used by other libraries, so if we want to have it they better be readRef, writeRef

Looks like this got overlooked! Presumably you could make some guarantees about purity if it only reads? Does ST not kinda do that?

Yes, sorry this was overlooked. Is there a compelling case for separating these out? I don't think either one on its own is a guarantee of any kind of purity unfortunately.

Looking at it now, I don't think it's very important, and I don't have a good use case. Additionally, it's way too breaking for doing it with no good reason.


support lookup by userid to prevent duplicate records for same user

add index by userId for fastlookup
modified lookup to options.id OR options.userId
should fix https://github.com/raix/push/issues/78

Thanks @sirpy it's released https://travis-ci.org/raix/push#L568


AccountContactRelation Not Accessable

$mySforceConnection->describeSObject('AccountContactRelation')
returns: Fatal error: Uncaught SoapFault exception: [sf:INVALID_TYPE] INVALID_TYPE: sObject type 'AccountContactRelation' is not supported.
Account Contact Relationships activated for org.

Are there any workarounds?

Is there any workaround to this issue?

it is a feature that salesforce support had to enable for our account.

any updates?

I ran into this today, too. It looks like this is bundled with version 27 of the API. I generated a new WSDL for version 40, plugged it in and it worked. So far I haven't had issues, I'm not sure if this will break anything else. It's worth a shot, make sure you test everything afterwards: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_quickstart_get_WSDLs.htm

We tried with API version 37 [1] and it worked. Thanks @XGhozt00
[1] https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_accountcontactrelation.htm


Not clear on benefits over hyperscript + hyperscript-helpers

I'm not clear what the benefits of this package are over just combining hyperscript + hyperscript-helpers.
The readme asserts that it:

Allows for expressing UIs in the hyperscript-helpers style but with first class support for React.
The api has been greatly improved, making the library usable for actual projects.

Having successfully used the above pairing for actual projects, I'm not clear on what the differences are between this package and libraries that inspired it 🙂

One small difference is that this library exports a hyperscript function which allows to specifiy a react component and a selector:
h(MyComponent, '.large');


Consider having a ? operator on calls (like Rust) for error propagation

Last time I looked at Rust, they had a try! macro for this, but now they have a ? postfix operator; if "postfix" isn't stretching the terminology a bit here. (Note to self: check if it's actually implemented as a postfix ? in the parser, or whether it's the call syntax rule that has been extended. Either would work, but from slightly different directions in the grammar.)
Similar to #13, this operator affects the rest of the execution, but unlike that issue, it does it by returning early.

I feel like this brings us back to the discussion on whether or not you should be able to use a return from a quasi; and that it should return from the function the quasi is injected into.

Dammit!  It's here and now that my stubbornness on that issue is coming back to bite me...
I feel that, if I start turning over one stone here, I'll end up turning over them all (again) — which may or may not be worthwhile. So for the moment, let me just agree with you @vendethiel, with absolutely no further strings attached.

I feel that, if I start turning over one stone here, I'll end up turning over them all (again) — which may or may not be worthwhile.

No, it seems I was already convinced in the past, as evidenced by #483. We just haven't Made It So yet. So all's fine, and return will return from whatever's in the mainline, not in the macro.


WizardComponent does not refresh buttons state when set from TreeComponent change handler

Azure Data Studio Version: 1.26.0-insider (user setup)
Commit: 06bace1fcf7ec79b3f2df8588400f56b54476125

Steps to Reproduce:

In the extensions sample, update mainController.ts to accept Next button in getTab3Content, by changing line 83 to:

private async getTab3Content(view: azdata.ModelView, nextButton?: azdata.window.Button): Promise<void> {

Also change onNodeCheckedChanged handler to disable the next button, by adding the following line after line 130:

nextButton.enabled = false;

Finally render TreeComponent in a wizard, rather than a dialog by changing line 529 to:

await this.getTab3Content(view, wizard.nextButton);

Build the extension and install it in ADS
Run sqlservices.openWizard command, you should see a tree view and Next button enabled:

Uncheck node 12 - the Next button is still enabled (Expected behavior: next button should be disabled)

Click Next button to navigate to the next page and then click Previous button to navigate back to the first page.

Next button is now disabled

Expected behavior
Button state should be updated when enabled property changes during step 6.
I hit this when trying to implement custom validation for the tree control - depending on the selected nodes we would like to allow/disallow user to proceed in the wizard. Standard validation for the TreeComponent does not seem to have a way to validate the selection, so I was trying to roll out my own solution. Ideally it would be nice to extend validation feature for the TreeComponent to allow a delegate that is called on check state changes and returns true/false, but if we can at least fix this issue - that would be a workaround in the interim.

the state of the the following three buttons are controlled by the wizard itself: next, previous, done. extensions are supposed to leverage the page validation to control the enabled state of them. I tried the following code in the sqlservices extensions on top of your changes. around line 124 in maincontroller.ts
		let checkedItems = []; // track the checked tree items
		let tree: azdata.TreeComponent<TreeNode> = view.modelBuilder.tree<TreeNode>().withProperties({
			'withCheckbox': true
		}).withValidation(() => { // use withValidation to control the state of the next button.
			return checkedItems.length === 1;
		}).component();
		let treeView = tree.registerDataProvider(treeDataProvider);

		treeView.onNodeCheckedChanged(item => {
			checkedItems.push(item); // updated the checkedItems array.
			tree.validate(); // run the validation to refresh the validity state of the page
			if (item && item.element) {
				item.element.changeNodeCheckedState(item.checked);
			}
		});

you can use this or the navigation validator we chatted about today. let me know.

forgot to tag you @nahk-ivanov

please reactivate if you are having issue with the solution I provided.


License management

New feature: manage the service licenses allowing the instantiation. It will be possible to get a license through with the license management provided by the Gatekeeper

Clossed: #55


guzzle 6

Possible to upgrade to guzzle 6?

Hi,
In addition to this, what is the status of the library? I have several libraries on guzzle 3 that I'd like to upgrade to this and guzzle 6 but as it's not v1 yet, I'm waiting.
As AWS no longer use guzzle services but a custom format, is it still the recommended way to create clients with Guzzle? Or do you think now it's actually better to follow what you're doing in AWS ?

I believe @jeremeamia has some plans for how move Guzzle service descriptions forward.

I rewrite my code actual from guzzle 3 to 5.3. The Missing feature is the responseClass feature see also #81.

I'm having the same problem. I would like to know more about those plans @jeremeamia

:+1:

Would be glad to hear about these plans, too. I'd be glad to help. :)

:+1:

same. I'm just deciding how to consume an api from my sf2 app. Have decide to use custom responseClass but i've just found it is a missing feature for guzzle-services 0.5. Thx

+1 any update on this?

+1 on this too! 👍

+1

Hello everyone, I'm working on a Guzzle 6 version of guzzle/command, which is a dependency to this library. I should have a PR open sometime next week for review.

Great news, @jeremeamia! :)

Awesome! :+1:

Sweeeeet! :+1:

Great! I'm looking forward to it!

Awesome news!! Thanks @jeremeamia!

Thanks!! :+1:

@jeremeamia I am about to start a project that I would love to use service descriptions with guzzle 6, and I have been trying to decide what direction to go.  I just know that as soon as I get neck deep in going a different direction, you will release a great fix.
Do you have an ETA on this?
Thanks so much.

Unfortunately I do not. Right now, I'm about half-way done with the guzzle/command package, but I haven't started doing anything specifically with this one yet. My family and I are also preparing to move across the country in too weeks, so I'm a little constrained on time. Sorry. I'll keep everyone posted mon my progress though.

@jeremeamia, thanks for letting me know.  I appreciate your effort & good luck with the move--moving sucks.

I have a preview for Guzzle 6 support in guzzle/command. Take a look and leave some feedback there, if you are interested.

:+1:

The guzzlehttp/command package is now updated for Guzzle 6 in Version 0.9.0. Now it's time to work on this one. :smile:

This is great news @jeremeamia, thank you!

Awesome news!! Thanks @jeremeamia!

You made my day. Thanks @jeremeamia . I will FINALLY by abe to rewrite all my Client in Guzzle 6 and remove this Guzzle 3 dependency :D.

Nice job, @jeremeamia!

@jeremeamia I started trying out the guzzle6 branch and right now I always get null as the result. Looking into the execution I see that GuzzleHttp\Promise\Promise::settle gets called 7 times and after the correct response gets stored in $this->result it gets overwritten again to null. Any idea where this might come from? I’m more than happy to work on a PR to fix this but would need some guidance where this strange behaviour might come from. I assume the issue is not with the Promise library.

Nevermind: https://github.com/guzzle/guzzle-services/blob/guzzle6/src/GuzzleClient.php#L48 is the source of the mysterious null response :)

Yeah, this package is not quite Guzzle6 ready yet. Still working on it. The Command package has been updated already though.

Yes, fully aware of that - really need this though so will try to make some progress and will create a PR if I make it work properly.

@jeremeamia Are there any specific G6 issues for others to take a look at right now, or are updates forthcoming?
@hacfi Did you end up making any progress w/ that issue?

@jeremeamia Any help wanted for the guzzle6 branch stabilisation?

Happy to have help. Haven't been able to work on this for a while, unfortunately. The current branch is in progress to update to use Guzzle 6 and the updated guzzlehttp/command and get the tests passing. Feel free to make PRs against that branch, and I'm happy to review.

Ok. Any specific things that still need a bit of work?
Or is the current work mostly focused on making the tests work with Guzzle6 and the master branch of guzzlehttp/command?

Or is the current work mostly focused on making the tests work with Guzzle6 and the master branch of guzzlehttp/command?

Yep, that. There are a few @todos in there and some more find & replace work to do. It's been a few months since I looked at it, so I can't remember everything. I'd suggest just diving in and seeing what you can do with it. If you run into specific questions let me know, and I might be able to look at it and remember things.

Great, thanks for the pointers!
I'll take a look at this!

Good luck, and thank you.

@csarrazi What's the current status? Perhaps we can split this up and divide the todo's.

I've started migrating the Serializing part, for now. I'll try pushing something by the end of the week (as I'm currently abroad), but it won't be final.

Any update on this?

Sorry, I was terribly busy lately. I will push some code tonight, once I get back home.
The current status is : nothing really usable for now, mostly working on serialization / deserialization, and trying to make the tests pass.

@Konafets @snoek09 You can find the code in the guzzle6-pr1 branch of my fork.
https://github.com/csarrazi/guzzle-services/tree/guzzle6-pr1

Thanks, I will try at the weekend. Thanks so far.

Hello all,
Another keen observer here and I'm wondering if there has been an update since Jul 14th?
I've been investigating Guzzle 6 for a usecase at work and finally got to wrapping my head around the Guzzle3->6->psr-7 journey since I last looked.
@csarrazi Judging by your fork you (and open to all as well) have a good grasp of the library (promises and the handler stack in particular) how do we feel about the chance of guzzle-services and commands working together in an effort to use service descriptions?

Hey, last two days a got familar with the code and have a pretty good overview what to do. I started already with fixing the request locations and some other issues. Mainly making the tests work again but also introduce new tests.
Comments are highly welcome.
https://github.com/Konafets/guzzle-services/tree/guzzle6-pr1

Happy testing https://github.com/guzzle/guzzle-services/pull/109

@jeremeamia Did you had the chance to have a look at my PR?

The guzzle 6 branch was created a couple of days ago so this can probably be closed:
composer require guzzlehttp/guzzle-services:dev-guzzle6

I will close this issue when the branch is merged and the release is tagged.

Its finally done in 85c3969


⚠ ClamAV has degraded performance

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

HTTP code: 200
Response time: 79 ms

Resolved: ClamAV performance has improved in b57e679.


Create fancy zones spanning multiple monitors

Summary of the new feature/enhancement
Ability to create zones which span multiple monitors
Proposed technical implementation details (optional)
I have this giant 49" screen which are practically 2 27"monitors in 5120x1440 resolution without a bezel.
I'd like to be able to create a zones which extends from 1 monitor into the other like for example to place a window in the middle. Right now the zone will stop at the border of the screen.
It would also be nice to be able to create different zones on each monitor.
like 50/50 on monitor 1, 33/33/33 on monitor 2 etc.

Been thinking about that one, too. Don't have a setup like that myself yet, but if FZ supported it, it'd become a lot more interesting to me.
So a Layout that spans/involves multiple montiors (or at least two).
Two bordering monitors can make already make an L. Or can touch at the corners. Only have a very small border area.
With 8 monitors you can have a big hole in the middle.
This can get extremely complex with different monitors potentially having different resolutions, orientations and DPI.
And the layout breaks instantly once they're not in position in the real world (though really that's the user's problem).
The only silver lining is that to my knowledge all monitors are rectangular.

Hi @Fonta
thank you for your feedback, this feature request is tracked by https://github.com/microsoft/PowerToys/issues/480
Please add you comment there, I'm closing this one as duplicate.
Thanks.


Enable “mouse wheel zoom”

Describe the task
Enable “mouse wheel zoom” on the detailed map page in the public interface, rather than having to click the + and – buttons.
Acceptance Criteria

[x] mouse wheel zoom is enabled
[x] using Leaflet capability

Additional context
[Uploading... mouse wheel zoom.png]

[Uploading... image.png]

Basil provided this ref: https://gis.stackexchange.com/questions/111887/leaflet-mouse-wheel-zoom-only-after-click-on-map

This is deployed on FOM Test environment. @gormless87


A good start

In general, this all makes reasonable sense, with three caveats, each related.
To What End?: First, this proposal lacks a statement of purpose and powers. This should come first, before you design the vehicle to carry out that purpose. The XRPL has always lacked an independent “champion of the chain” that other communities have had. The XRPL Foundation has never functioned in this way. It should and that list of purposes and goals - the vision - should be in here somewhere.
With What Resources?: Second, and related to the first, any entity needs funding to enable its activities. Other communities have  an entity resourced to be the independent champion. The XRPL ecosystem is 100% reliant on Ripple. It is the only entity with funds and the sole source of all funds within the ecosystem. Whatever it is, if it’s XRPL -related & Ripple stops funding it, it dies. The revised Foundation needs to have a business model that solves that problem.
Armed With What Clout?: Finally, it would help if the list of things the Foundation managed included the canonical code base. At present, Ripple controls what code gets merged and voted on by validators. In a code base that has no composability, where every innovation has to be agreed by everyone, it doesn’t make sense for a single large actor - instead of a revitalised Foundation - to control which innovations the validators are allowed to have a view on.
So, by all means, change the membership criteria and charge membership fees. All worthy innovations. But first agree the purpose, powers, and business model for the vision the members are joining up to support.

Please tell me this isn’t for me.


Sierra Leone mobile phone numbers are considered invalid

Hi,
Apparently, a valid mobile phone number for Sierra Leone, such as +23299500743 is considered invalid by libphonenumber, even though it is a valid mobile phone number for this country.

Do you have any information on the "99" prefix, such as official documentation from the government or a telecom? Thanks.

Hello. Regards from Freetown.
We are making our best to have. A friend expert in IT tell us and in general,  official documentation is hard to find when it comes to telephone systems in Sierra Leone. There is a national regulator (NATCOM) but they usually don't respond. All our numbers here in UN are +232-9950****.
What can we do?
best regards

Who's the carrier for +232 99 xxx xxx?

Dear Keghani
This morning we received confirmation from Africell that the 099 is a NDC allocated in their network in Sierra Leone.
Please find attached an screenshot of the email (I cover the personal data)
Please let me know if this is enough. I see that the validation process in services as Twitter and other is not possible for those +232-99 numbers
Best regards
Luis

Great, thanks for that Luis. This is good evidence, I'll include Africell as the carrier for 099.
Expect this fixed in the next release.
Do you have contact with Africell? They may like to know that "99" is not appearing on their "choose your number" page: http://www.africell.sl/choose-your-number.php

Dear Keghani
I have the contact. I'll send it to you in a private message.
By the way, did you see this? http://blog.hackersonlineclub.com/2015/03/how-to-bypass-two-step-verification-code.html
Best regards

Hi Luis,
No need to send me. I was suggesting that if you're already corresponding with them you may like to let them know.

ok

Hello again
The Chief Technical Officer in Africell will update their website.
Thanks a lot

Released in v7.0.4

hey, thanks a lot! :)


combine figma.boolean with figma.nestedProps

We use nested components in our design system quite a lot and utilize figma.nestedProps to map their props to the parents props in code. Only thing that doesn't work for us is when we have an optional nested component, i.e. that can be shown/hidden with a boolean property in Figma. It seems like we can use either figma.boolean or figma.nestedProps, but not both in combination.
This is an example where we have a notification component that has an optional button component nested inside.
props: {
  icon: figma.boolean('icon?', {
    true: figma.instance('icon'),
    false: undefined
  }),
  title: figma.boolean('title?', {
    true: figma.string('title'),
    false: undefined,
  }),
  description: figma.string('description'),
  // this throws an error when the nested component is toggled off
  action: figma.nestedProps('action', {
    label: figma.string('label'),
    icon: figma.instance('icon')
  }),
  /* would like to use nestedProps inside the boolean
  action: figma.boolean('action?', {
    true:  figma.nestedProps('action', ...)
    false: undefined
  }) */
},
example: (props) => <NotificationBanner
    icon={props.icon}
    title={props.title}
    description={props.description}
    action={{label: props.action.label, icon: props.action.icon, onClick:()=>{} }}
 />

+1

This is also a commonly used pattern in my company's design system

+1

+1

Hey all, thanks for the report and sorry that this report seemed to get missed by us. I'm going to discuss this with the team and see if we can find a solution! I will keep you updated.

+1

Could we somehow avoid the error that is thrown when the nested component is toggled off ?

+1

+💯  to this!
In our case, we have a boolean prop, where if true we want to expose some nested text... something like:
In our props:
description: figma.boolean('Description', {
  true: figma.nestedProps('<description_node_name>', {
    text: figma.textContent('<text_layer_name>')
}),
  false: undefined,
}

and then in the component:
<Component description={props.description} />

Hey all, thank you for your patience here. Just wanted to follow up and mention that this will be supported in the next release (1.0.8).
You will be able to use nestedProps in conjunction with boolean by providing a fallback value for the false case, like so:
action: figma.boolean('action?', {
  true:  figma.nestedProps('action', {
     label: figma.string('label'),
     icon: figma.instance('icon')
  })
  false: { label: undefined, icon: undefined }
}) */

We just released Code Connect v1.1.1 which should resolve this issue. Please feel free to reopen the issue or create a new one if you continue to have issues.


AC-IN Vals = AC-OUT Values

hi,
have the issue that the AC-In Vals equal AC-out when i use : servicename='com.victronenergy.grid.cgwacs_ttyUSB0_mb1
with servicename='com.victronenergy.grid' i can see the MQTT Meter in Dev-List but not as AC-In or AC-OUT.
any ideas?
thx

I think thats a VIctron Error. The Victron "sees" that you Import from Grid. And if you import you need to "use" it. Thats why he write it to the AC Load


New Rule - No duplicate destructured exports

It would be nice to have a rule that combines/simplifies a duplicated object export destructuring. Similar to no-duplicates.
This export style might be pretty rare but I think this rule would still be very useful.
Bad
export const { defaultColor } = module;
export const { transparentColor } = module;
export const { defaultD3Color } = module;

Good
export const { defaultColor, transparentColor, defaultD3Color } = module;

I'd say it's so rare that i've never once seen it; where does module come from in this case?

Haha, yeah I know it's rare. The module in my case would come from something like...
const module = jest.requireActual('../some_file.ts');`

Where I then want to export only certain functions or properties from that module.
Maybe this would be suitable for simplifying the destructuring itself with or without the export. In which case import is probably not the best plugin.

Is there a use case outside of jest mocking?

None that I can think of outside of complex index files that need to use then export things within a module. But again, it's rare. I'm just gonna close this and see about adding a no duplicate destructure rule elsewhere.


Update Readme docs periodically for developers and app users

Please update the Readme or related docs about development environment and usage of apps.
This is ongoing task which can be passed from milestone to milestone.
Currently update required versions for dependencies, etc.

Adding test command in Readme.


Allow users to override the default template's layout file

This addresses both my concerns and the author's in #6.
After reading these instructions from the jsdoc team and looking at https://github.com/jsdoc3/jsdoc/issues/480, I feel confident that this change is the way to go.

:+1: Pretty good, just a few changes based on a quick glance at the code.

The changes that you requested are done. Once you approve, I'll squash the commits to a single one so you can merge.

:+1:

Seems the build is failing with this comment. Can you check why?
There is also a dev-dependency issue failing unrelated to this comment:
$ gulp lint
[23:01:48] Using gulpfile ~/gulp-jsdoc3/gulpfile.js
[23:01:48] Starting 'lint'...
TypeError: Cannot read property 'visitClass' of undefined
at monkeypatch (/gulp-jsdoc3/node_modules/babel-eslint/index.js:220:40)
So without linting I can't test this, but I am pretty confident that you can move that added var down as a const. What is the error you see when you do?
:+1: for what you did for allowing a done callback only

"vars-on-top": 2 fromt he .eslintrc  is what triggered the error. args is no longer a const so I cannot move it down... Let me know... Good night.

Use 'let' instead of const - we still want block scoping. I should change all my vars to let also

Auf Wiedersehen vars.

:+1: this looks great. Really appreciate the iterations! Please squash and I'll merge. The release won't be for another 2 weeks due to travel conflicts.

Done. Thank you.

Thanks again!


Unable to write to external storage even though permission is granted

App cannot create Nekos folder anymore, when created manually app does not have permission to write to it even though read/write to external storage permission is granted.

This is specific to android 10 and later versions since storage security was update.
Fixed in commit 0731a8f508cce56d70466a7de5ea5cd6a32cecb5


AzMigrate-StartReplication.ps1 cannot find Availability Set if in different subscription than Azmigrate (Target sub)

The "AzMigrate-StartReplication.ps1" script was failing for me with the following error due to fact that the Availability Set I was trying to assign to some VMs I was initiating replication for was in a different subscription than the AzMigrate appliance/project - i.e. the TARGET sub that the VMs were to live:
20220308_141933[ERROR]-Get-AzAvailabilitySet : Resource group 'AS-RGNAME' could not be found.
ErrorCode: ResourceGroupNotFound
ErrorMessage: Resource group 'AS-RGNAME' could not be found.
ErrorTarget:
StatusCode: 404
ReasonPhrase: Not Found
OperationID : d15c666c-e04b-4742-ad45-58dc6e35d4f8
At C:\Users\PATH\Azure-Migrate\Agentless VMware automation\AzMigrate_StartReplication.ps1:232
char:26

...    $avSet = Get-AzAvailabilitySet -Name $availabilitysetName -Resourc ...

            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : CloseError: (:) [Get-AzAvailabilitySet], ComputeCloudException
FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.GetAzureAvailabilitySetCommand

20220308_141933[ERROR]-Exception processing item
20220308_141933[ERROR]-Exception calling "Invoke" with "3" argument(s): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop:
After some research into what was going wrong, it seems that if the Availability Set you want any group of VMs to be assigned to upon initiating replication is in a different sub (i.e. the TARGET SUB) than the AzMigrate Sub (i.e. - AZMIGRATEPROJECT_SUBSCRIPTION_ID) - the AzMigrate-Start-Replication.ps1 script does not change context to the target sub and hence fails as it cannot find the Resource Group that the AS lives in so that it can grab the AS's resource ID.
I added these two lines to the "# Get the Availability Set" section of this script so that it will switch context to the appropriate sub and then be able to grab the AS's resource ID and then it ran properly:
Set-AzContext -Subscription $targetSubscriptionID
Set-AzContext -Subscription $azMigProjSubscriptionID
        else {
            #Get the availability set
            **Set-AzContext -Subscription $targetSubscriptionID**
            $avSet = Get-AzAvailabilitySet -Name $availabilitysetName -ResourceGroupName $targetResourceGroup
            if (-not $avSet){
                $processor.Logger.LogTrace("AVAILABILITY Set could not be retrieved for: '$($sourceMachineName)'")
                $reportItem.AdditionalInformation = "AVAILABILITY Set could not be retrieved for: '$($sourceMachineName)'"
                return
            }
            else {
                $params.Add("TargetAvailabilitySet", $avSet.Id)
                **Set-AzContext -Subscription $azMigProjSubscriptionID**
            }
        }

This could probably use some more in depth error checking or logic built around it as this may not ALWAYS be the case and the AS could live in the same sub as the AzMigrate project/appliance does.  BUT, if the AS does NOT live in the same sub as the AzMigrate appliance/project - then this script will fail without it changing context to the proper Target sub to get the resource ID of the AS so it can assign the VMs to them upon initiating replication...

@mikefrobbins This is a bug in the underlying PowerShell module and not the script. The updated PowerShell module will be released by early August. In the meantime, please use Az.Migrate Powershell module 1.1.0 in the meantime and that should resolve the issue.

Closing this issue since there is no problem with the script per @rahug1190's comment.


executorService in "Send events" code snippet

executorService variable passed to creation of EventHubClient was not declared & initialized previously.
That should be something like
ExecutorService executorService = Executors.newCachedThreadPool()

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

ID: 61059dbc-d075-6af1-98f6-7fe02f9e0440
Version Independent ID: a15c8888-4b49-f9b8-3cee-30d5765c49fa
Content: Send events to Azure Event Hubs using Java
Content Source: articles/event-hubs/event-hubs-java-get-started-send.md
Service: event-hubs
GitHub Login: @ShubhaVijayasarathy
Microsoft Alias: shvija

@ayyagari Thanks for the feedback! We are currently investigating and will update you shortly.

@ShubhaVijayasarathy I notice the same thing in the example code, could you take a look?

This quick start has been updated recently. Please try and reopen the issue if you run into the problem again. Thanks.
#please-close


Add support for redirection from Company app on find page with productStore filter applied

What is the motivation for adding/enhancing this feature?

We want to redirect user to the facilities list page with the productStoreId filter applied when redirecting from the company app for a particular product store.
What are the acceptance criteria?

[ ] ...

Can you complete this feature request by yourself?

[ ] YES
[ ] NO

Additional information

Verified and working fine in release v1.8.0. Hence, closing it.


AlertView: change frame to all screen

Hi, one more thing,
is possible to set the frame alertView to all screen. UIScreen.main.bounds.height and width, in order to cover also navbar and tab bar?
i'm trying but i can't do it.
thank you

Honestly alert not ready for use in this case. I even not debug it.


Product dashboard without commits on environments after Build and Commit

Hi, I have a product view wich not shows any commit on environments after Build and Commit boxes.
This is the jenkins pipeline view, description of principal jobs and his hygieia publisher configuration:

And these are the team and product dashboards:

¿What I'm doing wrong?

@rsans  - Get the latest code base and do below steps

Do a commit to github
Run build and deploy jobs (DEV,TEST,STAGE,PROD) which has Hygieia plugin configured.
In you team dashboard, reconfigure deploy widget and pipeline widget with DEV,TEST,STAGE.
Add team dashboard to product dashboard.
Repeat steps 1 and 2 , refresh product dashboard.

Jenkins version ?

Jenkins version 2.32.1

@rsans  - Reopen if issue is not resolved


Indexer and migrator cherry picks to swift-4.0-branch

Cherry picking recent indexer and migrator patches from master to swift-4.0-branch

@swift-ci Please test and merge

@swift-ci please test linux


Updated README for removing CRDs generated by v1 api.

When I started working on this project I figured that a few steps were missing.  I have added them in the PR.

I don't quite understand why this is necessary, can you explain?

Currently prometheus-operator generates alertmanagers.monitoring.coreos.com, prometheuses.monitoring.coreos.com  and servicemonitors.monitoring.coreos.com  CRDs but Removal section on README is missing the instruction for removing them.
README is the first place to look for while getting started with any project. README should be correct and complete for any instruction that it mentions.


WPF: animation freezes (see Teapot sample) if mouse is moving over window

Not sure if SharpGL related, but this happens.
Any way to fix this?

I agree that the issue is the dispatchtimer as Librium said, but if I'm using this library from nuget, and not from this source, I don't have access to change the dispatch timer.
Is it possible instead to use System.Timers.Timer, and then use:              Application.Current.Dispatcher.BeginInvoke( this._dispatcherPriority, new Action(() => { put rendering action here }));
Then expose the _dispatcherPriority field via a public property of the usercontrol?

In case anyone has this issue still and doesnt want to rebuild the source, you can overwrite the private field using reflection
var prop = openGLControl.GetType().GetField("timer",
    System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
prop.SetValue(openGLControl, new DispatcherTimer(DispatcherPriority.Render));


pipeline transaction not working

I am running the following code (taken from the docs example:
from coredis import Redis, WatchError

redis = Redis(host='localhost', port=22720, db=0, decode_responses=True)

async def example():
    await redis.set('OUR-SEQUENCE-KEY', 0)
    async with await redis.pipeline() as pipe:
        while True:
            try:
                # put a WATCH on the key that holds our sequence value
                await pipe.watch('OUR-SEQUENCE-KEY')
                # after WATCHing, the pipeline is put into immediate execution
                # mode until we tell it to start buffering commands again.
                # this allows us to get the current value of our sequence
                current_value = await pipe.get('OUR-SEQUENCE-KEY')
                next_value = int(current_value or 0) + 1
                # now we can put the pipeline back into buffered mode with MULTI
                pipe.multi()
                pipe.set('OUR-SEQUENCE-KEY', next_value)
                # and finally, execute the pipeline (the set command)
                await pipe.execute()
                # if a WatchError wasn't raised during execution, everything
                # we just did happened atomically.
                break
            except WatchError:
                # another client must have changed 'OUR-SEQUENCE-KEY' between
                # the time we started WATCHing it and the pipeline's execution.
                # our best bet is to just retry.
                continue

    print(await redis.get('OUR-SEQUENCE-KEY'))

import asyncio

asyncio.run(example())

And I would expect to get 1 printed but I am not seeing any changes in the Redis DB

😓 there's a mistake in the examples...
it should be
await pipe.set('OUR-SEQUENCE-KEY', next_value)

thank you very much @alisaifee


CI fail test

[] I confirm this contribution is my own and I agree to license it with Apache 2.0.
[] I confirm the moderators may change the PR before merging it in.
Summary of changes

run-unit-tests


Added second BG + performance tweaks in TBGSubtraction

Added second background for TBGSubtraction
Ability to turn different background gates on and off
Added Update check box to BGSubtraction
This increases speed when not interested in performing gating-on-the-fly
Default is on-the-fly is off
Fitting, and writing is disabled when you are not updating the gates.
Allows faster window expansion, gate setting etc, especially with multiple backgrounds
This was implemented because I'm not sure it's possible to connect to histogram range expansion without also connection to the window being expanded.

Re last bullet point, TRootEmbeddedCanvas::GetCanvas()->Connect("RangeChanged()" ... should produce the desired result.

My current connection is
fProjectionCanvas->GetCanvas()->Connect("RangeAxisChanged()");

I'll give the other one a shot and see what happens. Thanks!

Yep, that worked... I'm going to change the default to auto updating now. Thanks again.

This solves issue #950 . None of these files interfere with other libraries. I've tested coincidences and peak areas, and they reproduce what was measured before this update. Merging.

Looks great! Thanks Ryan and James!

This solves issue #950 . None of these files interfere with other
libraries. I've tested coincidences and peak areas, and they reproduce
what was measured before this update. Merging.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/GRIFFINCollaboration/GRSISort/pull/952#issuecomment-341204331


h264 not support under headless mode

Steps to reproduce
Tell us about your environment:

Puppeteer version:1.2
Platform / OS version: mac 10.13.4
URLs (if applicable):
Node.js version: 8.11

What steps will reproduce the problem?
if I set headless to false,  when I use createOffer of webrtc. It works right with H264 in SDP. but when I set headless to true. there is no H264 in SDP anymore.
What is the expected result?
What happens instead?

Can you please share the sample code?

This is a known issue, you need to use Chrome and not Chromium for it to work.

@starcwl the repro would be very helpful. If it works in non-headless and breaks in headless, it could be that we don't build h264 into the headless.

It doesn't work in Chromium, it works in Chrome - independent of whether or not it's headless

Thanks @benjamingr, in this case it is indeed has been discussed quite a lot on the bugtracker.


boards: up_squared: add timeout multiplier

To accommodate for some slow tests.
For example: tests/arch/x86/info/arch.x86.info.userspace
Related issue: https://github.com/zephyrproject-rtos/zephyr/issues/80134

why does this behave differently on 3.7 branch?

why does this behave differently on 3.7 branch?

up2 behaves same as on main but on main it has set timeout_multiplier so we don't see failes
Execution time on main:

date
test suite name
test case name
tc status
tc execution   time

Oct,   12 2024
tests/arch/x86/info/arch.x86.info
arch.x86.info
passed
56.94

tests/arch/x86/info/arch.x86.info.userspace
arch.x86.info.userspace
passed
56.29

Oct,   23 2024
tests/arch/x86/info/arch.x86.info
arch.x86.info
passed
65.58

tests/arch/x86/info/arch.x86.info.userspace
arch.x86.info.userspace
passed
56.65

Oct,   22 2024
tests/arch/x86/info/arch.x86.info
arch.x86.info
passed
63.02

tests/arch/x86/info/arch.x86.info.userspace
arch.x86.info.userspace
passed
63.52

Oct, 21 2024
tests/arch/x86/info/arch.x86.info
arch.x86.info
passed
55.77

tests/arch/x86/info/arch.x86.info.userspace
arch.x86.info.userspace
passed
55.75

Oct, 20 2024
tests/arch/x86/info/arch.x86.info
arch.x86.info
passed
55.58

tests/arch/x86/info/arch.x86.info.userspace
arch.x86.info.userspace
passed
64.62

up2 behaves same as on main but on main it has set timeout_multiplier so we don't see failes
Execution time on main:

does it? looking at https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/up-bridge-the-gap/up_squared/up_squared.yaml it does not have a multiplier

@arikgreen you need to submit this to main, and label it for backporting by the bot.


chore(master): release 1.5.3

:robot: I have created a release beep boop
1.5.3 (2024-06-18)
Dependencies

deps: update codecov/codecov-action action to v4.5.0 (b202d7c)
deps: update dependency phpstan/phpstan to v1.11.5 (e58b071)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

v1.5.3
:sunflower:


[stable/bookstack] upgrade bookstack to 0.25.2

What this PR does / why we need it:

Updates app version of the bookstack chart.

Which issue this PR fixes
Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Variables are documented in the README.md

/ok-to-test

/lgtm
/approve


Support for initial entries

Fixes https://github.com/p4lang/p4runtime/issues/426

As of commit 2 of this PR, this is a first draft of a proposal for addressing issue https://github.com/p4lang/p4runtime/issues/426
There are still several embedded questions marked TODO at this point.  Please comment with suggested answers to those questions if you have any.

Jonathan DiLorenzo: Should we have tables with const entries have has_initial_entries AND is_const_table both true?
Andy: I will make this change in another commit on this PR and let people know it is ready for review.

I have updated this PR to follow the suggestion made during the 2023-Jul-14 API work group meeting, so that tables declared in source code with const entries continue to have is_const_table true as before, but they also have the new flag has_initial_entries true.
The new style of tables that the language spec now supports that can have entries without const before entries, will only have has_initial_entries true, but is_const_table will be false.

@smolkaj @jonathan-dilorenzo @chrispsommers I have made 7 commits to this PR since the 2023-Jul-14 API work group meeting, primarily due to comments made during the meeting, and from Steffen's careful review after the meeting, and I think it is the better for it.
I have no current plans to change it any more, until and unless there is additional review feedback that warrants additional changes.

This LGTM! There seem to be 3 remaining threads that would be nice to resolve, 2 of them being nits. Other than that, from my side this is ready to be merged.

LGTM modulo the remaining open comment in the appendix regarding the protobuf schema.

With commit 22 on this PR, I have attempted to clarify the description of the protobuf schema of an entries file.

Looks great to me.

@saynb @jamescchoi  This has been through careful review by several others already, so hopefully should also meet with your approval, but in case you want to take a look, this is something we are going to be asked to implement by some folks, so good to be aware of the details.

@smolkaj @chrispsommers Happy to discuss this at the next P4 API work group meeting on 2023-Aug-11, in hopes of seeing if it has the right approvals for merging.

We have 4 approvals, so I think we are good to go.
Let's wait until the meeting before we hit merge, just in case.


Support for unstructured libraries and batch processing in Pinecone

What does this PR do?
Additions

Allows to use unstructured libraries locally

Fixes

Batch processing errors in Pinecone

@ItzCrazyKns Thank you for this, can you please resolve the merge conflicts and I will merge it.

@ItzCrazyKns why did you close this?


Paraphrased generated texts aren't classifying as Machine-generated

I came across your project while doing my ongoing final year major project of detecting fake news. Well! I must appreciate the different unique approach of your project 💯 .  However, I tested your online lived webpage but seems that it isnt detecting correctly if the text is paraphrased. Also if some 'human' changes some words or sentences or for that matter even a paragraph in a Machine-generated text; how is the whole thing still being classified as Machine generated?
Would love to have insights on these for improving it :)

Hi,
Thanks for following our work. Yes, the text-level detection system can be vulnerable to attacks such as paraphrasing and local work modifications. One simple solution is to involve such training data (e.g., AI paraphrases) in the model training phase.
You can refer to this paper for other solutions:
Paraphrasing evades detectors of AI-generated text, but retrieval is an effective defense


Allow to deploy flow with development branch of jina to do manual testing

Hey team.
Atm we can't set a github branch as a valide jina version for jcloud.
I would like to be able to test a development branch on jcloud. Right now I can only precise a released (on pypi) version.
According the our slack discussion I believe that the VERSION validation should be slightly changed https://github.com/jina-ai/wolf/blob/8baa0badb743399646084efb37e4eb44ef3d5b00/wolf/commons/models/jcloud/init.py#L88-L98
and that the pip install jina[standard]==VERSION could be move in the case of a git version to something like this pip install jina+git:GIT_URL

Supported with Operator.


allow for custom screen resolution

We ran into resolution related problems while using this (otherwise excellent) image. Thought this might help others too.

Thanks a lot!

Pleasure!


Add unstyled login pattern

Merge away!

If we are going ahead with Empties…can this be closed?


2013 BMW 325D (F30)

Hi all,
Looking forward to get bimmer_connected working in Home Assistant, so I started reading some threads but I'm not able to get it working.
Bimmer_connected:
$ pip3 install --upgrade bimmer_connected
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: bimmer_connected in /usr/local/lib/python3.5/dist-packages (0.5.3)
Requirement already satisfied, skipping upgrade: typing<4,>=3 in /usr/local/lib/python3.5/dist-packages (from bimmer_connected) (3.6.6)
Requirement already satisfied, skipping upgrade: requests in ./.local/lib/python3.5/site-packages (from bimmer_connected) (2.19.1)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in ./.local/lib/python3.5/site-packages (from requests->bimmer_connected) (3.0.4)
Requirement already satisfied, skipping upgrade: idna<2.8,>=2.5 in ./.local/lib/python3.5/site-packages (from requests->bimmer_connected) (2.7)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in ./.local/lib/python3.5/site-packages (from requests->bimmer_connected) (2018.8.24)
Requirement already satisfied, skipping upgrade: urllib3<1.24,>=1.21.1 in ./.local/lib/python3.5/site-packages (from requests->bimmer_connected) (1.23)

Fingerprint:
$ sudo bimmerconnected fingerprint XXXXXXXXXXXXX XXXXXXXXXXXXX rest_of_world
DEBUG:bimmer_connected.account:Getting vehicle list
DEBUG:bimmer_connected.account:getting new oauth token
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): b2vapi.bmwgroup.com:443
DEBUG:urllib3.connectionpool:https://b2vapi.bmwgroup.com:443 "POST /gcdm/oauth/token HTTP/1.1" 200 None
DEBUG:bimmer_connected.account:got new token 5dFzGZZsgOMG365YN2ysaDzdsTWz7joq with expiration date 2018-10-17 10:29:42.923715
DEBUG:bimmer_connected.account:Old token is still valid. Not getting a new one.
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): b2vapi.bmwgroup.com:443
DEBUG:urllib3.connectionpool:https://b2vapi.bmwgroup.com:443 "GET /webapi/v1/user/vehicles HTTP/1.1" 200 None
DEBUG:bimmer_connected.state:requesting new data from connected drive
DEBUG:bimmer_connected.account:Old token is still valid. Not getting a new one.
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): b2vapi.bmwgroup.com:443
DEBUG:urllib3.connectionpool:https://b2vapi.bmwgroup.com:443 "GET /webapi/v1/user/vehicles/XXXXXXXXXXXXX/status?dlat=0.0&deviceTime=2018-10-17T09%3A29%3A44&dlon=0.0 HTTP/1.1" 200 None
DEBUG:bimmer_connected.state:received new data from connected drive
fingerprint of the vehicles written to /usr/local/bin/vehicle_fingerprint/2018-10-17_09-29-43

status_0.txt:
$ more status_0.txt
{
  "vehicleStatus": {
    "DCS_CCH_Activation": "NA",
    "DCS_CCH_Ongoing": false,
    "position": {
      "status": "TOO_FAR_AWAY"
    },
    "steering": "LH",
    "updateTime": "2018-10-17T09:08:48+0200",
    "vehicleCountry": "NL",
    "vin": "some_vin"
  }
}

vehicles_0.txt:
$ more vehicles_0.txt
{
  "vehicles": [
    {
      "a4a": "USB_ONLY",
      "bodytype": "F30",
      "brand": "BMW",
      "breakdownNumber": "+4989358957103",
      "carCloud": "NOT_SUPPORTED",
      "chargeNow": "NOT_SUPPORTED",
      "chargingControl": "NOT_SUPPORTED",
      "climateControl": "START_TIMER",
      "climateControlRES": "NOT_SUPPORTED",
      "climateFunction": "VENTILATION",
      "climateNow": "ACTIVATED",
      "climateNowRES": "NOT_SUPPORTED",
      "color": "BLACK SAPPHIRE METALLIC",
      "colorCode": "475",
      "countryCode": "V1-NL",
      "dealer": {
        "city": "XXXXXXXXXXXXXXX",
        "country": "NL",
        "name": "XXXXXXXXXXXXXXX",
        "phone": "XXXXXXXXXXXXXXX",
        "postalCode": "XXXXXXXXXXXXXXX",
        "street": "XXXXXXXXXXXXXXX"
      },
      "doorLock": "ACTIVATED",
      "doorUnlock": "ACTIVATED",
      "driveTrain": "CONV",
      "fuelType": "DIESEL",
      "hasAlarmSystem": false,
      "hmiVersion": "ID4",
      "hornBlow": "ACTIVATED",
      "hub": "HUB_ECE",
      "intermodalRouting": "NOT_AVAILABLE",
      "ipa": "NOT_SUPPORTED",
      "lastDestinations": "NOT_SUPPORTED",
      "lightFlash": "ACTIVATED",
      "lscType": "NOT_SUPPORTED",
      "model": "325d",
      "onlineSearchMode": "MAP",
      "onlineSearchProvider": "GOOGLE",
      "rangeMap": "NOT_SUPPORTED",
      "remote360": "NOT_SUPPORTED",
      "remoteSoftwareUpgrade": "NOT_SUPPORTED",
      "sendPoi": "ACTIVATED",
      "smartSolution": "NOT_SUPPORTED",
      "statisticsAvailable": false,
      "statisticsCommunityEnabled": false,
      "steering": "LH",
      "vehicleFinder": "ACTIVATED",
      "vin": "some_vin",
      "yearOfConstruction": 2013
    }
  ]
}

Note:

the car is in front of my house, aprox 50 meters away from the RPi.
I'm able to get my cars location with the Android BMW Connected app.
when I check bimmer_connected with 'status' instead of 'fingerprint' parameter, I see other information (like VIN):

$ sudo bimmerconnected status XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX rest_of_world
DEBUG:bimmer_connected.account:Getting vehicle list
DEBUG:bimmer_connected.account:getting new oauth token
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): b2vapi.bmwgroup.com:443
DEBUG:urllib3.connectionpool:https://b2vapi.bmwgroup.com:443 "POST /gcdm/oauth/token HTTP/1.1" 200 None
DEBUG:bimmer_connected.account:got new token WqfjSXprWElyQE0Ut14633rLsdnLHB4n with expiration date 2018-10-17 10:41:27.252552
DEBUG:bimmer_connected.account:Old token is still valid. Not getting a new one.
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): b2vapi.bmwgroup.com:443
DEBUG:urllib3.connectionpool:https://b2vapi.bmwgroup.com:443 "GET /webapi/v1/user/vehicles HTTP/1.1" 200 None
DEBUG:bimmer_connected.state:requesting new data from connected drive
DEBUG:bimmer_connected.account:Old token is still valid. Not getting a new one.
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): b2vapi.bmwgroup.com:443
DEBUG:urllib3.connectionpool:https://b2vapi.bmwgroup.com:443 "GET /webapi/v1/user/vehicles/XXXXXXXXXXXXXXX/status?dlat=0.0&dlon=0.0&deviceTime=2018-10-17T09%3A41%3A27 HTTP/1.1" 200 None
DEBUG:bimmer_connected.state:received new data from connected drive
Found 1 vehicles: 325d
VIN: XXXXXXXXXXXXXXX
DEBUG:bimmer_connected.state:No data available for attribute <function VehicleState.mileage at 0x75e06d20>!
mileage: None
vehicle properties:
{
    "countryCode": "V1-NL",
    "model": "325d",
    "fuelType": "DIESEL",
    "rangeMap": "NOT_SUPPORTED",
    "bodytype": "F30",
    "climateNow": "ACTIVATED",
    "colorCode": "475",
    "a4a": "USB_ONLY",
    "doorUnlock": "ACTIVATED",
    "yearOfConstruction": 2013,
    "vehicleFinder": "ACTIVATED",
    "color": "BLACK SAPPHIRE METALLIC",
    "steering": "LH",
    "carCloud": "NOT_SUPPORTED",
    "vin": "XXXXXXXXXXXXXXX",
    "sendPoi": "ACTIVATED",
    "onlineSearchProvider": "GOOGLE",
    "breakdownNumber": "+4989358957103",
    "climateControlRES": "NOT_SUPPORTED",
    "onlineSearchMode": "MAP",
    "chargeNow": "NOT_SUPPORTED",
    "chargingControl": "NOT_SUPPORTED",
    "smartSolution": "NOT_SUPPORTED",
    "climateFunction": "VENTILATION",
    "intermodalRouting": "NOT_AVAILABLE",
    "dealer": {
        "city": "XXXXXXXXXXXXXXX",
        "phone": "XXXXXXXXXXXXXXX",
        "postalCode": "XXXXXXXXXXXXXXX",
        "street": "XXXXXXXXXXXXXXX",
        "name": "XXXXXXXXXXXXXXX",
        "country": "XXXXXXXXXXXXXXX"
    },
    "statisticsAvailable": false,
    "brand": "BMW",
    "driveTrain": "CONV",
    "lscType": "NOT_SUPPORTED",
    "statisticsCommunityEnabled": false,
    "remoteSoftwareUpgrade": "NOT_SUPPORTED",
    "hasAlarmSystem": false,
    "lastDestinations": "NOT_SUPPORTED",
    "ipa": "NOT_SUPPORTED",
    "hub": "HUB_ECE",
    "doorLock": "ACTIVATED",
    "hmiVersion": "ID4",
    "remote360": "NOT_SUPPORTED",
    "climateControl": "START_TIMER",
    "climateNowRES": "NOT_SUPPORTED",
    "lightFlash": "ACTIVATED",
    "hornBlow": "ACTIVATED"
}
vehicle status:
{
    "steering": "LH",
    "updateTime": "2018-10-17T09:08:48+0200",
    "vin": "XXXXXXXXXXXXXXX",
    "DCS_CCH_Activation": "NA",
    "position": {
        "status": "TOO_FAR_AWAY"
    },
    "vehicleCountry": "NL",
    "DCS_CCH_Ongoing": false
}

In Home Assistant (0.80.1) I have the following configuration.
configuration.yaml (stripped:)
bmw_connected_drive:
  name:
    username: !secret bmw_username
    password: !secret bmw_password
    region: "rest_of_world"

home_assistant.log:
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.setup] Setup of domain bmw_connected_drive took 4.2 seconds.
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.loader] Loaded sensor.bmw_connected_drive from homeassistant.components.sensor.bmw_connected_drive
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.loader] Loaded binary_sensor.bmw_connected_drive from homeassistant.components.binary_sensor.bmw_connected_d
rive
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.setup] Setting up lock
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.setup] Setup of domain lock took 0.0 seconds.
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.bmw_connected_drive
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.bmw_connected_drive
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.loader] Loaded lock.bmw_connected_drive from homeassistant.components.lock.bmw_connected_drive
2018-10-17 08:46:25 INFO (MainThread) [homeassistant.components.lock] Setting up lock.bmw_connected_drive
2018-10-17 08:46:25 ERROR (MainThread) [homeassistant.components.binary_sensor] bmw_connected_drive: Error on device update!
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 251, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_job(self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/bmw_connected_drive.py", line 166, in update
    self._state = vehicle_state.has_check_control_messages
  File "/srv/homeassistant/lib/python3.5/site-packages/bimmer_connected/state.py", line 71, in _func_wrapper
    return func(self, *args, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/bimmer_connected/state.py", line 326, in has_check_control_messages
    return len(self.check_control_messages) > 0
TypeError: object of type 'NoneType' has no len()
2018-10-17 08:46:25 ERROR (MainThread) [homeassistant.components.binary_sensor] bmw_connected_drive: Error on device update!
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 251, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_job(self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/bmw_connected_drive.py", line 164, in update
    self._state = not vehicle_state.are_all_cbs_ok
  File "/srv/homeassistant/lib/python3.5/site-packages/bimmer_connected/state.py", line 231, in are_all_cbs_ok
    for cbs in self.condition_based_services:
TypeError: 'NoneType' object is not iterable
2018-10-17 08:46:25 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 354, in _async_add_entity
    await entity.async_update_ha_state()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 240, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/lock/bmw_connected_drive.py", line 69, in device_state_attributes
    'door_lock_state': vehicle_state.door_lock_state.value
AttributeError: 'NoneType' object has no attribute 'value'
2018-10-17 08:46:25 INFO (Thread-5) [homeassistant.components.device_tracker.nmap_tracker] nmap scan successful
2018-10-17 08:46:25 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 354, in _async_add_entity
    await entity.async_update_ha_state()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 240, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/bmw_connected_drive.py", line 114, in device_state_attributes
    result['door_lock_state'] = vehicle_state.door_lock_state.value
AttributeError: 'NoneType' object has no attribute 'value'
2018-10-17 08:46:25 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 354, in _async_add_entity
    await entity.async_update_ha_state()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 240, in async_update_ha_state
    device_attr = self.device_state_attributes
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/bmw_connected_drive.py", line 117, in device_state_attributes
    result['lights_parking'] = vehicle_state.parking_lights.value
AttributeError: 'NoneType' object has no attribute 'value'
2018-10-17 08:46:44 INFO (MainThread) [homeassistant.setup] Setup of domain device_tracker took 22.4 seconds.
2018-10-17 08:46:44 INFO (MainThread) [homeassistant.loader] Loaded device_tracker.bmw_connected_drive from homeassistant.components.device_tracker.bmw_connected
_drive
2018-10-17 08:46:44 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.bmw_connected_drive
2018-10-17 08:46:44 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 27.10s

Is anyone able to guide me further through the process to get this working?
If you need any more information, please let me know.

See https://community.home-assistant.io/t/bmw-connecteddrive-component/39569/310.

See also #96.

@plaksnor Your vehicle 🚘 just does not send much useful data to the server (see your Status.txt), so there is not much to show in Home Assistant. I'm sorry, but there is not much that we can do here 😭


Mark macOS Monterey as supported

[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same change?
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[ ] Have you written new tests for your changes? Here's an example.
[ ] Have you successfully run brew style with your changes locally?
[ ] Have you successfully run brew typecheck with your changes locally?
[ ] Have you successfully run brew tests with your changes locally?

Not sure of the best time to merge this. We should have Portable Ruby 2.6.8 built first (we hopefully will be able to do this tomorrow) and have some basic level of bottle coverage. But also ideally tagged before Monterey final is released to the public on Monday.

Review period skipped due to critical label.


Timeseries can be tricked by a couple bad first inputs

If you have one or two wildly off datum points for timeseries.detectEquilibration from the start of the timeseries, then the true equilibration time is woefully underpredicted. @jchodera requested I post sample data and script to process and regenerate the plot and output from below.
The output below is from Top plot is the full timeseries with bars showing where "Equilibration" stops, bottom is the same set from the 2nd sample onwards (series[1:]). Below the image is the code used to create. The dataset is in the attached zip file. @jchodera  If you only want the series to look at, you only need the imports and the first three lines of the code below.
Full Trajectory               -- Equilibration 0,  Subsample Rate 1.75, Num Effective 1710
Trajectory w/o initial sample -- Equilibration 20, Subsample Rate 3.75, Num Effective 794

import numpy as np
import matplotlib.pyplot as plt
from pymbar import timeseries

y = np.load('explicit0_timeseries.npy')
[n_equilibration, g_t, n_effective_max] = timeseries.detectEquilibration(y)
[n_short, g_t_short, n_eff_max_short] = timeseries.detectEquilibration(y[1:])

print("Full Trajectory -- Equilibration {0:d}, Subsample Rate {1:3.2f}, Num Effective {2:d}".format(
    n_equilibration, g_t, int(np.floor(n_effective_max))
))
print("Trajectory w/o initial sample -- Equilibration {0:d}, Subsample Rate {1:3.2f}, Num Effective {2:d}".format(
    n_short, g_t_short, int(np.floor(n_eff_max_short))
))

f, (a,b) = plt.subplots(2, 1)
x = np.arange(y.size)
a.plot(x, y, 'k-', label='Timeseries')
b.plot(x[1:], y[1:], '-k')
for p in [a, b]:
    ylim = p.get_ylim()
    xlim = p.get_xlim()
    p.set_xlabel('Iteration')
    p.set_ylabel(r'$\sum_k u_{k,k,n}$')
    p.vlines(n_equilibration, *ylim,
             colors='b', linewidth=1,
             label='Full Timeseries: Num Samples={}'.format(int(np.floor(n_effective_max))))
    p.vlines(n_short, *ylim,
             colors='r', linewidth=1,
             label='Timeseries[1:]: Num Samples={}'.format(int(np.floor(n_eff_max_short))))
    p.set_ylim(ylim)
    p.set_xlim(xlim)
a.legend()
f.savefig('bad_series.png', bbox_inches='tight')

explicit0_timeseries.npy.zip

Interested in the resolution of this issue as it is affecting me too. I can provide another example if that would be helpful!

Please do! The more, the better!

Okay, attached are a test script and data.  This timeseries is from a simulation with data recorded every 500 steps, hence the length.  Even though the first couple values of are much lower than the rest, detectEquilibration still decides that first index in the equilibrium region is 0.
from pymbar import timeseries
import numpy as np
import matplotlib.pyplot as plt

data_om=np.load('energy_timeseries_om.npy')
#Simulation step numbers and data recorded every 500 steps
stepnumber=data_om[0,:]
energy_timeseries=data_om[1,:]
[t_equil,g,N_eff]=timeseries.detectEquilibration(energy_timeseries)
print("Equilibrated (according to function) at index %i" % t_equil)
plt.plot(stepnumber,energy_timeseries)
plt.title("Timeseries value vs. Step Number")

energy_timeseries_om.zip

Thanks! This is super helpful @ocmadin!

Seems like this is also a duplicate of #277

@jchodera just wanted to bring this up again, as I have been getting outliers in heat capacity calculations from fluctuations, and this turned out to be the culprit.  I have a temporary caveman solution, but would be interested in a more permanent (and elegant) solution.

Can you post a sample data set that is causing problems?

Okay, so here is a comparison of two datasets, one where timeseries.detectEquilibration works and one where it fails:
These are both 9 ns simulations of 200 cyclohexane molecules at 293.15 K and 1.01 bar.
In the first (cychex_timeseries_good_equil.npy), detectEquilibration works properly,

While in the second (cychex_timeseries_bad_equil.npy) , it does not:

Interestingly, these two timeseries start at roughly equal volumes (0.02302 for good vs 0.02304 for bad), but within the first 10 timesteps, the "bad" timeseries hits a max value of 0.02341, where the "good" timeseries only hits a max value of 0.02322:

It seems like this little spike is the difference between detectEquilibration working properly and failing.
cychex_timeseries_data.zip

I've had a look at these with some of the equilibration heuristics we tested here. Specifically:

original_pymbar: equivalent to the standard PyMBAR detect_equilibration with fast=False.
pymbar_min_sse: uses the same method as original_pymbar to account for autocorrelation, but selects the equilibration time as the minimum of the marginal standard error (squared standard error (SSE)), rather than the maximum effective sample size.
window_root_n: also determines equilibration according to the minimum marginal standard error, but accounts for autocorrelation using a window of size $\sqrt N$, where $N$ is the number of samples remaining for the truncation time being evaluated. This method seemed to be the most robust of those we tested.
mser: the original marginal standard error rule of White. This is equivalent to window_root_n with a window size of 1/ calculating the standard error completely ignoring autocorrelation.

Naden Issue
As discussed in this issue, selecting the truncation point by minimum marginal standard error, rather than maximum effective sample size increases sensitivity to initial bias and means that all methods other than original_pymbar remove the highly biased samples (truncation indices are shown in the legend):

pymbar_min_sse throws away a few more than might seem reasonable, but this is still a small fraction of the data:

Madin First Issue
Here, both the original_pymbar and pymbar_min_sse methods fail to discard the highly biased samples, while the other methods produce reasonable results:

Here, the window_root_n method throws away a few more samples than looks reasonable, but again this is a small fraction of the overall data:

To understand why using the minimum marginal standard error (or SSE - squared standard error) in the pymbar_min_sse method didn't fix the issue, I've plotted the the ESS or 1/SSE for the first few indices for all methods (normalising so that the first value is 1):

The ESS (with original PyMBAR autocorrelation treatment) shows a large spike at index 0. ESS is given by ESS = n_actual * Var_uncor / Var_cor, where "n_actual" is the actual number of samples, and "uncor" and "cor" denote the uncorrelated and correlated variance estimates. Plotting these two variance estimates (normalised so that the first term is 1) shows that the first few very biased samples dramatically increase Var_uncor, but decrease Var_cor (by shifting the mean closer to a more central value for the later data):

Therefore, using 1/SSE = n_actual / Var_cor dramatically reduces the initial spike (pymbar_min_sse). However, it doesn't totally fix the initial spike, because the first correlated variance estimate is still low. As we go to methods which less thoroughly account for autocorrelation ( pymbar_min_sse -> window_root_n -> mser), we go from using 1/SSE = n_actual / Var_cor  to 1/SSE = n_actual / Var_uncor, which gradually removes the initial spike in 1/SSE, moving the equilibration time later.
Madin Second Issue (Bad Cyclohexane Series)
Here, I find that original_pymbar selects a truncation index of 2, rather than 0 as in the issue. I've checked with detectEquilibration(fast=False) from PyMBAR version 3.1.1 and also get 2. Here, the first ~ 10 points are particularly biased, and all of the methods other than original_pymbar discard these:

Summary

Selecting the truncation point by minimum marginal standard error, rather than maximum effective sample size increases sensitivity to the initial transient.
The window_root_n and  mser methods seem to consistently remove the problematic samples. However, we'd generally recommend against MSER since it's prone to under-discarding when a trend in the average is hidden by noise (see here).

Code
All code and output: pymbar_equil_issues.tar.gz (you'll need to install red with mamba install -c conda-forge red-molsim).
Thanks!


Is it possible to obtain the precise coordinates of the selected text in a PDF document through the plugin?

I am learning how to develop a zotero plugin.
Specifically, the purpose is to retrieve the coordinates of the selected text in relation to the PDF page, and subsequently display relevant hints proximal to the text. However, such an outcome has yet to be achieved.
I have attempted to obtain the 'selection', then get the range by selection.getRangeAt(0). Unfortunately, this approach has been hindered by the persistent outcome whereby Selection.isCollapsed is always set to true.
Consequently, coordinates for the selected text are consistently registering as 0.
Several methods have been employed in an attempt to obtain the 'selection', including:

readerinstance._iframeWindow?.getSelection()
readerinstance._iframeWindow?.document.getSelection()
window.getSelection() which listens to the selectionchange event.

These efforts have proved futile. As such, I am seeking further guidance or recommendations to resolve this issue.
Thank you in advance for your enthusiasm~

Thanks to your help, I have made some progress, but still close to success.
I just used the following code, and successfully got the text message
let reader = Zotero.Reader._readers[0];
let selection = reader._iframeWindow.getSelection();
reader._iframeWindow.wrappedJSObject
.selectionBox.addEventListener('select', (e) => {
    Zotero.log("text: "+e.target.value)
    rect = e.target.getBoundingClientRect()
    Zotero.log("target, getBoundingClientRect:"+rect.left+", "+ rect.top+", "+ rect.right+", "+ rect.bottom);
})

Unfortunately, the output of the coordinates is constant

[JavaScript Warning: "target, getBoundingClientRect:-10, -10, -6, -6"]

Do you have any ideas about what I did wrong?

I tried using the following code, which does get the coordinates.
let reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID);
let menu = reader._iframeWindow.document.querySelector('#selection-menu');
menu.getBoundingClientRect()

But it gets the coordinates relative to the upper left corner of the screen, not the current document.
If you have any good notes, please help me


Return number of inserted statement when update

When executing an update operation (e.g.: insert) it would be nice to return the number of inserted statements (to make sure it worked)

Not possible Update.execute()  returns void. We would need to do a query to get this